/* lab.lewdzone — toonz.to look: neutral greys, no accent hue, 14px Inter, 8px radius.
   Tokens mirror src/components/sites/toonz/theme.css on the toonz.to app.
   Themes on <html>: .main (default grey), .dark (true black), .light. */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --body-font-size: 0.875rem;
  --content-max: 72rem;            /* 1152px: the lab is a tool, not a storefront */
  --radius: 0.5rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --nav-h: 3.5rem;
  --medal: oklch(0.80 0.14 85);
  --success: oklch(0.74 0.16 150);
  --warning: oklch(0.80 0.14 85);
  --danger: oklch(0.65 0.20 27);
}
html, html.main {
  --background: oklch(0.2478 0 0);
  --foreground: oklch(0.9775 0 0);
  --card: oklch(0.3092 0 0);
  --popover: oklch(0.3092 0 0);
  --primary: oklch(0.9775 0 0);
  --primary-foreground: oklch(0.2478 0 0);
  --secondary: oklch(0.4050 0 0);
  --muted: oklch(0.3554 0 0);
  --muted-foreground: oklch(0.72 0 0);
  --accent: oklch(0.4500 0 0);
  --border: oklch(0.4400 0 0);
  --input: oklch(0.4200 0 0);
  --ring: oklch(0.72 0 0);
  --destructive: oklch(0.58 0.21 27);
  --overlay: rgb(0 0 0 / .45);
}
html.dark {
  --background: oklch(0 0 0);
  --foreground: oklch(0.96 0 0);
  --card: oklch(0.19 0 0);
  --popover: oklch(0.16 0 0);
  --primary: oklch(0.96 0 0);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.34 0 0);
  --muted: oklch(0.27 0 0);
  --muted-foreground: oklch(0.68 0 0);
  --accent: oklch(0.39 0 0);
  --border: oklch(0.38 0 0);
  --input: oklch(0.36 0 0);
  --ring: oklch(0.68 0 0);
  --overlay: rgb(0 0 0 / .6);
}
html.light {
  --background: oklch(0.96 0 0);
  --foreground: oklch(0.22 0 0);
  --card: oklch(1 0 0);
  --popover: oklch(1 0 0);
  --primary: oklch(0.28 0 0);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.855 0 0);
  --muted: oklch(0.90 0 0);
  --muted-foreground: oklch(0.52 0 0);
  --accent: oklch(0.82 0 0);
  --border: oklch(0.80 0 0);
  --input: oklch(0.82 0 0);
  --ring: oklch(0.52 0 0);
  --destructive: oklch(0.58 0.21 27);
  --success: oklch(0.55 0.16 150);
  --warning: oklch(0.58 0.13 70);
  --danger: oklch(0.55 0.20 27);
  --medal: oklch(0.58 0.13 70);
  --overlay: rgb(0 0 0 / .25);
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--background); color: var(--foreground); font-size: var(--body-font-size); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a.plain:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.25; }
h2 { font-size: 1rem; } h3 { font-size: .9375rem; } h4 { font-size: .8125rem; color: var(--muted-foreground); font-weight: 500; }
a, button, [role=button], select, label[for], summary { cursor: pointer; }
.muted { color: var(--muted-foreground); }
.pill, .hint { font-size: .75rem; color: var(--muted-foreground); }
.mono { font-family: var(--font-mono); }
.empty { color: var(--muted-foreground); padding: 2.5rem 1rem; text-align: center; }
.sp { flex: 1; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
svg { flex-shrink: 0; }

/* ── controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; height: 2rem; padding: 0 .625rem; border-radius: var(--radius-lg);
  border: 1px solid transparent; background: transparent; color: var(--foreground); font: inherit; font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s, opacity .12s; user-select: none; }
.btn:hover { background: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 85%, transparent); }
.btn-secondary { background: var(--secondary); color: var(--foreground); }
.btn-secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }
.btn-outline { border-color: var(--border); background: color-mix(in oklab, var(--input) 30%, transparent); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); background: var(--muted); }
.btn-danger { background: color-mix(in oklab, var(--destructive) 15%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in oklab, var(--destructive) 25%, transparent); }
.btn-sm { height: 1.5rem; padding: 0 .5rem; font-size: .75rem; border-radius: var(--radius-md); gap: .25rem; }
.btn-icon { padding: 0; }
.btn-block { width: 100%; }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; } .btn-sm svg { width: 1.125rem; height: 1.125rem; }
.btn-icon { width: 2.25rem; }  .btn-sm.btn-icon { width: 2rem; height: 2rem; }
.pg svg { width: 1.25rem; height: 1.25rem; vertical-align: -.3rem; }
.modal-close { width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; }
.step .n svg { width: .875rem; height: .875rem; }
.reorder .btn-sm, .grp-head .grp-x { width: 2rem; padding: 0; }

.input, select.input, textarea.input { display: block; width: 100%; min-width: 0; height: 2rem; padding: .25rem .625rem; border-radius: var(--radius-lg);
  border: 1px solid var(--input); background: color-mix(in oklab, var(--input) 30%, transparent); color: var(--foreground); font: inherit; font-size: .875rem; outline: none;
  transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: var(--muted-foreground); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 40%, transparent); }
.input:disabled { opacity: .5; cursor: not-allowed; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 1.75rem; cursor: pointer; line-height: 1.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right .5rem center; background-size: 14px; }
html.light select.input { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); }
select.input option { background: var(--popover); color: var(--foreground); }
select.input::-ms-expand { display: none; }
textarea.input { height: auto; min-height: 2rem; padding: .5rem .625rem; line-height: 1.5; resize: vertical; }
label { display: block; font-size: .75rem; color: var(--muted-foreground); margin: .5rem 0 .25rem; font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: .375rem; margin: 0 .75rem 0 0; color: var(--foreground); font-size: .875rem; font-weight: 400; }

.badge { display: inline-flex; align-items: center; gap: .25rem; height: 1.25rem; padding: 0 .5rem; border-radius: 999px; font-size: .75rem; font-weight: 500; white-space: nowrap;
  background: var(--secondary); color: var(--foreground); border: 1px solid transparent; }
.badge-outline { background: transparent; border-color: var(--border); }
.badge-count { background: var(--muted); color: var(--muted-foreground); }
.badge-success { background: color-mix(in oklab, var(--success) 18%, transparent); color: var(--success); }
.badge-info { background: color-mix(in oklab, var(--foreground) 12%, transparent); color: var(--foreground); }
.badge-warning { background: color-mix(in oklab, var(--warning) 20%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in oklab, var(--destructive) 16%, transparent); color: var(--danger); }
.badge-draft { background: color-mix(in oklab, #a855f7 20%, transparent); color: #9333ea; }
:root[data-theme="dark"] .badge-draft, :root:not([data-theme="light"]) .badge-draft { color: #c084fc; }
:root[data-theme="light"] .badge-draft { color: #9333ea; }

.chip { display: inline-flex; align-items: center; gap: .375rem; height: 2rem; padding: 0 .625rem; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in oklab, var(--input) 30%, transparent); font-size: .8125rem; cursor: pointer; user-select: none; white-space: nowrap; }
.chip:hover { background: var(--muted); }
.chip.unset { border-color: var(--warning); color: var(--warning); }
button.chip { font: inherit; color: inherit; }
#scopeChip.on { background: color-mix(in oklab, var(--foreground) 12%, transparent); border-color: color-mix(in oklab, var(--foreground) 30%, transparent); }
#scopeChip:disabled { opacity: .5; cursor: default; }
#scopeChip svg { width: 1rem; height: 1rem; }
.chip .k { color: var(--muted-foreground); font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; }
.chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted-foreground); }
.chip .dot.on { background: var(--success); }

.notice { padding: .625rem .75rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); font-size: .8125rem; margin: 0 0 .75rem; }
.notice-info { border-color: color-mix(in oklab, var(--foreground) 25%, transparent); }
.notice-success { border-color: color-mix(in oklab, var(--success) 50%, transparent); color: var(--success); }
.notice-warning { border-color: color-mix(in oklab, var(--warning) 55%, transparent); color: var(--warning); }
.notice-danger { border-color: color-mix(in oklab, var(--destructive) 55%, transparent); color: var(--danger); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; max-width: 28rem; white-space: pre-wrap; box-shadow: 0 10px 30px rgb(0 0 0 / .35); background: var(--popover); }

.card { background: var(--card); border-radius: var(--radius-xl); box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent); padding: 1rem; }

/* tabs (line variant) */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 0 0 .75rem; flex-wrap: wrap; }
.tab { position: relative; background: none; border: 0; padding: .5rem .625rem; font: inherit; font-size: .875rem; font-weight: 500; color: var(--muted-foreground); display: inline-flex; align-items: center; gap: .375rem; }
.tab:hover { color: var(--foreground); }
.tab.on { color: var(--foreground); }
.tab.on::after { content: ""; position: absolute; left: .25rem; right: .25rem; bottom: -1px; height: 2px; background: var(--foreground); border-radius: 1px; }
.tab .cnt { font-size: .6875rem; padding: 0 .4rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }
.tab.on .cnt { background: var(--foreground); color: var(--background); }

/* modal */
.modal { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; }
.modal.is-open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); }
.modal-content { position: relative; background: var(--popover); border-radius: var(--radius-xl); padding: 1rem; width: calc(100% - 2rem); max-width: 28rem; max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent), 0 20px 50px rgb(0 0 0 / .35); }
.modal-close { position: absolute; top: .5rem; right: .5rem; width: 1.75rem; height: 1.75rem; border: 0; border-radius: var(--radius-md); background: none; color: var(--muted-foreground); font: inherit; }
.modal-close:hover { background: var(--muted); color: var(--foreground); }

/* ── nav ── */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 85%, transparent); backdrop-filter: saturate(160%) blur(12px); }
.nav-inner { max-width: var(--content-max); margin: 0 auto; height: 100%; padding: 0 1rem; display: flex; align-items: center; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; margin-right: .75rem; }
.brand-mark { width: 1.75rem; height: 1.75rem; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--foreground); color: var(--background); box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 12%, transparent); transition: transform .15s; }
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brand-text { font-weight: 600; font-size: .9375rem; letter-spacing: -.01em; line-height: 1; }
.brand-text em { font-style: normal; font-weight: 500; color: var(--muted-foreground); }
.nav-links { display: flex; align-items: center; gap: .125rem; }
.nav-links a { display: inline-flex; align-items: center; gap: .25rem; height: 2rem; padding: 0 .625rem; border-radius: var(--radius-lg); font-size: .875rem; font-weight: 500; color: var(--muted-foreground); }
.nav-links a:hover { color: var(--foreground); background: var(--muted); text-decoration: none; }
.nav-links a.is-current { color: var(--foreground); background: var(--muted); }
.nav-links .lz-cnt { display: inline-block; min-width: 1.125rem; padding: 0 .3rem; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: .6875rem; line-height: 1.125rem; text-align: center; font-weight: 600; }
.nav-links .lz-cnt.zero { display: none; }
.nav-links .lz-cnt.warn { background: var(--warning); color: #2a1a00; }
.nav-actions { display: flex; align-items: center; gap: .375rem; margin-left: auto; }
@media (max-width: 1000px) { .chip .k { display: none; } }

/* ── layout ── */
main { max-width: var(--content-max); margin: 0 auto; padding: 1rem 1rem 3rem; }
.view { display: none; } .view.on { display: block; }
.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; min-height: 2rem; }

/* table */
.tbl-wrap { overflow: visible; user-select: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th, .tbl td { padding: .375rem .5rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl thead th { position: sticky; top: var(--nav-h); height: 2.5rem; background: var(--background); font-size: .75rem; color: var(--muted-foreground); font-weight: 500; z-index: 1; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.tbl tbody tr.sel { background: var(--muted); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .c-ck { width: 1.75rem; } .tbl .c-cv { width: 2.75rem; }
.tbl .cv { width: 2.25rem; height: 3rem; object-fit: cover; border-radius: var(--radius-sm); background: var(--muted); display: block; }
.tbl .t { font-weight: 500; }
.tbl .v { color: var(--muted-foreground); font-family: var(--font-mono); font-size: .75rem; }
.tbl .v .pill { font-family: var(--font-sans); margin-top: .125rem; }
.tbl td .badge { margin-right: .25rem; }
.tbl input[type=checkbox] { accent-color: var(--foreground); }
.stage { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: 0 .5rem; height: 1.25rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.stage.s-choose_links, .stage.s-waiting_source { background: color-mix(in oklab, var(--warning) 20%, transparent); color: var(--warning); }
.stage.s-ready { background: color-mix(in oklab, var(--success) 18%, transparent); color: var(--success); }
.stage.s-transferring, .stage.s-queued, .stage.s-leased, .stage.s-downloading, .stage.s-uploading { background: color-mix(in oklab, var(--foreground) 14%, transparent); color: var(--foreground); }
.stage.s-review, .stage.s-done { background: color-mix(in oklab, var(--success) 18%, transparent); color: var(--success); }
.stage.s-failed, .stage.s-needs_mirror, .stage.s-partial { background: color-mix(in oklab, var(--destructive) 16%, transparent); color: var(--danger); }
.stage.s-scraping, .stage.s-queued_scrape, .stage.s-publishing { color: var(--foreground); }

/* pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; padding: .75rem 0; }
.pg { min-width: 2.25rem; height: 2.25rem; padding: 0 .75rem; border: 1px solid var(--border); background: transparent; color: var(--foreground); border-radius: var(--radius-lg); font: inherit; font-size: .9375rem; font-weight: 500; }
.pg:hover:not(:disabled) { background: var(--muted); }
.pg:disabled { opacity: .4; }
.pg.cur { background: var(--foreground); border-color: var(--foreground); color: var(--background); font-weight: 600; }
.ell { color: var(--muted-foreground); padding: 0 .25rem; font-size: 1rem; }
.jump { width: 3.75rem; height: 1.75rem; text-align: center; margin-left: auto; }

/* ── wizard ── */
.modal-xl { max-width: 70rem; max-height: 92vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.wz-head { padding: .875rem 1.25rem 0; }
.wz-body { flex: 1; overflow: auto; padding: 1rem 1.25rem 1.5rem; min-height: 0; }
.wz-foot { padding: .625rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; background: color-mix(in oklab, var(--muted) 50%, transparent); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.wz-title { display: flex; align-items: center; gap: .75rem; padding-right: 2rem; }
.wz-title img { width: 6rem; height: 3.375rem; object-fit: cover; border-radius: var(--radius-sm); }
.wz-cover { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); line-height: 0; }
.wz-cover img { display: block; }
.wz-cover:hover img, .wz-cover:focus-visible img { outline: 2px solid var(--primary); outline-offset: 1px; }
.wz-pen { position: absolute; right: .25rem; bottom: .25rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; }
.crop-live { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; padding-top: .625rem; border-top: 1px solid var(--border); line-height: 1.4; }
.crop-live[hidden] { display: none; }
.crop-live img { width: 4rem; height: 2.25rem; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.wz-title h2 { font-size: 1rem; }
.wz-title .pill a { color: var(--muted-foreground); }
a.wz-lz { display: inline-flex; align-items: center; gap: .3125rem; color: inherit; text-decoration: none; }
.wz-title a.wz-lz img.lz-fav { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; flex: none; }
a.wz-lz:hover, a.wz-lz:focus-visible { color: var(--foreground); text-decoration: underline; text-underline-offset: 2px; }
.stepper { display: flex; gap: .25rem; margin-top: .75rem; border-bottom: 1px solid var(--border); }
.step { flex: 1; padding: .5rem .25rem; font-size: .8125rem; color: var(--muted-foreground); border-bottom: 2px solid transparent; cursor: pointer; display: flex; gap: .5rem; align-items: center; justify-content: center; margin-bottom: -1px; }
.step .n { width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: .6875rem; font-weight: 600; }
.step.done .n { background: var(--success); color: #002a11; }
.step.cur { color: var(--foreground); border-bottom-color: var(--foreground); }
.step.cur .n { background: var(--foreground); color: var(--background); }
.step:hover { color: var(--foreground); }

/* link groups */
.grp { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); margin-bottom: .75rem; overflow: hidden; }
.grp.st-done { border-color: color-mix(in oklab, var(--success) 50%, transparent); }
.grp.st-needs_mirror, .grp.st-partial { border-color: color-mix(in oklab, var(--destructive) 60%, transparent); }
.grp.st-queued, .grp.st-leased, .grp.st-downloading, .grp.st-uploading { border-color: color-mix(in oklab, var(--foreground) 45%, transparent); }
.grp.st-skipped { opacity: .55; }
.grp-head { display: flex; align-items: center; gap: .375rem; padding: .5rem .625rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.grp-head .pos { font-family: var(--font-mono); color: var(--muted-foreground); font-size: .75rem; width: 1.25rem; }
.grp-head .tabsel { display: flex; gap: .25rem; }
.grp-head .tabsel label { font-size: .6875rem; display: inline-flex; align-items: center; padding: .125rem .5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); margin: 0; }
.grp-head .tabsel label.on { border-color: var(--foreground); color: var(--foreground); background: var(--muted); }
.grp-head .tabsel input { display: none; }
.grp-body { display: grid; grid-template-columns: 1fr 20rem; gap: .75rem; padding: .625rem; }
@media (max-width: 860px) { .grp-body { grid-template-columns: 1fr; } }
.grp-body label { margin-top: 0; }
textarea.mirrors { font-family: var(--font-mono); font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; line-height: 1.6; }
.mlines { display: flex; flex-direction: column; gap: .125rem; margin-top: .375rem; }
.mline { display: flex; align-items: center; gap: .5rem; font-size: .75rem; font-family: var(--font-mono); padding: .125rem .375rem; border-radius: var(--radius-sm); background: var(--muted); }
.mline .h { min-width: 5.5rem; color: var(--muted-foreground); text-transform: uppercase; font-size: .6875rem; letter-spacing: .04em; font-family: var(--font-sans); }
.mline .u { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); }
.mline.masked .u { color: var(--warning); }
.mline.real .u { color: var(--foreground); }
.mline .tag { font-size: .6875rem; padding: 0 .375rem; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); font-family: var(--font-sans); }
.mline .tag.cache { background: color-mix(in oklab, var(--success) 18%, transparent); color: var(--success); }
.mline a.open { white-space: nowrap; font-family: var(--font-sans); color: var(--foreground); }
.hostrow .hostname { font-size: .75rem; color: var(--muted-foreground); padding: .125rem .5rem; border-radius: 999px; border: 1px solid var(--border); }
.hostrow .hostname.ok { color: var(--foreground); border-color: color-mix(in oklab, var(--success) 45%, var(--border)); }
.src { display: flex; flex-direction: column; gap: .375rem; }
.src .row2 { display: flex; gap: .375rem; }
.src input { flex: 1; font-family: var(--font-mono); font-size: .75rem; }
.src .st { font-size: .75rem; display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }
.prog { height: .375rem; border-radius: 999px; background: var(--muted); overflow: hidden; position: relative; }
.prog > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--foreground); transition: width .4s; }
.prog.up > i { background: var(--success); }
.results { display: flex; flex-wrap: wrap; gap: .25rem; }
.results .r { font-size: .6875rem; padding: .125rem .4rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }
.results .r.ok { background: color-mix(in oklab, var(--success) 18%, transparent); color: var(--success); }
.results .r.no { background: color-mix(in oklab, var(--destructive) 16%, transparent); color: var(--danger); }
.results .r.copy { border: 0; cursor: pointer; font: inherit; font-size: .6875rem; line-height: inherit; }
.results .r.copy:hover { outline: 1px solid currentColor; }
.results.mirrors { margin-top: .25rem; align-items: center; }
.results.mirrors .hint { font-size: .6875rem; }
.results .r.mir { background: color-mix(in oklab, var(--foreground) 8%, transparent); color: var(--foreground); }
.preview { margin-top: .75rem; }
.preview pre { margin: 0; padding: .625rem; background: var(--muted); border-radius: var(--radius-lg); font-size: .6875rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all; max-height: 16rem; overflow: auto; font-family: var(--font-mono); }
.preview h4 { margin: .5rem 0 .25rem; display: flex; align-items: center; gap: .5rem; }

/* review form */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; }
.full { grid-column: 1 / 3; }
.platforms { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
textarea.lz-links { font-family: var(--font-mono); font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; line-height: 1.6; }
.shots { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .375rem; }
.shots img { height: 4.25rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.existing { grid-column: 1 / 3; }
.existing h3 { margin: 0 0 .375rem; font-size: .875rem; }
.existing .kv { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .75rem; color: var(--muted-foreground); margin-bottom: .375rem; }
.existing .kv b { color: var(--foreground); font-weight: 500; }
.verstrip { display: flex; gap: .375rem; overflow-x: auto; padding: .625rem 0 .5rem; scrollbar-width: thin; }
.verstrip .vp { flex: 0 0 auto; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); border-radius: 999px; padding: .125rem .55rem; font: inherit; font-size: .6875rem; cursor: pointer; white-space: nowrap; }
.verstrip .vp:hover { color: var(--foreground); }
.verstrip .vp.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.verlinks { margin-top: .25rem; }
.existing .lk { font-family: var(--font-mono); font-size: .6875rem; white-space: pre-wrap; color: var(--muted-foreground); margin: .125rem 0 .5rem; }
.existing summary { font-size: .75rem; margin-top: .25rem; }

/* jobs + logs */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: .75rem; }
.wk-strip { display: flex; gap: .375rem; flex-wrap: wrap; align-items: center; min-width: 0; }
.wk { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; padding: .25rem .625rem; border-radius: 999px; background: var(--muted); white-space: nowrap; }
.wk .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--danger); flex: none; }
.wk.on .dot { background: var(--success); }
.wk span { color: var(--muted-foreground); }
.jsec { margin: 1rem 0 .5rem; display: flex; align-items: center; gap: .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); font-weight: 600; }
.jsec .n { background: var(--muted); border-radius: 999px; padding: 0 .5rem; letter-spacing: 0; }
.jgame { margin-bottom: .75rem; padding: .75rem; }
.jg-head { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.jg-cv { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-md); object-fit: cover; flex: none; background: var(--muted); }
.jg-t { min-width: 0; flex: 1 1 8rem; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.jg-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.jg-v { font-size: .75rem; color: var(--muted-foreground); }
.jg-who { font-size: .75rem; font-weight: 500; padding: .125rem .625rem; border-radius: 999px; background: color-mix(in oklab, var(--foreground) 10%, transparent); white-space: nowrap; flex: none; }
.jg-rows { display: flex; flex-direction: column; gap: .5rem; margin-top: .625rem; }
.jrow { padding: .5rem .625rem; border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.jr-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8125rem; min-width: 0; }
.jr-tab { font-weight: 500; white-space: nowrap; }
.jr-name { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-foreground); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 8rem; }
.jr-w { font-size: .75rem; color: var(--muted-foreground); margin-left: auto; white-space: nowrap; }
.jr-err { font-size: .75rem; color: var(--danger); overflow-wrap: anywhere; }
.jr-ticks { display: flex; gap: .25rem; flex-wrap: wrap; }
.jr-actions { display: flex; gap: .375rem; flex-wrap: wrap; }
.lz-log-layout { display: grid; grid-template-columns: 18rem 1fr; gap: .75rem; height: calc(100vh - var(--nav-h) - 7rem); }
.lz-log-runs { overflow: auto; border-right: 1px solid var(--border); padding-right: .5rem; }
.lz-log-lines { overflow: auto; font-family: var(--font-mono); font-size: .75rem; }
.lz-run { padding: .375rem .5rem; border-radius: var(--radius-md); cursor: pointer; margin-bottom: .125rem; border: 1px solid transparent; }
.lz-run:hover { background: var(--muted); }
.lz-run.on { background: var(--muted); border-color: var(--border); }
.lz-run .rt { font-weight: 500; }
.lz-run .rm { font-size: .75rem; color: var(--muted-foreground); display: flex; gap: .375rem; align-items: center; margin-top: .125rem; flex-wrap: wrap; }
.lz-logline { display: grid; grid-template-columns: 4rem 4.5rem 1fr; gap: .5rem; padding: .2rem 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 50%, transparent); align-items: start; }
.lz-logline .ph { color: var(--muted-foreground); text-transform: uppercase; font-size: .6875rem; letter-spacing: .04em; padding-top: .125rem; }
.lz-logline .tm { color: var(--muted-foreground); font-size: .6875rem; padding-top: .125rem; }
.lz-logline .ms { color: var(--muted-foreground); white-space: pre-wrap; word-break: break-all; }
.lz-logline.ok .ms { color: var(--foreground); }
.lz-logline.warn .ph, .lz-logline.warn .ms { color: var(--warning); }
.lz-logline.error .ph, .lz-logline.error .ms { color: var(--danger); }

/* account / editor pickers */
.acct { display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; margin-bottom: .375rem; }
.acct:hover { background: var(--muted); }
.acct.on { border-color: var(--foreground); background: var(--muted); }
.acct .nm { font-weight: 500; flex: 1; }
.acct.banned { opacity: .6; }
.acct-form { display: grid; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* Links step, single column */
.grp, .grp-main, .mline, .mline .u, .srcbox, .wz-body { min-width: 0; }
.grp-main { padding: .625rem .75rem .75rem; display: flex; flex-direction: column; gap: .5rem; }
.grp-main .mlines { margin-top: 0; }
.mline { padding: .25rem .5rem; gap: .625rem; }
.mline .h { font-family: var(--font-sans); font-size: .6875rem; min-width: 6rem; font-weight: 600; }
.mline .u { font-size: .75rem; }
.mline.masked .u { color: var(--muted-foreground); font-family: var(--font-sans); font-style: italic; }
.mline .btn { margin-left: auto; }
.mrow-head { display: flex; align-items: center; gap: .375rem; margin-top: .25rem; }
.srcbox { border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: .625rem .75rem; display: flex; flex-direction: column; gap: .375rem; background: color-mix(in oklab, var(--muted) 35%, transparent); }
.srcbox.done { border-style: solid; }
.srcbox-t { font-weight: 500; font-size: .875rem; }
.srcbox .row2 { display: flex; gap: .375rem; }
.srcbox .row2 .input { flex: 1; font-family: var(--font-mono); font-size: .75rem; }
details.preview summary { list-style: revert; }
.grp-head .tabsel .hint { margin-right: .125rem; }

/* diff against lewdzone */
.fld.changed { border-left: 2px solid var(--warning); padding-left: .5rem; margin-left: -.625rem; }
.fld.same .input { opacity: .75; }
.fld.same label { color: var(--muted-foreground); }
.was { font-size: .6875rem; color: var(--muted-foreground); margin-top: .2rem; }
.difftbl { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.difftbl th, .difftbl td { padding: .3rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.difftbl thead th { font-size: .6875rem; color: var(--muted-foreground); font-weight: 500; }
.difftbl tbody th { font-weight: 500; white-space: nowrap; width: 8rem; color: var(--muted-foreground); }
.difftbl tr.same td { color: var(--muted-foreground); }
.difftbl tr.changed td:last-child { color: var(--warning); font-weight: 500; }
.difftbl tr.lists td:last-child { color: inherit; font-weight: 400; }
.difftbl tr.lists td { color: var(--muted-foreground); }
.difftbl .li.add { color: var(--success); font-weight: 600; }
.difftbl .li.rm { color: var(--danger); font-weight: 600; text-decoration: line-through; }
.was .add { color: var(--success); } .was .rm { color: var(--danger); }
.difftbl tr.changed th { color: var(--foreground); }
.difftbl tr.changed th::before { content: "●"; color: var(--warning); margin-right: .375rem; font-size: .6rem; vertical-align: middle; }

/* profile picker */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .375rem; margin-bottom: .5rem; }
.pbtn { display: flex; flex-direction: column; align-items: flex-start; gap: .125rem; padding: .5rem .625rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: transparent; color: var(--foreground); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.pbtn:hover { background: var(--muted); }
.pbtn.on { border-color: var(--foreground); background: var(--muted); }
.pbtn b { font-weight: 500; font-size: .875rem; }
.pbtn span { font-size: .6875rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pbtn.new { justify-content: center; align-items: center; color: var(--muted-foreground); border-style: dashed; }

/* batch modal */
.blist { display: flex; flex-direction: column; gap: .25rem; max-height: 60vh; overflow: auto; }
.brow { display: flex; align-items: center; gap: .5rem; padding: .5rem .625rem; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; }
.brow:hover { background: var(--muted); }
.brow .t { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.brow .v { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-foreground); }
.tbl .c-act { text-align: left; white-space: nowrap; width: 1%; padding-right: .25rem; }
.tbl .c-act .btn { vertical-align: middle; }
.tbl .c-act .btn-icon.btn-sm { width: 1.75rem; height: 1.75rem; }
.tbl .c-act .btn.danger:hover { color: var(--danger); background: color-mix(in oklab, var(--destructive) 15%, transparent); }
.tbl .c-st { white-space: nowrap; }
.tbl .c-st .st-stage { margin-top: .25rem; }
.stage .who { font-weight: 600; margin-left: .125rem; }

/* links step, compact */
.hostrow { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }
.hostrow .hint { margin-right: .25rem; min-width: 5.5rem; }
.hostrow .hint.ph { min-width: 0; margin-left: .25rem; }
.hostrow .mline { padding: .125rem .5rem; }
.grp-main .row2 { display: flex; gap: .375rem; }
.grp-main .row2 .input { flex: 1; font-family: var(--font-mono); font-size: .75rem; }
.grp-main .tools { margin-top: .125rem; }
.grp-main .tools .btn-ghost { color: var(--muted-foreground); }
.badge.unm { cursor: pointer; border: 0; font: inherit; font-size: .75rem; margin-left: .25rem; }
.badge.unm:hover { filter: brightness(1.15); }
.unm-list { margin: 0; padding: .625rem; background: var(--muted); border-radius: var(--radius-lg); font-family: var(--font-mono); font-size: .6875rem; line-height: 1.6; max-height: 50vh; overflow: auto; white-space: pre; }
.unm-list .h { display: inline-block; min-width: 7rem; color: var(--muted-foreground); font-family: var(--font-sans); text-transform: uppercase; font-size: .6875rem; }

/* skeleton loading */
@keyframes skel { 0% { opacity: .45; } 50% { opacity: .9; } 100% { opacity: .45; } }
.skel { height: .875rem; border-radius: var(--radius-sm); background: var(--muted); animation: skel 1.4s ease-in-out infinite; margin: .25rem 0; }
.skel.sm { height: .625rem; }
.skel.cv { width: 2.25rem; height: 3rem; margin: 0; }
.skel.w20 { width: 20%; } .skel.w30 { width: 30%; } .skel.w40 { width: 40%; } .skel.w50 { width: 50%; } .skel.w60 { width: 60%; }
.skel-card { height: 7rem; border-radius: var(--radius-xl); background: var(--muted); animation: skel 1.4s ease-in-out infinite; margin: .75rem 0; }
.tbl tr.sk td { padding: .5rem; }
.wz-title .skel.cv { width: 6rem; height: 3.375rem; }

/* pagination pinned to the bottom of the viewport */
/* full-bleed bar: stretch to the viewport edges, keep the buttons aligned with the content column */
#latestPager { position: sticky; bottom: 0; z-index: 5; width: 100vw; margin: 0 calc(50% - 50vw); padding: .5rem max(1rem, calc(50vw - 50%));
  background: color-mix(in oklab, var(--background) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-top: 1px solid var(--border); box-sizing: border-box; }
.jumpbox { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 0 auto; font-size: .8125rem; color: var(--muted-foreground); }
.jumpbox .jump { width: 5.5rem; height: 2.25rem; margin: 0; padding: 0 .75rem; font-size: 1rem; text-align: center; font-family: var(--font-mono); -moz-appearance: textfield; }
.jumpbox .jump::-webkit-outer-spin-button, .jumpbox .jump::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.jumpbox .jump:focus { border-color: var(--foreground); }
.addbox { display: flex; gap: .375rem; align-items: center; flex: 1; max-width: 34rem; min-width: 16rem; }
.addbox .input { flex: 1; }
.tbl tbody tr { cursor: default; }
.tbl tbody tr.open { cursor: pointer; }
.tbl .v { white-space: nowrap; }
.lzid { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-sans); font-size: .75rem; color: var(--muted-foreground); margin-top: .125rem; }
.lzid img { width: 12px; height: 12px; border-radius: 2px; opacity: .9; }
.lzid:hover { color: var(--foreground); text-decoration: none; }

/* Jobs: upload server load table */
.srvtbl td,.srvtbl th{padding:6px 10px;white-space:nowrap}
.srvtbl tr.pick td{background:var(--bg-2,rgba(127,127,127,.08))}
.srvtbl tr.off td{opacity:.5}

/* Latest: "done" tick per game */
.tbl .c-done { width: 7.5rem; max-width: 7.5rem; padding-right: .75rem; }
.dn-wrap { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.dn { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.dn input { width: 1.125rem; height: 1.125rem; accent-color: var(--success); cursor: pointer; margin: 0; }
.dn-who { font-size: .75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tbl tbody tr.done td { opacity: .55; }
.tbl tbody tr.done td.c-done { opacity: 1; }

/* ── structured link lists (LinkView.structured) ─────────────────────────── */
.lv-tab { margin-top: 1.25rem; }
.lv-tab:first-of-type { margin-top: .75rem; }
.lv-tab-h { font-size: .75rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.lv-cnt { font-size: .6875rem; font-weight: 400; color: var(--muted-foreground); }
.lv-grp { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .75rem .875rem .875rem; margin-bottom: .75rem; background: color-mix(in oklab, var(--muted) 30%, transparent); }
.lv-grp-h { display: flex; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.lv-label { font-size: .6875rem; font-weight: 600; padding: .125rem .55rem; border-radius: 999px; background: color-mix(in oklab, var(--primary) 18%, transparent); color: var(--primary); }
.lv-label.main { background: transparent; color: var(--muted-foreground); font-weight: 400; padding-left: 0; }
.lv-warn { font-size: .6875rem; color: var(--warning); }
.lv-row { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin: 0; }
.lv-row + .lv-row { margin-top: .5rem; }
.lv-k { font-size: .6875rem; color: var(--muted-foreground); width: 3.25rem; flex: 0 0 auto; }
.lv-none { font-size: .6875rem; color: var(--muted-foreground); font-style: italic; }
.lv-pill { font: inherit; font-size: .6875rem; line-height: 1.3; border: 1px solid var(--border); background: var(--muted); color: var(--foreground); border-radius: 999px; padding: .25rem .625rem; cursor: pointer; white-space: nowrap; }
.lv-pill i { font-style: normal; color: var(--muted-foreground); }
.lv-pill:hover { border-color: currentColor; }
.lv-pill.h-fileknot, .lv-pill.h-transfaze { background: color-mix(in oklab, var(--success) 16%, transparent); color: var(--success); border-color: transparent; }
.lv-pill.broken { cursor: default; color: var(--danger); background: color-mix(in oklab, var(--destructive) 12%, transparent); border-color: transparent; }
.lv-pill.broken em { font-style: normal; font-size: .6875rem; text-transform: uppercase; margin-left: .25rem; }
.rawtext { margin-top: .5rem; }
.rawtext summary { cursor: pointer; }
.rawtext .lk { font-family: var(--font-mono); font-size: .6875rem; white-space: pre-wrap; color: var(--muted-foreground); margin: .25rem 0 .5rem; }

/* ── lewdzone look-alike preview (LinkView.site): dark like the site, whatever the lab theme ── */
.lzp { background: #0c0f10; color: #fff; border-radius: 8px; padding: 1rem; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
.lzp h3 { font-size: 1.05rem; margin: 0 0 .25rem; color: #fff; }
.lzp .older-versions { font-size: .75rem; color: #9aa0a6; font-weight: 400; margin-left: .25rem; }
.lzp .nav-tabs { list-style: none; display: flex; gap: .25rem; margin: 10px 0 0; padding: 0; border-bottom: 1px solid #1b1d22; }
.lzp .nav-link { font: inherit; color: #42c0fb; background: transparent; border: 1px solid transparent; border-bottom: 0; padding: 10px 16px; cursor: pointer; border-radius: 3px 3px 0 0; }
.lzp .nav-link.active { background: rgba(13, 16, 17, .59); border-color: #1b1d22; color: #fff; }
.lzp .tab-content { border: 1px solid #1b1d22; border-top: none; padding: 15px; }
.lzp .tab-pane { display: none; } .lzp .tab-pane.active { display: block; }
.lzp .tab-pane > span, .lzp .tab-pane a.downloadLink { display: inline-block; padding: 10px; margin: 10px 10px 0 0; min-width: 85px; font-weight: 700; border: 1px solid #2a2d33; color: #fff; border-radius: 4px; position: relative; text-decoration: none; }
.lzp a.downloadLink:hover { background: #2a2d33; }
.lzp .tab-pane > span { margin-top: 30px; padding: 9px 5px; min-width: 112px; border-width: 0 0 2px 0; border-radius: 0; }
.lzp .tab-pane > span.android { border-color: #83C056; } .lzp .tab-pane > span.windows { border-color: #0078D6; margin-top: 0; } .lzp .tab-pane > span.mac { border-color: #fff; } .lzp .tab-pane > span.linux { border-color: #FF6606; } .lzp .tab-pane > span.cg { border-color: #F31F53; }
.lzp .break { min-height: 1px; border-bottom: 1px dashed #292929; margin: 15px 0 0; }
.lzp .dl-icon { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #3e8bb1; margin: 0 5px -1px 0; }
.lzp a.d-fileknot, .lzp a.d-transfaze { border-color: rgba(62, 139, 177, .25); padding-right: 26px; }
.lzp .fk-lk-float { position: absolute; top: 0; right: 0; font-size: 11px; font-style: normal; color: #42c0fb; background: #182e38; border: 1px solid #182e38; border-radius: 9% 3px 9% 3px; padding: 2px 2px 3px; }
.lzp-note { font-size: .75rem; color: #9aa0a6; margin-top: .75rem; }

/* Links step: leads to other f95 posts (Patch / Extras lines) */
.related .rel-list { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .5rem; }
.related .rel { display: inline-flex; align-items: center; gap: .375rem; }
.lv-carry { font-size: .6875rem; color: var(--muted-foreground); }
.lv-carry:hover { color: var(--foreground); }

/* rich-text field (installation) */
.rte .rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-bottom: .25rem; }
.rte .rte-bar button { font: inherit; font-size: .75rem; line-height: 1; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--foreground); cursor: pointer; }
.rte .rte-bar button:hover { background: var(--muted); }
.rte .rte-bar .hint { margin-left: auto; }
.rte .rte-body { height: auto; min-height: 4.5rem; padding: .5rem .625rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.rte .rte-body > div { min-height: 1.5em; padding-left: 1rem; position: relative; }
.rte .rte-body > div::before { content: '•'; position: absolute; left: 0; color: var(--muted-foreground); }
.rte .rte-body a { color: var(--primary); text-decoration: underline; }

/* ── desktop bits for the mobile retrofit ── */
main, .view, .toolbar, .tbl-wrap, .nav-inner, .nav-links, .wz-tt, .wz-meta { min-width: 0; }
.wz-tt { flex: 1; min-width: 0; }
.wz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .375rem; margin-top: .125rem; }
.wz-url-s { display: none; }
.wz-src a { overflow-wrap: anywhere; }
.step .lbl { white-space: nowrap; }
.grp-head .pill.mono, .existing .kv a { overflow-wrap: anywhere; }
.reorder { display: inline-flex; gap: .125rem; margin-left: .25rem; }
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.hscroll .tbl thead th { position: static; }
#latestStat a { text-decoration: underline; text-underline-offset: 2px; }
.difftbl td.diff-only { display: none; }
.difftbl .diff-only .rm { color: var(--danger); } .difftbl .diff-only .add { color: var(--success); }
.lz-lines-h { position: sticky; top: 0; background: var(--background); padding: .5rem 0; border-bottom: 1px solid var(--border); z-index: 1; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-family: var(--font-sans); font-size: .8125rem; }
.jumpbox .jump { border-color: var(--border); }
.theme-row { display: flex; align-items: center; gap: .375rem; margin: .25rem 0 .5rem; }
.theme-row .btn.on { background: var(--muted); border-color: var(--foreground); }
.pubas { height: 2rem; display: flex; align-items: center; font-weight: 500; }
details.exist > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; }
details.exist > summary::-webkit-details-marker { display: none; }
details.exist > summary::before { content: "▸"; color: var(--muted-foreground); font-size: .75rem; transition: transform .15s; }
details.exist[open] > summary::before { transform: rotate(90deg); }
details.exist > summary h3 { margin: 0; }
details.exist[open] > summary { margin-bottom: .375rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .375rem; }
.shots img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

/* ── phones (≤ 640px): single column, card rows, big tap targets, full-screen wizard ── */
@media (max-width: 640px) {
  :root { --nav-h: 3.25rem; }
  .nav { padding-top: env(safe-area-inset-top); height: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .nav-inner { gap: .5rem; padding: 0 .75rem; }
  .brand { margin-right: 0; } .brand-text { display: none; }
  .nav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 88%, transparent); padding: 0 1.5rem 0 .25rem; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: 0 0 auto; scroll-snap-align: start; height: 2.5rem; padding: 0 .75rem; }
  .nav-actions { flex: 0 0 auto; margin-left: 0; }
  #themeBtn { display: none; }
  #profileChip, #scopeChip { height: 2.5rem; padding: 0 .625rem; max-width: 7.5rem; }
  #scopeChip .lbl { display: none; }   /* icon only on phones */
  #profileName { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  main { padding: .75rem .75rem 3rem; }
  .toolbar { gap: .5rem .75rem; }
  .addbox { flex: 1 1 100%; max-width: none; min-width: 0; }
  .toolbar > .pill { flex: 1 1 0; min-width: 10rem; }
  .toolbar > .sp { display: none; }
  .toolbar .btn-ghost.btn-sm { margin-left: auto; }
  #view-pipeline .toolbar > .pill { flex: 0 0 auto; min-width: 0; }

  /* controls: 16px inputs (no iOS focus zoom), ≥ 40px primary targets */
  .btn { height: 2.5rem; }  .btn-primary, .btn-secondary, .btn-danger { height: 2.75rem; }
  .btn-sm { height: 2.25rem; padding: 0 .75rem; font-size: .8125rem; }
  .btn-icon { width: 2.5rem; }  .tbl .c-act .btn-icon.btn-sm { width: 2.5rem; height: 2.5rem; }
  .input, select.input { height: 2.75rem; }
  input, select, textarea, .input, .rte .rte-body, .grp-main .row2 .input, .srcbox .row2 .input, .src input, textarea.mirrors, textarea.lz-links, .jumpbox .jump { font-size: 1rem !important; }   /* 16px: iOS does not zoom on focus */
  .rte .rte-body { height: auto; }
  label.inline { min-height: 2.5rem; }  label.inline input { width: 1.75rem; height: 1.75rem; flex: none; }
  .badge.unm, .verstrip .vp, .lv-pill, .results .r.copy { min-height: 2rem; padding: .375rem .75rem; }
  .lzid, .tbl .pill a, .lz-run .rm a, #latestStat a, .wz-src a, .existing .kv a, .wz-body p a, .related a { display: inline-flex; align-items: center; min-height: 1.75rem; }
  .rte .rte-bar button { min-height: 2.25rem; min-width: 2.25rem; }
  .tab { min-height: 2.75rem; padding: .5rem .375rem; }  .pg { min-width: 2.5rem; height: 2.5rem; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab .cnt { padding: 0; width: .4rem; height: .4rem; color: transparent; overflow: hidden; line-height: 0; }
  .modal-close { width: 2.5rem; height: 2.5rem; top: .375rem; right: .375rem; font-size: 1rem; }
  .chip .k { display: none; }

  /* tables → card rows */
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl tbody tr { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; grid-auto-rows: auto; column-gap: .625rem; row-gap: 0;
    padding: .625rem 0; border-bottom: 1px solid var(--border); align-items: start; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .tbl td[colspan] { grid-column: 1 / -1; }
  .tbl td.c-cv { grid-column: 1; grid-row: 1 / span 9; }
  .tbl td.c-act, .tbl td.c-done { grid-column: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .375rem; width: auto; max-width: none; padding: 0 0 0 .25rem; }
  .tbl td.c-act { grid-row: 1 / span 2; align-self: start; }
  .tbl td.c-done { grid-row: 3 / span 7; align-self: start; padding-top: .375rem; }
  .tbl td.c-act:empty { display: none; }
  .tbl td.c-act .btn-icon.btn-sm { width: 2.75rem; height: 2.75rem; }
  .tbl td.c-t, .tbl td.v, .tbl td.c-st, .tbl td.c-stage, .tbl td.c-lz, .tbl td.c-grp, .tbl td.c-upd, .tbl td.c-unm { grid-column: 2; white-space: normal; margin-top: .125rem; }
  .tbl td.c-t { margin-top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
  .tbl td.c-t .pill { margin-top: 0; }
  .tbl td.c-grp, .tbl td.c-upd { font-size: .75rem; color: var(--muted-foreground); }
  .tbl td.c-unm:has(> .hint:only-child) { display: none; }
  .tbl td.c-unm { margin-top: .25rem; }
  .tbl tbody tr.pline[onclick]::after { content: "›"; grid-column: 3; grid-row: 1 / span 4; align-self: center; color: var(--muted-foreground); font-size: 1.25rem; padding: 0 .25rem; }
  .tbl td.c-upd { grid-column: 3; grid-row: 5; align-self: end; font-size: .6875rem; white-space: nowrap; padding-right: .25rem; margin-top: 0; }
  .tbl .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tbl-wrap { user-select: text; }
  .tbl .c-done .dn-wrap { flex-direction: column; gap: .125rem; align-items: center; }
  .dn { padding: .5rem; margin: -.5rem; }  .dn input { width: 1.5rem; height: 1.5rem; }
  .dn-who { font-size: .6875rem; max-width: 3rem; text-align: center; }
  .dn-who .badge { display: inline-block; max-width: 3rem; overflow: hidden; text-overflow: ellipsis; padding: 0 .3rem; }

  /* pager */
  #latestPager { position: fixed; left: 0; right: 0; bottom: 0; width: auto; margin: 0; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); flex-wrap: nowrap; gap: .25rem; }
  #latestPager .pg { min-width: 2.5rem; padding: 0 .5rem; }
  .jumpbox .jl { display: none; }  .jumpbox .jump { width: 4rem; height: 2.5rem; }
  #view-latest { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  .toast { left: 1rem; right: 1rem; max-width: none; bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

  /* modals: wizard + preview full screen, the rest centred sheets */
  .modal { align-items: stretch; }
  .modal-content { max-width: 100% !important; min-width: 0; align-self: center; width: calc(100% - 1.5rem); margin: 0 auto; max-height: calc(100dvh - 2rem); overflow: auto; }
  .modal-xl, .modal-preview { width: 100% !important; height: 100dvh; max-height: 100dvh !important; border-radius: 0; align-self: stretch; }
  .modal-preview { padding: 1rem .75rem; }
  .wz-head, .wz-body, .wz-foot, .wz-title > div, .grp, .grp-head, .grp-main, .grid, .fld, .existing { min-width: 0; }
  .wz-head { padding: .625rem .75rem .25rem; }
  .wz-title { padding-right: 2.5rem; gap: .5rem; }
  .wz-title img { width: 4.875rem; height: 2.75rem; }
  .wz-tt { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .375rem; }
  .wz-name { flex: 1 1 100%; font-size: .9375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .wz-meta { display: contents; }
  .wz-src { display: inline-flex; align-items: center; gap: .25rem; margin: 0; }
  .wz-url { display: none; } .wz-url-s { display: inline; }
  .wz-lz, .wz-upd, .wz-meta .badge-warning { display: none; }   /* the stage pill already names who is on it */
  .wz-src { min-height: 0; }
  .wz-head { padding-bottom: 0; }
  .wz-body { padding: .75rem .75rem 1.25rem; overflow-x: clip; }
  .wz-foot { flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); border-radius: 0; }
  .wz-foot > .pill { flex: 1 1 100%; order: -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wz-foot .wz-advice { display: none; }
  .wz-foot .btn { height: 2.75rem; flex: 1 1 auto; min-width: 0; padding: 0 .75rem; }
  .wz-foot .btn-primary { flex: 1 1 100%; order: 10; }
  .stepper { gap: 0; margin-top: .375rem; }
  .step { flex: 1 1 0; min-width: 0; gap: .25rem; padding: .5rem 0; font-size: .75rem; min-height: 2.5rem; }
  .step:not(.cur) .lbl { display: none; }
  .step.cur { flex: 2 1 0; }
  .step .n { width: 1.5rem; height: 1.5rem; }
  .modal-content h2, #lzpTitle { padding-right: 2.5rem; overflow-wrap: anywhere; }
  .lzp { padding: .75rem; } .lzp .nav-link { padding: 8px 10px; }
  .pgrid { grid-template-columns: 1fr 1fr; } .pbtn { min-height: 3rem; }

  /* wizard: links groups */
  .grp-head { padding: .5rem .625rem; row-gap: .5rem; }
  .grp-head .tabsel { flex: 1 1 100%; flex-wrap: wrap; gap: .375rem; }
  .grp-head .tabsel label { min-height: 2rem; padding: .25rem .625rem; font-size: .75rem; }
  .grp-head .btn-icon.btn-sm { height: 2.25rem; width: 2.25rem; padding: 0; }
  .grp-head .preset-btn { padding: 0 .625rem; height: 2.75rem; }
  .grp-head .lbl { flex: 1 1 6rem; }
  .grp .st .btn { flex: 1 1 auto; }
  .grp-main .tools { flex-wrap: wrap; }
  .grp-main .tools .btn { flex: 1 1 auto; }
  .grp-main .tools .reorder { margin-right: auto; }
  .reorder .btn-sm { width: 2.25rem; padding: 0; }
  .hostrow .hint { min-width: 0; }

  /* wizard: review / scrape */
  .grid { grid-template-columns: 1fr; gap: .5rem 0; }
  .full, .existing { grid-column: auto; }
  .fld.changed { margin-left: 0; padding-left: .5rem; }
  textarea.lz-links { white-space: pre-wrap; word-break: break-all; }
  .fld label .hint { display: block; font-weight: 400; opacity: .75; }
  .shots { grid-template-columns: repeat(3, 1fr); }
  .difftbl { font-size: .75rem; table-layout: fixed; width: 100%; } .difftbl tbody th { width: 5rem; white-space: normal; } .difftbl td { overflow-wrap: anywhere; }
  .difftbl tr.lists td:not(.diff-only) { display: none; } .difftbl td.diff-only { display: table-cell; }
  .lzp .tab-pane > span { display: block; margin: 1rem 0 0; }
  .lzp a.downloadLink { max-width: 100%; white-space: normal; overflow-wrap: anywhere; padding-right: 22px; }
  #profileForm > .row:last-child { position: sticky; bottom: 0; background: var(--popover); padding: .5rem 0 .25rem; margin-top: .5rem; }
  .srvtbl th:nth-child(6), .srvtbl td:nth-child(6), .srvtbl th:nth-child(7), .srvtbl td:nth-child(7) { display: none; }
  .srvtbl { display: table; width: 100%; } .srvtbl tbody { display: table-row-group; } .srvtbl thead { display: table-header-group; } .srvtbl thead tr, .srvtbl tbody tr { display: table-row; padding: 0; } .srvtbl td, .srvtbl th { display: table-cell; width: auto; height: auto; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: static; }
  .cards { grid-template-columns: 1fr; }
  #view-jobs .toolbar .sp, #view-jobs .toolbar > .btn { display: none; }   /* the view refreshes itself every 4 s */
}

/* logs: single column under 760px */
@media (max-width: 760px) {
  .lz-log-layout { grid-template-columns: 1fr; height: auto; }
  .lz-log-runs { border-right: 0; padding-right: 0; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
  .lz-log-lines { max-height: none; overflow: visible; }
  .lz-lines-h { top: calc(var(--nav-h) + env(safe-area-inset-top)); }
  #logLines { scroll-margin-top: calc(var(--nav-h) + env(safe-area-inset-top) + .5rem); }
  .lz-logline { grid-template-columns: auto auto 1fr; }
  .lz-logline .ms { grid-column: 1 / -1; }
  .lz-run { padding: .625rem .625rem; min-height: 2.75rem; }
  .lz-run .rm a { display: inline-flex; align-items: center; min-height: 2rem; padding: 0 .5rem; border: 1px solid var(--border); border-radius: 999px; }
}

/* publish step */
.pub-msgs { font-size: .75rem; white-space: pre-wrap; margin: 0 0 .75rem; color: var(--muted-foreground); }
.pub-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .375rem .75rem; margin: 0 0 .75rem; padding: .625rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.pub-kv { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.pub-kv .k { font-size: .6875rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.pub-kv .v { font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; }
.pub-h { margin: .875rem 0 .375rem; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; }
.pub-act { height: 2.75rem; justify-content: flex-start; gap: .625rem; padding: 0 .875rem; white-space: normal; text-align: left; line-height: 1.2; }
.pub-act:hover { text-decoration: none; }
.pub-act.is-done { color: var(--success); border-color: color-mix(in oklab, var(--success) 50%, transparent); }
@media (max-width: 640px) { .pub-grid { grid-template-columns: 1fr; } .pub-summary { grid-template-columns: 1fr 1fr; } }

/* ── link group card, v2: platforms first, label + preset picker, per-host status rows ── */
.grp-head { display: block; padding: .5rem .625rem; }
.grp-row { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }
.grp-row + .grp-row { margin-top: .375rem; }
.grp-head .pos { width: 1.25rem; text-align: center; }
.grp-row.top { flex-wrap: nowrap; align-items: flex-start; }
.grp-head .tabsel { flex: 1 1 0; min-width: 0; flex-wrap: wrap; gap: .3rem; }
.grp-row.top .stage { margin-left: auto; flex: none; }
.grp-head .grp-x { flex: none; }
.grp-head .tabsel label { min-height: 1.75rem; padding: .25rem .625rem; font-size: .75rem; font-weight: 500; }
.grp-head .lbl { flex: 1 1 10rem; min-width: 0; }
.preset-btn { flex: none; height: 2rem; }
.preset-btn.on { background: var(--muted); border-color: var(--foreground); }
@media (max-width: 640px) { .preset-btn { height: 2.75rem; } }
/* label: after the link box (or at the end of the source line once a link is set) */
.lblwrap { display: flex; align-items: center; gap: .375rem; flex: 0 1 22rem; min-width: min(100%, 15rem); }
.lblwrap .lbl-k { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; flex: none; }
.grp-main .lblwrap .input.lbl { flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: .875rem; }
.grp-main .row2.linkrow { flex-wrap: wrap; }
.grp-main .row2.linkrow .src-in { flex: 1 1 18rem; min-width: 0; }
.grp-main .row2.linkrow .lblwrap { margin-left: .5rem; padding-left: .75rem; border-left: 1px solid var(--border); }
.src-line .lblwrap { margin-left: auto; }
@media (max-width: 640px) { .lblwrap, .grp-main .row2.linkrow .lblwrap { flex: 1 1 100%; margin-left: 0; padding-left: 0; border-left: 0; } .grp-main .row2.linkrow .src-in { flex: 1 1 0; } }
.preset-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--border); }
.pchip { font: inherit; font-size: .75rem; line-height: 1; padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--muted); color: var(--foreground); cursor: pointer; }
.pchip:hover { border-color: var(--foreground); }
.pchip.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.pchip.clear { background: transparent; color: var(--muted-foreground); border-style: dashed; }
.srcbox { gap: .5rem; }
.src-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.src-k { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; }
.src-host { font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in oklab, var(--foreground) 10%, transparent); }
.src-url { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-foreground); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.src-url:hover { color: var(--foreground); text-decoration: none; }
.grp-err { color: var(--danger); }
.hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .25rem .5rem; }
.hrow { display: flex; align-items: center; gap: .5rem; min-height: 2.25rem; padding: .25rem .5rem; border-radius: var(--radius-md); background: color-mix(in oklab, var(--muted) 55%, transparent); font: inherit; font-size: .8125rem; color: var(--foreground); border: 1px solid transparent; text-align: left; min-width: 0; }
button.hrow { cursor: pointer; }
button.hrow:hover { border-color: var(--border); }
.hrow .hic { width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; }
.hrow .hic .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted-foreground); opacity: .6; }
.hrow .hname { font-weight: 500; flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.hrow .hname em { font-style: normal; font-family: var(--font-mono); font-size: .6875rem; font-weight: 600; color: var(--muted-foreground); margin-left: .25rem; }
.hrow .hbar { flex: 1 1 3rem; height: .375rem; border-radius: 999px; background: var(--muted); overflow: hidden; position: relative; min-width: 2rem; }
.hrow .hbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--foreground); transition: width .4s; }
.hrow .hbar.up i { background: var(--success); }
.hrow .hpct { font-family: var(--font-mono); font-size: .75rem; min-width: 2.5rem; text-align: right; }
.hrow .hmeta { margin-left: auto; font-size: .75rem; color: var(--muted-foreground); white-space: nowrap; display: inline-flex; align-items: center; gap: .25rem; }
.hrow.ok { background: color-mix(in oklab, var(--success) 12%, transparent); }
.hrow.ok .hic { color: var(--success); }
.hrow.up .hic { color: var(--foreground); }
.hrow.no { background: color-mix(in oklab, var(--destructive) 10%, transparent); }
.hrow.no .hic, .hrow.no .hmeta { color: var(--danger); }
.hrow.wait { color: var(--muted-foreground); }
.hrow.hsrc .hic { color: var(--foreground); }
.hrow.dl { grid-column: 1 / -1; }   /* the download row spans the grid so its bar has room */
.hrow.dl .hname { flex: none; }
.hsize { margin-top: .125rem; }
.post-mirrors { gap: .3rem; }
.grp-actions { gap: .375rem; }
@media (max-width: 640px) {
  .grp-head .tabsel label { min-height: 2rem; }
  .hosts { grid-template-columns: 1fr; }
  .hrow { min-height: 2.25rem; }
  .grp-actions .btn { flex: 1 1 auto; }
}

/* ── phones: compact wizard header + one-row footer ── */
@media (max-width: 640px) {
  .wz-head { padding: .375rem .5rem 0 .5rem; }
  .wz-title { gap: .5rem; padding-right: 2.5rem; }
  .wz-title img { width: 4rem; height: 2.25rem; }
  .wz-name { font-size: .875rem; -webkit-line-clamp: 1; }
  .wz-tt { gap: .125rem .375rem; }
  .wz-meta .pill, .wz-src { font-size: .6875rem; }
  .wz-meta .badge, .wz-meta .stage { height: 1.125rem; font-size: .6875rem; }
  .modal-close { top: .125rem; right: .125rem; width: 2.25rem; height: 2.25rem; }
  .stepper { margin-top: .125rem; }
  .step { min-height: 2.125rem; padding: .25rem 0; }
  .step .n { width: 1.375rem; height: 1.375rem; }
  .wz-body { padding: .625rem .625rem 1rem; }
  .wz-intro { display: none; }
  .wz-foot { flex-wrap: nowrap; gap: .375rem; padding: .375rem .5rem calc(.375rem + env(safe-area-inset-bottom)); }
  .wz-foot > .pill { display: none; }
  .wz-foot > .pill.keep { display: inline; flex: 1 1 auto; order: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wz-foot .btn { height: 2.5rem; flex: 1 1 0; min-width: 0; padding: 0 .375rem; font-size: .8125rem; gap: .25rem; }
  .wz-foot .btn-primary { flex: 1.6 1 0; order: 0; }
  .wz-foot .btn svg { width: 1.125rem; height: 1.125rem; }
  .wz-foot .desk-only { display: none; }
}

/* clear / restore on the installation + changelog fields */
.lbl-row { display: flex; align-items: center; gap: .5rem; }
.lbl-row > label { flex: 1 1 auto; min-width: 0; }
.fld-clear { height: 1.75rem; padding: 0 .5rem; font-size: .75rem; flex: none; }
@media (max-width: 640px) { .fld-clear { height: 2.25rem; padding: 0 .75rem; } }

/* two-tap publish: [✕] [Confirm · countdown] in the footer */
.pubwrap { display: inline-flex; gap: .375rem; align-items: center; }
.pub-x { width: 2.5rem; flex: none; }
.pub-confirm .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 1.375rem; height: 1.375rem; border-radius: 999px; background: color-mix(in oklab, var(--primary-foreground) 18%, transparent); font-variant-numeric: tabular-nums; font-weight: 600; }
.pub-confirm:disabled { opacity: .7; }
@media (max-width: 640px) { .pubwrap { flex: 1.6 1 0; min-width: 0; } .pubwrap .btn-primary { flex: 1 1 0; } .pub-x { width: 2.75rem; } }
@media (max-width: 640px) { .wz-foot.armed > :not(.pubwrap) { display: none; } .wz-foot.armed .pubwrap { flex: 1 1 100%; } .wz-foot.armed .pub-confirm { flex: 1 1 0; } }
.wz-foot .pub-x { flex: 0 0 2.75rem; }
.pub-confirm .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pub-confirm { min-width: 0; }

/* paste of the F95 first post (Links step) */
.pastebox { border: 1px dashed color-mix(in oklab, var(--foreground) 30%, transparent); border-radius: var(--radius-lg); padding: .5rem .75rem; margin: 0 0 .75rem; background: color-mix(in oklab, var(--card) 70%, transparent); }
.pastebox.has { border-style: solid; border-color: color-mix(in oklab, var(--success) 55%, var(--border)); }
.pastebox summary { cursor: pointer; display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .875rem; }
.pastebox summary .hint { font-weight: 400; }
.pastebox .hint { font-size: .8125rem; }
.pastebox p.hint { margin: .5rem 0; }
.pastearea { min-height: 72px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: .5rem .6rem; background: var(--input); color: var(--foreground); font-size: .8125rem; outline: none; white-space: pre-wrap; word-break: break-word; }
.pastearea:focus { border-color: var(--ring); box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 35%, transparent); }
.pastearea:empty::before { content: attr(data-ph); color: var(--muted-foreground); }
.pastebox .row { margin-top: .5rem; gap: .5rem; align-items: center; }

/* F95 links are copy buttons, never anchors (see copyF95 in app.js) */
.f95copy { display: inline-flex; align-items: center; gap: .25rem; margin: 0; padding: 0 .45rem; min-height: 1.35rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: .75rem; line-height: 1; cursor: pointer; vertical-align: middle; }
.f95copy:hover { color: var(--foreground); border-color: color-mix(in oklab, var(--foreground) 35%, var(--border)); }
.f95copy:active { transform: translateY(1px); }
.f95copy svg { flex: 0 0 auto; }
.slugchip { max-width: 100%; min-width: 0; }
.slugchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-src .f95copy { margin-left: .35rem; }
.wz-src .wz-url { cursor: pointer; text-decoration: none; }
.wz-src .wz-url:hover { color: var(--foreground); }
@media (max-width: 880px) { .f95copy { min-height: 1.75rem; padding: 0 .6rem; } }

/* copy chip beside a game name */
.c-t .t { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cpchip { padding: 0 .3rem; min-height: 1.25rem; opacity: .7; }
.cpchip:hover { opacity: 1; }

/* second source panel (Links step) */
.sitebox { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .6rem .75rem; margin: 0 0 .75rem; background: color-mix(in oklab, var(--card) 70%, transparent); }
.sitebox.has { border-color: color-mix(in oklab, var(--success) 55%, var(--border)); }
.sitehead { display: flex; align-items: center; gap: .4rem; font-size: .875rem; margin-bottom: .45rem; flex-wrap: wrap; }
.sitebox .row2 { display: flex; gap: .4rem; align-items: center; }
.sitebox .row2 .input { flex: 1; min-width: 0; }
.sitehits { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.sitehit { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: .8125rem; }
.sitehit .hit-t { font-weight: 600; }
.sitebox .notice { margin: 0 0 .5rem; }
@media (max-width: 640px) { .sitebox .row2 { flex-wrap: wrap; } .sitebox .row2 .input { flex-basis: 100%; } }

/* Latest: search within the cached feed */
.lat-q { max-width: 16rem; min-width: 9rem; height: 2rem; font-size: .8125rem; }
@media (max-width: 640px) { .lat-q { flex-basis: 100%; max-width: none; order: 5; } }

/* add-a-mirror row under the host ticks */
.addmirror { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.addmirror .pchip { font-size: .75rem; }

/* Latest: load-from chips (paired secondary sites) */
.loadfrom { display: inline-flex; align-items: center; gap: .3rem; margin-left: .4rem; }
.loadfrom .pchip.lf { font-size: .72rem; padding: 0 .45rem; min-height: 1.35rem; }

/* wizard: breathing room */
.wz-intro { margin: 0 0 .75rem; }
.wz-body .grid { gap: .75rem .75rem; }
.wz-body .fld > label, .wz-body .full > label, .wz-body .lbl-row label { display: block; margin: 0 0 .3rem; }
.wz-body .lbl-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.wz-body .lbl-row label { margin: 0; }
.wz-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.wz-body .notice + .grid, .wz-body .notice + .sitebox { margin-top: .25rem; }
.sitebox, .pastebox, .related { margin-bottom: 1rem; }

/* field labels: the status word sits apart from the field name */
.wz-body .fld label .hint, .wz-body .full label .hint, .wz-body .fld label .badge, .wz-body .lbl-row label .badge { margin-left: .4rem; }
.wz-body .fld label .hint { opacity: .8; }

/* stale-tab notice */
.newver { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--popover, var(--card)); box-shadow: 0 6px 24px rgba(0,0,0,.4); font-size: .8125rem; }

/* keep a file off a host */
.hrow .hx { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.hrow .hx:hover { background: var(--muted); color: var(--foreground); }
.hrow.wait .hmeta { margin-left: auto; }
.hrow.wait .hx { margin-left: .25rem; }
.skiprow { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.skiprow .pchip.off { opacity: .7; text-decoration: line-through; }
.skiprow .pchip.off:hover { opacity: 1; text-decoration: none; }

/* Logs: filters + slim rows for QC */
.logbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.logbar .input.sm { height: 2rem; font-size: .8125rem; width: auto; min-width: 9rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted-foreground); padding: .3rem .75rem; font: inherit; font-size: .8125rem; cursor: pointer; }
.seg button.on { background: var(--muted); color: var(--foreground); }
.lz-log-layout { grid-template-columns: 26rem 1fr; }
.lz-run.slim, .lz-game { display: grid; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; font-size: .8125rem; margin-bottom: 1px; }
.lz-run.slim { grid-template-columns: auto 1fr auto auto auto; }
.lz-game { grid-template-columns: 1fr auto auto auto auto; }
.lz-run.slim:hover, .lz-game:hover { background: var(--muted); }
.lz-run.slim.on, .lz-game.on { background: var(--muted); border-color: var(--border); }
.lz-run.slim .rt, .lz-game .gt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 500; }
.lz-game .gv { color: var(--muted-foreground); font-family: var(--font-mono); font-size: .72rem; font-weight: 400; }
.lz-run.slim .rp, .lz-game .gp, .lz-run.slim .rw, .lz-game .gw { color: var(--muted-foreground); font-size: .72rem; white-space: nowrap; }
.lz-run.slim .rs { width: .5rem; height: .5rem; border-radius: 50%; background: var(--success); }
.lz-run.slim .rs.err { background: var(--danger); } .lz-run.slim .rs.run { background: var(--warning); }
.lz-run.slim .badge, .lz-game .badge { font-size: .65rem; padding: .05rem .4rem; }
.lz-run-sep { display: flex; align-items: center; gap: .5rem; margin: .75rem 0 .25rem; padding-top: .5rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted-foreground); }
.lz-run-sep b { color: var(--foreground); font-weight: 600; } .lz-run-sep .err { color: var(--danger); }
.lz-lines-h { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 760px) { .lz-log-layout { grid-template-columns: 1fr; } .lz-game { grid-template-columns: 1fr auto; } .lz-game .gp, .lz-game .gw { display: none; } .lz-run.slim { grid-template-columns: auto 1fr auto; } .lz-run.slim .rp, .lz-run.slim .rw { display: none; } }

/* Logs: profile tabs */
.ptabs { flex-basis: 100%; display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .25rem; }
.ptab { border: 1px solid var(--border); background: transparent; color: var(--muted-foreground); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8125rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.ptab:hover { color: var(--foreground); }
.ptab.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.ptab .cnt { font-size: .7rem; opacity: .7; }

/* F95 Copy Post extension window */
.ext-modal { max-width: 46rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.ext-modal > p { margin: .5rem 0 1rem; font-size: .875rem; line-height: 1.5; }
.ext-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ext-card { border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 8px; padding: 1rem; }
.ext-card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.ext-card ol { margin: .75rem 0 0; padding-left: 1.2rem; font-size: .875rem; line-height: 1.6; }
.ext-card code { font-size: .8rem; word-break: break-all; }
.ext-btn { gap: .35rem; }
@media (max-width: 640px) { .nav .ext-btn { display: none; } }   /* the extension is a desktop-browser thing */
@media (max-width: 640px) { .ext-cards { grid-template-columns: 1fr; } }

/* Status tab: transfer server cards */
.st-note { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted-foreground); }
.srv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: .75rem; }
.srv-card { min-width: 0; }
.srv-card .sc-h { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.srv-card .sc-h .sp { flex: 1; }
.srv-card .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--danger); flex: none; }
.srv-card.on .dot { background: var(--success); }
.srv-card.off { opacity: .7; }
.srv-card .sc-mon { font-size: .75rem; padding: 0 .45rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }
.srv-card .sc-sub { color: var(--muted-foreground); font-size: .8125rem; overflow-wrap: anywhere; }
.sc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .75rem 0; }
.sc-stat { background: var(--muted); border-radius: var(--radius-md); padding: .45rem .6rem; min-width: 0; }
.sc-stat span { display: block; font-size: .6875rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .05em; }
.sc-stat b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.sc-stat em { display: block; font-style: normal; font-size: .72rem; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-line { font-size: .8125rem; margin: .2rem 0; overflow-wrap: anywhere; }
.sc-line > span { color: var(--muted-foreground); }
.sc-jobs { margin-top: .6rem; border-top: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent); padding-top: .5rem; display: grid; gap: .3rem; }
.sc-job { display: flex; gap: .5rem; font-size: .8125rem; align-items: baseline; min-width: 0; }
.sc-job .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-job .p { color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: tabular-nums; }
a.wk { text-decoration: none; color: inherit; }
@media (max-width: 640px) {
  .sc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-job { flex-direction: column; gap: 0; }
  .sc-job .p { white-space: normal; }
}

/* cover preview + crop tool (cover.js) */
.cover-slot:empty { display: none; }
.cover-slot { margin: 0 0 .75rem; }
.cover-card { display: flex; gap: .75rem; align-items: center; width: 100%; text-align: left; background: var(--card); color: var(--foreground); font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .5rem; cursor: pointer; }
.cover-card:hover { border-color: var(--ring); }
.cover-card.is-empty { cursor: default; }
.cover-card img { width: 10rem; aspect-ratio: 16 / 9; object-fit: contain; background: var(--muted); border-radius: var(--radius-sm); flex: none; }
.cover-meta { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.crop-modal { max-width: 72rem; padding: 1.25rem 1.5rem 1.25rem; overflow: auto; }
.crop-modal h2 { margin: 0 0 1rem; padding-right: 2.5rem; }
.crop-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1rem; align-items: start; }
.crop-stage { position: relative; justify-self: center; max-width: 100%; line-height: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; background: var(--muted); border-radius: var(--radius-sm); }
.crop-stage img { display: block; max-width: 100%; max-height: 64vh; pointer-events: none; }
.crop-rect { display: none; position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgb(0 0 0 / .55); cursor: move; }
.crop-rect i { position: absolute; width: 14px; height: 14px; background: #fff; border: 1px solid #000; border-radius: 3px; }
.crop-rect i[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-rect i[data-h="n"] { left: calc(50% - 7px); top: -8px; cursor: ns-resize; }
.crop-rect i[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-rect i[data-h="e"] { right: -8px; top: calc(50% - 7px); cursor: ew-resize; }
.crop-rect i[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-rect i[data-h="s"] { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.crop-rect i[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-rect i[data-h="w"] { left: -8px; top: calc(50% - 7px); cursor: ew-resize; }
@media (pointer: coarse) { .crop-rect i { width: 22px; height: 22px; } .crop-rect i[data-h="n"], .crop-rect i[data-h="s"] { left: calc(50% - 11px); } .crop-rect i[data-h="e"], .crop-rect i[data-h="w"] { top: calc(50% - 11px); } }
.crop-side { display: flex; flex-direction: column; gap: .5rem; }
.crop-side canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.crop-stats { font-size: .875rem; line-height: 1.5; }
.crop-stats .warn { color: var(--warning); }
.crop-foot { margin-top: 1rem; }
@media (max-width: 760px) { .crop-modal { padding: .875rem .75rem; } .crop-wrap { grid-template-columns: 1fr; } .crop-stage img { max-height: 50vh; } .cover-card img { width: 7.5rem; } }

/* Pipeline stage pills (replaces the stage dropdown) */
.stage-pills { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0 0 .75rem; }
.spill { display: inline-flex; align-items: center; gap: .375rem; height: 2rem; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted-foreground); font: inherit; font-size: .8125rem; cursor: pointer; white-space: nowrap; }
.spill:hover { color: var(--foreground); border-color: var(--muted-foreground); }
.spill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.spill.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.spill.sub { border-style: dashed; }
.spill.on.sub { border-style: solid; }
.spill .n { font-size: .6875rem; font-variant-numeric: tabular-nums; opacity: .75; }
@media (max-width: 640px) { .stage-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -.75rem .625rem; padding: 0 .75rem; } .stage-pills::-webkit-scrollbar { display: none; } .spill { height: 2.25rem; } }


/* ── Latest list as cards on phones (2026-11-11): cover beside title/version, then status, then tools + done ── */
.st-tools { display: none; }
.tbl .pill.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .25rem; }
.tbl .pill.tools .loadfrom { margin-left: .25rem; }
/* the done tick: a drawn box instead of the browser's white square */
.dn input { appearance: none; -webkit-appearance: none; display: inline-grid; place-content: center; border: 1.5px solid color-mix(in oklab, var(--foreground) 35%, var(--border)); border-radius: .375rem; background: transparent; transition: background .12s, border-color .12s; }
.dn input::before { content: ""; width: .7em; height: .7em; transform: scale(0); transition: transform .12s; background: var(--background);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.dn input:checked { background: var(--success); border-color: var(--success); }
.dn input:checked::before { transform: scale(1); }
.dn input:hover { border-color: var(--foreground); }
.dn input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
@media (max-width: 640px) {
  /* nav: brand + profile/actions on top, the views on their own swipeable row underneath */
  :root { --nav-h: 5.75rem; }
  /* only the views row stays pinned: the brand/profile row (3.125rem) scrolls away with the page */
  .nav { height: auto; background: var(--background); backdrop-filter: none; top: calc(-3.125rem - env(safe-area-inset-top)); }
  .lz-lines-h { top: 2.625rem !important; }
  #logLines { scroll-margin-top: 3.125rem !important; }
  .nav-inner { flex-wrap: wrap; height: auto; row-gap: 0; padding: 0 .75rem; }
  .nav-inner > .brand, .nav-actions { height: 3.125rem; }
  .nav-actions { margin-left: auto; }
  .nav-links { order: 3; flex: 1 1 100%; height: 2.625rem; margin: 0 -.75rem; padding: 0 .5rem; gap: .25rem; align-items: center;
    border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent); mask-image: none; -webkit-mask-image: none; scroll-padding-inline: .5rem; }
  .nav-links a { height: 2rem; padding: 0 .75rem; font-size: .875rem; }
  #profileChip { max-width: 9.5rem; }

  /* toolbar: add box, then search, then the page line */
  #view-latest .toolbar .lat-q { order: 1; height: 2.75rem; }
  #view-latest .toolbar > #latestStat { order: 2; min-width: 0; line-height: 1.5; }
  #view-latest .toolbar > .btn-ghost { order: 3; }

  /* cards: cover | title, version, status + tools | play/open, done */
  #latestBody tr { grid-template-columns: 5.5rem minmax(0, 1fr) auto; grid-template-areas: "cv t act" "cv v act" "cv st dn";
    column-gap: .75rem; row-gap: 0; padding: .75rem 0; align-items: start; }
  #latestBody td { margin: 0; }
  #latestBody td.c-cv { grid-area: cv; }
  #latestBody .cv { width: 5.5rem; height: 3.1rem; border-radius: var(--radius-md); }
  #latestBody td.c-t { grid-area: t; display: block; }
  #latestBody td.c-t .t { font-size: .9375rem; line-height: 1.3; font-weight: 600; }
  #latestBody td.c-t .tools, #latestBody td.c-unm { display: none; }
  #latestBody td.v { grid-area: v; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .625rem; margin-top: .125rem; font-size: .75rem; }
  #latestBody td.v > div { display: contents; }
  #latestBody td.v .lzid { min-height: 1.5rem; margin: 0; }
  #latestBody td.c-st { grid-area: st; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .375rem; margin-top: .375rem; }
  #latestBody td.c-st .badge, #latestBody td.c-st .st-stage { margin: 0; }
  #latestBody .st-tools { display: inline-flex; align-items: center; gap: .125rem; }
  #latestBody .st-tools .f95copy { border: 0; padding: 0; background: none; min-height: 1.75rem; min-width: 1.75rem; justify-content: center; opacity: .8; }
  #latestBody .st-tools .f95copy:hover, #latestBody .st-tools .f95copy:active { opacity: 1; color: var(--foreground); }
  #latestBody .st-tools .f95copy:not(.cpchip) { padding: 0 .125rem; }
  #latestBody td.c-act { grid-area: act; flex-direction: row; gap: .25rem; padding: 0; align-self: start; justify-content: flex-end; }
  #latestBody td.c-act .btn-icon.btn-sm { width: 2.5rem; height: 2.5rem; }
  #latestBody td.c-act .btn-ghost { border: 1px solid var(--border); }
  #latestBody td.c-done { grid-area: dn; align-self: center; justify-content: center; padding: .375rem 0 0; }
  #latestBody .c-done .dn-wrap { flex-direction: row-reverse; gap: .375rem; }
  #latestBody .dn input { width: 1.5rem; height: 1.5rem; }
  #latestBody .dn-who { max-width: 6rem; font-size: .75rem; text-align: right; }
  #latestBody td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  #latestBody tr.sk { grid-template-areas: none; }
}


/* ── Status → Editors graph (web/js/edchart.js). Categorical slots in fixed order, validated against each theme's
   card surface (dataviz reference palette: dark steps for grey/dark, light steps for light) ── */
html, html.main, html.dark { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s-other: oklch(0.6 0 0); }
html.light { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s-other: oklch(0.65 0 0); }
.ed-chart { padding: .75rem .875rem .875rem; margin-bottom: .25rem; min-width: 0; }
.ec-head { display: flex; gap: 1.25rem; align-items: baseline; margin-bottom: .25rem; }
.ec-kpi { color: var(--muted-foreground); font-size: .8125rem; }
.ec-kpi b { color: var(--foreground); font-size: 1.375rem; font-weight: 600; margin-right: .3rem; font-variant-numeric: tabular-nums; }
.ec-plot { position: relative; }
.ec-plot svg { display: block; overflow: visible; }
.ec-grid { stroke: var(--border); stroke-opacity: .45; stroke-width: 1; }
.ec-ax { fill: var(--muted-foreground); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ec-ax.ec-today { fill: var(--foreground); font-weight: 600; }
.ec-tot { fill: var(--muted-foreground); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ec-hit { fill: var(--foreground); fill-opacity: 0; cursor: pointer; }
.ec-hit.on { fill-opacity: .06; }
.ec-tip { position: absolute; z-index: 3; min-width: 9.5rem; pointer-events: none; padding: .5rem .625rem; border-radius: var(--radius-lg);
  background: var(--popover, var(--card)); border: 1px solid var(--border); box-shadow: 0 8px 24px rgb(0 0 0 / .25); font-size: .8125rem; }
.ec-tt { font-weight: 600; }
.ec-tip .hint { margin-bottom: .25rem; }
.ec-tr { display: flex; align-items: center; gap: .45rem; line-height: 1.6; }
.ec-tr i, .ec-lg i { width: .625rem; height: .625rem; border-radius: 3px; flex: none; }
.ec-tr span { flex: 1; color: var(--muted-foreground); }
.ec-tr b { font-variant-numeric: tabular-nums; }
.ec-tr.ec-sum { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .2rem; }
.ec-legend { display: flex; flex-wrap: wrap; gap: .375rem 1rem; margin-top: .5rem; font-size: .8125rem; }
.ec-lg { display: inline-flex; align-items: center; gap: .375rem; }
.ec-lg b { font-weight: 500; }
.ec-lg span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ec-lg em { font-style: normal; font-size: .75rem; color: var(--muted-foreground); }
@media (max-width: 640px) { .ed-chart { padding: .625rem .625rem .75rem; } .ec-legend { gap: .375rem .875rem; } }


/* ── phone UX pass (2026-11-12): list cards everywhere, wizard footer, Jobs, Logs, Status ── */
@media (max-width: 640px) {
  /* Pipeline / Links / Review: card rows like Latest */
  .tbl tbody tr.lcard { display: block; padding: .75rem 0; }
  .tbl tbody tr.lcard::after { display: none !important; }
  .tbl tr.lcard > td { display: block; padding: 0; }
  .lc { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); column-gap: .75rem; align-items: start; }
  .lc-cv { width: 5.5rem; height: 3.1rem; border-radius: var(--radius-md); object-fit: cover; background: var(--muted); display: block; }
  .lc-main { min-width: 0; }
  .lc-top { display: flex; align-items: baseline; gap: .5rem; }
  .lc-t { flex: 1; min-width: 0; font-size: .9375rem; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .lc-ago { flex: none; font-size: .6875rem; color: var(--muted-foreground); white-space: nowrap; }
  .lc-v { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .625rem; margin-top: .125rem; font-size: .75rem; color: var(--muted-foreground); }
  .lc-ver { font-family: var(--font-mono); }
  .lc-v .lzid { margin: 0; min-height: 1.5rem; }
  .lc-g .pill, .lc-g { font-size: .75rem; }
  .lc-st { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .375rem; margin-top: .375rem; }
  .lc-st .badge, .lc-st .stage { margin: 0; }
  .lc-err { margin-top: .25rem; font-size: .75rem; color: var(--danger); }
  .lc .st-tools, #latestBody .st-tools { display: inline-flex; align-items: center; gap: .125rem; }
  .lc .st-tools .f95copy { border: 0; padding: 0 .125rem; background: none; min-height: 1.75rem; min-width: 1.75rem; justify-content: center; opacity: .8; }

  /* wizard footer: secondary actions share one row, the main action gets its own full-width row (no overlap) */
  .wz-foot { flex-wrap: wrap; row-gap: .375rem; }
  .wz-foot > span[style*="flex:1"], .wz-foot > span[style*="flex: 1"] { display: none; }
  .wz-foot .btn { flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wz-foot > .btn-primary, .wz-foot > .pubwrap { flex: 1 1 100%; order: 10; }
  .wz-foot > .pubwrap { display: flex; }
  .wz-foot > .pubwrap .btn { flex: 1 1 0; }
  /* group cards: the platform pills stay on one swipeable row */
  .grp-head .tabsel { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .grp-head .tabsel::-webkit-scrollbar { display: none; }
  .grp-head .tabsel label { flex: none; }
  .wz-body input[type=checkbox] { accent-color: var(--foreground); }

  /* Jobs: one card per game, its files separated by lines instead of nested boxes */
  .jgame { padding: .625rem .75rem; }
  .jg-rows { gap: 0; }
  .jrow { border: 0; border-radius: 0; border-top: 1px solid var(--border); padding: .625rem 0 .5rem; }
  .jg-rows .jrow:first-child { border-top: 0; padding-top: .375rem; }
  .jr-actions { justify-content: flex-end; }
  .jr-actions .btn { height: 2.25rem; font-size: .8125rem; padding: 0 .75rem; }

  /* Logs: the profile filter is one swipeable row */
  .ptabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .125rem; }
  .ptabs::-webkit-scrollbar { display: none; }
  .ptabs .ptab { flex: none; }

  /* section headings: the note goes on its own line */
  .jsec { flex-wrap: wrap; row-gap: .125rem; }
  .jsec .st-note { flex-basis: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .75rem; }
}

/* shared F95 account sheet in the profile window */
.f95sheet { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.f95sheet summary { cursor: pointer; font-weight: 600; }
.f95list { display: grid; }
.f95row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .375rem 0; border-bottom: 1px solid var(--border); font-size: .8125rem; color: var(--foreground); }
.f95row:last-child { border-bottom: 0; }
.f95row .u, .f95row .p { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.f95row .u b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f95row .cpchip { flex: none; }
.f95row .pw { cursor: pointer; font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f95row .s { justify-self: end; }
.f95row .badge { cursor: pointer; border: 0; }
.f95row.banned .u, .f95row.banned .p { opacity: .45; }
.f95row.banned .u b { text-decoration: line-through; }
@media (max-width: 640px) {
  .f95row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "u s" "p s"; row-gap: .125rem; padding: .5rem 0; }
  .f95row .u { grid-area: u; } .f95row .p { grid-area: p; } .f95row .s { grid-area: s; }
}
.f95add { display: grid; grid-template-columns: 1fr 1fr auto; gap: .375rem; margin-top: .5rem; }
@media (max-width: 640px) { .f95add { grid-template-columns: 1fr; } }

/* search hit: position in the latest list, and the row it jumps to */
.pchip.lpos { font-variant-numeric: tabular-nums; color: var(--foreground); border-color: color-mix(in oklab, var(--foreground) 35%, transparent); }
/* a colourful snake runs round the row a search jumped to (Latest.snake) */
.lz-snake { position: fixed; pointer-events: none; z-index: 40; overflow: visible; }
.lz-snake rect { fill: none; stroke: url(#lzSnakeGrad); stroke-linecap: round; }
.lz-snake .s1 { stroke-width: 2.25; }
.lz-snake .s2 { stroke-width: 2; opacity: .45; }
.lz-snake .s3 { stroke-width: 1.5; opacity: .18; }
.lz-snake.out { opacity: 0; transition: opacity .4s; }
