:root {
  color-scheme: dark;
  --ink: #f3f7f4;
  --ink-soft: #b5c0ba;
  --ink-faint: #79857f;
  --void: #050a09;
  --forest-950: #07110f;
  --forest-900: #0a1714;
  --forest-850: #0e1d19;
  --forest-800: #12251f;
  --forest-700: #1a342b;
  --line: rgba(213, 234, 220, 0.12);
  --line-strong: rgba(213, 234, 220, 0.2);
  --lime: #c9ff4a;
  --lime-strong: #adf01e;
  --lime-soft: rgba(201, 255, 74, 0.12);
  --mint: #57e3a6;
  --amber: #ffca66;
  --red: #ff7c73;
  --blue: #7eb8ff;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--forest-950); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--forest-950); font-family: var(--font); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.035em; line-height: 1.08; }
h1 { font-size: clamp(2.8rem, 5.5vw, 5.8rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); }
h3 { font-size: 1.06rem; letter-spacing: -0.01em; }
strong { font-weight: 650; }
em { color: var(--lime); font-style: normal; font-weight: 560; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 9px 14px; color: var(--forest-950); background: var(--lime); border-radius: var(--radius-sm); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mobile-only, .mobile-brand { display: none; }
.muted { color: var(--ink-soft); }
.fine-print { color: var(--ink-faint); font-size: 0.78rem; }
.mono { font-family: var(--mono); font-size: 0.84em; letter-spacing: -0.02em; }
.eyebrow { margin-bottom: 12px; color: var(--lime); font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px var(--lime-soft); }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 0.94rem; letter-spacing: -0.025em; text-decoration: none; }
.brand--large { position: absolute; top: 40px; left: 48px; font-size: 1rem; }
.brand-mark { position: relative; display: inline-flex; width: 31px; height: 34px; align-items: center; justify-content: center; background: var(--lime); clip-path: polygon(50% 0, 94% 19%, 89% 72%, 50% 100%, 11% 72%, 6% 19%); }
.brand-mark::before, .brand-mark::after, .brand-mark span { position: absolute; width: 14px; height: 2px; border-radius: 9px; background: var(--forest-950); content: ""; }
.brand-mark::before { transform: translateY(-5px); }
.brand-mark::after { transform: translateY(5px); }

/* Authentication */
.login-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr); background: var(--forest-950); }
.login-story { position: relative; display: flex; min-height: 100vh; padding: 150px 9vw 52px 48px; overflow: hidden; flex-direction: column; justify-content: center; background: radial-gradient(circle at 10% 85%, rgba(88, 191, 121, 0.16), transparent 32%), linear-gradient(145deg, #0a1915 0%, #0d241d 68%, #0b1714 100%); border-right: 1px solid var(--line); }
.login-story::before { position: absolute; width: 620px; height: 620px; right: -250px; top: -230px; border: 1px solid rgba(201, 255, 74, 0.08); border-radius: 50%; box-shadow: 0 0 0 80px rgba(201, 255, 74, 0.025), 0 0 0 160px rgba(201, 255, 74, 0.018); content: ""; }
.story-copy { position: relative; z-index: 1; max-width: 760px; }
.story-copy h1 { max-width: 820px; margin-bottom: 28px; font-weight: 420; }
.story-copy > p:last-child { max-width: 590px; color: var(--ink-soft); font-size: 1.08rem; line-height: 1.7; }
.signal-card { width: min(470px, 83%); margin-top: 44px; padding: 19px 20px 17px; background: rgba(5, 15, 12, 0.55); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.signal-card__header { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 0.78rem; }
.signal-visual { display: flex; height: 70px; margin: 22px 0 15px; align-items: center; gap: 9px; }
.signal-visual span { width: 3px; min-height: 10px; flex: 1; border-radius: 4px; background: linear-gradient(to top, rgba(201, 255, 74, 0.22), var(--lime)); box-shadow: 0 0 15px rgba(201, 255, 74, 0.08); }
.signal-visual span:nth-child(1) { height: 24%; } .signal-visual span:nth-child(2) { height: 39%; } .signal-visual span:nth-child(3) { height: 30%; }
.signal-visual span:nth-child(4) { height: 68%; } .signal-visual span:nth-child(5) { height: 48%; } .signal-visual span:nth-child(6) { height: 82%; }
.signal-visual span:nth-child(7) { height: 54%; } .signal-visual span:nth-child(8) { height: 32%; } .signal-visual span:nth-child(9) { height: 45%; }
.signal-visual span:nth-child(10) { height: 29%; } .signal-visual span:nth-child(11) { height: 22%; }
.signal-card > p { margin: 0; color: var(--ink-soft); font-size: 0.77rem; }
.signal-card > p strong { color: var(--lime); }
.story-foot { position: absolute; left: 48px; bottom: 28px; margin: 0; color: var(--ink-faint); font-family: var(--mono); font-size: 0.7rem; }
.login-panel { display: flex; min-height: 100vh; padding: 40px; align-items: center; justify-content: center; background: #f0f2ed; color: #101713; }
.login-box { width: min(390px, 100%); }
.login-panel .eyebrow { color: #64851c; }
.login-panel h2 { margin-bottom: 9px; font-size: 2.4rem; }
.login-panel .muted { margin-bottom: 35px; color: #657069; }
.form-stack { display: grid; gap: 20px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field label, .field-label { color: inherit; font-size: 0.78rem; font-weight: 650; }
.field small { color: var(--ink-faint); }
input, select, textarea { width: 100%; padding: 11px 12px; background: var(--forest-900); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none; transition: border-color 0.16s, box-shadow 0.16s; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: rgba(213, 234, 220, 0.32); }
input:focus, select:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
input::placeholder, textarea::placeholder { color: #66736c; }
.login-panel input { padding: 13px 14px; color: #101713; background: #fff; border-color: #ccd2cc; }
.login-panel input:focus { border-color: #7c9e2b; box-shadow: 0 0 0 3px rgba(124, 158, 43, 0.13); }
.login-panel input::placeholder { color: #8a938e; }
.input-action { position: relative; }
.input-action input { padding-right: 66px; }
.input-action .icon-button { position: absolute; right: 5px; top: 5px; color: #526058; }
.form-error { margin: -5px 0 0; padding: 10px 12px; color: #8e2019; background: #ffe6e3; border-left: 3px solid #c23b31; border-radius: 5px; font-size: 0.82rem; }
.security-note { display: flex; margin-top: 28px; padding-top: 22px; align-items: flex-start; gap: 10px; color: #69736d; border-top: 1px solid #d7dcd7; font-size: 0.74rem; }
.security-note p { margin: 0; }

/* Shell */
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 242px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 30; top: 0; display: flex; height: 100vh; padding: 23px 16px 18px; flex-direction: column; background: #07100e; border-right: 1px solid var(--line); }
.sidebar-head { display: flex; min-height: 50px; padding: 0 8px; align-items: flex-start; justify-content: space-between; }
.sidebar nav { display: flex; margin-top: 26px; flex: 1; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label { margin: 19px 10px 7px; color: #65736c; font-family: var(--mono); font-size: 0.63rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.sidebar nav a { position: relative; display: flex; padding: 9px 10px; align-items: center; gap: 11px; color: #9eaaa4; border: 1px solid transparent; border-radius: 7px; font-size: 0.81rem; font-weight: 540; text-decoration: none; }
.sidebar nav a > span:first-child { width: 18px; color: #77867f; text-align: center; }
.sidebar nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.035); }
.sidebar nav a.active { color: var(--ink); background: var(--lime-soft); border-color: rgba(201, 255, 74, 0.15); }
.sidebar nav a.active > span:first-child { color: var(--lime); }
.nav-count { margin-left: auto; padding: 0 6px; color: var(--forest-950); background: var(--amber); border-radius: 9px; font-family: var(--mono); font-size: 0.63rem; font-weight: 800; }
.live-dot { width: 6px !important; height: 6px; margin-left: auto; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 3px var(--lime-soft); }
.sidebar-foot { padding: 12px 4px 0; border-top: 1px solid var(--line); }
.system-mini { display: flex; padding: 8px; align-items: center; gap: 10px; }
.system-mini > div { display: grid; }
.system-mini strong { font-size: 0.72rem; }
.system-mini small { color: var(--ink-faint); font-size: 0.65rem; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; background: var(--ink-faint); border-radius: 50%; }
.status-dot.online { background: var(--mint); box-shadow: 0 0 0 4px rgba(87, 227, 166, 0.1); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 124, 115, 0.1); }
.logout-button { width: 100%; margin-top: 5px; padding: 8px 10px; color: var(--ink-faint); background: transparent; border: 0; border-radius: 7px; text-align: left; }
.logout-button:hover { color: var(--ink); background: rgba(255,255,255,.035); }

.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 68px; padding: 0 28px; align-items: center; justify-content: space-between; background: rgba(7, 17, 15, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-size: 0.75rem; }
.breadcrumb strong { color: var(--ink-soft); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 11px; }
.connection-state { display: flex; padding: 5px 9px; align-items: center; gap: 7px; color: var(--ink-faint); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 20px; font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; }
.connection-state span { width: 6px; height: 6px; background: var(--ink-faint); border-radius: 50%; }
.connection-state.connected { color: var(--mint); }
.connection-state.connected span { background: var(--mint); box-shadow: 0 0 0 3px rgba(87,227,166,.1); }
.connection-state.connecting { color: var(--amber); }
.connection-state.connecting span { background: var(--amber); }
.icon-button { display: inline-flex; min-width: 34px; min-height: 34px; padding: 7px 9px; align-items: center; justify-content: center; color: var(--ink-soft); background: transparent; border: 1px solid transparent; border-radius: 7px; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.05); border-color: var(--line); }
.account-button { display: flex; padding: 3px 7px 3px 3px; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 9px; }
.account-button:hover { background: rgba(255,255,255,.04); border-color: var(--line); }
.avatar { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; color: var(--forest-950); background: var(--lime); border-radius: 8px; font-family: var(--mono); font-size: 0.7rem; font-weight: 800; }
.account-copy { display: grid; min-width: 105px; text-align: left; }
.account-copy strong { max-width: 150px; overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--ink-faint); font-size: 0.62rem; }
.account-menu { position: absolute; top: 49px; right: 0; width: 230px; padding: 10px; background: var(--forest-850); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.account-menu p { padding: 7px 8px 11px; margin: 0 0 5px; overflow: hidden; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 0.73rem; text-overflow: ellipsis; }
.account-menu button { width: 100%; padding: 8px; color: var(--red); background: transparent; border: 0; border-radius: 6px; text-align: left; }
.account-menu button:hover { background: rgba(255,124,115,.08); }
.main-content { width: 100%; min-height: calc(100vh - 68px); padding: 34px clamp(20px, 3.2vw, 48px) 70px; background: radial-gradient(circle at 92% 0, rgba(46, 105, 80, 0.12), transparent 30%), var(--forest-950); }
.page { width: min(1500px, 100%); margin: 0 auto; animation: page-in 0.18s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; margin-bottom: 27px; align-items: flex-end; justify-content: space-between; gap: 22px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(2rem, 3.8vw, 3.25rem); font-weight: 470; }
.page-head p { max-width: 670px; margin: 0; color: var(--ink-soft); }
.page-actions { display: flex; align-items: center; gap: 9px; }

/* Shared components */
.button { display: inline-flex; min-height: 39px; padding: 8px 14px; align-items: center; justify-content: center; gap: 9px; background: var(--forest-800); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 640; text-decoration: none; transition: transform .13s, background .13s, border-color .13s; }
.button:hover:not(:disabled) { background: var(--forest-700); border-color: rgba(213,234,220,.32); transform: translateY(-1px); }
.button--primary { color: var(--forest-950); background: var(--lime); border-color: var(--lime); }
.button--primary:hover:not(:disabled) { background: var(--lime-strong); border-color: var(--lime-strong); }
.button--danger { color: var(--red); background: rgba(255,124,115,.07); border-color: rgba(255,124,115,.2); }
.button--ghost { background: transparent; }
.button--small { min-height: 31px; padding: 5px 10px; font-size: .74rem; }
.button--wide { width: 100%; justify-content: space-between; }
.button .spinner { width: 14px; height: 14px; border-width: 2px; }
.card { min-width: 0; background: rgba(13, 29, 25, 0.82); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255,255,255,.015); }
.card-header { display: flex; min-height: 60px; padding: 16px 19px; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: .92rem; letter-spacing: -.01em; }
.card-header p { margin: 3px 0 0; color: var(--ink-faint); font-size: .7rem; }
.card-body { padding: 19px; }
.card-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid { display: grid; margin-bottom: 15px; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { position: relative; min-height: 137px; padding: 17px 18px; overflow: hidden; }
.metric-card::after { position: absolute; width: 90px; height: 90px; right: -45px; top: -45px; background: var(--metric-color, var(--lime)); border-radius: 50%; filter: blur(42px); opacity: .12; content: ""; }
.metric-card--mint { --metric-color: var(--mint); } .metric-card--lime { --metric-color: var(--lime); }
.metric-card--amber { --metric-color: var(--amber); } .metric-card--blue { --metric-color: var(--blue); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .72rem; }
.metric-icon { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; color: var(--metric-color, var(--lime)); background: color-mix(in srgb, var(--metric-color, var(--lime)) 9%, transparent); border: 1px solid color-mix(in srgb, var(--metric-color, var(--lime)) 20%, transparent); border-radius: 7px; }
.metric-value { margin: 16px 0 7px; font-family: var(--mono); font-size: 2rem; font-weight: 600; letter-spacing: -.06em; line-height: 1; }
.metric-meta { margin: 0; color: var(--ink-faint); font-size: .67rem; }
.metric-meta strong { color: var(--mint); }
.overview-grid { display: grid; gap: 15px; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .8fr); }
.chart { display: flex; min-height: 245px; padding-top: 12px; align-items: end; gap: clamp(4px, 1vw, 12px); }
.chart-column { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: flex-end; }
.chart-bars { display: flex; height: 190px; align-items: end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.chart-bar { width: min(9px, 40%); min-height: 2px; background: var(--lime); border-radius: 2px 2px 0 0; opacity: .76; }
.chart-bar.secondary { background: var(--mint); opacity: .42; }
.height-0 { height: 2%; } .height-5 { height: 5%; } .height-10 { height: 10%; } .height-15 { height: 15%; } .height-20 { height: 20%; }
.height-25 { height: 25%; } .height-30 { height: 30%; } .height-35 { height: 35%; } .height-40 { height: 40%; } .height-45 { height: 45%; }
.height-50 { height: 50%; } .height-55 { height: 55%; } .height-60 { height: 60%; } .height-65 { height: 65%; } .height-70 { height: 70%; }
.height-75 { height: 75%; } .height-80 { height: 80%; } .height-85 { height: 85%; } .height-90 { height: 90%; } .height-95 { height: 95%; } .height-100 { height: 100%; }
.chart-label { margin-top: 9px; overflow: hidden; color: var(--ink-faint); font-family: var(--mono); font-size: .57rem; text-align: center; text-overflow: clip; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--ink-faint); font-size: .64rem; }
.legend span::before { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: var(--lime); border-radius: 50%; content: ""; }
.legend span:nth-child(2)::before { background: var(--mint); }
.activity-list, .event-list { display: grid; margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; padding: 13px 0; align-items: start; gap: 11px; grid-template-columns: 26px minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-symbol { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; color: var(--lime); background: var(--lime-soft); border-radius: 6px; font-size: .68rem; }
.activity-copy strong { display: block; overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy p { margin: 3px 0 0; overflow: hidden; color: var(--ink-faint); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-item time { color: var(--ink-faint); font-family: var(--mono); font-size: .6rem; white-space: nowrap; }
.status-chip, .risk-badge { display: inline-flex; width: fit-content; padding: 3px 7px; align-items: center; gap: 5px; border-radius: 10px; font-family: var(--mono); font-size: .59rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.status-chip::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; content: ""; }
.status-chip--online, .risk-low { color: var(--mint); background: rgba(87,227,166,.09); border: 1px solid rgba(87,227,166,.17); }
.status-chip--paused, .risk-medium { color: var(--amber); background: rgba(255,202,102,.09); border: 1px solid rgba(255,202,102,.17); }
.status-chip--error, .risk-high, .risk-critical { color: var(--red); background: rgba(255,124,115,.09); border: 1px solid rgba(255,124,115,.17); }
.status-chip--stopped, .status-chip--neutral { color: var(--ink-soft); background: rgba(181,192,186,.07); border: 1px solid var(--line); }
.risk-critical { box-shadow: inset 0 0 0 1px rgba(255,124,115,.2); }
.risk-score { font-family: var(--mono); font-size: .78rem; font-weight: 700; }
.progress { width: 100%; height: 5px; overflow: hidden; appearance: none; background: rgba(255,255,255,.05); border: 0; border-radius: 5px; }
.progress::-webkit-progress-bar { background: rgba(255,255,255,.05); border-radius: 5px; }
.progress::-webkit-progress-value { background: var(--lime); border-radius: 5px; }
.progress::-moz-progress-bar { background: var(--lime); border-radius: 5px; }
.inline-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-faint); font-size: .68rem; }

.toolbar { display: flex; margin-bottom: 14px; padding: 11px; flex-wrap: wrap; align-items: end; gap: 9px; background: rgba(13,29,25,.68); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .field { min-width: 145px; flex: 0 1 190px; }
.toolbar .field--search { min-width: 220px; flex: 1; }
.toolbar label { font-size: .65rem; }
.toolbar input, .toolbar select { min-height: 36px; padding: 7px 9px; font-size: .74rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; color: var(--ink-faint); background: rgba(255,255,255,.018); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .59rem; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: .72rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.018); }
td strong { color: var(--ink); }
.row-button { padding: 0; color: var(--ink); background: transparent; border: 0; font-weight: 650; text-align: left; }
.row-button:hover { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }
.pagination { display: flex; padding: 13px 15px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.pagination p { margin: 0; color: var(--ink-faint); font-size: .68rem; }

.empty-state { display: grid; min-height: 230px; padding: 35px 20px; place-items: center; text-align: center; }
.empty-state > div { max-width: 390px; }
.empty-icon { display: inline-flex; width: 48px; height: 48px; margin-bottom: 16px; align-items: center; justify-content: center; color: var(--lime); background: var(--lime-soft); border: 1px solid rgba(201,255,74,.14); border-radius: 13px; font-size: 1.2rem; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { color: var(--ink-faint); font-size: .73rem; }
.error-state { border-color: rgba(255,124,115,.2); }
.error-state .empty-icon { color: var(--red); background: rgba(255,124,115,.08); border-color: rgba(255,124,115,.18); }
.loading-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.skeleton { position: relative; height: 130px; overflow: hidden; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--radius); }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; content: ""; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line-strong); border-top-color: var(--lime); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scan and detail */
.scan-layout { display: grid; align-items: start; gap: 15px; grid-template-columns: minmax(360px, .85fr) minmax(420px, 1.15fr); }
.scan-form textarea { min-height: 250px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section { padding: 18px 19px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { margin-bottom: 15px; }
.check-grid { display: grid; gap: 9px; }
.check-row { display: flex; padding: 8px 9px; align-items: flex-start; gap: 9px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 7px; }
.check-row input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--lime); }
.check-row span { display: grid; }
.check-row strong { font-size: .72rem; }
.check-row small { color: var(--ink-faint); font-size: .64rem; }
.character-count { display: flex; margin-top: 6px; justify-content: space-between; color: var(--ink-faint); font-family: var(--mono); font-size: .61rem; }
.result-placeholder { display: grid; min-height: 560px; padding: 40px; place-items: center; color: var(--ink-faint); text-align: center; }
.result-score { display: grid; margin-bottom: 15px; padding: 24px; align-items: center; gap: 25px; grid-template-columns: 120px minmax(0, 1fr); background: linear-gradient(135deg, var(--lime-soft), transparent 70%); border-bottom: 1px solid var(--line); }
.score-ring { display: grid; width: 112px; height: 112px; place-items: center; background: var(--lime-soft); border: 7px solid var(--lime); border-radius: 50%; box-shadow: inset 0 0 30px rgba(201,255,74,.08); }
.score-ring::before { position: absolute; width: 88px; height: 88px; background: var(--forest-850); border-radius: 50%; content: ""; }
.score-ring span { z-index: 1; font-family: var(--mono); font-size: 1.55rem; font-weight: 700; }
.result-score h2 { margin: 9px 0 7px; }
.result-score p { color: var(--ink-soft); }
.score-trio { display: grid; margin-top: 14px; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.score-trio > div { padding: 9px; background: rgba(0,0,0,.15); border: 1px solid var(--line); border-radius: 7px; }
.score-trio small { display: block; color: var(--ink-faint); font-size: .58rem; text-transform: uppercase; }
.score-trio strong { font-family: var(--mono); font-size: .78rem; }
.vector-list { display: grid; gap: 9px; }
.vector-card { padding: 12px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 8px; }
.vector-card header { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; gap: 10px; }
.vector-card h4 { margin: 0; font-size: .73rem; }
.vector-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: .68rem; }
.vector-card .progress { margin-top: 9px; }
.evidence { margin-top: 8px; padding-top: 8px; color: var(--ink-faint); border-top: 1px dashed var(--line); font-family: var(--mono); font-size: .6rem; }

/* Agents, events, settings */
.agent-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(250px, 1fr)); }
.agent-card { padding: 17px; }
.agent-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agent-card h3 { margin: 0 0 5px; }
.agent-card header p { margin: 0; color: var(--ink-faint); font-family: var(--mono); font-size: .61rem; }
.agent-description { min-height: 42px; margin: 15px 0; color: var(--ink-soft); font-size: .7rem; }
.agent-stats { display: grid; padding: 11px 0; gap: 8px; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-stats small { display: block; color: var(--ink-faint); font-size: .56rem; text-transform: uppercase; }
.agent-stats strong { font-family: var(--mono); font-size: .73rem; }
.agent-controls { display: flex; margin-top: 13px; flex-wrap: wrap; gap: 6px; }
.webhook-card { display: grid; padding: 17px; align-items: center; gap: 15px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; }
.webhook-card h3 { margin-bottom: 5px; }
.webhook-card p { margin: 0; overflow: hidden; color: var(--ink-faint); font-family: var(--mono); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.events-layout { display: grid; gap: 15px; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
.event-list { max-height: calc(100vh - 270px); overflow-y: auto; }
.event-item { display: grid; padding: 12px 15px; align-items: start; gap: 12px; grid-template-columns: 74px minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
.event-item:hover { background: rgba(255,255,255,.018); }
.event-type { color: var(--lime); font-family: var(--mono); font-size: .62rem; font-weight: 700; }
.event-data { overflow: hidden; color: var(--ink-soft); font-family: var(--mono); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.event-item time { color: var(--ink-faint); font-family: var(--mono); font-size: .58rem; }
.event-summary { display: grid; gap: 10px; }
.event-summary > div { display: flex; padding-bottom: 9px; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: .68rem; }
.event-summary span { color: var(--ink-faint); }
.settings-section { padding: 20px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-section > header { display: grid; margin-bottom: 18px; grid-template-columns: minmax(180px,.65fr) minmax(0,1.35fr); }
.settings-section > header p { color: var(--ink-faint); font-size: .7rem; }
.settings-form { display: grid; gap: 15px; }
.url-list { display: grid; gap: 7px; }
.url-row { display: flex; gap: 7px; }
.url-row input { flex: 1; }
.secret-reveal { padding: 15px; background: rgba(201,255,74,.07); border: 1px solid rgba(201,255,74,.18); border-radius: var(--radius); }
.secret-reveal code { display: block; margin: 10px 0; padding: 11px; overflow-wrap: anywhere; color: var(--lime); background: rgba(0,0,0,.2); border-radius: 7px; font-family: var(--mono); }
.mt-11 { margin-top: 11px; } .mt-15 { margin-top: 15px; } .mt-18 { margin-top: 18px; } .mt-22 { margin-top: 22px; }
.mb-15 { margin-bottom: 15px; }
.no-scroll { overflow: hidden; }

/* Dialogs and feedback */
.dialog-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; padding: 20px; align-items: flex-start; justify-content: flex-end; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); }
.dialog { width: min(620px, 100%); height: calc(100vh - 40px); overflow: hidden; background: var(--forest-850); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: dialog-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateX(15px); } }
.dialog > header { display: flex; min-height: 78px; padding: 18px 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog > header .eyebrow { margin-bottom: 5px; }
.dialog > header h2 { margin: 0; font-size: 1.4rem; }
.dialog-content { height: calc(100% - 78px); padding: 20px; overflow-y: auto; }
.detail-list { display: grid; gap: 0; }
.detail-row { display: grid; padding: 10px 0; gap: 15px; grid-template-columns: minmax(110px,.45fr) minmax(0,1fr); border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--ink-faint); font-size: .66rem; }
.detail-row dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: .7rem; }
.dialog-actions { display: flex; margin-top: 20px; justify-content: flex-end; gap: 8px; }
.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; width: min(370px, calc(100% - 40px)); gap: 8px; }
.toast { display: grid; padding: 13px 14px; align-items: start; gap: 10px; grid-template-columns: 7px 1fr auto; background: #14251f; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast > span { width: 7px; height: 7px; margin-top: 6px; background: var(--mint); border-radius: 50%; }
.toast.error > span { background: var(--red); }
.toast.warning > span { background: var(--amber); }
.toast p { margin: 0; color: var(--ink-soft); font-size: .71rem; }
.toast strong { display: block; margin-bottom: 2px; color: var(--ink); }
.toast button { color: var(--ink-faint); background: transparent; border: 0; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-grid { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { padding: 28px 22px; }
  .mobile-brand { display: flex; margin-bottom: 60px; align-items: center; gap: 10px; font-size: .9rem; }
  .app-shell { display: block; }
  .mobile-only { display: inline-flex; }
  .sidebar { position: fixed; left: 0; width: 255px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .nav-scrim { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(0,0,0,.5); }
  .topbar { padding: 0 17px; }
  .breadcrumb { display: none; }
  .topbar-actions { margin-left: auto; }
  .scan-layout, .overview-grid, .events-layout { grid-template-columns: 1fr; }
  .result-placeholder { min-height: 300px; }
  .event-list { max-height: 500px; }
}

@media (max-width: 680px) {
  .main-content { padding: 25px 14px 55px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-actions .button { flex: 1; }
  .metric-grid, .card-grid, .card-grid--3, .agent-grid, .form-grid { grid-template-columns: 1fr; }
  .loading-grid { grid-template-columns: repeat(2, 1fr); }
  .account-copy, .account-button > span:last-child, .connection-state b { display: none; }
  .connection-state { width: 28px; height: 28px; padding: 0; justify-content: center; }
  .scan-form textarea { min-height: 200px; }
  .result-score { grid-template-columns: 1fr; text-align: center; }
  .score-ring { margin: auto; }
  .webhook-card { grid-template-columns: 1fr; }
  .settings-section > header { grid-template-columns: 1fr; }
  .dialog-backdrop { padding: 0; }
  .dialog { height: 100vh; border: 0; border-radius: 0; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .brand-mark, .status-dot, .status-chip::before, .connection-state span, .live-dot { forced-color-adjust: none; }
  .button--primary { color: Canvas; background: ButtonText; }
}
