/* Bricolage Grotesque (SIL Open Font License, see bricolage-grotesque-OFL.txt), served from here: no visitor's IP goes to Google. */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(/bricolage-grotesque.woff2) format("woff2");
}

:root {
  /* Cromazo: sky blue, white and one hot pink. Pink marks the one thing to press and what is
     happening now; sky blue is the backdrop we cut away and everything finished or picked. */
  --bg: #f3f8fd;
  --surface: #ffffff;
  --surface-2: #eaf3fb;
  --line: #d3e3f1;
  --line-strong: #a9c6e0;
  --text: #0d2238;
  --text-2: #33485f;
  --muted: #536880;
  --sky: #38b6f4;
  --sky-ink: #0b6fae;
  --sky-soft: #e3f2fc;
  --pink: #e0137a;
  --pink-hover: #c80f6b;
  --pink-soft: #fde7f1;
  --pink-ink: #b4237a;
  --warn: #a3530a;
  --danger: #c0262d;
  --radius: 12px;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--sky-ink);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;  /* the app's full-width checkerboard must not scroll sideways */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--sky-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0; }
#view-setup h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; margin: 0 0 12px; }
p { margin: 0 0 10px; }
kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
code { font: 0.92em ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--text); }
::selection { background: var(--pink-soft); color: var(--text); }
html { scrollbar-color: var(--line-strong) var(--bg); }
input { caret-color: var(--pink); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon circle { fill: currentColor; stroke: none; }
.link { padding: 0; border: 0; background: none; color: var(--sky-ink); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { text-decoration-thickness: 2px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); } /* the outline shows in Windows high contrast */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.lead { font-size: 1.05rem; color: var(--text-2); max-width: 62ch; }
.warn { color: var(--warn); }

/* Layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -0.03em; }
/* The mark: a pink subject on a sky backdrop, what every clip is before we cut it out. */
.brand-mark { width: 24px; height: 24px; border-radius: 7px;
  background: radial-gradient(circle at 50% 38%, var(--pink) 0 22%, transparent 23%),
    radial-gradient(ellipse 46% 40% at 50% 100%, var(--pink) 0 99%, transparent 100%), var(--sky); }
.brand b { color: var(--pink); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 24px 48px; }
.view.narrow { max-width: 680px; margin: 0 auto; }
.footer { border-top: 1px solid var(--line); padding: 20px 24px; color: var(--muted); font-size: 13px; text-align: center; }
.footer p { margin: 4px auto; max-width: 80ch; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > input { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.actions.split { justify-content: space-between; }
.spacer { flex: 1; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--line-strong); background: var(--sky-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-hover); border-color: var(--pink-hover); }
/* Pink is the page's one action (the bar, connect, top up); each card's own action is deep sky. */
.btn.strong { background: var(--sky-ink); border-color: var(--sky-ink); color: #fff; }
.btn.strong:hover { background: #095d93; border-color: #095d93; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.btn.icon-only { padding: 8px 10px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.danger-text { color: var(--danger) !important; }
input[type=password], input[type=text], input:not([type]), input[readonly] {
  min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid #6f8aa8;
  background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
input[type=range] { accent-color: var(--pink); }
input[type=checkbox], input[type=radio] { accent-color: var(--pink); width: 16px; height: 16px; }
label { font-weight: 600; font-size: 14px; }
.form-error { color: var(--danger); margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

.balance {
  font-size: 13px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.balance.low { border-color: var(--warn); color: var(--warn); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(13, 34, 56, .14);
}
.menu-panel button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.menu-panel button:hover { background: var(--surface-2); }

/* Loading */
.loading { padding: 72px 0; }

/* Connect */
/* The hero: a sky gradient seen through fluted glass, beside the brand's picture. Text sits on the
   deep end of the sky, where white keeps its contrast. */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 28px; align-items: center;
  margin-top: 8px; padding: 40px 32px; border-radius: 24px; color: #fff;
  background: linear-gradient(110deg, #0a5f9f 0%, #0e6fb8 58%, #2ea6ea 86%, #6fd0ff 100%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / .10) 0 1px, transparent 1px 6px, rgb(13 34 56 / .06) 6px 7px, transparent 7px 11px);
}
.hero h1 { font-size: clamp(2rem, 5.4vw, 3rem); text-wrap: balance; color: #fff; }
.hero h1 span { display: block; color: #ffd3e7; }
.hero .lead { margin: 0; color: #fff; max-width: 44ch; }
/* The brand's picture: a green screen alone in a pink field under a deep sky (generated for Cromazo). */
.hero-art { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 16px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .35), 0 18px 40px rgb(5 30 70 / .35); }
.price-note { margin: 20px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.steps-title { margin: 36px 0 0; font-size: 1.4rem; }
.faq { margin: 36px 0 8px; }
.faq h2 { font-size: 1.4rem; margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pink); font: 700 1.3rem/1 var(--display); }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--sky-ink); }
.faq details p { margin: 0 0 14px; color: var(--text-2); max-width: 64ch; }
.not-affiliated { color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 12px 0 16px; display: grid; gap: 12px; }
.steps > li { counter-increment: s; position: relative; padding: 16px 16px 14px 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before {
  content: counter(s); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-ink); font: 700 14px var(--display);
}
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--text-2); }
.key-form { margin-top: 10px; }
.key-form label { display: block; margin-bottom: 6px; }

/* Setup + top-up */
.spinner { width: 40px; height: 40px; margin: 24px auto 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pink); animation: spin .8s linear infinite; }
.center-actions { justify-content: center; }
.keyfix { padding: 20px; margin-bottom: 18px; border: 1px solid #f3b9bb; border-radius: 16px; background: #fdf1f1; }
.keyfix h2 { font-size: 1.15rem; margin-bottom: 6px; }
.keyfix .actions { justify-content: flex-start; margin: 12px 0 0; }
.topup { padding: 20px; margin-bottom: 18px; border: 1px solid #f1c48f; border-radius: 16px; background: #fff6ec; }
.topup h2 { font-size: 1.15rem; margin-bottom: 6px; }
.topup .actions { justify-content: flex-start; margin: 12px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 6px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* The app's checkerboard: the transparency every clip leaves with, fading out under the header. */
#view-app { position: relative; isolation: isolate; }
#view-app::before {
  content: ""; position: absolute; z-index: -1; top: -32px; left: calc(50% - 50vw); width: 100vw; height: 440px;
  background: repeating-conic-gradient(#e2ecf6 0 25%, transparent 0 50%) 0 0 / 28px 28px;
  -webkit-mask-image: linear-gradient(rgb(0 0 0 / .9), transparent); mask-image: linear-gradient(rgb(0 0 0 / .9), transparent);
}

/* Drop zone: the home page's sky, pink subject and fluted glass, with a dashed frame where clips land. */
.drop {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; justify-items: start; align-content: start; text-align: left; gap: 12px; padding: 40px 40px 120px;
  border-radius: 20px; color: #fff; cursor: pointer;
  background: #0b3fae url(/drop-art.jpg) right 78% / cover no-repeat;
  outline: 2px dashed rgb(255 255 255 / .5); outline-offset: -12px; transition: outline-color .15s;
}
/* A soft shade over the sky keeps the white text readable wherever the picture is lighter. */
.drop::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, rgb(6 30 110 / .55) 0%, rgb(6 30 110 / .25) 55%, transparent 80%);
}
.drop:hover, .drop.over { outline-color: #fff; }
.drop.over { outline-style: solid; }
.drop:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sky-ink); }
.drop-title { font: 700 1.6rem/1.15 var(--display); letter-spacing: -0.02em; margin: 0; color: #fff; }
.drop-icon { width: 34px; height: 34px; color: #fff; }
.drop .muted { color: rgb(255 255 255 / .92); }
.drop.compact { grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; text-align: left; gap: 12px; padding: 16px 22px;
  outline-offset: -7px; border-radius: 16px; background-position: left 18%; }  /* the slim strip: just the sky */
.drop.compact .drop-icon { width: 22px; height: 22px; }
.drop.compact .drop-title { font-size: 1.05rem; }
.drop.compact .drop-btn { grid-column: 3; justify-self: end; grid-row: 1; background: #fff; border-color: #fff; color: var(--sky-ink); }
.drop.compact #drop-hint { display: none; }
.drop p { margin: 0; }
.how { list-style: none; counter-reset: h; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.how li { counter-increment: h; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.how li::before { content: counter(h); font: 700 1.6rem/1 var(--display); color: var(--pink); }
.how b { font: 700 1rem/1.25 var(--display); }
.how span { font-size: 13.5px; color: var(--text-2); }
.list-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.list-head p { margin: 0; }
.page-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid #f1c48f; background: #fff6ec; font-size: 14px; }
.page-note p { margin: 0; flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.calm-note { margin: 0 0 12px; }

/* The settings bar: chosen once for every clip not started. */
.batch { display: grid; gap: 16px; margin: 0 0 14px; padding: 18px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line-strong); }
.batch-title { font-size: 1.05rem; margin: 0; }
.batch-go { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.batch .muted.small, .batch .short { margin: -8px 0 0; }
.short { color: var(--warn); margin: 0; overflow-wrap: anywhere; }
.callout p { overflow-wrap: anywhere; }
.short a { color: inherit; font-weight: 600; }
.changed { margin-left: 8px; font-weight: 400; color: var(--text-2); }
.ready-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-links { display: inline-flex; gap: 16px; margin-left: auto; align-items: center; }
.link.quiet { color: var(--muted); }
.cancel { padding: 6px 0; margin: -6px 0 -6px 14px; font-size: 13px; }
.own-note { margin: 0 0 10px; color: var(--sky-ink); font-weight: 600; }
.small-mask { width: 44px; }
.done-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.done-row .link { margin-left: auto; }
.result-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
.result.done-result video { max-height: 220px; }

/* Before and after: the original under the result, cut at the bar the user drags. */
.compare { position: relative; border-radius: 10px; overflow: hidden; }
.compare video.preview { display: block; }
.compare .before { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  clip-path: inset(0 calc(100% - var(--pos)) 44px 0); }  /* the player's controls stay the result's */
.compare-line { position: absolute; top: 0; bottom: 44px; left: var(--pos); width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgb(13 34 56 / .25); pointer-events: none; }
.compare-pill { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; display: flex; gap: 6px;
  align-items: center; padding: 4px 9px; border-radius: 999px; background: #fff; color: var(--text); font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgb(13 34 56 / .2); }
.compare-pill i { width: 1px; height: 12px; background: var(--line-strong); }
.compare-range { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 44px); margin: 0; opacity: 0; cursor: ew-resize; }
.compare:has(.compare-range:focus-visible) { box-shadow: var(--focus); }
.done-result .result-side .btn { justify-self: start; }
.result-side .btn, .callout .btn, .done-row .btn { white-space: normal; text-align: center; }
.result-side p { margin: 0; }
.result-q { font: 700 1.05rem/1.2 var(--display); }
.callout.stopped .actions { align-items: center; gap: 8px 16px; }
.callout.stopped > p:last-child { margin-top: 8px; }
.jobs { display: grid; gap: 14px; }

/* Job card */
.job { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.job-head { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 14px 14px 16px; }
.thumb { width: 72px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.thumb.placeholder { background: repeating-conic-gradient(#dfe9f3 0 25%, #f4f8fc 0 50%) 0 0 / 12px 12px; }
.job-title { min-width: 0; }
.job-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-title .meta { margin: 0; font-size: 13px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--sky-ink); color: #fff; }
.badge.warn { background: #fff6ec; color: var(--warn); }
.badge.busy { background: var(--sky-soft); color: var(--sky-ink); }
.badge.bad { background: #fdecec; color: var(--danger); }
.job-body { padding: 0 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--sky-ink); border-radius: inherit; transition: width .4s ease; }
.progress.indeterminate > i { width: 30%; animation: slide 1.4s ease-in-out infinite; }
.progress.live > i {
  background-image: linear-gradient(45deg, rgb(255 255 255 / .35) 25%, transparent 25%, transparent 50%,
    rgb(255 255 255 / .35) 50%, rgb(255 255 255 / .35) 75%, transparent 75%);
  background-size: 16px 16px; animation: stripes .8s linear infinite;
}
@keyframes stripes { to { background-position: 16px 0; } }
.clock { font-variant-numeric: tabular-nums; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.progress-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.notice { font-size: 14px; color: var(--warn); margin: 0; }

.callout { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.callout.error { border-color: #f3b9bb; background: #fdf1f1; }
.callout.info { border-color: #b9dcf3; background: var(--sky-soft); }
.callout p:last-child { margin-bottom: 0; }
.callout .actions { margin-top: 10px; justify-content: flex-start; }
.callout .actions .btn { white-space: normal; text-align: center; } /* long labels wrap on phones instead of hiding the amount */

/* Settings */
.settings { display: grid; gap: 16px; padding-top: 4px; }
.q > .q-title { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.targets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.speeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice .gpu { font-size: 12px; }
.choice { position: relative; display: block; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--line-strong); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--sky-ink); background: var(--sky-soft); box-shadow: inset 0 0 0 1px var(--sky-ink); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice b { display: block; font-size: 14px; }
.choice span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button, .seg label { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg [aria-pressed=true], .seg label:has(input:checked) { background: var(--sky-soft); color: var(--sky-ink); box-shadow: inset 0 0 0 1px var(--sky-ink); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus); }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; width: fit-content; }
details.more > summary:hover { color: var(--text); }
details.more[open] > summary { margin-bottom: 10px; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.checks label input { margin-top: 3px; }
.checks small { color: var(--muted); }
.slider { display: grid; grid-template-columns: 170px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.slider label { font-weight: 400; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mask-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.subject-note { margin: 0; }
.bg-note { margin: 8px 0 0; max-width: 70ch; }
.formats { margin-top: 4px; }
.formats legend { color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.checks > p { margin: 0; }
.mask-thumb { position: relative; display: block; width: 88px; border-radius: 6px; overflow: hidden;
  background: #000 var(--frame) center / cover no-repeat; border: 1px solid var(--line); }
.mask-thumb::after { content: ""; position: absolute; inset: 0; background: rgb(255 0 170 / .65);
  -webkit-mask: var(--mask) center / cover no-repeat luminance; mask: var(--mask) center / cover no-repeat luminance; }
.estimate { font-size: 14px; color: var(--text-2); display: grid; gap: 2px; }
.estimate b { color: var(--text); }
.run-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Results */
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
/* The preview sits on a checkerboard, never taller than a card should be: a vertical clip stays a column. */
.result video { width: 100%; max-height: 340px; object-fit: contain; border-radius: 10px; display: block;
  background: repeating-conic-gradient(#dfe9f3 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.downloads { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.file { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.file div { min-width: 0; }
.file b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* Dialogs */
dialog {
  width: min(560px, calc(100vw - 32px)); padding: 24px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(13, 34, 56, .25);
}
dialog::backdrop { background: rgba(13, 34, 56, .45); }
dialog ul { padding-left: 20px; color: var(--text-2); }
dialog form label { display: block; margin-bottom: 6px; }
dialog.paint { width: min(1200px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px; display: none; }
dialog.paint[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.paint-head p { margin: 0; font-size: 14px; }
.paint-stage { display: grid; place-items: center; min-height: min(260px, 70vh); overflow: hidden; background: #000; border-radius: 10px; }
.paint-stage canvas { max-width: 100%; max-height: max(220px, calc(100vh - 230px)); touch-action: none; cursor: crosshair; display: block; }
.paint-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.paint-tools .size { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  padding: 12px 18px; border-radius: 10px; background: var(--text); color: #fff; border: 0; box-shadow: 0 12px 32px rgba(13, 34, 56, .3);
  max-width: calc(100vw - 32px); white-space: pre-line; overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  main { padding: 20px 16px 40px; }
  .topbar { padding: 12px 16px; }
  #btn-link { padding: 8px 10px; }
  .job-head { grid-template-columns: 56px 1fr auto; }
  .job-head .badge { grid-column: 2; grid-row: 2; justify-self: start; }
  .job-head .remove { grid-column: 3; grid-row: 1; }
  .thumb { width: 56px; height: 36px; }
  .job-title .name { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .result { grid-template-columns: minmax(0, 1fr); }
  .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch { padding: 14px; }
  .targets .choice:not(:has(input:checked)) span { display: none; }  /* only the chosen destination explains itself */
  .card-links { margin-left: 0; }
  .done-row .link { margin-left: 0; }
  .speeds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice { padding: 10px; }
  .choice b { font-size: 13px; }
  .slider { grid-template-columns: 1fr 44px; }
  .slider label { grid-column: 1 / -1; }
  .row { flex-direction: column; }
  .hero { grid-template-columns: 1fr; gap: 20px; padding: 28px 20px; border-radius: 18px; }
  .hero { background: linear-gradient(180deg, #0a5f9f 0%, #0e6fb8 72%, #2ea6ea 92%, #6fd0ff 100%); }
  .topbar:has(#topbar-actions:not([hidden])) .brand > span:last-child { display: none; }
  .hero-art { aspect-ratio: 16 / 10; }
  .drop.compact { grid-template-columns: auto 1fr; }
  .how { grid-template-columns: 1fr; }
  .drop { padding: 28px 22px 100px; }
  .drop.compact .drop-title { display: none; }
  .drop.compact .drop-btn { grid-column: 2; }
  .run-buttons .btn, .batch-go .btn { flex: 1 1 100%; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .progress.indeterminate > i { width: 100%; opacity: .35; }
}
