/* Tribe Tech Hub — design tokens lifted from tribetech.app (dark-first) */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #080a10;
  --bg-2: #0b0e15;
  --card: #10141d;
  --card-2: #141925;
  --popover: #111620;
  --secondary: #171c27;
  --muted: #161b25;
  --border: #283041;
  --border-strong: #34405a;
  --input: #2b3446;
  --fg: #f6f7fb;
  --fg-2: #cad0df;
  --fg-muted: #929bad;
  --fg-faint: #687387;
  --ring: #7b8cff;
  --paper: #f6f5f2;
  --ink: #0b0e14;

  /* accents (brand) */
  --cyan: #5ee2f5;
  --blue: #4387ff;
  --violet: #9a7dff;
  --mint: #51ffbe;
  --pink: #ff7ee2;
  --amber: #f2b84b;
  --grad: linear-gradient(90deg, #00d6fc 0%, #4a8afc 50%, #9560fc 100%);
  --grad-word: linear-gradient(90deg, #00c2fd 0%, #6287fd 50%, #b37bfc 100%);

  /* status */
  --good: #2ec48f;
  --warn: #e0a83a;
  --serious: #f0834f;
  --critical: #ef5a6b;
  --neutral: #929bab;

  /* chart series (validated for the dark card surface) */
  --series-1: #1a9bb8;
  --series-2: #8a6df0;
  --series-3: #17a877;
  --series-4: #c94fae;
  --series-5: #b8871f;
  --series-6: #4a8bfc;

  --radius: 0.7rem;
  --radius-sm: 4px;
  --radius-lg: 1.1rem;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  --font: 'Poppins', 'Avenir Next', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(74,138,252,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(0,214,252,.06), transparent 60%);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 30px; letter-spacing: -0.035em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; color: var(--fg-2); }
p { margin: 0 0 .8em; }
code, pre { font-family: var(--mono); font-size: 13px; }
code { background: var(--secondary); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--bg-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius); overflow: auto; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- App shell ---------- */
.app-body { background: var(--bg); }
.app-body::before { display: none; }
.app-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.app-scene .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.app-scene .g1 { width: 56vmax; height: 56vmax; left: -22vmax; top: -30vmax; background: radial-gradient(circle at 40% 40%, rgba(0,214,252,.32), rgba(0,214,252,0) 62%); }
.app-scene .g2 { width: 50vmax; height: 50vmax; right: -20vmax; bottom: -28vmax; background: radial-gradient(circle at 60% 60%, rgba(149,96,252,.30), rgba(149,96,252,0) 62%); }
.app-body canvas.constellation { z-index: 0; }

.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.nav {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; scrollbar-width: thin;
  border-right: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(14,18,27,.78), rgba(8,10,16,.72));
  backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15);
  padding: 16px 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.nav::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); opacity: .7; }
.nav .nav-top { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 14px; }
.nav .logo { display: block; width: 150px; }
.nav .logo img { width: 100%; height: auto; display: block; }
.nav .nav-close { display: none; }
.nav .search-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 9px 10px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(8,10,16,.55); color: var(--fg-muted);
  font: inherit; font-size: 13px; cursor: pointer; text-align: left; transition: border-color .15s ease, background-color .15s ease;
}
.nav .search-trigger:hover { border-color: rgba(255,255,255,.16); color: var(--fg-2); }
.nav .search-trigger .txt { flex: 1; }
kbd { font: 500 11px/1 var(--font); color: var(--fg-muted); border: 1px solid rgba(255,255,255,.12); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; background: rgba(255,255,255,.04); }
.nav .group { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-faint); padding: 12px 10px 4px; }
.nav a.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--fg-2); font-weight: 500; font-size: 13.5px; position: relative; transition: background-color .12s ease, color .12s ease; }
.nav a.item .ico { width: 18px; height: 18px; display: inline-grid; place-items: center; color: var(--fg-muted); flex: none; }
.nav a.item .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a.item.project .txt { white-space: normal; line-height: 1.3; }
.nav a.item.project { align-items: flex-start; }
.nav a.item.project .ico { margin-top: 1px; }
.nav a.item:hover { background: rgba(255,255,255,.05); text-decoration: none; color: var(--fg); }
.nav a.item:hover .ico { color: var(--fg); }
.nav a.item[aria-current="page"] { background: linear-gradient(90deg, rgba(0,214,252,.14), rgba(149,96,252,.08)); color: var(--fg); }
.nav a.item[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2.5px; border-radius: 2px; background: var(--grad); }
.nav a.item[aria-current="page"] .ico { color: var(--cyan); }
.nav a.item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.nav .spacer { flex: 1; min-height: 14px; }
.nav .me { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; margin-top: 8px; font-size: 12.5px; color: var(--fg-muted); display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.nav .me .avatar { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #04101a; background: var(--grad); letter-spacing: .02em; }
.nav .me .who { min-width: 0; }
.nav .me strong { display: block; color: var(--fg); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .me .email { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.nav .me .signout { grid-column: 1 / -1; margin-top: 4px; }
.main { padding: 22px 34px 72px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar .title { min-width: 0; }
.topbar .eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.topbar .eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--mint); display: inline-block; border-radius: 1px; box-shadow: 0 0 10px rgba(81,255,190,.7); }
.topbar h1 { font-size: 28px; letter-spacing: -0.035em; text-wrap: balance; }
.topbar .sub { color: var(--fg-muted); margin-top: 6px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.main .menu-toggle { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-100%); transition: transform .22s ease; z-index: 50; }
  .nav.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.55); }
  .nav .nav-close { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: transparent; color: var(--fg-2); font-size: 20px; line-height: 1; cursor: pointer; }
  .main { padding: 14px 16px 64px; }
  .main .menu-toggle { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px; width: 100%; justify-content: center; }
  .topbar { margin-bottom: 16px; }
  .topbar h1 { font-size: 23px; }
}

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
.card {
  position: relative; min-width: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%), rgba(16,20,29,.82);
  border: 1px solid rgba(255,255,255,.075); border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 34px rgba(0,0,0,.32);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card.tight { padding: 12px 14px; }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card .head h2, .card .head h3 { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; }
.card .head .meta { color: var(--fg-muted); font-size: 12px; }
.card.accent-cyan, .card.accent-violet, .card.accent-mint, .card.accent-pink, .card.accent-amber, .card.accent-blue { overflow: hidden; }
.card[class*="accent-"]::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 0 0 2px 2px; opacity: .9; }
.card.accent-cyan::before { background: var(--cyan); } .card.accent-violet::before { background: var(--violet); }
.card.accent-mint::before { background: var(--mint); } .card.accent-pink::before { background: var(--pink); }
.card.accent-amber::before { background: var(--amber); } .card.accent-blue::before { background: var(--blue); }
a.card { color: inherit; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
a.card:hover { text-decoration: none; transform: translateY(-2px); border-color: rgba(255,255,255,.16); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 44px rgba(0,0,0,.4); }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.empty { color: var(--fg-muted); padding: 26px; text-align: center; border: 1px dashed rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.015); }
.gradient-text { background: var(--grad-word); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Stat tiles ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 11.5px; color: var(--fg-muted); letter-spacing: .08em; text-transform: uppercase; }
.stat .value { font-size: 34px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; color: var(--fg-muted); }

/* ---------- Badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.04); color: var(--fg-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--neutral); flex: none; box-shadow: 0 0 6px currentColor; }
.badge.good, .badge.green, .badge.done, .badge.verified, .badge.live, .badge.implemented { color: #a7f3d0; border-color: rgba(46,196,143,.35); background: rgba(46,196,143,.10); }
.badge.good::before, .badge.green::before, .badge.done::before, .badge.verified::before, .badge.live::before, .badge.implemented::before { background: var(--good); }
.badge.warn, .badge.amber, .badge.at_risk, .badge.in_progress, .badge.building, .badge.staging, .badge.review, .badge.applicable { color: #fde68a; border-color: rgba(224,168,58,.35); background: rgba(224,168,58,.10); }
.badge.warn::before, .badge.amber::before, .badge.at_risk::before, .badge.in_progress::before, .badge.building::before, .badge.staging::before, .badge.review::before, .badge.applicable::before { background: var(--warn); }
.badge.serious, .badge.high, .badge.planned { color: #fed7aa; border-color: rgba(240,131,79,.35); background: rgba(240,131,79,.10); }
.badge.serious::before, .badge.high::before, .badge.planned::before { background: var(--serious); }
.badge.critical, .badge.red, .badge.blocked, .badge.failed { color: #fecdd3; border-color: rgba(239,90,107,.38); background: rgba(239,90,107,.10); }
.badge.critical::before, .badge.red::before, .badge.blocked::before, .badge.failed::before { background: var(--critical); }
.badge.deployed, .badge.next, .badge.build, .badge.discovery { color: #bfdbfe; border-color: rgba(67,135,255,.35); background: rgba(67,135,255,.10); }
.badge.deployed::before, .badge.next::before, .badge.build::before, .badge.discovery::before { background: var(--blue); }
.badge.not_applicable::before, .badge.retired::before, .badge.archived::before, .badge.paused::before { background: var(--fg-faint); }
.badge.owner, .badge.admin { color: #ddd6fe; border-color: rgba(154,125,255,.35); background: rgba(154,125,255,.10); }
.badge.owner::before, .badge.admin::before { background: var(--violet); }
.badge.member { color: #bae6fd; border-color: rgba(94,226,245,.3); background: rgba(94,226,245,.08); }
.badge.member::before { background: var(--cyan); }
.badge.model::before { background: var(--violet); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); border: 1px solid rgba(255,255,255,.1); }
.pill.legal { color: #ffb0bd; border-color: rgba(239,90,107,.4); }
.pill.conditional { color: #ffd28a; border-color: rgba(224,168,58,.4); }
.pill.contract { color: #b6c6ff; border-color: rgba(67,135,255,.4); }
.pill.assurance { color: #d4c6ff; border-color: rgba(154,125,255,.4); }
.pill.recommended { color: #9be9c8; border-color: rgba(46,196,143,.4); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border: 1px solid rgba(255,255,255,.075); border-radius: 12px; background: rgba(16,20,29,.6); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
th { font-weight: 500; color: var(--fg-muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; background: rgba(11,14,21,.92); position: sticky; top: 0; backdrop-filter: blur(8px); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
tr.clickable:hover td { background: rgba(255,255,255,.035); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12px; color: var(--fg-muted); margin-bottom: 5px; letter-spacing: .02em; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; background: rgba(8,10,16,.6); color: var(--fg); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.18); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(123,140,255,.9); box-shadow: 0 0 0 3px rgba(123,140,255,.16); background: rgba(8,10,16,.85); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 160px; }
select.auto { padding: 4px 26px 4px 8px; font-size: 12px; width: auto; border-radius: 999px; background-color: rgba(255,255,255,.05); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--fg-2); }
.check input { width: auto; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; background: var(--paper); color: var(--ink); line-height: 1.2; transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease, border-color .12s ease; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn:hover { background: #fff; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: rgba(255,255,255,.06); color: var(--fg); border-color: rgba(255,255,255,.1); box-shadow: none; }
.btn.secondary:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.btn.ghost { background: transparent; color: var(--fg-2); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.danger { background: transparent; color: #ff9aa7; border-color: rgba(239,90,107,.4); box-shadow: none; }
.btn.danger:hover { background: rgba(239,90,107,.12); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.grad { background: var(--grad); color: #04101a; border: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.alert { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); margin-bottom: 14px; font-size: 14px; }
.alert.error { border-color: rgba(239,90,107,.5); background: rgba(239,90,107,.1); }
.alert.ok { border-color: rgba(46,196,143,.5); background: rgba(46,196,143,.08); }
.alert.warn { border-color: rgba(224,168,58,.5); background: rgba(224,168,58,.08); }
details { border: 1px solid rgba(255,255,255,.075); border-radius: 12px; background: rgba(16,20,29,.7); }
details > summary { cursor: pointer; padding: 12px 16px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; color: var(--fg-muted); font-size: 18px; }
details[open] > summary::after { content: '–'; }
details > .body { padding: 4px 16px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 18px; overflow: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--fg-muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; font-size: 14px; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--fg); border-image: var(--grad) 1; border-bottom: 2px solid; }

/* ---------- Toasts (flash messages) ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: min(420px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; color: var(--fg);
  background: rgba(16,20,29,.92); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: toast-in .35s cubic-bezier(.2,.7,.2,1) both, toast-out .4s ease-in 6.5s forwards;
}
.toast .toast-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--fg-muted); }
.toast.ok { border-color: rgba(46,196,143,.4); } .toast.ok .toast-dot { background: var(--good); box-shadow: 0 0 10px rgba(46,196,143,.8); }
.toast.error { border-color: rgba(239,90,107,.45); } .toast.error .toast-dot { background: var(--critical); box-shadow: 0 0 10px rgba(239,90,107,.8); }
.toast.warn { border-color: rgba(224,168,58,.45); } .toast.warn .toast-dot { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); visibility: hidden; } }
@media (max-width: 700px) { .toast { left: 16px; right: 16px; bottom: 16px; } }

/* ---------- Command palette ---------- */
dialog.palette { border: 0; padding: 0; background: transparent; max-width: none; width: min(640px, calc(100vw - 32px)); margin: 12vh auto 0; color: var(--fg); }
dialog.palette::backdrop { background: rgba(4,6,10,.62); backdrop-filter: blur(6px); }
.palette-box { background: rgba(14,18,27,.96); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 0 1px rgba(0,214,252,.08); overflow: hidden; animation: card-rise .2s ease-out both; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.palette-input .ico { color: var(--fg-muted); display: inline-grid; place-items: center; }
.palette-input input { border: 0; background: transparent; padding: 6px 0; font-size: 16px; box-shadow: none; }
.palette-input input:focus { box-shadow: none; border: 0; background: transparent; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow: auto; }
.palette-list li { display: grid; grid-template-columns: 24px 1fr auto 18px; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--fg-2); }
.palette-list li .ico { display: inline-grid; place-items: center; color: var(--fg-muted); }
.palette-list li .hint { font-size: 12px; color: var(--fg-faint); }
.palette-list li .go { opacity: 0; color: var(--cyan); }
.palette-list li[hidden] { display: none; }
.palette-list li[aria-selected="true"], .palette-list li:hover { background: rgba(255,255,255,.06); color: var(--fg); }
.palette-list li[aria-selected="true"] .go { opacity: 1; }
.palette-list li .group-label { grid-column: 1 / -1; }
.palette-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: var(--fg-faint); }
.palette-foot kbd { margin-right: 4px; }
.palette-empty { padding: 18px; text-align: center; color: var(--fg-muted); font-size: 13.5px; }

/* ---------- Auth pages (login / setup / invite) ---------- */
.auth-body { overflow-x: hidden; }
.auth-body::before { display: none; }              /* the scene below replaces the app-shell glow */

/* Scene: three slow aurora orbs, a masked grid and a diagonal light beam. Pure CSS, no images. */
.auth-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-scene .orb { position: absolute; border-radius: 50%; filter: blur(58px); opacity: .8; will-change: transform; animation: orb-drift 22s ease-in-out infinite alternate; }
.auth-scene .o1 { width: 62vmax; height: 62vmax; left: -24vmax; top: -30vmax; background: radial-gradient(circle at 35% 35%, rgba(0,214,252,.78), rgba(0,214,252,0) 64%); }
.auth-scene .o2 { width: 58vmax; height: 58vmax; right: -22vmax; bottom: -30vmax; background: radial-gradient(circle at 60% 60%, rgba(149,96,252,.78), rgba(149,96,252,0) 64%); animation-delay: -8s; animation-duration: 26s; }
.auth-scene .o3 { width: 44vmax; height: 44vmax; left: 34vw; top: 18vh; background: radial-gradient(circle, rgba(74,138,252,.6), rgba(74,138,252,0) 64%); opacity: .5; animation-delay: -15s; animation-duration: 30s; }
.auth-scene .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 44px 44px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 15%, transparent 72%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 15%, transparent 72%);
}
.auth-scene .beam {
  position: absolute; left: 50%; top: -20%; width: 140vmax; height: 26vmax; transform: translateX(-50%) rotate(-14deg); opacity: .22;
  background: linear-gradient(90deg, transparent 0%, rgba(0,214,252,.55) 30%, rgba(74,138,252,.55) 50%, rgba(149,96,252,.55) 70%, transparent 100%);
  filter: blur(46px);
}
@keyframes orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
}

/* Constellation canvas (shared with the app shell) */
canvas.constellation { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.auth-body canvas.constellation { z-index: 0; }

/* Composition: header row, centred content row, footer row — balanced at any viewport height */
.auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(18px, 3vh, 32px) clamp(20px, 5vw, 72px); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-head .lockup { display: inline-block; width: 180px; }
.auth-head .lockup img { display: block; width: 100%; height: auto; }
.auth-head .status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-muted); letter-spacing: .02em; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: rgba(16,20,29,.5); backdrop-filter: blur(8px); }
.auth-head .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(81,255,190,.55); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(81,255,190,.55); } 70% { box-shadow: 0 0 0 9px rgba(81,255,190,0); } 100% { box-shadow: 0 0 0 0 rgba(81,255,190,0); } }
.auth-frame { width: min(1180px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: clamp(40px, 7vw, 120px); padding-block: clamp(24px, 4vh, 48px); }
.auth-brand { max-width: 560px; }
.auth-brand .eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .eyebrow::before { content: ''; width: 7px; height: 7px; background: var(--mint); border-radius: 1px; box-shadow: 0 0 12px rgba(81,255,190,.8); }
.auth-brand .headline { font-size: clamp(34px, 3.9vw, 54px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 500; margin: 0 0 20px; text-wrap: balance; }
.auth-brand .lead { color: var(--fg-2); font-size: clamp(15px, 1.1vw, 16.5px); line-height: 1.6; max-width: 46ch; margin: 0 0 26px; }
.auth-brand .areas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.auth-brand .areas li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.09); background: rgba(16,20,29,.55); backdrop-filter: blur(8px); font-size: 13px; color: var(--fg-2); }
.auth-brand .areas .k { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.auth-brand .areas .k1 { background: var(--cyan); } .auth-brand .areas .k2 { background: var(--blue); }
.auth-brand .areas .k3 { background: var(--violet); } .auth-brand .areas .k4 { background: var(--mint); }
.auth-side { display: grid; justify-items: end; }
.auth-card {
  position: relative; width: min(460px, 100%);
  padding: 36px 36px 26px; border-radius: 20px;
  background: linear-gradient(rgba(16,20,29,.78), rgba(16,20,29,.78)) padding-box,
              linear-gradient(140deg, rgba(0,214,252,.55), rgba(74,138,252,.14) 45%, rgba(149,96,252,.55)) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.05) inset;
  animation: card-rise .55s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes card-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 26px; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth-card .lead { color: var(--fg-muted); margin-bottom: 22px; font-size: 14px; }
.auth-card .lead strong { color: var(--fg); font-weight: 500; }
.auth-card .alert { margin-bottom: 18px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form label { color: var(--fg-2); font-size: 12.5px; margin-bottom: 6px; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] {
  background: rgba(8,10,16,.72); border-color: rgba(255,255,255,.10); border-radius: 10px; padding: 12px 14px; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.auth-form input::placeholder { color: var(--fg-faint); }
.auth-form input:hover { border-color: rgba(255,255,255,.18); }
.auth-form input:focus { background: rgba(8,10,16,.9); border-color: rgba(123,140,255,.9); box-shadow: 0 0 0 4px rgba(123,140,255,.16); }
.auth-form input:-webkit-autofill, .auth-form input:-webkit-autofill:focus { -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 1000px #0d1119 inset; caret-color: var(--fg); transition: background-color 9999s ease-out; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-wrap .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--fg-faint); cursor: pointer; }
.password-wrap .reveal:hover { color: var(--fg); background: rgba(255,255,255,.06); }
.password-wrap .reveal.on { color: var(--cyan); }
.btn.wide { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; font-weight: 600; border-radius: 10px; }
.btn.grad { position: relative; box-shadow: 0 10px 28px rgba(74,138,252,.28); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.btn.grad:hover { filter: brightness(1.06); box-shadow: 0 14px 34px rgba(74,138,252,.38); transform: translateY(-1px); }
.btn.grad:active { transform: translateY(0); }
.btn.grad .arrow { transition: transform .15s ease; }
.btn.grad:hover .arrow { transform: translateX(3px); }
.btn.working { opacity: .8; cursor: progress; }
.auth-form .help { margin: 16px 0 0; font-size: 12.5px; color: var(--fg-faint); line-height: 1.5; }
.auth-card .foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07); color: var(--fg-faint); font-size: 11.5px; display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.auth-card .foot .lock { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(81,255,190,.12); color: var(--mint); flex: none; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--fg-faint); letter-spacing: .02em; }

/* Claude connector — consent page (two columns: what it can do / what it never does) */
.consent { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 20px; }
.consent-col { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); border-radius: 12px; padding: 12px 14px; }
.consent-col h3 { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.consent-col h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.consent-col h3.ok { color: #a7f3d0; } .consent-col h3.ok::before { background: var(--good); box-shadow: 0 0 6px var(--good); }
.consent-col h3.no { color: #fecdd3; } .consent-col h3.no::before { background: var(--critical); box-shadow: 0 0 6px var(--critical); }
.consent-col ul { margin: 0; padding-left: 18px; color: var(--fg-2); font-size: 12.5px; line-height: 1.5; }
.consent-col li + li { margin-top: 4px; }
@media (max-width: 560px) { .consent { grid-template-columns: 1fr; } }

/* Claude connector — Account card */
.connector-url { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(123,140,255,.35); background: rgba(123,140,255,.08); margin: 4px 0 12px; }
.connector-url .mono { flex: 1; }
.connector-steps { margin: 0 0 12px; padding-left: 20px; color: var(--fg-2); font-size: 13px; line-height: 1.55; }
.connector-steps li + li { margin-top: 3px; }

@media (max-width: 960px) {
  .auth { padding: 16px 18px 22px; }
  .auth-head .lockup { width: 150px; }
  .auth-frame { grid-template-columns: 1fr; gap: 20px; align-items: start; padding-block: 18px 8px; }
  .auth-brand { max-width: none; }
  .auth-brand .headline { font-size: clamp(28px, 6vw, 36px); margin-bottom: 10px; }
  .auth-brand .lead { font-size: 14px; margin-bottom: 14px; }
  .auth-side { justify-items: stretch; }
  .auth-card { width: 100%; padding: 26px 22px 20px; }
  .auth-scene .grid { background-size: 36px 36px; }
}
@media (max-width: 560px) {
  .auth-head .status { display: none; }
  .auth-brand .areas, .auth-brand .lead { display: none; }
  .auth-frame { gap: 14px; }
}

/* ---------- Sidebar tree (products → projects) ---------- */
.nav .tree { display: flex; flex-direction: column; gap: 2px; }
.nav a.item.product { padding-right: 8px; align-items: flex-start; }
.nav a.item.product .txt { white-space: normal; line-height: 1.3; }
.nav a.item.product .ico { margin-top: 1px; }
.nav a.item.product .n { margin-top: 1px; }
.nav a.item.product .n { margin-left: auto; font-size: 11px; color: var(--fg-faint); font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); }
.nav .tree .children { display: none; flex-direction: column; gap: 1px; margin: 1px 0 4px; padding-left: 12px; position: relative; }
.nav .tree .children::before { content: ''; position: absolute; left: 17px; top: 4px; bottom: 6px; width: 1px; background: rgba(255,255,255,.09); }
.nav .tree.open .children { display: flex; }
.nav .tree .children a.item { padding: 6px 8px 6px 10px; font-size: 13px; font-weight: 400; color: var(--fg-muted); }
.nav .tree .children a.item .ico { width: 12px; }
.nav .tree .children .branch { width: 8px; height: 1px; background: rgba(255,255,255,.18); display: block; }
.nav .tree .children a.item[aria-current="page"] { color: var(--fg); font-weight: 500; }
.nav .tree .children a.item[aria-current="page"]::before { top: 6px; bottom: 6px; }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; margin-bottom: 8px; letter-spacing: .01em; }
.crumbs a { color: var(--fg-muted); }
.crumbs a:hover { color: var(--fg); text-decoration: none; }
.crumbs .sep { color: var(--fg-faint); }
.crumbs .here { color: var(--cyan); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }

/* ---------- Products ---------- */
.products-index { gap: 26px; }
.product-block { display: flex; flex-direction: column; gap: 12px; }
.product-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 0 2px; }
.product-title { display: inline-flex; align-items: center; gap: 10px; color: inherit; min-width: 0; flex-wrap: wrap; }
.product-title:hover { text-decoration: none; }
.product-title:hover h2 { color: var(--cyan); }
.product-title h2 { font-size: 18px; letter-spacing: -0.02em; transition: color .12s ease; }
.product-title .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 10px currentColor; }
.product-title .url { font-size: 12.5px; color: var(--fg-muted); font-family: var(--mono); }
.product-meta { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-muted); }
.product-meta span { white-space: nowrap; }
.product-card { display: flex; flex-direction: column; gap: 8px; color: inherit; }
.product-card .name { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.product-card .url { font-size: 12.5px; color: var(--fg-muted); font-family: var(--mono); }
.product-card .tag { color: var(--fg-muted); font-size: 13px; min-height: 2.6em; line-height: 1.5; }
.product-card .foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--fg-muted); margin-top: auto; flex-wrap: wrap; }
.dot-cyan { background: var(--cyan); color: var(--cyan); } .dot-violet { background: var(--violet); color: var(--violet); } .dot-mint { background: var(--mint); color: var(--mint); }
.dot-pink { background: var(--pink); color: var(--pink); } .dot-amber { background: var(--amber); color: var(--amber); } .dot-blue { background: var(--blue); color: var(--blue); }

/* ---------- Project cards ---------- */
.project-card { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.project-card:hover { text-decoration: none; }
.project-card .name { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
.project-card .tag { color: var(--fg-muted); font-size: 13px; min-height: 2.6em; line-height: 1.5; }
.project-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-muted); margin-top: auto; }
.meter { height: 6px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: 999px; box-shadow: 0 0 12px rgba(74,138,252,.5); }
.meter i.good { background: var(--good); box-shadow: 0 0 12px rgba(46,196,143,.5); }
.meter i.warn { background: var(--warn); box-shadow: none; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(176px, 1fr)); gap: 8px; overflow: auto; padding-bottom: 8px; scrollbar-width: thin; }
.kanban .col { position: relative; background: rgba(11,14,21,.72); border: 1px solid rgba(255,255,255,.065); border-radius: 12px; padding: 10px; min-height: 180px; transition: border-color .15s ease, background-color .15s ease; }
.kanban .col::before { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--fg-faint); opacity: .7; }
.kanban .col[data-status="backlog"]::before { background: var(--fg-faint); }
.kanban .col[data-status="next"]::before { background: var(--blue); }
.kanban .col[data-status="in_progress"]::before { background: var(--warn); }
.kanban .col[data-status="review"]::before { background: var(--violet); }
.kanban .col[data-status="blocked"]::before { background: var(--critical); }
.kanban .col[data-status="done"]::before { background: var(--good); }
.kanban .col h4 { display: flex; justify-content: space-between; margin: 4px 2px 10px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); }
.kanban .col h4 span:last-child { font-variant-numeric: tabular-nums; color: var(--fg-faint); }
.kanban .col.drop-target { border-color: rgba(94,226,245,.5); background: rgba(94,226,245,.05); }
.task { position: relative; background: rgba(16,20,29,.9); border: 1px solid rgba(255,255,255,.075); border-radius: 10px; padding: 10px 10px 8px 14px; margin-bottom: 8px; font-size: 13px; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, opacity .14s ease; }
.task::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--fg-faint); }
.task[data-priority="medium"]::before { background: var(--blue); }
.task[data-priority="high"]::before { background: var(--serious); }
.task[data-priority="critical"]::before { background: var(--critical); box-shadow: 0 0 8px rgba(239,90,107,.6); }
.task[draggable="true"] { cursor: grab; }
.task[draggable="true"]:hover { border-color: rgba(255,255,255,.16); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.task.dragging { opacity: .45; transform: scale(.98); cursor: grabbing; }
.task.saving { opacity: .6; }
.task .t { font-weight: 500; color: var(--fg); margin-bottom: 6px; line-height: 1.4; }
.task .m { display: flex; gap: 6px; align-items: center; justify-content: space-between; color: var(--fg-muted); font-size: 12px; flex-wrap: wrap; }
.task .m form { margin: 0; }
.prio { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--fg-faint); vertical-align: 1px; margin-right: 2px; }
.prio.low { background: var(--fg-faint); } .prio.medium { background: var(--blue); } .prio.high { background: var(--serious); } .prio.critical { background: var(--critical); }

/* ---------- Timeline / activity ---------- */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ''; position: absolute; left: 3.5px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(180deg, rgba(94,226,245,.5), rgba(154,125,255,.25), transparent); }
.feed li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-top: 6px; box-shadow: 0 0 0 3px rgba(94,226,245,.15); }
.feed .when { color: var(--fg-faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .who { color: var(--fg-2); }

/* ---------- Release board ---------- */
.release-grid th:first-child, .release-grid td:first-child { min-width: 200px; }
.env-cell { display: flex; flex-direction: column; gap: 4px; }
.env-cell .rev { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); word-break: break-all; }
.env-cell a.small { font-size: 12px; }

/* ---------- Compliance ---------- */
.section-bar { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 22px 0 10px; }
.section-bar h2 { font-size: 16px; }
.donut { display: flex; align-items: center; gap: 14px; }
.donut svg { width: 64px; height: 64px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--fg-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 150px; }

/* ---------- Charts (inline SVG) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--fg-muted); font-size: 11px; }
.chart .grid line { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); }
.chart .bar { rx: 0; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .14; }
svg .marker { stroke: var(--card); stroke-width: 2; }
svg .s1 { fill: var(--series-1); stroke: var(--series-1); }
svg .s2 { fill: var(--series-2); stroke: var(--series-2); }
svg .s3 { fill: var(--series-3); stroke: var(--series-3); }
svg .s4 { fill: var(--series-4); stroke: var(--series-4); }
svg .s5 { fill: var(--series-5); stroke: var(--series-5); }
svg .s6 { fill: var(--series-6); stroke: var(--series-6); }
svg .track { fill: var(--secondary); }
svg .hit { fill: transparent; }
svg .hit:hover + .tip, svg .hit:focus + .tip { opacity: 1; }
svg .tip { opacity: 0; pointer-events: none; transition: opacity .1s; }
svg .tip rect { fill: var(--popover); stroke: var(--border-strong); }
svg .tip text { fill: var(--fg); font-size: 11px; }
.bars { display: grid; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.bars .b .track { height: 14px; background: rgba(255,255,255,.05); border-radius: 4px; overflow: hidden; }
.bars .b .track i { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.bars .b .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); }

/* ---------- AI workspace ---------- */
.ai-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: calc(100vh - 160px); }
@media (max-width: 1000px) { .ai-layout { grid-template-columns: 1fr; } .ai-side { order: 2; } }
.ai-side .conv { display: block; padding: 8px 10px; border-radius: 9px; color: var(--fg-2); font-size: 13px; border: 1px solid transparent; }
.ai-side .conv:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.ai-side .conv[aria-current="page"] { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: var(--fg); }
.ai-side .conv .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-side .conv .m { display: block; font-size: 11px; color: var(--fg-faint); }
.chat { display: flex; flex-direction: column; min-height: 60vh; }
.chat .messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 12px; scrollbar-width: thin; }
.msg { max-width: 82ch; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.075); background: rgba(16,20,29,.85); font-size: 14.5px; line-height: 1.6; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(0,214,252,.12), rgba(149,96,252,.12)); border-color: rgba(123,140,255,.3); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; border-bottom-left-radius: 4px; position: relative; }
.msg.assistant::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--grad); }
.msg .role { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 4px; }
.msg p:last-child { margin-bottom: 0; }
.msg pre { margin: 8px 0; }
.msg.streaming::after { content: '▍'; color: var(--cyan); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; margin-top: 8px; }
.composer textarea { min-height: 72px; }
.composer .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.composer .bar select { width: auto; }
.composer .bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Sites workspace ---------- */
.main.wide { padding-left: 22px; padding-right: 22px; }
.site-card { display: flex; flex-direction: column; gap: 8px; color: inherit; overflow: hidden; }
.site-card .thumb { width: calc(100% + 40px); margin: -18px -20px 6px; height: 180px; border-bottom: 1px solid rgba(255,255,255,.07); }
.site-card .row .pill + .pill { margin-left: 6px; }
.site-card .name { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
.site-card .url { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); word-break: break-all; }
.site-card .tag { color: var(--fg-muted); font-size: 12.5px; }
.site-card .foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--fg-muted); margin-top: auto; }

.site-ws { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; min-height: calc(100vh - 190px); }
.site-viewer { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.site-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.075); background: rgba(16,20,29,.8); backdrop-filter: blur(10px); }
.site-toolbar .devices { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(8,10,16,.6); border: 1px solid rgba(255,255,255,.06); }
.site-toolbar .devices .btn { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.site-toolbar .devices .btn.on { background: rgba(94,226,245,.14); color: var(--fg); }
.site-toolbar .pathbar { display: flex; align-items: center; gap: 6px; flex: 1 1 260px; min-width: 200px; }
.site-toolbar .pathbar .host { font-family: var(--mono); font-size: 12px; color: var(--fg-faint); white-space: nowrap; }
.site-toolbar .pathbar input { padding: 6px 10px; font-family: var(--mono); font-size: 13px; border-radius: 8px; }
.site-toolbar .tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.site-toolbar .comment-toggle.on { background: rgba(255,126,226,.16); border-color: rgba(255,126,226,.5); color: #ffd1f2; }
.site-status { font-size: 12px; color: var(--fg-muted); padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: rgba(8,10,16,.5); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.site-status[data-state="ahead"] { color: #fde68a; border-color: rgba(224,168,58,.4); }
.site-status[data-state="pr"] { color: #bfdbfe; border-color: rgba(67,135,255,.4); }
.site-stage { flex: 1; min-height: 560px; border-radius: 14px; border: 1px solid rgba(255,255,255,.075); background: rgba(8,10,16,.55) repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 8px, transparent 8px 16px); display: flex; justify-content: center; overflow: auto; padding: 14px; }
.frame-wrap { position: relative; width: 100%; height: 100%; min-height: 540px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); transition: width .2s ease; flex: none; }
.frame-wrap[data-device="tablet"] { width: min(100%, 820px); }
/* Phone preset = iPhone 15 Pro: 393 x 852 CSS pixels. That is the device the Tribe Tech Mobile app
   targets first, so the workspace preview is the same viewport the app is laid out for. The stage
   scrolls when it is shorter than 852px. */
.frame-wrap[data-device="phone"] { width: min(100%, 393px); height: min(100%, 852px); min-height: 0; align-self: center; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.pin-layer { position: absolute; inset: 0; pointer-events: none; }
.pin-layer.commenting { pointer-events: auto; cursor: crosshair; background: rgba(0,214,252,.04); outline: 2px dashed rgba(94,226,245,.5); outline-offset: -2px; }
.pin-layer .pin, .pin.static { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50% 50% 50% 4px; border: 2px solid #fff; background: var(--pink); color: #1a0a14; font: 600 12px/22px var(--font); text-align: center; box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 3px rgba(255,126,226,.25); cursor: pointer; pointer-events: auto; transition: transform .12s ease; }
.pin-layer .pin:hover { transform: scale(1.12); z-index: 3; }
.pin-layer .pin.resolved { background: var(--good); color: #062a1c; box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 3px rgba(46,196,143,.25); }
.pin-layer .pin.faded { opacity: .45; }
.pin-layer .pin.pulse { animation: pin-pulse 1.4s ease-out 2; }
@keyframes pin-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,126,226,.7); } 100% { box-shadow: 0 0 0 18px rgba(255,126,226,0); } }
.pin.static { position: static; display: inline-block; margin: 0; width: 20px; height: 20px; line-height: 16px; font-size: 11px; vertical-align: middle; box-shadow: none; cursor: default; }
.comment-card.resolved .pin.static { background: var(--good); color: #062a1c; }
.pin-pop { position: absolute; z-index: 5; width: 310px; padding: 12px; border-radius: 12px; background: rgba(14,18,27,.97); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 24px 60px rgba(0,0,0,.6); color: var(--fg); pointer-events: auto; display: flex; flex-direction: column; gap: 8px; animation: card-rise .18s ease-out both; }
.pin-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pin-pop textarea { min-height: 70px; }
.pin-pop .thread-body { font-size: 13.5px; }
.pin-pop .replies { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow: auto; }
.pin-pop .reply { font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.pin-pop .reply .who { color: var(--cyan); font-weight: 500; margin-right: 4px; }
.pin-pop .reply p { margin: 0; display: inline; }
.pin-pop .reply-form { display: flex; gap: 6px; }
.pin-pop .reply-form input { padding: 6px 10px; font-size: 13px; }
.danger-text { color: #ff9aa7; }
.site-hint { margin: 0; }

.site-side { display: flex; flex-direction: column; min-height: 0; border-radius: 14px; border: 1px solid rgba(255,255,255,.075); background: rgba(16,20,29,.8); backdrop-filter: blur(10px); overflow: hidden; }
.side-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-tabs [role=tab] { flex: 1; padding: 11px 12px; background: transparent; border: 0; color: var(--fg-muted); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; }
.side-tabs [role=tab].on { color: var(--fg); border-image: var(--grad) 1; border-bottom: 2px solid; }
.side-tabs .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(255,126,226,.18); color: #ffd1f2; font-size: 11px; line-height: 18px; }
.side-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.side-pane[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.chat-head select { width: auto; max-width: 240px; padding: 5px 26px 5px 9px; font-size: 12.5px; border-radius: 8px; }
.site-side .alert.tiny { margin: 10px 12px 0; padding: 8px 10px; font-size: 12px; }
.chat-log { flex: 1; min-height: 240px; max-height: calc(100vh - 420px); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.chat-log .msg { max-width: 100%; font-size: 13.5px; padding: 10px 12px; }
.chat-log .msg.user { align-self: flex-end; max-width: 92%; }
.chat-log .empty.small { font-size: 13px; text-align: left; }
.agent-events { display: flex; flex-direction: column; gap: 3px; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: rgba(8,10,16,.55); border: 1px solid rgba(255,255,255,.06); font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); }
.agent-event.tool_result { color: var(--fg-faint); padding-left: 8px; }
.agent-event.commit { color: #a7f3d0; }
.agent-event.pull_request { color: #bfdbfe; }
.agent-event.error { color: #fecdd3; }
.agent-event a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* Raised tickets in the site workspace panel: what you asked, and the ticket it became. */
.raised { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; background: rgba(8,10,16,.5); display: flex; flex-direction: column; gap: 6px; }
.raised.pending { opacity: .7; }
.raised p { margin: 0; }
.raised .asked { font-size: 13.5px; color: var(--fg); }
.raised .tk { font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.raised .tk strong { font-weight: 600; }
.raised .pill { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: var(--fg-muted); }
.raised .tiny { color: var(--fg-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.raised .tiny.bad { color: #fecdd3; }
.raised a { color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.chat-composer { border-top: 1px solid rgba(255,255,255,.07); padding: 10px 12px 12px; }
.chat-composer textarea { min-height: 64px; font-size: 13.5px; }
.chat-composer .bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chat-composer .bar .status { flex: 1; min-width: 80px; text-align: right; }
.chat-composer .mic.on { background: rgba(239,90,107,.16); color: #ffb0bd; border-color: rgba(239,90,107,.4); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(239,90,107,.12); } }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.comment-list { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 330px); scrollbar-width: thin; }
.comment-card { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.075); background: rgba(8,10,16,.5); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s ease; }
.comment-card:hover { border-color: rgba(255,255,255,.18); }
.comment-card.resolved { opacity: .6; }
.comment-card p { margin: 0; }

@media (max-width: 1100px) {
  .site-ws { grid-template-columns: 1fr; }
  .site-side { max-height: none; }
  .chat-log, .comment-list { max-height: 50vh; }
}

/* ---------- Page transitions (cross-document, progressive) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms ease-out both vt-out; }
::view-transition-new(root) { animation: 180ms ease-out both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
  .toast { animation: none !important; }
}
@media print { .nav, .composer, .actions, canvas.constellation, .app-scene, .toast { display: none !important; } .shell { grid-template-columns: 1fr; } body { background: #fff; color: #000; } }

/* ---------- Small helpers ---------- */
[data-copy] { cursor: pointer; user-select: all; word-break: break-all; }
.nav .dot-cyan, .palette-list .dot-cyan { background: var(--cyan); } .nav .dot-violet, .palette-list .dot-violet { background: var(--violet); } .nav .dot-mint, .palette-list .dot-mint { background: var(--mint); }
.nav .dot-pink, .palette-list .dot-pink { background: var(--pink); } .nav .dot-amber, .palette-list .dot-amber { background: var(--amber); } .nav .dot-blue, .palette-list .dot-blue { background: var(--blue); }
.palette-list .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend i.s1 { background: var(--series-1); } .legend i.s2 { background: var(--series-2); } .legend i.s3 { background: var(--series-3); }
.legend i.s4 { background: var(--series-4); } .legend i.s5 { background: var(--series-5); } .legend i.s6 { background: var(--series-6); }
.donut-svg { width: 64px; height: 64px; flex: none; }
.card.donut { display: flex; align-items: center; gap: 14px; }
details.tight { border: 0; background: transparent; }
details.tight > summary { padding: 2px 0; color: var(--fg-muted); font-weight: 400; }
details.tight > summary::after { content: ''; }
details.tight > .body { padding: 6px 0 0; border: 0; }
.md h3, .md h4, .md h5 { margin: 12px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 2px solid var(--violet); color: var(--fg-2); }
.md a { text-decoration: underline; text-underline-offset: 3px; }
details > summary .row { gap: 8px 12px; }
details > summary::after { flex: none; margin-left: 10px; }
details > .body .table-wrap { margin-top: 10px; }

/* ---- Backend (keys) --------------------------------------------------------- */
.hdr-backend { gap: 6px; border-color: rgba(154,125,255,.35); background: rgba(154,125,255,.10); color: #ddd6fe; }
.hdr-backend:hover { background: rgba(154,125,255,.18); border-color: rgba(154,125,255,.5); }
.hdr-backend.on { background: rgba(154,125,255,.22); }
.hdr-backend svg { width: 14px; height: 14px; }
.zone { margin-bottom: 34px; }
.zone-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.zone-head h2 { font-size: 18px; letter-spacing: -0.02em; }
.zone-head p { margin: 0; }
#social .zone-head h2 { color: #fbcfe8; }
#ai .zone-head h2 { color: #bae6fd; }
.zone-card { margin-bottom: 14px; }
.zone-card .head code, .zone-card .meta code { font-size: 12px; }
details.key-group { margin-top: 10px; }
details.key-group > summary .meta { color: var(--fg-muted); font-size: 12px; font-weight: 400; margin-right: 10px; }
.keys { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 10px; }
.key label { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-bottom: 6px; }
.key .name { color: var(--fg); font-size: 12.5px; }
.key .lbl { color: var(--fg-muted); font-size: 12.5px; }
.key .badge { font-size: 11px; padding: 1px 7px; }
.key .row { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.key .row input { flex: 1 1 auto; min-width: 0; width: auto; }
.key .row .btn { flex: none; }
.key p.tiny { margin-top: 4px; }
@media (max-width: 720px) { .keys { grid-template-columns: 1fr; } }

/* ---- Home board (concepts → development → live) ------------------------------ */
.board-stage { margin-bottom: 30px; }
.stage-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.stage-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.stage-head p { margin: 0; font-size: 13.5px; }
.board-stage.concepts .stage-head h2 { color: #ddd6fe; }
.board-stage.development .stage-head h2 { color: #fde68a; }
.board-stage.live .stage-head h2 { color: #a7f3d0; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.tiles .empty { grid-column: 1 / -1; }
.tile { display: flex; flex-direction: column; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(20,25,38,.9), rgba(12,15,24,.9)); overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.16); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.tile.stage-concept { border-top: 2px solid rgba(154,125,255,.6); }
.tile.stage-development { border-top: 2px solid rgba(224,168,58,.6); }
.tile.stage-live { border-top: 2px solid rgba(46,196,143,.6); }
.thumb { position: relative; display: block; width: 100%; height: 210px; overflow: hidden; background: #0b0f1a; }
.thumb iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; width: 1280px; height: 800px; }
.thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(8,10,16,.55)); pointer-events: none; }
.thumb-hover { position: absolute; right: 12px; bottom: 10px; z-index: 2; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(8,10,16,.75); color: var(--fg); border: 1px solid rgba(255,255,255,.14); opacity: 0; transition: opacity .15s ease; }
.tile:hover .thumb-hover { opacity: 1; }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.tile-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-title h3 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.tile-title h3 a { color: var(--fg); text-decoration: none; }
.pill.stage { text-transform: capitalize; letter-spacing: 0; font-size: 11px; }
.pill.stage.concept { color: #ddd6fe; border-color: rgba(154,125,255,.4); }
.pill.stage.development { color: #fde68a; border-color: rgba(224,168,58,.4); }
.pill.stage.live { color: #a7f3d0; border-color: rgba(46,196,143,.4); }
.tile-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--fg-muted); }
.tile-meta a { color: var(--fg-muted); }
.tile-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.tile-actions form.inline { display: inline; }
.btn.publish { background: linear-gradient(180deg, #34d79c, #1fa877); color: #04140d; border-color: transparent; font-weight: 650; box-shadow: 0 8px 22px rgba(46,196,143,.32); }
.btn.publish:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 12px 28px rgba(46,196,143,.42); }
.btn.publish:disabled { background: rgba(255,255,255,.05); color: var(--fg-muted); box-shadow: none; font-weight: 500; }
.btn.publish:hover { filter: brightness(1.08); }
.btn.publish:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
.board-foot { margin-top: 10px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } .thumb { height: 180px; } }

/* ---------- Architecture maps ---------- */
.map-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.map-tab { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.09); background: rgba(16,20,29,.7); color: var(--fg); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.map-tab:hover { border-color: rgba(255,255,255,.2); }
.map-tab[aria-selected="true"] { border-color: rgba(26,155,184,.65); background: linear-gradient(180deg, rgba(26,155,184,.16), rgba(26,155,184,.06)); }
.map-tab-name { font-weight: 500; font-size: 14px; }
.map-tab-meta { font-size: 11.5px; color: var(--fg-muted); }
.map-panel { margin-bottom: 18px; }
.map-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.map-head h2 { margin: 0 0 2px; font-size: 18px; }
.map-head p { margin: 0; max-width: 64ch; }
.map-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-frame { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.09); background: #0b0f1a; }
.map-frame iframe { display: block; width: 100%; height: min(1400px, max(720px, calc(100vh - 250px))); border: 0; background: #0b0f1a; }
.map-upload { margin-top: 10px; }
.map-upload summary { font-size: 13px; color: var(--fg-muted); cursor: pointer; }
.map-upload .fields input[type="file"] { width: 100%; }
@media (max-width: 720px) { .map-tab { min-width: 0; flex: 1 1 30%; } .map-frame iframe { height: 70vh; } }

/* ---------- AI usage row ---------- */
.usage-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.utile { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(20,25,38,.9), rgba(12,15,24,.9)); }
.utile.stale { opacity: .78; }
.utile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.uprov { display: block; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.uacct { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); word-break: break-all; }
.umeter { display: flex; flex-direction: column; gap: 5px; }
.umeter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; align-items: baseline; }
.umeter-scope { color: var(--fg-2); text-transform: capitalize; }
.umeter-top strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.umeter .bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.umeter .bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .4s ease; background: var(--fill, #2ec48f); box-shadow: 0 0 10px color-mix(in srgb, var(--fill, #2ec48f) 60%, transparent); }
.umeter.tone-good { --fill: #2ec48f; }
.umeter.tone-warn { --fill: #e0a83a; }
.umeter.tone-bad { --fill: #f0616d; }
.umeter.tone-none { --fill: #6b7280; }
.umeter-foot { font-size: 11.5px; }
.umeter-foot.bad { color: #fca5a5; }
.utile.spend .spend-amount { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.badge.good { color: #a7f3d0; }
.badge.warn { color: #fde68a; }
.alert.small { padding: 8px 10px; font-size: 12.5px; }

.steps { display: grid; gap: 12px; padding-left: 22px; margin: 4px 0 0; }
.steps li { line-height: 1.5; }

/* Site profile tabs — Workspace · Architecture · Compliance · Backend · Settings */
/* ---------- Site profile tabs: the site's primary menu ---------- */
.site-tabs { display: flex; gap: 4px; padding: 6px; margin: 2px 0 22px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: linear-gradient(180deg, rgba(22,27,40,.92), rgba(13,16,25,.92)); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px rgba(0,0,0,.35); overflow-x: auto; scrollbar-width: none; position: sticky; top: 10px; z-index: 6; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.site-tabs::-webkit-scrollbar { display: none; }
.site-tabs a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 11px; border-radius: 11px; color: var(--fg-2); font-weight: 500; font-size: 13.5px; letter-spacing: -0.005em; white-space: nowrap; border: 1px solid transparent; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.site-tabs a:hover { background: rgba(255,255,255,.06); color: var(--fg); text-decoration: none; }
.site-tabs a:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.site-tabs a .ico { display: inline-flex; color: var(--fg-muted); transition: color .15s ease; }
.site-tabs a .ico svg { width: 17px; height: 17px; }
.site-tabs a:hover .ico { color: var(--cyan); }
.site-tabs a[aria-current="page"] { color: #fff; background: linear-gradient(135deg, rgba(0,214,252,.22), rgba(74,138,252,.26) 55%, rgba(149,96,252,.24)); border-color: rgba(122,150,255,.5); box-shadow: 0 0 0 1px rgba(122,150,255,.14) inset, 0 6px 18px rgba(74,138,252,.28); }
.site-tabs a[aria-current="page"] .ico { color: var(--cyan); }
.site-tabs a .n { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--fg-2); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; padding: 1px 8px; line-height: 1.5; }
.site-tabs a[aria-current="page"] .n { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); }
.site-tabs a .n.alert { color: #ffd0d6; background: rgba(239,90,107,.2); border-color: rgba(239,90,107,.4); }
.site-tabs a .n.good { color: #c8ffe9; background: rgba(46,196,143,.2); border-color: rgba(46,196,143,.4); }
@media (max-width: 900px) {
  .site-tabs { position: static; border-radius: 13px; padding: 5px; }
  .site-tabs a { flex: 0 0 auto; padding: 8px 12px; min-height: 40px; font-size: 13.5px; gap: 7px; }
}

/* ---------- Code base ---------- */
.codebase-stats .value.small-value { font-size: 20px; letter-spacing: -0.02em; }
.codebase-scanned form { margin-top: 8px; }
.lang-bar { margin-top: 12px; }
.lang-bar svg { display: block; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.05); }
.lang-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lang-legend li { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.lang-legend li b { font-weight: 500; }
.lang-legend li .pct { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.lang-legend li .muted { font-size: 12.5px; }
table.lang-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lang-table th, table.lang-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; vertical-align: middle; }
table.lang-table tr:last-child td { border-bottom: 0; }
table.lang-table th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); font-weight: 500; }
table.lang-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.lang-table.quiet td { padding: 6px 10px; color: var(--fg-2); font-size: 13.5px; }
.lang-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.share { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.share svg { border-radius: 999px; overflow: hidden; flex: none; }
ol.largest { list-style: none; margin: 0; padding: 0; }
ol.largest li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13.5px; }
ol.largest li:last-child { border-bottom: 0; }
ol.largest li .path { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
ol.largest li .path code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--fg-2); }
ol.largest li .n { font-variant-numeric: tabular-nums; color: var(--fg); }
.codebase-empty { text-align: center; padding: 48px 24px; }
.codebase-empty h3 { margin-bottom: 6px; }
.codebase-empty form { margin-top: 16px; display: inline-block; }
@media (max-width: 900px) { .codebase-tables { grid-template-columns: 1fr; } }
.app-keys-card { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.app-keys-card:hover { text-decoration: none; border-color: rgba(255,255,255,.18); }
.app-keys-card .btn { align-self: flex-start; margin-top: auto; }

/* Assistant gateway: approvals + audit log */
.badge.pending, .badge.pending_approval { color: #fde68a; border-color: rgba(224,168,58,.35); background: rgba(224,168,58,.10); }
.badge.pending::before, .badge.pending_approval::before { background: var(--warn); }
.badge.approved, .badge.executed, .badge.ok { color: #a7f3d0; border-color: rgba(46,196,143,.35); background: rgba(46,196,143,.10); }
.badge.approved::before, .badge.executed::before, .badge.ok::before { background: var(--good); }
.badge.rejected, .badge.error, .badge.refused { color: #fecdd3; border-color: rgba(239,90,107,.38); background: rgba(239,90,107,.10); }
.badge.rejected::before, .badge.error::before, .badge.refused::before { background: var(--critical); }
.badge.expired::before { background: var(--fg-faint); }
.card.approval.pending { border-color: rgba(224,168,58,.35); }
.card.approval form input[type=text] { flex: 1; min-width: 200px; }
table.audit td.args { max-width: 380px; white-space: pre-wrap; word-break: break-word; color: var(--fg-muted); }
table.audit tr.flagged td { background: rgba(224,168,58,.06); }
.gw-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Tickets ---------- */
.ticket-new > summary .ttl { font-size: 15px; }
.ticket-new > summary .muted { margin-left: 12px; font-weight: 400; flex: 1; }
.ticket-draft { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin: 10px 0 14px; border-radius: 12px; border: 1px dashed rgba(122,150,255,.35); background: linear-gradient(135deg, rgba(0,214,252,.05), rgba(149,96,252,.06)); }
.ticket-draft textarea { min-height: 72px; }
.grid.tight { gap: 10px; }
.grid.tight .field { margin: 0; }
.grid .span-2 { grid-column: span 2; }
.field.dim { opacity: .45; }
.ticket-form { display: flex; flex-direction: column; gap: 10px; }
.ticket-form.drafted input[data-f], .ticket-form.drafted textarea[data-f] { border-color: rgba(94,226,245,.45); box-shadow: 0 0 0 3px rgba(94,226,245,.08); }
.ticket-form.drafted.edited input[data-f], .ticket-form.drafted.edited textarea[data-f] { border-color: var(--input); box-shadow: none; }
.chips { gap: 6px; }
.chips .sep { width: 1px; height: 18px; background: rgba(255,255,255,.12); margin: 0 6px; }
.chip { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--fg-2); border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); }
.chip:hover { text-decoration: none; color: var(--fg); background: rgba(255,255,255,.08); }
.chip.on { color: #fff; background: rgba(74,138,252,.22); border-color: rgba(122,150,255,.5); }
.kanban.tickets { grid-template-columns: repeat(6, minmax(210px, 1fr)); }
.kanban .col[data-status="inbox"]::before { background: var(--fg-faint); }
.kanban .col[data-status="ready"]::before { background: var(--cyan); }
.kanban .col[data-status="in_review"]::before { background: var(--violet); }
.kanban .col[data-status="ready_to_ship"]::before { background: var(--good); box-shadow: 0 0 10px rgba(46,196,143,.45); }
.kanban .col[data-status="ready_to_ship"] { border-color: rgba(46,196,143,.24); }
.task.ticket { padding-left: 14px; }
.task.ticket .tk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11.5px; }
.task.ticket .tk-num { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); letter-spacing: .02em; }
.task.ticket .sev { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 600; margin-left: auto; }
.badge.feature { color: #c9e4ff; border-color: rgba(67,135,255,.4); background: rgba(67,135,255,.12); }
.badge.feature::before { background: var(--blue); }
.badge.bug { color: #ffd0d6; border-color: rgba(239,90,107,.4); background: rgba(239,90,107,.12); }
.badge.bug::before { background: var(--critical); }
.badge.compliance { color: #ffe2a8; border-color: rgba(224,168,58,.45); background: rgba(224,168,58,.12); }
.badge.compliance::before { background: var(--warn); }
.badge.chore { color: #d6dbe6; border-color: rgba(146,155,171,.4); background: rgba(146,155,171,.12); }
.badge.chore::before { background: var(--neutral); }
.task.ticket .t { font-size: 13.5px; }
.task.ticket .tiny.mono { font-size: 11.5px; margin: -2px 0 6px; color: var(--fg-faint); }
.task.ticket .m .links { display: inline-flex; gap: 8px; font-size: 12px; }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); }
.who i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: var(--fg-faint); }
.who.gary i { background: linear-gradient(135deg, #17a877, #1a9bb8); }
.who.claude i { background: linear-gradient(135deg, #c96442, #d97757); }
.who.person i { background: linear-gradient(135deg, #4a8bfc, #8a6df0); }
.tk-start { margin-top: 8px; }
.tk-start .btn { width: 100%; justify-content: center; }
.task .md.small { font-size: 12.5px; color: var(--fg-2); }
.task .md.small p { margin: 0 0 6px; }
.task .stack input, .task .stack textarea, .task .stack select { font-size: 12.5px; }
.task .stack .row { gap: 6px; }
.task .stack .row select { flex: 1; min-width: 0; }
ol.timeline { list-style: none; margin: 0; padding: 0; }
ol.timeline li { display: grid; grid-template-columns: 92px 92px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13.5px; align-items: baseline; }
ol.timeline li:last-child { border-bottom: 0; }
ol.timeline .when { color: var(--fg-muted); font-size: 12px; }
ol.timeline .ev { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); font-weight: 600; }
ol.timeline .ev.merged, ol.timeline .ev.pr_opened { color: #c8ffe9; }
ol.timeline .ev.review { color: #e4d9ff; }
@media (max-width: 900px) { .grid .span-2 { grid-column: span 1; } .ticket-form .grid.cols-4 { grid-template-columns: 1fr 1fr; } ol.timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* Ticket cards in review: the two peer verdicts and the Push to live button */
.tk-live { margin-top: 10px; padding: 9px 10px 8px; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 7px; }
.tk-live.ready { border-color: rgba(46,196,143,.35); background: linear-gradient(180deg, rgba(46,196,143,.08), rgba(46,196,143,.03)); }
.tk-live .checks { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; }
.tk-live .chk { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-2); }
.tk-live .chk::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); flex: none; }
.tk-live .chk.good::before { background: var(--good); box-shadow: 0 0 6px rgba(46,196,143,.7); }
.tk-live .chk.warn::before { background: var(--warn); }
.tk-live .chk a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tk-live form { margin: 0; }
.tk-live .btn { width: 100%; justify-content: center; }
.tk-live .btn.ghost[disabled] { opacity: .55; cursor: not-allowed; }
.tk-live .tiny { line-height: 1.35; }

/* ---- Ticket sessions that drive themselves ---- */
.ticket-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); font-size: 12.5px; color: var(--fg-2); }
.ticket-strip.blocked { border-color: rgba(239,90,107,.45); background: linear-gradient(180deg, rgba(239,90,107,.1), rgba(239,90,107,.04)); }
.ticket-strip a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ticket-strip .auto { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--fg-faint); }
.ticket-strip .needs { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #ffd7dc; font-weight: 600; }
.ticket-strip form.inline { margin: 0; display: inline; }
.msg.user.hub { align-self: flex-start; background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08); border-bottom-left-radius: 4px; border-bottom-right-radius: 14px; max-width: 60ch; padding: 8px 12px; }
.msg.user.hub .md p { margin: 0; }
.msg.user.queued { opacity: .72; border-style: dashed; }
.msg.user.brief { align-self: flex-start; background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08); border-bottom-left-radius: 4px; border-bottom-right-radius: 14px; }
.msg.user.brief summary { cursor: pointer; font-weight: 600; }
.msg.user.brief details[open] summary { margin-bottom: 8px; }
.tk-blocked { margin-top: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(239,90,107,.45); background: linear-gradient(180deg, rgba(239,90,107,.12), rgba(239,90,107,.04)); }
.tk-blocked.for-claude { border-color: rgba(74,138,252,.38); background: linear-gradient(180deg, rgba(74,138,252,.10), rgba(74,138,252,.04)); }
.tk-blocked.for-claude .tk-blocked-t { color: #a9c6ff; }
.tk-blocked-t { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #ff9ca6; font-weight: 700; margin-bottom: 3px; }
.tk-blocked form { margin: 0; flex-wrap: wrap; }
.tk-auto { margin-top: 8px; }
.stat .delta .bad { color: #ff9ca6; font-weight: 600; }
.stat .delta .good { color: #9fe9c8; font-weight: 600; }

/* ---- Gary's Lair: apps bar + slide-over drawer ---- */
.lair-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.lair-nav-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); margin-right: 2px; }
.lair-app { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: rgba(16,20,29,.85); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.lair-app:hover { border-color: rgba(123,140,255,.5); background: rgba(24,30,44,.95); transform: translateY(-1px); }
.lair-app[aria-current="true"] { border-color: rgba(0,214,252,.55); box-shadow: 0 0 0 3px rgba(0,214,252,.12); }
.lair-app.needs { border-color: rgba(239,90,107,.45); }
.lair-app.plain { color: var(--fg-2); }
.lair-app .n { font-weight: 600; }
.lair-app .pills { display: inline-flex; gap: 5px; }
.lair-app .pill { padding: 1px 7px; font-size: 10.5px; }
.lair-app .pill.bug { color: #ffb0bd; border-color: rgba(239,90,107,.45); }
.lair-app .pill.review { color: #c9b8ff; border-color: rgba(149,96,252,.45); }
.lair-app .pill.shippable { color: #9fe9c8; border-color: rgba(46,196,143,.5); background: rgba(46,196,143,.12); }
.lair-app .pill.needs { color: #ff9ca6; border-color: rgba(239,90,107,.6); background: rgba(239,90,107,.12); font-weight: 700; }
.lair-app .pill.compliance { color: #ffd28a; border-color: rgba(224,168,58,.4); }
.lair-app .pill.compliance.done { color: #9fe9c8; border-color: rgba(46,196,143,.5); }
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(1180px, 94vw); height: 100vh; height: 100dvh; max-height: none; max-width: none; padding: 0; border: 0; border-left: 1px solid rgba(255,255,255,.1); background: #0b0e16; color: var(--fg); display: none; flex-direction: column; box-shadow: -24px 0 60px rgba(0,0,0,.55); }
dialog.drawer[open] { display: flex; }
dialog.drawer::backdrop { background: rgba(4,6,12,.55); backdrop-filter: blur(2px); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(16,20,29,.9); }
.drawer-head strong { font-size: 14px; }
.drawer-frame { flex: 1; width: 100%; border: 0; background: #0b0e16; }
/* Inside the drawer: no sidebar, no top chrome, tighter page */
body.embed .shell { grid-template-columns: 1fr; min-height: 0; }
body.embed .main { padding: 12px 16px 40px; }
body.embed .topbar { margin-bottom: 12px; padding-bottom: 10px; }
body.embed .topbar h1 { font-size: 20px; }
body.embed .topbar .sub { display: none; }
@media (max-width: 700px) { dialog.drawer { width: 100vw; border-left: 0; } .lair-app .pills { display: none; } }

/* ---- QA tester ---- */
.stat .value.good { color: #9fe9c8; } .stat .value.warn { color: #ffd28a; } .stat .value.bad { color: #ff9ca6; }
.qa-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.qa-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-cat { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); font-size: 12.5px; color: var(--fg-2); text-transform: capitalize; }
.qa-cat b { font-variant-numeric: tabular-nums; color: var(--fg); }
.qa-cat.critical { border-color: rgba(239,90,107,.5); color: #ffb0bd; }
.qa-cat.high { border-color: rgba(240,131,79,.5); color: #ffc4a6; }
.qa-cat.medium { border-color: rgba(224,168,58,.45); color: #ffe2a8; }
.qa-cat.low { border-color: rgba(146,155,171,.4); }
ol.qa-findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
ol.qa-findings li { padding: 9px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.06); border-left-width: 3px; background: rgba(255,255,255,.02); }
ol.qa-findings li.sev-critical { border-left-color: var(--critical); }
ol.qa-findings li.sev-high { border-left-color: var(--serious); }
ol.qa-findings li.sev-medium { border-left-color: var(--warn); }
ol.qa-findings li.sev-low { border-left-color: var(--neutral); }
ol.qa-findings .row { gap: 8px; align-items: center; }
ol.qa-findings a { color: var(--fg-faint); text-decoration: none; }
ol.qa-findings a:hover { color: var(--cyan); text-decoration: underline; }
ul.qa-tickets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
ul.qa-tickets li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06); font-size: 13.5px; }
ul.qa-tickets .t { flex: 1; min-width: 200px; }
.qa-score { font-variant-numeric: tabular-nums; } .qa-score.good { color: #9fe9c8; } .qa-score.warn { color: #ffd28a; } .qa-score.bad { color: #ff9ca6; }

.cron-steps { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 3px; color: var(--fg-2); }
.cron-steps li.bad { color: #ff9ca6; }

/* Document intake reuses the ticket board's form and card language. */
.document-upload{padding:18px;border:1px solid var(--line,#334155);border-radius:14px;background:rgba(99,102,241,.05)}
.document-upload h3{margin-top:0}.document-import-list>.row{padding:10px 0;border-bottom:1px solid var(--line,#334155)}
.document-ticket>summary{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:18px;cursor:pointer;overflow-wrap:anywhere}
.document-ticket fieldset{border:0;padding:0;margin:0;min-width:0}.document-ticket fieldset:disabled{opacity:.9}
.document-text{white-space:pre-wrap}.document-source{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font:inherit;font-size:13px;line-height:1.65;padding:16px;background:rgba(0,0,0,.12);border-radius:10px}
.document-upload input[type=file]{max-width:100%;padding:10px}.document-ticket textarea{width:100%}
@media(max-width:680px){.document-upload{padding:12px}.document-upload .grid,.document-ticket .grid{grid-template-columns:1fr}.document-upload .btn{width:100%}}

.document-ticket label>input,.document-ticket label>select,.document-ticket label>textarea{display:block;margin-top:6px}
