/* Bauslo — refined, native-macOS-leaning UI. Light + dark. No decorative emoji. */
:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --track: #e8eaee;
  --ink: #14161a;
  --ink-2: #565d6b;
  --ink-3: #8b909c;
  --line: #e5e7ec;
  --line-2: #eef0f3;
  --accent: #007aff;              /* Apple system blue */
  --accent-ink: #ffffff;
  --accent-soft: #e7f0ff;
  --crit: #e5484d;
  --high: #f97316;
  --med: #e6a70b;
  --low: #2f9bd6;
  --info: #868c98;
  --pass: #16a06a;
  --crit-bg: #fdebec; --high-bg: #fff1e6; --med-bg: #fdf4d4; --low-bg: #e8f4fb; --pass-bg: #e6f6ef; --info-bg: #eef0f3;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20,24,33,.06);
  --shadow: 0 1px 2px rgba(20,24,33,.04), 0 6px 20px rgba(20,24,33,.06);
  --shadow-pop: 0 10px 34px rgba(20,24,33,.16);
  --toolbar: rgba(255,255,255,.72);
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
/* Dark tokens. Shared by system-dark (unless the user forced Light) and by an explicit
   Dark choice in Settings (data-theme="dark"). Keep the two selector blocks in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417; --panel: #1d1f23; --panel-2: #191b1e; --track: #2a2d33;
    --ink: #edeef1; --ink-2: #a6acb7; --ink-3: #737884;
    --line: #2e3137; --line-2: #26282c;
    --accent: #0a84ff; --accent-soft: #16304e;
    --crit: #ff6b6f; --high: #ff8a4d; --med: #f5c542; --low: #57b6ef; --info: #8b909c; --pass: #35c88a;
    --crit-bg: #2c1a1c; --high-bg: #2c2018; --med-bg: #2a2515; --low-bg: #16242f; --pass-bg: #12251c; --info-bg: #232629;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4);
    --shadow-pop: 0 14px 42px rgba(0,0,0,.6);
    --toolbar: rgba(24,26,29,.72);
  }
}
:root[data-theme="dark"] {
  --bg: #131417; --panel: #1d1f23; --panel-2: #191b1e; --track: #2a2d33;
  --ink: #edeef1; --ink-2: #a6acb7; --ink-3: #737884;
  --line: #2e3137; --line-2: #26282c;
  --accent: #0a84ff; --accent-soft: #16304e;
  --crit: #ff6b6f; --high: #ff8a4d; --med: #f5c542; --low: #57b6ef; --info: #8b909c; --pass: #35c88a;
  --crit-bg: #2c1a1c; --high-bg: #2c2018; --med-bg: #2a2515; --low-bg: #16242f; --pass-bg: #12251c; --info-bg: #232629;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4);
  --shadow-pop: 0 14px 42px rgba(0,0,0,.6);
  --toolbar: rgba(24,26,29,.72);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; letter-spacing: -.006em; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; }
h1, h2, h3, h4 { letter-spacing: -.02em; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

/* Top bar — translucent macOS-style toolbar */
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 56px; flex-shrink: 0;
  background: var(--toolbar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(150deg, #3b95ff, #0060df); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), var(--shadow-sm); }
.logo svg { width: 16px; height: 16px; }
.brand-name { font-weight: 640; letter-spacing: -.02em; font-size: 15px; }
.brand-tag { color: var(--ink-3); font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
@media (max-width: 720px) { .brand-tag { display: none; } }

.urlbar { display: flex; flex: 1; gap: 8px; max-width: 780px; }
.url-field { position: relative; flex: 1; display: flex; align-items: center; }
.url-ico { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.urlbar input { flex: 1; width: 100%; padding: 8px 13px 8px 33px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink); font-size: 13px; font-family: var(--mono); transition: border-color .12s, box-shadow .12s; }
.urlbar input::placeholder { color: var(--ink-3); }
.urlbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn, #scan-btn, .install-btn { font-family: var(--sans); }
#scan-btn { padding: 8px 20px; border: 0; border-radius: 9px; background-color: var(--accent); color: var(--accent-ink);
  background-image: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 48%, rgba(0,0,0,.10));
  font-weight: 590; font-size: 13.5px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), var(--shadow-sm); transition: filter .12s, transform .06s; }
#scan-btn:hover { filter: brightness(1.06); }
#scan-btn:active { transform: translateY(.5px); }
#scan-btn:disabled { opacity: .5; cursor: default; }

/* Tabs — soft segmented pills */
.tabs { display: flex; gap: 3px; padding: 7px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 56px; z-index: 15; overflow-x: auto; }
.tab { border: 0; background: none; padding: 6px 13px; color: var(--ink-2); font-size: 13px; font-weight: 550;
  cursor: pointer; border-radius: 8px; white-space: nowrap; transition: background .12s, color .12s; }
.tab:hover { background: var(--line-2); color: var(--ink); }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }

main { flex: 1; overflow: auto; }
.pane { max-width: 1080px; margin: 0 auto; padding: 26px 22px 64px; }
.pane > h2:first-child { margin-top: 0; }
[hidden] { display: none !important; }

/* Home mode (search-engine landing) — the top search + tabs hide; the hero takes over */
.top-links { display: flex; margin-left: auto; gap: 2px; }
.top-link { border: 0; background: none; color: var(--ink-2); font-size: 13px; font-weight: 550;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: background .12s, color .12s; }
.top-link:hover { background: var(--line-2); color: var(--ink); }
body.home .top-links { display: flex; }
body.home .urlbar { display: none; }
body.home .tabs { display: none; }

/* On home, the top bar dissolves into the page and the centred hero is the whole show. */
body.home .topbar { background: transparent; border-bottom-color: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
body.home .brand { display: none; }

.welcome { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px 22px 18vh; }
.home-inner { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; text-align: center; }

.home-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
/* A white "glass bubble" orb holding the favicon magnifying glass. */
.home-mark { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 24%, rgba(255,255,255,.98), rgba(255,255,255,.62) 46%, rgba(228,236,247,.42) 100%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(30,50,90,.16), 0 2px 6px rgba(30,50,90,.10),
    inset 0 2px 5px rgba(255,255,255,.95), inset 0 -9px 18px rgba(120,150,195,.20);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.home-mark-img { width: 62%; height: 62%; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(20,40,80,.20)); }
/* On dark, the white bubble reads as a bright glass orb — give it a faint cool glow. */
:root[data-theme="dark"] .home-mark { box-shadow: 0 12px 34px rgba(0,0,0,.5),
  0 0 0 1px rgba(255,255,255,.06), inset 0 2px 5px rgba(255,255,255,.95),
  inset 0 -9px 18px rgba(90,120,170,.28); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-mark {
  box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06),
    inset 0 2px 5px rgba(255,255,255,.95), inset 0 -9px 18px rgba(90,120,170,.28); } }
.home-word { font-size: 44px; font-weight: 680; letter-spacing: -.035em; color: var(--ink); }

.home-search { display: flex; align-items: center; width: min(600px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 14px 22px;
  transition: box-shadow .16s, border-color .16s; }
.home-search:hover { box-shadow: var(--shadow); border-color: transparent; }
.home-search:focus-within { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); border-color: var(--accent); }
.home-search .url-ico { position: static; width: 19px; height: 19px; margin-right: 13px; color: var(--ink-3); flex-shrink: 0; }
.home-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink);
  font-family: var(--sans); font-size: 16px; }
.home-search input::placeholder { color: var(--ink-3); }

.home-buttons { display: flex; gap: 12px; margin-top: 30px; }
.home-btn { border: 1px solid transparent; background: var(--panel-2); color: var(--ink);
  font-size: 13.5px; font-weight: 550; padding: 10px 20px; border-radius: 9px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .12s, background .12s, transform .06s; }
.home-btn:hover { border-color: var(--line); background: var(--panel); }
.home-btn:active { transform: translateY(.5px); }

.home-caps { margin-top: 48px; color: var(--ink-3); font-size: 12px; font-family: var(--mono);
  letter-spacing: .01em; line-height: 1.7; max-width: 520px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 13px;
  border-radius: 999px; cursor: pointer; font-size: 12.5px; font-family: var(--mono); box-shadow: var(--shadow-sm); transition: border-color .12s, color .12s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.fineprint { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; }

/* Recently-scanned strip on the home landing — click a chip to re-scan. */
.recent { margin-top: 40px; width: min(600px, 92vw); }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.recent-title { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.recent-clear { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; border-radius: 6px; transition: color .12s; }
.recent-clear:hover { color: var(--crit); }
.recent-row { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.recent-chip { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); padding: 7px 13px 7px 8px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm); transition: border-color .12s, background .12s, transform .06s; max-width: 100%; }
.recent-chip:hover { border-color: var(--accent); background: var(--panel-2); }
.recent-chip:active { transform: translateY(.5px); }
.rc-badge { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  color: #fff; font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: -.02em; }
.rc-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.rc-time { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); flex-shrink: 0; }

/* Scanning */
.scanning { display: grid; place-items: center; gap: 16px; min-height: 56vh; text-align: center; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.log { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: left;
  white-space: pre-wrap; max-height: 260px; overflow: auto; box-shadow: var(--shadow-sm); }

/* Overview */
.overview-grid { display: flex; flex-direction: column; gap: 14px; }
.grade-card { display: flex; align-items: center; gap: 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow); }
.grade-badge { width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; flex-shrink: 0;
  font-size: 38px; font-weight: 750; color: #fff; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background-image: linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,.05) 44%, rgba(0,0,0,.16));
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), inset 0 -8px 16px rgba(0,0,0,.14), 0 8px 20px rgba(20,24,33,.18);
  text-shadow: 0 1px 1px rgba(0,0,0,.22); }
.grade-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.grade-host { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); word-break: break-all; line-height: 1.3; }
.grade-score { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.grade-score b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.grade-bar { height: 7px; border-radius: 999px; background: var(--track); overflow: hidden; max-width: 420px; }
.grade-bar > i { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .5s cubic-bezier(.2,.7,.3,1); }
.grade-url { color: var(--ink-3); font-size: 12px; font-family: var(--mono); word-break: break-all; }
.watch-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13px;
  font-weight: 560; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, color .12s, border-color .12s; }
.watch-btn:hover { border-color: var(--accent); color: var(--accent); }
.watch-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.watch-btn .wb-ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.watch-btn.on .wb-ico { fill: currentColor; }

.counts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.count { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 12px;
  text-align: center; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .06s; }
.count:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.count:active { transform: translateY(.5px); }
.count.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count b { font-size: 24px; display: block; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.count span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 560; }

.owasp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 20px 0; }
.owasp-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow-sm); }
.owasp-cell.clickable { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .06s; }
.owasp-cell.clickable:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.owasp-cell.clickable:active { transform: translateY(.5px); }
.owasp-cell.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.owasp-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.owasp-cell .code { font-weight: 680; font-size: 12px; display: flex; align-items: center; }
.owasp-cell .name { color: var(--ink-3); font-size: 10.5px; line-height: 1.3; margin-top: 3px; }
.owasp-cell .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }

.tech { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.tech .t { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px;
  font-size: 12px; font-family: var(--mono); color: var(--ink-2); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: border-color .12s, color .12s; }
.tech .t:hover { border-color: var(--accent); color: var(--ink); }
.tech .t.open { border-color: var(--accent); background: var(--accent-soft); }
.tech .t b { color: var(--ink); font-weight: 600; }
.t-note { flex-basis: 100%; margin-top: 2px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 13px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.t-note b { color: var(--ink); }

/* Endpoints & Services — the "what does this site connect to?" panel on the Overview. */
.connect { margin: 18px 0; }
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.connect-grid.one { grid-template-columns: 1fr; }
.connect-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.connect-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2); }
.connect-h h3 { margin: 0; font-size: 13px; font-weight: 640; letter-spacing: -.01em; }
.connect-h span { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.connect-list { display: flex; flex-direction: column; }
.connect-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--line-2); }
.connect-row:last-child { border-bottom: 0; }
.cr-st { font-family: var(--mono); font-size: 11px; font-weight: 600; min-width: 30px; text-align: center;
  font-variant-numeric: tabular-nums; }
.cr-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 11px; }
.cr-dot.on { background: var(--pass); }
.cr-dot.off { background: var(--ink-3); opacity: .5; }
.cr-main { min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.cr-main b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.cr-path { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cr-flags { display: flex; gap: 4px; flex-shrink: 0; }
.ctag { font-size: 10px; font-weight: 560; padding: 2px 7px; border-radius: 5px; background: var(--track);
  color: var(--ink-2); letter-spacing: .01em; }
.ctag.api { background: var(--accent-soft); color: var(--accent); }
.ctag.bad { background: var(--crit-bg); color: var(--crit); }
.ctag.live { background: var(--pass-bg); color: var(--pass); }
.connect-empty { padding: 14px; color: var(--ink-3); font-size: 12.5px; }
.connect-more { border: 0; background: none; text-align: left; padding: 10px 14px; cursor: pointer;
  font-size: 12px; font-weight: 560; color: var(--accent); border-top: 1px solid var(--line-2);
  transition: background .12s; margin-top: auto; }
.connect-more:hover { background: var(--accent-soft); }
@media (max-width: 820px) { .connect-grid { grid-template-columns: 1fr; } }

.findings-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 14px; }
.findings-head h2 { font-size: 18px; margin: 0; }
.filters { display: flex; gap: 4px; background: var(--track); padding: 3px; border-radius: 10px; }
.filters button { border: 0; background: none; border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer;
  color: var(--ink-2); font-weight: 550; transition: background .12s, color .12s; }
.filters button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.findings { display: flex; flex-direction: column; gap: 8px; }
.finding { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: border-color .12s; }
.finding[open] { border-color: var(--line); box-shadow: var(--shadow); }
.finding summary { display: flex; align-items: center; gap: 11px; padding: 13px 15px; cursor: pointer; list-style: none; }
.finding summary::-webkit-details-marker { display: none; }
.finding summary:hover { background: var(--panel-2); }
.sev-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; min-width: 62px; text-align: center; }
.finding .f-title { font-weight: 550; flex: 1; }
.finding .f-cat { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); }
.heuristic-tag { font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.f-body { padding: 4px 15px 16px 15px; border-top: 1px solid var(--line-2); }
.f-body h4 { margin: 13px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.f-body p { margin: 0; color: var(--ink); }
.f-body pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); margin: 4px 0 0; }

.sev-critical { color: var(--crit); } .bg-critical { background: var(--crit); color: #fff; }
.sev-high { color: var(--high); } .bg-high { background: var(--high); color: #fff; }
.sev-medium { color: var(--med); } .bg-medium { background: var(--med); color: #3d2c00; }
.sev-low { color: var(--low); } .bg-low { background: var(--low); color: #fff; }
.sev-info { color: var(--info); } .bg-info { background: var(--info); color: #fff; }
.sev-pass { color: var(--pass); } .bg-pass { background: var(--pass); color: #fff; }
.fill-crit { background: var(--crit); } .fill-high { background: var(--high); } .fill-med { background: var(--med); }
.fill-low { background: var(--low); } .fill-pass { background: var(--pass); } .fill-none { background: var(--line); }

/* Inspect / Security Lens */
.inspect { display: grid; grid-template-columns: 1fr 350px; gap: 0; max-width: none; padding: 0; height: calc(100vh - 104px); }
.inspect-frame { position: relative; border-right: 1px solid var(--line); background: #fff; }
.inspect-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: rgba(20,24,33,.86); color: #fff; font-size: 12px; padding: 6px 13px; border-radius: 999px; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#page { width: 100%; height: 100%; border: 0; background: #fff; }
.lens { background: var(--panel); padding: 20px; overflow: auto; }
.lens h2 { font-size: 16px; margin: 0 0 12px; }
.lens-empty { color: var(--ink-3); font-size: 13px; line-height: 1.55; }
.lens-el { font-family: var(--mono); font-size: 12px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px; color: var(--ink-2); word-break: break-all; margin-bottom: 14px; }
.lens-note { border-left: 3px solid var(--line); padding: 8px 0 8px 12px; margin: 10px 0; }
.lens-note.n-critical { border-color: var(--crit); } .lens-note.n-high { border-color: var(--high); }
.lens-note.n-medium { border-color: var(--med); } .lens-note.n-low { border-color: var(--low); }
.lens-note.n-pass { border-color: var(--pass); } .lens-note.n-info { border-color: var(--info); }
.lens-note .nt { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.lens-note .nd { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }

/* Shared stat blocks (Network + Attack Surface) */
.net-summary, .surface-summary { display: flex; gap: 26px; margin-bottom: 16px; flex-wrap: wrap; }
.net-summary .s b, .surface-summary .s b { font-size: 24px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.net-summary .s span, .surface-summary .s span { color: var(--ink-3); font-size: 12px; display: block; margin-top: 1px; }

/* Network */
.net-domains { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.net-domains .d { border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; font-size: 12px; font-family: var(--mono); background: var(--panel); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.net-domains .d:hover { border-color: var(--accent); }
.net-domains .d.first { border-color: var(--accent); color: var(--accent); }
.net-domains .d.insecure { border-color: var(--crit); color: var(--crit); }
.net-domains .d.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.net-controls { display: flex; gap: 18px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.net-controls label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.net-table, .surface-list, .mon-feed { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-sm); }
.net-row { display: grid; grid-template-columns: 54px 64px 1fr auto; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; align-items: center; cursor: pointer; }
.net-row.open { background: var(--accent-soft); }
.net-detail { padding: 12px 14px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); }
.net-detail dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; margin: 0; }
.net-detail dt { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; align-self: center; }
.net-detail dd { margin: 0; color: var(--ink); font-size: 12.5px; font-family: var(--mono); word-break: break-all; }
.net-detail dd a { color: var(--accent); }
.net-detail .flag { display: inline-flex; align-items: center; gap: 6px; }
.net-row:last-child { border-bottom: 0; }
.net-row:hover { background: var(--panel-2); }
.net-row .st { font-weight: 600; font-variant-numeric: tabular-nums; }
.net-row .url { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-row .badge { font-size: 10px; padding: 2px 6px; border-radius: 5px; font-family: var(--sans); font-weight: 550; }
.badge.third { background: var(--med-bg); color: var(--med); }
.badge.insec { background: var(--crit-bg); color: var(--crit); }
.badge.cookie { background: var(--low-bg); color: var(--low); }

/* Tools */
.tools-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.install-btn { border: 0; background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px; font-weight: 590; white-space: nowrap; box-shadow: var(--shadow-sm); transition: filter .12s; }
.install-btn:hover { filter: brightness(1.06); }
.install-btn:disabled { opacity: .55; cursor: default; }
.tools-actions .fineprint { margin: 0; max-width: 560px; }
.tools-gate { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.authorize { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; }
.authorize input { width: 16px; height: 16px; accent-color: var(--accent); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow-sm); transition: box-shadow .14s, transform .14s; }
.tool:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tool .th { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.tool .tn { font-weight: 620; }
.tool .kind { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.tool .td { color: var(--ink-2); font-size: 12.5px; min-height: 50px; line-height: 1.45; }
.tool .status { font-size: 12px; margin: 9px 0; font-weight: 550; }
.tool .installed { color: var(--pass); } .tool .missing { color: var(--ink-3); }
.tool-run { width: 100%; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px;
  padding: 8px; font-weight: 590; cursor: pointer; transition: filter .12s; }
.tool-run:hover:not(:disabled) { filter: brightness(1.06); }
.tool-run:disabled { background: var(--panel-2); color: var(--ink-3); border-color: var(--line); cursor: default; }
.tool .install-hint { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-top: 9px; }
.tool-output { max-width: none; min-height: 200px; max-height: 420px; }

/* Attack Surface (passive subdomain discovery) */
.surface-head h2, .mon-head h2 { margin: 0 0 6px; font-size: 20px; }
.surface-head .fineprint { margin: 0 0 18px; max-width: 730px; line-height: 1.55; }
.surface-note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow-sm); }
.surface-note b { display: block; font-family: var(--mono); margin-bottom: 4px; }
.surface-note span { color: var(--ink-2); font-size: 13px; }
.surface-controls { display: flex; gap: 18px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); align-items: center; flex-wrap: wrap; }
.surface-controls label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.surface-controls input[type="text"] { margin-left: auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font-family: var(--mono); font-size: 12.5px; min-width: 190px; }
.surface-controls input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.surf-row { display: grid; grid-template-columns: 16px 1fr 160px auto; gap: 10px; padding: 9px 13px;
  border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 12.5px; align-items: center; }
.surf-row:last-child { border-bottom: 0; }
.surf-row:hover { background: var(--panel-2); }
.surf-row.live { background: linear-gradient(90deg, var(--pass) 0 3px, transparent 3px); }
.surf-row.live:hover { background: linear-gradient(90deg, var(--pass) 0 3px, var(--panel-2) 3px); }
.surf-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.surf-dot.on { background: var(--pass); box-shadow: 0 0 0 3px var(--pass-bg); } .surf-dot.off { background: var(--line); border: 1px solid var(--ink-3); box-sizing: border-box; }
.surf-host { color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surf-host:hover { text-decoration: underline; }
.surf-host.dead { color: var(--ink-3); }
.surf-ip { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surf-tag { font-family: var(--sans); font-size: 10.5px; padding: 2px 8px; border-radius: 5px; background: var(--med-bg);
  color: var(--med); white-space: nowrap; font-weight: 550; }
.surface-list .fineprint { padding: 9px 13px; margin: 0; }

/* Monitor */
.mon-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.mon-head .fineprint { margin: 0; max-width: 620px; line-height: 1.55; }
.mon-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mon-toggle { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); font-weight: 550; }

/* toggle switch */
.sw { width: 42px; height: 25px; border-radius: 999px; border: 0; background: var(--track);
  position: relative; cursor: pointer; padding: 0; transition: background .18s; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s; }
.sw.on { background: var(--pass); }
.sw.on::after { transform: translateX(17px); }

/* segmented picker — native raised-selection style */
.seg-pick { display: inline-flex; background: var(--track); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-pick button { border: 0; background: none; padding: 5px 12px; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; border-radius: 7px; font-weight: 550; transition: background .12s, color .12s; }
.seg-pick button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.mon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px;
  border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 560; box-shadow: var(--shadow-sm); transition: border-color .12s, color .12s; }
.mon-btn:hover { border-color: var(--accent); color: var(--accent); }
.mon-btn.ghost { color: var(--ink-2); }
.mon-btn.on { background: var(--pass-bg); border-color: var(--pass); color: var(--pass); }

.mon-status { color: var(--ink-3); font-size: 12.5px; margin-bottom: 18px; font-family: var(--mono); }
.mon-status.busy { color: var(--accent); }

.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(322px, 1fr)); gap: 14px; margin-bottom: 30px; }
.mon-empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius-lg);
  padding: 30px; text-align: center; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.mon-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); transition: box-shadow .14s, transform .14s; }
.mon-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.mon-card-head { display: flex; gap: 13px; align-items: center; }
.mon-badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  font-weight: 750; font-size: 18px; flex-shrink: 0; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 6px rgba(0,0,0,.12); }
.mon-meta { min-width: 0; }
.mon-host { font-family: var(--mono); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-sub2 { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.mon-when { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.spark { width: 100%; height: 38px; }
.spark svg { display: block; width: 100%; height: 38px; }
.mon-changes { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 11px; }
.mon-mini { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.mon-actions { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 12px; }
.mon-a { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); padding: 5px 11px;
  border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 550; transition: border-color .12s, color .12s; }
.mon-a:hover { border-color: var(--accent); color: var(--accent); }
.mon-a.on { color: var(--pass); border-color: var(--pass); background: var(--pass-bg); }
.mon-a.danger:hover { border-color: var(--crit); color: var(--crit); }

.mon-feed-head h3 { margin: 0 0 12px; font-size: 16px; }
.feed-row { display: grid; grid-template-columns: 12px 150px 1fr auto; gap: 11px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-2); font-size: 12.5px; align-items: baseline; }
.feed-row:last-child { border-bottom: 0; }
.feed-row:hover { background: var(--panel-2); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; align-self: center; }
.feed-dot.bg-critical { background: var(--crit); } .feed-dot.bg-high { background: var(--high); }
.feed-dot.bg-medium { background: var(--med); } .feed-dot.bg-low { background: var(--low); }
.feed-dot.bg-info { background: var(--info); } .feed-dot.bg-pass { background: var(--pass); }
.feed-host { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-msg { color: var(--ink); line-height: 1.45; }
.feed-time { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.mon-feed .fineprint { padding: 15px; margin: 0; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 60;
  max-width: min(360px, calc(100vw - 40px)); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 11px;
  padding: 12px 15px; font-size: 13px; color: var(--ink); box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .28s, transform .28s; }
.toast.in { opacity: 1; transform: none; }
.toast.t-critical { border-left-color: var(--crit); } .toast.t-high { border-left-color: var(--high); }
.toast.t-medium { border-left-color: var(--med); } .toast.t-low { border-left-color: var(--low); }
.toast.t-pass { border-left-color: var(--pass); } .toast.t-info { border-left-color: var(--info); }

@media (max-width: 620px) {
  .counts { grid-template-columns: repeat(3, 1fr); }
  .owasp { grid-template-columns: repeat(2, 1fr); }
  .grade-card { flex-wrap: wrap; }
  .feed-row { grid-template-columns: 12px 1fr; }
  .feed-host, .feed-time { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Shader logo mark — a live WebGL pixel-art magnifying glass fills the chip;
   the gradient is the fallback when WebGL is unavailable.
   ══════════════════════════════════════════════════════════════════════════════ */
.logo, .home-mark { position: relative; overflow: hidden; }
.shader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* When the shader mounts, the glass sits on transparent (like the favicon) —
   drop the blue chip so the magnifying glass reads on its own. */
.logo.has-shader, .home-mark.has-shader { background: none; box-shadow: none; }

/* Fullscreen "easter effect" overlay (Konami code / triple-click the logo). */
.fx-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9998;
  display: block; cursor: pointer; opacity: 0; transition: opacity .35s ease; }
.fx-overlay.on { opacity: 1; }
.fx-caption { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  pointer-events: none; color: #eafcff; font-family: var(--mono); font-weight: 700;
  font-size: clamp(20px, 5vw, 56px); letter-spacing: .35em; text-indent: .35em;
  text-shadow: 0 0 18px rgba(60, 220, 255, .9), 0 0 42px rgba(30, 140, 255, .7);
  opacity: 0; transform: scale(.96); transition: opacity .4s ease, transform .4s ease; }
.fx-caption.on { opacity: 1; transform: scale(1); }

/* ══════════════════════════════════════════════════════════════════════════════
   Settings — top-right control + modal sheet
   ══════════════════════════════════════════════════════════════════════════════ */
.settings-btn { display: inline-flex; align-items: center; gap: 7px; margin-left: 10px; flex-shrink: 0;
  border: 1px solid transparent; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 550;
  padding: 6px 11px; border-radius: 8px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.settings-btn svg { width: 16px; height: 16px; }
.settings-btn:hover { background: var(--line-2); color: var(--ink); }
/* In home mode the .top-links carry margin-left:auto and push Settings to the right;
   otherwise the flex:1 .urlbar does. Either way it sits far right. */
@media (max-width: 720px) { .settings-btn span { display: none; } }

.modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(15,17,21,.42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 10vh 20px 20px; }
.settings-sheet { width: min(520px, 100%); max-height: 80vh; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  animation: sheetIn .2s cubic-bezier(.2,.7,.2,1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px;
  position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line-2); z-index: 1; }
.settings-head h2 { margin: 0; font-size: 17px; }
.settings-close { border: 0; background: var(--panel-2); color: var(--ink-2); width: 30px; height: 30px; border-radius: 8px;
  font-size: 19px; line-height: 1; cursor: pointer; }
.settings-close:hover { color: var(--ink); background: var(--line-2); }
.set-group { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.set-group:last-child { border-bottom: 0; }
.set-group h3 { margin: 0 0 4px; font-size: 13px; font-weight: 640; }
.set-note { margin: 0 0 12px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.set-note code { font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }

.seg-theme, .seg-pick { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-theme button { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 550;
  padding: 6px 16px; border-radius: 7px; cursor: pointer; transition: background .12s, color .12s; }
.seg-theme button:hover { color: var(--ink); }
.seg-theme button.on { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

.set-key { display: flex; gap: 8px; }
.set-key input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--ink); font-family: var(--mono); font-size: 13px; }
.set-key input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.set-save { border: 0; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 590; font-size: 13px;
  padding: 0 18px; cursor: pointer; box-shadow: var(--shadow-sm); }
.set-save:hover { filter: brightness(1.06); }
.set-keystate { margin-top: 9px; font-size: 12px; color: var(--ink-3); min-height: 16px; }
.set-keystate.ok { color: var(--pass); }

/* ══════════════════════════════════════════════════════════════════════════════
   Deep Search — a papery imageboard "board" of the whole scan
   ══════════════════════════════════════════════════════════════════════════════ */
.pane.deepsearch { max-width: none; margin: 0; padding: 0; height: calc(100dvh - 56px - 47px); overflow: hidden; }
.graph-wrap { position: relative; display: flex; flex-direction: column; height: 100%;
  --paper: #ece0c8; --paper-2: #f6efdd; --paper-ink: #2b2118; --paper-line: #cbb68f; --maroon: #7c1d1d; --green: #5f7a2f; }

.graph-bar { display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 9px 16px; z-index: 3;
  background: linear-gradient(var(--paper-2), #efe6cf); border-bottom: 1px solid var(--paper-line);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset; }
.gb-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 15px; color: var(--maroon); letter-spacing: .01em; }
.gb-host { font-family: var(--mono); font-size: 12px; color: #6b5a3c; font-weight: 400; margin-left: 6px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.5); border: 1px solid var(--paper-line);
  color: #4d3f28; border-radius: 20px; padding: 4px 10px 4px 8px; font-size: 11.5px; cursor: pointer; user-select: none; transition: .12s; }
.g-chip .g-dot { width: 9px; height: 9px; border-radius: 50%; }
.g-chip.off { opacity: .34; }
.g-chip:hover { border-color: #9c8558; }
.gb-actions { display: flex; gap: 7px; align-items: center; }
.deep-btn { border: 1px solid #6a1717; background: linear-gradient(#9a2323, #7c1d1d); color: #fdeee0; font-family: var(--sans);
  font-weight: 600; font-size: 12.5px; padding: 7px 15px; border-radius: 7px; cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, var(--shadow-sm); transition: filter .12s, transform .06s; }
.deep-btn:hover { filter: brightness(1.08); }
.deep-btn:active { transform: translateY(.5px); }
.deep-btn.busy, .deep-btn:disabled { opacity: .7; cursor: default; }
.deep-btn.sm { padding: 6px 12px; font-size: 12px; }
.gb-ghost { border: 1px solid var(--paper-line); background: rgba(255,255,255,.5); color: #5a4a30; font-family: var(--sans);
  font-size: 12.5px; font-weight: 550; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.gb-ghost:hover { border-color: #9c8558; background: rgba(255,255,255,.75); }

.graph-stage { position: relative; flex: 1; overflow: hidden; cursor: grab;
  background-color: var(--paper);
  background-image:
    radial-gradient(130% 90% at 50% -10%, rgba(255,252,244,.75), rgba(214,196,158,.15) 68%, rgba(120,98,60,.12)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: auto, 160px 160px; }
.graph-stage canvas { display: block; position: absolute; inset: 0; }
.g-tip { position: absolute; pointer-events: none; background: #fffaf0; border: 1px solid var(--paper-line);
  border-radius: 6px; padding: 6px 9px; font-size: 12px; max-width: 220px; opacity: 0; transition: opacity .12s; z-index: 5;
  box-shadow: var(--shadow); color: var(--paper-ink); }
.g-tip b { display: block; font-family: Georgia, serif; }
.g-tip span { color: #7a6640; font-size: 11px; }
.g-hint { position: absolute; left: 14px; bottom: 12px; font-size: 11px; color: #6b5a3c; z-index: 4;
  background: rgba(255,250,240,.72); border: 1px solid rgba(203,182,143,.6); padding: 5px 9px; border-radius: 6px; pointer-events: none; }

.g-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.g-empty-card { max-width: 380px; text-align: center; background: #fffaf0; border: 1px solid var(--paper-line);
  border-radius: 12px; padding: 26px 28px; box-shadow: var(--shadow); color: var(--paper-ink); }
.g-empty-card h3 { margin: 0 0 8px; font-family: Georgia, serif; color: var(--maroon); font-size: 18px; }
.g-empty-card p { margin: 0; color: #4d3f28; font-size: 13px; line-height: 1.55; }

/* intro overlay */
.g-intro { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: rgba(60,48,28,.28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.g-intro-card { max-width: 460px; background: #fffaf0; border: 1px solid var(--paper-line); border-radius: 14px;
  padding: 26px 30px; box-shadow: var(--shadow-pop); color: var(--paper-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"); }
.g-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon); }
.g-intro-card h2 { margin: 6px 0 8px; font-family: Georgia, serif; font-size: 23px; color: var(--paper-ink); }
.g-intro-card > p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; color: #4d3f28; }
.g-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 20px; }
.g-stats b { display: block; font-family: Georgia, serif; font-size: 24px; color: var(--maroon); }
.g-stats span { font-size: 11px; color: #7a6640; }
.g-intro-row { display: flex; gap: 10px; align-items: center; }

/* transient paper note */
.g-note { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 7; max-width: 360px;
  background: #fffaf0; border: 1px solid var(--paper-line); border-left: 3px solid var(--maroon); border-radius: 10px;
  padding: 13px 16px; box-shadow: var(--shadow-pop); color: var(--paper-ink); }
.g-note b { font-family: Georgia, serif; color: var(--maroon); }
.g-note p { margin: 5px 0 10px; font-size: 12.5px; line-height: 1.5; color: #4d3f28; }
.g-note-row { display: flex; gap: 8px; }

/* the detail "post" panel */
.g-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(430px, 94vw); z-index: 9;
  background: #f3ead4; border-left: 1px solid var(--paper-line); box-shadow: -8px 0 30px rgba(60,44,20,.22);
  transform: translateX(103%); transition: transform .3s cubic-bezier(.35,0,.1,1); overflow-y: auto; }
.g-panel.open { transform: none; }
.g-panel-inner { position: relative; padding: 16px 18px 28px; }
.g-close { position: absolute; top: 12px; right: 12px; border: 1px solid var(--paper-line); background: #fffaf0; color: #7a6640;
  width: 28px; height: 28px; border-radius: 7px; font-size: 17px; line-height: 1; cursor: pointer; }
.g-close:hover { color: var(--maroon); }
.post { background: #fdf6e6; border: 1px solid var(--paper-line); border-radius: 8px; padding: 14px 15px; color: var(--paper-ink); }
.post-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-right: 30px; margin-bottom: 8px;
  border-bottom: 1px dashed rgba(203,182,143,.8); padding-bottom: 8px; }
.post-head .subject { font-family: Georgia, serif; font-weight: 700; font-size: 15.5px; }
.post-head .name { color: var(--green); font-weight: 700; font-size: 12px; }
.post-head .cap { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.post-head .pno { font-family: var(--mono); font-size: 11px; color: #9a8558; margin-left: auto; }
.quotes { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.ql { color: var(--green); font-size: 12px; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; font-family: var(--mono); }
.ql span { color: #6b5a3c; text-decoration: none; }
.ql:hover { color: #46621f; }
.comment { margin: 0; font-size: 13.5px; line-height: 1.6; color: #33291b; }
.comment .lede { font-size: 13.5px; }
.comment h4 { margin: 14px 0 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--maroon); }
.comment p { margin: 0 0 9px; }
.comment .muted { color: #7a6640; font-size: 12px; }
.comment .warn { color: var(--maroon); font-weight: 600; }
.comment pre { background: #efe4cb; border: 1px solid var(--paper-line); border-radius: 6px; padding: 9px 11px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; word-break: break-word; color: #3b2f1c; }
.comment code { font-family: var(--mono); font-size: 12px; background: #efe4cb; padding: 1px 5px; border-radius: 4px; }
.comment a { color: var(--maroon); }
.prow { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dotted rgba(203,182,143,.6); font-size: 12.5px; }
.prow .pk { color: #7a6640; min-width: 84px; font-family: var(--mono); font-size: 11.5px; }
.prow .pv { flex: 1; word-break: break-word; }
.greens { display: flex; flex-direction: column; gap: 1px; margin: 10px 0 2px; }
.greens span { color: var(--green); font-family: var(--mono); font-size: 12px; }
.post-file { margin-top: 12px; font-size: 11px; color: #9a8558; font-family: var(--mono); word-break: break-all; }

/* Deep Search stays papery in dark mode, just a touch deeper so it isn't blinding. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .graph-wrap { --paper: #d9c8a4; --paper-2: #e7dcc2; }
}
:root[data-theme="dark"] .graph-wrap { --paper: #d9c8a4; --paper-2: #e7dcc2; }
