/* ==========================================================================
   app-ui.css — the Plintara app's own design system, re-rooted under `.app`
   for marketing "product windows". v3 kit, 2026-11-26.

   SOURCE OF TRUTH (read-only, copied verbatim where a value exists):
     cde/apps/web/src/index.css            tokens (HSL triplets, L16–205)
     cde/apps/web/tailwind.config.ts       type scale, radii, shadows
     cde/apps/web/src/components/ui/*      button, badge, card, tabs, table, input
     cde/apps/web/src/components/*         rail, page-header, list-row, sheet-card,
                                           key-value, chips, identifier, status-badge
   Where a screenshot and the code disagree, the code wins (the rail was rebuilt
   on 2026-10-13; most screenshots predate it).

   RULES
   - Everything is scoped under `.app`, so nothing leaks into the marketing page.
   - Every class is prefixed `a-`, so the marketing page's own `.btn`, `.chip`,
     `.card` rules cannot leak IN.
   - Fonts: the host page must load 'Manrope' and 'JetBrains Mono' (the family
     names both v3 sites already declare). This file declares no @font-face.
   - Icons: Lucide 0.427 (the app's set), from kit/icons.svg as <symbol>s:
       <svg class="a-i"><use href="#i-send"/></svg>
     Paste the sprite once per page.
   ========================================================================== */

.app {
  /* ---- neutral scale (index.css L16–25) ---- */
  --ink-50: 205 20% 98%;
  --ink-100: 205 16% 95%;
  --ink-200: 205 14% 89%;
  --ink-300: 205 12% 80%;
  --ink-400: 205 10% 62%;
  --ink-500: 205 10% 46%;
  --ink-600: 205 11% 36%;
  --ink-700: 205 12% 26%;
  --ink-800: 205 12% 20%;
  --ink-900: 205 15% 12%;
  --field-placeholder: 205 10% 56%;
  --background: 0 0% 100%;
  --foreground: var(--ink-900);
  --canvas: 205 18% 96.5%;
  --card: 0 0% 100%;
  --primary: var(--ink-800);
  --primary-foreground: 210 40% 98%;
  --destructive: 0 72% 45%;
  --border: var(--ink-200);
  --input: 205 14% 84%;
  --ring: 171 55% 33%;
  /* ---- brand ---- */
  --brand: 171 64% 29%;
  --brand-hover: 171 64% 23%;
  --brand-foreground: 0 0% 100%;
  --brand-subtle: 171 40% 95%;
  --brand-ring: 171 55% 40%;
  --brand-ink: 171 64% 20%;
  /* ---- palette: DECORATIVE ONLY, avatars (index.css L155–177) ---- */
  --palette-blue-subtle: 212 45% 94%;        --palette-blue-strong: 212 69% 30%;
  --palette-terracotta-subtle: 15 55% 94%;   --palette-terracotta-strong: 15 54% 34%;
  --palette-gold-subtle: 36 55% 93%;         --palette-gold-strong: 36 58% 27%;
  --palette-teal-subtle: 171 40% 93%;        --palette-teal-strong: 171 64% 22%;
  --palette-rust-subtle: 13 45% 93%;         --palette-rust-strong: 13 53% 26%;
  --palette-sand-subtle: 36 35% 92%;         --palette-sand-strong: 36 30% 28%;
  /* ---- radii (tailwind.config borderRadius) ---- */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  /* ---- urgency: ORDINAL, due dates only ---- */
  --urgency-overdue: 0 72% 51%;
  --urgency-soon: 24 85% 38%;
  --urgency-later: 38 75% 35%;
  --urgency-none: 215 16% 47%;
  /* ---- tone: CATEGORICAL, Badge/StatusBadge only ---- */
  --tone-neutral-subtle: 205 14% 94%;   --tone-neutral-strong: 205 10% 34%;
  --tone-progress-subtle: 214 38% 95%;  --tone-progress-strong: 214 32% 35%;
  --tone-positive-subtle: 189 28% 93%;  --tone-positive-strong: 189 40% 27%;
  --tone-attention-subtle: 40 50% 92%;  --tone-attention-strong: 40 42% 32%;
  --tone-negative-subtle: 352 40% 95%;  --tone-negative-strong: 352 38% 38%;
  /* ---- elevation (tailwind boxShadow: each carries its own 1px ring) ---- */
  --shadow-card: 0 1px 2px rgba(16,24,32,.06), 0 0 0 1px hsl(var(--ink-200));
  --shadow-raised: 0 4px 12px -2px rgba(16,24,32,.10), 0 0 0 1px hsl(var(--ink-200));
  --shadow-overlay: 0 16px 40px -8px rgba(16,24,32,.24), 0 0 0 1px hsl(var(--ink-200));

  /* ---- base (index.css @layer base, body) ---- */
  font-family: 'Manrope', 'Manrope Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  color: hsl(var(--foreground));
  font-feature-settings: 'rlig' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app *, .app *::before, .app *::after { box-sizing: border-box; border: 0 solid hsl(var(--border)); margin: 0; }
.app :where(h1, h2, h3, h4, p, dl, dd, dt, figure, figcaption, blockquote) { margin: 0; font: inherit; color: inherit; }
.app :where(ul, ol) { list-style: none; padding: 0; margin: 0; }
.app :where(a) { color: inherit; text-decoration: none; }
.app :where(button) { font: inherit; color: inherit; background: none; padding: 0; cursor: default; }
.app :where(table) { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.app :where(th) { font-weight: inherit; text-align: left; }
.app :where(svg) { display: block; }

/* ---- type scale (tailwind fontSize; tracking is part of the token) ---- */
.app .a-2xs { font-size: 11px; line-height: 14px; letter-spacing: .06em; }
.app .a-xs  { font-size: 12px; line-height: 16px; }
.app .a-sm  { font-size: 13px; line-height: 18px; }
.app .a-base{ font-size: 14px; line-height: 20px; }
.app .a-md  { font-size: 15px; line-height: 22px; letter-spacing: -.005em; }
.app .a-lg  { font-size: 17px; line-height: 24px; letter-spacing: -.01em; }
.app .a-xl  { font-size: 20px; line-height: 26px; letter-spacing: -.015em; }
.app .a-2xl { font-size: 24px; line-height: 30px; letter-spacing: -.025em; }
.app .a-mono, .app .a-id { font-family: 'JetBrains Mono', 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Identifier (components/identifier.tsx): font-mono text-xs font-medium, never prose */
.app .a-id { font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.app .a-tnum { font-variant-numeric: tabular-nums; }
.app .a-500 { font-weight: 500; } .app .a-600 { font-weight: 600; } .app .a-700 { font-weight: 700; }
.app .a-fg { color: hsl(var(--foreground)); }
.app .a-ink5 { color: hsl(var(--ink-500)); } .app .a-ink6 { color: hsl(var(--ink-600)); }
.app .a-ink7 { color: hsl(var(--ink-700)); } .app .a-ink8 { color: hsl(var(--ink-800)); }
.app .a-brand { color: hsl(var(--brand)); } .app .a-brand-ink { color: hsl(var(--brand-ink)); }
.app .a-italic { font-style: italic; }
/* EYEBROW_CLASS (components/list-row.tsx): text-2xs font-bold uppercase tracking .06em ink-500 */
.app .a-eyebrow { font-size: 11.5px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.app .a-nowrap { white-space: nowrap; }
.app .a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- icons: 16px, stroke 1.75 (button.tsx [&_svg]) ---- */
.app .a-i { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.75; }
.app .a-i-sm { width: 14px; height: 14px; }
.app .a-i-xs { width: 12px; height: 12px; }
.app .a-i-lg { width: 18px; height: 18px; }
.app .a-i-muted { color: hsl(var(--ink-400)); } /* text-icon-muted: icons only, never text */

/* ==========================================================================
   PRODUCT WINDOW — the marketing frame. Light browser chrome, nothing more.
   <figure class="app a-window" style="--screen-w:1200px; --focus-x:0px">
     <div class="a-chrome">…</div>
     <div class="a-viewport"><div class="a-screen">…the app…</div></div>
   </figure>
   ========================================================================== */
.app.a-window {
  display: block;
  width: 100%;
  max-width: var(--screen-w, 1200px);
  border-radius: 12px;
  overflow: hidden;
  background: hsl(var(--canvas));
  box-shadow: 0 1px 2px rgba(16,24,32,.06), 0 0 0 1px hsl(var(--ink-200)), 0 24px 60px -24px rgba(16,24,32,.28);
  container-type: inline-size;
  container-name: awin;
}
.app .a-chrome {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 14px;
  background: hsl(var(--ink-100));
  border-bottom: 1px solid hsl(var(--ink-200));
}
/* Neutral window controls: grey, never traffic-light colours. */
.app .a-chrome-dots { display: flex; gap: 6px; }
.app .a-chrome-dots i { width: 10px; height: 10px; border-radius: 999px; background: hsl(var(--ink-300)); display: block; }
.app .a-chrome-url {
  flex: 0 1 360px; margin: 0 auto; height: 22px; border-radius: 6px;
  background: hsl(var(--background)); box-shadow: inset 0 0 0 1px hsl(var(--ink-200));
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; line-height: 14px; color: hsl(var(--ink-500));
  white-space: nowrap; overflow: hidden; padding: 0 8px; min-width: 0;
}
.app .a-chrome-url > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.app .a-chrome-url .a-i { width: 11px; height: 11px; color: hsl(var(--ink-400)); }
.app .a-chrome-end { width: 46px; }
.app .a-viewport { position: relative; overflow: hidden; }
.app .a-screen { width: var(--screen-w, 1200px); min-width: var(--screen-w, 1200px); background: hsl(var(--canvas)); }
/* A window can cap its height; the cut is a soft fade into the canvas, so it
   reads as "the page continues", never as a broken box. */
.app .a-viewport[data-cut] { max-height: var(--cut, 640px); }
.app .a-viewport[data-cut]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(to bottom, hsl(var(--canvas) / 0), hsl(var(--canvas)));
  pointer-events: none;
}
.app .a-viewport[data-cut="white"]::after { background: linear-gradient(to bottom, hsl(0 0% 100% / 0), hsl(0 0% 100%)); }

/* ---- PHONE (≤ 600px of window): never shrink text; crop to a focal region.
   The screen keeps its desktop width and text sizes (11px stays 11px). The
   window shows the region starting at --focus-x, and the reader can pan
   sideways (scroll-snap off; a thin native scrollbar is the honest cue). ---- */
@container awin (max-width: 600px) {
  .app .a-viewport, .app .a-viewport[data-cut] { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; max-height: var(--phone-h, 560px); }
  .app .a-viewport > .a-screen { margin-left: calc(-1 * var(--focus-x, 0px)); margin-top: calc(-1 * var(--focus-y, 0px)); }
  .app .a-viewport[data-phone="pan"] > .a-screen { margin-left: 0; }
  .app .a-chrome-url { flex-basis: 200px; }
  .app .a-chrome-end { display: none; }
}

/* ==========================================================================
   APP SHELL — routes/app-shell.tsx (header) + components/rail.tsx
   ========================================================================== */
.app .a-top {
  height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border));
  justify-content: space-between;
}
.app .a-top-l { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.app .a-lockup { height: 24px; width: 134px; flex-shrink: 0; }
.app .a-vsep { width: 1px; height: 24px; background: hsl(var(--border)); flex-shrink: 0; }
.app .a-nav { display: flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; }
/* NavItem: h-14 px-3 font-medium; active = foreground + 2px brand underline on the header's edge */
.app .a-navitem {
  position: relative; height: 56px; padding: 0 12px; display: flex; align-items: center; gap: 6px;
  font-weight: 500; color: hsl(var(--ink-500)); white-space: nowrap;
}
.app .a-navitem.is-active { color: hsl(var(--foreground)); }
.app .a-navitem.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: hsl(var(--brand)); }
.app .a-navcount { border-radius: var(--radius-sm); padding: 0 4px; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-variant-numeric: tabular-nums; background: hsl(var(--ink-200)); color: hsl(var(--ink-700)); }
.app .a-navcount.is-brand { background: hsl(var(--brand)); color: hsl(var(--brand-foreground)); }
/* project switcher: avatar 16px square, name, chevrons-up-down */
.app .a-switcher { display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: 13px; line-height: 18px; color: hsl(var(--foreground)); }
.app .a-search {
  display: flex; align-items: center; gap: 8px; height: 32px; width: 240px; padding: 0 10px;
  border-radius: var(--radius-sm); background: hsl(var(--ink-50)); box-shadow: inset 0 0 0 1px hsl(var(--ink-200));
  font-size: 13px; line-height: 18px; color: hsl(var(--ink-500));
}
.app .a-kbd { margin-left: auto; border-radius: var(--radius-sm); background: hsl(var(--ink-100)); padding: 1px 6px; font-size: 11px; line-height: 14px; letter-spacing: .06em; color: hsl(var(--ink-500)); }
.app .a-account { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: var(--radius-sm); }
.app .a-account-who { width: 112px; line-height: 1.25; }
.app .a-account-who b { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: hsl(var(--foreground)); }
.app .a-account-who span { display: block; font-size: 12px; line-height: 16px; color: hsl(var(--ink-500)); }

.app .a-shell { display: flex; align-items: stretch; background: hsl(var(--canvas)); }
/* LAYOUT_RAIL_NAV: white column, right rule, 232px labelled (xl) or 60px icons */
.app .a-rail { width: 232px; flex-shrink: 0; background: hsl(var(--card)); border-right: 1px solid hsl(var(--ink-200)); display: flex; flex-direction: column; font-size: 13px; line-height: 18px; }
.app .a-rail-id { display: flex; align-items: flex-start; gap: 8px; padding: 16px 24px 12px; border-bottom: 1px solid hsl(var(--ink-200)); }
.app .a-rail-id-name { font-size: 13px; line-height: 1.25; font-weight: 600; color: hsl(var(--foreground)); }
.app .a-rail-id-sub { font-size: 11px; line-height: 14px; letter-spacing: .06em; color: hsl(var(--ink-500)); }
.app .a-rail-id-city { font-size: 12px; line-height: 16px; color: hsl(var(--ink-500)); }
.app .a-rail-items { display: flex; flex-direction: column; gap: 2px; padding: 12px; flex: 1; }
.app .a-rail-group { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding-top: 12px; border-top: 1px solid hsl(var(--ink-200)); }
.app .a-rail-head { padding: 0 12px 6px; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-rail-item { position: relative; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; font-weight: 500; color: hsl(var(--ink-500)); white-space: nowrap; }
.app .a-rail-item .a-i { color: hsl(var(--ink-400)); }
.app .a-rail-item.is-active { background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); }
.app .a-rail-item.is-active .a-i { color: hsl(var(--brand)); }
.app .a-rail-item.is-active::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 999px; background: hsl(var(--brand)); }
.app .a-rail-count { margin-left: auto; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: hsl(var(--ink-500)); }
.app .a-rail-foot { border-top: 1px solid hsl(var(--ink-200)); padding: 8px 12px; }
.app .a-rail-foot .a-rail-item { color: hsl(var(--ink-500)); }
/* icons mode (md–xl, or "Collapse menu"): 60px, labels and headings hidden, a dot for a count */
.app .a-rail.is-icons { width: 60px; }
.app .a-rail.is-icons .a-rail-id { justify-content: center; padding: 16px 10px 12px; }
.app .a-rail.is-icons .a-rail-id-txt,
.app .a-rail.is-icons .a-rail-label,
.app .a-rail.is-icons .a-rail-head,
.app .a-rail.is-icons .a-rail-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.app .a-rail.is-icons .a-rail-item { justify-content: center; padding: 0; }
.app .a-rail.is-icons .a-rail-items { padding: 12px 10px; }
.app .a-rail.is-icons .a-rail-item[data-count]::after { content: ''; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 999px; background: hsl(var(--ink-500)); }
/* LAYOUT_CONTENT: px-6 py-6 lg:px-10 */
.app .a-content { flex: 1; min-width: 0; padding: 24px 40px; }
.app .a-content.is-centred { padding: 24px 32px; }
.app .a-stack > * + * { margin-top: 20px; }
.app .a-stack-4 > * + * { margin-top: 16px; }
.app .a-stack-6 > * + * { margin-top: 24px; }

/* ==========================================================================
   PRIMITIVES
   ========================================================================== */
/* ---- avatar (initials-avatar.tsx): xs20 sm24 md32 lg40; round people, square firms/projects ---- */
.app .a-av { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600; border-radius: 999px; }
.app .a-av.is-sq { border-radius: var(--radius-sm); }
.app .a-av-xxs { width: 16px; height: 16px; font-size: 9px; }
.app .a-av-xs { width: 20px; height: 20px; font-size: 10px; }
.app .a-av-sm { width: 24px; height: 24px; font-size: 11px; }
.app .a-av-28 { width: 28px; height: 28px; font-size: 12px; }
.app .a-av-md { width: 32px; height: 32px; font-size: 13px; }
.app .a-av-lg { width: 40px; height: 40px; font-size: 15px; }
.app .a-tint-blue { background: hsl(var(--palette-blue-subtle)); color: hsl(var(--palette-blue-strong)); }
.app .a-tint-terracotta { background: hsl(var(--palette-terracotta-subtle)); color: hsl(var(--palette-terracotta-strong)); }
.app .a-tint-teal { background: hsl(var(--palette-teal-subtle)); color: hsl(var(--palette-teal-strong)); }
.app .a-tint-gold { background: hsl(var(--palette-gold-subtle)); color: hsl(var(--palette-gold-strong)); }
.app .a-tint-rust { background: hsl(var(--palette-rust-subtle)); color: hsl(var(--palette-rust-strong)); }
.app .a-tint-sand { background: hsl(var(--palette-sand-subtle)); color: hsl(var(--palette-sand-strong)); }

/* ---- badge (ui/badge.tsx): rounded-sm px-1.5 py-px text-xs font-medium leading-4; dot 6px current ---- */
.app .a-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); padding: 1px 6px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.app .a-badge.has-dot::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: .8; flex-shrink: 0; }
.app .a-badge-default   { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.app .a-badge-secondary { background: hsl(var(--ink-100)); color: hsl(var(--ink-700)); }
.app .a-badge-outline   { background: transparent; color: hsl(var(--ink-600)); box-shadow: inset 0 0 0 1px hsl(var(--ink-200)); }
.app .a-badge-neutral   { background: hsl(var(--tone-neutral-subtle)); color: hsl(var(--tone-neutral-strong)); }
.app .a-badge-progress  { background: hsl(var(--tone-progress-subtle)); color: hsl(var(--tone-progress-strong)); }
.app .a-badge-positive  { background: hsl(var(--tone-positive-subtle)); color: hsl(var(--tone-positive-strong)); }
.app .a-badge-attention { background: hsl(var(--tone-attention-subtle)); color: hsl(var(--tone-attention-strong)); }
.app .a-badge-negative  { background: hsl(var(--tone-negative-subtle)); color: hsl(var(--tone-negative-strong)); }
/* Chip (components/chips.tsx): rounded-sm bg-ink-100 px-1.5 py-0.5 text-xs font-medium ink-600 */
.app .a-chip { display: inline-flex; align-items: center; border-radius: var(--radius-sm); background: hsl(var(--ink-100)); padding: 2px 6px; font-size: 12px; line-height: 16px; font-weight: 500; color: hsl(var(--ink-600)); white-space: nowrap; }
/* The file header's "Rev C" token: rounded-sm bg-ink-100 px-1.5 py-px font-mono text-xs ink-700 */
.app .a-revtag { border-radius: var(--radius-sm); background: hsl(var(--ink-100)); padding: 1px 6px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 16px; color: hsl(var(--ink-700)); white-space: nowrap; }

/* ---- urgency (urgency-badge.tsx): 6px dot + text-xs ---- */
.app .a-urg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; white-space: nowrap; }
.app .a-urg::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: hsl(var(--urgency-none)); }
.app .a-urg.is-overdue::before { background: hsl(var(--urgency-overdue)); }
.app .a-urg.is-soon::before { background: hsl(var(--urgency-soon)); }
.app .a-urg.is-later::before { background: hsl(var(--urgency-later)); }

/* ---- button (ui/button.tsx): rounded-sm 14px/500; sm 30, default 34, lg 40, icon 32, icon-sm 28 ---- */
.app .a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; font-weight: 500; height: 34px; padding: 0 12px; }
.app .a-btn-sm { height: 30px; padding: 0 10px; font-size: 13px; line-height: 18px; }
.app .a-btn-icon { height: 32px; width: 32px; padding: 0; }
.app .a-btn-icon-sm { height: 28px; width: 28px; padding: 0; }
.app .a-btn-default { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.app .a-btn-secondary { background: hsl(var(--ink-100)); color: hsl(var(--ink-800)); }
.app .a-btn-outline { background: #fff; color: hsl(var(--ink-800)); box-shadow: inset 0 0 0 1px hsl(var(--ink-200)); }
.app .a-btn-ghost { color: hsl(var(--ink-700)); }
.app .a-btn-quiet { color: hsl(var(--ink-600)); }
.app .a-btn-subtle { background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); }
.app .a-btn-brand { background: hsl(var(--brand)); color: hsl(var(--brand-foreground)); }
.app .a-btn-link { color: hsl(var(--brand)); height: auto; padding: 0; }
.app .a-btn[disabled], .app .a-btn.is-disabled { opacity: .5; }

/* ---- inputs (ui/input, select, search-input): h-34 rounded-sm border-input white ---- */
.app .a-input { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid hsl(var(--input)); background: #fff; font-size: 13px; line-height: 18px; color: hsl(var(--foreground)); }
.app .a-input.is-ph { color: hsl(var(--field-placeholder)); }
.app .a-input.is-search { padding-left: 8px; }
.app .a-input .a-ph { color: hsl(var(--field-placeholder)); }
.app .a-select { justify-content: space-between; }
.app .a-select .a-i { color: hsl(var(--ink-400)); }
.app .a-textarea { height: auto; min-height: 72px; align-items: flex-start; padding: 8px 10px; }
/* filter pill (chips.tsx pillClass): h-34 rounded-sm border px-3 text-sm */
.app .a-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid hsl(var(--ink-200)); font-size: 13px; line-height: 18px; color: hsl(var(--ink-600)); white-space: nowrap; }
.app .a-pill.is-on { border-color: hsl(var(--brand)); background: hsl(var(--brand-subtle)); font-weight: 500; color: hsl(var(--brand-ink)); }
.app .a-pill .a-i { width: 14px; height: 14px; stroke-width: 2; }
.app .a-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.app .a-toolbar .a-spacer { flex: 1; }
.app .a-label { font-size: 14px; line-height: 20px; font-weight: 500; color: hsl(var(--foreground)); }
.app .a-check { width: 16px; height: 16px; border-radius: 4px; border: 1px solid hsl(var(--primary)); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- tabs (ui/tabs.tsx) ---- */
.app .a-tabs { display: flex; align-items: center; border-bottom: 1px solid hsl(var(--ink-200)); }
.app .a-tab { position: relative; display: inline-flex; align-items: center; padding: 8px 12px; font-size: 13px; line-height: 18px; font-weight: 500; color: hsl(var(--ink-500)); white-space: nowrap; }
.app .a-tab.is-active { color: hsl(var(--foreground)); }
.app .a-tab.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: hsl(var(--brand)); }
.app .a-tab-count { margin-left: 6px; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: hsl(var(--ink-500)); }
.app .a-seg { display: inline-flex; align-items: center; height: 32px; padding: 2px; border-radius: 8px; background: hsl(var(--ink-100)); }
.app .a-seg > span { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 13px; line-height: 18px; font-weight: 500; color: hsl(var(--ink-600)); }
.app .a-seg > span.is-on { background: #fff; color: hsl(var(--foreground)); box-shadow: var(--shadow-card); }

/* ---- card (ui/card.tsx) + SheetCard (components/sheet-card.tsx) ---- */
.app .a-card { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; overflow: hidden; }
.app .a-card-sec { border-top: 1px solid hsl(var(--ink-100)); padding: 16px 20px; }
.app .a-card-sec:first-child { border-top: 0; }
.app .a-card-sec.is-tight { padding: 12px 16px; }
.app .a-card-sec.is-p4 { padding: 16px; }
.app .a-sc-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 4px; padding: 14px 16px 10px; }
.app .a-sc-title { font-size: 15px; line-height: 22px; letter-spacing: -.005em; font-weight: 600; color: hsl(var(--foreground)); }
.app .a-sc-count { font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); }
.app .a-sc-link { margin-left: auto; font-size: 13px; line-height: 18px; font-weight: 600; color: hsl(var(--brand)); }
.app .a-sc-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }
.app .a-sc-desc { flex-basis: 100%; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); max-width: 65ch; }
.app .a-sc-body { padding: 0 16px 14px; }
.app .a-sc-line { padding: 0 16px 14px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-600)); }
/* CardSection collapsible title (ui/card.tsx): chevron + eyebrow + count */
.app .a-cs-title { display: flex; align-items: center; gap: 8px; }
.app .a-cs-title .a-i { color: hsl(var(--ink-400)); }
.app .a-cs-title.is-closed .a-i { transform: rotate(-90deg); }

/* ---- page header (components/page-header.tsx) ---- */
.app .a-ph { }
.app .a-ph > * + * { margin-top: 12px; }
.app .a-ph-eyebrow { font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); min-height: 18px; }
.app .a-ph-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.app .a-ph-titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app .a-ph-titlerow.is-baseline { align-items: baseline; }
.app .a-ph-title { font-size: 24px; line-height: 30px; letter-spacing: -.025em; font-weight: 600; color: hsl(var(--foreground)); }
.app .a-ph-lead { margin-top: 4px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); max-width: 80ch; }
.app .a-ph-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.app .a-ph-toolbar { border-bottom: 1px solid hsl(var(--ink-200)); padding-bottom: 12px; }
.app .a-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); }
.app .a-crumbs .a-i { width: 14px; height: 14px; color: hsl(var(--ink-300)); }
.app .a-crumbs .is-here { color: hsl(var(--foreground)); }

/* ---- detail layout (components/detail-layout.tsx): 1fr + 360px aside, gap 20 ---- */
.app .a-detail { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 20px; align-items: start; }
.app .a-detail > * { min-width: 0; }
.app .a-detail > * > * + * { margin-top: 20px; }

/* ---- key-value (components/key-value.tsx) ---- */
.app .a-kv { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; row-gap: 12px; }
.app .a-kv dt { font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-kv dd { margin-top: 2px; font-size: 13px; line-height: 18px; color: hsl(var(--foreground)); overflow-wrap: anywhere; }
.app .a-kv dd.is-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 16px; font-weight: 500; }
.app .a-kv dd .is-unset { font-style: italic; color: hsl(var(--ink-500)); }

/* ---- list row (components/list-row.tsx) ---- */
.app .a-list > li + li { border-top: 1px solid hsl(var(--ink-100)); }
.app .a-lr { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; row-gap: 8px; padding: 12px 0; }
.app .a-lr.is-dense { padding: 8px 0; }
.app .a-lr-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 0; }
.app .a-lr-lead { width: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app .a-lr-primary { font-size: 15px; line-height: 22px; letter-spacing: -.005em; font-weight: 500; color: hsl(var(--foreground)); }
.app .a-lr-meta { margin-top: 2px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-500)); }
.app .a-lr-secondary { margin-top: 2px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); }
.app .a-lr-figure { min-width: 6.5rem; text-align: right; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; color: hsl(var(--ink-500)); }
.app .a-lg-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; }

/* ---- table (ui/table.tsx + data-table.tsx) ---- */
.app .a-tframe { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.app .a-table { width: 100%; table-layout: fixed; font-size: 13px; line-height: 18px; }
.app .a-table thead tr { border-bottom: 1px solid hsl(var(--ink-200)); }
.app .a-table th { height: 36px; padding: 0 12px; background: hsl(var(--ink-50)); vertical-align: middle; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); white-space: nowrap; }
.app .a-table th:first-child, .app .a-table td:first-child { padding-left: 16px; }
.app .a-table th:last-child, .app .a-table td:last-child { padding-right: 16px; }
.app .a-th-sort { display: inline-flex; align-items: center; gap: 4px; }
.app .a-th-sort svg { width: 12px; height: 12px; color: hsl(var(--ink-300)); }
.app .a-table tbody tr { border-bottom: 1px solid hsl(var(--ink-100)); }
.app .a-table tbody tr:last-child { border-bottom: 0; }
.app .a-table td { height: 44px; padding: 8px 12px; vertical-align: middle; }
.app .a-table td.is-r, .app .a-table th.is-r { text-align: right; }
.app .a-table tr.is-hover td { background: hsl(var(--ink-50)); }
/* group band (table-rules.ts GROUP_BAND_CLASS) */
.app .a-table tr.a-band td { height: auto; padding: 6px 16px; background: hsl(var(--ink-50)); border-bottom: 1px solid hsl(var(--ink-100)); }
.app .a-dash { color: hsl(var(--ink-500)); }
.app .a-row-actions { display: flex; justify-content: flex-end; gap: 2px; }

/* ==========================================================================
   FEATURE PIECES
   ========================================================================== */
/* markup toolbar (files/components/annotation-toolbar.tsx) */
.app .a-mtool { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.app .a-mtool-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: hsl(var(--ink-700)); }
.app .a-mtool-btn.is-on { background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); }
.app .a-mtool-sep { width: 1px; height: 20px; background: hsl(var(--ink-200)); margin: 0 2px; }
.app .a-mtool-colour { width: 16px; height: 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,.1); }
.app .a-mtool-w { width: 18px; border-radius: 2px; background: hsl(var(--ink-700)); }
/* drawing canvas: the viewer's own ground */
.app .a-canvas { border-radius: 8px; background: hsl(var(--ink-50)); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.app .a-pinmark { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .06em; }

/* issue sheet (projects/overview/issue-sheet.tsx) */
.app .a-is { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 18px; }
.app .a-is th, .app .a-is td { border: 0 solid hsl(var(--ink-100)); }
.app .a-is .is-hd { border-bottom: 1px solid hsl(var(--ink-200)); border-right: 1px solid hsl(var(--ink-200)); background: hsl(var(--ink-50)); padding: 8px 12px 8px 16px; text-align: left; vertical-align: bottom; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-is .is-col { width: 64px; min-width: 64px; border-bottom: 1px solid hsl(var(--ink-200)); border-left: 1px solid hsl(var(--ink-100)); background: hsl(var(--ink-50)); padding: 8px 2px 6px; text-align: center; vertical-align: bottom; font-weight: 400; }
.app .a-is .is-col.is-new { background: hsl(var(--brand-subtle)); }
.app .a-is-colin { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.app .a-is-day { font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: hsl(var(--ink-800)); }
.app .is-new .a-is-day { color: hsl(var(--brand-ink)); }
.app .a-is-mon, .app .a-is-to { font-size: 11px; line-height: 14px; color: hsl(var(--ink-500)); white-space: nowrap; }
.app .a-is .is-band { border-bottom: 1px solid hsl(var(--ink-100)); background: hsl(var(--canvas)); padding: 4px 16px; text-align: left; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-is .is-row { border-bottom: 1px solid hsl(var(--ink-100)); border-right: 1px solid hsl(var(--ink-200)); background: hsl(var(--card)); padding: 6px 12px 6px 16px; text-align: left; font-weight: 400; min-width: 240px; }
.app .a-is .is-cell { border-bottom: 1px solid hsl(var(--ink-100)); border-left: 1px solid hsl(var(--ink-100)); padding: 6px 0; text-align: center; }
.app .a-is .is-cell.is-new { background: hsl(var(--brand-subtle) / .4); }
.app .a-is .is-ft { border-top: 1px solid hsl(var(--ink-200)); border-right: 1px solid hsl(var(--ink-200)); background: hsl(var(--ink-50)); padding: 8px 12px 8px 16px; text-align: left; font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 700; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-is .is-ftc { border-top: 1px solid hsl(var(--ink-200)); border-left: 1px solid hsl(var(--ink-100)); background: hsl(var(--ink-50)); padding: 8px 0; text-align: center; }
.app .a-is .is-ftc.is-new { background: hsl(var(--brand-subtle) / .6); }
.app .a-is .is-spacer { background: hsl(var(--card)); border-bottom: 1px solid hsl(var(--ink-100)); }
.app .a-revchip { display: inline-block; border-radius: 4px; padding: 0 6px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; line-height: 18px; }
.app .a-revchip.is-current { background: hsl(var(--ink-800)); color: #fff; font-weight: 500; }
.app .a-revchip.is-superseded { color: hsl(var(--ink-500)); }
.app .a-revchip.is-sent { background: hsl(var(--ink-200)); color: hsl(var(--ink-900)); font-weight: 500; }
.app .a-code { display: inline-grid; place-items: center; height: 18px; min-width: 24px; padding: 0 2px; border-radius: 3px; font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .04em; color: hsl(var(--ink-700)); box-shadow: inset 0 0 0 1px hsl(var(--ink-300)); }
.app .a-ack { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: hsl(var(--tone-attention-strong)); }
.app .a-ack.is-full { color: hsl(var(--tone-positive-strong)); }
.app .a-ack .a-i { width: 14px; height: 14px; stroke-width: 2; }
.app .a-is-foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; row-gap: 8px; border-top: 1px solid hsl(var(--ink-200)); padding: 10px 16px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-500)); }
.app .a-is-key { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 6px; }
.app .a-is-key li { display: inline-flex; align-items: center; gap: 6px; }

/* title block cells (projects/overview/title-block.tsx) */
.app .a-tb-cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid hsl(var(--ink-200)); }
.app .a-tb-cell { padding: 16px 24px; min-width: 0; }
.app .a-tb-cell + .a-tb-cell { border-left: 1px solid hsl(var(--ink-200)); }
.app .a-tb-cell-l { font-size: 11px; line-height: 14px; letter-spacing: .06em; font-weight: 600; text-transform: uppercase; color: hsl(var(--ink-500)); }
.app .a-tb-cell-v { margin-top: 6px; font-size: 13px; line-height: 18px; color: hsl(var(--foreground)); }
.app .a-tb-cell-s { margin-top: 2px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-500)); }

/* needs-you / waiting rows */
.app .a-ny { display: grid; grid-template-columns: 16px minmax(0,1fr) auto auto; align-items: center; column-gap: 12px; row-gap: 2px; padding: 10px 16px; border-top: 1px solid hsl(var(--ink-100)); font-size: 13px; line-height: 18px; }
.app .a-wo { border-top: 1px solid hsl(var(--ink-100)); padding: 12px 16px; font-size: 13px; line-height: 18px; }
.app .a-wo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.app .a-wo-lines { margin-top: 2px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-700)); }
.app .a-log li { border-top: 1px solid hsl(var(--ink-100)); padding: 10px 16px; font-size: 13px; line-height: 18px; }
.app .a-log li:first-child { border-top: 0; }

/* Hub enquiry board */
.app .a-board { display: flex; align-items: flex-start; gap: 12px; }
.app .a-bcol { width: 260px; flex-shrink: 0; border-radius: var(--radius); background: hsl(var(--ink-50)); padding: 8px; }
.app .a-bcol-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.app .a-bcard { position: relative; border-radius: 8px; background: hsl(var(--card)); box-shadow: var(--shadow-card); padding: 10px 12px 10px 28px; }
.app .a-bcard + .a-bcard { margin-top: 8px; }
.app .a-bcard-grip { position: absolute; left: 0; top: 0; bottom: 0; width: 24px; display: flex; align-items: center; justify-content: center; color: hsl(var(--ink-400)); }
.app .a-tray { border-radius: var(--radius); background: hsl(var(--ink-50)); padding: 8px; }

/* query bar shell */
.app .a-qb-row { display: flex; align-items: center; gap: 8px; }
.app .a-qb-row .a-input { flex: 1; }
.app .a-qb-thinking { font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); }
.app details.a-qb-more > summary { list-style: none; display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); }
.app details.a-qb-more > summary::-webkit-details-marker { display: none; }

/* misc */
.app .a-row { display: flex; align-items: center; }
.app .a-gap-1 { gap: 4px; } .app .a-gap-2 { gap: 8px; } .app .a-gap-3 { gap: 12px; } .app .a-gap-4 { gap: 16px; }
.app .a-wrap { flex-wrap: wrap; }
.app .a-between { justify-content: space-between; }
.app .a-grow { flex: 1; min-width: 0; }
.app .a-ml-auto { margin-left: auto; }
.app .a-mt-1 { margin-top: 4px; } .app .a-mt-2 { margin-top: 8px; } .app .a-mt-3 { margin-top: 12px; } .app .a-mt-4 { margin-top: 16px; }
.app .a-rule-t { border-top: 1px solid hsl(var(--ink-200)); }
.app .a-callout { display: flex; align-items: center; gap: 8px; border-radius: 8px; border-left: 2px solid hsl(var(--brand)); background: hsl(var(--brand-subtle)); padding: 8px 12px; font-size: 13px; line-height: 18px; }
.app .a-callout.is-quiet { border-left: 0; background: hsl(var(--ink-50)); color: hsl(var(--ink-600)); }
.app .a-white { background: hsl(var(--background)); }
