/* Transkrypt v5 "Światło": shared tokens + base + v5 layers (see DESIGN.md). Roboto is served locally (OFL/Apache-2.0). */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url("../fonts/roboto-latin.woff2") format("woff2"); 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: "Roboto"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url("../fonts/roboto-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- css/tokens.css ---- */
/* Shared tokens of the Transkrypt mockups (mirrors DESIGN.md). Variants override only what makes them different. */
:root {
  color-scheme: dark;
  /* surfaces: warm red-black, YouTube dark as the reference (#0f0f0f / #212121 / #272727) */
  --bg: #0e0c0d;
  --surface-1: #171415;
  --surface-2: #211d1e;
  --surface-3: #2c2829;
  /* text */
  --text: #f1f1f1;
  --text-2: #c9c4c5;
  --text-3: #aaa4a5;
  /* red: fill for buttons (white text 5.9:1), glow for light, text for red on dark */
  --red-fill: #cc0018;
  --red-fill-hover: #b30015;
  --red-glow: #ff1f3a;
  --red-text: #ff7a7a;
  /* YouTube dark-mode blue for links and time stamps */
  --link: #3ea6ff;
  --info: #6cb8ff;
  --ok: #5ee08c;
  --warn: #ffd25e;
  --danger: #ff8a8a;
  --focus: #ffffff;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .5);
  /* shape and rhythm */
  --r-panel: 20px;
  --r-field: 18px;
  --r-btn: 14px;
  --r-chip: 12px;
  --container: 1120px;
  --gutter: 24px;
  --header-h: 64px;
  --fs-body: 17px;
  --fs-small: 15px;
  /* type: Roboto family is YouTube's own look; Flex gives width and weight axes for the headings */
  --font-head: "Roboto Flex", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
  --head-weight: 700;
  --head-wdth: 100;
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 56px; --fs-body: 16.5px; }
}

/* ---- v5-swiatlo/tokens.css ---- */
/* Variant 5, "Światło" (D18): v4 plus a lit atmosphere: deep navy base, two blurred blobs around the URL field, a thin horizon glow. Same quiet glass and hairlines as v4, red only on the URL border, primary button,
   active state and progress. Overrides the shared tokens; loaded after _shared/css/tokens.css. */
:root {
  --bg: #070b15;
  --bg-top: #0a1224;
  --bg-bottom: #090a12;
  --light-red: 255, 0, 51;
  --light-blue: 64, 108, 255;
  --light-violet: 124, 77, 255;
  --horizon: 255, 94, 36;
  --surface-1: #0f1422;
  --surface-2: #151b2b;
  --surface-3: #1c2335;
  --text: #f4f4f5;
  --text-2: #c4c4ca;
  --text-3: #a1a1a9;
  --red-fill: #d6002a;
  --red-fill-hover: #bd0025;
  --red-glow: #ff0033;
  --red-text: #ff6b78;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .42);
  --hair: rgba(255, 255, 255, .08);
  --r-panel: 14px;
  --r-field: 14px;
  --r-btn: 10px;
  --r-chip: 9px;
  --container: 1040px;
  --font-head: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head-weight: 600;
  --head-wdth: 100;
  /* wow border palette: YouTube red -> coral -> deep crimson */
  --wow-1: #ff0033;
  --wow-2: #ff4e45;
  --wow-3: #8a0019;
  --wow-speed: 6s;
}

/* ---- css/base.css ---- */
/* Structure and components of the Transkrypt mockups. No highlight technique here: .glass, .glass-inset,
   focus light and the background belong to each variant's glass.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #fff; }
svg.icon { flex: none; }
code { font-family: var(--font-mono); font-size: .92em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .09); }
.muted { color: var(--text-2); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 18px; border-radius: 10px; background: #fff; color: #111; font-weight: 600; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
main { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 40px; outline: 0; }
.glass { position: relative; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); font-stretch: calc(var(--head-wdth) * 1%); letter-spacing: -.01em; line-height: 1.15; }

/* ---------- shell: header, footer ---------- */
.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--header-h); padding-inline: max(var(--gutter), calc(50% - var(--container) / 2)); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
.brand:hover { color: #fff; }
.brand__name { font: 700 21px/1 var(--font-head); letter-spacing: -.02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .06); font-size: 15px; font-weight: 500; }
.pill--private { color: var(--text); flex: none; white-space: nowrap; }
.site-footer { margin-top: auto; width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: 24px var(--gutter) 32px; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 18px 24px; border-radius: var(--r-panel); }
.site-footer__nav { display: flex; align-items: center; gap: 16px; }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__mode { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.site-footer__legal { color: var(--text-2); font-size: var(--fs-small); max-width: 62ch; }
.site-footer__legal strong { color: var(--text); font-weight: 600; }

/* ---------- hero: one big field ---------- */
.hero { padding: clamp(28px, 6vw, 68px) 0 20px; }
.hero__title { font-size: clamp(30px, 5vw, 50px); line-height: 1.08; max-width: 17ch; margin-bottom: 26px; }
.url-form__row { display: flex; gap: 12px; align-items: stretch; }
.field { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 16px; border-radius: var(--r-field); position: relative; }
.field--xl { flex: 1 1 0; min-width: 0; min-height: 60px; padding-left: 20px; }
.field__icon { display: grid; place-items: center; color: var(--text-2); }
.field__input { flex: 1 1 0; min-width: 0; align-self: stretch; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.field__input::placeholder { color: var(--text-3); opacity: 1; }
.field:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.field:has(input[aria-invalid="true"]) { outline: 2px solid var(--danger); outline-offset: 2px; }
.field:has(input[aria-invalid="true"]):focus-within { outline-color: var(--focus); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 20px; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.error-slot:empty { display: none; }
.error-slot { margin-top: 16px; }
.url-form__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 18px; }
.select-field { display: flex; align-items: center; gap: 12px; }
.select-field label { color: var(--text-2); font-size: var(--fs-small); white-space: nowrap; }
.select-wrap { position: relative; border-radius: var(--r-btn); min-width: 230px; }
.select-wrap select { appearance: none; width: 100%; min-height: 48px; padding: 0 44px 0 16px; border: 0; border-radius: inherit; background: transparent; color: var(--text); cursor: pointer; outline-offset: 3px; }
.select-wrap select option { background: #1b1819; color: var(--text); }
.select-wrap:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.select-wrap__chevron { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--text-2); display: grid; }
.hint { color: var(--text-2); font-size: var(--fs-small); max-width: 62ch; flex: 1 1 280px; }
.hero.is-compact { padding: 20px 0 8px; }
.hero.is-compact .hero__title { font-size: 22px; margin-bottom: 14px; max-width: none; }
.hero.is-compact .hint { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r-btn); border: 1px solid transparent; background: rgba(255, 255, 255, .09); color: var(--text); font: 600 16px/1.2 var(--font-body); text-decoration: none; transition: background .15s, border-color .15s, box-shadow .2s; position: relative; }
.btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn--primary { background: var(--red-fill); color: #fff; }
.btn--primary:hover { background: var(--red-fill-hover); }
.btn--secondary { border-color: var(--line); }
.btn--ghost { background: transparent; }
.btn--lg { min-height: 52px; padding: 0 26px; }
.btn--xl { min-height: 60px; padding: 0 30px; font-size: 17px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn.is-busy { opacity: .75; cursor: progress; }
.btn.is-done { background: rgba(94, 224, 140, .18); border-color: var(--ok); color: var(--ok); }

/* ---------- three steps (home) ---------- */
.steps { margin-top: 24px; }
.steps__list { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r-panel); }
.step { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 22px 24px; align-items: start; }
.step + .step { border-left: 1px solid var(--line); }
.step__num { display: none; }
.step__icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--red-text); }
.step__title { font-size: 18px; }
.step__text { color: var(--text-2); font-size: var(--fs-small); }

/* ---------- notices ---------- */
.notice { --tone: var(--info); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 20px 22px; border-radius: var(--r-panel); margin-top: 18px; }
.notice--warn { --tone: var(--warn); } .notice--error { --tone: var(--danger); } .notice--ok { --tone: var(--ok); }
.error-slot .notice { margin-top: 0; }
.notice__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.notice__title { font: 600 19px/1.3 var(--font-head); }
.notice__text, .notice__hint { margin-top: 6px; color: var(--text-2); }
.notice__hint { color: var(--text); }
.notice__list { margin: 10px 0 0 4px; display: grid; gap: 4px; color: var(--text-2); }
.notice__list li { position: relative; padding-left: 18px; }
.notice__list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.notice__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.notice__when { display: flex; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.notice__when-icon { color: var(--warn); display: grid; align-items: start; padding-top: 2px; }
.notice__when-title { font-weight: 600; }
.notice__close { align-self: start; margin: -8px -10px 0 0; }
.choice .notice__title { font-size: 21px; }

/* ---------- loading ---------- */
.loading { display: flex; gap: 20px; align-items: flex-start; padding: 26px; border-radius: var(--r-panel); margin-top: 20px; }
.loading__body { flex: 1 1 0; min-width: 0; }
.loading__title { font-size: 20px; }
.loading__text { color: var(--text-2); margin-top: 4px; }
.spinner { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .16); border-top-color: var(--red-glow); animation: spin .9s linear infinite; }
.spinner--sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { rotate: 360deg; } }
.steps-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.steps-mini li { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: 14.5px; }
.steps-mini .is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.steps-mini .is-now { color: var(--text); border-color: var(--red-glow); background: rgba(255, 31, 58, .12); }
.loading__cancel { margin-top: 16px; }
.skeleton { display: grid; gap: 10px; margin-top: 18px; }
.skeleton span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton span:nth-child(2) { width: 82%; } .skeleton span:nth-child(3) { width: 58%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- result (film) ---------- */
.result, .playlist { margin-top: 20px; scroll-margin-top: calc(var(--header-h) + 8px); outline: 0; }
.backlink { margin-bottom: 8px; }
.result__head, .pl-head { padding: 24px 28px; border-radius: var(--r-panel); }
.result__title { font-size: clamp(24px, 3.4vw, 34px); max-width: 30ch; }
.result__author { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 500; font-size: 17px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ff3d52, #a8001a); color: #fff; font: 700 16px/1 var(--font-head); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; color: var(--text-2); font-size: var(--fs-small); }
.meta__item { display: inline-flex; align-items: center; gap: 7px; }
.meta__item strong { color: var(--text); font-weight: 600; }
.meta__note { color: var(--text-3); }
.result__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main side"; gap: 20px; margin-top: 20px; align-items: start; }
.result__main { grid-area: main; min-width: 0; display: grid; gap: 14px; }
.result__side { grid-area: side; position: sticky; top: calc(var(--header-h) + 16px); }
.side { padding: 22px; border-radius: var(--r-panel); }
.side__title { font-size: 19px; }
.side__toggle { display: none; }
.dl-list { display: grid; gap: 12px; margin-top: 16px; }
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 14px; border-radius: 16px; }
.dl__icon { grid-row: span 2; color: var(--red-text); padding-top: 2px; }
.dl__title { font: 600 16.5px/1.3 var(--font-body); }
.dl__ext { color: var(--text-2); font-weight: 500; }
.dl__text { color: var(--text-2); font-size: 14.5px; }
.dl__btn { grid-column: 1 / -1; margin-top: 8px; }
.download-confirm:empty { display: none; }
.download-confirm { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(94, 224, 140, .1); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); color: var(--text); font-size: 15px; }
.download-confirm__icon { color: var(--ok); display: grid; padding-top: 1px; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-panel); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.seg__item { position: relative; display: inline-flex; }
.seg__item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__item span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-chip); background: rgba(255, 255, 255, .1); font-weight: 500; font-size: 15.5px; }
.seg__item:hover span { background: rgba(255, 255, 255, .18); }
.seg__item input:checked + span { background: #f1f1f1; color: #0f0f0f; }
.seg__item input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.toolbar__hint { grid-column: 1 / -1; color: var(--text-2); font-size: var(--fs-small); }
.search { grid-column: 1 / -1; min-height: 48px; }
.search .field__input { font-size: 16px; }
.search__count { color: var(--text-2); font-size: 14.5px; white-space: nowrap; padding: 0 4px; }
.transcript { padding: 10px; border-radius: var(--r-panel); scroll-margin-top: calc(var(--header-h) + 8px); }
.tx__row, .tx__para { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; padding: 4px 14px; border-radius: 12px; }
.tx__row:hover, .tx__para:hover { background: rgba(255, 255, 255, .06); }
.tx__time { display: inline-flex; align-items: center; min-height: 44px; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15.5px; color: var(--link); text-decoration: none; }
.tx__time:hover { text-decoration: underline; color: #8cc8ff; }
.tx__text, .tx__para > span { padding: 10px 0; max-width: 72ch; }
.tx--plain p { padding: 16px 20px; max-width: 72ch; line-height: 1.8; }
mark.hit { background: #ffd54a; color: #141010; border-radius: 4px; padding: 0 2px; }
mark.hit.is-current { background: #ff9a3d; box-shadow: 0 0 0 2px #fff; }

/* ---------- playlist ---------- */
.pl-controls { display: grid; gap: 14px; padding: 20px 24px; margin-top: 16px; border-radius: var(--r-panel); }
.pl-controls__row { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.pl-n { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pl-n__label { color: var(--text-2); }
.pl-n__ctl { display: flex; align-items: center; gap: 10px; }
.stepper { display: inline-flex; align-items: center; border-radius: var(--r-btn); padding: 2px; }
.stepper input { width: 64px; min-height: 44px; border: 0; background: transparent; text-align: center; font-weight: 600; font-size: 17px; -moz-appearance: textfield; outline-offset: 2px; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.pl-quick { display: flex; gap: 10px; }
.selline { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; color: var(--text-2); }
.selline strong { color: var(--text); }
.selline__time, .selline__empty { display: inline-flex; align-items: center; gap: 7px; }
.pl-list { display: grid; gap: 4px; margin-top: 16px; }
.plrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 8px 14px 8px 6px; border-radius: 14px; }
.plrow:hover { background: rgba(255, 255, 255, .05); }
.plrow__check { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; position: relative; }
.plrow__main { min-width: 0; padding: 7px 0; }
.plrow__title { font-weight: 500; overflow-wrap: anywhere; }
.plrow__num { color: var(--text-3); margin-right: 8px; font-variant-numeric: tabular-nums; }
.plrow__author { color: var(--text-2); font-size: 14.5px; margin-top: 2px; }
.plrow__status { margin-top: 8px; }
.plrow__detail { margin-top: 6px; color: var(--text-2); font-size: 14.5px; max-width: 66ch; }
.plrow__open { align-self: center; min-height: 44px; }
.badge { --tone: var(--text-2); display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent); }
.badge--ok { --tone: var(--ok); } .badge--warn { --tone: var(--warn); } .badge--error { --tone: var(--danger); } .badge--busy { --tone: var(--info); } .badge--skip { --tone: #cfc9ca; } .badge--muted { --tone: var(--text-3); }
.plrow[data-tone="muted"] .plrow__title { color: var(--text-2); }
.pl-more { display: grid; justify-items: center; gap: 8px; margin: 18px 0 8px; text-align: center; }
.pl-actionbar.glass { position: sticky; bottom: 14px; z-index: 20; margin-top: 18px; padding: 14px 18px; border-radius: var(--r-panel); }
.actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.progress { display: grid; gap: 12px; }
.progress__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.progress__text { display: grid; gap: 2px; min-width: 0; }
.progress__now { color: var(--text-2); font-size: 14.5px; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff0033, #ff6a6a); transition: width .35s ease; }
.summary { margin-top: 16px; }
.summary__lines { display: grid; gap: 10px; margin-top: 12px; }
.summary__lines li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.summary__lines svg { margin-top: 3px; color: var(--tone); }
.summary__zip { margin-top: 12px; font-size: 14.5px; }

/* ---------- advanced settings (private mode) ---------- */
.advanced { margin-top: 24px; border-radius: var(--r-panel); scroll-margin-top: calc(var(--header-h) + 12px); }
.advanced__summary { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 22px; cursor: pointer; list-style: none; font: 600 19px/1.2 var(--font-head); }
.advanced__summary::-webkit-details-marker { display: none; }
.advanced__summary:focus-visible { outline-offset: -4px; border-radius: var(--r-panel); }
.advanced__icon { color: var(--red-text); display: grid; }
.advanced__label { flex: 1 1 auto; }
.advanced__chevron { display: grid; transition: rotate .2s; color: var(--text-2); }
.advanced[open] .advanced__chevron { rotate: 180deg; }
.advanced__body { padding: 4px 22px 22px; }
.setting { border: 0; border-top: 1px solid var(--line); padding: 20px 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.setting__title { display: flex; align-items: center; gap: 10px; padding: 0; font: 600 18px/1.3 var(--font-head); margin-bottom: 2px; }
.setting__title svg { color: var(--red-text); }
.help { color: var(--text-2); font-size: var(--fs-small); max-width: 68ch; }
.help--wide, .field-error--wide { grid-column: 1 / -1; }
.warn-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255, 210, 94, .09); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: var(--fs-small); }
.warn-line svg { color: var(--warn); margin-top: 2px; }
.form-row { display: grid; gap: 6px; min-width: 0; }
.form-row > label, .form-row label { font-weight: 500; }
.form-row--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-btn); border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--text); }
textarea.input { resize: vertical; min-height: 110px; }
.input--mono { font-family: var(--font-mono); font-size: 14px; }
.input::placeholder { color: var(--text-3); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--fs-small); }
.field-error:empty { display: none; }
.radio-group { display: grid; gap: 2px; }
.radio, .check { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 9px 0; cursor: pointer; }
.radio input, .check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; left: 0; top: 10px; cursor: pointer; }
.radio__dot, .check__box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--line-strong); background: rgba(0, 0, 0, .2); color: transparent; }
.radio__dot { border-radius: 50%; }
.check__box { border-radius: 7px; }
.radio input:checked + .radio__dot { border-color: var(--red-glow); background: radial-gradient(circle, var(--red-glow) 0 38%, transparent 42%); }
.check input:checked + .check__box { background: var(--red-fill); border-color: var(--red-fill); color: #fff; }
.plrow__check .check__box { position: static; }
.plrow__check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.radio input:focus-visible + .radio__dot, .check input:focus-visible + .check__box, .plrow__check input:focus-visible + .check__box { outline: 2px solid var(--focus); outline-offset: 3px; }
.advanced__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-status { font-size: var(--fs-small); color: var(--text-2); }
.settings-status[data-tone="ok"] { color: var(--ok); } .settings-status[data-tone="error"] { color: var(--danger); }

/* ---------- pages, 404 ---------- */
.page { margin-top: 28px; padding: clamp(22px, 4vw, 40px); border-radius: var(--r-panel); max-width: 820px; }
.page__title { font-size: clamp(28px, 4vw, 38px); margin-bottom: 14px; }
.page h2 { font-size: 20px; margin: 26px 0 8px; }
.page p, .page li { color: var(--text-2); max-width: 70ch; }
.page ul { display: grid; gap: 6px; margin: 8px 0 8px 20px; list-style: disc; }
.draft { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255, 210, 94, .09); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); margin: 6px 0 10px; }
.draft svg { color: var(--warn); margin-top: 2px; }
.page__back { margin-top: 28px; }
.page--404 { text-align: left; }
.page--404 p { margin-bottom: 18px; }
.nf__code { font: 800 clamp(80px, 16vw, 150px)/1 var(--font-head); color: var(--red-text); letter-spacing: -.04em; margin-bottom: 6px; }

.toasts { position: fixed; left: 50%; bottom: 96px; translate: -50% 0; z-index: 70; display: grid; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 14px; background: #2a2627; border: 1px solid var(--line-strong); border-left: 5px solid var(--info); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); animation: toast-in .25s ease; }
.toast--ok { border-left-color: var(--ok); } .toast--error { border-left-color: var(--danger); }
.toast.is-leaving { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; translate: 0 10px; } }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .result__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  .result__side { position: static; }
  .side { padding: 6px 8px; }
  .side__title--desktop { display: none; }
  .side__toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 12px; border: 0; background: transparent; text-align: left; font-weight: 600; }
  .side__toggle .side__title { font: 600 17px/1.2 var(--font-head); }
  .side__formats { color: var(--text-2); font-size: 14.5px; font-weight: 400; flex: 1 1 auto; }
  .side__chevron { display: grid; transition: rotate .2s; }
  .side__toggle[aria-expanded="true"] .side__chevron { rotate: 180deg; }
  .side__body { padding: 0 4px 10px; }
  .side__body.is-collapsed { display: none; }
  .download-confirm { margin: 6px 4px 8px; }
  .steps__list { grid-template-columns: 1fr; }
  .step + .step { border-left: 0; border-top: 1px solid var(--line); }
}
@media (min-width: 901px) { .side__body.is-collapsed { display: block; } }
@media (max-width: 640px) {
  .site-header { gap: 8px; }
  .brand__name { font-size: 19px; }
  .pill__long { display: none; }
  .url-form__row { flex-direction: column; }
  .btn--xl { width: 100%; }
  .select-field { width: 100%; flex-wrap: wrap; } .select-wrap { flex: 1 1 100%; min-width: 0; }
  .result__head, .pl-head { padding: 20px; }
  .toolbar { grid-template-columns: minmax(0, 1fr); }
  .toolbar__copy { width: 100%; }
  .tx__row, .tx__para { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding: 2px 8px; }
  .notice { grid-template-columns: auto minmax(0, 1fr); padding: 18px; gap: 12px 14px; }
  .notice__close { position: absolute; right: 6px; top: 6px; margin: 0; }
  .notice__title { padding-right: 36px; }
  .plrow { grid-template-columns: 44px minmax(0, 1fr); }
  .plrow__open { grid-column: 2; justify-self: start; margin-bottom: 6px; }
  .form-row--two { grid-template-columns: 1fr; }
  .pl-actionbar { bottom: 8px; padding: 12px 14px; }
  .actionbar .btn { width: 100%; }
  .loading { padding: 20px; }
  .advanced__summary, .advanced__body { padding-inline: 16px; }
  .site-footer__inner { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- v5-swiatlo/glass.css ---- */
/* Variant 5 (v4 surfaces; atmosphere in atmosphere.css): calm Linear-like surfaces, hairline borders, light frosted glass on panels only.
   The single motion/glow on the page is the conic gradient running along the URL field border (wow.css). */

.glass, .glass-inset { position: relative; }
.field__clear[hidden] { display: none; }
.glass { background: rgba(255, 255, 255, .028); border: 1px solid var(--hair); backdrop-filter: blur(10px) saturate(110%); }
.glass-inset { background: rgba(255, 255, 255, .035); border: 1px solid var(--hair); }
.glass-inset:hover { border-color: rgba(255, 255, 255, .16); }
.field:focus-within, .select-wrap:focus-within { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 3px; }
.field.glass-inset:focus-within { border-color: rgba(255, 255, 255, .2); }

.site-header { background: rgba(7, 11, 21, .8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--hair); }
.pill { background: rgba(255, 255, 255, .04); border-color: var(--hair); }
.site-footer__inner { border-top: 1px solid var(--hair); border-radius: 0; background: none; backdrop-filter: none; border-inline: 0; border-bottom: 0; padding-inline: 0; }

/* buttons: quiet by default, red only for the primary action */
.btn { background: rgba(255, 255, 255, .05); border-color: var(--hair); font-weight: 500; }
.btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); }
.btn--secondary { border-color: rgba(255, 255, 255, .14); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--primary { background: var(--red-fill); border-color: rgba(255, 255, 255, .12); font-weight: 600; }
.btn--primary:hover { background: var(--red-fill-hover); border-color: rgba(255, 255, 255, .2); }
.btn--primary[disabled] { opacity: .7; }

/* active / selected state is red, tinted and hairline */
.seg__item span { background: rgba(255, 255, 255, .05); border: 1px solid var(--hair); font-weight: 500; }
.seg__item:hover span { background: rgba(255, 255, 255, .1); }
.seg__item input:checked + span { background: rgba(255, 0, 51, .16); border-color: rgba(255, 78, 69, .7); color: #fff; }

.plrow__check input:checked + .check__box { background: var(--red-fill); border-color: var(--red-fill); color: #fff; }
.field__input { text-overflow: ellipsis; }
.hero .field--xl.glass-inset { --wow-rest: rgba(255, 255, 255, .28); }
.tx__row:hover, .tx__para:hover, .plrow:hover, .plrow:focus-within { background: rgba(255, 255, 255, .04); }
.step__icon { background: rgba(255, 255, 255, .05); }
.notice { background: color-mix(in srgb, var(--tone) 7%, rgba(255, 255, 255, .025)); border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent); }
.pl-actionbar { background: rgba(12, 17, 30, .92); }
.bar { background: rgba(255, 255, 255, .1); height: 6px; }
.bar span { background: linear-gradient(90deg, #ff0033, #ff4e45); }
.toast { background: #151b2b; border-color: var(--hair); }
.spinner { border-top-color: var(--wow-1); }

/* headline: tight, semibold */
.hero { text-align: center; padding-top: clamp(36px, 8vw, 92px); }
.hero__title { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.035em; line-height: 1.06; max-width: 18ch; margin-inline: auto; margin-bottom: 30px; }
.hero.is-compact { text-align: left; }
.hero.is-compact .hero__title { margin-inline: 0; letter-spacing: -.02em; }
.hero .url-form { max-width: 820px; margin-inline: auto; text-align: left; }
.hero.is-compact .url-form { max-width: none; margin-inline: 0; }
.url-form__meta { justify-content: center; }
.hero.is-compact .url-form__meta { justify-content: flex-start; }
.hint { text-align: left; }
@media (max-width: 640px) { .hero .url-form__meta { justify-content: stretch; } }

/* ---- v5-swiatlo/wow.css ---- */
/* The one WOW element: a conic gradient rotating along the border of the main URL field.
   Rotation via @property (animatable angle); slower at rest, brighter on focus, faster while processing. */
@property --wow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.hero .field--xl.glass-inset {
  --wow-w: 1.5px;
  --wow-arc: conic-gradient(from var(--wow-angle), transparent 0deg, transparent 150deg, var(--wow-3) 215deg, var(--wow-2) 285deg, var(--wow-1) 330deg, transparent 360deg);
  border: var(--wow-w) solid transparent;
  background: linear-gradient(#0a0f1c, #0a0f1c) padding-box, rgba(255, 255, 255, .1) border-box;
  background: linear-gradient(#0a0f1c, #0a0f1c) padding-box, var(--wow-arc) border-box, linear-gradient(var(--wow-rest, rgba(255, 255, 255, .28)), var(--wow-rest, rgba(255, 255, 255, .28))) border-box;
  animation: wow-spin var(--wow-speed) linear infinite;
  transition: --wow-w .25s;
}
/* a soft halo copy of the same arc, only for the main field */
.hero .field--xl.glass-inset::before {
  content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: calc(var(--r-field) + 3px); pointer-events: none;
  background: var(--wow-arc); filter: blur(14px); opacity: .22; transition: opacity .3s;
}
.hero .field--xl.glass-inset:focus-within { --wow-w: 2px; outline-offset: 5px; outline-color: rgba(255, 255, 255, .5); }
.hero .field--xl.glass-inset:focus-within::before { opacity: .5; }
.hero .field--xl.glass-inset:focus-within { --wow-arc: conic-gradient(from var(--wow-angle), var(--wow-3) 0deg, transparent 40deg, transparent 100deg, var(--wow-3) 170deg, var(--wow-2) 250deg, var(--wow-1) 320deg, var(--wow-3) 360deg); }
/* processing: the run speeds up */
.hero:has(.is-busy) .field--xl.glass-inset, body:has(.progress) .hero .field--xl.glass-inset { animation-duration: 1.6s; }
.hero:has(.is-busy) .field--xl.glass-inset::before { opacity: .45; }
.hero .field--xl.glass-inset:has(input[aria-invalid="true"]) { --wow-arc: conic-gradient(from var(--wow-angle), transparent 0 150deg, #7a2a2a 215deg, var(--danger) 330deg, transparent 360deg); }

@keyframes wow-spin { to { --wow-angle: 360deg; } }

/* reduced motion: static border, no spin, no transitions */
@media (prefers-reduced-motion: reduce) {
  .hero .field--xl.glass-inset, .hero:has(.is-busy) .field--xl.glass-inset, body:has(.progress) .hero .field--xl.glass-inset { animation: none !important; --wow-angle: 40deg; transition: none; }
  .hero .field--xl.glass-inset::before { transition: none; }
}
/* browsers without @property still show a static gradient border */

/* ---- v5-swiatlo/atmosphere.css ---- */
/* D18 atmosphere: the only difference from v4. Pure CSS, no assets.
   .bg is anchored to the document (scrolls away), so light stays in the hero and never reaches result screens strongly. */
body { position: relative; min-height: 100vh; background: var(--bg); overflow-x: clip; }
.bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 640px, var(--bg-bottom) 100%); }

/* two large blurred blobs around the URL field: red behind-left, cool blue/violet behind-right */
.bg::before, .bg::after { content: ""; position: absolute; border-radius: 50%; will-change: transform; }
.bg::before { left: calc(50% - 620px); top: 90px; width: 680px; height: 440px;
  background: radial-gradient(closest-side, rgba(var(--light-red), .5), rgba(var(--light-red), .18) 55%, transparent 100%);
  filter: blur(54px); animation: drift-a 26s ease-in-out infinite alternate; }
.bg::after { left: calc(50% + 40px); top: 150px; width: 720px; height: 440px;
  background: radial-gradient(closest-side, rgba(var(--light-blue), .46), rgba(var(--light-violet), .18) 58%, transparent 100%);
  filter: blur(58px); animation: drift-b 32s ease-in-out infinite alternate; }

/* thin red-orange horizon line with a soft halo, low under the hero */
.hero { position: relative; }
.hero::after { content: ""; position: absolute; left: 50%; bottom: -84px; width: min(1100px, 100vw); height: 160px; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(var(--horizon), .95) 22%, rgba(255, 190, 90, 1) 50%, rgba(var(--horizon), .95) 78%, transparent) center 80px / 100% 2px no-repeat,
    radial-gradient(closest-side at 50% 80px, rgba(var(--horizon), .32), rgba(var(--light-red), .1) 60%, transparent 100%);
  filter: blur(.4px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40%, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 40%, #000 55%, transparent 100%);
  opacity: .9; }
.hero.is-compact::after { display: none; }

/* result / playlist screens: hero is compact, light stays quiet and high */
body:has(.hero.is-compact) .bg::before, body:has(.hero.is-compact) .bg::after { opacity: .38; }
body:has(.hero.is-compact) .bg::before { top: 40px; }
body:has(.hero.is-compact) .bg::after { top: 60px; }

@keyframes drift-a { to { transform: translate3d(70px, 26px, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-80px, -22px, 0) scale(1.06); } }

@media (max-width: 760px) {
  .bg::before { left: -140px; top: 90px; width: 400px; height: 300px; filter: blur(44px); }
  .bg::after { left: auto; right: -160px; top: 230px; width: 420px; height: 300px; filter: blur(46px); }
  body:has(.hero.is-compact) .bg::before { top: 20px; }
  body:has(.hero.is-compact) .bg::after { top: 80px; }
}
@media (prefers-reduced-motion: reduce) { .bg::before, .bg::after { animation: none !important; } }
