/* BlackCrawler SOC UI: one restrained, reusable dark system. */
:root {
  color-scheme: dark;
  --bg: #090e16; --surface: #111925; --surface-raised: #172232;
  --line: #293547; --text: #eef2f8; --muted: #a1afc1;
  --accent: #65cfbb; --accent-ink: #071c1c;
  --good: #74d7a4; --bad: #f28a97; --warn: #eac17c;
  --radius: 12px; --space: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 0; margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
body, button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, input, select, textarea { font-size: 1rem; }
button { cursor: pointer; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
button:hover { background: #88e6d5; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #425269; border-radius: 9px; background: #0b121d; color: var(--text); padding: 10px 12px; }
input::placeholder { color: #8b9aad; }
input[type=hidden] { display: none; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
form { max-width: 100%; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.035em; }
h1 { font-size: clamp(29px, 4vw, 42px); margin: 0 0 16px; }
h2 { font-size: clamp(20px, 2.5vw, 25px); margin: 0 0 16px; }
p { margin: 0 0 16px; }
.muted, .label { color: var(--muted); }
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 26px; height: 72px; padding: 0 max(22px, calc((100vw - 1260px)/2)); border-bottom: 1px solid var(--line); background: #0d141eeF; backdrop-filter: blur(12px); }
.brand { display: inline-flex; flex-shrink: 0; gap: 9px; align-items: center; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 760; letter-spacing: -.045em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 31px; height: 31px; color: var(--accent); }
.brand-name b { color: var(--accent); }
.brand-tag { display: none; }
.nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 42px; border-radius: 8px; padding: 8px 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav a:hover, .nav a.active { text-decoration: none; background: #1b2937; color: var(--text); }
.identity { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.identity .muted { font-size: 13px; white-space: nowrap; }
.identity form { margin: 0; }
.identity button { background: transparent; color: var(--text); border-color: var(--line); font-size: 13px; font-weight: 550; }
.identity button:hover { background: var(--surface-raised); }
.main { min-width: 0; }
.content { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 44px 0 100px; min-width: 0; }
.content > section, .content > div { min-width: 0; }
.card, .table-wrap, .notice, #overview, #screenshot, #network, #redirects, #dns-tls, #observations { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; }
.notice { margin-bottom: 18px; }
.notice.bad, .bad { color: var(--bad); }
.good { color: var(--good); } .warn { color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid label:last-child { grid-column: 1 / -1; }
.card h2 { margin-bottom: 22px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: .13em; }
.analyzer-home { padding-top: clamp(32px, 8vh, 98px); }
.analyzer-hero { text-align: center; max-width: 860px; margin: 0 auto; }
.analyzer-hero .hero-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 30px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -.05em; }
.analyzer-hero .hero-brand svg { width: 39px; height: 39px; color: var(--accent); }
.analyzer-hero h1 { font-size: clamp(39px, 6vw, 66px); font-weight: 650; letter-spacing: -.055em; margin: 0 0 12px; }
.analyzer-hero > p { color: var(--muted); font-size: clamp(15px, 2vw, 18px); margin-bottom: 30px; }
.analyzer-form { margin: 0 auto; }
.analyzer-form label { text-align: left; font-size: 13px; font-weight: 650; margin-bottom: 9px; }
.url-bar { display: flex; gap: 8px; padding: 8px; border: 1px solid #4b6672; border-radius: 16px; background: #121e2a; box-shadow: 0 14px 50px #0005, 0 0 0 1px #65cfbb15; }
.url-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #65cfbb35; }
.url-bar input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; padding: 0 14px; font-size: 17px; outline: none; }
.url-bar input:focus-visible { outline: none; }
.url-bar button { flex: 0 0 auto; min-width: 126px; min-height: 52px; border-radius: 11px; }
.trust-line { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 16px auto 0; color: var(--muted); font-size: 12px; }
.trust-line span + span::before { content: '·'; margin-right: 10px; color: #708394; }
.recent { margin: clamp(54px, 10vh, 112px) 0 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
td { font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
td a { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1b293733; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.history-filters { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0 18px; }
.history-filters a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.history-filters a:hover { color: var(--text); text-decoration: none; background: var(--surface-raised); }
.content > h1 + nav[aria-label="Scan sections"] { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
nav[aria-label="Scan sections"] a { color: var(--muted); font-size: 13px; }
#overview, #screenshot, #network, #redirects, #dns-tls, #observations { margin-bottom: 20px; scroll-margin-top: 92px; min-width: 0; overflow: hidden; }
#overview p, #dns-tls p, #redirects p, #redirects li, #observations li { overflow-wrap: anywhere; }
#overview form { display: inline-flex; margin: 8px 8px 0 0; }
#overview form button { background: #1b2e3a; color: var(--text); border: 1px solid var(--line); }
#overview form[action$="/delete"] button { color: var(--bad); }
#screenshot img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
#network form { display: flex; align-items: end; gap: 10px; margin-bottom: 18px; }
#network form label { flex: 1; }
#network .table-wrap { padding: 0; border: 0; }
#network table { min-width: 690px; }
#network td { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
#redirects ol { padding-left: 22px; }
#redirects li { padding: 5px 0; }
.login { width: min(440px, calc(100% - 32px)); margin: clamp(46px, 12vh, 140px) auto 40px; }
.login > .brand { display: flex; justify-content: center; margin-bottom: 28px; font-size: 21px; }
.login .brand-mark { width: 38px; height: 38px; }
.login .card { padding: 32px; }
.login .card h1 { font-size: 27px; margin: 8px 0 24px; }
.login label { margin-bottom: 18px; }
.login button { width: 100%; }
.login .notice { margin-bottom: 16px; }
.content > .table-wrap + .card, .content > .table-wrap + div { margin-top: 24px; }
.create-user { margin-top: 24px; }
.report-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 10px 14px; color: var(--muted); }
.report-summary span { padding: 2px 10px; border-right: 1px solid var(--line); }
.report-search { display: flex; align-items: end; gap: 10px; max-width: 650px; margin-bottom: 18px; }
.report-search label { flex: 1; min-width: 0; color: var(--muted); }
.report-search input { margin-top: 6px; }
.copy-value { display: inline-block; max-width: min(60ch, 100%); overflow-wrap: anywhere; user-select: all; cursor: text; color: var(--accent); }
.finding-list { display: grid; gap: 12px; padding-left: 20px; }
.finding-list li { min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }
.finding-list .muted { overflow-wrap: anywhere; }
.table-hint { display: none; color: var(--muted); font-size: 12px; }
.user-table td form { display: flex; align-items: center; gap: 8px; min-width: 380px; }
.user-table td form select { min-width: 96px; }
.user-table td form input { min-width: 170px; }
.history-table td:last-child { min-width: 270px; }
.history-table td:last-child form { display: inline-flex; margin: 0 0 0 7px; }
.history-table td:last-child button { background: transparent; border-color: var(--line); color: var(--text); min-height: 36px; padding: 6px 10px; font-size: 12px; }
.history-table td:last-child form[action$="/delete"] button { color: var(--bad); }
.pagination { margin-top: 20px; }
.mobile-menu-button, .mobile-drawer, .mobile-menu-overlay { display: none; }
@media (max-width: 920px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .nav a { padding: 8px; font-size: 13px; }
  .identity .muted { display: none; }
}
@media (max-width: 760px) {
  .report-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary span { min-width: 0; }
  .report-search { flex-wrap: wrap; }
  .report-search label { flex-basis: 100%; }
  .table-hint { display: block; }
  body.mobile-menu-open { overflow: hidden; }
  .topbar { height: 64px; gap: 12px; }
  .topbar > .nav, .topbar > .identity { display: none; }
  .mobile-menu-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; padding: 0; background: transparent; border-color: var(--line); color: var(--text); font-size: 22px; }
  .topbar .brand { margin-right: auto; }
  .mobile-menu-overlay { position: fixed; inset: 0; z-index: 30; background: #000b; }
  .mobile-menu-overlay.is-open { display: block; }
  .mobile-drawer { display: block; position: fixed; z-index: 31; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); padding: 18px; background: var(--surface); border-right: 1px solid var(--line); transform: translateX(-105%); transition: transform .18s ease; overflow-y: auto; }
  .mobile-drawer.is-open { transform: translateX(0); }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .drawer-title { font-size: 18px; font-weight: 700; }
  .drawer-subtitle, .drawer-user { color: var(--muted); font-size: 13px; }
  .drawer-user { padding: 16px 0; }
  .drawer-close { width: 44px; min-width: 44px; padding: 0; background: transparent; border: 1px solid var(--line); color: var(--text); font-size: 26px; }
  .mobile-drawer .nav { display: grid; gap: 7px; }
  .mobile-drawer .nav a { min-height: 48px; font-size: 16px; }
  .drawer-logout { margin-top: 20px; }
  .drawer-logout button { width: 100%; background: var(--surface-raised); color: var(--text); }
  .content { width: min(100% - 32px, 1180px); padding-top: 26px; }
  .analyzer-home { padding-top: clamp(24px, 8vh, 60px); }
  .recent { margin-top: 56px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label:last-child { grid-column: auto; }
  .card, .table-wrap, .notice, #overview, #screenshot, #network, #redirects, #dns-tls, #observations { padding: 16px; }
}
@media (max-width: 520px) {
  .analyzer-hero .hero-brand { margin-bottom: 18px; }
  .analyzer-hero h1 { font-size: 40px; }
  .url-bar { flex-direction: column; }
  .url-bar input { height: 52px; font-size: 16px; }
  .url-bar button { min-height: 50px; width: 100%; }
  .trust-line { gap: 5px 9px; }
  .trust-line span + span::before { margin-right: 9px; }
  #network form { flex-direction: column; align-items: stretch; }
  .user-table td form { min-width: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-drawer { transition: none; }
}

/* B5B-B Interactive Browser: compact Analyze sub-surface. */
.analyzer-modes { display: flex; justify-content: center; gap: 8px; margin: 20px auto 0; }
.analyzer-modes a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.analyzer-modes a.active { background: var(--surface-raised); color: var(--text); }
.interactive-browser { max-width: 1180px; margin: 0 auto; }
.interactive-browser .section-heading { align-items: center; }
.interactive-browser .section-heading h1 { margin: 4px 0 0; }
.interactive-browser .interactive-safety { margin: 16px 0; font-size: 13px; }
.interactive-state { margin: 16px 0 8px; font-weight: 700; }
.interactive-session-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.interactive-session-meta code { color: var(--text); overflow-wrap: anywhere; }
.interactive-url-form { margin-bottom: 16px; }
.interactive-url-form > label { margin-bottom: 8px; }
.interactive-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.interactive-controls button { min-width: 84px; background: var(--surface-raised); border-color: var(--line); color: var(--text); }
.interactive-controls .stop-session { margin-left: auto; border-color: #8b3d4a; color: var(--bad); }
.interactive-viewport { width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid #46566a; border-radius: 9px; background: #000; outline-offset: 3px; touch-action: none; user-select: none; }
#interactive-frame { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.interactive-help { margin: 12px 0 0; font-size: 12px; }
#interactive-message { margin: 12px 0 0; }
#interactive-message[hidden] { display: none; }
@media (max-width: 760px) {
  .interactive-browser { padding: 16px; }
  .interactive-controls { gap: 6px; }
  .interactive-controls button { flex: 1 1 88px; padding: 8px 10px; }
  .interactive-controls .stop-session { margin-left: 0; }
}
@media (max-width: 520px) {
  .analyzer-modes { flex-direction: column; }
  .analyzer-modes a { justify-content: center; }
  .interactive-browser .section-heading { align-items: flex-start; flex-direction: column; }
  .interactive-url-form .url-bar { flex-direction: column; }
  .interactive-url-form .url-bar input { height: 48px; }
  .interactive-session-meta { display: grid; }
  .interactive-viewport { max-height: 55vh; }
}
