:root {
  --ink: #0b1f33; --navy: #12304f; --emer: #10b981; --emer-d: #047857; --emer-l: #d1fae5;
  --amber: #f59e0b; --amber-d: #b45309; --amber-l: #fef3c7; --red: #ef4444; --red-d: #b91c1c; --red-l: #fee2e2;
  --sky: #3b82f6; --sky-l: #dbeafe; --bg: #f3f5f8; --card: #fff; --muted: #64748b; --line: #e2e8f0; --text: #0f172a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Calibri, Arial, sans-serif; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
.side { width: 210px; background: var(--ink); color: #94a3b8; padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { color: #fff; font-weight: 700; font-size: 16px; padding: 0 8px 18px; }
.dia { color: var(--emer); }
nav a { display: block; color: #94a3b8; text-decoration: none; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; font-size: 13.5px; }
nav a:hover { color: #fff; }
nav a.on { background: var(--navy); color: #fff; font-weight: 600; }
nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 16px 10px 6px; }
nav .acc { display: flex; justify-content: space-between; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.side-foot { margin-top: auto; font-size: 12px; padding: 8px; }
main { flex: 1; padding: 24px 28px 60px; max-width: 1280px; min-width: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top .grow { flex: 1; }
.sub { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; box-shadow: 0 1px 3px rgba(11,31,51,.06); }
.grid { display: grid; gap: 14px; }
.k4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.k2 { grid-template-columns: 3fr 2fr; }
.k2e { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .k4 { grid-template-columns: 1fr 1fr; } .k2, .k2e { grid-template-columns: 1fr; } .side { display: none; } main { padding: 16px; } }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 24px; font-weight: 700; margin: 2px 0; }
.kpi .s { color: var(--muted); font-size: 12px; }
.good { color: var(--emer-d); } .warn { color: var(--amber-d); } .bad { color: var(--red-d); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-good { background: var(--emer-l); color: var(--emer-d); } .p-warn { background: var(--amber-l); color: var(--amber-d); } .p-bad { background: var(--red-l); color: var(--red-d); } .p-info { background: var(--sky-l); color: #1d4ed8; } .p-mute { background: #eef2f6; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8fafc; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: #cbd5e1; }
.btn.pri { background: var(--emer); border-color: var(--emer); color: #fff; }
.btn.pri:hover { background: var(--emer-d); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--red-d); border-color: #fecaca; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 4px; }
label .h { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=url], textarea, select { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.bar { height: 10px; background: #eef2f6; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.big-input { font-size: 30px !important; font-weight: 700; padding: 12px 16px !important; border: 2px solid var(--emer) !important; }
.log-item { display: grid; grid-template-columns: 64px 92px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.log-item:last-child { border-bottom: 0; }
.notice { background: var(--amber-l); color: #78350f; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.notice.info { background: var(--sky-l); color: #1e3a8a; }
.notice.err { background: var(--red-l); color: #7f1d1d; white-space: pre-line; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs figure { margin: 0; width: 120px; font-size: 11px; color: var(--muted); }
.thumbs img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.app-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg); border-radius: 8px; margin-bottom: 6px; }
.app-ico { width: 32px; height: 32px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-weight: 700; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; display: none; max-width: 90vw; z-index: 9; }
.demo-bar { background: #eef2ff; border: 1px dashed #a5b4fc; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { display: inline-flex; background: #eef2f6; border-radius: 8px; padding: 3px; }
.switch button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.switch button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.loading { color: var(--muted); padding: 40px; }
.steps { counter-reset: s; padding-left: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--emer-l); color: var(--emer-d); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

body.public { display: block; }
.pub { max-width: 440px; margin: 8vh auto; padding: 0 16px; }
.pub-brand { font-weight: 700; font-size: 18px; text-align: center; margin-bottom: 18px; color: var(--ink); }
.pub h1 { margin-bottom: 8px; } .pub h2 { margin: 16px 0 4px; }
.side-foot a { text-decoration: none; }

.land { max-width: 960px; margin: 0 auto; padding: 20px 16px 8px; }
.land-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.land-hero h1 { font-size: 30px; line-height: 1.2; max-width: 720px; margin-bottom: 12px; }
.land-hero p { font-size: 16px; color: #334155; max-width: 720px; }
.land-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 28px 0 14px; }
.land-info h2 { margin-top: 14px; } .land-info h2:first-child { margin-top: 0; }
@media (max-width: 800px) { .land-grid { grid-template-columns: 1fr; } .land-hero h1 { font-size: 24px; } }
