:root {
  --bg: #ffffff;
  --soft: #f6f7f6;
  --soft-2: #eef1ee;
  --ink: #1f2a25;
  --muted: #6b756f;
  --faint: #9aa39d;
  --line: #e6e9e6;
  --accent: #2f6b4f;
  --accent-soft: #e9f2ec;
  --warn: #b5562f;
  --warn-soft: #fbefe9;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--ink); padding: 0 16px 120px; }
html { background: var(--bg); }
h1, h2, h3, p, dl, dd, ol { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
kbd { font: 600 10px/1 ui-monospace, Menlo, monospace; padding: 3px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .5; }
.shell { width: min(440px, 100%); margin: auto; }

/* header */
.masthead { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-decoration: none; }
.brand-symbol { display: flex; align-items: center; gap: 3px; height: 22px; }
.brand-symbol i { width: 3px; height: 10px; border-radius: 3px; background: var(--accent); }
.brand-symbol i:nth-child(2) { height: 20px; }
.brand-symbol i:nth-child(3) { height: 15px; }
.brand-symbol i:nth-child(4) { height: 8px; }

.ghost-button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 38px; }
.ghost-button:hover { border-color: var(--ink); color: var(--ink); }
.ghost-button.danger:hover { border-color: var(--warn); color: var(--warn); }

/* intro */
.intro { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: center; padding: 48px 0 40px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1 { margin-top: 14px; font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
h1 em { font-style: normal; color: var(--accent); }
.lead { margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.primary-button { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 12px 22px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; min-height: 48px; }
.primary-button:hover { background: #255a41; }
.btn-icon { font-size: 11px; }
.secondary-button { border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 600; min-height: 48px; }
.secondary-button:hover { border-color: var(--ink); }
.hero-hint { margin-top: 12px; color: var(--muted); font-size: 13px; min-height: 1em; }

.hero-panel { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: 18px; }
.progress-ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; padding: 7px; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft-2) 0); }
.ring-inner { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); display: grid; place-content: center; text-align: center; }
.ring-value { font-size: 28px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.ring-value small { font-size: 13px; margin-left: 1px; }
.ring-caption { color: var(--faint); font-size: 9px; letter-spacing: .14em; margin-top: 4px; }
.hero-meters { display: grid; gap: 12px; min-width: 0; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.meter-top b { color: var(--ink); font-weight: 700; margin-right: 3px; }
.meter-bar { height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s; }
.mini-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 14px; }
.mini-stats div { text-align: center; }
.mini-stats div + div { border-left: 1px solid var(--line); }
.mini-stats dt { font-size: 11px; color: var(--faint); }
.mini-stats dd { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* toolbar */
.toolbar-static { padding-top: 24px; border-top: 1px solid var(--line); }
.toolbar { position: sticky; top: 0; z-index: 30; margin: 0 -12px; padding: 12px; background: #ffffffee; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.toolbar.is-stuck { border-bottom-color: var(--line); }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 999px; }
.segmented button { border: 0; background: transparent; border-radius: 999px; padding: 7px 16px; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.segmented button b { color: var(--faint); font-weight: 700; margin-right: 2px; }
.segmented button.is-active { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px #1f2a2522; }
.segmented.small button { padding: 6px 12px; min-height: 32px; font-size: 12px; }
.search { flex: 1; min-width: 200px; max-width: 340px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; }
.search span { color: var(--faint); font-size: 17px; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 42px; font-size: 14px; }
.search:focus-within { border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 13px; min-height: 34px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover { border-color: var(--faint); }
.chip span { font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; margin-left: 2px; }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar-more { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 4px; min-height: 34px; }
.toolbar-more:hover { color: var(--ink); }
.toolbar-more[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
.settings { position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); max-height: calc(100vh - 160px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 12px 32px #1f2a251a; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.settings[hidden] { display: none; }
.setting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setting-label { font-size: 12px; font-weight: 700; color: var(--faint); min-width: 72px; }
.toolbar-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.toolbar-foot p { font-size: 12px; color: var(--faint); }
.play-all { border: 1px solid var(--accent); border-radius: 999px; background: var(--bg); color: var(--accent); font-size: 13px; font-weight: 700; padding: 6px 14px; min-height: 34px; }
.play-all:hover { background: var(--accent-soft); }

/* list */
main { padding-top: 12px; }
.note { font-size: 12px; color: var(--faint); line-height: 1.8; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-num { font-size: 11px; letter-spacing: .14em; color: var(--faint); font-weight: 700; margin-bottom: 4px; }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.section-head h2 span { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 8px; }
.section-head .note { margin-top: 4px; }
.section-progress { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; align-items: start; }

.card { position: relative; display: grid; gap: 12px; padding: 20px 20px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; transition: border-color .15s; }
.card:hover { border-color: #d3d8d4; }
.card.is-ok { background: #fbfdfb; }
.card.is-ok::before, .card.is-alert::before { content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.card.is-alert::before { background: var(--warn); }
.card.is-playing { border-color: var(--accent); }
.card-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.num { font-size: 12px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.alert { background: var(--warn-soft); color: var(--warn); }
.card-top .focus-link { margin-left: auto; border: 0; background: transparent; color: var(--faint); font-size: 12px; font-weight: 600; padding: 4px 6px; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.card:hover .focus-link, .card:focus-within .focus-link { opacity: 1; }
.card-top .focus-link:hover { color: var(--ink); background: var(--soft); }
@media (hover: none) { .card-top .focus-link { opacity: 1; } }
.en { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; font-size: 20px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; overflow-wrap: anywhere; cursor: pointer; }
.en:hover { color: var(--accent); }
.hide-en .en { color: transparent; text-shadow: 0 0 10px #1f2a2570; user-select: none; }
.hide-en .card.is-revealed .en { color: inherit; text-shadow: none; }
.extra { display: grid; gap: 6px; }
.extra:not(:has(p:not([hidden]))) { display: none; }
.extra p { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.extra .ipa { font-family: "Lucida Grande", "Helvetica Neue", Arial, sans-serif; color: var(--muted); }
.extra .ja { color: var(--muted); }

.player { display: flex; align-items: center; gap: 12px; }
.play { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; }
.play:hover { background: #255a41; }
.track { flex: 1; height: 4px; border-radius: 99px; background: var(--soft-2); position: relative; cursor: pointer; }
.track::before { content: ""; position: absolute; inset: -12px 0; }
.track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.rec-mini { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 14px; display: grid; place-items: center; }
.rec-mini:hover { border-color: var(--faint); }
.rec-mini.is-recording { background: #d9483b; border-color: #d9483b; color: #fff; animation: pulse 1.2s infinite; }
.rec-mini.has-take { border-color: var(--accent); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #d9483b26; } }

.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.tbtn { border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; min-height: 34px; font-size: 13px; font-weight: 600; color: var(--faint); }
.tbtn:hover { color: var(--ink); background: var(--soft); }
.tbtn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.actions .spacer { flex: 1; }
.mark { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 13px; min-height: 34px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mark:hover { border-color: var(--faint); }
.mark.ok[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.mark.alert[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: #fff; }

.empty { margin-top: 30px; padding: 36px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.empty[hidden] { display: none; }

footer { margin-top: 56px; padding: 24px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.source-note { color: var(--faint); font-size: 12px; line-height: 1.9; }

/* now playing */
.now-bar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(540px, calc(100% - 24px)); z-index: 40; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 10px 12px 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 10px 30px #1f2a251f; overflow: hidden; }
.now-bar[hidden] { display: none; }
.now-text { min-width: 0; }
.now-label { display: block; font-size: 11px; color: var(--faint); }
.now-text strong { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-controls { display: flex; gap: 4px; }
.now-controls button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--soft); font-size: 13px; }
.now-controls .now-main { background: var(--accent); color: #fff; }
.now-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--soft-2); }
.now-progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* focus mode */
.focus { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto 1fr auto auto; padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
.focus[hidden] { display: none; }
.focus-top { display: flex; align-items: center; gap: 16px; width: min(720px, 100%); margin: 0 auto; }
.focus-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.focus-dots { flex: 1; height: 4px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.focus-dots i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.focus-close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 14px; flex: 0 0 auto; }
.focus-body { width: min(720px, 100%); margin: 0 auto; align-self: center; display: grid; gap: 22px; padding: 28px 0; }
.focus-section { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--faint); }
.focus-en { font-size: clamp(28px, 5vw, 42px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.focus.hide-en .focus-en:not(.is-revealed) { color: transparent; text-shadow: 0 0 16px #1f2a2570; cursor: pointer; }
.focus-reveals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reveal { text-align: left; border: 1px dashed var(--line); background: transparent; border-radius: 12px; padding: 12px 14px; min-height: 64px; display: grid; gap: 6px; align-content: start; }
.reveal-label { font-size: 12px; font-weight: 700; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.reveal-text { font-size: 16px; line-height: 1.6; visibility: hidden; overflow-wrap: anywhere; }
.reveal.is-open { border-style: solid; background: var(--soft); border-color: var(--soft); }
.reveal.is-open .reveal-text { visibility: visible; }
.focus-player { display: flex; align-items: center; gap: 16px; }
.focus-play { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px; flex: 0 0 auto; }
.focus-wave { flex: 1; display: grid; gap: 8px; }
.wave-track { height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.wave-track i { display: block; height: 100%; width: 0; background: var(--accent); }
.focus-time { font-size: 12px; color: var(--faint); }
.record-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.record-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 16px; min-height: 40px; font-size: 14px; font-weight: 700; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #d9483b; }
.record-button.is-recording { background: #d9483b; border-color: #d9483b; color: #fff; animation: pulse 1.2s infinite; }
.record-button.is-recording .rec-dot { background: #fff; border-radius: 2px; }
.record-note { flex-basis: 100%; font-size: 12px; color: var(--faint); }
.record-note:empty { display: none; }
.focus-bottom { width: min(720px, 100%); margin: 0 auto; display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 10px; }
.focus-nav { width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 19px; }
.judge { border: 1px solid transparent; border-radius: 14px; min-height: 54px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.judge-ok { background: var(--accent); color: #fff; }
.judge-alert { background: var(--bg); color: var(--warn); border-color: var(--line); }
.judge.is-current { outline: 2px solid var(--ink); outline-offset: 2px; }
.focus-auto { width: min(720px, 100%); margin: 12px auto 0; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.focus-auto input { accent-color: var(--accent); }

/* help sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: #1f2a2540; display: grid; place-items: center; padding: 20px; }
.sheet-backdrop[hidden] { display: none; }
.sheet { width: min(540px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--bg); border-radius: 18px; padding: 24px; box-shadow: 0 20px 50px #1f2a2530; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet h2 { font-size: 19px; }
.sheet h3 { font-size: 13px; margin: 20px 0 10px; color: var(--muted); }
.help-steps { padding-left: 22px; display: grid; gap: 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.help-steps strong { display: block; color: var(--ink); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; }
.keys div { display: flex; gap: 10px; align-items: center; }
.keys dt { min-width: 58px; }

.toast { white-space: nowrap; position: fixed; left: 50%; top: 18px; transform: translate(-50%, -30px); opacity: 0; z-index: 80; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; pointer-events: none; transition: all .25s; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.top-button { position: fixed; right: 20px; bottom: 24px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 17px; z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
.top-button.is-show { opacity: 1; pointer-events: auto; }
body.has-now-bar .top-button { bottom: 100px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== phone-fixed layout ===== */
html { scroll-padding-top: 150px; }
.masthead { height: 60px; }
.hide-sm { display: none; }
.intro { grid-template-columns: 1fr; gap: 22px; padding: 26px 0 26px; }
h1 { font-size: 34px; }
.lead { font-size: 14px; }
.hero-actions > * { flex: 1; justify-content: center; }
.primary-button, .secondary-button { padding: 12px 14px; font-size: 14px; white-space: nowrap; }
.hero-panel { padding: 18px; gap: 18px; }
.progress-ring { width: 88px; height: 88px; padding: 6px; }
.ring-value { font-size: 24px; }

.toolbar-static { display: grid; gap: 10px; padding-top: 20px; }
.toolbar-static .segmented { width: 100%; }
.toolbar-static .segmented button { flex: 1; padding-inline: 8px; }
.search { max-width: none; min-width: 0; }
.search input { height: 42px; }

/* accordion (settings) */
.acc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acc-head { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: var(--soft); padding: 12px 14px; min-height: 48px; text-align: left; }
.acc-title { font-size: 14px; font-weight: 700; }
.acc-sub { flex: 1; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); position: relative; transition: transform .2s; }
.chev::before { content: ""; position: absolute; left: 50%; top: 45%; width: 6px; height: 6px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
[aria-expanded="true"] > .chev { transform: rotate(180deg); background: var(--ink); border-color: var(--ink); }
[aria-expanded="true"] > .chev::before { border-color: #fff; }
.acc-head[aria-expanded="true"] { border-bottom: 1px solid var(--line); }
.settings, .acc-body { position: static; max-height: none; box-shadow: none; border: 0; border-radius: 0; padding: 14px; grid-template-columns: 1fr; gap: 14px; }
.setting { gap: 8px; }
.setting-label { min-width: 0; flex-basis: 100%; }

/* sticky bar */
.toolbar { margin: 8px -16px 0; padding: 10px 16px; display: grid; gap: 8px; }
.filter-chips { flex-wrap: nowrap; }
.filter-chips .chip { flex: 1; padding: 5px 6px; white-space: nowrap; }
.speed-row { display: flex; align-items: center; gap: 8px; }
.speed-label { font-size: 12px; font-weight: 700; color: var(--faint); }
.segmented.speed { flex: 1; }
.segmented.speed button { flex: 1; padding: 6px 4px; min-height: 36px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.segmented.speed button.is-active { background: var(--accent); color: #fff; box-shadow: none; }
.play-all { white-space: nowrap; }
.status { font-size: 11px; color: var(--faint); }

/* cards */
.section-head { flex-wrap: wrap; }
.section-head h2 { font-size: 20px; }
.grid { grid-template-columns: 1fr; }
.card { padding: 16px 16px 12px; }
.en { font-size: 19px; }
.card-top .focus-link { opacity: 1; }
.disclosures { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.disc { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: var(--bg); padding: 10px 12px; min-height: 44px; font-size: 14px; font-weight: 600; text-align: left; }
.disc + .disc-body + .disc, .disc-body + .disc, .disc + .disc { border-top: 1px solid var(--line); }
.disc:hover { background: var(--soft); }
.disc-hint { flex: 1; text-align: right; font-size: 12px; font-weight: 500; color: var(--faint); }
.disc[aria-expanded="true"] { background: var(--soft); }
.disc .chev { width: 20px; height: 20px; }
.disc-body { padding: 10px 12px 12px; font-size: 15px; line-height: 1.7; background: var(--soft); overflow-wrap: anywhere; }
.disc-body.ipa { font-family: "Lucida Grande", "Helvetica Neue", Arial, sans-serif; color: var(--ink); }
.actions { border-top: 0; padding-top: 0; }
.actions .mark { min-width: 76px; min-height: 40px; }

/* focus mode */
.focus-top, .focus-body, .focus-bottom, .focus-auto { width: min(440px, 100%); }
.focus-en { font-size: 30px; }
.focus-reveals { grid-template-columns: 1fr; }
.focus-bottom { grid-template-columns: 1fr 1fr; }
.focus-nav { display: none; }
.judge kbd, .reveal kbd, .record-button kbd { display: none; }
.focus-play { width: 60px; height: 60px; }
.keys { grid-template-columns: 1fr; }
.now-bar { width: min(424px, calc(100% - 16px)); }
.top-button { right: max(16px, calc(50% - 236px)); }
.sheet { width: min(440px, 100%); }

/* ===== simplified v6 ===== */
.masthead { border-bottom: 0; }
.brand { font-size: 13px; letter-spacing: .12em; }
.intro { display: grid; gap: 14px; padding: 12px 0 22px; }
h1 { margin: 0; font-size: 28px; }
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-line .meter-bar { flex: 1; height: 6px; }
.progress-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-count b { color: var(--ink); font-size: 15px; }
.hero-actions { margin-top: 4px; }
.hero-hint { margin-top: -4px; font-size: 12px; }
.hero-hint:empty { display: none; }
.toolbar-static { padding-top: 18px; }
.acc-body .play-all { justify-self: start; min-height: 40px; padding: 8px 16px; }
.toolbar { gap: 8px; }
.section { margin-top: 28px; }
.section-head { align-items: baseline; padding-bottom: 10px; }
.section-head h2 { font-size: 18px; }
.card { gap: 10px; padding: 14px 16px; }
.card-top { gap: 6px; }
.card-top .spacer { flex: 1; }
.card-top .mark { min-width: 0; min-height: 32px; padding: 4px 12px; font-size: 12px; }
.card.is-ok::before, .card.is-alert::before { display: none; }
.card.is-ok { background: var(--bg); border-color: #b9d3c3; }
.card.is-alert { border-color: #e6c3b2; }
.en { font-size: 18px; }
.player { gap: 10px; }
.take-play { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.disc { border: 1px solid var(--line); border-radius: 10px; min-height: 40px; padding: 8px 12px; font-size: 13px; color: var(--muted); justify-content: space-between; }
.disc[aria-expanded="true"] { border-radius: 10px 10px 0 0; border-bottom-color: transparent; color: var(--ink); }
.disc-body { margin-top: -10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; display: grid; gap: 6px; padding: 4px 12px 12px; }
.disc-body .ja { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }

/* ===== v7: per-card speed ===== */
.card .speed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; background: var(--soft); border-radius: 10px; margin-top: -2px; }
.card .speed button { border: 0; background: transparent; border-radius: 8px; min-height: 34px; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .speed button.is-active { background: var(--bg); color: var(--accent); box-shadow: 0 1px 3px #1f2a2522; }
.toolbar { display: block; }

/* ===== v8: conversation sets ===== */
.set-group { margin-top: 22px; }
.set-group:first-child { margin-top: 16px; }
.set-title { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.set-title small { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.set-group .grid { margin-top: 10px; }

/* ===== v9: set tabs ===== */
.set-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.set-tabs button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; min-height: 40px; font-size: 13px; font-weight: 700; color: var(--muted); }
.set-tabs button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-title { font-size: 14px; }

/* ===== v10: fixed bottom dock ===== */
body { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
.intro { padding-bottom: 8px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; gap: 8px; padding: 10px max(16px, calc(50% - 204px)) calc(10px + env(safe-area-inset-bottom, 0px)); background: #ffffffF2; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px #1f2a250d; }
.dock .segmented { width: 100%; }
.dock .segmented button { flex: 1; padding-inline: 8px; min-height: 36px; }
.dock .set-tabs { grid-template-columns: repeat(6, 1fr); gap: 4px; }
.dock .set-tabs button { min-height: 34px; font-size: 12px; padding: 0 2px; }
.dock .filter-chips { flex-wrap: nowrap; }
.dock .filter-chips .chip { flex: 1; padding: 5px 4px; white-space: nowrap; min-height: 34px; font-size: 12px; }
.top-button { bottom: calc(180px + env(safe-area-inset-bottom, 0px)); }
.toast { top: auto; bottom: calc(180px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); }
.toast.is-show { transform: translate(-50%, 0); }

/* ===== v11: section + set only ===== */
body { padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
.dock .set-tabs { grid-template-columns: repeat(5, 1fr); }
.dock .set-tabs button { min-height: 40px; font-size: 13px; }
.top-button, .toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
.section-head { display: none; }
.set-group:first-child { margin-top: 8px; }
.set-title { font-size: 18px; color: var(--ink); gap: 8px; }
.set-title span { color: var(--accent); }

/* ===== v12: next-set navigation ===== */
.next-nav { margin-top: 28px; padding: 22px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); display: grid; gap: 12px; justify-items: center; text-align: center; }
.next-note { font-size: 13px; color: var(--muted); }
.next-q { font-size: 17px; font-weight: 700; }
.next-btn { width: 100%; min-height: 52px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.next-btn:hover { background: #255a41; }
.next-btn.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.next-nav { margin-bottom: 60px; }

/* ===== v13: review mode ===== */
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-actions .primary-button { grid-column: 1 / -1; }
.review-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.review-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
