/* FanHook — Webhook fanout made delightful. */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ============ THEME TOKENS ============ */
:root {
  --brand-yellow: #FFD23F;
  --brand-pink:   #FF477E;
  --brand-blue:   #3A86FF;
  --brand-lilac:  #8338EC;
  --brand-green:  #06D6A0;

  --bg:           #FAF7F2;
  --bg-elev:      #FFFFFF;
  --bg-soft:      #F2EFE8;
  --surface:      #FFFFFF;
  --surface-2:    #F7F4EE;
  --border:       #E7E1D6;
  --border-soft:  #EFEAE0;
  --text:         #1B1A23;
  --text-soft:    #5A5666;
  --text-mute:    #6E6A78;   /* WCAG 1.4.3 AA: ~4.9:1 on --bg #FAF7F2 (was #8B8696 ~3.2:1) */

  --shadow-sm: 0 1px 2px rgba(27,26,35,0.05);
  --shadow:    0 6px 18px -6px rgba(27,26,35,0.12);
  --shadow-lg: 0 24px 48px -16px rgba(27,26,35,0.18);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;

  /* legacy aliases used in inline styles in routes/web.js */
  --font-heading: var(--font-head);
  --text-primary: var(--text);
  --text-secondary: var(--text-soft);
  --red:   var(--brand-pink);
  --green: var(--brand-green);
  --blue:  var(--brand-blue);
  --yellow: var(--brand-yellow);
  --indigo: var(--brand-lilac);
}

[data-theme="dark"] {
  --bg:          #0F0E14;
  --bg-elev:     #16151D;
  --bg-soft:     #1B1A23;
  --surface:     #16151D;
  --surface-2:   #1F1D28;
  --border:      #2A2833;
  --border-soft: #232129;
  --text:        #F4F1EA;
  --text-soft:   #B8B3C2;
  --text-mute:   #7C7889;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow:    0 6px 18px -6px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 48px -16px rgba(0,0,0,0.6);
}

/* ============ BASE ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--text);
}
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* ============ TOP NAV (landing/docs) ============ */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  max-width: 1200px; margin: 0 auto;
}
.fh-logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.fh-logo-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-pink), var(--brand-lilac));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.fh-logo-text {
  font-family: var(--font-head);
  font-weight: 600; font-size: 20px;
  color: var(--text);
}
.topnav-actions { display: flex; align-items: center; gap: 10px; }
.topnav-link {
  font-weight: 500; color: var(--text-soft);
  padding: 8px 14px; border-radius: var(--radius-pill);
}
.topnav-link:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }

/* ============ ICON BUTTONS ============ */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { background: var(--bg-soft); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* ============ PILL / BUTTONS ============ */
.pill, .btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.pill svg, .btn svg { width: 16px; height: 16px; stroke-width: 2; }
.btn:hover, .pill:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary, .btn-indigo {
  background: var(--brand-lilac); color: #fff;
}
.btn-primary:hover, .btn-indigo:hover { background: #6E2BC5; color: #fff; }

.btn-yellow {
  background: var(--brand-yellow); color: #1B1A23;
}
.btn-yellow:hover { background: #F5C42A; color: #1B1A23; }

.btn-pink {
  background: var(--brand-pink); color: #fff;
}
.btn-pink:hover { background: #EC3868; color: #fff; }

.btn-blue {
  background: var(--brand-blue); color: #fff;
}
.btn-blue:hover { background: #2E76EE; color: #fff; }

.btn-green {
  background: var(--brand-green); color: #00352A;
}
.btn-green:hover { background: #05BC8E; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); }

.btn-danger {
  background: transparent; color: var(--brand-pink);
  border: 1px solid transparent;
}
.btn-danger:hover { background: rgba(255,71,126,0.1); color: var(--brand-pink); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ============ INPUTS ============ */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-lilac);
  box-shadow: 0 0 0 3px rgba(131,56,236,0.15);
}
label {
  display: block;
  font-weight: 500; font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

/* ============ LANDING PAGE ============ */
.landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255,210,63,0.18), rgba(255,71,126,0.18));
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-soft);
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(6,214,160,0.25);
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.hero-title .grad {
  background: linear-gradient(135deg, var(--brand-pink), var(--brand-lilac), var(--brand-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.hero-sub {
  font-size: 18px; color: var(--text-soft);
  max-width: 640px; margin: 0 auto 32px;
}
.hero-cta {
  display: inline-flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* Flow mockup */
.flow {
  margin: 64px auto 80px;
  max-width: 920px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.flow::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,210,63,0.18), rgba(131,56,236,0.18));
  z-index: -1; filter: blur(20px); opacity: 0.6;
}
.flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}
.flow-node {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.flow-node .icon-bubble {
  width: 44px; height: 44px;
  border-radius: 14px;
  margin: 0 auto 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.flow-node .icon-bubble.yellow { background: var(--brand-yellow); color: #1B1A23; }
.flow-node .icon-bubble.pink   { background: var(--brand-pink); }
.flow-node .icon-bubble.blue   { background: var(--brand-blue); }
.flow-node .icon-bubble.lilac  { background: var(--brand-lilac); }
.flow-node .icon-bubble svg { width: 22px; height: 22px; stroke-width: 2; }
.flow-node h4 { font-size: 15px; margin: 0 0 4px; }
.flow-node p  { font-size: 12px; color: var(--text-mute); margin: 0; }
.flow-node-stack { display: flex; flex-direction: column; gap: 12px; }
.flow-arrow {
  color: var(--text-mute);
  display: flex; align-items: center; justify-content: center;
}
.flow-arrow svg { width: 22px; height: 22px; }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 0 auto 72px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature .icon-bubble {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: #fff;
}
.feature .icon-bubble svg { width: 22px; height: 22px; stroke-width: 2; }
.feature .icon-bubble.yellow { background: var(--brand-yellow); color: #1B1A23; }
.feature .icon-bubble.pink   { background: var(--brand-pink); }
.feature .icon-bubble.blue   { background: var(--brand-blue); }
.feature h3 { font-size: 19px; margin: 0 0 8px; }
.feature p  { color: var(--text-soft); margin: 0; font-size: 14px; }

/* Pricing */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 0 auto 56px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: left;
}
.price-card.highlight {
  border-color: var(--brand-lilac);
  box-shadow: var(--shadow);
  position: relative;
}
.price-card.highlight::before {
  content: 'Popular';
  position: absolute;
  top: -10px; left: 24px;
  background: var(--brand-lilac); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill);
}
.price-name { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--text-soft); }
.price-amount { font-family: var(--font-head); font-weight: 600; font-size: 40px; margin: 8px 0 4px; }
.price-amount small { font-size: 14px; color: var(--text-mute); font-weight: 400; }
.price-list { list-style: none; padding: 0; margin: 16px 0 20px; }
.price-list li {
  font-size: 14px; color: var(--text-soft);
  padding: 6px 0; display: flex; align-items: center; gap: 8px;
}
.price-list li::before {
  content: '✓'; color: var(--brand-green); font-weight: 700;
}

.section-title { text-align: center; margin: 16px 0 32px; }
.section-title h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; }
.section-title p  { color: var(--text-soft); margin: 0; }

/* ============ DASHBOARD APP SHELL ============ */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.sidebar-brand { padding: 4px 8px 24px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link svg { width: 18px; height: 18px; stroke-width: 2; }
.sidebar-link:hover { background: var(--bg-soft); color: var(--text); }
.sidebar-link.active {
  color: #fff;
}
.sidebar-link.active.nav-sinks   { background: var(--brand-lilac); }
.sidebar-link.active.nav-routes  { background: var(--brand-blue); }
.sidebar-link.active.nav-logs    { background: var(--brand-pink); }
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,210,63,0.2), rgba(255,71,126,0.18));
  border: 1px solid var(--border);
  font-size: 13px;
}
.sidebar-footer h4 { font-size: 14px; margin: 0 0 4px; }
.sidebar-footer p  { color: var(--text-soft); margin: 0 0 10px; font-size: 12px; }

/* App header */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.app-header-title { display: flex; align-items: center; gap: 12px; }
.app-header-title h1 {
  font-size: 20px; margin: 0;
  font-family: var(--font-head); font-weight: 600;
}
.app-header-actions { display: flex; align-items: center; gap: 10px; }

.menu-btn { display: none; }

/* Main content */
.app-content {
  padding: 28px 32px 60px;
  max-width: 1280px;
  width: 100%;
}

/* View header (per tab) */
.view-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.view-header h2 {
  font-size: 26px; margin: 0 0 4px;
  font-family: var(--font-head); font-weight: 600;
}
.view-header p { color: var(--text-soft); margin: 0; font-size: 14px; }

/* ============ ROW CARD (sinks, routes) ============ */
.row-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.row-card:hover { border-color: var(--brand-lilac); box-shadow: var(--shadow-sm); }
.row-card-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.row-card-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-lilac));
  color: #fff;
}
.row-card-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.row-card-text { min-width: 0; }
.row-card-text h4 {
  font-size: 15px; margin: 0 0 2px;
  font-family: var(--font-body); font-weight: 600;
}
.row-card-text p {
  font-size: 13px; color: var(--text-mute); margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  background: var(--bg-soft); color: var(--text-soft);
}
.tag.green  { background: rgba(6,214,160,0.15);  color: #038C66; }
.tag.pink   { background: rgba(255,71,126,0.15); color: #C72852; }
.tag.blue   { background: rgba(58,134,255,0.15); color: #1F5FCD; }
.tag.yellow { background: rgba(255,210,63,0.2);  color: #8C6D00; }
.tag.lilac  { background: rgba(131,56,236,0.15); color: #6321BC; }
[data-theme="dark"] .tag.green  { color: #46F0C0; }
[data-theme="dark"] .tag.pink   { color: #FF85A6; }
[data-theme="dark"] .tag.blue   { color: #7AAEFF; }
[data-theme="dark"] .tag.yellow { color: #FFE285; }
[data-theme="dark"] .tag.lilac  { color: #B380F2; }

.icon-action {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mute);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-action:hover { background: var(--bg-soft); color: var(--text); }
.icon-action.danger:hover { background: rgba(255,71,126,0.12); color: var(--brand-pink); }
.icon-action svg { width: 16px; height: 16px; stroke-width: 2; }

/* ============ STAT / USAGE CARDS ============ */
.usage-card {
  background: linear-gradient(135deg, rgba(255,210,63,0.16), rgba(131,56,236,0.10));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.usage-card .usage-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--brand-yellow); color: #1B1A23;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.usage-card .usage-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.usage-card .usage-text { flex: 1; min-width: 200px; }
.usage-card h4 { font-size: 16px; margin: 0 0 2px; }
.usage-card p  { color: var(--text-soft); margin: 0; font-size: 14px; }

/* ============ LOGS TABLE ============ */
.logs-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.logs-table { width: 100%; border-collapse: collapse; }
.logs-table thead th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px; font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.logs-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}
.logs-table tbody tr:last-child td { border-bottom: none; }
.logs-table tbody tr.event-row { cursor: pointer; transition: background 0.15s ease; }
.logs-table tbody tr.event-row:hover { background: var(--bg-soft); }
.logs-table tbody tr.detail-row td { padding: 0; background: var(--surface-2); }
.logs-table .detail-content { padding: 18px; }
.logs-table .detail-content pre {
  background: var(--bg-soft);
  padding: 12px; border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 6px 0 0;
  border: 1px solid var(--border-soft);
}
.logs-table .ev-id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-soft); }

/* status bubble (badge) */
.status-bubble {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.badge-delivered {
  background: rgba(6,214,160,0.15); color: #038C66; border-color: rgba(6,214,160,0.25);
}
.badge-failed {
  background: rgba(255,71,126,0.15); color: #C72852; border-color: rgba(255,71,126,0.25);
}
.badge-pending {
  background: rgba(58,134,255,0.15); color: #1F5FCD; border-color: rgba(58,134,255,0.25);
}
.badge-rejected { color: var(--brand-yellow); }
[data-theme="dark"] .badge-rejected { color: #FFE285; }
[data-theme="dark"] .badge-delivered { color: #46F0C0; }
[data-theme="dark"] .badge-failed    { color: #FF85A6; }
[data-theme="dark"] .badge-pending   { color: #7AAEFF; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.time-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-soft);
}
.time-pill svg { width: 13px; height: 13px; stroke-width: 2; opacity: 0.6; }

.attempts-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-soft);
}

/* ============ DLQ ============ */
.dlq-section {
  margin-top: 32px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dlq-section h3 {
  font-size: 17px; margin: 0 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.dlq-section h3 .dlq-bubble {
  width: 30px; height: 30px; border-radius: 10px;
  background: rgba(255,71,126,0.15); color: var(--brand-pink);
  display: inline-flex; align-items: center; justify-content: center;
}
.dlq-section h3 .dlq-bubble svg { width: 16px; height: 16px; stroke-width: 2; }

/* ============ DOCS ============ */
.docs-shell {
  max-width: 900px; margin: 0 auto;
  padding: 32px 32px 80px;
}
.docs-shell h1 { font-size: 36px; margin-bottom: 8px; }
.docs-shell h2 { font-size: 22px; margin: 36px 0 12px; }
.docs-shell p  { color: var(--text-soft); }
.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.endpoint-card .ep-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.endpoint-card .method {
  display: inline-block;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 600;
}
.endpoint-card .method.GET    { background: rgba(58,134,255,0.15);  color: #1F5FCD; }
.endpoint-card .method.POST   { background: rgba(6,214,160,0.18);   color: #038C66; }
.endpoint-card .method.DELETE { background: rgba(255,71,126,0.15);  color: #C72852; }
[data-theme="dark"] .endpoint-card .method.GET    { color: #7AAEFF; }
[data-theme="dark"] .endpoint-card .method.POST   { color: #46F0C0; }
[data-theme="dark"] .endpoint-card .method.DELETE { color: #FF85A6; }
.endpoint-card .ep-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--text);
}
.endpoint-card p { margin: 0; font-size: 14px; color: var(--text-soft); }

pre.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  margin: 12px 0;
}

/* ============ MISC ============ */
.muted { color: var(--text-mute); font-size: 13px; }
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-soft);
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mute);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.5; margin-bottom: 10px; }
.empty-state p { margin: 0; font-size: 14px; }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-lilac);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Stripe banner */
.upgrade-banner {
  background: linear-gradient(135deg, var(--brand-pink), var(--brand-lilac));
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.upgrade-banner h4 { color: #fff; margin: 0 0 2px; font-size: 15px; }
.upgrade-banner p  { color: rgba(255,255,255,0.85); margin: 0; font-size: 13px; }

/* Form panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.panel h3 { font-size: 16px; margin: 0 0 14px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 25;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .menu-btn { display: inline-flex; }
  .app-content { padding: 20px 18px 60px; }
  .app-header { padding: 14px 18px; }
  .flow-row { grid-template-columns: 1fr; gap: 14px; }
  .flow-arrow { transform: rotate(90deg); }
  .panel-row { grid-template-columns: 1fr; }
  .topnav { padding: 14px 18px; }
}

@media (max-width: 560px) {
  .row-card { flex-direction: column; align-items: flex-start; }
  .row-card-actions { width: 100%; justify-content: flex-end; }
  .hero { padding-top: 32px; }
}

/* ============ COMPAT — match actual class names in routes/web.js ============ */

/* Global safety: any SVG inside small containers must not exceed parent */
svg { max-width: 100%; max-height: 100%; }
button svg, a svg, .pill svg, .icon-btn svg, .icon-action svg { width: 1em; height: 1em; }

/* ---- Landing layout containers ---- */
.landing-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 80px;
  text-align: center;
}
.hero-ctas {
  display: inline-flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 8px;
}
.footer {
  max-width: 1200px; margin: 0 auto;
  padding: 32px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--text-soft); margin: 0 10px; }

/* ---- Pill buttons: ensure pill+btn-* combination works ---- */
.pill { font-family: var(--font-body); }

/* ---- Flow mockup (real markup) ---- */
.flow {
  margin: 56px auto 72px;
  max-width: 920px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  gap: 24px;
  align-items: center;
  text-align: left;
}
.flow-node {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.flow-node-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--brand-yellow), var(--brand-pink));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.flow-node-mark svg { width: 26px; height: 26px; stroke-width: 2; }
.flow-node-label {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: var(--text);
}
.flow-link {
  display: flex; align-items: center; justify-content: center;
}
.flow-link-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--brand-pink), var(--brand-lilac));
  color: #fff;
  font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow);
}
.flow-link-chip svg { width: 14px; height: 14px; stroke-width: 2.5; }
.flow-dest { display: flex; flex-direction: column; gap: 10px; }
.flow-dest-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.flow-dest-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.flow-dest-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.flow-dest-icon.pink  { background: var(--brand-pink); }
.flow-dest-icon.blue  { background: var(--brand-blue); }
.flow-dest-icon.amber { background: var(--brand-yellow); color: #1B1A23; }
.flow-dest-icon.indigo{ background: var(--brand-lilac); }
.flow-dest-label { font-size: 14px; font-weight: 500; color: var(--text); }

/* ---- Feature cards (real classes) ---- */
.feature { text-align: left; }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: #fff;
}
.feature-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.feature-icon.indigo { background: var(--brand-lilac); }
.feature-icon.sky    { background: var(--brand-blue); }
.feature-icon.rose   { background: var(--brand-pink); }
.feature-icon.amber  { background: var(--brand-yellow); color: #1B1A23; }

/* ---- Pricing (real markup uses .plan / .price / .plan-featured) ---- */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 760px;
  margin: 32px auto 56px;
  text-align: left;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.plan h3 { font-size: 20px; margin: 0 0 8px; font-family: var(--font-head); }
.plan .price {
  font-family: var(--font-head); font-weight: 600; font-size: 38px;
  color: var(--text);
  margin: 4px 0 16px;
}
.plan .price span { font-size: 14px; color: var(--text-mute); font-weight: 400; }
.plan ul {
  list-style: none; padding: 0; margin: 0 0 8px;
}
.plan ul li {
  font-size: 14px; color: var(--text-soft);
  padding: 5px 0 5px 22px;
  position: relative;
}
.plan ul li::before {
  content: '✓';
  position: absolute; left: 0; top: 5px;
  color: var(--brand-green); font-weight: 700;
}
.plan-featured {
  border-color: var(--brand-lilac);
  box-shadow: var(--shadow);
}

/* ---- Top nav refinements ---- */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft); color: var(--text-soft);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(6,214,160,0.25);
}

/* ============ DASHBOARD COMPAT ============ */

/* Sidebar header / close / toggle */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 24px;
}
.sidebar-close {
  display: none;
  background: transparent; border: none;
  color: var(--text-soft);
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.sidebar-close svg { width: 18px; height: 18px; }
.sidebar-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.sidebar-toggle svg { width: 18px; height: 18px; }

/* Side nav link (matches .side-nav-link not .sidebar-link) */
.side-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  transition: background 0.15s ease, color 0.15s ease;
}
.side-nav-link svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.side-nav-link:hover { background: var(--bg-soft); color: var(--text); }
.side-nav-link.active { color: #fff; }
.side-nav-link.active.nav-sinks  { background: var(--brand-lilac); }
.side-nav-link.active.nav-routes { background: var(--brand-blue); }
.side-nav-link.active.nav-logs   { background: var(--brand-pink); }

/* App header refinements */
h1.app-header-title { font-family: var(--font-head); font-size: 20px; margin: 0; font-weight: 600; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-lilac));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
  overflow: hidden;
}
.avatar svg { width: 18px; height: 18px; stroke-width: 2; }
.tier-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(6,214,160,0.18); color: #038C66;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid rgba(6,214,160,0.25);
}
[data-theme="dark"] .tier-pill { color: #46F0C0; }

/* View shell / sub text */
.view-shell { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sub { color: var(--text-soft); margin: 0; font-size: 14px; }
.text-muted { color: var(--text-mute); font-size: 14px; }
.text-secondary { color: var(--text-soft); }

.stat-label {
  font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
  margin-bottom: 4px;
}

/* Usage card (real classes) */
.usage-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  width: 100%;
  margin-bottom: 12px;
}
.usage-bar-track {
  width: 100%; height: 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-pink), var(--brand-lilac));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Sink status icon */
.sink-status-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-blue));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.sink-status-icon svg { width: 28px; height: 28px; stroke-width: 2; }

/* Add route form */
.add-route-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  display: flex; align-items: end; gap: 12px;
  flex-wrap: wrap;
}
.field { flex: 1; min-width: 240px; }

/* Route specifics */
.route-name { font-weight: 600; font-size: 14px; color: var(--text); }
.route-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--text-mute);
  word-break: break-all;
}
.route-actions { display: flex; gap: 8px; align-items: center; }

.tag-active { background: rgba(6,214,160,0.15); color: #038C66; }
.tag-method { background: var(--bg-soft); color: var(--text-soft); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
[data-theme="dark"] .tag-active { color: #46F0C0; }

/* Onboarding callout */
.onboarding {
  background: linear-gradient(135deg, rgba(255,210,63,0.16), rgba(255,71,126,0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.onboarding h2 { font-size: 18px; margin: 0 0 12px; }
.onboarding ol { margin: 0; padding-left: 22px; }
.onboarding li { margin-bottom: 8px; color: var(--text-soft); font-size: 14px; }
.onboarding code {
  background: var(--surface); padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 12px;
}

/* Logs: attempt details */
.attempt-line {
  display: flex; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  align-items: baseline;
}
.att-num { color: var(--text-mute); flex-shrink: 0; }
.att-err { color: var(--brand-pink); }
.att-time { color: var(--text-mute); flex-shrink: 0; }
.att-route-id { color: var(--text-mute); }

.id-cell { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-soft); }

.copy-btn {
  background: transparent; border: 1px solid var(--border);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s ease;
}
.copy-btn:hover { background: var(--bg-soft); color: var(--text); }
.copy-btn svg { width: 14px; height: 14px; stroke-width: 2; }

.dlq-badge {
  display: inline-block;
  background: rgba(255,71,126,0.15); color: #C72852;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  margin-left: 6px;
}
[data-theme="dark"] .dlq-badge { color: #FF85A6; }

/* Logs table wrap */
.logs-table-wrap { overflow-x: auto; }

/* ============ DOCS COMPAT ============ */
.docs-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}
.docs-side {
  position: sticky; top: 32px;
  align-self: start;
  display: flex; flex-direction: column; gap: 4px;
}
.docs-side a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 14px; font-weight: 500;
}
.docs-side a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.docs-side-title {
  font-family: var(--font-head); font-weight: 600;
  color: var(--text-mute);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0 12px 8px;
}
.docs-section { margin-bottom: 36px; }
.docs-section h2 {
  font-family: var(--font-head); font-size: 22px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.endpoint {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: start;
}
.endpoint:last-child { border-bottom: none; }
.endpoint-path {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-all;
}
.endpoint-desc { font-size: 13px; color: var(--text-soft); }
.endpoint-desc code, .endpoint-path code, code {
  background: var(--bg-soft);
  padding: 1px 6px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--text);
}
.endpoint-auth {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  background: var(--bg-soft); color: var(--text-mute);
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 11px; font-weight: 500;
}
.method {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  text-align: center;
  min-width: 64px;
}
.method-get    { background: rgba(58,134,255,0.15);  color: #1F5FCD; }
.method-post   { background: rgba(6,214,160,0.18);   color: #038C66; }
.method-delete { background: rgba(255,71,126,0.15);  color: #C72852; }
[data-theme="dark"] .method-get    { color: #7AAEFF; }
[data-theme="dark"] .method-post   { color: #46F0C0; }
[data-theme="dark"] .method-delete { color: #FF85A6; }

/* ============ MOBILE ============ */
@media (max-width: 900px) {
  .sidebar-close { display: inline-flex; }
  .sidebar-toggle { display: inline-flex; }
  .flow { grid-template-columns: 1fr; gap: 16px; }
  .flow-link { transform: rotate(90deg); padding: 4px 0; }
  .docs-shell { grid-template-columns: 1fr; gap: 24px; }
  .docs-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .add-route-form { flex-direction: column; align-items: stretch; }
}

/* ================================================================ */
/* ============ MINIMAL THEME — flat, ultra-spacious ============== */
/* ================================================================ */
/* Loaded last so it wins the cascade. Strips card chrome from every
   surface, adds generous whitespace + hairline dividers, neutralizes
   colored icon bubbles to mono thin-stroke, and refines typography. */

:root {
  --hair: 1px solid var(--border-soft);
  --ink:  var(--text);
  --ink-2: var(--text-soft);
  --ink-3: var(--text-mute);
}

/* ---- Typography refinements ---- */
body { font-size: 15.5px; line-height: 1.6; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.015em; }
.hero-title { font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; }
.hero-sub   { color: var(--ink-2); font-size: 17px; max-width: 560px; margin-left: auto; margin-right: auto; }
.view-header h2 { font-weight: 500; letter-spacing: -0.015em; }

/* Refined icon strokes everywhere */
svg { stroke-width: 1.5 !important; }
.fh-logo-mark svg, .live-dot { stroke-width: 0 !important; }

/* ---- Landing: flow diagram — drop card chrome ---- */
.flow {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 56px 0 64px;
  margin: 48px auto 88px;
}
.flow-node, .flow-dest-row {
  background: transparent;
  border: 0;
  padding: 14px 0;
}
.flow-dest { gap: 0; }
.flow-dest-row + .flow-dest-row { border-top: var(--hair); }
.flow-node-mark,
.flow-link-chip,
.flow-dest-icon {
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none;
  border-radius: 0;
}
.flow-link-chip {
  border: var(--hair);
  color: var(--ink-2) !important;
  font-weight: 500;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--bg) !important;
}
.flow-node-mark { width: 40px; height: 40px; margin-bottom: 14px; }
.flow-dest-icon { width: 28px; height: 28px; }

/* ---- Landing: features — no cards, just clean blocks ---- */
.features {
  gap: 56px 64px;
  margin: 0 auto 96px;
  max-width: 1080px;
  padding: 0 8px;
}
.feature {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  transform: none !important;
  box-shadow: none !important;
}
.feature:hover { transform: none; box-shadow: none; }
.feature-icon {
  background: transparent !important;
  color: var(--ink) !important;
  width: 28px; height: 28px;
  margin-bottom: 20px;
  border-radius: 0;
}
.feature h3 { font-weight: 500; font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.feature p  { color: var(--ink-2); font-size: 15px; line-height: 1.55; }

/* ---- Landing: pricing — no cards, hairline divider between plans ---- */
.pricing {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
  max-width: 760px;
  margin: 56px auto 88px;
  padding: 0;
  position: relative;
}
.pricing::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  background: var(--border-soft);
  width: 1px;
  align-self: stretch;
}
.plan {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 40px;
  position: relative;
}
.plan + .plan { padding-left: 40px; }   /* (the divider lives in ::before) */
.plan-featured { border-color: transparent; box-shadow: none; }
.plan h3 { font-weight: 500; font-size: 15px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px; }
.plan .price { font-weight: 400; font-size: 44px; letter-spacing: -0.025em; margin: 0 0 24px; }
.plan .price span { font-size: 14px; color: var(--ink-3); }
.plan ul { margin: 0 0 28px; }
.plan ul li { color: var(--ink-2); padding: 7px 0 7px 22px; font-size: 14px; }
.plan ul li::before { color: var(--ink-3); content: "—"; font-weight: 400; top: 7px; }

@media (max-width: 720px) {
  .pricing { grid-template-columns: 1fr; }
  .pricing::before { display: none; }
  .plan { padding: 24px 0; border-bottom: var(--hair); }
  .plan:last-child { border-bottom: 0; }
}

/* ---- Top nav — make pill buttons calmer ---- */
.live-pill {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0;
  font-weight: 500;
}

/* ---- Dashboard: row-cards become divider rows ---- */
.row-card {
  background: transparent !important;
  border: 0 !important;
  border-bottom: var(--hair) !important;
  border-radius: 0 !important;
  margin-bottom: 0;
  padding: 22px 4px;
  box-shadow: none !important;
  transition: none;
}
.row-card:hover { background: transparent !important; box-shadow: none !important; border-color: var(--border-soft) !important; }
.row-card-icon {
  background: transparent !important;
  color: var(--ink) !important;
  width: 24px; height: 24px;
  border-radius: 0;
}
.row-card-text h4 { font-weight: 500; font-size: 15px; }
.row-card-text p  { font-size: 13px; color: var(--ink-3); }

/* ---- Stat labels (usage card, account page) ---- */
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ---- Usage card — flat ---- */
.usage-card {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  padding: 8px 0 24px;
  margin-bottom: 32px;
  border-bottom: var(--hair) !important;
  gap: 14px;
}
.usage-card .usage-icon { display: none; }
.usage-card h4 { font-weight: 500; font-size: 14px; color: var(--ink-2); margin: 0 0 6px; }
.usage-card p  { color: var(--ink-3); font-size: 13px; }
.usage-bar-track { height: 4px; }

/* ---- Panel + form blocks — flat ---- */
.panel, .add-route-form, .dlq-section, .endpoint-card, .notice, .onboarding {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 24px;
}
.panel, .add-route-form { padding-top: 16px !important; border-top: var(--hair) !important; }
.dlq-section { margin-top: 40px; padding-top: 20px !important; border-top: var(--hair) !important; }
.dlq-section h3 .dlq-bubble {
  background: transparent !important;
  color: var(--ink) !important;
  width: 20px; height: 20px;
}
.endpoint-card { padding: 16px 0 !important; border-bottom: var(--hair) !important; }
.endpoint-card:last-child { border-bottom: 0 !important; }

/* ---- Onboarding — flat panel, no gradient ---- */
.onboarding {
  padding: 24px 0 !important;
  border-top: var(--hair) !important;
  border-bottom: var(--hair) !important;
}

/* ---- Logs table — drop the framed box, just the rows ---- */
.logs-table {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.logs-table thead th {
  background: transparent;
  border-bottom: var(--hair);
  padding: 12px 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.logs-table tbody td {
  border-bottom: var(--hair);
  padding: 16px 4px;
}

/* ---- Status badges — flat dots + text instead of pills ---- */
.status-bubble {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-weight: 500;
  font-size: 13px;
}
.status-bubble::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  background: currentColor;
}
.badge-delivered { color: var(--brand-green); }
.badge-failed    { color: var(--brand-pink); }
.badge-pending   { color: var(--brand-blue); }

/* ---- Tags / tier-pill — flat micro-text ---- */
.tag, .tier-pill, .dlq-badge, .tag-active, .tag-method {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.tag::before, .tier-pill::before, .dlq-badge::before, .tag-active::before {
  content: "● ";
  color: currentColor;
  font-size: 9px;
  vertical-align: 2px;
  margin-right: 4px;
}

/* ---- Avatar: flat ---- */
.avatar {
  background: transparent !important;
  border: 0 !important;
  color: var(--ink) !important;
}
.avatar {
  border: var(--hair) !important;
  border-radius: 999px !important;
}

/* ---- Sidebar — drop colored active backgrounds ---- */
.side-nav-link.active,
.side-nav-link.active.nav-sinks,
.side-nav-link.active.nav-routes,
.side-nav-link.active.nav-logs {
  background: transparent !important;
  color: var(--ink) !important;
  font-weight: 500;
  position: relative;
}
.side-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--ink);
}
.sidebar { border-right: var(--hair); }
.sidebar-footer {
  background: transparent !important;
  border: 0 !important;
  border-top: var(--hair) !important;
  border-radius: 0 !important;
  padding: 16px 6px;
}
.app-header { border-bottom: var(--hair); }

/* ---- Sink status icon — neutral ---- */
.sink-status-icon {
  background: transparent !important;
  color: var(--ink) !important;
  border: var(--hair) !important;
  border-radius: 999px !important;
  width: 44px; height: 44px;
}

/* ---- Pill buttons: keep primary CTA but flatten the rest ---- */
.pill.btn-ghost {
  background: transparent;
  border: var(--hair);
  color: var(--ink);
}
.pill.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.pill.btn-indigo {
  background: var(--ink);
  color: var(--bg);
  border: 0;
}

/* ---- Auth pages: flatten the row-card wrapper ---- */
.row-card[style*="padding:2rem"] {
  display: block !important;   /* reset base .row-card flex so header/form/footer stack vertically */
  border: 0 !important;
  border-bottom: 0 !important;
  padding: 16px 0 !important;
}

/* ---- Hero CTAs spacing ---- */
.hero-ctas { margin-top: 32px; gap: 14px; }

/* Section spacing */
.landing-main { padding-bottom: 96px; }
.section-title { margin: 64px 0 32px; }

/* ================================================================ */
/* ============ FIRST-RUN RESHAPE — modal, reveal panel, ========== */
/* ============ onboarding checklist, sink-context bar   ========== */
/* ================================================================ */
/* Kept in the ink/hairline vocabulary of the minimal theme above:
   flat surfaces, 1px dividers, no gradients — with the two existing
   "pop" accents (yellow = create, pink = add) left alone. */

/* ---- Endpoint row (readonly field + copy button) ----
   Used by sinkCardHtml's ingest URL row and reused below for the reveal
   panel + onboarding hint; wasn't previously given its own layout rule. */
.endpoint-row { display: flex; align-items: center; gap: 8px; }
.endpoint-row input { flex: 1; min-width: 0; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,14,20,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fh-modal-backdrop-in 0.15s ease;
}
.modal {
  background: var(--surface);
  border: var(--hair);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 26px;
  animation: fh-modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-family: var(--font-head); font-weight: 500;
  font-size: 19px; letter-spacing: -0.01em;
  color: var(--ink); margin: 0;
}
.modal .field { margin-bottom: 16px; }
.modal-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: var(--hair);
}
@keyframes fh-modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fh-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { animation: none; }
  .usage-bar-fill { transition: none; }
  .view-shell { animation: none; }
}

/* ---- Inline field / form errors (FE-1) ---- */
.field-error {
  color: var(--red);
  font-size: 12.5px;
  font-weight: 500;
  margin: 6px 0 0;
}
p.field-error[role="alert"] {
  background: rgba(255,71,126,0.08);
  border: 1px solid rgba(255,71,126,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 4px 0 0;
}

/* Explains what a field does when that isn't obvious — e.g. that a secret is
   optional for generic sinks, and what setting one turns on. */
.field-hint {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 6px 0 0;
}

/* Destructive-confirmation body inside the shared sink modal. */
.danger-note {
  background: rgba(255,71,126,0.08);
  border: 1px solid rgba(255,71,126,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.danger-note ul { margin: 8px 0 0; padding-left: 18px; }
.danger-note li { margin-bottom: 2px; }

/* ---- Plan-limit upsell (FE-1 / BE-1 403 contract) ---- */
.upsell-box {
  background: var(--bg-soft);
  border: var(--hair);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 4px 0 0;
}
.upsell-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-2, var(--text-mute));
  margin: 0 0 6px;
}
.upsell-box p { font-size: 13.5px; color: var(--ink-2, var(--text-soft)); margin: 0 0 14px; line-height: 1.5; }
.upsell-box .pill { font-size: 13.5px; }

/* ---- API-key reveal panel (FE-2) ---- */
.reveal-panel { display: flex; flex-direction: column; gap: 18px; }
.reveal-warning {
  background: rgba(255,210,63,0.14);
  border: 1px solid rgba(255,210,63,0.45);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink, var(--text));
}
[data-theme="dark"] .reveal-warning { background: rgba(255,210,63,0.1); border-color: rgba(255,210,63,0.3); }
.reveal-warning strong { font-weight: 700; }
.copy-status {
  font-size: 12px;
  min-height: 15px;
  margin: 6px 0 0;
  color: var(--text-mute);
}
.reveal-confirm {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-2, var(--text-soft));
  cursor: pointer;
  user-select: none;
}
.reveal-confirm input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--brand-lilac);
  cursor: pointer;
}

/* ---- Shared sink-context selector (FE-4) ----
   One always-visible element driving both Routes and Logs; hidden on
   Sinks and when there's only one sink (no ambiguity to resolve). */
.sink-context-bar {
  align-items: center;
  gap: 10px;
  padding: 0 4px 16px;
  margin-bottom: 8px;
  border-bottom: var(--hair);
}
.sink-context-bar label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3, var(--text-mute));
  margin: 0;
}
.sink-context-bar select {
  width: auto;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 13.5px;
}

/* ---- Onboarding checklist — first-run state on the Sinks view (FE-3) ---- */
.onboarding-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.onboarding h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0;
}
.onboarding h2 svg { width: 16px; height: 16px; color: var(--brand-yellow); }
.onboarding-steps { list-style: none; margin: 0; padding: 0; }
.onboarding-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  font-size: 13.5px; line-height: 1.5;
  color: var(--ink-3, var(--text-mute));
  border-bottom: var(--hair);
  transition: color 0.15s ease;
}
.onboarding-step:last-child { border-bottom: 0; }
.onboarding-step .step-check {
  flex-shrink: 0;
  width: 17px; height: 17px;
  margin-top: 1px;
  color: var(--border);
  transition: color 0.15s ease;
}
.onboarding-step .step-check svg { display: block; width: 100%; height: 100%; }
.onboarding-step.complete { color: var(--ink); }
.onboarding-step.complete .step-check { color: var(--brand-green); }
.onboarding-step code {
  display: inline-block;
  margin-top: 6px;
  word-break: break-all;
}
.onboarding-step .copy-btn { margin-left: 6px; vertical-align: middle; }
.manual-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3, var(--text-mute));
  border: var(--hair);
  border-radius: 999px;
  vertical-align: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .onboarding-step, .onboarding-step .step-check { transition: none; }
}

@media (max-width: 900px) {
  .modal { padding: 20px; }
  .sink-context-bar select { min-width: 0; flex: 1; }
}

/* ---- Status labels (dot + word) ----
   The status is text, so it needs text contrast (WCAG 1.4.3, 4.5:1), which the
   brand accents do not reach on the light background (brand green is 1.8:1).
   Light mode uses darker shades of the same hues; dark mode uses light tints.
   The dark rules are required, not duplicates: without them these light rules
   would outrank the older dark-mode badge colours. */
.status-bubble.badge-delivered { color: #047857; }
.status-bubble.badge-failed    { color: #C72852; }
.status-bubble.badge-pending   { color: #1F5FCD; }
.status-bubble.badge-rejected,
.status-bubble.badge-partial   { color: #A15C07; }
[data-theme="dark"] .status-bubble.badge-delivered { color: #46F0C0; }
[data-theme="dark"] .status-bubble.badge-failed    { color: #FF85A6; }
[data-theme="dark"] .status-bubble.badge-pending   { color: #7AAEFF; }
[data-theme="dark"] .status-bubble.badge-rejected,
[data-theme="dark"] .status-bubble.badge-partial   { color: #FFE285; }
.status-bubble { white-space: nowrap; }

/* ---- Sink card ----
   Head row (icon, name, meta | delete), then the ingest URL full width. */
.row-card.sink-card { flex-direction: column; align-items: stretch; gap: 16px; }
.sink-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sink-card .sink-status-icon { width: 40px; height: 40px; margin: 0; flex-shrink: 0; }
.sink-card .sink-status-icon svg { width: 20px; height: 20px; }
.sink-card .row-card-actions { width: auto; }
.sink-name { font-family: var(--font-body); font-weight: 500; font-size: 17px; color: var(--text); margin: 0; }
.sink-meta { font-size: 13px; color: var(--text-mute); margin: 2px 0 0; }
.sink-endpoint label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute);
}

/* ---- Routes empty state (not a .row-card, so it never counts as a route) ---- */
.routes-empty {
  padding: 22px 4px;
  font-size: 14px;
  color: var(--text-mute);
  border-bottom: var(--hair);
}

/* ---- Inline text button (checklist links to other tabs) ---- */
.link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

/* ============ PLAIN-ENGLISH GUIDE / FAQ ============ */
.guide-main { padding-bottom: 40px; }
.guide-col {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: left;
}
.guide-col-wide { max-width: 1000px; margin: 0 auto; padding: 0 32px; text-align: left; }

.guide-masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 52px 0 44px;
}
.guide-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 12px;
}
.guide-masthead h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  max-width: 18ch;
}
.guide-standfirst {
  margin: 16px 0 0;
  font-size: 18px;
  color: var(--text-soft);
  max-width: 58ch;
  line-height: 1.6;
}

.guide-band { padding: 52px 0; }
.guide-band-tint { background: var(--surface); border-block: 1px solid var(--border); }
.guide-band h2 { font-size: 25px; margin: 0 0 6px; }
.guide-subhead { margin: 0 0 22px; color: var(--text-mute); font-size: 15px; }
.guide-prose p { margin: 0 0 18px; max-width: 62ch; color: var(--text-soft); font-size: 16px; line-height: 1.7; }
.guide-prose p:last-child { margin-bottom: 0; }
.guide-prose strong { color: var(--text); font-weight: 600; }

/* Diagram */
.guide-figure { margin: 8px 0 0; }
.guide-figwrap { overflow-x: auto; }
svg.guide-flow { display: block; width: 100%; min-width: 520px; height: auto; }
.guide-flow .n-box { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.guide-flow .n-hub { fill: var(--brand-lilac); stroke: var(--brand-lilac); stroke-width: 2; }
.guide-flow .n-label { fill: var(--text); font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.guide-flow .n-hub-label { fill: #fff; }
.guide-flow .n-sub { fill: var(--text-mute); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; }
.guide-flow .n-hub-sub { fill: rgba(255,255,255,0.82); }
.guide-flow .n-wire { stroke: var(--text-mute); stroke-width: 1.6; fill: none; }
.guide-flow .n-head { fill: var(--text-mute); }
.guide-figcaption { margin: 14px 0 0; font-size: 14px; color: var(--text-mute); max-width: 62ch; }

/* Reason + use-case cards */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-band-tint .guide-card { background: var(--bg); }
.guide-card h3 { font-size: 17px; margin: 0 0 7px; }
.guide-card p { margin: 0; font-size: 14.5px; color: var(--text-soft); line-height: 1.6; }
.guide-card p strong { color: var(--text); font-weight: 600; }
.guide-card-who {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-lilac);
  margin: 0 0 8px; font-weight: 600;
}
[data-theme="dark"] .guide-card-who { color: #B380F2; }

/* FAQ */
.faq-group { margin-top: 38px; }
.faq-group:first-of-type { margin-top: 26px; }
.faq-group-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 14px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.qa { padding: 17px 0; border-bottom: 1px solid var(--border-soft); }
.qa:last-child { border-bottom: 0; }
.qa h3 { font-size: 17px; margin: 0 0 7px; line-height: 1.35; }
.qa p { margin: 0 0 11px; font-size: 15.5px; color: var(--text-soft); max-width: 64ch; line-height: 1.65; }
.qa p:last-child { margin-bottom: 0; }
.qa strong { color: var(--text); font-weight: 600; }

.guide-limits {
  margin: 14px 0 0;
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.guide-limits th {
  text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mute); font-weight: 600;
  padding: 0 16px 7px 0;
  border-bottom: 1px solid var(--border);
}
.guide-limits td {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.guide-limits td:first-child { color: var(--text); font-weight: 600; }

.guide-cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .guide-col, .guide-col-wide { padding: 0 20px; }
  .guide-masthead { padding: 36px 0 32px; }
  .guide-band { padding: 40px 0; }
}

/* ============ TIER PILL VARIANTS (global fix) ============ */
/* The minimal-theme overlay above flattens every pill to dot-prefixed
   micro-text with background/border/padding stripped via !important, so the
   honest differentiator here is ink color: Starter keeps the green ink, Free
   reads neutral. The words FREE and STARTER differ and the dot ::before uses
   currentColor, so meaning never rides on color alone. Appended after the
   overlay on purpose so these win the cascade. */
/* #02714F not the brand #038C66: the overlay above strips the pill background,
   leaving this ink bare on the page ground, and #038C66 only reaches ~4.0:1
   there. #02714F clears 4.5:1 on the ground, on white, and on the green tint. */
.tier-pill.starter { color: #02714F; }
[data-theme="dark"] .tier-pill.starter { color: #46F0C0; }
.tier-pill.free { color: var(--text-soft); }

/* ============ ACCOUNT PAGE ============ */
/* Same flat vocabulary as the reshaped dashboard: hairline dividers, no
   card chrome. Only consumables get meters; grants are table rows. */
.acct-wrap { max-width: 880px; margin: 0 auto; }
.acct-section {
  padding: 8px 0 24px;
  margin-bottom: 24px;
  border-bottom: var(--hair);
}
.acct-section:last-child { border-bottom: 0; }
.acct-section h2 { font-size: 16px; margin: 0 0 14px; }
.acct-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.acct-reset { font-size: 13px; color: var(--text-soft); }
.acct-note { font-size: 13.5px; color: var(--text-soft); line-height: 1.6; margin: 10px 0 0; max-width: 62ch; }

/* Plan card */
.plan-card-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.plan-name {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 22px;
  color: var(--text);
}
.plan-price { font-size: 14px; color: var(--text-soft); margin-top: 4px; }
.plan-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 320px; }
.plan-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  font-family: var(--font-body);
}
.plan-state svg { width: 14px; height: 14px; stroke-width: 2; }
/* Ink colours here are darker than the shared #038C66 / #8C6D00: composited
   over the light page ground these tints leave those at ~3.5:1 and ~4.3:1,
   under WCAG 1.4.3's 4.5:1 for 12px text. #02714F and #7D6100 clear it. */
.plan-state.ok { background: rgba(6,214,160,0.18); color: #02714F; }
.plan-state.warn { background: rgba(255,210,63,0.2); color: #7D6100; }
.plan-state.neutral { background: var(--bg-soft); color: var(--text-soft); }
[data-theme="dark"] .plan-state.ok { color: #46F0C0; }
[data-theme="dark"] .plan-state.warn { color: #FFE285; }

/* Usage blocks */
.usage-block { margin-top: 18px; }
.usage-block:first-of-type { margin-top: 0; }
.usage-headline {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem;
  color: var(--text-primary);
  margin: 2px 0 10px;
}
.usage-state { font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--text-soft); margin-left: 6px; }
.warn-ink { color: #8C6D00; }
[data-theme="dark"] .warn-ink { color: #FFE285; }
.warn-ink svg { width: 14px; height: 14px; stroke-width: 2; vertical-align: -2px; }
.usage-bar-fill.hot { background: linear-gradient(90deg, #EF4444, #F87171); }
.acct-rejected {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  margin: 10px 0 0;
}
.acct-cap-note { margin-top: 12px; }
.acct-cap-note .pill { margin-top: 12px; }

/* Per-sink usage rows (the truth for multi-sink accounts) */
.sink-usage-rows { margin-top: 4px; }
.sink-usage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
}
.sink-usage-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}
.sink-usage-count { color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sink-usage-rejected { color: #8C6D00; font-weight: 600; white-space: nowrap; }
[data-theme="dark"] .sink-usage-rejected { color: #FFE285; }
.usage-bar-track.sm { height: 4px; max-width: 160px; flex: 0 0 160px; }

/* Sink segments: discrete units, filled left to right. aria-hidden; the
   adjacent "N of M" text carries the meaning. */
.sink-segs { display: flex; gap: 6px; margin-top: 4px; }
.sink-segs span {
  width: 28px; height: 10px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: var(--hair);
}
.sink-segs span.on { background: var(--brand-green); border-color: transparent; }

/* Comparison table */
.compare-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td {
  padding: 10px 12px;
  border-bottom: var(--hair);
  text-align: left;
}
.compare-table th[scope="col"] { font-family: var(--font-body); font-weight: 600; color: var(--text); }
.compare-table th[scope="row"] { font-weight: 500; color: var(--text-soft); }
.compare-table td { color: var(--text); font-variant-numeric: tabular-nums; }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }
.compare-your-plan {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-soft);
}

/* Account detail rows */
.acct-rows { display: flex; flex-direction: column; }
.acct-row {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: var(--hair);
  font-size: 14px;
}
.acct-row:last-child { border-bottom: 0; }
.acct-row-label { color: var(--text-soft); font-weight: 500; }
.acct-row-value { color: var(--text); display: inline-flex; align-items: center; gap: 8px; word-break: break-all; }

/* Danger zone: quiet card, right-aligned trigger */
.acct-danger-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Sidebar nav anchors must not underline; the buttons never did. */
a.side-nav-link, a.side-nav-link:hover { text-decoration: none; }

/* Focus visibility, page-scoped minimum. The stylesheet has no global
   :focus-visible rule yet; that gap is wider than this page. */
.acct-wrap :is(a, button, input):focus-visible,
#account-delete-backdrop :is(button, input):focus-visible,
.sidebar-nav a.side-nav-link:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .sink-usage-row { flex-wrap: wrap; }
  .usage-bar-track.sm { max-width: none; flex: 1 0 100%; }
  .plan-card-row { flex-direction: column; }
  .plan-action { align-items: stretch; width: 100%; max-width: none; }
  .plan-action .pill { width: 100%; justify-content: center; }
  .acct-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ===========================================================================
   Ops dashboard (/ops)
   ---------------------------------------------------------------------------
   Operator-facing, not customer-facing: denser than the rest of the product,
   and deliberately plainer. Everything below reuses the existing tokens so
   data-theme="dark" needs no extra rules, with one addition: --brand-amber,
   which the palette lacked and which the charts need for a "warning" series
   that stays legible on both backgrounds (--brand-yellow is too light on the
   cream background to read as a line).
   =========================================================================== */
:root { --brand-amber: #D97706; }
[data-theme="dark"] { --brand-amber: #FBBF24; }

.ops-body { background: var(--bg); color: var(--text); font-family: var(--font-body); margin: 0; }

.ops-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.ops-head h1 { font-family: var(--font-head); font-size: 1.05rem; margin: 0; }
.ops-head-left { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.ops-head-right { display: flex; align-items: center; gap: 0.5rem; }
.ops-range { display: flex; gap: 0.25rem; }
.ops-range a {
  padding: 0.2rem 0.55rem; border-radius: var(--radius-pill); font-size: 0.8rem;
  color: var(--text-mute); text-decoration: none; border: 1px solid transparent;
}
.ops-range a.active { background: var(--brand-blue); color: #fff; }
.ops-range a:hover:not(.active) { border-color: var(--border); color: var(--text); }

.ops-grid {
  display: grid; gap: 1rem; padding: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.ops-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--shadow-sm);
  min-width: 0;
}
.ops-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.ops-panel-head h2 { font-family: var(--font-head); font-size: 0.95rem; margin: 0; }
.ops-signal { font-size: 0.68rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.ops-panel-body > svg { display: block; width: 100%; }
.ops-panel-note { margin-top: 0.7rem; font-size: 0.72rem; color: var(--text-mute); line-height: 1.45; }
.ops-sub { font-family: var(--font-head); font-size: 0.8rem; margin: 0.9rem 0 0.4rem; color: var(--text-soft); }

.ops-caption { display: flex; gap: 0.85rem; flex-wrap: wrap; font-size: 0.72rem; color: var(--text-mute); margin: 0.25rem 0 0.5rem; }
.ops-caption b { color: var(--text); font-weight: 600; }

.ops-kv { display: flex; flex-wrap: wrap; gap: 0.75rem 1.1rem; margin-top: 0.6rem; }
.ops-kv > div { display: flex; flex-direction: column; min-width: 62px; }
.ops-kv span { font-size: 0.68rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.03em; }
.ops-kv b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.ops-legend { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.72rem; color: var(--text-mute); margin-top: 0.3rem; }
.ops-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 0.5rem; }
.ops-legend .ops-swatch:first-child { margin-left: 0; }

.ops-empty { padding: 0.9rem; text-align: center; font-size: 0.78rem; color: var(--text-mute); background: var(--surface-2); border-radius: var(--radius-sm); }
.ops-note { margin-top: 0.5rem; font-size: 0.72rem; color: var(--text-mute); line-height: 1.5; }
.ops-note code { background: var(--surface-2); padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.9em; }

/* Bars */
.ops-bars { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
.ops-bar-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 0.5rem; }
.ops-bar-label { font-size: 0.74rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-bar-track { background: var(--surface-2); border-radius: var(--radius-pill); height: 14px; overflow: hidden; }
.ops-bar-fill { display: flex; height: 100%; border-radius: var(--radius-pill); overflow: hidden; }
.ops-bar-seg { display: block; height: 100%; }
.ops-bar-value { font-size: 0.74rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-soft); }

/* Gauge */
.ops-gauge { margin: 0.5rem 0; }
.ops-gauge-track { background: var(--surface-2); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.ops-gauge-fill { height: 100%; border-radius: var(--radius-pill); background: var(--brand-blue); }
.ops-gauge-fill.ops-warn { background: var(--brand-amber); }
.ops-gauge-fill.ops-crit { background: var(--brand-pink); }
.ops-gauge-text { font-size: 0.75rem; color: var(--text-soft); margin-top: 0.25rem; font-variant-numeric: tabular-nums; }

/* Tables */
.ops-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.74rem; }
.ops-table th { text-align: left; font-weight: 600; color: var(--text-mute); padding: 0.25rem 0.4rem; border-bottom: 1px solid var(--border); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ops-table td { padding: 0.28rem 0.4rem; border-bottom: 1px solid var(--border-soft); font-variant-numeric: tabular-nums; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-sql { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Alerts */
.ops-alerts { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; }
.ops-alerts li { display: flex; align-items: center; gap: 0.45rem; }
.ops-pill { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: var(--radius-pill); background: var(--surface-2); font-weight: 600; }

/* Status colors */
.ops-ok   { color: var(--brand-green); }
.ops-warn { color: var(--brand-amber); }
.ops-crit { color: var(--brand-pink); }
.ops-dim  { color: var(--text-mute); }
.ops-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

.ops-banner { padding: 0.6rem 1.25rem; font-size: 0.8rem; }
.ops-crit-bg { background: var(--brand-pink); color: #fff; }

.ops-foot { padding: 0.75rem 1.25rem 1.5rem; font-size: 0.72rem; line-height: 1.5; }

@media (max-width: 560px) {
  .ops-grid { grid-template-columns: 1fr; padding: 0.75rem; }
  .ops-bar-row { grid-template-columns: 84px 1fr 44px; }
}

/* ---------------------------------------------------------------------------
   Ops: environment identity
   ---------------------------------------------------------------------------
   Two deployments serve a byte-identical page. On Railway the hostname is an
   opaque container id, so without this the only way to tell a test tab from a
   production tab is to read the URL. The strip, the accent and the <title>
   tag exist so that mistake cannot be made at a glance.

   Production is the loud one on purpose: the cost of acting on production
   while believing you are in test is far higher than the reverse.
   --------------------------------------------------------------------------- */
.ops-envbar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 1.25rem; font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ops-envbar-tag { font-weight: 700; }

.ops-env-prod .ops-envbar { background: var(--brand-pink); color: #fff; }
.ops-env-prod .ops-head { border-bottom-color: var(--brand-pink); }

/* Non-production gets hazard stripes: unmistakable, and it reads as
   "scaffolding" rather than "alarm", which is what a test box should feel
   like. */
.ops-env-nonprod .ops-envbar {
  color: var(--text);
  background: repeating-linear-gradient(
    45deg,
    var(--surface-2), var(--surface-2) 10px,
    var(--bg-soft) 10px, var(--bg-soft) 20px
  );
  border-bottom: 1px solid var(--border);
}
.ops-env-nonprod .ops-envbar-tag { color: var(--brand-amber); }

/* Environment switcher. Plain links to sibling deployments; this page never
   calls them, so a peer being down costs nothing but a dead link. */
.ops-switch { display: flex; gap: 0.2rem; margin-right: 0.4rem; }
.ops-switch a, .ops-switch span {
  padding: 0.2rem 0.55rem; border-radius: var(--radius-pill);
  font-size: 0.75rem; text-decoration: none; border: 1px solid var(--border);
  color: var(--text-mute); white-space: nowrap;
}
.ops-switch a:hover { color: var(--text); border-color: var(--text-mute); }
.ops-switch span.active {
  background: var(--surface-2); color: var(--text); font-weight: 600;
  border-color: var(--text-mute);
}

@media (max-width: 720px) {
  .ops-head { flex-wrap: wrap; }
  .ops-switch { order: 3; }
}
