/* resolve404 — dark marketing styling.
 *
 * Layout proportions, type scale and rhythm mirror mobula.io:
 *   - 1100px container, ~100px section padding, tight letter-spacing
 *   - large, semibold hero (~80px) with line-height 0.9
 *   - small 14px body / 13px nav, generous whitespace
 *   - pill-shaped buttons (radius 999px)
 *   - flatter near-black surfaces with subtle borders
 * Green color scheme preserved: --accent / --accent-2 unchanged, ambient
 * hero glow still derives from them. CSP is strict (style-src 'self'), so
 * everything lives here — no inline styles anywhere.
 */

:root {
  --bg: #050a08;
  --surface: #0b1410;
  --surface-2: #101c17;
  --ink: #ffffff;
  --muted: #9aa4a0;
  --line: #1a2722;
  --accent: #22c55e;
  --accent-2: #4ade80;
  --accent-ink: #04190e;
  --bad: #ff7a8a;
  --header-bg: rgba(5, 10, 8, 0.78);
  --glow: radial-gradient(60% 60% at 50% -5%,
            color-mix(in srgb, var(--accent) 32%, transparent) 0%,
            color-mix(in srgb, var(--accent-2) 12%, transparent) 50%,
            transparent 78%);
  --radius: 14px;
  --radius-pill: 999px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* Baseline link color — overridden by .site-nav / .footer-col / .btn-*. */
a { color: var(--accent); }
a:hover { color: var(--accent-2); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Header — sticky, compact, light type (mobula uses 13px nav) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(12px);
}
.header-row { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { font-weight: 600; font-size: 0.98rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.86rem; transition: color 120ms ease; letter-spacing: 0; }
.site-nav a:hover { color: var(--ink); }
/* Nav buttons: keep button text colors (the .site-nav a rule above is more
   specific than .btn-* and would otherwise wash out the Log in button). */
.site-nav a.btn-primary, .site-nav a.btn-primary:hover { color: var(--accent-ink); }
.site-nav a.btn-ghost, .site-nav a.btn-ghost:hover { color: var(--ink); }
/* Language switcher */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 0.78rem; font-weight: 600; }
.lang-switch a { color: var(--muted); padding: 4px 8px; border-radius: var(--radius-pill); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active { color: var(--accent-ink); background: var(--accent); }
.nav-toggle { display: none; margin-left: auto; font-size: 1.4rem; background: none; border: 0; color: var(--ink); cursor: pointer; }

/* Buttons — fully pill-shaped, smaller type, no border on solid */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: var(--radius-pill);
  text-decoration: none; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; font-size: 0.88rem; line-height: 1.4;
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease, background 120ms ease;
  letter-spacing: -0.005em;
}
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface); }

/* Layout shell */
main { padding: 0 24px 120px; }
section { scroll-margin-top: 96px; }

/* Hero — large semibold headline, tight line-height, ample bottom margin */
.hero { position: relative; text-align: center; padding: 120px 0 96px; }
.hero-sm { padding: 80px 0 48px; }
.hero-glow {
  position: absolute; inset: -120px 0 auto 0; height: 520px;
  background: var(--glow); pointer-events: none; z-index: -1;
}
.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: 0.95; margin: 0 0 22px;
  letter-spacing: -0.04em; font-weight: 600;
  color: var(--ink);
  max-width: 18ch; margin-left: auto; margin-right: auto;
}
.lede { font-size: 1.05rem; color: var(--muted); max-width: 620px; margin: 0 auto 36px; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections — generous vertical rhythm */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.how, .control, .pricing-section { padding: 100px 0; border-top: 1px solid var(--line); }
h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  letter-spacing: -0.03em; margin: 0 0 14px;
  font-weight: 600; line-height: 1.05;
}
.section-head p { color: var(--muted); margin: 0; font-size: 1rem; line-height: 1.55; }

/* "How it works" steps — flatter cards, big accent counter */
.steps {
  counter-reset: step; list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.steps li {
  position: relative; color: var(--muted); font-size: 0.92rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 80px 26px 28px;
}
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 26px; top: 22px;
  font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--accent);
  letter-spacing: -0.04em;
}
.steps li strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 8px; font-weight: 600; letter-spacing: -0.01em; }

/* "You're in control" — three plain points */
.points {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 960px; margin: 0 auto;
}
.points li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.points strong { display: block; color: var(--ink); margin-bottom: 8px; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.points span { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

/* CTA band — pulled in, generous internal padding */
.cta-band {
  margin: 32px 0 80px; padding: 72px 32px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--muted); margin: 0 0 26px; font-size: 1rem; }

/* Pricing — single centered plan */
.pricing { display: flex; justify-content: center; }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 40px; max-width: 440px; width: 100%; text-align: center;
}
.plan h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.price { font-size: 0.95rem; color: var(--muted); margin: 4px 0 20px; }
.price strong { font-size: 2.8rem; color: var(--ink); font-weight: 600; letter-spacing: -0.04em; line-height: 1; display: block; margin-bottom: 4px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 28px; text-align: left; }
.plan li { padding: 12px 0 12px 28px; position: relative; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.plan li:last-child { border-bottom: 0; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Auth — narrower, more whitespace */
.auth { max-width: 420px; margin: 80px auto; }
.auth h1 { margin-top: 0; font-size: 1.8rem; letter-spacing: -0.03em; font-weight: 600; }
.auth-form, .stack { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.auth-form label, .stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 0.82rem; color: var(--muted); }
input, textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.94rem; font-family: inherit; background: var(--surface-2); color: var(--ink);
  transition: border-color 120ms ease;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-error { color: var(--bad); font-weight: 600; font-size: 0.88rem; }
.contact-form { max-width: 520px; margin: 0 auto; }

.flash {
  margin: 24px 0 0; padding: 13px 18px; border-radius: var(--radius);
  font-weight: 500; font-size: 0.9rem;
}
.flash-error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent); }
.flash-info  { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); }

/* Dashboards */
.dash { padding: 72px 0; }
.dash h1 { margin-bottom: 6px; font-size: 2rem; letter-spacing: -0.03em; font-weight: 600; }
.note { color: var(--muted); font-size: 0.88rem; }
.stat-grid { display: flex; gap: 12px; margin: 24px 0 36px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 140px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px; text-align: center;
}
.stat-num { display: block; font-size: 2rem; font-weight: 600; color: var(--accent); letter-spacing: -0.03em; line-height: 1; margin-bottom: 6px; }
/* Pipeline-lag tiles: diagnostic display-only — smaller, compact, no interactive cues.
   Explicit cursor:default + no hover/focus so they cannot be confused with the
   interactive count-tile buttons below (the #14/#21 affordance-honesty requirement). */
.stat-grid.lag { margin-bottom: 8px; }
.stat-grid.lag .stat {
  padding: 14px 12px; min-width: 110px;
  cursor: default;           /* not a button — display only */
  user-select: none;
}
.stat-grid.lag .stat:hover { background: var(--surface); border-color: var(--line); } /* no hover-lift */
.stat-grid.lag .stat-num { font-size: 1.35rem; margin-bottom: 4px; }
.stat-grid.lag .stat.stale .stat-num { color: var(--bad); }
.stat-grid.lag .stat.stale {
  background: color-mix(in srgb, var(--bad) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--bad) 30%, var(--line));
}
/* Lag tile group label */
.admin-group-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0 0 6px; opacity: 0.7;
}
.panel { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 28px; }
/* When .panel is combined with .admin-card or .admin-danger-card in the admin console,
   override the separator-style (border-top + padding-top) so the card reads as a
   self-contained elevated surface rather than a section separator. */
.admin .panel.admin-card,
.admin .panel.admin-danger-card {
  margin-top: 0; border-top: none; padding-top: 0;
}

table.data { width: 100%; border-collapse: collapse; margin: 12px 0 28px; font-size: 0.9rem; }
table.data th, table.data td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
table.data th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
/* Admin-scoped table density + enhancements: tighter sizing, vertical-align, zebra striping and hover */
.admin table.data { margin: 8px 0 24px; font-size: 0.88rem; }
.admin table.data th, .admin table.data td { padding: 10px 12px; vertical-align: middle; }
.admin table.data th { font-size: 0.72rem; letter-spacing: 0.09em; padding-top: 8px; padding-bottom: 8px; }
.admin table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.admin table.data tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  font-size: 0.76rem; font-weight: 600; line-height: 1;
}
/* Outbox delivery_status colouring — sent=accent (default), queued=muted, failed/blocked=bad. */
.badge-queued  { background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--muted); }
.badge-failed,
.badge-blocked { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
/* Admin-scoped contrast lift: raise the weak green-on-faint-green default and muted badge-queued
   without risking portal.php or api.php badge rendering (Rule 8 — both use single-line labels). */
.admin .badge         { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--accent-2); }
.admin .badge-queued  { background: color-mix(in srgb, var(--muted) 32%, transparent); color: var(--ink); }

/* htmx indicators (htmx's injected inline <style> is disabled for CSP). */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Legal pages (imprint / terms / privacy / cookies) */
.legal { max-width: 760px; margin: 72px auto; }
.legal h1 { margin: 0 0 24px; font-size: 2rem; letter-spacing: -0.03em; font-weight: 600; }
.legal h2 { font-size: 1.15rem; margin: 32px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.legal p { color: var(--muted); margin: 0 0 8px; }
.legal-notice {
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent);
  color: var(--ink); padding: 14px 18px; border-radius: var(--radius);
  margin: 0 0 32px; font-size: 0.88rem;
}
.legal-basis { margin-top: 32px; font-size: 0.82rem; opacity: 0.8; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 64px 24px 40px; color: var(--muted); font-size: 0.86rem; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col p { margin: 0; }
.footer-h { color: var(--ink); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.footer-col a { color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--ink); }
.footer-note { font-size: 0.76rem; opacity: 0.7; margin-top: 4px; }
.footer-base { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; font-size: 0.8rem; }
@media (max-width: 680px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── Funnel / G1 additions ───────────────────────────────────────────── */

/* Tighter hero when a screenshot follows it */
.hero-tight { padding: 100px 0 40px; }
.hero-sub { color: var(--muted); font-size: 0.84rem; margin: 22px 0 0; letter-spacing: 0; }

/* Hero centerpiece — a small focal mark beside the CTAs (mobula-style orb slot).
   Sits inside the hero-glow so the artwork picks up the ambient green halo. */
.hero-mark { margin: 64px auto 8px; width: 100%; max-width: 280px; display: block; }
.hero-mark img,
.hero-mark video { display: block; width: 100%; height: auto; border-radius: 50%; mix-blend-mode: screen; }

/* Two-column hero: text on the left, mark on the right (mirrors mobula.io). */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  text-align: left;
}
.hero-split .hero-text { min-width: 0; }
.hero-split h1 { max-width: 16ch; margin-left: 0; margin-right: 0; }
.hero-split .lede { margin-left: 0; margin-right: 0; max-width: 56ch; }
.hero-split .hero-actions { justify-content: flex-start; }
.hero-split .hero-mark { margin: 0; max-width: 360px; justify-self: center; }

/* Visual bands + responsive screenshots (intrinsic width/height attrs on the
   <img> give the browser the aspect ratio, so these reserve space → no CLS) */
.band { padding: 96px 0; border-top: 1px solid var(--line); }
.band-cta { text-align: center; margin: 36px 0 0; }
.shot {
  margin: 0 auto; max-width: 1000px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 12px; overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
.shot-hero { margin-top: 56px; box-shadow: 0 40px 100px -50px rgba(0,0,0,0.9); }
.shot figcaption { margin: 10px 4px 2px; text-align: center; }

/* Intake form */
.intake-section { padding: 100px 0; border-top: 1px solid var(--line); }
.intake-form { max-width: 620px; margin: 0 auto; }
.intake-form textarea { min-height: 84px; }
.links-grid {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 22px; margin: 4px 0; display: grid;
  grid-template-columns: 1fr 1fr; gap: 14px 18px;
}
.links-grid legend { color: var(--muted); font-size: 0.78rem; padding: 0 6px; font-weight: 600; letter-spacing: 0.02em; }
.intake-form .opt { color: var(--muted); font-weight: 400; font-size: 0.78rem; margin-left: 4px; }
.locale-row select {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font-size: 0.94rem; font-family: inherit;
}
.intake-form .note { text-align: center; }

/* Pricing trial line */
.trial-line {
  display: inline-block; margin: 0 0 20px; padding: 6px 14px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em;
}

/* FAQ — native <details> accordion */
.faq { max-width: 760px; margin: 12px auto 0; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 0 10px; background: var(--surface); padding: 0 20px;
}
.faq summary {
  cursor: pointer; padding: 20px 0; font-weight: 500; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.96rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 600; font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { color: var(--muted); margin: 16px 0 20px; font-size: 0.92rem; line-height: 1.65; }

/* Checkout */
.checkout { max-width: 460px; }
.sim-card {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 4px 0;
}
.sim-card legend { color: var(--muted); font-size: 0.78rem; padding: 0 6px; }
.sim-card input { width: 100%; opacity: 0.6; }

/* Confirm disclosure (cancel sub / admin destructive) */
.confirm summary { cursor: pointer; display: inline-block; }
.confirm[open] summary { margin-bottom: 12px; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 38%, transparent); }
.btn-danger:hover { border-color: var(--bad); }
/* Admin-scoped danger button hover: adds background tint for prominence without affecting portal cancel button */
.admin .btn-danger:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); }
/* Admin danger zone card — visually distinct from safe Settings panels */
.admin-danger-card {
  background: color-mix(in srgb, var(--bad) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--bad) 28%, var(--line));
  border-radius: var(--radius); margin: 0 0 16px;
}
.admin-danger-card > summary {
  padding: 16px 20px; font-weight: 600; color: var(--bad); cursor: pointer;
  display: block; list-style: none; font-size: 0.92rem;
}
.admin-danger-card > summary::-webkit-details-marker { display: none; }
.admin-danger-card[open] > summary { border-bottom: 1px solid color-mix(in srgb, var(--bad) 20%, var(--line)); }
.admin-danger-card > form,
.admin-danger-card > p { padding: 10px 20px 0; }
.admin-danger-card > form:last-child,
.admin-danger-card > p:last-child { padding-bottom: 20px; }
.cta-band .note a { color: var(--accent); }

/* ── Admin ops console / G7 ───────────────────────────────────────────── */
.admin code {
  background: var(--surface-2); padding: 2px 8px; border-radius: 6px;
  font-size: 0.84em; color: var(--accent-2);
}
.op-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 24px 0 8px; padding: 16px 0; border-top: 1px solid var(--line);
}
/* Admin card wrapper — consistent elevated surface for Settings / Op sections.
   When combined with .panel the border-top/padding-top from .panel are overridden
   so the card reads as a self-contained surface rather than a ruled separator. */
.admin-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0; margin: 0 0 14px;
}
/* <details>.admin-card: header is the <summary> */
.admin-card > summary {
  cursor: pointer; padding: 14px 20px; font-weight: 500; font-size: 0.92rem;
  color: var(--ink); display: block; list-style: none;
}
.admin-card > summary::-webkit-details-marker { display: none; }
.admin-card[open] > summary { border-bottom: 1px solid var(--line); }
.admin-card > form,
.admin-card > div.stack { padding: 16px 20px; }
/* <div>.admin-card: Alpine panel variant — toggle button + form */
.admin-card > .btn { margin: 14px 20px; }
.admin-card > form[x-show] { padding: 0 20px 16px; }
.op-form { display: inline; }
.btn-xs { padding: 5px 12px; font-size: 0.76rem; }
td.ops { white-space: nowrap; vertical-align: middle; }
td.ops .op-form, td.ops .confirm { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }
.confirm.inline { display: inline-block; }
.confirm.inline summary { color: var(--muted); font-size: 0.78rem; padding: 5px 0; }
.confirm.inline .stack { gap: 8px; margin: 8px 0; }
details.mail {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  margin: 0 0 8px; padding: 0;
}
details.mail > summary {
  cursor: pointer; font-weight: 500; font-size: 0.88rem;
  padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  list-style: none;
}
details.mail > summary::-webkit-details-marker { display: none; }
details.mail[open] > summary { border-bottom: 1px solid var(--line); }
details.mail > .form-error { margin: 0; padding: 10px 16px 0; }
details.mail > .op-form { margin: 0; padding: 10px 16px 0; display: block; }
/* op-form is inline globally but block inside a mail card for proper spacing */
.mail-body {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font: 0.82rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); background: var(--bg);
  border: none; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px;
}
.mail-body a { color: var(--accent); }

/* ── Admin console tabs (PR1, restyled PR3) ───────────────────────────── */
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 24px 0 0; padding: 0 0 0; border-bottom: 2px solid var(--line);
}
.admin-tab {
  padding: 10px 18px; border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--muted);
  font-size: 0.86rem; font-weight: 500; cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
  position: relative; bottom: -2px; /* sit on top of the bar border */
}
.admin-tab:hover { color: var(--ink); background: var(--surface-2); }
.admin-tab.is-active {
  color: var(--accent-2); background: var(--surface);
  border-color: var(--line); border-bottom-color: var(--surface);
  font-weight: 600;
}
.tab-panel { padding-top: 28px; }
/* Tab panel h2 — consistent section heading across all five tabs */
.tab-panel > h2 { margin: 0 0 20px; font-size: 1.35rem; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); }
.pipeline-alert {
  margin: 0 0 20px; padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem;
}
.pipeline-alert-ok {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.pipeline-alert-warn {
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent);
}
/* Plain-English breakdown of each lagging condition (owner request). Body text
   drops to readable ink/weight so it's not a wall of alarm-red. */
.pipeline-alert-list {
  margin: 8px 0 0; padding-left: 20px;
  font-weight: 400; font-size: 0.86rem; line-height: 1.5; color: var(--ink);
}
.pipeline-alert-list li { margin: 6px 0; }
.pipeline-alert-warn .note { margin: 10px 0 0; font-weight: 400; }
.pipeline-alert-warn em { font-style: normal; font-weight: 600; color: var(--ink); }

/* ── Admin console: vertical sidebar layout (owner request) ───────────── */
.admin-layout { display: flex; gap: 28px; align-items: flex-start; margin-top: 24px; }
.admin-layout .admin-panels { flex: 1; min-width: 0; }      /* min-width:0 lets wide tables scroll, not overflow */
.admin-layout .tab-panel { padding-top: 0; }
.admin-layout .admin-tabs {
  flex-direction: column; flex-wrap: nowrap; gap: 4px;
  margin: 0; padding: 0; border-bottom: none;
  min-width: 172px; position: sticky; top: 84px;
}
.admin-layout .admin-tab {
  width: 100%; text-align: left; bottom: 0;
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid transparent;
}
.admin-layout .admin-tab:hover { background: var(--surface-2); }
.admin-layout .admin-tab.is-active {
  background: var(--surface); color: var(--accent-2); border-color: var(--line);
}

/* ── Admin console PR2 additions ──────────────────────────────────────── */
/* Jobs Verdict cell: full text wrapped, readable, bounded width (PR2). */
.verdict-cell {
  white-space: normal; max-width: 32ch; font-size: 0.88rem;
  color: color-mix(in srgb, var(--ink) 75%, var(--muted));
  word-break: break-word;
}
/* Empty-cell neutral placeholder — reads as "empty," not as a value. */
.muted-placeholder { color: var(--muted); opacity: 0.5; user-select: none; }
/* Count-tile buttons: interactive drill-down — slightly elevated vs. lag tiles
   (--surface-2 background + accent border on hover) with explicit interactive cues.
   NOT .btn-primary so they don't compete with "Run pipeline now". */
.count-tile {
  appearance: none; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; text-align: center; font: inherit; color: var(--ink);
  padding: 20px 18px;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}
.count-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
  transform: translateY(-1px);
}
.count-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Funnel filter status bar. */
.funnel-filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; margin: 0 0 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: var(--radius); font-size: 0.88rem;
}
/* Per-client inline detail panel (stacked block, not a wide table — no new 375px overflow). */
.client-detail {
  padding: 16px 20px; margin: 2px 0 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.88rem;
}
.client-detail h3 { margin: 12px 0 10px; font-size: 1rem; font-weight: 600; color: var(--ink); }
.client-detail h4 {
  margin: 18px 0 6px; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); font-weight: 600;
}
.client-detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px;
  padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.client-detail-meta span { white-space: nowrap; }
.client-detail-ops { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.client-detail-row td { padding: 0; border-bottom: 2px solid var(--line); }
.client-open-btn { min-width: 52px; }

@media (max-width: 880px) {
  .points, .steps { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .shot { padding: 8px; }
  .how, .control, .pricing-section, .intake-section, .band { padding: 72px 0; }
  .hero { padding: 80px 0 64px; }
  .hero-tight { padding: 72px 0 32px; }
  .cta-band { padding: 56px 28px; margin: 24px 0 56px; }
  /* Stack the two-column hero on narrow screens and recenter everything;
     order: -1 lifts the mark above the text so it leads the page. */
  .hero-split { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .hero-split h1 { margin-left: auto; margin-right: auto; }
  .hero-split .lede { margin-left: auto; margin-right: auto; }
  .hero-split .hero-actions { justify-content: center; }
  .hero-split .hero-mark { order: -1; max-width: 260px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
  }
  .site-nav.open { display: flex; }
  /* Only stretch the plain text nav links — scoping by :not(.btn) keeps the
     Log in pill's 10px/22px padding, and the direct-child selector leaves the
     EN/HU language pills (which are .lang-switch > a, not direct children)
     on their own 4px/8px padding so they don't collapse into tall capsules. */
  .site-nav > a:not(.btn) { padding: 12px 0; }
  .site-nav > a.btn { margin: 10px 0 4px; }
  .site-nav > .lang-switch { margin: 8px 0 4px; }
  .hero h1 { font-size: 2.4rem; }
  h2 { font-size: 1.6rem; }
  .plan { padding: 32px 24px; }
  /* Sidebar collapses back to a horizontal wrapped tab bar on narrow screens. */
  .admin-layout { flex-direction: column; gap: 0; }
  .admin-layout .admin-tabs {
    flex-direction: row; flex-wrap: wrap; border-bottom: 2px solid var(--line);
    position: static; top: auto; min-width: 0; margin-bottom: 4px;
  }
  .admin-layout .admin-tab { width: auto; border-radius: var(--radius) var(--radius) 0 0; }
  /* Admin tap targets: ≥44px on narrow screens (blocking E3-ux criterion).
     Additive — does not alter the desktop .btn-xs padding used elsewhere. */
  .admin-tab,
  .admin .btn-xs,
  .admin .confirm.inline summary { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  /* PR2 new controls: count-tile buttons, Clear filter, Open, Back (≥44px tap targets). */
  .count-tile { min-height: 44px; }
  .funnel-filter-bar .btn-xs,
  .client-open-btn,
  .client-detail .btn-xs { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  /* PR3 new summary tap targets: Settings card disclosures + mail disclosures */
  .admin-card > summary,
  .admin-danger-card > summary,
  details.mail > summary { min-height: 44px; padding-top: 12px; padding-bottom: 12px; }
}
