/* gravity admin — a quiet monochrome instrument.
   Warm paper ground, white card surfaces with hairline borders and soft
   shadows, ink as the only accent (gravity's brand is monochrome — the mark
   keeps the logo's own 25% ink alpha, never recolored). Color exists only as
   status semantics. Inter for UI, Space Grotesk for titles and figures,
   Geist Mono for labels and identifiers. */

:root {
  --paper: #f7f6f3;
  --surface: #fffffe;
  --ink: #191713;
  --soft: #6f6c64;
  --faint: #a6a29a;
  --rule: rgba(25, 23, 19, 0.08);
  --rule-strong: rgba(25, 23, 19, 0.16);
  --fill: #f1efeb;

  --mark-alpha: 0.25;

  /* status — functional color only */
  --ok: #257a50;
  --bad: #b3261e;
  --warn: #96650d;

  --panel: color-mix(in srgb, var(--ink) 2.5%, var(--surface));
  --bad-fill: color-mix(in srgb, var(--bad) 7%, var(--surface));

  --shadow-1: 0 1px 2px rgba(25, 23, 19, 0.04), 0 2px 6px rgba(25, 23, 19, 0.03);
  --shadow-btn: 0 1px 2px rgba(25, 23, 19, 0.05);

  --sans: "Inter", -apple-system, system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131210;
    --surface: #1c1b18;
    --ink: #ece9e2;
    --soft: #949087;
    --faint: #605d55;
    --rule: rgba(236, 233, 226, 0.08);
    --rule-strong: rgba(236, 233, 226, 0.16);
    --fill: #242320;
    --mark-alpha: 0.35;

    --ok: #5cb88d;
    --bad: #e97b71;
    --warn: #d4a34b;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="light"] {
  --paper: #f7f6f3; --surface: #fffffe; --ink: #191713; --soft: #6f6c64; --faint: #a6a29a;
  --rule: rgba(25, 23, 19, 0.08); --rule-strong: rgba(25, 23, 19, 0.16); --fill: #f1efeb;
  --mark-alpha: 0.25;
  --ok: #257a50; --bad: #b3261e; --warn: #96650d;
  --shadow-1: 0 1px 2px rgba(25, 23, 19, 0.04), 0 2px 6px rgba(25, 23, 19, 0.03);
  --shadow-btn: 0 1px 2px rgba(25, 23, 19, 0.05);
}
:root[data-theme="dark"] {
  --paper: #131210; --surface: #1c1b18; --ink: #ece9e2; --soft: #949087; --faint: #605d55;
  --rule: rgba(236, 233, 226, 0.08); --rule-strong: rgba(236, 233, 226, 0.16); --fill: #242320;
  --mark-alpha: 0.35;
  --ok: #5cb88d; --bad: #e97b71; --warn: #d4a34b;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 13.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

.ico { width: 15px; height: 15px; flex: none; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }

.logo { color: var(--ink); display: block; }
.logo .mark { fill: currentColor; opacity: var(--mark-alpha); }

/* ============================ shell ============================ */

.app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--rule);
  padding: 30px 16px 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* brand lockup — the suffix sits on the wordmark's baseline (the svg's
   baseline is ~80% down; the rest is the g/y descender) */
.brand { display: flex; align-items: flex-end; gap: 9px; padding: 0 10px; }
.brand .logo { height: 15px; width: auto; }
.brand .suffix {
  font: 600 9.5px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}

.nav { margin-top: 38px; display: flex; flex-direction: column; gap: 24px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group .glabel {
  font: 600 9.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px; margin-bottom: 7px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--soft);
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}
.nav a .ico { color: var(--faint); transition: color 0.12s ease; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav a:hover .ico { color: var(--soft); }
.nav a.active {
  color: var(--ink); font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-btn), inset 0 0 0 1px var(--rule);
}
.nav a.active .ico { color: var(--ink); }
.nav a .count {
  margin-left: auto;
  font: 600 11px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--bad);
}
.nav a .count.zero { display: none; }

.sidebar-foot { margin-top: auto; padding: 18px 10px 0; }
.sidebar-foot .mock-tag {
  font: 600 9.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 6px;
}
.sidebar-foot .who {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-foot .row { display: flex; align-items: center; margin-top: 8px; margin-left: -7px; }

.content { min-width: 0; }
.content-inner {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 40px var(--gutter) 110px;
}

/* one quiet moment: page content rises in, staggered */
.content-inner > * { animation: rise 0.4s cubic-bezier(0.2, 0, 0, 1) both; }
.content-inner > *:nth-child(2) { animation-delay: 0.04s; }
.content-inner > *:nth-child(3) { animation-delay: 0.08s; }
.content-inner > *:nth-child(4) { animation-delay: 0.12s; }
.content-inner > *:nth-child(5) { animation-delay: 0.16s; }
.content-inner > *:nth-child(n+6) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }

/* mobile: the sidebar folds into a header — brand + controls on one line,
   nav as a horizontally scrolling row beneath */
@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--rule);
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 16px var(--gutter) 0;
    background: none;
  }
  .brand { order: 1; padding: 0; }
  .sidebar-foot { order: 2; margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 8px; }
  .sidebar-foot .who, .sidebar-foot .mock-tag { display: none; }
  .sidebar-foot .row { margin: 0; }
  .nav {
    order: 3; width: 100%;
    flex-direction: row; gap: 20px;
    margin-top: 10px;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group { flex-direction: row; gap: 20px; }
  .nav-group .glabel { display: none; }
  .nav a { padding: 8px 0 10px; flex: none; background: none !important; box-shadow: none !important; }
  .nav a .ico { display: none; }
  .nav a .count { margin-left: 4px; position: relative; top: -5px; font-size: 10px; }
  .content-inner { padding-top: 28px; padding-bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .content-inner > * { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ============================ page scaffolding ============================ */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-head h1 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.page-head .sub { color: var(--soft); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }

h2.section-h {
  font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--soft);
  margin: 34px 0 12px 2px;
}

/* ============================ buttons ============================ */

.btn {
  font: 600 13px/1 var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 7px 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.btn:hover { background: var(--panel); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--paper)); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--rule-strong)); }
.btn.danger:hover { background: var(--bad-fill); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--soft); }
.btn.ghost:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.icon { background: transparent; border-color: transparent; box-shadow: none; padding: 7px; color: var(--soft); }
.btn.icon:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn .ico { width: 14px; height: 14px; }

/* ============================ status language ============================ */

/* status — dot with a soft halo + quiet sans label */
.status { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1.4 var(--sans); letter-spacing: 0.01em; color: var(--soft); white-space: nowrap; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 16%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 16%, transparent); }
.dot.stale { background: var(--faint); }
.dot.accent { background: var(--ink); }
.dot.off { background: transparent; border: 1px solid var(--faint); }
.s-ok { color: var(--ok); }
.s-bad { color: var(--bad); }
.s-warn { color: var(--warn); }
.s-stale { color: var(--faint); }

/* chips — small uppercase tags: tinted fill + matching hairline ring */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 10px/1 var(--sans); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--soft);
  background: var(--fill);
  border: none; border-radius: 5px;
  padding: 4px 7px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.chip.accent { color: var(--paper); background: var(--ink); box-shadow: none; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 25%, transparent); }
.chip.bad { color: var(--bad); background: var(--bad-fill); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 25%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 25%, transparent); }
.chip.solid { color: var(--paper); background: var(--ink); box-shadow: none; }

/* ============================ stat group card ============================ */
/* one card, hairline-divided cells: 1px grid gaps over a rule-colored ground */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  margin-bottom: 12px;
}
.tile {
  background: var(--surface);
  padding: 14px 16px 15px;
  min-width: 0;
}
.tile .label {
  font: 600 10px/1.3 var(--mono); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--soft);
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden;
}
.tile .label .ico { width: 13px; height: 13px; color: var(--faint); }
.tile .label span { overflow: hidden; text-overflow: ellipsis; }
.tile .fig {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 7px; color: var(--ink);
}
.tile .fig .unit { font-size: 13px; font-weight: 500; color: var(--faint); margin-left: 3px; letter-spacing: 0; }
.tile .meta { font-size: 11px; font-weight: 500; color: var(--faint); margin-top: 1px; }
.tile.problem .fig { color: var(--bad); }
.tile.problem .meta { color: var(--bad); }
.tile.problem .label .ico { color: var(--bad); }
.tile a.tile-link { text-decoration: none; display: block; margin: -14px -16px -15px; padding: 14px 16px 15px; }
.tile a.tile-link:hover { background: var(--panel); }

/* ============================ notices ============================ */

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  padding: 11px 14px;
  font-size: 13px; color: var(--soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
/* breathing room when notices stack against other cards */
.content-inner .callout { margin-bottom: 10px; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout a { margin-left: auto; font-weight: 500; white-space: nowrap; }
.callout .ico { color: var(--soft); }
.callout.warn .ico { color: var(--warn); }
.callout.bad .ico { color: var(--bad); }
/* dot fallback only when a callout carries no icon */
.callout.warn:not(:has(.ico))::before, .callout.bad:not(:has(.ico))::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
}
.callout.warn:not(:has(.ico))::before { background: var(--warn); }
.callout.bad:not(:has(.ico))::before { background: var(--bad); }

.err-box {
  background: var(--bad-fill);
  border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px; font-weight: 500; color: var(--bad);
}

/* ============================ tables — cards ============================ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  scrollbar-width: thin;
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
table th, table td {
  text-align: left; padding: 10px 16px; vertical-align: middle;
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}
thead th {
  background: var(--panel);
  font: 600 10px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--soft);
  padding-top: 9px; padding-bottom: 9px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 1.5%, transparent); }
td.num, th.num { text-align: right; font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 220px; line-height: 1.5; }
td.strong { color: var(--ink); font-weight: 600; }
td .sub { color: var(--faint); font-size: 11px; font-family: var(--mono); margin-top: 1px; }
.rel { color: var(--soft); cursor: default; }
.mut { color: var(--faint); }

/* ============================ panels / units ============================ */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 16px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* pipeline units — one group card, hairline-separated rows */
.unit-list {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.unit { border-bottom: 1px solid var(--rule); }
.unit:last-child { border-bottom: none; }
.unit-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 18px; align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.unit-head:hover { background: color-mix(in srgb, var(--ink) 1.5%, transparent); }
.unit-name { font: 600 12.5px/1.4 var(--mono); color: var(--ink); }
.unit-name .kind { color: var(--faint); font-weight: 500; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-left: 8px; }
.unit-desc { color: var(--soft); font-size: 12.5px; margin-top: 2px; white-space: normal; }
.unit-log {
  border-top: 1px solid var(--rule);
  background: var(--fill);
  font: 400 11.5px/1.7 var(--mono);
  padding: 13px 16px;
  overflow-x: auto; max-height: 340px; overflow-y: auto;
  white-space: pre; color: var(--soft);
}
.unit-log .muted { color: var(--faint); }
@media (max-width: 640px) {
  .unit-head { grid-template-columns: 1fr auto; row-gap: 8px; }
}

/* empty state — inside a quiet card */
.empty {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 56px 24px;
  text-align: center; color: var(--soft); font-size: 13.5px;
}
.empty .big { color: var(--ink); font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.empty .ico { width: 22px; height: 22px; color: var(--faint); margin-bottom: 12px; }

/* ============================ filters / inputs ============================ */

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg {
  display: inline-flex; gap: 2px;
  background: var(--fill);
  border-radius: 9px;
  padding: 3px;
}
.seg button {
  font: 600 12px/1 var(--sans);
  padding: 5px 12px; background: transparent; border: none; cursor: pointer;
  color: var(--soft); border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn), inset 0 0 0 1px var(--rule); }
input.search, select.select {
  font: 500 13px/1.2 var(--sans);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 8px;
  padding: 8px 12px; min-width: 180px;
  box-shadow: var(--shadow-btn);
}
input.search::placeholder { color: var(--faint); }
input.search:focus, select.select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}

/* ============================ skeleton loading ============================ */

.skel { display: flex; flex-direction: column; gap: 12px; }
.skel-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--fill) 0%, color-mix(in srgb, var(--faint) 20%, var(--fill)) 50%, var(--fill) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-line { animation: none; } }
.skel-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.skel-tile { height: 86px; border-radius: 12px; }

/* ============================ dialog ============================ */

dialog {
  margin: auto; /* restore native centering clobbered by the * reset */
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  max-width: 440px;
  width: calc(100vw - 32px);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.05),
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.16);
}
dialog::backdrop { background: rgba(12, 11, 9, 0.4); backdrop-filter: blur(3px); }
.dlg-head { padding: 20px 22px 0; }
.dlg-head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.dlg-head p { color: var(--soft); font-size: 13px; margin-top: 4px; line-height: 1.5; text-wrap: pretty; }
.dlg-body { padding: 18px 22px 4px; display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
.dlg-foot { padding: 18px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.field label {
  display: block;
  font: 600 10px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--soft); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  font: 500 13.5px/1.4 var(--sans);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 8px; padding: 9px 11px;
  box-shadow: var(--shadow-btn);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field textarea { resize: vertical; min-height: 60px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; line-height: 1.5; }
.dlg-pre {
  font: 400 11.5px/1.6 var(--mono);
  background: var(--fill); border-radius: 8px; padding: 10px 12px;
  color: var(--soft); white-space: pre-wrap; word-break: break-word;
}
/* notices inside dialogs: quiet tinted fills, no dots */
.dlg-body .callout { background: var(--fill); border: none; box-shadow: none; border-radius: 8px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5; }
.dlg-body .callout.bad { background: var(--bad-fill); color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.dlg-body .callout.bad strong { color: var(--bad); }
.dlg-body .callout::before { display: none; }
.dlg-body input.search { width: 100%; min-width: 0; margin-bottom: 6px; }

/* ============================ gate screens ============================ */

.gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate-card {
  max-width: 360px; width: 100%; text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  padding: 36px 32px 30px;
}
.gate-card .logo { height: 22px; margin: 0 auto 26px; }
.gate-card h1 { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 7px; text-wrap: balance; }
.gate-card p { color: var(--soft); font-size: 13px; line-height: 1.55; margin-bottom: 24px; text-wrap: pretty; }
.gate-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 13.5px; }
.gate-card .err-box { margin-bottom: 16px; text-align: left; }
.gate-card .meta { margin-top: 18px; font: 500 10.5px/1.6 var(--mono); color: var(--faint); }
.gate-card .who-line { color: var(--ink); font-weight: 600; }

/* misc */
.spin { animation: sp 0.7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.hidden { display: none !important; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: var(--paper);
  font-size: 12.5px; font-weight: 500;
  padding: 10px 15px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  max-width: 340px;
  animation: rise 0.25s cubic-bezier(0.2, 0, 0, 1) both;
}
.toast.bad { background: var(--bad); color: #fff; }
