/* =============================================================================
   Console — the design system, as CSS custom properties.

   Every value below is §10 of AI-COMPANY-APP-BUILD-SPEC.md, literally. Not an
   interpretation of it: the same hexes, the same type scale, the same radii,
   the same three-step assembly motion. If a number here disagrees with the
   spec, the spec wins and this file is wrong.

   The app is dark-only and commits to it. There is no light theme, because an
   instrument that changes colour with the operating system is not an
   instrument. `color-scheme: dark` makes native controls agree.
   ========================================================================== */

:root {
  /* §10.1 — colour. One signal colour, one meaning. */
  --canvas:      #08090B;   /* near-black, not pure */
  --surface:     #101215;   /* cards */
  --surface-hi:  #16191E;   /* raised / pressed */
  --hairline:    rgba(255, 255, 255, .08);   /* a 1px luminous edge, NOT a shadow */
  --hairline-2:  rgba(255, 255, 255, .05);
  --text:        #F2F4F7;
  --text-dim:    #8A9099;
  --mono-dim:    #5C6470;   /* provenance footers */

  --signal:      #FFB020;   /* amber. ONLY for "this needs you". Nothing else. */
  --ok:          #3DD68C;
  --warn:        #FFB020;
  --error:       #FF5C5C;
  --running:     #4C9AFF;

  --dimhost:     #7C5CFF;
  --veghe:       #00C2A8;   /* the two SRLs must never be visually confusable */

  /* §10.2 — type. No web font is ever downloaded: it is faster and the CSP
     forbids the host anyway. */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* §10.3 — space and shape. 8pt grid. */
  --r-card: 16px;
  --r-inner: 12px;
  --r-pill: 11px;
  --pad-card: 16px;
  --gap-section: 24px;
  --tap: 44px;              /* he uses this walking, driving, half-awake */

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  /* A pull inside a list must not bounce the page (§10.3). */
  overscroll-behavior: none;
  /* Chrome is not selectable; ids and values are — he will want to copy a
     request id, and taking that away is a small cruelty. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body { overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── boot ──────────────────────────────────────────────────────────────── */

.boot {
  position: fixed; inset: 0; display: grid; place-content: center;
  justify-items: center; gap: 14px; background: var(--canvas);
}
.boot-mark {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--signal);
  position: relative;
  animation: boot-pulse 2s ease-in-out infinite;
}
.boot-mark::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: var(--signal);
}
@keyframes boot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.boot-text {
  margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--mono-dim);
}

/* ── app frame ─────────────────────────────────────────────────────────── */

.app { height: 100%; display: flex; flex-direction: column; }

.top {
  flex: 0 0 auto;
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 16px) 12px calc(var(--safe-l) + 16px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.top h1 {
  margin: 0;
  font-size: 34px; line-height: 40px; font-weight: 640; letter-spacing: -.02em;
}
.top h1.sm { font-size: 22px; line-height: 28px; font-weight: 620; letter-spacing: -.01em; }
.top-acts { display: flex; gap: 4px; align-items: center; }

.icon-btn {
  width: var(--tap); height: var(--tap); min-width: var(--tap);
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-inner); background: transparent;
  color: var(--text-dim); font-size: 17px; font-family: var(--sans);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-hi); color: var(--text); }
.icon-btn.on { background: var(--surface-hi); color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: -3px; }

.scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 calc(var(--safe-r) + 16px) 24px calc(var(--safe-l) + 16px);
  display: flex; flex-direction: column; gap: 12px;
}

/* ── the provenance footer — §10.4, the signature detail ───────────────── */

.prov {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px calc(var(--safe-r) + 18px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 18px);
  border-top: 1px solid var(--hairline-2);
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--mono-dim);
  overflow-wrap: anywhere;
}
.prov button {
  border: 0; background: transparent; color: var(--mono-dim);
  font-family: var(--mono); font-size: 15px; padding: 4px 8px; margin: -4px -8px;
  min-width: 32px; min-height: 32px; cursor: pointer;
}
.prov button:active { color: var(--text); }

/* ── cards ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 14px var(--pad-card);
  display: flex; flex-direction: column; gap: 9px;
}
.card.flat { background: transparent; border-color: var(--hairline-2); }
.card.hi { background: var(--surface-hi); }
.card.tap { cursor: pointer; }
.card.tap:active { background: var(--surface-hi); }

.row { display: flex; gap: 11px; align-items: flex-start; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }

.dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  margin-top: 7px; background: var(--mono-dim);
}
.dot.signal { background: var(--signal); box-shadow: 0 0 0 3px rgba(255, 176, 32, .14); }
.dot.error  { background: var(--error);  box-shadow: 0 0 0 3px rgba(255, 92, 92, .14); }
.dot.ok     { background: var(--ok); }
/* Live things get a slow 2s pulse — never a spinner (§10.5). */
.dot.running { background: var(--running); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .32; } }

.h  { margin: 0; font-size: 17px; line-height: 23px; font-weight: 600; letter-spacing: -.01em; }
.h.sig { color: var(--signal); }
.h.lg { font-size: 22px; line-height: 28px; }
.sub { margin: 0; font-size: 15px; line-height: 20px; color: var(--text-dim); }
.why { margin: 0; font-size: 13px; line-height: 18px; color: var(--signal); opacity: .92; }
.meta {
  margin: 0; font-family: var(--mono); font-size: 12px; line-height: 16px;
  color: var(--mono-dim); overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text;
}

.label {
  font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-dim); margin: 6px 0 -2px; padding: 0 2px;
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 560; letter-spacing: -.005em;
  padding: 0 14px; height: 38px; min-width: var(--tap);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline);
  background: var(--surface-hi); color: var(--text);
  white-space: nowrap; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--signal); border-color: var(--signal); color: #1A1206; font-weight: 640; }
.btn.danger  { color: var(--error); border-color: rgba(255, 92, 92, .3); }
.btn.ghost   { background: transparent; color: var(--text-dim); }
.btn.lg { height: 48px; font-size: 16px; flex: 1; border-radius: 14px; }
.btn.block { width: 100%; }

/* ── pills ─────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-hi); color: var(--text-dim);
  border: 1px solid var(--hairline-2); white-space: nowrap;
}
.pill.ok    { color: var(--ok);      border-color: rgba(61, 214, 140, .24); }
.pill.error { color: var(--error);   border-color: rgba(255, 92, 92, .26); }
.pill.run   { color: var(--running); border-color: rgba(76, 154, 255, .26); }
.pill.sig   { color: var(--signal);  border-color: rgba(255, 176, 32, .26); }

/* ── lens / segmented ──────────────────────────────────────────────────── */

.lens {
  display: flex; gap: 3px; padding: 3px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-inner);
}
.lens button {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 14px; font-weight: 550;
  cursor: pointer;
}
.lens button.on { background: var(--surface-hi); color: var(--text); }

/* ── banners ───────────────────────────────────────────────────────────── */

.banner {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  border-radius: var(--r-inner); font-size: 14px; line-height: 19px;
  background: rgba(255, 176, 32, .09); border: 1px solid rgba(255, 176, 32, .24);
  color: var(--signal);
}
.banner.quiet { background: var(--surface); border-color: var(--hairline); color: var(--text-dim); }
.banner.error { background: rgba(255, 92, 92, .09); border-color: rgba(255, 92, 92, .26); color: var(--error); }
.banner.ok    { background: rgba(61, 214, 140, .08); border-color: rgba(61, 214, 140, .24); color: var(--ok); }
.banner button { margin-left: auto; }

/* ── key/value ─────────────────────────────────────────────────────────── */

.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex; justify-content: space-between; gap: 14px; padding: 9px 0;
  border-bottom: 1px solid var(--hairline-2); font-size: 15px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--text-dim); margin: 0; flex: 0 0 auto; }
.kv-row dd {
  margin: 0; text-align: right; color: var(--text); font-weight: 520;
  overflow-wrap: anywhere; -webkit-user-select: text; user-select: text;
}
.kv-row dd.mono { font-family: var(--mono); font-size: 12.5px; }
.kv-row dd.bad  { color: var(--error); }
.kv-row dd.good { color: var(--ok); }

/* ── metric — numbers large and unapologetic (§10.2) ───────────────────── */

.metrics { display: flex; gap: 10px; }
.metrics > .card { flex: 1; }
.metric { display: flex; flex-direction: column; gap: 1px; }
.metric .v {
  font-size: 34px; line-height: 40px; font-weight: 620; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.metric .v.sm { font-size: 26px; line-height: 32px; }
.metric .v.bad { color: var(--error); }
.metric .v.sig { color: var(--signal); }
.metric .l { font-size: 13px; font-weight: 500; color: var(--text-dim); }

/* ── progress ──────────────────────────────────────────────────────────── */

.bar { height: 5px; border-radius: 3px; background: var(--surface-hi); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--running); border-radius: 3px; }
.bar.sig > i { background: var(--signal); }

/* ── timeline ──────────────────────────────────────────────────────────── */

.tl { display: flex; flex-direction: column; padding-left: 4px; }
.tl-row { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-row::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0;
  width: 1px; background: var(--hairline);
}
.tl-row:last-child { padding-bottom: 0; }
.tl-row:last-child::before { display: none; }
.tl-dot {
  flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; margin-top: 4px;
  background: var(--surface-hi); border: 1.5px solid var(--mono-dim); z-index: 1;
}
.tl-dot.ok  { background: var(--ok); border-color: var(--ok); }
.tl-dot.sig { background: var(--signal); border-color: var(--signal); }
.tl-b { flex: 1; min-width: 0; }
.tl-b .t { font-size: 15px; line-height: 20px; font-weight: 550; }

/* ── chat ──────────────────────────────────────────────────────────────── */

.msg {
  max-width: 84%; padding: 10px 14px; border-radius: 16px;
  font-size: 16px; line-height: 22px; overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text;
}
.msg.me   { align-self: flex-end;   background: var(--surface-hi); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--hairline);
            border-bottom-left-radius: 6px; }
.msg.pending { color: var(--text-dim); font-style: italic; }

.composer {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 16px);
  border-top: 1px solid var(--hairline-2);
}
.composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px;
  color: var(--text); font-family: var(--sans); font-size: 16px;
  -webkit-user-select: text; user-select: text;
}
.composer input::placeholder { color: var(--mono-dim); }
.composer input:focus { outline: none; border-color: var(--text-dim); }

/* ── search field ──────────────────────────────────────────────────────── */

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 22px; padding: 0 16px; height: 44px;
}
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 16px; height: 100%;
  -webkit-user-select: text; user-select: text;
}
.search input:focus { outline: none; }
.search span { color: var(--mono-dim); }

/* ── skeleton ──────────────────────────────────────────────────────────── */

.skel { background: var(--surface-hi); border-radius: 6px; height: 13px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .055), transparent);
  animation: shim 1.5s linear infinite;
}
@keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── sheet ─────────────────────────────────────────────────────────────── */

.sheet-back {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; z-index: 50;
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-height: 88%; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--hairline);
  border-radius: 22px 22px 0 0;
  padding: 8px calc(var(--safe-r) + 18px) calc(var(--safe-b) + 22px) calc(var(--safe-l) + 18px);
  display: flex; flex-direction: column; gap: 12px;
  animation: rise .24s cubic-bezier(.2, .7, .3, 1);
}
@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--surface-hi); margin: 4px auto 6px; }

/* ── empty / centred states ────────────────────────────────────────────── */

.centre {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 8px; padding: 40px 24px 80px;
}
.centre .mark {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--ok); color: var(--ok); font-size: 20px; margin-bottom: 6px;
}
.centre .mark.sig { border-color: var(--signal); color: var(--signal); }
.centre .mark.err { border-color: var(--error); color: var(--error); }
.centre p { margin: 0; max-width: 30ch; }

/* ── agent monogram — §10.6, colour derived from the id ────────────────── */

.mono-badge {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: #08090B;
}
.mono-badge.lg { width: 44px; height: 44px; font-size: 15px; }

/* ── voice ─────────────────────────────────────────────────────────────── */

.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 56px; }
.wave i {
  width: 3px; border-radius: 2px; background: var(--signal); height: 8px;
  animation: w 1.1s ease-in-out infinite;
}
@keyframes w { 0%, 100% { height: 8px; opacity: .5; } 50% { height: 38px; opacity: 1; } }

.mic {
  width: 74px; height: 74px; border-radius: 50%; border: 0;
  background: var(--signal); color: #1A1206; font-size: 26px;
  display: grid; place-items: center; cursor: pointer;
  touch-action: none;
}
.mic.listening { animation: pulse 2s ease-in-out infinite; }
.mic[disabled] { background: var(--surface-hi); color: var(--mono-dim); }

/* ── the assembly of a generated surface — §10.5, the one beautiful thing ─ */

.assembly > * { opacity: 0; transform: translateY(8px); animation: rise-in .34s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes rise-in { to { opacity: 1; transform: none; } }
.frame-line { height: 1px; background: var(--signal); opacity: .55; transform-origin: left;
              animation: draw .18s ease-out forwards; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Everything else is fast and plain: 200ms, no bounce, no parallax. */
.fade-in { animation: fade .2s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .assembly > *, .frame-line, .sheet, .sheet-back, .fade-in { animation: none; opacity: 1; transform: none; }
  .dot.running, .boot-mark, .mic.listening, .wave i, .skel::after { animation: none; }
  .wave i { height: 20px; }
}

/* ── the tool list (§6.2.4) ────────────────────────────────────────────── */

.tool-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--hairline-2);
  min-height: var(--tap); cursor: pointer;
}
.tool-row:last-child { border-bottom: 0; }
.tool-row .n {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  overflow-wrap: anywhere;
}
.tool-row .d { font-size: 12px; line-height: 16px; color: var(--mono-dim); margin-top: 2px; }

/* ── the tab bar ───────────────────────────────────────────────────────── */

.tabs {
  flex: 0 0 auto;
  display: flex; justify-content: space-around; align-items: stretch;
  border-top: 1px solid var(--hairline-2);
  padding: 6px calc(var(--safe-r) + 8px) calc(var(--safe-b) + 6px) calc(var(--safe-l) + 8px);
  background: var(--canvas);
}
.tabs button {
  flex: 1; min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent; color: var(--mono-dim);
  font-family: var(--sans); font-size: 10px; font-weight: 550; letter-spacing: .01em;
  cursor: pointer;
}
.tabs button .g { font-size: 18px; line-height: 20px; }
.tabs button.on { color: var(--signal); }
.tabs button:focus-visible { outline: 2px solid var(--signal); outline-offset: -3px; }
.tab-badge {
  position: absolute; transform: translate(14px, -8px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--signal); color: #1A1206;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ── evidence pack ─────────────────────────────────────────────────────── */

.evidence { display: flex; flex-direction: column; gap: 2px; }
.evidence .er { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0;
                border-bottom: 1px solid var(--hairline-2); font-size: 15px; }
.evidence .er:last-child { border-bottom: 0; }
.evidence .er .k { color: var(--text-dim); flex: 0 0 auto; }
.evidence .er .v { text-align: right; overflow-wrap: anywhere;
                   -webkit-user-select: text; user-select: text; }
.evidence .er .v.bad { color: var(--error); }
.evidence .er .v.good { color: var(--ok); }

/* ── forms inside generated surfaces ───────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 550; color: var(--text-dim); }
.field input, .field textarea {
  background: var(--surface-hi); border: 1px solid var(--hairline);
  border-radius: var(--r-inner); color: var(--text);
  font-family: var(--sans); font-size: 16px; padding: 11px 13px; min-height: var(--tap);
  -webkit-user-select: text; user-select: text;
}
.field input.mono { font-family: var(--mono); font-size: 14px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--signal); }

/* ═══════════════════════════════════════════════════════════════════════════
   Added after the first real device test.

   The verdict was "prea fadă, nu-i interactivă, nu-i intuitivă", and it was
   right: one flat column of identical grey cards, amber leaking onto things
   that needed nothing, and no sense of a living company anywhere. What follows
   is hierarchy, feedback, and one instrument.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── the top progress bar ──────────────────────────────────────────────────
   Not a spinner. §3.3 forbids a spinner over an agent turn, and one over a
   200ms read is worse than nothing. This says "heard you" and gets out of the
   way. */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease-out;
}
.progress.on { opacity: 1; }
.progress.done { opacity: 0; transition: opacity .26s ease-out .1s; }
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255,176,32,.35), var(--signal));
  box-shadow: 0 0 10px rgba(255, 176, 32, .55);
  transition: width .22s cubic-bezier(.2, .7, .3, 1);
}

/* ── the top bar ───────────────────────────────────────────────────────────
   Compact on the home screen: Radar is the headline there, so the word ACUM
   does not need 40 points of it. */
.top.compact { padding-bottom: 6px; }
.top.compact h1 { font-size: 19px; line-height: 24px; letter-spacing: .04em;
                  text-transform: uppercase; color: var(--text-dim); font-weight: 620; }
.top-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.icon-btn svg { display: block; }

/* ── Radar: the instrument at the top of ACUM ──────────────────────────────
   §10.5 rejects decoration and this is not decoration — every property of it
   is a measurement (see radar.js). It earns the pixels by answering "what is
   the state of my company" before a single card is read. */
.radar-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0 18px;
  position: relative;
}
.radar-hero::after {
  /* One hairline under the instrument, so it reads as a panel rather than as a
     floating picture. Depth from a luminous edge, never a drop shadow. */
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline), transparent);
}

.radar-orb {
  width: min(216px, 58vw);
  height: min(216px, 58vw);
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: block;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s cubic-bezier(.2, .7, .3, 1);
}
.radar-orb:active { transform: scale(.965); }
.radar-orb:focus-visible { outline: 2px solid var(--signal); outline-offset: 6px; }
.radar-canvas { width: 100%; height: 100%; display: block; }

.radar-headline {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 32px;
  font-weight: 650;
  letter-spacing: -.022em;
  text-align: center;
}
.mood-needs  .radar-headline { color: var(--signal); }
.mood-broken .radar-headline { color: var(--error); }
.mood-calm   .radar-headline { color: var(--ok); }

.radar-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 17px;
  letter-spacing: .03em;
  color: var(--mono-dim);
  text-align: center;
}
.radar-acts { display: flex; gap: 8px; margin-top: 14px; }
.radar-acts .btn { height: 40px; padding: 0 18px; }

/* ── section headings — the thing that turns a list into a hierarchy ────── */
.sec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 2px 2px;
}
.sec-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.sec-count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-hi);
  color: var(--text-dim);
}
.sec-rule { flex: 1; height: 1px; background: var(--hairline-2); }

.sec-head.sig .sec-label { color: var(--signal); }
.sec-head.sig .sec-count { background: rgba(255, 176, 32, .16); color: var(--signal); }
.sec-head.sig .sec-rule  { background: linear-gradient(90deg, rgba(255,176,32,.32), transparent); }
.sec-head.run .sec-label { color: var(--running); }
.sec-head.run .sec-count { background: rgba(76, 154, 255, .16); color: var(--running); }
.sec-head.dim .sec-label { color: var(--mono-dim); }

/* ── the severity stripe ───────────────────────────────────────────────────
   A 9px dot was carrying all of "how much does this matter", and at arm's
   length it carried none of it. The stripe is legible before a word is read. */
.card.sev {
  position: relative;
  padding-left: 18px;
  overflow: hidden;
}
.card.sev::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--mono-dim);
}
.card.sev-sig::before { background: var(--signal); box-shadow: 0 0 14px rgba(255,176,32,.5); }
.card.sev-err::before { background: var(--error);  box-shadow: 0 0 14px rgba(255,92,92,.45); }
.card.sev-run::before { background: var(--running); animation: pulse 2s ease-in-out infinite; }
.card.sev-dim::before { background: rgba(255, 255, 255, .12); }

.card.sev-sig { background: linear-gradient(100deg, rgba(255,176,32,.05), var(--surface) 42%); }
.card.sev-err { background: linear-gradient(100deg, rgba(255,92,92,.05), var(--surface) 42%); }

.card-head { display: flex; flex-direction: column; gap: 4px; }
.h.sm { font-size: 15px; line-height: 20px; }

/* Amber ONLY where something needs him. It had leaked onto "Din calendar." —
   the one colour with one meaning was glowing on things that meant nothing. */
.why.quiet { color: var(--text-dim); opacity: 1; }
.meta.err { color: var(--error); }

/* ── figures inside a card ─────────────────────────────────────────────── */
.figs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2px 0;
  border-top: 1px solid var(--hairline-2);
}
.fig {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-2);
}
.fig:last-child { border-bottom: 0; }
.fig-l { flex: 1; min-width: 0; font-size: 15px; color: var(--text);
         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fig-v { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text);
         font-variant-numeric: tabular-nums; }
.fig-d { font-family: var(--mono); font-size: 11px; color: var(--mono-dim);
         min-width: 60px; text-align: right; }

/* ── the calm state — good news must look like good news (§5.1) ─────────── */
.calm-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 26px 20px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-card);
  margin-top: 6px;
}
.calm-note .sub { max-width: 30ch; }

/* ── buttons: make them look pressable ─────────────────────────────────── */
.btn {
  transition: transform .12s cubic-bezier(.2,.7,.3,1), background .12s ease-out, border-color .12s ease-out;
}
.btn:active { transform: scale(.96); }
.btn.primary {
  box-shadow: 0 2px 14px -4px rgba(255, 176, 32, .55);
}
.btn.primary:active { box-shadow: none; }

/* The first action in a card is the one he wants; give it the edge. */
.acts .btn:first-child:not(.ghost):not(.primary) {
  background: var(--surface-hi);
  border-color: rgba(255, 255, 255, .14);
  color: var(--text);
}

/* ── tab bar ───────────────────────────────────────────────────────────── */
.tabs button .g { position: relative; display: grid; place-items: center; height: 22px; }
.tabs button.on .g { filter: drop-shadow(0 0 8px rgba(255, 176, 32, .45)); }
.tabs button { transition: color .15s ease-out; }
.tabs button:active { transform: scale(.94); }

/* ── chat ──────────────────────────────────────────────────────────────── */
.msg.pending {
  display: flex; align-items: center; gap: 8px;
  font-style: normal; color: var(--text-dim);
}
.think {
  display: inline-flex; gap: 4px; align-items: center;
}
.think i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim);
  animation: think 1.3s ease-in-out infinite;
}
.think i:nth-child(2) { animation-delay: .18s; }
.think i:nth-child(3) { animation-delay: .36s; }
@keyframes think { 0%, 60%, 100% { opacity: .25; transform: translateY(0); }
                   30% { opacity: 1; transform: translateY(-3px); } }

.agent-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.agent-strip::-webkit-scrollbar { display: none; }
.agent-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 6px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--text); font-size: 14px; font-weight: 550; cursor: pointer;
}
.agent-chip.on { border-color: var(--signal); background: var(--surface-hi); }
.agent-chip .mono-badge { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .card.sev-run::before, .think i { animation: none; }
  .btn:active, .tabs button:active, .radar-orb:active { transform: none; }
}

.thread { display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 0; }
.composer .btn.primary { width: 44px; height: 44px; padding: 0; border-radius: 22px; flex: 0 0 auto; }

/* ── rows that lead somewhere ──────────────────────────────────────────────
   An agent, a section, a device: same shape, so "this opens something" is
   learned once. The chevron is the affordance the flat cards were missing. */
.agent-row {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); cursor: pointer; margin: -2px 0;
}
.agent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-main .h { overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--mono-dim); font-size: 20px; line-height: 1; flex: 0 0 auto; padding-left: 4px; }
.sec-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--r-inner);
  display: grid; place-items: center;
  background: var(--surface-hi); color: var(--text-dim);
}

/* ── the tool list ─────────────────────────────────────────────────────── */
.tool-results { display: flex; flex-direction: column; gap: 10px; }
.tool-main { flex: 1; min-width: 0; }
.tool-row { gap: 12px; align-items: flex-start; padding: 12px 0; }
.tool-row .n { font-family: var(--mono); font-size: 13.5px; color: var(--text); line-height: 18px; }
.tool-row .d {
  font-size: 12.5px; line-height: 17px; color: var(--mono-dim); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-row .pill { flex: 0 0 auto; margin-top: 2px; }

/* ── search field with an icon ─────────────────────────────────────────── */
.search svg { color: var(--mono-dim); flex: 0 0 auto; }

/* ── metrics side by side ──────────────────────────────────────────────── */
.metrics > .card { padding: 12px 14px; }

@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
