/* Prodpeek console.
   ────────────────────────────────────────────────────────────────────────────
   The console's job is to let one operator hold the whole gate in their head
   and prove it to a customer. Two things have to be legible at a glance: what
   is reachable, and what was refused.

   Three typographic roles, not one. Inter Tight sets headings; Inter sets prose;
   JetBrains Mono is a first-class role, not a utility — in this product the
   identifier IS the content (`coolify__deploy_application`, `ejd-web1`,
   `anders`), so identifiers are always mono, at every size.

   Colour is the brand's: warm ground, white surfaces, black primary actions,
   zinc neutrals, and a green/red verdict vocabulary. Amber is reserved for
   genuine warnings so it keeps its meaning.

   Every page is laid out to the same grammar, in the same order:
     page head (eyebrow · h1 · sub · primary action)
     attention  — only when something needs doing
     inventory  — the thing you came to see, first
     composer   — the add/edit form, disclosed
     footnote
   The stylesheet owns all spacing; templates carry no inline layout. */

:root {
  /* Ink and ground */
  --ink: #111111;
  --paper: #f7f6f3;
  --surface: #ffffff;
  --muted: #5f5f68;
  --faint: #74747d;
  --line: #e4e4e7;
  --line-soft: #efeff1;

  /* Verdict vocabulary. The -strong pair is for graphics (ticks, dots) where
     3:1 is enough; the plain pair is for text, which needs 4.5:1. */
  --allow: #047857;
  --allow-strong: #10b981;
  --allow-bg: #ecfdf5;
  --allow-line: rgba(4, 120, 87, 0.18);
  --deny: #b91c1c;
  --deny-strong: #dc2626;
  --deny-bg: #fef2f2;
  --deny-line: rgba(185, 28, 28, 0.16);
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --warn-line: rgba(146, 64, 14, 0.18);

  /* Space scale. Nothing in this file uses a value outside it. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 100px;

  --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-md: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.05);
  --shadow-lg: 0 2px 8px rgba(17, 17, 17, 0.06), 0 24px 56px rgba(17, 17, 17, 0.12);

  --sidebar-w: 236px;
  --measure: 66ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s2);
  z-index: 10;
  padding: var(--s2) var(--s3);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  left: var(--s2);
}

/* ── App shell ─────────────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--s5) var(--s3) var(--s4);
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--s2);
  text-decoration: none;
}
.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
}
.brand-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-group {
  padding: var(--s3) var(--s2) var(--s2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover {
  background: var(--paper);
  color: var(--ink);
}
.nav a.active {
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.nav a.active .count {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.sidebar-foot .who {
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot .role {
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.main {
  min-width: 0;
  padding: var(--s6) var(--s6) var(--s7);
  max-width: 1120px;
}

/* ── Page grammar ──────────────────────────────────────────────────────── */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding-bottom: var(--s5);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.page-head .sub {
  margin-top: var(--s2);
  max-width: var(--measure);
  font-size: 14px;
  color: var(--muted);
}

.eyebrow {
  display: block;
  margin-bottom: var(--s2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

/* The one vertical rhythm for everything under the page head. */
.stack > * + * {
  margin-top: var(--s5);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
}
.section-head h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.012em;
}
.section-head .note {
  font-size: 12px;
  color: var(--faint);
}

.footnote {
  max-width: var(--measure);
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
}

/* ── Surfaces ──────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.panel-pad {
  padding: var(--s5);
}
/* A form panel that would be unreadable at full width. */
.panel-narrow {
  max-width: 460px;
}
.form-spaced,
.banner-spaced {
  margin-top: var(--s4);
}

/* A panel whose only child is a table: the table draws its own edges. */
.panel-flush {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
.panel-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.012em;
}
.panel-note {
  margin-top: var(--s1);
  max-width: var(--measure);
  font-size: 13px;
  color: var(--muted);
}

/* ── The verdict ledger ────────────────────────────────────────────────── */
/* One tick per audited call, oldest left. An allowed call is a low, quiet
   mark; a refusal is full height in full colour. Traffic reads as a steady
   field, and refusals read as spikes in it — which is exactly the shape of
   the question "did the gate hold?". */

.ledger {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end; /* newest verdict pinned to the right edge */
  gap: 2px;
  height: 30px;
  overflow: hidden;
}
.ledger i {
  flex: 0 0 3px;
  height: 40%;
  border-radius: 1px;
  background: var(--allow-strong);
  opacity: 0.45;
}
.ledger i.deny {
  height: 100%;
  background: var(--deny-strong);
  opacity: 1;
}
.ledger-sm {
  height: 18px;
  gap: 1px;
}
.ledger-sm i {
  flex: 0 0 2px;
}
.ledger-empty {
  height: 30px;
  border-bottom: 1px dashed var(--line);
}

/* The gate's headline figures, set against the ledger. */
.gate {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
}
.gate-figures {
  display: flex;
  gap: var(--s6);
}
.figure-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.figure-value {
  margin-top: var(--s2);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.figure-allow .figure-value {
  color: var(--allow);
}
.figure-deny .figure-value {
  color: var(--deny);
}
/* The chain reads as a state, not a number, so it sits on the figures' baseline
   rather than pretending to be one of them. */
.figure-chain {
  margin-top: var(--s3);
}

.gate-ledger {
  flex: 1 1 300px;
  min-width: 200px;
}
.gate-ledger .cap {
  margin-top: var(--s2);
  font-size: 11px;
  color: var(--faint);
  text-align: right;
}

/* ── Project rollup (Overview) ─────────────────────────────────────────── */

.rollup {
  display: grid;
  gap: var(--s3);
}
.rollup-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
}
.rollup-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rollup-meta {
  margin-top: var(--s1);
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.rollup-services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}
.rollup-ledger {
  width: 132px;
}

/* ── Attention list ────────────────────────────────────────────────────── */
/* Things that need doing, stated as what is wrong and what to do about it. */

.attention {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}
.attention .panel-title {
  color: var(--warn);
}
.attention ul {
  margin-top: var(--s3);
  list-style: none;
  display: grid;
  gap: var(--s2);
}
.attention li {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-size: 13px;
  color: var(--warn);
}
.attention li::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-2px);
}
.attention a {
  font-weight: 600;
}

/* ── Service entries ───────────────────────────────────────────────────── */

/* Services are grouped under the project that owns them. The heading is the
   project's slug, set as the identifier it is. */
.svc-group + .svc-group {
  margin-top: var(--s5);
}
.svc-group-head {
  padding: 0 var(--s1) var(--s2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
}

.svc {
  padding: var(--s4) var(--s5);
}
.svc + .svc {
  margin-top: var(--s3);
}
.svc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.svc-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.svc-facts {
  margin-top: var(--s2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s4);
  font-size: 12px;
  color: var(--muted);
}
.svc-facts .k {
  color: var(--faint);
}
/* A hairline between fact pairs, so `policy x at y` cannot read as one phrase. */
.svc-facts > span + span {
  padding-left: var(--s4);
  border-left: 1px solid var(--line);
}
.svc-facts .v {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
.svc-badges {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

/* Routine actions left, the destructive one pushed away from them. */
.svc-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
}
.svc-actions .spacer {
  flex: 1 1 auto;
}

/* A secondary action that opens in place inside the entry, for something done
   rarely enough that a button in the row would outrank its usefulness. */
.svc-extra {
  margin-top: var(--s3);
}
.svc-extra > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.svc-extra > summary::-webkit-details-marker {
  display: none;
}
.svc-extra > summary::before {
  content: '+';
  font-family: var(--mono);
}
.svc-extra[open] > summary::before {
  content: '\2013';
}
.svc-extra > summary:hover {
  color: var(--ink);
}
.svc-extra > .form {
  margin-top: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
}
.svc-extra > .form > .panel-note:first-child {
  margin-top: 0;
}

/* The result of a probe, or the database picker: the entry's own body. */
.svc-body {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line-soft);
}
.svc-body > * + * {
  margin-top: var(--s3);
}

.tool-group .eyebrow {
  margin-bottom: var(--s2);
}
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

/* ── Pills, tags, dots ─────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 2px var(--s2);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill-allow {
  background: var(--allow-bg);
  color: var(--allow);
  border-color: var(--allow-line);
}
.pill-deny {
  background: var(--deny-bg);
  color: var(--deny);
  border-color: var(--deny-line);
}
.pill-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-line);
}
.pill-plain {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--line);
}
/* A project is always shown as a mono identifier, wherever it appears. */
.pill-project {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--line);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.tag {
  padding: 2px var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
a.tag:hover {
  background: var(--paper);
  border-color: var(--muted);
}
.tag-allow {
  background: var(--allow-bg);
  color: var(--allow);
  border-color: var(--allow-line);
}
.tag-deny {
  background: var(--deny-bg);
  color: var(--deny);
  border-color: var(--deny-line);
}
.tag-unlisted {
  background: var(--paper);
  color: var(--muted);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover {
  background: var(--paper);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn[disabled]:hover {
  background: var(--surface);
}
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.btn-primary:hover {
  background: #2a2a2e;
}
.btn-danger {
  background: var(--surface);
  border-color: var(--line);
  color: var(--deny);
}
.btn-danger:hover {
  background: var(--deny-bg);
  border-color: var(--deny-line);
}
.btn-sm {
  padding: var(--s1) var(--s3);
  font-size: 12px;
}
.btn-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

/* ── Composer ──────────────────────────────────────────────────────────── */
/* The add/edit form. Collapsed by default so the inventory is what you land
   on; opened by the server when there is nothing to list yet, when an edit is
   in progress, or when a submission came back with an error. */

.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.composer > summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s5);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.012em;
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-lg);
}
.composer > summary::-webkit-details-marker {
  display: none;
}
.composer > summary::before {
  content: '+';
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}
.composer[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.composer[open] > summary::before {
  content: '–';
}
.composer-body {
  padding: var(--s5);
}
.composer-body > .panel-note:first-child {
  margin-top: 0;
  margin-bottom: var(--s4);
}

/* ── Forms ─────────────────────────────────────────────────────────────── */

.form > * + * {
  margin-top: var(--s4);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding-top: var(--s2);
}

.field label,
.field > .label {
  display: block;
  margin-bottom: var(--s2);
  font-size: 13px;
  font-weight: 600;
}
.field .hint {
  margin-top: var(--s2);
  max-width: var(--measure);
  font-size: 12px;
  color: var(--faint);
}
/* Two fields that belong together read as one line where there is room. */
.field-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s4);
}

input,
select,
textarea {
  width: 100%;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}
textarea {
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.07);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
/* Identifiers are typed as identifiers. */
.input-mono {
  font-family: var(--mono);
  font-size: 13px;
}
.input-inline {
  width: auto;
  flex: 1 1 240px;
}
.select-sm,
.input-sm {
  width: auto;
  padding: var(--s1) var(--s2);
  font-size: 12px;
}

/* A locked value shown where an input would be. */
.static-field {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}
.check:hover {
  background: var(--paper);
}
/* .check sets display, which outranks the user agent's rule for [hidden]. */
.check[hidden] {
  display: none;
}
.check input {
  width: auto;
  accent-color: var(--ink);
}
.check .size {
  color: var(--faint);
  font-size: 11px;
}
.checks-empty {
  font-size: 13px;
  color: var(--faint);
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.scroll-x {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  white-space: nowrap;
}
.table td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover td {
  background: #fbfbfa;
}
.table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}
.table .id {
  font-family: var(--mono);
  font-size: 12px;
}
.table .dim {
  color: var(--muted);
}
.table .end {
  text-align: right;
}
.table .nowrap {
  white-space: nowrap;
}
/* The audit table is long; keep its header in view while scanning it. */
.table-sticky th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ── Banners ───────────────────────────────────────────────────────────── */

.banner {
  padding: var(--s3) var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
}
.banner-ok {
  background: var(--allow-bg);
  color: var(--allow);
  border-color: var(--allow-line);
}
.banner-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-line);
}
.banner-error {
  background: var(--deny-bg);
  color: var(--deny);
  border-color: var(--deny-line);
}
.banners > * + * {
  margin-top: var(--s2);
}
.banners {
  margin-bottom: var(--s5);
}

.empty {
  padding: var(--s6) var(--s5);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty strong {
  display: block;
  margin-bottom: var(--s1);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.012em;
}

/* ── The one-time key reveal ───────────────────────────────────────────── */
/* Inverted, because it is the only moment in the console that cannot be
   repeated: the secret is on screen once and never again. */

.reveal {
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
}
.reveal h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.reveal p {
  margin-top: var(--s1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.reveal .label {
  margin: var(--s4) 0 var(--s2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}
.reveal .code {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-all;
}
.reveal .copy-text {
  flex: 1;
  min-width: 0;
}
.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.copy-btn.copied {
  background: var(--allow-strong);
  border-color: var(--allow-strong);
  color: #fff;
}
.reveal :focus-visible {
  outline-color: rgba(255, 255, 255, 0.8);
}

/* ── Getting started (shown only on an empty instance) ─────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  display: grid;
  gap: var(--s4);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s3);
  font-size: 13px;
  color: var(--muted);
  max-width: var(--measure);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.steps strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

/* ── Audit: view tabs and the filter bar ───────────────────────────────── */
.viewbar { display: flex; gap: 6px; margin: 22px 0 0; border-bottom: 1px solid var(--border); }
.viewtab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
}
.viewtab:hover { color: var(--text); }
.viewtab.active { color: var(--text); border-bottom-color: var(--text); }
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px;
}
.filterbar input[type="search"] { width: auto; flex: 1 1 260px; padding: 7px 11px; font-size: 13px; border-radius: 8px; }

/* ── Login ─────────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--s5);
}
.login-card {
  width: 100%;
  max-width: 372px;
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.login-card > * + * {
  margin-top: var(--s4);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.login-brand .brand-name {
  font-size: 18px;
}
.btn-block {
  width: 100%;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */

.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.muted {
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-group {
    display: none;
  }
  .sidebar-foot {
    margin-left: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
  .main {
    padding: var(--s5) var(--s4) var(--s7);
  }
  .rollup-row {
    grid-template-columns: 1fr;
  }
  .rollup-ledger {
    width: 100%;
  }
  .gate-figures {
    gap: var(--s5);
  }
  /* The divider separates facts on one line; once they wrap it is just a bar. */
  .svc-facts > span + span {
    padding-left: 0;
    border-left: none;
  }
  .svc-facts {
    gap: var(--s1) var(--s3);
  }
}

@media (max-width: 560px) {
  .page-head h1 {
    font-size: 24px;
  }
  .figure-value {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Standalone pages (the credential drop link) ──────────────────────────────
   Whoever opens a drop link may have no console account and no idea what
   Prodpeek is. They get one card, one field, and no navigation to wander into —
   a page that looked like the console would invite them to go exploring it. */

body.solo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--s7) var(--s4);
  background: var(--paper);
  min-height: 100vh;
}

.solo-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow-lg);
}

.brand-solo { margin-bottom: var(--s5); }

.solo-card h1 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s3);
}

.solo-lede { margin: 0 0 var(--s5); line-height: 1.55; }
.solo-note { color: var(--muted); font-size: 13px; margin: var(--s5) 0 0; line-height: 1.55; }

.solo-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s1) var(--s5);
  margin: 0 0 var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 13px;
}
.solo-facts dt { color: var(--muted); }
.solo-facts dd { margin: 0; overflow-wrap: anywhere; }

.solo-card textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: var(--s2) var(--s3);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  resize: vertical;
}
.solo-card textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: transparent;
}

/* The refusal count on the audit view's Denials tab. */
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px var(--s1);
  margin-left: var(--s1);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* A model's output, shown as it was written: line breaks are meaning in a
   three-section analysis, and reflowing it would lose them. */
.analysis {
  margin: var(--s3) 0 0;
  padding: var(--s4);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A count that means "go and look", rather than one that is decoration.
   Specificity has to beat `.nav a.active .count`, which pales the ordinary counts
   against the active item's dark ground — a red badge that inherits that rule is
   light text on a light chip, which is to say invisible exactly when it matters. */
.count-deny,
.nav a .count-deny,
.nav a.active .count-deny {
  padding: 1px var(--s2);
  border-radius: var(--r-pill);
  color: var(--deny);
  background: var(--deny-bg);
  border: 1px solid var(--deny-line);
  font-weight: 600;
}
.nav a.active .count-deny {
  /* On the active item's dark ground, the pale chip is the readable one. */
  color: var(--deny);
  background: #fff;
  border-color: transparent;
}

/* An opt-in: a checkbox and a sentence, for the choices that are off by default.
   Deliberately NOT `.check` — that is the bordered mono chip the Postgres database
   picker uses, and borrowing it here rendered a consent row as something that
   looked like a disabled text field. Different component, different name. */
.optin {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s2) 0;
  font-weight: 500;
  cursor: pointer;
}
.optin input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--ink);
}

/* A prose column in a table of identifiers. Everything else in these tables is a
   name or a number and stays on one line; a failure reason is a sentence, and
   forcing it onto one line pushes the row off the edge of a narrow window. */
.table th.wrap,
.table td.wrap {
  white-space: normal;
  min-width: 18ch;
  max-width: 44ch;
}
