/* ===== らぶスタAI＋ 本体UI =====
   本番アプリ（lovestar-app）の DESIGN_SYSTEM.md に合わせたトークン。
   色・角丸・書体を本番と揃えることで、デモが「別のツール」に見えないようにする。
   本番の値を変えたときは、ここも合わせること。 */

:root {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --sans: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;

  /* Lavender — ベース */
  --lv-50:  #f9f8fc;
  --lv-100: #f3eefb;
  --lv-200: #e8dbf6;
  --lv-300: #d6bdf0;
  --lv-400: #c49fe9;
  --lv-500: #ad7ee0;
  --lv-600: #955ed6;
  --lv-700: #7d42c8;

  /* Beige — 温かみ */
  --bg-100: #fdf6f0;
  --bg-200: #faede6;
  --bg-300: #f5ddce;
  --bg-500: #e8b8a3;
  --bg-700: #c08a74;

  /* Plum — テキスト・強調 */
  --pl-300: #d9a7b8;
  --pl-500: #b36b85;
  --pl-700: #9e4a67;
  --pl-900: #853d54;

  --gold: #d4af37;
  --grad: linear-gradient(to right, #ad7ee0, #b36b85);

  --shadow-soft: 0 4px 20px rgba(133, 61, 84, .06);
  --shadow-card: 0 8px 32px rgba(133, 61, 84, .10);
}

* { box-sizing: border-box; }

body.lovesta {
  margin: 0;
  min-height: 100dvh;
  background-image: url("/images/lavandula.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--pl-900);
  font-family: var(--sans);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.lovesta h1, .lovesta h2, .lovesta h3 {
  font-family: var(--serif);
  color: var(--pl-700);
  font-weight: 700;
  letter-spacing: .04em;
}

.page { max-width: 860px; margin: 0 auto; padding: 28px 18px 64px; }

/* ── ヘッダー ── */
.brand { text-align: center; padding: 12px 0 28px; position: relative; }
.brand .logo {
  font-family: var(--serif);
  font-size: 30px; font-weight: 700; letter-spacing: .12em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.brand .logo img {
  display: block; width: 220px; max-width: 64vw; height: auto; margin: 0 auto;
  filter: drop-shadow(0 4px 10px rgba(133, 61, 84, .12));
}
.brand .tag { font-size: 13px; color: var(--pl-500); letter-spacing: .08em; margin-top: 6px; }
.brand .out {
  position: absolute; top: 8px; right: 0;
  background: none; border: none; cursor: pointer;
  color: var(--pl-500); font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.brand .out:hover { background: var(--lv-100); color: var(--pl-900); }

/* ── カード ── */
.card {
  background: rgba(253, 246, 240, .95);
  border: 2px solid rgba(250, 237, 230, .9);
  border-radius: 2.5rem;
  padding: 30px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

/* ページ間で共通の小さなブランドヘッダー。設計図の演出を邪魔せず、
   本体マイページと同じサービスであることを伝える。 */
.compact-brand {
  display: flex; justify-content: center; padding: 18px 18px 0;
}
.compact-brand img {
  display: block; width: 172px; max-width: 48vw; height: auto;
  filter: drop-shadow(0 3px 8px rgba(133, 61, 84, .12));
}

:where(.lovesta button, .lovesta input, .lovesta textarea):focus-visible {
  outline: 3px solid rgba(173, 126, 224, .28);
  outline-offset: 3px;
}
.card.lav {
  background: rgba(243, 238, 251, .95);
  border-color: rgba(232, 219, 246, .9);
}
.card h2 {
  font-size: 20px; margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.card h2::before {
  content: ""; width: 7px; height: 28px; border-radius: 999px;
  background: var(--pl-500); flex-shrink: 0;
}
.card.lav h2::before { background: var(--lv-500); }

@media (max-width: 480px) {
  .page { padding: 20px 14px 56px; }
  .card { padding: 24px 18px; border-radius: 2rem; }
  .brand .logo { font-size: 25px; }
  /* 幅が足りずロゴとログアウトが重なるので、ボタンを上に逃がす */
  .brand { padding-top: 34px; }
  .brand .out { top: -6px; }
}

/* ── ルートカード ── */
.route-card .no {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; letter-spacing: .2em; color: var(--gold);
  border: 1px solid var(--bg-300); border-radius: 999px; padding: 3px 14px;
}
.route-card .rname {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 23px; font-weight: 700; color: var(--pl-700);
  line-height: 1.6; margin: 12px 0 4px;
  word-break: keep-all; overflow-wrap: break-word;
}
.route-card .pct {
  font-size: 13px; color: var(--pl-500);
}
.route-card .pct b {
  font-size: 22px; color: var(--pl-700); font-variant-numeric: tabular-nums;
  vertical-align: -1px; margin: 0 2px;
}

/* ── 進捗 ── */
.prog { margin-top: 22px; }
.prog .bar {
  height: 9px; border-radius: 999px; background: var(--lv-200); overflow: hidden;
}
.prog .bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(to right, var(--gold), var(--pl-500));
}
.prog .cap {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--pl-500); margin-bottom: 8px;
}
.prog .cap b { font-size: 15px; color: var(--pl-700); }

.steps-mini { margin-top: 20px; }
.steps-mini .s {
  display: flex; gap: 14px; padding: 11px 0;
  border-bottom: 1px dashed var(--bg-200); font-size: 14px;
}
.steps-mini .s:last-child { border-bottom: none; }
.steps-mini .s .n {
  width: 24px; height: 24px; line-height: 24px; text-align: center; flex-shrink: 0;
  border-radius: 50%; background: var(--lv-200); color: var(--pl-500); font-size: 12px;
}
.steps-mini .s.here .n { background: var(--pl-500); color: #fff; }
.steps-mini .s.here { color: var(--pl-900); font-weight: 700; }
.steps-mini .s.dim { color: var(--pl-500); opacity: .72; }

/* ── ボタン ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--grad); color: #fff; border: none; cursor: pointer;
  padding: 15px 30px; border-radius: 999px; font-size: 15px; font-weight: 700;
  letter-spacing: .06em; box-shadow: var(--shadow-soft);
  font-family: inherit; transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.btn.block { width: 100%; }
.btn.quiet {
  background: #fff; color: var(--pl-700); border: 1px solid var(--bg-200);
  box-shadow: none;
}
.btn.quiet:hover { background: var(--bg-100); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ── チャット ── */
.chat-card { padding-bottom: 22px; }
.chat-log {
  max-height: 62vh; overflow-y: auto; padding: 4px 2px 8px;
  display: flex; flex-direction: column; gap: 14px;
  overscroll-behavior: contain;
}
.msg { max-width: 86%; font-size: 15px; line-height: 1.9; }
.msg.ai {
  align-self: flex-start; background: #fff; border: 1px solid var(--bg-200);
  border-radius: 1.4rem 1.4rem 1.4rem .35rem; padding: 14px 18px;
  box-shadow: var(--shadow-soft);
}
.msg.me {
  align-self: flex-end; background: var(--grad); color: #fff;
  border-radius: 1.4rem 1.4rem .35rem 1.4rem; padding: 13px 18px;
  white-space: pre-wrap;
}
.msg.ai .who {
  display: block; font-size: 11px; letter-spacing: .14em;
  color: var(--lv-500); margin-bottom: 5px; font-weight: 700;
}
.msg.ai .body { white-space: pre-wrap; }
.msg .typing { color: var(--pl-300); }

.sugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sugg button {
  background: #fff; border: 1px solid var(--lv-200); color: var(--pl-700);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.sugg button:hover { background: var(--lv-100); border-color: var(--lv-300); }

.composer {
  display: flex; gap: 10px; align-items: flex-end; margin-top: 18px;
  padding-top: 18px; border-top: 1px solid var(--bg-200);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--bg-200); border-radius: 1.3rem;
  padding: 13px 16px; font-size: 16px; font-family: inherit; line-height: 1.7;
  background: #fff; color: var(--pl-900); max-height: 140px;
}
.composer textarea:focus { outline: none; border-color: var(--lv-300); }
.composer button { padding: 13px 24px; font-size: 14px; flex-shrink: 0; }

/* ── 空状態（受講後に埋まる場所） ── */
.empty {
  text-align: center; padding: 34px 22px; border-radius: 2rem;
  border: 1px dashed var(--lv-200); background: rgba(255,255,255,.5);
  color: var(--pl-500); font-size: 14px; line-height: 2;
}
.empty b { display: block; color: var(--pl-700); font-size: 15px; margin-bottom: 6px; }

/* 受講後に見える画面の見本。実データではないことを必ず明示する */
.preview-note {
  font-size: 12px; color: var(--pl-500); margin-top: 14px; line-height: 1.9;
}

.demo-bar {
  background: var(--pl-700); color: #fff; font-size: 12px;
  padding: 8px 16px; text-align: center; letter-spacing: .08em;
}

.foot {
  font-size: 12px; color: var(--pl-500); line-height: 2;
  text-align: center; margin-top: 30px; padding: 0 10px;
}

/* ===== 下部タブ =====
   画面遷移ではなくタブ切り替えにしている。
   ページを読み込み直すとチャットの表示が作り直しになり、
   スクロール位置も入力途中の文字も消えるため。 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: rgba(249, 248, 252, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--lv-200);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 2px 10px; font-family: inherit;
  /* 3タブ×日本語ラベルは幅が厳しいので、2行前提で小さめに組む */
  font-size: 10px; line-height: 1.35; letter-spacing: 0; font-weight: 700;
  color: var(--pl-500); opacity: .65; text-align: center;
  border-top: 2px solid transparent; margin-top: -1px;
}
.tabbar button span { display: block; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.on {
  opacity: 1; color: var(--pl-700); border-top-color: var(--pl-500);
}
.tabbar button .dot {
  position: absolute; margin-left: 26px; margin-top: -2px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
}

/* タブ分の高さを空ける。空けないと最後のカードが隠れる */
.page { padding-bottom: 104px; }
@media (max-width: 480px) { .page { padding-bottom: 96px; } }

.panel { display: none; }
.panel.on { display: block; }

/* ── チャットタブ ──
 * 対話部分は高さを縛らず、ページごとスクロールさせる（会話が読みやすい）。
 * ただし入力欄はタブバーの上に貼り付けておく。
 *
 * ★以前は max-height: none だけを指定していたため、
 *   会話が伸びるほど入力欄が下へ押し出され、画面外に出ていた
 *   （14往復で 2,880px 地点＝画面外）。書くには全メッセージを
 *   スクロールし切る必要があり、事実上入力できない状態だった。
 */
.panel#panel-chat .chat-log { max-height: none; min-height: 46vh; overflow: visible; }
.panel#panel-chat .composer {
  position: sticky; z-index: 15;
  /* タブバー（約72px＋セーフエリア）のぶん浮かせる */
  bottom: calc(76px + env(safe-area-inset-bottom));
  margin-top: 18px; padding: 14px;
  background: rgba(253, 246, 240, .96); backdrop-filter: blur(10px);
  border: 1px solid var(--bg-200); border-radius: 1.6rem;
  box-shadow: 0 6px 20px rgba(133, 61, 84, .12);
}
/* 入力欄を貼り付けたぶん、最後の発言が隠れないよう下に余白を作る */
.panel#panel-chat .chat-card { padding-bottom: 8px; }
@media (max-width: 480px) {
  .panel#panel-chat .composer { bottom: calc(72px + env(safe-area-inset-bottom)); padding: 11px; }
}

/* ===== セッション履歴（受講後の見本） ===== */
.preview-badge {
  display: inline-block; font-size: 11px; letter-spacing: .1em; font-weight: 700;
  color: var(--bg-700); background: var(--bg-200); border: 1px solid var(--bg-300);
  border-radius: 999px; padding: 3px 12px; margin-left: auto;
}
.card h2 .preview-badge { font-family: "Hiragino Sans", sans-serif; }

.sess {
  width: 100%; text-align: left; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,.7); border: 1px solid var(--bg-200);
  border-radius: 1.6rem; padding: 18px 20px; margin-bottom: 12px;
  transition: border-color .2s, box-shadow .2s;
  display: block; color: inherit;
}
.sess:hover { border-color: var(--lv-300); box-shadow: var(--shadow-soft); }
.sess.on { border-color: var(--pl-500); background: #fff; box-shadow: var(--shadow-card); }
.sess .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.sess .no {
  background: var(--bg-200); color: var(--pl-700); font-weight: 700;
  border-radius: 999px; padding: 3px 12px;
}
.sess .when { color: var(--pl-500); }
.sess .to { margin-left: auto; color: var(--pl-700); font-weight: 700; font-size: 13px; }
.sess .ttl {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 17px; font-weight: 700; color: var(--pl-700);
  line-height: 1.6; margin: 9px 0 6px;
}
.sess .sum { font-size: 13px; color: var(--pl-900); opacity: .82; line-height: 1.85; }
.sess .mini { height: 5px; border-radius: 999px; background: var(--lv-200); margin-top: 12px; overflow: hidden; }
.sess .mini i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(to right, var(--gold), var(--pl-500));
}

/* 見本の時点を表示しているときの帯 */
.viewing {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-200); border: 1px solid var(--bg-300);
  border-radius: 1.4rem; padding: 12px 18px; margin-bottom: 18px;
  font-size: 13px; color: var(--pl-700); line-height: 1.7;
}
.viewing button {
  margin-left: auto; background: #fff; border: 1px solid var(--bg-300);
  color: var(--pl-700); border-radius: 999px; padding: 6px 16px;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.viewing button:hover { background: var(--lv-100); }

.steps-mini .s.done { color: var(--pl-700); opacity: 1; }
.steps-mini .s.done .n { background: var(--bg-300); color: var(--pl-700); }

/* セッション見本の中の、発言と宿題 */
.sess .voice {
  margin-top: 12px; padding: 11px 15px; border-radius: 1rem;
  background: var(--lv-100); border: 1px solid var(--lv-200);
  font-size: 13px; color: var(--pl-700); line-height: 1.8;
}
.sess .voice em {
  display: block; font-style: normal; font-size: 11px;
  color: var(--lv-500); letter-spacing: .1em; font-weight: 700; margin-bottom: 3px;
}
.sess .hw {
  margin-top: 10px; font-size: 13px; color: var(--pl-900); line-height: 1.8;
  padding-left: 15px; border-left: 2px solid var(--bg-300);
}
.sess .hw em {
  display: block; font-style: normal; font-size: 11px;
  color: var(--bg-700); letter-spacing: .1em; font-weight: 700; margin-bottom: 3px;
}

/* ===== セッションレポート（既存レポートと同じ構成） ===== */
.sess .open {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--bg-200);
}
.sess:not(.on) .open { display: none; }
.sess .more {
  margin-top: 10px; font-size: 12px; color: var(--lv-600); font-weight: 700;
}
.sess.on .more { display: none; }

.rep-h {
  font-size: 12px; letter-spacing: .1em; font-weight: 700; color: var(--pl-700);
  display: flex; align-items: center; gap: 8px; margin: 16px 0 9px;
}
.rep-h::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pl-500);
}
.rep-h.gold::before { background: var(--gold); }
.rep-h.lav::before { background: var(--lv-500); }

/* バランススコア（本番はレーダー。ここは横棒で同じ6項目を出す） */
.scores { display: grid; gap: 7px; }
.scores .m { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.scores .m .lbl { width: 68px; flex-shrink: 0; color: var(--pl-700); }
.scores .m .track { flex: 1; height: 7px; border-radius: 999px; background: var(--lv-200); overflow: hidden; }
.scores .m .track i { display: block; height: 100%; border-radius: 999px; background: var(--lv-500); }
.scores .m .val { width: 30px; text-align: right; color: var(--pl-700); font-variant-numeric: tabular-nums; }
.scores .m.focus .lbl { font-weight: 700; color: var(--pl-900); }
.scores .m.focus .track i { background: linear-gradient(to right, var(--gold), var(--pl-500)); }
.scores .cap { font-size: 11px; color: var(--pl-500); margin-top: 8px; }

.rep-box {
  background: rgba(255,255,255,.75); border: 1px solid var(--bg-200);
  border-radius: 1.1rem; padding: 13px 16px; font-size: 13px; line-height: 1.85;
}
.rep-box.route {
  background: var(--lv-100); border-color: var(--lv-200);
}
.rep-box.route b { color: var(--pl-700); }

.gotoloc {
  display: inline-block; cursor: pointer;
  color: var(--lv-700); font-weight: 700; font-size: 12px;
  border-bottom: 1px solid var(--lv-300); padding-bottom: 1px;
}
.gotoloc:hover { color: var(--pl-700); border-color: var(--pl-500); }

/* ===== 現在地（詳細版） ===== */
.now {
  border-radius: 2rem; padding: 22px 20px; margin: 20px 0 8px;
  background: linear-gradient(160deg, rgba(212,175,55,.13), rgba(179,107,133,.07));
  border: 1px solid var(--gold);
}
.now .kick {
  font-size: 11px; letter-spacing: .22em; font-weight: 700; color: var(--bg-700);
  display: flex; align-items: center; gap: 8px;
}
.now .kick .badge {
  background: var(--gold); color: #fff; border-radius: 999px;
  padding: 2px 10px; letter-spacing: .1em;
}
.now .when { font-size: 12px; color: var(--pl-500); margin-top: 12px; }
.now .name {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 21px; font-weight: 700; color: var(--pl-700);
  line-height: 1.6; margin: 4px 0 10px;
}
.now .what { font-size: 14px; line-height: 1.9; color: var(--pl-900); opacity: .9; }

.now .q {
  margin-top: 16px; padding: 14px 16px; border-radius: 1.1rem;
  background: rgba(255,255,255,.72); border: 1px solid var(--bg-200);
}
.now .q .lb {
  font-size: 11px; letter-spacing: .12em; font-weight: 700;
  color: var(--bg-700); margin-bottom: 5px;
}
.now .q .tx {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 16px; color: var(--pl-700); font-weight: 700; line-height: 1.75;
}

.now .pair { display: grid; gap: 9px; margin-top: 14px; }
.now .pair div { font-size: 13px; line-height: 1.8; }
.now .pair em {
  font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: .1em;
  display: block; margin-bottom: 2px;
}
.now .pair .sign em { color: var(--lv-600); }
.now .pair .caut em { color: var(--bg-700); }

.now .todo {
  margin-top: 16px; padding: 15px 17px; border-radius: 1.2rem;
  background: #fff; border: 1px solid var(--pl-300);
}
.now .todo .lb {
  font-size: 11px; letter-spacing: .14em; font-weight: 700; color: var(--pl-500);
}
.now .todo .ttl { font-size: 15px; font-weight: 700; color: var(--pl-900); margin: 5px 0 4px; }
.now .todo .how { font-size: 13px; line-height: 1.85; color: var(--pl-900); opacity: .86; }

/* 全体の道のり（開閉できる） */
.road { margin-top: 26px; }
.road > .lb {
  font-size: 12px; letter-spacing: .12em; font-weight: 700;
  color: var(--pl-500); margin-bottom: 12px;
}
.rstep {
  width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer;
  background: none; border: none; border-bottom: 1px dashed var(--bg-200);
  padding: 12px 0; display: block;
}
.rstep:last-of-type { border-bottom: none; }
.rstep .hd { display: flex; gap: 12px; align-items: flex-start; }
.rstep .n {
  width: 25px; height: 25px; line-height: 25px; text-align: center; flex-shrink: 0;
  border-radius: 50%; background: var(--lv-200); color: var(--pl-500); font-size: 12px;
}
.rstep.done .n { background: var(--bg-300); color: var(--pl-700); }
.rstep.here .n { background: var(--pl-500); color: #fff; box-shadow: 0 0 0 5px rgba(179,107,133,.16); }
.rstep .tx { font-size: 14px; line-height: 1.7; }
.rstep.here .tx { font-weight: 700; color: var(--pl-900); }
.rstep.next .tx { color: var(--pl-900); }
.rstep:not(.here):not(.next) .tx { color: var(--pl-500); opacity: .78; }
.rstep .sub { font-size: 11px; color: var(--pl-500); margin-top: 3px; }
.rstep .det { display: none; margin: 10px 0 2px 37px; font-size: 12.5px; line-height: 1.85; }
.rstep.open .det { display: block; }
.rstep .det .k { color: var(--lv-600); font-weight: 700; }
.rstep .det .c { color: var(--bg-700); font-weight: 700; }
.rstep .tip { font-size: 11px; color: var(--lv-600); margin-top: 4px; }
.rstep.open .tip { display: none; }

.goalrow {
  margin-top: 10px; padding: 20px 22px; border-radius: 1.6rem;
  background: linear-gradient(160deg, rgba(212,175,55,.16), rgba(179,107,133,.08));
  border: 1px solid var(--gold);
}
.goalrow .lb { font-size: 11px; letter-spacing: .24em; color: var(--bg-700); font-weight: 700; }
.goalrow .g {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 18px; font-weight: 700; color: var(--pl-700); line-height: 1.75; margin-top: 8px;
}
.goalrow .g + .g { margin-top: 6px; }
.remain {
  margin-top: 14px; font-size: 12.5px; color: var(--pl-500); line-height: 1.9;
}
.remain b { color: var(--pl-700); }

/* 通過済みの段階は「達成した」見た目にする。薄くすると努力が消えて見える */
.rstep.done .tx { color: var(--pl-700); opacity: 1; }
.rstep.done .n { background: var(--gold); color: #fff; }

/* ===== この段階のToDo =====
   「AIに従えば進む」を作る中心。判断させず、チェックするだけにする。 */
.todos { margin-top: 18px; }
.todos .hd {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px;
}
.todos .hd .lb {
  font-size: 11px; letter-spacing: .14em; font-weight: 700; color: var(--pl-500);
}
.todos .hd .cnt {
  margin-left: auto; font-size: 13px; font-weight: 700; color: var(--pl-700);
  font-variant-numeric: tabular-nums;
}
.todos .track {
  height: 6px; border-radius: 999px; background: var(--lv-200);
  overflow: hidden; margin: 8px 0 12px;
}
.todos .track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(to right, var(--gold), var(--pl-500));
  transition: width .35s ease;
}
.todo {
  width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--bg-200); border-radius: 1.1rem;
  padding: 13px 15px; margin-bottom: 8px;
  font-size: 13.5px; line-height: 1.8; color: var(--pl-900);
  transition: border-color .2s, background .2s;
}
.todo:hover { border-color: var(--lv-300); }
.todo .box {
  width: 21px; height: 21px; flex-shrink: 0; margin-top: 2px;
  border-radius: 7px; border: 1.5px solid var(--lv-300); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; line-height: 1;
}
.todo.done { background: rgba(212,175,55,.09); border-color: var(--gold); }
.todo.done .box { background: var(--gold); border-color: var(--gold); }
.todo.done .tx { text-decoration: line-through; opacity: .62; }

.todos .after {
  font-size: 12px; line-height: 1.85; color: var(--pl-500); margin-top: 10px;
}
.todos .after b { color: var(--pl-700); }
.todos .after.clear {
  color: var(--pl-700); background: rgba(212,175,55,.12);
  border: 1px solid var(--gold); border-radius: 1rem; padding: 11px 14px;
}

/* 道のりの各段階に、ToDoの進み具合を出す */
.rstep .todocnt {
  font-size: 11px; color: var(--bg-700); font-weight: 700; margin-left: 8px;
}

/* ルート結果画面はタブバーが無いので、その分の余白を戻す */
body.lovesta:not(:has(.tabbar)) .page { padding-bottom: 64px; }

/* ───────── グラフ（既存ダッシュボードと同じ6項目・同じ配色） ───────── */
.chart-h { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--pl-700);
  margin: 4px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chart-h .cap2 { font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--pl-500); }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border: 1px solid var(--lv-200); border-radius: 20px; padding: 10px 6px; }
/* 既存アプリと同じく、入りきらないぶんは横スクロールで見せる（間引かない）。
   1回あたり46pxを確保して、第◯回のラベルが重ならないようにしてある。 */
.linechart { display: block; height: auto; }
.linechart .ax { font-size: 10px; fill: var(--pl-500); font-family: var(--sans); }
.linechart .ax.tot { font-size: 11px; font-weight: 700; fill: var(--pl-700); }
.linechart .ax.no { font-size: 10px; fill: var(--lv-600); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 20px;
  font-size: 11.5px; color: var(--pl-700); }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .lg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

.balance { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: center; }
@media (min-width: 620px) { .balance { grid-template-columns: 260px 1fr; gap: 16px; } }
.radar { display: block; width: 100%; max-width: 260px; margin: 0 auto; height: auto; }
.radar .rlbl { font-size: 10.5px; font-weight: 700; fill: var(--pl-900); font-family: var(--sans); }
.radar .rlbl.gold { fill: var(--gold); }
.scores .track { position: relative; }
.scores .track u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff;
  border-radius: 2px; transform: translateX(-1px); box-shadow: 0 0 0 1px rgba(133,61,84,.14); }

/* ───────── エネルギーマトリクス（既存レポートと同じ4象限） ───────── */
.mtx-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 6px; }
@media (min-width: 620px) { .mtx-wrap { grid-template-columns: 240px 1fr; align-items: center; } }
.mtx { position: relative; width: 100%; max-width: 240px; margin: 0 auto; aspect-ratio: 1;
  display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 2px; background: var(--lv-200);
  border-radius: 18px; overflow: hidden; }
.mtx .q { display: flex; align-items: flex-start; justify-content: center; padding-top: 8px;
  font-size: 11px; font-weight: 700; color: var(--pl-500); }
.mtx .q1 { background: #eef4fd } .mtx .q2 { background: #fdf8e8 }
.mtx .q3 { background: #f5f4f7 } .mtx .q4 { background: #eef8f0 }
.mtx .ax-y, .mtx .ax-x { position: absolute; font-size: 9.5px; color: var(--pl-500);
  background: rgba(255,255,255,.8); border-radius: 6px; padding: 1px 5px; z-index: 2; }
.mtx .ax-y.top { top: 4px; left: 50%; transform: translateX(-50%) }
.mtx .ax-y.bottom { bottom: 4px; left: 50%; transform: translateX(-50%) }
.mtx .ax-x.left { left: 4px; top: 50%; transform: translateY(-50%) }
.mtx .ax-x.right { right: 4px; top: 50%; transform: translateY(-50%) }
.mtx .dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 3; }
.mtx .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.28); }
.mtx .dot i { position: absolute; inset: 0; border-radius: 50%; background: var(--gold);
  opacity: .55; animation: mtxping 1.9s cubic-bezier(0,0,.2,1) infinite; }
@keyframes mtxping { 0% { transform: scale(1); opacity: .55 } 80%,100% { transform: scale(2.4); opacity: 0 } }
.mtx-note { font-size: 12.5px; line-height: 1.85; color: var(--pl-900); }
.mtx-note b { display: block; color: var(--pl-700); margin-bottom: 4px; }

/* ───────── ミクロ分析22項目 ───────── */
.acc { margin: 6px 0 4px; }
.acc-h { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--lv-700);
  cursor: pointer; padding: 6px 0; border-bottom: 1px solid var(--lv-300); }
.acc-b { margin-top: 12px; background: #fff; border: 1px solid var(--lv-200);
  border-radius: 20px; padding: 14px 16px; }
.acc-b .mg { font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--pl-700);
  margin: 14px 0 8px; padding-bottom: 5px; border-bottom: 1px dashed var(--lv-200); }
.acc-b .mg:first-child { margin-top: 0 }
.acc-b .mi { margin: 0 0 12px }
.acc-b .mi-h { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--pl-900); }
.acc-b .mi-h b { font-family: var(--serif); color: var(--pl-700) }
.acc-b .mi-bar { display: block; height: 5px; border-radius: 3px; background: var(--lv-100);
  margin: 4px 0 5px; overflow: hidden; }
.acc-b .mi-bar i { display: block; height: 100%; border-radius: 3px; }
.acc-b .mi-bar i.hi { background: var(--gold) }
.acc-b .mi-bar i.mid { background: var(--lv-400) }
.acc-b .mi-bar i.lo { background: var(--lv-200) }
.acc-b .mi-r { font-size: 11.5px; line-height: 1.8; color: var(--pl-500); }

/* グラフのツールチップ。既存アプリの recharts Tooltip と同じ内容を出す */
.chart-inner { position: relative; }
.linechart .guide { stroke: var(--lv-300); stroke-width: 1; stroke-dasharray: 4 3; }
.linechart .hit { cursor: pointer; }
.chart-tip {
  position: absolute; top: 8px; width: 178px; z-index: 3; pointer-events: none;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--lv-200);
  border-radius: 14px; padding: 9px 11px; box-shadow: var(--shadow-card);
}
.chart-tip .h {
  font-family: var(--serif); font-size: 12.5px; font-weight: 700; color: var(--pl-700);
  padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid var(--lv-100);
}
.chart-tip .h span { font-family: var(--sans); font-size: 10.5px; font-weight: 500; color: var(--pl-500); }
.chart-tip .r { display: flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.9; }
.chart-tip .r i { width: 9px; height: 3px; border-radius: 2px; flex: 0 0 auto; }
.chart-tip .r span { flex: 1; color: var(--pl-900); }
.chart-tip .r b { font-family: var(--serif); color: var(--pl-700); font-variant-numeric: tabular-nums; }
.chart-tip .t {
  margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--lv-100);
  font-size: 11px; font-weight: 700; color: var(--bg-700); text-align: right;
}
.chart-hint { margin: 6px 0 18px; font-size: 11px; color: var(--pl-500); text-align: center; }

/* ───────── 利用回数 ─────────
 * 「制限」として見せず、**入会後との差**を見せる場所にする。
 * 残りが0でも、入会後の数字は必ず出す。
 */
.usage {
  margin: -4px 0 16px; padding: 12px 16px; border-radius: 1.4rem;
  background: linear-gradient(140deg, rgba(212,175,55,.13), rgba(173,126,224,.08));
  border: 1px solid var(--bg-300);
}
.usage .now { font-size: 13px; line-height: 1.9; color: var(--pl-900); }
.usage .now b { color: var(--pl-700); }
.usage .now .left {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--bg-300);
  font-size: 12px; font-weight: 700; color: var(--bg-700);
}
.usage .after {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(212,175,55,.5);
  font-size: 13.5px; line-height: 1.85; color: var(--pl-700); font-weight: 700;
}
.usage .after b {
  font-family: var(--serif); font-size: 16px;
  background: linear-gradient(100deg, #9e4a67, #bf9226);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.usage.out { background: linear-gradient(140deg, rgba(212,175,55,.2), rgba(232,184,163,.14)); }
.usage.out .now { color: var(--pl-500); }
