/* Ticket board. One stylesheet, no framework.
   Stage colours are the validated categorical palette in its fixed order (light and dark each
   checked for colour-blind separation); every colour sits beside a text label, never alone.
   Status colours (good / warning / serious / critical) are kept for status only. */

:root {
  color-scheme: light;
  --bg: #f5f5f2;
  --bg-2: #ecebe6;
  --tint-1: rgba(61, 127, 224, .14);
  --tint-2: rgba(106, 85, 224, .10);
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #f2f1ed;
  --glass: rgba(247, 247, 244, .78);
  --line: rgba(20, 20, 18, .075);
  --line-2: rgba(20, 20, 18, .13);
  --text: #111110;
  --text-2: #4f4e4a;
  --text-3: #8a8982;
  --accent: #3d7fe0;
  --accent-2: #6a55e0;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --s-todo: #a3a29b;
  --s-doing: #2a78d6;
  --s-deploy: #eb6834;
  --s-waiting: #1baf7a;
  --s-proving: #eda100;
  --s-review: #e87ba4;
  --s-live: #008300;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --av-l: .92; --av-c: .05; --av-tl: .38;
  --shadow-xs: 0 1px 2px rgba(20, 20, 18, .04);
  --shadow-sm: 0 1px 2px rgba(20, 20, 18, .04), 0 4px 14px -6px rgba(20, 20, 18, .08);
  --shadow-md: 0 2px 6px rgba(20, 20, 18, .04), 0 16px 36px -14px rgba(20, 20, 18, .20);
  --shadow-lg: 0 34px 90px -24px rgba(20, 20, 18, .40), 0 6px 18px rgba(20, 20, 18, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0d0c; --bg-2: #141413;
    --tint-1: rgba(61, 127, 224, .14); --tint-2: rgba(144, 133, 233, .10);
    --surface: #171716; --surface-2: #1b1b1a; --surface-3: #242422;
    --glass: rgba(16, 16, 15, .74);
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
    --text: #f1f0ed; --text-2: #c3c2b7; --text-3: #8e8d86;
    --accent: #4b8de8; --accent-2: #8a7cf0;
    --s-todo: #6b6a64; --s-doing: #3987e5; --s-deploy: #d95926; --s-waiting: #199e70; --s-proving: #c98500; --s-review: #d55181; --s-live: #008300;
    --av-l: .34; --av-c: .06; --av-tl: .9;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -8px rgba(0, 0, 0, .5);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 40px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 34px 90px -20px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c; --bg-2: #141413;
  --tint-1: rgba(61, 127, 224, .14); --tint-2: rgba(144, 133, 233, .10);
  --surface: #171716; --surface-2: #1b1b1a; --surface-3: #242422;
  --glass: rgba(16, 16, 15, .74);
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --text: #f1f0ed; --text-2: #c3c2b7; --text-3: #8e8d86;
  --accent: #4b8de8; --accent-2: #8a7cf0;
  --s-todo: #6b6a64; --s-doing: #3987e5; --s-deploy: #d95926; --s-waiting: #199e70; --s-proving: #c98500; --s-review: #d55181; --s-live: #008300;
  --av-l: .34; --av-c: .06; --av-tl: .9;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -8px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 40px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 34px 90px -20px rgba(0, 0, 0, .8);
}

.s-todo { --stage: var(--s-todo); }
.s-doing { --stage: var(--s-doing); }
.s-deploy { --stage: var(--s-deploy); }
.s-waiting { --stage: var(--s-waiting); }
.s-proving { --stage: var(--s-proving); }
.s-review { --stage: var(--s-review); }
.s-live { --stage: var(--s-live); }

/* ── base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font: 14.5px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 0% -10%, var(--tint-1), transparent 60%),
    radial-gradient(900px 520px at 100% -14%, var(--tint-2), transparent 58%);
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
i.dot, .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--stage, var(--text-3)); flex: none; font-style: normal; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.grow { flex: 1; }
.muted { color: var(--text-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in oklab, var(--accent) 26%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── header ───────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "brand seg search tools";
  align-items: center; gap: 18px;
  min-height: var(--header-h);
  padding: 12px 28px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--glass);
  backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 6px 14px -6px rgba(80, 80, 220, .6); }
.brand b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.seg {
  grid-area: seg;
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line);
}
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.seg button .i { width: 15px; height: 15px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search { grid-area: search; justify-self: center; position: relative; width: min(520px, 100%); }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 42px 0 38px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-xs); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: color-mix(in oklab, var(--accent) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 15%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 600 11px/1 var(--mono); color: var(--text-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--surface-2);
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.tools { grid-area: tools; display: flex; align-items: center; gap: 6px; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live.is-live .live-dot { background: var(--good); }
.live.is-live .live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ripple 2.4s var(--ease) infinite; }
.live.is-reconnecting .live-dot, .live.is-connecting .live-dot { background: var(--warning); animation: blink 1s ease-in-out infinite; }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
}
.iconbtn:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.iconbtn .i { width: 18px; height: 18px; }
.me { position: relative; }
.me-btn { padding: 2px; border: 0; background: none; border-radius: 50%; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  transform-origin: top right; animation: pop .16s var(--ease);
}
.menu[hidden] { display: none; }
.menu-who { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-who b { display: block; font-weight: 650; line-height: 1.2; }
.menu-who span { font-size: 12px; color: var(--text-3); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-weight: 500; }
.menu button:hover { background: var(--surface-3); }

/* ── page ─────────────────────────────────────────────────────────────────── */
.page { max-width: 1520px; margin: 0 auto; padding: 34px 32px 80px; }
body[data-view="board"] .page { max-width: none; }
body[data-view="overview"] .boardwrap, body[data-view="board"] .overview { display: none; }

/* ── hero ─────────────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: minmax(260px, .9fr) 2.6fr; gap: 20px 36px; align-items: end; margin-bottom: 8px; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.hello h1 { font-size: 34px; line-height: 1.1; font-weight: 760; letter-spacing: -.035em; margin: 8px 0 10px; }
.lede { font-size: 15px; line-height: 1.55; color: var(--text-2); max-width: 34ch; }
.lede b { color: var(--text); font-weight: 680; }
.stats { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 12px; }
.stat {
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; align-items: start;
  padding: 16px 16px 14px; min-height: 128px; text-align: left;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  overflow: hidden;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-ico { grid-column: 2; grid-row: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in oklab, var(--c) 14%, transparent); color: var(--c); }
.stat-ico .i { width: 18px; height: 18px; }
.stat-n { grid-column: 1; grid-row: 1; font-size: 36px; font-weight: 760; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { grid-column: 1 / 3; margin-top: 14px; font-size: 13.5px; font-weight: 650; }
.stat-s { grid-column: 1 / 3; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-me { --c: #fff; color: #fff; border: 0; background: var(--grad); box-shadow: 0 18px 40px -16px color-mix(in oklab, var(--accent-2) 75%, transparent); }
.stat-me .stat-ico { background: rgba(255, 255, 255, .18); }
.stat-me .stat-s { color: rgba(255, 255, 255, .78); }
.stat-me::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); }
.stat-me.is-zero { --c: var(--good); color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat-me.is-zero .stat-ico { background: color-mix(in oklab, var(--good) 14%, transparent); }
.stat-me.is-zero .stat-s { color: var(--text-3); }
.stat-others { --c: var(--s-waiting); }
.stat-motion { --c: var(--s-doing); }
.stat-proving { --c: var(--s-proving); }
.stat-shipped { --c: var(--s-live); }
.stat.is-zero:not(.stat-me) .stat-n { color: var(--text-3); }
.distribution { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 4px 2px 0; }
.meter { flex: 0 0 min(360px, 34%); display: flex; gap: 2px; height: 8px; }
.meter span { flex-basis: 0; min-width: 5px; border-radius: 2px; background: var(--stage); transition: opacity .15s, flex-grow .5s var(--ease); }
.meter span:first-child { border-radius: 4px 2px 2px 4px; }
.meter span:last-child { border-radius: 2px 4px 4px 2px; }
.meter:hover span { opacity: .45; }
.meter span:hover { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── notices and filters ──────────────────────────────────────────────────── */
.notice {
  display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 11px 14px;
  border-radius: 14px; font-size: 13.5px;
  background: color-mix(in oklab, var(--critical) 9%, var(--surface)); border: 1px solid color-mix(in oklab, var(--critical) 24%, transparent);
}
.notice .i { color: var(--critical); }
.notice[hidden], .filterbar[hidden] { display: none; }
.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; font-size: 13px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 5px 0 8px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 12.5px; }
.pill .i { width: 14px; height: 14px; color: var(--text-3); }
.pill button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--surface-3); padding: 0; }
.pill button .i { width: 12px; height: 12px; color: var(--text-2); }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px 6px; border-radius: 6px; }

/* ── overview ─────────────────────────────────────────────────────────────── */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 36px; align-items: start; }
.rail { position: sticky; top: calc(var(--header-h) + 24px); margin-top: 40px; display: grid; gap: 14px; }
.sec { margin-top: 40px; }
.sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 16px; }
.sec-head h2 { font-size: 21px; font-weight: 720; letter-spacing: -.025em; }
.sec-n { font-size: 12.5px; font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.sec-head p { flex-basis: 100%; font-size: 13.5px; color: var(--text-3); }
.sec-me .sec-n { color: #fff; background: var(--grad); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.people-groups { display: grid; gap: 14px; }
.pgroup { padding: 14px; border-radius: 24px; background: color-mix(in oklab, var(--surface-3) 55%, transparent); border: 1px solid var(--line); }
.pgroup-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; }
.pgroup-head b { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.pgroup-head .muted { font-size: 13px; }
.shipped { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 2px 18px; padding: 8px 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.shipped a { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; text-decoration: none; transition: background .15s; }
.shipped a:hover { background: var(--surface-3); }
.shipped .key { flex: none; }
.shipped .t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { margin-top: 60px; text-align: center; color: var(--text-3); }
.empty-ico { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text-2); margin-bottom: 14px; }
.empty-ico .i { width: 24px; height: 24px; }
.empty h2 { font-size: 19px; color: var(--text); font-weight: 700; margin-bottom: 4px; }

/* ── rail ─────────────────────────────────────────────────────────────────── */
.panel { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-head h2 { font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.bars button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av name n" "av bar bar";
  align-items: center; gap: 2px 10px; width: calc(100% + 12px); margin: 0 -6px; padding: 7px 6px;
  border: 0; border-radius: 12px; background: none; text-align: left; transition: background .15s;
}
.bars button:hover { background: var(--surface-3); }
.bars button[aria-pressed="true"] { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.bars .avatar { grid-area: av; }
.bar-name { grid-area: name; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.bar-n { grid-area: n; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bar { grid-area: bar; height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--s-waiting); transition: width .5s var(--ease); }
.about summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.about summary::-webkit-details-marker { display: none; }
.about .chev { margin-left: auto; transition: transform .2s var(--ease); }
.about[open] .chev { transform: rotate(90deg); }
.about dl { display: grid; gap: 10px; margin-top: 14px; }
.about dt { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.about dd { margin-left: 16px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.about > p { margin-top: 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.sources { display: grid; gap: 6px; padding: 4px 6px; font-size: 12.5px; color: var(--text-3); }
.sources p { display: flex; align-items: center; gap: 8px; }
.sources .i { width: 14px; height: 14px; }
.sources .err { color: var(--critical); }

/* ── card ─────────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 150px; padding: 15px 17px 14px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
  animation: rise .4s var(--ease) both;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card:active { transform: translateY(-1px) scale(.995); }
.card.is-open { border-color: color-mix(in oklab, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent), var(--shadow-md); }
.card.flash { animation: flash 2.4s var(--ease); }
.sec-me .card { border-color: color-mix(in oklab, var(--accent-2) 26%, var(--line)); background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 4%, var(--surface)), var(--surface) 60%); }
.c-top { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.key { font: 600 11.5px/1 var(--mono); color: var(--text-3); letter-spacing: .01em; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; color: var(--text-2); background: color-mix(in oklab, var(--stage) 12%, transparent); white-space: nowrap; }
.tag .dot { width: 6px; height: 6px; }
.prio { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; }
.prio .i { width: 15px; height: 15px; stroke-width: 2.3; }
.p-critical { color: var(--critical); }
.p-serious { color: var(--serious); }
.p-low { color: var(--text-3); }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ripple 2.4s var(--ease) infinite; }
.when { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-title { font-size: 15.5px; font-weight: 660; line-height: 1.34; letter-spacing: -.012em; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.c-status { font-size: 13.5px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; font-size: 12.5px; }
.c-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); }
.c-names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.me-tag { color: var(--accent); }
.stack { display: inline-flex; }
.c-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-weight: 600; }
.c-meta .i { width: 13px; height: 13px; }
.c-src { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-3); font-size: 11.5px; font-weight: 600; }
.c-src .i { width: 12px; height: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.badge .i { width: 12px; height: 12px; stroke-width: 2.2; }
.b-critical { color: var(--critical); background: color-mix(in oklab, var(--critical) 13%, transparent); }
.b-serious { color: color-mix(in oklab, var(--serious) 72%, var(--text)); background: color-mix(in oklab, var(--serious) 16%, transparent); }

.avatar {
  --hh: calc(var(--h, 220) * 1deg);
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 11px; font-weight: 750; letter-spacing: .02em;
  background: oklch(var(--av-l) var(--av-c) var(--hh)); color: oklch(var(--av-tl) .1 var(--hh));
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; box-shadow: 0 0 0 2px var(--surface); margin-left: -6px; }
.stack .avatar.sm:first-child, .pill .avatar.sm { margin-left: 0; }
.avatar.md { width: 32px; height: 32px; font-size: 12px; }
.avatar-q { background: var(--surface-3); color: var(--text-3); }
.avatar-q .i { width: 16px; height: 16px; }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }

/* ── board view ───────────────────────────────────────────────────────────── */
.boardwrap { margin-top: 28px; }
.tabs { display: none; }
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 18px; margin: 0 -2px; }
.col { flex: 0 0 312px; padding: 10px; border-radius: 22px; background: color-mix(in oklab, var(--stage) 5%, var(--surface-2)); border: 1px solid color-mix(in oklab, var(--stage) 12%, var(--line)); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 6px 8px 12px; }
.col-head h2 { font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.col-n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-2); background: color-mix(in oklab, var(--stage) 13%, var(--surface)); border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums; }
.col-body { display: grid; gap: 10px; }
.col-empty { padding: 6px 8px 8px; font-size: 13px; color: var(--text-3); }
.col-empty[hidden] { display: none; }
.card.compact { min-height: 0; padding: 13px 15px 12px; border-radius: 16px; }
.card.compact .c-title { font-size: 14.5px; }
.card.compact .c-status { font-size: 13px; }
@media (min-width: 900px) {
  .col.is-empty { flex-basis: 54px; align-self: stretch; background: transparent; border-style: dashed; border-color: var(--line-2); }
  .col.is-empty .col-head { flex-direction: column; padding: 6px 0; gap: 12px; }
  .col.is-empty .col-head h2 { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--text-3); font-weight: 600; }
  .col.is-empty .col-n { margin: 0; background: var(--surface-3); }
  .col.is-empty .col-empty { display: none; }
}

/* ── ticket panel ─────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 10, 9, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.drawer {
  position: fixed; z-index: 41; top: 12px; right: 12px; bottom: 12px; width: min(620px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 24px)); transition: transform .42s var(--ease);
  overflow: hidden;
}
.is-drawer .scrim { opacity: 1; pointer-events: auto; }
.is-drawer .drawer { transform: none; }
.d-bar { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.stagepill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px 0 11px; border-radius: 999px; font-size: 13px; font-weight: 650; background: color-mix(in oklab, var(--stage) 13%, var(--surface)); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn .i { width: 15px; height: 15px; }
.btn-primary { border: 0; color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--accent-2) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.07); }
.d-scroll { flex: 1; overflow-y: auto; padding: 26px 28px 48px; overscroll-behavior: contain; }
.d-key { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.d-key .key { font-size: 13px; color: var(--text-2); }
.d-title { margin: 10px 0 22px; font-size: 26px; font-weight: 760; letter-spacing: -.03em; line-height: 1.18; }
.callout { padding: 16px 18px; border-radius: 18px; background: color-mix(in oklab, var(--stage) 8%, var(--surface-2)); border: 1px solid color-mix(in oklab, var(--stage) 20%, var(--line)); }
.callout-k { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.callout-t { font-size: 15.5px; line-height: 1.55; font-weight: 500; }
.callout-m { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.callout.warn { --stage: var(--s-deploy); }
.d-sec { margin-top: 28px; }
.d-sec > h3 { margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ppl { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 9px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--surface-3); font-size: 13.5px; font-weight: 600; }
.person.is-me { background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-3); font: 600 12px/1 var(--mono); color: var(--text-2); }
.deps { display: grid; gap: 8px; }
.deps a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "k t tag" "rel rel rel"; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; transition: background .15s, border-color .15s; }
.deps a:hover { background: var(--surface-2); border-color: var(--line-2); }
.deps .key { grid-area: k; }
.deps .t { grid-area: t; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deps .tag { grid-area: tag; }
.deps .rel { grid-area: rel; font-size: 12px; color: var(--text-3); }
.deps .off { opacity: .7; cursor: default; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border-radius: 16px; background: var(--line); border: 1px solid var(--line); }
.facts div { min-width: 0; padding: 11px 15px; background: var(--surface); }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin-top: 2px; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desc { font-size: 14.5px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.desc p + p { margin-top: 10px; }
.desc.is-clamped { max-height: 13.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.desc a { color: var(--accent); }
.more { margin-top: 6px; }
.timeline { position: relative; display: grid; gap: 4px; }
.timeline::before { content: ""; position: absolute; left: 16px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--line); }
.act { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 6px 0 10px; }
.act-ico { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.act-ico .i { width: 15px; height: 15px; }
.act.k-deploy .act-ico { border: 0; color: #fff; background: linear-gradient(135deg, var(--s-live), var(--s-waiting)); }
.act.k-comment .act-ico { color: var(--accent); }
.act.k-handoff .act-ico { color: var(--accent-2); }
.act-meta { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); padding-top: 7px; }
.act-meta b { color: var(--text); font-weight: 650; }
.act-text { margin-top: 3px; font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.act-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }

/* ── toasts, tooltip, skeleton ────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 16px; background: color-mix(in oklab, var(--text) 93%, transparent); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastin .4s var(--ease); cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.tip { position: fixed; z-index: 70; pointer-events: none; padding: 7px 11px; border-radius: 10px; background: color-mix(in oklab, var(--text) 94%, transparent); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-md); }
.tip[hidden] { display: none; }
.skeleton { margin-top: 40px; }
.skel { height: 150px; border-radius: 18px; background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface) 50%, var(--surface-3) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel-title { width: 220px; height: 24px; border-radius: 8px; margin-bottom: 18px; }

/* ── login ────────────────────────────────────────────────────────────────── */
.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.login-glow { position: absolute; width: 720px; height: 720px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--s-waiting), var(--accent)); filter: blur(120px); opacity: .22; animation: spin 24s linear infinite; }
.login-card { position: relative; width: min(420px, 100%); padding: 36px 34px 28px; border-radius: 28px; background: var(--glass); backdrop-filter: saturate(1.6) blur(28px); -webkit-backdrop-filter: saturate(1.6) blur(28px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) both; }
.login-logo { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 14px 30px -10px rgba(80, 80, 220, .65); }
.login-card h1 { margin: 20px 0 4px; font-size: 27px; font-weight: 760; letter-spacing: -.03em; }
.login-sub { color: var(--text-2); margin-bottom: 24px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field input { width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: color-mix(in oklab, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 15%, transparent); }
.field input.code { font: 650 21px/1 var(--mono); letter-spacing: .45em; text-align: center; padding-left: 24px; }
.field input.code::placeholder { color: var(--line-2); }
.login-card .btn-primary { width: 100%; height: 48px; justify-content: center; margin-top: 6px; border-radius: 14px; font-size: 15px; }
.login-card .btn-primary[disabled] { opacity: .75; cursor: progress; }
.err { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: var(--critical); }
.err[hidden] { display: none; }
.foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-3); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ── motion ───────────────────────────────────────────────────────────────── */
@keyframes ripple { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent), var(--shadow-md); border-color: var(--accent); }
  60% { box-shadow: 0 0 0 8px transparent, var(--shadow-md); }
  100% { box-shadow: var(--shadow-xs); }
}
@keyframes slidein-r { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slidein-l { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── narrower screens ─────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .lede { max-width: none; }
  .overview { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
}
@media (max-width: 1020px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; margin-top: 32px; grid-template-columns: 1fr 1fr; align-items: start; }
  .sources { grid-column: 1 / -1; }
  .seg button span { display: none; }
  .seg button { padding: 0 10px; }
}
@media (max-width: 899px) {
  .top { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "brand seg tools" "search search search"; gap: 10px 12px; padding: 10px 16px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .tools { justify-self: end; }
  .search { width: 100%; }
  .search kbd { display: none; }
  .live { padding: 0 10px; }
  .page { padding: 22px 16px calc(56px + env(safe-area-inset-bottom)); }
  .hello h1 { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-height: 112px; padding: 14px; border-radius: 18px; }
  .stat-me { grid-column: 1 / -1; min-height: 104px; }
  .stat-n { font-size: 30px; }
  .distribution { flex-direction: column; align-items: stretch; gap: 10px; }
  .meter { flex: none; }
  .sec { margin-top: 32px; }
  .sec-head h2 { font-size: 19px; }
  .pgroup { padding: 10px; border-radius: 20px; }
  .rail { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card:hover { transform: none; }

  .boardwrap { margin-top: 20px; }
  .tabs { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 10px 16px; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 650; color: var(--text-2); }
  .tab-n { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
  .tab[aria-selected="true"] { color: var(--text); border-color: color-mix(in oklab, var(--stage) 55%, transparent); background: color-mix(in oklab, var(--stage) 12%, var(--surface)); }
  .tab.is-zero { opacity: .5; }
  .board { display: block; overflow: visible; padding: 8px 0 0; margin: 0; }
  .col { display: none; padding: 0; background: none; border: 0; }
  .col.is-current { display: block; }
  .col.slide-r { animation: slidein-r .3s var(--ease); }
  .col.slide-l { animation: slidein-l .3s var(--ease); }
  .col-head { display: none; }
  .col-empty { padding: 48px 0; text-align: center; }

  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100dvh - max(26px, env(safe-area-inset-top))); border-radius: 26px 26px 0 0; border-bottom: 0; transform: translateY(100%); }
  .drawer::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 5px; background: var(--line-2); }
  .d-bar { padding: 20px 12px 12px 18px; }
  .d-bar .btn span { display: none; }
  .d-scroll { padding: 20px 18px calc(40px + env(safe-area-inset-bottom)); }
  .d-title { font-size: 22px; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .brand b { display: none; }
  .live .txt { display: none; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .col-body { grid-template-columns: 1fr 1fr; }
}
