/* One phone column: the sentence being spoken is the biggest thing on screen, big thumb-sized controls under it */
:root {
  --bg: #eef2f1;
  --surface: #ffffff;
  --ink: #17262b;
  --muted: #5b6d72;
  --line: #d3dcdb;
  --accent: #1d6b73;
  --accent-ink: #ffffff;
  --accent-soft: #d6ebec;
  --warm: #b8741a;
  --warm-soft: #f6e7cf;
  --rec: #b93a32;
  --en: "Atkinson Hyperlegible", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --ja: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a1c; --surface: #18262a; --ink: #e3ecec; --muted: #94a8ab; --line: #2b3d41;
    --accent: #5fc0c8; --accent-ink: #0f2124; --accent-soft: #1d3a3e; --warm: #e3a548; --warm-soft: #3a2c17;
    --rec: #f07a70; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--ja); font-size: 15px; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
h1 { font-size: 1.1rem; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 1rem; margin: 0 0 10px; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.ghost { background: transparent; border-color: var(--accent); color: var(--accent); }

.bar {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line);
}
.bar-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.bar-actions button { white-space: nowrap; }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; max-width: 46vw; }

.wrap {
  max-width: 640px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px calc(env(safe-area-inset-bottom, 0px) + 48px);
  display: flex; flex-direction: column; gap: 28px;
}
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; }
.empty p { margin: 8px 0 0; }

.player { display: flex; flex-direction: column; gap: 16px; }
.now { background: var(--surface); border-radius: 16px; padding: 18px; min-height: 13rem; display: flex; flex-direction: column; gap: 6px; }
.now-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.who { font-family: var(--en); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warm); }
.en { font-family: var(--en); font-size: 1.45rem; line-height: 1.35; margin: 0; text-wrap: pretty; }
.now.other .en { color: var(--muted); font-style: italic; }
.ja { margin: 0; color: var(--muted); font-size: 0.9rem; }
.hide-ja .ja { display: none; }

.seek input { width: 100%; accent-color: var(--accent); }
.times { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }

.controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: stretch; }
.controls button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 1.25rem; padding: 10px 4px; min-height: 64px; }
.controls small { font-size: 0.68rem; color: var(--muted); }
.controls .play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 1.6rem; }
#star[aria-pressed="true"] { background: var(--warm-soft); border-color: var(--warm); color: var(--warm); }

.options { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface); padding: 7px 12px; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 0.88rem; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }

.record { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rec { color: var(--rec); border-color: var(--rec); }
.rec.on { background: var(--rec); color: var(--surface); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.tabs button { white-space: nowrap; font-size: 0.82rem; padding: 6px 10px; }
.tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { border-bottom: 1px solid var(--line); }
.lines button { width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 10px 4px; display: grid; grid-template-columns: 1.4em 1fr; gap: 6px; }
.lines .en-s { font-family: var(--en); line-height: 1.4; }
.lines .ja-s { display: block; font-size: 0.8rem; color: var(--muted); }
.lines li.other .en-s { color: var(--muted); font-style: italic; }
.lines li.current button { background: var(--accent-soft); }
.lines .mark { color: var(--warm); }

.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.counters div { background: var(--surface); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.counters b { display: block; font-size: 1.5rem; line-height: 1.2; }
.counters span { font-size: 0.76rem; color: var(--muted); }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 12px 0 6px; }
.days div { aspect-ratio: 1; border-radius: 4px; background: var(--line); }
.days .on { background: var(--accent); }
.days .today { outline: 2px solid var(--warm); outline-offset: 1px; }
.report { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
textarea { width: 100%; min-height: 10rem; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

.packs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.packs li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.packs li span { min-width: 0; }
.packs .danger { color: var(--rec); border-color: var(--rec); flex: none; }

@media (prefers-reduced-motion: no-preference) { button { transition: background 0.15s ease; } }
