/* Grey, the simple version (/simple/). One column, big type, big buttons, words instead of icons.
   Written for people who find the full site too much: three numbered steps and nothing else.
   No inline styles anywhere (the site's CSP); light and dark follow <html data-scheme> from /assets/theme.js.
   Kept to plain CSS that old tablets understand: every clamp() has a fallback before it, no flex gap. */

:root {
  --paper: #ffffff; --wash: #f5f5f6; --wash-2: #ececee; --rule: #c9c9cf;
  --ink: #141417; --ink-2: #3b3b42;
  --red: #c8241f; --red-dark: #a51b17; --red-soft: #fdeceb; --on-red: #ffffff;
  --focus: #1a5fd0; --ok: #14663a; --ok-soft: #e9f6ee;
  --display: "Schibsted Grotesk", "Public Sans", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei", sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --paper: #121214; --wash: #1c1c20; --wash-2: #27272c; --rule: #4a4a54;
  --ink: #f2f2f5; --ink-2: #d0d0d8;
  --red-soft: #3a1817; --focus: #8ab4ff; --ok: #7fd6a2; --ok-soft: #15291d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 125%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 600px) { html { font-size: 137.5%; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1rem; line-height: 1.5;
  padding: 0 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
[hidden] { display: none !important; }
.top, main, .foot { max-width: 34rem; margin: 0 auto; }

.top { padding: 18px 0 6px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.3rem; min-height: 48px; }
.brand img { display: block; margin-right: 12px; }

h1 { font-family: var(--display); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; margin: 14px 0 10px; font-size: 1.7rem; font-size: clamp(1.55rem, 7vw, 2rem); text-wrap: balance; }
.lead { margin: 0 0 22px; color: var(--ink-2); }
/* Japanese: break lines between phrases, not in the middle of a word (newer browsers; others wrap as usual) */
:lang(ja) h1, :lang(ja) h2, :lang(ja) p, :lang(ja) .btn, :lang(ja) .big { word-break: auto-phrase; }

/* the three steps */
.step { border: 2px solid var(--rule); border-radius: 18px; padding: 18px 16px 20px; margin: 0 0 20px; background: var(--paper); }
@media (min-width: 600px) { .step { padding: 22px 24px 26px; } }
.step h2 { display: flex; align-items: center; margin: 0 0 14px; font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.2; }
.step h2 label { display: flex; align-items: center; min-height: 44px; }
.num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; margin-right: 0.7rem; border-radius: 50%; background: var(--red); color: var(--on-red); font-size: 1.2rem; }
.hint { margin: 0 0 12px; color: var(--ink-2); }

textarea {
  display: block; width: 100%; min-height: 8.5rem; resize: vertical;
  padding: 14px 16px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1.1rem; line-height: 1.45;
}
#count { margin: 10px 0 0; font-weight: 600; }

/* buttons: words, never icons alone; at least 60 px tall */
.row { display: flex; flex-wrap: wrap; margin: 14px -6px -12px; }
.row > * { margin: 0 6px 12px; flex: 1 1 12rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 60px; padding: 10px 18px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; line-height: 1.25;
  text-decoration: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.btn:active { background: var(--rule); }
.btn.strong { background: var(--ink); color: var(--paper); }
.btn.strong:active { background: var(--ink-2); }

.big {
  display: flex; align-items: center; justify-content: center; text-align: center; width: 100%;
  min-height: 92px; padding: 14px 20px; border: 0; border-radius: 18px;
  background: var(--red); color: var(--on-red);
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.2;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.big:active { background: var(--red-dark); }
.big[aria-disabled="true"] { background: var(--wash-2); color: var(--ink-2); cursor: default; }

/* hover only where there is a mouse: on a touch screen a pressed button would stay "hovered" */
@media (hover: hover) {
  .btn:hover, .voice:hover { background: var(--wash-2); }
  .btn.strong:hover { background: var(--ink-2); }
  .big:hover { background: var(--red-dark); }
  .big[aria-disabled="true"]:hover { background: var(--wash-2); }
  .voice[aria-pressed="true"]:hover { background: var(--red-soft); }
}

/* a clear ring for the keyboard (old browsers without :focus-visible keep the ring on every focus) */
a:focus, button:focus, textarea:focus { outline: 4px solid var(--focus); outline-offset: 3px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* step 2: the two voices */
.voices { display: grid; grid-template-columns: 1fr; grid-gap: 12px; gap: 12px; }
@media (min-width: 520px) { .voices { grid-template-columns: 1fr 1fr; } }
.voice {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%;
  min-height: 108px; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink); font: inherit; line-height: 1.25;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.v-name { font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.v-kind { margin-top: 2px; color: var(--ink-2); }
.v-on { margin-top: 8px; font-weight: 700; color: var(--red-dark); visibility: hidden; }
:root[data-scheme="dark"] .v-on { color: #ff9a90; }
.voice[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); }
.voice[aria-pressed="true"] .v-on { visibility: visible; }

/* step 3: what is happening, in words */
.error:empty, .status:empty { display: none; }
.error { margin: 16px 0 0; padding: 14px 16px; border: 3px solid var(--red); border-radius: 14px; background: var(--red-soft); font-weight: 700; }
.error.need { margin: 0 0 12px; }
.error small { display: block; margin-top: 6px; font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.status { margin: 16px 0 0; font-weight: 700; font-size: 1.1rem; }
.working { margin-top: 12px; }
.working .btn { margin-top: 14px; width: 100%; }
.bar { height: 20px; border-radius: 10px; background: var(--wash-2); border: 2px solid var(--rule); overflow: hidden; }
#fill { height: 100%; width: 0; background: var(--red); border-radius: 8px; transition: width 0.4s linear; }
.bar.wait #fill { width: 40%; animation: slide 1.6s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(-20%); } to { transform: translateX(170%); } }

.result { margin-top: 16px; padding: 16px; border: 3px solid var(--ok); border-radius: 14px; background: var(--ok-soft); }
.ready { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.25; }

.ai { margin: 0 0 26px; padding: 14px 16px; border-left: 6px solid var(--red); background: var(--wash); border-radius: 0 12px 12px 0; }

/* the way out to the full site, the languages, the small print */
.foot { padding: 4px 0 36px; padding-bottom: max(36px, env(safe-area-inset-bottom)); }
.full { display: flex; width: 100%; }
.foot .hint { margin: 10px 0 26px; text-align: center; text-wrap: balance; }
/* (11-29) the link to /read-aloud/ under the hint: in the page's ink, like the language and legal links */
.foot .hint a { color: var(--ink); text-underline-offset: 4px; }
.langs { display: flex; flex-wrap: wrap; justify-content: center; border-top: 2px solid var(--rule); padding-top: 14px; }
.langs a, .legal a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; color: var(--ink); text-underline-offset: 4px; }
.langs a[aria-current="true"] { font-weight: 700; text-decoration: none; border-bottom: 4px solid var(--red); }
.legal { display: flex; flex-wrap: wrap; justify-content: center; margin: 6px 0 0; font-size: 0.85rem; }
.nojs { max-width: 34rem; margin: 0 auto 30px; padding: 14px 16px; border: 3px solid var(--red); border-radius: 14px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  #fill { transition: none; }
  .bar.wait #fill { animation: none; width: 100%; opacity: 0.45; }
}
@media (forced-colors: active) {
  .voice[aria-pressed="true"] { outline: 4px solid Highlight; }
  #fill { background: Highlight; }
}
@media print { .foot, .working, .row, .big { display: none; } }
/* a voice maker's credit on its card (terms.html#credits) */
.v-credit { display: block; margin-top: 4px; font-size: .85em; color: var(--ink-2); }
/* (11-29) the questions under the tool: closed until tapped, rows big enough to tap */
.qa { margin: 30px 0 6px; }
.qa h2 { margin: 0 0 6px; font-size: 1.3rem; }
.qa details { border-top: 2px solid var(--rule); }
.qa details:last-child { border-bottom: 2px solid var(--rule); }
.qa summary { display: flex; align-items: center; min-height: 52px; padding: 6px 0; font-weight: 700; cursor: pointer; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "+"; flex: none; width: 1.4em; font-size: 1.3rem; color: var(--red); }
.qa details[open] > summary::before { content: "–"; }
.qa p { margin: 0 0 14px 1.4em; color: var(--ink-2); }
