/* AdsCommand dashboard — warm monochrome, flat, 1px borders, no shadows.
 *
 * Colour carries meaning here and nothing else: the only hues in the interface
 * are the four status tones (critical / warning / info / good) and one chart
 * ink. Everything structural is warm greyscale, so a red dot on this page
 * always means "someone needs to look at this" rather than "this is a heading".
 */

:root {
  --canvas: #fbfbfa;
  --surface: #ffffff;
  --surface-sunk: #f6f5f2;
  --ink: #1a1a18;
  --ink-soft: #4a4945;
  --ink-muted: #7c7a74;
  --line: #e8e7e3;
  --line-strong: #d8d6d0;

  --critical-bg: #fdebec;
  --critical-fg: #9f2f2d;
  --warning-bg: #fbf3db;
  --warning-fg: #8a5a00;
  --info-bg: #e1f3fe;
  --info-fg: #1f6c9f;
  --good-bg: #edf3ec;
  --good-fg: #346538;

  --chart-ink: #3f6d8c;
  --chart-fill: rgba(63, 109, 140, 0.1);
  --chart-grid: #eceae5;

  --radius: 8px;
  --radius-sm: 5px;

  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", "Consolas", ui-monospace, monospace;

  --topbar-h: 56px;
  --nav-w: 208px;
}

:root[data-theme="dark"] {
  --canvas: #141412;
  --surface: #1c1c1a;
  --surface-sunk: #232320;
  --ink: #ecebe7;
  --ink-soft: #c3c1ba;
  --ink-muted: #8d8b84;
  --line: #2e2e2a;
  --line-strong: #3d3c37;

  --critical-bg: #3a1f1f;
  --critical-fg: #f0a9a4;
  --warning-bg: #362c15;
  --warning-fg: #e5c176;
  --info-bg: #17303f;
  --info-fg: #92c9ea;
  --good-bg: #1d2c1f;
  --good-fg: #9ac79e;

  --chart-ink: #7fb0d0;
  --chart-fill: rgba(127, 176, 208, 0.12);
  --chart-grid: #2a2a26;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--ink);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--canvas);
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.sidenav {
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

.sidenav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  transition: background 140ms ease, color 140ms ease;
}
.sidenav__item:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}
.sidenav__item[aria-current="page"] {
  background: var(--surface-sunk);
  color: var(--ink);
  font-weight: 550;
}

.sidenav__count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
}
.sidenav__count[data-alert="true"] {
  color: var(--critical-fg);
}

.sidenav__foot {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.view {
  padding: 28px 32px 72px;
  max-width: 1240px;
  outline: none;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidenav {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidenav__foot {
    display: none;
  }
  .view {
    padding: 20px 16px 60px;
  }
}

/* ---------------------------------------------------------------- type */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-sub {
  color: var(--ink-muted);
  margin-top: 4px;
  max-width: 68ch;
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.micro {
  font-size: 12px;
  color: var(--ink-muted);
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.muted {
  color: var(--ink-muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.card__body {
  padding: 16px 20px;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1040px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* stat tiles ----------------------------------------------------------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 104px;
}

.stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
}

.stat__value {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat__value--alert {
  color: var(--critical-fg);
}

.stat__note {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: auto;
}

.stat--link:hover {
  border-color: var(--line-strong);
}

/* ---------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9999px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--quiet {
  background: var(--surface-sunk);
  color: var(--ink-muted);
  border: 1px solid var(--line);
}
.chip--critical {
  background: var(--critical-bg);
  color: var(--critical-fg);
}
.chip--warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}
.chip--info {
  background: var(--info-bg);
  color: var(--info-fg);
}
.chip--good,
.chip--ok,
.chip--success {
  background: var(--good-bg);
  color: var(--good-fg);
}
.chip--dormant {
  background: var(--surface-sunk);
  color: var(--ink-muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--ink-muted);
}
.dot--critical {
  background: #c0413d;
}
.dot--warning {
  background: #c99a2e;
}
.dot--ok,
.dot--good {
  background: #4f8c55;
}
.dot--info {
  background: #3f80ab;
}
.dot--dormant {
  background: var(--line-strong);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 100ms ease;
}
.btn:hover {
  background: var(--surface-sunk);
}
.btn:active {
  transform: scale(0.985);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
}
.btn--primary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}
.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}
.btn--ghost:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}
.btn--icon {
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
}
.btn--icon:hover {
  background: var(--surface-sunk);
}
.btn--small {
  padding: 3px 9px;
  font-size: 12px;
}
.btn--danger:hover {
  background: var(--critical-bg);
  border-color: var(--critical-bg);
  color: var(--critical-fg);
}

kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-sunk);
  padding: 1px 4px;
  color: var(--ink-muted);
}

.banner {
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.banner--critical {
  background: var(--critical-bg);
  color: var(--critical-fg);
}
.banner--warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

/* Showcase stack only: pinned to the bottom so it shows on every view and on
   the sign-in screen, which covers everything else. */
.showcase-strip {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 95;
  margin: 0;
  padding: 5px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--warning-bg);
  color: var(--warning-fg);
  pointer-events: none;
}
.showcase-strip[hidden] {
  display: none;
}
body:has(.showcase-strip:not([hidden])) {
  padding-bottom: 28px;
}

/* ---------------------------------------------------------------- inputs */

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--chart-ink);
  outline-offset: 1px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-muted);
}
.segmented button + button {
  border-left: 1px solid var(--line);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface-sunk);
  color: var(--ink);
  font-weight: 550;
}

/* ---------------------------------------------------------------- tables */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr.clickable {
  cursor: pointer;
}
table.data tbody tr.clickable:hover {
  background: var(--surface-sunk);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.delta--up {
  color: var(--good-fg);
}
.delta--down {
  color: var(--critical-fg);
}

/* ---------------------------------------------------------------- lists */

.attention {
  display: flex;
  flex-direction: column;
}

.attention__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
.attention__item:last-child {
  border-bottom: 0;
}
.attention__item:hover {
  background: var(--surface-sunk);
}

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

.attention__title {
  font-weight: 550;
}

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-muted);
}

.loading {
  padding: 40px 0;
  color: var(--ink-muted);
}

/* expandable review rows ------------------------------------------------ */

.review {
  border-bottom: 1px solid var(--line);
}
.review:last-child {
  border-bottom: 0;
}

.review__head {
  display: grid;
  grid-template-columns: 22px minmax(0, 2.4fr) minmax(0, 1fr) 110px 132px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
}
.review__head:hover {
  background: var(--surface-sunk);
}
@media (max-width: 860px) {
  .review__head {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .review__head > .review__hide {
    display: none;
  }
}

.review__subject {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review__meta {
  color: var(--ink-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review__detail {
  padding: 4px 18px 20px 52px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  border-top: 1px dashed var(--line);
}
@media (max-width: 860px) {
  .review__detail {
    grid-template-columns: 1fr;
    padding-left: 18px;
  }
}

.rationale {
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink-soft);
}

.kv {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 6px 14px;
  font-size: 13px;
}
.kv dt {
  color: var(--ink-muted);
  /* Setting keys and secret names are long and unbreakable; without this they
     run under the value column. */
  overflow-wrap: anywhere;
}
.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* Sentences, not values — monospace makes prose harder to read, not more
   precise. */
.kv--prose dd {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- agents */

.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.agent-card__no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.agent-card__name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.agent-card__purpose {
  color: var(--ink-soft);
}

.agent-card__facts {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
}

.agent-card--planned {
  background: transparent;
  border-style: dashed;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 2px;
}

.runlog {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.runlog__line {
  display: flex;
  gap: 10px;
  color: var(--ink-soft);
}
.runlog__time {
  color: var(--ink-muted);
  flex: none;
}

.spinner {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--ink);
  display: inline-block;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- charts */

.chart {
  width: 100%;
  height: 190px;
  display: block;
}

.chart__tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
  transform: translate(-50%, -120%);
  z-index: 5;
}

.chart-wrap {
  position: relative;
}

.sparkline {
  width: 96px;
  height: 24px;
  display: block;
}

/* ---------------------------------------------------------------- palette */

.palette[hidden] {
  display: none;
}

.palette {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 18, 0.32);
}

.palette__panel {
  position: relative;
  width: min(760px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.palette__input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 15px 18px;
  font-family: var(--mono);
  font-size: 14px;
  background: transparent;
}
.palette__input:focus-visible {
  outline: none;
}

.palette__body {
  max-height: 56vh;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

.console-out {
  display: grid;
  gap: 14px;
}

.console-entry {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.console-entry:last-child {
  border-bottom: 0;
}

.console-cmd {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.console-cmd::before {
  content: "› ";
}

.console-text {
  font-size: 13px;
}
.console-text--error {
  color: var(--critical-fg);
}
.console-text--success {
  color: var(--good-fg);
}
.console-text--muted,
.console-text--plain + .console-text--muted {
  color: var(--ink-muted);
  font-size: 12.5px;
}

table.console-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
table.console-table th {
  text-align: left;
  color: var(--ink-muted);
  font-weight: 500;
  padding: 4px 10px 4px 0;
  border-bottom: 1px solid var(--line);
}
table.console-table td {
  padding: 3px 10px 3px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: grid;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  animation: rise 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast--success {
  border-left-color: var(--good-fg);
}
.toast--error {
  border-left-color: var(--critical-fg);
}
.toast--info {
  border-left-color: var(--info-fg);
}

/* ---------------------------------------------------------------- misc */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1040px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.bar {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-sunk);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  background: var(--chart-ink);
}

/* Pacing bar: the bar is the month's budget, the fill is what has been spent,
   and the tick is where the calendar says spending should have reached by now.
   Fill past the tick means the account is running hot. Showing the tick rather
   than only a percentage is the whole point — "62% spent" reads fine until you
   notice it is the 12th. */
.pace {
  position: relative;
  min-width: 120px;
}
.pace .bar {
  height: 8px;
  border-radius: 4px;
}
.pace__fill {
  height: 100%;
  background: var(--chart-ink);
  transition: width 240ms ease;
}
.pace__fill--warning {
  background: var(--warning-fg);
}
.pace__fill--critical {
  background: var(--critical-fg);
}
.pace__mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--ink);
  opacity: 0.55;
}
.pace__over {
  position: absolute;
  top: -3px;
  right: -2px;
  width: 2px;
  height: 14px;
  background: var(--critical-fg);
}
.pace__legend {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  color: var(--ink-soft);
  background: var(--surface-sunk);
}
.tag--off {
  color: var(--ink-muted);
  background: transparent;
  border-style: dashed;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.fade-in {
  animation: fade 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------------------------------------------------------------- gate */

/* Opaque and above everything, including the command palette and the toasts:
   while the gate is up there is no session, so nothing behind it is meaningful
   and nothing on top of it should be either. */
.gate[hidden] {
  display: none;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

body.gated {
  overflow: hidden;
}

.gate__panel {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  animation: rise 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gate__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.gate__title {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.gate__lede {
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 20px;
}

.gate__notice {
  background: var(--info-bg);
  color: var(--info-fg);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.gate__error {
  background: var(--critical-bg);
  color: var(--critical-fg);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.gate__error[hidden] {
  display: none;
}

.gate__submit {
  width: 100%;
  justify-content: center;
  padding: 9px 12px;
}

.gate__foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- forms */

/* Long-form fields, where the hint under the input is the point: three of the
   onboarding fields are protections, and a protection nobody understands gets
   filled in wrong. */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

/* Inside a grid the gap already does the spacing; the margin would double it. */
.grid > .field {
  margin-bottom: 0;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field__hint {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.field input,
.field textarea,
.field select {
  width: 100%;
}

.field textarea {
  resize: vertical;
  font-size: 13px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
@media (max-width: 860px) {
  .checks {
    grid-template-columns: 1fr;
  }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
}
.check:hover {
  background: var(--surface-sunk);
}

.check__name {
  display: block;
  font-weight: 550;
  font-size: 13px;
}

.check__note {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

/* An account already under management, or a manager node holding no campaigns.
   Dimmed rather than hidden — "it is not in the list" and "it cannot be picked
   again" are different answers to the same click. */
.acct--blocked {
  color: var(--ink-muted);
}
.acct--blocked td {
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- calculators */
.calc__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 12px 0;
}
.calc__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.calc__label {
  font-size: 12px;
  color: var(--muted-fg, #6b7280);
}
.calc__input {
  width: 100%;
}
.calc__result {
  margin-top: 6px;
  border-top: 1px solid var(--rule, #e5e7eb);
  padding-top: 10px;
}
.calc__grounded {
  margin-top: 8px;
}
@media (max-width: 640px) {
  .calc__fields {
    grid-template-columns: 1fr;
  }
}

/* audit score tones — reuse the alert red, add amber/green */
.stat__value--good { color: var(--good-fg, #15803d); }
.stat__value--warning { color: var(--warn-fg, #b45309); }
.stat__value--critical { color: var(--bad-fg, #b91c1c); }
