/* Recast — sky liquid glass
 * 参考: 空色グラスモーフィズム（浮かぶ泡 / 白いガラス板 / 鮮やかブルーのピル）
 * 骨格: 青い扉 / 継ぎ線 / 一行の証拠
 */
:root {
  --bg-grad: linear-gradient(160deg, #C7DDFB 0%, #B7D2F8 45%, #C9E2FA 100%);
  --bubble-solid: #3D8BF2;
  --glass: rgba(255, 255, 255, .52);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .9);
  --glass-shadow: 0 8px 32px rgba(31, 84, 160, .16);
  --text: #163A66;
  --muted: #4A6E9C;
  --rule: rgba(60, 110, 180, .18);
  --border: rgba(60, 110, 180, .35);
  --brand: #1E7BF5;
  --brand-deep: #1257D6;
  --brand-soft: rgba(120, 180, 255, .25);
  --self: #E8794A;
  --self-soft: rgba(255, 160, 110, .22);
  --growth: #1F8A5D;
  --growth-soft: rgba(90, 210, 150, .22);
  --warning: #9A7013;
  --warning-soft: rgba(240, 200, 110, .3);
  --field-a: #2E8DF7;
  --field-b: #1257D6;
  --on-field: #FFFFFF;
  --r-lg: 28px;
  --r-md: 18px;
  --r-pill: 999px;
  --en: "Plus Jakarta Sans", "Noto Sans JP", sans-serif;
  --jp: "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-grad: linear-gradient(160deg, #0E1B30 0%, #12233E 45%, #0E1D33 100%);
    --bubble-solid: #1E5FBF;
    --glass: rgba(35, 55, 90, .45);
    --glass-strong: rgba(30, 48, 80, .8);
    --glass-edge: rgba(255, 255, 255, .18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .35);
    --text: #E8F1FC;
    --muted: #9FBBDD;
    --rule: rgba(150, 190, 240, .16);
    --border: rgba(150, 190, 240, .35);
    --brand: #66AAFF;
    --brand-deep: #4488EE;
    --brand-soft: rgba(80, 140, 230, .25);
    --self: #FFA184;
    --self-soft: rgba(255, 150, 110, .2);
    --growth: #7DD8A8;
    --growth-soft: rgba(90, 210, 150, .16);
    --field-a: #2D7BE0;
    --field-b: #1B4FBF;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--jp);
  background: var(--bg-grad) fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100dvh;
}
/* 背景: くっきりした泡をやめて、大きくぼかした光のグラデーションに
   (白丸がアイコンや読み込み失敗画像に見える誤認の防止) */
.bubbles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bubbles i { position: absolute; border-radius: 50%; filter: blur(64px); }
.bubbles i:nth-child(1) { width: 380px; height: 380px; left: -120px; top: 8%; background: rgba(61, 139, 242, .32); }
.bubbles i:nth-child(2) { width: 300px; height: 300px; right: -100px; top: 34%; background: rgba(124, 100, 245, .2); }
.bubbles i:nth-child(3) { width: 360px; height: 360px; left: -80px; bottom: -100px; background: rgba(46, 141, 247, .26); }
.bubbles i:nth-child(4), .bubbles i:nth-child(5), .bubbles i:nth-child(6) { display: none; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.field :focus-visible { outline-color: var(--on-field); }
button { font-family: inherit; cursor: pointer; transition: background-color .18s ease-out, color .18s ease-out, border-color .18s ease-out, transform .18s ease-out, box-shadow .18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.screen { display: none; max-width: 520px; margin: 0 auto; padding: 0 20px 64px; min-height: 100dvh; }
.screen.active { display: block; }

/* ---------- アイコン ---------- */
.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -5px;
}
.icon.sm { width: 17px; height: 17px; vertical-align: -3px; }
.icon.accent { color: var(--brand); }

/* ---------- ガラス面 ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1.5px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-lg);
}
.panel { padding: 20px; }

/* ---------- 共通 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
/* 右上の ⋯（設定メニュー） */
.more-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.45);
  display: inline-flex; align-items: center; justify-content: center; color: var(--brand-deep);
  box-shadow: 0 2px 8px rgba(31,84,160,.08);
}
.more-btn .icon { width: 22px; height: 22px; stroke: currentColor; }
.menu-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--r-md);
  background: rgba(255,255,255,.45); border: 0; color: var(--text); text-align: left; font-size: 15px; font-weight: 600;
}
.menu-item .icon { width: 22px; height: 22px; flex: none; color: var(--brand); }
.menu-item .mi-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.menu-item .mi-text { flex: 1; min-width: 0; }
.menu-item::after { content: "›"; color: var(--muted); font-size: 20px; }
.menu-item.danger { color: var(--self); }
.menu-item.danger::after { content: ""; }
.menu-foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
/* 設定のサブページ */
.settings-sec[hidden] { display: none !important; }
.back-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.terms { font-size: 14px; line-height: 1.8; }
.terms h2 { font-size: 15px; margin: 18px 0 4px; }
.terms p, .terms li { color: var(--text); }
.terms .draft { font-size: 12px; color: var(--muted); }
.wordmark { font-family: var(--en); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wordmark::before {
  content: ""; width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: url("/icon-192.png") center/contain no-repeat;
  box-shadow: 0 2px 8px rgba(30, 123, 245, .25);
}
.welcome-mark { justify-content: center; font-size: 26px; }
.welcome-mark::before { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 24px rgba(30, 123, 245, .3); }
.top-link {
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1.5px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  color: var(--muted); font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px 18px; border-radius: var(--r-pill);
}
.top-link:hover { color: var(--text); }

.primary-btn {
  display: block; width: 100%; border: 0;
  background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff;
  font-size: 16px; font-weight: 700; line-height: 1.4; min-height: 56px; padding: 14px 24px;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 24px rgba(30, 123, 245, .38);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(30, 123, 245, .46); }
.primary-btn:active { transform: scale(.99); }
.text-btn { background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 600; min-height: 48px; padding: 8px 14px; border-radius: var(--r-pill); }
.text-btn:hover { color: var(--text); }
.text-btn.center { display: block; margin: 0 auto; }
.outline-btn {
  display: block; width: 100%; background: var(--glass); border: 1.5px solid var(--glass-edge); border-radius: var(--r-pill);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text); font-size: 15px; font-weight: 600; min-height: 52px; padding: 12px;
}
.outline-btn:hover { border-color: var(--brand); color: var(--brand); }

.rule-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.rule-row:last-child { border-bottom: 0; }
.rule-label { font-size: 14px; color: var(--muted); flex: none; }
.rule-value { font-size: 15px; font-weight: 600; text-align: right; }
.section-label { font-size: 14px; font-weight: 700; color: var(--muted); margin: 36px 0 10px; letter-spacing: .02em; }
.section-sub { font-weight: 400; font-size: 12px; margin-left: 6px; }
.num { font-variant-numeric: tabular-nums; }
.en { font-family: var(--en); }
.page-title { font-size: 26px; font-weight: 700; margin: 8px 0 4px; }
.page-lead { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* ---------- 継ぎ線 ---------- */
.seam { display: flex; align-items: center; width: 100%; height: 24px; }
.seam-endcap { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.seam-endcap.left { background: var(--brand); }
.seam-endcap.right { background: var(--self); }
.seam-line { flex: 1; height: 3px; border-radius: 2px; position: relative; }
.seam-line.left { background: linear-gradient(to right, var(--brand), color-mix(in srgb, var(--brand) 40%, transparent)); }
.seam-line.right { background: linear-gradient(to left, var(--self), color-mix(in srgb, var(--self) 40%, transparent)); }
.seam-gap { flex: none; width: 14px; }
.seam.your-turn .seam-endcap.right { background: transparent; border: 2.5px solid var(--self); }
.seam.on-field .seam-endcap.left, .seam.on-field .seam-endcap.right { background: var(--on-field); border: 0; }
.seam.on-field .seam-line.left { background: linear-gradient(to right, rgba(255,255,255,.95), rgba(255,255,255,.35)); }
.seam.on-field .seam-line.right { background: linear-gradient(to left, rgba(255,255,255,.95), rgba(255,255,255,.35)); }
/* 発話中の起伏（面接官アイコンのspeakingに連動） */
.stage:has(.avatar.speaking) .seam-line.left::after {
  content: ""; position: absolute; top: -5px; width: 40px; height: 8px; border-radius: 5px;
  background: var(--brand); filter: blur(1px); left: 10%;
  animation: hump 1.5s ease-in-out infinite;
}
@keyframes hump {
  0%, 100% { opacity: 0; transform: translateX(0) scaleY(.4); }
  50% { opacity: .8; transform: translateX(90px) scaleY(1); }
}
/* 自分の声への即時反応（マイク音量 --mic を右側に反映） */
.seam { --mic: 0; }
.seam-line.right::after {
  content: ""; position: absolute; top: -5px; right: 10%; width: 40px; height: 8px; border-radius: 5px;
  background: var(--self); filter: blur(1px);
  opacity: calc(var(--mic) * 0.9);
  transform: scaleY(calc(0.3 + var(--mic) * 1.2));
  transition: opacity .08s linear, transform .08s linear;
}
.voice-state { text-align: center; font-size: 14px; color: var(--muted); margin-top: 10px; min-height: 24px; }
.voice-state::after { content: "あなたの番"; }
.stage { --who: "面接官"; }
.stage:has(.avatar.speaking) .voice-state::after { content: var(--who) "が話している"; color: var(--brand); }
.stage:has(.seam.user-speaking):not(:has(.avatar.speaking)) .voice-state::after { content: "聞こえています"; color: var(--self); }
.voice-state[data-state="thinking"]::after { content: "渡したよ · " var(--who) "が考え中…"; color: var(--brand); }
.stage:has(.avatar.speaking) .voice-state[data-state="thinking"]::after { content: var(--who) "が話している"; }
.transcript .pending { color: var(--muted); font-size: 14px; font-weight: 500; }

/* ---------- 青い扉 ---------- */
.field {
  background: linear-gradient(150deg, var(--field-a), var(--field-b));
  color: var(--on-field);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  box-shadow: 0 16px 44px rgba(18, 87, 214, .35);
  position: relative; overflow: hidden;
}
.field::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(70% 50% at 85% -15%, rgba(255, 255, 255, .35), transparent 70%),
    radial-gradient(40% 34% at 5% 110%, rgba(255, 255, 255, .16), transparent 70%);
}
.field > * { position: relative; }
.field-title { font-size: 28px; font-weight: 700; line-height: 1.4; }
.field .seam { margin: 20px 0; }
.field-theme-label { font-size: 13px; opacity: .92; }
.field-theme { font-size: 19px; font-weight: 700; line-height: 1.5; }
.field-btn {
  display: block; width: 100%; border: 0; margin-top: 20px;
  background: rgba(255, 255, 255, .94); color: var(--brand-deep);
  font-size: 16px; font-weight: 700; min-height: 56px; padding: 14px 24px; border-radius: var(--r-pill);
  box-shadow: 0 6px 20px rgba(10, 40, 110, .25);
}
.field-btn:hover { background: #fff; transform: translateY(-1px); }
.field-btn:active { transform: scale(.99); }

/* ---------- ホーム ---------- */
.deadline { font-size: 14px; color: var(--muted); padding: 4px 0 14px; }
.deadline strong { color: var(--text); font-weight: 700; }

/* トレーニンググリッド */
.training-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.training-card {
  text-align: left; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--glass); border: 1.5px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--glass-shadow); color: var(--text);
  display: flex; flex-direction: column; gap: 2px;
}
.training-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.training-card .t-head { display: flex; align-items: center; justify-content: space-between; }
.training-card .t-num {
  font-family: var(--en); font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
}
.training-card .t-aux { font-size: 10px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.5); border-radius: 999px; padding: 2px 8px; }
.training-card .t-icon { font-size: 20px; }
.training-card .t-title { font-size: 15px; font-weight: 700; }
.training-card .t-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 今日のフレーズ */
.phrase-card {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 18px 20px; color: var(--text);
}
.phrase-card:hover { transform: translateY(-2px); }
.phrase-en { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.phrase-ja { font-size: 14px; color: var(--muted); }
.phrase-more { font-size: 13px; font-weight: 600; color: var(--brand); margin-top: 6px; }

.lastline-quote { font-family: var(--en); font-size: 19px; font-weight: 500; line-height: 1.5; margin-bottom: 4px; }
.lastline-meta { font-size: 14px; color: var(--muted); }
.lastline-meta .g { color: var(--growth); font-weight: 700; }
.records { margin-top: 8px; }
.records summary, .cfg-more summary { font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.bank-list { display: flex; flex-direction: column; }
.bank-item { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.bank-item:last-child { border-bottom: 0; }
.bank-item .dot { flex: none; width: 9px; height: 9px; align-self: center; border: 2px solid var(--self); border-radius: 50%; }
.bank-item.done .dot { background: var(--growth); border-color: var(--growth); }
.bank-item p { font-size: 15px; line-height: 1.6; flex: 1; }
.bank-item .tag { font-size: 12px; color: var(--muted); flex: none; }
.bank-item.done .tag { color: var(--growth); font-weight: 600; }
.growth-spark { display: none; }

/* 面接官の設定 */
.voice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .35); border: 1.5px solid transparent; color: var(--text); text-align: left;
}
.v-ava {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--en); font-size: 16px; font-weight: 700; color: #fff;
}
.v-ava.f { background: linear-gradient(135deg, #F0894F, #E8674A); }
.v-ava.m { background: linear-gradient(135deg, var(--field-a), var(--field-b)); }
.voice-chip .v-name { font-size: 14px; font-weight: 700; display: block; line-height: 1.3; }
.voice-chip .v-desc { font-size: 11px; color: var(--muted); display: block; line-height: 1.4; }
.voice-chip.active { border-color: var(--brand); background: var(--brand-soft); }
.cfg-label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 0 6px; }
.cfg-label:first-child { margin-top: 0; }
.cfg-select, .interview-config textarea, #jp-input, .typed-answer {
  width: 100%; background: var(--glass-strong);
  border: 1.5px solid var(--glass-edge); border-radius: var(--r-md);
  color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.6; padding: 12px 14px;
}
.cfg-select { min-height: 48px; }
.cfg-more { margin-top: 12px; }
/* iOSのdate入力が親からはみ出す対策 */
input[type="date"].cfg-select {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  -webkit-appearance: none; appearance: none;
  text-align: left;
}
.cfg-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 14px; cursor: pointer; min-height: 44px; }
.cfg-check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ウェルカム（入口） */
.welcome-wrap { padding-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.welcome-mark { text-align: center; font-size: 24px; }
.welcome-auth { display: flex; flex-direction: column; }
.welcome-invite { margin-top: 14px; }
.welcome-invite summary { font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
#guest-skip { opacity: .85; }

.acct-lead { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-bottom: 4px; }
.acct-me { font-size: 15px; margin-bottom: 8px; }
.acct-error { font-size: 13.5px; color: #C2314B; font-weight: 600; margin-top: 8px; }
#account-panel input.cfg-select { min-height: 48px; }
#acct-import { margin: 10px 0 4px; }

.pass-note { font-size: 14px; color: var(--muted); line-height: 1.6; }
.pass-note .bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.45); margin: 10px 0; overflow: hidden; }
.pass-note .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(to right, var(--field-a), var(--field-b)); }
.dev-demo { margin-top: 24px; font-size: 12px; opacity: .75; }

.setup-hint { margin-top: 20px; padding: 18px 20px; border-left: 3px solid var(--warning); font-size: 14px; line-height: 1.6; }
.setup-hint strong { color: var(--warning); }
.setup-hint ol { margin: 8px 0 6px 20px; }
.setup-hint code { background: var(--brand-soft); padding: 1px 8px; border-radius: 6px; font-size: 13px; }
.hint-note { color: var(--muted); font-size: 14px; }

/* ---------- セッション ---------- */
#screen-session { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.session-top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.session-meta { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0 20px; }
.session-kind { font-size: 14px; color: var(--muted); }
.session-clock { font-family: var(--en); font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.interviewer { text-align: center; margin-bottom: 20px; }
.avatar {
  position: relative; width: 132px; height: 132px; border-radius: 50%; margin: 0 auto;
  background: var(--glass); border: 1.5px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  display: grid; place-items: center;
}
.avatar .person { width: 76px; height: 76px; }
.p-head { fill: var(--brand); opacity: .85; }
.p-body { fill: var(--brand); opacity: .55; }
.p-hair { fill: var(--brand-deep); opacity: .9; }
.avatar-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; }
.avatar-ring.r2 { inset: -14px; border-width: 1.5px; }
.avatar.speaking .avatar-ring.r1 { animation: ring 1.8s ease-out infinite; }
.avatar.speaking .avatar-ring.r2 { animation: ring 1.8s ease-out .4s infinite; }
@keyframes ring { 0% { transform: scale(.96); opacity: .7; } 100% { transform: scale(1.12); opacity: 0; } }
.interviewer-name { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 10px; }

.caption { min-height: 0; }
#caption-text { font-family: var(--en); font-size: 24px; font-weight: 500; line-height: 1.35; letter-spacing: -0.02em; }
.caption-ja { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 10px; }
/* 本番モード：字幕オフ */
.caption.cc-off #caption-text, .caption.cc-off .caption-ja { display: none; }
.cc-toggle {
  display: block; margin: 8px auto 0; background: var(--glass); border: 1.5px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--muted); font-size: 13px; font-weight: 600; min-height: 40px; padding: 6px 18px; border-radius: var(--r-pill);
}
.cc-toggle.on { color: var(--brand); border-color: var(--brand); }

.stage .seam { margin-top: 24px; }
.user-area { margin-top: 20px; }
.transcript { font-size: 16px; line-height: 1.75; color: var(--self); min-height: 28px; }
.typed-answer { margin-top: 8px; font-size: 15px; }

.session-controls {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 496px;
  padding: 10px; display: flex; align-items: center; gap: 8px;
  border-radius: var(--r-pill);
  margin-bottom: env(safe-area-inset-bottom);
}
.session-controls > * { white-space: nowrap; min-width: 0; }
.session-controls .jp-btn {
  flex: .9; background: var(--self-soft); color: var(--self); border: 0; padding: 0 8px;
  font-size: 13px; font-weight: 700; min-height: 52px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.mic-wrap { flex: 1.3; display: flex; min-width: 0; }
.mic-btn {
  flex: 1; border: 0; background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; padding: 0 8px;
  min-height: 52px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700; box-shadow: 0 6px 18px rgba(30, 123, 245, .35);
}
.mic-btn { min-width: 0; }
.mic-btn .icon { flex: none; }
.mic-btn .mic-text { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic-btn.listening { background: linear-gradient(135deg, #F0894F, #E8674A); box-shadow: 0 6px 18px rgba(232, 103, 74, .35); }
.mic-btn.listening.gated { background: linear-gradient(135deg, #B9C6D6, #98A9BE); box-shadow: none; }
.live-budget { margin-left: 3px; font-weight: 500; opacity: .7; }
.session-clock.over { color: var(--self); }
.teacher-heard.gated { opacity: .55; }
.teacher-notes.waiting { color: var(--muted); font-weight: 500; }
#next-q { flex: .9; background: none; border: 0; border-radius: var(--r-pill); min-height: 52px; font-size: 14px; font-weight: 600; color: var(--muted); }
#next-q:hover { color: var(--text); }
.end-turn-btn {
  flex: 1; min-height: 52px; padding: 0 8px; border-radius: var(--r-pill); border: 1.5px solid var(--brand); background: rgba(255,255,255,.7);
  color: var(--brand-deep); font-size: 13px; font-weight: 700;
}
.end-turn-btn:disabled { opacity: .45; }
.hold-btn { flex: .9; min-height: 52px; padding: 0 6px; border-radius: var(--r-pill); border: 1.5px solid rgba(31,84,160,.25); background: rgba(255,255,255,.5); color: var(--brand-deep); font-size: 13px; font-weight: 700; }
.hold-btn.on { background: #FFF3D6; border-color: #E8B04A; color: #8A5A00; }
.rule-value.perf { font-size: 12.5px; text-align: right; line-height: 1.5; max-width: 62%; }
.turns-log { font-size: 12.5px; line-height: 1.6; color: var(--muted); padding-left: 4px; list-style: none; margin: 6px 0 0; }

/* ---------- 日本語相談：先生のノート ---------- */
.sheet { position: fixed; inset: 0; background: rgba(10, 30, 60, .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; place-items: end center; z-index: 30; }
.sheet-inner {
  width: calc(100% - 16px); max-width: 512px; margin-bottom: 8px;
  border-radius: var(--r-lg); padding: 22px 20px 26px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border: 1.5px solid var(--glass-edge); box-shadow: var(--glass-shadow);
}
.sheet-head { display: flex; flex-direction: column; gap: 2px; }
.sheet-title { font-size: 15px; font-weight: 700; color: var(--self); }
.sheet-note { font-size: 13px; color: var(--muted); }
#jp-input { font-size: 15px; }
.teacher-board { display: flex; flex-direction: column; gap: 6px; }
.teacher-heard {
  font-size: 14px; line-height: 1.6; color: var(--muted);
  background: var(--self-soft); border-radius: var(--r-md); padding: 8px 14px;
  border: 1.5px solid transparent; transition: border-color .12s linear;
}
.teacher-heard.hearing { border-color: var(--self); }
.teacher-heard .heard-label { font-weight: 700; color: var(--self); }
.teacher-notes {
  font-size: 15.5px; line-height: 36px; min-height: 72px; max-height: 220px; overflow-y: auto;
  white-space: pre-wrap;
  background:
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px),
    var(--glass);
  padding: 6px 16px 12px; border-radius: var(--r-md); border: 1.5px solid var(--glass-edge);
}
.jp-result { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.note-label { font-size: 13px; font-weight: 700; color: var(--brand); }
.jp-en {
  font-family: var(--en); font-size: 23px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em;
  background:
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px),
    var(--glass);
  padding: 14px 16px 18px; border-radius: var(--r-md); border: 1.5px solid var(--glass-edge);
}
.note-explain { display: flex; flex-direction: column; gap: 4px; }
.note-explain .ex-row { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.note-explain .ex-row:last-child { border-bottom: 0; }
.note-explain .ex-en { font-family: var(--en); font-weight: 600; color: var(--brand-deep); flex: none; max-width: 100%; }
.note-explain .ex-ja { color: var(--text); flex: 1 1 12em; min-width: 0; line-height: 1.6; }
.note-explain .ex-whole { font-size: 14px; color: var(--text); padding-top: 4px; border-top: 1px dashed var(--rule); margin-top: 4px; }
.jp-tip { font-size: 13.5px; line-height: 1.6; color: var(--muted); background: var(--warning-soft); border-radius: var(--r-md); padding: 10px 14px; }
.jp-tip::before { content: "💡 先生のワンポイント： "; font-weight: 700; color: var(--warning); }

/* ---------- フレーズ帳 ---------- */
.shuffle-btn { margin-bottom: 14px; }
.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase-item { border-radius: var(--r-md); overflow: hidden; }
.phrase-item summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  font-family: var(--en); font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.phrase-item summary::-webkit-details-marker { display: none; }
.phrase-item summary::after { content: "＋"; color: var(--brand); font-weight: 700; flex: none; }
.phrase-item[open] summary::after { content: "−"; }
.phrase-item summary .ph-en { flex: 1; min-width: 0; }
.known-btn {
  flex: none; height: 30px; padding: 0 10px 0 8px; border-radius: var(--r-pill);
  border: 1.5px solid rgba(31,84,160,.35); background: rgba(255,255,255,.55); color: var(--brand-deep);
  font-family: var(--jp); font-size: 12px; font-weight: 700; letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 4px; margin-right: 2px;
}
.known-btn .icon { width: 14px; height: 14px; stroke: currentColor; opacity: .35; }
.phrase-item.is-known summary .ph-en { color: var(--muted); font-weight: 500; }
.phrase-item.is-known .known-btn { background: var(--self); border-color: var(--self); color: #fff; }
.phrase-item.is-known .known-btn .icon { opacity: 1; }
.ph-ex { margin: 10px 0 4px; padding: 10px 12px; border-left: 3px solid var(--field-b); background: rgba(255,255,255,.35); border-radius: 0 10px 10px 0; }
.ph-ex .ex-en { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--brand-deep); }
.ph-ex .ex-ja { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.ph-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.speak-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1.5px solid rgba(31,84,160,.25); background: rgba(255,255,255,.6);
  color: var(--brand-deep); font-size: 13px; font-weight: 700;
}
.speak-btn .icon { width: 18px; height: 18px; stroke: currentColor; }
.speak-btn:active { transform: scale(.97); }
.qn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qn-head .speak-btn { flex: none; padding: 0 10px; }
.known-filter { margin: 4px 0 12px; }
.known-filter .segmented { justify-content: stretch; }
.known-filter .seg { flex: 1; padding: 6px 4px; font-size: 12px; white-space: nowrap; }
.known-filter .seg .num { opacity: .7; font-weight: 600; margin-left: 2px; }
.known-hint { font-size: 12px; color: var(--muted); margin: 8px 4px 0; }
.list-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 32px 0; }
.phrase-body { padding: 0 18px 14px; }
.phrase-body .pj { font-size: 15px; font-weight: 600; }
.phrase-body .pn { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- リキャップ ---------- */
.recap-date { font-size: 14px; color: var(--muted); margin-top: 4px; }
.recap-lead { font-size: 24px; font-weight: 700; line-height: 1.45; margin: 12px 0 24px; }
.growth-card { padding: 24px 22px; position: relative; overflow: hidden; }
.growth-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 3px; border-radius: 2px;
  background: linear-gradient(to right, var(--brand) 0 48%, transparent 48% 52%, var(--self) 52% 100%);
}
.gc-title { font-size: 14px; font-weight: 700; color: var(--growth); margin-bottom: 14px; }
.gc-meta { font-size: 13px; color: var(--muted); }
.gc-ja { font-size: 15px; line-height: 1.6; margin: 2px 0 8px; }
.gc-prev-en { font-family: var(--en); font-size: 16px; line-height: 1.5; color: var(--muted); }
.gc-divider { border: 0; border-top: 1px solid var(--rule); margin: 14px 0; }
.gc-quote { font-family: var(--en); font-size: 24px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; margin-top: 4px; }
.gc-check { font-size: 14px; color: var(--growth); font-weight: 600; margin-top: 12px; background: var(--growth-soft); border-radius: var(--r-pill); padding: 8px 16px; display: inline-block; }
.gc-feedback { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.carry { margin-top: 8px; }
.carry-ja { font-size: 16px; font-weight: 600; margin-top: 4px; }
.recap-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.usage { margin-top: 12px; }

/* ---------- 料金 ---------- */
.pricing .field { margin-top: 4px; }
.price-block { padding: 28px 4px 0; }
.price-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.price-num { font-family: var(--en); font-size: 58px; font-weight: 700; line-height: 1.0; letter-spacing: -0.02em; margin: 4px 0 8px; }
.price-cond { font-size: 14px; color: var(--muted); }
.value-lines { margin: 24px 0; }
.value-lines p { font-size: 16px; line-height: 1.75; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.value-lines p:last-child { border-bottom: 0; }
.pricing-foot { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 20px; }
.pricing .section-label { margin-top: 32px; }

/* ---------- クイズ ---------- */
.quiz-menu { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.quiz-start {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; text-align: left; padding: 16px 18px; color: var(--text);
  border-radius: var(--r-md);
}
.quiz-start .icon { grid-row: 1 / 3; width: 26px; height: 26px; }
.quiz-start .q-title { font-size: 15px; font-weight: 700; }
.quiz-start .q-sub { font-size: 12px; color: var(--muted); }
.quiz-start:hover { transform: translateY(-2px); }

.quiz-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 4px; }
.quiz-progress { font-family: var(--en); font-size: 14px; font-weight: 700; color: var(--muted); }
.quiz-streak { display: flex; align-items: center; gap: 4px; font-family: var(--en); font-size: 15px; font-weight: 700; color: var(--muted); }
.quiz-streak .icon { width: 18px; height: 18px; }
.quiz-streak.hot { color: var(--self); }
.quiz-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); overflow: hidden; margin-bottom: 24px; }
.quiz-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(to right, var(--field-a), var(--field-b)); transition: width .25s ease-out; }
.quiz-ask { font-size: 13px; font-weight: 700; color: var(--muted); }
.quiz-ja { font-size: 22px; font-weight: 700; line-height: 1.5; margin: 4px 0 20px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  text-align: left; padding: 14px 18px; border-radius: var(--r-md); color: var(--text);
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5;
}
.quiz-opt:not(:disabled):hover { transform: translateY(-1px); border-color: var(--brand); }
.quiz-opt.correct { background: var(--growth-soft); border-color: var(--growth); color: var(--growth); }
.quiz-opt.wrong { background: rgba(232, 103, 74, .15); border-color: var(--self); color: var(--self); }
.quiz-opt .opt-ja {
  display: block; font-family: var(--jp); font-size: 12px; font-weight: 500;
  color: var(--muted); line-height: 1.5; margin-top: 2px;
}
.quiz-opt.correct .opt-ja { color: var(--growth); }
.quiz-note { margin-top: 16px; padding: 14px 18px; border-radius: var(--r-md); }
.qn-en { font-size: 17px; font-weight: 700; color: var(--brand-deep); }
.qn-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
#quiz-next { margin-top: 16px; }

.result-card { text-align: center; margin-bottom: 8px; }
.result-score { font-family: var(--en); font-size: 64px; font-weight: 800; line-height: 1.1; color: var(--brand); }
.result-of { font-size: 20px; color: var(--muted); margin-left: 6px; }
.result-streak { font-size: 14px; color: var(--muted); }
.miss-item { margin-bottom: 8px; padding: 14px 18px; }
.miss-item .pj { font-size: 15px; font-weight: 700; }
.miss-item .pn { font-size: 13px; color: var(--muted); }

.segmented { display: flex; background: rgba(255,255,255,.4); border-radius: var(--r-pill); padding: 4px; }
.seg {
  border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700;
  padding: 6px 16px; border-radius: var(--r-pill);
}
.seg.active { background: #fff; color: var(--brand-deep); box-shadow: 0 2px 8px rgba(31,84,160,.12); }

/* ---------- テキストで学ぶ / マイ辞書 ---------- */
.compose-entry {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; text-align: left; padding: 16px 18px; width: 100%;
  border-radius: var(--r-md); color: var(--text);
}
.compose-entry .icon { grid-row: 1 / 3; width: 26px; height: 26px; }
.compose-entry .q-title { font-size: 15px; font-weight: 700; }
.compose-entry .q-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.compose-entry:hover { transform: translateY(-2px); }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip {
  border: 1.5px solid var(--glass-edge); background: var(--glass); color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: var(--r-pill); min-height: 40px;
}
.topic-chip.active { background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; border-color: transparent; }

.compose-input {
  width: 100%; background: var(--glass-strong); border: 1.5px solid var(--glass-edge);
  border-radius: var(--r-md); color: var(--text); font-family: inherit; font-size: 14px;
  line-height: 1.7; padding: 14px 16px; margin-bottom: 12px;
}
.compose-status { font-size: 14px; color: var(--muted); text-align: center; margin-top: 16px; }
.compose-en-wrap { margin-bottom: 12px; }
.compose-en { font-size: 20px; font-weight: 500; line-height: 1.55; letter-spacing: -0.01em; }
.compose-gloss { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); }
#compose-phrases { margin: 12px 4px; }
#compose-memo { margin-top: 4px; }

.dict-empty { text-align: center; font-size: 14px; color: var(--muted); line-height: 1.8; }
.dict-empty .primary-btn { margin-top: 14px; }
.mydict-list { display: flex; flex-direction: column; gap: 10px; }
/* ノート: 回収ループ */
.loop-card { display: flex; justify-content: space-around; padding: 14px 8px; margin-bottom: 8px; }
.loop-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.loop-n { font-size: 26px; font-weight: 700; color: var(--brand-deep); line-height: 1.1; }
.loop-l { font-size: 11.5px; color: var(--muted); }
.sec-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.list-empty.small { padding: 10px 4px 18px; font-size: 13px; text-align: left; }
.note-card { padding: 14px 16px; border-radius: var(--r-md); }
.note-card .nc-ja { font-size: 13px; color: var(--muted); }
.note-card .nc-ja::before { content: "言いたかった："; }
.note-card .nc-en { font-size: 17px; font-weight: 700; color: var(--brand-deep); margin: 4px 0 2px; line-height: 1.45; }
.note-card .nc-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.note-card .nc-q { font-size: 14px; font-weight: 700; }
.note-card .nc-q::before { content: "Q. "; color: var(--brand); }
.note-card .nc-a { font-size: 14px; line-height: 1.7; margin-top: 4px; }
.note-card .nc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.note-card .nc-meta { font-size: 12px; color: var(--muted); margin-right: auto; }
.recover-btn {
  min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 0;
  background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; font-size: 13px; font-weight: 700;
}
.note-card.recovered .nc-en { color: var(--muted); font-weight: 600; }
.recovered-wrap { margin-top: 4px; margin-bottom: 8px; }
.recovered-wrap summary { font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
.recovered-wrap summary::-webkit-details-marker { display: none; }
.recovered-wrap .mydict-list { margin-top: 8px; }
.dict-item { border-radius: var(--r-md); overflow: hidden; }
.dict-item summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
}
.dict-item summary::-webkit-details-marker { display: none; }
.dict-topic {
  flex: none; font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 2px 10px;
}
.dict-head { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dict-body { padding: 0 18px 14px; }
.dict-en { font-size: 17px; font-weight: 500; line-height: 1.55; }
.dict-gloss { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 8px 0; }
.dict-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; border-top: 1px solid var(--rule); padding-top: 4px; }
.dict-date { font-size: 12px; color: var(--muted); }

/* ---------- 下タブバー ---------- */
.tabbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 496px; z-index: 20;
  display: flex; align-items: stretch; padding: 8px;
  border-radius: var(--r-pill);
  margin-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; border-radius: var(--r-pill);
  padding: 8px 2px; color: var(--muted); min-width: 0;
}
.tabbar .tab-icon { font-size: 20px; line-height: 1.2; }
.tabbar .tab-label { font-size: 10px; font-weight: 700; line-height: 1.3; white-space: nowrap; letter-spacing: -0.02em; }
@media (max-width: 380px) { .tabbar .tab-label { font-size: 9px; } }
.tabbar .tab.active {
  background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff;
  box-shadow: 0 6px 16px rgba(30, 123, 245, .32);
}
#screen-home, #screen-training, #screen-phrases, #screen-mydict, #screen-settings {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

/* ---------- リキャップ会話ログ ---------- */
.recap-log-wrap { margin-bottom: 4px; }
.recap-log-wrap summary { font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.recap-log { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.log-line { font-size: 14px; line-height: 1.65; }
.log-line .log-who { display: block; font-size: 11px; font-weight: 700; }
.log-line.ai { color: var(--text); }
.log-line.ai .log-who { color: var(--brand); }
.log-line.you { color: var(--self); font-family: var(--en); font-size: 15px; }
.log-line.you .log-who { color: var(--self); font-family: var(--jp); }

/* ---------- ホーム: 巨大マイクボタン ---------- */
.cheer { font-size: 14px; color: var(--muted); line-height: 1.7; text-align: center; margin: 4px 0 28px; max-width: 30em; }
.big-mic-wrap .deadline { text-align: center; }
/* ツアー中: 光っているタブだけを"選択中"に見せる（現在タブの青と二重にならないように） */
body.tour-lock #tabbar .tab.active:not(.tour-target) { background: none; color: var(--muted); box-shadow: none; }
body.tour-lock #tabbar .tab.tour-target { background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; box-shadow: 0 6px 16px rgba(30,123,245,.32); }
.deadline strong { font-size: 22px; }
/* ホームはflex縦積みで、マイクブロックを残り空間の中央に（activeのときだけ） */
#screen-home.active { display: flex; flex-direction: column; }
.big-mic-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 0; }
.big-mic {
  width: 176px; height: 176px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(150deg, var(--field-a), var(--field-b)); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 20px 50px rgba(18, 87, 214, .4), inset 0 2px 12px rgba(255, 255, 255, .3);
  position: relative;
}
.big-mic::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 2px solid rgba(46, 141, 247, .35);
  animation: bigring 2.4s ease-out infinite;
}
@keyframes bigring {
  0% { transform: scale(.95); opacity: .8; }
  100% { transform: scale(1.15); opacity: 0; }
}
.big-mic:active { transform: scale(.97); }
.big-mic-icon { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.big-mic-label { font-size: 18px; font-weight: 700; margin-top: 20px; }
.big-mic-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 求人票選択・一覧 ---------- */
.sheet-title-b { font-size: 17px; font-weight: 700; }
.start-sheet { max-height: 88vh; overflow-y: auto; }
.start-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
/* 面接タイプ: 1行1タイプのラジオ列（2列グリッドは題名が折れて読みにくかった） */
.type-list { display: flex; flex-direction: column; gap: 6px; }
.type-row {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px 10px 14px; min-height: 56px;
  border-radius: var(--r-md); background: rgba(255,255,255,.4); border: 1.5px solid transparent; color: var(--text);
}
.type-row.active { border-color: var(--brand); background: var(--brand-soft); }
.type-row > .icon { width: 22px; height: 22px; flex: none; }
.type-row .ty-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.type-row .ty-title { font-size: 15px; font-weight: 700; white-space: nowrap; }
.type-row .ty-sub { font-size: 12px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-row .ty-time { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.type-row .ty-check {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(31,84,160,.3);
  display: inline-flex; align-items: center; justify-content: center; color: transparent; background: rgba(255,255,255,.5);
}
.type-row .ty-check .icon { width: 14px; height: 14px; stroke: currentColor; }
.type-row.active .ty-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.persona-seg .seg { flex: 1; padding: 8px 4px; font-size: 14px; white-space: nowrap; }
.start-hint { font-size: 12.5px; color: var(--muted); margin: 8px 4px 0; min-height: 18px; }
.cfg-hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; line-height: 1.5; }
.quota-foot { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.persona-chip, .job-opt-chip {
  border: 1.5px solid var(--glass-edge); background: var(--glass); color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: var(--r-pill); min-height: 40px;
}
.job-opt-chip.add { border-style: dashed; color: var(--brand-deep); }
.persona-chip.active, .job-opt-chip.active { background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; border-color: transparent; }
.job-pick .ty-chev { color: var(--muted); font-size: 22px; line-height: 1; flex: none; }
.job-pick > .icon { width: 22px; height: 22px; flex: none; }
.sheet-inner.picker { max-height: 80vh; display: flex; flex-direction: column; }
.pick-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 2px 0 6px; }
.pick-list .start-label { margin: 10px 0 4px; }
#job-pick-sheet { z-index: 31; }
.job-row-opt { min-height: 48px; padding: 8px 12px 8px 14px; }
.job-row-opt .ty-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.job-row-opt .ty-sub[hidden] { display: none; }
.job-row-opt.add { border: 1.5px dashed rgba(31,84,160,.3); background: transparent; }
.job-row-opt.add .ty-title { color: var(--brand-deep); font-weight: 600; }
#job-start { margin-top: 18px; }
.job-opt { text-align: left; }
.jobs-list { margin-top: 12px; }
.job-item { border-bottom: 1px solid var(--rule); font-size: 14px; }
.job-item:last-child { border-bottom: 0; }
.job-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 4px; font-weight: 600;
}
.job-item summary::-webkit-details-marker { display: none; }
.job-item summary::after { content: "＋"; color: var(--brand); font-weight: 700; flex: none; }
.job-item[open] summary::after { content: "−"; }
.job-item .job-name { flex: 1; min-width: 0; }
.job-item .job-exp { font-size: 11.5px; color: var(--muted); font-weight: 500; flex: none; }
.job-body { padding: 0 4px 12px; }
.job-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.job-actions .text-btn { min-height: 36px; padding: 0 10px; text-decoration: none; }
.job-rename-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.job-rename-row input { flex: 1; }
.job-text {
  white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6; color: var(--text);
  max-height: 260px; overflow-y: auto; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.45);
}
#job-save-row { margin-top: 10px; }

/* ---------- ブランドバナー ---------- */
.brand-banner {
  display: block; width: 100%; border-radius: var(--r-md);
  box-shadow: var(--glass-shadow); border: 1.5px solid var(--glass-edge);
}
.welcome-banner { border-radius: var(--r-lg); }
.home-banner { margin: 16px 0 4px; }

/* ---------- 使い方ツアー(スポットライト) ---------- */
#tour { position: fixed; inset: 0; z-index: 60; }
body.tour-lock { overflow: hidden; }

/* 求人票URL */
.job-url-row { display: flex; gap: 8px; align-items: stretch; }
.job-url-row input { flex: 1; }
.job-fetch-btn { width: auto; min-height: 48px; padding: 10px 22px; flex: none; }
.job-status { font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.tour-box {
  position: absolute; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(12, 28, 56, .62);
  transition: left .32s cubic-bezier(.2,.8,.3,1), top .32s cubic-bezier(.2,.8,.3,1), width .32s cubic-bezier(.2,.8,.3,1), height .32s cubic-bezier(.2,.8,.3,1);
}
.tour-box.snap { transition: none; }
.tour-box::after { content: ""; position: absolute; inset: -3px; border-radius: 21px; border: 3px solid rgba(255,255,255,.95); animation: tourpulse 1.8s ease-in-out infinite; }
@keyframes tourpulse {
  0%, 100% { opacity: .95; transform: scale(1); }
  50% { opacity: .55; transform: scale(1.02); }
}
.tour-tip { transition: top .32s cubic-bezier(.2,.8,.3,1), opacity .22s ease; }
.tour-tip.snap { transition: opacity .22s ease; }
.tour-tip.fade { opacity: 0; }
.tour-tip {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: calc(100% - 48px); max-width: 400px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border-radius: var(--r-md); padding: 18px 20px;
}
.tour-step { font-size: 12px; font-weight: 700; color: var(--brand); }
.tour-title { font-size: 17px; font-weight: 700; margin: 2px 0 6px; }
.tour-body { font-size: 14px; line-height: 1.7; color: var(--muted); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.tour-next { width: auto; min-height: 44px; padding: 10px 26px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1.5px solid var(--glass-edge); color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.5; padding: 10px 20px; border-radius: var(--r-pill);
  box-shadow: var(--glass-shadow); z-index: 40; max-width: calc(100% - 40px);
}

/* ---------- 先生シート: 上に聞き方、左下に先生、来るまで前面モーダル ---------- */
.ask-row { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 8px; }
.ask-row textarea { flex: 1; min-height: 44px; resize: none; }
.ask-send { width: auto; min-height: 44px; padding: 0 16px; flex: none; }
.ask-examples { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ask-chip { border: 1.5px solid var(--glass-edge); background: rgba(255,255,255,.55); color: var(--brand-deep); font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: var(--r-pill); min-height: 32px; }
/* 先生の吹き出し＝ノート。左下に先生、右にノートが吹き出しとして伸びる */
.teacher-row { display: flex; align-items: flex-end; gap: 8px; }
.teacher-face { width: 72px; height: 72px; flex: none; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(31,84,160,.25)); animation: ta-pop .5s cubic-bezier(.2,1.4,.4,1) both; }
.teacher-notes.bubble { flex: 1; min-width: 0; position: relative; border-radius: 16px 16px 16px 4px; }
.teacher-notes.bubble::before { content: ""; position: absolute; left: -9px; bottom: 14px; border: 6px solid transparent; border-right-color: rgba(255,255,255,.75); border-left: 0; }
@keyframes ta-pop { from { transform: translateY(24px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ask-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 4px 0 10px; }
.teacher-notes { max-height: 44vh; }
.teacher-wait { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(10,30,60,.25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tw-card { width: min(320px, calc(100% - 48px)); padding: 26px 22px 22px; border-radius: 22px; text-align: center; }
.tw-img { display: block; margin: 0 auto 8px; animation: tw-bob 1.6s ease-in-out infinite; }
@keyframes tw-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tw-title { font-size: 17px; font-weight: 700; }
.tw-sub { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-top: 6px; }
.tw-dots { display: inline-flex; gap: 6px; margin-top: 14px; }
.tw-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: tw-dot 1.2s infinite; }
.tw-dots i:nth-child(2) { animation-delay: .2s; } .tw-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes tw-dot { 0%,80%,100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---------- 面接官アイコン ---------- */
.avatar-img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); border-radius: 50%; object-fit: cover; object-position: center 12%; background: rgba(255,255,255,.7); z-index: 1; }
.avatar:has(.avatar-img:not([hidden])) .person { display: none; }
.voice-chip .v-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 12%; background: rgba(255,255,255,.7); flex: none; }
.recap-debug { display: none !important; }

/* ---------- トレーニング: 主役カード（自分の言葉を面接英語に）— コンパクト版 ---------- */
.compose-hero { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; padding: 14px 40px 12px 16px; margin: 2px 0 18px; border-radius: var(--r-md); color: var(--text); border-color: rgba(30,123,245,.4); background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(200,225,255,.5)); }
.ch-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ch-step { display: inline-block; flex: none; font-family: var(--en); font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff; background: linear-gradient(135deg, var(--field-a), var(--field-b)); padding: 2px 8px; border-radius: var(--r-pill); }
.ch-step.inline { vertical-align: 2px; margin-right: 6px; }
.ch-title { font-size: 16px; font-weight: 800; line-height: 1.3; }
.ch-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ch-example { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-top: 4px; font-size: 12.5px; }
.ch-ja { color: var(--muted); }
.ch-arrow { color: var(--brand); }
.ch-en { font-weight: 700; color: var(--brand-deep); }
.ch-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--muted); line-height: 1; }
.topic-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 6px 2px 12px; min-height: 20px; }

/* ---------- インストール案内 ---------- */
.install-hero { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.install-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 6px 18px rgba(30,123,245,.3); flex: none; }
.install-lead { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.install-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; background: rgba(255,255,255,.5); border-radius: 12px; padding: 10px 12px; }
.is-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; font-family: var(--en); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.is-glyph { display: inline-block; font-size: 16px; color: var(--brand); }
.install-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 4px 0 6px; min-height: 18px; }

/* STEP 2 の見出し枠（STEP 1 のカードと同じ文法で） */
.step-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 4px 0 10px; border-radius: var(--r-md); }
.sh-title { font-size: 15px; font-weight: 800; }
.sh-sub { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.is-share { color: var(--brand); vertical-align: -3px; }

.buy-btn.inline { display: inline; min-height: 0; padding: 2px 8px; font-size: 13px; color: var(--brand-deep); border: 1.5px solid rgba(31,84,160,.3); border-radius: var(--r-pill); margin-left: 6px; }

/* STEP見出しは枠の外（見出しはタップ対象に見せない）。カードだけがタップ対象 */
.compose-hero { padding: 12px 38px 12px 14px; margin: 0 0 20px; }
.ch-row { display: flex; gap: 10px; align-items: flex-start; }
.ch-row > .icon { width: 22px; height: 22px; margin-top: 2px; }
.ch-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-sub { color: var(--text); font-weight: 600; }
.step-head { display: none; }
/* STEPの見出しは本文色で（ページの主見出しなので薄くしない） */
.step-label { color: var(--text); font-size: 15px; font-weight: 800; margin-top: 28px; }
.step-label .section-sub { color: var(--muted); }

/* ---------- 会話時間の購入（時間パック） ---------- */
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 6px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.72); border: 1.5px solid rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(30,60,120,.06); color: var(--text); }
.pack:active { transform: scale(.97); }
.pack.pick { border-color: var(--brand); background: #fff; box-shadow: 0 8px 22px rgba(30,123,245,.18); }
.pk-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--field-a), var(--field-b)); padding: 2px 8px; border-radius: var(--r-pill); }
.pk-min { font-family: var(--en); font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.pk-min small { font-family: var(--jp, inherit); font-size: 12px; font-weight: 700; margin-left: 1px; }
.pk-yen { font-family: var(--en); font-size: 15px; font-weight: 700; margin-top: 4px; }
.pk-per { font-size: 11px; color: var(--muted); }

/* パック画面: 主役3枚 + 畳んだ3枚 */
.pk-note { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: center; line-height: 1.3; }
.pack-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin: 2px 0 8px; }
.pack-more { margin: 4px 0 8px; }
.pack-more summary { font-size: 13.5px; font-weight: 600; color: var(--brand); cursor: pointer; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.pack-grid.small { margin-top: 4px; }
.pack-grid.small .pack { padding: 12px 6px 10px; background: rgba(255,255,255,.55); }
.pack-grid.small .pk-min { font-size: 20px; }
/* 先生の待機: 時間消費の明示とスキップ */
.tw-cost { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
#teacher-skip { margin-top: 4px; }
/* 同意チェック */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.6; margin-top: 12px; cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }
.consent a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* 特商法 */
.legal-table { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px 12px; font-size: 13.5px; line-height: 1.6; }
.legal-table dt { color: var(--muted); font-weight: 600; }
.legal-table dd { margin: 0; }
.pricing-foot a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* 右上: ベル + ⋯ */
.top-actions { display: inline-flex; gap: 8px; align-items: center; }
.bell-btn { position: relative; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #E5484D; border: 1.5px solid #fff; }
.news-empty p { font-size: 14px; color: var(--muted); line-height: 1.8; text-align: center; padding: 14px 0; }
.news-item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.news-item:last-child { border-bottom: 0; }
.news-date { font-family: var(--en); font-size: 12px; color: var(--muted); }
.news-title { font-size: 15px; font-weight: 700; margin: 2px 0 4px; }
.news-body { font-size: 13.5px; line-height: 1.7; color: var(--text); }
/* 購入画面の注意事項 */
.notes-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.notes-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; position: relative; font-size: 13.5px; line-height: 1.6; }
.notes-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.notes-list b { font-size: 14px; }
.notes-list span { color: var(--muted); }
.notes-link { font-size: 13px; color: var(--muted); margin-top: 14px; text-align: center; }
.notes-link a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 英文を1文1行で（作文の結果・マイ辞書） ---------- */
.sent-list { display: flex; flex-direction: column; gap: 6px; }
.sent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sent-hint { font-size: 12px; color: var(--muted); }
.speak-btn.all { background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; border: 0; padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; box-shadow: 0 4px 12px rgba(30,123,245,.28); }
.speak-btn.all.on { background: #E8674A; box-shadow: 0 4px 12px rgba(232,103,74,.3); }
.sent-row { display: grid; grid-template-columns: 34px 18px 1fr; gap: 6px; align-items: start; padding: 8px 8px 8px 4px; border-radius: 12px; }
.sent-row.playing { background: rgba(30,123,245,.10); }
.sent-row .sent-play { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
.sent-num { font-size: 12px; color: var(--muted); padding-top: 8px; text-align: right; }
.sent-text { font-size: 17px; font-weight: 500; line-height: 1.6; letter-spacing: -0.005em; margin: 0; padding-top: 4px; }
.dict-body .sent-list { margin-top: 4px; }

/* 話す速さ（ピッチはそのまま） */
.rate-ctl { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 8px auto 0; max-width: 300px; }
.rate-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rate-val { font-size: 12px; color: var(--brand-deep); font-weight: 700; min-width: 34px; text-align: right; }
#rate-range { flex: 1; accent-color: var(--brand); height: 28px; }

/* ---------- 振り返り v2（プレビュー） ---------- */
.rv-panel + .rv-panel { margin-top: 10px; }
.rv-k { font-size: 12px; font-weight: 700; color: var(--brand-deep); letter-spacing: .04em; margin: 0; }
.rv-fact { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.65; padding: 6px 0; margin: 0; }
.rv-fact::before { content: "✓"; color: #1E9E63; font-weight: 800; flex: none; }
.rv-goal { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.rv-ring { width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(#1E9E63 0 var(--pct), rgba(30,158,99,.15) var(--pct) 100%); display: grid; place-items: center; flex: none; }
.rv-ring i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; font-family: var(--en); font-size: 11px; font-weight: 800; color: #1E9E63; font-style: normal; }
.rv-gt { font-size: 14.5px; font-weight: 700; }
.rv-gs { font-size: 12px; color: var(--muted); }
.rv-try { border-left: 4px solid var(--brand); padding-left: 12px; margin-top: 8px; }
.rv-big { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 0 0 4px; }
.rv-en { font-size: 16px; margin: 0; }
.rv-ja { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.rv-q { font-size: 12.5px; color: var(--muted); margin: 0; }
.rv-a { font-size: 14.5px; line-height: 1.6; margin: 6px 0 8px; }
.rv-f { color: #B7791F; background: rgba(183,121,31,.12); border-radius: 4px; padding: 0 3px; }
.rv-g { color: #1E9E63; font-weight: 700; }
.rv-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin: 2px 4px 2px 0; }
.rv-tag.good { background: rgba(30,158,99,.12); color: #1E9E63; }
.rv-tag.soft { background: rgba(183,121,31,.12); color: #B7791F; }
.rv-ans + .rv-ans { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 12px; }
.rv-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rv-learned { margin-top: 10px; background: rgba(123,77,255,.10); border: 1.5px dashed #7B4DFF; border-radius: 14px; padding: 10px 12px; animation: ta-pop .4s ease-out; }
.rv-lk { font-size: 11px; font-weight: 800; color: #7B4DFF; letter-spacing: .04em; }
.rv-len { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.rv-lja { font-size: 12.5px; color: var(--muted); }
.rv-dock-space { height: 190px; }
/* 先生ドック */
.teacher-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; pointer-events: none; }
.teacher-dock > * { pointer-events: auto; }
.teacher-dock .teacher-row { animation: td-in .5s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes td-in { from { transform: translateY(120%); opacity: 0; } to { transform: none; opacity: 1; } }
.td-bubble { padding: 12px 14px; font-size: 14px; line-height: 1.6; max-height: none; box-shadow: 0 12px 30px rgba(31,84,160,.18); }
.td-who { display: block; font-size: 11px; font-weight: 800; color: #7B4DFF; letter-spacing: .04em; margin-bottom: 4px; }
.td-you { margin: 0 0 8px 80px; border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; background: rgba(255,240,236,.9); }
.td-you .td-who { color: var(--self); }
.td-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.td-acts .speak-btn.teach { background: #7B4DFF; color: #fff; border-color: transparent; }
.td-cost { font-size: 11px; color: var(--muted); margin-top: 6px; }
.td-next { display: block; margin: 8px auto 0; border: 0; border-radius: var(--r-pill); background: rgba(27,42,68,.9); color: #fff; font-size: 12px; font-weight: 800; padding: 8px 14px; }
/* ドックの吹き出しはノート罫線ではなく、普通のチャット吹き出し */
.teacher-dock .teacher-notes.bubble.td-bubble { background: #fff; line-height: 1.6; min-height: 0; max-height: none; overflow: visible; white-space: normal; font-size: 14px; }
.teacher-dock .teacher-notes.bubble.td-bubble::before { border-right-color: #fff; }
.teacher-dock .teacher-face { align-self: flex-end; }

/* ---------- 振り返り v2: タブ / チャット / 添削 ---------- */
.rv-tabs { margin: 8px 0 14px; }
.rv-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 0 4px 12px; }
.rv-stats b { color: var(--text); font-size: 16px; margin-right: 2px; }
.rv-note { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.rv-note.top { text-align: left; margin: 0 4px 10px; }
.rv-chat { display: flex; flex-direction: column; gap: 10px; }
.rv-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.rv-msg.ai { align-self: flex-start; }
.rv-msg.you { align-self: flex-end; flex-direction: row-reverse; }
.rv-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; }
.rv-bub { padding: 10px 12px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.rv-msg.ai .rv-bub { background: rgba(255,255,255,.8); border-bottom-left-radius: 4px; }
.rv-msg.you .rv-bub { background: linear-gradient(135deg, #3B8CFF, #1E7BF5); color: #fff; border-bottom-right-radius: 4px; }
.rv-play { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(31,84,160,.25); background: rgba(255,255,255,.7); color: var(--brand-deep); display: grid; place-items: center; flex: none; padding: 0; }
.rv-play .icon { width: 16px; height: 16px; }
.rv-fix + .rv-fix { margin-top: 10px; }
.rv-orig { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 6px 0 0; }
.rv-arrow { font-size: 11.5px; font-weight: 700; color: var(--brand); margin: 8px 0 4px; }
.rv-new { font-size: 15.5px; font-weight: 700; line-height: 1.55; margin: 0; }
.rv-why { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }
/* 先生: 右下フローティング */
.teacher-dock { max-width: none; padding: 0; }
.td-fab { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; background: radial-gradient(circle at 40% 35%, #fff, #E4D7FF); box-shadow: 0 10px 24px rgba(31,84,160,.25); padding: 0; overflow: visible; animation: ta-pop .5s cubic-bezier(.2,1.4,.4,1) both; }
.td-fab img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.td-hint { position: absolute; right: 70px; bottom: 16px; white-space: nowrap; background: #fff; color: var(--text); font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 12px 12px 4px 12px; box-shadow: 0 6px 16px rgba(31,84,160,.18); }
.td-hint:empty { display: none; }
.td-panel { position: fixed; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: 456px; margin: 0 auto; animation: td-in .4s cubic-bezier(.2,.9,.3,1.1) both; }
.td-panel .td-bubble { border-radius: 16px 16px 4px 16px; }
.td-panel .td-bubble::before { display: none; }
.teacher-dock .td-next { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; }

/* ---------- 振り返り v2（本実装） ---------- */
.rv-wait { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.rv-wait .tw-dots { margin: 0; }
.rv-learn { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.rv-learn:last-child { border-bottom: 0; }
.rv-learn .en { font-size: 15px; font-weight: 700; }
.rv-learn .ja { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rv-empty { font-size: 13.5px; color: var(--muted); text-align: center; padding: 20px 0; }
/* 開始シート: 今回の狙い */
.sec-sub-inline { font-weight: 400; font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.goal-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--brand); border-radius: 14px; padding: 8px 12px; margin-bottom: 4px; }
.goal-row.off { border-color: var(--rule); background: rgba(255,255,255,.5); }
.goal-row.off .goal-text { color: var(--muted); text-decoration: line-through; }
.goal-text { flex: 1; font-size: 14px; font-weight: 700; }
.goal-row .text-btn { padding: 4px 6px; font-size: 12px; }
/* ノート: 記録/履歴 */
.notes-tabs { margin: 0 0 14px; }
.hist-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); cursor: pointer; }
.hist-title { font-size: 14.5px; font-weight: 700; }
.hist-sub { font-size: 12px; color: var(--muted); grid-column: 1; }
.hist-chev { font-size: 20px; color: var(--muted); grid-row: 1 / 3; }
.hist-exp { font-size: 11.5px; color: var(--muted); }
.hist-exp.soon { color: #B7791F; font-weight: 700; }
.hist-del { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* タブが2〜3個しかない切替は中央寄せ（余白が目立たないように） */
.rv-tabs, .notes-tabs { width: max-content; max-width: 100%; margin-left: auto; margin-right: auto; }
.rv-tabs .seg, .notes-tabs .seg { flex: none; padding: 7px 18px; }
.rv-tabs { margin-bottom: 14px; }
.tour-tip .tour-body { max-height: 38vh; overflow-y: auto; }

/* ---------- 学習メモ: 初見の説明 ---------- */
.memo-hero { margin-bottom: 12px; }
.memo-title { font-size: 19px; font-weight: 800; line-height: 1.45; letter-spacing: -.01em; margin: 2px 0 12px; }
.memo-steps { list-style: none; margin: 0 0 6px; padding: 0; counter-reset: ms; display: flex; flex-direction: column; gap: 10px; }
.memo-steps li { counter-increment: ms; display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; align-items: start; }
.memo-steps li::before { content: counter(ms); grid-row: 1 / 3; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; font-family: var(--en); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.memo-steps b { font-size: 14.5px; }
.memo-steps span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.memo-hero .primary-btn { margin-top: 12px; }
.note-card .nc-ja.q::before { content: "質問："; }
.nc-src { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(30,123,245,.12); color: var(--brand-deep); margin-right: 6px; }
/* 右下の先生: 「これが先生、タップで話せる」が分かるように。名前札 + 輪の脈動（タップで止まる） */
.td-fab { overflow: visible; }
.td-fab::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(123,77,255,.55); animation: td-ring 1.6s ease-out infinite; pointer-events: none; }
.td-fab.quiet::before { animation: none; opacity: 0; }
@keyframes td-ring { 0% { transform: scale(.9); opacity: .9; } 70% { transform: scale(1.35); opacity: 0; } 100% { transform: scale(1.35); opacity: 0; } }
.td-name { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 800; color: #fff; background: #7B4DFF; padding: 2px 9px; border-radius: 999px; box-shadow: 0 4px 10px rgba(123,77,255,.35); }
.td-fab.talking img { animation: td-talk .5s ease-in-out infinite alternate; }
@keyframes td-talk { from { transform: scale(1); } to { transform: scale(1.06); } }
.td-hint { bottom: 20px; }
.td-hint::after { content: ""; position: absolute; right: -6px; bottom: 10px; border: 6px solid transparent; border-left-color: #fff; border-right: 0; }

/* 読み上げの取得中 */
.speak-btn.loading { opacity: .6; pointer-events: none; }
.speak-btn.loading .icon { animation: spk-pulse .8s ease-in-out infinite alternate; }
@keyframes spk-pulse { from { opacity: .4; } to { opacity: 1; } }
/* 右下の先生: 名前札が画面外に出ないように（右端揃え・少し上に） */
.td-fab { bottom: calc(40px + env(safe-area-inset-bottom)); }
.td-name { left: auto; right: 0; transform: none; bottom: -24px; }
.rv-dock-space { height: 150px; }

/* ---------- ステータスカード ---------- */
.scard-wrap { perspective: 1200px; margin: 4px 0 14px; }
.scard { position: relative; width: 100%; min-height: 176px; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.3,1); cursor: pointer; }
.scard.flipped { transform: rotateY(180deg); }
.scard-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; padding: 14px 16px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--sc-a, #8C6A4A), var(--sc-b, #B08B62)); box-shadow: 0 12px 30px rgba(31,84,160,.22); }
.scard-face.back { transform: rotateY(180deg); background: linear-gradient(135deg, #2A3A5C, #1B2A44); }
.scard-face::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.scard[data-rank="bronze"] .front { --sc-a: #8C6A4A; --sc-b: #C49A6C; }
.scard[data-rank="silver"] .front { --sc-a: #6E7B8B; --sc-b: #B8C4D2; }
.scard[data-rank="gold"] .front { --sc-a: #B8860B; --sc-b: #E9C46A; }
.scard[data-rank="platinum"] .front { --sc-a: #4C6B8A; --sc-b: #A9C4DE; }
.scard[data-rank="diamond"] .front { --sc-a: #1E7BF5; --sc-b: #9BD3FF; }
.sc-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.sc-avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.85); object-fit: cover; border: 2px solid rgba(255,255,255,.8); }
.sc-id { flex: 1; min-width: 0; }
.sc-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-since { font-size: 11px; opacity: .8; }
.sc-flip { font-size: 11.5px; font-weight: 700; opacity: .85; white-space: nowrap; }
.sc-rank { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; position: relative; z-index: 1; }
.sc-rank-en { font-family: var(--en); font-size: 26px; font-weight: 800; letter-spacing: .04em; }
.sc-rank-ja { font-size: 12px; opacity: .85; }
.sc-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; opacity: .95; position: relative; z-index: 1; }
.sc-stats b { font-size: 16px; margin-right: 2px; }
.sc-gauge { height: 6px; border-radius: 3px; background: rgba(255,255,255,.28); margin-top: 12px; overflow: hidden; position: relative; z-index: 1; }
.sc-gauge i { display: block; height: 100%; background: #fff; border-radius: 3px; width: 0; transition: width .6s ease; }
.sc-next { font-size: 11.5px; opacity: .9; margin-top: 6px; position: relative; z-index: 1; }
.sc-nextline { font-size: 12.5px; margin: 8px 0 6px; opacity: .95; }
.sc-ach { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.sc-ach li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 12.5px; line-height: 1.4; align-items: start; }
.sc-ach li .m { font-size: 14px; }
.sc-ach li.done { opacity: 1; } .sc-ach li.todo { opacity: .7; }
.sc-ach li .how { display: block; font-size: 11px; opacity: .8; }
.avatar-pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.avatar-pick button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid transparent; background: rgba(255,255,255,.7); padding: 0; overflow: hidden; }
.avatar-pick button img { width: 100%; height: 100%; object-fit: cover; }
.avatar-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,123,245,.2); }
/* 裏面は実績一覧が読めるだけの高さに */
.scard.flipped { min-height: 400px; }
.scard { transition: transform .55s cubic-bezier(.2,.8,.3,1), min-height .35s ease; }
.sc-ach { max-height: none; }
.scard-face.back .sc-ach li { font-size: 13px; }

/* ---------- ステータスカード v2: 切り絵のアートワーク ---------- */
.scard { min-height: 0; aspect-ratio: 3 / 2; }
.scard.flipped { min-height: 0; aspect-ratio: auto; height: auto; }
.scard-face { padding: 14px 16px 12px; }
.scard-face::after { display: none; }
.scard-face.front { background-size: cover; background-position: right center; color: var(--text); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.scard-face.front::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.12) 45%, rgba(255,255,255,0) 70%); pointer-events: none; }
.scard[data-rank="bronze"] .front { background-image: url("/card-bronze.jpg"); }
.scard[data-rank="silver"] .front { background-image: url("/card-silver.jpg"); }
.scard[data-rank="gold"] .front { background-image: url("/card-gold.jpg"); }
.scard[data-rank="platinum"] .front, .scard[data-rank="diamond"] .front { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.scard[data-rank="platinum"] .front::before, .scard[data-rank="diamond"] .front::before { background: linear-gradient(90deg, rgba(10,20,50,.35) 0%, rgba(10,20,50,.15) 45%, rgba(10,20,50,0) 70%); }
.scard[data-rank="platinum"] .front { background-image: url("/card-platinum.jpg"); }
.scard[data-rank="diamond"] .front { background-image: url("/card-diamond.jpg"); }
.scard-face.front .sc-avatar { border-color: rgba(255,255,255,.95); box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.scard-face.front .sc-rank { margin-top: 14px; }
.scard-face.front .sc-rank-en { font-size: 30px; letter-spacing: .06em; }
.scard-face.front .sc-stats { margin-top: 10px; font-size: 12.5px; }
.scard-face.front .sc-gauge { background: rgba(0,0,0,.14); }
.scard[data-rank="platinum"] .front .sc-gauge, .scard[data-rank="diamond"] .front .sc-gauge { background: rgba(255,255,255,.3); }
.scard-face.front .sc-gauge i { background: currentColor; opacity: .85; }
.scard-face.front .sc-next { opacity: 1; font-weight: 600; }
/* 裏面: 紙の質感の明るい面。読みやすさ優先 */
.scard.flipped .scard-face.back { position: relative; }
.scard-face.back { background: #FBF7EE; color: var(--text); box-shadow: 0 12px 30px rgba(31,84,160,.18); padding-bottom: 16px; }
.scard-face.back .sc-name { color: var(--text); }
.scard-face.back .sc-flip { color: var(--brand-deep); opacity: 1; }
.sc-nextline { font-size: 13px; color: var(--muted); margin: 8px 0 10px; }
.sc-done { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sc-done span { display: inline-flex; align-items: center; gap: 4px; background: rgba(30,158,99,.12); color: #1E7B4C; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.sc-done .none { background: rgba(0,0,0,.05); color: var(--muted); font-weight: 500; }
.sc-sub { font-size: 12px; font-weight: 700; color: var(--brand-deep); margin: 0 0 6px; letter-spacing: .04em; }
.scard-face.back .sc-ach { gap: 8px; }
.scard-face.back .sc-ach li { grid-template-columns: 28px 1fr; font-size: 14px; color: var(--text); opacity: 1; }
.scard-face.back .sc-ach li .m { font-size: 18px; }
.scard-face.back .sc-ach li .how { color: var(--muted); font-size: 12px; opacity: 1; }
/* ランクアップ */
.rankup { text-align: center; position: relative; overflow: hidden; }
.ru-kicker { font-family: var(--en); font-size: 12px; font-weight: 800; letter-spacing: .3em; color: var(--brand); margin: 6px 0 10px; }
.ru-card { aspect-ratio: 3 / 2; border-radius: 16px; background-size: cover; background-position: right center; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 14px 16px; box-shadow: 0 14px 34px rgba(31,84,160,.25); animation: ru-pop .6s cubic-bezier(.2,1.3,.4,1) both; color: var(--text); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.ru-card.dark { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ru-rank-en { font-family: var(--en); font-size: 34px; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.ru-rank-ja { font-size: 13px; font-weight: 700; margin-top: 4px; }
@keyframes ru-pop { from { transform: scale(.85) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ru-title { font-size: 20px; font-weight: 800; margin: 16px 0 4px; }
.ru-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; opacity: .9; animation: cf-fall 2.6s ease-in infinite; }
.confetti i:nth-child(1) { left: 6%; background: #1E7BF5; animation-delay: 0s; } .confetti i:nth-child(2) { left: 14%; background: #E8674A; animation-delay: .3s; }
.confetti i:nth-child(3) { left: 22%; background: #E9C46A; animation-delay: .6s; } .confetti i:nth-child(4) { left: 31%; background: #1E9E63; animation-delay: .1s; }
.confetti i:nth-child(5) { left: 40%; background: #7B4DFF; animation-delay: .9s; } .confetti i:nth-child(6) { left: 49%; background: #1E7BF5; animation-delay: .4s; }
.confetti i:nth-child(7) { left: 58%; background: #E8674A; animation-delay: 1.1s; } .confetti i:nth-child(8) { left: 67%; background: #E9C46A; animation-delay: .2s; }
.confetti i:nth-child(9) { left: 76%; background: #1E9E63; animation-delay: .7s; } .confetti i:nth-child(10) { left: 85%; background: #7B4DFF; animation-delay: 1.3s; }
.confetti i:nth-child(11) { left: 92%; background: #1E7BF5; animation-delay: .5s; } .confetti i:nth-child(12) { left: 36%; background: #E8674A; animation-delay: 1.6s; }
@keyframes cf-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }

/* カード: 裏返しの透け防止（backface-visibility が iOS で効かないことがあるので visibility で切る） */
.scard-face { transition: visibility 0s linear .27s; }
.scard:not(.flipped) .scard-face.back { visibility: hidden; }
.scard.flipped .scard-face.front { visibility: hidden; }
.scard.flipped .scard-face.back { visibility: visible; }
.scard:not(.flipped) .scard-face.front { visibility: visible; }
/* 表: タップ誘導 */
.sc-tap { position: absolute; right: 12px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.75); color: var(--brand-deep); text-shadow: none; z-index: 1; }
.scard[data-rank="platinum"] .sc-tap, .scard[data-rank="diamond"] .sc-tap { background: rgba(255,255,255,.22); color: #fff; }
/* 裏: 経験値 */
.sc-xp-unit { font-size: 11px; color: var(--muted); font-weight: 700; }
.sc-gauge.back { background: rgba(31,84,160,.12); margin-top: 8px; }
.sc-gauge.back i { background: linear-gradient(90deg, var(--field-a), var(--field-b)); }
.sc-xp-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.sc-xp-list li { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--rule); }
.sc-xp-list li b { font-family: var(--en); font-weight: 700; color: var(--brand-deep); }
.sc-xp-list li.hint { grid-column: 1 / -1; border: 0; color: var(--muted); font-size: 12px; justify-content: flex-start; gap: 6px; }

/* 無音の予告 */
.idle-warn { margin: 10px auto 0; max-width: 340px; text-align: center; font-size: 13px; font-weight: 700; color: #8A5A00; background: #FFF3D6; border: 1.5px solid #E8B04A; border-radius: 12px; padding: 8px 12px; animation: idle-blink 1s ease-in-out infinite alternate; }
@keyframes idle-blink { from { opacity: 1; } to { opacity: .7; } }

/* メニューのシートは画面より高くなったらスクロール */
#menu-sheet .sheet-inner { max-height: calc(100vh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* ---------- カード裏面 v2: 紙の面に、経験値の輪と実績のメダル ---------- */
.scard.flipped { aspect-ratio: 3 / 2; }
.scard.flipped .scard-face.back { position: absolute; }
.scard-face.back { background: #FBF7EE url("/card-paper.svg"); color: var(--text); padding: 14px 16px; }
.scard-face.back::before { content: ""; position: absolute; left: -30%; top: -60%; width: 90%; height: 120%; transform: rotate(-18deg); background: var(--sc-band, rgba(30,123,245,.10)); pointer-events: none; }
.scard[data-rank="bronze"] .back { --sc-band: rgba(196,154,108,.22); }
.scard[data-rank="silver"] .back { --sc-band: rgba(110,123,139,.18); }
.scard[data-rank="gold"] .back { --sc-band: rgba(233,196,106,.28); }
.scard[data-rank="platinum"] .back { --sc-band: rgba(76,107,138,.18); }
.scard[data-rank="diamond"] .back { --sc-band: rgba(30,123,245,.16); }
.sc-back-title { font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.sc-ringrow { display: flex; align-items: center; gap: 14px; margin-top: 8px; position: relative; z-index: 1; }
.sc-ring { width: 84px; height: 84px; border-radius: 50%; flex: none; background: conic-gradient(var(--brand) 0 var(--pct, 0%), rgba(31,84,160,.12) var(--pct, 0%) 100%); display: grid; place-items: center; }
.sc-ring-in { width: 66px; height: 66px; border-radius: 50%; background: #FBF7EE; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.sc-ring-in b { font-family: var(--en); font-size: 20px; font-weight: 800; color: var(--brand-deep); }
.sc-ring-in small { font-size: 9px; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }
.sc-rank-now { font-size: 14.5px; font-weight: 800; }
.sc-ringtext .sc-nextline { margin: 2px 0 0; font-size: 12.5px; }
.sc-medals { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.sc-medal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: #fff; border: 1.5px solid rgba(31,84,160,.18); box-shadow: 0 2px 6px rgba(31,84,160,.1); }
.sc-medal.locked { background: rgba(0,0,0,.05); border-color: transparent; box-shadow: none; filter: grayscale(1); opacity: .45; }
/* カードの下のブロック（裏面のときだけ） */
.sc-blocks { margin: -2px 0 14px; }
.sc-tiles { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sc-tile { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; padding: 10px 12px; }
.sc-tile .m { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 20px; }
.sc-tile .t { font-size: 14px; font-weight: 700; }
.sc-tile .h { font-size: 12px; color: var(--muted); line-height: 1.4; }
.sc-tile .xp { font-family: var(--en); font-weight: 800; color: var(--brand); font-size: 13px; white-space: nowrap; }
.sc-breakdown { margin-top: 10px; }
.sc-breakdown summary { font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.sc-breakdown .sc-xp-list { margin-top: 4px; }

/* ---------- カード裏面 v3: 表と同じ素材（同じ切り絵）に、すりガラスの面を重ねる ---------- */
.scard-face.back { background-size: cover; background-position: right center; }
.scard[data-rank="bronze"] .back { background-image: url("/card-bronze.jpg"); }
.scard[data-rank="silver"] .back { background-image: url("/card-silver.jpg"); }
.scard[data-rank="gold"] .back { background-image: url("/card-gold.jpg"); }
.scard[data-rank="platinum"] .back { background-image: url("/card-platinum.jpg"); }
.scard[data-rank="diamond"] .back { background-image: url("/card-diamond.jpg"); }
.scard-face.back::before { content: ""; position: absolute; inset: 0; transform: none; left: 0; top: 0; width: auto; height: auto; background: rgba(251,247,238,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.scard[data-rank="platinum"] .back::before, .scard[data-rank="diamond"] .back::before { background: rgba(20,32,60,.66); }
.scard[data-rank="platinum"] .back, .scard[data-rank="diamond"] .back { color: #fff; }
.scard[data-rank="platinum"] .back .sc-back-title, .scard[data-rank="diamond"] .back .sc-back-title, .scard[data-rank="platinum"] .back .sc-nextline, .scard[data-rank="diamond"] .back .sc-nextline, .scard[data-rank="platinum"] .back .sc-medal-info, .scard[data-rank="diamond"] .back .sc-medal-info { color: rgba(255,255,255,.85); }
.scard[data-rank="platinum"] .back .sc-ring-in, .scard[data-rank="diamond"] .back .sc-ring-in { background: rgba(20,32,60,.85); }
.scard[data-rank="platinum"] .back .sc-ring-in b, .scard[data-rank="diamond"] .back .sc-ring-in b { color: #fff; }
.scard[data-rank="platinum"] .back .sc-ring, .scard[data-rank="diamond"] .back .sc-ring { background: conic-gradient(#9BD3FF 0 var(--pct, 0%), rgba(255,255,255,.18) var(--pct, 0%) 100%); }
.scard[data-rank="platinum"] .back .sc-flip, .scard[data-rank="diamond"] .back .sc-flip { color: #fff; }
.sc-ring-in { background: rgba(251,247,238,.95); }
.sc-flip-btn { border: 0; background: rgba(255,255,255,.55); border-radius: 999px; padding: 6px 10px; font-family: var(--jp); font-size: 11.5px; font-weight: 800; color: var(--brand-deep); }
.scard[data-rank="platinum"] .back .sc-flip-btn, .scard[data-rank="diamond"] .back .sc-flip-btn { background: rgba(255,255,255,.18); }
/* メダル: 切り絵のアイコン。タップで説明（裏返さない） */
.sc-medals { gap: 7px; margin-top: 10px; }
.sc-medal { width: 34px; height: 34px; padding: 0; border: 2px solid rgba(255,255,255,.9); background: #fff; overflow: hidden; box-shadow: 0 2px 6px rgba(31,84,160,.16); cursor: pointer; }
.sc-medal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-medal.locked { filter: grayscale(1); opacity: .42; border-color: transparent; box-shadow: none; }
.sc-medal.sel { outline: 2.5px solid var(--brand); outline-offset: 1px; opacity: 1; }
.sc-medal.locked.sel { filter: grayscale(.6); opacity: .8; }
.sc-medal-info { font-size: 12px; color: var(--muted); margin: 8px 0 0; min-height: 18px; line-height: 1.5; position: relative; z-index: 1; }
.sc-medal-info b { color: inherit; }
/* タイルにも同じアイコン */
.sc-tile .m { overflow: hidden; padding: 0; }
.sc-tile .m img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 裏面は中身に合わせて伸びる（メダル2段＋説明が収まる） */
.scard.flipped { aspect-ratio: auto; min-height: 220px; }
.scard.flipped .scard-face.back { position: relative; }
.scard.flipped .scard-face.front { position: absolute; }
/* メダルの説明は常に2行ぶんの高さを確保（1行/2行でカードの高さが動かないように） */
.sc-medal-info { min-height: 36px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- メニュー: 見出しと「閉じる」は固定、中だけスクロール ---------- */
.menu-inner { max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: hidden; }
.menu-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; margin: 0 -6px; padding: 2px 6px; }
.sheet-head.row { flex-direction: row; align-items: center; justify-content: space-between; }
.sheet-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); color: var(--brand-deep); font-size: 20px; line-height: 1; }
.sheet-foot { padding-top: 4px; }
.sheet-foot .outline-btn { width: 100%; }
.sheet-foot .menu-foot { margin-top: 8px; }
#menu-sheet .sheet-inner { max-height: calc(100vh - 24px); }
/* コンパクトなステータス */
.scard-mini { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; padding: 10px 12px 14px; border-radius: 16px; overflow: hidden; color: var(--text); background: #DDE6F3 center/cover; box-shadow: 0 8px 22px rgba(31,84,160,.16); margin-bottom: 10px; font-family: var(--jp); }
.scard-mini::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.55), rgba(255,255,255,.25) 60%, rgba(255,255,255,0)); }
.scard-mini.dark { color: #fff; }
.scard-mini.dark::before { background: linear-gradient(90deg, rgba(10,20,50,.5), rgba(10,20,50,.25) 60%, rgba(10,20,50,0)); }
.scard-mini > * { position: relative; z-index: 1; }
.sm-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.9); background: #fff; }
.sm-text { display: flex; flex-direction: column; min-width: 0; }
.sm-name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-rank { font-family: var(--en); font-size: 12px; font-weight: 800; letter-spacing: .08em; opacity: .9; }
.sm-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sm-xp { font-family: var(--en); font-size: 12px; font-weight: 800; }
.sm-chev { font-size: 11px; font-weight: 700; opacity: .85; white-space: nowrap; }
.sm-gauge { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.14); z-index: 1; }
.scard-mini.dark .sm-gauge { background: rgba(255,255,255,.3); }
.sm-gauge i { display: block; height: 100%; border-radius: 2px; background: currentColor; opacity: .85; }
/* カードのシート内では上下の余白を詰める */
#card-sheet .scard-wrap { margin-top: 2px; }

/* ---------- 開始シート: 所要時間を大きく ---------- */
.start-time { display: grid; grid-template-columns: auto auto auto 1fr; align-items: baseline; gap: 4px 8px; margin: 6px 0 4px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.55); }
.start-time .st-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.start-time .num { font-size: 28px; font-weight: 800; color: var(--brand-deep); line-height: 1; }
.start-time .st-unit { font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.start-time .st-note { font-size: 11.5px; color: var(--muted); text-align: right; }
.start-time.free .st-note { grid-column: 1 / -1; text-align: left; }
/* トレーニングカードの時間 */
.training-card .t-time { font-family: var(--en); font-size: 11px; font-weight: 800; color: var(--brand-deep); background: rgba(255,255,255,.6); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
/* ---------- アカウント ---------- */
.acct-who { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.acct-who strong { color: var(--text); font-weight: 600; }
.quota-hero { position: relative; border-radius: 20px; padding: 16px 18px 14px; color: #fff; background: linear-gradient(135deg, #3B8CFF, #1E7BF5 60%, #1F54A0); box-shadow: 0 12px 30px rgba(30,123,245,.32); margin-bottom: 4px; }
.qh-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; opacity: .9; margin: 0; }
.qh-num { margin: 2px 0 8px; line-height: 1; }
.qh-num b { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.qh-num span { font-size: 16px; font-weight: 700; margin-left: 4px; }
.quota-hero .bar { background: rgba(255,255,255,.28); height: 8px; border-radius: 4px; overflow: hidden; }
.quota-hero .bar i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.qh-line { font-size: 12px; opacity: .92; margin: 8px 0 12px; }
.qh-btn { width: 100%; border: 0; border-radius: var(--r-pill); min-height: 46px; background: #fff; color: var(--brand-deep); font-family: var(--jp); font-size: 15px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.qh-foot { font-size: 11.5px; opacity: .85; margin: 10px 0 0; line-height: 1.5; }
.acct-manage { display: flex; flex-direction: column; gap: 8px; }
.text-btn.danger { color: #C2314B; }
.danger-btn { background: linear-gradient(135deg, #E8674A, #C2314B) !important; box-shadow: 0 6px 18px rgba(194,49,75,.3) !important; }
.danger-btn:disabled { opacity: .45; }
.del-list { margin: 0 0 8px; padding-left: 20px; font-size: 13.5px; line-height: 1.8; }
/* 開始シートの所要時間は1行に（低い画面でも「始める」が見えるように） */
.start-time { grid-template-columns: auto auto auto 1fr; padding: 6px 12px; margin: 4px 0 2px; align-items: center; }
.start-time .num { font-size: 22px; }
.start-time .st-note { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-time.free .st-note { grid-column: auto; text-align: right; }
.start-sheet .start-label { margin-top: 10px; }

/* ---------- アカウント: プロフィールをコンパクトに ---------- */
.profile-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.pp-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px; }
.pp-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pp-input { margin: 0; }
.avatar-pick.compact { margin: 0; gap: 6px; }
.avatar-pick.compact button { width: 36px; height: 36px; }
.acct-manage-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.acct-manage-row .dot { color: var(--muted); }
/* ---------- 残り時間の見せ方 ---------- */
.home-quota { display: inline-flex; align-items: baseline; gap: 3px; margin: 8px auto 0; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--brand-deep); font-size: 13px; font-weight: 700; box-shadow: 0 4px 12px rgba(31,84,160,.1); }
.home-quota .num { font-size: 20px; font-weight: 800; }
.home-quota.inline { margin: 2px 0 10px; }
.big-mic-wrap .home-quota { display: inline-flex; }
.start-quota { display: grid; grid-template-columns: auto auto auto 1fr; align-items: baseline; gap: 4px 8px; margin: 4px 0 2px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.55); }
.sq-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.start-quota .num { font-size: 22px; font-weight: 800; color: var(--brand-deep); line-height: 1; }
.sq-unit { font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.sq-targets { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-time { display: none; }
.training-card .t-time { display: none; }
/* 使いたかった一行 */
.rv-tg { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.rv-tg:last-child { border-bottom: 0; }
.rv-tg .en { font-weight: 700; }
.rv-tg .ev { font-size: 12px; color: var(--muted); }
.rv-tg.used .mk { color: #1E9E63; font-weight: 800; }
.rv-tg.miss .mk { color: var(--muted); }
.note-card .nc-target { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(30,158,99,.12); color: #1E7B4C; margin-right: 6px; }

/* ---------- アカウント: 1画面に収める ---------- */
.quota-hero { padding: 12px 16px 12px; border-radius: 18px; }
.qh-num { margin: 0 0 6px; }
.qh-num b { font-size: 36px; }
.qh-line { margin: 6px 0 10px; }
.qh-btn { min-height: 42px; font-size: 14px; }
.qh-foot { margin-top: 8px; font-size: 11px; }
.profile-panel { margin-top: 10px; padding: 10px 14px; gap: 8px; }
.acct-manage-row { margin-top: 10px; }
.consent.small { justify-content: center; font-size: 12px; color: var(--muted); margin-top: 6px; align-items: center; }
.consent.small input { width: 16px; height: 16px; margin: 0; }
.acct-who { margin-bottom: 8px; }
/* トレーニング: STEP 2 と同じ行に残り時間 */
.step-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.step-quota { font-size: 12.5px; color: var(--brand-deep); font-weight: 700; white-space: nowrap; }
.step-quota .num { font-size: 16px; font-weight: 800; }
.training-card .t-num { display: none; }
.start-quota { display: none; }
.start-targets { font-size: 12px; color: var(--muted); text-align: center; margin: 2px 0 4px; }
/* ---------- カンペ（練習中のフレーズ） ---------- */
.cc-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 8px auto 0; flex-wrap: wrap; }
.cc-row .cc-toggle { margin: 0; }
.cue-btn .cue-ico { margin-right: 4px; }
.cue-panel { margin: 10px auto 0; max-width: 360px; max-height: 190px; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; padding: 4px 14px 6px; background: rgba(255,255,255,.72); border: 1.5px solid var(--glass-edge); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-align: left; }
.cue-foot { margin: 6px 0 2px; font-size: 10.5px; color: var(--muted); text-align: center; }
.cue-line { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.cue-line:last-child { border-bottom: 0; }
.cue-line .en { font-size: 14.5px; font-weight: 700; color: var(--brand-deep); line-height: 1.4; }
.cue-line .ja { font-size: 11.5px; color: var(--muted); }
.cue-line .uses { font-size: 10.5px; color: #1E7B4C; font-weight: 700; margin-left: 6px; white-space: nowrap; }
.start-targets { display: none; }
/* ---------- 発音ボタン: 再生中はバーが動く。押すと止まる ---------- */
.speak-btn.playing { color: var(--brand); border-color: var(--brand); }
.speak-btn.playing .icon .bar { transform-origin: center; animation: spk-bar .7s ease-in-out infinite alternate; }
.speak-btn.playing .icon .b2 { animation-delay: .15s; }
.speak-btn.playing .icon .b3 { animation-delay: .3s; }
@keyframes spk-bar { from { transform: scaleY(.45); } to { transform: scaleY(1.15); } }
/* 学習メモ: 言えた回数 */
.nc-uses { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(30,158,99,.12); color: #1E7B4C; margin-right: 6px; }
/* アカウント: 393×660 でスクロールなしに収める（第2弾） */
#screen-settings .back-row { margin: 0 0 2px; }
#screen-settings .back-row .text-btn { padding: 4px 0; min-height: 0; }
#screen-settings .page-title { margin: 2px 0 2px; font-size: 24px; }
.acct-who { margin: -2px 0 6px; font-size: 12px; }
.quota-hero { padding: 10px 14px 10px; }
.qh-label { font-size: 11px; }
.qh-num { margin: 0 0 4px; }
.qh-num b { font-size: 32px; line-height: 1.1; }
.quota-hero .bar { height: 5px; }
.qh-line { margin: 5px 0 8px; font-size: 12px; }
.qh-btn { min-height: 38px; }
.qh-foot { margin-top: 6px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-panel { margin-top: 8px; padding: 8px 10px; gap: 6px; }
.pp-row { min-height: 40px; }
.pp-row.pp-av { grid-template-columns: 1fr; gap: 3px; min-height: 0; }
.avatar-pick.compact { gap: 4px; flex-wrap: nowrap; }
.avatar-pick.compact button { width: 31px; height: 31px; flex: 0 0 31px; }
.acct-manage-row { margin-top: 6px; }
.acct-manage-row .text-btn { padding: 4px 8px; min-height: 0; }
.consent.small { margin-top: 2px; }

/* ---------- ステータスカード: 2段階の裏返し（半回転→面を替えて高さを合わせる→残り半回転） ---------- */
.scard.turning { transition: transform .24s ease-in, height .26s ease; overflow: visible; }
.scard.turning.second { transition: transform .26s ease-out, height .26s ease; }
.scard.half { transform: rotateY(90deg) !important; }
.scard.turning .scard-face { transition: none; }
.scard.turning .scard-face.back, .scard.turning .scard-face.front { position: absolute; }
/* ---------- 記録: 数字タップで絞り込み ---------- */
.loop-stat { border: 0; background: transparent; font-family: var(--jp); padding: 4px 10px; border-radius: 12px; cursor: pointer; }
.loop-stat.on { background: rgba(30,123,245,.12); }
.loop-stat.on .loop-l { color: var(--brand-deep); font-weight: 700; }
.loop-filter-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin: -2px 2px 8px; }
.loop-filter-row .text-btn { padding: 4px 8px; min-height: 0; font-size: 12px; }
.recovered-wrap.forced > summary { pointer-events: none; }
/* ---------- 会話時間がなくなった案内 ---------- */
.quota-out { text-align: center; padding-top: 22px; }
.qo-ico { font-size: 40px; margin: 0; }
.qo-title { font-size: 19px; margin: 6px 0 8px; }
.qo-body { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0 0 16px; }
.qo-body span { display: block; font-size: 12px; margin-top: 6px; }
.quota-out .primary-btn { width: 100%; }
.quota-out .text-btn.center { display: block; margin: 8px auto 0; }
/* 枠切れ案内はコンパクトに（ツアーで吹き出しと同居できる高さ） */
.quota-out { padding-top: 12px; }
.qo-ico { font-size: 28px; line-height: 1.2; }
.qo-title { font-size: 17px; margin: 4px 0 6px; }
.qo-body { font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }
.qo-body br { display: none; }
.quota-out .primary-btn { min-height: 46px; }
.quota-out .text-btn.center { margin-top: 4px; min-height: 36px; }

/* ---------- ツアー: 吹き出し内の見本 ---------- */
.tour-preview { margin: 6px 0 10px; }
.tp-card { background: #fff; border-radius: 14px; padding: 12px 14px; text-align: center; box-shadow: 0 6px 18px rgba(31,84,160,.14); border: 1px solid var(--rule); }
.tp-ico { font-size: 22px; line-height: 1.2; }
.tp-title { font-size: 14px; font-weight: 800; color: var(--text); margin-top: 2px; }
.tp-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tp-btn { margin-top: 8px; background: linear-gradient(135deg, var(--field-a), var(--field-b)); color: #fff; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 8px 0; }
.tp-later { font-size: 11px; color: var(--muted); margin-top: 6px; }
/* ---------- ステータスカード: 裏面も表と同じ 3:2（大きさが変わらない） ---------- */
.scard.flipped { aspect-ratio: 3 / 2; min-height: 0; height: auto; }
.scard.flipped .scard-face.back { position: absolute; overflow: hidden; }
.scard-face.back { padding: 12px 14px 10px; }
.sc-ringrow { gap: 12px; margin-top: 6px; }
.sc-ring { width: 64px; height: 64px; }
.sc-ring-in { width: 50px; height: 50px; }
.sc-ring-in b { font-size: 16px; }
.sc-ring-in small { font-size: 8px; }
.sc-rank-now { font-size: 14px; }
.sc-nextline { font-size: 11.5px; }
.sc-medals { gap: 6px; margin-top: 8px; }
.sc-medal { width: 30px; height: 30px; }
.sc-medal-info { margin-top: 6px; min-height: 32px; line-height: 16px; font-size: 11.5px; }
/* ツアー: ここへの行き方 */
.tour-from { display: inline-block; margin: 4px 0 2px; font-size: 11.5px; font-weight: 700; color: var(--brand-deep); background: rgba(30,123,245,.1); border-radius: 999px; padding: 3px 10px; }
/* お問い合わせ（外部フォーム） */
a.contact-btn { display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.contact-btn .ext { font-size: 12px; opacity: .7; }
.contact-note { font-size: 12px; color: var(--muted); margin: 6px 2px 2px; }
.tour-box.nospot::after { display: none; }
.tour-box.nospot { border-radius: 0; }
/* メニュー: iPhoneのSafariでは 100vh がツールバー分だけ大きく、上の角が画面外に出る → dvh */
.menu-inner, #menu-sheet .sheet-inner { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top)); }
/* インストール案内: 一覧と切り離した控えめなカード */
.menu-install-wrap { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--rule); }
.menu-item.menu-install { background: rgba(120,135,160,.10); border: 1.5px dashed rgba(90,110,140,.35); color: var(--muted); border-radius: 14px; }
.menu-item.menu-install .icon { color: var(--muted); }
.menu-item.menu-install .mi-sub { color: var(--muted); opacity: .85; }
.menu-item.menu-install::after { content: "›"; color: var(--muted); opacity: .6; }
.menu-scroll { overscroll-behavior: contain; }
#menu-sheet .scard-wrap { touch-action: pan-y; }
.acct-pw-row { text-align: center; margin: 0; }
.acct-pw-row .text-btn { font-size: 12px; color: var(--muted); padding: 2px 8px; min-height: 0; }
#pw-sheet .cfg-label { margin-top: 10px; }
#pw-sheet .primary-btn { width: 100%; margin-top: 14px; }
#pw-sheet .text-btn.center { display: block; margin: 6px auto 0; }
#pw-sheet .err { color: var(--self); font-size: 13px; margin: 8px 0 0; }
/* パスワードを忘れた導線 */
.forgot-row { text-align: center; margin: 6px 0 0; }
.forgot-row .text-btn { font-size: 12.5px; color: var(--muted); min-height: 0; padding: 4px 8px; }
.forgot-row.hi .text-btn { color: var(--brand-deep); font-weight: 700; text-decoration: underline; }
.forgot-body { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0 0 12px; }
.forgot-body b { color: var(--text); }
#forgot-sheet .primary-btn { margin-top: 12px; width: 100%; }
#forgot-sheet .text-btn.center { display: block; margin: 6px auto 0; }
/* アカウント: パスワード変更はログアウトと同じ段・同じ大きさで */
.acct-manage-row { flex-wrap: wrap; gap: 6px; }
.acct-manage-row .text-btn { font-size: 14px; font-weight: 700; }
.acct-manage-row .text-btn.pw { color: var(--brand-deep); }
/* 開始シート: 本番はいつ？（1回だけ） */
.urgency-row { margin-bottom: 4px; }
.urgency-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.urgency-chips .chip { border: 1.5px solid rgba(31,84,160,.22); background: rgba(255,255,255,.6); color: var(--brand-deep); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; font-family: var(--jp); }
/* お知らせ: 一覧は日時＋見出し、タップで本文 */
.news-list { padding: 4px 14px; }
button.news-item { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date chev" "title chev"; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 0; border-bottom: 1px solid var(--rule); font-family: var(--jp); color: var(--text); }
button.news-item:last-child { border-bottom: 0; }
button.news-item .news-date { grid-area: date; }
button.news-item .news-title { grid-area: title; margin: 2px 0 0; }
button.news-item .news-chev { grid-area: chev; color: var(--muted); font-size: 20px; padding-left: 8px; }
#news-sheet .news-date { margin: 0 0 8px; }
.news-body.md p { margin: 0 0 12px; font-size: 14px; line-height: 1.8; }
.news-body.md h3 { font-size: 14.5px; margin: 14px 0 6px; color: var(--brand-deep); }
.news-body.md ul { margin: 0 0 12px; padding-left: 18px; }
.news-body.md li { font-size: 14px; line-height: 1.8; margin-bottom: 6px; }
/* ステージング帯 */
.staging-ribbon { position: fixed; top: 0; left: 0; right: 0; z-index: 99; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #fff; background: repeating-linear-gradient(45deg, #E8674A 0 12px, #C9502F 12px 24px); padding: 2px 0; pointer-events: none; }
/* 登録の説明 */
.reg-lead { font-size: 12.5px; color: var(--muted); margin: 6px 0 8px; line-height: 1.6; }
.reg-lead b { color: var(--brand-deep); }
/* 回収チャレンジ: ホームの帯 */
.home-mission { display: inline-flex; align-items: center; gap: 6px; margin: 8px auto 0; border: 1.5px solid rgba(31,84,160,.2); background: rgba(255,255,255,.75); color: var(--brand-deep); border-radius: 999px; padding: 7px 14px; font-family: var(--jp); font-size: 12.5px; font-weight: 700; }
.home-mission.ready { background: linear-gradient(135deg, #FFD36E, #FFB347); color: #5A3A00; border-color: transparent; box-shadow: 0 6px 16px rgba(255,179,71,.35); }
/* カード裏面: 特別ミッション */
.sc-mission { margin: 0 0 12px; }
.mission-card { border-radius: 14px; padding: 12px 14px; background: linear-gradient(135deg, rgba(255,211,110,.35), rgba(255,255,255,.7)); border: 1.5px solid rgba(255,179,71,.5); }
.mission-card .m-title { font-size: 14.5px; font-weight: 800; color: var(--text); }
.mission-card .m-body { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.mission-card .m-btn { width: 100%; margin-top: 10px; min-height: 42px; font-size: 14px; background: linear-gradient(135deg, #FFB347, #FF8C42); box-shadow: 0 6px 16px rgba(255,140,66,.3); }
.tp-card.mission { background: linear-gradient(135deg, rgba(255,211,110,.35), #fff); border-color: rgba(255,179,71,.5); }
.tp-card.mission .tp-btn { background: linear-gradient(135deg, #FFB347, #FF8C42); }
/* 回収チャレンジの文脈ヒント（添削タブ・開始シート） */
.mission-hint { border-radius: 12px; padding: 9px 12px; margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: #5A3A00; background: linear-gradient(135deg, rgba(255,211,110,.35), rgba(255,255,255,.75)); border: 1.5px solid rgba(255,179,71,.5); }
.mission-hint b { color: #7A4B00; }
