:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1d2321;
  --muted: #5f6b67;
  --line: #dcd8cf;
  --primary: #1f6f5c;
  --primary-text: #ffffff;
  --ok: #2e7d4f;
  --ng: #b5452f;
  --accent: #e0a526;
  --danger: #a33a2a;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917;
    --surface: #1e2522;
    --text: #e8ece9;
    --muted: #9aa7a2;
    --line: #333d39;
    --primary: #3a9c83;
    --primary-text: #0e1412;
    --ok: #4caf76;
    --ng: #e0705a;
    --accent: #f0bb48;
    --danger: #e0705a;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #141917;
  --surface: #1e2522;
  --text: #e8ece9;
  --muted: #9aa7a2;
  --line: #333d39;
  --primary: #3a9c83;
  --primary-text: #0e1412;
  --ok: #4caf76;
  --ng: #e0705a;
  --accent: #f0bb48;
  --danger: #e0705a;
  --shadow: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.screen[hidden] { display: none; }

/* ヘッダー */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.topbar-spacer { width: 72px; }

.icon-btn {
  min-width: 72px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.progress-text {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0 16px;
}

/* 下部ボタン（片手操作用） */
.bottom-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0 16px;
  background: linear-gradient(to bottom, transparent, var(--bg) 24%);
}

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:disabled { opacity: 0.45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-big { min-height: 68px; font-size: 1.2rem; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); margin-bottom: 12px; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ng { background: var(--ng); color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

.judge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ホーム・結果の数字 */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-label { color: var(--muted); margin-top: 4px; }
.stat-ok .stat-num { color: var(--ok); }
.stat-ng .stat-num { color: var(--ng); }

.time-setting { margin-top: 4px; }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.seg-btn {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}

.seg-btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.home-msg {
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

/* 練習カード */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 10px;
}

.label:first-child { margin-top: 0; }

.scene, .intent, .hint, .note, .cebuano {
  margin: 4px 0 0;
  line-height: 1.6;
}

.scene { font-size: 1rem; }
/* 問題の写真：切らずに全体を出す。画面の高さの4割を超えるときは、写真全体を縮めて真ん中に置く */
.qz-pic { position: relative; width: fit-content; max-width: 100%; margin: 10px auto 2px; border-radius: 10px; overflow: hidden; }
.qz-pic[hidden] { display: none; }
.qz-img { display: block; width: auto; height: auto; max-width: 100%; max-height: 40vh; background: var(--line); }
/* 虫やヘビなどの写真：ぼかして出し、タップで見せる（quiz.js の SOFT_PICS） */
.qz-pic.soft .qz-img { filter: blur(24px); transform: scale(1.1); }
.qz-pic-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 12px; border: 0; background: color-mix(in srgb, var(--surface) 40%, transparent); color: var(--text);
  font: inherit; font-weight: 700; text-align: center; cursor: pointer; }
.qz-pic-cover small { font-weight: 400; color: var(--muted); }
.qz-pic.tiny .qz-pic-cover { font-size: 0.85rem; }
.qz-pic.tiny .qz-pic-cover small { display: none; }
.qz-pic-cover[hidden] { display: none; }
.intent { font-size: 1.2rem; font-weight: 700; }

.hint {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: var(--primary);
}

.countdown-area { text-align: center; }

.countdown-num {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.countdown-num.low { color: var(--ng); }

.bar {
  height: 10px;
  margin-top: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left center;
}

.answer { border-color: var(--primary); }

.cebuano {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.note { color: var(--muted); font-size: 0.95rem; }

.no-audio {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--ng);
}

/* 結果一覧 */
.section-title { font-size: 1rem; margin: 8px 0 0; }

.sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
  line-height: 1.6;
}

.ng-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ng-item {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.ng-item .ceb { display: block; font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.ng-item .meaning { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.ng-item .na { display: block; color: var(--ng); font-size: 0.8rem; margin-top: 2px; }

/* 設定 */
.setting {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.setting label, .setting-head {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-toggle label { margin: 0; }

.setting input[type="range"] { width: 100%; accent-color: var(--primary); }

.setting select, .setting input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.toggle:checked { background: var(--primary); }
.toggle:checked::after { transform: translateX(22px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.setting .chip {
  display: inline-flex;
  margin: 0;
  font-weight: 400;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.setting .chip input { position: absolute; opacity: 0; pointer-events: none; }
.setting .chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.load-error {
  margin: 24px 16px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  line-height: 1.6;
}

@media (min-width: 720px) {
  .screen { padding-top: 24px; }
  .cebuano { font-size: 1.9rem; }
}

/* 設定：カテゴリのグループ見出し */
#set-categories { display: flex; flex-direction: column; gap: 8px; }
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}
.group-head:first-child { margin-top: 0; }
.group-toggle {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== ホーム：2つのモード ===== */
.mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.mode-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mode-title { margin: 0; font-size: 1.15rem; }
.mode-sub { color: var(--muted); font-size: 0.85rem; }
.mode-desc { margin: 6px 0 12px; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.mode-btn { margin-bottom: 0; }
#btn-start.mode-btn { margin-top: 16px; }
.mode-card .stat-row { margin-top: 0; }
.mode-card .time-setting { margin-top: 12px; padding: 0; border: none; }

/* ===== クイズ ===== */
.qz-kind { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.qz-kind .seg-btn { min-height: 44px; font-size: 0.9rem; padding: 4px; }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.qz-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.qz-bar > div { height: 100%; width: 0; background: var(--primary); transition: width 0.25s; }
.qz-tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 1px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.qz-choices { display: grid; gap: 10px; }
.qz-choice {
  text-align: left;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
  word-break: break-word;
}
.qz-choice:disabled { cursor: default; }
.qz-choice.correct {
  border-color: var(--ok);
  color: var(--ok);
  font-weight: 700;
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
}
.qz-choice.wrong {
  border-color: var(--ng);
  color: var(--ng);
  background: color-mix(in srgb, var(--ng) 14%, var(--surface));
}
.qz-feedback { margin: 0; font-weight: 700; font-size: 1.05rem; }
.qz-feedback.ok { color: var(--ok); }
.qz-feedback.ng { color: var(--ng); }
.qz-feedback.mid { color: var(--accent); }
/* 出し方（聞き取り・並べ替え・言ってから答え合わせ） */
.qz-form { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); font-weight: 700; }
.qz-listen { display: block; width: 100%; min-height: 56px; margin: 4px 0 10px; border: 1px solid var(--primary); border-radius: 14px; background: var(--surface); color: var(--primary); font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.qz-listen-q { display: block; font-size: 1rem; }
.qz-order { gap: 14px; }
.qz-line { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; padding: 10px; border: 2px dashed var(--line); border-radius: 14px; align-items: center; }
.qz-line.right { border: 2px solid var(--ok); }
.qz-line.wrong { border: 2px solid var(--ng); }
.qz-line-empty { color: var(--muted); font-size: 0.9rem; }
.qz-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-tile { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 1.05rem; cursor: pointer; touch-action: manipulation; }
.qz-tile.on { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.qz-pool .qz-tile:disabled { visibility: hidden; }
.qz-say-ans { margin: 0; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-size: 1.2rem; font-weight: 700; word-break: break-word; }
.qz-show { text-align: center; font-weight: 700; }
/* 声で採点（言ってから答え合わせ） */
.qz-mic.on { border-color: var(--ng); color: var(--ng); }
.qz-hint { text-align: center; }
.qz-voice-hint { margin: 0; padding: 10px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; word-break: break-word; }
.qz-voice-msg { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); font-size: 0.92rem; line-height: 1.6; }
.qz-voice-msg.ng { background: color-mix(in srgb, var(--ng) 10%, var(--surface)); }
.qz-voice-note { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
.qz-voice-heard { display: block; margin-top: 4px; font-size: 0.92rem; font-weight: 400; }
.qz-voice-heard span { color: var(--muted); font-size: 0.82rem; }
.qz-voice-skip { align-self: center; min-height: 44px; padding: 8px 12px; border: 0; background: none; color: var(--muted); font-size: 0.88rem; text-decoration: underline; cursor: pointer; }
.qz-send-audio { width: 100%; }
.qz-sent-link { display: block; margin-top: 6px; font-size: 0.95rem; font-weight: 400; }
.qz-say-ans .miss { color: var(--ng); text-decoration: underline wavy; }
.qz-rate.ok { border-color: var(--ok); }
.qz-rate.mid { border-color: var(--accent); }
.qz-rate.ng { border-color: var(--ng); }
.qz-rate.picked { font-weight: 700; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
#qz-sound-btn { min-width: 0; font-size: 0.85rem; }
.qz-result-actions { display: grid; gap: 10px; }
#qz-retry[hidden], #qz-new[hidden], #qz-again[hidden], #qz-home[hidden] { display: none; }
.qz-result-actions .btn-secondary { margin-bottom: 0; }
#qz-cats { display: flex; flex-direction: column; gap: 8px; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.qz-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.qz-table td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.qz-table .qz-ceb { font-weight: 700; color: var(--primary); width: 42%; word-break: break-word; }
.qz-table td:last-child { width: 1%; white-space: nowrap; text-align: right; }
.qz-play {
  min-width: 40px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

/* ===== クイズの進み具合 ===== */
.qz-progress { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.mode-card .qz-progress { margin-bottom: 12px; }
.pg-row { display: grid; grid-template-columns: 6.5em 1fr auto; align-items: center; gap: 8px; font-size: 0.85rem; }
.pg-row.total { font-weight: 700; font-size: 0.95rem; }
.pg-label { color: var(--muted); }
.pg-row.total .pg-label { color: var(--text); }
.pg-bar { position: relative; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.pg-bar .m { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); }
.pg-bar .r { position: absolute; top: 0; bottom: 0; background: var(--accent); }
.pg-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--muted); }
.pg-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.chip .chip-m { color: var(--ok); font-size: 0.8rem; margin-left: 2px; }
.setting .chip.on .chip-m { color: inherit; }
.qz-streak { display: inline-block; margin-left: 8px; font-size: 0.8rem; color: var(--muted); }
.qz-streak b { color: var(--ok); }
.qz-mastered-note { text-align: center; color: var(--ok); font-weight: 700; }
.pg-bar .c { position: absolute; top: 0; bottom: 0; background: var(--primary); opacity: 0.45; }
/* 要復習・まだまだ・あと一歩・マスター（Sentence Patterns と同じ4つの数） */
.pg-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pg-tile { border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center; }
.pg-tile b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.pg-tile span { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.pg-tile.due b { color: var(--ng); }
.pg-tile.almost b { color: var(--primary); }
.pg-tile.master b { color: var(--ok); }
.pg-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.qz-cap-row, .qz-form-row { margin-top: 8px; }
.qz-cap-row label, .qz-form-row label { font-weight: 400; }
.qz-mastered-note { white-space: pre-line; }
#qz-master-review { margin-bottom: 10px; }

/* ===== 単語の穴埋め例文 ===== */
.qz-blank { display: inline-block; color: var(--primary); font-weight: 700; letter-spacing: 0.05em; }
.qz-fill { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.qz-example { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.qz-ex-ja { margin: 0; line-height: 1.6; }
.qz-ex-ceb { margin: 4px 0 0; font-weight: 700; font-size: 1.05rem; line-height: 1.6; }
.qz-ex-note { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.7; }
#screen-quiz main { padding-bottom: 150px; }
.en-note:empty { display: none; }
#btn-lang { min-width: 0; }
.seg-5 { grid-template-columns: repeat(5, 1fr); }
.pg-goal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; }
.pg-goal .pg-bar .m { background: var(--accent); }
.pg-goal.done .pg-bar .m { background: var(--ok); }
.pg-goal.done b { color: var(--ok); }

/* Link back to the video quiz (repository root) */
.back-link { align-self: flex-start; margin-top: 10px; color: var(--primary); font-size: 0.9rem; font-weight: 600; text-decoration: none; padding: 4px 0; }

/* ===== クイズのレベル ===== */
#qz-level-info { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
#qz-level-info .sub { margin: 0; }
.qz-level-done { margin: 0; color: var(--ok); font-weight: 700; }
#qz-levels { display: flex; flex-wrap: wrap; gap: 6px; }
#qz-levels .seg-btn { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: 0.85rem; padding: 4px 10px; }

/* クイズ：答えたあとのセブアノ語のひと言（shared/site.js の RLB.feedback） */
.qz-cheer { display: block; margin-top: 4px; font-size: 0.95rem; font-weight: 600; color: var(--text); }

/* サイト内検索から開いた問題 */
.qz-table tbody.qz-found td { background: rgba(234, 179, 8, .22); }
/* 一覧：絞り込み・問題ごとの進み具合と操作 */
.qz-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.qz-filter .seg-btn { min-height: 36px; padding: 4px 10px; font-size: 0.85rem; flex: 0 0 auto; }
.qz-gh-num { float: right; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.qz-table tr.qz-st-row td { border-top: none; padding-top: 0; }
.qz-st { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.8rem; }
.qz-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.qz-pct.learning { color: var(--accent); }
.qz-pct.almost { color: var(--primary); }
.qz-pct.master { color: var(--ok); }
.qz-pct.new, .qz-pct.off { color: var(--muted); font-weight: 400; }
.qz-when { color: var(--muted); }
.qz-when.due { color: var(--ng); font-weight: 700; }
.qz-act { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 2px 10px; min-height: 28px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.qz-act.armed { border-color: var(--ng); color: var(--ng); font-weight: 700; }
.qz-table tbody.qz-off td { opacity: 0.6; }
/* 答えたあとの「マスターにする」「外す」 */
.qz-item-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 0; font-size: 0.85rem; }
.qz-acts-msg { color: var(--muted); }


/* Level picker (speaking): on phones, 2 x 2 so long English/Swedish labels do not run off the screen */
[data-level-picker] .seg-btn { min-width: 0; padding: 4px 8px; }
@media (max-width: 520px) { [data-level-picker].seg-4 { grid-template-columns: repeat(2, 1fr); } }

/* ===== 答えのあとの文法：分解（1行に1つ）と、くわしい解説 ===== */
.qz-parts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.95rem; line-height: 1.5; }
.qz-parts li { display: grid; grid-template-columns: minmax(4.5em, auto) 1fr; column-gap: 10px; padding: 3px 0; border-top: 1px dashed var(--line); }
.qz-parts li:first-child { border-top: 0; }
.qz-parts li b { color: var(--primary); overflow-wrap: anywhere; }
.qz-parts li span { color: var(--muted); }
.qz-parts li.plain { display: block; color: var(--muted); }
.qz-grammar { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.qz-grammar summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; color: var(--primary); padding: 4px 0; }
.gp { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.gp h3 { margin: 0; font-size: 1rem; line-height: 1.5; }
.gp h3 b { color: var(--primary); margin-right: 8px; }
.gp h3 span { font-weight: 400; font-size: 0.9rem; }
.gp p { margin: 6px 0 0; font-size: 0.92rem; line-height: 1.75; }
.gp-ex { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.92rem; line-height: 1.5; }
.gp-ex li { padding: 4px 0 4px 10px; border-left: 3px solid var(--line); margin-top: 4px; }
.gp-ex li b { display: block; }
.gp-ex li span { display: block; color: var(--muted); }
.qz-parts li.head { display: block; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.qz-parts li.head + li { border-top: 0; }
