/* Creator Quant. Brand Foundry's shell (sidebar, stat tiles, card grid, theme switch)
   in the BBM Manga Ink skin: paper, ink outlines with solid offsets, yellow highlighter
   as the one accent (red stays on the BBM home page), Anton / Inter Tight / Geist Mono. */
:root {
  --accent: #FFD23F;
  --accent-dark: #F5C518;
  --accent-text: #111111;
  --on-accent: #111111;
  --bg: #F2EDE3;
  --panel: #FFFFFF;
  --panel-2: #F7F4EE;
  --line: #111111;
  --rule: rgba(17, 17, 17, .16);
  --shadow: #111111;
  --text: #111111;
  --mut: #3A3A3A;
  --tint: rgba(255, 210, 63, .38);
  --sidebar: 252px;
  --font: 'Inter Tight', Helvetica, Arial, sans-serif;
  --display: 'Anton', Impact, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0E0E10;
  --panel: #17171B;
  --panel-2: #1E1E23;
  --line: #F2EDE3;
  --rule: rgba(242, 237, 227, .14);
  --shadow: #34343C;
  --text: #F4F1EA;
  --mut: #A9A49A;
  --accent-text: #FFD23F;
  --tint: rgba(255, 210, 63, .16);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { padding: 30px 34px 70px; min-width: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px 16px; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .navitem { width: auto; }
  .side .foot { display: none; }
  .main { padding: 20px 16px 60px; }
}

/* ---------- sidebar ---------- */
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand .mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand .name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.workspace { display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 18px; background: var(--panel-2); border: 1px solid var(--line); }
.workspace .dot { width: 8px; align-self: stretch; background: var(--accent); }
.workspace .t { font-weight: 700; font-size: 13.5px; }
.workspace .s { font-size: 11.5px; color: var(--mut); }
.navhead { padding: 14px 10px 6px; color: var(--mut); font: 700 10.5px/1 var(--font); letter-spacing: .13em; text-transform: uppercase; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 9px 11px; color: var(--mut); font-size: 13.5px; font-weight: 600; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.navitem:hover { background: var(--panel-2); color: var(--text); }
.navitem.on { background: var(--text); color: var(--bg); }
.navitem .count { margin-left: auto; font-size: 11px; opacity: .7; font-weight: 700; }
.navitem .ic { width: 16px; display: grid; place-items: center; }
.side .foot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 11.5px; color: var(--mut); line-height: 1.6; padding-left: 10px; }

.themeswitch { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); }
.themeswitch button { display: grid; place-items: center; width: 34px; height: 28px; border: 0; cursor: pointer; background: none; color: var(--mut); font-size: 13px; }
.themeswitch button.on { background: var(--text); color: var(--bg); }

/* ---------- header + stats ---------- */
.headrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; margin: 0; line-height: 1.1; }
.h1 em { font-style: normal; color: var(--accent-text); }
.sub { color: var(--mut); font-size: 14px; margin-top: 6px; max-width: 760px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--mut); font-size: 12.5px; font-weight: 700; }
.section-t { font-size: 17px; font-weight: 800; margin: 30px 0 14px; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-t .mut { font-size: 13px; font-weight: 500; color: var(--mut); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--mut); font-weight: 600; }
.stat .v { font-size: 30px; font-weight: 800; color: var(--accent-text); margin-top: 6px; letter-spacing: -0.02em; line-height: 1.1; }
.stat .n { font-size: 11.5px; color: var(--mut); margin-top: 3px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; padding: 12px; background: var(--panel); border: 1px solid var(--line); }
.filters select, .filters input[type=search], .filters input[type=number], .field { background: var(--panel-2); border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; min-width: 0; border-radius: 0; }
.filters input[type=search] { flex: 1 1 200px; }
.filters input[type=number] { width: 84px; }
.filters label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--mut); }
.filters input[type=checkbox] { accent-color: var(--accent); }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- buttons ---------- */
.btn { padding: 9px 14px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.red { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.red:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ink { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.small { padding: 6px 10px; font-size: 11.5px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; cursor: pointer; transition: border-color .15s ease; }
.card:hover { border-color: var(--text); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--panel-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb.vert { aspect-ratio: 4/5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; color: var(--mut); font-size: 13px; line-height: 1.45; text-align: left; overflow: hidden; }
.thumb .x { position: absolute; left: 0; top: 0; }
.card .body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .meta { font-size: 12px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.card .meta b { color: var(--text); font-weight: 700; }
.card .ttl { font-weight: 700; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); background: var(--tint); padding: 4px 7px; }
.tag.plain { color: var(--mut); background: var(--panel-2); }
.tag.warn { color: #7a5b00; background: #fff3cd; }

/* multiplier badge: one accent, intensity = strength */
.x { display: inline-block; font-weight: 800; font-size: 13px; padding: 3px 8px; line-height: 1.3; background: var(--panel-2); color: var(--mut); }
.x.x2 { background: var(--tint); color: var(--accent-text); }
.x.x3 { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
.x.x5 { background: var(--accent); color: var(--on-accent); }
.x.x10 { background: var(--text); color: var(--bg); }

.zs { display: inline-block; font-weight: 700; font-size: 11.5px; padding: 3px 6px; line-height: 1.4; background: rgba(20,18,16,.72); color: #F3EEE6; }
.brk { position: absolute; right: 0; top: 0; font: 800 10.5px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; background: var(--accent); color: var(--on-accent); }
.more { display: flex; justify-content: center; margin-top: 20px; }
.empty { border: 1px dashed var(--line); padding: 40px 24px; text-align: center; color: var(--mut); font-size: 13.5px; line-height: 1.7; margin-top: 16px; }
.empty code, code { background: var(--panel-2); padding: 1px 6px; font-size: 12.5px; }

/* ---------- tables ---------- */
.tw { overflow-x: auto; margin-top: 14px; background: var(--panel); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); font-weight: 700; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td .sm { font-size: 12px; color: var(--mut); }
.bar { position: relative; height: 10px; background: var(--panel-2); min-width: 120px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }

/* ---------- prose (Read page) ---------- */
.prose { max-width: 820px; background: var(--panel); border: 1px solid var(--line); padding: 26px 30px; margin-top: 22px; line-height: 1.65; font-size: 15px; }
.prose h2 { font-size: 22px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17px; margin: 22px 0 6px; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.prose li { margin: 6px 0; }
.prose b { font-weight: 800; }

/* ---------- drawer (post detail) ---------- */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(720px, 100vw); max-width: 100vw; border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--bg); color: var(--text); }
dialog.drawer::backdrop { background: rgba(20, 18, 16, .45); }
.drawer .top { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer .top .grow { flex: 1; }
.drawer .inner { padding: 20px 22px 60px; }
.drawer .hero { max-height: 360px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.drawer .hero img { width: 100%; display: block; max-height: 360px; object-fit: contain; }
.drawer h2 { font-size: 20px; line-height: 1.3; margin: 16px 0 6px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.kv > div { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; }
.kv .k { font-size: 11.5px; color: var(--mut); font-weight: 600; }
.kv .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
dl.bd { margin: 0; }
dl.bd dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); font-weight: 700; margin-top: 14px; }
dl.bd dd { margin: 3px 0 0; font-size: 14px; line-height: 1.55; }
dl.bd dd.hl { border-left: 3px solid var(--accent); padding-left: 10px; }
details.tx { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; }
details.tx summary { cursor: pointer; font-weight: 700; }
details.tx pre { white-space: pre-wrap; font: 13px/1.6 var(--font); max-height: 420px; overflow: auto; margin: 10px 0 0; }
.saverow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.saverow input { flex: 1 1 180px; }

/* ---------- forms + log ---------- */
.formrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding: 12px; background: var(--panel); border: 1px solid var(--line); }
.runs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.run { background: var(--panel); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.run .t { font-weight: 800; }
.run .d { font-size: 12.5px; color: var(--mut); flex: 1; }
pre.log { background: #111111; color: #F4F1EA; padding: 14px 16px; font: 12px/1.55 var(--mono); max-height: 460px; overflow: auto; white-space: pre-wrap; margin-top: 14px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; font-weight: 700; font-size: 13px; z-index: 50; }
.mut { color: var(--mut); }
.red { color: var(--accent-text); }
.ftable td:first-child { min-width: 240px; }
.ftable td:nth-child(7), .ftable td:nth-child(8) { min-width: 210px; }
.tw table td:first-child { min-width: 170px; }

/* ---------- thumbnails ---------- */
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.face { position: relative; display: block; border: 2px solid var(--line); cursor: pointer; aspect-ratio: 1; overflow: hidden; background: var(--panel-2); }
.face.on { border-color: var(--accent); }
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face input { position: absolute; left: 6px; top: 6px; accent-color: var(--accent); width: 18px; height: 18px; }
.face button { position: absolute; right: 4px; top: 4px; padding: 2px 7px; }
.job { background: var(--panel); border: 1px solid var(--line); padding: 14px; margin-top: 12px; }
.job .meta { font-size: 12.5px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.job .meta b { color: var(--text); }
.card.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.card .btn { text-align: center; }
/* YouTube homepage mock: always YouTube's own dark look, so the test is honest */
.yt { background: #0f0f0f; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 14px; min-height: 100%; }
.ytc .ytt { aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #272727; }
.ytc .ytt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytc.mine .ytt { box-shadow: 0 0 0 3px var(--accent); }
.ytm { display: flex; gap: 10px; margin-top: 10px; font-family: Roboto, Arial, sans-serif; }
.ytm .ava { width: 32px; height: 32px; border-radius: 50%; background: #3f3f3f; flex: 0 0 32px; }
.ytti { color: #f1f1f1; font-size: 14px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ytch { color: #aaa; font-size: 12.5px; margin-top: 2px; }

/* ---------- layered editor ---------- */
.edtop, .edtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); }
.edtools { border-top: 0; }
.edtools label.btn { display: inline-block; }
.ed { display: grid; grid-template-columns: 210px minmax(0, 1fr) 270px; gap: 14px; margin-top: 14px; align-items: start; }
@media (max-width: 1100px) { .ed { grid-template-columns: 1fr; } .edlayers { order: 2; } .edprops { order: 3; } }
.edlayers, .edprops { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; max-height: calc(100vh - 160px); overflow-y: auto; }
.edcanvas { min-width: 0; }
.stagebox { position: relative; margin: 0 auto; background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 / 20px 20px; outline: 1px solid var(--line); overflow: hidden; touch-action: none; user-select: none; }
.stagebox.drop { outline: 3px dashed var(--accent); }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; cursor: default; }
#stage .L { cursor: move; }
.selbox { position: absolute; border: calc(2px * var(--inv, 1)) solid #2F80FF; pointer-events: none; box-sizing: border-box; }
.selbox.locked { border-style: dashed; border-color: var(--mut); }
.selbox i { position: absolute; width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1)); background: #fff; border: calc(2px * var(--inv, 1)) solid #2F80FF; pointer-events: auto; }
.selbox.locked i { display: none; }
.selbox i[data-h="nw"] { left: calc(-8px * var(--inv, 1)); top: calc(-8px * var(--inv, 1)); cursor: nwse-resize; }
.selbox i[data-h="ne"] { right: calc(-8px * var(--inv, 1)); top: calc(-8px * var(--inv, 1)); cursor: nesw-resize; }
.selbox i[data-h="sw"] { left: calc(-8px * var(--inv, 1)); bottom: calc(-8px * var(--inv, 1)); cursor: nesw-resize; }
.selbox i[data-h="se"] { right: calc(-8px * var(--inv, 1)); bottom: calc(-8px * var(--inv, 1)); cursor: nwse-resize; }
.guide { position: absolute; background: #FF2E8A; pointer-events: none; }
.guide.gx { top: 0; bottom: 0; width: 1px; }
.guide.gy { left: 0; right: 0; height: 1px; }
.lrow { display: flex; align-items: center; gap: 6px; padding: 7px 6px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.lrow:hover { background: var(--panel-2); }
.lrow.on { background: var(--text); color: var(--bg); }
.lrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lrow .ic { width: 16px; text-align: center; font-weight: 800; }
.lrow button { background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 11px; color: inherit; opacity: .75; }
.lrow button:hover { opacity: 1; }
.pf { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--mut); font-weight: 600; min-width: 0; }
.pf .field { width: 100%; color: var(--text); font-weight: 400; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.g2 .chk { margin-top: 10px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.colrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.colrow input[type=color] { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--line); background: var(--panel-2); }
.colrow .field { flex: 1 1 90px; }
.colrow .sw { display: flex; gap: 3px; flex-wrap: wrap; }
.colrow .sw b { width: 18px; height: 18px; border: 1px solid var(--line); cursor: pointer; display: inline-block; }
.codebox { width: 100%; min-height: 360px; font: 12px/1.5 var(--mono); }

/* ---------- thumbnails v2: winners first ---------- */
.tabs { display: flex; gap: 0; margin-top: 20px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--mut); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab .mut { font-weight: 600; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { background: var(--panel-2); border: 0; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--mut); }
.seg button.on { background: var(--text); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); padding: 7px 10px; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.chip:hover { border-color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on .mut, .chip.on .red { color: inherit; opacity: .8; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; padding-bottom: 90px; }
.wcard { cursor: pointer; min-width: 0; }
.wcard .wimg { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--panel-2); outline: 1px solid var(--line); }
.wcard.vert .wimg { aspect-ratio: 9/16; }
.wcard .wimg img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.wcard:hover .wimg img { transform: scale(1.03); }
.wcard.picked .wimg { outline: 4px solid var(--accent); outline-offset: -4px; }
.wcard .pick { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 900; }
.wcard .winfo { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border: 0; background: rgba(20,18,16,.75); color: #F3EEE6; font-weight: 800; cursor: pointer; opacity: 0; }
.wcard:hover .winfo, .wcard .winfo:focus-visible { opacity: 1; }
.wmeta { font-size: 12px; color: var(--mut); margin-top: 7px; }
.wmeta b { color: var(--text); }
.wttl { font-size: 13.5px; font-weight: 700; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tray { position: fixed; left: calc(var(--sidebar) + 34px); right: 34px; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--text); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.tray img { height: 46px; aspect-ratio: 16/9; object-fit: cover; outline: 1px solid rgba(243,238,230,.3); }
.tray .grow { flex: 1; min-width: 0; }
.tray .btn:not(.red) { background: transparent; color: var(--bg); border-color: rgba(243,238,230,.35); }
@media (max-width: 900px) { .tray { left: 12px; right: 12px; } .tray img:nth-child(n+2) { display: none; } }
.refrow { display: flex; gap: 10px; flex-wrap: wrap; }
.refrow figure { margin: 0; flex: 1 1 180px; max-width: 260px; }
.refrow img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; outline: 1px solid var(--line); }
.refrow figcaption { font-size: 12px; color: var(--mut); margin-top: 4px; }
.faces.mini { display: flex; gap: 6px; margin-top: 12px; }
.faces.mini img { width: 54px; height: 54px; object-fit: cover; outline: 1px solid var(--line); }
.face .fname { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(20,18,16,.7); color: #F3EEE6; font-size: 10.5px; padding: 3px 5px; text-transform: capitalize; }
.thumb .mk { position: absolute; right: 8px; bottom: 8px; border: 0; background: var(--accent); color: var(--on-accent); font: 800 11px/1 var(--font); padding: 7px 9px; cursor: pointer; opacity: 0; }
.card:hover .thumb .mk, .thumb .mk:focus-visible { opacity: 1; }

/* ---------- ideas + hooks ---------- */
.ideas { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .ideas { grid-template-columns: 1fr; } .ilist { max-height: 300px; } }
.ilist { background: var(--panel); border: 1px solid var(--line); max-height: calc(100vh - 200px); overflow-y: auto; outline: none; }
.irow { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.irow:hover { background: var(--panel-2); }
.irow.on { background: var(--text); color: var(--bg); }
.irow.on .sm, .irow.on .x { color: inherit; }
.ith { width: 72px; flex: 0 0 72px; aspect-ratio: 16/9; background: var(--panel-2); overflow: hidden; }
.ith img { width: 100%; height: 100%; object-fit: cover; display: block; }
.itx { min-width: 0; }
.ittl { font-weight: 700; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sm { font-size: 12px; color: var(--mut); }
.idetail { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; min-width: 0; }
.idetail .hero { max-height: 300px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.idetail .hero img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.idetail h2 { font-size: 20px; line-height: 1.3; margin: 10px 0 4px; overflow-wrap: anywhere; }
.idetail .formrow { padding: 12px 0 0; border: 0; background: none; }
kbd { font: 700 10.5px/1 var(--font); border: 1px solid currentColor; padding: 2px 4px; margin-left: 6px; opacity: .7; }
.ver { border-left: 3px solid var(--accent); padding: 4px 10px; margin: 6px 0; }
.hooks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.hk { background: var(--panel); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.hkt { font-size: 16px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.rbox { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; }
.rbox .chk { font-size: 12.5px; margin-left: 10px; display: inline-flex; gap: 6px; align-items: center; }
.idetail:empty { display: none; }
.f3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.f3 > div { background: var(--panel); border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; }
.f3 .sm { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; margin-bottom: 2px; }
@media (max-width: 600px) { .f3 { grid-template-columns: 1fr; } }
details.doc .prose { max-width: none; font-size: 14.5px; }
@media (max-width: 900px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .chip { flex: 0 0 auto; white-space: nowrap; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}
/* e2e fixes: badge row on cards, no stretched cards */
.thumb .x-wrap { display: flex; }
.thumb .x-wrap .x { position: static; }
.grid { align-items: start; }
.hkex { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.hkex li { margin: 4px 0; }

/* ---------- make workspace ---------- */
.mk { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .mk { grid-template-columns: 1fr; } }
.mkside { background: var(--panel); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mkside .hero img { width: 100%; display: block; max-height: 220px; object-fit: contain; background: var(--panel-2); }
.mkmain { min-width: 0; }
.hlbox { border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--tint); font-size: 13.5px; }
.tellflag { display: inline-block; font: 700 10.5px/1 var(--font); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; background: #fff3cd; color: #7a5b00; cursor: help; }
.tlist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.trow { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trow.top { border-color: var(--accent); }
.trow.pick { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.trow .tt { font-size: 16px; overflow-wrap: anywhere; }
.xposts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 12px; align-items: start; }
.xp { background: var(--panel); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xp pre, pre.doc { white-space: pre-wrap; font: 14.5px/1.55 var(--font); margin: 0; overflow-wrap: anywhere; }
pre.doc { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; margin-top: 10px; max-height: 70vh; overflow: auto; }
.steps { display: flex; gap: 0; margin-top: 10px; }
.step { padding: 8px 14px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 12.5px; color: var(--mut); }
.step.done { background: var(--text); color: var(--bg); border-color: var(--text); }
.hk.star { border-color: var(--accent); }
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; background: var(--panel); border: 1px solid var(--accent); padding: 10px 12px; font-size: 13.5px; }
.alert .at { flex: 1 1 100%; color: var(--text); }
.pill.warn { border-color: var(--accent); color: var(--accent-text); }
details.more summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--mut); margin-top: 6px; }

/* ---------- readability pass ---------- */
body { font-size: 14.5px; }
.sub { font-size: 14.5px; max-width: 70ch; }
.sm, .card .meta, .job .meta { font-size: 12.5px; }
.tag { font-size: 11px; letter-spacing: .04em; }
.prose { max-width: 720px; }
.navhead { padding-top: 16px; }
.navitem { padding: 8px 11px; }
.footwarn { display: block; color: var(--accent-text); font-weight: 700; margin-bottom: 6px; text-decoration: underline; text-underline-offset: 2px; }
.keys { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; font-size: 12.5px; color: var(--mut); }
.keys kbd { margin: 0 2px 0 0; }
.filters input[type=number] { width: 64px; }
.morefilters { flex: 1 1 100%; }
.morefilters summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--mut); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.morefilters summary::before { content: "▸"; font-size: 11px; }
.morefilters[open] summary::before { content: "▾"; }
.morefilters summary .count { font-size: 11px; background: var(--tint); color: var(--accent-text); padding: 2px 6px; }
.morebody { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.main.loading { min-height: 60vh; }
.skeleton { margin-top: 30px; }
.sk-h { height: 34px; width: 40%; background: var(--panel-2); }
.sk-l { height: 14px; width: 60%; margin-top: 12px; background: var(--panel-2); }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 28px; }
.sk-grid div { aspect-ratio: 16/11; background: var(--panel-2); }
@media (max-width: 900px) {
  .side nav { display: block; white-space: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .side .navhead { display: inline-block; padding: 8px 6px 8px 10px; }
  .side .navitem { display: inline-flex; width: auto; padding: 8px 10px; }
}
@media (max-width: 900px) {
  .side, .main { min-width: 0; }
  .side nav { max-width: 100%; }
  .workspace { max-width: 100%; }
}

/* Personal Run of show */
.ros-context { border: 1px solid var(--line); background: var(--panel); padding: 12px 16px; margin-top: 14px; }
.ros-context summary { cursor: pointer; font-weight: 700; }
.ros-order { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 12px; margin-bottom: 8px; }
.ros-order a { flex: 1; font-weight: 700; }
.ros-number { color: var(--accent-text); font-weight: 800; width: 24px; }
.ros-empty { padding: 20px; margin-bottom: 12px; }
.ros-cards { display: grid; gap: 18px; }
.ros-card { background: var(--panel); border: 1px solid var(--line); padding: 22px; }
.ros-card-head { display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; }
.ros-card-head h2 { margin: 0; font-size: 23px; line-height: 1.25; max-width: 840px; }
.ros-card-head h2 a:hover { color: var(--accent-text); }
.ros-card-head label { font-size: 12px; color: var(--mut); display: grid; gap: 4px; }
.ros-card select { padding: 7px; border: 1px solid var(--line); background: var(--panel-2); }
.ros-evidence { max-width: 960px; margin-top: 16px; }
.ros-evidence p { margin: 0 0 12px; }
.ros-prompter { font-size: 19px; line-height: 1.75; }
.ros-prompter h3 { font-size: 20px; }
.ros-evidence a, .ros-context .prose a { color: var(--accent-text); text-decoration: underline; }
.ros-note-label { display: grid; gap: 8px; font-weight: 700; margin-top: 16px; }
.ros-note-label textarea { resize: vertical; min-height: 100px; padding: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 400; width: 100%; }
.ros-note-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12px; }
@media (max-width: 700px) { .ros-card-head { flex-direction: column; } .ros-card { padding: 16px; } }

/* Run of show: candidates first, order and script at the bottom */
.ros-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ros-card.on { border-color: var(--red); }
.ros-card.off { opacity: .55; }
.ros-card.off .ros-evidence { display: none; }
.pill { display: inline-block; border: 1px solid var(--line); padding: 3px 8px; font-size: 12px; }
.pill.red { border-color: var(--red); color: var(--red); }
.ros-brief { border: 1px solid var(--line); padding: 14px 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ros-brief-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ros-script { border: 1px solid var(--line); padding: 16px 18px; margin-top: 10px; }
.ros-script-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.ros-script h2 { font-size: 22px; margin: 0 0 8px; }
.ros-script h3 { font-size: 17px; margin: 18px 0 6px; }

/* ---------- Manga Ink skin ----------
   Restyles only: ink outlines and solid offsets on panels, Anton headings and
   buttons, Geist Mono labels, yellow highlighter for whatever is selected. */
.side { border-right: 3px solid var(--line); }
.brand .mark { border: 2.5px solid var(--line); border-radius: 6px; box-shadow: 3px 3px 0 var(--shadow); }
.brand .name { font: 400 23px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.workspace { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; box-shadow: 4px 4px 0 var(--shadow); }
.workspace .dot { width: 10px; border-radius: 3px; border: 1.5px solid var(--line); }
.workspace .t { font-weight: 800; }
.navhead { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; }
.navitem { border: 2px solid transparent; border-radius: 8px; }
.navitem.on { background: var(--accent); color: var(--on-accent); border-color: var(--line); box-shadow: 3px 3px 0 var(--shadow); }
.side .foot { border-top: 2px solid var(--line); font: 500 10.5px/1.7 var(--mono); letter-spacing: .04em; }

.themeswitch { border: 2px solid var(--line); border-radius: 6px; box-shadow: 3px 3px 0 var(--shadow); }
.themeswitch button { border-radius: 3px; }
.themeswitch button.on { background: var(--accent); color: var(--on-accent); }

.h1 { font: 400 clamp(34px, 4vw, 50px)/1.08 var(--display); text-transform: uppercase; letter-spacing: 0; }
.h1 em { color: var(--on-accent); background: linear-gradient(transparent 22%, var(--accent) 22%, var(--accent) 88%, transparent 88%);
  padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sub { font-size: 14.5px; }
.pill { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); border: 2px solid var(--line); border-radius: 6px; }
.section-t { font: 400 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.section-t .mut { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: none; }

.stat, .filters, .formrow, .run, .job, .rbox, .hk, .idetail, .mkside, .trow, .xp, .ros-card, .ros-order,
.ros-context, .tw, .prose, .ilist, details.tx, .alert, pre.doc, .ros-brief, .ros-script {
  border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 5px 5px 0 var(--shadow); }
.kv > div, .f3 > div { border: 2px solid var(--line); border-radius: 8px; box-shadow: 3px 3px 0 var(--shadow); }
.trow.top, .hk.star { box-shadow: 5px 5px 0 var(--accent); }
.alert { box-shadow: 5px 5px 0 var(--accent); }
.pill.warn { border-color: var(--line); color: var(--text); background: var(--tint); }
.stat .k, .kv .k, dl.bd dt, th, .f3 .sm { font-family: var(--mono); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: 10.5px; }
.stat .v, .kv .v { font-family: var(--display); font-weight: 400; letter-spacing: 0; color: var(--text); }
.stat .v { font-size: 38px; }
.kv .v { font-size: 24px; }
th, td { border-bottom-color: var(--rule); }
.irow { border-bottom-color: var(--rule); }
.irow.on, .step.done { background: var(--accent); color: var(--on-accent); border-color: var(--line); }
.prose h2, .prose h3, .drawer h2, .idetail h2, .ros-script h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; }
.prose a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }

/* inputs */
.filters select, .filters input[type=search], .filters input[type=number], .field, .ros-card select, .ros-note-label textarea {
  border: 2px solid var(--line); border-radius: 6px; background: var(--panel); }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }

/* buttons: outlined with a solid offset; the primary one is the highlighter */
.btn { font: 400 14px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 10px 15px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 6px; box-shadow: 3px 3px 0 var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--line);
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.btn.red, .btn.red:hover { background: var(--accent); border-color: var(--line); color: var(--on-accent); }
.btn.ink { background: var(--text); border-color: var(--line); color: var(--bg); }
.btn.small { font-size: 12.5px; padding: 7px 10px; }
.tray { border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 6px 6px 0 var(--accent); }

/* cards */
.card { border: 2.5px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 5px 5px 0 var(--shadow); transition: transform .12s, box-shadow .12s; }
.card:hover { border-color: var(--line); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
.card.picked { outline: 4px solid var(--accent); outline-offset: 2px; }
.thumb { border-bottom: 2.5px solid var(--line); }
.card .meta, .wmeta, .job .meta { font-family: var(--mono); font-size: 11px; }
.card .meta b, .job .meta b, .wmeta b { font-family: var(--font); font-weight: 800; }
.card .ttl, .wttl { font-weight: 800; }
.tag { font: 500 10px var(--mono); letter-spacing: .12em; color: var(--on-accent); background: var(--accent); border: 1.5px solid var(--line); }
.tag.plain { color: var(--mut); background: transparent; border-color: var(--rule); }
.x { font: 400 15px/1.3 var(--display); letter-spacing: .03em; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.x.x10 { background: #111111; color: var(--accent); }
.brk { font-family: var(--mono); font-weight: 500; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.wcard .wimg { outline: 0; border: 2.5px solid var(--line); border-radius: 10px; box-shadow: 4px 4px 0 var(--shadow); }
.wcard.picked .wimg { outline: 4px solid var(--accent); outline-offset: 2px; }
.wcard .pick { border: 2px solid var(--line); border-radius: 6px; }
.face { border-radius: 8px; }
.face.on { border-color: var(--line); outline: 4px solid var(--accent); }
.empty { border: 2px dashed var(--line); border-radius: 12px; }

/* tabs, segments, chips */
.tabs { border-bottom: 3px solid var(--line); }
.tab { font: 400 17px var(--display); text-transform: uppercase; letter-spacing: .03em; border-bottom: 0; }
.tab.on { background: linear-gradient(transparent 22%, var(--accent) 22%, var(--accent) 88%, transparent 88%); color: var(--on-accent); }
.tab .mut { font: 500 10.5px var(--mono); }
.tab.on .mut { color: inherit; }
.seg { border: 2px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 3px 3px 0 var(--shadow); }
.seg button { font: 400 14px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on, .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--line); }
.chip { border: 2px solid var(--line); border-radius: 6px; font-weight: 600; }
.chip:hover { background: var(--tint); border-color: var(--line); }
.step { border: 2px solid var(--line); border-radius: 6px; font: 400 14px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.toast { border: 2.5px solid var(--line); border-radius: 8px; box-shadow: 4px 4px 0 var(--accent); }
dialog.drawer { border-left: 3px solid var(--line); }
.drawer .top { border-bottom: 2.5px solid var(--line); }
.drawer .hero, .idetail .hero { border: 2.5px solid var(--line); border-radius: 10px; }
.hlbox, dl.bd dd.hl, .ver { border-left-width: 4px; }
.tellflag { font-family: var(--mono); font-weight: 500; border: 1.5px solid currentColor; }
kbd { font-family: var(--mono); border-radius: 3px; }

/* ---------- dashboard boxes (What's winning), paged alerts, hook info card ---------- */
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 22px; margin-top: 26px; align-items: start; }
.dbox { background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 5px 5px 0 var(--shadow); padding: 18px 22px 20px; min-width: 0; }
.dbox[hidden] { display: none; }
.dbox.wide { grid-column: 1 / -1; }
.dbox.tldr { box-shadow: 6px 6px 0 var(--accent); }
.dbox.tldr .dbody { font-size: 17px; line-height: 1.6; }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dhead h2 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 22px; letter-spacing: .01em; }
.dbox.tldr .dhead h2 { background: var(--accent); color: var(--on-accent); padding: 0 6px; }
.dx { border: 0; background: none; color: var(--mut); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.dx:hover { color: var(--text); }
.prose.dbody { max-width: none; background: none; border: 0; box-shadow: none; padding: 0; margin: 0; font-size: 14.5px; }
.prose.dbody ul, .prose.dbody ol { padding-left: 18px; margin: 6px 0; }
.prose.dbody p:first-child { margin-top: 0; }
.dashgrid { margin-top: 4px; }
.boxlink { display: inline-block; margin-top: 14px; font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.custom { margin-top: 18px; background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.custom[hidden] { display: none; }
.custlist { display: flex; flex-wrap: wrap; gap: 8px 16px; flex: 1 1 400px; }
.alerthead .pager { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.alerthead .pager .btn { min-width: 34px; }
.alerthead .pager .btn:disabled { opacity: .35; cursor: default; }
.hookinfo { margin-top: 26px; background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 5px 5px 0 var(--accent); padding: 18px 22px; max-width: 760px; }
.hookinfo .k, .hookinfo .sm { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.hookinfo h2 { margin: 4px 0 6px; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 26px; }
.hookinfo p { margin: 0 0 12px; font-size: 15px; }
.hookinfo .shape { font-weight: 800; font-size: 16px; margin-top: 4px; background: var(--tint); display: inline-block; padding: 4px 8px; }

/* ---------- Home, tabs, Analytics charts ---------- */
.navgap { height: 10px; }
.ptabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 2.5px solid var(--line); }
.ptab { padding: 8px 14px 9px; font-weight: 800; font-size: 13.5px; color: var(--mut); border: 2.5px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; margin-bottom: -2.5px; }
.ptab:hover { color: var(--text); }
.ptab.on { color: var(--text); background: var(--panel); border-color: var(--line); box-shadow: inset 0 -3px 0 var(--accent); }
a.stat.link { display: block; transition: transform .12s, box-shadow .12s; }
a.stat.link:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
.delta { font-family: var(--mono); font-weight: 500; font-size: 11px; padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.delta.up { background: var(--tint); color: var(--text); }
.delta.down { border: 1px solid var(--rule); color: var(--mut); }
.homegrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; margin-top: 26px; align-items: start; }
.hg-read { grid-column: span 7; } .hg-rise { grid-column: span 5; }
.hg-chart { grid-column: span 6; } .hg-best { grid-column: span 3; } .hg-todo { grid-column: span 3; }
@media (max-width: 1180px) { .hg-read, .hg-rise { grid-column: span 12; } .hg-chart { grid-column: span 12; } .hg-best, .hg-todo { grid-column: span 6; } }
@media (max-width: 760px) { .hg-best, .hg-todo { grid-column: span 12; } }
.sm-link { margin-top: 0; font-size: 12.5px; }
.hnext { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.hnext .k, .hookinfo .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.hnext ol { margin: 8px 0 0; padding-left: 20px; } .hnext li { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.rlist { display: flex; flex-direction: column; }
.rrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rrow:last-child { border-bottom: 0; }
.rrow:hover .rtt { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.rrow .x { flex: 0 0 auto; min-width: 52px; text-align: center; }
.rt { min-width: 0; font-size: 13px; } .rt .mut { font-family: var(--mono); font-size: 11px; }
.rtt { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid.one { grid-template-columns: 1fr; margin-top: 0; }
.todo { display: flex; flex-direction: column; gap: 8px; }
.todoi { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.todoi:hover { background: var(--tint); }
.todoi b { font-family: var(--display); font-weight: 400; font-size: 24px; min-width: 34px; }
.todoi span { flex: 1; font-size: 13.5px; line-height: 1.35; } .todoi i { font-style: normal; font-weight: 800; }
.vfilters { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; }
.vfilters .chips { margin-top: 6px; }
.vbox { margin-top: 24px; }
.vchart { width: 100%; overflow: hidden; }
.vchart svg { display: block; }
.vgrid { stroke: var(--rule); stroke-width: 1; }
.vgrid.one { stroke: var(--mut); stroke-dasharray: 0; opacity: .6; }
.vgrid.two { stroke: var(--accent); stroke-dasharray: 4 4; stroke-width: 1.5; }
.vbase { stroke: var(--line); stroke-width: 1.5; }
.vax { fill: var(--mut); font: 500 10.5px var(--mono); }
.vbar { fill: var(--accent); stroke: var(--line); stroke-width: 1.25; }
.vhit { fill: transparent; cursor: default; }
.vhit:hover { fill: var(--tint); opacity: .5; }
.vdot { fill: var(--mut); opacity: .45; stroke: var(--panel); stroke-width: 2; cursor: pointer; }
.vdot.hit { fill: var(--accent); opacity: 1; stroke: var(--line); stroke-width: 1.5; }
.vdot:hover { opacity: 1; stroke: var(--line); }
.vtip { position: fixed; z-index: 50; pointer-events: none; max-width: 300px; background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 8px; box-shadow: 4px 4px 0 var(--shadow); padding: 8px 10px; font-size: 12.5px; line-height: 1.4; }
.vtip .mut { color: var(--mut); font-family: var(--mono); font-size: 11px; margin-top: 2px; }
.vnote { margin: 10px 0 0; font-size: 12px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.spark { vertical-align: middle; margin-left: 6px; }
.spark polyline { fill: none; stroke: var(--text); stroke-width: 2; }
.tw.flat { border: 0; box-shadow: none; margin-top: 4px; background: none; }
.hg-best .thumb { max-height: 240px; }
.hg-best .thumb img { object-fit: cover; height: 240px; }

/* collapsible nav groups */
.navhead.toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer; color: var(--mut); text-align: left; border-radius: 6px; }
.navhead.toggle:hover { color: var(--text); }
.navhead.toggle .caret { margin-left: auto; font-size: 15px; line-height: 1; color: var(--text); transition: transform .15s; }
.navhead.toggle:not(.open) .caret { transform: rotate(-90deg); }
.navhead.toggle .count { font: 700 10.5px/1 var(--font); letter-spacing: 0; background: var(--tint); color: var(--text); padding: 3px 6px; border-radius: 4px; }
.navgroup[hidden] { display: none; }

/* ---------- Drafts + script status ---------- */
.composer { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.composer .crow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.composer .k, .sstat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.composer select.field, .composer textarea.field, .composer input.field { width: 100%; }
.drafts { display: flex; flex-direction: column; gap: 12px; }
.draft { background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); }
.dtop { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; }
.dtop .dttl { flex: 1 1 260px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtop .dwhen { font-family: var(--mono); font-size: 11px; }
.dtop .caret { transition: transform .15s; } .draft:not(.open) .dtop .caret { transform: rotate(-90deg); }
.dbody2 { padding: 0 16px 16px; }
.dbody2[hidden] { display: none; }
.dtext { width: 100%; font: 14px/1.55 var(--font); }
.ditems { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.ditem { border: 2px solid var(--line); border-radius: 10px; padding: 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.ditem .mut { font-family: var(--mono); font-size: 11px; color: var(--mut); }
.dtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.derr { border: 2px solid var(--line); border-left: 6px solid var(--text); border-radius: 8px; padding: 10px 12px; background: var(--panel-2); font-size: 13.5px; }
.derr b { display: block; margin-bottom: 4px; }
.dstate { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--line); white-space: nowrap; }
.dstate.q { color: var(--mut); border-style: dashed; }
.dstate.run { background: var(--tint); color: var(--text); }
.dstate.ok { background: var(--accent); color: var(--on-accent); }
.dstate.bad { background: var(--text); color: var(--bg); }
.dstate.bad::before { content: "!"; font-weight: 900; }
.dstate.ok::before { content: "✓"; }
.spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cqspin .8s linear infinite; }
@keyframes cqspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-right-color: currentColor; opacity: .6; } }
.sstat { margin: 14px 0 4px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sstat.failed { border-left: 6px solid var(--text); }
.sstat.done { box-shadow: 4px 4px 0 var(--accent); }
.sstat .smsg { flex: 1 1 100%; font-size: 13.5px; }
.irow .dstate { padding: 3px 6px; font-size: 10px; margin-top: 4px; }

/* post drawer: one Save, one Use this menu */
.saverow { align-items: center; }
.usemenu { position: relative; }
.usemenu > summary { list-style: none; cursor: pointer; }
.usemenu > summary::-webkit-details-marker { display: none; }
.umenu { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; min-width: 260px; display: flex; flex-direction: column; background: var(--panel); border: 2.5px solid var(--line); border-radius: 10px; box-shadow: 5px 5px 0 var(--shadow); overflow: hidden; }
.umenu button { text-align: left; border: 0; background: none; padding: 11px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--rule); }
.umenu button:last-child { border-bottom: 0; }
.umenu button:hover { background: var(--tint); }
.savemore { flex: 1 1 100%; }
.savemore summary { cursor: pointer; color: var(--mut); }

/* Refresh & rules: everyday controls first, Advanced folded */
.runs.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.preset { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); cursor: pointer; font-size: 13.5px; }
.preset b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 20px; }
.preset.on { background: var(--accent); color: var(--on-accent); }
.preset:hover { transform: translate(-1px, -1px); }
details.advanced { margin-top: 30px; border-top: 2.5px solid var(--line); padding-top: 14px; }
details.advanced > summary { cursor: pointer; font-weight: 800; }

/* Setup checklist */
.sprog { height: 10px; border: 2px solid var(--line); border-radius: 6px; margin-top: 18px; overflow: hidden; background: var(--panel); }
.sprog i { display: block; height: 100%; background: var(--accent); }
.ssteps { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; max-width: 860px; }
.sstep { background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); }
.stop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.stop b { flex: 1; font-size: 15px; } .stop .mut { font-family: var(--mono); font-size: 11px; color: var(--mut); }
.sn { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.sstep.is-done .sn { background: var(--accent); color: var(--on-accent); }
.sstep:not(.open) .caret { transform: rotate(-90deg); }
.sbody { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.sbody[hidden] { display: none; }
.sbody .pf { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13.5px; }
.sbody .field { width: 100%; }
.sbody .btn { align-self: flex-start; }
.setupbar { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 18px; background: var(--accent); color: var(--on-accent); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); }
.setupbar b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 20px; }
.setupbar span { flex: 1; font-size: 14px; } .setupbar i { font-style: normal; font-weight: 900; font-size: 20px; }
.twrow { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.twlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.twopt { text-align: left; border: 2px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 8px 10px; font: 600 13.5px/1.4 var(--font); cursor: pointer; }
.twopt:hover { background: var(--tint); }

/* ---------- phone layout: Menu button instead of a sideways nav ---------- */
.menubtn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 30; padding: 10px 16px; border-right: 0; border-bottom: 2.5px solid var(--line); height: auto; max-height: 100vh; overflow-y: auto; }
  .brand { padding: 0; }
  .menubtn { display: inline-flex; margin-left: auto; border: 2.5px solid var(--line); border-radius: 8px; background: var(--accent); color: var(--on-accent); font: 400 16px/1 var(--display); text-transform: uppercase; padding: 8px 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); }
  .side .workspace, .side nav, .side .foot { display: none; }
  body.navopen .side .workspace { display: flex; margin-top: 14px; }
  body.navopen .side nav { display: block; white-space: normal; overflow: visible; margin-top: 8px; }
  body.navopen .side .foot { display: block; }
  body.navopen .side .navhead, .side .navhead.toggle { display: flex; width: 100%; padding: 14px 10px 6px; }
  body.navopen .side .navitem { display: flex; width: 100%; padding: 11px 12px; font-size: 15px; }
  .side .navgroup { display: block; }
  .side .navgroup[hidden] { display: none; }
  .headrow { flex-wrap: wrap; gap: 12px; }
  .h1 { font-size: clamp(34px, 9vw, 54px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; } .stat .v { font-size: 30px; }
  .homegrid, .dash { gap: 16px; }
  .dbox { padding: 14px 16px 16px; }
  .vfilters .chips, #rfmt { flex-wrap: nowrap; overflow-x: auto; }
  .drawer .saverow { flex-wrap: wrap; }
  .umenu { min-width: min(260px, 80vw); }
}
@media (max-width: 900px) { .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; } .tabs .tab { flex: 0 0 auto; } .ptabs { overflow-x: auto; } .ptab { flex: 0 0 auto; } }
.replies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.reply { background: var(--panel); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.reply .rtext { font-weight: 700; font-size: 14.5px; line-height: 1.45; }

/* Team */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-top: 18px; }
.rolec { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rolec b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 18px; }
.rolenote { margin: -8px 0 18px; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 10px; font-size: 13.5px; background: var(--panel-2); }
.noaccess { max-width: 640px; margin: 10vh auto 0; }
