/* Ad Factory dashboard.
   Look: a quiet work surface. Neutral canvas, white (or near-black) sheets, ink for actions, one blue for selection,
   links and charts. Yellow is kept for one meaning only: a person is needed. Green and red are states, never decoration.
   Two themes from the same tokens: light by default, dark with <html data-theme="dark">.
   Type: IBM Plex Sans + IBM Plex Sans Arabic. Logical properties throughout, so dir="rtl" mirrors the layout.
   Spacing steps: 4 8 12 16 24 32. Radii: 6 (controls), 10 (cards), 14 (dialogs). */
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-22FF; }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-22FF; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-22FF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  color-scheme: light;
  --floor: #F3F4F6; --floor-2: #E9EBEF; --paper: #FFFFFF; --paper-2: #F8F9FB;
  --ink: #10151B; --mute: #566170; --faint: #8590A0; --rule: #DADFE6; --rule-2: #E9ECF1;
  --door: #10151B; --door-ink: #F4F6F8; --door-mute: #9AA4B1; --door-line: rgba(255, 255, 255, .2);   /* the sign-in screen's dark side */
  --strong: #10151B; --on-strong: #FFFFFF; --strong-2: #2A323D;          /* primary buttons, selected segments */
  --accent: #2F5BFF; --accent-2: #1E44D9; --accent-tint: #E9EEFF; --on-accent: #FFFFFF; --link: #1E44D9;
  --hivis: #FFD21F; --hivis-2: #FFF6CC; --hivis-ink: #2B2500;
  --stop: #CE2440; --stop-tint: #FCE9EC; --stop-ink: #84152A; --go: #0C8459; --go-tint: #DEF4EA; --go-ink: #0A5239;
  --series: #2F5BFF; --series-soft: rgba(47, 91, 255, .12); --grid: #E4E8EE;
  --scrim: rgba(16, 21, 27, .45); --glass: rgba(243, 244, 246, .9); --code: #10151B; --code-ink: #D9DEE6;
  /* the names the screens were first written with */
  --petrol: var(--strong); --petrol-2: var(--accent); --petrol-3: var(--accent); --petrol-tint: var(--accent-tint);
  --text: "Plex", "Plex Arabic", system-ui, sans-serif; --head: var(--text);
  --r: 6px; --r2: 10px; --r3: 14px; --rail: 252px; --top: 56px;
  --lift: 0 1px 2px rgba(16, 21, 27, .06), 0 12px 32px rgba(16, 21, 27, .12);
  --edge: 0 1px 2px rgba(16, 21, 27, .05);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --floor: #0C0F13; --floor-2: #1B2028; --paper: #14181E; --paper-2: #191E25;
  --ink: #EDF0F4; --mute: #A2ACB9; --faint: #6F7A88; --rule: #2A313B; --rule-2: #20262E;
  --door: #07090C; --door-ink: #F4F6F8; --door-mute: #8E98A6; --door-line: rgba(255, 255, 255, .16);
  --strong: #EDF0F4; --on-strong: #10151B; --strong-2: #FFFFFF;
  --accent: #7C97FF; --accent-2: #9DB1FF; --accent-tint: #1B2547; --on-accent: #0C0F13; --link: #8FA6FF;
  --hivis: #FFD21F; --hivis-2: #2F290C; --hivis-ink: #2B2500;
  --stop: #FF6F84; --stop-tint: #3A161D; --stop-ink: #FFB3BE; --go: #3CCB93; --go-tint: #11342A; --go-ink: #9BE8C8;
  --series: #6B88FF; --series-soft: rgba(107, 136, 255, .18); --grid: #262C35;   /* validated against the dark surface (dataviz validator) */
  --scrim: rgba(0, 0, 0, .6); --glass: rgba(12, 15, 19, .88); --code: #090B0E; --code-ink: #D9DEE6;
  --lift: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .5);
  --edge: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--floor); color: var(--ink); font-family: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 600; margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; letter-spacing: -.012em; }
h2 { font-size: 1.13rem; }
h3 { font-size: 1rem; }
[lang="ar"] h1 { letter-spacing: 0; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mute { color: var(--mute); }
.small { font-size: .87rem; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- shell: sidebar, top bar, page ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--paper); border-inline-end: 1px solid var(--rule); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 10px 10px 12px; gap: 6px; z-index: 9; }
.space { position: relative; }
.space-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: var(--r2); background: none; cursor: pointer; text-align: start; }
.space-btn:hover, .space-btn[aria-expanded="true"] { background: var(--floor); border-color: var(--rule-2); }
.space-btn .names { min-width: 0; flex: 1; display: grid; }
.space-btn b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.space-btn small { color: var(--mute); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-btn > .ic { color: var(--faint); rotate: 90deg; }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font-weight: 600; font-size: .95rem; color: #fff; background: hsl(var(--hue, 225) 62% 46%); text-transform: uppercase; }
.avatar.sm { width: 26px; height: 26px; border-radius: 7px; font-size: .78rem; }
.avatar.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 1.25rem; }
.space-menu { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r2); box-shadow: var(--lift); padding: 6px; z-index: 12; display: grid; gap: 2px; animation: rise .12s ease-out; min-width: 232px; }
.space-menu h3 { font-size: .78rem; font-weight: 500; color: var(--faint); padding: 6px 8px 4px; }
.space-menu button, .space-menu a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: start; text-decoration: none; color: var(--ink); width: 100%; }
.space-menu button:hover, .space-menu a:hover { background: var(--floor); }
.space-menu button .names { min-width: 0; flex: 1; display: grid; }
.space-menu button small { color: var(--mute); font-size: .76rem; }
.space-menu button > .ic { color: var(--accent); }
.space-menu hr { border: 0; border-top: 1px solid var(--rule-2); margin: 4px 0; width: 100%; }
.rail nav { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.rail nav a { color: var(--mute); text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 11px; position: relative; font-weight: 500; }
.rail nav a:hover { color: var(--ink); background: var(--floor); }
.rail nav a.on { color: var(--ink); background: var(--floor-2); }
.rail nav a.on .ic { color: var(--accent); }
.rail nav .sep { height: 1px; background: var(--rule-2); margin: 8px 6px; }
.rail .count { margin-inline-start: auto; background: var(--hivis); color: var(--hivis-ink); border-radius: 10px; min-width: 22px; text-align: center; font-size: .78rem; font-weight: 600; padding: 0 6px; }
.rail-foot { margin-top: auto; display: grid; gap: 6px; }
.linecard { border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 9px 11px; font-size: .84rem; display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: var(--paper-2); }
.linecard:hover { border-color: var(--rule); }
.linecard b { font-weight: 500; display: flex; align-items: center; gap: 7px; }
.linecard span { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linecard.pilot .ic { color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--go); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.body { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 8; background: var(--glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule-2); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .93rem; color: var(--mute); }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .ic { opacity: .5; }
[dir="rtl"] .crumbs .ic, [dir="rtl"] .flip { transform: scaleX(-1); }
.topbar .sp { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.searchbtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: var(--paper); border-radius: 8px; padding: 6px 10px; color: var(--mute); cursor: pointer; min-width: 220px; margin-inline-end: 6px; }
.searchbtn:hover { border-color: var(--faint); color: var(--ink); }
.searchbtn kbd { margin-inline-start: auto; font: inherit; font-size: .74rem; border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; background: var(--paper-2); }
.iconbtn { border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px; cursor: pointer; color: var(--mute); display: inline-flex; align-items: center; gap: 6px; }
.iconbtn:hover { background: var(--floor-2); color: var(--ink); }
.page { padding: 26px 28px 72px; width: 100%; max-width: 1400px; margin-inline: auto; }
.view-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.view-head .lede { color: var(--mute); margin-top: 4px; max-width: 72ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons, chips ---------- */
.btn { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 7px 14px; border-radius: var(--r); cursor: pointer; font-weight: 500; text-decoration: none; display: inline-flex; gap: 7px; align-items: center; justify-content: center; white-space: nowrap; line-height: 1.35; transition: background .12s, border-color .12s; box-shadow: var(--edge); }
.btn:hover { background: var(--paper-2); border-color: var(--faint); }
.btn.primary { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.btn.primary:hover { background: var(--strong-2); border-color: var(--strong-2); }
.btn.signal { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); font-weight: 600; }
.btn.signal:hover { background: #F2C400; border-color: #F2C400; }
.btn.danger { border-color: var(--stop); color: var(--stop); }
.btn.danger:hover { background: var(--stop-tint); }
.btn.danger.primary { background: var(--stop); color: #fff; }
:root[data-theme="dark"] .btn.danger.primary { color: #1A0509; }
.btn.quiet { border-color: transparent; background: transparent; padding-inline: 8px; box-shadow: none; color: var(--mute); }
.btn.quiet:hover { background: var(--floor-2); color: var(--ink); }
.btn.sm { padding: 3px 10px; font-size: .87rem; }
.btn.lg { padding: 10px 20px; font-size: 1.02rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.on-dark { background: transparent; color: var(--on-strong); border-color: currentColor; box-shadow: none; }
.btn.on-dark:hover { background: rgba(127, 127, 127, .2); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 11px; font-size: .8rem; font-weight: 500; background: var(--floor-2); color: var(--ink); white-space: nowrap; }
.chip.go { background: var(--go-tint); color: var(--go-ink); }
.chip.stop { background: var(--stop-tint); color: var(--stop-ink); }
.chip.wait { background: var(--hivis); color: var(--hivis-ink); }
.chip.run { background: var(--accent-tint); color: var(--accent-2); }
.chip.ghost { background: transparent; border: 1px solid var(--rule); color: var(--mute); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; min-width: 0; }
.field > span { font-weight: 500; font-size: .9rem; }
.field small { color: var(--mute); font-size: .82rem; }
.field input, .field select, .field textarea, .input { border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r); padding: 7px 10px; width: 100%; transition: border-color .12s, box-shadow .12s; }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover { border-color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--series-soft); }
.field input[readonly], .field textarea[readonly] { background: var(--paper-2); color: var(--mute); }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.toggle small { display: block; color: var(--mute); font-size: .82rem; }
.err { color: var(--stop); font-size: .9rem; margin: 6px 0; }
.note { background: var(--accent-tint); border-radius: var(--r); padding: 9px 12px; font-size: .9rem; margin-bottom: 14px; }
.note.warn { background: var(--hivis-2); }
.note.bad { background: var(--stop-tint); color: var(--stop-ink); }
.stepper { align-self: flex-start; display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
.stepper button { border: 0; background: none; width: 36px; height: 36px; cursor: pointer; font-size: 1.2rem; }
.stepper button:hover { background: var(--floor-2); }
.stepper b { min-width: 32px; text-align: center; font-size: 1.1rem; }
.seg { align-self: flex-start; display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; gap: 2px; background: var(--floor); }
.toolbar .seg { flex-wrap: wrap; max-width: 100%; }
.seg button { border: 0; background: none; padding: 4px 11px; cursor: pointer; color: var(--mute); font-weight: 500; border-radius: 6px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--edge); }

/* ---------- surfaces ---------- */
.panel { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--edge); }
.panel > h2 { margin-bottom: 10px; }
.panel > h2:has(+ .lede) { margin-bottom: 4px; }
.panel > .lede { color: var(--mute); font-size: .9rem; margin-bottom: 14px; max-width: 72ch; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel.flat { background: transparent; border-style: dashed; border-color: var(--rule); box-shadow: none; }
.split { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 22px; align-items: start; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.two > .panel, .pair > .panel { margin-bottom: 0; min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr)); gap: 18px; align-items: start; }
.empty { border: 1px dashed var(--rule); border-radius: var(--r2); padding: 38px 24px; text-align: center; color: var(--mute); display: grid; justify-items: center; gap: 6px; }
.empty .ic { color: var(--faint); margin-bottom: 4px; }
.empty h3 { color: var(--ink); }
.empty p { max-width: 56ch; }
.empty .btn { margin-top: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 13px; cursor: pointer; color: var(--mute); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .n { background: var(--floor-2); border-radius: 9px; padding: 0 7px; font-size: .78rem; }
.tabs .n.wait { background: var(--hivis); color: var(--hivis-ink); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pills button { border: 1px solid var(--rule); background: var(--paper); padding: 4px 12px; border-radius: 16px; cursor: pointer; color: var(--mute); font-weight: 500; }
.pills button:hover { color: var(--ink); border-color: var(--faint); }
.pills button.on { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.skel { background: linear-gradient(90deg, var(--floor-2) 25%, var(--rule-2) 45%, var(--floor-2) 65%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -150% 0; } }
.skel.textline { height: 14px; margin-bottom: 10px; }   /* not "line": that is the conveyor, 1090px wide */
.skel.block { height: 150px; border-radius: var(--r2); }

/* ---------- home: status board, get-started guide ---------- */
.today { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr minmax(180px, 1.3fr); background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2);
  box-shadow: var(--edge); margin-bottom: 12px; overflow: hidden; }
.today > * { padding: 16px 18px; display: grid; gap: 2px; align-content: start; color: var(--ink); text-decoration: none; border-inline-start: 1px solid var(--rule-2); min-width: 0; }
.today > :first-child { border-inline-start: 0; }
.today span { font-size: .84rem; color: var(--mute); font-weight: 500; }
.today b { font-size: 1.55rem; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today .lead b { font-size: 2.1rem; }
.today small { color: var(--faint); font-size: .8rem; }
.today a:hover { background: var(--paper-2); }
.today .spark { align-content: end; }
.today .spark svg { width: 100%; height: 54px; display: block; overflow: visible; }
.today .spark polyline { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.today .spark circle { fill: var(--series); }
.quickrow { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 2px 22px; font-size: .9rem; }
.quickrow a { color: var(--mute); text-decoration: none; }
.quickrow a:hover { color: var(--ink); }
.quickrow b { color: var(--ink); font-weight: 600; margin-inline-end: 3px; }
.rail nav .group { font-size: .72rem; color: var(--faint); padding: 2px 12px 4px; font-weight: 500; }
.rail nav a.minor { font-size: .88rem; padding-block: 6px; color: var(--mute); }
.rail nav a.minor.on { color: var(--ink); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.board a, .board div.cell { padding: 14px 16px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; align-content: start; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); box-shadow: var(--edge); }
.board a:hover { border-color: var(--rule); }
.board b { font-size: 1.75rem; line-height: 1.1; font-weight: 600; letter-spacing: -.01em; }
.board span { font-size: .9rem; font-weight: 500; }
.board small { color: var(--mute); font-size: .8rem; }
.board .hot { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.board .hot small { color: var(--hivis-ink); }
.guide { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--edge); }
.guide-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.bar { height: 6px; border-radius: 3px; background: var(--floor-2); overflow: hidden; margin-bottom: 12px; }
.bar i { display: block; height: 100%; background: var(--go); border-radius: 3px; transition: width .3s; }
.guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: g; }
.guide li { counter-increment: g; display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.guide li::before { content: counter(g); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; font-size: .82rem; font-weight: 600; color: var(--mute); flex: none; }
.guide li.done { color: var(--mute); }
.guide li.done::before { content: "✓"; background: var(--go); border-color: var(--go); color: var(--paper); }
.guide li.next { background: var(--hivis-2); }
.guide li.next::before { border-color: var(--hivis); color: var(--hivis-ink); background: var(--hivis); }
.guide li small { display: block; color: var(--mute); font-size: .82rem; }

/* ---------- the yellow band: things that wait for a person ---------- */
.needs { background: var(--hivis); color: var(--hivis-ink); border-radius: var(--r3); padding: 16px 18px 18px; margin-bottom: 24px; }
.needs h2 { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.needs .tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.needs .ticket { border-color: transparent; }

/* ---------- the line ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.line-wrap { overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; }
.line { display: grid; grid-template-columns: repeat(6, minmax(172px, 1fr)); gap: 0 10px; min-width: 1090px; position: relative; align-items: start; }
.station .more { display: block; text-align: center; padding: 7px; font-size: .87rem; font-weight: 500; text-decoration: none; border-radius: 8px; }
.station .more:hover { background: var(--paper); }
.station { background: var(--floor-2); border-radius: var(--r2); padding: 10px 8px 8px; }
.line.moving .station:has(.ticket[data-state="running"]) { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.station-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; }
.node { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); color: var(--mute); display: grid; place-items: center; font-weight: 600; font-size: .78rem; flex: none; }
.station.has .node { background: var(--strong); color: var(--on-strong); }
.station.live.has .node { background: var(--go); color: var(--paper); }
.station-head b { font-size: .93rem; font-weight: 600; }
.station-head .n { margin-inline-start: auto; color: var(--mute); font-size: .82rem; font-weight: 500; }
.station-head .n:empty { display: none; }
.station .tickets { display: grid; gap: 8px; min-height: 56px; }
.station .slot { border: 1px dashed var(--rule); border-radius: 8px; height: 48px; }

/* ---------- work ticket ---------- */
.ticket { background: var(--paper); border: 1px solid var(--rule-2); border-radius: 9px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; align-items: center; transition: box-shadow .12s, border-color .12s; box-shadow: var(--edge); }
a.ticket:hover { box-shadow: var(--lift); border-color: var(--rule); }
.ticket::before { content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
[dir="rtl"] .ticket::before { border-radius: 3px 0 0 3px; }
.ticket[data-state="waiting"]::before { background: var(--hivis); }
.ticket[data-state="failed"]::before { background: var(--stop); }
.ticket[data-state="done"]::before, .ticket[data-state="live"]::before { background: var(--go); }
.ticket[data-state="running"]::before { background: var(--accent); }
.ticket[data-state="running"]::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 24px); background-size: 24px 2px; animation: belt2 .7s linear infinite; }
@keyframes belt2 { to { background-position-x: 24px; } }
.ticket .pic { grid-row: span 2; width: 40px; height: 40px; border-radius: 7px; background: var(--floor-2) center / cover no-repeat; }
.ticket .t-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .t-note { grid-column: 2 / -1; font-size: .83rem; color: var(--mute); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ticket .t-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: .78rem; color: var(--faint); flex-wrap: wrap; }
.ticket .t-foot > span { white-space: nowrap; }
.station .ticket .t-foot .chip { display: none; }
.ticket .t-act { grid-column: 1 / -1; margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.steps5 { display: flex; gap: 3px; }
.steps5 i { width: 14px; height: 4px; border-radius: 2px; background: var(--rule); }
.steps5 i.done { background: var(--go); }
.steps5 i.running { background: var(--accent); }
.steps5 i.waiting { background: var(--hivis); }
.steps5 i.failed { background: var(--stop); }
.tag { min-width: 26px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--floor-2); color: var(--ink); display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; text-transform: uppercase; flex: none; }
.tag.lg { min-width: 54px; height: 54px; font-size: 1.5rem; border-radius: 12px; background: var(--strong); color: var(--on-strong); }

/* ---------- products ---------- */
.toolbar { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .find { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .find .ic { position: absolute; inset-inline-start: 10px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
.toolbar .find input { padding-inline-start: 34px; }
.toolbar select.input { width: auto; max-width: 100%; padding-inline-end: 28px; cursor: pointer; }
.toolbar .sp { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.pcard { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .12s, border-color .12s; box-shadow: var(--edge); }
.pcard:hover { box-shadow: var(--lift); border-color: var(--rule); }
.pcard .pic { aspect-ratio: 4 / 3; background: var(--floor-2) center / cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 2rem; font-weight: 600; text-transform: uppercase; position: relative; }
.pcard .pic .badge { position: absolute; top: 8px; inset-inline-start: 8px; text-transform: none; font-size: .78rem; background: var(--paper); color: var(--ink); box-shadow: var(--edge); }
.pcard .pic .badge.wait { background: var(--hivis); color: var(--hivis-ink); }
.pcard .body { padding: 11px 13px 12px; display: grid; gap: 3px; }
.pcard .name { font-weight: 600; }
.pcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); margin-top: auto; }
.pcard .stats div { padding: 8px 13px; display: grid; }
.pcard .stats div + div { border-inline-start: 1px solid var(--rule-2); }
.pcard .stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard .stats span { font-size: .74rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard.picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--series-soft); }
.pcard[disabled] { opacity: .55; }
.plist td .pic { width: 40px; height: 40px; border-radius: 8px; background: var(--floor-2) center / cover no-repeat; display: block; }
.plist td.who { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.plist td.who a { color: var(--ink); font-weight: 500; text-decoration: none; }
.plist td.who a:hover { text-decoration: underline; }
.plist td.who small { display: block; color: var(--mute); }
.phead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.phead .pic { width: 76px; height: 76px; border-radius: var(--r3); background: var(--floor-2) center / cover no-repeat; flex: none; border: 1px solid var(--rule-2); }
.phead .sp { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.clip { aspect-ratio: 3 / 4; border-radius: 8px; background: var(--floor-2) center / cover no-repeat; position: relative; overflow: hidden; border: 1px solid var(--rule-2); }
.clip span { position: absolute; inset-inline: 0; bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); color: #fff; font-size: .7rem; padding: 14px 6px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.clip i { position: absolute; top: 5px; inset-inline-start: 5px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 4px; padding: 2px; display: grid; }
.drop { border: 1.5px dashed var(--accent); border-radius: var(--r2); padding: 22px; text-align: center; color: var(--mute); cursor: pointer; margin-top: 14px; background: var(--accent-tint); display: grid; justify-items: center; gap: 6px; transition: background .12s; }
.drop:hover { filter: brightness(.98); }
.drop.over { background: var(--hivis); color: var(--hivis-ink); border-color: var(--hivis-ink); }
.renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.render { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); overflow: hidden; box-shadow: var(--edge); }
.render .strip { display: block; width: 100%; aspect-ratio: 8 / 2; object-fit: cover; background: var(--floor-2); border: 0; padding: 0; cursor: pointer; position: relative; }
.render .strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.render .strip .playico { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0); opacity: 0; transition: opacity .12s, background .12s; }
.render .strip:hover .playico, .render .strip:focus-visible .playico { opacity: 1; background: rgba(0, 0, 0, .35); }
.render .bar2 { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.render .bar2 .small { white-space: nowrap; }
.render .bar2 .sp { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }
.starbtn { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--faint); display: grid; }
.starbtn:hover { background: var(--floor-2); color: var(--ink); }
.starbtn.on { color: #C79A00; }
.starbtn.on svg { fill: var(--hivis); }

/* ---------- one ad ---------- */
.adhead { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.adhead > .grow { flex-basis: 240px; }
.adhead .angle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 90ch; }
.tracker { display: flex; margin: 20px 0 22px; counter-reset: st; overflow-x: auto; }
.tracker .st { flex: 1; min-width: 120px; position: relative; padding-top: 38px; font-size: .9rem; }
.tracker .st::before { counter-increment: st; content: counter(st); position: absolute; top: 0; inset-inline-start: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--paper); color: var(--mute); display: grid; place-items: center; font-weight: 600; font-size: .85rem; z-index: 1; }
.tracker .st::after { content: ""; position: absolute; top: 13px; inset-inline: 28px 0; height: 2px; background: var(--rule); }
.tracker .st:last-child::after { display: none; }
.tracker .st[data-s="done"]::before { background: var(--go); border-color: var(--go); color: var(--paper); content: "✓"; }
.tracker .st[data-s="done"]::after { background: var(--go); }
.tracker .st[data-s="running"]::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tracker .st[data-s="waiting"]::before { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.tracker .st[data-s="failed"]::before { background: var(--stop); border-color: var(--stop); color: var(--paper); content: "!"; }
.tracker .st b { display: block; font-size: .98rem; }
.tracker .st small { color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-inline-end: 14px; overflow-wrap: anywhere; }
.call { border-radius: var(--r2); padding: 14px 18px; margin-bottom: 20px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; }
.call.wait { background: var(--hivis); color: var(--hivis-ink); }
.call.bad { background: var(--stop-tint); border: 1px solid var(--stop); }
.call.run { background: var(--strong); color: var(--on-strong); }
.call.ok { background: var(--go-tint); color: var(--go-ink); }
.call p { max-width: 70ch; overflow-wrap: anywhere; }
.call b { font-size: 1.08rem; display: block; }
.stamp { position: absolute; inset-inline-end: 18px; top: 50%; translate: 0 -50%; rotate: -9deg; border: 4px double var(--go); color: var(--go); font-weight: 600; font-size: 1.4rem; padding: 2px 12px; border-radius: 4px; background: var(--paper); animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1) both; pointer-events: none; }
@keyframes stamp { from { scale: 2.4; opacity: 0; } to { scale: 1; opacity: 1; } }
.side { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 12px; }
.post { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); overflow: hidden; box-shadow: var(--edge); }
.post-head { display: flex; gap: 9px; align-items: center; padding: 10px 12px 6px; }
.post-head .av { width: 34px; height: 34px; border-radius: 50%; background: var(--strong); color: var(--on-strong); display: grid; place-items: center; font-weight: 600; flex: none; }
.post-head b { display: block; line-height: 1.2; font-size: .93rem; }
.post-head small { color: var(--faint); font-size: .76rem; }
.post-text { margin: 2px 12px 9px; font-size: .9rem; cursor: pointer; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-text.all { display: block; }
.post-media { background: #07090B; aspect-ratio: 4 / 5; display: grid; place-items: center; color: #9AA4B1; text-align: center; }
.post-media.tall { aspect-ratio: 9 / 16; }
.post-media video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.post-media p { padding: 20px; font-size: .9rem; }
.post-media.sq { aspect-ratio: 1 / 1; }
.post-media img { width: 100%; height: 100%; display: block; object-fit: contain; }
.post-cards { display: flex; gap: 8px; overflow-x: auto; padding: 8px; background: var(--floor-2); scroll-snap-type: x proximity; }
.post-card { flex: 0 0 64%; min-width: 0; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--paper); scroll-snap-align: start; }
.post-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.post-card b { display: block; padding: 6px 8px; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-also { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--rule-2); font-size: .8rem; color: var(--mute); }
.post-also img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r); flex: none; }
.render .strip.pic { aspect-ratio: 4 / 3; cursor: default; }
.render .strip.pic img { object-fit: contain; }
.actions.wrap { flex-wrap: wrap; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick { position: relative; padding: 0; border: 2px solid var(--rule-2); border-radius: var(--r2); overflow: hidden; background: var(--paper); cursor: pointer; text-align: start; }
.pick img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.pick .cap { display: block; padding: 5px 7px; font-size: .75rem; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.on { border-color: var(--accent); }
.pick .n { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: var(--paper); font-weight: 700; font-size: .8rem; }
.post-cta { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: var(--paper-2); border-top: 1px solid var(--rule-2); }
.post-cta div { min-width: 0; flex: 1; }
.post-cta small { display: block; color: var(--faint); font-size: .72rem; direction: ltr; text-align: start; }
.post-cta b { display: block; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-cta span.d { display: block; font-size: .8rem; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-cta .fake { border: 1px solid var(--rule); border-radius: var(--r); padding: 5px 11px; font-weight: 600; font-size: .85rem; background: var(--floor-2); white-space: nowrap; }
/* each script line takes its own direction from its first letter: `vo: …` reads left to right, Arabic titles right to left */
.script { font-family: var(--text); unicode-bidi: plaintext; text-align: start; min-height: 440px !important; line-height: 1.8 !important; white-space: pre-wrap; }
.problems { margin: 0 0 12px; padding: 10px 12px 10px 30px; color: var(--stop-ink); font-size: .9rem; background: var(--stop-tint); border-radius: var(--r); }
[dir="rtl"] .problems { padding: 10px 30px 10px 12px; }
.counter { font-size: .8rem; color: var(--mute); text-align: end; margin-top: -10px; margin-bottom: 10px; unicode-bidi: plaintext; }
.counter.over { color: var(--stop); font-weight: 600; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.steps li { border-top: 1px solid var(--rule-2); padding: 8px 0; }
.steps summary { cursor: pointer; font-weight: 500; }
.steps pre, .log { background: var(--code); color: var(--code-ink); padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: .8rem; direction: ltr; text-align: left; max-height: 340px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; margin: 8px 0 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 16px; font-size: .92rem; margin: 0 0 12px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 12px; margin-bottom: 14px; }
.figures div { border-inline-start: 2px solid var(--rule); padding-inline-start: 10px; }
.figures b { display: block; font-size: 1.4rem; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.figures span { font-size: .8rem; color: var(--mute); }

/* ---------- autopilot ---------- */
.dial { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dial button { border: 1px solid var(--rule); background: var(--paper); padding: 13px 15px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 4px; border-radius: var(--r2); }
.dial button:hover { border-color: var(--faint); }
.dial button b { font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.dial button span { font-size: .84rem; color: var(--mute); line-height: 1.4; }
.dial button.on { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.dial button.on span { color: inherit; opacity: .78; }
.dial button.on.autonomous { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.feed { list-style: none; margin: 10px 0 0; padding: 0; max-height: 640px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 78px auto minmax(0, 1fr); gap: 2px 8px; padding: 9px 0; border-top: 1px solid var(--rule-2); align-items: baseline; }
.feed li:first-child { border-top: 0; }
.feed li .when { font-size: .8rem; color: var(--faint); }
.feed li p { overflow-wrap: anywhere; font-size: .93rem; }
.feed li details { grid-column: 3; }
.lessons { margin: 4px 0 12px; padding-inline-start: 20px; display: grid; gap: 6px; max-width: 85ch; }
.lessons small { display: block; color: var(--mute); }
details > summary { cursor: pointer; padding: 6px 0; }
details > summary:hover { color: var(--accent-2); }

/* ---------- tables, connection rows ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: start; font-weight: 500; color: var(--mute); font-size: .82rem; padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button:hover, th[aria-sort] button { color: var(--ink); }
th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
td { padding: 10px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--paper-2); }
td.n, th.n { text-align: end; font-variant-numeric: tabular-nums; }
.conn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px 0; border-top: 1px solid var(--rule-2); align-items: start; }
.conn:first-of-type { border-top: 0; }
.conn .state { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--floor-2); color: var(--mute); }
.conn .state.ok { background: var(--go-tint); color: var(--go); }
.conn .state.todo { background: var(--hivis); color: var(--hivis-ink); }
.conn h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.conn .facts { color: var(--mute); font-size: .88rem; overflow-wrap: anywhere; }

/* ---------- analytics ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 14px 16px; box-shadow: var(--edge); display: grid; gap: 2px; align-content: start; }
.kpi > span { font-size: .87rem; color: var(--mute); }
.kpi b { font-size: 1.6rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .8rem; color: var(--mute); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.kpi small:empty { display: none; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; }
.delta.good { color: var(--go); }
.delta.bad { color: var(--stop); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .area { fill: var(--series-soft); }
.chart .lineplot { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker { fill: var(--series); stroke: var(--paper); stroke-width: 2; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--lift); padding: 8px 10px; font-size: .82rem; min-width: 150px; z-index: 3; }
.tip b { display: block; margin-bottom: 4px; }
.tip dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 1px 14px; }
.tip dt { color: var(--mute); }
.tip dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.tip dt.cur, .tip dd.cur { color: var(--ink); font-weight: 600; }
.rank { display: grid; gap: 2px; overflow-x: auto; }
.rank .row { display: grid; grid-template-columns: minmax(120px, 1.5fr) minmax(120px, 1.3fr) repeat(3, 64px); gap: 4px 12px; align-items: center; padding: 6px 6px; border-radius: 7px; font-size: .9rem; }
.rank .row:hover { background: var(--paper-2); }
.rank .head { font-size: .78rem; color: var(--mute); padding-block: 0 4px; }
.rank .head:hover { background: none; }
.rank .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank a.who { color: var(--ink); text-decoration: none; }
.rank a.who:hover { text-decoration: underline; }
.rank .track { height: 8px; border-radius: 4px; background: var(--floor-2); overflow: hidden; }
.rank .track i { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--series); }
[dir="rtl"] .rank .track i { border-radius: 4px 0 0 4px; }
.rank .n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel { display: grid; gap: 8px; }
.funnel .row { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .9rem; }
.funnel .track { height: 22px; border-radius: 4px; background: var(--floor-2); overflow: hidden; }
.funnel .track i { display: block; height: 100%; min-width: 2px; background: var(--series); border-radius: 0 4px 4px 0; }
[dir="rtl"] .funnel .track i { border-radius: 4px 0 0 4px; }
.funnel .n { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.funnel .n small { color: var(--mute); margin-inline-start: 6px; }
.verdictbar { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; margin: 8px 0 10px; background: var(--floor-2); }
.verdictbar i { display: block; min-width: 3px; }
.verdictbar .w { background: var(--go); }
.verdictbar .l { background: var(--stop); }
.verdictbar .q { background: var(--faint); }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--mute); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }

/* ---------- campaigns ---------- */
.switch { width: 36px; height: 20px; border-radius: 10px; border: 0; padding: 2px; background: var(--rule); cursor: pointer; display: inline-flex; transition: background .14s; vertical-align: middle; }
.switch i { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: translate .14s; }
.switch.on { background: var(--accent); }
.switch.on i { translate: 16px 0; }
[dir="rtl"] .switch.on i { translate: -16px 0; }
.switch[disabled] { opacity: .5; cursor: progress; }
.ctable th.sw, .ctable td.sw { width: 52px; text-align: center; padding-inline: 6px; }
.ctable td { white-space: nowrap; }
.ctable td small { display: block; color: var(--mute); font-size: .78rem; font-weight: 400; }
.ctable td.who { white-space: normal; min-width: 260px; max-width: 420px; display: flex; gap: 10px; align-items: center; }
.ctable td.who > span:last-child { min-width: 0; display: grid; }
.ctable td.who a, .ctable td.who > span > span { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.ctable td.who a:hover { text-decoration: underline; }
.ctable td.who .pic { width: 36px; height: 36px; border-radius: 7px; background: var(--floor-2) center / cover no-repeat; flex: none; }
.ctable tr.dim td.who a, .ctable tr.dim td.n { color: var(--mute); }
.ctable .issue { max-width: 240px; white-space: normal; color: var(--stop); }
.ctable tfoot td { border-top: 1px solid var(--rule); border-bottom: 0; font-weight: 600; color: var(--ink); background: var(--paper-2); }
.ctable .x.edit { display: inline-grid; vertical-align: middle; padding: 2px; margin-inline-start: 2px; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; }
.state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.state.go i { background: var(--go); }
.state.stop i { background: var(--stop); }
.state.run i { background: var(--accent); }
.scope { margin: -6px 0 14px; }
.scope .chip { padding: 3px 4px 3px 10px; gap: 6px; font-size: .87rem; max-width: 100%; }
.scope .chip bdi { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.scope .x { padding: 2px; }

/* ---------- memory, workspaces ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--rule-2); align-items: start; }
.lesson:first-child { border-top: 0; }
.lesson .meta { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--mute); }
.lesson p { grid-column: 1; overflow-wrap: anywhere; max-width: 100ch; }
.lesson .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 2px; }
.lesson.pinned p { font-weight: 500; }
.teach { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.teach .field { margin-bottom: 0; }
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.spacecard { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r3); padding: 16px; display: grid; gap: 12px; box-shadow: var(--edge); }
.spacecard.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--series-soft); }
.spacecard .top { display: flex; gap: 12px; align-items: center; }
.spacecard .top .names { min-width: 0; flex: 1; }
.spacecard .top b { display: block; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacecard .top small { color: var(--mute); }
.spacecard .counts { display: flex; gap: 6px; flex-wrap: wrap; }
.spacecard .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- overlays: modal, palette, sheet, toast ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r3); width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--lift); animation: rise .16s ease-out; }
@keyframes rise { from { translate: 0 8px; opacity: 0; } }
.modal.wide { width: min(1040px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal-head { padding: 18px 22px 10px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-body { padding: 4px 22px 18px; overflow: auto; }
.modal-foot { padding: 12px 22px; border-top: 1px solid var(--rule-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--paper-2); border-radius: 0 0 var(--r3) var(--r3); }
.x { border: 0; background: none; cursor: pointer; color: var(--mute); padding: 5px; border-radius: 6px; display: grid; }
.x:hover { background: var(--floor-2); color: var(--ink); }
.wizard { display: flex; gap: 6px; margin-bottom: 16px; counter-reset: w; flex-wrap: wrap; }
.wizard span { counter-increment: w; font-size: .87rem; color: var(--mute); padding: 3px 10px 3px 4px; border-radius: 14px; display: flex; gap: 6px; align-items: center; }
.wizard span::before { content: counter(w); width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; font-size: .75rem; font-weight: 600; }
.wizard span.on { background: var(--strong); color: var(--on-strong); }
.wizard span.on::before { border-color: currentColor; }
.palette { align-items: start; padding-top: 12vh; }
.palette .box { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r3); width: min(620px, 100%); box-shadow: var(--lift); overflow: hidden; animation: rise .14s ease-out; }
.palette .q { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); color: var(--mute); }
.palette input { border: 0; outline: none; flex: 1; font-size: 1.05rem; background: none; min-width: 0; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette li a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.palette li a.on { background: var(--floor-2); }
.palette li small { margin-inline-start: auto; color: var(--faint); font-size: .78rem; white-space: nowrap; }
.palette .none { padding: 18px; color: var(--mute); text-align: center; }
.palette .pic { width: 26px; height: 26px; border-radius: 6px; background: var(--floor-2) center / cover no-repeat; flex: none; }
.toasts { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; display: grid; gap: 8px; z-index: 30; max-width: min(460px, calc(100vw - 40px)); }
.toast { background: var(--strong); color: var(--on-strong); padding: 10px 12px 10px 14px; border-radius: 10px; box-shadow: var(--lift); display: flex; gap: 10px; align-items: flex-start; animation: rise .16s ease-out; }
.toast.bad { background: var(--stop); color: #fff; }
:root[data-theme="dark"] .toast.bad { color: #1A0509; }
.toast p { flex: 1; overflow-wrap: anywhere; }
.toast button { border: 0; background: none; color: inherit; opacity: .75; cursor: pointer; padding: 2px; display: grid; }
.toast button:hover { opacity: 1; }
.sticky-foot { position: sticky; bottom: 0; background: var(--glass); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--rule); display: flex; gap: 10px; align-items: center; z-index: 5; }
.crash { max-width: 560px; margin: 8vh auto; text-align: center; display: grid; gap: 10px; justify-items: center; }

/* ---------- narrower screens ---------- */
.tabbar, .sheet { display: none; }
/* Sign-in: the factory's own line on the dark side, the form on the other. The user menu. People and roles. */
.door { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.15fr); background: var(--floor); }
.door-art { background: var(--door); color: var(--door-ink); padding: 40px 46px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background-image: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 255, 255, .025) 46px 48px); }
.door-art .brand { display: flex; gap: 12px; align-items: center; font-size: 1.05rem; }
.door-art .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--hivis); color: var(--hivis-ink); display: grid; place-items: center; }
.door-art h2 { font-size: clamp(1.55rem, 2.5vw, 2.25rem); line-height: 1.22; font-weight: 600; letter-spacing: -.01em; max-width: 19ch; }
.door-line { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; max-width: 470px; }
.door-line::before { content: ""; position: absolute; top: 15px; inset-inline: 10%; height: 2px; background: var(--door-line); }
.door-line li { display: grid; justify-items: center; gap: 8px; font-size: .78rem; color: var(--door-mute); position: relative; }
.door-line i { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--door-line); background: var(--door); display: grid; place-items: center; font-style: normal;
  font-weight: 600; color: var(--door-ink); font-size: .85rem; }
.door-line li.on i { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.door-line li.on span { color: var(--door-ink); }
.door-art .foot { color: var(--door-mute); font-size: .88rem; max-width: 42ch; }
.door-main { display: grid; grid-template-rows: auto 1fr; padding: 14px 20px 44px; }
.door-tools { display: flex; justify-content: flex-end; gap: 4px; }
.door-card { align-self: center; justify-self: center; width: min(400px, 100%); }
.door-card form { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r3); box-shadow: var(--lift); padding: 30px; display: grid; gap: 2px; }
.door-card h1 { font-size: 1.5rem; }
.door-card .lede { margin-bottom: 14px; }
.door-card .btn.lg { width: 100%; margin-top: 8px; }
.door-card .err { margin: 2px 0 4px; }
.secretbox { position: relative; }
.secretbox input { width: 100%; padding-inline-end: 42px; }
.secretbox .iconbtn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); }
.secretbox .iconbtn[aria-pressed="true"] { color: var(--accent); }
.linkbtn { border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; font-size: .86rem; padding: 12px 0 0; text-align: center; }
.linkbtn:hover { text-decoration: underline; }
.usermenu { position: relative; }
.userbtn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; display: grid; }
.userbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.space-menu.user { inset-inline: auto 0; min-width: 244px; top: calc(100% + 8px); }
.space-menu .me { display: grid; gap: 3px; padding: 8px 10px; justify-items: start; }
.space-menu .me small { color: var(--mute); }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 18px; }
.rolecard { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--edge); align-content: start; }
.rolecard span { color: var(--mute); font-size: .86rem; }
.rolecard small { color: var(--faint); margin-top: 4px; }
.rolepick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rolepick button { text-align: start; border: 1px solid var(--rule); border-radius: var(--r2); background: var(--paper); padding: 10px 12px; cursor: pointer; display: grid; gap: 3px;
  color: var(--ink); font: inherit; align-content: start; }
.rolepick button span { color: var(--mute); font-size: .82rem; }
.rolepick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px; }
.checkchip { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px 4px 8px; cursor: pointer; font-size: .9rem; }
.checkchip input { width: 16px; height: 16px; accent-color: var(--accent); }
table.people .who { display: flex; gap: 10px; align-items: center; min-width: 200px; }
table.people .who small { display: block; color: var(--mute); }
table.people tr.off { opacity: .55; }
.chip.role-manager { background: var(--accent-tint); color: var(--accent-2); }
.chip.role-viewer { background: transparent; border: 1px solid var(--rule); color: var(--mute); }
.secret { display: flex; gap: 10px; align-items: center; background: var(--floor-2); border-radius: var(--r); padding: 10px 12px; margin-top: 10px; }
.secret code { font-size: 1.15rem; letter-spacing: .04em; flex: 1; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; user-select: all; }
.empty-people { display: grid; justify-items: center; gap: 8px; padding: 26px 10px; text-align: center; color: var(--mute); }
.empty-people h2 { color: var(--ink); }
@media (max-width: 820px) {
  .door { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .door-art { padding: 20px; gap: 12px; }
  .door-art h2 { font-size: 1.25rem; max-width: none; }
  .door-line, .door-art .foot { display: none; }
  .door-main { padding-bottom: 28px; }
  .door-card form { padding: 22px; }
}

/* Team: the pulse meter, plans, the feed by role. System: checks. The assistant's button and panel. */
.panel h2 .ic { display: inline-block; vertical-align: -3px; }
.meter { height: 8px; border-radius: 4px; background: var(--floor-2); overflow: hidden; margin: 10px 0 6px; min-width: 120px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter i.warm { background: var(--hivis); }
.meter i.hot { background: var(--stop); }
.field.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.field.inline span { font-size: .82rem; color: var(--mute); white-space: nowrap; }
.field.inline input { width: 92px; }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.plan { border: 1px solid var(--rule-2); border-radius: var(--r2); padding: 14px 16px; background: var(--paper-2); display: grid; gap: 8px; align-content: start; min-width: 0; }
.plan.held { border-style: dashed; border-color: var(--rule); }
.plan header { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.plan h3 { font-size: 1rem; }
.plan p { font-size: .92rem; overflow-wrap: anywhere; }
.plan-steps { margin: 0; padding-inline-start: 20px; font-size: .9rem; color: var(--mute); display: grid; gap: 3px; }
.plan footer { border-top: 1px solid var(--rule-2); padding-top: 10px; display: grid; gap: 8px; }
.plan footer .when { color: var(--mute); }
.held { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 10px; }
.feed.roles li { grid-template-columns: 78px 98px minmax(0, 1fr); }
.feed .what { font-weight: 600; }
.chip.role-owner { background: var(--strong); color: var(--on-strong); }
.checks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--rule-2); font-size: .9rem; }
.checks li:first-child { border-top: 0; }
.checks li small { color: var(--mute); text-align: end; overflow-wrap: anywhere; max-width: 24ch; }
.checks li.ok .ic { color: var(--go); }
.checks li.bad .ic { color: var(--stop); }
.checks li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.toasts { inset-block-end: 84px; }
.panel-head .seg { flex-wrap: wrap; max-width: 100%; }
.pulse .panel-head, .pulse .actions { flex-wrap: wrap; }
.pulse .panel-head > div { min-width: 0; }
.field.inline select { max-width: 100%; }
.helper-btn { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--strong); color: var(--on-strong);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--lift); z-index: 18; transition: transform .12s; }
.helper-btn:hover { transform: translateY(-2px); }
.helper-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.helper { position: fixed; inset-block-end: 84px; inset-inline-end: 20px; width: min(480px, calc(100vw - 24px)); height: min(720px, calc(100vh - 110px)); background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r2); box-shadow: var(--lift); z-index: 18; display: flex; flex-direction: column; overflow: hidden; animation: rise .12s ease-out; }
.app[hidden], .tabbar[hidden] { display: none !important; }
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--paper); position: relative; flex: 1; }
.chat.over::after { content: ""; position: absolute; inset: 6px; border: 2px dashed var(--accent); border-radius: var(--r2); pointer-events: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--rule-2); flex: none; }
.chat-head .title { display: flex; gap: 8px; align-items: center; min-width: 0; font-weight: 600; }
.chat-head .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .sp { display: flex; gap: 2px; align-items: center; flex: none; }
.chat-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 14px; }
.chat-body.setup { display: grid; gap: 10px; align-content: start; }
.chat-body.setup ol { padding-inline-start: 20px; display: grid; gap: 6px; font-size: .92rem; margin: 0; }
.chat-body.setup code { background: var(--floor-2); border-radius: 5px; padding: 1px 6px; font-size: .86em; }
.chat-col { display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin: 0 auto; width: 100%; min-width: 0; }
.chat-hello { margin-top: 7vh; display: grid; gap: 10px; }
.chat.wide .chat-hello { text-align: center; justify-items: center; margin-top: 15vh; }
.chat-hello h2 { font-size: 1.5rem; }
.starters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); width: 100%; margin-top: 8px; }
.starters button { text-align: start; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r2); padding: 10px 12px; cursor: pointer; color: var(--ink); font: inherit; font-size: .9rem; }
.starters button:hover { border-color: var(--ink); }
.msg { font-size: .95rem; overflow-wrap: anywhere; min-width: 0; }
.msg.you { align-self: flex-end; max-width: 86%; background: var(--floor-2); border-radius: 16px; padding: 9px 13px; display: grid; gap: 8px; }
.msg.you p { white-space: pre-wrap; }
.msg.bot .msg-act { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity .12s; }
.msg.bot:hover .msg-act, .msg.bot:focus-within .msg-act { opacity: 1; }
.msg.err { background: var(--stop-tint); color: var(--stop-ink); border-radius: var(--r); padding: 8px 10px; }
.msg-meta { color: var(--faint); font-size: .78rem; display: flex; gap: 6px; align-items: center; }
.md { display: grid; gap: 10px; min-width: 0; }
.md p { white-space: pre-wrap; line-height: 1.6; }
.md h3 { font-size: 1.12rem; margin-top: 4px; }
.md h4, .md h5, .md h6 { font-size: 1rem; margin-top: 2px; }
.md ul, .md ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.md li { white-space: pre-wrap; line-height: 1.55; }
.md li.deep { margin-inline-start: 18px; }
.md code { background: var(--floor-2); border-radius: 5px; padding: 1px 5px; font-size: .86em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.md blockquote { margin: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--rule); color: var(--mute); white-space: pre-wrap; }
.md hr { border: 0; border-top: 1px solid var(--rule-2); margin: 2px 0; }
.md table { font-size: .88rem; }
.codeblock, .tool .io { border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--floor-2); min-width: 0; }
.codebar { display: flex; justify-content: space-between; align-items: center; padding: 3px 6px 3px 10px; font-size: .74rem; color: var(--mute); border-bottom: 1px solid var(--rule-2); }
.codeblock pre, .tool pre { margin: 0; padding: 10px 12px; overflow: auto; font-size: .8rem; max-height: 420px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; }
.tool pre { white-space: pre-wrap; max-height: 260px; overflow-wrap: anywhere; }
.codeblock pre code { background: none; padding: 0; font-size: inherit; }
.copy { border: 0; background: none; color: var(--mute); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; padding: 4px 6px; border-radius: 6px; font-size: .74rem; }
.copy:hover { color: var(--ink); background: var(--floor-2); }
.tool { font-size: .84rem; min-width: 0; }
.tool summary { cursor: pointer; display: flex; gap: 8px; align-items: center; color: var(--mute); list-style: none; padding: 2px 0; }
.tool summary::-webkit-details-marker { display: none; }
.tool .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .78rem; min-width: 0; }
.tool.think .what { font-family: inherit; font-size: .82rem; }
.tool .dotmark { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); flex: none; }
.tool.ok .dotmark { background: var(--go); }
.tool.bad .dotmark { background: var(--stop); }
.tool.run .dotmark { background: var(--accent); }
.tool[open] summary { color: var(--ink); }
.tool .io { margin-top: 6px; }
.attached, .pending { display: flex; flex-wrap: wrap; gap: 6px; }
.pending { margin-bottom: 6px; }
.attached .pic img { width: 132px; height: 132px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--rule-2); }
.filechip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; font-size: .8rem; color: var(--ink); text-decoration: none; background: var(--paper); max-width: 100%; }
.filechip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.filechip small { color: var(--faint); }
.filechip img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.filechip button { border: 0; background: none; cursor: pointer; color: var(--mute); padding: 0; display: grid; }
.composer { flex: none; padding: 8px 12px 10px; border-top: 1px solid var(--rule-2); }
.inputbox { border: 1px solid var(--rule); border-radius: 14px; background: var(--paper); padding: 6px 8px; display: grid; gap: 4px; }
.inputbox:focus-within { border-color: var(--ink); }
.inputbox textarea { border: 0; outline: 0; background: none; resize: none; padding: 6px 6px 2px; font: inherit; color: var(--ink); min-height: 36px; width: 100%; box-shadow: none; }
.inputbox textarea:focus { outline: 0; box-shadow: none; border: 0; }
.inputbox .tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.inputbox .grow { flex: 1; }
.inputbox .tools .iconbtn { display: inline-grid; place-items: center; align-self: center; }
.chat.wide .starters { grid-template-columns: 1fr 1fr; max-width: 660px; }
.pickbox select { border: 0; background: none; color: var(--mute); font: inherit; font-size: .82rem; padding: 4px 2px; cursor: pointer; max-width: 138px; width: auto; box-shadow: none; }
.pickbox select:hover { color: var(--ink); }
.seg.mini { align-self: center; }
.seg.mini button { padding: 2px 9px; font-size: .8rem; }
.iconbtn.toggle.on { color: var(--accent); background: var(--accent-tint); }
.composer .hint { font-size: .72rem; color: var(--faint); margin: 5px 4px 0; }
.composer .send { border-radius: 10px; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chat-list button { width: 100%; text-align: start; background: none; border: 0; padding: 8px 10px; border-radius: var(--r); cursor: pointer; display: grid; gap: 1px; color: var(--ink); font: inherit; font-size: .9rem; }
.chat-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list button:hover, .chat-list button.on { background: var(--floor-2); }
.chat-list small { color: var(--faint); font-size: .74rem; }
.chatpage { position: fixed; inset: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--paper); z-index: 16; }
.chat-side { border-inline-end: 1px solid var(--rule); background: var(--floor); padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-width: 0; }
.chat-side .back { color: var(--mute); text-decoration: none; font-size: .88rem; display: flex; gap: 6px; align-items: center; }
.chat-side .back:hover { color: var(--ink); }
.chat-side h3 { font-size: .78rem; color: var(--faint); font-weight: 500; margin-top: 8px; }
.chat-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.side-toggle { display: none; }

@media (max-width: 1180px) {
  .rail nav .group { display: none; }
  .today { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .today .spark { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--rule-2); grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
  :root { --rail: 66px; }
  .rail { padding-inline: 8px; align-items: center; }
  .space-btn { padding: 4px; justify-content: center; }
  .space-btn .names, .space-btn > .ic, .rail nav a span.label, .linecard span, .linecard b em { display: none; }
  .space-menu { inset-inline: 0 auto; }
  .rail nav { width: 100%; }
  .rail nav a { justify-content: center; padding: 11px; }
  .rail .count { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; font-size: .7rem; padding: 0 4px; }
  .linecard { padding: 9px; justify-items: center; }
  .searchbtn { min-width: 0; }
  .searchbtn span, .searchbtn kbd { display: none; }
}
@media (max-width: 760px) {
  .chatpage { grid-template-columns: minmax(0, 1fr); }
  .chat-side { display: none; position: absolute; inset: 0; z-index: 3; }
  .chatpage.side-open .chat-side { display: flex; }
  .side-toggle { display: grid; position: absolute; top: 8px; inset-inline-start: 8px; z-index: 4; }
  .chat.wide .chat-head { padding-inline-start: 48px; }
  .msg.you { max-width: 94%; }
  .today { grid-template-columns: 1fr 1fr; }
  .today > * { padding: 12px 14px; }
  .today > :nth-child(3) { border-inline-start: 0; }
  .today > :nth-child(n+3) { border-top: 1px solid var(--rule-2); }
  .today .lead b { font-size: 1.6rem; }
  .today b { font-size: 1.3rem; }
  .helper-btn { inset-block-end: 72px; inset-inline-end: 12px; width: 46px; height: 46px; }
  .helper { inset: auto 8px 126px 8px; width: auto; height: min(68vh, 560px); }
  .feed.roles li { grid-template-columns: 64px minmax(0, 1fr); }
  .feed.roles li p, .feed.roles li details { grid-column: 1 / -1; }
  .toasts { inset-block-end: 128px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { padding: 0 14px; }
  .page { padding: 18px 14px 96px; }
  h1 { font-size: 1.4rem; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: 2; }
  .dial { grid-template-columns: minmax(0, 1fr); }
  .toolbar .find { max-width: none; flex-basis: 100%; }
  .toolbar .sp { margin-inline-start: 0; }
  .rank .row { grid-template-columns: minmax(0, 1fr) repeat(3, auto); }
  .rank .track { display: none; }
  .funnel .row { grid-template-columns: minmax(0, 1fr) auto; }
  .funnel .track { grid-column: 1 / -1; order: 3; height: 12px; }
  .teach { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: flex; position: fixed; inset: auto 0 0 0; background: var(--paper); border-top: 1px solid var(--rule); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; color: var(--mute); text-decoration: none; background: none; border: 0; border-top: 2px solid transparent; padding: 8px 2px 7px; font-size: .72rem; display: grid; justify-items: center; gap: 2px; position: relative; cursor: pointer; min-width: 0; }
  .tabbar .on { color: var(--ink); border-top-color: var(--ink); }
  .tabbar .on .ic { color: var(--accent); }
  .tabbar .count { position: absolute; top: 3px; inset-inline-start: 54%; background: var(--hivis); color: var(--hivis-ink); border-radius: 9px; min-width: 17px; font-size: .68rem; font-weight: 600; padding: 0 4px; }
  .sheet { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); }
  .sheet nav { position: absolute; inset: auto 0 0 0; background: var(--paper); border-radius: 16px 16px 0 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 2px; animation: rise .16s ease-out; max-height: 80vh; overflow: auto; }
  .sheet a, .sheet button { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 8px; text-decoration: none; color: var(--ink); background: none; border: 0; text-align: start; cursor: pointer; font-size: 1rem; }
  .sheet a:hover, .sheet button:hover { background: var(--floor-2); }
  .sheet h3 { font-size: .8rem; font-weight: 500; color: var(--faint); padding: 8px 12px 2px; }
  .toasts { inset-block-end: 76px; inset-inline: 12px; max-width: none; }
  .modal-foot .btn { flex: 1; }
}
.linkform { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.linkform .input { flex: 1 1 220px; min-width: 0; width: auto; }
/* footage from a YouTube link (product → Footage) */
.fromlink { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); max-width: 760px; }
.fromlink h3 { margin: 0 0 8px; }
.linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkrow .input { flex: 1 1 260px; min-width: 0; width: auto; }
.partpick { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 2px; font-size: .9rem; cursor: pointer; }
.parttimes { display: grid; grid-template-columns: repeat(2, minmax(0, 140px)); gap: 0 12px; margin-top: 8px; }
.parttimes .field { margin-bottom: 4px; }
.fromlink > p { margin: 8px 0 0; max-width: 72ch; }
.blockednote { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; color: var(--mute); max-width: 72ch; }
.blockednote svg { flex: none; margin-top: 3px; }
.linkruns { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.linkruns li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
.linkruns .what { display: grid; gap: 1px; min-width: 0; }
.linkruns .what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.linkruns small { color: var(--mute); font-size: .82rem; }
.linkruns small.why { color: var(--stop-ink); }
.linkruns .meter { flex: 0 0 120px; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
