/* === DESIGN TOKENS === */
:root {
  /* Bassahaulic brand palette — synthwave / retro-futuristic / underground */
  --surface:            #000000;
  --surface-dim:        #141414;
  --surface-hover:      #222222;
  --primary:            #0097FF;
  --secondary:          #E21AFF;
  --on-surface:         #FFFFFF;
  --on-surface-variant: #CCCCCC;
  --on-surface-muted:   #8a8a8a;
  --outline-variant:    #2e2e2e;
  --border-hairline:    rgba(204, 204, 204, 0.18);

  /* Backward-compat aliases — every calculator component still references these */
  --bg-primary:   var(--surface);
  --bg-card:      var(--surface-dim);
  --bg-input:     var(--surface-dim);
  --bg-hover:     var(--surface-hover);
  --color-primary: var(--primary);
  --color-accent:  var(--secondary);
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger:  #ef4444;
  --text-primary:   var(--on-surface);
  --text-secondary: var(--on-surface-variant);
  --text-muted:     var(--on-surface-muted);
  --border-subtle: var(--outline-variant);
  --border-input:  var(--outline-variant);

  --gradient-line:   linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  --gradient-submit: linear-gradient(135deg, var(--secondary), var(--primary));

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;

  --shadow-card:            0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-focus:           0 0 0 3px rgba(0, 151, 255, 0.25);
  --shadow-glow-primary:    0 0 10px rgba(0, 151, 255, 0.5);
  --shadow-glow-secondary:  0 0 10px rgba(226, 26, 255, 0.5);

  --font-display: 'Audiowide', 'Orbitron', system-ui, sans-serif;
  --font-body:    'Roboto', system-ui, sans-serif;
  --font-mono:    'Audiowide', 'Orbitron', monospace;
}

/* === LIGHT THEME OVERRIDES ===
   Applied when `<html data-theme="light">` is set (by the inline bootstrap
   in index.html, persisted in localStorage key `bh-theme`). Only tokens are
   overridden here — every individual rule already reads from var(--…), so
   the theme switch is zero-per-rule overhead.
   The brand accents stay in-family but darker on white: --primary shifts
   from #0097FF (≈3.1:1 on white, fails WCAG AA body text) to #0070CC
   (≈4.9:1, AA pass); --secondary from #E21AFF (≈3.6:1) to #A815BC (≈5.4:1). */
[data-theme="light"] {
  --surface:            #FFFFFF;
  --surface-dim:        #f5f7fa;
  --surface-hover:      #e8ebf0;
  --primary:            #0070CC;
  --secondary:          #A815BC;
  --on-surface:         #000000;
  --on-surface-variant: #4b5563;
  --on-surface-muted:   #6b7280;
  --outline-variant:    #e5e7eb;
  --border-hairline:    rgba(0, 0, 0, 0.1);

  --bg-primary:   var(--surface);
  --bg-card:      var(--surface-dim);
  --bg-input:     var(--surface);
  --bg-hover:     var(--surface-hover);
  --border-subtle: var(--outline-variant);
  --border-input:  var(--outline-variant);

  --shadow-card:           0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-focus:          0 0 0 3px rgba(0, 112, 204, 0.25);
  --shadow-glow-primary:   0 0 10px rgba(0, 112, 204, 0.35);
  --shadow-glow-secondary: 0 0 10px rgba(168, 21, 188, 0.35);
}

[data-theme="light"] body {
  background: linear-gradient(180deg, #FFFFFF 0%, #f5f7fa 100%);
}

[data-theme="light"] ::selection {
  background: rgba(0, 112, 204, 0.22);
  color: #000000;
}

/* Select dropdown caret needs to track the accent */
[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230070CC' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Source tags — the contact variant used rgba(255,255,255,…) for its border,
   which disappears on white. Flip to a dark hairline in light mode. */
[data-theme="light"] .source-tag--contact {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(107, 114, 128, 0.12);
}

/* Theme toggle button (rendered from app.js) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.theme-toggle .material-symbols-outlined { font-size: 20px; }

.app-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 4px;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(0, 151, 255, 0.3);
  color: #fff;
}

/* === MATERIAL SYMBOLS === */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  vertical-align: middle;
}

/* === TYPOGRAPHY === */
/* Audiowide is a single-weight display face (regular only) — reserve it for:
   - Real display text: h1 / h2 / h3, brand wordmark
   - Hero-sized numeric readouts (≥1.25rem) where faux-bold is invisible
   Everything else — small UI labels, buttons, chips, tab labels, badges,
   result rows — uses Roboto (var(--font-body)) with a real 700/500 weight,
   because faux-bolding Audiowide at 10–14px reads as slightly blurry. */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  line-height: 1.2;
  font-weight: 400;
}

h1 { font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.04em; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }

.mono,
.data-value {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.data-readout {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.text-glow-primary   { text-shadow: var(--shadow-glow-primary); }
.text-glow-secondary { text-shadow: var(--shadow-glow-secondary); }
.thin-border         { border: 1px solid var(--border-hairline); }

/* === SEARCH BAR ===
   Sticky-top filter used by ToolsIndex and GuidesIndex. Bleeds past the
   app-container side padding so the sticky backdrop covers content that
   scrolls behind it on mobile. */
.search-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -12px 12px;
  padding: 8px 12px;
  background: var(--surface);
}

.search-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
}

/* Selector must be more specific than the global input[type="text"] rule
   (0,0,1,1), otherwise the global `padding: 12px 14px` overrides the 42px
   side padding we need to clear the icon + clear button. */
.search-bar .search-bar-input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 42px;
  font-size: 16px; /* iOS zoom prevention */
  font-family: var(--font-body);
  background: var(--surface-dim);
  color: var(--on-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-bar .search-bar-input::placeholder {
  color: var(--on-surface-muted);
}

.search-bar-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-muted);
  font-size: 20px;
  pointer-events: none;
}

.search-bar-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.search-bar-clear:hover {
  background: var(--surface-hover);
  color: var(--on-surface);
}

.search-bar-clear .material-symbols-outlined {
  font-size: 18px;
}

.search-count {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin: 4px 4px 10px;
}

.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--on-surface-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* === BRAND HERO (top-level indexes only) ===
   Synthwave-adjacent: gradient wordmark, radial glow behind,
   horizon line underneath. Used on ToolsIndex + GuidesIndex. Detail pages
   keep the plain .page-header with a per-page <h1>. */
.brand-hero {
  position: relative;
  padding: 22px 4px 16px;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}

.brand-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 200px;
  background: radial-gradient(
    ellipse at center,
    rgba(226, 26, 255, 0.22) 0%,
    rgba(0, 151, 255, 0.12) 38%,
    transparent 70%
  );
  filter: blur(18px);
  z-index: -1;
  pointer-events: none;
}

.brand-hero-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 10vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 151, 255, 0.35))
          drop-shadow(0 0 22px rgba(226, 26, 255, 0.22));
  padding: 2px 0;
}

.brand-hero-tagline {
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.brand-hero-tagline strong {
  display: block;
  color: var(--on-surface);
  font-weight: 700;
  letter-spacing: 0.26em;
  margin-bottom: 2px;
}

.brand-hero-horizon {
  margin: 16px auto 0;
  height: 1px;
  max-width: 420px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary) 25%,
    var(--secondary) 75%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(0, 151, 255, 0.5),
    0 0 18px rgba(226, 26, 255, 0.3);
  border: none;
  opacity: 0.9;
}

[data-theme="light"] .brand-hero-wordmark {
  filter: none;
}

[data-theme="light"] .brand-hero::before {
  opacity: 0.35;
}

[data-theme="light"] .brand-hero-horizon {
  box-shadow:
    0 0 6px rgba(0, 112, 204, 0.35),
    0 0 12px rgba(168, 21, 188, 0.22);
}

/* === PAGE-HEADER HERO VARIANT ===
   Lighter detail-page version of .brand-hero: left-aligned, smaller glow,
   gradient-fill h1, eyebrow label above. Opt in via
   <div class="page-header page-header--hero">.
   Detail pages that don't opt in keep the plain .page-header. */
.page-header--hero {
  position: relative;
  padding: 18px 4px 12px;
  isolation: isolate;
  overflow: hidden;
}

.page-header--hero::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  height: 160px;
  background: radial-gradient(
    ellipse at left center,
    rgba(226, 26, 255, 0.16) 0%,
    rgba(0, 151, 255, 0.1) 38%,
    transparent 70%
  );
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
}

.page-header--hero h1 {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 400;
  letter-spacing: 0.04em;
  filter: drop-shadow(0 0 8px rgba(0, 151, 255, 0.25));
  margin-bottom: 4px;
}

[data-theme="light"] .page-header--hero h1 {
  filter: none;
}

[data-theme="light"] .page-header--hero::before {
  opacity: 0.5;
}

.page-eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--secondary);
  margin-bottom: 6px;
  line-height: 1;
}

.page-header--hero .brand-hero-horizon {
  margin: 12px 0 0;
  max-width: none;
}

/* === GRADIENT BUTTON ===
   Shares the language of .primary-cta-action. Use as .btn.btn-gradient
   for "this is the conversion action on the page" moments (Send Request,
   Open Portal, Submit Order). */
.btn-gradient {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #000;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 16px rgba(226, 26, 255, 0.18);
  transition: filter 0.15s, box-shadow 0.2s, transform 0.1s;
}

.btn-gradient:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(226, 26, 255, 0.28);
}

.btn-gradient:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

/* === SUCCESS HERO ===
   Celebration block for conversion success states (request submitted,
   order placed, message sent). Big glowing check disc + gradient title. */
.success-hero {
  position: relative;
  padding: 32px 16px 20px;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}

.success-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 240px;
  background: radial-gradient(
    circle at center,
    rgba(226, 26, 255, 0.25) 0%,
    rgba(0, 151, 255, 0.15) 38%,
    transparent 68%
  );
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

.success-hero-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 18px rgba(226, 26, 255, 0.45));
}

.success-hero-icon .material-symbols-outlined {
  font-size: 40px;
  color: #000;
  font-variation-settings: 'FILL' 1, 'wght' 600;
}

.success-hero h1 {
  display: inline-block;
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 400;
  letter-spacing: 0.04em;
  filter: drop-shadow(0 0 10px rgba(0, 151, 255, 0.3));
  margin-bottom: 6px;
}

[data-theme="light"] .success-hero h1 {
  filter: none;
}

.success-hero-sub {
  color: var(--on-surface-variant);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

/* === PRIMARY CTA (Request a Custom Design) ===
   Differentiated from the standard tool-card row. Magenta-forward since
   secondary is the "special / conversion" accent. */
.primary-cta {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(
    135deg,
    rgba(226, 26, 255, 0.1) 0%,
    rgba(0, 151, 255, 0.05) 100%
  );
  border: 1px solid rgba(226, 26, 255, 0.38);
  border-radius: var(--radius-lg);
  color: var(--on-surface);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(226, 26, 255, 0.06),
    0 4px 24px rgba(226, 26, 255, 0.1);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.primary-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 92% 10%,
    rgba(226, 26, 255, 0.15),
    transparent 55%
  );
  pointer-events: none;
}

.primary-cta:hover {
  border-color: var(--secondary);
  box-shadow:
    0 0 0 1px rgba(226, 26, 255, 0.3),
    0 8px 32px rgba(226, 26, 255, 0.18);
}

.primary-cta:active { transform: scale(0.995); }

.primary-cta-media {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(226, 26, 255, 0.22),
    rgba(0, 151, 255, 0.12)
  );
  border: 1px solid rgba(226, 26, 255, 0.28);
  flex-shrink: 0;
}

.primary-cta-media .material-symbols-outlined {
  font-size: 2rem;
  color: var(--secondary);
  filter: drop-shadow(0 0 6px rgba(226, 26, 255, 0.45));
}

.primary-cta-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.primary-cta-eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--secondary);
}

.primary-cta-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--on-surface);
}

.primary-cta-sub {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--on-surface-variant);
  margin: 2px 0 8px;
}

.primary-cta-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #000;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: filter 0.15s;
}

.primary-cta-action .material-symbols-outlined {
  font-size: 1rem;
}

.primary-cta:hover .primary-cta-action { filter: brightness(1.15); }

/* === FOCUS VISIBILITY === */
/* Global keyboard-only focus ring. :focus-visible only triggers on
   keyboard navigation (not mouse), so pointer users aren't shown outlines
   while the keyboard-accessibility story stays solid. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Inputs already handle focus via border-color + shadow — suppress the
   extra outline to avoid double-ring. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

/* === LAYOUT === */
.app-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px;
}

.page-header {
  padding: 16px 4px 12px;
}

.page-header h1 {
  font-size: 1.5rem;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 900;
}

.gradient-divider {
  height: 1px;
  background: var(--gradient-line);
  border: none;
  margin: 12px 0 4px;
  border-radius: 1px;
  opacity: 0.6;
}

/* === CARDS === */
.card {
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.card-header {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: 12px;
  letter-spacing: 0.15em;
}

/* === FORM ELEMENTS === */
label {
  display: block;
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font-size: 16px; /* iOS zoom prevention */
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 48px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

/* Strip the native up/down spinner arrows on number inputs. Every numeric
   field in this app has a `step="0.25"` or similar and users type the
   value — the tiny spinner arrows just add visual noise. */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input.error, select.error {
  border-color: var(--secondary);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--outline-variant);
  border-radius: 2px;
  outline: none;
  margin: 10px 0;
  min-height: auto;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-glow-primary);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-glow-primary);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230097FF' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.input-group {
  margin-bottom: 12px;
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.input-row > * { flex: 1; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, background 0.2s, border-color 0.2s, color 0.2s;
}

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

.btn-primary {
  background: var(--primary);
  color: #000;
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-primary);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--on-surface-variant);
}

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

.btn-sm {
  font-size: 0.625rem;
  padding: 8px 14px;
  min-height: 32px;
  letter-spacing: 0.1em;
}

/* === TOGGLE BUTTONS === */
.toggle-group {
  display: flex;
  background: var(--surface-dim);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 12px;
  min-height: 44px;
  background: transparent;
  color: var(--on-surface-variant);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: var(--primary);
  color: #000;
}

/* Admin variant: always-black chips with colored borders.
   Inactive = blue outline, active = magenta outline (brighter + glow).
   Colors are hardcoded so the look stays consistent across dark/light theme —
   admin filters are utilitarian, not part of the themed surface. */
.toggle-group--admin {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.toggle-group--admin .toggle-btn {
  flex: 1 0 auto;
  background: #000000;
  color: #0097FF;
  border: 1px solid rgba(0, 151, 255, 0.55);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.toggle-group--admin .toggle-btn:hover {
  border-color: #0097FF;
  box-shadow: 0 0 0 1px rgba(0, 151, 255, 0.4);
}

.toggle-group--admin .toggle-btn.active {
  background: #000000;
  color: #E21AFF;
  border-color: #E21AFF;
  box-shadow: 0 0 0 1px #E21AFF, 0 0 12px rgba(226, 26, 255, 0.3);
}

/* === CHIP BUTTONS === */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border: 1px solid transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.chip:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

/* === RESULTS === */
.result-card {
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 12px;
}

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

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

.result-label {
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.result-value {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result-value.success { color: var(--color-success); }
.result-value.warning { color: var(--color-warning); }
.result-value.danger  { color: var(--color-danger); }

.result-big {
  text-align: center;
  padding: 20px;
}

.result-big .value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--primary);
  text-shadow: var(--shadow-glow-primary);
  font-variant-numeric: tabular-nums;
}

.result-big .unit {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* === SUMMARY BAR === */
.summary-bar {
  display: flex;
  gap: 1px;
  background: var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid var(--border-hairline);
}

.summary-item {
  flex: 1;
  background: var(--surface-dim);
  text-align: center;
  padding: 12px 8px;
}

.summary-item .label {
  font-size: 0.5625rem;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.summary-item .value {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* === TABLE === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table th {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-hairline);
}

.data-table td {
  font-family: var(--font-body);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.data-table .highlight { color: var(--primary); font-weight: 700; }
.data-table .success   { color: var(--color-success); }
.data-table .warning   { color: var(--color-warning); }
.data-table .danger    { color: var(--color-danger); }

/* === TABS === */
.tab-bar {
  display: flex;
  background: var(--surface-dim);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  overflow-x: auto;
  margin-bottom: 12px;
  padding: 2px;
  gap: 2px;
}

.tab-btn {
  flex: 1;
  min-width: max-content;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  min-height: 40px;
  background: transparent;
  color: var(--on-surface-variant);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #000;
}

/* === STATUS BADGES === */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-ok   { background: rgba(16, 185, 129, 0.12);  color: var(--color-success); }
.badge-warn { background: rgba(245, 158, 11, 0.12);  color: var(--color-warning); }
.badge-bad  { background: rgba(239, 68, 68, 0.12);   color: var(--color-danger); }
.badge-info { background: rgba(0, 151, 255, 0.12);   color: var(--primary); }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.modal-close {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--on-surface-variant);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  min-height: 40px;
  cursor: pointer;
  margin-top: 12px;
}

/* === TOOLS INDEX (row-list layout) === */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.tool-card:hover {
  background: var(--surface-hover);
}

.tool-card:active {
  background: rgba(0, 151, 255, 0.1);
}

.tool-card .icon-slot {
  color: var(--primary);
  font-size: 1.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  transition: transform 0.15s;
}

.tool-card:hover .icon-slot {
  transform: scale(1.08);
}

.tool-card .content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-card .name {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
}

.tool-card .desc {
  font-size: 0.625rem;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  line-height: 1.3;
}

.tool-card .chevron {
  color: var(--on-surface-variant);
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* === SECTION TABS (Tools / Guides switcher) === */
.section-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 4px 0 16px;
  padding: 3px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.section-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--on-surface-variant);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: background 0.15s, color 0.15s;
}

.section-tab .material-symbols-outlined {
  font-size: 1.1rem;
}

.section-tab:hover:not(.active) {
  color: var(--primary);
}

.section-tab.active {
  background: var(--primary);
  color: #000;
}

/* === CATEGORY HEADER === */
.category-header {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin: 20px 0 6px;
  padding: 0 4px;
  border-bottom: none;
}

/* === INFO / EDUCATIONAL CONTENT === */
.article-content {
  line-height: 1.75;
  color: var(--on-surface-variant);
  font-size: 0.9375rem;
}

.article-content h2 {
  color: var(--primary);
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.article-content h3 {
  color: var(--on-surface);
  margin: 20px 0 8px;
}

.article-content p {
  margin-bottom: 14px;
}

.article-content strong {
  color: var(--on-surface);
}

.article-content ul, .article-content ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.article-content li {
  margin-bottom: 6px;
}

.info-box {
  background: rgba(0, 151, 255, 0.06);
  border: 1px solid rgba(0, 151, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 14px 0;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
}

.info-box .info-title {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 8px;
}

/* === WIRING CONFIG DISPLAY === */
.wiring-config {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.wiring-config:last-child { border-bottom: none; }

.wiring-config .config-name {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.wiring-config .config-desc {
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.wiring-config .config-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: 4px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* === TONE GENERATOR === */
.tone-display {
  text-align: center;
  padding: 20px;
}

.tone-display .freq-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--primary);
  text-shadow: var(--shadow-glow-primary);
  font-variant-numeric: tabular-nums;
}

.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #000;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  transition: transform 0.15s, box-shadow 0.2s;
}

.play-btn:active { transform: scale(0.95); }
.play-btn.playing {
  box-shadow: 0 0 24px rgba(0, 151, 255, 0.55);
}

/* === ORIENTATION TOGGLE (box calcs) === */
.orientation-group {
  display: flex;
  gap: 6px;
}

.orientation-btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--on-surface-variant);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-height: 44px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.orientation-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 151, 255, 0.08);
}

/* === CUT SHEET (box calcs) === */
.cut-sheet {
  margin-top: 12px;
}

.cut-sheet-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.8125rem;
}

.cut-sheet-row .piece {
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
  font-weight: 700;
}

.cut-sheet-row .dims {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* === CHART WRAPPER === */
.chart-container {
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 12px 0;
}

/* === NOTE / HELPER TEXT === */
.note {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin-top: 10px;
}

.note strong {
  color: var(--on-surface);
}

/* === DELETE BUTTON === */
.delete-btn {
  color: var(--color-danger);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

/* === ORDER FORM / PORTAL / ADMIN === */

/* Step progress dots for the order wizard */
.step-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px;
}

.step-dot {
  flex: 1;
  height: 3px;
  background: var(--outline-variant);
  border-radius: 2px;
  transition: background 0.2s;
}

.step-dot.done   { background: var(--primary); }
.step-dot.active { background: var(--secondary); }

.step-title {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin: 0 0 14px;
}

/* Short lead paragraph under the h1 on the order form */
.form-lead {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin: 0 0 18px;
}

/* Intro paragraph at the top of a wizard step */
.step-intro {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--on-surface);
  line-height: 1.5;
  margin: 0 0 20px;
}

/* Section header inside a wizard step (groups related inputs) */
.form-section {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin: 22px 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border-hairline);
}

.form-section:first-child { margin-top: 4px; }

/* Small muted help text that sits between a <label> and its <input> */
.form-hint {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  line-height: 1.45;
  margin: -2px 0 10px;
}

/* Inline "optional" tag inside a <label> */
.form-label-optional {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant);
  opacity: 0.7;
  text-transform: uppercase;
}

/* "What happens next" callout on the final step */
.next-steps-card {
  margin: 20px 0 16px;
  padding: 14px 16px;
  background: rgba(0, 151, 255, 0.06);
  border: 1px solid rgba(0, 151, 255, 0.25);
  border-radius: var(--radius-md);
}

.next-steps-card h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin: 0 0 8px;
}

.next-steps-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--on-surface);
  font-size: 0.875rem;
  line-height: 1.5;
}

.next-steps-card li + li { margin-top: 6px; }

/* Final-step confirmation checkbox — readable, tappable, full-width row */
.confirm-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  margin: 0;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--on-surface);
  font-size: 0.9375rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}

.confirm-checkbox input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 3px 0 0;
  flex-shrink: 0;
}

/* Card-style radio / checkbox options (replaces plain radios) */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

@media (max-width: 420px) {
  .option-grid { grid-template-columns: 1fr; }
}

.option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 48px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--on-surface-variant);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.option-card:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.option-card.active {
  border-color: var(--primary);
  background: rgba(0, 151, 255, 0.08);
  color: var(--on-surface);
}

.option-card .option-check {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--outline-variant);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.option-card.active .option-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #000;
}

/* Field error message */
.form-error {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0 0;
}

/* Wizard navigation bar */
.wizard-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.wizard-nav .btn { flex: 1; }

@media (max-width: 480px) {
  .wizard-nav { flex-direction: column-reverse; }
}

/* Order status badges (portal + admin) */
.status-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-badge--not_started { background: rgba(156, 163, 175, 0.15); color: var(--on-surface-variant); }
.status-badge--in_progress { background: rgba(0, 151, 255, 0.14);   color: var(--primary); }
.status-badge--done        { background: rgba(226, 26, 255, 0.14);   color: var(--secondary); }

/* Persistent CTA row at top of MyDashboard for users who have orders —
   gives them a quick way to request a new design or message Drew without
   having to bounce back out to the home page. */
.dashboard-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

/* Customer identity badge (MyDashboard) — shown once a user has submitted
   a paid-intake order. Brand gradient to read as an identity tag rather
   than a status. */
.customer-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Source / submission-type tag (admin list) */
.source-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 7px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  vertical-align: 2px;
  border: 1px solid transparent;
}
.source-tag--order   { background: rgba(226, 26, 255, 0.1);  color: var(--secondary); border-color: rgba(226, 26, 255, 0.25); }
.source-tag--inquiry { background: rgba(0, 151, 255, 0.1);  color: var(--primary);   border-color: rgba(0, 151, 255, 0.25); }
.source-tag--contact { background: rgba(156, 163, 175, 0.1); color: var(--on-surface-variant); border-color: rgba(255, 255, 255, 0.1); }

/* Status timeline — 3-node horizontal progress */
.status-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin: 12px 0;
}

.status-node {
  text-align: center;
  padding: 10px 6px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}

.status-node.done   { border-color: var(--primary); color: var(--primary); }
.status-node.active { border-color: var(--secondary); color: var(--secondary); background: rgba(226, 26, 255, 0.06); }

/* Message thread */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.message-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-bubble--customer {
  align-self: flex-end;
  background: rgba(0, 151, 255, 0.1);
  border: 1px solid rgba(0, 151, 255, 0.25);
  color: var(--on-surface);
}

.message-bubble--admin {
  align-self: flex-start;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  color: var(--on-surface);
}

.message-meta {
  font-family: var(--font-body);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-muted);
  margin-top: 4px;
}

.message-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.message-thread-empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--on-surface-muted);
  font-size: 0.8125rem;
}

/* Per-message delete trigger (admin only; rendered inline in .message-meta). */
.message-delete {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font: inherit;
  padding: 0 0 0 8px;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.message-delete:hover,
.message-delete:focus { opacity: 1; text-decoration: underline; }

/* Destructive action card — used for admin "Delete order" affordance. */
.danger-zone {
  border-color: rgba(239, 68, 68, 0.35);
}
.danger-zone .card-header { color: var(--color-danger); }

/* Destructive button variant. */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: 1px solid var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

/* Field summary grid — used on portal + admin detail */
.field-grid {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 8px 16px;
  padding: 4px 0;
}

.field-grid dt {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  padding-top: 2px;
}

.field-grid dd {
  font-size: 0.9375rem;
  color: var(--on-surface);
  word-break: break-word;
}

/* Admin order row (list view) */
.order-row {
  display: block;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.order-row:hover { border-color: var(--primary); background: var(--surface-hover); }

.order-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.order-row-name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}

.order-row-meta {
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Form field count / text helpers */
.hint-text {
  font-size: 0.75rem;
  color: var(--on-surface-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Sign-in card */
.signin-card {
  max-width: 360px;
  margin: 24px auto;
}

/* File uploader */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  border: 1.5px dashed var(--outline-variant);
  border-radius: var(--radius-md);
  background: var(--surface-dim);
  color: var(--on-surface-variant);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(0, 151, 255, 0.05);
  color: var(--primary);
}

.upload-zone .material-symbols-outlined {
  font-size: 1.75rem;
  color: var(--primary);
}

.upload-zone-title {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface);
}

.upload-zone-hint {
  font-size: 0.6875rem;
  color: var(--on-surface-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.file-tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.file-tile:hover {
  border-color: var(--primary);
}

.file-tile img,
.file-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-tile .material-symbols-outlined {
  font-size: 2.25rem;
  color: var(--on-surface-variant);
}

.file-tile-name {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
  font-size: 0.625rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-tile-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-tile-remove:hover { background: var(--color-danger); }

.upload-progress {
  height: 4px;
  background: var(--outline-variant);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress-bar {
  height: 100%;
  background: var(--primary);
  box-shadow: var(--shadow-glow-primary);
  transition: width 0.15s;
}

.file-section-label {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin: 12px 0 4px;
}

.file-badge-design {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  color: #000;
  font-family: var(--font-body);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === ADMIN NAV (tabs shared across every admin view) === */
.admin-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 4px;
}
.admin-nav-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant);
  text-decoration: none;
  border-radius: var(--radius-sm);
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-tab:hover { color: var(--on-surface); }
.admin-nav-tab.active {
  background: rgba(0, 151, 255, 0.12);
  color: var(--primary);
}

/* Badges + unread indicators */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--secondary);
  margin-right: 6px;
  vertical-align: middle;
}
.order-row.unread {
  border-left: 3px solid var(--secondary);
  padding-left: 9px;
}

/* === ADMIN DESKTOP (workstation 2-pane shell at #/admindesktop) ===
   Breaks out of the 560px mobile container via `.app-container--wide`.
   Two panes: sticky left rail with filters + list, scrollable main pane
   showing either the embedded AdminOrderDetail or the dashboard home. */
.app-container--wide {
  max-width: 1400px;
  padding: 12px 16px 32px;
}

.admin-desktop {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-desktop-rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 24px);
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 12px;
  overflow: hidden;
}

.admin-desktop-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-desktop-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface);
}
.admin-desktop-title .material-symbols-outlined { color: var(--primary); }

.admin-desktop-mobile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin-desktop-mobile-link:hover {
  background: var(--surface-hover);
  color: var(--on-surface);
}

.admin-desktop-viewtabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 4px;
}
.admin-desktop-viewtab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.admin-desktop-viewtab:hover { color: var(--on-surface); }
.admin-desktop-viewtab.active {
  background: rgba(0, 151, 255, 0.12);
  color: var(--primary);
}

.admin-desktop-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-desktop-filters input {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.875rem;
}

.admin-desktop-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-desktop-row {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.admin-desktop-row:hover { border-color: var(--primary); }
.admin-desktop-row.selected {
  border-color: var(--primary);
  background: rgba(0, 151, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--primary);
}
.admin-desktop-row.unread { border-left: 3px solid var(--secondary); padding-left: 9px; }
.admin-desktop-row.selected.unread { box-shadow: none; }

.admin-desktop-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.admin-desktop-row-name {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--on-surface);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-desktop-row-when {
  font-size: 0.6875rem;
  color: var(--on-surface-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.admin-desktop-row-sub {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.admin-desktop-row-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-desktop-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--surface-hover);
  color: var(--on-surface-variant);
}
.admin-desktop-pill--reply {
  background: rgba(226, 26, 255, 0.15);
  color: var(--secondary);
}

.admin-desktop-main { min-width: 0; }

/* Dashboard home */
.admin-desktop-home { display: flex; flex-direction: column; gap: 16px; }

.admin-desktop-kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.admin-desktop-kpi {
  background: var(--surface-dim);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.admin-desktop-kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--on-surface);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.admin-desktop-kpi-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-muted);
  margin-top: 4px;
}
.admin-desktop-kpi--primary .admin-desktop-kpi-value { color: var(--primary); }
.admin-desktop-kpi--secondary .admin-desktop-kpi-value { color: var(--secondary); }

.admin-desktop-home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-desktop-subrow {
  display: block;
  padding: 8px 10px;
  margin: 4px -6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.admin-desktop-subrow:hover { background: var(--surface-hover); }
.admin-desktop-subrow-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 2px;
  gap: 8px;
}
.admin-desktop-subrow-head .source-tag { margin-right: 4px; }
.admin-desktop-subrow-body {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-desktop-typebar {
  padding: 6px 0;
}
.admin-desktop-typebar + .admin-desktop-typebar {
  border-top: 1px solid var(--border-hairline);
}
.admin-desktop-typebar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--on-surface);
  margin-bottom: 4px;
}
.admin-desktop-typebar-track {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
}
.admin-desktop-typebar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s;
}

.admin-desktop-sparkline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 120px;
  align-items: end;
  padding: 8px 0;
}
.admin-desktop-spark-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.admin-desktop-spark-fill {
  width: 100%;
  background: linear-gradient(to top, var(--primary), var(--secondary));
  min-height: 2px;
  transition: height 0.3s;
}
.admin-desktop-spark-label {
  position: absolute;
  top: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--on-surface);
}
.admin-desktop-sparkline-axis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  font-size: 0.625rem;
  color: var(--on-surface-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 1100px) {
  .admin-desktop { grid-template-columns: 280px minmax(0, 1fr); }
  .admin-desktop-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .app-container--wide { padding: 12px; }
  .admin-desktop { grid-template-columns: 1fr; }
  .admin-desktop-rail { position: static; max-height: 60vh; }
  .admin-desktop-home-grid { grid-template-columns: 1fr; }
  .admin-desktop-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* === RESPONSIVE === */
@media (max-width: 400px) {
  .input-row { flex-direction: column; gap: 0; }
  .summary-bar { flex-direction: column; gap: 0; }
  .field-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .field-grid dt { padding-top: 8px; }
}
