/* NOVARA — mockup visual system */
:root {
  --bg: #07060d;
  --bg-2: #0d0a16;
  --panel: rgba(22, 16, 40, 0.72);
  --panel-strong: rgba(28, 20, 52, 0.9);
  --line: rgba(167, 139, 250, 0.16);
  --line-strong: rgba(167, 139, 250, 0.32);
  --text: #f5f3ff;
  --text-muted: #b7b0d0;
  --text-dim: #7d7698;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --accent-deep: #7c3aed;
  --link: #7dd3fc;
  --link-hover: #bae6fd;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --mark-bg: rgba(167, 139, 250, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --glow: 0 0 40px rgba(124, 58, 237, 0.28);
  --font-display: "Syne", "Avenir Next", sans-serif;
  --font-body: "Manrope", "Avenir Next", sans-serif;
  --max: 680px;
  --max-wide: 1080px;
  --header-h: 64px;
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 50% 18%, rgba(124, 58, 237, 0.22), transparent 58%),
    radial-gradient(700px 420px at 80% 0%, rgba(56, 189, 248, 0.08), transparent 50%),
    linear-gradient(180deg, #0b0814 0%, var(--bg) 45%, #05040a 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { color: var(--link-hover); }

input:focus, input:focus-visible,
button:focus, button:focus-visible,
select:focus, select:focus-visible,
textarea:focus, textarea:focus-visible,
a:focus, a:focus-visible {
  outline: none;
}
a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.45);
  border-radius: 10px;
}
input, button, select, textarea { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 40;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--text); text-decoration: none;
}
.wordmark:hover { color: var(--text); }
.mark { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-lang {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--text-muted); font-size: .88rem; font-weight: 600;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: .3rem .55rem .3rem .7rem; cursor: pointer;
}
.nav-lang select {
  border: 0; background: transparent; color: var(--text);
  font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer;
  padding: .15rem .1rem;
}
.nav-lang select option { background: #16102a; color: var(--text); }
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px; background: currentColor;
  position: relative;
}
.menu-toggle span::before, .menu-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

/* Hero */
.hero {
  min-height: calc(100vh - 160px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  position: relative;
}
.hero-orb {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  top: 42%; left: 50%;
  transform: translate(-50%, -58%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.18), transparent 58%),
    conic-gradient(from 210deg, transparent 0 60%, rgba(125, 211, 252, 0.12), transparent 75%, rgba(167, 139, 250, 0.2), transparent 100%);
  filter: blur(2px);
  pointer-events: none;
  animation: orb 12s ease-in-out infinite alternate;
}
.hero-brand { position: relative; z-index: 1; margin-bottom: 1.6rem; animation: rise .7s ease both; }
.hero-brand .wordmark-text { font-size: clamp(2.2rem, 7vw, 3.6rem); letter-spacing: .22em; }
.hero-brand .mark { width: 48px; height: 48px; border-radius: 14px; box-shadow: var(--glow); }
.tagline {
  margin: .9rem 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  letter-spacing: .02em;
  animation: rise .8s ease .05s both;
}

.search-shell {
  width: 100%; max-width: var(--max);
  position: relative; z-index: 2;
  animation: rise .85s ease .1s both;
}
.search-form { position: relative; }
.search-row {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(18, 12, 34, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .4rem .4rem .4rem 1rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-row:focus-within {
  border-color: rgba(167, 139, 250, .55);
  box-shadow: var(--shadow), var(--glow);
}
.search-icon { color: var(--text-dim); display: inline-flex; flex: 0 0 auto; }
.search-row input[type="search"] {
  flex: 1; min-width: 0; border: 0; outline: none; box-shadow: none;
  background: transparent; color: var(--text);
  font: inherit; font-size: 1.02rem; padding: .85rem .35rem;
  -webkit-appearance: none; appearance: none;
}
.search-row input[type="search"]::placeholder { color: var(--text-dim); }
.search-row input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.btn-go {
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(124, 58, 237, .45);
  transition: transform .15s ease, filter .15s ease;
  flex: 0 0 auto;
}
.btn-go:hover { filter: brightness(1.08); transform: scale(1.03); }
.btn-go:active { transform: scale(.97); }
.btn-go .loader {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-go .loader.on { display: inline-block; }
.btn-go .loader.on + .go-arrow { display: none; }

.controls {
  display: flex; flex-wrap: wrap; gap: .65rem;
  justify-content: center; margin-top: 1rem;
  animation: rise .9s ease .15s both;
}
.pill-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .55rem 1rem;
  font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: .15s ease;
}
.mode-toggle { display: inline-flex; gap: .55rem; }
.mode-toggle label { cursor: pointer; }
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mode-toggle span {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: .88rem; font-weight: 600;
}
.mode-toggle input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .35);
}
.lang-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: .35rem .55rem .35rem .85rem;
  color: var(--text-muted);
  font-size: .88rem; font-weight: 600;
}
.lang-pill select {
  border: 0; background: transparent; color: var(--text);
  font: inherit; font-weight: 600; padding: .2rem .3rem; cursor: pointer;
}
.lang-pill select option { background: #16102a; color: var(--text); }

/* Live suggestions */
.suggestions {
  position: absolute; left: 0; right: 0;
  top: calc(100% + .5rem);
  background: rgba(14, 10, 28, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  list-style: none; margin: 0; padding: .45rem;
  text-align: left; box-shadow: var(--shadow);
  z-index: 30; display: none;
  max-height: min(62vh, 440px); overflow: auto;
  backdrop-filter: blur(14px);
}
.suggestions.open { display: block; animation: fade .15s ease; }
.live-link {
  display: block; padding: .75rem .9rem; border-radius: 14px; color: inherit;
}
.live-link:hover, .live-link[aria-selected="true"] {
  background: rgba(139, 92, 246, .12); color: inherit; box-shadow: none;
}
.live-domain { display: block; color: var(--text-dim); font-size: .75rem; margin-bottom: .15rem; }
.live-title {
  display: block; color: var(--text);
  font-family: var(--font-display); font-size: .98rem; font-weight: 650; line-height: 1.3;
}
.live-title mark, .live-snippet mark, .result-snippet mark, .result-title mark {
  background: var(--mark-bg); color: var(--text); border-radius: 3px; padding: 0 .12em;
}
.live-snippet {
  display: block; margin-top: .25rem; color: var(--text-muted);
  font-size: .86rem; line-height: 1.4; max-height: 2.8em; overflow: hidden;
}
.live-empty { padding: .9rem 1rem; color: var(--text-muted); font-size: .9rem; }
.live-footer { padding: .25rem; border-top: 1px solid var(--line); margin-top: .25rem; }
.live-all {
  width: 100%; border: 0; background: transparent; color: var(--accent-bright);
  font: inherit; font-weight: 600; font-size: .88rem;
  padding: .7rem .85rem; border-radius: 12px; cursor: pointer; text-align: center;
}
.live-all:hover { background: rgba(139, 92, 246, .1); }

/* Feature strip */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 3rem auto 0;
  padding: 0 1rem;
  position: relative; z-index: 1;
  animation: rise 1s ease .2s both;
}
.feature {
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.feature-icon {
  width: 44px; height: 44px; margin: 0 auto .75rem;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(139, 92, 246, .12);
  border: 1px solid var(--line);
  color: var(--accent-bright);
}
.feature strong { display: block; color: var(--text); margin-bottom: .25rem; font-weight: 650; }

/* Footer */
.footer {
  max-width: 1200px; margin: 0 auto;
  padding: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  color: var(--text-dim); font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.05);
}
.footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer a { color: var(--text-muted); }

/* Results */
.results-page .site-header {
  max-width: none;
  border-bottom: 1px solid rgba(255,255,255,.05);
  background: rgba(7, 6, 13, .75);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.results-top {
  display: flex; align-items: center; gap: 1rem; width: 100%;
  max-width: 1100px; margin: 0 auto;
}
.results-top .search-shell { margin: 0; flex: 1; max-width: 720px; animation: none; }
.results-top .controls { justify-content: flex-start; margin-top: .65rem; }
.results-wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}
.result-tabs {
  display: flex; gap: .2rem; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin: .5rem 0 1.25rem;
  overflow-x: auto;
}
.result-tabs a, .result-tabs span {
  padding: .7rem .95rem;
  color: var(--text-muted);
  font-size: .9rem; font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.result-tabs .active {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}
.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.75rem;
  align-items: start;
}
.meta-bar {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  color: var(--text-dim); font-size: .88rem; margin-bottom: 1.1rem;
}
.locale-hint {
  color: var(--text-muted);
  opacity: .9;
}
.locale-hint::before {
  content: '·';
  margin-right: .75rem;
  color: var(--text-dim);
}
.result-list { display: flex; flex-direction: column; gap: 1.35rem; }
.result { animation: rise .4s ease both; }
.result-domain {
  display: flex; align-items: center; gap: .45rem;
  color: var(--text-dim); font-size: .8rem; margin-bottom: .2rem;
}
.favicon {
  width: 16px; height: 16px; border-radius: 4px;
  background: rgba(255,255,255,.08);
}
.result-title {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 650; line-height: 1.3;
  margin: 0 0 .2rem;
}
.result-title a { color: var(--link); }
.result-title a:hover { color: var(--link-hover); text-decoration: underline; }
.result-url { color: var(--ok); font-size: .84rem; word-break: break-all; }
.result-snippet { color: var(--text-muted); margin: .35rem 0 0; font-size: .94rem; }
.result-date { margin-top: .3rem; color: var(--text-dim); font-size: .78rem; }

.ai-panel {
  position: sticky; top: 88px;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(124, 58, 237, .16), rgba(14, 10, 28, .9));
  box-shadow: var(--shadow);
}
.ai-panel h2 {
  margin: 0 0 .75rem;
  font-family: var(--font-display);
  font-size: .92rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  display: flex; align-items: center; gap: .45rem;
}
.ai-answer { white-space: pre-wrap; color: var(--text); margin: 0; font-size: .92rem; }
.ai-citations { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: .45rem; }
.ai-citations li {
  font-size: .82rem; color: var(--text-muted);
  padding: .55rem .65rem; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.state { padding: 2rem 0; color: var(--text-muted); text-align: center; }
.state.error { color: var(--danger); }

.pagination { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.35rem; height: 2.35rem; padding: 0 .65rem;
  border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-muted); font-size: .88rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent-bright); }
.pagination .current {
  background: var(--accent-deep); border-color: transparent; color: #fff;
}

/* Prose pages */
.prose {
  max-width: 680px; margin: 0 auto; padding: 2rem 1.25rem 4rem;
}
.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1rem; letter-spacing: .04em;
}
.prose h2 {
  font-family: var(--font-display); font-size: 1.15rem;
  margin: 2rem 0 .75rem; letter-spacing: .04em;
}
.prose p, .prose li { color: var(--text-muted); }
.contact-form { display: grid; gap: .9rem; margin-top: 1.5rem; }
.contact-form label { display: grid; gap: .35rem; color: var(--text-muted); font-size: .9rem; }
.contact-form input, .contact-form textarea,
.admin-form input, .admin-form textarea, .login-form input {
  width: 100%; background: rgba(18, 12, 34, .9);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; padding: .75rem .9rem;
}
.contact-form input:focus, .contact-form textarea:focus,
.admin-form input:focus, .login-form input:focus {
  border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}
.btn {
  appearance: none; border: 0; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-deep));
  color: #fff; padding: .8rem 1.25rem;
  box-shadow: 0 10px 28px rgba(124, 58, 237, .35);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--line); padding: .55rem .95rem;
}
.btn-danger {
  background: rgba(251, 113, 133, .12); color: var(--danger);
  border: 1px solid rgba(251, 113, 133, .3);
  padding: .45rem .8rem; border-radius: var(--radius-sm);
}
.flash { padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.flash.ok { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3); color: var(--ok); }
.flash.err { background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .3); color: var(--danger); }

/* Admin sidebar layout */
.admin-body { background: #07060d; }
.admin-app { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: rgba(12, 8, 24, .96);
  border-right: 1px solid rgba(255,255,255,.05);
  padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1rem;
}
.admin-nav { display: flex; flex-direction: column; gap: .25rem; margin-top: .5rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text-muted); padding: .7rem .8rem;
  border-radius: 12px; font-size: .92rem; font-weight: 600;
}
.admin-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.admin-nav a.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, .28), rgba(124, 58, 237, .18));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25);
}
.admin-main { flex: 1; padding: 1.4rem 1.5rem 2.5rem; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.admin-topbar h1 {
  margin: 0; font-family: var(--font-display);
  font-size: 1.5rem; letter-spacing: .04em;
}
.admin-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}
.stat {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  position: relative; overflow: hidden;
}
.stat span { color: var(--text-dim); font-size: .82rem; font-weight: 600; }
.stat strong {
  display: block; font-family: var(--font-display);
  font-size: 1.7rem; margin-top: .25rem;
}
.stat-spark {
  position: absolute; right: .8rem; bottom: .6rem;
  opacity: .55; color: var(--accent-bright);
}
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1.15rem;
  background: rgba(255,255,255,.025);
}
.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.admin-form label { display: grid; gap: .3rem; font-size: .85rem; color: var(--text-muted); }
.admin-form input { min-width: 220px; width: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td {
  text-align: left; padding: .7rem .45rem;
  border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top;
}
.table th { color: var(--text-dim); font-weight: 600; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
}
.badge-ok { background: rgba(52, 211, 153, .12); color: var(--ok); }
.badge-fail { background: rgba(251, 113, 133, .12); color: var(--danger); }
.badge-queue { background: rgba(251, 191, 36, .12); color: var(--warn); }
.login-box {
  max-width: 400px; margin: 12vh auto; padding: 2rem;
  border: 1px solid var(--line-strong); border-radius: 20px;
  background: rgba(14, 10, 28, .95); box-shadow: var(--shadow), var(--glow);
}
.login-form { display: grid; gap: .9rem; }
.login-form label { display: grid; gap: .35rem; color: var(--text-muted); font-size: .9rem; }
.diag-list {
  columns: 2; gap: 1rem; margin: 0; padding: 0;
  list-style: none; color: var(--text-muted); font-size: .9rem;
}

@media (max-width: 960px) {
  .results-layout { grid-template-columns: 1fr; }
  .ai-panel { position: static; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-strip { grid-template-columns: 1fr; gap: 1.1rem; max-width: 420px; }
}
@media (max-width: 820px) {
  .admin-app { flex-direction: column; }
  .admin-sidebar {
    width: 100%; height: auto; position: relative;
    border-right: 0; border-bottom: 1px solid rgba(255,255,255,.05);
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; right: 1rem; left: 1rem;
    flex-direction: column; align-items: stretch;
    background: rgba(14, 10, 28, .98);
    border: 1px solid var(--line-strong);
    border-radius: 16px; padding: .6rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-lang { padding: .75rem .85rem; border-radius: 10px; }
  .results-top { flex-direction: column; align-items: stretch; }
  .search-row { border-radius: 22px; }
  .hero { min-height: calc(100vh - 120px); justify-content: flex-start; padding-top: 10vh; }
  .diag-list { columns: 1; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* Privacy / security UI */
.private-toggle span {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
}
.private-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.private-toggle input:checked + span {
  background: linear-gradient(135deg, #312e81, var(--accent-deep));
  border-color: transparent; color: #fff;
}
.search-form.is-private .search-row {
  border-color: rgba(167, 139, 250, .55);
  box-shadow: var(--shadow), 0 0 0 1px rgba(124, 58, 237, .25);
}
.private-notice, .private-banner {
  margin: .85rem auto 0; max-width: var(--max);
  color: var(--text-muted); font-size: .82rem; line-height: 1.45;
  background: rgba(124, 58, 237, .12); border: 1px solid var(--line);
  border-radius: 14px; padding: .7rem .9rem; text-align: left;
}
.private-banner { max-width: var(--max-wide); margin: 0 auto .8rem; }
.btn-voice {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-dim); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-voice.listening { color: var(--danger); animation: pulse 1s infinite; }
.pill-danger {
  background: rgba(251, 113, 133, .15) !important;
  border-color: rgba(251, 113, 133, .4) !important;
  color: #fecdd3 !important;
}
.badge {
  display: inline-flex; align-items: center; margin-left: .4rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: .12rem .4rem; border-radius: 999px; text-transform: uppercase;
}
.badge.ok { background: rgba(52, 211, 153, .15); color: var(--ok); }
.badge.warn { background: rgba(251, 191, 36, .15); color: var(--warn); }
.badge.danger { background: rgba(251, 113, 133, .18); color: var(--danger); }
.result-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .45rem; }
.linkish {
  border: 0; background: none; color: var(--accent-bright);
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: 0;
}
.linkish:hover { color: var(--link-hover); }
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  max-width: var(--max-wide); margin: 0 auto .75rem; color: var(--text-muted); font-size: .85rem;
}
.filter-bar select {
  margin-left: .35rem; background: rgba(255,255,255,.04); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: .25rem .45rem; font: inherit;
}
.filter-note { color: var(--text-dim); font-size: .78rem; }
.image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.image-card {
  margin: 0; background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.image-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: #120c22; }
.image-card figcaption { padding: .65rem .75rem; font-size: .82rem; }
.image-card figcaption span { display: block; color: var(--text-dim); font-size: .72rem; margin-top: .2rem; }
.is-blurred .result-snippet, .is-blurred img { filter: blur(8px); }
.about-panel {
  position: fixed; right: 1rem; bottom: 1rem; width: min(380px, calc(100vw - 2rem));
  max-height: 70vh; overflow: auto; z-index: 80;
  background: rgba(14, 10, 28, .98); border: 1px solid var(--line-strong);
  border-radius: 18px; padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.about-close {
  position: absolute; top: .5rem; right: .6rem; border: 0; background: transparent;
  color: var(--text-muted); font-size: 1.4rem; cursor: pointer;
}
.about-dl { display: grid; grid-template-columns: 100px 1fr; gap: .35rem .6rem; font-size: .86rem; }
.about-dl dt { color: var(--text-dim); }
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  z-index: 100; background: rgba(28, 20, 52, .96); border: 1px solid var(--line-strong);
  color: var(--text); padding: .75rem 1.1rem; border-radius: 14px; max-width: min(520px, 92vw);
  box-shadow: var(--shadow); font-size: .9rem;
}
.toast.error { border-color: rgba(251, 113, 133, .45); color: #fecdd3; }
.clear-dialog {
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 0;
  background: #120c22; color: var(--text); max-width: min(440px, 92vw);
}
.clear-dialog::backdrop { background: rgba(0,0,0,.55); }
.clear-dialog-inner { padding: 1.15rem 1.25rem; }
.clear-dialog-inner ul { padding-left: 1.1rem; color: var(--text-muted); font-size: .88rem; }
.clear-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.privacy-settings .prefs-form, .privacy-settings form { display: grid; gap: .75rem; max-width: 520px; }
.privacy-settings .check { display: flex; gap: .55rem; align-items: flex-start; }
.privacy-settings label { display: grid; gap: .35rem; color: var(--text-muted); font-size: .92rem; }
.privacy-settings input[type="text"],
.privacy-settings input[type="url"],
.privacy-settings input[type="email"],
.privacy-settings textarea,
.privacy-settings select {
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: .55rem .7rem; font: inherit;
}
.history-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.history-list li {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.history-list .inline { display: inline; margin: 0; }
.muted { color: var(--text-dim); font-size: .85rem; }
.state.ok { color: var(--ok); }
.inline-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@keyframes orb {
  from { transform: translate(-50%, -58%) scale(1); opacity: .85; }
  to { transform: translate(-50%, -60%) scale(1.06); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
