:root {
  --bg: #16181b;
  --side: #1c1f23;
  --panel: #212529;
  --raise: #292d33;
  --well: #121416;
  --line: #31363d;
  --line-soft: #292d33;
  --text: #dedcd5;
  --text-2: #c3c1ba;
  --muted: #8b9098;
  --faint: #5f656d;
  --accent: #4fae9a;
  --accent-ink: #0c1a16;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-fg: var(--accent);
  --danger: #d9534b;
  --danger-soft: rgba(217, 83, 75, .14);
  --warn: #d9a548;
  --warn-soft: rgba(217, 165, 72, .14);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --line-hover: #454c55;
  --hover: #30353c;
  --row-hover: #262a30;
  --danger-text: #ec8a83;
  --r: 6px; --r-sm: 4px; --r-lg: 8px;
  --zoom: 1;
  --console-size: 12.5px;
  color-scheme: dark;
}
/* themes: only the colors that differ from the default (Deepslate) */
:root[data-theme="midnight"] {
  --bg: #0e1218; --side: #121821; --panel: #161c26; --raise: #1e2531; --well: #0a0d12;
  --line: #28313f; --line-soft: #1f2733; --text: #dce3ec; --text-2: #b4bfcd; --muted: #8794a6; --faint: #5a6677;
  --line-hover: #3a4658; --hover: #263040; --row-hover: #1b2330;
}
:root[data-theme="nether"] {
  --bg: #1a1214; --side: #20161a; --panel: #271b20; --raise: #31232a; --well: #140d10;
  --line: #44313a; --line-soft: #36262d; --text: #eadfdb; --text-2: #cdbdb8; --muted: #a08d8c; --faint: #6f5d5e;
  --line-hover: #5d4450; --hover: #3b2a32; --row-hover: #2f2127;
}
:root[data-theme="light"] {
  --bg: #eceff2; --side: #e2e6ea; --panel: #ffffff; --raise: #f1f3f6; --well: #f7f8fa;
  --line: #ccd2d9; --line-soft: #e3e7eb; --text: #1b2127; --text-2: #38424c; --muted: #5b6671; --faint: #8a939d;
  --line-hover: #aeb7c1; --hover: #e4e8ec; --row-hover: #f3f5f8;
  --danger: #c23e36; --danger-text: #b3342d; --warn: #9c6a12;
  --accent-fg: color-mix(in srgb, var(--accent) 62%, #000);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { zoom: var(--zoom); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); height: calc(100vh / var(--zoom)); }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 14px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark, .logo-pv { width: 28px; height: 28px; flex: none; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); overflow: hidden; display: grid; place-items: center; }
.brand-mark svg, .logo-pv svg { width: 100%; height: 100%; display: block; }
.brand-mark.img, .logo-pv.img { background: transparent; }
.brand-mark img, .logo-pv img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark.pixel img, .logo-pv.pixel img { image-rendering: pixelated; }
.brand-letter { font-weight: 700; font-size: 16px; line-height: 1; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.logo-opt { padding: 5px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--raise); cursor: pointer; display: grid; }
.logo-opt:hover { border-color: var(--line-hover); }
.logo-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.logo-opt .logo-pv { width: 34px; height: 34px; }
.logo-opt .brand-letter { font-size: 19px; }
.logos .btn { margin-left: 4px; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: var(--text); background: var(--raise); }
.nav a[aria-current="page"] { color: var(--text); background: var(--raise); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.side-foot { margin-top: auto; padding: 0 8px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.top h1 { font-size: 17px; font-weight: 600; margin-right: auto; }
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 2px; background: var(--faint); }
.state[data-s="online"] .dot { background: var(--accent); }
.state[data-s="starting"] .dot, .state[data-s="stopping"] .dot { background: var(--warn); animation: blink 1s steps(2, start) infinite; }
.state[data-s="offline"] .dot { background: var(--danger); }
@keyframes blink { 50% { opacity: .25; } }
.controls { display: flex; gap: 8px; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 22px 24px 28px; }
.view.fill { display: flex; flex-direction: column; overflow: hidden; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raise); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--line-hover); background: var(--hover); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, white); border-color: color-mix(in srgb, var(--accent) 86%, white); }
.btn.danger { color: var(--danger-text); border-color: rgba(217, 83, 75, .45); background: transparent; }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { color: var(--text); background: var(--raise); border-color: transparent; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); }
textarea { height: auto; padding: 9px 10px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
label.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 500; }
.field small, .hint { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; background: var(--raise); color: var(--muted); }
.chip.ok { background: var(--accent-soft); color: var(--accent-fg); }
.chip.bad { background: var(--danger-soft); color: var(--danger-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- console view ---------- */
.stats { display: flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 14px; flex: none; overflow: hidden; }
.stat { flex: 1; padding: 11px 16px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 600; margin-top: 1px; white-space: nowrap; }
.stat .v small { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.meter { height: 3px; background: var(--well); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .6s; }
.meter i.hot { background: var(--warn); }
.console-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; }
.term { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--well); overflow: hidden; }
.log { flex: 1; overflow: auto; padding: 10px 14px; font: var(--console-size) / 1.55 var(--mono); }
.log div { white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.log .warn { color: var(--warn); }
.log .err { color: var(--danger-text); }
.log .sys { color: var(--accent-fg); }
.cmd { display: flex; align-items: center; border-top: 1px solid var(--line); background: var(--panel); }
.cmd span { padding: 0 0 0 14px; color: var(--accent-fg); font: 13px var(--mono); }
.cmd input { border: 0; background: transparent; height: 38px; font-family: var(--mono); font-size: 13px; box-shadow: none !important; }
.jump { position: absolute; right: 22px; bottom: 56px; }
.roster { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.roster h3 { font-size: 13px; font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.roster ul { list-style: none; margin: 0; padding: 4px 0; overflow: auto; }
.roster li a { display: block; padding: 6px 14px; color: var(--text); text-decoration: none; }
.roster li a:hover { background: var(--raise); }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; line-height: 1.5; }

/* ---------- tables ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--row-hover); }
td.r, th.r { text-align: right; }
td.act { text-align: right; white-space: nowrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }

/* ---------- files ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-right: auto; font-weight: 500; }
.crumbs button { background: none; border: 0; padding: 4px 6px; border-radius: var(--r-sm); cursor: pointer; color: var(--muted); }
.crumbs button:hover { background: var(--raise); color: var(--text); }
.crumbs button:last-child { color: var(--text); }
.crumbs i { color: var(--faint); font-style: normal; }
.fname { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fname svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.fname.dir svg { color: var(--warn); }
.fname button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.fname button:hover { color: var(--accent-fg); }
.dropzone { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); display: grid; place-items: center; z-index: 50; pointer-events: none; }
.dropzone div { border: 2px dashed var(--accent); border-radius: 10px; padding: 44px 64px; font-size: 18px; font-weight: 500; }
.progress { height: 6px; border-radius: var(--r-sm); background: var(--well); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; width: 0; }
.uploads { margin-bottom: 14px; padding: 12px 14px; display: grid; gap: 8px; }

/* ---------- versions ---------- */
.current { display: flex; gap: 22px; align-items: center; padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; }
.current .k { font-size: 12.5px; color: var(--muted); }
.current .v { font-size: 16px; font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; margin-bottom: -1px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.vitem { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.vitem.cur { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--panel); }
.vitem .id { font-weight: 600; }
.vitem .note { font-size: 12px; color: var(--muted); }
.install-bar { padding: 14px 18px; margin-bottom: 18px; border-color: var(--accent); }

/* ---------- players drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: var(--side); border-left: 1px solid var(--line); z-index: 40; overflow: auto; box-shadow: -18px 0 40px rgba(0, 0, 0, .35); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; position: sticky; top: 0; background: var(--side); border-bottom: 1px solid var(--line); z-index: 1; }
.drawer header h2 { font-size: 18px; }
.drawer section { padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.drawer h3 { font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.avatar { width: 42px; height: 42px; border-radius: var(--r); flex: none; image-rendering: pixelated; background: var(--raise); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini { width: 100%; font-size: 13px; }
.mini td, .mini th { padding: 6px 0; border: 0; border-bottom: 1px solid var(--line-soft); }
.mini tr:last-child td { border-bottom: 0; }
.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .35); }

/* ---------- dialogs, toasts, forms ---------- */
dialog.pfull { font-size: 15.5px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 9, 10, .6); }
dialog form { display: flex; flex-direction: column; }
.d-head { padding: 18px 20px 6px; }
.d-head h2 { font-size: 16px; }
.d-body { padding: 8px 20px 16px; display: grid; gap: 14px; }
.d-foot { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.editor { width: 100%; height: min(60vh, 520px); font: 13px/1.5 var(--mono); background: var(--well); white-space: pre; tab-size: 2; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: var(--r); max-width: 360px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.toast.err { border-left-color: var(--danger); }
.form { max-width: 680px; display: grid; gap: 22px; }
.form section { display: grid; gap: 14px; padding: 18px 20px; }
.form h2 { font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- login ---------- */
.gate { min-height: calc(100vh / var(--zoom)); display: grid; place-items: center; padding: 20px; }
.gate form, .gate .gate-form { width: min(380px, 100%); display: grid; gap: 16px; }
.gate .brand { padding: 0 0 4px; }
.gate h1 { font-size: 22px; }
.err-text { color: var(--danger-text); min-height: 18px; font-size: 13px; }


/* ---------- plugins ---------- */
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { padding-left: 33px; }
.toolbar select { width: auto; min-width: 170px; }
.catbar { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; }
.fchip:hover { color: var(--text); border-color: var(--line-hover); }
.fchip[aria-pressed="true"] { color: var(--accent-fg); border-color: var(--accent); background: var(--accent-soft); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-width: 0; }
.pcard:hover { border-color: var(--line-hover); }
.phead { display: flex; align-items: center; gap: 12px; }
.phead h3 { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phead .grow { min-width: 0; }
.picon { width: 48px; height: 48px; border-radius: var(--r-lg); object-fit: cover; background: var(--raise); flex: none; }
svg.avatar { border-radius: var(--r-lg); flex: none; }
.pdesc { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pfoot { display: flex; align-items: center; gap: 14px; margin-top: auto; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pstat { display: inline-flex; align-items: center; gap: 5px; }
.pstat svg { width: 14px; height: 14px; }
.pcats { display: flex; gap: 5px; margin-left: auto; }
.plink { display: inline-flex; padding: 6px; border-radius: var(--r); color: var(--muted); }
.plink:hover { background: var(--raise); color: var(--text); }
.plink svg { width: 16px; height: 16px; }
.notice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid rgba(217, 165, 72, .45); background: var(--warn-soft); border-radius: var(--r); }
.pact .btn { min-width: 76px; }
.pcard { cursor: pointer; }
.ptitle { all: unset; cursor: pointer; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle:hover { color: var(--accent-fg); }
.ptitle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.pcard .pdesc { cursor: pointer; }
/* ---------- plugin detail view ---------- */
dialog.pfull { width: min(1180px, calc(100vw / var(--zoom) - 32px)); height: calc(100dvh / var(--zoom) - 32px); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
dialog.pfull[open] { display: flex; }
dialog.pfull.max { width: calc(100vw / var(--zoom)); height: calc(100dvh / var(--zoom)); max-width: none; border-radius: 0; border: 0; }
.pfull-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.pfull-head .btn { height: 38px; padding: 0 16px; font-size: 15px; }
.pfull-head .pact .btn { min-width: 96px; }
.pfull-head h2 { font-size: 22px; font-weight: 650; }
.pfull-head .grow { min-width: 0; flex: 1 1 200px; }
.pfull-scroll { overflow: auto; flex: 1; padding: 20px; }
.pfull-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; max-width: 1100px; margin: 0 auto; }
.plead { font-size: 17px; color: var(--text-2); margin-bottom: 14px; }
.pgallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.pgallery[hidden] { display: none; }
.pgallery a { flex: none; }
.pgallery img { height: 220px; width: auto; border-radius: var(--r); border: 1px solid var(--line); display: block; background: var(--raise); }
.pbody { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.pbody > * + * { margin-top: .8em; }
.pbody h1, .pbody h2 { font-size: 1.35em; font-weight: 650; margin-top: 1.4em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.pbody h3, .pbody h4, .pbody h5, .pbody h6 { font-size: 1.08em; font-weight: 650; margin-top: 1.2em; }
.pbody img { max-width: 100%; height: auto; border-radius: var(--r); vertical-align: middle; }
.pbody ul, .pbody ol { padding-left: 1.4em; }
.pbody li + li { margin-top: .25em; }
.pbody a[href] { color: var(--accent-fg); text-decoration: underline; text-underline-offset: 2px; }
.pbody code { font-family: var(--mono); font-size: .9em; background: var(--raise); padding: 1px 5px; border-radius: 4px; }
.pbody pre { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; overflow-x: auto; }
.pbody pre code { background: none; padding: 0; }
.pbody blockquote { border-left: 3px solid var(--line-hover); padding-left: 14px; color: var(--text-2); }
.pbody hr { border: 0; border-top: 1px solid var(--line); }
.pbody table { border-collapse: collapse; display: block; overflow-x: auto; }
.pbody th, .pbody td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.pbody th { background: var(--raise); }
.pside { position: sticky; top: 0; }
.pside h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.facts { display: grid; gap: 10px; margin: 0 0 16px; }
.fact { display: flex; justify-content: space-between; gap: 14px; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.fact dt { color: var(--muted); flex: none; }
.fact dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.plinks { display: grid; gap: 8px; margin-bottom: 14px; }
.plinks a { font-size: 15px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-fg); }
.plinks svg { width: 16px; height: 16px; }
@media (max-width: 820px) { .pfull-grid { grid-template-columns: 1fr; } .pside { position: static; } dialog.pfull, dialog.pfull.max { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; } }
@media (max-width: 820px) { .pgrid { grid-template-columns: 1fr; } }

@media (max-width: 820px) {
  html { zoom: 1; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .side { flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } .brand-sub, .side-foot { display: none; }
  .nav { flex-direction: row; } .nav a { padding: 7px 10px; } .nav a span:not(.count) { display: none; }
  .top, .view { padding-left: 14px; padding-right: 14px; }
  .console-wrap { grid-template-columns: 1fr; } .roster { display: none; }
  .view.fill { min-height: 80vh; }
  .stats { flex-wrap: wrap; } .stat { flex: 1 1 45%; } .stat + .stat { border-left: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
/* source switch + filters on the plugin page */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 2px; background: var(--well); margin-bottom: 12px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.filters { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 14px; }
@media (max-width: 820px) { .panel { overflow-x: auto; } .panel table { min-width: 560px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- appearance settings ---------- */
.look-row { display: grid; gap: 8px; }
.look-row > span { font-weight: 500; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.theme { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 8px; cursor: pointer; text-align: left; display: grid; gap: 7px; }
.theme:hover { border-color: var(--line-hover); }
.theme[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme .pv { height: 44px; border-radius: var(--r-sm); display: grid; grid-template-columns: 26% 1fr; overflow: hidden; border: 1px solid rgba(128, 128, 128, .25); }
.theme .pv i { display: block; }
.theme .pv b { display: grid; align-content: center; gap: 4px; padding: 0 8px; }
.theme .pv b::before, .theme .pv b::after { content: ""; height: 5px; border-radius: 2px; background: var(--c-line); }
.theme .pv b::after { width: 55%; background: var(--c-acc); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); }
.swatches input[type=color] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; cursor: pointer; }

/* ======================================================================== portal */
a.btn { text-decoration: none; }
.nav-sec { margin: 16px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.wrap-w { max-width: 1080px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.scard { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 16px 18px; display: grid; gap: 12px; cursor: pointer; min-width: 0; }
.scard:hover { border-color: var(--line-hover); }
.scard h3 { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .spec { font-size: 13px; color: var(--muted); }
.addr { display: flex; align-items: center; gap: 8px; min-width: 0; }
.addr code { font-family: var(--mono); font-size: 13.5px; background: var(--well); border: 1px solid var(--line-soft); padding: 5px 9px; border-radius: var(--r-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.addr.big code { font-size: 17px; padding: 8px 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raise); color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line-hover); }
.icon-btn svg { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.badge .dot { width: 8px; height: 8px; }
.badge[data-s="running"] .dot { background: var(--accent); }
.badge[data-s="stopped"] .dot, .badge[data-s="failed"] .dot { background: var(--danger); }
.badge[data-s="busy"] .dot { background: var(--warn); animation: blink 1s steps(2, start) infinite; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.plan { text-align: left; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); cursor: pointer; display: grid; gap: 6px; color: var(--text); font: inherit; }
.plan:hover:not(:disabled) { border-color: var(--line-hover); }
.plan[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.plan:disabled { opacity: .5; cursor: not-allowed; }
.plan .pname { font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.plan .ram { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.plan .ram small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.plan .spec { color: var(--text-2); font-size: 13.5px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; color: var(--faint); }
.steps li .mk { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-hover); display: grid; place-items: center; flex: none; }
.steps li.done { color: var(--text-2); }
.steps li.done .mk { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.done .mk svg { width: 12px; height: 12px; }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now .mk { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.callout { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-radius: var(--r-lg); margin-bottom: 16px; }
.callout h2 { font-size: 15px; }
.callout.bad { border-color: rgba(217, 83, 75, .5); background: var(--danger-soft); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.box { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 16px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.box h2 { font-size: 14px; color: var(--muted); font-weight: 600; }
.danger-zone { border-color: rgba(217, 83, 75, .35); }
.danger-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.danger-row + .danger-row { border-top: 1px solid var(--line-soft); }
.danger-row .grow { min-width: 0; }
.danger-row b { display: block; font-weight: 600; margin-bottom: 2px; }
.buildlog { font-family: var(--mono); font-size: 12px; line-height: 1.5; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.checks .ok { color: var(--accent-fg); font-weight: 600; } .checks .no { color: var(--danger-text); font-weight: 600; }
.fp { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.auth-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.auth-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 2px; margin-right: 14px; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.plan-table input { min-width: 0; }
.plan-table td { padding: 6px 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.activity time { color: var(--faint); flex: none; width: 92px; }
.activity .who { color: var(--muted); }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } .danger-row { flex-wrap: wrap; } }

/* ---------- addresses */
.suffix { display: flex; align-items: stretch; min-width: 0; }
.suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; flex: 1; }
.suffix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r) var(--r) 0; background: var(--raise); color: var(--muted); font-family: var(--mono); font-size: 13px; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.hint.good { color: var(--accent-fg); } .hint.bad { color: var(--danger-text); }
.routes { display: grid; gap: 8px; justify-items: start; }
.route-row { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; }
.dnsbox { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--well); }
.dnsbox .mini td { padding: 4px 14px 4px 0; }
@media (max-width: 820px) { .route-row { grid-template-columns: 1fr; } .route-row > .muted { display: none; } }

/* ======================================================================== landing page */
.back-home { justify-self: start; font-size: 13px; text-decoration: none; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 600; }
.landing { min-height: 100vh; background: var(--bg); color: var(--text); }
.lwrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.lwrap.narrow { max-width: 760px; }
.center { text-align: center; justify-content: center; }
.lnav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.lnav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.lbrand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 16px; }
.lbrand .brand-mark { width: 30px; height: 30px; }
.lnav-links { display: flex; gap: 22px; margin-left: 12px; }
.lnav-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.lnav-link:hover { color: var(--text); }
.lnav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.hero { position: relative; padding: 72px 0 80px; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, #000 20%, transparent 75%); }
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow { color: var(--accent-fg); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -.025em; font-weight: 720; }
.lead { font-size: 17.5px; line-height: 1.6; color: var(--text-2); margin-top: 18px; max-width: 540px; }
.lead .mono { font-family: var(--mono); font-size: .92em; color: var(--text); background: var(--raise); padding: 1px 6px; border-radius: 4px; }
.hero-cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: 13.5px; min-height: 1.4em; }

/* product preview */
.preview { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .03) inset; overflow: hidden; font-size: 12.5px; user-select: none; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--side); }
.pv-lock { width: 9px; height: 10px; border: 1.6px solid var(--accent); border-radius: 2px; position: relative; top: 1px; }
.pv-lock::before { content: ""; position: absolute; left: 1px; top: -6px; width: 4px; height: 5px; border: 1.6px solid var(--accent); border-bottom: 0; border-radius: 4px 4px 0 0; }
.pv-url { font-family: var(--mono); color: var(--muted); font-size: 12px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 5px; padding: 4px 10px; flex: 1; }
.pv-url b { color: var(--text); font-weight: 500; }
.pv-app { display: grid; grid-template-columns: 132px minmax(0, 1fr); min-height: 330px; }
.pv-side { background: var(--side); border-right: 1px solid var(--line); padding: 12px 8px; display: grid; align-content: start; gap: 2px; }
.pv-brand { display: flex; align-items: center; gap: 7px; font-weight: 650; padding: 2px 6px 12px; }
.pv-mark { width: 16px; height: 16px; border-radius: 4px; background: var(--accent); }
.pv-nav { padding: 6px 8px; border-radius: 5px; color: var(--muted); }
.pv-nav.on { background: var(--raise); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.pv-main { display: flex; flex-direction: column; min-width: 0; }
.pv-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pv-top b { margin-right: auto; font-size: 13.5px; }
.pv-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.pv-state i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.pv-btn { border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px; background: var(--raise); }
.pv-btn.red { color: var(--danger-text); background: transparent; border-color: rgba(217, 83, 75, .45); }
.pv-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.pv-stats > div { padding: 9px 14px; display: grid; gap: 2px; }
.pv-stats > div + div { border-left: 1px solid var(--line); }
.pv-stats small { color: var(--muted); font-size: 11px; }
.pv-stats b { font-size: 14.5px; }
.pv-meter { height: 3px; background: var(--well); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.pv-meter i { display: block; height: 100%; background: var(--accent); }
.pv-log { flex: 1; background: var(--well); font-family: var(--mono); font-size: 11.5px; line-height: 1.75; padding: 10px 14px; color: var(--text-2); overflow: hidden; }
.pv-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-log .t { color: var(--faint); }

/* sections */
.lsec { padding: 76px 0; border-bottom: 1px solid var(--line-soft); }
.lsec.alt { background: var(--side); }
.lsec h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; font-weight: 700; }
.sec-lead { color: var(--muted); font-size: 16.5px; margin-top: 10px; max-width: 620px; line-height: 1.55; }
.center .sec-lead { margin-left: auto; margin-right: auto; }
.steps3 { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps3 li { display: flex; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.step-n { flex: none; width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.steps3 h3, .feature h3 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.steps3 p, .feature p { color: var(--muted); line-height: 1.55; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.f-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-fg); margin-bottom: 14px; }
.f-ico svg { width: 20px; height: 20px; }
.plans.static { margin: 30px 0 30px; }
.plans.static .plan { cursor: default; }
.plans.static .plan.sold { opacity: .55; }
.plan .price { color: var(--accent-fg); font-weight: 600; font-size: 14px; margin-top: 2px; }
.qa { border-bottom: 1px solid var(--line); }
.qa:first-of-type { margin-top: 24px; border-top: 1px solid var(--line); }
.qa summary { cursor: pointer; padding: 16px 2px; font-weight: 600; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.qa[open] summary::after { content: "–"; }
.qa p { color: var(--text-2); padding: 0 2px 18px; line-height: 1.6; max-width: 640px; }
.cta-band { background: radial-gradient(ellipse 60% 120% at 50% 100%, var(--accent-soft), transparent 70%); }
.lfoot { padding: 26px 0 40px; font-size: 13px; }
.lfoot-in { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.lfoot-in .muted { flex: 1; min-width: 240px; }
@media (max-width: 900px) {
  .hero { padding: 44px 0 56px; }
  .hero-in { grid-template-columns: 1fr; gap: 40px; }
  .steps3, .features { grid-template-columns: 1fr; }
  .lnav-links { display: none; }
  .lsec { padding: 56px 0; }
}
@media (max-width: 520px) {
  .lwrap { padding: 0 16px; }
  .pv-app { grid-template-columns: 1fr; } .pv-side { display: none; }
  .lnav-cta .btn.quiet { padding: 0 8px; }
}

/* ---------- error states */
.crash { max-width: 620px; margin: 40px auto; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); display: grid; gap: 12px; }
.gate .crash { margin: 0; }
.crash-code { font: 600 12.5px var(--mono); letter-spacing: .08em; color: var(--accent-fg); }
.crash h2 { font-size: 20px; }
.crash-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.crash-details pre { margin: 8px 0 0; padding: 10px 12px; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r); font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; color: var(--text-2); }
