/* vladostutor: kitchen talk, in English.
   Style true-black-flat (taste-skill): a warm near-black kitchen at night, elevation by lightness alone, no
   borders or shadows on things at rest, the primary control made primary by inversion. The one hue is the
   blue of a gas flame, kept for data and for Vlados's voice; it never fills a button or a nav item.
   Family: Dernity (volt) and Cinematic Studio (tungsten) share the condensed display face, the woodcuts
   tinted by token, and the single signal colour. See DESIGN.md. */

@font-face {
  font-family: 'Golos Text';
  src: url('../fonts/golos-text-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  src: url('../fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  src: url('../fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2') format('woff2');
  font-weight: 1 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  src: url('../fonts/sofia-sans-extra-condensed-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 1 1000;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: dark;
  --ground: #0e0d0c;
  --surface: #181716;
  --raised: #23211f;
  --nested: #2c2a27;
  --ink: #efefed;
  --ink-press: #d6d6d3;
  --on-ink: #0e0d0c;
  --muted: #b4b1ab;
  --faint: #96938d;
  --rule: #1f1d1b;
  --flame: #4aa8ff;
  --flame-tint: rgb(74 168 255 / 14%);
  --good: #7fd39b;
  --bad: #f47c86;
  --bad-tint: rgb(244 124 134 / 12%);

  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: 20px;
  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* Keep focused controls clear of the fixed nav. */
  scroll-padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
@media (pointer: fine) { html { overscroll-behavior: none; } }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgb(74 168 255 / 35%); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 99px; text-decoration: none;
}
.skip:focus { top: calc(12px + var(--safe-t)); }

.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- frame ---------- */

#app { outline: none; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) var(--gutter) calc(var(--nav-h) + var(--safe-b) + 40px);
}

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 21px/1 var(--display);
  letter-spacing: 0.08em;
  text-decoration: none;
}
.mark { width: 26px; height: 26px; flex: none; }
.mark .crown { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.mark .tongue { fill: var(--flame); }

.title {
  font: 300 44px/0.98 var(--display);
  letter-spacing: -0.01em;
}
.title-s {
  font: 300 34px/1 var(--display);
  letter-spacing: -0.005em;
}
.lead { color: var(--muted); font-size: 17px; margin-top: 12px; max-width: 34ch; }

.section {
  margin-top: 48px;
}
.section-head {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px;
  margin-bottom: 14px;
}
.section-head h2 { font: 300 28px/1 var(--display); }
.section-head p { grid-column: 1 / -1; color: var(--faint); font-size: 14px; }
.section-head p.count { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }

/* Interface language: two segments, the chosen one a step lighter. */
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--surface); }
.lang-switch button {
  min-width: 44px; height: 38px; padding: 0 12px; border: 0; border-radius: 99px;
  background: none; color: var(--faint); font: 600 13px/1 var(--sans); letter-spacing: 0.04em;
  cursor: pointer; touch-action: manipulation; transition: color 150ms, background-color 150ms;
}
.lang-switch button[aria-pressed=true] { background: var(--nested); color: var(--ink); }
@media (hover: hover) { .lang-switch button:hover { color: var(--ink); } }

/* ---------- pictures: woodcuts as masks, filled by token ---------- */

.art {
  display: block;
  background-color: var(--art-ink, rgb(239 239 237 / 82%));
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.art.cover { -webkit-mask-size: cover; mask-size: cover; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 99px;
  background: var(--raised); color: var(--ink);
  font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform 150ms var(--ease), background-color 150ms;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn .icon { width: 20px; height: 20px; }
.btn.primary { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.btn.primary:active { background: var(--ink-press); }
.btn.wide { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.text { background: transparent; padding: 0 12px; color: var(--muted); }
.btn.text:active { color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.danger { background: var(--bad-tint); color: var(--bad); }

@media (hover: hover) {
  .btn:hover { background: var(--nested); }
  .btn.primary:hover { background: #fff; }
  .btn.text:hover { background: transparent; color: var(--ink); }
}

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 99px;
  background: transparent; color: var(--muted); text-decoration: none;
}
.icon-btn:active { background: var(--raised); color: var(--ink); }
@media (hover: hover) { .icon-btn:hover { background: var(--raised); color: var(--ink); } }

/* ---------- home ---------- */

.home-hero { margin-top: 4px; }
.home-hero .art {
  -webkit-mask-image: url('../art/vlados.webp'); mask-image: url('../art/vlados.webp');
  width: 100%;
  aspect-ratio: 705 / 720;
  -webkit-mask-position: center top; mask-position: center top;
  -webkit-mask-size: cover; mask-size: cover;
  max-height: 46dvh;
}
.home-hero h1 { margin-top: 22px; }
.home-hero .actions { margin-top: 24px; display: grid; gap: 8px; }
.home-hero .quick { display: flex; gap: 4px; justify-content: center; }

.today {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-radius: var(--radius);
  margin: 32px 0 0; padding: 16px 0;
}
.today > div { padding: 0 16px; }
.today > div + div { box-shadow: inset 1px 0 0 var(--rule); }
.today dt { color: var(--faint); font-size: 13px; }
.today dd { margin: 4px 0 0; font: 300 30px/1 var(--display); }
.today dd small { font: 400 13px var(--sans); color: var(--faint); margin-left: 3px; }
.today .goal-track { height: 3px; background: var(--raised); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.today .goal-track i { display: block; height: 100%; background: var(--flame); border-radius: 2px; }

.group .art {
  width: 100%; aspect-ratio: 2 / 1;
  --art-ink: rgb(239 239 237 / 58%);
  margin-bottom: 18px;
}

.rows {
  list-style: none; padding: 0;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden;
}
.rows > li + li { box-shadow: inset 0 1px 0 var(--rule); }
.row-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 12px 12px 12px 16px;
  background: none; border: 0; text-align: left; text-decoration: none; color: inherit;
  transition: background-color 150ms;
}
.row-item:active { background: var(--raised); }
@media (hover: hover) { .row-item:hover { background: var(--raised); } }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-main b { font-weight: 500; }
.row-main small { color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.row-item > .icon { color: var(--faint); width: 18px; height: 18px; }
.row-end { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; flex: none; }

.person {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 99px;
  background: hsl(var(--h) 22% 20%); color: hsl(var(--h) 55% 82%);
  font: 500 15px/1 var(--sans);
}
.person.vlados {
  background: var(--raised);
  position: relative; overflow: hidden;
}
.person.vlados::after {
  content: ''; position: absolute; inset: 0;
  background: var(--ink);
  -webkit-mask: url('../art/vlados.webp') 50% 22% / 240% no-repeat;
  mask: url('../art/vlados.webp') 50% 22% / 240% no-repeat;
}

.level {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px;
  background: var(--flame-tint); color: var(--flame); font-size: 13px; font-weight: 600;
}

/* ---------- onboarding ---------- */

.onboarding .art {
  -webkit-mask-image: url('../art/kitchen.webp'); mask-image: url('../art/kitchen.webp');
  width: 100%; aspect-ratio: 533 / 560; max-height: 40dvh;
  -webkit-mask-position: center top; mask-position: center top;
  -webkit-mask-size: cover; mask-size: cover;
  margin-top: 4px;
}
.onboarding h1 { margin-top: 24px; }
.onboarding form { margin-top: 32px; }

/* ---------- forms ---------- */

.panel { background: var(--surface); border-radius: var(--radius); padding: 18px 16px; }
.fields { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 500; }
.field > small, .field-hint { color: var(--faint); font-weight: 400; font-size: 13px; }

input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--raised); border: 0; border-radius: 8px;
  font-size: 16px; font-weight: 400;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 150ms;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
textarea { resize: vertical; line-height: 1.45; }
select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4b1ab' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
option { background: var(--surface); }
.input-row { display: flex; gap: 8px; }
.input-row > input { flex: 1; min-width: 0; }

.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; cursor: pointer;
}
.switch span { display: grid; gap: 2px; font-size: 15px; font-weight: 500; }
.switch small { color: var(--faint); font-size: 13px; font-weight: 400; }
.switch input {
  appearance: none; flex: none; margin: 0;
  width: 44px; height: 26px; border-radius: 99px; background: var(--nested);
  position: relative; transition: background-color 200ms var(--ease);
}
.switch input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 99px;
  background: var(--faint); transition: transform 200ms var(--ease), background-color 200ms;
}
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-ink); }

details.help { font-size: 14px; color: var(--muted); }
details.help summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--ink); font-weight: 500; }
details.help ol { padding-left: 20px; display: grid; gap: 6px; }
details.help p { margin-top: 10px; }

.error { color: var(--bad); font-size: 14px; }
.ok { color: var(--good); }

/* ---------- settings ---------- */

.settings .section { margin-top: 40px; }
.memory { list-style: none; padding: 0; display: grid; }
.memory li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; font-size: 15px; }
.memory li + li { box-shadow: inset 0 1px 0 var(--rule); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.colophon { margin-top: 40px; color: var(--faint); font-size: 13px; text-align: center; }

/* ---------- session ---------- */

.session {
  display: flex; flex-direction: column;
  min-height: 100dvh; max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) var(--gutter) calc(var(--safe-b) + 16px);
}
.session-head { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.session-head .who { flex: 1; min-width: 0; display: grid; }
.session-head .who h1 { font: 300 28px/1 var(--display); }
.session-head .who small { color: var(--faint); font-size: 13px; margin-top: 2px; }
.clock { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.clock .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--faint); }
.session[data-status=live] .clock .dot { background: var(--flame); animation: live 1.6s steps(1, end) infinite; }
@keyframes live { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.3; } }

.goal-line { color: var(--muted); font-size: 15px; margin-top: 4px; }

.stage { display: grid; justify-items: center; gap: 14px; margin: 20px 0 8px; }
.burner { position: relative; width: min(64vw, 248px); aspect-ratio: 1; }
.burner svg { position: relative; width: 100%; height: 100%; overflow: visible; }
/* The engraved burner sits faintly behind the live one. */
.burner::before {
  content: ''; position: absolute; inset: -16%;
  background: rgb(239 239 237 / 7%);
  -webkit-mask: url('../art/burner.webp') center / contain no-repeat;
  mask: url('../art/burner.webp') center / contain no-repeat;
}
.burner .crown { fill: none; stroke: var(--raised); stroke-width: 7; }
.burner .cap { fill: var(--surface); }
.burner .tongue { fill: var(--faint); opacity: 0.55; transition: fill 250ms, opacity 250ms; }
.burner[data-who=partner] .tongue { fill: var(--flame); opacity: 1; }
.burner[data-who=user] .tongue { fill: var(--ink); opacity: 0.95; }
.burner .face {
  position: absolute; inset: 31%; border-radius: 99px; overflow: hidden;
  display: grid; place-items: center;
  font: 300 34px/1 var(--display); color: var(--muted);
}
.burner .face.vlados::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  -webkit-mask: url('../art/vlados.webp') 50% 22% / 240% no-repeat;
  mask: url('../art/vlados.webp') 50% 22% / 240% no-repeat;
}
.status { font-size: 16px; color: var(--muted); min-height: 24px; text-align: center; }
.session[data-status=error] .status { color: var(--bad); max-width: 32ch; }
.stage .retry { display: flex; gap: 8px; justify-content: center; }

.captions {
  flex: 1; min-height: 120px; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 8px 0 12px;
}
.captions.hidden { visibility: hidden; }
.cap { font-size: 16px; line-height: 1.45; color: var(--ink); }
.cap b { display: block; font-size: 12px; font-weight: 500; color: var(--faint); margin-bottom: 1px; }
.cap.model b { color: var(--flame); }
.cap.user { color: var(--muted); }
.cap.hint-text { color: var(--faint); font-size: 15px; }

.controls {
  display: grid; grid-template-columns: repeat(3, 56px) 1fr; gap: 10px; align-items: center;
  padding-top: 8px;
}
.ctl {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 99px; border: 0;
  background: var(--raised); color: var(--ink);
  transition: transform 150ms var(--ease), background-color 150ms;
}
.ctl:active { transform: scale(0.94); }
.ctl[aria-pressed=false] { color: var(--faint); }
.ctl[data-action=mute][aria-pressed=true] { background: var(--bad-tint); color: var(--bad); }
.ctl .icon { width: 24px; height: 24px; }
.controls .btn { min-height: 56px; }

/* ---------- report ---------- */

.back-row { display: flex; align-items: center; min-height: 56px; margin-left: -12px; }
.report-head .meta { color: var(--faint); font-size: 14px; margin-top: 8px; }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: start; margin-top: 28px; }
.verdict .grade { font: 300 64px/0.85 var(--display); color: var(--flame); grid-row: span 2; }
.verdict .grade-label { color: var(--faint); font-size: 13px; }
.verdict p { font-size: 17px; }

.scores { display: grid; gap: 12px; margin-top: 28px; }
.score { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 12px; font-size: 14px; }
.score span { color: var(--muted); text-transform: capitalize; }
.score .track { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.score .track i { display: block; height: 100%; background: var(--flame); border-radius: 3px; }
.score b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.score b small { color: var(--faint); font-weight: 400; }

.fixes { list-style: none; padding: 0; background: var(--surface); border-radius: var(--radius); }
.fixes > li { padding: 16px; display: grid; gap: 6px; }
.fixes > li + li { box-shadow: inset 0 1px 0 var(--rule); }
.said { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; font-size: 15px; }
.said.plain { color: var(--faint); text-decoration: none; }
.better { color: var(--ink); font-size: 17px; font-weight: 500; }
.why { color: var(--muted); font-size: 14px; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-right: 8px; border-radius: 99px;
  background: var(--raised); color: var(--muted); font-size: 12px; vertical-align: 1px;
}
.tag.on { background: var(--flame-tint); color: var(--flame); }
.fix-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 14px; min-height: 40px; }
.saved .icon { width: 16px; height: 16px; }

.wins { padding-left: 20px; display: grid; gap: 8px; }
.wins li::marker { color: var(--flame); }

.phrase-line { font-size: 17px; font-weight: 500; }
.example { color: var(--muted); font-size: 15px; font-style: italic; }

.next {
  margin-top: 48px; padding: 20px 16px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: inset 3px 0 0 var(--flame);
}
.next h2 { font: 300 24px/1 var(--display); margin-bottom: 8px; }

.listening { display: grid; justify-items: center; text-align: center; gap: 16px; margin-top: 32px; }
.listening .art { -webkit-mask-image: url('../art/recorder.webp'); mask-image: url('../art/recorder.webp'); width: 72%; aspect-ratio: 734 / 599; }
.listening .reels { display: flex; gap: 8px; }
.listening .reels i { width: 8px; height: 8px; border-radius: 99px; background: var(--flame); animation: reel 1.2s var(--ease) infinite; }
.listening .reels i:nth-child(2) { animation-delay: 0.15s; }
.listening .reels i:nth-child(3) { animation-delay: 0.3s; }
@keyframes reel { 0%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

details.transcript { margin-top: 48px; background: var(--surface); border-radius: var(--radius); padding: 0 16px; }
details.transcript summary { min-height: 56px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }
details.transcript[open] { padding-bottom: 16px; }
details.transcript .cap + .cap { margin-top: 10px; }
details.transcript .btn { margin-top: 16px; }

.end-actions { display: flex; gap: 8px; margin-top: 32px; }
.end-actions .btn.primary { flex: 1; }

/* ---------- history, phrases ---------- */

.figures { display: flex; gap: 28px; margin: 20px 0 0; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dt { color: var(--faint); font-size: 13px; }
.figures dd { margin: 0; font: 300 34px/1 var(--display); }

.empty { display: grid; justify-items: center; text-align: center; gap: 12px; margin-top: 40px; }
.empty .art { width: 78%; aspect-ratio: 1; --art-ink: rgb(239 239 237 / 70%); margin-bottom: 8px; }
.empty h2 { font: 300 30px/1 var(--display); }
.empty p { color: var(--muted); max-width: 30ch; }
.empty .btn { margin-top: 8px; }

.phrase-row { padding: 14px 8px 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.phrase-row .phrase-line { grid-column: 1; }
.phrase-row .acts { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: flex-start; }
.phrase-row .muted, .phrase-row .example, .phrase-row .meta { grid-column: 1; font-size: 14px; }
.phrase-row .meta { color: var(--faint); }

/* ---------- dialog (bottom sheet) ---------- */

dialog.sheet {
  width: min(560px, 100%); max-width: 100%; margin: auto auto 0; padding: 24px var(--gutter) calc(20px + var(--safe-b));
  border: 0; border-radius: 18px 18px 0 0;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 -12px 40px rgb(0 0 0 / 45%);
  overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet 280ms var(--ease); }
dialog.sheet::backdrop { background: rgb(0 0 0 / 60%); }
dialog.sheet h2 { font: 300 30px/1 var(--display); }
dialog.sheet p { margin: 8px 0 16px; color: var(--muted); }
dialog.sheet .sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* ---------- nav, toast ---------- */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--ground); box-shadow: inset 0 1px 0 var(--rule);
}
.nav a {
  display: grid; place-items: center; align-content: center; gap: 4px;
  color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 500;
  transition: color 150ms;
}
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--ink); }
.nav a:active { color: var(--ink); }
@media (hover: hover) { .nav a:hover { color: var(--ink); } }

.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 30;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 99px;
  background: var(--ink); color: var(--on-ink); font-size: 15px; font-weight: 500;
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
  transition: opacity 200ms, transform 250ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wider screens: the same column, more air ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .page { padding-top: 32px; }
  .title { font-size: 56px; }
  .nav { left: 50%; right: auto; width: 560px; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
