/* =========================================================================
   mcpmake Cloud — Styles
   ========================================================================= */

/* --- Reset --- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--color-text-dark);
  background: var(--color-bg-dark);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* --- Custom Properties --- */

:root {
  /* TYPE. Identity per `.impeccable.md` ("engineering datasheet"): headings,
     labels, figures, and chips set in the mono stack; body copy in the system
     sans stack. No webfonts — CSP is default-src 'self' and stays that way. */
  --font-sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    'Helvetica Neue', sans-serif;
  --font-mono:
    ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Menlo, Consolas,
    monospace;

  --color-bg-dark: #0a0a0f;
  --color-bg-dark-end: #12121f;
  --color-bg-light: #fafafa;
  --color-text-dark: #e4e4e7;
  --color-text-light: #1a1a2e;
  --color-text-muted: #a1a1aa;
  /* BRAND — oxide orange (`.impeccable.md`; retired the audit-flagged purple).
     Contrast obligations carried over from the purple era (M-06):
       • --color-primary is a WHITE-TEXT button/badge bg → #c2410c is ~5.2:1.
       • --color-primary-hover doubles as accent TEXT on the dark bg → #ea580c
         is ~5.3:1 on #0a0a0f (the light theme overrides it darker below).
       • --color-primary-strong is the white-text HOVER bg → #9a3412 ~7.3:1. */
  --color-primary: #c2410c;
  --color-primary-hover: #ea580c;
  --color-primary-strong: #9a3412;
  --color-primary-subtle: rgba(234, 88, 12, 0.12);
  --color-border: #27272a;
  --color-border-subtle: #1e1e24;
  --color-surface: #18181b;
  --color-surface-hover: #1f1f23;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --nav-height: 64px;
  --max-width: 1200px;
  --section-padding: 96px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* THEME ROLE TOKENS. Default (no data-theme / data-theme="dark") values equal
     the colors they replaced verbatim, so the dark UI is byte-identical — the
     light theme below is purely additive. Brand (--color-primary) and status
     (success/warning/error + status dots/badges) stay constant across themes. */
  --text-heading: #fff; /* h1/h2/h3 + emphasized values — pure white on dark */
  --text-secondary: #d4d4d8;
  /* WCAG AA (M-06): #71717a on the #0a0a0f bg was ~4.09:1 — below the 4.5:1
     minimum for normal text. #85858f is ~5.4:1, still faint (below --color-text-muted)
     but readable. */
  --text-faint: #85858f;
  --text-on-accent: #fff; /* text on brand-colored buttons/badges — constant */
  --nav-bg: rgba(10, 10, 15, 0.85);
  /* Near-opaque variant for the mobile nav dropdown, which floats OVER page
     content when open (the sticky bar only needs 0.85). */
  --nav-bg-overlay: rgba(10, 10, 15, 0.98);
  --surface-raised: #0d0d14;
  --surface-raised-2: #141420;
  --surface-raised-3: #111116;
  --bg-grad-start: #0e0e16;
  --bg-grad-start-alt: #12121f;
  --border-strong: #3f3f46;

  /* Inline form notices (.auth-error / .auth-success outside the auth layout).
     Themed rather than hardcoded because these render on public pages that
     honor the light theme; the light values below are darkened so the text
     clears 4.5:1 on paper (#fca5a5 / #6ee7b7 do not). The .auth-page copies
     stay hardcoded and keep winning by specificity there. */
  --notice-error-bg: rgba(239, 68, 68, 0.1);
  --notice-error-border: rgba(239, 68, 68, 0.35);
  --notice-error-text: #fca5a5;
  --notice-success-bg: rgba(16, 185, 129, 0.1);
  --notice-success-border: rgba(16, 185, 129, 0.35);
  --notice-success-text: #6ee7b7;
}

/* LIGHT THEME — set <html data-theme="light">. Overrides only the themed tokens;
   everything else (brand purple, status colors, radii, layout) is shared. */
[data-theme='light'] {
  --color-bg-dark: #ffffff;
  --color-bg-dark-end: #f4f4f7;
  --color-bg-light: #ffffff;
  --color-text-dark: #1a1a2e;
  --color-text-light: #1a1a2e;
  --color-text-muted: #52525b;
  --color-border: #e4e4e7;
  --color-border-subtle: #ececef;
  --color-surface: #ffffff;
  --color-surface-hover: #f4f4f5;
  --color-primary-subtle: rgba(234, 88, 12, 0.1);
  /* Accent TEXT on white needs the darker shade (#ea580c is only ~3.6:1 there;
     #c2410c is ~5.2:1). Hover-bg duty stays covered by --color-primary-strong. */
  --color-primary-hover: #c2410c;

  --text-heading: #18181b;
  --text-secondary: #3f3f46;
  --text-faint: #71717a;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-bg-overlay: rgba(255, 255, 255, 0.98);
  --surface-raised: #ffffff;
  --surface-raised-2: #f7f7f8;
  --surface-raised-3: #fafafa;
  --bg-grad-start: #f3f3f7;
  --bg-grad-start-alt: #ececf2;
  --border-strong: #d4d4d8;

  /* #b91c1c ≈ 6.2:1 and #047857 ≈ 5.2:1 on the tinted white notice bg. */
  --notice-error-bg: rgba(239, 68, 68, 0.08);
  --notice-error-border: rgba(185, 28, 28, 0.3);
  --notice-error-text: #b91c1c;
  --notice-success-bg: rgba(16, 185, 129, 0.1);
  --notice-success-border: rgba(4, 120, 87, 0.3);
  --notice-success-text: #047857;
}

/* --- Nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text-heading);
}

.nav-link-subtle {
  color: var(--color-text-muted);
}

/* Hamburger toggle — hidden on desktop, revealed at narrow widths. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.nav-toggle:hover {
  color: var(--text-heading);
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--text-on-accent);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  /* Darker (not lighter) on hover so white button text keeps ≥4.5:1 (M-06).
     No glow — flat surfaces per `.impeccable.md`. */
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-dark);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-text-muted);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  position: relative;
}

/* L-01: the compact button visual is ~31px tall — below the project's 44px
   touch-target standard. Extend the HIT AREA to 44px with a transparent,
   centered overlay (clicks bubble to the button) WITHOUT inflating the visual
   fill. Matters most in nav / mobile. */
.btn-sm::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* --- Hero --- */
/* Datasheet hero (`.impeccable.md`): left-aligned two-column grid — the claim
   on the left, the real session transcript as proof on the right. Flat bg, no
   gradient, no radial glow, no centered stack. */

.hero {
  border-bottom: 1px solid var(--color-border);
  padding: 88px 24px 72px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 10fr) minmax(0, 9fr);
  gap: 64px;
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 34rem;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Session transcript (hero proof) --- */
/* Formerly the macOS-style "terminal mockup" with traffic-light dots — an
   audit-flagged AI-template marker. Now a flat, labelled transcript panel:
   proof over ornament. */

.terminal {
  background: var(--surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: left;
  overflow: hidden;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.terminal-body {
  padding: 20px 24px;
  overflow-x: auto;
}

.terminal-body pre {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.terminal-body code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.terminal-prompt {
  color: var(--color-success);
  font-weight: 700;
}

.terminal-muted {
  color: var(--text-faint);
}

.terminal-success {
  color: var(--color-success);
}

/* --- Fact strip --- */
/* Was a centered "metric strip" of boxed stats (audit-flagged). Now a quiet
   ruled line of datasheet figures: mono values, lowercase labels, left-set. */

.social-proof {
  border-bottom: 1px solid var(--color-border);
  padding: 20px 24px;
}

.social-proof-inner {
  display: flex;
  align-items: baseline;
  gap: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.social-proof-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.social-proof-number {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.social-proof-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* --- Sections --- */
/* One continuous page surface, ruled apart — no alternating dark/light bands
   (the retired .section--dark rhythm). Headers are left-set mono, numbered by
   an optional data-attribute rendered as a faint figure. */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding) 24px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.section h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  text-align: left;
  margin-bottom: 40px;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.section h2::before {
  content: attr(data-num) ' ';
  color: var(--color-primary-hover);
  font-weight: 600;
  letter-spacing: 0;
}

/* --- Steps (How it works) --- */
/* Ruled columns, mono numerals — no icon tiles, no hover-lift cards. */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  border-top: 2px solid var(--color-border);
  padding-top: 20px;
}

.step-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-hover);
  margin-bottom: 12px;
}

.step h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.step p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* --- Capability spec sheet --- */
/* Replaces the ten-card icon "bento wall": grouped definition-list rows, read
   like a datasheet. Term column in mono; no icons, no cards. */

.spec-groups {
  display: grid;
  gap: 56px;
}

.spec-group-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.spec-list {
  margin: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 5fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--color-border-subtle);
}

.spec-row:first-of-type {
  border-top-color: var(--color-border);
}

.spec-row dt {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

.spec-row dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Comparison Table --- */

.comparison-wrapper {
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table tbody td {
  padding: 16px 20px;
  color: var(--color-text-dark);
  border-bottom: 1px solid var(--color-border-subtle);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-name {
  font-weight: 500;
  color: var(--text-heading);
}

.comparison-highlight {
  background: var(--color-primary-subtle);
}

.comparison-highlight td {
  border-bottom-color: transparent;
}


.comparison-highlight td:last-child {
  color: var(--color-success);
}

/* --- Pricing --- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 24px;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.pricing-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.pricing-card--featured {
  border-color: var(--color-primary);
}

.pricing-card--featured:hover {
  border-color: var(--color-primary-hover);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--text-on-accent);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: 20px;
}

.pricing-card-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.pricing-tier-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pricing-amount {
  color: var(--text-heading);
  margin-bottom: 8px;
}

.pricing-currency {
  font-size: 1.25rem;
  font-weight: 600;
  vertical-align: top;
  position: relative;
  top: 6px;
}

.pricing-value {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.pricing-period {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.pricing-tagline {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 28px;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--color-text-dark);
  padding: 7px 0;
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}

.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.pricing-card-footer {
  text-align: center;
}

.pricing-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 10px;
}

/* --- CTA Section --- */
/* Flat closing block: same ruled rhythm as the rest of the page, no gradient
   or radial glow. */

.cta-section {
  padding: var(--section-padding) 24px;
}

.cta-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.cta-section h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.cta-sub {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 36rem;
}

/* --- Footer --- */

.footer {
  border-top: 1px solid var(--color-border);
  padding: 64px 24px 32px;
  background: var(--color-bg-dark);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  padding: 4px 0;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--color-primary-hover);
}

.footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 24px;
}

/* --- Status Colors (used by dashboard) --- */

.status-green {
  color: #22c55e;
}
.status-gray {
  color: var(--text-faint);
}
.status-red {
  color: var(--color-error);
}
.status-yellow {
  color: #eab308;
}

/* =========================================================================
   Admin Panel
   ========================================================================= */

/* --- Admin Shell (sidebar + main) --- */

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.admin-sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
}

.admin-sidebar-logo {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.admin-sidebar-logo:hover {
  color: var(--color-primary-hover);
}

.admin-sidebar-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-hover);
  background: var(--color-primary-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition:
    background 0.12s,
    color 0.12s;
}

.admin-nav-link:hover {
  background: var(--color-surface-hover);
  color: var(--text-heading);
}

.admin-nav-link.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary-hover);
}

.admin-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.admin-nav-link.active svg {
  opacity: 1;
}

.admin-nav-link--back {
  margin-top: auto;
}

.admin-sidebar-footer {
  padding: 12px 8px 16px;
  border-top: 1px solid var(--color-border);
}

.admin-sidebar-user {
  padding: 8px 12px;
  margin-top: 8px;
}

.admin-sidebar-email {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.admin-signout-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
}

.admin-signout-btn:hover {
  color: var(--color-error);
}

.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  min-width: 0;
}

/* --- Admin Page Structures --- */

.admin-page-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.admin-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.admin-page-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Stats Grid --- */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- System Info --- */

.system-info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.system-info h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 16px;
  text-align: left;
}

.system-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.system-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.system-info-row:last-child {
  border-bottom: none;
}

.system-info-row dt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.system-info-row dd {
  font-size: 0.875rem;
  color: var(--color-text-dark);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
}

/* --- Admin Table --- */

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  user-select: none;
}

.admin-table thead th.sortable {
  cursor: pointer;
  transition: color 0.12s;
}

.admin-table thead th.sortable:hover {
  color: var(--text-heading);
}

.admin-table thead th.sorted-asc::after {
  content: ' \2191';
}

.admin-table thead th.sorted-desc::after {
  content: ' \2193';
}

.admin-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-dark);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: var(--color-surface-hover);
}

.admin-table code {
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--color-primary-hover);
}

.admin-table-empty {
  text-align: center;
  padding: 32px 16px !important;
  color: var(--color-text-muted);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* --- Search Input --- */

.search-input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-dark);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--color-primary);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

/* --- Plan Badge --- */

.plan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-badge--free {
  background: rgba(113, 113, 122, 0.15);
  color: #a1a1aa;
}

.plan-badge--hobbyist {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.plan-badge--pro {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
}

.plan-badge--team {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.plan-badge--enterprise {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

/* --- Admin Badge --- */

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

/* --- Admin Select & Danger Button --- */

.admin-select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-dark);
  color: var(--color-text-dark);
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
}

.admin-select:focus {
  border-color: var(--color-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.inline-action {
  display: inline-flex;
}

/* --- Status dot in table --- */

.status-dot {
  font-weight: 600;
  font-size: 0.8125rem;
}

/* --- Admin links (row + back) --- */

.admin-row-link {
  color: var(--color-text-dark);
  text-decoration: none;
  font-weight: 500;
}

.admin-row-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.admin-back-link {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.admin-back-link:hover {
  color: var(--text-heading);
}

/* --- Health panel --- */

.health-panel,
.chart-panel,
.credit-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.health-panel h2,
.chart-panel h2,
.credit-panel h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 16px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
}

.health-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.health-badge--ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.health-badge--bad {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.health-badge--neutral {
  background: var(--color-surface-hover);
  color: var(--color-text-dark);
  text-transform: none;
}

.health-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.health-name {
  font-size: 0.875rem;
  color: var(--text-heading);
}

.health-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.health-alerts {
  margin-top: 16px;
  padding: 12px 16px;
  list-style: disc inside;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-size: 0.8125rem;
}

/* --- Chart panels --- */

.chart-panel-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-panel-header h2 {
  margin-bottom: 0;
}

.chart-panel-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.failure-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.chart-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-dark);
}

.chart-box-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart--sparkline {
  height: 48px;
}

.chart--bars {
  height: 80px;
}

.chart--dual {
  height: 140px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.chart-swatch {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.chart-swatch--a {
  background: var(--color-primary-hover);
}

.chart-swatch--b {
  background: var(--color-error);
}

.chart-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}

.chart-empty code {
  font-family: var(--font-mono, monospace);
  color: var(--color-text-dark);
}

/* --- Credit form --- */

.credit-form {
  margin-top: 16px;
}

.credit-form-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.credit-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.credit-form-field .search-input {
  width: 200px;
  margin-bottom: 0;
}

.credit-form-actions {
  display: flex;
  gap: 8px;
}

.ledger-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
}

/* --- Telemetry --- */

.telemetry-count {
  font-weight: 700;
  color: var(--text-heading);
}

.telemetry-error {
  max-width: 360px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  word-break: break-word;
}

/* --- Admin error log --- */

.admin-error-stack,
.admin-error-context {
  margin: 8px 0 0;
  padding: 8px 10px;
  max-height: 320px;
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.5;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.telemetry-error details > summary {
  cursor: pointer;
}

/* =========================================================================
   Dashboard
   ========================================================================= */

/* --- Dashboard Shell (sidebar + main) --- */

.dashboard-body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-logo {
  display: block;
  padding: 20px 20px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo:hover {
  color: var(--color-primary-hover);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition:
    background 0.12s,
    color 0.12s;
}

.sidebar-link:hover {
  background: var(--color-surface-hover);
  color: var(--text-heading);
}

.sidebar-link.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary-hover);
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 8px 12px;
}

.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
}

.sidebar-email {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
}

.sidebar-logout:hover {
  color: var(--color-error);
}

.dashboard-main {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  min-width: 0;
}

/* --- Dashboard Header --- */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.dashboard-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin: 0;
}

.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color 0.12s;
}

.breadcrumb-link:hover {
  color: var(--color-primary-hover);
}

.breadcrumb-sep {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* --- Server Cards --- */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.server-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition:
    border-color 0.15s,
    transform 0.15s;
}

.server-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.server-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}

.server-card-name:hover {
  color: var(--color-primary-hover);
}

.server-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.server-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-card-actions form {
  display: inline;
}

/* --- Status Badge --- */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.status-running {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.status-stopped {
  background: rgba(113, 113, 122, 0.15);
  color: #a1a1aa;
}

.status-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.status-building {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

/* --- Empty State --- */

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-muted);
}

.empty-state-icon {
  margin-bottom: 16px;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.empty-state-icon svg {
  display: inline-block;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

/* --- Detail Page --- */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.detail-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.detail-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
}

.detail-value-lg {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 16px;
  text-align: left;
}

/* --- Endpoint --- */

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.endpoint-url {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
  font-size: 0.875rem;
  color: var(--color-primary-hover);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-display {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
  font-size: 0.8125rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}

/* --- Config Tabs --- */

.config-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.config-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.12s,
    border-color 0.12s;
}

.config-tab:hover {
  color: var(--text-heading);
}

.config-tab.active {
  color: var(--color-primary-hover);
  border-bottom-color: var(--color-primary);
}

.config-content {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 20px;
}

.config-content pre {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-x: auto;
}

.config-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
  color: var(--text-secondary);
}

.config-copy {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* --- Log Viewer --- */

.log-viewer-wrapper {
  margin-top: 8px;
}

.log-viewer {
  background: var(--surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  max-height: 600px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.log-viewer div {
  padding: 1px 0;
}

.log-connecting {
  color: var(--color-text-muted);
  font-style: italic;
}

/* --- Metrics --- */

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.metrics-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.metrics-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-dark);
}

.metrics-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Bar Chart --- */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-chart-label {
  flex: 0 0 140px;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
}

.bar-chart-track {
  flex: 1;
  height: 20px;
  background: var(--color-surface);
  border-radius: 4px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.bar-chart-value {
  flex: 0 0 48px;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
}

/* --- Create Form --- */

.create-form-wrapper {
  max-width: 560px;
}

.create-form .form-group {
  margin-bottom: 1.25rem;
}

.create-form .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--color-text-dark);
}

.create-form .form-group input[type='text'] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-dark);
  color: var(--color-text-dark);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s;
}

.create-form .form-group input[type='text']:focus {
  border-color: var(--color-primary);
}

/* Shared form controls. Sized to visually match .btn (padding 12px 24px,
   0.9375rem, radius 8px) so inputs/selects/textareas line up with the buttons
   beside them instead of rendering at the tiny UA default. */
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-dark);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

select.form-input {
  cursor: pointer;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

.form-hint-inline {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.85em;
}

/* --- Dropzone --- */

.dropzone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s;
  cursor: pointer;
}

.dropzone:hover,
.dropzone-active {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  pointer-events: none;
}

.dropzone-content svg {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--color-text-muted);
}

.dropzone-content p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.dropzone-link {
  color: var(--color-primary-hover);
  font-weight: 500;
}

.dropzone-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--color-text-dark);
  font-size: 0.875rem;
  pointer-events: none;
}

.dropzone-selected svg {
  color: var(--color-primary-hover);
}

.dropzone-clear {
  pointer-events: all;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.dropzone-clear:hover {
  color: var(--color-error);
}

/* --- Flash Messages --- */

.flash-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.flash-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.flash-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* --- Focus States --- */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Skip to Content --- */

.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-to-content:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: var(--color-primary);
  color: white;
  z-index: 1000;
  display: block;
  text-align: center;
}

/* --- Error Pages --- */

.error-page {
  text-align: center;
  padding: 120px 24px 80px;
  max-width: 520px;
  margin: 0 auto;
}

.error-page h1 {
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.error-page h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.error-page p {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Alpine.js cloak --- */

[x-cloak] {
  display: none !important;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .terminal {
    max-width: 640px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .server-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 64px;
  }

  .sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .dashboard-body {
    flex-direction: column;
  }

  .dashboard-main {
    margin-left: 0;
    padding: 24px 20px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
  }

  .sidebar-divider {
    display: none;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .bar-chart-label {
    flex: 0 0 100px;
  }

  .admin-sidebar {
    width: 200px;
  }

  .admin-main {
    margin-left: 200px;
    padding: 24px 20px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-page-header h1 {
    font-size: 1.25rem;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .nav-links {
    gap: 16px;
  }

  .hero {
    padding: 48px 20px 40px;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .terminal-body {
    padding: 16px;
  }

  .terminal-body pre {
    font-size: 0.6875rem;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  .comparison-table {
    font-size: 0.8125rem;
  }

  .comparison-table thead th,
  .comparison-table tbody td {
    padding: 12px 14px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-proof-inner {
    gap: 16px 32px;
  }
}

@media (max-width: 480px) {
  /* Reveal the hamburger and turn the nav into a tap-to-toggle panel that
     drops down below the bar, so Features/Pricing/Docs/Sign-in stay reachable. */
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 16px 16px;
    background: var(--nav-bg-overlay);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links--open {
    display: flex;
  }

  /* Full-width, comfortably tall tap targets in the dropdown. */
  .nav-links a:not(.btn) {
    padding: 12px 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-links .btn-sm {
    min-height: 44px;
    padding: 11px 16px;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .terminal {
    border-radius: var(--radius-md);
  }

  .pricing-value {
    font-size: 2.5rem;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .admin-shell {
    flex-direction: column;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
  }

  .admin-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }

  .admin-nav-link--back {
    margin-top: 0;
  }

  .admin-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
  }

  .admin-sidebar-user {
    margin-top: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .admin-sidebar-email {
    margin-bottom: 0;
  }
}

/* ===========================================================================
   Documentation pages (/docs)
   =========================================================================== */

.docs-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  background: #ffffff;
  color: var(--color-text-light);
  min-height: calc(100vh - var(--nav-height));
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  flex: 0 0 232px;
  width: 232px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.docs-sidebar-home {
  font-weight: 600;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.docs-sidebar-group {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar-cat {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 4px 10px;
}

.docs-sidebar-link {
  color: #3f3f52;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}

.docs-sidebar-link:hover,
.docs-sidebar-home:hover {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.docs-sidebar-link.active,
.docs-sidebar-home.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

.docs-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 820px;
  line-height: 1.7;
}

/* Prose */
.prose h1 { font-size: 2rem; margin: 0 0 16px; line-height: 1.2; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; padding-top: 8px; border-top: 1px solid #ececf1; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 10px; }
.prose h4 { font-size: 1.02rem; margin: 22px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0; }
.prose a { color: var(--color-primary); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 700; }
.prose hr { border: none; border-top: 1px solid #ececf1; margin: 32px 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f3f3f7;
  color: #5b21b6;
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre {
  background: #14141c;
  color: #e4e4e7;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 8px 16px;
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #3f3f52;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  border: 1px solid #e4e4ea;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.prose thead th {
  background: #f7f7fa;
  font-weight: 700;
}

/* Docs index cards */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}

.docs-card {
  display: block;
  padding: 18px;
  border: 1px solid #e4e4ea;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-light);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.12);
}

.docs-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--color-primary); }
.docs-card p { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.5; }

@media (max-width: 860px) {
  .docs-layout { flex-direction: column; gap: 8px; padding: 24px 16px 56px; }
  .docs-sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ececf1;
    margin-bottom: 16px;
  }
  .docs-sidebar-group { margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .docs-sidebar-cat { display: none; }
}

/* =========================================================================
   Reduced motion
   =========================================================================

   Honor the user's OS-level "reduce motion" preference: disable smooth
   scrolling and neutralize the decorative transitions/animations (hover
   lifts, fades, bar growth). Kept near-instant rather than fully 0s so
   functional state changes still register. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Family-A-led pricing section (homepage) ───────────────────────────── */
/* Lead under a section <h2>; muted, centered. */
.section-sub {
  max-width: 40rem;
  margin: -28px 0 40px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}
/* Managed-hosting (Family B) add-on block, below the Family A cards. */
.pricing-addon {
  max-width: var(--max-width);
  margin: 56px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}
.pricing-addon h3 {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}
.pricing-addon .section-sub {
  margin-top: 0;
  margin-bottom: 28px;
}
.pricing-addon-note {
  max-width: 42rem;
  margin: 28px 0 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* --- Input support matrix (capability-manifest.ts) --- */

.adapter-level {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.adapter-level--supported {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.adapter-level--acceptance_review {
  color: var(--color-primary-hover);
  background: var(--color-primary-subtle);
  border-color: rgba(234, 88, 12, 0.3);
}
.adapter-level--assisted_beta {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}
.adapter-level--experimental {
  color: var(--color-text-muted);
  background: rgba(161, 161, 170, 0.12);
  border-color: rgba(161, 161, 170, 0.3);
}

/* --- Maintenance-PR proof block (private beta) --- */

.proof-block {
  max-width: 46rem;
  border-left: 2px solid var(--color-warning);
  padding-left: 28px;
}
.proof-block h2 {
  margin: 12px 0 16px;
}
.proof-block .section-sub {
  margin: 0;
}
.state-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.state-chip--private-beta {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- Theme toggle (TODO 1244) --- */

.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--text-heading);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--color-surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Light-mode legibility (TODO 1244 review): the status/flash backgrounds are
   low-alpha tints that composite to near-white in light mode, so their
   dark-tuned pastel TEXT colors become unreadable. Override them with darker,
   on-white-readable variants; dark mode keeps the originals. */
[data-theme='light'] .flash-success {
  color: #047857;
}
[data-theme='light'] .flash-error {
  color: #b91c1c;
}
[data-theme='light'] .plan-badge--free,
[data-theme='light'] .status-stopped {
  color: #52525b;
}
[data-theme='light'] .plan-badge--hobbyist {
  color: #1d4ed8;
}
[data-theme='light'] .plan-badge--pro {
  color: #6d28d9;
}
[data-theme='light'] .plan-badge--team,
[data-theme='light'] .status-building {
  color: #b45309;
}
[data-theme='light'] .plan-badge--enterprise,
[data-theme='light'] .health-badge--ok,
[data-theme='light'] .status-running {
  color: #047857;
}
[data-theme='light'] .health-badge--bad,
[data-theme='light'] .status-error {
  color: #b91c1c;
}

/* =========================================================================
   Utility classes (CSP hardening: replace inline `style=` attributes so
   style-src can drop 'unsafe-inline'. Values mirror the exact declarations
   the inline styles used — including their var() references — to keep
   computed styles identical. Keep `.u-m-0` before the directional margins
   so compositions like "u-m-0 u-mb-075" resolve the way `margin:0 0 .75rem`
   did.)
   ========================================================================= */

/* Margin utilities carry !important for the same precedence reason as the
   color utilities below — the inline styles they replace overrode descendant
   rules like `.detail-section h2 { margin-bottom }`. All are declared here in
   one block so within the group the usual later-wins order still applies
   (e.g. "u-m-0 u-mb-075" composes like `margin:0 0 .75rem` did). */
.u-m-0 { margin: 0 !important; }
.u-my-05 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.u-mt-025 { margin-top: 0.25rem !important; }
.u-mt-035 { margin-top: 0.35rem !important; }
.u-mt-05 { margin-top: 0.5rem !important; }
.u-mt-075 { margin-top: 0.75rem !important; }
.u-mt-1 { margin-top: 1rem !important; }
.u-mt-15 { margin-top: 1.5rem !important; }
.u-mt-2 { margin-top: 2rem !important; }
.u-mb-025 { margin-bottom: 0.25rem !important; }
.u-mb-035 { margin-bottom: 0.35rem !important; }
.u-mb-05 { margin-bottom: 0.5rem !important; }
.u-mb-075 { margin-bottom: 0.75rem !important; }
.u-mb-1 { margin-bottom: 1rem !important; }
.u-mb-125 { margin-bottom: 1.25rem !important; }
.u-ml-035 { margin-left: 0.35rem !important; }
.u-ml-05 { margin-left: 0.5rem !important; }
.u-ml-1 { margin-left: 1rem !important; }

.u-inline { display: inline; }
.u-inline-block { display: inline-block; }
.u-block { display: block; }
.u-hidden { display: none; }
.u-flex { display: flex; }
.u-flex-col { flex-direction: column; }
.u-flex-wrap { flex-wrap: wrap; }
.u-items-start { align-items: flex-start; }
.u-items-center { align-items: center; }
.u-items-end { align-items: flex-end; }
.u-justify-between { justify-content: space-between; }
.u-gap-025 { gap: 0.25rem; }
.u-gap-05 { gap: 0.5rem; }
.u-gap-06 { gap: 0.6rem; }
.u-gap-1 { gap: 1rem; }
.u-flex-1 { flex: 1; }
.u-flex-2 { flex: 2; }
.u-minw-0 { min-width: 0; }
.u-minw-180 { min-width: 180px; }
.u-minw-220 { min-width: 220px; }
.u-minw-240 { min-width: 240px; }
.u-minw-280 { min-width: 280px; }

.u-w-100 { width: 100%; }
.u-w-auto { width: auto; }
.u-w-160 { width: 160px; }
.u-w-200 { width: 200px; }
.u-maxw-420 { max-width: 420px; }
.u-maxw-480 { max-width: 480px; }
.u-maxw-600 { max-width: 600px; }
.u-scroll-160 { max-height: 160px; overflow: auto; }
.u-scroll-320 { max-height: 320px; overflow: auto; }
.u-bordered { border: 1px solid var(--border-color); border-radius: 6px; }

.u-center { text-align: center; }
.u-right { text-align: right; }
.u-nowrap { white-space: nowrap; }
.u-prewrap { white-space: pre-wrap; }
.u-break-all { word-break: break-all; }
.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-upper { text-transform: uppercase; }
.u-capitalize { text-transform: capitalize; }
.u-mono { font-family: monospace; }
.u-ls-01 { letter-spacing: 0.1em; }
.u-fs-075 { font-size: 0.75rem; }
.u-fs-08 { font-size: 0.8rem; }
.u-fs-09 { font-size: 0.9rem; }
.u-fs-1 { font-size: 1rem; }
.u-fw-400 { font-weight: 400; }
.u-fw-500 { font-weight: 500; }
.u-fw-600 { font-weight: 600; }
/* The color utilities carry !important because the inline styles they replace
   overrode descendant component rules like `.metrics-table tbody td { color }`
   (higher specificity than a single class) — this preserves that precedence. */
.u-muted { color: var(--text-muted) !important; }
.u-danger { color: #e5484d !important; }
.u-warn { color: #f5a623 !important; }
.u-color-inherit { color: inherit !important; }
.u-pointer { cursor: pointer; }
.u-p-06-125 { padding: 0.6rem 1.25rem; }
/* Non-interactive "Current plan"-style buttons. */
.u-inert { opacity: 0.6; cursor: default; }
.u-list-plain { list-style: none; margin: 0; padding: 0; }

/* --- Small components extracted from repeated inline styles --- */

/* Static copy pages (legal, contact, tools): centered readable column. */
.copy-page { margin: 0 auto; padding: 2rem 1.25rem; line-height: 1.65; }
.copy-page--640 { max-width: 640px; }
.copy-page--720 { max-width: 720px; }
.copy-page--760 { max-width: 760px; }
.copy-page--820 { max-width: 820px; }

/* Body links on the copy pages. `a { color: inherit }` in the reset left these
   indistinguishable from surrounding prose (a WCAG 1.4.1 problem); .btn-styled
   links are excluded so their own fill/border keeps winning. */
.copy-page a:not(.btn) {
  color: var(--color-primary-hover);
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-line: underline;
  text-underline-offset: 0.15em;
}
.copy-page a:not(.btn):hover {
  text-decoration-color: currentColor;
}

/* Inline notices outside the auth layout. `.auth-error` / `.auth-success` are
   emitted by the contact form, the /tools preview, and the dashboard build
   poller, but style.css only defined them under `.auth-page` — everywhere else
   they rendered as bare text. Base rules here; the `.auth-page` copies still
   win by specificity, so auth pages are unchanged. */
.auth-error,
.auth-success {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.auth-error {
  background: var(--notice-error-bg);
  border-color: var(--notice-error-border);
  color: var(--notice-error-text);
}
.auth-success {
  background: var(--notice-success-bg);
  border-color: var(--notice-success-border);
  color: var(--notice-success-text);
}
.auth-error a,
.auth-success a {
  color: inherit;
  text-decoration: underline;
}

/* --- Contact page (pages/contact.hbs) ---
   The fields reuse the shared .form-label / .form-input controls, so this block
   only carries layout: the ruled card, the name/email pair, and the submit.
   Flat surface, 1px rule, small radius per `.impeccable.md`. */

.contact-header { margin-bottom: 1.75rem; }
.contact-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}
.contact-header h1 { margin-bottom: 0.5rem; }
.contact-header .contact-lede { max-width: 52ch; font-size: 0.95rem; }

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
}
.contact-form .form-group { margin-bottom: 1.25rem; }
/* Name + email share a row on anything wider than a phone; the honeypot's
   wrapper is display:none and sits outside this grid, so it adds no track. */
.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
}
@media (max-width: 560px) {
  .contact-form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.25rem; }
}

.contact-textarea {
  min-height: 170px;
  resize: vertical;
}

.contact-submit {
  width: 100%;
  margin-top: 0.25rem;
}
.contact-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.9rem;
}

/* Bordered inline card (onboarding checklist, incoming transfers). */
.panel-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.panel-card--warning { border-color: var(--warning, #b8860b); }

/* Warning accent on a detail card (pending ownership transfer). */
.detail-card--warning { border-color: var(--warning, #b8860b); }

/* Onboarding checklist rows; --done strikes the step through. */
.onboarding-step { display: flex; align-items: center; gap: 0.6rem; }
.onboarding-step--done { color: var(--text-muted); text-decoration: line-through; }

/* Quota bars (billing) + generic usage bars. The fill width is dynamic —
   set from data-bar-width by static/bar-widths.js (CSSOM writes are allowed
   under style-src 'self'; inline style attributes are not). */
.quota-track {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.quota-fill { height: 100%; width: 0; background: var(--accent-color, #6366f1); transition: width 0.3s; }
.quota-fill--warn { background: #f5a623; }
.quota-fill--over { background: #e5484d; }

/* Reachability / live-status dots (server detail, sync pages). */
.probe-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.probe-dot--up { background: #3fb950; }
.probe-dot--down { background: #f85149; }
.probe-dot--unknown { background: #8b949e; }

/* 8px health dot on server cards (ok / warn / down-or-unknown). */
.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.health-dot--ok { background: #30a46c; }
.health-dot--warn { background: #f5a623; }
.health-dot--neutral { background: #8b8d98; }

/* Server-type chip on server cards (API / Browser). */
.type-chip {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
}

/* Small green success chip (e.g. "connected" markers). */
.chip-success {
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--success-bg, #1c3a2e);
  color: var(--success-color, #3fb950);
}

/* Sidebar notification-count badge (rendered by routes/notifications.ts). */
.notif-badge {
  background: #e5484d;
  color: var(--text-on-accent);
  border-radius: 10px;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  margin-left: 0.35rem;
}

/* One-time codes (account activation, 2FA recovery). */
.otp-code {
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  font-family: monospace;
  margin: 0.25rem 0 1rem;
}

/* Wrapped code value in its own chip (deploy token reveal). */
.code-chip {
  word-break: break-all;
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem;
  background: var(--bg-subtle, #161b22);
  border-radius: 6px;
}

/* Screenshot thumbnails (server detail analysis gallery). */
.screenshot-img {
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* Tool list rows in the MCP inspector. The doubled --active selector must
   outrank .btn-secondary:hover, exactly as the old inline style did. */
.tool-list-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
}
.tool-list-btn.tool-list-btn--active { background: var(--bg-elevated, rgba(99, 102, 241, 0.12)); }

/* Support-ticket message cards; staff replies get the tinted surface. */
.support-message {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.support-message--staff { background: var(--surface-2, #f8fafc); }

/* =========================================================================
   Auth pages (login / register / 2FA / password reset)
   Moved out of layouts/auth.hbs's former inline <style> block so the CSP can
   drop style-src 'unsafe-inline'. Scoped under .auth-page (the auth layout's
   <main>) so these rules keep applying only where the inline block did —
   notably .form-group/.form-hint here must not restyle dashboard pages.
   ========================================================================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-page .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border, #27272a);
  border-radius: 12px;
  padding: 2rem;
}
.auth-page .auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  text-align: center;
}
.auth-page .auth-card .auth-subtitle {
  color: var(--color-text-muted, #a1a1aa);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.auth-page .auth-logo {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-dark, #e4e4e7);
}
.auth-page .auth-logo:hover {
  color: var(--color-primary, #6366f1);
}
.auth-page .form-group {
  margin-bottom: 1rem;
}
.auth-page .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--color-text-dark, #e4e4e7);
}
.auth-page .form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border, #27272a);
  border-radius: 6px;
  background: var(--color-bg-dark, #0a0a0f);
  color: var(--color-text-dark, #e4e4e7);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.auth-page .form-group input:focus {
  border-color: var(--color-primary, #6366f1);
}
.auth-page .form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted, #a1a1aa);
  margin-top: 0.25rem;
}
.auth-page .auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.auth-page .auth-error a {
  color: #fca5a5;
  text-decoration: underline;
}
.auth-page .auth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.auth-page .auth-submit {
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 6px;
  background: var(--color-primary, #6366f1);
  color: var(--text-on-accent);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.auth-page .auth-submit:hover {
  background: var(--color-primary-hover, #818cf8);
}
.auth-page .auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted, #a1a1aa);
}
.auth-page .auth-footer a {
  color: var(--color-primary, #6366f1);
}
.auth-page .auth-footer a:hover {
  text-decoration: underline;
}
.auth-page .oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.auth-page .oauth-btn {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border, #27272a);
  border-radius: 6px;
  background: var(--color-bg-dark, #0a0a0f);
  color: var(--color-text-dark, #e4e4e7);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.auth-page .oauth-btn:hover {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-surface);
}
.auth-page .oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--color-text-muted, #a1a1aa);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}
.auth-page .oauth-divider::before,
.auth-page .oauth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--color-border, #27272a);
}
.auth-page .oauth-divider span {
  padding: 0 0.75rem;
}

/* =========================================================================
   New Server page source tabs
   Moved out of pages/dashboard/create.hbs's former inline <style> block
   (CSP: style-src no longer allows 'unsafe-inline'). The [x-cloak] rule it
   also carried is already defined globally above.
   ========================================================================= */

.source-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.source-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.source-tab:hover { background: var(--color-surface-hover); }
.source-tab.active {
  background: var(--color-primary);
  color: var(--text-on-accent);
}
