/* HostPanel UI. Hand-written, no build step, no external assets. Light and dark themes via [data-theme]. */
:root {
  color-scheme: light;
  --bg: #f5f6f8; --card: #ffffff; --subtle: #f8f9fb; --hover: #f1f3f6; --ink: #151a23; --muted: #667085; --line: #e4e7ec; --line-2: #d0d5dd;
  --brand: #2f6bed; --brand-h: #2559cc; --brand-soft: #edf2fe; --on-brand: #fff;
  --ok: #157f45; --ok-soft: #e3f6ea; --ok-line: #b7e4c7;
  --warn: #a15c07; --warn-soft: #fdf3dc; --warn-line: #f3d9a0;
  --bad: #c9302c; --bad-soft: #fdeaea; --bad-line: #f5c2c0;
  --code-bg: #12161d; --code-ink: #dde3ec; --art: #121722; --sel: rgba(47,107,237,.18);
  --r: 12px; --r-s: 8px; --shadow: 0 1px 2px rgba(16,24,40,.05); --pop: 0 12px 32px -8px rgba(16,24,40,.22), 0 0 0 1px var(--line);
  --hdr: 60px; --side-w: 244px; --ease: cubic-bezier(.2,.7,.2,1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme=dark] {
  color-scheme: dark;
  --bg: #0c0e12; --card: #14171d; --subtle: #181c23; --hover: #1d222a; --ink: #e8eaee; --muted: #8e97a7; --line: #232831; --line-2: #333a46;
  --brand: #4d86f5; --brand-h: #6b9aff; --brand-soft: rgba(77,134,245,.14); --on-brand: #0a0f1a;
  --ok: #4cc38a; --ok-soft: rgba(76,195,138,.13); --ok-line: rgba(76,195,138,.3);
  --warn: #e6a53c; --warn-soft: rgba(230,165,60,.13); --warn-line: rgba(230,165,60,.3);
  --bad: #f06a66; --bad-soft: rgba(240,106,102,.13); --bad-line: rgba(240,106,102,.32);
  --code-bg: #0a0c10; --code-ink: #d6dce6; --art: #0f1218; --sel: rgba(77,134,245,.22);
  --shadow: none; --pop: 0 16px 40px -8px rgba(0,0,0,.6), 0 0 0 1px var(--line-2);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .25s, color .25s, border-color .25s, fill .25s, stroke .25s !important; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sel); }
h1 { font-size: 22px; margin: 0; letter-spacing: -.015em; font-weight: 650; } h2 { font-size: 15px; margin: 0 0 4px; font-weight: 650; } h3 { font-size: 14px; margin: 0; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.right { margin-left: auto; } .row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
svg { flex: none; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 60; height: var(--hdr); display: flex; align-items: center; gap: 8px; padding-right: 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.hdr .brand { width: var(--side-w); height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.01em; border-right: 1px solid var(--line); }
.hdr .brand:hover { text-decoration: none; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo i, .hdr .brand i { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-style: normal; }
.logo svg, .hdr .brand svg { width: 16px; height: 16px; stroke: var(--on-brand); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hdr .grow { flex: 1; }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.iconbtn:hover { background: var(--hover); color: var(--ink); } .iconbtn:active { transform: scale(.94); }
.iconbtn svg, .seg svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burger { display: none; }
.theme-btn .i-moon { display: none; } [data-theme=dark] .theme-btn .i-sun { display: none; } [data-theme=dark] .theme-btn .i-moon { display: block; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 650; font-size: 13px; letter-spacing: .02em; cursor: pointer; display: grid; place-items: center; transition: box-shadow .15s, transform .1s; text-transform: uppercase; }
.avatar:hover { box-shadow: 0 0 0 4px var(--brand-soft); } .avatar:active { transform: scale(.95); } .avatar[aria-expanded=true] { box-shadow: 0 0 0 4px var(--brand-soft); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; cursor: default; } .avatar.lg:hover { box-shadow: none; }
.dd { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; width: 288px; background: var(--card); border-radius: 14px; box-shadow: var(--pop); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s; }
.dd.open .pop { opacity: 1; visibility: visible; transform: none; }
.pop .who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop .who b { display: block; line-height: 1.3; } .pop .who div span:not(.badge) { display: block; color: var(--muted); font-size: 12.5px; word-break: break-all; }
.pop .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; text-align: left; transition: background .12s; }
.pop .item:hover { background: var(--hover); text-decoration: none; } .pop .item svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pop .item.d, .pop .item.d svg { color: var(--bad); stroke: var(--bad); }
.pop .sep { height: 1px; background: var(--line); margin: 6px 0; }
.pop .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 6px 10px 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: var(--hover); padding: 3px; border-radius: 9px; margin: 2px 4px 6px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--muted); padding: 6px 4px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; transition: background .15s, color .15s; }
.seg button svg { width: 15px; height: 15px; } .seg button:hover { color: var(--ink); } .seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- shell & sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--hdr)); }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 14px 12px; position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); overflow-y: auto; transition: transform .28s var(--ease); }
.nav a { white-space: nowrap; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .cap { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 14px 12px 6px; }
.overlay { position: fixed; inset: var(--hdr) 0 0 0; background: rgba(8,10,14,.5); z-index: 54; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.main { padding: 28px 36px 64px; max-width: 1200px; width: 100%; min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.top p { margin: 2px 0 0; color: var(--muted); }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; transition: border-color .15s; }
.card.flush { padding: 0; overflow-x: auto; overflow-y: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: 1fr 1fr; }
.stat .lbl { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 4px 0 10px; } .stat .val small { font-size: 14px; color: var(--muted); font-weight: 500; }
.bar { height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transform-origin: left; animation: grow .8s var(--ease) backwards; }
.bar.hot i { background: var(--bad); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 0 14px; border-radius: var(--r-s); font: inherit; font-weight: 550; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .08s; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; } .btn:active { transform: scale(.975); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .btn.primary:hover { background: var(--brand-h); border-color: var(--brand-h); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); } .btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; } .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.loading { pointer-events: none; opacity: .8; } .btn.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }

/* ---------- forms ---------- */
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]), select, textarea { width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 0 12px; font: inherit; background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:disabled, select:disabled, textarea:disabled { background: var(--hover); color: var(--muted); cursor: not-allowed; }
textarea { height: auto; padding: 10px 12px; font-family: var(--mono); font-size: 13px; resize: vertical; line-height: 1.55; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=file] { font: inherit; color: var(--muted); } input[type=file]::file-selector-button { font: inherit; font-weight: 550; margin-right: 12px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; transition: background .15s; } input[type=file]::file-selector-button:hover { background: var(--hover); }
input[type=checkbox], input[type=radio] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0; border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; vertical-align: middle; }
input[type=checkbox] { border-radius: 5px; } input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--brand); }
input[type=checkbox]:checked { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/80% no-repeat; border-color: var(--brand); }
input[type=radio]:checked { border-color: var(--brand); background: radial-gradient(circle, var(--brand) 0 40%, transparent 45%); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin-bottom: 0; }
.switch input[type=checkbox] { width: 36px; height: 20px; border-radius: 99px; position: relative; background: var(--line-2); border-color: transparent; }
.switch input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch input[type=checkbox]:checked { background: var(--brand); border-color: transparent; } .switch input[type=checkbox]:checked::after { transform: translateX(16px); }
.switch input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
.field + .field { margin-top: 16px; } .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* ---------- badges, tables ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--muted); line-height: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.brand { background: var(--brand-soft); color: var(--brand); }
table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 20px; background: var(--subtle); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; } tbody tr { transition: background .12s; } tbody tr:hover td { background: var(--subtle); }
.site-name { font-weight: 600; color: var(--ink); } .rt { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; font-weight: 700; font-size: 12px; color: #fff; flex: none; }
.rt.nextjs { background: #111; } .rt.nuxt { background: #00b368; } .rt.sveltekit { background: #ff3e00; } .rt.remix { background: #3992ff; } .rt.vite { background: #646cff; } .rt.vue { background: #42b883; } .rt.react { background: #087ea4; } .rt.angular { background: #dd0031; } .rt.astro { background: #ff5d01; } .rt.laravel { background: #ff2d20; } .rt.wordpress { background: #21759b; }
.rt.php { background: #777bb3; } .rt.node { background: #3c873a; } .rt.python { background: #3776ab; } .rt.static { background: #e69a14; } .rt.ruby { background: #cc342d; }
[data-theme=dark] .rt.nextjs { background: #2a2f38; }

/* ---------- flash, tabs, empty ---------- */
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid; } .flash.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); } .flash.error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); } .flash.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; } .tabs a:hover { color: var(--ink); text-decoration: none; } .tabs a.on { color: var(--brand); border-color: var(--brand); }
.empty { text-align: center; padding: 56px 20px; } .empty .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; margin: 0 auto 14px; } .empty .ico svg { width: 24px; height: 24px; stroke: var(--brand); fill: none; stroke-width: 1.8; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-all; }
.code { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; overflow: auto; max-height: 420px; white-space: pre-wrap; border: 1px solid var(--line); }
.dns { background: var(--brand-soft); border-radius: 10px; padding: 14px 16px; }

/* ---------- file manager ---------- */
.fm { display: flex; flex-direction: column; min-height: 520px; }
.fm-bar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--subtle); }
.crumbs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 180px; font-weight: 600; flex-wrap: wrap; } .crumbs a { cursor: pointer; padding: 3px 7px; border-radius: 6px; color: var(--ink); } .crumbs a:hover { background: var(--hover); text-decoration: none; } .crumbs span { color: var(--muted); }
.fm-list { flex: 1; } .fm-row { display: grid; grid-template-columns: 28px 1fr 90px 150px 70px 40px; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); cursor: default; transition: background .12s; }
.fm-row:hover { background: var(--subtle); } .fm-row.head { font-size: 11.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; font-weight: 600; background: var(--subtle); } .fm-row.sel { background: var(--brand-soft); }
.fm-row .nm { display: flex; align-items: center; gap: 9px; font-weight: 550; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-row svg { width: 18px; height: 18px; flex: none; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; } .ic-dir { stroke: #e69a14; fill: rgba(230,154,20,.25) !important; } .ic-file { stroke: var(--muted); }
.drop { border: 2px dashed var(--brand); background: var(--brand-soft); color: var(--brand); text-align: center; padding: 14px; font-weight: 600; display: none; } .fm.dragging .drop { display: block; }
.menu { position: relative; } .menu-pop { position: absolute; right: 0; top: 100%; z-index: 20; background: var(--card); border-radius: 12px; box-shadow: var(--pop); min-width: 170px; padding: 6px; display: none; } .menu.open .menu-pop { display: block; animation: pop .14s var(--ease); }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; } .menu-pop button:hover { background: var(--hover); } .menu-pop .d { color: var(--bad); }
.editor { position: fixed; inset: 0; background: rgba(8,10,14,.6); backdrop-filter: blur(3px); z-index: 90; display: none; place-items: center; padding: 24px; } .editor.open { display: grid; animation: fade .18s; }
.editor .win { background: var(--card); border-radius: 14px; width: min(1000px, 100%); height: min(86vh, 760px); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--pop); animation: pop .22s var(--ease); } .editor .win header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .editor textarea { flex: 1; border: 0 !important; border-radius: 0; padding: 16px; line-height: 1.6; tab-size: 4; background: var(--code-bg); color: var(--code-ink); white-space: pre; overflow: auto; height: auto; } .editor textarea:focus { box-shadow: none; }

/* ---------- toasts & progress ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--card); padding: 11px 14px; border-radius: 10px; font-weight: 500; box-shadow: 0 12px 32px -8px rgba(0,0,0,.35); max-width: 420px; pointer-events: auto; animation: toast-in .3s var(--ease); }
.toast.out { animation: toast-out .22s ease forwards; } .toast svg { width: 18px; height: 18px; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast.ok svg { color: #4cc38a; } .toast.err svg { color: #f87b77; } .toast.warn svg { color: #f0b04a; }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--brand); z-index: 130; opacity: 0; transition: width .35s var(--ease), opacity .3s; }
.progress.on { opacity: 1; }
#app-main { transition: opacity .12s; } #app-main.leaving { opacity: .45; pointer-events: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .art { background: var(--art); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.auth .art .logo i { background: #fff; } .auth .art .logo svg { stroke: #121722; }
.auth .art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.025em; max-width: 420px; font-weight: 650; } .auth .art ul { list-style: none; padding: 0; margin: 22px 0 0; color: #b9c0d0; } .auth .art li { margin: 10px 0; padding-left: 26px; position: relative; } .auth .art li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid #5fd39a; border-bottom: 2px solid #5fd39a; transform: rotate(-45deg); }
.auth .form { display: grid; place-items: center; padding: 30px; background: var(--card); position: relative; } .auth .form form { width: 100%; max-width: 380px; animation: rise .5s var(--ease) backwards; }
.auth .theme-corner { position: absolute; top: 16px; right: 16px; }
.opt { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } .opt label { margin: 0; cursor: pointer; } .opt input { position: absolute; opacity: 0; width: 0; height: 0; } .opt span { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; transition: border-color .15s, background .15s, transform .12s; text-align: center; background: var(--card); } .opt span:hover { border-color: var(--line-2); transform: translateY(-1px); } .opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); } .opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.grp { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.opt input:disabled + span { opacity: .45; cursor: not-allowed; background: var(--subtle); transform: none; }
.opt small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; } .steps > div { background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; padding: 14px; } .steps b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; margin-bottom: 6px; }
.logbox { min-height: 160px; }
.pulse { animation: pulse 1.2s infinite; }
.grid > .field + .field { margin-top: 0; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
#app-main.enter > * { animation: rise .38s var(--ease) backwards; }
#app-main.enter > *:nth-child(2) { animation-delay: .04s; } #app-main.enter > *:nth-child(3) { animation-delay: .08s; } #app-main.enter > *:nth-child(4) { animation-delay: .12s; } #app-main.enter > *:nth-child(5) { animation-delay: .16s; } #app-main.enter > *:nth-child(n+6) { animation-delay: .2s; }
.grid.g2 > *, .grid.g3 > *, .grid.g4 > * { animation: rise .4s var(--ease) backwards; } .grid > *:nth-child(2) { animation-delay: .05s; } .grid > *:nth-child(3) { animation-delay: .1s; } .grid > *:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: 1fr 1fr; } .main { padding: 24px 24px 60px; } }
@media (max-width: 960px) {
  :root { --side-w: 272px; }
  .burger { display: inline-grid; }
  .hdr { padding-left: 8px; }
  .hdr .brand { width: auto; border-right: 0; padding: 0 6px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: var(--hdr); left: 0; bottom: 0; width: var(--side-w); height: auto; z-index: 55; transform: translateX(-102%); box-shadow: none; }
  .nav-open .side { transform: none; box-shadow: 8px 0 30px -10px rgba(0,0,0,.35); } .nav-open .overlay { opacity: 1; visibility: visible; } .nav-open { overflow: hidden; }
  .main { padding: 20px 16px 50px; }
  .g3, .g2 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .fm-row { grid-template-columns: 24px 1fr 40px; } .fm-row .hide-s { display: none; }
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; } }
@media (max-width: 640px) {
  h1 { font-size: 20px; } .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .top > .btn.right, .top > .row.right, .top > form.right { margin-left: 0; }
  .card { padding: 16px; } .card.flush { padding: 0; } .card-h { padding: 12px 16px; }
  th, td { padding: 10px 12px; } .card.flush table { min-width: 560px; } td:first-child { min-width: 170px; } .site-name { white-space: nowrap; }
  .row.wrap > .right { margin-left: 0; }
  .redir { flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); } .redir input { flex: 1 1 100% !important; } .redir > span { display: none; } .redir select { width: 100% !important; }
  form .row.wrap { align-items: stretch; } .row > .field { min-width: 100% !important; flex: 1 1 100% !important; }
  input[style*="width"], select[style*="width"] { width: 100% !important; max-width: none !important; }
  .pop { position: fixed; top: calc(var(--hdr) + 8px); right: 10px; left: 10px; width: auto; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; } .toast { max-width: none; }
  .editor { padding: 0; } .editor .win { width: 100%; height: 100%; border-radius: 0; }
  .opt { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .auth .form { padding: 22px 18px; }
}

/* ---------- admin: sidebar groups, stat tiles, tables, modal ---------- */
.nav .cap:first-child { padding-top: 4px; }
.stat.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.stat.tile .val { margin: 2px 0 0; }
.stat.tile .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.stat.tile .ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.grid.ov { grid-template-columns: 1.15fr 1fr; align-items: start; }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.search input { padding-left: 36px !important; }
table.nodes td { vertical-align: middle; } table.nodes .cell { min-width: 96px; white-space: nowrap; } table.nodes .bar { margin-top: 6px; height: 5px; }
.card.flush td a:not(.btn) { color: var(--ink); } .card.flush td a:not(.btn):hover { color: var(--brand); }

dialog.modal { border: 1px solid var(--line-2); border-radius: 16px; padding: 0; background: var(--card); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 64px -12px rgba(0,0,0,.45); overflow: hidden; }
dialog.modal.wide { width: min(720px, calc(100vw - 24px)); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .24s var(--ease); }
dialog.modal::backdrop { background: rgba(8,10,14,.55); backdrop-filter: blur(2px); animation: fade .2s; }
.mform { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 32px); }
.mh { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.mh h2 { margin: 0; } .mh p { margin: 4px 0 0; max-width: 56ch; }
.mb { padding: 4px 22px 18px; overflow-y: auto; }
.mf { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--subtle); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 960px) { .grid.ov { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  dialog.modal, dialog.modal.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .mh, .mb, .mf { padding-left: 16px; padding-right: 16px; } .mf .btn { flex: 1; }
  .card.flush table.nodes { min-width: 820px; }
}
[hidden]{display:none !important}
.chart{width:100%;height:auto;display:block;margin-top:4px}
.logerr{color:var(--bad)}

.logo .mark, .hdr .brand .mark { width: 30px; height: 30px; border-radius: 8px; display: block; flex: none; }
