:root {
  --bg-primary: #060a12;
  --bg-surface: #0c1322;
  --bg-card: #121c33;
  --bg-card-hover: #182542;
  --bg-input: #172440;
  --border-color: #1e2f50;
  --border-glow: rgba(56, 189, 248, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  background-color: #0b111e;
  background: linear-gradient(180deg, #0b111e 0%, #060a12 100%);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: 14px 12px 32px;
  min-height: 100vh;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

button, a, input, select, .preset-card, .preset-chip, .pill-btn, .step-tab-btn, .nav-tab-btn, .btn-action, .btn-step-nav, .ad-slot-card, .hardware-item-card, .clickable {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding-top: 8px;
}

/* EQ Accent Bar */
.eq-accent-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981, #06b6d4, #3b82f6, #8b5cf6);
  border-radius: 999px;
  margin-bottom: 12px;
  opacity: 0.85;
}

/* SubWire Pro Brand Header & Logo */
.app-header {
  margin-top: 4px;
  margin-bottom: 16px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(11, 17, 30, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}

.logo-container {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: #090e1c;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-container:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.65);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.brand-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-title-main {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  flex-shrink: 0;
}

.brand-title-pro {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #0b111e;
  background: linear-gradient(135deg, #38bdf8, #06b6d4);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.brand-tagline {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.15px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pro-badge {
  display: none !important;
}

.btn-pro-toggle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.14));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #f59e0b;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  max-width: 140px;
}

.btn-pro-toggle:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-pro-toggle.pro-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border: 1px solid #f59e0b;
  color: #fef3c7;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.btn-pro-toggle .pro-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}

@media (max-width: 440px) {
  .header-top-row {
    padding: 8px 10px;
    gap: 8px;
  }
  .logo-container {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .brand-title-main {
    font-size: 16px;
  }
  .brand-tagline {
    font-size: 9px;
  }
  .btn-pro-toggle {
    padding: 5px 8px;
    font-size: 9.5px;
    max-width: 120px;
  }
  .btn-pro-toggle .pro-btn-text {
    max-width: 75px;
  }
}

/* Multi-Page Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.nav-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Page Containers */
.page-view {
  display: none;
}
.page-view.active {
  display: block;
}

/* =========================================================
   STEP WIZARD SUB-NAVIGATION (SPLITS PAGE UP INTO FOCUSED TABS)
========================================================= */
.step-nav-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
}

.step-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.step-tab-btn span.step-num {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 800;
}

.step-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.step-tab-btn.active span.step-num {
  color: var(--accent-cyan);
}

/* Step Views */
.step-view {
  display: none;
}
.step-view.active {
  display: block;
}

/* Quick Presets Section (Overhauled Tile Grid) */
.presets-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.presets-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.presets-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}

.presets-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.presets-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.presets-subtext {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

@media (min-width: 641px) {
  .presets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

.preset-card {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.4);
  -webkit-tap-highlight-color: transparent;
}

.preset-card:hover {
  border-color: #38bdf8;
  background: linear-gradient(180deg, #243447 0%, #131c2e 100%);
  box-shadow: 0 6px 16px -2px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.preset-card:active {
  transform: scale(0.97);
}

.preset-card.active-preset {
  border-color: #38bdf8 !important;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.18) 0%, #0f172a 100%) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35) !important;
}

.preset-card.featured-preset {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.2);
}

.preset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
}

.preset-pill {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.preset-pill.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.preset-pill.cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.45);
}

.preset-pill.blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.preset-pill.purple {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.preset-pill.emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.preset-pill.gray {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.preset-target-ohm {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  font-weight: 900;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 6px;
  padding: 1px 6px;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
  letter-spacing: -0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.preset-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.preset-card-desc {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

/* Configuration Card / Controls Overhaul */
.config-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(20, 30, 52, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.config-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-header-icon {
  font-size: 20px;
}

.config-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.config-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
}

.config-live-pill {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.control-group-full {
  grid-column: 1 / -1;
}

.control-group-watts {
  grid-column: 1 / -1;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.control-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ctrl-icon {
  font-size: 12px;
}

.control-badge {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Pill Selectors */
.pill-group {
  display: flex;
  background: #0b1322;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pill-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pill-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn.active {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.45);
}

.pill-bold {
  font-weight: 900;
  letter-spacing: -0.2px;
}

/* Watts RMS Stepper & Quick Presets */
.watts-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-watt-step {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-watt-step:hover {
  background: #273549;
  border-color: #38bdf8;
  color: #fff;
}

.btn-watt-step:active {
  transform: scale(0.94);
}

.watts-field-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.watts-input {
  width: 100%;
  background: #0b1322;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #f8fafc;
  padding: 10px 14px;
  padding-right: 90px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.watts-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.watts-unit {
  position: absolute;
  right: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #06b6d4;
  pointer-events: none;
}

.watt-chips-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.watt-chip {
  flex: 1;
  min-width: 54px;
  background: #162032;
  border: 1px solid #25334c;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.watt-chip:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.watt-chip.active {
  background: rgba(6, 182, 212, 0.18);
  color: #38bdf8;
  border-color: #06b6d4;
  font-weight: 800;
}

/* Big Action Navigation Buttons */
.step-next-bar {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-step-nav {
  flex: 1;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #1e3a8a 100%);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 14px;
  font-weight: 800;
  padding: 13px 18px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.2px;
}

.btn-step-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
  border-color: #38bdf8;
}

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

.btn-step-nav.secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

/* =========================================================
   DIAGRAM VIEW (FITS SCREEN NATURALLY + TAP TO ZOOM)
========================================================= */
.visualizer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.visualizer-topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(17, 28, 51, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.active-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.active-impedance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #38bdf8;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(2, 132, 199, 0.26));
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 50px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.5px;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  flex-shrink: 0;
}

.active-title-desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.active-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-title-desc h3 {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
}

.active-match-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.active-match-pill.optimal {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.active-match-pill.safe {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.active-match-pill.danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.active-title-desc p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

@media (min-width: 620px) {
  .action-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

.btn-action {
  background: linear-gradient(180deg, #162032, #0d1524);
  border: 1px solid #22324d;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.btn-action svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.btn-action:hover {
  background: linear-gradient(180deg, #22324d, #162032);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-action.toggle-active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(2, 132, 199, 0.35));
  border-color: var(--accent-cyan);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

/* Outcomes Tabs */
.outcomes-tabs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.outcomes-tabs-row::-webkit-scrollbar {
  display: none;
}

.outcome-tab-btn {
  flex: 0 0 145px;
  width: 145px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  box-sizing: border-box;
  gap: 2px;
}

.outcome-tab-btn.active {
  background: var(--bg-card);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.tab-ohm-badge {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.outcome-tab-btn.active .tab-ohm-badge {
  color: var(--accent-cyan);
}

.tab-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.tab-safety-pill {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 3px;
}

.safety-safe {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.safety-optimal {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}
.safety-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

/* SVG Container: FITS FULLY ON SCREEN WITH CLICK-TO-ZOOM AFFORDANCE */
.svg-interactive-box {
  position: relative;
  width: 100%;
  cursor: zoom-in;
}

.svg-wrapper {
  width: 100%;
  background: #080d1a;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

/* Automatically scales to 100% of mobile screen width with zero clipping */
.wiring-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.tap-zoom-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

/* Status Banner */
.status-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   FULLSCREEN CLICK-TO-ZOOM MODAL & LIGHTBOX
========================================================= */
.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  flex-direction: column;
}

.zoom-modal.active {
  display: flex;
}

.zoom-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #090d16;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.zoom-controls-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-zoom-ctrl {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-zoom-close {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.zoom-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
  cursor: grab;
}

.zoom-viewport.dragging {
  cursor: grabbing;
}

.zoom-content {
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  width: 100%;
  max-width: 1100px;
  padding: 16px;
}

.zoom-hint-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
}

/* Wire pulse animation for interactive step tracing */
.wires-layer.has-focus .dual-wire-group:not(.active-wire) {
  opacity: 0.12 !important;
  transition: opacity 0.25s ease;
}

.dual-wire-group.active-wire .wire-casing {
  stroke: #ffffff !important;
  stroke-width: 9.5px !important;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 18px rgba(56, 189, 248, 0.9)) !important;
}

.dual-wire-group.active-wire .wire-core {
  animation: wirePulse 1.1s infinite ease-in-out;
}

@keyframes wirePulse {
  0%, 100% {
    stroke-width: 5.5px;
    filter: drop-shadow(0 0 8px currentColor);
  }
  50% {
    stroke-width: 8.5px;
    filter: drop-shadow(0 0 22px currentColor) drop-shadow(0 0 35px #ffffff);
  }
}

/* Audio Tone Generator Bar */
.audio-tone-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tone-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tone-freq {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-tone-freq.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-tone-play {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-tone-play.playing {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Details Cards */
.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.info-card h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Interactive Checklist */
.steps-list {
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps-list li {
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.steps-list li:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.steps-list li.active-step {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.steps-list li::marker {
  color: var(--accent-cyan);
  font-weight: 900;
}

/* DMM AC Voltage Badge */
.dmm-card-highlight {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

.dmm-voltage-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-cyan);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

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

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 700;
  color: var(--text-main);
}

.stat-value.highlight {
  color: var(--accent-cyan);
}

/* Matched Hardware & Monetization Panel */
.hardware-recommendation-panel {
  display: block;
  background: linear-gradient(135deg, #0b1324 0%, #111e38 100%);
  border: 1px solid #1e3a5f;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

.hardware-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .hardware-header-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.hardware-text-block {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.ad-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
  margin-bottom: 4px;
}

.ad-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-hardware-toggle {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid #334155;
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-hardware-toggle:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}

.hardware-primary-bar {
  width: 100%;
  margin-top: 8px;
}

.btn-affiliate-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  padding: 11px 14px;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  text-align: center;
}

.btn-affiliate-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.hardware-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
}

@media (min-width: 580px) {
  .hardware-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hardware-item-card {
  background: #090e1c;
  border: 1px solid #1e2c45;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  transition: all 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.hardware-item-card:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.hardware-item-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.hardware-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.hardware-item-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
}

.hardware-item-spec {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.hardware-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-hardware-buy {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa;
  font-size: 11.5px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 7px;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.btn-hardware-buy:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
}

.ad-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 3px;
}

.ad-title {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
}

.ad-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.btn-affiliate {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
}

/* Modal Styling for Pro Mode & Custom Branding */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid #2a3d66;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #f59e0b;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.pro-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.form-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-text {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #f59e0b;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.btn-save-pro {
  flex: 1;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  font-size: 12.5px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

/* Cheat Sheet Table View */
.sheet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.sheet-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  padding: 10px 8px;
  text-align: left;
}

.sheet-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-quick-load {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}

/* Guides & Reference Section */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
}

.guide-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.guide-table th, .guide-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 12px 36px;
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 24px;
}

.footer-brand {
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  padding: 0;
}

.footer-link-btn:hover {
  text-decoration: underline;
}

.footer-bullet {
  color: #475569;
}

.footer-copyright {
  font-size: 10px;
  color: #475569;
}

/* ========================================================
   PAYWALL & SUBSCRIPTION MODAL STYLES (APPLE & GOOGLE COMPLIANT)
   ======================================================== */
.modal-title-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-crown-badge {
  font-size: 18px;
}

.paywall-card {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.paywall-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 12px;
}

.paywall-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feat-icon {
  font-size: 16px;
  line-height: 1.2;
}

.feat-text strong {
  display: block;
  font-size: 12.5px;
  color: #f8fafc;
  font-weight: 800;
}

.feat-text span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.paywall-plans-container {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
}

.plan-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #090e1c;
  border: 1.5px solid #1e293b;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-card:hover {
  border-color: #38bdf8;
  background: #0f172a;
}

.plan-card.active {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.95));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.plan-card.active .plan-radio {
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: inset 0 0 0 3px #0f172a;
}

.plan-info {
  display: flex;
  flex-direction: column;
}

.plan-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-subtext {
  font-size: 10.5px;
  color: var(--text-muted);
}

.plan-badge-save {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 9px;
  font-weight: 800;
  padding: 1.5px 5px;
  border-radius: 4px;
}

.plan-badge-once {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  font-size: 9px;
  font-weight: 800;
  padding: 1.5px 5px;
  border-radius: 4px;
}

.plan-price-block {
  text-align: right;
}

.plan-price {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
}

.plan-period {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}

.btn-paywall-cta {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b111e;
  border: none;
  font-size: 13.5px;
  font-weight: 850;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.btn-paywall-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.pro-active-status-card {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.pro-status-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-pro-unlocked {
  font-size: 12px;
  font-weight: 800;
  color: #10b981;
}

.badge-pro-tier {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
}

.pro-active-desc {
  font-size: 11px;
  color: #cbd5e1;
  margin: 6px 0 10px 0;
}

.btn-manage-sub {
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
}

.section-divider-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 14px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.paywall-restore-row {
  display: flex;
  justify-content: center;
  margin: 14px 0 10px;
}

.btn-restore-link {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-restore-link:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.paywall-legal-notice {
  font-size: 9.5px;
  color: #64748b;
  line-height: 1.45;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  margin-top: 10px;
}

.paywall-legal-notice p {
  margin: 0 0 6px 0;
}

.paywall-legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.paywall-legal-links a {
  color: #94a3b8;
  text-decoration: underline;
  font-weight: 600;
}

.paywall-legal-links a:hover {
  color: var(--accent-cyan);
}

/* Legal In-App Modals */
.legal-modal-card {
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
}

.legal-modal-body p {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
}

.legal-modal-body ul {
  padding-left: 18px;
  margin: 8px 0;
}

.legal-modal-body li {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-cyan);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  padding: 9px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Print Only Banner (Hidden on Screen) */
.print-header-banner {
  display: none;
}

/* =========================================================
   STRICT 1-PAGE PRINT MEDIA QUERY
========================================================= */
@page {
  size: letter portrait;
  margin: 0.3in 0.3in 0.25in 0.3in;
}

@media print {
  html, body {
    background: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
    font-size: 9.5px !important;
    line-height: 1.3 !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* In print mode, show both the diagram and checklist together */
  .step-view {
    display: block !important;
  }

  .eq-accent-bar,
  .app-header,
  .nav-bar,
  .step-nav-bar,
  .presets-card,
  .config-card,
  .outcomes-header,
  .outcomes-tabs-row,
  .action-buttons,
  .step-next-bar,
  .audio-tone-bar,
  .ad-slot-card,
  .app-footer,
  .toast,
  .modal-backdrop,
  .zoom-modal,
  .tap-zoom-badge,
  #pageCheatSheet,
  #pageGuides {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-header-banner {
    display: block !important;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 5px;
    margin-bottom: 6px;
  }

  .print-header-banner .print-title {
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    color: #0f172a;
  }

  .print-header-banner .print-meta {
    font-size: 9.5px;
    color: #475569;
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
  }

  .visualizer-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px !important;
    box-shadow: none !important;
    margin-bottom: 6px !important;
    page-break-inside: avoid !important;
  }

  .active-impedance {
    font-size: 22px !important;
    color: #0284c7 !important;
    text-shadow: none !important;
  }

  .svg-wrapper {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
  }

  .wiring-svg {
    max-height: 310px !important;
    width: 100% !important;
  }

  .details-grid {
    display: grid !important;
    grid-template-columns: 1.25fr 0.75fr !important;
    gap: 8px !important;
    margin-top: 6px !important;
    page-break-inside: avoid !important;
  }

  .info-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px !important;
  }

  .steps-list {
    font-size: 8.5px !important;
    gap: 2px !important;
    padding-left: 12px !important;
    color: #1e293b !important;
  }

  .stat-row {
    padding: 2.5px 0 !important;
    font-size: 8.5px !important;
  }

  .dmm-card-highlight {
    padding: 5px !important;
    margin-top: 4px !important;
  }

  .dmm-voltage-val {
    font-size: 16px !important;
  }

  body, .container, .page-view, .visualizer-card {
    page-break-after: avoid !important;
    page-break-before: avoid !important;
  }
}
