:root {
  color-scheme: dark;
  --bg: #080d17;
  --bg-soft: #0d1422;
  --panel: rgba(20, 30, 48, .86);
  --panel-solid: #141e30;
  --panel-raised: #1a2740;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .28);
  --txt: #f7f9fc;
  --muted: #94a3b8;
  --accent: #6c7cff;
  --accent-2: #32d6c5;
  --accent-soft: rgba(108, 124, 255, .14);
  --good: #31d19c;
  --bad: #ff667a;
  --warning: #f8bd55;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--txt);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(108,124,255,.18), transparent 31rem),
    radial-gradient(circle at 94% 0%, rgba(50,214,197,.10), transparent 25rem),
    var(--bg);
}

button, input, select { font: inherit; }
a { color: #96a3ff; text-decoration: none; }
a:hover { color: #bac2ff; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.muted { color: var(--muted); }
small { font-size: .76em; color: var(--muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 23, .82);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--txt); font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { color: var(--txt); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { margin-top: 3px; font-size: 9px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  color: white;
  background: linear-gradient(145deg, var(--accent), #5362dc 55%, #3442b9);
  box-shadow: 0 8px 24px rgba(83,98,220,.35);
}
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav > a:not(.btn) { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.topbar nav > a:not(.btn):hover { color: var(--txt); background: rgba(255,255,255,.05); }
.topbar nav > a.nav-log { display: inline-flex; align-items: center; gap: 7px; color: #dce2ff; border: 1px solid rgba(108,124,255,.24); background: rgba(108,124,255,.09); }
.nav-log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(50,214,197,.09); }
.notification-bell { position: relative; display: grid !important; width: 38px; height: 38px; padding: 8px !important; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px !important; background: rgba(255,255,255,.035); }
.notification-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-count { position: absolute; top: -7px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid var(--bg); border-radius: 10px; color: white; background: var(--bad); font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
.topbar .user { margin: 0 4px 0 8px; padding-left: 13px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.client-switch { margin-right: 8px; }
.client-switch label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.client-switch select { max-width: 220px; }

.container { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 38px 0 72px; }
h1 { margin: 0 0 22px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.018em; }
p { margin: 7px 0 15px; }
.crumbs { margin-bottom: 10px; color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: white;
  background: linear-gradient(135deg, #7180ff, #5665e8);
  box-shadow: 0 7px 18px rgba(86,101,232,.20);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.btn:hover { color: white; filter: brightness(1.08); transform: translateY(-1px); }
.btn.sm { min-height: 31px; padding: 6px 11px; font-size: 11px; }
.btn.xs { min-height: 28px; padding: 4px 9px; border-color: var(--line); background: rgba(255,255,255,.045); box-shadow: none; color: #cad3e2; }
.btn.danger { color: #ff9aaa; border-color: rgba(255,102,122,.22); }
.btn.ghost { border-color: var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.btn.disabled { opacity: .4; pointer-events: none; }

input, select {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  color: var(--txt);
  background: rgba(5, 10, 19, .65);
}
textarea { width: 100%; margin-top: 4px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; resize: vertical; color: var(--txt); background: rgba(5,10,19,.65); font: inherit; }
textarea:focus { border-color: rgba(108,124,255,.75); box-shadow: 0 0 0 3px rgba(108,124,255,.12); }
input:focus, select:focus { border-color: rgba(108,124,255,.75); box-shadow: 0 0 0 3px rgba(108,124,255,.12); }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.card, .stat {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24,35,56,.92), rgba(16,25,41,.92));
  box-shadow: var(--shadow);
}
.stat { position: relative; min-height: 100px; padding: 18px; border-radius: 13px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.stat::after { content: ""; position: absolute; right: -24px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft); }
.stat .n { display: block; margin-bottom: 4px; color: var(--txt); font-size: 25px; font-weight: 760; letter-spacing: -.03em; text-transform: none; }
.stat.bad .n { color: var(--bad); }

.card { margin-bottom: 16px; padding: 22px; border-radius: 14px; }
.card > h2:first-child { margin-top: 0; }
.card pre { padding: 14px; border: 1px solid var(--line); border-radius: 9px; overflow: auto; background: rgba(5,10,19,.6); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card.mini { margin: 0; padding: 16px; }
.card.mini .lbl { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card.mini .val { font-size: 16px; font-weight: 700; }

.grid { width: 100%; border: 1px solid var(--line); border-spacing: 0; border-radius: 14px; overflow: hidden; background: rgba(18,28,45,.82); box-shadow: var(--shadow); }
.grid th, .grid td { padding: 14px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { color: #7f8da5; background: rgba(255,255,255,.025); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.grid tbody tr { transition: background .14s ease; }
.grid tbody tr:hover { background: rgba(108,124,255,.035); }
.grid tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; min-width: 230px; flex-wrap: wrap; gap: 5px; }
.inline { display: inline-flex; margin: 0; }
.policy-value { display: inline-flex; padding: 4px 8px; border: 1px solid rgba(50,214,197,.18); border-radius: 20px; color: #76e8dc; background: rgba(50,214,197,.07); font-size: 11px; font-weight: 700; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(148,163,184,.08); }
.dot.on { background: var(--good); box-shadow: 0 0 0 4px rgba(49,209,156,.10); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,102,122,.10); }

.subnav { display: flex; gap: 5px; margin: 0 0 22px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13,20,34,.8); }
.subnav a { padding: 8px 13px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.subnav a:hover { color: var(--txt); background: rgba(255,255,255,.04); }
.subnav a.on { color: white; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(108,124,255,.22); }
.subnav-filters { margin-left: auto; }
.filterform { display: flex; align-items: center; gap: 6px; }
.filterform input, .filterform select { min-height: 31px; padding: 5px 8px; font-size: 11px; }
.shot-filters { border-color: rgba(108,124,255,.28); background: linear-gradient(145deg,rgba(28,39,65,.95),rgba(14,23,39,.95)); }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.filter-heading h2 { margin: 3px 0 0; font-size: 20px; }
.filter-count { padding: 6px 11px; border: 1px solid rgba(50,214,197,.2); border-radius: 20px; color: var(--accent-2); background: rgba(50,214,197,.07); font-size: 11px; font-weight: 750; }
.filter-grid { display: grid; grid-template-columns: repeat(6,minmax(115px,1fr)); gap: 12px; }
.filter-grid label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.filter-grid input,.filter-grid select { width: 100%; margin-top: 5px; font-size: 12px; letter-spacing: normal; text-transform: none; }
.filter-wide { grid-column: span 3; }
.filter-actions { display: flex; gap: 8px; margin-top: 16px; }
.shot.has-anomaly { border-color: rgba(255,102,122,.45); box-shadow: 0 14px 35px rgba(255,102,122,.10); }
.tag.category { color: #bfc7ff; border-color: rgba(108,124,255,.24); background: rgba(108,124,255,.10); }
.tag.anomaly { color: #ff9aaa; border-color: rgba(255,102,122,.3); background: rgba(255,102,122,.10); }
.notification-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; padding: 18px 20px; border: 1px solid rgba(108,124,255,.24); border-radius: 14px; background: linear-gradient(120deg,rgba(108,124,255,.15),rgba(20,30,48,.9)); box-shadow: var(--shadow); }
.notification-summary > div { min-width: 120px; padding-right: 18px; border-right: 1px solid var(--line); }
.notification-summary strong { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.notification-big { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.notification-summary .btn:first-of-type { margin-left: auto; }
.rules-title { margin-top: 26px; }
.alert-state { display: inline-flex; padding: 4px 8px; border-radius: 20px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.alert-state.new { color: #fff; background: var(--bad); }
.alert-state.read { color: var(--muted); background: rgba(148,163,184,.1); }
.alerts-table tr.alert-unread td { background: rgba(255,102,122,.025); }

.settings-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 16px; padding: 28px; border: 1px solid rgba(108,124,255,.27); border-radius: 16px; background: linear-gradient(120deg, rgba(108,124,255,.18), rgba(20,30,48,.88) 52%, rgba(50,214,197,.08)); box-shadow: var(--shadow); }
.settings-hero h2 { margin: 3px 0 7px; font-size: 24px; }
.settings-hero p { max-width: 690px; margin: 0; color: #a9b5c8; }
.eyebrow { color: #8ee9df; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-value { min-width: 150px; padding-left: 24px; border-left: 1px solid var(--line-strong); text-align: right; }
.hero-value strong { display: block; font-size: 31px; line-height: 1.1; letter-spacing: -.04em; }
.hero-value span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.setting-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.setting-card p { margin-bottom: 0; }
.policy-form { display: flex; align-items: end; gap: 9px; }
.policy-form label { margin: 0; }
.policy-list { margin: 14px -22px -22px; }
.policy-row { display: grid; grid-template-columns: minmax(240px, 1fr) 100px minmax(190px, 230px) auto; gap: 14px; align-items: center; padding: 15px 22px; border-top: 1px solid var(--line); }
.policy-row.retention-row { grid-template-columns: minmax(220px, 1fr) auto minmax(210px, auto) minmax(135px, auto) auto; }
.policy-client { display: flex; align-items: center; gap: 12px; }
.policy-client strong, .policy-client .mono { display: block; }
.policy-client .mono { margin-top: 2px; color: var(--muted); }
.status-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pulse.active { background: var(--good); box-shadow: 0 0 0 5px rgba(49,209,156,.09); }
.policy-effective span, .policy-effective strong { display: block; }
.policy-effective span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.policy-effective strong { margin-top: 2px; }
.notice { display: flex; gap: 14px; margin-top: 16px; padding: 15px 18px; border: 1px solid rgba(50,214,197,.18); border-radius: 11px; color: #b8c5d7; background: rgba(50,214,197,.055); }
.notice strong { color: #77e5da; white-space: nowrap; }

.listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 25px 0 12px; }
.listhead h2 { margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0 4px; }
.pager-info { color: var(--muted); font-size: 12px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; }
.shot { margin: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--panel); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.shot img, .shot .noimg { width: 100%; height: 150px; display: flex; align-items: center; justify-content: center; object-fit: cover; background: #05080e; }
.shot .noimg { color: var(--muted); font-size: 11px; }
.shot figcaption { padding: 10px 12px; font-size: 11px; }
.tag { padding: 2px 6px; border-radius: 5px; color: white; background: var(--bad); font-size: 9px; }
.tag.score { color: #8ef0ce; background: rgba(49,209,156,.13); }
.tag.pending { color: #ffd778; background: rgba(231,180,0,.13); }
.detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.capture-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(280px,.8fr); gap: 16px; align-items: start; }
.capture-image { padding: 8px; background: #05080e; }
.capture-image img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 9px; }
.capture-image .noimg { min-height: 360px; display: grid; place-items: center; color: var(--muted); }
.analysis-panel { border-color: rgba(108,124,255,.3); }
.analysis-panel.good { border-color: rgba(49,209,156,.32); }
.analysis-panel.warn { border-color: rgba(231,180,0,.32); }
.analysis-panel.bad { border-color: rgba(255,102,122,.32); }
.analysis-score { margin: 12px 0 0; font-size: 52px; font-weight: 800; letter-spacing: -.06em; }
.analysis-score small { margin-left: 4px; color: var(--muted); font-size: 17px; letter-spacing: 0; }
.anomaly { display: flex; justify-content: space-between; gap: 16px; margin: 9px 0; padding: 13px 15px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 9px; background: rgba(255,255,255,.025); }
.anomaly strong, .anomaly span { display: block; }
.anomaly span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.severity { display: inline-flex; align-items: center; height: 24px; padding: 3px 8px; border-radius: 20px; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.severity-low, .anomaly.severity-low { border-color: #3b82f6; color: #9ac3ff; }
.severity-medium, .anomaly.severity-medium { border-color: #e7b400; color: #ffda69; }
.severity-high, .anomaly.severity-high { border-color: #f97316; color: #ffb078; }
.severity-critical, .anomaly.severity-critical { border-color: #ff4d68; color: #ff93a4; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(340px,1fr)); gap: 14px; }
.rule-card { margin: 0; }
.rule-card .section-head label { flex: 1; margin-right: 12px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th, .mini-table td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.log-toolbar .filterform { flex-wrap: wrap; }
.log-toolbar input[name=q] { min-width: 260px; }
.auto-refresh { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.log-table-wrap { overflow: auto; border-radius: 14px; }
.log-table { min-width: 1050px; }
.log-table td { font-size: 11px; }
.log-table td:first-child { white-space: nowrap; color: var(--muted); }
.log-table .level-warning { background: rgba(231,180,0,.025); }
.log-table .level-error, .log-table .level-critical { background: rgba(255,102,122,.04); }
.log-level { display: inline-flex; padding: 3px 7px; border-radius: 20px; color: #b9c5d8; background: rgba(148,163,184,.1); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.log-level.warning { color: #ffda69; background: rgba(231,180,0,.12); }
.log-level.error, .log-level.critical { color: #ff93a4; background: rgba(255,102,122,.13); }
.log-level.info { color: #91baff; background: rgba(59,130,246,.12); }
.log-uri, .log-duration { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.log-table details pre { max-width: 470px; max-height: 280px; margin: 7px 0 0; white-space: pre-wrap; word-break: break-word; }
.log-table summary, .card details summary { color: #91baff; cursor: pointer; font-size: 11px; }
.legacy-log { max-height: 390px; margin-top: 12px; white-space: pre-wrap; word-break: break-word; font-size: 10px; line-height: 1.55; }
.log-footer-grid { margin-top: 18px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bar-label { width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.bar { flex: 1; height: 8px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.06); }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-val { width: 75px; color: var(--muted); text-align: right; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 11px; }
.client-identity { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.rename-machine { display: flex; align-items: end; gap: 10px; min-width: min(100%, 430px); }
.rename-machine label { flex: 1; margin: 0; }
.rename-machine .btn { white-space: nowrap; }

form label { display: block; margin: 8px 0; color: var(--muted); font-size: 12px; }
form label input:not([type=checkbox]), form label select { width: 100%; margin-top: 4px; }
form label input[type=checkbox] { margin-right: 7px; vertical-align: middle; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }
.row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.section-head { display: flex; align-items: start; justify-content: space-between; }
.section-head p { margin-bottom: 0; }
.alert { margin-bottom: 16px; padding: 11px 14px; border: 1px solid rgba(49,209,156,.24); border-radius: 10px; color: #95ead0; background: rgba(49,209,156,.08); font-size: 12px; }
.auth { width: min(100%, 390px); max-width: 390px; margin: 8vh auto 0; padding: 28px; }
.auth h1 { text-align: center; }
.auth button { width: 100%; }
.auth-security-note { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.security-shield { display: grid; flex: 0 0 25px; height: 28px; place-items: center; color: white; background: linear-gradient(145deg,var(--accent),#4150c4); clip-path: polygon(50% 0,92% 16%,84% 72%,50% 100%,16% 72%,8% 16%); font-size: 10px; font-weight: 850; }
.captcha-panel { margin: 16px 0; padding: 14px; border: 1px solid rgba(108,124,255,.3); border-radius: 12px; background: rgba(108,124,255,.07); }
.captcha-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 11px; }
.captcha-refresh { width: auto !important; padding: 4px 8px; border: 0; color: #aeb7ff; background: transparent; cursor: pointer; font-size: 10px; }
.captcha-panel img { display: block; width: 100%; height: 82px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; background: #0c1423; }
.captcha-panel input { text-align: center; font: 750 20px/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing: .28em; text-transform: uppercase; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; gap: 14px; }
  .topbar nav { flex-wrap: wrap; justify-content: flex-end; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-wide { grid-column: span 2; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid { display: block; overflow-x: auto; }
  .policy-row { grid-template-columns: 1fr auto; }
  .policy-effective { display: none; }
}

@media (max-width: 640px) {
  .topbar { position: static; flex-direction: column; padding: 14px 18px; }
  .topbar nav { width: 100%; justify-content: flex-start; }
  .topbar .user { display: none; }
  .client-switch { width: 100%; order: 2; }
  .client-switch label, .client-switch select { width: 100%; max-width: none; }
  .container { width: min(100% - 24px, 1180px); padding-top: 25px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 88px; padding: 14px; }
  .subnav { overflow-x: auto; }
  .subnav-filters { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-wide { grid-column: span 1; }
  .notification-summary { align-items: stretch; flex-wrap: wrap; }
  .notification-summary .btn:first-of-type { margin-left: 0; }
  .settings-hero, .setting-card { align-items: stretch; flex-direction: column; }
  .hero-value { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .policy-form { align-items: stretch; flex-direction: column; }
  .policy-row { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .capture-layout { grid-template-columns: 1fr; }
  .log-toolbar { align-items: stretch; flex-direction: column; }
  .log-toolbar input[name=q] { min-width: 0; width: 100%; }
  .notice { flex-direction: column; gap: 3px; }
  .client-identity, .rename-machine { align-items: stretch; flex-direction: column; }
  .rename-machine { min-width: 100%; }
}
.analysis-job{margin-top:12px}.analysis-job-track{height:8px;border-radius:999px;background:rgba(127,127,127,.18);overflow:hidden}.analysis-job-track span{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--accent),var(--good));transition:width .25s ease}.analysis-job-text{display:block;margin-top:7px;font-size:.9rem}
.job-summary{margin-bottom:16px}.job-filters{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.jobs-table td{vertical-align:middle}.jobs-table td small{display:block;margin-top:4px;color:var(--muted)}.job-state{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.job-pending{background:rgba(231,180,0,.16);color:#b88b00}.job-processing{background:rgba(40,125,255,.14);color:var(--accent)}.job-done{background:rgba(22,163,74,.14);color:var(--good)}.job-error{background:rgba(220,38,38,.14);color:var(--bad)}.analysis-job-track.compact{min-width:110px;height:6px}.job-result{max-width:320px}.table-wrap{overflow-x:auto}
.deep-analysis h3{font-size:.86rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:16px 0 4px}.deep-analysis p{margin:0;line-height:1.6}.deep-analysis ul{padding-left:20px}.deep-meta{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.deep-meta span{padding:7px 10px;border-radius:9px;background:rgba(127,127,127,.09)}.diary-controls form{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.diary-controls label{min-width:220px}.diary-tabs{display:flex;gap:8px;margin:18px 0;flex-wrap:wrap}.diary-tabs a{padding:10px 18px;border:1px solid var(--border);border-radius:12px;text-decoration:none;color:var(--muted);font-weight:700}.diary-tabs a.active{background:var(--accent);border-color:var(--accent);color:#fff}.calendar-title{display:flex;align-items:center;justify-content:center;gap:16px;margin:14px 0}.calendar-title h2{margin:0;min-width:230px;text-align:center}.diary-calendar{display:grid;grid-template-columns:repeat(7,minmax(100px,1fr));gap:8px}.cal-weekday{text-align:center;color:var(--muted);font-size:.8rem;font-weight:800;padding:5px}.cal-day{min-height:112px;padding:11px;border:1px solid var(--border);border-radius:14px;background:var(--card);text-decoration:none;color:var(--text);display:flex;flex-direction:column;gap:6px}.cal-day:hover{transform:translateY(-2px);border-color:var(--accent)}.cal-day b{font-size:1.05rem}.cal-day span{font-size:.78rem;color:var(--muted)}.cal-day strong{font-size:.9rem}.cal-day i{font-size:.68rem;text-transform:uppercase;color:var(--accent);font-style:normal;font-weight:800}.cal-day.good{box-shadow:inset 0 3px 0 var(--good)}.cal-day.warn{box-shadow:inset 0 3px 0 #e7b400}.cal-day.bad{box-shadow:inset 0 3px 0 var(--bad)}.cal-day.empty{background:transparent;border-style:dashed;opacity:.3}.diary-generate{margin-bottom:16px}.diary-summary{font-size:1.06rem;line-height:1.75}.diary-list{padding-left:20px}.diary-list li{margin:0 0 10px;line-height:1.5}@media(max-width:800px){.diary-calendar{grid-template-columns:repeat(7,minmax(42px,1fr));gap:4px}.cal-day{min-height:75px;padding:6px}.cal-day span,.cal-day strong{display:none}.cal-weekday{font-size:.68rem;padding:2px}.diary-controls label{min-width:100%}}
.hypothesis-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px}.hypothesis-head h3{margin:0}.hypothesis-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin:12px 0}.hypothesis-card{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--border);border-radius:13px;background:rgba(127,127,127,.035);cursor:pointer}.hypothesis-card.selected{border-color:var(--accent);box-shadow:0 0 0 2px rgba(40,125,255,.12)}.hypothesis-card input{width:auto;align-self:flex-start}.hypothesis-title{display:flex;justify-content:space-between;gap:10px}.hypothesis-title b{color:var(--accent)}.hypothesis-card small{color:var(--muted);font-weight:700}.hypothesis-card ul{margin:2px 0 0}.text-observations{display:grid;gap:10px;margin-top:10px}.text-observations>div{padding:12px;border-radius:11px;background:rgba(127,127,127,.06)}.text-observations p{margin:7px 0}.text-observations small{color:var(--muted)}.privacy-note{margin-top:10px!important}
.prompt-card{margin-bottom:18px}.prompt-card textarea{width:100%;min-height:150px;margin:12px 0;padding:14px;resize:vertical;border:1px solid var(--border);border-radius:12px;background:#0c1528;color:#dce8ff;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace}.prompt-card textarea:focus{outline:2px solid rgba(55,130,255,.35);border-color:var(--accent)}.prompt-vars{margin:10px 0;color:var(--muted)}.prompt-vars code{display:inline-block;margin:3px 2px;padding:3px 7px;border-radius:7px;background:#14213b;color:#9fc1ff}.pill.warn{background:#3a2c12;color:#ffd681;border-color:#6d501b}
.topbar nav > a.nav-health{display:inline-flex;align-items:center;gap:7px}.nav-health-dot{width:7px;height:7px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px rgba(49,209,156,.09)}
.health-hero{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:16px;padding:28px;border:1px solid rgba(49,209,156,.26);border-radius:18px;background:linear-gradient(120deg,rgba(49,209,156,.14),rgba(20,30,48,.94) 50%,rgba(108,124,255,.1));box-shadow:var(--shadow)}.health-hero-warning{border-color:rgba(248,189,85,.38);background:linear-gradient(120deg,rgba(248,189,85,.13),rgba(20,30,48,.94) 50%,rgba(108,124,255,.08))}.health-hero-critical{border-color:rgba(255,102,122,.42);background:linear-gradient(120deg,rgba(255,102,122,.14),rgba(20,30,48,.94) 50%,rgba(108,124,255,.08))}.health-hero h1{margin:3px 0 7px}.health-hero p{max-width:700px;margin:0;color:#a9b5c8}.health-kicker{color:var(--accent-2);font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.health-overall{display:flex;min-width:180px;align-items:flex-end;flex-direction:column;gap:9px}.health-overall small{white-space:nowrap}
.health-pill{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid var(--line);border-radius:999px;color:var(--muted);background:rgba(148,163,184,.08);font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.health-pill i{width:7px;height:7px;border-radius:50%;background:currentColor}.health-ok{color:#75e9c2;border-color:rgba(49,209,156,.24);background:rgba(49,209,156,.1)}.health-running{color:#aeb7ff;border-color:rgba(108,124,255,.26);background:rgba(108,124,255,.1)}.health-warning{color:#ffd778;border-color:rgba(248,189,85,.25);background:rgba(248,189,85,.1)}.health-critical{color:#ff9aaa;border-color:rgba(255,102,122,.27);background:rgba(255,102,122,.1)}
.health-issues,.health-clear{margin-bottom:16px;padding:17px 20px;border:1px solid rgba(248,189,85,.28);border-radius:14px;background:rgba(248,189,85,.07)}.health-issues>strong{font-size:12px;letter-spacing:.05em;text-transform:uppercase}.health-issues ul{display:grid;gap:8px;margin:11px 0 0;padding:0;list-style:none}.health-issues li{display:flex;align-items:center;gap:9px;color:#d8dfeb;font-size:12px}.health-issues li span{width:7px;height:7px;border-radius:50%;background:var(--warning)}.health-issues li.health-issue-critical span{background:var(--bad)}.health-clear{display:flex;align-items:center;gap:12px;border-color:rgba(49,209,156,.24);background:rgba(49,209,156,.07)}.health-clear>span{display:grid;width:30px;height:30px;place-items:center;border-radius:50%;color:#07130e;background:var(--good);font-weight:900}.health-clear strong,.health-clear small{display:block}
.health-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.health-card{padding:18px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(145deg,rgba(24,35,56,.92),rgba(16,25,41,.92));box-shadow:var(--shadow)}.health-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.health-card-head>span{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.health-card>strong{display:block;min-height:26px;margin-bottom:12px;font-size:18px}.health-card dl{margin:0}.health-card dl>div{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:6px 0;border-top:1px solid var(--line)}.health-card dt{color:var(--muted);font-size:11px}.health-card dd{max-width:65%;margin:0;text-align:right;font-size:11px;font-weight:700;word-break:break-word}.health-model{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px!important}.health-footnote{display:block;margin-top:10px;line-height:1.4}
.health-architecture{display:flex;align-items:center;gap:22px;margin:24px 0;padding:24px;border:1px solid rgba(108,124,255,.28);border-radius:16px;background:linear-gradient(120deg,rgba(108,124,255,.12),rgba(20,30,48,.9));box-shadow:var(--shadow)}.health-architecture-mark{display:grid;flex:0 0 60px;height:60px;place-items:center;border-radius:17px;color:#fff;background:linear-gradient(145deg,var(--accent),#4554c4);font-size:17px;font-weight:850;box-shadow:0 10px 28px rgba(83,98,220,.28)}.health-architecture h2{margin:3px 0 5px}.health-architecture p{margin:0;color:#a9b5c8}.health-architecture code,.health-table code{color:#bfc7ff;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}
.health-section-head{align-items:flex-end;margin:28px 0 12px}.health-section-head h2{margin-bottom:3px}.health-section-head p{margin:0}.health-section-head>span{color:var(--muted);font-size:11px}.health-table{min-width:1160px}.health-table td small,.health-table td span:not(.health-pill){display:block;margin-top:4px;color:var(--muted);font-size:10px}.health-table td>strong{display:block}.health-table code{white-space:nowrap}.health-links{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:20px}.health-links a{display:flex;padding:17px 19px;border:1px solid var(--line);border-radius:13px;flex-direction:column;color:var(--txt);background:rgba(20,30,48,.72)}.health-links a:hover{border-color:rgba(108,124,255,.45);transform:translateY(-1px)}.health-links span{margin-top:4px;color:var(--muted);font-size:11px}
@media(max-width:900px){.health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.health-links{grid-template-columns:1fr}.health-hero{align-items:flex-start}.health-overall{min-width:150px}}
@media(max-width:640px){.health-hero{align-items:stretch;flex-direction:column}.health-overall{align-items:flex-start}.health-grid{grid-template-columns:1fr}.health-architecture{align-items:flex-start;flex-direction:column}}
.search-hero{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:16px;padding:28px;border:1px solid rgba(108,124,255,.3);border-radius:18px;background:linear-gradient(120deg,rgba(108,124,255,.17),rgba(20,30,48,.94) 54%,rgba(50,214,197,.09));box-shadow:var(--shadow)}.search-hero h1{margin:3px 0 7px}.search-hero p{max-width:720px;margin:0;color:#a9b5c8}.search-index-state{min-width:150px;padding-left:24px;border-left:1px solid var(--line);text-align:right}.search-index-state strong,.search-index-state span{display:block}.search-index-state strong{font-size:25px}.search-index-state span{color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.07em;text-transform:uppercase}
.global-search-form{border-color:rgba(108,124,255,.27)}.global-search-query{margin:0 0 16px!important;color:#dce3ef!important;font-size:13px!important;font-weight:750}.global-search-query input{height:52px!important;padding:12px 15px!important;border-color:rgba(108,124,255,.42)!important;font-size:16px!important}.global-search-filters{display:grid;grid-template-columns:1.4fr repeat(4,minmax(120px,1fr));gap:12px}.global-search-filters label{margin:0}.global-search-actions{display:flex;align-items:center;gap:9px;margin-top:16px}.global-search-actions small{margin-left:auto}.search-results-head{align-items:flex-end;margin:28px 0 12px}.search-results-head h2{margin-bottom:3px}.search-results-head p{margin:0}.search-results-head>span{color:var(--accent-2);font-size:12px;font-weight:750}
.search-intro-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:20px}.search-intro-grid .card{margin:0}.search-intro-icon{display:grid;width:40px;height:40px;margin-bottom:15px;place-items:center;border:1px solid rgba(108,124,255,.25);border-radius:12px;color:#c4cbff;background:rgba(108,124,255,.12);font-size:12px;font-weight:850}.global-search-results{display:grid;gap:10px}.global-search-result{display:grid;grid-template-columns:95px minmax(0,1fr) 155px;gap:18px;align-items:center;padding:17px 19px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:14px;background:linear-gradient(145deg,rgba(24,35,56,.9),rgba(16,25,41,.9));box-shadow:0 10px 30px rgba(0,0,0,.18)}.global-search-result.has-anomaly{border-left-color:var(--bad)}.search-result-time{padding-right:16px;border-right:1px solid var(--line)}.search-result-time strong,.search-result-time span{display:block}.search-result-time span{margin-top:3px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}.search-result-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-bottom:5px}.search-machine{padding:3px 7px;border-radius:6px;color:#bfc7ff;background:rgba(108,124,255,.11);font-size:10px;font-weight:750}.search-result-body h3{margin:0 0 4px;font-size:15px}.search-result-body p{margin:0 0 5px;color:#d4dce8;line-height:1.5}.search-result-body>small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-result-action{display:flex;align-items:flex-end;flex-direction:column;gap:6px}.search-result-action>strong{font-size:20px}.search-result-action>strong small{font-size:10px}.search-result-action>span{color:var(--muted);font-size:9px;text-transform:uppercase}.search-empty{text-align:center}.search-limit-note{text-align:center}
@media(max-width:900px){.global-search-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.global-search-result{grid-template-columns:80px minmax(0,1fr)}.search-result-action{grid-column:2;align-items:center;flex-direction:row}.search-intro-grid{grid-template-columns:1fr}.global-search-actions{align-items:flex-start;flex-wrap:wrap}.global-search-actions small{width:100%;margin-left:0}}
@media(max-width:640px){.search-hero{align-items:stretch;flex-direction:column}.search-index-state{padding:12px 0 0;border-top:1px solid var(--line);border-left:0;text-align:left}.global-search-filters{grid-template-columns:1fr}.global-search-result{grid-template-columns:1fr}.search-result-time{display:flex;gap:8px;padding:0;border:0}.search-result-time span{margin:0}.search-result-action{grid-column:1;align-items:center;justify-content:space-between;flex-direction:row}}
