/* ============================================================
   Lenbd.org — Free Web Test | styles.css
   Clean, deduplicated, conflict-free stylesheet
   ============================================================ */

/* ── DESIGN TOKENS ── */
:root {
  --radius-sm: 5px; --radius-md: 10px;
  --radius-lg: 16px; --radius-xl: 22px;
  --font-body:  'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono:  'JetBrains Mono', monospace;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.18s var(--ease-out);
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg:        #0b0f19;
  --bg-1:      #131720;
  --bg-2:      #1a1f2e;
  --bg-3:      #252a3a;
  --bg-hover:  #1e2433;
  --border:    rgba(255,255,255,0.09);
  --border-2:  rgba(255,255,255,0.16);
  --ink:       #f8fafc;
  --ink-2:     #cbd5e1;
  --ink-3:     #64748b;
  --ink-inv:   #09090b;
  --accent:        #6366f1;
  --accent-dim:    rgba(99,102,241,0.12);
  --accent-hover:  #818cf8;
  --good:    #22c55e; --good-bg:   rgba(34,197,94,0.10);
  --medium:  #f59e0b; --medium-bg: rgba(245,158,11,0.10);
  --poor:    #f97316; --poor-bg:   rgba(249,115,22,0.10);
  --bad:     #ef4444; --bad-bg:    rgba(239,68,68,0.10);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.45);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.65);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:        #f8fafc;
  --bg-1:      #ffffff;
  --bg-2:      #f1f5f9;
  --bg-3:      #e2e8f0;
  --bg-hover:  #f1f5f9;
  --border:    rgba(0,0,0,0.08);
  --border-2:  rgba(0,0,0,0.16);
  --ink:       #0f172a;
  --ink-2:     #475569;
  --ink-3:     #94a3b8;
  --ink-inv:   #ffffff;
  --accent:        #4f46e5;
  --accent-dim:    rgba(79,70,229,0.08);
  --accent-hover:  #6366f1;
  --good:    #16a34a; --good-bg:   rgba(22,163,74,0.08);
  --medium:  #d97706; --medium-bg: rgba(217,119,6,0.08);
  --poor:    #ea580c; --poor-bg:   rgba(234,88,12,0.08);
  --bad:     #dc2626; --bad-bg:    rgba(220,38,38,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--ink);
  min-height: 100vh; overflow-x: hidden;
  width: 100%; max-width: 100%;
  line-height: 1.6;
}
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
a { color: inherit; }
/* ── SCROLLBAR ── */
::-webkit-scrollbar { 
  width: 12px;
  height: 12px; 
}
::-webkit-scrollbar-track { 
  background: var(--bg-2); 
}
::-webkit-scrollbar-thumb { 
  background: var(--ink-3);
  border-radius: 6px; 
  border: 3px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { 
  background: var(--ink-2);
}

/* ── LAYOUT ── */
.wrap {
  width: 100%; max-width: 100%;
  padding: 0 clamp(16px, 4vw, 56px);
  box-sizing: border-box;
}
.app-shell {
  width: 100%; min-height: 100vh;
  display: flex; flex-direction: column;
  padding-top: 58px;
}
.hidden { display: none !important; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  width: 100%;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity 0.2s;
}
.brand-mark:hover { opacity: 0.8; }
.brand-name {
  font-size: 0.95rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em;
}
.brand-dot { color: var(--accent); }
.brand-sub { display: block; font-size: 0.6rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--ink-2); transition: var(--transition);
}
.theme-btn:hover { background: var(--bg-3); color: var(--ink); }
[data-theme="dark"]  .sun-icon  { display: none; }
[data-theme="light"] .moon-icon { display: none; }

/* ── HERO ── */
.hero {
  width: 100%; text-align: center;
  padding: clamp(20px, 3vw, 40px) 0 clamp(16px, 2.5vw, 32px);
  position: relative; overflow: visible;
  display: flex; align-items: flex-start; justify-content: center;
  transition: padding 0.5s cubic-bezier(0.4,0,0.2,1);
}
.hero::before {
  content: ''; position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: min(1000px, 150vw); height: 600px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 920px;
  margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px);
}
.hero-text-block {
  overflow: visible; max-height: 600px;
  transition: opacity 0.35s ease, max-height 0.5s cubic-bezier(0.4,0,0.2,1);
  margin-bottom: 20px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(99,102,241,0.22);
  padding: 5px 16px; border-radius: 20px; margin-bottom: 18px;
  animation: eyebrowPulse 2s ease-in-out infinite;
}
.eyebrow-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
@keyframes eyebrowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
  50%       { box-shadow: 0 0 0 4px rgba(99,102,241,0.12); }
}
.hero-title {
  font-family: var(--font-serif); font-size: clamp(2.1rem, 5.5vw, 5rem);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.03em;
  margin-bottom: 14px; color: var(--ink);
  text-wrap: balance;
}
.hero-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 60%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block; padding-right: 0.1em;
}
.hero-desc {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  color: var(--ink-2); line-height: 1.7;
}

/* ── SEARCH ── */
.search-block {
  width: 100%; max-width: 860px; margin: 0 auto;
  transition: margin-top 0.4s cubic-bezier(0.4,0,0.2,1);
}
.search-field {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1.5px solid rgba(99,102,241,0.45);
  border-radius: 100px;
  padding: clamp(7px,1vw,10px) clamp(7px,1vw,10px) clamp(7px,1vw,10px) clamp(16px,2vw,22px);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.06), 0 0 18px rgba(99,102,241,0.12), 0 4px 20px rgba(0,0,0,0.07);
  animation: searchGlow 4s ease-in-out infinite;
  transition: border-color 0.22s, box-shadow 0.22s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] .search-field { background: rgba(255,255,255,0.80); }
[data-theme="dark"]  .search-field { background: rgba(20,24,36,0.65); animation: searchGlowDark 4s ease-in-out infinite; }
/* ── SEARCH FIELD GLOW FIX ── */
.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 8px rgba(99,102,241,0.12); 
}

@keyframes searchGlow {
  0%, 100% { 
    box-shadow: 0 0 0 3px rgba(99,102,241,0.06), 0 0 12px rgba(99,102,241,0.1); 
    border-color: rgba(99,102,241,0.3); 
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(99,102,241,0.12), 0 0 25px rgba(99,102,241,0.2); 
    border-color: rgba(99,102,241,0.6); 
  }
}

@keyframes searchGlowDark {
  0%, 100% { 
    box-shadow: 0 0 0 4px rgba(99,102,241,0.08), 0 0 18px rgba(99,102,241,0.15); 
    border-color: rgba(99,102,241,0.35); 
  }
  50% { 
    box-shadow: 0 0 0 10px rgba(99,102,241,0.15), 0 0 35px rgba(99,102,241,0.3); 
    border-color: rgba(99,102,241,0.7); 
  }
}
.search-prefix { color: var(--ink-3); flex-shrink: 0; display: flex; }
.search-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-family: var(--font-mono); font-size: clamp(0.82rem,1.4vw,0.92rem);
  color: var(--ink); caret-color: var(--accent);
}
.search-input::placeholder { color: var(--ink-3); font-family: var(--font-body); }
.device-group { display: flex; gap: 2px; flex-shrink: 0; }
.dev-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; padding: 6px 11px;
  border-radius: var(--radius-sm); color: var(--ink-3);
  background: transparent; transition: var(--transition);
  border: 1px solid transparent; white-space: nowrap;
}
.dev-pill:hover { color: var(--ink-2); background: var(--bg-2); }
.dev-pill.active { color: var(--accent); background: var(--accent-dim); border-color: rgba(99,102,241,0.2); }
.analyze-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  color: white; font-size: clamp(0.82rem,1.2vw,0.92rem); font-weight: 700;
  padding: clamp(11px,1.5vw,14px) clamp(18px,2.5vw,28px);
  border-radius: 100px; flex-shrink: 0; white-space: nowrap;
  transition: var(--transition); box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.analyze-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(99,102,241,0.5); }
.analyze-btn:active { transform: none; }
.analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.search-note { font-size: 0.72rem; color: var(--ink-3); margin-top: 10px; text-align: center; }
.feature-pills {
  display: flex; flex-wrap: nowrap; justify-content: center;
  gap: 6px; margin-top: 20px;
  overflow-x: auto; scrollbar-width: none;
}
.feature-pills::-webkit-scrollbar { display: none; }
.fpill {
  font-size: 0.72rem; font-weight: 600; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 20px;
  transition: var(--transition); white-space: nowrap; flex-shrink: 0;
}
.fpill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.hero.hero-collapsed { padding: 14px 0; }
.hero.hero-collapsed .hero-text-block { opacity: 0; max-height: 0; margin: 0; padding: 0; pointer-events: none; }
.hero.hero-collapsed::before { opacity: 0; }
.hero.hero-collapsed .search-note,
.hero.hero-collapsed .feature-pills { display: none !important; }

/* ── LOADING STATE ── */
.loading-state { padding: 10px 0; }
.loading-wrap {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.loading-visual {
  position: relative; width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.scan-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: scanExpand 1.8s ease-out infinite;
}
.scan-ring.r1 { width: 40px; height: 40px; animation-delay: 0s; }
.scan-ring.r2 { width: 60px; height: 60px; animation-delay: 0.4s; }
.scan-ring.r3 { width: 80px; height: 80px; animation-delay: 0.8s; }
@keyframes scanExpand {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 0; }
}
.scan-core {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); animation: scanCorePulse 1s ease-in-out infinite alternate;
  position: relative; z-index: 1;
}
@keyframes scanCorePulse { from { opacity: 0.6; } to { opacity: 1; } }
.loading-text { text-align: center; }
.loading-headline { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.loading-step { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-3); margin-bottom: 12px; }
.step-track { height: 3px; background: var(--bg-3); border-radius: 2px; width: 100%; max-width: 860px; }
.step-prog  { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; width: 5%; }

/* ── ERROR STATE ── */
.error-state { padding: 20px 0; }
.error-box {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.error-left { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; }
.error-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--bad-bg); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--bad); }
.error-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.error-msg { font-size: 0.82rem; color: var(--ink-2); white-space: pre-wrap; font-family: var(--font-mono); }

/* ── BUTTONS ── */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 600; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-ghost:hover { color: var(--ink); background: var(--bg-3); }
.btn-sm { padding: 6px 10px; font-size: 0.76rem; white-space: nowrap; }
.btn-accent {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: 0.78rem; font-weight: 700;
  background: var(--accent); color: white;
  transition: var(--transition);
}
.btn-accent:hover { background: var(--accent-hover); }

/* ── RESULTS ── */
.results { width: 100%; }
.results-topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: nowrap; gap: 8px; padding: 16px 0 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
  overflow: visible;
}
.rt-left  { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex: 1; min-width: 0; overflow: hidden; }
.rt-right { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; white-space: nowrap; }
.share-group { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rt-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.rt-url   { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 60px; max-width: 420px; flex: 1; text-decoration: none; }
.rt-url:hover { text-decoration: underline; }
.rt-time  { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-3); }
.chip { font-size: 0.62rem; font-weight: 800; padding: 2px 8px; border-radius: 5px; letter-spacing: 0.06em; }
.chip-demo { background: var(--medium-bg); color: var(--medium); }

/* ── SHARE DROPDOWN ── */
.share-dropdown-wrap { position: relative; }
.share-dropdown {
  position: fixed;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); min-width: 185px;
  box-shadow: var(--shadow-md); z-index: 9999; overflow: hidden;
}
.share-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-2); text-align: left; transition: var(--transition);
  background: none; border: none; cursor: pointer;
}
.share-item:hover { background: var(--bg-2); color: var(--ink); }
.share-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── DEVICE TABS ── */
.dev-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.dtab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px 10px; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-3); border-bottom: 2px solid transparent;
  transition: var(--transition); background: none; cursor: pointer;
  margin-bottom: -1px;
}
.dtab:hover { color: var(--ink-2); }
.dtab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-badge {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  background: var(--bg-2);
}
.tab-badge.good   { background: var(--good-bg);   color: var(--good); }
.tab-badge.medium { background: var(--medium-bg); color: var(--medium); }
.tab-badge.poor   { background: var(--poor-bg);   color: var(--poor); }
.tab-badge.bad    { background: var(--bad-bg);     color: var(--bad); }
.tab-badge-both   { background: var(--accent); color: #fff; }

/* ── BOTH PANEL STYLES ── */
.both-device-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 12px;
  margin-bottom: 14px; margin-top: 8px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.both-section-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 700; color: var(--ink);
  padding: 14px 18px; margin-bottom: 24px; margin-top: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
}

/* ── PANEL SECTION ── */
.panel-section { margin-bottom: clamp(24px, 3vw, 40px); }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: clamp(12px, 1.5vw, 18px); gap: 12px; flex-wrap: wrap;
}
.sec-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-3);
  display: flex; align-items: center; gap: 7px;
}
.sec-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.sec-badge {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--ink-3); background: var(--bg-2);
  padding: 3px 8px; border-radius: 6px;
}
.sec-note { font-size: 0.75rem; color: var(--ink-3); margin-top: 8px; font-style: italic; }
.pass-box {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--good-bg);
  border: 1px solid rgba(34,197,94,0.2); border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 600; color: var(--good);
}

/* ── SCORE GRID ── */
.score-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: clamp(8px, 1.5vw, 16px); margin-bottom: 32px;
}
.score-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(14px,2vw,22px) clamp(10px,1.5vw,16px);
  text-align: center; transition: transform 0.2s, box-shadow 0.2s;
}
.score-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ring-wrap { position: relative; width: 74px; height: 74px; margin: 0 auto 10px; }
.ring-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--bg-3); stroke-width: 5; }
.ring-fill { fill: none; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out); }
.ring-fill.good   { stroke: var(--good); }
.ring-fill.medium { stroke: var(--medium); }
.ring-fill.poor   { stroke: var(--poor); }
.ring-fill.bad    { stroke: var(--bad); }
.ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700;
}
.ring-label.good   { color: var(--good); }
.ring-label.medium { color: var(--medium); }
.ring-label.poor   { color: var(--poor); }
.ring-label.bad    { color: var(--bad); }
.score-name { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 4px; }
.score-verdict { font-size: 0.72rem; font-weight: 700; }
.score-verdict.good   { color: var(--good); }
.score-verdict.medium { color: var(--medium); }
.score-verdict.poor   { color: var(--poor); }
.score-verdict.bad    { color: var(--bad); }

/* ── VITALS GRID ── */
.vitals-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; margin-bottom: 32px;
}
.vital-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: clamp(12px,1.8vw,18px);
  transition: transform 0.2s;
}
.vital-card:hover { transform: translateY(-2px); }
.vital-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vital-abbr { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; }
.vital-status-dot { width: 7px; height: 7px; border-radius: 50%; }
.vital-status-dot.good   { background: var(--good); }
.vital-status-dot.medium { background: var(--medium); }
.vital-status-dot.poor   { background: var(--poor); }
.vital-status-dot.bad    { background: var(--bad); }
.vital-val  { font-family: var(--font-mono); font-size: clamp(1.1rem,2vw,1.4rem); font-weight: 700; margin-bottom: 2px; }
.vital-val.good   { color: var(--good); }
.vital-val.medium { color: var(--medium); }
.vital-val.poor   { color: var(--poor); }
.vital-val.bad    { color: var(--bad); }
.vital-name  { font-size: 0.68rem; color: var(--ink-3); margin-bottom: 8px; }
.vital-track { height: 3px; border-radius: 2px; background: var(--bg-2); overflow: hidden; margin-bottom: 5px; }
.vital-fill  { height: 100%; border-radius: 2px; }
.vital-range { font-size: 0.62rem; color: var(--ink-3); }

/* ── STATS GRID ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: clamp(12px,1.5vw,16px);
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-2); }
.stat-lbl  { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 6px; }
.stat-val  { font-family: var(--font-mono); font-size: clamp(1rem,1.8vw,1.25rem); font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.stat-val.warn { color: var(--poor); }
.stat-val.bad  { color: var(--bad); }
.stat-note { font-size: 0.62rem; color: var(--ink-3); line-height: 1.4; }

/* ── CONTENT BREAKDOWN ── */
.bk-bar    { height: 12px; border-radius: 6px; overflow: hidden; display: flex; gap: 2px; background: var(--bg-2); margin-bottom: 14px; }
.bk-seg    { border-radius: 2px; min-width: 3px; }
.bk-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.bk-item   { font-size: 0.74rem; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.bk-dot    { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── ISSUE CARDS (Opportunities / Diagnostics) ── */
.issues-stack { display: flex; flex-direction: column; gap: 6px; }
.issue-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.15s;
}
.issue-card.open .issue-chevron { transform: rotate(180deg); }
.issue-card .issue-chevron { transition: transform 0.22s ease; display: flex; align-items: center; }
.issue-card:not(.open) .issue-detail { display: none !important; }
.issue-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: clamp(10px,1.5vw,14px) clamp(12px,1.5vw,16px);
  cursor: pointer; transition: background 0.12s;
}
.issue-trigger:hover { background: var(--bg-hover); }
.issue-severity {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
}
.issue-severity.high   { background: var(--bad-bg);    color: var(--bad); }
.issue-severity.medium { background: var(--medium-bg); color: var(--medium); }
.issue-severity.low    { background: var(--good-bg);   color: var(--good); }
.issue-name { flex: 1; min-width: 0; font-size: 0.88rem; font-weight: 500; color: var(--ink); word-break: break-word; }
.issue-save {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
}
.save-time  { background: var(--bad-bg);    color: var(--bad); }
.save-bytes { background: var(--poor-bg);   color: var(--poor); }
.save-info  { background: var(--medium-bg); color: var(--medium); }
.save-ok    { background: var(--good-bg);   color: var(--good); }
.issue-detail {
  display: block; border-top: 1px solid var(--border);
  padding: clamp(10px,1.5vw,14px) clamp(12px,1.5vw,16px);
  background: var(--bg); overflow-x: auto;
}
.issue-desc { font-size: 0.82rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 12px; word-break: break-word; }
.fix-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fix-tag {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(99,102,241,0.2); padding: 2px 8px; border-radius: 5px;
}

/* ── ISSUE TABLE (inside detail) ── */
.issue-tbl { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.74rem; }
.issue-tbl thead th {
  text-align: left; padding: 6px 10px; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3);
  border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.issue-tbl tbody td { padding: 8px 10px; color: var(--ink-2); border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all; }
.issue-tbl tbody tr:last-child td { border-bottom: none; }
.issue-tbl tbody tr:hover td { background: var(--bg-2); }
.issue-desc-row { font-size: 0.78rem; color: var(--ink-2); margin-top: 5px; line-height: 1.5; }
.sev-badge { font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.sev-badge.sev-high   { background: var(--bad-bg);    color: var(--bad); }
.sev-badge.sev-medium { background: var(--medium-bg); color: var(--medium); }
.sev-badge.sev-low    { background: var(--good-bg);   color: var(--good); }

/* ── DATA TABLE (full-width tables) ── */
.table-scroll { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.data-tbl { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.74rem; }
.data-tbl thead th {
  text-align: left; padding: 7px 10px; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3);
  border-bottom: 1px solid var(--border); background: var(--bg-2);
  white-space: nowrap;
}
.data-tbl tbody td { padding: 8px 10px; color: var(--ink-2); border-bottom: 1px solid var(--border); vertical-align: top; }
.data-tbl tbody tr:last-child td { border-bottom: none; }
.data-tbl tbody tr:hover td { background: var(--bg-2); }
.td-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; color: var(--ink); }
.td-r   { text-align: right; white-space: nowrap; }
.td-red { color: var(--bad); }
.td-blue { color: var(--accent); }
.td-green { color: var(--good); }

/* ── ELEM CODE / ITEM ── */
.elem-code {
  display: block; font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(99,102,241,0.2); border-radius: 5px;
  padding: 4px 8px; margin-top: 0;
  word-break: break-all; white-space: pre-wrap; overflow-wrap: break-word;
  max-width: 100%; line-height: 1.5;
}
/* elem-code inside data table cells */
.data-tbl td .elem-code,
.issue-tbl td .elem-code {
  margin-top: 0; font-size: 0.68rem; padding: 3px 6px;
}
.elem-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.elem-item { padding: 8px 12px; background: var(--bg-2); border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }
.elem-label { font-size: 0.76rem; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.elem-meta  { font-family: var(--font-mono); font-size: 0.7rem; color: var(--poor); margin-bottom: 3px; }

/* ── AUDIT GRID (SEO, A11Y, BP) ── */
.audit-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.audit-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: clamp(10px,1.5vw,14px);
  transition: background 0.12s;
}
.audit-card:hover { background: var(--bg-hover); }
.audit-card.fail  { border-color: rgba(239,68,68,0.2); }
.audit-ico  { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.audit-name { font-size: 0.84rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.audit-desc { font-size: 0.76rem; color: var(--ink-2); line-height: 1.5; word-break: break-word; }
.audit-val  {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-3);
  margin-top: 3px; white-space: normal; word-break: break-all;
}

/* ── PASSED AUDITS ── */
.passed-details {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 16px;
}
.passed-details summary {
  padding: 12px 16px; cursor: pointer; font-size: 0.83rem; font-weight: 600;
  color: var(--good); background: var(--bg-2); list-style: none;
  display: flex; align-items: center; gap: 8px; transition: var(--transition);
}
.passed-details summary:hover { background: var(--bg-3); }
.passed-details[open] summary { border-bottom: 1px solid var(--border); }
.passed-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; padding: 12px; }
.passed-item { font-size: 0.78rem; color: var(--ink-2); padding: 5px 8px; background: var(--bg-2); border-radius: 5px; }
.passed-all summary { color: var(--good); }

/* ── COMPARISON TABLE ── */
.cmp-table { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.cmp-head {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  padding: 10px 18px; background: var(--bg-2);
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-3);
  border-bottom: 1px solid var(--border);
}
.cmp-row {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
}
.cmp-row:last-child { border-bottom: none; }
.cmp-row.section-head { background: var(--bg-2); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.cmp-row:hover:not(.section-head) { background: var(--bg-2); }
.cmp-metric { font-size: 0.82rem; color: var(--ink-2); }
.cmp-score  { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; }
.cmp-score.good   { color: var(--good); }
.cmp-score.medium { color: var(--medium); }
.cmp-score.poor   { color: var(--poor); }
.cmp-score.bad    { color: var(--bad); }

/* ── RECOMMENDATIONS ── */
.rec-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.rec-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: clamp(14px,2vw,20px);
  transition: transform 0.2s;
}
.rec-card:hover { transform: translateY(-2px); }
.rec-num {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700;
  color: var(--accent-hover); opacity: 0.4; flex-shrink: 0; line-height: 1; margin-top: -2px;
}
.rec-title  { font-size: 0.84rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.rec-text   { font-size: 0.78rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; word-break: break-word; }
.rec-impact { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.rec-impact.high   { background: var(--bad-bg);    color: var(--bad); }
.rec-impact.medium { background: var(--medium-bg); color: var(--medium); }
.rec-impact.low    { background: var(--good-bg);   color: var(--good); }

/* ── ADVANCED BADGES ── */
.adv-info-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.adv-badge { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.adv-red    { background: var(--bad-bg);    color: var(--bad); }
.adv-orange { background: var(--poor-bg);   color: var(--poor); }
.adv-yellow { background: var(--medium-bg); color: var(--medium); }
.adv-green  { background: var(--good-bg);   color: var(--good); }

/* ── CRITICAL CHAINS ── */
.chain-tree { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; font-family: var(--font-mono); font-size: 0.74rem; }
.chain-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.chain-row:hover { background: var(--bg-2); }
.chain-node:last-child .chain-row:last-child { border-bottom: none; }
.chain-indent { color: var(--accent); flex-shrink: 0; }
.chain-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); min-width: 0; }
.chain-meta { flex-shrink: 0; color: var(--ink-3); font-size: 0.68rem; }
.chain-node.depth-1 .chain-row { background: rgba(99,102,241,0.02); }
.chain-node.depth-2 .chain-row { background: rgba(99,102,241,0.04); }
.chain-node.depth-3 .chain-row { background: rgba(99,102,241,0.06); }

/* ── ECO IMPACT ── */
.eco-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.04) 0%, rgba(5,150,105,0.08) 100%);
  border: 1px solid rgba(16,185,129,0.2); border-radius: var(--radius-lg); padding: 20px 24px;
}
.eco-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eco-icon { font-size: 2rem; flex-shrink: 0; }
.eco-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.eco-sub   { font-size: 0.76rem; color: var(--ink-2); margin-top: 2px; }
.eco-rating {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  padding: 6px 14px; border-radius: 20px; white-space: nowrap;
}
.eco-rating.good   { background: var(--good-bg);   color: var(--good); border: 1px solid rgba(34,197,94,0.3); }
.eco-rating.medium { background: var(--medium-bg); color: var(--medium); border: 1px solid rgba(245,158,11,0.3); }
.eco-rating.poor   { background: var(--poor-bg);   color: var(--poor); border: 1px solid rgba(249,115,22,0.3); }
.eco-rating.bad    { background: var(--bad-bg);     color: var(--bad); border: 1px solid rgba(239,68,68,0.3); }
.eco-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.eco-metric { text-align: center; }
.eco-metric-val { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.eco-metric-val.good   { color: var(--good); }
.eco-metric-val.medium { color: var(--medium); }
.eco-metric-val.poor   { color: var(--poor); }
.eco-metric-val.bad    { color: var(--bad); }
.eco-metric-lbl { font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.eco-bar-wrap { margin-bottom: 14px; }
.eco-bar-track { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.eco-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.eco-bar-fill.good   { background: linear-gradient(90deg, var(--good), #86efac); }
.eco-bar-fill.medium { background: linear-gradient(90deg, var(--medium), #fde68a); }
.eco-bar-fill.poor   { background: linear-gradient(90deg, var(--poor), #fed7aa); }
.eco-bar-fill.bad    { background: linear-gradient(90deg, var(--bad), #fca5a5); }
.eco-bar-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-3); }
.eco-tip { font-size: 0.8rem; color: var(--ink-2); line-height: 1.55; padding: 10px 14px; background: var(--bg-2); border-radius: var(--radius-sm); border-left: 3px solid var(--good); }

/* ── TECH STACK ── */
.tech-stack-grid { display: flex; flex-direction: column; gap: 14px; }
.tech-group-label { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 8px; }
.tech-items { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 6px 12px;
  transition: var(--transition);
}
.tech-chip:hover { border-color: var(--accent); background: var(--accent-dim); }
.tech-icon { font-size: 1rem; line-height: 1; }
.tech-name { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.tech-ver  { font-family: var(--font-mono); font-size: 0.65rem; color: var(--ink-3); }

/* ── SECURITY CHECKS ── */
.sec-checks-list { display: flex; flex-direction: column; gap: 8px; }
.sec-check-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-1); transition: var(--transition);
}
.sec-check-row.pass { border-color: rgba(34,197,94,0.15); background: rgba(34,197,94,0.02); }
.sec-check-row.fail { border-color: rgba(239,68,68,0.20); background: rgba(239,68,68,0.02); }
.sec-check-status { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.sec-check-body   { flex: 1; min-width: 0; }
.sec-check-label  { font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.sec-check-detail { font-size: 0.78rem; color: var(--ink-2); white-space: pre-line; line-height: 1.5; }
.sec-check-fix    { font-size: 0.75rem; color: var(--accent); margin-top: 6px; line-height: 1.5; font-style: italic; }
.sec-sev-badge { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; align-self: flex-start; }
.sev-critical { background: var(--bad-bg);    color: var(--bad); }
.sev-high     { background: var(--poor-bg);   color: var(--poor); }
.sev-medium   { background: var(--medium-bg); color: var(--medium); }
.sev-low      { background: var(--good-bg);   color: var(--good); }

/* ── PWA PANEL ── */
.pwa-panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.pwa-header { padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.pwa-score-wrap { display: flex; align-items: center; gap: 14px; }
.pwa-score { font-size: 2.2rem; }
.pwa-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.pwa-sub   { font-size: 0.76rem; color: var(--ink-2); margin-top: 3px; }
.pwa-checks { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.pwa-check-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.82rem; transition: background 0.1s; }
.pwa-check-row:hover { background: var(--bg-2); }
.pwa-icon   { flex-shrink: 0; font-size: 0.95rem; }
.pwa-label  { flex: 1; font-weight: 500; color: var(--ink); }
.pwa-req    { font-family: var(--font-mono); font-size: 0.62rem; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.req-yes    { background: rgba(239,68,68,0.08); color: var(--bad); }
.req-no     { background: var(--bg-3); color: var(--ink-3); }
.pwa-status { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.pwa-status.good { color: var(--good); }
.pwa-status.bad  { color: var(--bad); }
.pwa-tip { padding: 12px 16px; font-size: 0.8rem; color: var(--ink-2); line-height: 1.55; border-top: 1px solid var(--border); background: var(--accent-dim); }

/* ── SCHEMA CHIPS ── */
.schema-types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.schema-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-dim); border: 1px solid rgba(99,102,241,0.25); color: var(--accent); padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }

/* ── FOOTER ── */
.footer { padding: 0; margin-top: auto; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  font-size: 0.73rem; font-family: var(--font-mono); color: var(--ink-3);
  border-top: 1px solid var(--border);
  padding: clamp(12px,2vw,16px) clamp(16px,4vw,56px);
}
.footer-center { text-align: center; flex: 1; }
.footer-right  { text-align: right; }
.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 440px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s var(--ease-out);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center;
  color: var(--ink-3); transition: var(--transition);
}
.modal-close:hover { background: var(--bg-2); color: var(--ink); }
.modal-body { padding: 18px 22px; }
.export-opts { display: flex; flex-direction: column; gap: 8px; }
.export-opt {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid var(--border);
  transition: var(--transition); text-align: left; cursor: pointer;
}
.export-opt:hover { border-color: var(--accent); background: var(--accent-dim); }
.export-opt-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.export-opt-name { font-size: 0.84rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.export-opt-desc { font-size: 0.74rem; color: var(--ink-3); }

/* ── PRINT ── */
@media print {
  .nav, .hero, .footer, .share-group, .btn-ghost, .analyze-btn, .dev-tabs, .modal-overlay { display: none !important; }
  .results { display: block !important; padding: 20px; }
  .issue-detail { display: block !important; }
  body { background: white; color: black; }
}

/* ── LARGE SCREENS (≥1200px) ── */
@media (min-width: 1200px) {
  .vitals-grid { grid-template-columns: repeat(6,1fr); }
  .stats-grid  { grid-template-columns: repeat(4,1fr); }
  .audit-grid  { grid-template-columns: repeat(3,1fr); }
  .rec-grid    { grid-template-columns: repeat(3,1fr); }
}

/* ── TABLET (768–1199px) ── */
@media (max-width: 1199px) and (min-width: 601px) {
  .score-grid  { grid-template-columns: repeat(4,1fr); }
  .vitals-grid { grid-template-columns: repeat(3,1fr); }
  .stats-grid  { grid-template-columns: repeat(3,1fr); }
  .audit-grid  { grid-template-columns: repeat(2,1fr); }
  .rec-grid    { grid-template-columns: repeat(2,1fr); }
  .eco-metrics { grid-template-columns: repeat(2,1fr); }
}

/* ── MOBILE (≤600px) ── */
@media (max-width: 600px) {
  .brand-sub { display: none; }
  .wrap { padding: 0 16px; }

  .hero { padding: 24px 0 20px; }
  .hero-title { font-size: clamp(1.75rem, 7.5vw, 2.1rem); }
  .hero-desc  { font-size: 0.85rem; }
  .hero-text-block { margin-bottom: 14px; }
  .hero-eyebrow { font-size: 0.62rem; padding: 4px 12px; margin-bottom: 12px; }
  .search-note { font-size: 0.66rem; }
  .feature-pills { flex-wrap: wrap; justify-content: center; }
  .fpill { font-size: 0.65rem; padding: 4px 9px; }

  /* Mobile search field stacks */
  .search-field { flex-direction: column; align-items: stretch; border-radius: 18px; padding: 12px; gap: 10px; }
  .search-prefix { display: none; }
  .search-input { font-size: 0.9rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
  .device-group { width: 100%; justify-content: center; }
  .dev-pill { flex: 1; justify-content: center; padding: 7px 4px; font-size: 0.7rem; }
  .analyze-btn { width: 100%; justify-content: center; padding: 12px; border-radius: 12px; }

  .score-grid  { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .vitals-grid { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .stats-grid  { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .audit-grid  { grid-template-columns: 1fr; }
  .rec-grid    { grid-template-columns: 1fr; }
  .eco-metrics { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .passed-grid { grid-template-columns: 1fr; }
  .cmp-head    { grid-template-columns: 1.6fr 1fr 1fr; font-size: 0.62rem; padding: 8px 10px; }
  .cmp-row     { grid-template-columns: 1.6fr 1fr 1fr; padding: 8px 10px; }
  .cmp-metric  { font-size: 0.74rem; }

  .ring-wrap  { width: 60px; height: 60px; }
  .ring-label { font-size: 0.95rem; }
  .score-card { padding: 12px 8px; }
  .score-name { font-size: 0.6rem; }
  .vital-val  { font-size: 1.1rem; }
  .eco-metric-val { font-size: 1rem; }

  .issue-save { display: none; }
  .table-scroll table { min-width: 400px; }
  .data-tbl { font-size: 0.68rem; }
  .issue-tbl td:first-child { max-width: 140px; white-space: normal; word-break: break-word; }

  .rt-right { gap: 4px; }
  .rt-url   { font-size: 0.74rem; white-space: normal; word-break: break-all; max-width: 100%; flex: 1; }

  .dev-tabs { width: 100%; }
  .dtab { flex: 1; justify-content: center; padding: 8px 4px; font-size: 0.75rem; }

  .footer-inner { flex-direction: column; text-align: center; gap: 5px; }
  .footer-right { text-align: center; }

  .sec-check-row { flex-wrap: wrap; gap: 8px; }
  .pwa-check-row { flex-wrap: wrap; }
  .chain-meta { display: none; }
}

@media (max-width: 380px) {
  .score-grid { gap: 6px; }
  .score-card { padding: 10px 6px; }
  .ring-wrap  { width: 52px; height: 52px; }
  .ring-label { font-size: 0.82rem; }
  .issue-save { display: none; }
}


/* ── NON-COMPOSITED ANIMATIONS table ── */
.data-tbl td:first-child { min-width: 180px; }
.data-tbl td.td-r { width: 220px; }

/* ── TOPBAR BUTTONS — always one row ── */
.rt-right { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
.rt-right::-webkit-scrollbar { display: none; }
.rt-right .btn-ghost,
.rt-right .btn-accent { flex-shrink: 0; padding: 5px 10px; font-size: 0.74rem; }
.rt-right svg { flex-shrink: 0; }
@media (max-width: 480px) {
  .rt-label { display: none; }
  .rt-right .btn-ghost span,
  .rt-right .btn-accent span { display: none; }
  .rt-right .btn-ghost,
  .rt-right .btn-accent { padding: 6px 8px; }
}

.issue-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.025);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.issue-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.issue-trigger {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: #ffffff;
  user-select: none;
}

.issue-severity {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}

.issue-severity.high { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.issue-severity.medium { background: #ffedd5; color: #ea580c; border: 1px solid #fed7aa; }
.issue-severity.low { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }

.issue-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.4;
}

.issue-save {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.issue-save.save-time { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.issue-chevron svg {
  transition: transform 0.3s ease;
  color: #64748b;
  width: 18px;
  height: 18px;
}

.issue-card.open .issue-chevron svg {
  transform: rotate(180deg);
  color: #0f172a;
}

.issue-detail {
  display: none;
  padding: 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.6;
}

.issue-card.open .issue-detail {
  display: block;
  animation: slideDown 0.3s ease-out forwards;
}

.fix-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fix-tag {
  background: #eef2ff;
  color: #4f46e5;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid #c7d2fe;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.2s ease;
}

.fix-tag:hover {
  background: #e0e7ff;
}

.issue-tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.issue-tbl th {
  background: #f1f5f9;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

.issue-tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.issue-tbl tr:last-child td {
  border-bottom: none;
}

.issue-tbl tr:hover td {
  background: #f8fafc;
}

.elem-code {
  background: #f1f5f9;
  color: #db2777;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  border: 1px solid #e2e8f0;
  display: inline-block;
  word-break: break-all;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .issue-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .issue-trigger {
  background: #1e293b;
}

[data-theme="dark"] .issue-name {
  color: #f1f5f9;
}

[data-theme="dark"] .issue-detail {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .issue-tbl {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .issue-tbl th {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .issue-tbl td {
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .issue-tbl tr:hover td {
  background: #1c2636;
}

[data-theme="dark"] .elem-code {
  background: #0f172a;
  border-color: #334155;
  color: #f472b6;
}

[data-theme="dark"] .fix-tag {
  background: #312e81;
  color: #a5b4fc;
  border-color: #3730a3;
}


.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-top: 15px;
  background: #ffffff;
}

.standard-tbl {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* Allow columns to adjust properly */
  min-width: 650px;
}

.standard-tbl th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.standard-tbl td {
  padding: 14px 18px;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  line-height: 1.5;
}

/* Specific Alignment Classes */
.col-main {
  text-align: left !important;
  width: 45%; /* Give more room to URLs/Names */
  word-break: break-all;
  font-weight: 500;
}

.col-num {
  text-align: right !important;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.standard-tbl tr:hover td {
  background: #f8fafc;
}

.desc-link { color: var(--accent); text-decoration: underline; word-break: break-all; font-size: inherit; }
.desc-link:hover { opacity: 0.75; }

[data-theme="dark"] .table-scroll { border-color: #334155; background: #1e293b; }
[data-theme="dark"] .standard-tbl th { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .standard-tbl td { border-color: #334155; color: #e2e8f0; }


.issue-trigger, summary {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.issue-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  color: #64748b;
  transition: transform 0.3s ease;
  min-width: 24px;
}

.issue-card.open .issue-chevron,
details[open] .issue-chevron {
  transform: rotate(180deg);
  color: #0f172a;
}

.issue-chevron svg {
  flex-shrink: 0;
}

[data-theme="dark"] .issue-chevron {
  color: #94a3b8;
}

[data-theme="dark"] .issue-card.open .issue-chevron {
  color: #f1f5f9;
}

/* Ensure global scrolling is active */
html, body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  scroll-behavior: smooth;
}

/* Fix Header to top */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Back to Top Button Design */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: none; 
  align-items: center;
  justify-content: center;
  z-index: 3000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  opacity: 0.9;
}

#backToTop:hover {
  transform: translateY(-5px);
  opacity: 1;
}

#backToTop svg {
  width: 20px;
  height: 20px;
}

/* ── FOOTER LEGAL BAR ── */
.footer-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px clamp(16px, 4vw, 56px) 10px;
  margin-top: 0;
}

.footer-policy-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
}

.footer-policy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.footer-policy-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.footer-policy-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.footer-sep {
  color: var(--ink-3);
  font-size: 12px;
  opacity: 0.4;
  user-select: none;
}

.footer-auto-delete-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--font-body);
  opacity: 0.7;
  letter-spacing: 0.01em;
}

.footer-auto-delete-note svg {
  flex-shrink: 0;
  color: var(--good);
  opacity: 1;
}

/* ── POLICY MODAL OVERLAY ── */
.policy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s var(--ease-out);
}

.policy-overlay.hidden { display: none !important; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.policy-modal {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.25s var(--ease-out);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.policy-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.policy-modal-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.policy-modal-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 18px;
}

.policy-modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.policy-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  position: absolute;
  right: 28px;
  top: 24px;
}

.policy-modal-close:hover {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
}

.policy-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  font-family: var(--font-body);
}

.policy-modal-body h3 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.policy-modal-body h3:first-child { margin-top: 0; }

.policy-modal-body h3::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.policy-modal-body p {
  margin-bottom: 10px;
  color: var(--ink-2);
}

.policy-modal-body ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.policy-modal-body ul li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.policy-modal-body ul li::before {
  content: '→';
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.policy-warning-box {
  background: var(--bad-bg);
  border: 1px solid rgba(220,38,38,0.25);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--bad);
  font-weight: 500;
  line-height: 1.6;
}

.policy-warning-box svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.policy-info-box {
  background: var(--accent-dim);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.6;
}

.policy-info-box svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.policy-good-box {
  background: var(--good-bg);
  border: 1px solid rgba(22,163,74,0.2);
  border-left: 3px solid var(--good);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--good);
  font-weight: 500;
  line-height: 1.6;
}

.policy-good-box svg { flex-shrink: 0; margin-top: 1px; }

.policy-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.policy-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
}

.policy-modal-footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: var(--font-body);
}

@media (max-width: 600px) {
  .policy-modal { border-radius: var(--radius-lg); max-height: 90vh; }
  .policy-modal-header { padding: 18px 20px 14px; }
  .policy-modal-body { padding: 18px 20px; }
  .policy-modal-footer { padding: 8px 20px; }
  .footer-legal { padding: 12px 16px 16px; }
  .footer-policy-links { gap: 4px 2px; }
  .footer-policy-btn { font-size: 11px; padding: 3px 6px; }
}


html.is-restoring .hero {
  padding: 14px 0 !important;
  transition: none !important;
}
html.is-restoring .hero-text-block,
html.is-restoring .search-note,
html.is-restoring .feature-pills {
  display: none !important;
  opacity: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}
html.is-restoring .hero::before {
  opacity: 0 !important;
  transition: none !important;
}