:root {
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --blue-deep: #1d4ed8;
  --bg-0: #0b1120;
  --bg-1: #101a30;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Noto Sans JP", sans-serif;
  background: linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 55%, #0d1b2e 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 600px 400px at 85% 10%, rgba(59, 130, 246, 0.14), transparent 70%),
    radial-gradient(ellipse 500px 500px at 10% 90%, rgba(29, 78, 216, 0.12), transparent 70%);
}

main { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- header ---------- */
.site-header { text-align: center; padding: 56px 16px 28px; position: relative; }

.lang-switch {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
  backdrop-filter: blur(6px);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
}
.lang-btn.active { background: var(--blue); color: #fff; font-weight: 700; }

.logo {
  font-size: clamp(40px, 9vw, 60px);
  font-weight: 900;
  letter-spacing: 0.04em;
}
.logo-choko { color: #fff; }
.logo-fit { color: var(--blue-light); }

.tagline { color: var(--text-sub); font-size: clamp(13px, 3.4vw, 16px); margin-top: 6px; }

/* ---------- form ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  backdrop-filter: blur(8px);
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--text-sub); margin-bottom: 7px; font-weight: 500; }

select {
  width: 100%;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.form-error { color: #f87171; font-size: 14px; text-align: center; margin-bottom: 12px; }

.btn-generate {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5); }
.btn-generate:active { transform: translateY(0); }
.btn-generate.loading { opacity: 0.7; pointer-events: none; }

/* ---------- result ---------- */
.result { margin-top: 26px; }

.menu-head {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.menu-head h2 { font-size: 19px; margin-bottom: 8px; }
.menu-head ul { list-style: none; font-size: 14px; color: var(--text-sub); }
.menu-head li { display: inline-block; margin-right: 14px; }

.ex-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  animation: fadein 0.5s ease both;
}
.ex-card:nth-child(2) { animation-delay: 0.08s; }
.ex-card:nth-child(3) { animation-delay: 0.16s; }
.ex-card:nth-child(4) { animation-delay: 0.24s; }
.ex-card:nth-child(5) { animation-delay: 0.32s; }
.ex-card:nth-child(6) { animation-delay: 0.4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ex-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.ex-target {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--blue-light);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 12px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: 2px;
}

.ex-body { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.ex-anim {
  flex: 0 0 180px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 4px;
}
.ex-anim svg { display: block; width: 100%; height: auto; }
.ex-info { flex: 1; min-width: 220px; }

.ex-label { font-size: 13px; font-weight: 700; color: var(--blue-light); margin: 8px 0 3px; }
.ex-info ol { padding-left: 20px; font-size: 14px; color: var(--text-sub); }
.ex-info ol li { margin-bottom: 3px; }
.ex-breath { font-size: 13px; color: var(--text-muted); }

.ex-yt {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 14px;
  transition: border-color 0.15s, color 0.15s;
}
.ex-yt:hover { border-color: var(--blue); color: var(--blue-light); }
.ex-yt .yt-icon { color: #ef4444; margin-right: 5px; }

.advice-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(29, 78, 216, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  font-size: 14px;
}
.advice-card strong { display: block; margin-bottom: 4px; }

.btn-done {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s;
}
.btn-done:hover { transform: translateY(-2px); }
.btn-done:disabled { background: #475569; box-shadow: none; cursor: default; transform: none; }

/* ---------- calendar ---------- */
.calendar-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 26px;
  backdrop-filter: blur(8px);
}
.cal-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.cal-head h2 { font-size: 17px; }
.cal-nav {
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-sub);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.cal-nav:hover { border-color: var(--blue); color: var(--blue-light); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 11px; color: var(--text-muted); padding: 4px 0; }
.cal-dow.sun { color: #f87171; }
.cal-dow.sat { color: var(--blue-light); }
.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-sub);
  border-radius: 8px;
}
.cal-day.done { background: rgba(59, 130, 246, 0.16); border: 1px solid rgba(59, 130, 246, 0.4); }
.cal-day.today { outline: 2px solid var(--gold); }
.cal-day .mark { font-size: 11px; line-height: 1; }

.cal-level { text-align: center; font-size: 15px; font-weight: 700; margin-top: 14px; }
.cal-legend { list-style: none; text-align: center; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }

/* ---------- pro ---------- */
.pro-card {
  text-align: center;
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.btn-pro {
  display: inline-block;
  padding: 13px 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #1c1200;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
  transition: transform 0.15s;
}
.btn-pro:hover { transform: translateY(-2px); }
.pro-note { font-size: 13px; color: var(--text-sub); margin-top: 14px; font-weight: 700; }
.pro-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 30px 16px 40px; color: var(--text-muted); font-size: 12px; }

@media (max-width: 480px) {
  .ex-body { flex-direction: column; }
  .ex-anim { flex-basis: auto; width: 100%; max-width: 240px; margin: 0 auto; }
}

/* ---------- mode tabs ---------- */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.mode-tab {
  flex: 1;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* ---------- pro wizard ---------- */
.pro-lead { font-size: 14px; color: var(--text-sub); margin-bottom: 16px; }

.pro-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.pro-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 999px;
  transition: width 0.3s;
}
.pro-progress-label { font-size: 12px; color: var(--text-muted); margin: 6px 0 14px; text-align: right; }
.pro-question { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.pro-options { display: flex; flex-direction: column; gap: 8px; }
.pro-opt {
  text-align: left;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.pro-opt:hover { border-color: var(--blue); background: rgba(59, 130, 246, 0.12); }
.pro-opt.selected { border-color: var(--blue); background: rgba(59, 130, 246, 0.22); font-weight: 700; }

.pro-nav { margin-top: 12px; }
.pro-nav-btn {
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  cursor: pointer;
}
.pro-nav-btn:hover { border-color: var(--blue); color: var(--blue-light); }
#pro-generate { margin-top: 16px; background: linear-gradient(135deg, var(--gold), #d97706); box-shadow: 0 4px 18px rgba(251, 191, 36, 0.35); }

.pro-gate { text-align: center; }
.pro-gate p { font-size: 14px; color: var(--text-sub); margin-bottom: 14px; }
.pro-gate input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ---------- pro result ---------- */
.pro-summary { font-size: 14px; color: var(--text-sub); margin-top: 6px; }
.pro-safety {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-sub);
}
.pro-safety strong { display: block; margin-bottom: 6px; color: #fca5a5; }
.pro-safety ul { padding-left: 18px; }

.pro-day {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.pro-day.rest { opacity: 0.75; }
.pro-dow {
  display: inline-block;
  min-width: 42px;
  text-align: center;
  font-weight: 900;
  font-size: 15px;
  color: var(--blue-light);
  background: rgba(59, 130, 246, 0.14);
  border-radius: 8px;
  padding: 3px 8px;
  margin-right: 10px;
}
.pro-day-title { font-size: 14px; font-weight: 700; }

.pro-ex {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}
.pro-ex summary {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.pro-ex summary::before { content: "▸ "; color: var(--blue-light); }
.pro-ex[open] summary::before { content: "▾ "; }
.pro-ex summary::-webkit-details-marker { display: none; }
.pro-ex .ex-body { padding: 0 14px 14px; }

/* ---------- chat ---------- */
.chat-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transition: transform 0.15s;
  z-index: 50;
}
.chat-fab:hover { transform: scale(1.1); }

.chat-window {
  position: fixed;
  bottom: 88px;
  right: 22px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #101a30;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 51;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  min-height: 200px;
  max-height: 320px;
}
.chat-msg { display: flex; margin-bottom: 10px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-line;
  word-break: break-word;
}
.chat-msg.user .chat-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: rgba(255, 255, 255, 0.09); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble a { color: var(--blue-light); word-break: break-all; }
.chat-bubble.typing { color: var(--text-muted); letter-spacing: 2px; }

.chat-line-link {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: #86efac;
  text-decoration: none;
  padding: 8px;
  background: rgba(34, 197, 94, 0.1);
  border-top: 1px solid var(--card-border);
}
.chat-line-link:hover { background: rgba(34, 197, 94, 0.2); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--card-border);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}
.chat-send {
  border: none;
  background: var(--blue);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  cursor: pointer;
}
