/* M3U8 Downloader site: Welcome Page, Uninstall Page, "thank you", privacy policy, 404.
   Colours follow the extension window (extension/src/popup.css): white and neutral grey, black ink and black main
   button, red only for highlights; no beige or warm paper (owner's rule 2026-11-25). Text colours keep AA contrast.
   System fonts only (they cover Latin, Latin Extended and Cyrillic); nothing is loaded from other sites.
   No inline styles anywhere, so the Content-Security-Policy can say style-src 'self'. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #ebebef; --fg: #111113; --muted: #55555a; --placeholder: #6e6e73;
  --border: #e0e0e5; --primary: #111113; --primary-hover: #3a3a3c; --on-primary: #ffffff; --ring: #b71f14;
  --red: #b71f14; --tint: #fce8e6; --accent: #1e7b34; --accent-soft: #e3f2e6;
  --chrome: #e8e8ed; --chrome-fg: #3a3a3c; --omni: #ffffff;
  --shadow: 0 1px 2px rgb(17 17 19 / .06), 0 8px 24px rgb(17 17 19 / .08);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  --hand: "Segoe Print", "Ink Free", "Bradley Hand", "Noteworthy", "Comic Sans MS", cursive;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214; --surface: #1c1c1e; --surface-2: #2c2c2e; --fg: #f5f5f7; --muted: #aeaeb2; --placeholder: #98989f;
    --border: #38383a; --primary: #f5f5f7; --primary-hover: #d1d1d6; --on-primary: #111113; --ring: #ff8a80;
    --red: #ff6b5f; --tint: #3f1f1d; --accent: #7cc08a; --accent-soft: #1f3324;
    --chrome: #2c2c2e; --chrome-fg: #d1d1d6; --omni: #1c1c1e;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
figure, picture { margin: 0; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
a { color: var(--fg); text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible, button:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
code { font: .9em var(--mono); overflow-wrap: anywhere; }
.ico { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 20px 0; font-weight: 650; font-size: 18px; color: var(--fg); text-decoration: none; }
.brand:hover { color: var(--fg); }
.brand img { width: 32px; height: 32px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 4px 12px 4px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; line-height: 20px; }
h1 { margin: 0 0 16px; font-size: clamp(28px, 5vw, 42px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.lead { margin: 0 0 28px; max-width: 640px; color: var(--muted); font-size: 18px; }
.section-title { margin: 0 0 20px; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }

.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 10px; font-weight: 650;
  text-decoration: none; background: var(--primary); color: var(--on-primary); }
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn.ghost { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
[hidden] { display: none !important; }

/* ===== Screenshots of the real extension window and of the Download button on a video ===== */
.shot { display: block; width: 380px; max-width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }

/* "Good to know": honest limits */
.know { padding: 40px 0 56px; border-top: 1px solid var(--border); }
.know ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.know li { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.know li .ico { color: var(--fg); margin-top: 2px; }
.note { display: flex; gap: 12px; margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--fg); font-size: 15px; }
.note .ico { color: var(--accent); margin-top: 2px; }

/* ===== Welcome Page: two modes (course lesson 3.2). body[data-mode] is set by assets/welcome.js; "pin" is the
   default and works without JavaScript. Without JavaScript the switch link (#usage) still works through :target. */
body[data-mode="pin"] .mode.usage { display: none; }
body[data-mode="usage"] .mode.pin { display: none; }
body:not(.js) .mode.usage:target { display: block; }
body:not(.js):has(.mode.usage:target) .mode.pin { display: none; }
.mode { padding: 16px 0 48px; }
.mode h1 { margin-bottom: 12px; }
.switch { margin: 32px 0 0; }
.switch a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { counter-increment: step; position: relative; padding-left: 48px; }
.step::before { content: counter(step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 650; font-size: 16px; }
.step h2, .step h3 { margin: 0; font-size: 20px; line-height: 32px; font-weight: 650; }
.step p { margin: 6px 0 0; color: var(--muted); }
.pin .steps { display: grid; gap: 20px; margin-top: 28px; }
.usage .steps { margin-top: 12px; }
.usage .step { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px 40px; align-items: start;
  padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--border); }
.usage .step:first-child { border-top: 0; padding-top: 0; }
.usage .step::before { top: 32px; }
.usage .step:first-child::before { top: 0; }
.usage .step-shot { justify-self: center; }
.usage .step.text-only { grid-template-columns: minmax(0, 1fr); }

/* ===== The drawn Chrome toolbar and extensions menu (not a screenshot: stays sharp, follows the theme and the language) ===== */
.browser { position: relative; max-width: 560px; border: 1px solid var(--border); border-radius: 12px; background: var(--chrome);
  box-shadow: var(--shadow); color: var(--chrome-fg); }
.tb { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.tb-nav { display: flex; gap: 2px; }
.tb-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; }
.tb-omni { flex: 1; min-width: 0; height: 32px; margin: 0 6px; border-radius: 16px; background: var(--omni); display: flex; align-items: center;
  padding: 0 14px; font-size: 14px; color: var(--placeholder); white-space: nowrap; overflow: hidden; }
.tb-avatar { width: 24px; height: 24px; margin: 0 4px; border-radius: 50%; background: var(--placeholder); opacity: .5; }
.menu { position: relative; margin: 0 10px 12px auto; width: min(320px, calc(100% - 20px)); border-radius: 8px; background: var(--surface);
  color: var(--fg); box-shadow: var(--shadow); border: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.menu-title { padding: 12px 16px 8px; font-weight: 650; }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; }
.menu-row img { width: 20px; height: 20px; }
.menu-name { flex: 1; min-width: 0; }
.menu-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.menu-foot { padding: 10px 16px 12px; border-top: 1px solid var(--border); color: var(--muted); }
.dots { width: 4px; height: 16px; background: radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 0 / 4px 6px repeat-y; }

/* highlighted target: a red ring with a breathing wave */
.hl { background: var(--tint); color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.hl::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); opacity: 0;
  animation: wave 2.4s ease-out infinite; pointer-events: none; }
.mark { position: absolute; top: -10px; right: -10px; z-index: 1; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--red); color: #ffffff; font: 650 13px/1 var(--font); box-shadow: 0 0 0 2px var(--surface); }
@keyframes wave { 0% { opacity: .6; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.6); } }

/* ===== A pencil note "Click here" with an arrow up to the real Chrome toolbar (top right of the window), in both modes:
   to the puzzle piece while the icon is not pinned, to the pinned M3U8 Downloader icon afterwards (owner, 2026-11-27).
   It is drawn in full without any CSS animation: on the owner's computer Windows animation effects are off and Chrome
   skips CSS animations. The nudge towards the toolbar runs on a JS clock in assets/welcome.js (reduced motion: the
   arrow stays and only pulses its opacity). Sizes and stroke are also in the SVG markup, so an old cached stylesheet
   cannot blow the drawing up. */
.to-toolbar { position: absolute; top: 6px; right: 150px; z-index: 2; width: 180px; height: 110px; color: var(--red); pointer-events: none; }
.to-toolbar svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round; filter: url(#pencil); }
/* the note: the extension icon (the same on the toolbar), so the visitor sees which icon to look for, then "Click here" */
.to-note { position: absolute; top: 24px; right: calc(100% - 58px); display: flex; align-items: center; gap: 10px; font: 600 24px/1 var(--hand);
  white-space: nowrap; transform: rotate(-5deg); }
.to-note img { display: block; width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
/* where the tip points: in "pin" mode at the puzzle piece (about 90 px from the right edge of the window, left of the
   profile button); once pinned, at the new icon, which Chrome puts just left of the puzzle piece */
body[data-mode="pin"] .to-toolbar { right: 85px; }
body[data-mode="usage"] .to-toolbar { right: 140px; }
.defs { position: absolute; }

/* ===== Uninstall Page and "thank you" (built by scripts/build-pages.mjs; works without JavaScript) ===== */
.uninstall { padding: 16px 0 56px; max-width: 720px; }
.card-form { margin: 0 0 24px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.reasons { margin: 0 0 20px; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.reasons legend { padding: 0; margin: 0 0 14px; }
.reasons legend h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chip { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 16px; border-radius: 22px; cursor: pointer;
  background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border); font-weight: 550; line-height: 1.35; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--fg); }
/* a chosen reason changes only colour and border, never its place (owner's rule on buttons) */
.sr:checked + .chip { background: var(--tint); color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.sr:focus-visible + .chip { outline: 3px solid var(--ring); outline-offset: 3px; }
/* the hint of a chosen reason: inputs come first in the fieldset, so "~" reaches the hints after them */
.hint { display: none; flex-basis: 100%; margin: 6px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--fg); font-size: 15px; }
#r-not-found:checked ~ .hint-not-found, #r-download-failed:checked ~ .hint-download-failed, #r-protected:checked ~ .hint-protected,
#r-live:checked ~ .hint-live, #r-permissions:checked ~ .hint-permissions { display: block; }
.field { display: block; margin: 0 0 20px; }
.field span { display: block; margin: 0 0 6px; font-weight: 600; }
.field textarea { display: block; width: 100%; min-height: 104px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font: inherit; resize: vertical; }
.field textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.card-form .btn { border: 0; cursor: pointer; font: inherit; font-weight: 650; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* messages the form handler sends the visitor back to: #form-error, #form-unavailable, #form-uncertain */
.form-msg { display: none; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--red); color: var(--fg); font-weight: 600; }
.form-msg:target { display: block; }
/* the form switched off (FEEDBACK_CONFIGURED = false in scripts/build-pages.mjs): a visible notice, greyed controls */
.form-off { display: flex; gap: 12px; margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--fg); font-weight: 600; }
.form-off .ico { margin-top: 2px; }
.is-off .reasons, .is-off .field, .is-off .btn { opacity: .55; }
.is-off .chip, .is-off .btn { cursor: not-allowed; }
.is-off .chip:hover { box-shadow: inset 0 0 0 1px var(--border); }
.thanks .back-q { margin: 32px 0 12px; font-weight: 600; }
.pick { list-style: none; margin: 0 0 40px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pick a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border); color: var(--fg); text-decoration: none; font-weight: 600; }
.pick a:hover { box-shadow: inset 0 0 0 1px var(--fg); }

/* ===== Privacy policy (English only) ===== */
.policy { max-width: 720px; padding: 16px 0 56px; }
.policy .updated { margin: 0 0 28px; color: var(--muted); }
.policy .summary { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 0 0 8px; }
.policy .summary h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 18px; }
.policy .summary ul { margin: 0; }
.policy h2 { margin: 40px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 22px; line-height: 1.3; font-weight: 650; }
.policy p, .policy ul { margin: 0 0 14px; }
.policy ul { padding-left: 22px; }
.policy li { margin: 0 0 6px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 15px; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.policy th { color: var(--muted); font-weight: 600; }

/* ===== 404 ===== */
.notfound { padding: 48px 0 80px; }

/* ===== Footer and language switch ===== */
footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 14px; line-height: 1.6; }
footer p { margin: 0 0 10px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }
.langs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; padding: 0; list-style: none; }
.langs a[aria-current="true"] { color: var(--fg); font-weight: 650; text-decoration: none; }

/* the icon is a black square: on the dark page it would melt into the background, so it gets a thin light ring there
   (the drawing itself stays as in the extension) */
@media (prefers-color-scheme: dark) {
  .brand img, .to-note img, .menu-row img { border-radius: 22%; box-shadow: 0 0 0 1px #6e6e73; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
@media (max-width: 760px) {
  .usage .step { grid-template-columns: minmax(0, 1fr); }
  .usage .step-shot { justify-self: start; }
  .tb-nav { display: none; }
  .to-toolbar { display: none; }
}
@media (max-width: 420px) {
  .step { padding-left: 44px; }
  .menu { width: calc(100% - 20px); }
  .card-form { padding: 18px; }
}
