/* ───────────────────────────────────────────────────────────
   Unadmin SaaS — Customer Dashboard
   Modern editorial SaaS · neutral · strong typography
   ─────────────────────────────────────────────────────────── */

:root {
  /* Neutrals — warm paper canvas + clearly elevated white cards.
     Surfaces are spaced ~15-20 lightness levels apart so cards lift
     off the page instead of melting into it. */
  --bg: #EBE9E0;        /* canvas / main area — deeper warm paper */
  --bg-elev: #FFFFFF;   /* cards / panels — pop as bright white */
  --bg-tint: #F3F2EA;   /* inset chips, inputs, wells */
  --bg-sunken: #DEDCD1; /* tracks / recessed bars */

  --ink: #14150F;
  --ink-2: #34362F;
  --ink-3: #5E6159;     /* secondary text — darker for real contrast */
  --ink-4: #898C82;     /* meta / muted */
  --ink-5: #BCBEB5;

  /* Borders carry real weight now — boxes read as boxes */
  --line: rgba(14, 15, 12, 0.16);
  --line-strong: rgba(14, 15, 12, 0.26);
  --line-soft: rgba(14, 15, 12, 0.09);

  /* Accent: forest green — the "look here" colour, used with intent */
  --accent: #1C5A41;
  --accent-soft: #DCEBE2;
  --accent-ink: #103022;

  /* Status palette — muted but legible, soft tints deepened for presence */
  --running: #335A8C;
  --running-soft: #DEE8F4;
  --idle: #898C82;
  --idle-soft: #E7E6DE;
  --attention: #9A5B12;
  --attention-soft: #F6E6CC;
  --review: #1C5A41;
  --review-soft: #DCEBE2;
  --danger: #97402F;
  --danger-soft: #F3DAD2;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", "PT Serif", Georgia, serif;

  /* Radii / shadow */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 18px;
  --shadow-card: 0 1px 2px rgba(20, 24, 18, 0.05), 0 2px 8px rgba(20, 24, 18, 0.06);
  --shadow-hover: 0 2px 6px rgba(20, 24, 18, 0.08), 0 10px 26px rgba(20, 24, 18, 0.12);
  --shadow-pop: 0 1px 1px rgba(20, 24, 18, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1, "cv11" 1;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }

/* ──────────────────────────────────────────────────────────── */
/* Canvas container                                              */
/* ──────────────────────────────────────────────────────────── */

#root {
  width: 100vw;
  min-height: 100vh;
}

.provisioning-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: 32px;
  background: var(--bg);
}
.provisioning-shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.provisioning-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.provisioning-panel h1 {
  margin: 8px 0 10px;
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 0.98;
  font-weight: 400;
}
.provisioning-panel p {
  margin: 0;
  color: var(--ink-3);
  line-height: 1.55;
}
.provisioning-panel__detail {
  margin-top: 12px !important;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.provisioning-panel__actions {
  margin-top: 18px;
}

/* Override design-canvas chrome to match the editorial vibe */
.dc-shell { background: #EFEFEA !important; }

/* ──────────────────────────────────────────────────────────── */
/* Reusable utility primitives                                  */
/* ──────────────────────────────────────────────────────────── */

.mono { font-family: var(--font-mono); font-feature-settings: "ss01" 1; }
.serif { font-family: var(--font-serif); }
.tnum { font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.hr { height: 1px; background: var(--line); width: 100%; }

/* Pulse animation for "running" indicators */
@keyframes lw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.78); }
}

@keyframes lw-spin {
  to { transform: rotate(360deg); }
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  vertical-align: middle;
}
.dot--running { background: var(--running); animation: lw-pulse 1.6s ease-in-out infinite; }
.dot--attention { background: var(--attention); }
.dot--review { background: var(--review); }
.dot--idle { background: var(--idle); }
.dot--danger { background: var(--danger); }

/* Status chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--idle-soft);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--running { background: var(--running-soft); color: var(--running); }
.chip--attention { background: var(--attention-soft); color: var(--attention); }
.chip--review { background: var(--review-soft); color: var(--review); }
.chip--idle { background: var(--idle-soft); color: var(--ink-3); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--ghost { background: transparent; color: var(--ink-3); padding-left: 0; padding-right: 0; }

.connector-account { gap: 10px; }
.connector-account--attention { border-color: rgba(168, 106, 31, 0.28); background: #fffdfa; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-1);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--bg-tint); border-color: var(--ink-4); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-pop); }
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-pop); }
.btn--accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); padding-left: 6px; padding-right: 6px; }
.btn--ghost:hover { background: var(--bg-tint); color: var(--ink); }
.btn--danger:hover { color: var(--danger); border-color: var(--danger); background: #fff; }
.btn--sm { padding: 5px 9px; font-size: 12px; }
.btn--xs { padding: 3px 7px; font-size: 11.5px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-card);
}
.card--flat { box-shadow: none; }
.card--tinted { background: var(--bg-tint); }

.activity-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.activity-row:last-child { border-bottom: 0; }
.activity-row:not(:disabled):hover .activity-row__title { color: var(--accent-ink); }
.activity-row:disabled { cursor: default; }
.activity-row__body { min-width: 0; }
.activity-row__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: uppercase;
}
.activity-row__title {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.activity-row__detail {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}
.activity-row__meta {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0;
}
.activity-row__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.activity-row__icon {
  width: 14px;
  height: 14px;
}


.bounded-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.bounded-list__scroll {
  max-height: min(62vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
.bounded-list__scroll:focus-visible {
  outline: 2px solid rgba(42, 107, 93, 0.32);
  outline-offset: 2px;
}
.bounded-list__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px 0;
  border-top: 1px solid var(--line-soft);
}
.bounded-list__count {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
}
.activity-list {
  padding: 16px;
}
.schedule-history .bounded-list { gap: 8px; }
.schedule-history .bounded-list__footer { padding-top: 8px; }
.schedule-history .bounded-list__scroll { max-height: min(42vh, 360px); }
/* Headings */
.h-display {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}
.h-section {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}
.h-card {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

/* ──────────────────────────────────────────────────────────── */
/* Desktop dashboard layout                                      */
/* ──────────────────────────────────────────────────────────── */

.app {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: 100%;
  overflow: hidden;
}

.loading-gate {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 28px;
  text-align: center;
}
.loading-gate__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: lw-spin 800ms linear infinite;
}
.loading-gate__label {
  font-size: 14px;
  font-weight: 500;
}
.loading-gate__detail {
  max-width: 340px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.app--onboarding-gate {
  grid-template-columns: minmax(0, 1fr);
}
.onboarding-gate__main {
  width: 100%;
}
.onboarding-gate__head {
  align-items: center;
}
.onboarding-gate__section {
  padding-bottom: 36px;
}
.onboarding-gate__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  max-width: none;
}
.onboarding-gate__wizard {
  min-width: 0;
}
.onboarding-gate__aside {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.onboarding-gate__note {
  padding: 16px;
}
.onboarding-gate__note h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.onboarding-gate__note p {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.onboarding-gate__note p:last-child {
  margin-bottom: 0;
}

/* Sidebar */
.sidebar {
  background: #F6F6F1;
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 6px;
}
.sidebar__brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1;
}
.sidebar__brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.sidebar__brand-suffix {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: auto;
}

.sidebar__workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.sidebar__workspace-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #2E2C28;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.sidebar__workspace-name {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__workspace-meta {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.sidebar__workspace-caret { margin-left: auto; color: var(--ink-4); }

.agent-avatar-fallback {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #2E2C28;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar__nav-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-1);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: rgba(14, 15, 12, 0.06); color: var(--ink); }
.nav-item--active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.nav-item--active .nav-item__icon { color: var(--accent); }
.nav-item__icon { color: var(--ink-3); width: 16px; height: 16px; flex-shrink: 0; }
.nav-item__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--bg-tint);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.nav-item--active .nav-item__count { background: var(--accent); color: #fff; border-color: var(--accent); }

.sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar__usage {
  padding: 10px 10px 12px;
  border-radius: var(--r-2);
  background: #fff;
  border: 1px solid var(--line);
}
.sidebar__usage-row { display: flex; align-items: baseline; gap: 4px; }
.sidebar__usage-row .num { font-family: var(--font-mono); font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.sidebar__usage-row .denom { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-4); }
.sidebar__usage-bar {
  height: 4px;
  background: var(--bg-sunken);
  border-radius: 999px;
  margin: 8px 0 4px;
  overflow: hidden;
}
.sidebar__usage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2D6C56);
  border-radius: 999px;
}
.sidebar__usage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.sidebar__usage-foot .denom {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar__topup {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg-tint);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 7px;
}
.sidebar__topup:hover {
  border-color: var(--line-strong);
  background: #fff;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
}
.sidebar__user-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4B68A, #A8845C);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
}

/* Main area */
.main {
  min-height: 0;
  overflow-y: auto;
  background: var(--bg);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 4;
}
.topbar__crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.topbar__crumb b { color: var(--ink); font-weight: 500; }
.topbar__crumb svg { color: var(--ink-4); }

/* Read-only workspace status chip - deliberately not styled like an input. */
.topbar__status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-3);
  font-size: 12px;
}
.topbar__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7BA88F;
}
.topbar__status-dot--busy { background: #C9A24B; }
.topbar__status-state {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__auth {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 34px;
}
.topbar__auth .lw-clerk-user-button,
.mk-nav__cta .lw-clerk-user-button {
  display: flex;
  align-items: center;
}

/* Page header */
.page-head {
  padding: 26px 28px 18px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.page-head__intro { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-head__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head__title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}
.page-head__sub {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 560px;
}
.page-head__pulse {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-elev);
  box-shadow: var(--shadow-card);
}
.pulse-stat { min-width: 74px; display: flex; flex-direction: column; gap: 2px; }
.pulse-stat .num { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.pulse-stat .lbl { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.pulse-divider { width: 1px; height: 26px; background: var(--line); }

/* ──────────────────────────────────────────────────────────── */
/* Hero: agent team status                                       */
/* ──────────────────────────────────────────────────────────── */

.section {
  padding: 28px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section--tight { padding-top: 18px; }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  justify-content: space-between;
}
.section__head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-weight: 600;
  margin: 0;
}
.section__head h2::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.section__head .actions { display: flex; align-items: center; gap: 6px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 10px;
}

.agent-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  cursor: pointer;
}
.agent-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.agent-card__row { display: flex; align-items: center; gap: 10px; }
.agent-card__avatar { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-tint); }
.agent-card__id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.agent-card__name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.2; }
.agent-card__role { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); }
.agent-card__status { margin-left: auto; }
.agent-card__fact {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg-tint);
  padding: 8px 10px;
}
.agent-card__fact p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}
.agent-card__activity {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 2px 0 0;
  letter-spacing: -0.003em;
  text-wrap: pretty;
}
.agent-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.agent-card__meta .sep { color: var(--ink-5); }
.agent-card__contribution {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.agent-card__contribution > div {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
  padding: 8px;
  min-width: 0;
}
.agent-card__contribution p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
}

/* Briefing card (alt hero) */
.briefing {
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #FBFBF7 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: stretch;
}
.briefing__body { display: flex; flex-direction: column; gap: 12px; }
.briefing__lede {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.briefing__lede em { font-style: italic; color: var(--accent); }
.briefing__bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.briefing__bullets li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 9px;
  align-items: baseline;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.briefing__bullets li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  display: block;
  margin-top: 7px;
}
.briefing__side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
}
.briefing__side .label { margin-bottom: 0; }
.mini-bars { display: flex; flex-direction: column; gap: 6px; }
.mini-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.mini-bar__label { width: 78px; color: var(--ink-3); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.mini-bar__track { flex: 1; height: 3px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; }
.mini-bar__fill { display: block; height: 100%; background: var(--ink-2); }
.mini-bar__fill--accent { background: var(--accent); }
.mini-bar__fill--attention { background: var(--attention); }
.mini-bar__value { width: 28px; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--ink); }

/* Ticker (alt hero) */
.ticker {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.ticker__avatars { display: flex; }
.ticker__avatars > * { margin-left: -8px; border: 2px solid #fff; border-radius: 8px; }
.ticker__avatars > *:first-child { margin-left: 0; }
.ticker__body { flex: 1; }
.ticker__body .who { font-size: 13px; color: var(--ink-3); font-family: var(--font-mono); }
.ticker__body .what {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 4px;
  color: var(--ink);
}
.ticker__rhs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ticker__rhs .big { font-family: var(--font-serif); font-size: 26px; color: var(--ink); text-transform: none; letter-spacing: -0.01em; }

/* ──────────────────────────────────────────────────────────── */
/* Attention queue                                               */
/* ──────────────────────────────────────────────────────────── */

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.attn-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
  position: relative;
}
.attn-row:last-child { border-bottom: 0; }
.attn-row__kind { display: flex; flex-direction: column; gap: 6px; }
.attn-row__kind .label { margin: 0; }
.attn-row__body { min-width: 0; }
.attn-row__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin: 0 0 4px;
  color: var(--ink);
  text-wrap: pretty;
}
.attn-row__detail {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}
.attn-row__byline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.attn-row__byline-av { width: 18px; height: 18px; border-radius: 4px; overflow: hidden; }
.attn-row__actions { display: flex; align-items: center; gap: 6px; }

/* Preview body inside expanded attention row */
.attn-row__preview {
  grid-column: 2 / -1;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.attn-row__preview pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 72ch;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.attn-row__preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ──────────────────────────────────────────────────────────── */
/* Two-column work area                                          */
/* ──────────────────────────────────────────────────────────── */

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 22px;
  padding: 28px 28px 60px;
}
.work-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }

.work-col { display: flex; flex-direction: column; gap: 26px; min-width: 0; }

/* Approval cards (vertical list) */
.approvals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(600px, 100%), 1fr));
  gap: 12px;
  align-items: start;
}
.approval-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.focus-card {
  border-color: rgba(168, 106, 31, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(168, 106, 31, 0.14), var(--shadow-card);
}
.approval-card__head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  align-items: center;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background 120ms ease;
}
.approval-card__head:hover { background: var(--bg-tint); }
.approval-card__head:focus-visible {
  outline: 2px solid rgba(42, 107, 93, 0.32);
  outline-offset: -2px;
}
.approval-card--open .approval-card__head { border-bottom-color: var(--line); }
.approval-card__chev { color: var(--ink-4); transition: transform 150ms ease; }
.approval-card--open .approval-card__chev { transform: rotate(90deg); }
.approval-card__title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
.approval-card__sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); }
.approval-card__sub .dot-sep { color: var(--ink-5); }
.approval-card__status { display: flex; align-items: center; gap: 8px; }
.approval-card__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: var(--r-1);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}
.approval-card__body { padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 14px; background: #FCFCF9; }
.approval-card__draft {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  text-wrap: pretty;
  max-height: 280px;
  overflow: auto;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 rgba(14, 15, 12, 0.03);
}
.approval-card__draft--bounded {
  max-height: min(52vh, 440px);
  overscroll-behavior: contain;
}
.approval-card__draft:focus-visible {
  outline: 2px solid rgba(42, 107, 93, 0.28);
  outline-offset: 2px;
}
.approval-card__lifecycle-note,
.approval-card__disabled-note {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.approval-card__disabled-note {
  padding: 9px 11px;
  border: 1px solid rgba(168, 106, 31, 0.22);
  border-radius: var(--r-1);
  background: var(--attention-soft);
  color: #69410f;
}
.approval-card__draft .greet, .approval-card__draft .signoff { color: var(--ink-2); }
.approval-card__thread {
  display: grid;
  gap: 8px;
}
.approval-card__turn {
  max-width: 880px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.72);
}
.approval-card__turn--note {
  margin-left: 28px;
  border-left-color: var(--line-strong);
  background: transparent;
}
.approval-card__speaker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.approval-card__turn p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.approval-card__turn p + p { margin-top: 4px; }
.approval-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.approval-card__context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: #fff;
}
.approval-card__context .cell {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}
.approval-card__context .cell:last-child { border-right: 0; }
.approval-card__context .cell .label { display: block; margin-bottom: 3px; }
.approval-card__context .cell .val { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.approval-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.approval-card__actions .left { display: flex; gap: 6px; flex-wrap: wrap; }
.approval-card__actions .right { margin-left: auto; display: flex; gap: 6px; }

.attention-explain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: #FCFCF9;
}
.attention-explain > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}
.attention-explain > div:last-child { border-right: 0; }
.attention-explain__label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.attention-explain p {
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.45;
}
/* W1 (2026-07-24): the "what triggered this" row sits above the explain grid and is inset
   by the same 16px as the grid and the draft preview, so nothing touches the card border. */
.attention-trigger {
  margin: 0 16px 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-tint);
}
.attention-trigger__label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.attention-trigger p {
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Billing — design styles live in page-styles.css (re-introduced from the original design file). */

/* Activity timeline */
.timeline {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.timeline__row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  font-size: 13px;
  line-height: 1.4;
}
.timeline__row:last-child { border-bottom: 0; }
.timeline__icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: var(--bg-tint);
  color: var(--ink-3);
  flex-shrink: 0;
}
.timeline__icon--approved { background: var(--review-soft); color: var(--review); }
.timeline__icon--attention { background: var(--attention-soft); color: var(--attention); }
.timeline__icon--draft { background: var(--running-soft); color: var(--running); }
.timeline__icon--sent { background: var(--bg-tint); color: var(--ink); }
.timeline__icon--signal { background: var(--idle-soft); color: var(--ink-3); }
.timeline__body { min-width: 0; }
.timeline__title { color: var(--ink); font-size: 13px; line-height: 1.4; }
.timeline__meta { color: var(--ink-4); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* Work context */
/* work-row context styles live in page-styles.css (.work-row__ctx) */

/* Quick draft card */
.quick {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick__label { display: flex; align-items: center; gap: 8px; }
.quick__row { display: flex; gap: 8px; }
.quick__input {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.quick__input input {
  flex: 1 1 180px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 8px 11px;
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: border-color 120ms ease;
}
.quick__input input:focus { border-color: var(--ink-3); }
.quick__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.quick__chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.quick__chip:hover { background: var(--bg-tint); }
.quick__chip--active { background: var(--ink); color: #fff; border-color: var(--ink); }

.mini-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.today-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
/* D-b / P1-2: the tile grid used to be a second column - `minmax(0, 1.25fr)
   minmax(240px, 0.75fr)`. Inside the narrow right-hand `work-col` on Tasks that
   resolved to a 149px text column against a fixed 240px of tiles, so the status
   sentence, the runner line and the capacity line each wrapped into a ribbon and read
   as clipped mid-word ("AN AI RUN FAILED AND NEE...").

   This is not a missing breakpoint. The panel is narrow while the viewport is wide, so
   none of the app's breakpoints (1100/1020/820/760/720/640) ever fire - the one rule
   that already fixed it, `@media (max-width: 720px)`, was unreachable on a desktop.
   The tiles are now a sibling row in the normal flow at every width, and they size
   themselves against the width they actually have. */
.today-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  container-type: inline-size;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.today-status--attention { border-color: rgba(168, 106, 31, 0.28); background: #fffdfa; }
.today-status--clear { border-color: rgba(31, 77, 60, 0.2); background: #fbfdfb; }
.today-status__notice {
  padding: 9px 11px;
  border: 1px solid rgba(168, 106, 31, 0.32);
  border-radius: 7px;
  background: #fff8ef;
  font-size: 13px;
  line-height: 1.4;
}
.today-status__notice p { font-size: 12px; }
.advanced-disclosure {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.advanced-disclosure > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-3);
  list-style: none;
}
.advanced-disclosure > summary::-webkit-details-marker { display: none; }
.advanced-disclosure > summary::before { content: "\25b8 "; }
.advanced-disclosure[open] > summary::before { content: "\25be "; }
.advanced-disclosure--section { margin-top: 16px; }
.autonomy-caps__field--plain small { display: block; margin-top: 3px; font-size: 11.5px; }
.assistant-card__reason {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #fff8ef;
  border: 1px solid rgba(168, 106, 31, 0.24);
  font-size: 12.5px;
  line-height: 1.4;
}
.today-status__primary,
.today-status__sources,
.today-status__no-work,
.today-status__next {
  min-width: 0;
}
.today-status__primary {
  display: grid;
  align-content: start;
  gap: 7px;
}
.today-status__state,
.today-status__checked,
.today-status__mini-head,
.today-status__source-row,
.today-status__next {
  display: flex;
  align-items: center;
  gap: 8px;
}
.today-status__state,
.today-status__checked,
.today-status__mini-head {
  flex-wrap: wrap;
}
.today-status h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 650;
}
.today-status p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.today-status__checked {
  color: var(--ink-3);
  font-size: 11.5px;
}
.today-status__queue {
  display: grid;
  /* 2x2 is the floor, and it is what the narrow Tasks column gets. The container query
     below widens it to a single row on Today. Sizing against the panel rather than the
     viewport is the whole point of P1-2: the panel is narrow while the window is wide,
     which is why no viewport breakpoint could ever have caught this. A browser without
     container queries keeps the 2x2 floor, which is correct, just not as wide. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
@container (min-width: 600px) {
  .today-status__queue { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.today-status__queue-item {
  appearance: none;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-tint);
  color: var(--ink);
  text-align: left;
}
.today-status__queue-item:hover {
  border-color: var(--line-strong);
  background: #fff;
}
.today-status__queue-item--attention {
  border-color: rgba(168, 106, 31, 0.26);
  background: var(--attention-soft);
}
.today-status__queue-item strong {
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
}
.today-status__queue-item span {
  min-width: 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.today-status__sources,
.today-status__no-work,
.today-status__next {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.today-status__sources {
  display: grid;
  gap: 7px;
}
.today-status__mini-head {
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 11.5px;
}
.today-status__source-row {
  justify-content: space-between;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
}
.today-status__source-row span,
.today-status__source-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.today-status__source-row span {
  font-size: 12.5px;
  font-weight: 600;
}
.today-status__source-row small {
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: right;
}
.today-status__no-work {
  display: grid;
  gap: 4px;
}
.today-status__next {
  justify-content: space-between;
  align-items: flex-start;
}
.today-status__next > div {
  min-width: 0;
}
.today-status__next .btn {
  flex: 0 0 auto;
}
.today-work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.today-work-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.today-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.today-card--attention { border-color: rgba(168, 106, 31, 0.25); background: #fffdfa; }
.today-card--review { border-color: rgba(31, 77, 60, 0.22); background: #fbfdfb; }
.today-card__main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.today-card__value {
  min-width: 34px;
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
}
.today-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}
.today-card p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.today-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}
.today-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.today-column__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.today-column__head h3 {
  margin: 0;
  font-size: 14px;
}
.approvals--compact { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stack { display: grid; gap: 10px; }
.approval-card__body textarea,
.approval-card__body input[type="email"],
.agent-card input,
.agent-card textarea,
.onboarding__field textarea,
.onboarding__field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
.approval-card__recipient {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
}
.approval-card__recipient small { font-size: 11.5px; line-height: 1.4; }
.onboarding__field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .onboarding-gate__content { grid-template-columns: minmax(0, 1fr); }
  .onboarding-gate__aside { grid-template-columns: minmax(0, 1fr); }
  .onboarding-gate__head { align-items: flex-start; }
  .approval-card__head { grid-template-columns: 22px minmax(0, 1fr); }
  .approval-card__toggle { grid-column: 2; justify-content: flex-start; padding-left: 0; }
  .approval-card__draft--bounded { max-height: min(58vh, 360px); }
  .attention-explain { grid-template-columns: minmax(0, 1fr); }
  .attention-explain > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .attention-explain > div:last-child { border-bottom: 0; }
  .approval-card__context { grid-template-columns: minmax(0, 1fr); }
  .approval-card__context .cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .approval-card__context .cell:last-child { border-bottom: 0; }
  .approval-card__actions .right { margin-left: 0; flex-wrap: wrap; }
  .billing-grid,
  .billing-plan-grid,
  .billing-usage-grid,
  .billing-topups,
  .billing-facts { grid-template-columns: minmax(0, 1fr); }
  .billing-card__head,
  .billing-plan__top { flex-direction: column; }
  .agent-card__contribution { grid-template-columns: minmax(0, 1fr); }
  /* D-b: `.today-status` is single-column at every width now and `.today-status__queue`
     is 2x2 until its own container is wide enough, so neither needs a phone override. */
  .today-work-grid { grid-template-columns: minmax(0, 1fr); }
  .today-status__next,
  .today-status__source-row { align-items: flex-start; }
  .today-status__source-row { flex-direction: column; gap: 2px; }
  .today-status__source-row small { text-align: left; }
  .today-status__next { flex-direction: column; }
  .today-card { flex-direction: column; }
  .today-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  html,
  body {
    min-height: 100%;
    height: auto;
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
    display: block;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
  }

  .sidebar__brand,
  .sidebar__nav,
  .nav-item {
    flex: 0 0 auto;
  }

  .sidebar__brand {
    padding: 0 8px 0 0;
  }

  .sidebar__brand-suffix,
  .sidebar__workspace,
  .sidebar__bottom,
  .sidebar__nav-section {
    display: none;
  }

  .sidebar__nav {
    flex-direction: row;
    gap: 4px;
  }

  .nav-item {
    min-height: 34px;
    white-space: nowrap;
  }

  .main {
    min-height: 0;
    overflow: visible;
  }

  .topbar {
    position: static;
    padding: 10px 16px;
    gap: 10px;
  }

  .topbar__crumb {
    min-width: 0;
    flex: 1;
  }

  .topbar__status {
    display: none;
  }

  .page-head,
  .page-head--page {
    padding: 20px 16px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .page-head__title,
  .page-head--page .page-head__title {
    font-size: 27px;
    line-height: 1.08;
  }

  .page-head__sub {
    max-width: none;
  }

  .page-head__pulse {
    width: 100%;
    gap: 10px;
  }

  .section {
    padding: 20px 16px 8px;
  }

  .work-grid,
  .work-grid--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    padding: 20px 16px 48px;
  }

  .approvals {
    grid-template-columns: minmax(0, 1fr);
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
  }
}

/* Sidebar widgets in right column */
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.side-card__title { font-size: 13.5px; font-weight: 600; }
.side-card hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }

/* Usage panel */
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.usage-grid .cell .label { display: block; margin-bottom: 4px; }
.usage-grid .cell .val { font-family: var(--font-mono); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.usage-grid .cell .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.usage-track {
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}
.usage-track > span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
}
.usage-track__mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: var(--ink-4);
}

/* Schedules / watch rules */
.rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rule:last-child { border-bottom: 0; }
.rule__name { font-size: 12.5px; }
.rule__meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.rule__switch {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--bg-sunken);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--line);
}
.rule__switch::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: left 150ms ease;
}
.rule__switch--on { background: var(--accent); border-color: var(--accent); }
.rule__switch--on::after { left: 13px; }

/* Profile completeness */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-bar__ring {
  --val: 78;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) calc(var(--val) * 1%), var(--bg-sunken) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.profile-bar__ring::after {
  content: "";
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
}
.profile-bar__ring span {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}
.profile-bar__ring { position: relative; }
.profile-bar__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-bar__title { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.profile-bar__sub { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

/* ──────────────────────────────────────────────────────────── */
/* Empty / dismiss states + animations                           */
/* ──────────────────────────────────────────────────────────── */

@keyframes lw-fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lw-fade-out { to { opacity: 0; transform: translateY(-2px); max-height: 0; padding: 0; margin: 0; border-width: 0; } }

.fade-in { animation: lw-fade-up 220ms ease-out both; }
.fade-out { animation: lw-fade-out 240ms ease forwards; overflow: hidden; }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Above the onboarding scan modal backdrop (z-index 60) - toasts are the
     topmost transient layer. */
  z-index: 70;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r-2);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(14,15,12,0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: lw-fade-up 200ms ease-out;
  pointer-events: auto;
}
.toast .undo {
  margin-left: 8px;
  color: #C9E4D5;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ──────────────────────────────────────────────────────────── */
/* Mobile viewport                                               */
/* ──────────────────────────────────────────────────────────── */

.mobile {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mobile__top {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.mobile__top .sidebar__brand-mark { width: 26px; height: 26px; }
.mobile__top h1 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.mobile__top .mob-sub { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.mobile__top .mob-spacer { flex: 1; }

.mobile__body { flex: 1; overflow-y: auto; padding-bottom: 64px; }

.mob-hero {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.mob-hero__eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mob-hero__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}
.mob-hero__sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin-top: 6px; }
.mob-pulse { display: flex; gap: 14px; margin-top: 12px; }
.mob-pulse .ps { display: flex; flex-direction: column; gap: 1px; }
.mob-pulse .ps .num { font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.mob-pulse .ps .lbl { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }

.mob-section { padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 10px; }
.mob-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mob-section__head h2 {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0;
}

.mob-agents {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 0 18px 6px;
  scrollbar-width: none;
}
.mob-agents::-webkit-scrollbar { display: none; }
.mob-agent {
  flex: 0 0 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-agent__row { display: flex; align-items: center; gap: 8px; }
.mob-agent__row .agent-card__avatar { width: 30px; height: 30px; border-radius: 7px; }
.mob-agent__activity { font-size: 12px; color: var(--ink-2); line-height: 1.4; }

.mob-attn { display: flex; flex-direction: column; gap: 8px; }
.mob-attn__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mob-attn__title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
.mob-attn__detail { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.mob-attn__actions { display: flex; gap: 6px; margin-top: 4px; }

.mob-quick {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mob-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.mob-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink-3);
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.mob-nav__item--active { color: var(--ink); }

/* Tweaks-specific scoped tweaks */
.app[data-hero="briefing"] .agent-card { }
.app[data-bylines="hidden"] .attn-row__byline { display: none; }
.app[data-bylines="hidden"] .approval-card__sub .byline-name { display: none; }
.app[data-bylines="hidden"] .agent-card__role { opacity: 0.6; }

/* "Invisible agents" — even hide the team hero */
.app[data-bylines="hidden"] .hero-team { display: none; }

/* Prominent bylines — show avatar in approval head */
.app[data-bylines="prominent"] .approval-card__head { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
.app[data-bylines="prominent"] .approval-card__head .byline-av { display: block; }
.byline-av { display: none; width: 26px; height: 26px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }

/* Mobile shell (design-bundle port, M20): full-viewport layout, real tab
   buttons, and actionable nav badges. */
.mobile {
  position: relative;
  height: 100vh;
  height: 100dvh;
}
.mobile__body { padding: 0 14px; }
.mobile__body .mob-section { padding: 14px 0 0; }
button.mob-nav__item {
  border: none;
  background: transparent;
  padding: 0;
  position: relative;
  height: 100%;
}
.mob-nav__badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 22px);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 8.5px;
  line-height: 1.3;
  padding: 1px 5px;
  font-family: var(--font-mono);
}
