:root {
  --bg: #090c11; --bg2: #0e131a; --panel: #121923; --panel2: #17202c; --line: #1f2a37; --line2: #2a3746;
  --text: #e7edf4; --muted: #8796a8; --dim: #5d6b7c;
  --accent: #34d399; --accent2: #10b981; --accentbg: rgba(52, 211, 153, .12);
  --blue: #60a5fa; --bluebg: rgba(96, 165, 250, .12);
  --warn: #fbbf24; --warnbg: rgba(251, 191, 36, .12);
  --bad: #f87171; --badbg: rgba(248, 113, 113, .12);
  --violet: #a78bfa; --violetbg: rgba(167, 139, 250, .12);
  --r: 14px; --r2: 10px;
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .dim { color: var(--dim); }

.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }

/* sidebar */
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 22px; }
.brand b { font-size: 18px; letter-spacing: .2px; display: block; }
.brand small { color: var(--dim); font-size: 11.5px; }
.logo { width: 34px; height: 34px; }
.logo path:first-child { fill: var(--accentbg); stroke: var(--accent); stroke-width: 1.6; }
.logo .tick { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.on { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
nav a .badge { margin-left: auto; background: var(--badbg); color: var(--bad); font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.mode-box { border-top: 1px solid var(--line); padding: 14px 4px 2px; }
.mode-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 0; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.on { background: var(--panel2); color: var(--text); }
.seg button.on[data-mode=gaming] { color: var(--violet); }
.seg button.on[data-mode=dev] { color: var(--blue); }

/* main */
main { overflow: auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 32px 6px; position: sticky; top: 0; background: linear-gradient(var(--bg) 75%, transparent); z-index: 5; }
.top h1 { margin: 0; font-size: 22px; font-weight: 650; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-right { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.chip.ok { color: var(--accent); } .chip.ok .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accentbg); }
.chip.warn { color: var(--warn); } .chip.warn .dot { background: var(--warn); }
.chip.bad { color: var(--bad); } .chip.bad .dot { background: var(--bad); }
.chip.gaming { color: var(--violet); background: var(--violetbg); border-color: transparent; }
.chip.dev { color: var(--blue); background: var(--bluebg); border-color: transparent; }
.view { padding: 16px 32px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card h3 .right { margin-left: auto; font-weight: 500; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .g4 { grid-template-columns: 1fr 1fr; } .g-main, .g2, .g3 { grid-template-columns: 1fr; } }

.hero { display: flex; gap: 22px; align-items: center; padding: 24px 26px; background: radial-gradient(120% 140% at 0% 0%, rgba(52,211,153,.13), transparent 55%), var(--panel); }
.hero.attn { background: radial-gradient(120% 140% at 0% 0%, rgba(251,191,36,.14), transparent 55%), var(--panel); }
.hero .shield { width: 74px; height: 74px; flex: none; }
.hero .shield path:first-child { fill: var(--accentbg); stroke: var(--accent); stroke-width: 1.2; }
.hero .shield .tick { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero.attn .shield path:first-child { fill: var(--warnbg); stroke: var(--warn); } .hero.attn .shield .tick { stroke: var(--warn); }
.hero h2 { margin: 0; font-size: 22px; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.hero .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.3px; }
.stat .s { color: var(--dim); font-size: 12px; margin-top: 2px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar.warn i { background: var(--warn); } .bar.violet i { background: var(--violet); } .bar.blue i { background: var(--blue); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line2); background: var(--panel2); padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--dim); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04140d; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* lists & tables */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--panel2); }
.row .ico svg, .list .ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .d { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { color: var(--dim); font-size: 12px; white-space: nowrap; }
.ok-c { color: var(--accent); } .warn-c { color: var(--warn); } .bad-c { color: var(--bad); } .blue-c { color: var(--blue); } .violet-c { color: var(--violet); }
.ico.ok-c { background: var(--accentbg); } .ico.warn-c { background: var(--warnbg); } .ico.bad-c { background: var(--badbg); } .ico.blue-c { background: var(--bluebg); } .ico.violet-c { background: var(--violetbg); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); font-weight: 600; padding: 0 12px 10px; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); }
td .t { font-weight: 600; } td .d { color: var(--muted); font-size: 12.5px; }
td.actions { text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.pill.ok { background: var(--accentbg); color: var(--accent); } .pill.warn { background: var(--warnbg); color: var(--warn); }
.pill.bad { background: var(--badbg); color: var(--bad); } .pill.blue { background: var(--bluebg); color: var(--blue); }
.pill.violet { background: var(--violetbg); color: var(--violet); } .pill.grey { background: var(--panel2); color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; }
.tabs button { border: 0; background: none; padding: 9px 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.tabs .count { color: var(--dim); font-weight: 500; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; width: 260px; outline: none; }
.search:focus { border-color: var(--line2); }

/* countdown */
.count-ring { width: 38px; height: 38px; flex: none; }
.count-ring circle { fill: none; stroke-width: 3.5; }
.count-ring .bg { stroke: var(--line); } .count-ring .fg { stroke: var(--warn); stroke-linecap: round; transition: stroke-dashoffset 1s linear; transform: rotate(-90deg); transform-origin: center; }
.timeleft { font-family: var(--mono); font-size: 13px; color: var(--warn); font-weight: 600; min-width: 70px; text-align: right; }

/* scan */
.drop { border: 2px dashed var(--line2); border-radius: var(--r); padding: 46px 20px; text-align: center; transition: .15s; background: var(--bg2); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accentbg); }
.drop svg { width: 44px; height: 44px; stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop h2 { margin: 10px 0 4px; font-size: 18px; }
.drop p { margin: 0; color: var(--muted); }
.hashbox { display: flex; gap: 8px; margin-top: 14px; }
.hashbox input { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-family: var(--mono); font-size: 12.5px; outline: none; }
.verdict { display: flex; gap: 18px; align-items: flex-start; }
.vbadge { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.vbadge svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.verdict h2 { margin: 0; font-size: 20px; }
.reasons { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.reasons li { padding-left: 18px; position: relative; color: #c5cfdb; }
.reasons li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.meter .k { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter .k b { color: var(--text); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.engines { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.eng { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.eng b { font-size: 13px; } .eng div { font-family: var(--mono); font-size: 12px; color: var(--bad); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng.generic div { color: var(--warn); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toggles */
.toggle { position: relative; width: 40px; height: 23px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; transition: .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #cfd8e3; transition: .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(17px); background: #fff; }
.toggle input:disabled + span { opacity: .4; cursor: not-allowed; }
.setting { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting .main { flex: 1; } .setting .t { font-weight: 600; } .setting .d { color: var(--muted); font-size: 12.5px; }

.mode-card { cursor: pointer; transition: .15s; position: relative; }
.mode-card:hover { border-color: var(--line2); }
.mode-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mode-card.on.gaming { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet) inset; }
.mode-card.on.dev { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.mode-card .big { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }
.mode-card .big svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.mode-card .active { position: absolute; top: 16px; right: 16px; }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r2); background: var(--bluebg); color: #cfe2fb; font-size: 13px; }
.notice.warn { background: var(--warnbg); color: #f6e3b0; }
.notice svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }

/* drawer / modal / toast */
.drawer { position: fixed; inset: 0; background: rgba(3, 6, 10, .55); z-index: 20; display: flex; justify-content: flex-end; }
.drawer-card { width: min(620px, 100%); height: 100%; background: var(--bg2); border-left: 1px solid var(--line); overflow: auto; padding: 24px 26px; animation: slide .18s ease-out; display: flex; flex-direction: column; gap: 18px; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.modal { position: fixed; inset: 0; background: rgba(3, 6, 10, .6); z-index: 30; display: grid; place-items: center; }
.modal-card { width: min(480px, 92vw); background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 22px 24px; animation: pop .15s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: .5; } }
.modal-card h2 { margin: 0 0 4px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field select { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { border: 1px solid var(--line2); background: var(--bg2); border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.presets button.on { border-color: var(--warn); color: var(--warn); background: var(--warnbg); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--accent); padding: 11px 16px; border-radius: 10px; min-width: 260px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .15s ease-out; font-weight: 500; }
.toast.warn { border-left-color: var(--warn); } .toast.bad { border-left-color: var(--bad); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; stroke: var(--dim); fill: none; stroke-width: 1.5; margin-bottom: 8px; }
a { color: inherit; text-decoration: none; }
a.btn.primary { color: #04140d; }
th, td.dim, td.muted { white-space: nowrap; }
.card h3 svg, .presets svg, .row .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.presets svg { width: 13px; height: 13px; vertical-align: -2px; }
.drop { display: block; }

/* slim dark scrollbars — invisible until you hover or scroll */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover, *.scrolling { scrollbar-color: #2a3746 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
:hover::-webkit-scrollbar-thumb, .scrolling::-webkit-scrollbar-thumb { background-color: #2a3746; }
::-webkit-scrollbar-thumb:hover { background-color: #3b4b5e; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
main, .drawer-card { scroll-behavior: smooth; overscroll-behavior: contain; }
.ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navsec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--dim); padding: 14px 11px 5px; font-weight: 600; }
nav { overflow-y: auto; }
svg.inl { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; vertical-align: -2px; }
.mode-card ul li { margin: 2px 0; }
.toggle { display: inline-block; vertical-align: middle; }
.g-main > *, .grid > * { min-width: 0; }
td.mono { white-space: nowrap; }
.card table { display: table; width: 100%; }
.card:has(> table) { overflow-x: auto; }
/* ---- Ash Cloud additions ---- */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(80% 60% at 50% 0%, rgba(52,211,153,.10), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 92vw); background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 30px 30px 24px; }
.auth-card h1 { margin: 10px 0 4px; font-size: 22px; } .auth-card .logo { width: 44px; height: 44px; }
.auth-card .switch { margin-top: 16px; text-align: center; color: var(--muted); font-size: 13px; } .auth-card .switch a { color: var(--accent); cursor: pointer; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }
.dot-on, .dot-off { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; } .dot-on { background: var(--accent); box-shadow: 0 0 0 3px var(--accentbg); } .dot-off { background: var(--dim); }
.kv2 { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; font-size: 13px; } .kv2 > div:nth-child(odd) { color: var(--muted); }
.codebox { font-family: var(--mono); font-size: 12.5px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; word-break: break-all; user-select: all; }
.pol-row { display: grid; grid-template-columns: 1fr 220px; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.pol-row:first-child { border-top: 0; } .pol-row .d { color: var(--muted); font-size: 12.5px; }
.pol-row select { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; color: var(--text); }
.toggle { display: inline-block; vertical-align: middle; } .grid > * { min-width: 0; } td.mono { white-space: nowrap; }
.navsec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--dim); padding: 14px 11px 5px; font-weight: 600; }
.big-num { font-size: 30px; font-weight: 650; }
/* Ash Protection logo keeps its own colours */
.logo path:first-child { fill: #1c222b; stroke: #34d399; stroke-width: 1.3; }
