/* AI Team Cockpit — shared tokens, base styles and app shell. Every page loads this first. */
:root {
  color-scheme: light;
  --bg: #F2F2EF; --surface: #FFFFFF; --sunken: #EAEAE6; --line: #E1E1DC; --line2: #C9C9C2;
  --ink: #17171A; --text2: #44444A; --text3: #616168;
  --accent: #EC6636; --on-accent: #16120F; --accent-soft: #FBE3D8; --accent-text: #B5461F; --sel: #FCEDE6;
  --brand-grad: linear-gradient(145deg, #F59A75 0%, #EC6636 55%, #D9541F 100%); --brand-on: #EC6636;
  --hot: #A15C07; --hot-soft: #FDF0D5;
  --check: #0F6E68; --check-soft: #DDF1EE;
  --neg: #9F1239; --neg-soft: #FCE4EA;
  --pos: #20743A; --pos-soft: #DCF0E1;
  --dots: #D9D9D2;
  /* department sticky colors */
  --d-conv: #FFE9A8; --d-inb: #FFD1C7; --d-pmp: #CFE0F5; --d-trk: #CFE8D5; --d-cre: #E1D5F5;
  --note-ink: #17171A; --note-meta: #44444A;
  --tape: rgba(255, 255, 255, .62); --note-shadow: 0 2px 0 rgba(26, 26, 26, .10);
  --f-head: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* The iPhone system fonts: SF Pro and SF Mono (Yan, November 16, 2026); Segoe UI/Consolas on Windows, Roboto on Android */
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131314; --surface: #1B1B1D; --sunken: #242427; --line: #2E2E32; --line2: #48484E;
  --ink: #F0F0EE; --text2: #BCBCC2; --text3: #909097;
  --accent: #EC6636; --on-accent: #16120F; --accent-soft: #3B2119; --accent-text: #F59A75; --sel: #2A1B15; --brand-on: #EC6636;
  --hot: #F0B44C; --hot-soft: #33260F;
  --check: #5FD1C4; --check-soft: #143230;
  --neg: #FB7185; --neg-soft: #3A1720;
  --pos: #6FD08C; --pos-soft: #163020;
  --dots: #252529;
  --d-conv: #4A4128; --d-inb: #4A302B; --d-pmp: #2B3A4D; --d-trk: #2B4031; --d-cre: #3A3150;
  --note-ink: #F1EEE8; --note-meta: #D3CEC6;
  --tape: rgba(255, 255, 255, .10); --note-shadow: 0 2px 0 rgba(0, 0, 0, .40);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131314; --surface: #1B1B1D; --sunken: #242427; --line: #2E2E32; --line2: #48484E;
    --ink: #F0F0EE; --text2: #BCBCC2; --text3: #909097;
    --accent: #EC6636; --on-accent: #16120F; --accent-soft: #3B2119; --accent-text: #F59A75; --sel: #2A1B15; --brand-on: #EC6636;
    --hot: #F0B44C; --hot-soft: #33260F;
    --check: #5FD1C4; --check-soft: #143230;
    --neg: #FB7185; --neg-soft: #3A1720;
    --pos: #6FD08C; --pos-soft: #163020;
    --dots: #252529;
    --d-conv: #4A4128; --d-inb: #4A302B; --d-pmp: #2B3A4D; --d-trk: #2B4031; --d-cre: #3A3150;
    --note-ink: #F1EEE8; --note-meta: #D3CEC6;
    --tape: rgba(255, 255, 255, .10); --note-shadow: 0 2px 0 rgba(0, 0, 0, .40);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
kbd {
  font-family: var(--f-mono); font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent); color: inherit; opacity: .85;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--f-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- Page frame ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }

.side {
  flex: 1 1 224px; max-width: 100%; padding: 18px 12px; display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; text-decoration: none; }
/* The ClickOn mark (spark cursor on an orange tile, the website orange #EC6636) and wordmark (Click + italic serif On): crew/assets/brand/ */
.brand-mark { flex: 0 0 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); color: #FFFFFF; display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(120, 50, 20, .22); }
.cm-svg { width: 68%; height: 68%; }
.wordmark { font-family: var(--f-head); font-weight: 700; letter-spacing: -0.03em; }
.wordmark i { font-family: "Instrument Serif", ui-serif, "New York", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.14em;
  letter-spacing: -0.01em; color: var(--brand-on); margin-left: .03em; }
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name b { font-family: var(--f-head); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-name span { font-size: 11.5px; color: var(--text3); }
.nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text2); text-decoration: none; font-size: 13px;
}
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.nav svg { flex: 0 0 16px; }
.nav .label { flex: 1; font-size: inherit; font-weight: inherit; text-transform: none; letter-spacing: normal; color: inherit; }
.nav .count { font-family: var(--f-mono); font-size: 11px; color: var(--text3); }
.nav .badge { font-family: var(--f-mono); font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.nav .down { font-family: var(--f-mono); font-size: 11px; color: var(--neg); }
.test-chip {
  margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 10px;
  background: var(--check-soft); color: var(--check); font-size: 12px; line-height: 1.35;
}
.test-chip b { font-weight: 600; display: flex; align-items: center; gap: 6px; }

.work {
  flex: 999 1 560px; min-width: 0; padding: 26px 48px 64px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.crumb { font-family: var(--f-mono); font-size: 12px; color: var(--text3); background: var(--bg); padding: 2px 4px; border-radius: 4px; }
.topbar .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px;
  font: 500 13px/1 var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--text3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; padding: 0 12px 0 16px; }
.btn.primary:hover { filter: brightness(.94); }
.btn.small { height: 30px; font-size: 12.5px; }

.cols { display: flex; flex-wrap: wrap; gap: 36px 40px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; max-width: 680px; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 30px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-head .meta { font-size: 12px; color: var(--text3); }
.card-head .push { margin-left: auto; }
.text-link { color: var(--accent-text); text-decoration: none; font-size: 12.5px; font-weight: 500; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Desk characters ---------- */
.tile {
  --tile: var(--sunken);
  position: relative; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
  background: var(--tile); color: var(--note-ink); display: grid; place-items: center;
  border: 1.5px solid transparent;
}
.tile svg { width: 22px; height: 22px; display: block; }
.tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.tile.sm svg { width: 17px; height: 17px; }
.tile[data-dept="conv"] { --tile: var(--d-conv); }
.tile[data-dept="inb"] { --tile: var(--d-inb); }
.tile[data-dept="pmp"] { --tile: var(--d-pmp); }
.tile[data-dept="trk"] { --tile: var(--d-trk); }
.tile[data-dept="cre"] { --tile: var(--d-cre); }
.tile[data-state="idle"] { background: color-mix(in srgb, var(--tile) 42%, var(--surface)); border: 1.5px dashed var(--text3); }
.tile[data-state="idle"] svg { opacity: .7; }
.tile[data-state="down"] { border: 1.5px dashed var(--neg); }
.yan { background: var(--ink); color: var(--bg); font-family: var(--f-head); font-weight: 600; font-size: 14px; }

/* ---------- Shared bits used across pages ---------- */
.label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.hint { font-size: 12px; color: var(--text3); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.chip.you { background: var(--accent); color: var(--on-accent); }
.chip.hot { background: var(--hot-soft); color: var(--hot); }
.chip.check { background: var(--check-soft); color: var(--check); }
.chip.neg { background: var(--neg-soft); color: var(--neg); }
.chip.pos { background: var(--pos-soft); color: var(--pos); }
.chip.idle, .chip.muted { background: var(--sunken); color: var(--text2); }
.chip.blocked { background: var(--neg-soft); color: var(--neg); }
.chip.blocked::before { content: ""; width: 12px; height: 10px; border-radius: 2px; background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, var(--ink) 3px 6px); }
.state { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.state.run { background: var(--pos); }
.state.you { background: var(--accent); border-radius: 2px; }
.state.idle { border: 1.5px dashed var(--text3); }
.state.down { background: var(--neg); transform: rotate(45deg); border-radius: 1px; }
.yan { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--f-head); font-weight: 600; font-size: 14px; }
.yan.lg { flex-basis: 44px; width: 44px; height: 44px; border-radius: 10px; font-size: 16px; }
.page-title { font-size: 22px; }
.input { font: inherit; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--sel); }
.meter { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 12px; }
.meter .bar { position: relative; width: 56px; height: 4px; border-radius: 2px; background: var(--line); }
.meter .bar i { position: absolute; left: 0; top: 0; height: 4px; border-radius: 2px; background: var(--ink); }
.meter .bar b { position: absolute; top: -2px; width: 1px; height: 8px; background: var(--text3); }
.conf { display: inline-flex; align-items: flex-end; gap: 1.5px; margin-right: 5px; }
.conf i { width: 3px; border-radius: 1px; background: var(--line2); }
.conf i:nth-child(1) { height: 6px; } .conf i:nth-child(2) { height: 8px; } .conf i:nth-child(3) { height: 10px; }
.conf.high i { background: var(--pos); } .conf.med i:nth-child(-n+2) { background: var(--check); } .conf.low i:nth-child(1) { background: var(--neg); }
