:root {
  --bg: #0f0f0f;
  --bg-2: #131313;
  --surface: #1a1a1a;
  --surface-2: #212121;
  --surface-3: #2a2a2a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --ink: #ffffff;
  --ink-2: #c9c9c6;
  --muted: #8c8c88;
  --accent: #dafa9c;
  --accent-ink: #0f1405;
  --accent-soft: rgba(218, 250, 156, .12);
  --ok: #b7f36b;
  --warn: #f5c451;
  --danger: #ff6b5b;
  --danger-soft: rgba(255, 107, 91, .12);
  --info: #8fd3ff;
  --r: 6px;
  --r-lg: 10px;
  --font: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 248px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--r); text-decoration: none; font-weight: 500; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3a3a3a; }
::-webkit-scrollbar-track { background: transparent; }

.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }

.btn {
  --b-bg: var(--surface-2); --b-ink: var(--ink); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  background: var(--b-bg); color: var(--b-ink); border: 1px solid var(--b-line); border-radius: var(--r);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.22); background: var(--surface-3); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .06s; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-line: var(--accent); }
.btn-primary:hover { background: #e6ffb6; border-color: #e6ffb6; box-shadow: 0 6px 22px -8px rgba(218,250,156,.55); }
.btn-danger { --b-bg: var(--danger-soft); --b-ink: #ff9488; --b-line: rgba(255,107,91,.28); }
.btn-danger:hover { background: rgba(255,107,91,.2); border-color: rgba(255,107,91,.45); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:hover { border-color: rgba(255,255,255,.2); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-size: 13.5px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8c88' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle { position: relative; width: 38px; height: 22px; flex: none; appearance: none; background: var(--surface-3); border-radius: 22px; cursor: pointer; border: 1px solid var(--line-2); transition: background .2s; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .22s var(--ease), background .2s; }
.toggle:checked { background: var(--accent); border-color: var(--accent); }
.toggle:checked::after { transform: translateX(16px); background: var(--accent-ink); }
input[type=checkbox].cb { appearance: none; width: 17px; height: 17px; border: 1.5px solid #4a4a4a; border-radius: 4px; margin: 0; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
input[type=checkbox].cb:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox].cb:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.login-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 420px at 15% 110%, rgba(218,250,156,.10), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px, var(--bg); }
.login-art h1 { font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -.04em; font-weight: 500; margin: 0; max-width: 11ch; }
.login-art h1 em { font-style: normal; color: var(--accent); }
.login-art p { color: var(--ink-2); max-width: 44ch; margin: 18px 0 0; font-size: 17px; }
.term-demo { margin-top: 40px; max-width: 560px; background: rgba(10,10,10,.85); border: 1px solid var(--line-2); border-radius: var(--r-lg); font-family: var(--mono); font-size: 13px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.term-demo .bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; color: var(--muted); font-size: 12px; }
.term-demo .bar i { width: 9px; height: 9px; border-radius: 50%; background: #333; display: block; }
.term-demo .body { padding: 14px 16px; min-height: 196px; color: var(--ink-2); line-height: 1.75; }
.term-demo .body div { opacity: 0; animation: lineIn .4s var(--ease) forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: min(380px, 100%); display: grid; gap: 18px; animation: enter .6s var(--ease) both; }
.login-form h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.login-form .err { color: #ff9488; font-size: 13.5px; min-height: 20px; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; font-size: 16px; }
.mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; stroke: var(--accent-ink); stroke-width: 3; fill: none; stroke-linecap: round; }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--bg); }
.side .brand { padding: 4px 8px 18px; }
.nav-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--accent); flex: none; text-transform: uppercase; }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.side-foot .who b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: var(--muted); }
.main { min-width: 0; padding: 28px clamp(20px, 3vw, 40px) 48px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13.5px; margin-bottom: 10px; transition: color .15s; }
.crumb:hover { color: var(--ink); }
.crumb:hover .i { transform: translateX(-2px); }
.crumb .i { transition: transform .18s var(--ease); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; flex: none; }
.st-running .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(183,243,107,.6); animation: pulse 2.6s infinite; }
.st-running { color: var(--ok); background: rgba(183,243,107,.08); border-color: rgba(183,243,107,.2); }
.st-starting .dot, .st-stopping .dot, .st-task .dot { background: var(--warn); animation: blink 1s infinite; }
.st-starting, .st-stopping, .st-task { color: var(--warn); background: rgba(245,196,81,.08); border-color: rgba(245,196,81,.2); }
.st-offline .dot { background: #5a5a5a; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(183,243,107,.55); } 70% { box-shadow: 0 0 0 7px rgba(183,243,107,0); } 100% { box-shadow: 0 0 0 0 rgba(183,243,107,0); } }
@keyframes blink { 50% { opacity: .35; } }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .v { font-size: 28px; font-weight: 500; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }
.chips { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.chips button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 13.5px; transition: background .15s, color .15s; }
.chips button:hover { color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none; transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); cursor: pointer; overflow: hidden;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 18px 40px -24px rgba(0,0,0,.9); }
.card.is-running::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .8; }
.card-top { display: flex; align-items: flex-start; gap: 12px; }
.bot-ico { width: 40px; height: 40px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--ink-2); transition: background .2s, color .2s; }
.card:hover .bot-ico { background: var(--accent-soft); color: var(--accent); }
.card h3 { margin: 0; font-size: 16.5px; font-weight: 500; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .id { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.card-top .status { margin-left: auto; }
.spark { width: 100%; height: 44px; display: block; }
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.meters div { min-width: 0; }
.meters span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.meters b { font-weight: 500; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-actions { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 6px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s var(--ease); }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; transform: none; }
.card:hover .meters, .card:focus-within .meters { opacity: .25; }
.meters { transition: opacity .2s; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-weight: 500; margin: 10px 0 6px; }

.srv-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.srv-head .bot-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.srv-head .bot-ico .i { width: 24px; height: 24px; }
.srv-title { min-width: 0; flex: 1; }
.srv-title h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srv-title .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }
.power { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; text-decoration: none; color: var(--muted); font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.terminal { background: #0a0a0a; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; position: relative; }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: #0d0d0d; }
.term-bar .grow { flex: 1; }
.term-out { flex: 1; overflow-y: auto; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: #d7d7d2; white-space: pre-wrap; word-break: break-word; tab-size: 4; }
.term-out .ln { min-height: 1.6em; }
.term-out .ln:hover { background: rgba(255,255,255,.025); }
.term-in { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 0 12px; background: #0d0d0d; }
.term-in .prompt { color: var(--accent); font-family: var(--mono); }
.term-in input { flex: 1; height: 46px; background: transparent; border: 0; outline: none; font-family: var(--mono); font-size: 13.5px; }
.term-in input:disabled { opacity: .5; }
.to-bottom { position: absolute; right: 16px; bottom: 60px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); transform: translateY(6px); }
.to-bottom.show { opacity: 1; pointer-events: auto; transform: none; }
.side-stats { display: grid; gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 10px; }
.metric .row { display: flex; justify-content: space-between; align-items: baseline; }
.metric .k { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.metric .v { font-family: var(--mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.metric canvas { width: 100%; height: 56px; display: block; margin-top: 8px; }
.metric.plain { padding-bottom: 14px; }
.kv { display: grid; gap: 8px; font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; font-family: var(--mono); font-size: 12.5px; text-align: right; word-break: break-all; }

.a-b { font-weight: 600; } .a-d { opacity: .65; } .a-i { font-style: italic; } .a-u { text-decoration: underline; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; font-weight: 500; margin: 0; }
.crumbs { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 13px; flex: 1; min-width: 0; flex-wrap: wrap; }
.crumbs button { background: none; border: 0; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: var(--ink-2); }
.crumbs button:hover { background: var(--surface-3); color: var(--ink); }
.crumbs button:last-child { color: var(--ink); }
.crumbs .sep { color: #444; }
.ftable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ftable th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ftable td { padding: 0 14px; height: 46px; border-bottom: 1px solid var(--line); }
.ftable tr:last-child td { border-bottom: 0; }
.ftable tbody tr { transition: background .12s; }
.ftable tbody tr:hover { background: rgba(255,255,255,.025); }
.ftable tbody tr.sel { background: var(--accent-soft); }
.ftable .c-check { width: 44px; padding-right: 0; }
.ftable .c-size, .ftable .c-date { color: var(--muted); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.ftable .c-size { width: 110px; text-align: right; }
.ftable .c-date { width: 170px; }
.ftable .c-act { width: 56px; text-align: right; }
.fname { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: left; max-width: 100%; }
.fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname:hover span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.ficon { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: none; font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: -.02em; text-transform: uppercase; }
.ficon.dir { background: rgba(218,250,156,.12); color: var(--accent); }
.ficon.js { background: #f7df1e; color: #1a1a00; }
.ficon.ts { background: #3178c6; color: #fff; }
.ficon.json { background: #2b2b2b; color: #f5c451; border: 1px solid #3a3a3a; }
.ficon.env { background: #ecd53f; color: #111; }
.ficon.md { background: #2b2b2b; color: #c9c9c6; border: 1px solid #3a3a3a; }
.ficon.zip { background: #3a2a14; color: #f5a623; }
.ficon.img { background: #12304a; color: #8fd3ff; }
.ficon.py { background: #3572a5; color: #ffd43b; }
.ficon.other { background: var(--surface-3); color: var(--muted); }
.drop-hint { display: none; position: absolute; inset: 0; background: rgba(15,15,15,.86); border: 2px dashed var(--accent); border-radius: var(--r-lg); z-index: 5; place-items: center; color: var(--accent); font-size: 18px; font-weight: 500; }
.dropping .drop-hint { display: grid; }
.files-wrap { position: relative; }
.bulk { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.uploads { position: fixed; right: 20px; bottom: 20px; width: 340px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 20px 60px -20px #000; z-index: 40; overflow: hidden; animation: enter .3s var(--ease); }
.uploads header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 500; }
.uploads ul { list-style: none; margin: 0; padding: 6px 0; max-height: 240px; overflow-y: auto; }
.uploads li { padding: 6px 14px; font-size: 12.5px; display: grid; gap: 5px; }
.uploads li .nm { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); }
.uploads li .nm span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 3px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .15s; }
.bar.err i { background: var(--danger); width: 100% !important; }

.editor { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; animation: enter .25s var(--ease); }
.editor-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; }
.editor-head .path { font-family: var(--mono); font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-head .path b { color: var(--ink); font-weight: 500; }
.editor-head .path span { color: var(--muted); }
.dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; margin-left: 8px; vertical-align: middle; }
.editor-body { flex: 1; min-height: 0; position: relative; }
.editor-body textarea { width: 100%; height: 100%; border: 0; outline: none; resize: none; background: #0a0a0a; padding: 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: #e6e6e1; tab-size: 2; }
.editor-foot { display: flex; gap: 18px; padding: 6px 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg-2); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 16px; }
.box h2 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.box > p { margin: -8px 0 0; color: var(--muted); font-size: 13.5px; }
.box-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.env-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
.env-row .input { height: 36px; font-family: var(--mono); font-size: 13px; }
.env-list { display: grid; gap: 8px; }
.env-head { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 74px; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.danger-zone { border-color: rgba(255,107,91,.25); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table .r { text-align: right; white-space: nowrap; }
.table a.lnk { text-decoration: none; font-weight: 500; }
.table a.lnk:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-family: var(--mono); margin: 2px 4px 2px 0; }
.tag.acc { background: var(--accent-soft); color: var(--accent); }
.scroll-x { overflow-x: auto; }

.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 40px 100px -30px #000; animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal header h2 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.015em; }
.modal .body { padding: 18px 20px; display: grid; gap: 16px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.modal .err { color: #ff9488; font-size: 13.5px; }
.pick-list { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; background: var(--bg-2); }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.pick-list label:hover { background: var(--surface-2); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tpl { position: relative; display: block; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; }
.tpl div { border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; background: var(--bg-2); transition: border-color .15s, background .15s, transform .18s var(--ease); height: 100%; }
.tpl:hover div { transform: translateY(-2px); border-color: rgba(255,255,255,.2); }
.tpl input:checked + div { border-color: var(--accent); background: var(--accent-soft); }
.tpl input:focus-visible + div { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl b { display: block; font-weight: 500; font-size: 14px; }
.tpl span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.menu { position: fixed; z-index: 70; min-width: 190px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 5px; box-shadow: 0 20px 50px -16px #000; animation: pop .16s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; background: none; border: 0; border-radius: 5px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); color: var(--ink); outline: none; }
.menu button.danger { color: #ff9488; }
.menu button.danger:hover { background: var(--danger-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

#toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 11px 14px; font-size: 14px; box-shadow: 0 16px 40px -18px #000; animation: toastIn .32s var(--ease); }
.toast.err { border-left-color: var(--danger); }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

.sys-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.gauge { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.gauge i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .6s var(--ease); }
.gauge.hot i { background: var(--warn); }
.section-title { font-size: 18px; font-weight: 500; margin: 30px 0 12px; letter-spacing: -.015em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-lg); height: 180px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: enter .45s var(--ease) both; }

@media (max-width: 1100px) {
  .console-layout { grid-template-columns: 1fr; }
  .side-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 55; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .28s var(--ease); background: var(--bg-2); }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 80px #000; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: rgba(15,15,15,.9); backdrop-filter: blur(8px); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .ftable .c-date { display: none; }
  .sys-grid { grid-template-columns: 1fr; }
  .terminal { height: 62vh; }
}
@media (max-width: 560px) {
  .main { padding: 20px 14px 40px; }
  .summary, .side-stats { grid-template-columns: 1fr 1fr; }
  .ftable .c-size { display: none; }
  .env-row, .env-head { grid-template-columns: 1fr; }
  .env-head { display: none; }
  .power .btn span { display: none; }
  .power .btn { width: 40px; padding: 0; }
  .card-actions { opacity: 1; transform: none; position: static; }
  .card:hover .meters { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .term-demo .body div { opacity: 1; }
}
