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

:root {
  --bg:              #ffffff;
  --surface:         #ffffff;
  --surface-raised:  #f7f7f7;
  --border:          #e5e5e5;
  --border-subtle:   #f0f0f0;
  --text:            #3c3c3c;
  --text-secondary:  #777777;
  --text-muted:      #afafaf;
  --accent:          #58cc02;
  --accent-hover:    #4db800;
  --accent-subtle:   rgba(88,204,2,0.10);
  --accent-glow:     rgba(88,204,2,0.04);
  --cta:             #58cc02;
  --cta-hover:       #4db800;
  --cta-shadow:      #58a700;
  --success:         #58cc02;
  --success-subtle:  rgba(88,204,2,0.12);
  --warning:         #ff9600;
  --warning-subtle:  rgba(255,150,0,0.10);
  --danger:          #ff4b4b;
  --danger-subtle:   rgba(255,75,75,0.10);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 0 #afafaf;
  --shadow-sm: 0 3px 0 #afafaf;
  --shadow-lift: 0 10px 32px rgba(0,0,0,0.10);
  --gloss: none;
}

/* ── Dark theme ──────────────────────────────────────── */
[data-theme="dark"] {
  --bg:              #131f24;
  --surface:         #1f2d35;
  --surface-raised:  #263540;
  --border:          #2c3e50;
  --border-subtle:   #233040;
  --text:            #ffffff;
  --text-secondary:  #afafaf;
  --text-muted:      #6e8a9a;
  --accent:          #58cc02;
  --accent-hover:    #4db800;
  --accent-subtle:   rgba(88,204,2,0.16);
  --accent-glow:     rgba(88,204,2,0.06);
  --cta:             #58cc02;
  --cta-hover:       #4db800;
  --cta-shadow:      #58a700;
  --success:         #58cc02;
  --success-subtle:  rgba(88,204,2,0.14);
  --warning:         #ff9600;
  --warning-subtle:  rgba(255,150,0,0.14);
  --danger:          #ff4b4b;
  --danger-subtle:   rgba(255,75,75,0.14);
  --shadow:          0 4px 0 rgba(0,0,0,0.45);
  --shadow-sm:       0 3px 0 rgba(0,0,0,0.45);
  --shadow-lift:     0 10px 32px rgba(0,0,0,0.5);
  --gloss:           none;
}

html, body { height: 100%; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ── App shell ───────────────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ──────────────────────────────────────────── */
.app-header {
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.logo-img { flex-shrink: 0; display: block; object-fit: contain; filter: invert(1); }
[data-theme="dark"] .logo-img { filter: invert(0); }

.header-nav { display: flex; gap: 2px; }
.nav-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
  border-bottom-width: 3px;
}

/* ── Main ────────────────────────────────────────────── */
.app-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 44px 24px;
}
.view {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.view.active { display: flex; animation: viewIn 0.3s cubic-bezier(0.34,1.2,0.64,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.panel { width: 100%; }

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow), var(--gloss);
  position: relative;
}
.card-title   { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.card-subtitle { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: 14px; line-height: 1.6; }
.community-counter { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 16px; }
.community-counter svg { flex-shrink: 0; color: var(--green); }

/* ── History badge ───────────────────────────────────── */
.history-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}
.history-badge:hover { background: var(--accent-subtle); }
.history-badge-icon { font-size: 0.85rem; flex-shrink: 0; }
.history-badge-text { flex: 1; font-weight: 500; }
.history-badge-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.history-badge.open .history-badge-chevron { transform: rotate(180deg); }

.history-expanded {
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-left: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
  font-size: 0.8rem;
}
.history-expanded-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.history-fix-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-fix-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--gloss);
}
.history-fix-icon { font-size: 1rem; flex-shrink: 0; }
.history-fix-label { flex: 1; font-size: 0.8rem; font-weight: 500; }
.history-fix-when { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.history-fix-status {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 1px 6px;
  border-radius: 2px;
}
.history-fix-status.fixed {
  color: var(--success);
  background: rgba(45,168,112,0.12);
}
.history-fix-status.tried {
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
}
.history-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Quick fixes card ────────────────────────────────── */
.quick-fixes-card {
  background: transparent;
  border: none;
  border-left: 3px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  transition: border-color 0.2s;
}
.quick-fixes-card:has(.quick-fixes-toggle.open) {
  border-left-color: var(--accent);
}

.quick-fixes-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  font-family: inherit;
}
.quick-fixes-toggle:hover { background: var(--accent-subtle); }

.quick-fixes-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quick-fixes-bolt { font-size: 1rem; flex-shrink: 0; }
.quick-fixes-toggle-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.quick-fixes-toggle-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.quick-toggle-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.quick-fixes-toggle.open .quick-toggle-arrow { transform: rotate(180deg); }

.quick-fixes-body {
  padding: 2px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-fix-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.quick-fix-item:first-child { padding-top: 8px; border-top: none; }
.quick-fix-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.quick-fix-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.quick-fix-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Hero ────────────────────────────────────────────── */
.hero-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 48px 52px;
  box-shadow: var(--shadow), var(--gloss);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  display: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 100px;
  padding: 7px 20px;
  margin-bottom: 28px;
  position: relative;
  box-shadow: 0 3px 0 var(--cta-shadow);
  transform: translateY(0);
}
.hero-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.08;
  color: var(--text);
  position: relative;
}
.hero-body {
  color: var(--text-muted);
  font-size: 0.9375rem;
  max-width: 420px;
  margin: 0 auto 26px;
  line-height: 1.7;
  position: relative;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  position: relative;
}
.os-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.os-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  color: var(--text-muted);
}
.os-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 24px;
  position: relative;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--cta); color: #fff; border: none;
  border-radius: 100px; padding: 13px 28px;
  font-size: 0.9375rem; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: 0.01em; white-space: nowrap;
  box-shadow: 0 4px 0 var(--cta-shadow);
  transform: translateY(0);
  transition: background 0.15s, transform 0.1s, box-shadow 0.1s;
}
.btn-primary.btn-lg { padding: 16px 44px; font-size: 1.05rem; font-weight: 800; }
.btn-primary:hover  { background: var(--cta-hover); transform: translateY(-2px); box-shadow: 0 6px 0 var(--cta-shadow); }
.btn-primary:active { transform: translateY(4px); box-shadow: none; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-raised); color: var(--text-secondary);
  border: 2px solid var(--border); border-radius: 100px;
  padding: 9px 20px; font-size: 0.875rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.1s;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}
.btn-secondary:hover { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary:active { transform: translateY(3px); box-shadow: none; }
.btn-secondary.copied { background: var(--success-subtle); color: var(--success); border-color: rgba(45,168,112,0.3); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-secondary);
  border: 2px solid var(--border); border-radius: 100px;
  padding: 9px 20px; font-size: 0.875rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.1s;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}
.btn-ghost:hover { background: var(--surface-raised); color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost:active { transform: translateY(3px); box-shadow: none; }

.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; color: var(--text-secondary); border: none;
  padding: 4px 8px 4px 2px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: color 0.15s; flex-shrink: 0;
  font-family: inherit;
}
.btn-back:hover { color: var(--text); }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-raised); color: var(--accent);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 18px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s; margin-top: 16px;
  font-family: inherit;
  box-shadow: var(--gloss);
}
.btn-link:hover { background: var(--accent-subtle); border-color: rgba(88,204,2,0.4); }

/* ── Progress (health check) ─────────────────────────── */
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.progress-counter {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.progress-track {
  height: 10px;
  background: var(--border);
  border-radius: 100px;
  margin-bottom: 24px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 50%, var(--accent) 100%);
  background-size: 200% auto;
  border-radius: 100px;
  transition: width 0.4s ease;
  animation: shimmer 1.8s linear infinite;
}

/* ── Step list ───────────────────────────────────────── */
.step-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.step-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: transparent;
  transition: all 0.2s ease;
}
.step-item.step-waiting { opacity: 0.35; }
.step-item.step-active  {
  opacity: 1;
  border-left-color: var(--accent);
  background: var(--accent-subtle);
  animation: stepActivate 0.22s ease both;
}
.step-item.step-done    {
  opacity: 0.75;
  border-left-color: var(--success);
  background: var(--success-subtle);
}
.step-item.step-warn    {
  opacity: 1;
  border-left-color: var(--warning);
  background: var(--warning-subtle);
}
.step-item.step-error   {
  opacity: 1;
  border-left-color: var(--danger);
  background: var(--danger-subtle);
}
.step-icon   { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.step-label  { flex: 1; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.step-status { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }

@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.icon-spin {
  display: block;
  animation: iconSpin 0.9s linear infinite;
  transform-origin: center;
}

@keyframes checkPop {
  0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
  55%  { transform: scale(1.25) rotate(4deg); opacity: 1; }
  80%  { transform: scale(0.93); }
  100% { transform: scale(1) rotate(0deg); }
}
.icon-check-pop {
  display: block;
  animation: checkPop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes warnPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.icon-warn-pop {
  display: block;
  animation: warnPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes stepActivate {
  from { opacity: 0.4; transform: translateX(-6px); }
  to   { opacity: 1;   transform: translateX(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scorePulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  70%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* ── Score ring ──────────────────────────────────────── */
.score-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 30px 24px 26px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.score-ring-wrap {
  position: relative;
  width: 124px;
  height: 124px;
  flex-shrink: 0;
  animation: scorePulse 0.55s ease 0.9s both;
}
.score-ring { width: 124px; height: 124px; transform: rotate(-90deg); }
.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 9;
}
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1), stroke 0.4s ease;
}
.ring-fill.good { stroke: var(--success); }
.ring-fill.warn { stroke: var(--warning); }
.ring-fill.bad  { stroke: var(--danger); }

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.score-num {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-pct { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); align-self: flex-end; margin-bottom: 5px; }

.score-text { min-width: 0; }
.verdict-title  { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.verdict-subtitle { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 12px; }
.verdict-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
}
.verdict-badge.good { background: var(--success-subtle); color: var(--success); }
.verdict-badge.warn { background: var(--warning-subtle); color: var(--warning); }
.verdict-badge.bad  { background: var(--danger-subtle);  color: var(--danger);  }

/* ── Result grid ─────────────────────────────────────── */
.result-grid  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.result-group {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  animation: resultIn 0.3s ease both;
  box-shadow: var(--shadow-sm);
}
.result-group-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 12px;
}
.result-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; }
.result-row + .result-row { border-top: 1px solid var(--border-subtle); margin-top: 2px; padding-top: 7px; }
.result-key   { font-size: 0.84rem; color: var(--text-secondary); }
.result-value { font-size: 0.84rem; font-weight: 700; color: var(--text); text-align: right; }
.result-value.good { color: var(--success); }
.result-value.warn { color: var(--warning); }
.result-value.bad  { color: var(--danger); }

/* ── Result row tooltip ──────────────────────────────── */
.tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 800;
  font-family: inherit;
  border: none;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.tip-btn:hover,
.tip-btn:focus { background: var(--accent); color: #fff; outline: none; }
.tip-btn::before,
.tip-btn::after {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
}
.tip-btn::after {
  content: attr(data-tip);
  bottom: calc(100% + 8px);
  background: #1c1c2e;
  color: #f0f0f0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 10px 13px;
  border-radius: 8px;
  width: 240px;
  max-width: 85vw;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.tip-btn::before {
  content: '';
  bottom: calc(100% + 2px);
  border: 6px solid transparent;
  border-top-color: #1c1c2e;
  width: 0;
  height: 0;
}
.tip-btn:hover::before,
.tip-btn:hover::after,
.tip-btn:focus::before,
.tip-btn:focus::after { opacity: 1; }

/* ── Technical Details accordion ────────────────────── */
.tech-details {
  margin-top: 8px;
  margin-bottom: 4px;
  border-top: 1.5px solid var(--border-subtle);
}
.tech-details-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  padding: 12px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.tech-details-toggle:hover {
  color: var(--text);
  background: var(--surface-raised);
}
.tech-details-toggle::-webkit-details-marker { display: none; }
.tech-details-toggle::marker { content: ''; display: none; }
.tech-details-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.15s;
}
.tech-details-toggle:hover .tech-details-chevron { color: var(--text); }
.tech-details[open] .tech-details-chevron { transform: rotate(90deg); }
.tech-details-label { flex: 1; }

/* ── Issue prompts ───────────────────────────────────── */
.issue-prompts {
  background: #fdf9f0;
  border: 1.5px solid rgba(160,110,0,0.18);
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.issue-prompts-heading {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #8a6800;
}
.issue-cta-list { display: flex; flex-direction: column; gap: 8px; }
.issue-cta-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 100px; padding: 10px 16px;
  text-align: left; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.1s;
  width: 100%;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}
.issue-cta-btn:hover { background: var(--accent-subtle); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.issue-cta-btn:active { transform: translateY(3px); box-shadow: none; }
.issue-cta-emoji { font-size: 1rem; flex-shrink: 0; }
.issue-cta-text  { flex: 1; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.issue-cta-arrow { color: var(--text-muted); flex-shrink: 0; }

/* ── Result actions ──────────────────────────────────── */
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Symptom search ──────────────────────────────────── */
.search-section-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.symptom-search-wrap { margin-bottom: 20px; }
.symptom-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.symptom-search {
  width: 100%;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 12px 40px 12px 44px;
  outline: none;
  transition: border-color 0.15s;
}
.symptom-search::placeholder { color: var(--text-muted); }
.symptom-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  background: var(--surface);
}
.search-clear {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 100px;
  line-height: 1;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--text); }

.search-results-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.search-no-match {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 24px 0;
}
.search-no-match strong { color: var(--text); }

/* ── Search suggestions dropdown ─────────────────────── */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 0 #afafaf;
  z-index: 100;
  overflow: hidden;
}
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
}
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item:hover { background: var(--surface-raised); }
.search-suggest-label { font-weight: 600; flex: 1; }
.search-suggest-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* ── OS section grouping ─────────────────────────────── */
.os-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.os-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 3px solid var(--border);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
}
.os-section-header:hover .os-section-name {
  color: var(--green);
}
.os-section-chevron {
  margin-left: auto;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.os-section.is-open .os-section-chevron {
  transform: rotate(180deg);
}
.os-section-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.os-section-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color 0.15s ease;
}
.os-section-body {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
}
.os-section.is-open .os-section-body {
  display: flex;
}

/* ── Issue categories ────────────────────────────────── */
.issue-categories { display: flex; flex-direction: column; gap: 48px; }

.issue-category-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 11px 14px;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, border-radius 0.15s;
  margin-bottom: 0;
}
.issue-category-label:hover {
  border-color: var(--accent);
}
.issue-category.is-open .issue-category-label {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: var(--border-subtle);
}
.issue-category-label svg:first-child {
  flex-shrink: 0;
  color: var(--accent);
}
.cat-label-text { flex: 1; }
.cat-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.issue-category.is-open .cat-chevron {
  transform: rotate(180deg);
}
.issue-category-body {
  display: none;
  padding: 12px;
  border: 2px solid var(--border);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}
.issue-category.is-open .issue-category-body {
  display: block;
}

.issue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.issue-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm), var(--gloss);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s ease, border-color 0.15s;
  animation: cardIn 0.3s cubic-bezier(0.34,1.2,0.64,1) both;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 160px;
  font-family: inherit;
}
.issue-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift), var(--gloss);
  border-color: var(--accent);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.issue-grid .issue-card:nth-child(1) { animation-delay:   0ms; }
.issue-grid .issue-card:nth-child(2) { animation-delay:  40ms; }
.issue-grid .issue-card:nth-child(3) { animation-delay:  80ms; }
.issue-grid .issue-card:nth-child(4) { animation-delay: 120ms; }
.issue-grid .issue-card:nth-child(5) { animation-delay: 160ms; }
.issue-grid .issue-card:nth-child(6) { animation-delay: 200ms; }
.issue-card-icon {
  display: block;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 22px;
  overflow: hidden;
}
.issue-card-icon svg { width: 88px; height: 88px; display: block; }
dotlottie-player.issue-card-icon { display: block; width: 88px; height: 88px; border-radius: 22px; overflow: hidden; mix-blend-mode: multiply; }
dotlottie-player.wizard-lottie-icon { display: block; width: 72px; height: 72px; border-radius: 18px; overflow: hidden; flex-shrink: 0; }
[data-theme="dark"] dotlottie-player.issue-card-icon { mix-blend-mode: normal; }
.issue-card-title  { font-size: 0.8rem; font-weight: 700; color: var(--text); line-height: 1.3; flex: 1; }
.issue-card-arrow  { display: none; }
.issue-card-meta   { display: flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; }
.issue-card-steps  { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.issue-card-time   { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.issue-card-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 2px;
}
.tag-fixed {
  color: var(--success);
  background: rgba(45,168,112,0.13);
}
.tag-tried {
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
}

/* ── Wizard ──────────────────────────────────────────── */
.wizard-card { padding: 26px 30px 30px; }
.wizard-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
@keyframes wizardHeroIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.82); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}
@keyframes wizardStepInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wizardStepInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wizardStepOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}
@keyframes wizardStepOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}
@keyframes wizardStepRefresh {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}
.wizard-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px;
  padding: 18px 0 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.wizard-hero.hero-anim {
  animation: wizardHeroIn 0.5s cubic-bezier(0.34, 1.35, 0.64, 1) both;
}
.wizard-body.step-anim-next    { animation: wizardStepInRight  0.28s cubic-bezier(0.25, 1, 0.5, 1) both; }
.wizard-body.step-anim-prev    { animation: wizardStepInLeft   0.28s cubic-bezier(0.25, 1, 0.5, 1) both; }
.wizard-body.step-exit-left    { animation: wizardStepOutLeft  0.15s ease-in both; }
.wizard-body.step-exit-right   { animation: wizardStepOutRight 0.15s ease-in both; }
.wizard-body.step-anim-refresh { animation: wizardStepRefresh  0.15s ease both; }

/* ── Wizard icon progress ring ─────────────────────────── */
.wizard-icon-ring {
  position: relative;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wizard-ring-svg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.wizard-ring-track { fill: none; stroke: var(--border); stroke-width: 3.5; }
.wizard-ring-fill  {
  fill: none; stroke: var(--accent); stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 289.03;
  stroke-dashoffset: 289.03;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Copy step button ──────────────────────────────────── */
.wizard-copy-step {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.75rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.wizard-copy-step:hover { color: var(--text); border-color: var(--border); }
.wizard-copy-step svg   { flex-shrink: 0; }
.wizard-icon  { font-size: 2.4rem; flex-shrink: 0; line-height: 1; }
.wizard-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.wizard-step-counter { display: none; }


.wizard-body { min-height: 170px; margin-bottom: 24px; }
.wizard-step-num {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--accent); margin-bottom: 10px;
  scroll-margin-top: 68px;
}
.wizard-step-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 13px; line-height: 1.3; }
.wizard-step-body  { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.8; }
.wizard-step-body strong { color: var(--text); font-weight: 600; }
.wizard-step-body em {
  color: var(--text); font-style: normal;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 6px; font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.wizard-step-action { margin-top: 14px; }


/* ── Phase 1: Step meta row (num + duration) ─────────── */
.wizard-step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wizard-step-meta .wizard-step-num {
  margin-bottom: 0;
}
.wizard-step-duration {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 1px 7px;
}

/* ── Phase 1: Warning / danger banners ───────────────── */
.wizard-step-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.84rem;
  line-height: 1.55;
  margin-bottom: 14px;
  font-weight: 500;
}
.wizard-step-banner.banner-warn {
  background: var(--warning-subtle);
  border: 1px solid rgba(200,144,48,0.28);
  color: var(--warning);
}
.wizard-step-banner.banner-danger {
  background: var(--danger-subtle);
  border: 1px solid rgba(200,64,64,0.28);
  color: var(--danger);
}

/* ── Phase 1: Expected result confirmation ───────────── */
.wizard-step-expect {
  margin-top: 13px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.65;
  border-left: 3px solid var(--success);
  padding-left: 11px;
  background: var(--success-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 11px;
}

/* ── Phase 1: Inline command copy buttons ────────────── */
.cmd-copy-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px 4px;
  margin-left: 3px;
  border-radius: 2px;
  color: var(--text-muted);
  vertical-align: middle;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}
.cmd-copy-btn:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}
.cmd-copy-btn.cmd-copy-flash {
  color: var(--success);
}

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 18px; border-top: 1px solid var(--border-subtle);
}
.wizard-prev:disabled { opacity: 0.25; cursor: default; }

/* ── Done + thumbs ───────────────────────────────────── */
.wizard-done { text-align: center; padding: 16px 0; }
.done-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--success-subtle); border: 3px solid rgba(45,168,112,0.3);
  color: var(--success); font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.done-title  { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.done-body   { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: 18px; }

.thumbs-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.thumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  font-family: inherit;
}
.thumb-btn:hover { transform: scale(1.03); }
.thumb-yes:hover { background: var(--success-subtle); border-color: rgba(45,168,112,0.35); color: var(--success); }
.thumb-no:hover  { background: var(--surface-raised); border-color: var(--border); }

.done-feedback { margin-bottom: 18px; }
.feedback-win {
  background: var(--success-subtle);
  border: 1px solid rgba(45,168,112,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
  text-align: center;
}
.feedback-nofix {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
}
.feedback-nofix strong { color: var(--text); }

/* ── Related guides (wizard done) ─────────────────────── */
.wizard-related { padding: 18px 0 4px; }
.related-label  {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 10px;
}
.related-grid {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.related-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-family: inherit; cursor: pointer;
  width: calc(33.33% - 6px); min-width: 86px;
  transition: border-color 0.15s, transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
dotlottie-player.related-icon { display: block; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; mix-blend-mode: multiply; }
[data-theme="dark"] dotlottie-player.related-icon { mix-blend-mode: normal; }
.related-emoji { font-size: 1.75rem; line-height: 1; }
.related-title { font-size: 0.68rem; font-weight: 700; color: var(--text); text-align: center; line-height: 1.3; }
.feedback-nofix p { margin: 0 0 12px; }
.feedback-nofix-msg { text-align: left; }

.feedback-nofix-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-reddit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #cc3700;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 2px;
  font-family: inherit;
}
.btn-reddit:hover { background: #aa2e00; }

.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Panic home CTA ──────────────────────────────────── */
.btn-panic-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
  padding: 9px 20px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.1s;
  width: auto;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}
.btn-panic-home:hover {
  background: var(--surface-raised);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-panic-home:active {
  transform: translateY(3px);
  box-shadow: none;
}

/* ── Panic entry card (Fix an Issue tab) ─────────────── */
.panic-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: var(--accent-subtle);
  border: 1px solid rgba(88,204,2,0.22);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 28px;
}
.panic-entry-card:hover {
  background: rgba(88,204,2,0.18);
  border-color: var(--accent);
}
.panic-entry-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.panic-entry-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.panic-entry-title { font-size: 0.88rem; font-weight: 600; color: var(--text); display: block; }
.panic-entry-sub   { font-size: 0.78rem; color: var(--text-secondary); display: block; }
.panic-entry-arrow { color: var(--text-secondary); flex-shrink: 0; }

/* ── Fix an Issue view: hero search redesign ─────────── */

/* Flex column so we can reorder children visually */
#view-issues .card {
  display: flex;
  flex-direction: column;
}

/* 1. Heading: centered */
#view-issues .card-title {
  order: 1;
  text-align: center;
  margin-bottom: 8px;
}

/* 2. Subtitle: centered, a bit more air below */
#view-issues .card-subtitle {
  order: 2;
  text-align: center;
  margin-bottom: 28px;
}

/* 3. Search: the hero element */
#view-issues .symptom-search-wrap {
  order: 3;
  margin-bottom: 0;
}
#view-issues .symptom-search-wrap .search-section-label { display: none; }

#view-issues .symptom-search {
  padding: 20px 52px 20px 56px;
  font-size: 1rem;
  box-shadow: 0 4px 0 var(--border);
}
#view-issues .symptom-search:focus {
  box-shadow: 0 4px 0 rgba(88, 204, 2, 0.38);
}
#view-issues .search-icon {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}
#view-issues .search-clear {
  top: 50%;
  transform: translateY(-50%);
  right: 18px;
}

/* 4. Error code decoder: secondary search, sits below symptom search */
#view-issues .error-code-wrap {
  order: 4;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
#view-issues .error-code-wrap .search-section-label {
  display: block;
  text-align: center;
  margin-bottom: 8px;
}

/* 5. Community badge: centered, sits below the error decoder as a trust signal */
#view-issues .community-counter {
  order: 5;
  justify-content: center;
  margin-top: 18px;
  margin-bottom: 22px;
}

/* 6. Panic card: secondary CTA below the badge */
#view-issues .panic-entry-card {
  order: 6;
  margin-bottom: 28px;
}

/* Keep remaining children in their natural order */
#view-issues #search-results { order: 7; }
#view-issues #issue-grid     { order: 8; }
#view-issues #panic-triage   { order: 9; }

/* ── Panic triage panel ──────────────────────────────── */
.panic-triage {
  padding-top: 4px;
}
.panic-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  transition: color 0.15s;
}
.panic-back-btn:hover { color: var(--text); }
.panic-reassurance {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.panic-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}
.panic-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.panic-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-raised);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.13s, border-color 0.13s;
  color: var(--text);
}
.panic-choice-btn:hover {
  background: rgba(88,204,2,0.1);
  border-color: rgba(88,204,2,0.25);
}
.panic-choice-icon  { font-size: 1.15rem; flex-shrink: 0; line-height: 1; }
.panic-choice-label { font-size: 0.88rem; font-weight: 500; }
.panic-cancel-btn {
  display: block;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
  margin-top: 4px;
}
.panic-cancel-btn:hover { color: var(--accent-hover); }

/* ── Panic stop state ────────────────────────────────── */
.panic-stop-state {
  padding: 18px 20px;
  background: var(--danger-subtle);
  border: 1px solid rgba(200,64,64,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.panic-stop-state--info {
  background: var(--accent-subtle);
  border-color: rgba(88,204,2,0.2);
}
.panic-stop-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: block;
}
.panic-stop-msg {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}
.panic-stop-state .btn-primary { width: 100%; justify-content: center; }

/* ── Wizard pre-triage ───────────────────────────────── */
.wizard-pretriage {
  padding: 8px 0 20px;
}
.pretriage-intro {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.pretriage-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.pretriage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 14px;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: border-color 0.13s;
  font-size: 0.875rem;
  color: var(--text);
  user-select: none;
}
.pretriage-item:hover { border-color: rgba(88,204,2,0.22); }
.pretriage-item:has(input:checked) {
  background: var(--success-subtle);
  border-color: rgba(88,204,2,0.25);
}
.pretriage-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.pretriage-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.pretriage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Already tried step label ────────────────────────── */
.wizard-already-tried {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  background: var(--warning-subtle);
  border: 1px solid rgba(200,144,48,0.22);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--warning);
  line-height: 1.5;
  margin-bottom: 12px;
}
.wizard-already-tried span { flex: 1; }
.already-tried-undo {
  background: none;
  border: none;
  color: var(--warning);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.already-tried-undo:hover { opacity: 1; }

/* ── Footer ──────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 40px 24px 28px;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.footer-logo { display: block; margin: 0 auto 10px; }
.footer-logo-dark { display: none; }
[data-theme="dark"] .footer-logo-light { display: none; }
[data-theme="dark"] .footer-logo-dark { display: block; }
.footer-tagline { margin: 0; }
.footer-links { margin-top: 8px; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-sister-tools { margin-top: 24px; padding-top: 0; }
.footer-sister-label { margin: 0 0 12px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); opacity: 0.7; }
.footer-sister-cards { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto; }
.footer-sister-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--surface); border: none; border-radius: 10px; text-decoration: none; color: inherit; transition: background 0.2s, transform 0.2s; }
.footer-sister-card:hover { background: var(--surface-raised, var(--surface)); transform: translateY(-1px); }
.footer-sister-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.footer-sister-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.footer-sister-text strong { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.footer-sister-text span { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
@media (min-width: 540px) {
  .footer-sister-cards { flex-direction: row; }
  .footer-sister-card { flex: 1; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 540px) {
  .app-main { padding: 20px 14px 32px; }
  .card { padding: 20px 18px; }
  .hero-card { padding: 40px 24px 36px; }
  .hero-title { font-size: 2.2rem; }
  .hero-body { font-size: 0.9rem; margin-bottom: 20px; }
  .trust-row { gap: 6px; margin-bottom: 22px; }
  .trust-chip { font-size: 0.75rem; padding: 5px 12px; }
  .btn-primary.btn-lg { width: 100%; justify-content: center; padding: 16px 20px; }
  .wizard-card { padding: 18px 16px 20px; }
  .wizard-toolbar { flex-wrap: wrap; gap: 6px; }
  .issue-grid { grid-template-columns: 1fr 1fr; }
  .result-actions, .done-actions { flex-direction: column; align-items: stretch; }
  .thumbs-row { gap: 8px; }
  .thumb-btn { flex: 1; justify-content: center; padding: 11px 14px; }
  .score-row {
    flex-direction: row;
    text-align: left;
    padding: 18px 16px;
    gap: 18px;
    align-items: center;
  }
  .score-ring-wrap { width: 90px; height: 90px; flex-shrink: 0; }
  .score-ring { width: 90px; height: 90px; }
  .score-num { font-size: 1.5rem; }
  .header-inner { gap: 6px; }
  .nav-btn { padding: 10px 12px; font-size: 0.84rem; min-height: 44px; }
  .seo-categories { grid-template-columns: 1fr; }
  .app-header { padding: 0 14px; }
  .wizard-step-title { font-size: 1.05rem; }
  .wizard-step-body { font-size: 0.9rem; }
  .done-actions { gap: 8px; }
  .pretriage-actions { flex-direction: column; }
  .pretriage-actions .btn-primary,
  .pretriage-actions .btn-ghost { width: 100%; justify-content: center; }
  .wizard-nav { gap: 8px; }
  .wizard-prev, .wizard-next { flex: 1; justify-content: center; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 1.85rem; }
  .issue-grid { grid-template-columns: 1fr; }
  .issue-card { min-height: 60px; }
  .hero-card { padding: 32px 18px 28px; }
  .trust-chip { padding: 5px 10px; font-size: 0.72rem; }
  .issue-category-label { font-size: 0.8rem; }
}

/* ── SEO Content Section ─────────────────────────────── */
.seo-content {
  background: var(--surface);
  padding: 20px 0 32px;
  margin-top: 0;
}
.seo-details {
  width: 100%;
}
.seo-details[open] {
  padding-bottom: 8px;
}
.seo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  user-select: none;
}
.seo-summary::-webkit-details-marker { display: none; }
.seo-summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: color 0.15s;
}
.seo-summary:hover .seo-summary-label { color: var(--accent); }
.seo-summary-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s;
}
.seo-summary:hover .seo-summary-arrow { color: var(--accent); }
.seo-details[open] .seo-summary-arrow { transform: rotate(180deg); }

.seo-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.seo-details .seo-about {
  margin-top: 16px;
}
.seo-details .seo-categories,
.seo-details .seo-privacy {
  margin-top: 0;
}

.seo-about h2 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.seo-about p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 8px;
  padding-left: 15px;
}
.seo-about p:last-child { margin: 0; }

.seo-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.seo-cat {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px 10px;
}
.seo-cat h3 {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.seo-cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.seo-cat li {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.seo-cat li:first-child { padding-top: 0; }
.seo-cat li:last-child { border-bottom: none; padding-bottom: 0; }
.seo-cat li strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
  font-size: 0.81rem;
  font-weight: 600;
}

.seo-privacy {
  background: var(--accent-subtle);
  border: 1px solid rgba(88,204,2,0.18);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.seo-privacy h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.seo-privacy p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 580px) {
  .seo-categories {
    grid-template-columns: 1fr;
  }
}

/* ── Phase 2.3: Guide-level YouTube video embed ──────── */
.wizard-video { margin-bottom: 18px; }
.wizard-video-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.wizard-video-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--surface-raised);
  transition: background 0.15s;
  user-select: none;
}
.wizard-video-summary::-webkit-details-marker { display: none; }
.wizard-video-summary:hover { background: var(--accent-subtle); }
.wizard-video-summary span { flex: 1; }
.wizard-video-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.wizard-video-details[open] .wizard-video-chevron { transform: rotate(180deg); }
.wizard-video-body { background: #000; }
.wizard-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.wizard-video-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.wizard-video-notice {
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-raised);
  border-top: 1px solid var(--border-subtle);
}

/* ── Phase 2.1 / 2.2: Step image and GIF ────────────── */
.wizard-step-img { margin-top: 18px; }
.step-img-btn {
  display: block;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  padding: 0;
  overflow: hidden;
  position: relative;
  text-align: left;
}
.step-img-btn:hover .step-img-expand { opacity: 1; }
.step-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.step-gif { width: 100%; }
.step-img-expand {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

/* ── Phase 2.1 / 2.2: Lightbox ──────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  animation: lightboxIn 0.18s ease;
}
@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: min(100%, 900px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }


/* ── Phase 5.2: Reddit verified label ───────────────── */
.wizard-reddit-verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Phase 5.1: "Still stuck?" escalation section ───── */
.escalation {
  margin-top: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.escalation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 0;
}
.escalation-summary::-webkit-details-marker { display: none; }
.escalation-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.escalation[open] .escalation-chevron { transform: rotate(180deg); }

.escalation-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.escalation-intro {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.65;
}

.escalation-template {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.escalation-pre {
  font-family: inherit;
  font-size: 0.74rem;
  color: var(--text-secondary);
  background: var(--surface-raised);
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  max-height: 180px;
  overflow-y: auto;
}

.escalation-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  background: var(--surface);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.escalation-copy-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.escalation-search-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ff4500;
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
}
.escalation-search-link:hover { text-decoration: underline; }

/* ── Recently viewed guides ──────────────────────────── */
.recently-viewed {
  max-width: 660px;
  margin: 0 auto 18px;
  width: 100%;
}

.recently-viewed-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.recently-viewed-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: left;
  line-height: 1.3;
}
.recent-chip:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

.recent-chip-icon { font-size: 1rem; flex-shrink: 0; }
.recent-chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ── Wizard toolbar: meta + action icons on one row ──── */
.wizard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── Phase 3.4 / 3.3: Severity pill + shop cost ─────── */
.wizard-guide-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  flex: 1;
}

.wizard-severity {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  border: none;
}

.severity-safe    { background: #58cc02; box-shadow: 0 3px 0 #58a700; }
.severity-careful { background: #ff9600; box-shadow: 0 3px 0 #cc7800; }
.severity-pro     { background: #ff4b4b; box-shadow: 0 3px 0 #cc3b3b; }

.wizard-shop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  white-space: nowrap;
}

/* ── Phase 6.2: Step elapsed timer ─────── */
.wizard-step-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.wizard-step-timer.timer-over {
  color: var(--warning);
  border-color: var(--warning);
}

/* ── Phase 4.3 / 4.4: Wizard action buttons bar ─────── */
.wizard-actions {
  display: flex;
  gap: 4px;
  padding: 0;
  flex-shrink: 0;
}

.wizard-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0;
  font-family: inherit;
  padding: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.wizard-action-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Phase 3.2: Affiliate product card ───────────────── */
.wizard-step-product { margin-top: 16px; }

.product-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.product-card-icon {
  grid-row: 1 / 3;
  color: var(--accent);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.product-card-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.product-card-btn {
  grid-row: 1;
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 0.77rem;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.product-card-btn:hover { background: var(--accent-hover, var(--accent)); filter: brightness(0.9); }

.product-card-label {
  grid-row: 2;
  grid-column: 3;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
}

@media (max-width: 540px) {
  .product-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
  }
  .product-card-btn {
    grid-row: 3;
    grid-column: 1 / 3;
    justify-content: center;
  }
  .product-card-label {
    grid-row: 4;
    grid-column: 1 / 3;
    text-align: center;
  }
}

/* ── Phase 4.1: QR code modal ────────────────────────── */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lightboxIn 0.18s ease;
}

.qr-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 280px;
  width: 100%;
}

.qr-modal-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.qr-modal-canvas { line-height: 0; }
.qr-modal-canvas table { border-collapse: collapse; }
.qr-modal-canvas td { padding: 0; }

.qr-modal-url {
  font-size: 0.7rem;
  color: var(--text-secondary);
  word-break: break-all;
  max-width: 100%;
  margin: 0;
}

.qr-modal-close { width: 100%; }

/* ── Production polish ───────────────────────────────── */

/* Brand selection colour */
::selection { background: rgba(88,204,2,0.18); color: var(--text); }

/* Remove tap flash on mobile */
button, a, [role="button"],
.issue-card, .recent-chip,
.panic-choice-btn, .nav-btn,
.thumb-btn, .wizard-action-btn,
.escalation-summary, .seo-summary { -webkit-tap-highlight-color: transparent; }

/* Keyboard focus: visible, branded, consistent */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible { border-radius: var(--radius-sm); }
.issue-card:focus-visible { border-radius: var(--radius-md); }

/* Remove default focus ring where :focus-visible handles it */
:focus:not(:focus-visible) { outline: none; }

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* ── Theme toggle button ─────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm), var(--gloss);
  transition: background 0.14s, color 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.theme-toggle:hover {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow), var(--gloss);
}
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun  { display: block; }

/* Smooth color transitions on theme switch */
body,
.app-header,
.card,
.hero-card,
.issue-card,
.history-item,
.result-group,
.score-row,
.recent-chip,
.wizard-step,
.wizard-toolbar,
.seo-content,
.panel-results,
.escalation-summary,
.panic-choice-btn,
.wizard-action-btn,
.btn,
.symptom-search,
.nav-btn {
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

/* History badge icon: show the SVG clock */
.history-badge-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--accent);
}

/* Issue card title: max 3 lines with ellipsis */
.issue-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Panic choice buttons: min touch target */
.panic-choice-btn { min-height: 44px; }

/* Symptom search clear button / input improvements */
.symptom-search-wrap { position: relative; }

/* Wizard nav buttons: always 44px tall */
.wizard-prev, .wizard-next { min-height: 44px; }

/* Done icon: animated entrance */
.done-icon {
  animation: doneIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes doneIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Respect system reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Emoji suppression ───────────────────────────────── */
/* Guide emojis are a follow-up replacement task.        */
/* These containers are hidden until custom icons land.  */
.recent-chip-icon,
.panic-choice-icon,
.issue-cta-emoji,
.issue-card-emoji,
.history-fix-icon { display: none; }

/* ── Phase 4.2: Print styles ─────────────────────────── */
@media print {
  .app-header,
  .app-footer,
  .seo-content,
  .wizard-toolbar,
  .wizard-video,

  .wizard-nav,
  .wizard-done,
  .wizard-pretriage,
  .wizard-step-banner,
  .wizard-step-img,
  .wizard-step-product,
  .wizard-step-action,
  .wizard-step-expect,
  .wizard-step-meta,
  .wizard-copy-step,
  .btn-back,
  #view-home,
  #view-issues,
  .qr-modal,
  .lightbox {
    display: none !important;
  }

  body, html { background: #fff; color: #000; }

  .app, .app-main { display: block; }

  .view { display: block !important; visibility: visible !important; }
  #view-wizard { display: block !important; }

  .wizard-card {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: 100%;
  }

  .wizard-header {
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .wizard-step-counter {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
  }

  .wizard-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 12px 0 8px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 16px;
  }

  .wizard-title  { font-size: 1.15rem; font-weight: 700; color: #000; }
  .wizard-icon   { font-size: 2rem; }
  dotlottie-player.wizard-lottie-icon { display: none; }

  .wizard-step-title { font-size: 1rem; font-weight: 700; color: #000; }

  .wizard-step-body {
    font-size: 0.88rem;
    color: #222;
    line-height: 1.65;
    margin-bottom: 10px;
  }

  .wizard-body {
    display: block !important;
    page-break-inside: avoid;
  }

  .cmd-copy-btn { display: none; }

  a { color: #000; text-decoration: underline; }

  .publish-checklist { display: none; }
}

/* ── Pre-publish checklist (dev only, not shown on live domain) ─── */
.publish-checklist {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #111827;
  border-top: 2px solid var(--accent);
  font-size: 0.8rem;
  font-family: inherit;
}
.publish-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
}
.publish-toggle:hover { background: rgba(88,204,2,0.08); }
.publish-chevron { margin-left: auto; color: var(--text-muted); transition: transform 0.2s; }
.publish-toggle[aria-expanded="true"] .publish-chevron { transform: rotate(180deg); }
.publish-list {
  list-style: none;
  margin: 0;
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}
.publish-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.publish-item-todo {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
}
.publish-item-pass {
  background: rgba(45,168,112,0.08);
  border: 1px solid rgba(45,168,112,0.2);
}
.publish-item-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.publish-item-todo .publish-item-icon { color: var(--danger); }
.publish-item-pass .publish-item-icon { color: var(--success); }
.publish-item-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.publish-item-text strong {
  font-size: 0.8rem;
  color: var(--text);
}
.publish-item-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Error Code Decoder ───────────────────────────────────────── */
.error-code-wrap {
  margin: 4px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.error-code-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.error-code-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.error-code-inner .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.error-code-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.error-code-input:focus {
  border-color: var(--green);
}
.error-code-input::placeholder { color: var(--text-muted); }
.error-code-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-alt, rgba(88,204,2,0.06));
  border: 1.5px solid rgba(88,204,2,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  flex-wrap: wrap;
}
.error-code-result-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.error-code-match-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.error-code-match-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.error-code-go {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 8px 14px;
  white-space: nowrap;
}
.error-code-step-hint {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  display: block;
}
.error-code-no-match {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 0 4px;
}
.error-code-no-match a {
  color: var(--green);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════
   MODAL (CONTACT)
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease, pointer-events 0s;
  padding: 16px;
  opacity: 1;
  pointer-events: auto;
}
.modal-overlay[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, pointer-events 0s 0.2s;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay[aria-hidden="true"] .modal-content {
  transform: translateY(20px) scale(0.95);
}
.btn-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.btn-modal-close:hover {
  color: var(--text);
  background: var(--surface-raised);
}
.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.15);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-actions {
  margin-top: 24px;
}
.contact-feedback.success {
  background: rgba(88, 204, 2, 0.1);
  color: var(--green);
  border: 1px solid rgba(88, 204, 2, 0.2);
}
.contact-feedback.error {
  background: rgba(255, 75, 75, 0.1);
  color: #ff4b4b;
  border: 1px solid rgba(255, 75, 75, 0.2);
}
.btn-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover {
  color: var(--text);
}
