/* ============================================================
   Jellystructure — production design system
   Dark-primary with a light toggle · Aurora visual direction
   Accent: Jellyfin-style purple→blue gradient
   Type: Space Grotesk (display) · Sora (UI) · JetBrains Mono (code)
   All legacy token + class names preserved so page markup styles
   itself with zero edits.
   ============================================================ */

/* FR-167-3 — self-hosted, not a Google Fonts @import. The CSP's style-src/font-src are both 'self'
   (Server.kt), which was silently blocking the old @import and its fonts.gstatic.com files in any
   CSP-enforcing browser — the whole documented type system was falling back to system fonts with no
   visible error. Each family below is a single variable-font woff2 (Google serves one file covering the
   full weight axis; the repeated @font-face blocks per weight are Google's own CSS shape, kept
   identical here for the same browser-compatibility reasons, not a copy-paste mistake). Files live in
   design/app/fonts/, wired into syncDesignAssets + wasmJsBrowserDistribution's copy list
   (build.gradle.kts) and the Dockerfile build same as flags/**. Fenced in
   scripts/check-mobile-css.sh so a design-project sync can't silently revert this to the @import. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/sora.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/sora.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/sora.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/sora.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/space-grotesk.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/space-grotesk.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/space-grotesk.woff2') format('woff2');
}

/* ---------- TOKENS ---------- */
:root {
  /* accent (shared across themes/directions) */
  --acc-a: #b15cd0;            /* magenta-violet  */
  --acc-b: #00a4dc;            /* jellyfin blue   */
  --grad:  linear-gradient(122deg, var(--acc-a) 0%, #7b6ef0 48%, var(--acc-b) 100%);
  --hi:        #7b6ef0;        /* unified solid accent */
  --hi-soft:   rgba(123,110,240,.16);
  --acc-ink:   #c6bcfb;        /* accent text on tinted bg (dark) */

  /* semantic status */
  --bad:  #ff6f61;  --bad-soft:  rgba(255,111,97,.15);
  --ok:   #2dd49a;  --ok-soft:   rgba(45,212,154,.15);
  --info: #3fb6f5;  --info-soft: rgba(63,182,245,.15);
  --warn: #f5b542;  --warn-soft: rgba(245,181,66,.15);

  /* surfaces — DARK (default) · "Soft Charcoal" comfort palette:
     lifted floor (no near-black glare) + dimmed ink + lighter card surfaces */
  --bg:      #16181f;
  --bg-2:    #1a1d25;
  --paper:   var(--bg);
  --paper-2: var(--bg-2);
  --fill:    #262a37;
  --fill-2:  #20242f;
  --fill-3:  #2f3441;
  --ink:     #dde1ec;
  --ink-soft:#9aa0b4;
  --ink-dim: rgba(221, 225, 236, 0.32);
  --line:    rgba(255,255,255,.08);
  --line-2:  rgba(255,255,255,.14);

  /* shape / depth */
  --radius:   16px;
  --radius-s: 10px;
  --shadow:   0 10px 34px rgba(0,0,0,.42);
  --shadow-s: 0 4px 16px rgba(0,0,0,.32);
  --card-bg:  rgba(46,51,66,.74);
  --card-bd:  1px solid var(--line);
  --blur:     blur(16px) saturate(125%);
  --ambient:  1;   /* aurora glows on */
}

/* ---------- LIGHT THEME ---------- */
[data-theme="light"] {
  --bg:      #eef0f6;
  --bg-2:    #e7eaf2;
  --fill:    #ffffff;
  --fill-2:  #f3f5fa;
  --fill-3:  #eceff6;
  --ink:     #181a22;
  --ink-soft:#5d6378;
  --ink-dim: rgba(15, 17, 26, 0.25);
  --line:    rgba(20,22,32,.10);
  --line-2:  rgba(20,22,32,.16);
  --acc-ink: #6240cf;
  --card-bg: rgba(255,255,255,.74);
  --shadow:   0 12px 34px rgba(40,44,70,.14);
  --shadow-s: 0 4px 14px rgba(40,44,70,.10);
}

* { box-sizing: border-box; }

/* suppress transitions during initial appearance boot (set by app-shell.js) */
html[data-booting] *, html[data-booting] *::before, html[data-booting] *::after { transition: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ambient aurora field (aurora dir only) */
body.wf-body {
  min-height: 100vh;
  position: relative;
}
body.wf-body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--ambient);
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(177,92,208,.16), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(0,164,220,.14), transparent 55%),
    radial-gradient(700px 600px at 50% 120%, rgba(123,110,240,.10), transparent 60%);
  transition: opacity .4s ease;
}

h1,h2,h3,h4 {
  font-family: 'Space Grotesk', 'Sora', sans-serif;
  font-weight: 600; margin: 0 0 .3em; line-height: 1.12; letter-spacing: -.01em;
}
p { margin: 0 0 .7em; }
a { color: var(--acc-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: .84em; }

/* ---------- generic surfaces ---------- */
.box, .card {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: var(--card-bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 16px;
}
.card.flat, .box.flat { box-shadow: none; background: var(--fill-2); -webkit-backdrop-filter:none; backdrop-filter:none; }

.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 14px; }
.row.wrap { flex-wrap: wrap; }
.row.center { align-items: center; }
.col { display: flex; flex-direction: column; gap: 16px; }
.fill { flex: 1; }
.spacer { flex: 1; }
.muted { color: var(--ink-soft); }
.tiny { font-size: .8rem; }
.center-x { text-align: center; }
hr.dash { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
/* Settings tabbed layout — one panel visible at a time, ?tab= addressable (Phase 55) */
.set-section[data-tab] { display: none; }
.set-section[data-tab].tab-show { display: block; }
/* Tag cards + colour swatch picker (Phase 82 / FR-TG3) */
.tag-card { display: flex; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer; }
.tag-dot-lg { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }
/* Audio-language flag strip — pagebar (Phase 87) + Ravilo detail (R75) */
.audio-flags { display: inline-flex; align-items: center; gap: 7px; }
.audio-flags .af-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-dim); font-weight: 600; }
.audio-flags .af-row { display: inline-flex; align-items: center; gap: 5px; }
.audio-flags .fi { width: 21px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px var(--line-2), 0 1px 3px rgba(0,0,0,.3); background-size: cover; background-position: center; }
.audio-flags .af-more { font-size: .68rem; font-weight: 600; color: var(--ink-soft); background: var(--fill-3); padding: 1px 7px; border-radius: 20px; line-height: 1.5; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scrollbox { max-height: 460px; overflow: auto; }

/* ---------- buttons ---------- */
.btn {
  font-family: 'Sora', sans-serif; font-weight: 600; font-size: .9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 15px; background: var(--fill-3); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, filter .2s ease;
}
.btn:hover { border-color: var(--hi); box-shadow: 0 0 0 3px var(--hi-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--grad); color: #fff; border: 1px solid transparent;
  box-shadow: 0 6px 18px rgba(123,110,240,.35);
}
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 8px 24px rgba(123,110,240,.5); }
.btn.bad { background: var(--bad); color: #fff; border-color: transparent; }
.btn.bad:hover { box-shadow: 0 0 0 3px var(--bad-soft); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--fill-3); color: var(--ink); box-shadow: none; }
.btn.sm { padding: 5px 11px; font-size: .8rem; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: .76rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); text-transform: uppercase; }
.field .hint { font-size: .76rem; color: var(--ink-soft); }
.input, .select {
  background: var(--fill-2); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  padding: 9px 12px; font-family: 'Sora', sans-serif; font-size: .9rem; color: var(--ink);
  min-height: 38px; display: flex; align-items: center; gap: 8px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:hover, .select:hover { border-color: var(--line-2); }
.input.ph { color: var(--ink-soft); cursor: text; }
.select { justify-content: space-between; cursor: pointer; }
.select::after { content: '⌄'; margin-left: auto; color: var(--ink-soft); font-size: 1.1em; line-height: 1; }

/* toggle */
.toggle { width: 44px; height: 25px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--fill-3);
  position: relative; display: inline-block; cursor: pointer; flex: none; transition: background .2s ease, border-color .2s ease; }
.toggle::after { content:''; position: absolute; top: 2px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--ink-soft); transition: left .2s ease, background .2s ease; }
.toggle.on { background: var(--grad); border-color: transparent; }
.toggle.on::after { left: auto; right: 3px; background: #fff; }

/* segmented */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; background: var(--fill-2); }
.seg span { padding: 6px 13px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--ink-soft);
  border-right: 1px solid var(--line); transition: background .2s ease, color .2s ease; }
.seg span:last-child { border-right: 0; }
.seg span:hover { color: var(--ink); }
.seg span.on { background: var(--hi-soft); color: var(--acc-ink); }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
  padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--fill-2);
  color: var(--ink); white-space: nowrap; transition: border-color .2s ease, background .2s ease;
}
.chip.ghost { background: transparent; border-style: dashed; color: var(--ink-soft); cursor: pointer; }
.chip.sugg { cursor: pointer; }
.chip.sugg:hover, .chip.ghost:hover { border-color: var(--hi); color: var(--ink); }
/* accent-filled chips (markup uses inline background:var(--hi)) need light ink */
.chip[style*="--hi)"]:not([style*="soft"]) { color: #fff; border-color: transparent; }
/* Selected-filter-chip state — used by Library's ".active-chip" and Activity's ".act"
   modifiers. Neither had a design reference (not in any mockup) — matches the same
   selected treatment as .theme-seg button.on / .seg-pill button.on elsewhere.
   RESTORED 2026-07-31, again 2026-08-11 (6th occurrence total) after a design-tool sync silently reverted this — see
   the reference memory note on diffing design/app/*.css after every sync. */
.chip.active-chip, .chip.act { background: var(--hi-soft); color: var(--acc-ink); border-color: var(--hi); }

.badge { display: inline-flex; align-items:center; gap:5px; font-size: .72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 7px; border:1px solid transparent; white-space: nowrap; }
.badge.bad { background: var(--bad-soft); border-color: rgba(255,111,97,.4); color: var(--bad); }
.badge.ok  { background: var(--ok-soft);  border-color: rgba(45,212,154,.4); color: var(--ok); }
.badge.warn{ background: var(--warn-soft); border-color: rgba(245,181,66,.4); color: var(--warn); }
.badge.info{ background: var(--info-soft); border-color: rgba(63,182,245,.4); color: var(--info); }
[data-theme="light"] .badge.bad  { color: #c23b2d; }
[data-theme="light"] .badge.ok   { color: #128a5f; }
[data-theme="light"] .badge.warn { color: #9a6a06; }
[data-theme="light"] .badge.info { color: #1f7fb8; }

/* Phase 117/146 — dashboard "Needs your attention" breakdown grid. Same gap as .nav-group:
   the mockup's inline <style> (index.html) never made it into the shipped CSS files, so these
   rows rendered with zero styling — no card background/border, no hover, no severity coloring.
   RE-ADDED 2026-07 after a design-tool sync overwrote this file and silently dropped it, RESTORED
   AGAIN 2026-07-31, and AGAIN 2026-08-11 (6th sync-wipe event overall) — see the reference memory
   note on syncing before touching this block again. */
.attn-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 4px 0 2px; }
.abk { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--fill-2); text-decoration: none; color: var(--ink);
  cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.abk:hover { border-color: var(--hi); background: var(--hi-soft); text-decoration: none; }
.abk:active { transform: translateY(1px); }
.abk .abk-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.abk .abk-l b { font-family: 'Space Grotesk', sans-serif; font-size: .92rem; font-weight: 600; }
.abk .abk-l .d { font-size: .72rem; color: var(--ink-soft); line-height: 1.3; }
.abk .badge { flex: none; }
.abk.zero { opacity: .5; }
.abk.zero:hover { opacity: .8; }
@media (max-width: 640px) { .attn-breakdown { grid-template-columns: 1fr; } }

.lang { font-family: 'JetBrains Mono', monospace; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255,111,97,.7); }
.dot.ok  { background: var(--ok);  box-shadow: 0 0 8px rgba(45,212,154,.6); }
.dot.warn{ background: var(--warn); box-shadow: 0 0 8px rgba(245,181,66,.6); }
.dot.info{ background: var(--info); box-shadow: 0 0 8px rgba(63,182,245,.6); }
.dot.none{ background: transparent; border: 1px solid var(--line-2); box-shadow: none; }

/* ---------- image placeholder / posters ---------- */
.imgslot {
  background: linear-gradient(150deg, var(--fill-3), var(--fill-2));
  border: 1px solid var(--line); border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; font-size: .68rem;
  position: relative; overflow: hidden;
}
.imgslot::before {  /* faint film-strip / sheen */
  content: ''; position: absolute; inset: 0; opacity: .5;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(123,110,240,.16), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255,255,255,.03) 13px 14px);
}
.imgslot .x { display: none; }       /* retire the wireframe crosshatch */
.imgslot span { position: relative; padding: 3px 9px; border-radius: 20px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); letter-spacing: .03em; }
[data-theme="light"] .imgslot span { background: rgba(255,255,255,.7); color: var(--ink-soft); }

/* ---------- table ---------- */
.wf-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.wf-table th, .wf-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wf-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line-2); }
.wf-table tr:last-child td { border-bottom: 0; }
.wf-table tbody tr, .wf-table tr { transition: background .15s ease; }
.wf-table tr:hover td { background: var(--hi-soft); }
.wf-table tr.attn td { background: var(--bad-soft); }
.wf-table tr.attn:hover td { background: rgba(255,111,97,.22); }
.wf-table .num { font-family: 'JetBrains Mono', monospace; font-size: .82rem; }

/* ---------- progress ---------- */
.bar { height: 9px; border-radius: 20px; background: var(--fill-3); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 20px; transition: width .5s ease; }
.bar.ok > i { background: var(--ok); }

/* ---------- log / console ---------- */
.log {
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; line-height: 1.7;
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 12px 14px; overflow: auto; max-height: 220px;
}
[data-theme="light"] .log { background: #0e1018; color: #e7e9f2; }   /* keep terminals dark for contrast */
[data-theme="light"] .log .muted { color: #8d93a8; }
.log .ts { color: var(--ink-soft); } .log .warnc { color: var(--warn); } .log .badc { color: var(--bad); } .log .okc { color: var(--ok); }

/* Activity page — media-worker status dot + job-queue rows (design/app/activity.html,
   never shipped). Verified against the real markup directly: the mockup's .runpick/
   .rp-dot/.run-sel searchable-run-picker isn't implemented in the real Kotlin page at
   all, so those are intentionally NOT ported (nothing uses them — porting would be dead
   CSS, not a fix). RESTORED 2026-07-31, again 2026-08-11, after a design-tool sync silently reverted this. */
.wk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.wk-dot.busy { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.wk-dot.idle { background: var(--ink-dim); }
.jobs-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  padding: 0 5px; border-radius: 20px; background: var(--warn); color: #1a1204;
  font-size: .62rem; font-weight: 800; margin-left: 6px;
}
.jobrow { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px dashed var(--line); }
.jobrow:first-child { border-top: none; }
.jobrow.leaving { opacity: 0; transform: translateX(10px); transition: opacity .25s, transform .25s; }
.jq-pos {
  width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--fill-3); color: var(--ink-soft);
  font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.jq-ic { width: 22px; flex: none; text-align: center; font-weight: 800; }
.jq-ic.ok { color: var(--ok); } .jq-ic.bad { color: var(--bad); }
.jq-main { flex: 1; min-width: 0; }
.jq-title { font-size: .86rem; }
.jq-sub { font-size: .72rem; color: var(--ink-dim); margin-top: 2px; }

/* Ravilo config's hero-carousel row thumbnail (design/app/ravilo-config.html) — the
   element's own dynamic style= only sets `background`, so the box shape/overlay-label
   positioning still needs this. */
.hero-thumb { width: 92px; height: 52px; border-radius: 8px; flex: none; position: relative; overflow: hidden; }
.hero-thumb .t { position: absolute; left: 8px; bottom: 6px; font-family: 'Space Grotesk',sans-serif; font-weight: 700; font-size: .72rem; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* Settings > Metadata's age-rating region-cascade editor (#rc-list/.rc-add/.rc-menu) — reorder
   (drag or ▲▼), remove, add-from-catalog. Never had a design pass at all (no mockup, no shipped
   CSS) despite Phase 106 shipping the feature — related to but distinct from detail.css's
   .rc-trace/.rc-tr (the per-title cascade-resolution trace card on the media detail page; same
   "rc-" family/concept, different page and markup shape). ADDED 2026-07-31 — Settings.kt has no
   dedicated CSS file in syncDesignAssets' copy list, so this lives here alongside the dashboard/
   activity components above. */
.rc-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; padding: 0; list-style: none; }
.rc-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card-bg); border: var(--card-bd); border-radius: var(--radius-s);
  box-shadow: var(--shadow-s); cursor: grab; transition: border-color .15s ease, opacity .15s ease;
}
.rc-item.top { border-color: var(--hi); background: var(--hi-soft); }
.rc-item.dragging { opacity: .4; cursor: grabbing; }
.rc-item.drag-over { border-color: var(--hi); box-shadow: 0 0 0 2px var(--hi); }
.rc-grip { color: var(--ink-dim); font-size: 1.05rem; letter-spacing: -2px; flex: none; cursor: grab; }
.rc-item:active .rc-grip { cursor: grabbing; }
.rc-ord {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--fill-3); color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace; font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rc-item.top .rc-ord { background: var(--hi); color: #fff; }
.rc-item .rc-cc {
  font-family: 'JetBrains Mono', monospace; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  background: var(--fill-3); color: var(--ink); padding: 2px 7px; border-radius: 5px; flex: none;
}
.rc-name { font-weight: 600; font-size: .88rem; flex: none; white-space: nowrap; }
.rc-sys { font-size: .74rem; color: var(--ink-soft); flex: none; white-space: nowrap; }
.rc-scale { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 2px; }
.rc-scale span {
  font-family: 'JetBrains Mono', monospace; font-size: .66rem; color: var(--ink-dim);
  background: var(--fill-2); padding: 1px 6px; border-radius: 4px;
}
.rc-top-tag {
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--acc-ink); background: var(--hi-soft); padding: 2px 8px; border-radius: 20px; flex: none;
  white-space: nowrap;
}
.rc-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.rc-btn {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--ink-soft); font-size: .74rem; cursor: pointer; user-select: none;
  transition: background .15s ease, color .15s ease;
}
.rc-btn:hover { background: var(--fill-3); color: var(--ink); }
.rc-btn.dis { opacity: .3; pointer-events: none; }
.rc-btn.rm:hover { background: var(--bad-soft); color: var(--bad); }

.rc-add { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 260px; max-height: 320px; overflow: auto; padding: 6px; }
.rc-add.open .rc-menu { display: block; }
.rc-mi { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 7px; cursor: pointer; transition: background .15s ease; }
.rc-mi:hover { background: var(--fill-3); }
.rc-mi .rc-name { flex: 1; }

/* ---------- info note / callout ---------- */
.note {
  font-family: 'Sora', sans-serif; font-size: .9rem; line-height: 1.45;
  background: var(--hi-soft); color: var(--ink); padding: 12px 14px;
  border-radius: var(--radius-s); border: 1px solid var(--line-2);
}
.note.blue { background: var(--info-soft); border-color: rgba(63,182,245,.35); }
.note.red  { background: var(--bad-soft); border-color: rgba(255,111,97,.35); }
.note-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0; }
/* RaviloConfig's upload-failure notice — same red-alert treatment as .note.red, no
   reference anywhere (not in the mockup either); this is new, not a port.
   RESTORED 2026-07-31, again 2026-08-11, after a design-tool sync silently reverted this. */
.alert-bad {
  font-family: 'Sora', sans-serif; font-size: .85rem; line-height: 1.4;
  background: var(--bad-soft); color: var(--bad); padding: 10px 12px;
  border-radius: var(--radius-s); border: 1px solid rgba(255,111,97,.35);
}

/* floating toast (created by page scripts) */
.toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
  z-index: 200; font-family: 'Sora', sans-serif; font-weight: 600; font-size: .9rem;
  background: var(--grad); color: #fff; padding: 11px 18px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(123,110,240,.45); animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.callout { font-family: 'Sora', sans-serif; color: var(--ink-soft); display:inline-flex; align-items:center; gap:6px; }
.callout .arr { font-size: 1.7rem; color: var(--acc-ink); }

/* legend */
.legend { display:flex; gap:16px; flex-wrap:wrap; font-size:.82rem; align-items:center; margin: 4px 0 0; }
.legend span { display:flex; align-items:center; gap:6px; }

/* keyboard hint */
.kbd { font-family: 'JetBrains Mono', monospace; font-size:.72rem; border:1px solid var(--line-2); border-bottom-width:2px;
  border-radius:6px; padding:2px 7px; background:var(--fill-2); color: var(--ink-soft); }
.drag-handle { cursor: grab; color: var(--ink-soft); font-size: 1.05rem; letter-spacing: -2px; }

/* navitem (settings section list + legacy) */
.navitem {
  display: flex; align-items: center; gap: 9px; justify-content: space-between;
  padding: 9px 11px; border-radius: var(--radius-s); color: var(--ink-soft);
  text-decoration: none; font-size: .9rem; font-weight: 500; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.navitem:hover { background: var(--fill-3); color: var(--ink); text-decoration: none; }
.navitem.active { background: var(--hi-soft); color: var(--acc-ink); font-weight: 600; }
.group-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); padding: 13px 11px 5px; font-weight: 600; }

/* numbered step badge (Language Settings) */
.step-n { width: 28px; height: 28px; border-radius: 8px; background: var(--hi-soft); color: var(--acc-ink);
  font-weight: 700; font-family: 'Space Grotesk', sans-serif; display: inline-flex; align-items: center; justify-content: center;
  flex: none; font-size: .95rem; }
.step-n.alt { background: var(--fill-3); color: var(--ink-soft); }

/* =====================================================================
   SHARED COMPONENTS — restored (Phase: design-sync bug fix)
   These are multi-page components. wf.css is loaded by EVERY page in
   design/app/; a class absent from one page may still be used by another
   (media.html · series*.html · ravilo-config.html · settings.html · …).
   Before removing any rule below, grep the class across ALL design/app/*.html
   and only delete it if it appears in zero of them.
   ===================================================================== */

/* pagebar dropdown menus + split save button — media.html / series*.html */
.menu-wrap, .split { position: relative; display: inline-flex; }
.menu-btn { cursor: pointer; }
.caret { font-size: .7rem; opacity: .7; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 224px; z-index: 60; padding: 6px;
  background: var(--fill); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45); display: none; }
.menu-wrap.open > .menu, .split.open > .menu { display: block; }
.menu-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: 8px;
  font-size: .86rem; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.menu-item:hover { background: var(--fill-3); }
.menu-item .mi-ic { width: 16px; text-align: center; opacity: .7; flex: none; }
.menu-item .mi-sub { display: block; font-size: .72rem; color: var(--ink-soft); font-weight: 400; margin-top: 1px; }
.split .btn.primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .split-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 1px; padding-left: 9px; padding-right: 10px; }

/* config rows — ravilo-config.html (rows list) */
.cfg-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--fill-2); }
.cfg-row + .cfg-row { margin-top: 9px; }
.cfg-row.off { opacity: .5; }
.cfg-row .nm { font-weight: 600; }
.cfg-row .src { font-size: .76rem; color: var(--ink-soft); }

/* segmented pill — ravilo-config.html, ravilo-builders.js */
.seg-pill { display: inline-flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--fill-3); border: 1px solid var(--line); }
.seg-pill button { border: none; background: transparent; color: var(--ink-soft); font-family: 'Sora',sans-serif; font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg-pill button.on { background: var(--hi-soft); color: var(--acc-ink); box-shadow: inset 0 0 0 1px rgba(123,110,240,.3); }

/* scalable season picker (1 → 40+ seasons) — series*.html */
.season-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-step { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--fill-3); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.sp-step:hover { background: var(--hi-soft); border-color: var(--hi); color: var(--hi); }
.sp-step[disabled] { opacity: .35; pointer-events: none; }
.sp-btn { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--fill-3); cursor: pointer; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.sp-btn:hover { border-color: var(--hi); }
.sp-btn .cnt { font-family: 'Sora', sans-serif; font-weight: 500; font-size: .8rem; color: var(--ink-soft); }
.sp-btn .dot { margin-left: 2px; }
.sp-menu { position: absolute; z-index: 140; width: 320px; background: var(--fill); border: 1px solid var(--line-2); border-radius: var(--radius-s); box-shadow: var(--shadow); overflow: hidden; display: none; }
.sp-menu.open { display: block; }
.sp-search { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.sp-search input { flex: 1; border: none; background: transparent; color: var(--ink); font-family: 'Sora', sans-serif; font-size: .88rem; outline: none; }
.sp-list { max-height: 320px; overflow-y: auto; padding: 5px; }
.sp-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.sp-opt:hover, .sp-opt.active { background: var(--hi-soft); }
.sp-opt.cur { box-shadow: inset 0 0 0 1px var(--hi); }
.sp-opt .nm { font-weight: 600; font-family: 'Space Grotesk', sans-serif; }
.sp-opt .ec { margin-left: auto; font-size: .76rem; color: var(--ink-soft); }
.sp-opt .att { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }

/* Phase 76 — cast & crew: person cards, presence matrix, episode scope */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 14px; }
.person { position: relative; background: var(--fill-2); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; cursor: grab; }
.person.dragging { opacity: .4; }
.person .ph { position: relative; aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 600; letter-spacing: .03em; }
.person .pbody { padding: 9px 10px 11px; }
.person .pname { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.person .prole { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; cursor: text; min-height: 1.1em; }
.person .prole:hover { color: var(--ink); }
.person .prole-input { width: 100%; font-size: .8rem; padding: 2px 5px; }
.person .prm { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(8,10,16,.72); color: #fff; border: none; cursor: pointer; opacity: 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; transition: opacity .15s; }
.person:hover .prm { opacity: 1; }
.person .prm:hover { background: var(--bad); }
.person.add { display: flex; align-items: center; justify-content: center; min-height: 130px; border-style: dashed; color: var(--ink-soft); cursor: pointer; font-size: .85rem; }
.person.add:hover { color: var(--ink); border-color: var(--hi); }
.person.inh { opacity: .62; cursor: default; }
.person .gtag { position: absolute; top: 6px; left: 6px; font-size: .56rem; font-family: 'JetBrains Mono', monospace; padding: 1px 6px; border-radius: 5px; background: rgba(45,212,154,.22); color: #7ad7b0; z-index: 1; }
.person .ph .epb { position: absolute; bottom: 6px; left: 6px; font-size: .58rem; font-family: 'JetBrains Mono', monospace; padding: 1px 6px; border-radius: 5px; background: rgba(8,10,16,.78); color: #9ab6ff; z-index: 1; }
.person .ph .tag { position: absolute; bottom: 6px; left: 6px; font-size: .58rem; font-family: 'JetBrains Mono', monospace; padding: 1px 6px; border-radius: 5px; background: rgba(8,10,16,.78); color: var(--ink-soft); z-index: 1; }
.crew-dept { font-size: .72rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 6px; }
.crew-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.crew-row:last-child { border-bottom: none; }
.crew-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: #fff; }
.crew-name { font-weight: 600; font-size: .88rem; }
.crew-job { font-size: .78rem; color: var(--ink-soft); }
.crew-rm { margin-left: auto; cursor: pointer; color: var(--ink-dim); font-size: .82rem; padding: 3px 6px; border-radius: 5px; }
.crew-rm:hover { color: var(--bad); background: rgba(var(--bad-rgb, 231,76,60),.1); }
.matrix { width: 100%; border-collapse: collapse; font-size: .8rem; }
.matrix th { font-weight: 600; color: var(--ink-soft); font-size: .72rem; padding: 6px 4px; text-align: center; }
.matrix td { padding: 6px 4px; text-align: center; border-top: 1px solid var(--line); }
.matrix td.name { text-align: left; font-weight: 600; white-space: nowrap; padding-right: 12px; }
.matrix td.name .r { font-weight: 400; color: var(--ink-soft); font-size: .72rem; }
.matrix td.cell { cursor: pointer; }
.matrix td.cell:hover { background: var(--hi-soft); }
.ndot { width: 25px; height: 25px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.ndot.on { background: var(--hi); color: #fff; }
.ndot.g { background: var(--ok); color: #fff; }
.ndot.off { background: var(--fill-3); color: var(--ink-dim); font-size: .9rem; }
.dot.on { background: var(--hi); }
.dot.g { background: var(--ok); }
.dot.off { background: var(--fill-3); border: 1px solid var(--line-2); }
.mlegend { display: flex; gap: 16px; font-size: .72rem; color: var(--ink-soft); margin-top: 10px; align-items: center; flex-wrap: wrap; }
.mlegend span { display: flex; align-items: center; gap: 5px; }
.eppick { display: flex; flex-wrap: wrap; gap: 5px; }
.eppick button { padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--fill-2); color: var(--ink-soft); font-size: .78rem; cursor: pointer; }
.eppick button.on, .eppick button:hover { background: var(--hi-soft); border-color: var(--hi); color: var(--hi); }

/* pair-a-TV modal — ravilo-config.html */
.pair-back { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
  background: rgba(7,9,14,.66); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); padding: 30px; }
.pair-back.open { display: flex; }
.pair-modal { width: 440px; max-width: 100%; padding: 22px; position: relative; }
.pair-modal .x { cursor: pointer; color: var(--ink-dim); font-size: 1rem; }
.pair-modal .x:hover { color: var(--ink); }
.pair-tv-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--hi-soft); color: var(--acc-ink); }
.code-inputs { display: flex; gap: 8px; }
.code-inputs input { width: 46px; height: 56px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 1.5rem;
  font-weight: 600; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); color: var(--ink); }
.code-inputs input:focus { outline: none; border-color: var(--hi); box-shadow: 0 0 0 3px var(--hi-soft); }

/* ---------- scheduled scan pipeline (Phase 91) ---------- */
.pipe-sched { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.pipe-recipe { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pipe-recipe .rc { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.pipe-recipe .rc.off { filter: grayscale(.7); opacity: .5; text-decoration: line-through; }
.pipe-recipe .arrow { color: var(--ink-dim); font-size: .8rem; }
.pipe-canvas { transition: opacity .2s, filter .2s; }
.pipe-canvas.off { opacity: .42; pointer-events: none; filter: saturate(.45); }

.pipe-step { position: relative; display: flex; align-items: stretch; background: var(--fill-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, opacity .2s ease, transform .12s ease; }
.pipe-step::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.pipe-step:hover { box-shadow: var(--shadow-s); }
.pipe-step.dashed { border-style: dashed; }
.pipe-step.disabled { opacity: .5; }
.pipe-step.dragging { opacity: .35; }
.pipe-step.drop-target { box-shadow: 0 -3px 0 0 var(--hi); }
.pipe-step.running { border-color: var(--hi); box-shadow: 0 0 0 3px var(--hi-soft); }
.pipe-step.done::before { background: var(--ok); }

.pipe-grip { display: flex; align-items: center; padding: 0 3px 0 9px; color: var(--ink-dim);
  cursor: grab; font-size: 1.05rem; letter-spacing: -2px; flex: none; }
.pipe-grip:active { cursor: grabbing; }
.pipe-step.trigger .pipe-grip { cursor: default; opacity: .55; }
.pipe-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; flex: none; align-self: center; background: var(--c-soft); color: var(--c); }
.pipe-ic svg { width: 17px; height: 17px; }
.pipe-body { flex: 1; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.pipe-row1 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pipe-title { font-weight: 600; font-size: .92rem; }
.pipe-tag { font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--c); background: var(--c-soft); padding: 2px 7px; border-radius: 5px; }
.pipe-need { font-size: .62rem; font-weight: 700; color: var(--warn); background: var(--warn-soft);
  border: 1px solid rgba(245,181,66,.4); padding: 1px 7px; border-radius: 20px; }
.pipe-sub { font-size: .76rem; color: var(--ink-soft); line-height: 1.35; }
.pipe-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.pipe-opts:empty { display: none; }
.opt-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: var(--fill); }
.opt-seg span { padding: 3px 9px; font-size: .72rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  border-right: 1px solid var(--line); transition: background .15s, color .15s; }
.opt-seg span:last-child { border-right: 0; }
.opt-seg span:hover { color: var(--ink); }
.opt-seg span.on { background: var(--c-soft); color: var(--c); }
.opt-tog { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--ink-soft); cursor: pointer; }
.opt-step { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line-2); border-radius: 7px; padding: 2px 5px 2px 9px; cursor: pointer; user-select: none; }
.opt-step b { color: var(--ink); font-family: 'JetBrains Mono', monospace; }
.opt-step .nx { width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; background: var(--fill-3); }

/* first-step freshness policy */
.scan-cfg { flex: 1 0 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--fill); padding: 12px 13px; display: flex; flex-direction: column; }
.scan-cfg .sc-head { display: flex; align-items: center; gap: 9px; font-size: .86rem; cursor: pointer; }
.scan-cfg .sc-sub { font-size: .74rem; color: var(--ink-soft); line-height: 1.4; margin: 4px 0 10px 31px; }
.scan-cfg.off .fresh-tbl, .scan-cfg.off .sc-state { opacity: .4; pointer-events: none; }
.fresh-tbl { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; }
.fresh-hd { display: contents; }
.fresh-hd span { font-size: .62rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-dim);
  font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fresh-hd span:last-child { text-align: right; }
.fr-age { display: flex; align-items: baseline; gap: 9px; padding: 9px 0; }
.fr-age .nm { font-size: .82rem; font-weight: 600; color: var(--ink); }
.fr-age .yr { font-family: 'JetBrains Mono', monospace; font-size: .68rem; color: var(--ink-soft); }
.fr-cell { display: flex; justify-content: flex-end; padding: 9px 0; }
.fresh-tbl > .fr-age, .fresh-tbl > .fr-cell { border-bottom: 1px solid var(--line); }
.fresh-tbl > .fr-age:nth-last-child(2), .fresh-tbl > .fr-cell:last-child { border-bottom: 0; }
.cad { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 9px 5px 10px; cursor: pointer; user-select: none;
  background: var(--fill-2); transition: border-color .15s, box-shadow .15s; }
.cad:hover { border-color: var(--hi); box-shadow: 0 0 0 3px var(--hi-soft); }
.cad .ci { color: var(--hi); display: inline-flex; }
.cad .ci svg { width: 14px; height: 14px; }
.cad .cv { min-width: 96px; }
.cad .cx { color: var(--ink-dim); font-size: .68rem; }
.cad.never { color: var(--ink-soft); }
.cad.never .ci { color: var(--ink-dim); }
.sc-state { font-size: .7rem; color: var(--ink-dim); line-height: 1.5; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.sc-state b { color: var(--ink-soft); }

.pipe-act { display: flex; align-items: center; gap: 7px; padding: 0 11px; flex: none; }
.pipe-status { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
.pipe-status .spin { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--hi);
  border-radius: 50%; animation: pspin .7s linear infinite; }
.pipe-status .ck { color: var(--ok); }
@keyframes pspin { to { transform: rotate(360deg); } }
.pipe-x { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--ink-dim); cursor: pointer; font-size: .82rem; transition: background .15s, color .15s; }
.pipe-x:hover { background: var(--bad-soft); color: var(--bad); }

.pipe-conn { position: relative; display: flex; justify-content: center; height: 26px; }
.pipe-conn .ln { width: 2px; height: 100%; background: var(--line-2); }
.pipe-add { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg);
  color: var(--ink-soft); display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1.05rem; line-height: 0; opacity: 0; transition: opacity .15s, border-color .15s, color .15s, box-shadow .15s; }
.pipe-conn:hover .pipe-add { opacity: 1; }
.pipe-add:hover { border-color: var(--hi); color: var(--hi); box-shadow: 0 0 0 3px var(--hi-soft); }
.pipe-end { display: flex; justify-content: center; margin-top: 8px; }
.pipe-end .btn { border-style: dashed; }

/* block palette popover */
.blk-back { position: fixed; inset: 0; z-index: 200; display: none; }
.blk-back.open { display: block; }
.blk-pal { position: fixed; z-index: 201; width: 296px; max-height: 64vh; overflow: auto; display: none;
  background: var(--fill); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
.blk-pal.open { display: block; }
.blk-pal .pl-h { font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft);
  font-weight: 700; padding: 6px 8px 4px; }
.blk-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 9px; border-radius: var(--radius-s); cursor: pointer; }
.blk-item:hover { background: var(--hi-soft); }
.blk-item .pipe-ic { width: 30px; height: 30px; }
.blk-item .nm { font-weight: 600; font-size: .85rem; }
.blk-item .ds { font-size: .72rem; color: var(--ink-soft); line-height: 1.3; }
