:root {
  --bg: #f6f3f0; --card: #ffffff; --ink: #1f1a1c; --muted: #6d6266; --line: #e3dcd8;
  --brand: #7a2341; --brand-ink: #ffffff; --brand-soft: #f3e6eb;
  --good: #1f7a4a; --good-soft: #e3f3ea; --warn: #9a5b00; --warn-soft: #fbf0dc; --bad: #b3261e;
  --radius: 14px; --tabs: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161214; --card: #221c1f; --ink: #f2ecee; --muted: #a99ea3; --line: #3a3135;
          --brand: #d27a98; --brand-ink: #1a0f13; --brand-soft: #3a2730; --good: #6fd29b; --good-soft: #1d3327;
          --warn: #f0b860; --warn-soft: #3a2f1c; --bad: #ff8a80; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100dvh;
       padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
button, input { font: inherit; color: inherit; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
       background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); }
.brand img { width: 28px; height: 28px; }
.who { font-size: 14px; color: var(--muted); }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.view { display: none; }
.view.active { display: block; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.lead { color: var(--muted); margin: 4px 0 12px; }
.hint { color: var(--muted); font-size: 15px; margin: 8px 0; }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.sentence { font-size: 26px; line-height: 1.4; font-weight: 600; min-height: 120px; }
.subject { font-size: 32px; font-weight: 700; text-align: center; letter-spacing: .5px; }
.example { color: var(--muted); font-style: italic; margin: 8px 2px 12px; }
.counter { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 12px;
       padding: 14px 16px; min-height: 52px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: 15px; }
.btn.wide { width: 100%; margin: 12px 0; }
.btn.link { background: none; border: none; color: var(--muted); text-decoration: underline; min-height: 44px; width: 100%; }
.row { display: flex; gap: 10px; margin: 12px 0; }
.row > * { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row input[type=text] { flex: 2; }
.row .btn { flex: 0 1 auto; }
#rec-after .btn, .grid2 .btn, [data-c].btn { flex: 1; }
.stack input[type=text] { width: 100%; }
.consent ul { padding-left: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
input[type=text] { border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 52px; background: var(--card); }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 16px 0 8px; }
.meter div { height: 100%; width: 0; background: var(--good); transition: width .06s linear; }
.meter div.loud { background: var(--bad); }
.rec-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0; }
.round { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--line); background: var(--card);
         display: grid; place-items: center; cursor: pointer; }
.round.rec span { width: 40px; height: 40px; border-radius: 50%; background: var(--bad); transition: all .15s; }
.round.rec.on { border-color: var(--bad); }
.round.rec.on span { border-radius: 8px; width: 34px; height: 34px; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); }
.msg { border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.msg.ok { background: var(--good-soft); color: var(--good); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.skip summary { color: var(--muted); cursor: pointer; margin-top: 16px; min-height: 44px; display: flex; align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
.options { display: grid; gap: 10px; margin: 8px 0; }
.options .btn { font-size: 22px; letter-spacing: .5px; }
.q { font-weight: 600; margin: 16px 0 8px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 20px; font-weight: 700; }
.scale button.sel, .row .btn.sel { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
#rate-form.disabled { opacity: .4; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 13px; color: var(--muted); }
.milestones { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.milestones li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.milestones li.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.milestones li.done { opacity: .75; }
.milestones .head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.milestones .goal { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar div { height: 100%; background: var(--brand); }
.milestones li.done .bar div { background: var(--good); }
.crit { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.crit.met { color: var(--good); }
.consent { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; max-height: 50vh; overflow: auto; font-size: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.check input { width: 24px; height: 24px; margin-top: 2px; }
.people { width: 100%; border-collapse: collapse; font-size: 15px; }
.people td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.linkbox { background: var(--warn-soft); border-radius: 12px; padding: 12px; word-break: break-all; font-size: 14px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 2px; min-height: var(--tabs); display: flex; flex-direction: column;
               align-items: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabs svg { width: 24px; height: 24px; fill: currentColor; }
.tabs button.active { color: var(--brand); font-weight: 700; }
#rate-word { width: 100%; margin-top: 10px; }
