/* TSC HQ styles. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font-body); }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--pink-deep); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--black); color: var(--white); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 36px; }

/* ---- demo ribbon and top bar ------------------------------------------- */
.demo-ribbon { position: sticky; top: 0; z-index: 60; height: var(--ribbon-h); display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--yellow); color: var(--black); font-size: 13px; letter-spacing: .02em; border-bottom: 1px solid #141114; }
.topbar { position: sticky; top: var(--ribbon-h); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 10px var(--gap); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--pink); color: var(--black);
  font: 700 15px/1 var(--font-display); letter-spacing: .02em; }
.brand-word { font: 700 18px/1.1 var(--font-display); white-space: nowrap; }
.brand-tag { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: var(--black); color: var(--yellow); letter-spacing: .06em; }
.nav { order: 3; flex-basis: 100%; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-item { position: relative; border: 0; background: transparent; padding: 7px 11px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.is-active { background: var(--black); color: var(--white); }
.nav-settings { margin-left: auto; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: var(--ok-bg); color: #14532D; font-size: 13px; white-space: nowrap; }
.pill.is-paused { background: var(--idle-bg); color: var(--muted); }
.pill-tag, .tag, .board-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 999px; }
.pill-tag { background: var(--white); color: var(--muted); }
.tag { background: var(--idle-bg); color: var(--muted); }
.tag-demo { background: var(--yellow); color: var(--black); }
.board-tag { background: var(--yellow); color: var(--black); vertical-align: 1px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.cos-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--pink); color: var(--black); padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.cos-btn:hover { background: #EC9DBD; }
.badge { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--black); color: var(--yellow); font-size: 12px; }
.owner-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--white); font-weight: 700; }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(21, 128, 61, .5); animation: pulse 2s infinite; flex: none; }
.is-paused .pulse-dot { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, .45); } 70% { box-shadow: 0 0 0 7px rgba(21, 128, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); } }


/* ---- layout ------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: var(--gap); padding: var(--gap); align-items: start; }
.main { min-width: 0; outline: none; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.rail { display: grid; gap: 14px; }
@media (max-width: 1279px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
  /* The decisions sit below the scene here, so the war room offers a jump to them. */
  .head-actions .jump-decisions { display: inline-flex; }
}

/* ---- buttons, chips ------------------------------------------------------ */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid transparent; border-radius: 999px;
  padding: 9px 16px; font-weight: 700; font-size: 14px; line-height: 1.2; text-align: center; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-xs { padding: 5px 11px; font-size: 12px; }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: #2c262c; }
.btn-pink { background: var(--pink); color: var(--black); }
.btn-pink:hover { background: #EC9DBD; }
.btn-light { background: var(--white); border-color: var(--line-strong); color: var(--ink); }
.btn-light:hover { background: var(--surface-2); }
.btn-outline { background: var(--white); border-color: var(--black); color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-link { background: transparent; color: var(--pink-deep); text-decoration: underline; padding-left: 4px; padding-right: 4px; }
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; background: var(--white); border-color: var(--line-strong); color: var(--ink); }
.btn-note { font-size: 10px; font-weight: 500; opacity: .85; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--white); font-size: 18px; line-height: 1; flex: none; }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: #166534; }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.info { background: var(--info-bg); color: var(--info); }
.status.muted { background: var(--idle-bg); color: var(--idle); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-static { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-body); }

/* ---- avatars ------------------------------------------------------------ */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 800; flex: none; letter-spacing: .02em; }
.avatar-xs { width: 26px; height: 26px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-cos { background: var(--pink); color: var(--black); }
.avatar-researcher { background: var(--pink-deep); color: var(--white); }
.avatar-seo { background: var(--black); color: var(--yellow); }
.avatar-campaign { background: var(--yellow); color: var(--black); box-shadow: inset 0 0 0 1px #141114; }
.avatar-fact { background: #3A3A40; color: var(--white); }

/* ---- cards --------------------------------------------------------------- */
.card, .rail-card, .scene-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card, .rail-card { padding: 18px; }
.card-head, .rail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title, .rail-title { font: 700 18px/1.25 var(--font-display); }
.rail-sub, .card-note { font-size: 13px; color: var(--muted); }
.strong-note { color: var(--ink); background: var(--surface-2); border-left: 3px solid var(--pink); padding: 6px 10px; border-radius: 6px; margin-bottom: 12px; }
.mini-head { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }

/* ---- view head ----------------------------------------------------------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.jump-decisions { display: none; text-decoration: none; }
#rail-top { scroll-margin-top: 12px; }
#rail-top:focus { outline: none; }
#rail-top:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.greeting, .view-title { font: 700 32px/1.15 var(--font-display); letter-spacing: -.01em; }
.subline { color: var(--muted); margin-top: 6px; max-width: 70ch; }

/* ---- war room scene ------------------------------------------------------ */
.scene-card { overflow: hidden; }
.board { background: var(--black); color: var(--white); padding: 12px 16px; }
.board-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 12px; }
.board-cell dt { font-size: 12px; color: #E9DDE6; }
.board-cell dd { font: 700 26px/1.15 var(--font-display); color: var(--yellow); margin-top: 2px; font-variant-numeric: tabular-nums; }
.board-cell dd.idea { font: 600 14px/1.3 var(--font-body); }
.scene { position: relative; aspect-ratio: 1000 / 560; }
.scene-art, .scene-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-overlays { position: absolute; inset: 0; }
.plaque { position: absolute; transform: translate(-50%, calc(-100% - 6px - var(--lift, 0px))); display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: 0 2px 6px rgba(20, 17, 20, .18); text-align: left; max-width: 150px; }
.plaque:hover { border-color: var(--black); }
.plaque::before { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: calc(6px + var(--lift, 0px)); background: rgba(20, 17, 20, .55); transform: translateX(-1px); }
.plaque.is-selected { background: var(--black); color: var(--white); border-color: var(--black); }
.plaque-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.plaque-name { font-size: 12px; font-weight: 800; white-space: nowrap; }
.plaque-status { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.plaque.is-selected .plaque-status { color: #86EFAC; }
.plaque .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.plaque.is-paused .plaque-status { color: var(--muted); }
.plaque.is-selected.is-paused .plaque-status { color: #E9DDE6; }
.plaque.is-last::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--black); }
.plaque-open { position: absolute; transform: translate(-50%, -50%); font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .9);
  border: 1px dashed var(--line-strong); border-radius: 999px; padding: 2px 8px; white-space: nowrap; pointer-events: none; }
.weather-switch { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end;
  background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 4px 4px 4px 10px; box-shadow: 0 2px 6px rgba(20, 17, 20, .15); }
.ws-label { font-size: 12px; font-weight: 700; margin-right: 2px; }
.ws-btn { border: 0; background: transparent; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ws-btn:hover { background: var(--surface-2); }
.ws-btn.is-on { background: var(--black); color: var(--white); }
.ws-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: var(--line); }
.legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .95); border-radius: 12px; padding: 8px 12px; box-shadow: 0 2px 6px rgba(20, 17, 20, .15); font-size: 12px; max-width: 46%; }
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-trailer { background: var(--pink); }
.sw-shop { background: var(--black); }
.sw-open { background: transparent; border: 1px dashed var(--muted); }
.legend-note { color: var(--muted); font-size: 11px; margin-top: 3px; }
.scene-actions { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.scene-actions .btn { box-shadow: 0 2px 6px rgba(20, 17, 20, .2); }

/* scene animation */
.scene-svg .drift { animation: drift 28s ease-in-out infinite alternate; }
.scene-svg .drift.slow { animation-duration: 40s; }
.scene-svg .rain { animation: fall-rain .5s linear infinite; }
.scene-svg .snow { animation: fall-snow 5s linear infinite; }
@keyframes drift { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes fall-rain { from { transform: translateY(0); } to { transform: translateY(44px); } }
@keyframes fall-snow { from { transform: translateY(0); } to { transform: translateY(48px); } }

/* ---- rail ----------------------------------------------------------------- */
.approve-all-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; }
.ask-list { display: grid; gap: 8px; }
.ask-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ask-text { flex: 1; font-size: 13px; min-width: 0; }
.ask-agent { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.featured-ask { margin-top: 10px; border: 2px solid var(--pink); border-radius: var(--radius-sm); padding: 12px; background: var(--pink-soft); }
.featured-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.featured-text { font-weight: 700; margin: 8px 0 4px; }
.featured-detail { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.rail-note { margin-top: 10px; font-size: 12px; color: var(--muted); }
.caught-up { padding: 12px; border-radius: var(--radius-sm); background: var(--ok-bg); color: #14532D; font-weight: 600; }
.agent-card-top { display: flex; align-items: center; gap: 10px; }
.agent-id { flex: 1; min-width: 0; }
.status-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status-badge.ok { background: var(--ok-bg); color: #166534; }
.status-badge.idle { background: var(--idle-bg); color: var(--idle); }
.right-now { margin: 12px 0; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.right-now .label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.agent-one { font-size: 14px; margin-bottom: 10px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.stat-tile .label { display: block; font-size: 11px; color: var(--muted); }
.stat-tile .num { font: 700 20px/1.2 var(--font-display); }
.plain-list { display: grid; gap: 6px; font-size: 14px; }
.plain-list li { padding-left: 14px; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { border: 0; background: transparent; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--pink-deep); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.live.is-paused { color: var(--muted); }
.feed { display: grid; gap: 0; }
.feed-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.feed-item:first-child { border-top: 0; }
.feed-time { color: var(--muted); white-space: nowrap; font-size: 12px; }
.ask-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.ask-row-input, .ask-form[data-form="drawer"] { display: flex; gap: 8px; }
.ask-form input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 14px; background: var(--white); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--black); color: var(--yellow); font-size: 18px; flex: none; }

/* ---- drawer --------------------------------------------------------------- */
.drawer { position: fixed; top: var(--ribbon-h); right: 0; bottom: 0; z-index: 50; width: min(420px, 100vw); display: flex; flex-direction: column; gap: 12px;
  background: var(--white); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(20, 17, 20, .15); padding: 18px;
  transform: translateX(105%); transition: transform .25s ease; visibility: hidden; }
.drawer.is-open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; gap: 10px; }
.drawer-title { font: 700 20px/1.2 var(--font-display); }
.drawer-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14px; }
.msg-cos { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.msg-you { background: var(--black); color: var(--white); align-self: flex-end; }
.msg-from { display: block; font-size: 11px; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--white); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.chip:hover { background: var(--surface-2); }

/* ---- toast ---------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; pointer-events: none; }
.toast-msg { background: var(--black); color: var(--white); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }

/* ---- marketing ------------------------------------------------------------- */
.agent-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.agent-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.agent-tile-top { display: flex; align-items: center; gap: 8px; }
.agent-tile-top h3 { font-size: 14px; margin-bottom: 2px; }
.agent-task { font-size: 13px; flex: 1; }
.agent-meta { font-size: 12px; color: var(--muted); }
.mk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--gap); align-items: start; }
.brief { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 14px; }
.brief .wide { grid-column: 1 / -1; }
.brief dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.brief dd { font-size: 14px; }
.timeline { display: grid; gap: 0; margin-bottom: 12px; }
.stage { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.stage::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--line-strong); margin-top: 3px; flex: none; position: relative; }
.stage-completed .stage-dot { border-color: var(--ok); background: var(--ok); }
.stage-awaiting-user .stage-dot, .stage-cancel-requested .stage-dot { border-color: var(--warn); }
.stage-running .stage-dot { border-color: var(--info); }
.stage-blocked .stage-dot, .stage-failed .stage-dot { border-color: var(--bad); }
.stage-body { flex: 1; min-width: 0; }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.stage-last { font-size: 13px; }
.stage-meta { font-size: 12px; color: var(--muted); }
.field { padding: 10px 0; border-top: 1px solid var(--line); }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.field-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field-value { font-size: 14px; }
.count { font-size: 12px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.count.over { color: var(--bad); }
.edit-form { display: grid; gap: 8px; }
.edit-form input { border: 1px solid var(--black); border-radius: 10px; padding: 8px 10px; width: 100%; }
.faqs { border-top: 1px solid var(--line); padding: 10px 0; }
.faqs summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.faqs dl { display: grid; gap: 4px; margin-top: 8px; }
.faqs dt { font-weight: 700; font-size: 13px; margin-top: 6px; }
.wording ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.wording q { color: var(--muted); }
.empty-note { font-size: 14px; color: var(--muted); padding: 12px 0; }
.variant-body { white-space: pre-line; }
.faqs dd { font-size: 13px; }
.cite { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.variant { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.variant h3 { font: 700 15px/1.3 var(--font-display); }
.variant p { font-size: 13px; flex: 1; }
.variant-claims { font-size: 11px; color: var(--muted); }
.variant.is-picked { border: 2px solid var(--black); background: var(--pink-soft); }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.actions { white-space: nowrap; }
td.actions .btn + .btn { margin-left: 4px; }
.row-note { display: block; font-size: 12px; color: var(--muted); }
tr.is-removed td:nth-child(2) { text-decoration: line-through; color: var(--muted); }


/* ---- chunk 2 screens ---- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.num-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.num-tile dt { font-size: 12px; color: var(--muted); }
.num-tile dd { font: 700 26px/1.15 var(--font-display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.num-note { font-size: 12px; color: var(--muted); }
.agent-slot { display: flex; gap: 12px; align-items: center; border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 16px; background: transparent; }
.agent-slot-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--muted); color: var(--muted); font-weight: 700; flex: none; }
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--pink); border-radius: 999px; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 700; }

/* pipeline */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kan-col { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; }
.kan-head { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 8px; }
.kan-count { font-size: 12px; background: var(--white); border-radius: 999px; padding: 0 8px; }
.kan-list { display: grid; gap: 8px; }
.kan-empty { font-size: 12px; color: var(--muted); }
.lead { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 4px; }
.lead-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 6px; font-size: 13px; }
.lead-top .chip-static { font-size: 11px; padding: 1px 7px; white-space: nowrap; }
.lead-job { font-size: 13px; }
.lead-meta, .lead-next { font-size: 12px; color: var(--muted); }
.lost-list, .wait-list, .audit-list, .addon-list, .check-list, .review-list { display: grid; gap: 8px; }
.lost-list li, .wait-list li, .addon-list li, .check-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* brain */
.brain-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.brain-graph { position: relative; height: 300px; }
.brain-lines { position: absolute; left: 34%; width: 32%; top: 0; height: 100%; overflow: visible; }
.brain-lines line { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.brain-lines line.is-lit { stroke: var(--pink-deep); stroke-width: 2; }
.brain-btn { position: absolute; transform: translateY(-50%); width: 34%; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--white); font-size: 12px; font-weight: 700; text-align: left; }
.brain-btn:hover { border-color: var(--black); }
.brain-agent { left: 0; }
.brain-node { right: 0; justify-content: center; }
.brain-btn.is-on { background: var(--black); color: var(--white); border-color: var(--black); }
.brain-detail { border-left: 1px solid var(--line); padding-left: 16px; min-height: 120px; }
.brain-node-name { font-weight: 700; font-size: 13px; margin: 8px 0 4px; }
.spend-line { font-size: 14px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* crew */
.sched td, .sched th { width: 18%; }
.sched th:first-child { width: 10%; }
.sched .is-today { background: var(--pink-soft); }
.today-tag { font-size: 10px; background: var(--pink); color: var(--black); border-radius: 999px; padding: 0 6px; text-transform: none; }
.sky-row td { font-size: 12px; color: var(--muted); }
.sky-row td.is-wet { color: var(--info); font-weight: 700; }
.slot-job { display: grid; gap: 2px; font-size: 12px; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--pink); border-radius: 6px; padding: 6px 8px; }
.slot-job span { color: var(--muted); }
.slot-job .btn { justify-self: start; padding-left: 0; }
.slot-open { font-size: 12px; color: var(--muted); }

/* social */
.social-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { min-height: 92px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: grid; align-content: start; gap: 4px; }
.cal-day.is-today { border-color: var(--pink-deep); background: var(--pink-soft); }
.cal-date { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-post { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; background: var(--white); font-size: 11px; }
.cal-post:hover { border-color: var(--black); }
.cal-post.is-on { outline: 2px solid var(--black); }
.cal-facebook { border-left: 3px solid var(--pink-deep); }
.cal-gbp { border-left: 3px solid var(--black); }
.cal-ch { color: var(--muted); font-size: 10px; }
.cal-title { font-weight: 700; line-height: 1.2; }
.cal-post .status { font-size: 10px; padding: 0 6px; justify-self: start; }
.post-body { font-size: 14px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; margin: 10px 0; }
.post-body.is-empty { color: var(--muted); font-style: italic; }

/* reviews */
.review { border-bottom: 1px solid var(--line); padding-bottom: 10px; display: grid; gap: 6px; justify-items: start; }
.review-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.review textarea { width: 100%; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; }
.review .edit-form { width: 100%; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.meter span { display: block; height: 100%; background: var(--ok); }
.check-right { display: flex; gap: 6px; align-items: center; flex: none; }

/* settings */
.settings-panel { display: grid; gap: var(--gap); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.banner-paid { margin: 0; font-weight: 700; }
.usage-track { position: relative; height: 16px; border-radius: 999px; background: var(--surface-2); }
.usage-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pink); border-radius: 999px; }
.usage-fill.is-hot { background: var(--bad); }
.usage-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--black); }
.usage-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.usage-big { font-size: 15px; margin: 10px 0 4px; }
.usage-big strong { font: 700 24px/1 var(--font-display); }
.usage-meter { margin-bottom: 12px; }
.alert-list { display: grid; gap: 6px; justify-items: start; }
.alert-list .status { white-space: normal; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.setting-row select { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--white); }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 0; background: var(--line-strong); flex: none; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(20, 17, 20, .3); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--black); }
.switch[aria-checked="true"] span { left: 23px; background: var(--yellow); }
.prio-list { display: grid; gap: 6px; }
.prio-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.prio-list li.is-kept { border-color: var(--black); }
.prio-num { width: 18px; font-weight: 800; text-align: center; }
.prio-name { flex: 1; font-weight: 700; }
.prio-btns { display: flex; gap: 4px; }
.icon-btn-sm { width: 26px; height: 26px; font-size: 13px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.day-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; border-bottom: 1px solid var(--line-strong); }
.day-bar { flex: 1; background: var(--pink); border-radius: 4px 4px 0 0; min-height: 2px; }
.day-bar.is-today { background: var(--black); }
.day-bar.is-spike { background: var(--bad); }
.audit-list li { font-size: 13px; }
.audit-list time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.addon-list li > span:first-child { display: grid; gap: 2px; }

@media (max-width: 1100px) {
  .num-tiles, .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .settings-grid, .brain-wrap { grid-template-columns: minmax(0, 1fr); }
  .agent-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-grid { grid-template-columns: minmax(0, 1fr); }
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* chunk 3: real TSC material */
.variant p, .post-body { white-space: pre-line; }
.real-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-deep); border: 1px solid var(--pink); vertical-align: 1px; }
.lead-stage { justify-self: start; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.media-pending { display: grid; gap: 6px; margin: 10px 0; }
.media-pending img { display: block; width: 100%; max-width: 280px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.media-pending figcaption { font-size: 12px; color: var(--muted); }
.check-photo { display: grid; gap: 6px; }
.check-photo img { width: 96px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
@media (max-width: 1400px) { .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phone width: stack the top bar, calendar and boards. */
@media (max-width: 640px) {
  .topbar { position: static; }
  .topbar-right { flex-wrap: wrap; margin-left: 0; gap: 8px; }
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 0; }
  .cal-day:not(.is-today):not(:has(.cal-post)) { display: none; }
  .kanban, .num-tiles, .agent-tiles, .board-grid { grid-template-columns: minmax(0, 1fr); }
  #wr-head { flex-direction: column; align-items: stretch; }
  #wr-head .head-actions { justify-content: flex-start; }
}

/* ---- sign-in page ---------------------------------------------------------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; }
.login-title { font-family: var(--font-display); font-size: 26px; margin: 0 0 4px; }
.login-sub { color: var(--muted); margin: 0 0 18px; }
.login-form { display: grid; gap: 8px; }
.login-form input { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.login-form input:focus-visible { outline: 3px solid var(--pink); outline-offset: 1px; }
.login-form .btn { margin-top: 10px; justify-self: start; }
.login-error { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-sm); padding: 8px 10px; margin: 4px 0 0; }
.login-note { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.login-code { display: grid; gap: 8px; margin-top: 6px; }
.login-code[hidden] { display: none; }
.login-code .login-note { margin: 0; }
.secret-text { font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; letter-spacing: .06em; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0; user-select: all; }
.code-list { font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; padding: 10px 12px; margin: 8px 0; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form input { font: inherit; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); width: 12em; }
.inline-form input:focus-visible { outline: 3px solid var(--pink); outline-offset: 1px; }

/* ---- dialogs (password, yes/no, add and edit) ------------------------------ */
.modal { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(20, 17, 20, .25); }
.modal-wide { width: min(560px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(20, 17, 20, .45); }
.modal-form { display: grid; gap: 8px; padding: 22px 20px; }
.modal-title { font: 700 19px/1.25 var(--font-display); }
.modal-text { color: var(--muted); font-size: 14px; }
.modal-form input, .modal-form select, .modal-form textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.modal-form textarea { min-height: 84px; resize: vertical; }
.modal-form [aria-invalid="true"] { border-color: var(--bad); }
.modal-error { color: var(--bad); font-size: 13px; min-height: 0; }
.modal-error:empty { display: none; }
.modal-actions { margin-top: 8px; }
.modal-sample { font-size: 13px; background: var(--info-bg); color: var(--info); border-radius: var(--radius-sm); padding: 8px 10px; }
.field-error { color: var(--bad); font-size: 12px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sample-note { font-size: 13px; color: var(--info); background: var(--info-bg); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 12px; }
.load-error { margin: 24px var(--gap); padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); }
.cal-outside { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.backup-list { list-style: none; display: grid; gap: 8px; margin: 8px 0; }
.backup-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
#mock-select { max-width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--white); }
