/* Subtitle Sync setup page.
   One accent, generous spacing, large text and tap targets, light and dark.
   No external fonts, images or scripts. */

:root {
  --bg: #f5f4fb;
  --bg-glow: rgba(139, 109, 255, 0.16);
  --surface: #ffffff;
  --surface-2: #f0eefb;
  --text: #1a1830;
  --muted: #5d5a78;
  --border: #e2dff2;
  --border-strong: #cfcae8;
  --accent: #5b3df0;
  --accent-2: #8b6dff;
  --accent-ink: #ffffff;
  --accent-soft: #eee9ff;
  --ok: #0a7d52;
  /* The accent as a text colour. In dark mode the accent itself is too dim for text on the dark
     and pale-accent backgrounds (WCAG AA 4.5:1), so text gets a lighter shade of it. */
  --accent-text: var(--accent);
  --ok-soft: #e2f6ec;
  --warn: #8a5a00;
  --warn-soft: #fff3d1;
  --err: #c22f3c;
  --err-soft: #fde9ec;
  --shadow: 0 1px 2px rgba(26, 24, 48, 0.05), 0 8px 28px rgba(26, 24, 48, 0.07);
  --shadow-lg: 0 2px 4px rgba(26, 24, 48, 0.06), 0 18px 46px rgba(60, 40, 160, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* One easing for everything that moves: quick to start, soft to settle. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d19;
    --bg-glow: rgba(139, 109, 255, 0.18);
    --surface: #17162a;
    --surface-2: #1f1e37;
    --text: #edecff;
    --muted: #a4a2c6;
    --border: #2b2949;
    --border-strong: #3a3760;
    --accent: #8f73ff;
    --accent-2: #b3a0ff;
    --accent-ink: #0e0d19;
    --accent-soft: #272052;
    --accent-text: #a592ff;
    --ok: #39d08f;
    --ok-soft: #10281f;
    --warn: #f0be55;
    --warn-soft: #2c2410;
    --err: #ff7d88;
    --err-soft: #2e1519;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 46px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0d19;
  --bg-glow: rgba(139, 109, 255, 0.18);
  --surface: #17162a;
  --surface-2: #1f1e37;
  --text: #edecff;
  --muted: #a4a2c6;
  --border: #2b2949;
  --border-strong: #3a3760;
  --accent: #8f73ff;
  --accent-2: #b3a0ff;
  --accent-ink: #0e0d19;
  --accent-soft: #272052;
  --accent-text: #a592ff;
  --ok: #39d08f;
  --ok-soft: #10281f;
  --warn: #f0be55;
  --warn-soft: #2c2410;
  --err: #ff7d88;
  --err-soft: #2e1519;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 46px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(900px 420px at 50% -120px, var(--bg-glow), transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.root { min-height: 100vh; }
.noscript { max-width: 34rem; margin: 4rem auto; padding: 1.2rem; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.35rem); font-weight: 780; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 10px; }

.skip { position: absolute; left: -999px; top: 0; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 0.7rem 1rem; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* ------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(1.4) blur(14px); background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.top.scrolled { border-bottom-color: var(--border); }
.top__row { max-width: 820px; margin: 0 auto; padding: 0.8rem 1.1rem; display: flex; align-items: center; gap: 0.8rem; }
/* The logo never shrinks away: on the narrowest phones the tools give way instead (see below). */
.brand { display: flex; align-items: center; gap: 0.7rem; min-width: 38px; flex: 1; }
.seg__short { display: none; }
@media (max-width: 380px) {
  /* "EN" / "SR" instead of "English" / "Srpski", so the logo and every button fit at 320 px. */
  .seg__long { display: none; }
  .seg__short { display: inline; }
}
.brand__link { display: inline-flex; align-items: center; gap: 0.7rem; min-width: 0; color: inherit; text-decoration: none; border-radius: 12px; }
.brand__link:hover b { color: var(--accent-text); }
.brand img { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.brand b { font-size: 1.02rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 650; padding: 0.35rem 0.8rem; border-radius: 999px; cursor: pointer; min-height: 34px; transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color 0.18s var(--ease), border-color 0.18s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* --------------------------------------------------------- page frame */
.wrap { max-width: 820px; margin: 0 auto; padding: 0 1.1rem 4rem; }
.hero { padding: 1.6rem 0 0.9rem; }
/* The welcome page: what the addon does, who it is for, and the way in. */
.welcome__head { padding-top: 1.6rem; }
.welcome__lead { color: var(--muted); font-size: 1.15rem; margin-top: 0.6rem; max-width: 38rem; }
.welcome__points { margin: 0.6rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.45rem; }
/* The donation line; the Donate button reads as a link in the sentence, the heart follows it. */
.welcome__donate { color: var(--muted); max-width: 42rem; margin-inline: auto; text-align: center; }
.welcome__donate:empty { display: none; }
.welcome__donate .linkbtn { font-size: inherit; padding: 0; vertical-align: baseline; }
.welcome__donate svg { color: var(--err); vertical-align: -3px; }
/* The before/after: two little film frames. The subtitle on the left arrives late. */
.movies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-top: 0.9rem; }
.movie { margin: 0; display: grid; gap: 0.45rem; }
.movie__label { font-weight: 700; font-size: 0.95rem; }
.movie__screen { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 30% 30%, #3a3456, #111019 70%); display: grid; align-content: space-between; padding: 0.8rem; }
/* The lines of each kind sit on top of each other, and take turns. */
.movie__speeches, .movie__subs { display: grid; }
.movie__speeches > *, .movie__subs > * { grid-area: 1 / 1; }
.movie__subs { justify-self: center; justify-items: center; text-align: center; }
.movie__speech { color: #e9e6ff; font-size: 0.9rem; font-style: italic; }
.movie__sub { color: #fff; font-weight: 700; font-size: 1.05rem; padding: 0.15rem 0.55rem; border-radius: 6px; background: rgba(0, 0, 0, 0.55); }
.movie__tag { justify-self: center; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; font-weight: 650; color: var(--ok); }
.movie--late .movie__tag { color: var(--err); }
/* Still frame (also what reduced motion shows): the first line spoken, its on-time subtitle up, the late one not yet. */
.movie__speech, .movie__sub { opacity: 0; }
.movie__speech.movie__line--1, .movie--sync .movie__sub.movie__line--1 { opacity: 1; }
/* Moving: a 19 s loop. Each line is spoken for 3.5 s, from 0.5 s, 5.5 s and 10.5 s. The on-time
   subtitle shows with it; the late one 4.5 s after the line starts, so 1 s after the speaking
   has stopped, running over the next line. "4.5 s late" under the screen says the same. */
.movie__speech, .movie__sub { animation: movie-line 19s infinite backwards; }
.movie__line--1 { animation-delay: 0.5s; }
.movie__line--2 { animation-delay: 5.5s; }
.movie__line--3 { animation-delay: 10.5s; }
.movie--late .movie__sub.movie__line--1 { animation-delay: 5s; }
.movie--late .movie__sub.movie__line--2 { animation-delay: 10s; }
.movie--late .movie__sub.movie__line--3 { animation-delay: 15s; }
@keyframes movie-line { 0% { opacity: 0; } 1%, 17.4% { opacity: 1; } 18.4%, 100% { opacity: 0; } }
@media (max-width: 560px) { .movies { grid-template-columns: 1fr; } }

/* Stremio's subtitle menu, as it looks in the app: always dark, like Stremio. */
.menu-mock { margin-top: 0.8rem; border-radius: 12px; background: #151421; color: #e9e6ff; padding: 0.8rem; display: grid; gap: 0.5rem; font-size: 0.93rem; }
.menu-mock__lang { font-weight: 750; color: #fff; padding: 0 0.4rem; }
.menu-mock ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.menu-mock li { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.5rem; border-radius: 8px; }
.menu-mock li.is-picked { background: rgba(143, 115, 255, 0.28); }
.menu-mock__dot { width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid #8f84c9; flex: none; }
.menu-mock li.is-picked .menu-mock__dot { background: #b3a0ff; border-color: #b3a0ff; }
/* The "make it automatic" step: a key step, so it stands out; its drawing of Stremio's setting row matches the menu drawing. */
.setting-mock { margin-top: 0.8rem; border-radius: 12px; background: #151421; color: #e9e6ff; padding: 0.8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; font-size: 0.93rem; }
.setting-mock__value { background: rgba(143, 115, 255, 0.28); border-radius: 8px; padding: 0.35rem 0.7rem; font-weight: 650; color: #fff; }

/* Small drawings of another app's screen, with the thing to press lit up. Dark, like
   the menu drawing; only the parts that matter, so a changed layout still reads right. */
.guide { margin: 0.8rem 0 0; }
.guide__label { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.35rem; }
/* A real screenshot of another app: framed like a card, and a tap opens it full size. */
.guide__shot { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 10%, transparent); cursor: zoom-in; }
.guide__shot:focus-visible { outline: none; box-shadow: var(--focus); }
.guide__shot img { display: block; width: 100%; height: auto; }

/* What you need before starting: a tick for what is required, a star for what is optional. */
.need-list { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.need { position: relative; padding-left: 1.8rem; }
.need::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.need--yes::before { content: "✓"; color: var(--ok); }
.need--maybe::before { content: "☆"; color: var(--accent-text); }
.need ul { margin: 0.35rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }

.faq { display: grid; margin-top: 1.6rem; }
/* The FAQ and contact page. */
.help__head { display: grid; justify-items: start; gap: 0.6rem; }
.help .faq { margin-top: 0; }
.help #contact { scroll-margin-top: 90px; }
.help #help-contact { margin-top: 0.9rem; }
.welcome__questions { text-align: center; color: var(--muted); }
.welcome__questions a { font-weight: 700; }
.welcome__questions svg { vertical-align: -3px; }

.welcome__start { display: grid; justify-items: center; gap: 0.5rem; margin-top: 0.4rem; text-align: center; }
.welcome__start .btn { width: 100%; }

.steps { display: flex; gap: 0.4rem; margin: 1.3rem 0 1.4rem; padding: 0; list-style: none; counter-reset: s; }
.steps li { flex: 1; min-width: 0; }
.chip { width: 100%; display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 0.93rem; font-weight: 650; cursor: pointer; text-align: left; min-height: 48px; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip__n { flex: none; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 0.85rem; background: var(--surface-2); color: var(--muted); transition: background-color 0.18s var(--ease), color 0.18s var(--ease); }
.chip__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip[aria-current="step"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chip[aria-current="step"] .chip__n { background: var(--accent); color: var(--accent-ink); }
/* The ink is white on the light theme's dark green and near-black on the dark theme's light green (at least 3:1 in both). */
.chip.done .chip__n { background: var(--ok); color: var(--accent-ink); }
@media (max-width: 620px) {
  .chip__t { display: none; }
  .chip { justify-content: center; padding: 0.55rem; }
  .steps { gap: 0.35rem; }
  .brand b { font-size: 0.95rem; }
}
@media (max-width: 430px) {
  /* The name is in the big title right below; a cut-off copy in the bar only looks broken. */
  .brand b { display: none; }
}

/* Only moving to another step animates. Ticking a box or switching a choice redraws parts of
   the page, and replaying this each time made the whole section flash and slide. */
.panel--enter { animation: rise 0.35s var(--ease); }
/* A place that content is put into and taken out of, without adding a gap when it is empty. */
.slot { display: contents; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Something that just appeared inside a step (a check result, a hint, a test row) fades up, once.
   Everything a screen reader is told about is exactly that: something that just appeared. */
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
[aria-live="polite"] > * { animation: fade-up 0.2s var(--ease) backwards; }
.test-results > :nth-child(2) { animation-delay: 40ms; }
.test-results > :nth-child(3) { animation-delay: 80ms; }
.test-results > :nth-child(4) { animation-delay: 120ms; }
/* A pill, row or box added to a list that is already on the screen. */
.is-new { animation: rise 0.25s var(--ease) backwards; }

.stack { display: grid; gap: 1.1rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 0.5rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.3rem 1.4rem; }
.card__head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.card__head h3 { flex: 1; min-width: 0; }
.badge { font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* --------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: inherit; font-weight: 700; font-size: 1rem; min-height: 48px; padding: 0.6rem 1.15rem; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s, background 0.15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn--primary:hover { border-color: transparent; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(1px); }
.btn--big { min-height: 58px; font-size: 1.1rem; padding: 0.8rem 1.5rem; border-radius: 16px; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); border-color: var(--border); }
.btn--small { min-height: 40px; padding: 0.35rem 0.85rem; font-size: 0.93rem; border-radius: 12px; }
.btn svg { flex: none; }
.actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.actions .spacer { flex: 1; }

/* ---------------------------------------------------------- language chips */
.langs { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }
.pill span { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 46px; padding: 0.4rem 1rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 650; transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.pill span small { font-weight: 500; color: var(--muted); font-size: 0.85rem; transition: color 0.18s var(--ease); }
.pill input:hover + span { border-color: var(--accent-2); }
.pill input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.pill input:checked + span small { color: var(--accent-text); }
.pill input:focus-visible + span { box-shadow: var(--focus); }
/* The box grows into its tick: a small pop, not a bounce. */
.pill span::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--border-strong); flex: none; background: transparent; transform: scale(0.88); transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease); }
.pill input:checked + span::before { transform: scale(1); background: var(--accent); border-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 14px; background-position: center; background-repeat: no-repeat; }
.search { margin-top: 1rem; }

/* -------------------------------------------------------- choice tiles */
.tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 1rem; }
/* Four answers: two by two rather than three and one alone. */
.tiles--pairs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.tile { position: relative; display: block; }
.tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; z-index: 1; }
.tile__body { height: 100%; display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1.5px solid var(--border-strong); background: var(--surface); transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.tile__title { font-weight: 720; display: flex; align-items: center; gap: 0.5rem; }
.tile__title::before { content: ""; width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--border-strong); flex: none; transform: scale(0.88); transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), transform 0.18s var(--ease); }
.tile__hint { color: var(--muted); font-size: 0.93rem; }
.tile input:hover:not(:disabled) + .tile__body { border-color: var(--accent-2); }
.tile input:checked + .tile__body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 12%, transparent); }
.tile input:checked + .tile__body .tile__title::before { transform: scale(1); border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 42%, transparent 46%); }
.tile input:focus-visible + .tile__body { box-shadow: var(--focus); }
.tile input:disabled { cursor: not-allowed; }
.tile input:disabled + .tile__body { opacity: 0.55; border-style: dashed; }
.question .tiles { margin-top: 0.8rem; }
/* A tile you can tick together with others (a checkbox) is a rounded square with a tick,
   so it does not look like a choice of one (a radio, a circle). */
.tile input[type="checkbox"] + .tile__body .tile__title::before { border-radius: 6px; }
.tile input[type="checkbox"]:checked + .tile__body .tile__title::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
/* The one answer that gives the best result, on its own line and marked, above the rest. */
.tile--featured { grid-column: 1 / -1; }
.tile--featured .tile__body { border-width: 2px; border-color: var(--accent); }
.tile--featured .tile__title { flex-wrap: wrap; }
.tile--featured .tile__hint { color: var(--text); }
/* A line inside a grid of tiles that names the group below it. */
.tiles__label { grid-column: 1 / -1; margin: 0.35rem 0 -0.2rem; }

/* --------------------------------------------------------- credentials */
.cred { display: grid; gap: 1.1rem; }
.cred__label { font-size: 0.8rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cred ol { margin: 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 0.6rem; }
.cred ol li { counter-increment: n; display: grid; grid-template-columns: 30px 1fr; gap: 0.75rem; align-items: start; }
.cred ol li::before { content: counter(n); width: 30px; height: 30px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 750; font-size: 0.9rem; display: grid; place-items: center; }
.cred ol li span { padding-top: 0.2rem; }
/* Buttons that act on a card (open the site, check what was pasted) sit in its middle. */
.cred__action { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; }
/* What a value looks like: a line of text between the label and the box, never a box itself. */
.field__hint { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.field__hint code { font-family: var(--mono); font-size: 0.86rem; color: var(--text); background: var(--surface-2); padding: 0.05rem 0.35rem; border-radius: 6px; word-break: break-all; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 700; font-size: 0.97rem; }
.input { width: 100%; min-height: 52px; padding: 0.7rem 0.95rem; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 14px; transition: border-color 0.12s, box-shadow 0.12s; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:hover { border-color: var(--accent-2); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.input.mono { font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.01em; }
.input[aria-invalid="true"] { border-color: var(--err); }
.input--ok { border-color: var(--ok); }
.inputrow { display: flex; gap: 0.5rem; align-items: stretch; }
.inputrow .input { flex: 1; min-width: 0; }
.inputrow .btn { flex: none; }
.hint { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.95rem; padding: 0.55rem 0.8rem; border-radius: 12px; line-height: 1.4; }
/* The words may be one long unbroken thing (an email address): they wrap rather than run out of the box. */
.hint > span { min-width: 0; overflow-wrap: anywhere; }
.hint svg { flex: none; margin-top: 2px; }
.hint--ok { background: var(--ok-soft); color: var(--ok); }
.hint--err { background: var(--err-soft); color: var(--err); }
.hint--warn { background: var(--warn-soft); color: var(--warn); }
.hint--info { background: var(--surface-2); color: var(--muted); }
.hint:empty { display: none; }
.notes { color: var(--muted); font-size: 0.9rem; }
.notes:empty { display: none; }
.checkrow { display: grid; gap: 0.6rem; }
.result { min-height: 0; }
.result:empty { display: none; }
.test-results { display: grid; gap: 0.9rem; margin-top: 0.9rem; }
.test-results:empty { display: none; }
.test-row { display: grid; gap: 0.4rem; }
.test-row h4 { font-size: 1rem; font-weight: 700; margin: 0; }
.privacy { font-size: 0.9rem; color: var(--muted); display: flex; gap: 0.5rem; align-items: flex-start; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.privacy svg { flex: none; margin-top: 2px; }
.saved-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ summary */
.summary { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.summary li { display: flex; gap: 0.7rem; align-items: flex-start; }
.summary li svg { flex: none; margin-top: 3px; color: var(--ok); }
.summary li.is-neutral svg { color: var(--muted); }
.summary li.is-warn svg { color: var(--warn); }
.summary li > span { flex: 1; min-width: 0; }
.warns { display: grid; gap: 0.6rem; margin-top: 1rem; }
.warns__item { display: grid; gap: 0.4rem; justify-items: start; }
/* Why the install button is not active yet: right above it, each problem with a way to fix it. */
.not-ready { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; border-radius: var(--radius-sm); padding: 0.9rem 1rem; margin-bottom: 0.9rem; outline: none; }
.not-ready h4 { display: flex; gap: 0.5rem; align-items: center; margin: 0; }
.not-ready__list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.7rem; }
.not-ready__list li { display: grid; gap: 0.4rem; justify-items: start; }
.not-ready.is-flash { animation: not-ready-flash 1s ease-in-out; }
@keyframes not-ready-flash { 30% { box-shadow: 0 0 0 6px var(--warn-soft), 0 0 0 8px var(--warn); } }
/* A small text button, for "Change" next to each summary line. */
.linkbtn { font: inherit; font-size: 0.9rem; font-weight: 650; color: var(--accent-text); background: none; border: 0; padding: 0.1rem 0.3rem; cursor: pointer; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; flex: none; }
.linkbtn:hover { color: var(--text); }
.linkbtn:focus-visible { box-shadow: var(--focus); outline: none; }
.tips { margin: 0.8rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.steps-list { margin: 0.3rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.35rem; color: var(--muted); }
.titlerow { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }

/* ------------------------------------------------------ timing picture */
/* Speech and subtitle as two bars on one line of a film: late, then on time. */
.demo { display: grid; gap: 0.7rem; }
.demo__row { display: grid; grid-template-columns: 7.5rem 1fr 8.5rem; gap: 0.8rem; align-items: center; }
.demo__label { font-weight: 700; font-size: 0.95rem; }
.demo__track { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.demo__speech, .demo__sub { position: absolute; left: 18%; width: 46%; }
.demo__speech { top: 5px; height: 10px; border-radius: 999px; background: var(--muted); opacity: 0.55; }
.demo__sub { bottom: 5px; height: 10px; border-radius: 999px; background: var(--ok); }
.demo__row--late .demo__sub { left: 40%; background: var(--err); }
.demo__note { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; font-weight: 650; color: var(--ok); }
.demo__row--late .demo__note { color: var(--err); }
.demo__legend { display: flex; gap: 1.1rem; justify-content: center; font-size: 0.85rem; color: var(--muted); }
.demo__key { display: inline-flex; align-items: center; gap: 0.4rem; }
.demo__key::before { content: ""; width: 22px; height: 8px; border-radius: 999px; }
.demo__key--speech::before { background: var(--muted); opacity: 0.55; }
.demo__key--sub::before { background: var(--ok); }

/* ------------------------------------------------------------- support */
.donate__text { flex: 1; min-width: 14rem; }
.donate__text p { margin-top: 0.3rem; }
/* The donation card at the bottom of the install step, with Ko-fi's panel in it. */
.donate-panel { display: grid; gap: 1rem; scroll-margin-top: 90px; }
.donate-panel:focus-visible { box-shadow: var(--focus); outline: none; }
.donate-panel h3 { display: flex; align-items: center; gap: 0.45rem; }
.donate-panel h3 svg { color: var(--err); flex: none; }
.donate-panel .donate__text p { margin-top: 0.35rem; }
/* Ko-fi's donation panel, framed. Its own page is white, so it gets a white, rounded box.
   Ko-fi cannot tell this page how tall its panel is (another site, no size message), so the
   height is measured: inside this page Ko-fi shows the logged-out panel (with a "Display name"
   box), which ends at about 558 px, "Powered by Ko-fi" included, at every width (27 September
   2026; logged in it is shorter, about 494). Once someone clicks inside it, the frame grows to
   the 712 px of Ko-fi's own embed code, room for its next screen. */
.kofi-frame { display: block; width: 100%; max-width: 460px; height: 585px; margin: 0 auto; border: 0; border-radius: 16px; background: #fff; transition: height 0.3s var(--ease); }
.kofi-frame.is-open { height: 712px; }
@media (prefers-reduced-motion: reduce) { .kofi-frame { transition: none; } }
dialog.donate-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.donate-dialog::backdrop { background: rgba(14, 13, 25, 0.6); }
/* The window settles in; closing is instant. */
dialog.donate-dialog[open] { animation: dialog-in 0.22s var(--ease); }
dialog.donate-dialog[open]::backdrop { animation: backdrop-in 0.22s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.donate-dialog__body { display: grid; gap: 0.9rem; padding: 1.2rem; }
.donate-dialog__head { display: flex; align-items: center; gap: 0.7rem; }
.donate-dialog__head h2 { flex: 1; min-width: 0; font-size: 1.25rem; }
button.support-pill { font: inherit; font-weight: 700; font-size: 0.93rem; cursor: pointer; }
/* Said once an install button was pressed. */
.thanks { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.1rem; border-radius: 16px; background: var(--accent-soft); border: 1.5px solid var(--accent); animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.thanks p { margin-top: 0.3rem; }
/* In the top bar, on every step. */
.support-pill { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; padding: 0.3rem 0.85rem; border-radius: 999px; font-weight: 700; font-size: 0.93rem; text-decoration: none; color: var(--accent-text); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease); }
.support-pill:hover { border-color: var(--accent); }
.support-pill:focus-visible { box-shadow: var(--focus); outline: none; }
.support-pill svg { color: var(--err); flex: none; }
/* The FAQ link beside it: the same shape, a plain colour for its icon. */
.help-pill svg { color: var(--accent-text); }
/* Up to 520 px the header holds the logo, both pills, "English/Srpski" and the theme button only
   without the pills' words: a 428-430 px phone (the large iPhones) scrolled sideways at 420. */
@media (max-width: 520px) {
  .support-pill { padding: 0.3rem 0.65rem; }
  .support-pill__text { display: none; }
}

/* ------------------------------------------------------------- install */
.install { display: grid; gap: 1rem; margin-top: 1rem; }
.linkbox { display: grid; gap: 0.5rem; }
.linkbox .input { font-family: var(--mono); font-size: 0.85rem; }
details.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.acc + details.acc { margin-top: 0.6rem; }
details.acc summary { cursor: pointer; padding: 0.95rem 1.1rem; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 0.6rem; min-height: 52px; border-radius: var(--radius-sm); }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s var(--ease), margin-bottom 0.2s var(--ease); flex: none; margin-bottom: 4px; }
details.acc[open] summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
details.acc .acc__body { padding: 0 1.1rem 1.1rem; display: grid; gap: 0.8rem; }
/* While the body is sliding open or shut (app.mjs animates its height), nothing spills out of it. */
details.acc.is-moving .acc__body { overflow: hidden; }
.check { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.check:first-child { border-top: 0; }
.check input[type="checkbox"] { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.check label { font-weight: 650; display: block; }
.check small { display: block; color: var(--muted); font-weight: 400; }

/* The setup checklist (step 3): a progress bar, then each item as a soft row with a round tick,
   like a chosen tile once ticked. The whole row is the label. */
.checklist__bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 1rem; color: var(--accent); }
.checklist__bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.checklist__bar::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; transition: width 0.35s var(--ease); }
.checklist__bar::-moz-progress-bar { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.checklist__bar.is-ready::-webkit-progress-value { background: var(--ok); }
.checklist__bar.is-ready::-moz-progress-bar { background: var(--ok); }
.checklist__items { display: grid; gap: 0.9rem; margin-top: 1.1rem; }
.checklist .check { align-items: center; gap: 0.9rem; padding: 0.85rem 1rem; border: 1.5px solid transparent; border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease); }
.checklist .check:first-child { border-top: 1.5px solid transparent; }
.checklist .check:hover { border-color: var(--accent-2); }
.checklist .check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.checklist .check__text { font-weight: 600; line-height: 1.45; }
.checklist .check { position: relative; }
/* A row the link check proved: ticked for the person, locked, and tagged so. The tag sits on the
   row's top edge, so the round tick stays centered on the text. */
.checklist .check__tag { display: none; position: absolute; top: -0.7rem; right: 0.9rem; align-items: center; gap: 0.25rem; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.checklist .check.is-auto { cursor: default; }
.checklist .check.is-auto:hover { border-color: var(--accent); }
.checklist .check.is-auto .check__tag { display: inline-flex; }
.checklist .check input[type="checkbox"]:disabled { cursor: default; opacity: 1; }
/* Step 5: the one that matters most (the default subtitle language) wears an "Important" pill
   and an accent frame, with how to do it right under it until it is ticked. */
.checklist .check__badge { position: absolute; top: -0.7rem; right: 0.9rem; padding: 0.05rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 750; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.checklist .check.is-key { border: 2px solid var(--accent); }
.check-block { display: grid; }
.check-block__details { overflow: hidden; padding: 0.2rem 0.4rem 0.2rem 3.4rem; }
@media (max-width: 560px) { .check-block__details { padding-left: 0.4rem; } }
.checklist .check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface) center / 15px no-repeat; cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.checklist .check input[type="checkbox"]:checked {
  border-color: var(--accent); transform: scale(1.04);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.checklist .check input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--focus); }
.checklist__auto h4 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.count { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.count label { font-weight: 650; flex: 1; min-width: 12rem; }
.count .input { width: 5.5rem; min-height: 46px; text-align: center; }

.banner { padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.foot { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; display: grid; gap: 0.3rem; text-align: center; justify-items: center; }

.contact-form { display: grid; gap: 0.9rem; }
.contact-form textarea.input { min-height: 8rem; resize: vertical; line-height: 1.5; }
.contact p { margin: 0.25rem 0; }
/* The slot itself is display: contents, so the line inside it is what gets centered. */
#step5-contact .contact { text-align: center; }
.foot .linkbtn { display: inline-flex; align-items: center; gap: 0.3rem; vertical-align: middle; }
.foot .linkbtn svg { color: var(--err); flex: none; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .card { padding: 1.05rem 1rem 1.15rem; }
  /* The box people paste into gets a whole line, with its buttons underneath. */
  .inputrow { flex-wrap: wrap; }
  .inputrow .input { flex: 1 1 100%; }
  .inputrow .btn { flex: 1 1 0; }
  .actions .btn { flex: 1; }
  .actions .btn--ghost { flex: none; }
  .demo__row { grid-template-columns: 1fr; gap: 0.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Spacing and sizing helpers. The page sets no inline styles at all, because its
   security policy forbids them. */
.offscreen { position: fixed; left: -9999px; opacity: 0; }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mt-sm { margin-top: 0.6rem; }
.mb-lg { margin-bottom: 1rem; }

/* Language priority (step 1): a numbered list with up/down buttons, usable with a TV remote. */
.order { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.order__item { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.55rem 0.7rem 0.55rem 0.35rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: grab; transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
/* Dragging a row: the grip takes a finger (the rest of the row still scrolls the page); the dragged row is lifted and follows the pointer. */
.order__grip { display: grid; place-items: center; width: 2rem; height: 2rem; font-size: 1.15rem; line-height: 1; color: var(--muted); touch-action: none; cursor: grab; user-select: none; }
.order.is-sorting { user-select: none; }
.order.is-sorting .order__item { cursor: grabbing; }
.order__item.is-dragging { position: relative; z-index: 2; border-color: var(--accent); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.order__item .icon-btn { cursor: pointer; }
.order__item.is-first { border-color: var(--accent); background: var(--accent-soft); }
.order__num { width: 1.9rem; height: 1.9rem; border-radius: 999px; display: grid; place-items: center; font-weight: 750; background: var(--surface-2); color: var(--text); transition: background-color 0.18s var(--ease), color 0.18s var(--ease); }
.order__item.is-first .order__num { background: var(--accent); color: var(--accent-ink); }
.order__name { font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.order__name small { display: block; font-weight: 500; color: var(--muted); }
.order .icon-btn { font-size: 1.1rem; }
.order .icon-btn:disabled { opacity: 0.35; cursor: default; }
.order .icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
