/*
 * Acme Consulting — admin (logged-in) UI, design prototype.
 *
 * Light, flat, and built from the marketing site's design system
 * (app/views/marketing/show.html.erb): same tokens, type, eyebrow/card/button
 * language — so the admin reads as the same brand and the ERB port is a
 * straight translation.
 */

:root {
  /* Lifted verbatim from the marketing site. */
  --bg: #ffffff;
  --soft: #f5f7fc;
  --soft-2: #eef1f9;
  --ink: #0f1230;
  --ink-2: #2a2e4d;
  --muted: #5d6580;
  --faint: #98a0b6;
  --line: #e7ebf4;
  --line-2: #eef1f7;
  --indigo: #5b50e6;
  --blue: #3f74f5;
  --cyan: #15cfd6;
  --grad: linear-gradient(120deg, #6a5cff 0%, #3f74f5 52%, #16d4d4 100%);
  --grad-soft: linear-gradient(120deg, #eef0ff, #e6f6ff);
  --shadow-sm: 0 12px 30px -16px rgba(40, 52, 120, 0.22);
  --shadow: 0 24px 60px -28px rgba(40, 52, 120, 0.30);

  /* Admin-only data semantics, kept muted to stay flat. */
  --pos: #12b886;
  --neg: #e5484d;
  --amber: #f5a623;

  --display: "Poppins", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--soft);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--grad-soft);
  border: 1px solid #e2e6fb;
  border-radius: 999px;
  padding: 6px 14px;
}
.eyebrow .d { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }

/* ---------- Buttons (marketing parity) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--grad);
  background-size: 140% 140%;
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 16px 36px -18px rgba(63, 116, 245, 0.7);
  transition: transform 0.18s ease, box-shadow 0.25s ease, background-position 0.4s ease;
}
.btn:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 22px 50px -20px rgba(63, 116, 245, 0.85); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-ghost:hover { border-color: #cfd6ea; box-shadow: var(--shadow-sm); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid #f3d2d4;
  background: #fff;
  color: var(--neg);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-danger:hover { background: #fdf1f1; border-color: #ecbcbe; }

.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }

.confirm-actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; }

/* ---------- Shell ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 8px 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; flex: none; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  margin: 6px 10px 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a.is-active { color: var(--indigo); background: var(--grad-soft); border-color: #e2e6fb; font-weight: 600; }
.nav-ico { width: 19px; height: 19px; flex: none; color: var(--faint); }
.nav a:hover .nav-ico { color: var(--muted); }
.nav a.is-active .nav-ico { color: var(--indigo); }

.sidebar-foot { margin-top: auto; padding-top: 16px; }
.user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--grad);
}
.user-meta { min-width: 0; line-height: 1.25; }
.user-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.user-mail { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 11px;
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.signout:hover { color: var(--ink); background: var(--soft); }
.signout:hover .nav-ico { color: var(--muted); }

/* ---------- Main column ---------- */

.main { padding: 30px 38px 56px; min-width: 0; }
.main-inner { width: 100%; max-width: 1120px; margin: 0 auto; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
h1.page-title { font-size: clamp(26px, 3vw, 34px); margin-top: 14px; }
.page-sub { color: var(--muted); font-size: 16px; margin-top: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.chip .d { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }

/* ---------- Cards (flat: border, no resting shadow) ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--faint); }

.grid { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.grid-2 { grid-template-columns: 1.35fr 1fr; margin-top: 18px; }

/* ---------- Autonomy signature ---------- */

.autonomy { display: flex; align-items: center; gap: 26px; }
.autonomy-now { flex: none; }
.autonomy-now .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.autonomy-now .stage { font-family: var(--display); font-weight: 700; font-size: 22px; margin-top: 4px; }
.autonomy-track { flex: 1; min-width: 0; }
.track {
  position: relative;
  height: 8px;
  border-radius: 5px;
  background: var(--soft-2);
}
.track > i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 5px;
  background: var(--grad);
  width: 0;
  animation: fillw 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.track > .pin {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px -4px rgba(63, 116, 245, 0.6);
}
@keyframes fillw { from { width: 0; } }
.track-labels { display: flex; justify-content: space-between; margin-top: 12px; }
.track-labels span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--faint); }
.track-labels span.on { color: var(--indigo); font-weight: 600; }

/* ---------- KPI tiles ---------- */

.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.kpi-value small { font-size: 16px; font-weight: 600; color: var(--faint); }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); }
.kpi-spark { width: 66px; height: 22px; flex: none; }

.delta { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.delta.up { color: var(--pos); }
.delta.down { color: var(--neg); }
.delta.up::before { content: "\2197 "; }
.delta.down::before { content: "\2198 "; }

/* ---------- Hero area chart ---------- */

.hero-figure { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.hero-figure .num { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; color: var(--ink); letter-spacing: -0.01em; }
.hero-figure .unit { color: var(--muted); font-size: 14px; }
.chart { width: 100%; display: block; }
.chart-area { height: 210px; margin-top: 8px; }

/* ---------- Bars ---------- */

.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: flex; flex-direction: column; gap: 8px; }
.bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-name { color: var(--ink); font-weight: 500; }
.bar-name .mono { font-family: var(--mono); color: var(--muted); font-size: 12.5px; font-weight: 400; }
.bar-val { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.bar-track { height: 8px; border-radius: 999px; background: var(--soft-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad); transform-origin: left; animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Ring ---------- */

.ring-wrap { display: flex; align-items: center; gap: 22px; }
.ring { width: 132px; height: 132px; flex: none; }
.ring-legend { display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend-item .mono { font-family: var(--mono); color: var(--muted); margin-left: auto; padding-left: 18px; }

/* ---------- Definition list (subscription) ---------- */

.detail { display: grid; grid-template-columns: max-content 1fr; gap: 14px 32px; margin: 0; }
.detail dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); align-self: center; }
.detail dd { margin: 0; font-size: 15.5px; font-weight: 500; color: var(--ink); }
.detail dd .muted { color: var(--muted); font-weight: 400; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.03em; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.pill-ok { color: var(--pos); background: rgba(18, 184, 134, 0.1); }
.pill-ok::before { background: var(--pos); }
.pill-warn { color: #b07400; background: rgba(245, 166, 35, 0.12); }
.pill-warn::before { background: var(--amber); }
.pill-off { color: var(--muted); background: var(--soft-2); }
.pill-off::before { background: var(--faint); }
.pill-danger { color: var(--neg); background: rgba(229, 72, 77, 0.12); }
.pill-danger::before { background: var(--neg); }

.counts-strip { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin: 22px 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.counts-strip .metric { display: flex; align-items: center; gap: 8px; }
.counts-strip .metric-value { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); }
.counts-strip .metric-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.counts-strip .metric-pct { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.board-notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 13.5px;
}

/* The board's refusal flash — a trial-control POST or interstitial GET
   refused for a hidden state (a subscribed team, no active membership) or
   an unrecognized preset, styled like the auth pages' .error. */
.notice-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--neg);
  background: #fdf1f1;
  border: 1px solid #f3d2d4;
  border-radius: 11px;
}

/* The Actions cell's trial controls (+14 days, +30 days, End trial…),
   rendered only for a row whose org is on trial with no subscription. */
.trial-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.trial-controls form { display: inline-flex; }
.trial-controls .muted { font-size: 12px; }

/* ---------- Accounts board filter bar ---------- */

.filter-bar {
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.filter-bar .field { flex: 0 1 180px; }
.filter-bar select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

/* A switched-off account's row, muted so it reads distinctly from the rest
   of the board without hiding it — the default view shows off rows
   alongside every other account. */
.table tr.is-off { color: var(--faint); }
.table tr.is-off .who > div > div:first-child { color: var(--faint); }
.table tr.is-off .pill { opacity: 0.7; }

/* The "no accounts match these filters" row: centered, muted text with no
   cell borders of its own so it never reads as a truncated real row. */
.table tr.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 26px 8px;
}

/* ---------- Table (API keys) ---------- */

.table { width: 100%; border-collapse: collapse; }
.table th { padding: 0 8px 12px; text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.table td { padding: 15px 8px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; vertical-align: middle; color: var(--ink-2); }
.table tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.table .who { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.gh-dot { width: 28px; height: 28px; border-radius: 8px; background: var(--grad-soft); display: grid; place-items: center; color: var(--indigo); flex: none; }
.lockout { color: #a46a21; font-size: 12.5px; }
.when { border-bottom: 1px dotted var(--faint); cursor: help; }
.col-actions { text-align: right; }

/* ---------- Reveal (one-time token) ---------- */

.reveal-key { margin-bottom: 18px; padding: 22px 24px; border-radius: 18px; border: 1px solid #d9e0fb; background: var(--grad-soft); }
.reveal-key h2 { font-family: var(--display); font-weight: 600; font-size: 18px; }
.reveal-key p { margin: 4px 0 14px; color: var(--ink-2); font-size: 14px; }
.token { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.token code { flex: 1; font-family: var(--mono); font-size: 14px; color: var(--ink); word-break: break-all; }

/* ---------- Forms ---------- */

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 200px; min-width: 0; }
.field label { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field input { width: 100%; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63, 116, 245, 0.14); }

.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 14px; }
.stack-gap { margin-top: 18px; }

/* ---------- Settings hub (category cards) ---------- */

/* A category card holds one link. The anchor stretches back over the card's
   padding with a matching negative margin, so the hover fill and the click
   target cover the whole card rather than just the two lines of text. */
.category {
  display: block;
  margin: -22px -24px;
  padding: 22px 24px;
  border-radius: 18px;
  transition: background 0.15s ease;
}
.category:hover { background: var(--soft); }
.category-title { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
.category-desc { display: block; margin-top: 4px; font-size: 14.5px; color: var(--muted); }

/* ---------- Focus & motion ---------- */

a:focus-visible, .btn:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible, input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Auth (centered card, no shell) ---------- */

.authwrap {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(42% 62% at 10% 12%, rgba(106, 92, 255, 0.30), transparent 60%),
    radial-gradient(46% 66% at 90% 22%, rgba(22, 212, 212, 0.18), transparent 60%),
    radial-gradient(56% 76% at 76% 104%, rgba(63, 116, 245, 0.22), transparent 60%),
    #080b18;
}

/* Slow-drifting aurora glow behind the stars */
.authwrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  pointer-events: none;
  background:
    radial-gradient(34% 40% at 30% 32%, rgba(106, 92, 255, 0.22), transparent 60%),
    radial-gradient(30% 38% at 72% 60%, rgba(22, 212, 212, 0.14), transparent 60%),
    radial-gradient(40% 44% at 84% 20%, rgba(63, 116, 245, 0.16), transparent 60%);
  animation: auth-aurora 40s ease-in-out infinite;
}
@keyframes auth-aurora {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(3%, -2%) rotate(4deg) scale(1.08); }
  66% { transform: translate(-2%, 3%) rotate(-3deg) scale(1.04); }
}

/* Flowing streams behind the auth card — the marketing hero's deep-water motif */
.auth-deco { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-deco svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-deco .stream { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 90 420; animation: auth-flow 12s linear infinite; }
.auth-deco .stream.s1 { stroke: rgba(22, 212, 212, 0.35); }
.auth-deco .stream.s2 { stroke: rgba(99, 124, 255, 0.30); animation-duration: 15s; animation-delay: -4s; }
.auth-deco .stream.s3 { stroke: rgba(63, 116, 245, 0.26); animation-duration: 18s; animation-delay: -9s; }
.auth-deco .stream.s4 { stroke: rgba(22, 212, 212, 0.16); animation-duration: 21s; animation-delay: -2s; }
@keyframes auth-flow { to { stroke-dashoffset: -1020; } }

@keyframes auth-deco-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* The stream layer eases in once, then the dashes flow forever */
.auth-deco { opacity: 0; transform-origin: center; animation: auth-deco-in 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 26rem;
  padding: 38px 34px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.auth-card.wide { max-width: 31rem; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 30px;
}
.auth-brand svg { width: 46px; height: 46px; }
.auth-brand img { width: 46px; height: 46px; border-radius: 12px; }

.stepper { display: flex; gap: 6px; margin-bottom: 10px; }
.stepper i { height: 4px; flex: 1; border-radius: 2px; background: var(--soft-2); }
.stepper i.on { background: var(--grad); }
.step-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }

.auth-card h1 { font-size: 25px; margin-bottom: 8px; }
.lede { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-form .field { flex: 0 0 auto; }
.auth-card .btn { width: 100%; margin-top: 4px; }

.code-input { text-align: center; font-family: var(--mono); font-size: 26px; letter-spacing: 0.5em; padding-left: 0.5em; }

.error {
  margin: 18px 0 0;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--neg);
  background: #fdf1f1;
  border: 1px solid #f3d2d4;
  border-radius: 11px;
}

.notice {
  margin: 18px 0 0;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--pos);
  background: #f0fbf6;
  border: 1px solid #c8ede0;
  border-radius: 11px;
}

.alt { margin: 22px 0 0; font-size: 14.5px; color: var(--muted); text-align: center; }
.alt a { color: var(--indigo); font-weight: 600; }
.alt a:hover { text-decoration: underline; }

.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.back-link:hover { color: var(--ink); }

.auth-form .error { margin: 0; }
.field input.is-error, .code-input.is-error { border-color: var(--neg); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12); }

.link-btn { background: none; border: 0; padding: 0; font: inherit; font-family: var(--body); font-size: 14.5px; font-weight: 600; color: var(--indigo); cursor: pointer; }
.link-btn:disabled { color: var(--faint); cursor: default; }
.link-btn:not(:disabled):hover { text-decoration: underline; }
.resend-note { text-align: center; font-size: 13px; margin: 8px 0 0; color: var(--muted); }

/* ---------- Trial banner (Overview + API keys) ---------- */

.trial-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid #e2e6fb;
  border-left: 4px solid var(--indigo);
  background: var(--grad-soft);
  box-shadow: var(--shadow-sm);
}
.trial-banner::before {
  content: "";
  flex: none;
  align-self: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 0 4px rgba(91, 80, 230, 0.16);
}
.trial-banner p {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.trial-banner .btn { margin-left: auto; flex: none; }

@media (max-width: 560px) {
  .trial-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .trial-banner::before { display: none; }
  .trial-banner .btn { margin-left: 0; width: 100%; }
}

/* ---------- Marketing callout (Overview) ---------- */

.plan-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.plan-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.plan-list li::before {
  content: "✓";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--grad-soft);
  color: var(--indigo);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
}

.marketing .cta-row { margin-top: 22px; }

@media (max-width: 560px) {
  .plan-list { grid-template-columns: 1fr; }
}

/* ---------- Subscribe (plan + payment) ---------- */

.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #e2e6fb;
  background: var(--grad-soft);
}
.plan-banner .pn { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
.plan-banner .pp { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.plan-banner .price { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); white-space: nowrap; }
.plan-banner .price small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Selectable plan cards: the native radio renders as a custom indigo dot and
   the whole label is the click target. Hovering lifts the card with a soft
   shadow; the checked card takes the indigo accent border, the soft-gradient
   fill, and the same lift, so the active plan reads clearly against the rest. */
fieldset.plans {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
fieldset.plans > legend { grid-column: 1 / -1; padding: 0; }

.plan-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, background 0.15s ease;
}
.plan-option:hover { border-color: #cfd6ea; box-shadow: var(--shadow-sm); }

.plan-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.plan-option input[type="radio"]:checked {
  border-color: var(--indigo);
  background: radial-gradient(circle at center, var(--indigo) 0 5px, #fff 6px);
}
.plan-option input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 80, 230, 0.25);
}

.plan-option .pn { font-family: var(--display); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.plan-option .price { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.plan-option .price small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--faint); }

.plan-option:has(input:checked) {
  border-color: var(--indigo);
  background: var(--grad-soft);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 560px) {
  fieldset.plans { grid-template-columns: 1fr; }
}

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; width: max-content; }
.qty button { width: 44px; height: 48px; border: 0; background: #fff; color: var(--ink); font-size: 20px; cursor: pointer; transition: background 0.15s ease; }
.qty button:hover { background: var(--soft); }
.qty input { width: 60px; height: 48px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-family: var(--mono); font-size: 17px; color: var(--ink); }
.qty input:focus { outline: none; }

.payfield { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }

/* Stripe Elements mount: a block field so the injected card iframe takes the
   full width (a flex container collapses it to a blank sliver). */
.stripe-field { padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.stripe-field .__PrivateStripeElement { width: 100%; }
.stripe-field .StripeElement { width: 100%; }
.payfield .card-ico { color: var(--faint); flex: none; }
.payfield .dots { font-family: var(--mono); font-size: 15px; color: var(--ink); letter-spacing: 0.04em; }
.payfield .exp { margin-left: auto; font-family: var(--mono); font-size: 14px; color: var(--muted); }

.order { margin-top: 4px; }
.order-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14.5px; color: var(--muted); padding: 6px 0; }
.order-row.total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); }
.order-row.total b { font-family: var(--display); font-weight: 700; font-size: 20px; }
.secured { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--faint); }

/* ---------- Empty state ---------- */

.empty { text-align: center; padding: 40px 24px 30px; }
.empty-ico { width: 60px; height: 60px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 16px; background: var(--grad-soft); color: var(--indigo); }
.empty h2 { font-size: 21px; }
.empty p { color: var(--muted); font-size: 15px; max-width: 42ch; margin: 8px auto 22px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

.download-card { margin-bottom: 18px; }
.download-card p { margin: 0 0 18px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; text-align: left; }
.step { padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); }
.step .n { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; }
.step h3 { font-size: 15px; margin: 10px 0 4px; }
.step p { font-size: 13px; color: var(--muted); margin: 0; max-width: none; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Flow detail ---------- */

.detail dd { overflow-wrap: anywhere; }

details.card > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 18px; }
.summary-meta { display: inline-flex; align-items: center; gap: 12px; }
.chev { color: var(--faint); transition: transform 0.2s ease; flex: none; }
details.card[open] .chev { transform: rotate(180deg); }

.log {
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
}

.run { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.run:first-of-type { padding-top: 0; }
.run:last-child { border-bottom: none; padding-bottom: 0; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.run-name { font-weight: 600; color: var(--ink); }
.run-name .mono { font-family: var(--mono); font-size: 12.5px; font-weight: 400; color: var(--muted); }

.finding { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.finding + .finding { margin-top: 14px; }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.finding-agent { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); }
.finding-tenant { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 8px; }

.finding-segments { display: flex; flex-direction: column; gap: 14px; }
.seg-label {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--grad-soft);
  border: 1px solid #e2e6fb;
  border-radius: 7px;
  padding: 3px 10px;
}
.seg-body {
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 10px 0 4px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-label { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding-top: 0; }
  .signout { display: none; }
  .main { padding: 22px 18px 40px; }
  .autonomy { flex-direction: column; align-items: stretch; gap: 16px; }
}
@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
