/* Mishale OS — the Mishale brand: Jost, paper and deep teal, coral for action, the arrowhead mark.
   Light and dark follow the system. All motion stops under prefers-reduced-motion. */
@font-face {
  font-family: "Jost"; src: url("/static/jost.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* light: warm paper and ink, deep teal for the brand, one terracotta accent */
  --bg: #faf9f6;
  --panel: rgba(255, 255, 255, .9);
  --solid: #ffffff;
  --panel-2: #f0eee8;
  --text: #14110b;
  --muted: #5a5348;
  --faint: #726b5e;
  --line: #e3dfd6;
  --line-strong: #cfc9bc;
  --brand: #0d4848;
  --accent: #bd4524;
  --accent-2: #0d6868;
  --accent-ink: #ffffff;
  --accent-weak: rgba(189, 69, 36, .09);
  --grad: linear-gradient(135deg, #cf5733 0%, #b03c1d 100%);
  --glow: rgba(189, 69, 36, .2);
  --aurora-1: rgba(13, 72, 72, .07); --aurora-2: rgba(189, 69, 36, .05);
  --mark-a: #208080; --mark-b: #0d4848; --mark-c: #021818; --mark-edge: #021010;
  --crit: #9e2a23; --crit-bg: rgba(158, 42, 35, .09);
  --high: #b3401f; --high-bg: rgba(179, 64, 31, .1);
  --med: #835f10;  --med-bg: rgba(131, 95, 16, .11);
  --low: #5a5348;  --low-bg: rgba(20, 17, 11, .06);
  --ok: #2f6a47;   --ok-bg: rgba(47, 106, 71, .11);
  --shadow: 0 1px 2px rgba(20, 17, 11, .04), 0 4px 14px rgba(20, 17, 11, .05);
  --shadow-lg: 0 24px 60px rgba(20, 17, 11, .2);
  --radius: 14px;
  --sidebar: 256px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* dark: the platform register. Deep teal ink, ivory text, luminous teal data, coral signal */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071a1b; --panel: rgba(13, 38, 40, .82); --solid: #0d2628; --panel-2: rgba(132, 179, 178, .08);
    --text: #e8f3ef; --muted: #9ac6c1; --faint: #6f9fa1;
    --line: rgba(132, 179, 178, .16); --line-strong: rgba(132, 179, 178, .3);
    --brand: #c2ddd8; --accent: #f58e76; --accent-2: #38b8c8; --accent-ink: #1d0a05; --accent-weak: rgba(245, 142, 118, .13);
    --grad: linear-gradient(135deg, #f9ad97 0%, #ee7458 100%);
    --glow: rgba(226, 96, 74, .3);
    --aurora-1: rgba(56, 184, 200, .1); --aurora-2: rgba(226, 96, 74, .07);
    --mark-a: #f2ede6; --mark-b: #a89c8c; --mark-c: #3a2c24; --mark-edge: rgba(200, 192, 176, .55);
    --crit: #f07568; --crit-bg: rgba(240, 117, 104, .14); --high: #f0a05c; --high-bg: rgba(240, 160, 92, .13);
    --med: #e0a648; --med-bg: rgba(224, 166, 72, .13); --low: #9ac6c1; --low-bg: rgba(132, 179, 178, .1);
    --ok: #46c896; --ok-bg: rgba(70, 200, 150, .13);
    --shadow: 0 1px 0 rgba(232, 243, 239, .04) inset, 0 8px 24px rgba(1, 8, 8, .35);
    --shadow-lg: 0 30px 70px rgba(1, 8, 8, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #071a1b; --panel: rgba(13, 38, 40, .82); --solid: #0d2628; --panel-2: rgba(132, 179, 178, .08);
    --text: #e8f3ef; --muted: #9ac6c1; --faint: #6f9fa1;
    --line: rgba(132, 179, 178, .16); --line-strong: rgba(132, 179, 178, .3);
    --brand: #c2ddd8; --accent: #f58e76; --accent-2: #38b8c8; --accent-ink: #1d0a05; --accent-weak: rgba(245, 142, 118, .13);
    --grad: linear-gradient(135deg, #f9ad97 0%, #ee7458 100%);
    --glow: rgba(226, 96, 74, .3);
    --aurora-1: rgba(56, 184, 200, .1); --aurora-2: rgba(226, 96, 74, .07);
    --mark-a: #f2ede6; --mark-b: #a89c8c; --mark-c: #3a2c24; --mark-edge: rgba(200, 192, 176, .55);
    --crit: #f07568; --crit-bg: rgba(240, 117, 104, .14); --high: #f0a05c; --high-bg: rgba(240, 160, 92, .13);
    --med: #e0a648; --med-bg: rgba(224, 166, 72, .13); --low: #9ac6c1; --low-bg: rgba(132, 179, 178, .1);
    --ok: #46c896; --ok-bg: rgba(70, 200, 150, .13);
    --shadow: 0 1px 0 rgba(232, 243, 239, .04) inset, 0 8px 24px rgba(1, 8, 8, .35);
    --shadow-lg: 0 30px 70px rgba(1, 8, 8, .65);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); height: 100%; }
body {
  margin: 0; min-height: 100%; color: var(--text);
  font: 15px/1.45 "Jost", "Avenir Next", Avenir, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
}
/* drifting aurora + a faint base-pair dot grid behind everything */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  inset: -20%;
  background: radial-gradient(38% 34% at 22% 18%, var(--aurora-1), transparent 70%),
              radial-gradient(34% 38% at 82% 78%, var(--aurora-2), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after {
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 26px 26px; opacity: .45;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
[hidden] { display: none !important; }
::selection { background: var(--glow); }

/* ---------------------------------------------------------------- layout */
#app { display: flex; min-height: 100vh; }
#sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--panel);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
/* the sidebar's header stays put and lines up with the top bar (its height is the top
   bar's, measured: see watchTopbar in app.js); only the links scroll */
#side-head {
  flex: 0 0 auto; height: var(--bar-h, 77px); display: flex; align-items: center;
  border-bottom: 1px solid var(--line); box-sizing: border-box;
}
#side-head .brand { padding: 0 20px; height: 100%; flex: 1; min-width: 0; }
#nav { overflow-y: auto; min-height: 0; scrollbar-width: thin; overscroll-behavior: contain; }
#sidebar.scrolled #company-switch { box-shadow: 0 10px 14px -12px rgba(0, 0, 0, .35); }
#sidebar-foot { flex: 0 0 auto; }
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 16px 30px; background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
#topbar h1 { font-size: 24px; margin: 0; font-weight: 600; letter-spacing: -.015em; animation: rise .5s var(--ease) both; }
.titles { flex: 1 1 180px; min-width: 150px; }
/* one line each, so the bar keeps one height (the sidebar's header matches it) */
#topbar h1, .page-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub { color: var(--muted); font-size: 13.5px; }
@media (min-width: 901px) and (max-width: 1279px) {
  #palette-btn > span { display: none; }                  /* the search shrinks to its key */
  #palette-btn { min-width: 0; padding-right: 8px; }
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#view { padding: 26px 30px 72px; outline: none; max-width: 1500px; width: 100%; }
#menu-btn { display: none; }
#scrim { display: none; }

/* ----------------------------------------------------------------- brand */
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 34px; height: 44px; flex: 0 0 34px; display: grid; place-items: center; transition: transform .5s var(--spring); }
.logo svg, .mark { width: 100%; height: 100%; overflow: visible; }
.brand:hover .logo { transform: translateY(-3px); }
.mk-body { fill: var(--mark-b); } .mk-lit { fill: var(--mark-a); } .mk-shade { fill: var(--mark-c); opacity: .5; }
.mk-spine { stroke: var(--mark-a); stroke-width: 1.6; opacity: .7; } .mk-shaft { fill: var(--mark-b); }
.mk-edge { fill: none; stroke: var(--mark-edge); stroke-width: 1.2; stroke-linejoin: miter; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 500; font-size: 17px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); }
.brand-name b {
  font-weight: 700; font-size: 10.5px; letter-spacing: .12em; vertical-align: 4px; margin-left: 6px;
  padding: 1px 6px; border-radius: 5px; background: var(--accent-weak); color: var(--accent);
}
.brand-sub { color: var(--muted); font-size: 12.5px; }

/* the helix: rungs whose two bases swap sides, staggered so it reads as a turning strand */
.helix { display: flex; align-items: center; gap: 3px; height: 24px; }
.helix i { position: relative; width: 3px; height: 100%; }
.helix i::before, .helix i::after {
  content: ""; position: absolute; left: 0; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent-2); animation: strand 1.8s ease-in-out infinite; animation-delay: inherit;
}
.helix i::after { animation-name: strand-b; opacity: .65; }
.helix i:nth-child(1) { animation-delay: 0s; }   .helix i:nth-child(2) { animation-delay: -.22s; }
.helix i:nth-child(3) { animation-delay: -.44s; } .helix i:nth-child(4) { animation-delay: -.66s; }
.helix i:nth-child(5) { animation-delay: -.88s; } .helix i:nth-child(6) { animation-delay: -1.1s; }
.helix i:nth-child(7) { animation-delay: -1.32s; }
.loader { display: grid; place-items: center; gap: 14px; padding: 90px 0; color: var(--muted); animation: fade .4s .15s both; }
.loader .helix { height: 44px; gap: 7px; }
.loader .helix i, .loader .helix i::before, .loader .helix i::after { width: 6px; }
.loader .helix i::before, .loader .helix i::after { height: 6px; background: var(--accent-2); }
.loader .helix i::after { background: var(--accent); opacity: 1; }

/* ------------------------------------------------------------------- nav */
#nav { padding: 4px 10px 16px; flex: 1; }
.nav-group { margin-top: 6px; }
.nav-home { margin-top: 2px; }
.nav-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint);
  padding: 10px 12px 4px; font-weight: 600;
}
.nav-link {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: 9px; color: var(--muted); font-size: 14px; line-height: 1.35;
  transition: color .2s, background .2s;
}
.nav-link .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .ico, .nav-head .ico { flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nav-link::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 60%; border-radius: 3px;
  background: var(--grad); transform: translateY(-50%) scaleY(0); transition: transform .35s var(--spring);
}
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-weak); color: var(--text); font-weight: 500; }
.nav-link.active .ico { opacity: 1; color: var(--accent); }
.nav-link.active::before { transform: translateY(-50%) scaleY(1); }
.nav-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; transition: opacity .15s; }
.nav-badge {
  font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 0 8px; line-height: 19px;
  background: var(--crit); color: #fff; animation: pop .5s var(--spring) both, pulse 2.4s 1s ease-out infinite;
}
/* a section: a header that folds it, and its links */
.nav-section { margin-top: 2px; }
.nav-head {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; text-align: left; transition: background .2s, color .2s;
}
.nav-head:hover { background: var(--panel-2); }
.nav-head:focus-visible, .nav-link:focus-visible, .nav-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-head .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-head .chev { flex: 0 0 12px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.nav-section.open .chev { transform: rotate(90deg); }
.nav-n { color: var(--faint); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.nav-section.open .nav-n { opacity: 0; }
.nav-section.has-active:not(.open) .nav-head { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
.nav-alert { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; background: var(--crit-bg); color: var(--crit); }
.nav-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease); }
.nav-section.open .nav-body { grid-template-rows: 1fr; }
.nav-body-in { overflow: hidden; min-height: 0; padding-left: 14px; margin-left: 17px; border-left: 1px solid var(--line); }
.nav-section:not(.open) .nav-body-in { visibility: hidden; transition: visibility 0s .32s; }
.nav-body-in > :first-child { margin-top: 2px; }
.nav-body-in > :last-child { margin-bottom: 6px; }
.nav-section .nav-link { padding: 5px 10px; font-size: 13.5px; }
/* pin a link to the top */
.nav-item { position: relative; }
.nav-pin {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--faint); cursor: pointer; opacity: 0; z-index: 2; transition: opacity .15s, color .15s, background .15s;
}
.nav-pin .ico { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.nav-item:hover .nav-pin, .nav-pin:focus-visible { opacity: 1; }
.nav-item:hover .nav-count { opacity: 0; }
.nav-pin:hover { color: var(--accent); background: var(--panel-2); }
.nav-item.is-pinned .nav-pin { color: var(--accent); }
.nav-item.is-pinned .nav-pin .ico { fill: currentColor; }
@media (hover: none) { .nav-pin { opacity: .55; } .nav-count { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav-body, .nav-head .chev { transition: none; } }
.sidebar-foot { padding: 12px 20px 18px; color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--solid);
  cursor: pointer; font-weight: 500; white-space: nowrap; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .25s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 6px 18px var(--glow); text-decoration: none; }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn.primary { background: var(--grad); background-size: 180% 180%; color: var(--accent-ink); border-color: transparent; font-weight: 600; transition: transform .18s var(--ease), box-shadow .25s, background-position .6s var(--ease); }
.btn.primary:hover { background-position: 100% 50%; }
.btn.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg);
}
.btn.primary:hover::after { animation: sheen .7s var(--ease); }
.btn.danger { color: var(--crit); } .btn.danger:hover { border-color: var(--crit); box-shadow: 0 6px 18px var(--crit-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); box-shadow: none; }
.btn.small { height: 29px; padding: 0 11px; font-size: 13.5px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--solid); cursor: pointer; font-size: 16px; transition: transform .25s var(--spring), border-color .2s;
}
.icon-btn:hover { transform: rotate(90deg); border-color: var(--accent); }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1720px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.two-col { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 15px 18px 11px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .005em; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.stack > * + * { margin-top: 18px; }

.card {
  --mx: 50%; --my: 0%; position: relative; padding: 16px 18px; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .3s;
}
.card::before {                       /* spotlight that follows the pointer */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(220px circle at var(--mx) var(--my), var(--glow), transparent 65%);
}
.card::after {                        /* gradient hairline along the top */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 14px 34px var(--glow); }
.card:hover::before { opacity: 1; } .card:hover::after { transform: scaleX(1); }
.card > * { position: relative; }
.card .label { white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.card .value { white-space: nowrap; font-size: 31px; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.card .hint { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.card.alert { border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.card.alert::after { background: var(--crit); transform: scaleX(1); }
.card.alert .value { color: var(--crit); }
.card .card-link { font-size: 13px; font-weight: 500; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.card.with-ring { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ring { width: 58px; height: 58px; flex: 0 0 58px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line-strong); stroke-width: 5; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1.4s .25s var(--ease); filter: drop-shadow(0 0 5px var(--glow)); }
.card.alert .ring-arc { stroke: var(--crit); filter: none; }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--low-bg); color: var(--low);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev-critical, .pr-critical, .st-blocked { background: var(--crit-bg); color: var(--crit); }
.sev-high, .pr-high, .st-not_started { background: var(--high-bg); color: var(--high); }
.sev-medium, .pr-medium, .st-in_progress { background: var(--med-bg); color: var(--med); }
.sev-low, .pr-low, .st-na { background: var(--low-bg); color: var(--low); }
.st-done { background: var(--ok-bg); color: var(--ok); }
.sev-critical::before, .pr-critical::before { animation: beacon 1.6s ease-out infinite; }
.st-in_progress::before { animation: blink 1.4s ease-in-out infinite; }
.tag {
  display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}

/* ------------------------------------------------------------- findings */
.finding { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line); transition: background .2s; }
.finding:first-child { border-top: 0; }
.finding:hover { background: var(--panel-2); }
.finding .title { font-weight: 500; font-size: 15.5px; }
.finding .detail { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.finding .refs { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.ref { font-size: 12.5px; padding: 1px 9px; border-radius: 99px; background: var(--accent-weak); transition: transform .2s var(--spring), background .2s; }
.ref:hover { transform: translateY(-2px) scale(1.04); text-decoration: none; background: var(--glow); }
.kind-filter { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--solid); border-radius: 99px;
  padding: 4px 13px; font-size: 13.5px; cursor: pointer; transition: transform .2s var(--spring), border-color .2s, background .25s, color .25s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.chip.on { background: var(--grad); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

/* ------------------------------------------------------------- deadlines */
.list-row { display: flex; align-items: center; gap: 13px; padding: 11px 18px; border-top: 1px solid var(--line); transition: background .2s; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--panel-2); }
.date-box {
  width: 48px; flex: 0 0 48px; text-align: center; border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 0; line-height: 1.1; background: var(--solid); transition: transform .3s var(--spring);
}
.list-row:hover .date-box { transform: rotate(-4deg) scale(1.08); }
.date-box .m { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.date-box .d { font-size: 19px; font-weight: 600; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------- progress */
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 1.2s .2s var(--ease); }
.dept { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; padding: 7px 0; }

/* ----------------------------------------------------------------- chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11.5px; font-family: inherit; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .zero { stroke: var(--crit); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s .2s var(--ease) forwards; filter: drop-shadow(0 3px 8px var(--glow)); }
.chart .area-stop { stop-color: var(--accent); }
.chart .area { opacity: 0; animation: fade 1s 1s forwards; }
.chart .dot { fill: var(--solid); stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pop .45s var(--spring) both; transition: r .2s; }
.chart .dot:hover { r: 5.5; }
.chart .dot.neg { stroke: var(--crit); }
.chart .bar-in, .chart .bar-out { transform-box: fill-box; transform-origin: bottom; animation: grow .8s var(--ease) both; }
.chart .bar-in { fill: var(--accent-2); } .chart .bar-out { fill: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .in { background: var(--accent-2); } .legend .out { background: var(--accent); }

/* ----------------------------------------------------------------- table */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  height: 38px; min-width: 240px; flex: 0 1 340px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--solid);
  transition: flex-basis .45s var(--ease), box-shadow .3s, border-color .2s;
}
.search:focus { flex-basis: 460px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--faint); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .1em; padding: 11px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer; white-space: nowrap; user-select: none; transition: color .2s;
}
table.data th:hover, table.data th.sorted { color: var(--text); }
table.data th .arrow { color: var(--accent); margin-left: 4px; display: inline-block; animation: pop .3s var(--spring); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background .18s; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr td:first-child { box-shadow: inset 0 0 0 var(--accent); transition: box-shadow .25s var(--ease), background .18s; }
table.data tbody tr:hover td { background: var(--panel-2); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data tr:last-child td { border-bottom: 0; }
td .clip { display: block; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.id { color: var(--faint); width: 1%; font-variant-numeric: tabular-nums; }
.neg { color: var(--crit); } .pos { color: var(--ok); }
.table-foot { padding: 10px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------------- drawer */
#drawer-backdrop { position: fixed; inset: 0; background: rgba(4, 8, 14, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 30; animation: fade .3s both; }
#drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(580px, calc(100% - 20px)); z-index: 31;
  background: var(--solid); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden;
  animation: drawer-in .5s var(--ease) both;
}
#drawer::before { content: ""; height: 3px; background: var(--grad); flex: 0 0 3px; }
#drawer.closing { animation: drawer-out .22s ease-in both; }
#drawer-backdrop.closing { animation: fade .22s reverse both; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 24px 13px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 21px; font-weight: 600; overflow-wrap: anywhere; letter-spacing: -.01em; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head .kicker { color: var(--accent); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 24px; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--panel-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; animation: rise .45s var(--ease) both; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; transition: color .2s; }
.field:focus-within label { color: var(--accent); }
.field label .req { color: var(--crit); margin-left: 3px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 39px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--panel-2); transition: border-color .2s, box-shadow .25s, background .2s;
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); background: var(--solid);
}
.form-error {
  background: var(--crit-bg); color: var(--crit); border-radius: 10px; padding: 10px 13px;
  margin-bottom: 14px; font-size: 14px; overflow-wrap: anywhere; animation: shake .4s;
}
.meta-line { color: var(--faint); font-size: 12.5px; margin-top: 18px; }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow-lg); font-weight: 500;
  max-width: min(560px, 92vw); animation: toast-in .5s var(--spring) both;
}
.toast::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--glow); flex: 0 0 9px; }
.toast.error { background: var(--crit); color: #fff; } .toast.error::before { background: #fff; box-shadow: none; }
.toast.out { animation: toast-out .3s ease-in both; }

/* --------------------------------------------------------------- history */
.hist { padding: 13px 18px 13px 40px; border-top: 1px solid var(--line); position: relative; transition: background .2s; }
.hist:first-child { border-top: 0; }
.hist:hover { background: var(--panel-2); }
.hist::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.hist::after { content: ""; position: absolute; left: 17px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--solid); border: 2px solid var(--accent); transition: transform .25s var(--spring), background .2s; }
.hist:hover::after { transform: scale(1.35); background: var(--accent); }
.hist-head { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.hist-head .seq { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.diff { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 3px 0 0 0; overflow-wrap: anywhere; }
.diff del { color: var(--crit); text-decoration: line-through; }
.diff ins { color: var(--ok); text-decoration: none; }

/* --------------------------------------------------------------- welcome */
.welcome { max-width: 640px; margin: 40px auto; }
.welcome .panel-body { padding: 28px; }
.welcome h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.drop {
  border: 2px dashed var(--line-strong); border-radius: 14px; padding: 30px; text-align: center;
  color: var(--muted); margin: 16px 0; cursor: pointer; transition: border-color .25s, background .25s, transform .3s var(--spring);
}
.drop:hover { border-color: var(--accent); transform: translateY(-2px); }
.drop.over { border-color: var(--accent); background: var(--accent-weak); transform: scale(1.02); }
.ok-text { color: var(--ok); font-weight: 600; } .bad-text { color: var(--crit); font-weight: 600; }

/* ---------------------------------------------------------------- motion */
.rise { animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sheen { to { left: 130%; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes aurora { from { transform: translate(-3%, -2%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(8deg); } }
@keyframes strand { 0%, 100% { top: 0; transform: scale(1.25); } 50% { top: calc(100% - 3px); transform: scale(.7); } }
@keyframes strand-b { 0%, 100% { top: calc(100% - 3px); transform: scale(.7); } 50% { top: 0; transform: scale(1.25); } }
.loader .helix i::before { animation-name: strand-lg; } .loader .helix i::after { animation-name: strand-lg-b; }
@keyframes strand-lg { 0%, 100% { top: 0; transform: scale(1.2); } 50% { top: calc(100% - 6px); transform: scale(.7); } }
@keyframes strand-lg-b { 0%, 100% { top: calc(100% - 6px); transform: scale(.7); } 50% { top: 0; transform: scale(1.2); } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 currentColor; } 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--crit); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(60px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(50px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(.95); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  #sidebar { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform .4s var(--ease); box-shadow: var(--shadow-lg); background: var(--solid); }
  body.nav-open #sidebar { transform: none; }
  body.nav-open #scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(4, 8, 14, .45); animation: fade .3s both; }
  #menu-btn { display: inline-block; }
  #topbar { padding: 12px 16px; } #topbar h1 { font-size: 20px; }
  .titles { min-width: 0; flex-basis: 0; }
  #view { padding: 16px 16px 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .value { font-size: 24px; }
  .search, .search:focus { min-width: 0; flex: 1 1 100%; }
  .finding { grid-template-columns: 1fr; gap: 5px; }
  #drawer { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; }
}

/* ============================ command palette, menus, keyboard ============================ */
kbd {
  font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line-strong); border-bottom-width: 2px;
}
.search-btn {
  display: flex; align-items: center; gap: 22px; height: 36px; padding: 0 8px 0 14px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--solid); color: var(--faint); cursor: pointer;
  transition: border-color .2s, box-shadow .25s, color .2s;
}
.search-btn:hover { border-color: var(--accent); color: var(--text); box-shadow: 0 6px 18px var(--glow); }
#palette {
  position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start;
  padding-top: 13vh; background: rgba(4, 8, 14, .55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fade .18s both;
}
.pal-box {
  width: min(640px, calc(100vw - 24px)); background: var(--solid); border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--glow); overflow: hidden;
  animation: pal-in .28s var(--spring) both;
}
.pal-box::before { content: ""; display: block; height: 2px; background: var(--grad); }
.pal-input { width: 100%; border: 0; outline: 0; background: transparent; padding: 18px 20px; font-size: 18px; border-bottom: 1px solid var(--line); }
.pal-list { max-height: min(52vh, 440px); overflow-y: auto; padding: 6px; }
.pal-item {
  display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
}
.pal-item.on { background: var(--accent-weak); }
.pal-hint { flex: 0 0 104px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item.on .pal-hint { color: var(--accent); }
.pal-label { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub { color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pal-foot { padding: 9px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; background: var(--panel-2); }
@keyframes pal-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }

.menu {
  position: fixed; z-index: 70; min-width: 168px; padding: 5px; background: var(--solid);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: pal-in .2s var(--spring) both; transform-origin: top left;
}
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--panel-2); outline: none; }

#tip {
  position: fixed; z-index: 80; pointer-events: none; padding: 8px 11px; border-radius: 10px; font-size: 13px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); max-width: 300px; animation: fade .12s both;
}
#tip .tip-head { font-weight: 600; }

/* ================================== tables: inline, select, bulk ========================= */
.pill-btn { border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 99px; transition: transform .2s var(--spring), box-shadow .2s; }
.pill-btn:hover { transform: scale(1.07); box-shadow: 0 0 0 3px var(--accent-weak); }
table.data th.check, table.data td.check { width: 1%; padding-right: 2px; }
td.check input, th.check input, .toggle input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
td.check input { opacity: 0; transition: opacity .15s; }
tr:hover td.check input, tr.selected td.check input, tr.cursor td.check input, td.check input:focus { opacity: 1; }
table.data tbody tr.cursor td { background: var(--panel-2); }
table.data tbody tr.cursor td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data tbody tr.selected td { background: var(--accent-weak); }
table.data.plain tbody tr { cursor: default; }
table.data.plain tbody tr:hover td:first-child { box-shadow: none; }
.table-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kbd-hint { color: var(--faint); }
.kbd-hint kbd { margin: 0 1px; }
#bulkbar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 9px 18px; border-radius: 99px; background: var(--solid); border: 1px solid var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-weak); animation: toast-in .4s var(--spring) both;
}
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.seg-btn { border: 0; background: transparent; padding: 5px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; transition: background .25s, color .2s, box-shadow .25s; }
.seg-btn.on { background: var(--solid); color: var(--text); box-shadow: var(--shadow); }

/* ========================================== boards ======================================== */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col {
  flex: 1 0 250px; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: border-color .2s, box-shadow .25s, background .2s;
}
.board-col.over { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); background: var(--accent-weak); }
.board-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.board-title { font-weight: 600; flex: 1; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; }
.board-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--faint); }
.bs-not_started .board-title::before { background: var(--high); } .bs-in_progress .board-title::before { background: var(--med); }
.bs-blocked .board-title::before { background: var(--crit); } .bs-done .board-title::before { background: var(--ok); }
.board-add { border: 0; background: transparent; cursor: pointer; width: 24px; height: 24px; border-radius: 7px; color: var(--muted); font-size: 17px; line-height: 1; transition: background .2s, transform .25s var(--spring); }
.board-add:hover { background: var(--panel-2); color: var(--accent); transform: rotate(90deg); }
.board-list { padding: 4px 9px 10px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.board-card {
  --mx: 50%; --my: 0%; position: relative; background: var(--solid); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  cursor: grab; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s, opacity .2s;
}
.board-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(160px circle at var(--mx) var(--my), var(--glow), transparent 65%); }
.board-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 10px 24px var(--glow); }
.board-card:hover::before { opacity: 1; }
.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: .35; transform: rotate(2deg) scale(.98); }
.board-card.landed { animation: landed .5s var(--spring); }
.board-card > * { position: relative; }
.bc-title { font-weight: 500; line-height: 1.3; }
.bc-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 12.5px; }
.board-empty { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 14px; text-align: center; color: var(--faint); font-size: 13px; }
@keyframes landed { 0% { transform: scale(.9); box-shadow: 0 0 0 0 var(--glow); } 60% { transform: scale(1.04); box-shadow: 0 0 0 8px var(--accent-weak); } 100% { transform: none; } }

/* ========================================= timeline ======================================= */
.timeline { padding: 8px 22px 18px; }
.tl-month { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 18px 0 6px; }
.tl-item { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 14px; padding: 9px 10px 9px 24px; border-radius: 10px; cursor: pointer; transition: background .2s; }
.tl-item:hover { background: var(--panel-2); }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.tl-item::after { content: ""; position: absolute; left: 4px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--solid); border: 2px solid var(--accent); transition: transform .25s var(--spring), background .2s; }
.tl-item:hover::after { transform: scale(1.4); background: var(--accent); }
.tl-item.is-done::after { background: var(--accent); }
.tl-date { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tl-title { font-weight: 500; }
.tl-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===================================== KPI trend cards ==================================== */
.sparks { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 18px; }
.spark { padding: 14px 16px; }
.spark .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.spark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spark .value { font-size: 24px; font-weight: 500; }
.sparkline { width: 120px; flex: 0 0 120px; }
.spark .hint { font-size: 13px; color: var(--muted); } .spark .hint.pos { color: var(--ok); } .spark .hint.neg { color: var(--crit); }

/* ========================================= calendar ======================================= */
.calendar { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px 12px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; padding: 7px 7px 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; transition: background .2s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--panel-2); }
.cal-cell.out .cal-num { opacity: .35; }
.cal-num { font-size: 13.5px; font-variant-numeric: tabular-nums; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.cal-cell.today .cal-num { background: var(--grad); color: var(--accent-ink); font-weight: 700; box-shadow: 0 4px 12px var(--glow); }
.cal-item { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font-size: 12.5px; padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--k-bg, var(--low-bg)); color: var(--k, var(--low)); border-left: 3px solid var(--k, var(--low)); transition: transform .2s var(--spring), filter .2s; }
.cal-item:hover { transform: translateX(2px) scale(1.02); filter: brightness(1.12); }
.cal-item.is-done { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: 12px; padding-left: 7px; }
.k-deadline { --k: var(--crit); --k-bg: var(--crit-bg); } .k-task { --k: var(--accent); --k-bg: var(--accent-weak); }
.k-follow_up { --k: var(--high); --k-bg: var(--high-bg); } .k-event { --k: var(--accent-2); --k-bg: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.k-renewal { --k: var(--med); --k-bg: var(--med-bg); } .k-content { --k: var(--low); --k-bg: var(--low-bg); }
.k-milestone { --k: var(--ok); --k-bg: var(--ok-bg); }
.legend i[class^="k-"] { background: var(--k); }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k); margin-right: 6px; }

/* ====================================== today, rituals ==================================== */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.hero-title { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.hero-stats { display: flex; gap: 12px; }
.hero-stat { display: flex; flex-direction: column; align-items: center; min-width: 108px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); color: var(--muted); font-size: 13px; transition: transform .3s var(--spring); }
a.hero-stat:hover { transform: translateY(-3px); text-decoration: none; }
.hero-stat b { font-size: 27px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.ritual-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; border: 2px solid var(--ok); background: var(--ok); }
.ritual-dot.due { background: transparent; border-color: var(--high); animation: beacon 1.8s ease-out infinite; color: var(--high); }

/* ================================ findings, drawer extras ================================= */
.finding-actions { display: flex; gap: 6px; margin-top: 9px; }
.toast-btn { border: 0; cursor: pointer; font-weight: 700; padding: 3px 11px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); transition: transform .2s var(--spring); }
.toast-btn:hover { transform: scale(1.08); }
.related { margin-top: 22px; }
.related-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.related-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); animation: rise .4s var(--ease) both; }
.related-row:hover { background: var(--panel-2); text-decoration: none; }
.related-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-link { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; }
.foot-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.foot-me { display: flex; align-items: center; gap: 9px; color: var(--text); }
.foot-me .grow { display: grid; line-height: 1.25; min-width: 0; }
.foot-me b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-me .faint { font-size: 12px; }
.foot-av { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--company, var(--accent-2)) 18%, transparent); color: var(--company, var(--accent-2)); }
.foot-note { margin-top: 6px; }
.theme-btn { border: 1px solid var(--line-strong); background: transparent; border-radius: 99px; padding: 2px 10px; cursor: pointer; color: var(--muted); font-size: 12.5px; transition: border-color .2s, color .2s; }
.theme-btn:hover { border-color: var(--accent); color: var(--text); }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* ========================================== login ========================================= */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(380px, 100%); padding: 30px 28px; text-align: center; animation: rise .6s var(--ease) both; }
.login-box .logo { margin: 0 auto 12px; width: 48px; height: 62px; }
.login-box h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; }
.login-box input { width: 100%; height: 44px; margin: 18px 0 12px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel-2); text-align: center; font-size: 17px; letter-spacing: .08em; }
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); }
.login-box .btn { width: 100%; justify-content: center; height: 44px; }

@media (max-width: 900px) {
  .search-btn span { display: none; } .search-btn { gap: 0; padding: 0 8px; }
  .search-btn kbd { border: 0; background: transparent; font-size: 13px; }
  .cal-cell { min-height: 74px; padding: 4px; } .cal-item { font-size: 0; height: 7px; padding: 0; border-left-width: 0; background: var(--k); }
  .cal-head div { padding: 8px 4px; text-align: center; letter-spacing: 0; }
  .tl-item { grid-template-columns: 1fr; gap: 2px; } .hero-title { font-size: 21px; }
  .kbd-hint { display: none; } #bulkbar { width: calc(100% - 20px); border-radius: 16px; flex-wrap: wrap; justify-content: center; bottom: 12px; }
  .board-col { flex-basis: 78vw; }
}

/* ------------------------------------------------------------ connectors */
.btn.working { position: relative; color: transparent !important; pointer-events: none; }
.btn.working::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--muted); border-top-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.working::before { border-color: var(--accent-ink); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.field-help { font-size: 12.5px; color: var(--faint); line-height: 1.35; }
.conn-hero { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px 26px; }
.conn-hero h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; color: var(--brand); }
.conn-hero > div:first-child { flex: 1 1 380px; max-width: 640px; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-node {
  padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand); background: var(--solid);
  animation: rise .5s var(--ease) both;
}
.flow-node:nth-of-type(2) { animation-delay: .08s; } .flow-node:nth-of-type(3) { animation-delay: .16s; }
.flow-node:nth-of-type(4) { animation-delay: .24s; } .flow-node:nth-of-type(5) { animation-delay: .32s; }
.flow-arrow { color: var(--accent); font-weight: 600; }
.conn-cat { margin: 8px 2px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.conn-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.conn { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.conn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.conn.on { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.conn.on::before, .conn.bad::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent-2); }
.conn.bad::before { background: var(--crit); }
.conn-top { display: flex; gap: 12px; align-items: center; }
.conn-top h4 { margin: 0 0 4px; font-size: 16.5px; font-weight: 600; }
.conn-glyph {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; display: grid; place-items: center;
  font: 600 14px var(--mono); letter-spacing: .02em; text-transform: uppercase;
  color: var(--brand); background: var(--panel-2); border: 1px solid var(--line);
}
.conn.on .conn-glyph { color: var(--bg); background: var(--accent-2); border-color: transparent; }
.conn-blurb { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; flex: 1; }
.pill.conn-off { color: var(--faint); background: var(--low-bg); }
.pill.conn-on { color: var(--ok); background: var(--ok-bg); }
.pill.conn-on::before { animation: pulse 2.4s ease-in-out infinite; }
.pill.conn-bad { color: var(--crit); background: var(--crit-bg); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.conn-metrics { display: flex; gap: 22px; flex-wrap: wrap; }
.conn-metric .label, .pstat .label, .stage-node .label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.conn-metric .value { font: 600 20px var(--mono); letter-spacing: -.02em; }
.conn-metric .delta { font-size: 12px; } .delta.up { color: var(--ok); } .delta.down { color: var(--crit); }
.conn-last { display: flex; gap: 10px; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: 9px; background: var(--panel-2); }
.conn-last.bad { color: var(--crit); background: var(--crit-bg); }
.conn-last .faint { white-space: nowrap; }
.conn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.conn-feed { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.conn-feed code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 9px; border-radius: 8px; background: var(--panel-2); font: 12px var(--mono); }
.conn-setup { padding: 12px 14px; border-radius: 11px; background: var(--panel-2); margin-bottom: 16px; font-size: 14px; display: grid; gap: 6px; }
.conn-note { margin-top: 14px; font-size: 12.5px; }

/* -------------------------------------------------------------- products */
.stage-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 24px; overflow-x: auto; }
.stage-node { text-align: center; min-width: 76px; opacity: .5; transition: opacity .3s; }
.stage-node.has { opacity: 1; }
.stage-node .value { font: 600 26px var(--mono); color: var(--brand); }
.stage-node.has .value { color: var(--accent); }
.product-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.product { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: transform .3s var(--ease), box-shadow .3s; }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product.ended { opacity: .72; }
.product-top { display: flex; gap: 12px; align-items: flex-start; }
.product-top h3 { margin: 0 0 3px; font-size: 20px; font-weight: 600; }
.product-top h3 a { color: var(--brand); }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pstat { padding: 10px 8px; border-radius: 10px; background: var(--panel-2); color: var(--text); text-align: center; transition: background .2s, transform .2s var(--ease); }
.pstat:hover { text-decoration: none; background: var(--accent-weak); transform: translateY(-2px); }
.pstat .value { font: 600 19px var(--mono); }
.product-money { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.product-money b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.product-money .bad-text b { color: var(--crit); } .product-money .ok-text b { color: var(--ok); }
.product-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; font-size: 13.5px; padding-top: 12px; border-top: 1px solid var(--line); }
.pill.stage-live { color: var(--ok); background: var(--ok-bg); }
.pill.stage-beta, .pill.stage-building { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 13%, transparent); }
.pill.stage-idea, .pill.stage-discovery { color: var(--med); background: var(--med-bg); }
.pill.stage-paused, .pill.stage-pivoted, .pill.stage-sunset, .pill.stage-none { color: var(--low); background: var(--low-bg); }
.product-pick { flex: 0 1 190px; }

/* ------------------------------------------------------------- assistant */
#agent-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 20; display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); cursor: pointer;
  background: var(--solid); color: var(--brand); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px;
  box-shadow: var(--shadow-lg); transition: transform .3s var(--spring), border-color .2s, opacity .2s;
  animation: rise .6s .4s var(--ease) both;
}
#agent-fab svg { width: 17px; height: 30px; transition: transform .45s var(--spring); }
#agent-fab:hover { transform: translateY(-3px); border-color: var(--accent); }
#agent-fab:hover svg { transform: translateY(-3px); }
body.agent-open #agent-fab { opacity: 0; pointer-events: none; }
#agent {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: 420px; z-index: 25; display: flex; flex-direction: column;
  background: var(--solid); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: drawer-in .45s var(--ease) both;
}
@media (min-width: 1180px) { body.agent-open #main { padding-right: 430px; } body.agent-open #bulkbar { right: 440px; } }
.agent-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.agent-mark { width: 18px; height: 32px; flex: 0 0 18px; }
.agent-title { font-weight: 600; font-size: 16px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.agent-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.agent-empty { margin: auto 0; text-align: center; padding: 10px 6px; animation: rise .5s var(--ease) both; }
.agent-empty h3 { margin: 0 0 6px; font-size: 21px; font-weight: 600; color: var(--brand); }
.agent-empty p { margin: 0 0 16px; }
.suggest { display: grid; gap: 8px; }
.suggest .chip { text-align: left; white-space: normal; line-height: 1.3; padding: 10px 13px; border-radius: 11px; width: 100%; }
.msg { animation: rise .35s var(--ease) both; display: grid; gap: 9px; }
.msg.user { justify-items: end; }
.bubble { max-width: 88%; padding: 9px 13px; border-radius: 15px 15px 4px 15px; background: var(--brand); color: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.md { line-height: 1.5; overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; } .md p:last-child, .md ul:last-child, .md ol:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; } .md li { margin: 2px 0; }
.md code { font: 13px var(--mono); padding: 1px 5px; border-radius: 5px; background: var(--panel-2); }
.md-head { font-weight: 600; color: var(--brand); }
.steps { display: grid; gap: 3px; }
.step { font-size: 12.5px; color: var(--faint); display: flex; gap: 7px; align-items: center; animation: rise .3s var(--ease) both; }
.step::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); flex: 0 0 5px; }
.actions { display: grid; gap: 5px; }
.action {
  display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); animation: rise .35s var(--ease) both; min-width: 0;
}
a.action:hover { text-decoration: none; border-color: var(--accent); }
.action .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action .faint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.verb { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.v-add { color: var(--ok); background: var(--ok-bg); } .v-upd { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.v-del { color: var(--crit); background: var(--crit-bg); }
.bot-error { color: var(--crit); background: var(--crit-bg); padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.undo-turn { justify-self: start; font-size: 13px; padding: 5px 11px; }
.thinking { display: flex; gap: 5px; padding: 4px 0; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: think 1.1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.agent-foot { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--panel-2); }
.agent-input {
  flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--solid);
  outline: 0; line-height: 1.4; max-height: 160px; transition: border-color .2s, box-shadow .2s;
}
.agent-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
@media (max-width: 899px) {
  #agent { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; border: 0; }
  #agent-fab { right: 14px; bottom: 14px; }
  .pstats { grid-template-columns: repeat(2, 1fr); }
  .conn-grid, .product-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .thinking i, .pill.conn-on::before, .btn.working::before { animation: none; } }

/* ------------------------------------------------- earlier looks, kept as options
   data-skin on <html>: none = the Mishale brand, "helix" = the green aurora look,
   "classic" = the first plain blue one. Each has a light and a dark side. */
:root[data-skin="helix"] {
  --bg: #f3f6f2; --panel: rgba(255, 255, 255, .86); --solid: #ffffff; --panel-2: #eef3ee;
  --text: #0e1b17; --muted: #53635d; --faint: #65716c; --line: rgba(14, 27, 23, .09); --line-strong: rgba(14, 27, 23, .17);
  --brand: #0e1b17; --accent: #097e5d; --accent-2: #3d5bdb; --accent-ink: #ffffff; --accent-weak: rgba(9, 126, 93, .11);
  --grad: linear-gradient(135deg, #0fb587 0%, #1c9fd6 55%, #5a5fe0 100%); --glow: rgba(11, 154, 114, .22);
  --aurora-1: rgba(15, 181, 135, .16); --aurora-2: rgba(90, 95, 224, .12);
  --mark-a: #37e2aa; --mark-b: #0b9a72; --mark-c: #063d2e; --mark-edge: #063d2e;
  --crit: #d42c1f; --crit-bg: rgba(217, 45, 32, .09); --high: #c2410c; --high-bg: rgba(194, 65, 12, .1);
  --med: #a16207; --med-bg: rgba(161, 98, 7, .11); --low: #53635d; --low-bg: rgba(14, 27, 23, .06);
  --ok: #0b7a55; --ok-bg: rgba(11, 122, 85, .11);
  --shadow: 0 1px 2px rgba(14, 27, 23, .05), 0 4px 14px rgba(14, 27, 23, .05); --shadow-lg: 0 24px 60px rgba(14, 27, 23, .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root[data-skin="helix"]:not([data-theme="light"]) {
  --bg: #060b12; --panel: rgba(17, 24, 36, .72); --solid: #0e1520; --panel-2: rgba(255, 255, 255, .045);
  --text: #e9eef5; --muted: #9aa8ba; --faint: #7a889c; --line: rgba(255, 255, 255, .075); --line-strong: rgba(255, 255, 255, .15);
  --brand: #e9eef5; --accent: #37e2aa; --accent-2: #7f8cff; --accent-ink: #03130d; --accent-weak: rgba(55, 226, 170, .12);
  --grad: linear-gradient(135deg, #37e2aa 0%, #4cc3ff 55%, #8a7dff 100%); --glow: rgba(55, 226, 170, .28);
  --aurora-1: rgba(55, 226, 170, .13); --aurora-2: rgba(127, 140, 255, .14);
  --mark-a: #b9ffe6; --mark-b: #37e2aa; --mark-c: #0a3b2c; --mark-edge: rgba(55, 226, 170, .6);
  --crit: #ff6f61; --crit-bg: rgba(255, 111, 97, .13); --high: #ff9d5c; --high-bg: rgba(255, 157, 92, .13);
  --med: #f4c552; --med-bg: rgba(244, 197, 82, .12); --low: #9aa8ba; --low-bg: rgba(255, 255, 255, .07);
  --ok: #37e2aa; --ok-bg: rgba(55, 226, 170, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .28); --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
}
:root[data-skin="helix"][data-theme="dark"] {
  --bg: #060b12; --panel: rgba(17, 24, 36, .72); --solid: #0e1520; --panel-2: rgba(255, 255, 255, .045);
  --text: #e9eef5; --muted: #9aa8ba; --faint: #7a889c; --line: rgba(255, 255, 255, .075); --line-strong: rgba(255, 255, 255, .15);
  --brand: #e9eef5; --accent: #37e2aa; --accent-2: #7f8cff; --accent-ink: #03130d; --accent-weak: rgba(55, 226, 170, .12);
  --grad: linear-gradient(135deg, #37e2aa 0%, #4cc3ff 55%, #8a7dff 100%); --glow: rgba(55, 226, 170, .28);
  --aurora-1: rgba(55, 226, 170, .13); --aurora-2: rgba(127, 140, 255, .14);
  --mark-a: #b9ffe6; --mark-b: #37e2aa; --mark-c: #0a3b2c; --mark-edge: rgba(55, 226, 170, .6);
  --crit: #ff6f61; --crit-bg: rgba(255, 111, 97, .13); --high: #ff9d5c; --high-bg: rgba(255, 157, 92, .13);
  --med: #f4c552; --med-bg: rgba(244, 197, 82, .12); --low: #9aa8ba; --low-bg: rgba(255, 255, 255, .07);
  --ok: #37e2aa; --ok-bg: rgba(55, 226, 170, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .28); --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-skin="classic"] {
  --bg: #f5f6f8; --panel: #ffffff; --solid: #ffffff; --panel-2: #f2f4f7;
  --text: #15181e; --muted: #5d6573; --faint: #67707d; --line: #e4e7ec; --line-strong: #d0d5dd;
  --brand: #15181e; --accent: #1f5eff; --accent-2: #0e9384; --accent-ink: #ffffff; --accent-weak: #eaf0ff;
  --grad: linear-gradient(135deg, #1f5eff 0%, #1f5eff 100%); --glow: rgba(31, 94, 255, .2);
  --aurora-1: transparent; --aurora-2: transparent;
  --mark-a: #6b95ff; --mark-b: #1f5eff; --mark-c: #0b2a80; --mark-edge: #0b2a80;
  --crit: #d42c1f; --crit-bg: #fef3f2; --high: #c4320a; --high-bg: #fff4ed;
  --med: #a15c07; --med-bg: #fffaeb; --low: #475467; --low-bg: #f2f4f7; --ok: #067647; --ok-bg: #ecfdf3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08); --shadow-lg: 0 20px 40px rgba(16, 24, 40, .18);
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root[data-skin="classic"]:not([data-theme="light"]) {
  --bg: #0e1116; --panel: #161a21; --solid: #161a21; --panel-2: #1b2029;
  --text: #e7eaf0; --muted: #a2abb9; --faint: #838d9c; --line: #262c36; --line-strong: #333b47;
  --brand: #e7eaf0; --accent: #6b95ff; --accent-2: #4ad2c0; --accent-ink: #0b0f17; --accent-weak: #1a2643;
  --grad: linear-gradient(135deg, #6b95ff 0%, #6b95ff 100%); --glow: rgba(107, 149, 255, .25);
  --aurora-1: transparent; --aurora-2: transparent;
  --mark-a: #c5d6ff; --mark-b: #6b95ff; --mark-c: #1a2643; --mark-edge: rgba(107, 149, 255, .6);
  --crit: #ff6b5e; --crit-bg: #3a1714; --high: #ff9a5c; --high-bg: #3a2113;
  --med: #f5c451; --med-bg: #33290f; --low: #a2abb9; --low-bg: #222833; --ok: #4ad295; --ok-bg: #0f2e21;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
}
:root[data-skin="classic"][data-theme="dark"] {
  --bg: #0e1116; --panel: #161a21; --solid: #161a21; --panel-2: #1b2029;
  --text: #e7eaf0; --muted: #a2abb9; --faint: #838d9c; --line: #262c36; --line-strong: #333b47;
  --brand: #e7eaf0; --accent: #6b95ff; --accent-2: #4ad2c0; --accent-ink: #0b0f17; --accent-weak: #1a2643;
  --grad: linear-gradient(135deg, #6b95ff 0%, #6b95ff 100%); --glow: rgba(107, 149, 255, .25);
  --aurora-1: transparent; --aurora-2: transparent;
  --mark-a: #c5d6ff; --mark-b: #6b95ff; --mark-c: #1a2643; --mark-edge: rgba(107, 149, 255, .6);
  --crit: #ff6b5e; --crit-bg: #3a1714; --high: #ff9a5c; --high-bg: #3a2113;
  --med: #f5c451; --med-bg: #33290f; --low: #a2abb9; --low-bg: #222833; --ok: #4ad295; --ok-bg: #0f2e21;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
[data-skin="classic"] body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
[data-skin="classic"] body::after { display: none; }
[data-skin="classic"] .brand-name, [data-skin="helix"] .brand-name { letter-spacing: .04em; text-transform: none; font-weight: 600; font-size: 19px; }
.skin-row { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.skin-dots { display: flex; } .skin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--solid); margin-left: -5px; }
.skin-dots i:first-child { margin-left: 0; }
.skin-row .faint { margin-left: auto; font-size: 12px; }

/* --------------------------------------------------------------- motion, round two */
#view { view-transition-name: page; }
::view-transition-old(page) { animation: vt-out .16s ease-in both; }
::view-transition-new(page) { animation: vt-in .34s var(--ease) both; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px) scale(.995); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.below { opacity: 0; }
#nav { position: relative; }
#nav-glider {
  position: absolute; left: 10px; width: 0; top: 0; height: 34px; border-radius: 9px; pointer-events: none; opacity: 0;
  background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent);
  transition: transform .42s var(--spring), height .3s var(--ease), left .3s var(--ease), width .3s var(--ease), opacity .25s;
}
.nav-link { z-index: 1; }
.nav-link.active { background: transparent; }
.nav-link::before { display: none; }
.nav-add { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--faint); font: inherit; font-size: 13.5px; }
tr.flash > td, .board-card.flash { animation: flash 1.6s var(--ease) both; }
@keyframes flash { 0%, 35% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.skeleton { display: grid; gap: 16px; padding: 6px 0; animation: fade .3s .12s both; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sk { display: block; border-radius: 12px; background: linear-gradient(100deg, var(--panel-2) 20%, color-mix(in srgb, var(--line-strong) 45%, var(--panel-2)) 40%, var(--panel-2) 60%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
.sk-card { height: 104px; } .sk-line { height: 14px; border-radius: 7px; } .sk-block { height: 220px; } .sk-block.short { height: 120px; }
.w60 { width: 60%; } .w40 { width: 40%; }
@keyframes shimmer { to { background-position: -220% 0; } }
#main { transition: padding-right .45s var(--ease); }
.md.fresh p, .md.fresh li { animation: rise .45s var(--ease) both; }
.btn:active, .chip:active { transition-duration: .05s; }
.panel.card, .conn, .product, .auto { will-change: transform; }

/* --------------------------------------------------------------- automations */
.auto-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.auto { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .3s var(--ease), box-shadow .3s, opacity .3s; }
.auto:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.auto.off { opacity: .6; }
.auto-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.auto-top h4 { margin: 0; font-size: 16.5px; font-weight: 600; }
.auto-flow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.auto-flow .flow-node { padding: 2px 9px; font-size: 10.5px; animation: none; }
.auto-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.warn { color: var(--high); background: var(--high-bg); }
.auto-prompt { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.auto-last { font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.auto-last summary { cursor: pointer; font-weight: 600; color: var(--brand); margin-bottom: 8px; }
.auto-head .muted { max-width: 760px; font-size: 14px; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.auto-page > section + section { margin-top: 34px; }
.switch { width: 40px; height: 23px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; background: var(--line-strong); position: relative; flex: 0 0 40px; transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--solid); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .32s var(--spring); }
.switch.on { background: var(--accent-2); } .switch.on i { transform: translateX(17px); }
.kv-rows { display: grid; gap: 7px; margin-bottom: 7px; }
.kv-row { display: flex; gap: 7px; align-items: center; }
.kv-row select { flex: 0 1 170px; min-width: 0; } .kv-row input { flex: 1; min-width: 0; }
.kv-row select, .kv-row input, .day-picks + input, .field input[type="time"] { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: var(--solid); }
.rule-actions { display: grid; gap: 10px; margin-bottom: 10px; }
.rule-action { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); display: grid; gap: 8px; }
.btn.small, .icon-btn.small { font-size: 12.5px; padding: 3px 9px; } .icon-btn.small { width: 26px; height: 26px; padding: 0; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.checks { gap: 9px; }
.field-def select { flex: 0 0 130px; }

/* ----------------------------------------------------- files, meters, approvals */
.files-box { margin-top: 20px; }
.drop.slim { padding: 14px; font-size: 13.5px; margin-top: 8px; }
.drop.uploading { opacity: .6; pointer-events: none; animation: pulse 1s ease-in-out infinite; }
.file-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { display: grid; gap: 4px; margin-top: 6px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.meter-top b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.meter .bar > span { background: var(--accent-2); } .meter.over .bar > span { background: var(--crit); } .meter.hit .bar > span { background: var(--ok); }
.product-bars { display: grid; gap: 6px; }
.prod-row { display: flex; gap: 14px; align-items: center; color: var(--text); }
.prod-row:hover { text-decoration: none; }
.prod-name { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.prod-tasks { display: grid; justify-items: center; font-size: 11.5px; color: var(--faint); min-width: 70px; }
.prod-tasks b { font: 600 20px var(--mono); color: var(--text); }
.ask { border: 1px solid var(--accent); border-radius: 13px; padding: 13px; display: grid; gap: 9px; background: var(--accent-weak); animation: rise .4s var(--spring) both; }
.ask-title { font-weight: 600; font-size: 15px; }
.ask-note { font-size: 12.5px; color: var(--muted); }
.ask-line .label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.ask-value { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--solid); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; max-height: 240px; overflow-y: auto; font-size: 14px; }
.ask-actions { display: flex; gap: 8px; }
.ask.done { display: flex; align-items: center; border-color: var(--line); background: var(--panel-2); padding: 8px 10px; font-size: 13.5px; animation: none; }
@media (max-width: 899px) { .auto-grid { grid-template-columns: 1fr; } .sk-row { grid-template-columns: 1fr; } .kv-row { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .sk, .ask, tr.flash > td { animation: none; } #nav-glider, #main, .switch i { transition: none; } ::view-transition-old(page), ::view-transition-new(page) { animation: none; } }

/* ------------------------------------------------------------- companies */
.co-avatar {
  --co: #0d6868; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--co); color: #fff; font: 600 11.5px var(--mono); letter-spacing: .02em;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--co) 25%, transparent);
}
.co-avatar.lg { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; font-size: 15px; }
.co-avatar.xl { width: 76px; height: 76px; flex-basis: 76px; border-radius: 20px; font-size: 26px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
#company-switch {
  --co: #0d6868; margin: 12px 12px 6px; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px; width: calc(100% - 24px);
  border: 1px solid var(--line); border-radius: 12px; background: var(--solid); cursor: pointer; text-align: left; color: var(--text);
  transition: border-color .2s, box-shadow .25s, transform .25s var(--spring);
}
#company-switch:hover { border-color: var(--co); box-shadow: 0 6px 20px color-mix(in srgb, var(--co) 22%, transparent); transform: translateY(-1px); }
#company-switch .co-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-count { font: 600 11px var(--mono); color: var(--faint); background: var(--panel-2); border-radius: 99px; padding: 1px 7px; }
.co-chev { color: var(--faint); transition: transform .3s var(--spring); }
#company-switch:hover .co-chev { transform: translateY(2px); }
.co-menu { min-width: 260px; }
.co-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.co-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-row kbd { font-size: 10.5px; }
.co-menu .menu-item:has(.sep) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.co-plus { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: inline-grid; place-items: center; border: 1px dashed var(--line-strong); color: var(--muted); }
.co-plus.big { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; transition: transform .35s var(--spring), border-color .2s, color .2s; }
.co-preview { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 13px; background: var(--panel-2); }
.co-preview-name { font-weight: 600; font-size: 17px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { --co: #000; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--co); box-shadow: 0 0 0 2px var(--solid), 0 0 0 3px transparent; transition: transform .25s var(--spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--solid), 0 0 0 4px var(--co); transform: scale(1.08); }
.co-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.co-tile { --co: #0d6868; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.co-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--co); transform-origin: left; transform: scaleX(.18); transition: transform .5s var(--ease); }
.co-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--co) 40%, var(--line)); }
.co-tile:hover::before, .co-tile.here::before { transform: scaleX(1); }
.co-tile.here { border-color: color-mix(in srgb, var(--co) 45%, var(--line)); }
.co-tile-top { display: flex; gap: 12px; align-items: center; }
.co-tile-top h3 { margin: 0 0 2px; font-size: 18px; font-weight: 600; }
.co-cash { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.co-cash .label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.co-cash b { font: 600 24px var(--mono); letter-spacing: -.02em; }
.pstat.bad .value { color: var(--crit); }
.co-new { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; cursor: pointer; align-items: center; justify-content: center; text-align: center; color: var(--muted); font: inherit; min-height: 220px; }
.co-new > span:nth-child(2) { font-weight: 600; color: var(--text); font-size: 16px; }
.co-new:hover .co-plus.big { transform: rotate(90deg) scale(1.08); border-color: var(--accent); color: var(--accent); }
#curtain { --co: #0d6868; --x: 50vw; --y: 50vh; position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--co); color: #fff; }
#curtain.closing { animation: curtain-close .42s cubic-bezier(.7, 0, .3, 1) both; }
#curtain.opening { animation: curtain-open .7s .12s cubic-bezier(.7, 0, .3, 1) both; }
.curtain-label { display: grid; justify-items: center; gap: 14px; font-size: 22px; font-weight: 500; letter-spacing: .02em; }
.curtain-label .co-avatar { background: rgba(255, 255, 255, .16); box-shadow: none; }
#curtain.closing .curtain-label { animation: rise .35s .12s var(--ease) both; }
#curtain.opening .curtain-label { animation: vt-out .3s ease-in both; }
@keyframes curtain-close { from { clip-path: circle(0 at var(--x) var(--y)); } to { clip-path: circle(150vmax at var(--x) var(--y)); } }
@keyframes curtain-open { from { clip-path: circle(150vmax at 50% 50%); } to { clip-path: circle(0 at 50% 50%); } }
@media (max-width: 899px) { .co-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { #curtain { display: none; } .co-tile::before, .swatch, .co-plus.big { transition: none; } }
.co-new::before { display: none; }
#company-name[hidden] { display: none !important; }

/* ----------------------------------------------------------- reconciling */
.recon { padding: 18px 22px; display: grid; gap: 16px; }
.recon input { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: var(--solid); }
.recon-scale { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 14px; background: var(--panel-2); transition: background .5s var(--ease); }
.recon-scale.even { background: var(--ok-bg); }
.recon-side { display: grid; gap: 3px; } .recon-side:last-child { text-align: right; }
.recon-side b { font: 600 26px var(--mono); letter-spacing: -.02em; }
.recon-side .label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.recon-mid { display: grid; justify-items: center; gap: 4px; }
.recon-eq { font: 600 34px var(--mono); color: var(--muted); transition: transform .5s var(--spring); }
.recon-scale.even .recon-eq { color: var(--ok); transform: scale(1.15); }
@media (max-width: 899px) { .recon-scale { grid-template-columns: 1fr; text-align: center; } .recon-side:last-child { text-align: center; } }

/* ----------------------------------------------------------------- people */
.people { display: grid; gap: 12px; }
.person { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.person h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 600; }
.person-av { --co: var(--accent-2); }
.role-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; }
.role-chip .co-avatar { width: 18px; height: 18px; flex-basis: 18px; font-size: 8px; border-radius: 5px; box-shadow: none; }
.role-row { padding: 6px 0; } .role-row select { flex: 0 1 300px; }
.login-box input#name { margin-bottom: 0; letter-spacing: 0; font-size: 15px; }
/* a viewer is offered nothing that changes data */
body.role-viewer #top-actions .btn.primary, body.role-viewer #agent-fab, body.role-viewer #bulkbar,
body.role-viewer .drawer-foot .btn.primary, body.role-viewer .drawer-foot .btn.danger,
body.role-viewer .files-box .drop, body.role-viewer td input[type=checkbox] { display: none !important; }
body.role-viewer .pill-btn, body.role-viewer .board-card { pointer-events: none; }
body.no-assistant #agent-fab { display: none !important; }
body:not(.role-owner) #top-actions [title="Add your own fields to this table"] { display: none; }
.md.draft > :last-child::after { content: "▍"; margin-left: 2px; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.conn-metric.usage { width: 100%; }
.conn-metric.usage.over .bar > span { background: var(--crit); }
.ask.waiting { margin: 2px 0; }
.proposals { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------ files, sign-off, rounds */
.file-item { display: grid; gap: 4px; padding: 2px 0 6px; border-bottom: 1px solid var(--line); }
.sigs { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 4px; }
.tag.sig { color: var(--ok); background: var(--ok-bg); } .tag.sig.warn { color: var(--high); background: var(--high-bg); }
.versions { font-size: 13px; padding-left: 4px; } .versions summary { cursor: pointer; color: var(--muted); }
.own { display: grid; gap: 10px; padding: 16px 18px; }
.own-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr 64px 92px; gap: 12px; align-items: center; font-size: 14px; }
.own-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.own-track { height: 12px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.own-bar { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); transition: width .9s var(--ease); }
.own-bar.k-pool { background: var(--accent-2); } .own-bar.k-safe { background: var(--med); } .own-bar.k-new { background: var(--accent); }
.round-inputs .kv-row input { min-width: 0; }
@media (max-width: 899px) { .own-row { grid-template-columns: 1fr 64px; } .own-track, .own-row .faint { display: none; } }
.round-cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.round-cards .value { font-size: 24px; overflow-wrap: anywhere; }
.conflict-mine { margin-top: 6px; font-size: 13.5px; }
.ai-active { align-self: flex-start; }

/* ---------------------------------------------------- tax calendar, invoicing, roles */
.tag.jur { font-weight: 600; letter-spacing: .03em; }
.tag.jur-us { color: #2c4f9e; background: rgba(44, 79, 158, .1); }
.tag.jur-ke { color: #1f6b3a; background: rgba(31, 107, 58, .1); }
.tag.jur-nl { color: #b25410; background: rgba(178, 84, 16, .1); }
.tag.jur-eu { color: #3b4cb0; background: rgba(59, 76, 176, .1); }
:root[data-theme="dark"] .tag.jur { filter: brightness(1.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.jur { filter: brightness(1.6); } }
.tax-row.is-done { opacity: .62; }
.tax-row .grow a { color: var(--text); }
.rules-table tr.faded td { color: var(--faint); }
.rules-table code { font-size: 12px; white-space: nowrap; }
.help-box { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; }
.help-box summary { cursor: pointer; color: var(--muted); }
.help-box p { margin: 6px 0; font-size: 13px; }
.pill.inv-draft, .pill.inv-received { color: var(--med); background: var(--med-bg); }
.pill.inv-issued, .pill.inv-approved { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 13%, transparent); }
.pill.inv-part_paid { color: var(--high); background: var(--high-bg); }
.pill.inv-paid, .pill.inv-credited { color: var(--ok); background: var(--ok-bg); }
.pill.inv-void { color: var(--low); background: var(--low-bg); }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover td { background: var(--accent-weak); }
.inv-lines input, .inv-lines select { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; background: var(--solid); color: var(--text); }
.inv-lines td:first-child { min-width: 220px; }
.num-input { text-align: right; font-variant-numeric: tabular-nums; max-width: 120px; }
.inv-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px 24px; margin: 0; }
.inv-totals dt { color: var(--muted); text-align: right; } .inv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-sheet { overflow-x: auto; }
.invoice-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.invoice-layout > * { min-width: 0; }
.inv-foot { padding: 4px 18px 16px; display: grid; gap: 10px; }
.data th.num { text-align: right; }
.profile-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 18px; }
.profile-checks > label:first-child { grid-column: 1 / -1; }
.profile-checks .toggle { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--text); }
.inv-facts { word-break: break-all; font-size: 12px; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.role-card .panel-body { display: grid; gap: 8px; }
.perm-grid th, .perm-grid td { text-align: center; padding: 6px; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; min-width: 160px; }
.perm-grid td:last-child { text-align: left; }
.perm-grid .toggle { display: inline-flex; gap: 4px; margin-right: 8px; }
@media (max-width: 899px) { .invoice-layout { grid-template-columns: minmax(0, 1fr); } .invoice-page { padding: 20px; } .invoice-page .parties, .invoice-page header { flex-direction: column; } .invoice-page .parties > div:last-child, .invoice-page header > div { text-align: left; } }
.perm-grid input[type=checkbox] { width: 17px; height: 17px; min-width: 0; padding: 0; margin: 0; accent-color: var(--accent); }

/* hosted sign-in: one-time links, the QR code, recovery codes */
.setup-box { max-width: 440px; }
.setup-box h2 { margin: 6px 0 0; font-size: 19px; }
.setup-form { display: grid; gap: 10px; width: 100%; }
.qr { display: grid; place-items: center; padding: 6px; background: #fff; border-radius: 12px; width: max-content; margin: 4px auto; }
.qr svg { width: 220px; height: 220px; display: block; }
.totp-key { display: block; margin-top: 6px; font: 600 14px var(--mono); letter-spacing: .06em; user-select: all; word-break: break-all; }
.recovery { columns: 2; margin: 0; padding-left: 22px; font-size: 14px; }
.recovery code { font: 500 14px var(--mono); user-select: all; }

/* live: someone else changed the record you have open; who else is looking */
.live-note { background: var(--med-bg); color: var(--med); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 13.5px; }
.presence { margin-top: 4px; font-size: 12.5px; color: var(--accent-2); }
.presence::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
.login-box .toggle { justify-content: center; text-align: left; font-size: 13.5px; }
.login-box input[type="checkbox"] { width: auto; flex: 0 0 auto; }
