/* ==========================================================================
   Ember UI: one stylesheet for the builder, the team page and the phone.
   Ships inside every pack. No fonts, images or requests from anywhere.

   Concept: field & sheet. A constant orange field frames a paper sheet.
   Paper is white or black (the only thing the theme changes). Ink is orange.
   Anything that needs the owner is shown as a solid orange block.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  /* The one orange. Identical in both themes. */
  --ink: #ff5c00;
  --ink-hot: #ffa200;           /* flame core, used only in the ASCII mark */
  --ink-deep: #e23500;          /* flame edge, used only in the ASCII mark */
  --on-ink: #ffffff;            /* text and icons on orange */
  --term: #000000;              /* terminals are black in both themes */

  /* Paper: light values (the theme flips only these three) */
  --paper: #ffffff;
  --paper-2: #fff5ec;
  --ink-text: #c94400;          /* small orange text on white, 4.9:1 */
  --ink-text-2: #b04e1c;        /* secondary text: 5.2:1 on white, 4.9:1 on paper-2 */

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 30px;
  --fs-hero: 54px;

  --r-sheet: 24px;
  --r-card: 18px;
  --r-ctl: 12px;
  --r-pill: 999px;

  --stroke: 1.5px;
  --frame: 7px;                 /* orange field around the sheet on a phone */
  --safe-t: calc(env(safe-area-inset-top, 0px) / var(--zoom, 1));      /* the size setting zooms the page; */
  --safe-b: calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1));   /* the insets stay true to the hardware */
  --safe-l: calc(env(safe-area-inset-left, 0px) / var(--zoom, 1));
  --safe-r: calc(env(safe-area-inset-right, 0px) / var(--zoom, 1));

  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root,
.ember[data-theme="light"], .ember[data-theme="white"] {
  --paper: #ffffff;
  --paper-2: #fff5ec;
  --ink-text: #c94400;
  --ink-text-2: #b04e1c;
  color-scheme: light;
}

/* Contract: data-theme="auto" | "white" | "black" on <html>; AUTO follows the system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="white"]) {
    --paper: #000000;
    --paper-2: #0f0803;
    --ink-text: #ff6a00;
    --ink-text-2: #d65900;
    color-scheme: dark;
  }
}

:root[data-theme="dark"], :root[data-theme="black"],
.ember[data-theme="dark"], .ember[data-theme="black"] {
  --paper: #000000;
  --paper-2: #0f0803;
  --ink-text: #ff6a00;
  --ink-text-2: #d65900;        /* 5.3:1 on black */
  color-scheme: dark;
}

/* Derived tokens are re-declared on every themed scope so they follow it. */
:root,
.ember {
  --text: var(--ink-text);
  --text-2: var(--ink-text-2);   /* body text stays at 4.5:1 or better (contract: Theme) */
  --text-3: color-mix(in srgb, var(--ink-text) 50%, var(--paper));   /* placeholders and disabled only */
  --line: color-mix(in srgb, var(--ink) 42%, var(--paper));
  --line-2: color-mix(in srgb, var(--ink) 20%, var(--paper));
  --wash: color-mix(in srgb, var(--ink) 6%, var(--paper));
  --wash-2: color-mix(in srgb, var(--ink) 12%, var(--paper));
  --tint: color-mix(in srgb, var(--ink) 30%, var(--paper));
  /* token split: cost order, cheapest lightest (cached -> fresh input -> output) */
  --tok-cache: color-mix(in srgb, var(--ink) 28%, var(--paper));
  --tok-in: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --tok-out: var(--ink);
}

/* ---------- 2. Base ------------------------------------------------------ */

.ember {
  container: ember / inline-size;
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font: 400 var(--fs-md)/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.ember--static { height: auto; overflow: visible; background: var(--paper); }
.ember *, .ember *::before, .ember *::after { box-sizing: border-box; }
.ember :where(h1, h2, h3, h4, p, ul, ol, figure, pre) { margin: 0; padding: 0; }
.ember :where(ul, ol) { list-style: none; }
.ember :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ember :where(button) { background: none; border: 0; padding: 0; cursor: pointer; }
.ember :where(a) { color: inherit; text-decoration: none; }
.ember :where(svg) { display: block; flex: none; }
.ember :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.ember ::selection { background: var(--ink); color: var(--on-ink); }

.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }

/* ---------- 3. Shell: field, sheet, side, tabs --------------------------- */

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "sheet" "tabs";
  padding: var(--safe-t) var(--frame) 0;
  position: relative;
}

.side { display: none; grid-area: side; }
.shell--notabs { grid-template-rows: minmax(0, 1fr); grid-template-areas: "sheet"; padding-bottom: calc(var(--frame) + var(--safe-b)); }
.shell--notabs .tabs { display: none; }

.sheet {
  grid-area: sheet;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-sheet);
  overflow: hidden;
  position: relative;
}

.top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  min-height: 62px;
  background: var(--paper);
  position: relative;
  z-index: 2;
}
.top::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 0;
  border-bottom: var(--stroke) dashed var(--line-2);
}
.top__mark { flex: none; }
.top__title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.top__title h1 {
  font-size: 26px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top__title .ser { font-size: 20px; color: var(--text-2); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 8; padding-right: 2px; }   /* a long team name gives way to the title; the pad keeps the italic's overhang */
.top__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.page { padding: 18px 18px 40px; display: flex; flex-direction: column; gap: 26px; }
.page--tight { gap: 16px; }

/* Bottom tabs live in the orange field */
.tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 8px 4px calc(8px + var(--safe-b));
  color: var(--on-ink);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 0; position: relative; color: var(--on-ink);
}
.tab__ic { width: 52px; height: 30px; display: grid; place-items: center; border-radius: var(--r-pill); transition: background .2s var(--ease); }
.tab[aria-current="page"] .tab__ic { background: var(--paper); color: var(--ink-display, var(--ink)); }
.tab__badge {
  position: absolute; top: 0; left: calc(50% + 10px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--paper); color: var(--ink-display, var(--ink)); font: 700 11px/18px var(--sans); text-align: center;
  box-shadow: 0 0 0 2px var(--ink);
}
.tab--new .tab__ic { width: 50px; height: 50px; margin-top: -12px; background: var(--paper); color: var(--ink-display, var(--ink)); box-shadow: 0 0 0 4px var(--ink); }
.tab--new .tab__ic .ico { width: 26px; height: 26px; stroke-width: 2.25; }

/* Tabs as a rail on the right edge, in the field: the iPhone Duo opened puts its
   Dock and navigation there (Settings → Layout can choose it anywhere). Phone
   layout only; the desk keeps its side column. */
@container ember (max-width: 899.98px) {
  .shell--rail {
    grid-template-columns: minmax(0, 1fr) 76px;
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "sheet tabs";
    padding: var(--safe-t) 0 calc(var(--frame) + var(--safe-b)) calc(var(--frame) + var(--safe-l));
  }
  .shell--rail .tabs {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
    align-content: center;
    gap: 18px;
    padding: 8px var(--safe-r) 8px 0;
  }
  .shell--rail .tab { text-align: center; line-height: 1.15; }
  .shell--rail .tab__ic { width: 50px; }
  .shell--rail .tab--new .tab__ic { margin: 0 auto 2px; }
  .shell--rail .tab__badge { left: calc(50% + 8px); }
}

/* Desktop: the field becomes the navigation column */
@container ember (min-width: 900px) {
  .shell {
    grid-template-columns: 236px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "side sheet";
    padding: 12px 12px 12px 0;
  }
  .tabs { display: none; }
  .shell--notabs { grid-template-areas: "side sheet"; padding: 12px 12px 12px 0; }
  .side {
    display: flex; flex-direction: column; gap: 22px;
    padding: 8px 14px 6px 18px; color: var(--on-ink); min-height: 0;
  }
  .top { padding: 20px 28px 16px; min-height: 76px; }
  .top::after { left: 28px; right: 28px; }
  .top__title h1 { font-size: 32px; }
  .top__title .ser { font-size: 22px; }
  .page { padding: 24px 28px 48px; gap: 30px; }
}

/* Tabs on the right, at desk width: the navigation column moves to the right edge too. */
@container ember (min-width: 900px) {
  .shell--rail { grid-template-columns: minmax(0, 1fr) 236px; grid-template-areas: "sheet side"; padding: 12px calc(var(--safe-r)) 12px 12px; }
  .shell--rail .side { padding: 8px 18px 6px 14px; }
}
.side__brand { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.side__tile {
  width: 48px; height: 48px; border-radius: 14px; background: var(--paper);
  display: grid; place-items: center; flex: none; overflow: hidden;
}
.side__word { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.side__word .wordmark { width: 92px; color: var(--on-ink); }
.side__word .ser { font-size: 17px; line-height: 1; }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__link {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: var(--r-pill); font-weight: 500; color: var(--on-ink); position: relative;
  transition: background .15s var(--ease);
}
.side__link:hover { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.side__link[aria-current="page"] { background: var(--paper); color: var(--ink-text); }
.side__count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--on-ink); color: var(--ink); font: 700 12px/22px var(--sans); text-align: center;
}
.side__link[aria-current="page"] .side__count { background: var(--ink); color: var(--on-ink); }
.side__new {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  border-radius: var(--r-pill); background: var(--paper); color: var(--ink-text); font-weight: 600;
}
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font: 500 var(--fs-2xs)/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.side__foot .seg { --seg-ink: var(--on-ink); --seg-on: var(--ink); }

/* ---------- 4. Type helpers --------------------------------------------- */

.ser { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.lbl {
  font: 500 var(--fs-xs)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
}
.lbl--ink { color: var(--text); }
.dim { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.h2 { font-size: var(--fs-xl); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.h2 .ser { font-size: 1.08em; }
.h3 { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.hero-num { font-size: var(--fs-hero); font-weight: 400; letter-spacing: -0.045em; line-height: .95; color: var(--ink-display, var(--ink)); }
.big-num { font-size: 34px; font-weight: 400; letter-spacing: -0.035em; line-height: 1; color: var(--ink-display, var(--ink)); }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.code { font: 400 12.5px/1.5 var(--mono); }
.arrow3 { font-family: var(--mono); letter-spacing: -0.12em; }
p.copy { max-width: 62ch; color: var(--text-2); }
p.copy b, p.copy strong { color: var(--text); font-weight: 600; }

.sec { display: flex; flex-direction: column; gap: 14px; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec__head .h2 { flex: 1; min-width: 0; }
.rule { border: 0; border-top: var(--stroke) dashed var(--line-2); margin: 0; }
.rule--solid { border-top-style: solid; }

/* ---------- 5. Controls -------------------------------------------------- */

.btn {
  --b-h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--b-h); padding: 0 20px; border-radius: var(--r-pill);
  font-weight: 600; font-size: var(--fs-md); white-space: nowrap;
  border: var(--stroke) solid var(--ink); color: var(--ink-text); background: transparent;
  transition: transform .12s var(--ease), background .15s var(--ease), color .15s var(--ease);
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--ink); color: var(--on-ink); }
.btn--solid:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.btn:not(.btn--solid):hover { background: var(--wash); }
.btn--sm { --b-h: 34px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--xs { --b-h: 28px; padding: 0 11px; font-size: 12px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--b-h); padding: 0; }
.btn--bare { border-color: transparent; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
/* white-on-orange context (inbox blocks, orange dialogs, toasts) */
.on-ink .btn { border-color: var(--on-ink); color: var(--on-ink); }
.on-ink .btn:not(.btn--solid):hover { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.on-ink .btn--solid { background: var(--on-ink); color: var(--ink); }

/* The oval: italic serif in an ellipse outline. Secondary and navigational actions. */
.oval {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 22px; border-radius: 50%;
  border: var(--stroke) solid var(--ink); color: var(--ink-text);
  font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1; white-space: nowrap;
  transition: background .15s var(--ease);
}
.oval:hover { background: var(--wash); }
.oval--sm { min-height: 34px; padding: 4px 16px; font-size: 15.5px; }
.oval .ico { width: 15px; height: 15px; }
.on-ink .oval { border-color: var(--on-ink); color: var(--on-ink); }

/* Text link in mono with the triple arrow */
.more-link {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text);
  white-space: nowrap;
}

/* Switch */
.switch {
  --sw-w: 46px; --sw-h: 28px;
  position: relative; width: var(--sw-w); height: var(--sw-h); flex: none;
  border-radius: var(--r-pill); border: var(--stroke) solid var(--ink); background: transparent;
  transition: background .18s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 50%; left: 4px;
  width: calc(var(--sw-h) - 11px); height: calc(var(--sw-h) - 11px); border-radius: 50%;
  border: var(--stroke) solid var(--ink); background: var(--paper);
  transform: translateY(-50%); transition: left .18s var(--ease), background .18s;
}
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { left: calc(100% - var(--sw-h) + 7px); background: var(--on-ink); border-color: var(--on-ink); }
.switch--sm { --sw-w: 38px; --sw-h: 23px; }
.switch[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.keysw { display: inline-flex; align-items: center; gap: 8px; }
.keysw .lbl { color: var(--text); }

/* Segmented control */
.seg {
  --seg-ink: var(--ink); --seg-on: var(--on-ink);
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill);
  border: var(--stroke) solid var(--seg-ink); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg button {
  height: 30px; padding: 0 13px; border-radius: var(--r-pill); white-space: nowrap;
  font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--seg-ink);
}
.seg button[aria-pressed="true"] { background: var(--seg-ink); color: var(--seg-on); }
.seg button[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.seg--block { display: flex; }
.seg--block button { flex: 1; }
.seg__n { opacity: .7; margin-left: 4px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-ctl);
  border: var(--stroke) solid var(--ink); background: var(--paper); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--wash-2); }
.input--mono { font-family: var(--mono); font-size: 14px; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field--bad .input { border-color: var(--ink); border-width: 2px; }
.help { font-size: var(--fs-sm); color: var(--text-2); display: flex; gap: 6px; align-items: flex-start; }
.help .ico { width: 15px; height: 15px; margin-top: 2px; }
.help--ok { color: var(--text); }
.help--bad { color: var(--on-ink); background: var(--ink); padding: 6px 10px; border-radius: 10px; font-weight: 500; }
.affix { display: flex; align-items: stretch; border: var(--stroke) solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.affix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--wash-2); }
.affix > span { display: flex; align-items: center; padding: 0 12px; background: var(--wash); color: var(--text-2); font: 500 14px var(--mono); border-right: var(--stroke) solid var(--line-2); }
.affix .input { border: 0; box-shadow: none !important; }

.stepper { display: inline-flex; align-items: center; border: var(--stroke) solid var(--ink); border-radius: var(--r-pill); height: 48px; }
.stepper button { width: 46px; height: 100%; display: grid; place-items: center; color: var(--ink-text); }
.stepper output { min-width: 84px; text-align: center; font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check__box { width: 22px; height: 22px; border-radius: 7px; border: var(--stroke) solid var(--ink); display: grid; place-items: center; flex: none; color: transparent; }
.check[aria-checked="true"] .check__box { background: var(--ink); color: var(--on-ink); }
.check[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border-radius: var(--r-pill); border: var(--stroke) solid var(--line); white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--text); max-width: 100%;
}
.chip--fill { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip--faint { color: var(--text-3); border-color: var(--line-2); border-style: dashed; }
.chip__m { font: 500 11.5px/1 var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip--fill .chip__m { color: var(--on-ink); opacity: .85; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 6. Status ---------------------------------------------------- */

/* State glyph: shape + word, never colour alone */
.st { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.st__g { width: 1.1em; text-align: center; font-weight: 400; }
.st--off { color: var(--text-2); }
.st--bad { background: var(--ink); color: var(--on-ink); padding: 4px 7px; border-radius: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  border: var(--stroke) solid var(--ink); color: var(--ink-text);
}
.badge .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.badge--premium { background: var(--ink); color: var(--on-ink); }
.badge--ghost { border-style: dashed; color: var(--text-2); border-color: var(--line); }

/* Rubber stamp for void-ish states on tickets */
.stamp {
  position: absolute; z-index: 3; pointer-events: none;
  padding: 6px 12px; border: 2.5px solid var(--ink); border-radius: 8px;
  font: 800 15px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-display, var(--ink));
  transform: rotate(-9deg); background: color-mix(in srgb, var(--paper) 70%, transparent);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3.5px var(--ink);
}

/* ---------- 7. Ticket ---------------------------------------------------- */

.ticket {
  position: relative; border: var(--stroke) solid var(--ink); border-radius: var(--r-card);
  background: var(--paper); overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  transition: transform .25s var(--ease);
}
.ticket__body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ticket__stub { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.perf { position: relative; height: 0; border-top: var(--stroke) dashed var(--ink); margin: 0 14px; }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: var(--stroke) solid var(--ink);
}
.perf::before { left: -26px; }
.perf::after { right: -26px; }
.ticket--needs { transform: rotate(-1.1deg); }
.ticket--needs:hover { transform: rotate(0); }
.ticket--void .ticket__body, .ticket--void .ticket__stub { opacity: .5; }
.ticket--ghost { border-style: dashed; border-color: var(--line); }
.ticket--ghost .perf { border-top-color: var(--line-2); }
.ticket--ghost .perf::before, .ticket--ghost .perf::after { border-color: var(--line); }
.ticket__flag {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--ink); color: var(--on-ink);
  font: 700 var(--fs-xs)/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.ticket__flag span:last-child { margin-left: auto; font-weight: 500; opacity: .9; }
a.ticket:hover, .ticket--link:hover { cursor: pointer; }

/* Leader rows (receipt lines): label ........ value */
.leader { display: flex; align-items: baseline; gap: 8px; min-width: 0; font: 500 12px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.leader > :first-child { flex: none; }
.leader::after { content: none; }
.leader__dots { flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--line); transform: translateY(-4px); }
.leader > :last-child { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; text-transform: none; letter-spacing: .01em; }
.leader--lg { font-size: 13px; }
.leader b { font-weight: 700; color: var(--text); }

/* ---------- 8. Data marks ------------------------------------------------ */

/* Barcode meter: bars left of the fill are ink, the rest are a tint of it. */
.barcode { display: block; width: 100%; height: 34px; color: var(--ink); }
.barcode .on { fill: var(--ink); }
.barcode .off { fill: var(--line-2); }
.barcode .cut { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.barcode--sm { height: 22px; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.meter-head .amt { font: 600 15px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.meter-head .amt small { font-weight: 400; color: var(--text-2); }
.meter-note { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 var(--fs-2xs)/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); }
.meter-note b { color: var(--text); font-weight: 700; }
.meter-note .hot { background: var(--ink); color: var(--on-ink); padding: 1px 5px; border-radius: 4px; }

/* Columns (spend by day / hour) */
.cols { display: flex; align-items: flex-end; gap: 3px; height: 72px; position: relative; }
.cols__c { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; position: relative; }
.cols__c i { display: block; width: 100%; max-width: 18px; min-height: 2px; background: var(--tint); border-radius: 4px 4px 0 0; }
.cols__c.is-now i { background: var(--ink); }
.cols__c:hover i { background: var(--ink); }
.cols__c[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); font: 600 11px/1 var(--mono); padding: 6px 8px; border-radius: 6px; white-space: nowrap; z-index: 4;
}
.cols--sm { height: 40px; gap: 2px; }
.cols--sm .cols__c i { max-width: 10px; border-radius: 2px 2px 0 0; }
.cols-axis { display: flex; justify-content: space-between; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: .06em; color: var(--text-2); text-transform: uppercase; margin-top: 6px; }
.cols-wrap { border-bottom: var(--stroke) solid var(--line-2); }

/* Sparkline */
.spark { display: block; overflow: visible; }
.spark .ln { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .ar { fill: var(--ink); opacity: .09; }
.spark .pt { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }

/* Token split: cached | fresh input | output, 2px paper gaps */
.split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.split i { display: block; min-width: 3px; }
.split .c { background: var(--tok-cache); }
.split .n { background: var(--tok-in); }
.split .o { background: var(--tok-out); }
.split--lg { height: 16px; border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 var(--fs-xs)/1.3 var(--mono); letter-spacing: .04em; color: var(--text-2); text-transform: uppercase; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; }
.stat { display: flex; flex-direction: column; gap: 5px; padding: 0 12px; min-width: 0; border-left: var(--stroke) dashed var(--line-2); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat__l { font: 500 var(--fs-2xs)/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.stat__v { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 4px; }
.stat__x { font: 500 10.5px/1.35 var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.stat__v small { font-size: 11px; font-weight: 500; color: var(--text-2); font-family: var(--mono); letter-spacing: .02em; }
.stat__v .spark { align-self: center; }

/* Glyph spinner (braille), driven by the shared low-fps clock */
.spin { font-family: var(--mono); display: inline-block; width: 1.1em; text-align: center; }

/* ---------- 9. ASCII flame + wordmark ------------------------------------ */

.flame {
  font: 700 var(--fl-fs, 8px)/var(--fl-lh, 8px) var(--mono);
  letter-spacing: 0; white-space: pre; margin: 0; user-select: none;
  color: var(--ink);
}
.flame .h { color: var(--ink-hot); }
.flame .m { color: var(--ink); }
.flame .d { color: var(--ink-deep); }
.flame .a { color: var(--line); }
.flame--sm { --fl-fs: 6.6px; --fl-lh: 6.4px; }
.flame--md { --fl-fs: 9px; --fl-lh: 8.6px; }
.flame--lg { --fl-fs: 13px; --fl-lh: 12px; }
.flame--xl { --fl-fs: 17px; --fl-lh: 15px; }

.wordmark { display: block; width: 100%; height: auto; color: var(--ink); }
.wordmark path, .wordmark rect, .wordmark polygon { fill: currentColor; }
.wordmark .cut { fill: var(--wm-cut, var(--paper)); }
.side__word .wordmark { --wm-cut: var(--ink); }
.wordmark .s { fill: none; stroke: currentColor; stroke-width: 20; }

/* ---------- 10. Composite blocks ---------------------------------------- */

/* Fleet pulse */
.pulse { display: grid; gap: 18px; }
.pulse__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pulse__sub { font-size: 21px; color: var(--text-2); margin-top: -12px; }
.pulse .stats { padding-top: 14px; border-top: var(--stroke) dashed var(--line-2); }

/* Needs-you block: solid orange, white text */
.need {
  background: var(--ink); color: var(--on-ink); border-radius: var(--r-card); padding: 15px 16px;
  display: flex; flex-direction: column; gap: 10px; position: relative; min-width: 0;
}
.need__top { display: flex; align-items: center; gap: 8px; font: 700 var(--fs-2xs)/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.need__top time { margin-left: auto; font-weight: 500; opacity: .85; }
.need__title { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.need__quote { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.3; }
.need__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.need__reply { display: flex; gap: 8px; }
.need__reply .input { background: transparent; border-color: color-mix(in srgb, var(--on-ink) 60%, transparent); color: var(--on-ink); min-height: 42px; padding: 9px 12px; }
.need__reply .input::placeholder { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }
.need__reply .input:focus { border-color: var(--on-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--on-ink) 25%, transparent); }
.need--resolved { background: transparent; color: var(--text-2); border: var(--stroke) dashed var(--line); }
.need--resolved .need__title { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.needs { display: flex; flex-direction: column; gap: 10px; }

/* Mac group */
.mac { display: flex; flex-direction: column; gap: 14px; }
.mac__head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: var(--stroke) solid var(--ink); }
.mac__name { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.mac__meta { display: flex; gap: 6px 12px; flex-wrap: wrap; flex: 1; min-width: 0; }
.mac__down { background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.tgrid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@container ember (min-width: 640px) { .tgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }

/* Team ticket specifics */
.tt__head { display: flex; align-items: flex-start; gap: 10px; }
.tt__name { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.tt__folder { font: 400 12px/1.3 var(--mono); color: var(--text-2); margin-top: 3px; }
.tt__foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 var(--fs-2xs)/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); }
.tt__foot b { color: var(--text); font-weight: 700; }

/* Filter row */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
@container ember (min-width: 900px) { .filters { margin: 0; padding: 0; } }

/* Agent rows (metrics) */
.agents { display: flex; flex-direction: column; }
.agent { display: grid; gap: 10px; padding: 16px 0; border-top: var(--stroke) dashed var(--line-2); cursor: pointer; text-align: left; width: 100%; }
.agent:first-child { border-top: 0; padding-top: 4px; }
.agent__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent__name { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.agent__cost { margin-left: auto; font: 600 15px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.agent__sub { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.agent__sub .sep { color: var(--line); }
.agent:hover .agent__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.agent--off { opacity: .55; }

/* Desktop agent table */
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 0 10px 10px; white-space: nowrap; border-bottom: var(--stroke) solid var(--ink); }
.atable td { padding: 13px 10px; border-bottom: var(--stroke) dashed var(--line-2); vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
.atable tr:last-child td { border-bottom: 0; }
.atable th:first-child, .atable td:first-child { padding-left: 0; }
.atable th:last-child, .atable td:last-child { padding-right: 0; text-align: right; }
.atable .r { text-align: right; }
.atable tbody tr { cursor: pointer; }
.atable tbody tr:hover td { background: var(--wash); }
.atable .mono { font-size: 13px; }

/* Tabs inside a page (mono underline) */
.ptabs { display: flex; gap: 22px; border-bottom: var(--stroke) solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.ptabs > a, .ptabs > button { position: relative; padding: 10px 0 12px; font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.ptabs > [aria-selected="true"] { color: var(--text); }
.ptabs > [aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; border-radius: 3px; background: var(--ink); }
.ptabs .n { margin-left: 5px; color: var(--text-2); }

/* Generic list rows */
.rows { display: flex; flex-direction: column; }
.rowi { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-top: var(--stroke) dashed var(--line-2); width: 100%; text-align: left; }
.rowi:first-child { border-top: 0; }
.rowi__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rowi__t { font-weight: 500; }
.rowi__s { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }   /* a long URL wraps instead of running under the row's badge */
.rowi__end { flex: none; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.box { border: var(--stroke) solid var(--ink); border-radius: var(--r-card); padding: 4px 16px; }
.box--pad { padding: 16px; }
.box--dash { border-style: dashed; border-color: var(--line); }

/* Task rows */
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 13px 0; border-top: var(--stroke) dashed var(--line-2); }
.task:first-child { border-top: 0; }
.task__ic { width: 26px; height: 26px; border-radius: 50%; border: var(--stroke) solid var(--ink); display: grid; place-items: center; color: var(--ink-text); margin-top: 1px; }
.task__ic .ico { width: 14px; height: 14px; stroke-width: 2.25; }
.task__ic--done { background: var(--ink); color: var(--on-ink); }
.task__ic--fail { background: var(--paper); border-style: dashed; }
.task__t { font-weight: 500; line-height: 1.3; }
.task__s { font-size: 12.5px; color: var(--text-2); display: flex; gap: 2px 8px; flex-wrap: wrap; margin-top: 3px; }
.task__r { text-align: right; font: 600 13px/1.3 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.task__r small { display: block; font-weight: 500; font-size: 11px; color: var(--text-2); margin-top: 3px; }

/* Wizard */
.wiz-prog { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 0 18px 12px; }
.wiz-prog i { height: 4px; border-radius: 2px; background: var(--line-2); }
.wiz-prog i.on { background: var(--ink); }
.wsec { display: flex; flex-direction: column; gap: 20px; }
.wsec__head { display: flex; align-items: baseline; gap: 14px; }
.wsec__n { font: 500 13px/1 var(--mono); color: var(--text-2); letter-spacing: .04em; }
.wsec__t { font-size: 30px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.05; }
.wsec__t .ser { font-size: 1.05em; }
.wbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px 14px; border-top: var(--stroke) solid var(--ink); background: var(--paper); }
.wbar .btn--solid { flex: 1; }
.macpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.macopt { border: var(--stroke) solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; }
.macopt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.macopt[aria-pressed="true"] .lbl, .macopt[aria-pressed="true"] .st { color: var(--on-ink); }
.macopt[aria-disabled="true"] { border-style: dashed; opacity: .5; cursor: not-allowed; }
.macopt__n { font-size: 20px; letter-spacing: -0.02em; line-height: 1; }
.tpl { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.tplopt { flex: none; width: 112px; border: var(--stroke) solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.tplopt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.tplopt[aria-pressed="true"] .lbl { color: var(--on-ink); }
.tplopt__n { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1; }
.arow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: var(--stroke) dashed var(--line-2); align-items: start; }
.arow:first-child { border-top: 0; }
.arow__main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.arow__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arow__name { font-size: 17px; font-weight: 500; }
.modelbtn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 12px; border: var(--stroke) solid var(--line); border-radius: var(--r-ctl); text-align: left; }
.modelbtn:hover { border-color: var(--ink); }
.modelbtn__n { font-weight: 500; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.modelbtn__p { font: 500 11.5px/1.2 var(--mono); color: var(--text-2); }
.why { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; }
.why .ser { color: var(--text); font-size: 15px; }
.callout { border: var(--stroke) solid var(--ink); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.callout--fill { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.callout--fill .lbl, .callout--fill .leader, .callout--fill .leader > :last-child { color: var(--on-ink); }
.callout--fill .leader__dots { border-color: color-mix(in srgb, var(--on-ink) 50%, transparent); }
.callout--dash { border-style: dashed; border-color: var(--line); }

/* Desktop wizard: all sections on one page, summary rail */
.wiz { display: block; }
.wiz__rail { display: none; }
.wiz__nav { display: none; }
@container ember (max-width: 899.98px) {
  .wiz[data-step] .wsec { display: none; }
  .wiz[data-step="1"] .wsec[data-sec="1"], .wiz[data-step="2"] .wsec[data-sec="2"], .wiz[data-step="3"] .wsec[data-sec="3"],
  .wiz[data-step="4"] .wsec[data-sec="4"], .wiz[data-step="5"] .wsec[data-sec="5"], .wiz[data-step="6"] .wsec[data-sec="6"] { display: flex; }
}
@container ember (min-width: 900px) {
  .wiz { display: grid; grid-template-columns: 150px minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
  .wiz__nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
  .wiz__nav a { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; color: var(--text-2); }
  .wiz__nav a span { font: 500 12px/1.5 var(--mono); }
  .wiz__nav a[aria-current="true"] { color: var(--text); font-weight: 600; }
  .wiz__body { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
  .wiz__body .wsec[data-sec="6"] { display: none; }
  .wiz__rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
  .wbar--phone { display: none; }
  .macpick { grid-template-columns: repeat(3, minmax(0, 180px)); }
  .tpl { margin: 0; padding: 2px 0; flex-wrap: wrap; }
}

/* Deploy job */
.job { display: flex; flex-direction: column; }
.jstep { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: var(--stroke) dashed var(--line-2); }
.jstep:first-child { border-top: 0; }
.jstep__ic { width: 28px; height: 28px; border-radius: 50%; border: var(--stroke) solid var(--ink); display: grid; place-items: center; color: var(--ink-text); font: 600 12px/1 var(--mono); }
.jstep--done .jstep__ic { background: var(--ink); color: var(--on-ink); }
.jstep--wait .jstep__ic { border-style: dashed; border-color: var(--line); color: var(--text-2); }
.jstep--skip { opacity: .5; }
.jstep--fail .jstep__ic { background: var(--paper); border-width: 2.5px; }
.jstep__n { font-weight: 500; }
.jstep--wait .jstep__n { color: var(--text-2); }
.jstep__log { margin-top: 8px; }
.jstep__t { font: 500 12px/28px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Terminal / log: black in both themes */
.term {
  background: var(--term); color: var(--term-ink, var(--ink)); border-radius: 14px; padding: 14px 16px;
  font: 400 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; overflow: auto;
  border: var(--stroke) solid var(--ink);
}
.term .t2 { color: color-mix(in srgb, var(--term-ink, var(--ink)) 60%, var(--term)); }
.term .t3 { color: color-mix(in srgb, var(--term-ink, var(--ink)) 40%, var(--term)); }
.term .inv { background: var(--term-ink, var(--ink)); color: var(--term); }
.term--screen { min-height: 360px; font-size: 12px; line-height: 1.45; }

/* Masked secret */
.secret { display: flex; flex-direction: column; gap: 10px; }
.secret__val { background: var(--term); color: var(--term-ink, var(--ink)); border-radius: 12px; padding: 12px 14px; font: 400 12.5px/1.55 var(--mono); word-break: break-all; border: var(--stroke) solid var(--ink); }
.secret__val .mask { letter-spacing: .1em; color: color-mix(in srgb, var(--term-ink, var(--ink)) 55%, var(--term)); }
.secret__acts { display: flex; gap: 8px; }

/* Conversation */
.conv { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.msg__who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 var(--fs-2xs)/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.msg__who .via { color: var(--text-2); font-weight: 500; }
.msg__who time { color: var(--text-2); font-weight: 500; }
.msg__body { font-size: 15px; line-height: 1.5; color: var(--text); }
.msg--claude .msg__body { background: var(--wash); border-radius: 4px 16px 16px 16px; padding: 11px 14px; }
.msg--link .msg__body { border: var(--stroke) solid var(--ink); border-radius: 4px 16px 16px 16px; padding: 11px 14px; }
.msg--link.msg--ask .msg__body { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.msg--think .msg__body { font-family: var(--serif); font-style: italic; color: var(--text-2); font-size: 16px; }
.msg--sys { flex-direction: row; align-items: center; gap: 12px; max-width: none; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.msg--sys::before, .msg--sys::after { content: ""; flex: 1; border-top: var(--stroke) dashed var(--line-2); }
.composer { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; border-top: var(--stroke) solid var(--ink); background: var(--paper); }
.composer__row { display: flex; gap: 8px; align-items: center; }
.composer .input { min-height: 46px; border-radius: var(--r-pill); padding: 10px 18px; }
.composer__opts { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.composer__opts .select { min-height: 32px; height: 32px; line-height: 30px; width: auto; padding: 0 30px 0 12px; border-radius: var(--r-pill); font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text); border-color: var(--ink); }

/* Agent cards on the team page */
.acards { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 4px; }
.acard { flex: none; width: 196px; border: var(--stroke) solid var(--line); border-radius: 16px; padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.acard[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.acard--ask { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.acard--ask .st, .acard--ask .acard__m, .acard--ask .dim { color: var(--on-ink); }
.acard--ask .split .c { background: color-mix(in srgb, var(--on-ink) 35%, transparent); }
.acard--ask .split .n { background: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.acard--ask .split .o { background: var(--on-ink); }
.acard__n { font-size: 16px; font-weight: 500; }
.acard__m { font: 500 11px/1.4 var(--mono); color: var(--text-2); letter-spacing: .03em; display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
@container ember (min-width: 900px) {
  .acards { flex-direction: column; overflow: visible; margin: 0; padding: 0; }
  .acard { width: auto; }
}

/* Team page shell (ships in the pack) */
.vshell { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr); padding: var(--safe-t) var(--frame) calc(var(--frame) + var(--safe-b)); }
.vshell .sheet { grid-area: auto; }
.vbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vgrid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vmain { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vrail { padding: 0 18px 4px; flex: none; }
.vtabs { padding: 0 18px; }
@container ember (min-width: 900px) { .vtabs { padding: 0 28px; } }
@container ember (min-width: 900px) {
  .vshell { padding: 12px; }
  .vgrid { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .vgrid > .vrail { border-right: var(--stroke) dashed var(--line-2); overflow-y: auto; padding: 20px 18px; }
}

/* ---------- 11. Overlays ------------------------------------------------- */

.layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.layer > * { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 55%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
.osheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-bottom: 0;
  border-radius: 26px 26px 0 0; display: flex; flex-direction: column;
  animation: rise .32s var(--ease); padding-bottom: var(--safe-b);
}
.osheet__grab { width: 44px; height: 5px; border-radius: 3px; background: var(--ink); margin: 10px auto 2px; flex: none; }
.osheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px 14px; border-bottom: var(--stroke) dashed var(--line-2); flex: none; }
.osheet__head .h2 { flex: 1; min-width: 0; }
.osheet__body { overflow-y: auto; padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 20px; }
.osheet__foot { flex: none; display: flex; gap: 10px; padding: 12px 20px 16px; border-top: var(--stroke) solid var(--ink); }
.osheet__foot .btn--solid { flex: 1; }
@container ember (min-width: 900px) {
  .osheet { left: 50%; bottom: auto; top: 50%; width: 560px; max-height: 86%; border-radius: 26px; border-bottom: var(--stroke) solid var(--ink); transform: translate(-50%, -50%); animation: pop .25s var(--ease); padding-bottom: 0; }
  .osheet__grab { display: none; }
  .osheet__head { padding-top: 20px; }
  .osheet--wide { width: 720px; }
}

/* Confirmation: a solid orange card */
.dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px)); background: var(--ink); color: var(--on-ink);
  border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px;
  animation: pop .22s var(--ease);
}
.dialog__t { font-size: 24px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.dialog__b { font-size: 15px; line-height: 1.5; }
.dialog__b li { display: flex; gap: 8px; }
.dialog__b li::before { content: "◆"; font-size: 10px; line-height: 22px; }
.dialog__acts { display: flex; gap: 10px; margin-top: 6px; }
.dialog__acts .btn { flex: 1; }
.dialog .lbl { color: var(--on-ink); opacity: .9; }
.dialog .input { background: transparent; border-color: var(--on-ink); color: var(--on-ink); }

.toast {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 28px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--ink); color: var(--on-ink); border-radius: 16px; font-size: 14px; font-weight: 500;
  box-shadow: 0 0 0 3px var(--paper); animation: rise .3s var(--ease);
}
.toast .btn { --b-h: 32px; padding: 0 12px; font-size: 13px; }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: var(--on-ink); border-radius: 14px; font-size: 14px; }
.banner .lbl { color: var(--on-ink); }
.banner .btn { margin-left: auto; }

/* Menu list in sheets (model picker) */
.mlist { display: flex; flex-direction: column; }
.mopt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-top: var(--stroke) dashed var(--line-2); text-align: left; width: 100%; }
.mopt:first-child { border-top: 0; }
.mopt__n { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mopt__p { font: 600 13px/1.2 var(--mono); text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.mopt__p small { display: block; font-weight: 500; color: var(--text-2); font-size: 11px; margin-top: 3px; }
.mopt__s { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.mopt[aria-pressed="true"] .mopt__n::after { content: "◆ chosen"; font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.pbar { display: flex; gap: 2px; height: 8px; grid-column: 1 / -1; }
.pbar i { flex: 1; border-radius: 1px; background: var(--line-2); }
.pbar i.on { background: var(--ink); }

/* Before / after */
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.ba__c { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; border: var(--stroke) dashed var(--line); min-width: 0; }
.ba__c--after { border: var(--stroke) solid var(--ink); background: var(--ink); color: var(--on-ink); }
.ba__c--after .lbl, .ba__c--after .dim { color: var(--on-ink); }
.ba__v { font-size: 26px; letter-spacing: -0.03em; line-height: 1; }
.ba__arrow { font-family: var(--mono); color: var(--text); }

/* Empty / loading */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 40px 10px; }
.empty__t { font-size: 34px; font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; }
.empty__t .ser { font-size: 1.05em; }
.skel { background: var(--wash-2); border-radius: 8px; height: 14px; animation: breathe 1.4s ease-in-out infinite; }
.loading-line { display: flex; align-items: center; gap: 10px; font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }

/* Login */
.login { height: 100%; display: flex; flex-direction: column; padding: 22px 20px calc(18px + var(--safe-b)); gap: 22px; overflow-y: auto; }
.login__row { display: flex; justify-content: space-between; gap: 12px; font: 500 var(--fs-xs)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.login__mid { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; width: 100%; }
.login__form { display: flex; flex-direction: column; gap: 22px; max-width: 460px; width: 100%; }
.login__flame { display: flex; justify-content: center; }
.login__h { font-size: 40px; font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
.login__h .ser { font-size: 1.06em; }
.scallop { display: block; width: 100%; height: 12px; color: var(--ink); }
@container ember (min-width: 900px) {
  .login { padding: 34px 40px 28px; }
  .login__mid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; }
  .login__form { max-width: 440px; }
  .login__h { font-size: 52px; }
}

/* Desktop layout helpers */
.split2 { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
@container ember (max-width: 899.98px) { .only-desk { display: none !important; } }
@container ember (min-width: 900px) {
  .only-phone { display: none !important; }
  .split2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
}
.fleet-grid { display: grid; gap: 30px; grid-template-columns: minmax(0, 1fr); }
.fleet-rail { display: none; }
@container ember (min-width: 1180px) {
  .fleet-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .fleet-rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
  .fleet-needs-inline { display: none !important; }
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; border-left: var(--stroke) dashed var(--line); min-width: 0; }
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi__v { font-size: 38px; letter-spacing: -0.04em; line-height: 1; color: var(--ink-display, var(--ink)); }
.kpi__s { font-size: 13px; color: var(--text-2); }

/* ---------- 12. Motion --------------------------------------------------- */

@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: .96; } }
@keyframes fade { from { opacity: 0; } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes inkin { from { clip-path: inset(0 100% 0 0); } }
.toast { animation-name: toastin; }
@keyframes toastin { from { transform: translate(-50%, 16px); opacity: 0; } }
.dialog { animation-name: dlgin; }
@keyframes dlgin { from { transform: translate(-50%, -46%); opacity: 0; } }
@container ember (min-width: 900px) {
  .osheet { animation-name: shin; }
}
@keyframes shin { from { transform: translate(-50%, -47%); opacity: 0; } }
.page > * { animation: fade .28s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .ember *, .ember *::before, .ember *::after { animation: none !important; transition: none !important; }
  .ticket--needs { transform: none; }
}

/* ---------- 13. Contract additions --------------------------------------
   The builder's CSP forbids style="" in markup, so layout helpers are classes.
   Dynamic values (bar heights, flex shares) are set from JS via element.style. */

/* Layout utilities */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.base { align-items: baseline; }
.end-y { align-items: flex-end; }
.self-center { align-self: center; }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.center { text-align: center; }
.block { display: block; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g16 { gap: 16px; } .g18 { gap: 18px; }
.g26 { gap: 26px; } .g28 { gap: 28px; } .g30 { gap: 30px; } .g8-14 { gap: 8px 14px; } .g4-18 { gap: 4px 18px; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mb6 { margin-bottom: 6px; } .mb12 { margin-bottom: 12px; } .pt2 { padding-top: 2px; }
.fs-10 { font-size: 10px; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; } .fs-17 { font-size: 17px; }
.fs-18 { font-size: 18px; } .fs-20 { font-size: 20px; } .fs-22 { font-size: 22px; } .fs-24 { font-size: 24px; } .fs-28 { font-size: 28px; }
.fw5 { font-weight: 500; }
.tight { letter-spacing: -0.03em; line-height: 1.05; }
.t-text { color: var(--text); }
.w40 { width: 40%; } .w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w110 { width: 110px; flex: none; }
.h18 { height: 18px; } .h30 { height: 30px; } .h48 { height: 48px; }
.is-off { opacity: .5; }
.scroll-x { overflow-x: auto; min-width: 0; }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hot-t { color: var(--ink-text); font-weight: 700; }
.lockup { display: inline-flex; align-items: baseline; gap: .35em; }
.stats.n3 { --n: 3; } .stats.n4 { --n: 4; }
.lg-c { background: var(--tok-cache); } .lg-n { background: var(--tok-in); } .lg-o { background: var(--tok-out); }
.mt8.hero-num { display: block; }
.sheet--full { height: 100%; border-radius: inherit; }
.top__title--stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.empty--sm { padding: 24px 10px; }
.kpi__w { font-size: 22px; color: var(--text-2); }
.kpi__v--sm { font-size: 20px; letter-spacing: -0.02em; display: flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
@container ember (min-width: 900px) { .kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpis--4 .kpi:nth-child(3) { padding-left: 0; border-left: 0; }
@container ember (min-width: 900px) { .kpis--4 .kpi:nth-child(3) { padding-left: 20px; border-left: var(--stroke) dashed var(--line); } }
.pulse__cols { width: 112px; flex: none; }
.stamp { right: 18px; top: 54px; }
.stamp--low { top: 70px; }
.stamp--key { right: 16px; top: 20px; }
.stamp--mac { right: 16px; top: 64px; }
.spark-gap { display: inline-block; width: 54px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: var(--stroke) solid var(--ink); flex: none; }
[aria-pressed="true"] > .radio { background: var(--ink); box-shadow: inset 0 0 0 4px var(--paper); }

/* Reconnecting mark (contract: a quiet mark while polls fail) */
.recon { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); border: var(--stroke) dashed var(--ink); border-radius: var(--r-pill); padding: 6px 10px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--on-ink); vertical-align: 1px; }

/* Side rail additions */
.side__sep { display: block; height: 0; border-top: var(--stroke) dashed color-mix(in srgb, var(--on-ink) 40%, transparent); margin: 6px 12px; }
.side__link { height: 36px; }
.side__out { display: flex; gap: 8px; align-items: center; color: var(--on-ink); font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; }
.side__count--q { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 1.5px var(--on-ink); }
.side__link[aria-current="page"] .side__count--q { background: transparent; color: var(--ink-text); box-shadow: inset 0 0 0 1.5px var(--ink); }
.rowi .side__count--q { background: var(--ink); color: var(--on-ink); box-shadow: none; margin-left: 0; }

/* Toast for errors: the API's own sentence, shown as is */
.toast--bad { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }

/* Ticket extras */
.ticket--add { align-items: center; justify-content: center; min-height: 200px; gap: 8px; color: var(--text); text-align: center; }
.key__name { font: 600 14px/1.3 var(--mono); }
.key__h { font-family: var(--mono); font-size: 16px; word-break: break-all; letter-spacing: 0; }

/* Needs you, driven by the server's actions */
.need--fyi { background: transparent; color: var(--text); border: var(--stroke) solid var(--ink); }
.need--fyi .btn { border-color: var(--ink); color: var(--ink-text); }
.need--fyi .btn--solid { background: var(--ink); color: var(--on-ink); }
.need--fyi .oval { border-color: var(--ink); color: var(--ink-text); }
.need--fyi .need__hide { color: var(--text-2); }
.need:not(.need--fyi):not(.need--resolved) { --text: var(--on-ink); }
.need:not(.need--fyi):not(.need--resolved) .btn { border-color: var(--on-ink); color: var(--on-ink); }
.need:not(.need--fyi):not(.need--resolved) .btn--solid { background: var(--on-ink); color: var(--ink); }
.need:not(.need--fyi):not(.need--resolved) .oval { border-color: var(--on-ink); color: var(--on-ink); }
.need--blocking { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--on-ink); }
.need__sev { padding: 2px 6px; border-radius: 4px; background: var(--on-ink); color: var(--ink); letter-spacing: .08em; }
.need__detail { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.need__quote { overflow-wrap: anywhere; }
.need__more, .need__hide { align-self: flex-start; font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.need__hide { margin-left: auto; align-self: center; opacity: .9; }
.need__err { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }
.need__reply { align-items: center; }
.need__cur { font: 600 16px/1 var(--mono); }
.input--amt { max-width: 120px; font-family: var(--mono); }
.need--compact .need__quote { font-size: 17px; }
.btn--danger { border-style: dashed; }

/* Agents, tasks, quotes */
.agent__ask { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.agent__detail { font-size: 13.5px; color: var(--text-2); line-height: 1.4; overflow-wrap: anywhere; }
.atable tr.is-off td { opacity: .55; }
.atable__ask td { white-space: normal; padding-top: 0; text-align: left !important; padding-left: 30px; }
.atable__ask .need__quote { font-size: 17px; color: var(--text); }
.atable--plain tbody tr { cursor: pointer; }
.task { color: inherit; }
.task:hover .task__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.task__ic--wait { border-style: dashed; color: var(--text-2); }
.task__last { font-size: 13px; color: var(--text-2); margin-top: 6px; overflow-wrap: anywhere; }
.task__last .mono { font-size: 11px; font-weight: 700; color: var(--text); margin-right: 4px; }
.task__h { font-size: 26px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.quote { border-left: 3px solid var(--ink); padding: 4px 0 4px 14px; font-size: 15px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.quote .mono { font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.quote--ask { background: var(--ink); color: var(--on-ink); border-radius: 12px; border: 0; padding: 12px 14px; font-family: var(--serif); font-style: italic; font-size: 18px; }
.rowi--top { align-items: flex-start; }
.term--sm { padding: 8px 12px; font-size: 12px; margin-top: 6px; max-height: 220px; }

/* Diff: agent-made text, coloured by line, never interpreted */
.files { display: flex; flex-direction: column; border: var(--stroke) solid var(--line-2); border-radius: 12px; overflow: hidden; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: var(--stroke) dashed var(--line-2); font-size: 13px; min-width: 0; }
.file:first-child { border-top: 0; }
.file__s { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; background: var(--wash-2); font: 700 11px/1 var(--mono); color: var(--text); flex: none; }
.file__n { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.file__n b { color: var(--text); }
.diff { --ti: var(--term-ink, var(--ink)); background: var(--term); border: var(--stroke) solid var(--ink); border-radius: 14px; padding: 10px 0; font: 400 12px/1.55 var(--mono); overflow: auto; max-height: 70vh; color: color-mix(in srgb, var(--ti) 70%, var(--term)); }
.dl { display: block; padding: 0 14px; white-space: pre; min-width: max-content; }
.dl--file { color: var(--ti); font-weight: 700; }
.dl--file:first-child, .dl:not(.dl--file) + .dl--file { margin-top: 8px; padding-top: 6px; border-top: var(--stroke) dashed color-mix(in srgb, var(--ti) 35%, var(--term)); }
.dl--hunk { color: var(--term); background: color-mix(in srgb, var(--ti) 70%, var(--term)); }
.dl--add { color: var(--ti); background: color-mix(in srgb, var(--ti) 18%, var(--term)); font-weight: 600; }
.dl--del { color: color-mix(in srgb, var(--ti) 50%, var(--term)); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ti) 35%, var(--term)); }

/* The conversation log */
.live { padding: 18px; }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--in .msg__body { background: var(--wash); border-radius: 4px 16px 16px 16px; padding: 11px 14px; }
.msg__cut { display: block; margin-top: 6px; font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.msg--note { flex-direction: row; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text-2); font-style: italic; font-family: var(--serif); }
.msg--note time { font: 500 var(--fs-2xs)/1 var(--mono); font-style: normal; color: var(--text-2); }
details.msg--think > summary { list-style: none; cursor: pointer; }
details.msg--think > summary::-webkit-details-marker { display: none; }
details.msg--think > summary::after { content: "▸ show"; font-weight: 500; color: var(--text-2); }
details.msg--think[open] > summary::after { content: "▾ hide"; }
.tool { border: var(--stroke) solid var(--line); border-radius: 12px; max-width: 720px; }
.tool > summary { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; list-style: none; min-width: 0; }
.tool > summary::-webkit-details-marker { display: none; }
.tool__n { font: 700 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--on-ink); padding: 4px 6px; border-radius: 5px; flex: none; }
.tool__t { font: 400 12.5px/1.3 var(--mono); color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool__who { font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); flex: none; }
.tool__d { margin: 0 12px 10px; padding: 8px 10px; background: var(--term); color: var(--term-ink, var(--ink)); border-radius: 8px; font: 400 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.result { max-width: 720px; margin-top: -10px; margin-left: 14px; padding-left: 12px; border-left: var(--stroke) dashed var(--line); }
.result__h { font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.result pre { margin-top: 4px; font: 400 12px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: hidden; }
.result--bad { border-left: 3px solid var(--ink); }
.result--bad .result__h, .result--bad pre { color: var(--text); }
.page--live { gap: 16px; }

/* Composer extras */
.composer__task { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.field--inline { flex-direction: row; align-items: center; gap: 6px; }
.input--sm { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.field--inline .input--sm { width: 110px; }
.check--sm { min-height: 32px; gap: 8px; font-size: 13px; }
.check--sm .check__box { width: 18px; height: 18px; border-radius: 6px; }
.seg--scroll { max-width: 100%; }

/* Usage cards and load bars */
.ucard { border: var(--stroke) solid var(--line); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ucard--best { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.loadbar { display: grid; grid-template-columns: 64px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.loadbar .mono { font-size: 12px; text-align: right; color: var(--text); }

/* Kill switch */
.killbox { background: var(--ink); color: var(--on-ink); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.killbox .lbl { color: var(--on-ink); }
.killbox__t { font-size: 30px; letter-spacing: -0.03em; line-height: 1.05; }
.killbox p { font-size: 14.5px; line-height: 1.45; max-width: 42ch; }
.killlist { display: flex; flex-direction: column; gap: 10px; }
.killrow { border: var(--stroke) dashed var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ba--ink .ba__c { border-color: var(--on-ink); }
.ba--ink .ba__c--after { background: var(--on-ink); color: var(--ink); }
.ba--ink .ba__c--after .lbl { color: var(--ink); }
.ba--ink .ba__arrow { color: var(--on-ink); }

/* Scoreboard matrix: quality as ink density */
.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.matrix th { font: 500 var(--fs-2xs)/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding: 0 4px 10px; text-align: center; white-space: nowrap; border-bottom: var(--stroke) solid var(--ink); }
.matrix th:first-child { text-align: left; padding-left: 0; }
.matrix tbody th { text-align: left; font: 500 13px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); padding: 8px 12px 8px 0; border-bottom: var(--stroke) dashed var(--line-2); white-space: normal; min-width: 180px; }
.matrix td { padding: 4px; border-bottom: var(--stroke) dashed var(--line-2); text-align: center; }
.matrix td.r, .matrix th.r { text-align: right; padding-left: 10px; white-space: nowrap; }
.matrix tr.is-best th { color: var(--ink-text); }
.mx { cursor: pointer; }
.mx__q { --q: 0; display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto; border-radius: 8px; font: 700 12px/1 var(--mono);
  background: color-mix(in srgb, var(--ink) calc(var(--q) * 100%), var(--paper)); color: var(--text); border: var(--stroke) solid var(--line-2); }
.mx__q--hi { color: var(--on-ink); border-color: var(--ink); }
.mx__q--none { border-style: dashed; background: transparent; color: var(--text-2); }
.mx--none .mx__q, .mx--run { color: var(--text-2); }
.mx__id { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; border: var(--stroke) solid var(--ink); font: 700 11px/1 var(--mono); color: var(--text); margin-right: 4px; }
.mxrow { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.mxrow .mx__q { width: 100%; aspect-ratio: 1; height: auto; cursor: pointer; }
.barst { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; border: var(--stroke) solid var(--ink); font: 700 13px/1 var(--mono); color: var(--text); }
.barst--met { background: var(--ink); color: var(--on-ink); }
.barst--pending { border-style: dashed; }
.barst--not-met { background: var(--paper); border-width: 2.5px; }

/* Decisions and handoff */
.decision { border: var(--stroke) solid var(--ink); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.decision__t { font-size: 24px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.md { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.55; color: var(--text); max-width: 68ch; }
.md b { font-weight: 650; }
.mdl { display: flex; flex-direction: column; gap: 4px; padding-left: 0; }
.mdl li::before { content: "◆ "; font-size: 10px; vertical-align: 2px; }
.opts { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@container ember (min-width: 700px) { .opts { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.opt { border: var(--stroke) dashed var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.opt--rec { border-style: solid; border-color: var(--ink); }
.opt--picked { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.opt--picked .copy { color: var(--on-ink); }
.opt__t { font-size: 17px; font-weight: 500; }
.hlog { display: flex; flex-direction: column; }
.hentry { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: var(--stroke) dashed var(--line-2); }
.hentry:first-child { border-top: 0; }
.hentry__rail { display: flex; flex-direction: column; gap: 2px; }
.chip--link { border-color: var(--ink); }
.sha { max-width: 200px; display: inline-block; vertical-align: bottom; }

/* Wizard and deploy extras */
.sum__name { font-size: 24px; letter-spacing: -0.03em; line-height: 1.05; word-break: break-all; }
.sum__name--big { font-size: 30px; }
.deploy__h { font-size: 30px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.05; }
.wiz-skip { text-align: center; padding: 0 0 10px; background: var(--paper); }
.stepper--sm { height: 40px; }
.stepper--sm output { min-width: 64px; font-size: 17px; }
.stepper--sm button { width: 40px; }
.mopt--static { cursor: default; }
.mopt__note { color: var(--text); }
.mopt[disabled], .rowi[disabled] { opacity: .45; cursor: not-allowed; }
.brandfoot { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; }
.brandfoot__wm { width: 150px; }

@media (prefers-reduced-motion: reduce) { .need--blocking { box-shadow: none; } }

/* The full-page app (no <style> in the page: the builder's CSP forbids it) */
.ember-page, .ember-page body { height: 100%; margin: 0; background: var(--ink); }
.ember-page #app { height: 100%; }

/* Foldables, opened (EmberApp.boot): two phone sheets on one field. Each
   pane's app is its own container, so each lays out as a phone. Lying flat,
   a Pixel or Galaxy reports one segment and the 50/50 split lands on the
   hinge; the panes' frame padding leaves orange field over the fold. A screen
   that reports its hinge gets columns that match it exactly. */
.fold { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr); background: var(--ink); }
.fold__l, .fold__r { min-width: 0; min-height: 0; overflow: hidden; transition: opacity .15s var(--ease); }
@media (horizontal-viewport-segments: 2) {
  .fold { grid-template-columns: env(viewport-segment-width 0 0) calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)) env(viewport-segment-width 1 0) !important; }
}
/* The divider: a grip in the field between the sheets. Dragged past a side's
   minimum, that side dims and folds away on release; folded, the grip becomes
   a strip at the edge that brings it back. Locked when the screen reports a hinge. */
.fold__hinge { position: relative; z-index: 30; }
.fold__grip { position: absolute; top: 0; bottom: 0; left: -12px; width: 24px; display: grid; place-items: center; touch-action: none; cursor: col-resize; -webkit-user-select: none; user-select: none; }
.fold__grip i { width: 4px; height: 44px; border-radius: 2px; background: color-mix(in srgb, var(--on-ink) 70%, transparent); transition: height .15s var(--ease), width .15s var(--ease), background .15s var(--ease); }
.fold__grip:hover i, .fold__grip:focus-visible i, .fold--drag .fold__grip i { width: 6px; height: 64px; background: var(--on-ink); }
.ember-page .fold__grip:focus-visible { outline: 2px solid var(--on-ink); outline-offset: -4px; border-radius: 12px; }
.fold--drag { cursor: col-resize; -webkit-user-select: none; user-select: none; }
.fold--drag .fold__l, .fold--drag .fold__r { pointer-events: none; }
.fold--off-l .fold__l, .fold--off-r .fold__r { opacity: .35; }
.fold--solo-r .fold__l, .fold--solo-l .fold__r { visibility: hidden; }
.fold--solo-r .fold__grip { left: 0; width: 16px; cursor: pointer; }
.fold--solo-l .fold__grip { left: -16px; width: 16px; cursor: pointer; }
.fold--solo-l .fold__grip i, .fold--solo-r .fold__grip i { width: 6px; height: 72px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }   /* on the frame and the sheet edge alike */
.fold--locked .fold__grip { display: none; }
/* What the right pane shows, marked in the list on the left */
.ticket.is-picked { outline: 3px solid var(--ink); outline-offset: 3px; }
.rowi.is-picked { position: relative; isolation: isolate; }
.rowi.is-picked::before { content: ""; position: absolute; inset: 4px -10px; z-index: -1; border-radius: 12px; background: var(--wash-2); }
.atable tbody tr.is-picked td { background: var(--wash-2); }
.page--center { min-height: 100%; justify-content: center; }

/* The smallest phones (a Galaxy Z Fold cover is 320 wide): tighten, don't clip */
@container ember (max-width: 359.98px) {
  .tab { letter-spacing: .02em; }
  .top { gap: 10px; padding: 14px 14px 12px; }
  .top::after { left: 14px; right: 14px; }
  .top__title h1 { font-size: 23px; }
  .top__title .ser { font-size: 18px; }
  .top__actions .lbl { white-space: normal; max-width: 8.5em; text-align: right; line-height: 1.25; }   /* counts wrap; the title keeps its words */
  .page { padding: 16px 14px 36px; }
  .filters, .acards, .tpl { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .ptabs { gap: 12px; justify-content: space-between; }
  .ptabs > a, .ptabs > button { font-size: 10.5px; letter-spacing: .05em; }
  .seg button { padding: 0 8px; font-size: 10.5px; letter-spacing: .03em; }
  .composer { padding: 10px 10px 12px; }
  .composer__opts { flex-wrap: wrap; }
  .wiz-prog { padding: 0 14px 12px; }
  .wbar { padding: 12px 14px 14px; gap: 8px; }
  .wbar--phone .oval { padding: 6px 16px; }
  .wbar--phone .btn { min-width: 0; white-space: normal; line-height: 1.15; text-align: center; padding: 0 14px; }   /* "Pick the project folder" */
  .stats.n4 { --n: 2; row-gap: 14px; }
  .stats.n4 .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .need { padding: 14px 13px; }
  .leader > :first-child { flex: 0 1 auto; min-width: 0; }             /* a long label wraps instead of pushing the value out */
  .osheet__head { padding: 12px 14px 14px; }
  .osheet__body { padding: 16px 14px 20px; }
  .osheet__foot { padding: 12px 14px 14px; gap: 8px; }
  .osheet__foot .btn { min-width: 0; padding: 0 14px; }
  .osheet__foot .btn--icon { flex: none; padding: 0; }
  .osheet__foot .btn--solid { white-space: normal; line-height: 1.15; text-align: center; }
  .osheet__body .spark { max-width: 100%; height: auto; }
}

@container ember (max-width: 899.98px) { .wbtn { width: var(--b-h); padding: 0; } }
.modelbtn__n .badge { align-self: flex-start; }
@container ember (max-width: 899.98px) { .deploy__h { font-size: 26px; } }

/* Colour picker (Settings) */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 var(--fs-2xs)/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.swatch__dot { width: 44px; height: 44px; border-radius: 50%; border: var(--stroke) solid var(--line); display: grid; place-items: center; }
.swatch[aria-pressed="true"] .swatch__dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatch[aria-pressed="true"] { color: var(--text); }
.hue { width: 100%; height: 30px; -webkit-appearance: none; appearance: none; border-radius: var(--r-pill); border: var(--stroke) solid var(--line); background: var(--hue-grad, linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red)); }
.hue::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 3px solid var(--text); }
.hue::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 3px solid var(--text); }
.range { width: 100%; height: 30px; margin: 4px 0; -webkit-appearance: none; appearance: none; border-radius: var(--r-pill); border: var(--stroke) solid var(--line); background: linear-gradient(90deg, var(--ink) var(--fill, 50%), transparent var(--fill, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 3px solid var(--text); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 3px solid var(--text); }
.colorin { width: 48px; height: 48px; padding: 0; border: var(--stroke) solid var(--ink); border-radius: var(--r-ctl); background: none; flex: none; }
.preview { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-card); overflow: hidden; border: var(--stroke) solid var(--ink); }
.preview > div { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.preview__ink { background: var(--ink); color: var(--on-ink); }
.preview__ink .lbl { color: var(--on-ink); }
.ratio { font: 600 12px/1.3 var(--mono); }
