
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;scroll-behavior:smooth}

:root{
  --bg:         #0e0b12;
  --bg-2:       #130f1a;
  --bg-card:    #1a1525;
  --bg-hover:   #201929;
  --border:     rgba(255,255,255,0.08);
  --border-mid: rgba(255,255,255,0.12);
  --text:       #f0edf5;
  --text-muted: #9990aa;
  --text-faint: #5a5268;
  --accent:     #4fbfc9;
  --accent-2:   #7c5cbf;
  --accent-glow: rgba(79,191,201,0.15);

  --critical:#e53e3e;--high:#dd6b20;--medium:#d69e2e;--low:#38a169;--unknown:#6b7280;

  --chip-bg:#1e1829;
  --chip-bg-active:rgba(79,191,201,0.12);
  --chip-text-active:#4fbfc9;

  --r-sm:6px;--r-md:8px;--r-lg:12px;--r-xl:16px;--r-full:9999px;
  --font-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-mono:"SF Mono","Cascadia Code",Consolas,monospace;
  --topbar-h:52px;
}

body{
  font-family:var(--font-sans);
  font-size:14px;
  line-height:1.5;
  color:var(--text);
  background:var(--bg);
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,0.1) transparent;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}

/* ── MESH BACKGROUND ── */
.bg-mesh{
  position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(124,92,191,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(79,191,201,0.07) 0%, transparent 60%),
    var(--bg);
}

/* ── TOPBAR ── */
.topbar{
  position:fixed;top:0;left:0;right:0;
  height:var(--topbar-h);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 24px;
  border-bottom:1px solid var(--border);
  background:rgba(14,11,18,0.85);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  z-index:100;
}
.topbar-brand{
  display:flex;align-items:center;gap:10px;
  font-weight:600;font-size:15px;letter-spacing:-0.02em;
}
.brand-dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 8px var(--accent);
  flex-shrink:0;
}
.brand-label{
  font-size:11px;font-weight:500;letter-spacing:0.08em;
  text-transform:uppercase;color:var(--accent);
  padding:2px 10px;border:1px solid rgba(79,191,201,0.3);
  border-radius:var(--r-full);
  background:rgba(79,191,201,0.08);
}
.status{
  display:flex;align-items:center;gap:6px;
  font-size:12px;color:var(--text-muted);
  font-family:var(--font-mono);
}
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--text-faint);flex-shrink:0;transition:background 300ms}
.status-dot.ok{background:#3fb950;box-shadow:0 0 6px rgba(63,185,80,0.5)}
.status-dot.err{background:var(--critical)}

/* ── PAGE BODY ── */
.page-body{
  position:relative;z-index:1;
  margin-top:var(--topbar-h);
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:calc(100dvh - var(--topbar-h));
}
.page-scroll{
  flex:1;
  display:flex;
  flex-direction:column;
}

/* ── HERO ── */
.hero{
  padding:4.5rem 2rem 2.5rem;
  max-width:840px;
  margin:0 auto;
  width:100%;
  text-align:left;
  transition:padding 250ms ease;
}
.hero-eyebrow{
  display:inline-flex;align-items:center;gap:6px;
  font-size:11px;font-weight:600;letter-spacing:0.1em;
  text-transform:uppercase;color:var(--accent);
  padding:4px 12px;border:1px solid rgba(79,191,201,0.25);
  border-radius:var(--r-full);
  background:rgba(79,191,201,0.07);
  margin-bottom:1.75rem;
  transition:opacity 250ms ease, height 250ms ease, margin 250ms ease;
}
.hero-eyebrow-dot{
  width:5px;height:5px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 5px var(--accent);
}
.hero-title{
  font-size:clamp(2.25rem,5vw,3.75rem);
  font-weight:700;
  letter-spacing:-0.04em;
  line-height:1.1;
  color:var(--text);
  margin-bottom:1.25rem;
  max-width:18ch;
  transition:font-size 250ms ease, margin 250ms ease;
}
.hero-tagline{
  font-size:1rem;
  color:var(--text-muted);
  max-width:56ch;
  line-height:1.75;
  margin-bottom:0.75rem;
  transition:opacity 250ms ease, height 250ms ease, margin 250ms ease;
}
.hero-sub{
  font-size:0.8125rem;
  color:var(--text-faint);
  transition:opacity 250ms ease, height 250ms ease;
}
.hero-sub a{color:var(--text-muted)}
.hero-sub a:hover{color:var(--accent)}

.hero--compact{padding:1.25rem 2rem 1rem}
.hero--compact .hero-tagline,
.hero--compact .hero-sub,
.hero--compact .hero-eyebrow{
  opacity:0;height:0;overflow:hidden;margin:0;padding:0;border:none
}
.hero--compact .hero-title{
  font-size:clamp(1.25rem,2vw,1.5rem);
  margin-bottom:0;
}

/* ── SEARCH PANEL ── */
.search-panel{
  max-width:840px;
  margin:0 auto;
  padding:0 2rem 1.25rem;
  width:100%;
}
.search-row{
  display:flex;gap:10px;margin-bottom:14px;
}
.search-wrap{
  flex:1;position:relative;display:flex;
}
.search-input{
  width:100%;height:48px;
  padding:0 44px 0 18px;
  background:var(--bg-card);
  border:1px solid var(--border-mid);
  border-radius:var(--r-lg);
  color:var(--text);font-size:15px;
  font-family:var(--font-sans);
  outline:none;
  transition:border-color 150ms,box-shadow 150ms;
}
.search-input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-glow);
}
.search-input::placeholder{color:var(--text-faint)}
.search-clear{
  position:absolute;right:12px;top:50%;transform:translateY(-50%);
  width:24px;height:24px;
  display:none;align-items:center;justify-content:center;
  border:none;background:none;color:var(--text-muted);
  cursor:pointer;border-radius:50%;font-size:17px;line-height:1;padding:0;
}
.search-clear:hover{color:var(--text);background:var(--bg-hover)}
.search-clear.show{display:flex}
.search-btn{
  height:48px;padding:0 24px;
  border:none;
  border-radius:var(--r-lg);
  background:var(--accent);
  color:#0e0b12;
  font-size:14px;font-weight:700;
  font-family:var(--font-sans);
  cursor:pointer;white-space:nowrap;
  transition:opacity 120ms,box-shadow 120ms;
  display:flex;align-items:center;gap:6px;
  flex-shrink:0;
  letter-spacing:0.01em;
}
.search-btn:disabled{opacity:0.35;cursor:not-allowed}
.search-btn:hover:not(:disabled){
  opacity:0.9;
  box-shadow:0 0 16px var(--accent-glow);
}
.spinner-sm{
  width:14px;height:14px;
  border:2px solid rgba(14,11,18,0.3);
  border-top-color:#0e0b12;
  border-radius:50%;
  animation:spin 0.7s linear infinite;
  display:inline-block;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── CONTROLS ROW ── */
.controls-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
}
.filter-row{
  display:flex;align-items:center;
  gap:10px;flex-wrap:wrap;
  flex:1;
}
.filter-group{display:flex;align-items:center;gap:5px}
.filter-label{
  font-size:10px;font-weight:700;
  color:var(--text-faint);
  text-transform:uppercase;
  letter-spacing:0.08em;
  margin-right:3px;
  white-space:nowrap;
}
.chip{
  display:inline-flex;align-items:center;gap:4px;
  padding:5px 11px;
  border-radius:var(--r-full);
  font-size:12px;
  cursor:pointer;
  background:var(--chip-bg);
  color:var(--text-muted);
  border:1px solid var(--border);
  transition:background 120ms,border-color 120ms,color 120ms;
  -webkit-user-select:none;user-select:none;
  white-space:nowrap;
}
.chip:hover{background:var(--bg-hover);border-color:rgba(255,255,255,0.15)}
.chip input{display:none}
.chip:has(input:checked){
  background:var(--chip-bg-active);
  border-color:var(--chip-text-active);
  color:var(--chip-text-active);
}
.chip.chip--sev:has(input:checked){border-color:currentColor}
.filter-divider{width:1px;height:18px;background:var(--border);flex-shrink:0}
.sev-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}

/* ── TURNSTILE ── */
.turnstile-wrap{
  display:flex;flex-direction:column;
  align-items:flex-end;
  gap:6px;
  flex-shrink:0;
  padding-top:2px;
}
.turnstile-hint{
  font-size:10px;color:var(--text-faint);
  font-family:var(--font-mono);
  text-align:right;
}

/* ── RESULTS ── */
.results{
  flex:1;
  padding:0 2rem 80px;
}
.results-inner{
  max-width:840px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.results-header{
  display:flex;align-items:center;
  justify-content:space-between;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}
.results-count{
  font-size:11px;color:var(--text-faint);
  font-family:var(--font-mono);
}

/* ── EMPTY / WELCOME ── */
.results-empty{
  display:flex;flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:10px;
  padding:56px 0;
  color:var(--text-muted);
}
.results-empty h2{
  font-size:16px;font-weight:600;
  color:var(--text-muted);
  letter-spacing:-0.01em;
}
.results-empty p{
  font-size:13px;max-width:50ch;
  line-height:1.7;
  color:var(--text-faint);
}

/* ── CARD (legacy styles removed; use .prompt-result-card) ── */

/* ── SEARCH ANALYTICS STRIP (removed) ── */

/* ── NEW CARD STYLES ── */
.prompt-result-card{
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  background:var(--bg-card);
  padding:14px 16px 12px;
  transition:border-color 150ms,box-shadow 150ms;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.prompt-result-card:hover{
  border-color:rgba(255,255,255,0.14);
  box-shadow:0 4px 20px rgba(0,0,0,0.3);
}
.prc-header{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.prc-id-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.prc-id{
  font-family:var(--font-mono);
  font-size:13px;
  font-weight:700;
  color:var(--text);
  text-decoration:none;
  letter-spacing:0.02em;
}
.prc-id:hover{color:var(--accent);text-decoration:none}
.prc-sev-badge{
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.07em;
  padding:2px 8px;
  border-radius:var(--r-full);
  border:1px solid;
  flex-shrink:0;
}
.prc-score-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.prc-score-bar{
  flex:1;
  height:3px;
  background:rgba(255,255,255,0.07);
  border-radius:2px;
  overflow:hidden;
}
.prc-score-fill{
  height:100%;
  border-radius:2px;
  transition:width 300ms ease;
  opacity:0.7;
}
.prc-score-val{
  font-family:var(--font-mono);
  font-size:11px;
  color:var(--text-muted);
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
  min-width:44px;
  text-align:right;
}
.prc-desc{
  font-size:13px;
  color:var(--text-muted);
  line-height:1.65;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
  max-width:100%;
}
.prompt-result-card.expanded .prc-desc{
  -webkit-line-clamp:unset;
  overflow:visible;
}
.prc-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.prc-nvd-btn{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border:1px solid var(--border-mid);
  border-radius:var(--r-sm);
  font-size:11px;
  font-weight:600;
  color:var(--accent);
  text-decoration:none;
  background:rgba(79,191,201,0.06);
  transition:background 100ms,border-color 100ms;
  white-space:nowrap;
}
.prc-nvd-btn:hover{
  background:rgba(79,191,201,0.13);
  border-color:var(--accent);
  text-decoration:none;
}
.prc-expand-btn{
  padding:4px 10px;
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  background:none;
  font-size:11px;
  color:var(--text-muted);
  cursor:pointer;
  font-family:var(--font-sans);
  transition:background 100ms,color 100ms,border-color 100ms;
}
.prc-expand-btn:hover{background:var(--bg-hover);color:var(--text);border-color:rgba(255,255,255,0.15)}
.prompt-result-card.expanded .prc-expand-btn{color:var(--accent);border-color:rgba(79,191,201,0.3)}
.prc-copy-btn{
  padding:4px 10px;
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  background:none;
  font-size:11px;
  color:var(--text-muted);
  cursor:pointer;
  font-family:var(--font-sans);
  transition:background 100ms,color 100ms;
  margin-left:auto;
}
.prc-copy-btn:hover{background:var(--bg-hover);color:var(--text)}

/* ── mark highlights ── */
mark.prompt-highlight{background:rgba(79,191,201,0.2);color:var(--accent);border-radius:2px}

/* ── MODAL ── */
.modal-overlay{
  position:fixed;inset:0;z-index:200;
  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;
  padding:1.5rem;
}
.modal-overlay.hidden{display:none}
.modal-box{
  background:var(--bg-card);
  border:1px solid var(--border-mid);
  border-radius:var(--r-xl);
  max-width:680px;width:100%;
  max-height:80dvh;overflow-y:auto;
  padding:1.75rem;
  box-shadow:0 24px 64px rgba(0,0,0,0.6);
}
.prompt-modal-title{font-size:15px;font-weight:700;margin-bottom:10px;font-family:var(--font-mono)}
.prompt-modal-meta{font-size:11px;color:var(--text-faint);margin-bottom:14px;display:flex;gap:12px;font-family:var(--font-mono)}
.prompt-modal-content{font-size:13px;color:var(--text-muted);line-height:1.7}
.modal-close{
  float:right;
  background:none;border:none;
  color:var(--text-muted);
  cursor:pointer;font-size:18px;line-height:1;
  padding:2px 6px;
  border-radius:var(--r-sm);
  transition:color 100ms,background 100ms;
}
.modal-close:hover{color:var(--text);background:var(--bg-hover)}

/* ── LOADING / ERROR SCREENS ── */
.loading-screen,.error-screen,.welcome-screen{
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  gap:14px;min-height:200px;
  text-align:center;color:var(--text-muted);
  padding:4rem 1rem;
}
.loading-screen p,.error-screen p,.welcome-screen p{
  font-size:13px;max-width:45ch;color:var(--text-faint);
}
.loading-screen h2,.error-screen h2,.welcome-screen h2{
  font-size:15px;font-weight:600;color:var(--text-muted);
}
.loader{
  width:28px;height:28px;
  border:2px solid rgba(255,255,255,0.06);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 0.8s linear infinite;
}

/* ── FOOTER ── */
.site-footer{
  position:fixed;bottom:0;left:0;right:0;
  padding:9px 16px;
  border-top:1px solid var(--border);
  background:rgba(14,11,18,0.9);
  backdrop-filter:blur(16px);
  font-size:11px;color:var(--text-faint);
  text-align:center;z-index:100;
}
.site-footer p{max-width:840px;margin:0 auto}
.site-footer a{color:var(--text-faint)}
.site-footer a:hover{color:var(--accent)}

/* ── MISC ── */
.hidden{display:none!important}
#search-mode-label{font-size:11px;color:var(--text-faint);font-family:var(--font-mono)}

/* ── DEV BYPASS NOTICE ── */
.dev-notice{
  display:inline-flex;align-items:center;gap:6px;
  padding:3px 10px;
  border:1px solid rgba(253,171,67,0.3);
  border-radius:var(--r-full);
  font-size:10px;font-weight:600;letter-spacing:0.06em;
  text-transform:uppercase;
  color:#fdab43;
  background:rgba(253,171,67,0.08);
  font-family:var(--font-mono);
  margin-bottom:10px;
}

/* ── RECENT SEARCHES ── */
.recent-search-chip{
  display:inline-flex;align-items:center;
  padding:4px 12px;
  border:1px solid var(--border);
  border-radius:var(--r-full);
  font-size:12px;color:var(--text-muted);
  background:none;cursor:pointer;
  transition:border-color 100ms,color 100ms;
  font-family:var(--font-sans);
  white-space:nowrap;
}
.recent-search-chip:hover{border-color:var(--accent);color:var(--accent)}

/* ── ISSUE #92 POLISH ── */
.turnstile-wrap{
  transition:opacity 0.4s ease,max-height 0.4s ease,margin 0.4s ease;
  max-height:200px;
}
.turnstile-wrap.verified{
  opacity:0;pointer-events:none;max-height:0;margin:0;overflow:hidden
}
.page-scroll{padding-bottom:70px}

/* ── MODE SELECTOR HIGHLIGHT ── */
.filter-group--mode{
  background:rgba(79,191,201,0.08);
  border:1px solid rgba(79,191,201,0.25);
  border-radius:var(--r-lg);
  padding:4px 8px;
  box-shadow:0 0 16px rgba(79,191,201,0.06);
}
.filter-group--mode .filter-label{
  color:var(--accent);
  font-weight:800;
  letter-spacing:0.1em;
}
.filter-group--mode .chip:has(input:checked){
  background:var(--accent);
  color:#0e0b12;
  border-color:var(--accent);
  font-weight:700;
  box-shadow:0 0 12px var(--accent-glow);
}
.filter-group--mode .chip:hover:not(:has(input:checked)){
  border-color:var(--accent);
  color:var(--accent);
}
