:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #17202e;
  --muted: #5b6678;
  --line: #d9e0ea;
  --primary: #8c1f3a;
  --primary-ink: #ffffff;
  --ok: #1a8a4c;
  --ok-bg: #e3f5ea;
  --ng: #c93a3a;
  --ng-bg: #fbe6e6;
  --lvverb: #2e9d6a;
  --lvnoun: #2f6fd1;
  --lvadj: #7a4fd0;
  --lvadv: #c77a12;
  --lvidiom: #0f8a8a;
  --lvall: #3c4658;
  --lvbook: #c2410c;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141c;
    --surface: #18202c;
    --surface-2: #212b3a;
    --text: #e8edf5;
    --muted: #9aa6b8;
    --line: #2d3848;
    --primary: #e57a93;
    --primary-ink: #0b1220;
    --ok: #4cc585;
    --ok-bg: #173526;
    --ng: #f07474;
    --ng-bg: #3b1d1f;
    --lvverb: #4cc58e;
    --lvnoun: #6a9cf0;
    --lvadj: #a585ee;
    --lvadv: #e8a54a;
    --lvidiom: #3fc3c3;
    --lvall: #aab6c8;
    --lvbook: #fb923c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141c; --surface: #18202c; --surface-2: #212b3a; --text: #e8edf5; --muted: #9aa6b8;
  --line: #2d3848; --primary: #e57a93; --primary-ink: #0b1220; --ok: #4cc585; --ok-bg: #173526;
  --ng: #f07474; --ng-bg: #3b1d1f; --lvverb: #4cc58e; --lvnoun: #6a9cf0; --lvadj: #a585ee;
  --lvadv: #e8a54a; --lvidiom: #3fc3c3; --lvall: #aab6c8; --lvbook: #fb923c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
kbd {
  font-family: Inter, sans-serif;
  font-size: .75em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 .4em;
  background: var(--surface);
  color: var(--muted);
}

/* ヘッダー */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0; }
.brand-mark {
  background: var(--primary); color: var(--primary-ink);
  font-weight: 700; font-size: 13px; border-radius: 8px; padding: 4px 7px;
}
.brand-text { font-weight: 700; font-size: 16px; }
.brand-text b { font-family: Inter, sans-serif; color: var(--primary); margin-left: 2px; }
.icon-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 12px 5px 8px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 0; }
.icon-btn svg .wave { fill: none; stroke-width: 2; stroke-linecap: round; }
.icon-btn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); }
.icon-btn[aria-pressed="false"] svg .wave { display: none; }

/* 効果音：音符。OFF のときは斜線を出す */
#sfxToggle svg { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sfxToggle svg circle { fill: currentColor; stroke: none; }
#sfxToggle svg .slash { display: none; }
#sfxToggle[aria-pressed="false"] svg .slash { display: inline; }
.topbar-right { display: flex; gap: 6px; flex: none; }
.icon-btn { white-space: nowrap; }
/* スマホ幅では効果音ボタンは音符アイコンだけ（自動発音と並べても見出しを押し出さない） */
@media (max-width: 440px) {
  #sfxToggle { padding: 5px 8px; }
  #sfxToggle span { display: none; }
}

main { width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }

/* ホーム */
.hero h1 { font-size: 26px; line-height: 1.35; margin: 8px 0 6px; }
.hero p { margin: 0 0 20px; color: var(--muted); }
.sp { display: none; }

.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.level {
  --c: var(--lvall);
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 12px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
}
.level:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.level:active { transform: scale(.99); }
.level[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.level[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff;
  font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
/* 単語帳は1行まるごと（品詞5つ＋全部で2列が埋まるので、その下に置く） */
.level.book { grid-column: 1 / -1; }
.lv-name { font-family: "Noto Sans JP", sans-serif; font-weight: 800; font-size: 24px; color: var(--c); line-height: 1.1; }
.lv-name small { font-family: "Noto Sans JP", sans-serif; font-size: 14px; font-weight: 700; margin-left: 2px; }
.level.all .lv-name { font-size: 20px; font-family: "Noto Sans JP", sans-serif; }
.lv-sub { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.lv-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.lv-bar i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.lv-stat { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }
.lv-stat b { color: var(--text); font-weight: 700; }

.options {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 16px; margin-bottom: 20px;
}
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt label, .opt-label { font-size: 14px; font-weight: 700; }
select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 180px;
}
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0; background: transparent; border-radius: 8px; padding: 5px 11px; font-size: 13px;
  cursor: pointer; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--primary-ink) 40%, transparent); opacity: .8; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.note { color: var(--muted); font-size: 13px; text-align: center; min-height: 1.6em; margin: 8px 0 0; }
.note.warn { color: var(--ng); }

.howto { margin-top: 24px; font-size: 14px; color: var(--muted); }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ul { padding-left: 1.2em; }

/* クイズ */
.quiz-head { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width .25s; }
.counter { font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); min-width: 56px; text-align: right; }
.score-line { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 10px; font-size: 14px; color: var(--muted); }
.score-line b { color: var(--ok); font-family: Inter, sans-serif; }
.lv-chip { --c: var(--lvall); font-size: 12px; font-weight: 700; color: #fff; background: var(--c); border-radius: 999px; padding: 2px 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.question { padding: 18px 20px 22px; text-align: center; margin-bottom: 16px; }
.q-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.pos { display: inline-block; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: 1px 8px; }
.q-word-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.q-word { font-family: Inter, sans-serif; font-weight: 800; font-size: 44px; line-height: 1.15; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.q-word.ja { font-family: "Noto Sans JP", sans-serif; font-weight: 700; font-size: 32px; }
.q-ipa { color: var(--muted); font-size: 16px; margin-top: 4px; min-height: 1.6em; }
.speak {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-size: 20px; line-height: 1;
}
.speak:hover { border-color: var(--primary); }
.speak.small { width: 32px; height: 32px; font-size: 15px; }
/* リスニング（音声 → 意味）：答えるまで英単語を隠し、大きな🔊だけ出す */
.question.listen .q-word { display: none; }
.question.listen .speak { width: 88px; height: 88px; font-size: 40px; border-width: 2px; border-color: var(--primary); }
.q-listen-hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 13px 16px; cursor: pointer; font-size: 17px; font-weight: 500; min-height: 58px;
  transition: border-color .12s, background .12s;
}
.choice:hover:not(:disabled) { border-color: var(--primary); }
.choice .num {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2);
  display: grid; place-items: center; font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; color: var(--muted);
}
.choice .txt { flex: 1; }
.choice.en .txt { font-family: Inter, sans-serif; font-weight: 700; font-size: 19px; }
.choice .mark { flex: none; font-weight: 800; font-size: 18px; }
.choice:disabled { cursor: default; }
.choice.correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.correct .num { background: var(--ok); color: #fff; }
.choice.correct .mark::before { content: "○"; color: var(--ok); }
.choice.wrong { border-color: var(--ng); background: var(--ng-bg); }
.choice.wrong .num { background: var(--ng); color: #fff; }
.choice.wrong .mark::before { content: "×"; color: var(--ng); }
.choice.dim { opacity: .55; }
/* わからない（スキップ）：4択より一段控えめに */
.btn.skip {
  width: 100%; margin-top: 10px; min-height: 48px; background: transparent;
  border: 2px dashed var(--line); color: var(--muted); font-weight: 700;
}
.btn.skip:disabled { opacity: .4; cursor: default; }
.btn.skip.chosen { opacity: 1; border-style: solid; border-color: var(--muted); color: var(--text); }

.feedback { margin-top: 16px; }
.verdict { font-weight: 800; font-size: 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.verdict.ok { color: var(--ok); }
.verdict.ng { color: var(--ng); }
.verdict.skip { color: var(--muted); }
.detail { overflow: hidden; margin-bottom: 14px; }
/* 判定の行：左に判定、右に「次へ →」（下の大きい「次へ」と同じ動き） */
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-bottom: 10px; }
.verdict-row .verdict { margin-bottom: 0; min-width: 0; }
/* 「☆ 単語帳」と「次へ →」の組。判定の右の空きを埋め、単語帳ボタンはその真ん中、次へは右端。
   入りきらない幅（スマホで「？ わからない（不正解扱い）」のとき）は組ごと次の行へ回る */
.v-actions { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v-actions::before { content: ""; }
#bookBtnTop { margin-left: 0; padding: 7px 14px; }
#nextBtnTop { flex: none; padding: 8px 16px; font-size: 14px; }
.book-btn .bk-short { display: none; }
/* スマホ幅：いちばん長い「？ わからない（不正解扱い）」と「結果を見る →」も1行に収める（正解・不正解の大きさは変えない） */
@media (max-width: 440px) {
  #nextBtnTop { padding: 8px 12px; }
  .verdict.skip { font-size: 16px; }
  /* 判定の行の単語帳ボタンは短い表示（☆ 単語帳／★ 追加済み）。解説カードの方は長いまま */
  #bookBtnTop { padding: 7px 10px; }
  #bookBtnTop .bk-long { display: none; }
  #bookBtnTop .bk-short { display: inline; }
}
.detail { overflow: hidden; margin-bottom: 14px; }
/* 写真は切り抜かず全体を表示する（元画像は 1200x670 → 560x313） */
.detail-img { display: block; width: 100%; height: auto; aspect-ratio: 560 / 313; object-fit: contain; background: var(--surface-2); }
.detail-body { padding: 14px 18px 16px; }
.d-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-word { font-family: Inter, sans-serif; font-weight: 800; font-size: 24px; }
.d-ipa { color: var(--muted); }
/* 単語帳に追加（解説カードの見出しの右端） */
.book-btn {
  margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.book-btn:hover { border-color: var(--lvbook); color: var(--lvbook); }
.book-btn[aria-pressed="true"] { border-color: var(--lvbook); color: var(--lvbook); background: color-mix(in srgb, var(--lvbook) 10%, var(--surface)); }
.d-kana { color: var(--muted); font-size: 13px; }
.d-kana b { color: var(--text); }            /* アクセントの位置（Excel の太字） */
.d-lv { font-size: 11px; font-weight: 700; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; padding: 0 6px; }
.d-sub { margin: -6px 0 10px; font-size: 13px; color: var(--muted); }
.d-sub div + div { margin-top: 2px; }
.d-list .def { font-family: Inter, sans-serif; font-style: italic; }
.d-meaning { font-size: 18px; font-weight: 700; margin: 6px 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-list { margin: 0; display: grid; gap: 8px; }
.d-list div { display: grid; grid-template-columns: 56px 1fr; gap: 10px; font-size: 14px; }
.d-list dt { color: var(--muted); font-weight: 700; font-size: 12px; padding-top: 2px; }
.d-list dd { margin: 0; }
.d-list .en { display: block; font-family: Inter, "Noto Sans JP", sans-serif; }
.d-list .ja { display: block; color: var(--muted); font-size: 13px; }
.hl { background: color-mix(in srgb, var(--primary) 18%, transparent); border-radius: 3px; padding: 0 2px; font-weight: 700; }

/* 結果 */
.result-card { text-align: center; padding: 24px 20px; margin-bottom: 16px; }
.r-level { font-weight: 700; color: var(--muted); }
.r-score { font-family: Inter, sans-serif; font-weight: 800; font-size: 64px; line-height: 1.1; }
.r-score small { font-size: 28px; color: var(--muted); }
.r-rate { font-family: Inter, sans-serif; font-weight: 700; font-size: 18px; color: var(--primary); }
.r-msg { margin: 8px 0 0; }
.r-actions { display: grid; gap: 10px; margin-bottom: 24px; }
.r-subhead { font-size: 16px; margin: 0 0 8px; }
.wrong-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.wrong-list li {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.wrong-list .w { font-family: Inter, sans-serif; font-weight: 700; min-width: 7.5em; }
.wrong-list .m { flex: 1; }
.wrong-list .yours { display: block; font-size: 12px; color: var(--ng); }
.wrong-list .speak { width: 32px; height: 32px; font-size: 14px; }

/* もっと学ぶ（書籍・動画・サイトへの入口） */
.promo { margin-top: 28px; display: grid; gap: 10px; }
.promo-head { margin: 0 0 2px; font-size: 17px; }
.promo-card {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
a.promo-card:hover { border-color: var(--primary); }
.promo-card.book { align-items: flex-start; }
.promo-cover { flex: none; width: 72px; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.promo-body { flex: 1; min-width: 0; display: block; }
.promo-title { display: block; font-weight: 700; }
.promo-text { display: block; margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.promo-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.promo-links .btn { text-decoration: none; color: var(--primary); }
.promo-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); font-size: 18px; color: var(--primary);
}
.r-promo { text-align: center; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.r-promo a { color: var(--primary); font-weight: 700; }

/* 広告を消す（Android アプリだけ。promo.js） */
.adfree { margin-top: 12px; padding: 14px 16px; }
.adfree-text { margin: 0 0 10px; font-size: 14px; }
.adfree-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.linklike { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }

/* 毎日のリマインダー（Android アプリだけ。stats.js） */
.reminder { margin-top: 12px; padding: 14px 16px; }
.rm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.rm-title { font-weight: 700; }
.rm-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; }
.rm-time.off { opacity: .55; }
.rm-time input {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
}
.rm-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.rm-note.warn { color: var(--ng); }
/* オン・オフのスイッチ（チェックボックスを丸いつまみの形に） */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; cursor: pointer; margin: 0;
  width: 48px; height: 28px; border-radius: 999px; background: var(--line); transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* 単語一覧・詳細（list.js） */
#listBtn { margin-top: 10px; }
.list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-head h2 { margin: 0; font-size: 20px; }
.search {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.search:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.list-filters { display: grid; gap: 8px; margin: 10px 0 6px; }
.list-filters .seg button { flex: 1; }
.list-count { font-size: 13px; color: var(--muted); margin: 8px 2px; }
/* 列は画面幅まで（長い意味が行を押し広げないよう minmax(0,1fr)。はみ出す分は … で省略） */
.word-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.word-list li { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding-right: 8px; }
.wl-row {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; padding: 9px 4px 9px 12px; cursor: pointer;
}
.wl-st { flex: none; width: 1.3em; text-align: center; font-weight: 800; }
.wl-st.done { color: var(--ok); }
.wl-st.weak { color: var(--ng); }
.wl-st.new { color: var(--muted); }
.wl-w { flex: none; width: 8.2em; font-family: Inter, sans-serif; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.wl-w small { display: block; font-family: inherit; font-weight: 500; font-size: 11px; color: var(--muted); }
.wl-m { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-empty { justify-content: center; padding: 20px; color: var(--muted); }
.wv-pos { margin-left: auto; font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); }
.wv-status { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.wv-status.done { color: var(--ok); }
.wv-status.weak { color: var(--ng); }
.wv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.wl-book { color: var(--lvbook); font-weight: 700; }

/* 単語帳（list.js） */
#bookBtn { margin-top: 10px; }
#bookQuiz { margin: 2px 0 4px; }
.del-btn {
  flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-size: 14px; line-height: 1;
}
.del-btn:hover { border-color: var(--ng); }
/* 「外しました［元に戻す］」の帯（画面下・5秒） */
.undo-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10;
  width: calc(100% - 32px); max-width: 560px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25); font-size: 14px;
}
.undo-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-bar button {
  flex: none; border: 0; background: none; color: inherit; font: inherit; font-weight: 800;
  text-decoration: underline; cursor: pointer; padding: 4px 2px;
}
.wl-m { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-empty { justify-content: center; padding: 20px; color: var(--muted); }
.wv-pos { margin-left: auto; font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); }
.wv-status { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.wv-status.done { color: var(--ok); }
.wv-status.weak { color: var(--ng); }
.wv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 学習記録（stats.js） */
.streak {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 12px 14px; margin-bottom: 16px; border-width: 1px;
}
.streak:hover { border-color: var(--primary); }
.sk-fire { flex: none; font-size: 26px; line-height: 1; }
.streak.off .sk-fire { filter: grayscale(1); opacity: .55; }
.sk-body { flex: 1; min-width: 0; display: block; }
.sk-main { display: block; font-weight: 700; font-size: 16px; }
.sk-main b { font-family: Inter, sans-serif; font-weight: 800; font-size: 22px; color: var(--lvadv); margin-right: 1px; }
.sk-sub { display: block; font-size: 12.5px; color: var(--muted); }
.sk-go { flex: none; font-size: 22px; color: var(--muted); }

/* 上段3つ（連続・最高・学習した日）、下段2つ（総回答数・正答率）を6列の格子で並べる */
.st-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.st-tile {
  grid-column: span 2;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; min-width: 0;
}
.st-tile:nth-child(n+4) { grid-column: span 3; }
.st-tile.main { border-color: var(--lvadv); background: color-mix(in srgb, var(--lvadv) 8%, var(--surface)); }
.st-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.st-val { font-family: Inter, sans-serif; font-weight: 800; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.st-val small { font-family: "Noto Sans JP", sans-serif; font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.st-tile.main .st-val { color: var(--lvadv); }
.st-block { padding: 14px 14px 12px; margin-bottom: 14px; }
.st-head { margin: 0 0 10px; font-size: 15px; }
.st-chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; height: 180px; }
.st-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.st-n { font-family: Inter, sans-serif; font-size: 10px; font-weight: 700; color: var(--muted); height: 15px; line-height: 15px; }
.st-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.st-bar {
  width: 72%; max-width: 26px; background: color-mix(in srgb, var(--ng) 55%, var(--surface));
  border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; overflow: hidden;
}
.st-bar i { display: block; width: 100%; background: var(--ok); }
.st-d { font-family: Inter, sans-serif; font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.st-w { font-size: 10px; color: var(--muted); line-height: 1.3; }
.st-w.sun { color: var(--ng); }
.st-w.sat { color: var(--lvnoun); }
.st-col.today .st-d, .st-col.today .st-w { color: var(--text); font-weight: 700; }
.st-col.today .st-bar-wrap { background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: 6px 6px 0 0; }
.st-chart { position: relative; }
.st-chart.empty::before {
  content: "まだ記録がありません。クイズを解くとここにグラフが出ます";
  position: absolute; inset: 20px 0 50px; display: grid; place-items: center; text-align: center;
  font-size: 13px; color: var(--muted); padding: 0 12px;
}
.st-legend { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-top: 8px; }
.st-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.st-legend .ok::before { background: var(--ok); }
.st-legend .ng::before { background: color-mix(in srgb, var(--ng) 55%, var(--surface)); }
.st-levels { display: grid; gap: 10px; }
/* 数字の列は幅を固定（「苦手 ○」の有無でバーの長さがずれないように） */
/* 品詞名（形容詞＝3文字）が入る幅 */
.st-lv { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) 8.8em; align-items: center; gap: 10px; }
.st-lv-name { font-family: "Noto Sans JP", sans-serif; font-weight: 800; font-size: 15px; color: var(--c); }
.st-lv-name small { font-family: "Noto Sans JP", sans-serif; font-size: 11px; margin-left: 1px; }
.st-lv-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.st-lv-bar i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.st-lv-num { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.st-lv-num b { font-family: Inter, sans-serif; color: var(--text); }
.st-lv-num em { font-style: normal; color: var(--ng); margin-left: 8px; font-size: 12px; }

.foot {text-align: center; font-size: 11px; color: var(--muted); padding: 16px; }

@media (max-width: 560px) {
  .sp { display: inline; }
  .hero h1 { font-size: 23px; }
  .q-word { font-size: 36px; }
  .q-word.ja { font-size: 26px; }
  .choice { font-size: 16px; padding: 11px 14px; }
  .opt { flex-direction: column; align-items: stretch; gap: 6px; }
  .seg button { flex: 1; }
  select { width: 100%; }
  .lv-name { font-size: 22px; }
  .wrong-list .w { min-width: 6em; }
}
