/* FloraHost panel — calm and light (Tailscale-like), green accent. Dark via system or toggle. */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f4;
  --bg-inset: #f7f7f4;
  --bg-hover: #f1f1ec;
  --border: #dededa;
  --border-muted: #ebebe6;
  --fg: #1b1d1a;
  --fg-muted: #555a52;
  --link: #2b6a26;
  --primary: #2e7d32;
  --primary-hover: #276b2b;
  --primary-fg: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --attention: #8a5a00;
  --attention-bg: #fff6dc;
  --info-bg: #eef4fb;
  --info-border: #b9cde8;
  --success-fg: #2e7d32;
  --ok-bg: #e7f3e4;
  --ok-fg: #245f21;
  --btn-bg: #ffffff;
  --btn-hover: #f4f4f0;
  --btn-border: #d9d9d3;
  --shadow: none;
  --overlay-shadow: 0 12px 32px #14181224, 0 2px 6px #1418120f;
  --focus: #2e7d32;
  --tab-active: #2e7d32;
  --dot-run: #2e9e3e;
  --dot-off: #8a8f86;
  --moon: #4a5d80;
  --console-bg: #16181a;
  --console-fg: #c9cdc6;
  --radius: 8px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121411; --bg-subtle: #0c0e0b; --bg-inset: #0a0b09; --bg-hover: #1c1f1a;
    --border: #2e322b; --border-muted: #24271f;
    --fg: #eef0eb; --fg-muted: #a3a89e; --link: #8fd47e;
    --primary: #2e8b3a; --primary-hover: #34983f; --primary-fg: #ffffff;
    --danger: #ff7b72; --danger-bg: #ff7b721a; --attention: #e3b341; --attention-bg: #e3b3411f;
    --info-bg: #1d2a3a; --info-border: #34506f; --success-fg: #8fd47e; --ok-bg: #1d3319; --ok-fg: #a6e294;
    --btn-bg: #1a1d18; --btn-hover: #22261f; --btn-border: #353a31;
    --overlay-shadow: 0 12px 32px #000a; --focus: #5fcb3a; --tab-active: #5fcb3a; --dot-run: #5fcb3a; --dot-off: #7b8177; --moon: #9db1d6;
    --console-bg: #0a0b09;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121411; --bg-subtle: #0c0e0b; --bg-inset: #0a0b09; --bg-hover: #1c1f1a;
  --border: #2e322b; --border-muted: #24271f;
  --fg: #eef0eb; --fg-muted: #a3a89e; --link: #8fd47e;
  --primary: #2e8b3a; --primary-hover: #34983f; --primary-fg: #ffffff;
  --danger: #ff7b72; --danger-bg: #ff7b721a; --attention: #e3b341; --attention-bg: #e3b3411f;
  --info-bg: #1d2a3a; --info-border: #34506f; --success-fg: #8fd47e; --ok-bg: #1d3319; --ok-fg: #a6e294;
  --btn-bg: #1a1d18; --btn-hover: #22261f; --btn-border: #353a31;
  --overlay-shadow: 0 12px 32px #000a; --focus: #5fcb3a; --tab-active: #5fcb3a; --dot-run: #5fcb3a; --dot-off: #7b8177; --moon: #9db1d6;
  --console-bg: #0a0b09;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
code { font-family: var(--mono); font-size: 12px; background: var(--bg-subtle); border: 1px solid var(--border-muted); padding: 0 4px; border-radius: 4px; }
.muted { color: var(--fg-muted); font-weight: 400; }
.hint { color: var(--fg-muted); font-size: 12px; margin: 8px 0 0; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.grow { flex: 1; min-width: 0; }

/* icons */
.ic { width: 16px; height: 16px; flex-shrink: 0; vertical-align: text-bottom; }
.ic.lg { width: 24px; height: 24px; }
.logo-ic { color: var(--primary); width: 26px; height: 26px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius);
  background: var(--btn-bg); color: var(--fg); border: 1px solid var(--btn-border);
  box-shadow: var(--shadow); font: inherit; font-weight: 500; line-height: 1; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .1s, border-color .1s;
}
.btn:hover { background: var(--btn-hover); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabs button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: -1px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { color: var(--fg-muted); }
.btn.primary { background: var(--primary); border-color: #1f23281a; color: var(--primary-fg); }
.btn.primary .ic { color: currentColor; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger .ic { color: currentColor; }
.btn.danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--fg-muted); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }
.icon-btn.bordered { border-color: var(--btn-border); }

input, textarea, select {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  height: 32px; padding: 0 12px; font: inherit; min-width: 0; outline: none;
}
textarea { height: auto; padding: 8px 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
input::placeholder { color: var(--fg-muted); opacity: .8; }
input.num { width: 80px; }
input[type="checkbox"] { height: auto; accent-color: var(--primary); width: 15px; height: 15px; margin: 0; }
.field-label { font-weight: 600; font-size: 14px; }

.search-input, .input-ic { position: relative; display: flex; align-items: center; }
.search-input .ic, .input-ic .ic { position: absolute; left: 9px; color: var(--fg-muted); pointer-events: none; }
.search-input input, .input-ic input { width: 100%; padding-left: 32px; }
.search-input.small input { height: 28px; width: 200px; font-size: 13px; }

.row { display: flex; gap: 8px; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* labels, counters, dots */
.label {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--fg-muted);
}
.label.running { color: var(--success-fg); border-color: currentColor; }
.label.starting, .label.stopping, .label.busy { color: var(--attention); border-color: currentColor; }
.counter {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-hover);
  border: 1px solid transparent; font-size: 12px; font-weight: 500; line-height: 18px; text-align: center; color: var(--fg);
}
.counter:empty { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot-off); flex-shrink: 0; display: inline-block; }
.dot.running { background: var(--dot-run); }
.dot.starting, .dot.stopping { background: var(--attention); }
.dot.busy { background: var(--link); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

/* ---------- sign in ---------- */
/* sign-in: the panel's own look — brand mark, one calm card, the switch link under it */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 64px; background: var(--bg-subtle); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--fg); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none !important; }
.login-brand .brand-mark { width: 30px; height: 30px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(20, 24, 18, .06);
}
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.login-card input:not([type=checkbox]) { height: 42px; font-size: 15px; }
.login-card .btn.block { height: 42px; font-size: 15px; margin-top: 4px; }
.login-card .hint { margin: 0; }
.login-sent { margin: 0; color: var(--fg-muted); font-size: 14px; }
.code-input { text-align: center; font: 600 22px var(--mono) !important; letter-spacing: 10px; }
.login-links { display: flex; justify-content: space-between; }
.login-switch { width: 100%; max-width: 400px; margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--fg-muted); }
.link-btn { background: none; border: 0; color: var(--link); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.login-foot { color: var(--fg-muted); font-size: 12.5px; margin-top: 16px; text-align: center; max-width: 400px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--overlay-shadow);
}
.menu-head { padding: 6px 10px; font-size: 12px; color: var(--fg-muted); }
.menu-head b { color: var(--fg); font-size: 13px; word-break: break-all; }
.menu-sep { height: 1px; background: var(--border-muted); margin: 6px 0; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius);
  background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.menu-item .ic { color: var(--fg-muted); }
.menu-item:hover { background: var(--bg-hover); }

.view { display: flex; flex-direction: column; gap: 16px; }

/* ---------- page heads ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; }
.server-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.server-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.server-title h1 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; }
.meta { display: flex; gap: 6px 20px; flex-wrap: wrap; color: var(--fg-muted); font-size: 13px; margin-top: -6px; }
.meta b { color: var(--fg); font-weight: 600; }
.meta .copy { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: var(--radius); background: var(--bg-subtle); border: 1px solid var(--border-muted); color: var(--fg); }
.meta .copy:hover { border-color: var(--focus); }
.meta .copy .ic { width: 13px; height: 13px; color: var(--fg-muted); }

/* stats (overview) */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: baseline; gap: 8px; }
.stat-n { font-size: 26px; font-weight: 600; line-height: 1; }
.stat-l { color: var(--fg-muted); }

/* flash banners */
.flash { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--info-border); background: var(--info-bg); }
.flash.warn { border-color: #d4a72c66; background: var(--attention-bg); }

/* underline tabs */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 0; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; height: 48px; background: none; border: 0;
  border-bottom: 2px solid transparent; color: var(--fg); font: inherit; cursor: pointer; white-space: nowrap; position: relative;
}
.tabs button .ic { color: var(--fg-muted); }
.tabs button:hover::after { content: ""; position: absolute; inset: 8px 0; border-radius: var(--radius); background: var(--bg-hover); z-index: -1; }
.tabs button.active { border-bottom-color: var(--tab-active); font-weight: 600; }
.tabs button.active .ic { color: var(--fg); }
.tab { display: none; flex-direction: column; gap: 16px; }
.tab.active { display: flex; }

/* ---------- boxes & lists ---------- */
.box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.box-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; min-height: 48px; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.box-head h2 { font-size: 14px; }
.box-body { padding: 16px; }
.box-body.tight { padding: 10px 16px; border-bottom: 1px solid var(--border-muted); }
.box-foot { padding: 10px 16px; border-top: 1px solid var(--border-muted); color: var(--fg-muted); font-size: 12px; }
.details > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.details > summary::-webkit-details-marker { display: none; }
.details[open] > summary { border-bottom: 1px solid var(--border); }
.details .chev { color: var(--fg-muted); transition: transform .15s; }
.details[open] .chev { transform: rotate(180deg); }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-muted); min-height: 52px; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--bg-subtle); }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .name .muted { font-weight: 400; font-size: 12px; }
.item .sub { color: var(--fg-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.off .name { color: var(--fg-muted); font-weight: 400; }
.item .btns { display: flex; gap: 6px; flex-shrink: 0; }
.node-step { margin: 0 0 8px; }
.node-step + .node-form, .install-box + .node-step, .install-row + .node-step { margin-top: 16px; }
.install-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.install-box { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.install-box pre { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; background: var(--bg-subtle); border: 1px solid var(--border-muted); border-radius: 6px; white-space: pre-wrap; max-height: 120px; overflow: auto; }
.item .sub .warn-text { color: var(--danger-fg, #d1242f); }
.empty { color: var(--fg-muted); padding: 24px 16px; text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* overview rows */
.ov-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--border-muted); }
.ov-row:first-child { border-top: 0; }
.ov-row:hover { background: var(--bg-subtle); }
.ov-main { flex: 1; min-width: 0; }
.ov-name { font-size: 15px; font-weight: 600; color: var(--link); cursor: pointer; }
.ov-name:hover { text-decoration: underline; }
.ov-sub { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--fg-muted); font-size: 12px; margin-top: 4px; }
.ov-sub span { display: inline-flex; align-items: center; gap: 4px; }
.ov-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ov-empty { padding: 40px 16px; text-align: center; color: var(--fg-muted); }
.ov-empty h3 { color: var(--fg); margin-bottom: 6px; font-size: 16px; }

/* toggle switch (mods) */
.switch { position: relative; width: 32px; height: 18px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 18px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }

/* drop zone */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-top: 14px;
  min-height: 96px; padding: 16px; text-align: center; color: var(--fg-muted); cursor: pointer;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg-subtle); transition: border-color .1s, background .1s;
}
.drop:hover, .drop.over { border-color: var(--focus); color: var(--fg); background: var(--info-bg); }
.small-drop { min-height: 0; padding: 10px; margin-top: 8px; }
.install-log { margin-top: 14px; font: 12px/1.6 var(--mono); background: var(--bg-subtle); border: 1px solid var(--border-muted); border-radius: var(--radius); padding: 10px 12px; white-space: pre-wrap; }
.install-log .err { color: var(--danger); }
.install-log .ok { color: var(--success-fg); }

/* ---------- console ---------- */
.console-wrap { position: relative; height: clamp(320px, calc(100vh - 380px), 900px); }
.log {
  position: absolute; inset: 0; overflow: auto; background: var(--console-bg); color: var(--console-fg);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.log .t { color: #6e7681; margin-right: 10px; user-select: none; }
.log .w { color: #d29922; }
.log .e { color: #ff7b72; }
.log .p { color: #79c0ff; }
.log .c { color: #7ee787; }
.log .sep { color: #484f58; text-align: center; }
.to-bottom {
  position: absolute; right: 14px; bottom: 12px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--primary); color: #fff; border: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px #0006;
}
.cmd { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 4px 4px 12px; background: var(--bg); }
.cmd:focus-within { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.cmd .prompt { color: var(--fg-muted); font: 600 14px var(--mono); }
.cmd input { flex: 1; border: 0; box-shadow: none !important; background: transparent; font-family: var(--mono); font-size: 13px; padding: 0 4px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-top: -6px; }
.quick button {
  height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
  color: var(--fg); font: 12px var(--mono); cursor: pointer;
}
.quick button:hover { background: var(--bg-hover); border-color: var(--fg-muted); }

/* ---------- settings ---------- */
.subhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-muted); margin-top: 8px; }
.subhead h2 { font-size: 20px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 180px 1fr; gap: 14px 16px; align-items: center; max-width: 860px; }
.form-grid > label { font-weight: 600; font-size: 14px; }
.form-grid .hint { margin-top: 6px; }
textarea#props { width: 100%; min-height: 420px; font: 12px/1.6 var(--mono); resize: vertical; background: var(--bg-subtle); }
.danger-title h2 { color: var(--fg); }
.danger-box { border-color: var(--danger); }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; }
.danger-row p { margin: 2px 0 0; font-size: 13px; }

.seg { display: inline-flex; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; background: none; border: 1px solid transparent; border-radius: 5px; color: var(--fg-muted); font: inherit; font-weight: 500; cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button.active { background: var(--bg); color: var(--fg); border-color: var(--border); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: #1f232866; display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal-card {
  width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--overlay-shadow); overflow: hidden;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-muted); }
.modal-head h2 { font-size: 14px; }
.modal-body { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-body .form-grid { grid-template-columns: 120px 1fr; }
.modal-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-muted); background: var(--bg-subtle); }
.modal-actions .muted { flex: 1; font-size: 12px; }
.modal select { width: 100%; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; max-width: min(480px, calc(100vw - 32px)); }
.toast {
  background: var(--fg); color: var(--bg); border-radius: var(--radius); padding: 10px 16px; font-weight: 500;
  box-shadow: var(--overlay-shadow); animation: toast-in .18s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hide-narrow { display: none; }
  .brand span { max-width: 52vw; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { flex-direction: column; gap: 2px; padding: 10px 12px; }
  .stat-n { font-size: 22px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .row { flex-direction: column; }
  .row .btn { width: 100%; }
  .form-grid, .modal-body .form-grid { grid-template-columns: 1fr; gap: 6px; }
  .form-grid > span:empty { display: none; }
  .form-grid > label:not(:first-child) { margin-top: 10px; }
  .search-input.small input { width: 140px; }
  .ov-row { flex-wrap: wrap; }
  .ov-actions { width: 100%; }
  .ov-actions .btn { flex: 1; }
  .danger-row { flex-direction: column; align-items: stretch; }
  .item { padding: 10px 12px; }
  .console-wrap { height: 60vh; }
}

/* nodes */
.side-offline { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 12px; color: var(--attention); }
.side-offline .dot { background: var(--attention); }
.section-lead { margin: -8px 0 0; font-size: 13px; }
.node-add { border-top: 1px solid var(--border-muted); }
.node-form { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 8px; }
@media (max-width: 900px) { .node-form { grid-template-columns: 1fr; } }

/* ---------- server settings form ---------- */
.set-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--topbar-h, 110px) + 16px); display: flex; flex-direction: column; gap: 2px; }
.set-nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--fg); text-decoration: none; font-size: 14px; }
.set-nav a:hover { background: var(--bg-hover); }
.set-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.set-top input { flex: 1; max-width: 360px; }
.set-top .btn { margin-left: auto; }
.set-section { margin-bottom: 8px; scroll-margin-top: 72px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 300px); gap: 6px 24px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-muted); }
.set-row:first-child { border-top: 0; }
.set-row.changed { box-shadow: inset 3px 0 0 var(--attention); }
.set-label { font-weight: 600; font-size: 14px; }
.set-key { margin-left: 8px; font: 400 11px var(--mono); color: var(--fg-muted); }
.set-desc { color: var(--fg-muted); font-size: 12px; margin-top: 2px; }
.set-ctl { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.set-ctl input:not([type=checkbox]), .set-ctl select { width: 100%; min-width: 0; }
.set-ctl .unit { color: var(--fg-muted); font-size: 12px; white-space: nowrap; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px 10px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--overlay-shadow); }
.save-bar span { flex: 1; font-weight: 600; }
#restartNote { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
#restartNote span { flex: 1; }
#restartNote.hidden { display: none; }
@media (max-width: 760px) {
  .set-layout { grid-template-columns: 1fr; gap: 8px; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .set-nav a { white-space: nowrap; border: 1px solid var(--border-muted); }
  .set-row { grid-template-columns: 1fr; }
  .set-ctl { justify-content: flex-start; }
}

/* backups */
.box-head .btns { display: flex; gap: 8px; align-items: center; }
.btn.disabled { pointer-events: none; opacity: .6; }
.item .name .label { margin-left: 6px; font-weight: 400; }

/* ---------- games ---------- */
.game-ic { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; }
.game-ic.lg { width: 40px; height: 40px; }
.section-title { font-size: 16px; margin-top: 8px; }

/* sidebar tree: game → its servers */
.game-tree { display: flex; flex-direction: column; gap: 10px; }
.side-game-row { display: flex; align-items: center; gap: 2px; }
.side-game-row .icon-btn { width: 26px; height: 26px; flex-shrink: 0; }
.side-game-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); color: var(--fg); font-weight: 600; position: relative; }
.side-game-head:hover { background: var(--bg-hover); text-decoration: none; }
.side-game-head.active { background: var(--bg-hover); }
.side-game-head.active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 4px; border-radius: 6px; background: var(--focus); }
.side-game-head .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-game .side-list { margin-left: 15px; padding-left: 6px; border-left: 1px solid var(--border-muted); }
a.side-server { color: inherit; }
a.side-server:hover { text-decoration: none; }

/* home: game cards */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.game-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); box-shadow: var(--shadow); transition: border-color .15s; }
a.game-card:hover { border-color: var(--focus); text-decoration: none; }
a.game-card:hover .chev { color: var(--fg); transform: translateX(2px); }
.game-card-top { display: flex; align-items: center; gap: 12px; }
.game-card-name { font-size: 16px; font-weight: 600; }
.game-card-tag { color: var(--fg-muted); font-size: 12px; margin-top: 2px; }
.game-card .chev { color: var(--fg-muted); transition: transform .15s; }
.game-card .chev .ic { transform: rotate(-90deg); }
.game-card-stats { display: flex; gap: 16px; color: var(--fg-muted); font-size: 13px; }
.game-card-stats b { color: var(--fg); font-weight: 600; }
.game-card-live { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; padding-top: 12px; border-top: 1px solid var(--border-muted); }
.game-card-live > span { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card.soon { border-style: dashed; box-shadow: none; background: none; justify-content: center; }
.game-card.soon .game-card-name { color: var(--fg-muted); }
.soon-ic { width: 40px; height: 40px; padding: 8px; color: var(--fg-muted); border-radius: var(--radius); background: var(--bg-subtle); flex-shrink: 0; }

/* one game's page */
.game-title { display: flex; align-items: center; gap: 14px; min-width: 0; }

/* new server dialog */
#newTitle { display: flex; align-items: center; gap: 8px; }
#newTitle .game-ic { width: 20px; height: 20px; }
.game-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.game-pick button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit; font-weight: 500; cursor: pointer; }
.game-pick button.active { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }

@media (max-width: 760px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-ic.lg { width: 32px; height: 32px; }
}

/* ---------- files ---------- */
.fm-head { flex-wrap: wrap; gap: 8px; }
.fm-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; min-width: 0; font-size: 14px; }
.fm-crumbs a { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--link); font-weight: 600; }
.fm-crumbs a .ic { color: var(--fg-muted); }
.fm-crumbs b { font-weight: 600; word-break: break-all; }
.fm-crumbs .sep { color: var(--fg-muted); }
#fmBox.over { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
#fmBox.over .fm-list { background: var(--info-bg); }
.fm-row { min-height: 40px; padding: 6px 16px; gap: 10px; }
.fm-row.sel { background: var(--info-bg); }
.fm-row > span:first-child { width: 16px; }
.fm-check { margin: 0; width: 16px; height: 16px; flex-shrink: 0; }
.fm-ic { color: var(--fg-muted); flex-shrink: 0; }
.fm-ic.dir { color: #54aeff; }
.fm-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.fm-name { color: var(--fg); cursor: pointer; }
.fm-row:hover .fm-name { color: var(--link); }
.fm-size, .fm-date { color: var(--fg-muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.fm-size { width: 72px; text-align: right; }
.fm-date { width: 110px; text-align: right; }
.fm-acts { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; }
.fm-row:hover .fm-acts, .fm-row:focus-within .fm-acts { opacity: 1; }
.fm-acts .icon-btn { width: 28px; height: 28px; color: var(--fg-muted); }
.fm-acts .icon-btn:hover { color: var(--fg); }
.fm-acts .icon-btn.danger:hover { color: var(--danger-fg, #d1242f); }
.fm-state { font-size: 12px; }
.fm-text { display: block; width: 100%; min-height: 60vh; border: 0; border-radius: 0; resize: vertical; padding: 12px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5; tab-size: 2; background: var(--bg-inset, var(--bg)); color: var(--fg); white-space: pre; overflow: auto; }
.fm-text:focus { outline: none; box-shadow: none; }
@media (hover: none), (max-width: 760px) {
  .fm-acts { opacity: 1; }
  .fm-date { display: none; }
}
@media (max-width: 760px) {
  .fm-row { padding: 6px 12px; }
  .fm-size { width: auto; }
}

/* ---------- usage charts ---------- */
:root { --chart-1: #0969da; --chart-grid: #d1d9e0b3; --chart-ref: #9a6700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-1: #4493f8; --chart-grid: #3d444db3; --chart-ref: #d29922; } }
:root[data-theme="dark"] { --chart-1: #4493f8; --chart-grid: #3d444db3; --chart-ref: #d29922; }
.usage-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.usage-bar .muted { font-size: 12px; }
.usage-stats .stat-l { font-size: 13px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; transition: opacity .15s; }
.chart-grid.loading { opacity: .5; }
.chart-card .box-head { display: flex; align-items: baseline; gap: 8px; justify-content: flex-start; }
.chart-sub { font-size: 12px; }
.chart { position: relative; padding: 8px 8px 4px; outline: none; }
.chart:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); border-radius: var(--radius); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { fill: var(--fg-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-1); fill-opacity: .12; stroke: none; }
.chart .ref { stroke: var(--chart-ref); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-label { fill: var(--fg-muted); font-size: 11px; }
.chart .cross { stroke: var(--fg-muted); stroke-width: 1; }
.chart .pt { fill: var(--chart-1); stroke: var(--bg); stroke-width: 2; }
.chart .hidden { display: none; }
.chart-empty { position: absolute; inset: 40% 0 auto; text-align: center; color: var(--fg-muted); font-size: 12px; pointer-events: none; }
.chart .tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--overlay-shadow, 0 4px 12px #0002);
  padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; white-space: nowrap; font-size: 12px; z-index: 2; }
.chart .tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart .tip span { color: var(--fg-muted); }
.usage-table summary { cursor: pointer; color: var(--fg-muted); font-size: 13px; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border-muted); }
.data-table th { color: var(--fg-muted); font-weight: 600; font-size: 12px; }

/* node meters (Panel settings → Nodes) */
/* nodes: a card per node — capacity first (memory sold to customers), then what runs now */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.node-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.node-card.offline { background: var(--bg-subtle); }
.node-top { display: flex; align-items: flex-start; gap: 10px; }
.node-top .grow { min-width: 0; }
.node-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; }
.node-title .dot { flex: none; }
.node-url { margin-top: 3px; padding-left: 16px; font: 12.5px var(--mono); color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-cap-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--fg-muted); }
.node-cap-label b { color: var(--fg); font-weight: 600; }
.node-cap-bar { height: 8px; border-radius: 4px; background: var(--bg-inset); overflow: hidden; margin-top: 6px; }
.node-cap-bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.node-cap-bar span.warn { background: var(--attention); }
.node-cap-bar span.full { background: var(--danger); }
.node-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.node-stats .k { font-size: 12px; color: var(--fg-muted); }
.node-stats .v { margin-top: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.node-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border-muted); font-size: 13px; color: var(--fg-muted); }
.node-foot .pill { font-size: 12px; }
.node-warn { font-size: 13px; }
.node-add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 220px; border: 1.5px dashed var(--border); border-radius: 14px; background: none; color: var(--fg-muted); font: inherit; font-size: 15px; cursor: pointer; }
.node-add-card:hover { border-color: var(--fg-muted); color: var(--fg); }
.node-add-card .ic { width: 22px; height: 22px; }
.row-menu { position: relative; display: inline-block; }
.row-menu .menu { min-width: 190px; text-align: left; }
.icon-btn.dots { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ic { color: var(--danger); }
#nodeAddModal .modal-card { max-width: 640px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--fg-muted); }
.meter-top b { color: var(--fg); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter-bar { height: 6px; border-radius: 3px; background: var(--bg-subtle); border: 1px solid var(--border-muted); overflow: hidden; margin-top: 4px; }
.meter-bar span { display: block; height: 100%; background: var(--chart-1); border-radius: 2px; }
@media (max-width: 760px) {
  .chart-grid { grid-template-columns: 1fr; }
  .node-usage { grid-template-columns: 1fr; }
}
.usage-stats .stat { flex-wrap: wrap; }
.usage-stats .stat-n { white-space: nowrap; }

/* ---------- schedule ---------- */
.task-card { max-width: 620px; }
#tCommand { width: 100%; font-family: var(--mono); font-size: 13px; }
.day-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.day-pick .day input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick .day span { display: inline-block; min-width: 42px; text-align: center; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--fg-muted); background: var(--bg); }
.day-pick .day input:checked + span { color: var(--fg); border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); background: var(--info-bg); }
.day-pick .day input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
#taskList .item .name code { font-weight: 400; }
#taskList .item .name .muted { font-weight: 400; font-size: 13px; margin-left: 4px; }

/* ---------- access levels: hide what the signed-in person can't do ---------- */
body:not(.is-admin) [data-need="admin"],
body:not(.can-create) [data-need="create"],
body.is-admin [data-need="customer"],
body:not(.is-admin):not([data-owned="true"]) [data-need="owner"],
body[data-level="view"] [data-need="operate"],
body[data-level="view"] [data-need="manage"],
body[data-level="operate"] [data-need="manage"] { display: none !important; }
.access-pill { font-size: 11px; }

/* people */
.user-row { flex-wrap: wrap; }
.user-row select { width: auto; }
.user-access { flex-basis: 100%; margin: 4px 0 2px; border: 1px solid var(--border-muted); border-radius: var(--radius); background: var(--bg-subtle); }
.user-access .acc-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--border-muted); }
.user-access .acc-row:first-child { border-top: 0; }
.user-access .acc-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.user-access .acc-row .muted { font-size: 12px; }
.user-access select { height: 28px; font-size: 13px; }

/* activity */
.audit-filters { gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.audit-filters select { width: auto; max-width: 260px; height: 30px; font-size: 13px; }
.audit-row { align-items: flex-start; min-height: 0; padding: 8px 16px; }
.audit-row .when { color: var(--fg-muted); font-size: 12px; width: 108px; flex-shrink: 0; padding-top: 2px; font-variant-numeric: tabular-nums; }
.audit-row .what { font-size: 13px; }
.audit-row .what b { font-weight: 600; }
.audit-row .detail { color: var(--fg-muted); font-size: 12px; word-break: break-word; }
.audit-foot:has(.hidden) { display: none; }
@media (max-width: 760px) { .audit-row { flex-wrap: wrap; } .audit-row .when { width: 100%; } }

/* ---------- plans (Panel settings → Plans) ---------- */
.plan-row { flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.plan-row .plan-id { min-width: 80px; align-self: center; }
.plan-f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--fg-muted); }
.plan-f input { width: 120px; }
.plan-f input.num { width: 64px; }
.price { white-space: nowrap; }
.always-on { margin-top: 6px; font-size: 12px; color: var(--fg-muted); }

/* ================= Tailscale-like shell ================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
#app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-subtle); }
/* the header stays on top while the page scrolls; --topbar-h is its height (set by app.js) */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
html { scroll-padding-top: calc(var(--topbar-h, 110px) + 12px); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--fg); font-weight: 600; font-size: 15px; text-decoration: none !important; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; flex-shrink: 0; }
.appbar-right { display: flex; align-items: center; gap: 18px; }
.top-link { color: var(--fg-muted); font-size: 14.5px; }
.top-link:hover { color: var(--fg); text-decoration: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font: 600 14px/1 var(--font); text-transform: uppercase;
}
.topnav { display: flex; gap: 28px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.topnav a {
  display: flex; align-items: center; gap: 7px; padding: 14px 2px 12px; border-bottom: 2px solid transparent;
  color: var(--fg-muted); font-size: 15px; white-space: nowrap; text-decoration: none !important;
}
.topnav a:hover { color: var(--fg); }
.topnav a .ic { color: currentColor; }
.topnav a[aria-current="page"] { color: var(--tab-active); border-bottom-color: var(--tab-active); font-weight: 500; }
.content { flex: 1; background: var(--bg); padding: 36px 0 64px; }
.page-head { align-items: flex-start; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin-top: 8px; font-size: 15px; max-width: 680px; }
.h2 { font-size: 18px; font-weight: 600; margin-top: 20px; }
.h2 + .muted { margin: -4px 0 4px; }
#planBox, #payHistory { display: flex; flex-direction: column; gap: 12px; }
#planBox:empty, #payHistory:empty { display: none; }
#payHistory p { margin: 4px 0 0; }
.small { font-size: 13px; }
.center { text-align: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }

/* buttons a little larger, like the mockups */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius); font-weight: 500; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn.primary { border-color: transparent; }
.btn.danger { border-color: #e5c4bf; }
input, select { height: 36px; }
.menu { border-radius: 10px; }

/* "New server" menu */
.new-menu { width: 330px; padding: 0; overflow: hidden; }
.menu-item.rich { align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 0; border-top: 1px solid var(--border-muted); }
.menu-item.rich:first-child { border-top: 0; }
.menu-item.rich > span { display: flex; flex-direction: column; gap: 3px; }
.menu-item.rich b { font-weight: 600; font-size: 15px; }
.menu-item.rich span span { font-size: 13px; color: var(--fg-muted); line-height: 1.45; }
.menu-item.rich .ic.lg, .menu-item.rich .game-ic.lg { width: 22px; height: 22px; margin-top: 1px; color: var(--fg); }

/* server list */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.toolbar .search-input { flex: 1 1 320px; }
.toolbar .search-input input { height: 40px; }
.toolbar select { height: 40px; width: auto; }
.count-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.count-line:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; background: var(--bg-hover); color: var(--fg); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.ok, .pill.state.running { background: var(--ok-bg); color: var(--ok-fg); }
.pill.warn, .pill.state.starting, .pill.state.stopping, .pill.state.busy { background: var(--attention-bg); color: var(--attention); }
.table-wrap { overflow-x: auto; }
.srv-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
.srv-table th { text-align: left; padding: 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); border-bottom: 1px solid var(--border); }
.srv-table td { padding: 15px 8px; border-bottom: 1px solid var(--border-muted); vertical-align: top; }
.srv-table th:first-child, .srv-table td:first-child { padding-left: 0; }
.srv-table tbody tr[data-row] { cursor: pointer; }
.srv-table tbody tr[data-row]:hover { background: var(--bg-subtle); }
.srv-name { color: var(--fg); font-weight: 600; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.tag { font-size: 12px; padding: 2px 7px; border-radius: 5px; background: var(--bg-hover); color: var(--fg-muted); white-space: nowrap; }
.tag.green { background: var(--ok-bg); color: var(--ok-fg); }
.tag.amber { background: var(--attention-bg); color: var(--attention); }
.tag.blue { background: var(--info-bg); color: var(--link); }
.cell-sub { font-size: 13.5px; color: var(--fg-muted); margin-top: 4px; }
.copy-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: 14px var(--mono); color: var(--fg); cursor: pointer; text-align: left; word-break: break-all; }
.copy-btn .ic { width: 14px; height: 14px; color: var(--fg-muted); }
.copy-btn:hover .ic { color: var(--fg); }
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.state .dot { width: 8px; height: 8px; }
.state.stopped .dot { background: none; border: 1.5px solid var(--dot-off); }
.ic.moon { width: 13px; height: 13px; color: var(--moon); }
.row-acts { text-align: right; white-space: nowrap; }
.empty-card { border: 1px dashed var(--border); border-radius: 12px; padding: 48px 24px; text-align: center; color: var(--fg-muted); }
.empty-card h3 { color: var(--fg); font-size: 18px; margin-bottom: 6px; }
.empty-card p { margin: 0 0 16px; }

/* first-week tips */
.tips { margin-top: 24px; border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px 26px; background: var(--bg-subtle); }
.tips-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tips-head h2 { font-size: 18px; }
.tips-head p { margin: 4px 0 0; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.tip { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.tip:hover { border-color: var(--fg-muted); }
.tip .ic { color: var(--fg-muted); }
.tip.done { cursor: default; color: var(--fg-muted); }
.tip.done .ic { color: var(--dot-run); }

/* server page */
.back-link { font-size: 14px; align-self: flex-start; }
.server-head { align-items: flex-start; }
.server-title h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.server-title .pill .dot { width: 7px; height: 7px; }
.server-sub { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 10px; font-size: 14.5px; color: var(--fg-muted); }
.server-sub span:empty { display: none; }
.address-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); }
.address { margin-top: 6px; font: 500 20px var(--mono); word-break: break-all; }
.meta { margin-top: 0; }
.meta:empty { display: none; }
.tabs { gap: 20px; margin-top: 8px; }
.tabs button { padding: 0 2px; height: 46px; color: var(--fg-muted); }
.tabs button:hover::after { display: none; }
.tabs button:hover { color: var(--fg); }
.tabs button.active { color: var(--fg); }
.log { border: 0; border-radius: 10px; padding: 14px 18px; font-size: 13px; line-height: 1.7; }
.box { border-radius: 10px; }
.box-head { background: var(--bg-subtle); }

/* welcome */
.welcome { display: flex; flex-wrap: wrap; gap: 24px; }
.welcome-card { flex: 1 1 420px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 36px 38px; }
#welcomeView { background: none; }
.steps { display: flex; gap: 6px; }
.steps span { width: 30px; height: 3px; border-radius: 2px; background: var(--border); }
.steps span.on { background: var(--primary); }
.welcome-card h1 { margin: 26px 0 12px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.lead { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--fg-muted); }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.welcome-card .address-card { margin-top: 22px; }
.welcome-card .address { font-size: 16px; }
.opts { border: 0; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.opts legend { font-size: 13px; font-weight: 600; color: var(--fg-muted); margin-bottom: 10px; padding: 0; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--fg-muted); }
.opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.opt input { margin-top: 3px; accent-color: var(--primary); }
.opt > span { display: flex; flex-direction: column; gap: 2px; }
.opt b { font-weight: 600; }
.opt span span { font-size: 14px; color: var(--fg-muted); }
.welcome-preview { display: flex; flex-direction: column; justify-content: center; gap: 26px; min-height: 460px; }
.welcome-preview .eyebrow { text-align: center; }
.mc-entry, .mc-state { width: 100%; max-width: 420px; margin: 0 auto; display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.mc-entry { box-shadow: 0 6px 20px #14181210; }
.mc-entry > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mc-entry span { font-size: 14px; color: var(--fg-muted); }
.mc-entry code { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--fg-muted); font-size: 13px; word-break: break-all; }
.game-ic.xl { width: 48px; height: 48px; }
.mc-state { align-items: center; gap: 12px; }
.mc-state .muted { margin-left: auto; font-size: 14px; }
.wire { width: 0; height: 34px; margin: -14px auto; border-left: 1.5px dashed var(--border); }
.welcome-preview > p { max-width: 380px; margin: 0 auto; font-size: 14px; line-height: 1.55; }

/* plan & billing */
.card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.plan-now { display: flex; gap: 24px; padding: 24px; flex-wrap: wrap; }
.plan-now-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.plan-now-name b { font-size: 26px; font-weight: 700; }
.plan-now p { margin: 8px 0 0; }
.plan-days { font-size: 15px; margin-top: 14px !important; }
.bar { margin-top: 10px; width: 320px; max-width: 100%; height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--dot-run); }
.plan-pay { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.plan-pay .small { text-align: right; max-width: 260px; }
.addon-row { display: flex; align-items: flex-start; gap: 14px; padding: 18px 24px; border-top: 1px solid var(--border-muted); background: var(--bg-subtle); cursor: pointer; }
.addon-row input { width: 18px; height: 18px; margin-top: 2px; }
.addon-row > span { display: flex; flex-direction: column; gap: 3px; }
.addon-row b { font-weight: 600; }
.addon-row .muted { font-size: 14px; }
.plan-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.plan-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; }
.plan-tile.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--ok-bg); }
.plan-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-tile-top b { font-size: 16px; }
.plan-price { margin: 8px 0 10px; font-size: 18px; }
.plan-price .muted { font-size: 13px; font-weight: 400; }
.plan-tile .btn { margin-top: auto; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .content { padding: 24px 0 48px; }
  .page-head h1, .server-title h1 { font-size: 26px; }
  .topnav { gap: 20px; }
  .welcome-card { padding: 26px 22px; }
  .plan-pay { align-items: stretch; width: 100%; }
  .plan-pay .small { text-align: left; }
  .new-menu { width: min(330px, calc(100vw - 32px)); }
}

/* ================= Settings: side menu + one section of calm cards ================= */
.settings { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.set-menu { flex: 0 0 220px; position: sticky; top: calc(var(--topbar-h, 110px) + 16px); display: flex; flex-direction: column; gap: 2px; }
.set-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); color: var(--fg-muted); font-size: 14.5px; text-decoration: none !important; }
.set-menu a .ic { color: currentColor; }
.set-menu a:hover { background: var(--bg-hover); color: var(--fg); }
.set-menu a[aria-current="page"] { background: var(--bg-hover); color: var(--fg); font-weight: 600; }
.set-menu-head { margin: 16px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.set-panes { flex: 999 1 560px; min-width: 0; }
.pane { display: none; flex-direction: column; gap: 16px; }
.pane.active { display: flex; }
.pane-head h2 { font-size: 20px; font-weight: 600; }
.pane-head p { margin: 4px 0 0; }
.set-stack { display: flex; flex-direction: column; gap: 16px; }
.set-card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.set-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; flex-wrap: wrap; }
.set-card-head > div:first-child { flex: 1 1 300px; min-width: 0; }
.set-card-head h3 { font-size: 15.5px; font-weight: 600; }
.set-card-head p { margin: 4px 0 0; color: var(--fg-muted); font-size: 14px; line-height: 1.5; }
.set-card-head + .list, .set-card-head + .set-card-body { border-top: 1px solid var(--border-muted); }
.set-card-body { padding: 18px 20px; }
.set-card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-muted); background: var(--bg-subtle); }
.set-fields { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.set-fields > label:not(.check), .set-field-label { font-size: 14px; font-weight: 500; color: var(--fg); }
.set-fields input:not([type=checkbox]) { width: 100%; max-width: 460px; }
.set-fields .hint { margin-top: 4px; }
.set-save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-more { display: block; justify-content: flex-start; color: var(--fg-muted); font-size: 13.5px; }
.set-more summary { cursor: pointer; color: var(--fg); font-weight: 500; }
.set-more p { margin: 8px 0 0; line-height: 1.55; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--bg-hover); color: var(--fg-muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--dot-off); box-sizing: border-box; }
.state.ok { background: var(--ok-bg); color: var(--ok-fg); }
.state.ok::before { background: var(--dot-run); border: 0; }
.state:empty { display: none; }
.set-card .list .item { padding: 12px 20px; }
.set-card .switch { margin-top: 2px; width: 40px; height: 22px; }
.set-card .switch span::after { width: 18px; height: 18px; }
.set-card .switch input:checked + span::after { transform: translateX(18px); }
.node-step { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 10px; }
.node-step .hint { margin-top: 2px; }
.step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.install-row { margin-left: 36px; }
.install-box { margin-left: 36px; }
.node-form { margin: 0 0 0 36px; }
.node-add > .hint { margin-left: 36px; }
.node-step:not(:first-child) { margin-top: 20px; }

/* plans: a readable row; the form opens on Edit */
.plan-wrap + .plan-wrap { border-top: 1px solid var(--border-muted); }
.plan-wrap .item { border-top: 0; }
.plan-sum-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 14px; white-space: nowrap; }
.plan-sum-price .muted { font-size: 12.5px; }
.plan-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; padding: 16px 20px 18px; background: var(--bg-subtle); border-top: 1px solid var(--border-muted); }
.plan-row.hidden { display: none !important; }
.plan-row .plan-f input, .plan-row .plan-f input.num { width: 100%; }
.plan-row .plan-id { align-self: end; padding-bottom: 8px; }
.plan-public { align-self: end; padding-bottom: 8px; }
.plan-row-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

@media (max-width: 760px) {
  .set-menu { position: static; flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .set-menu a { white-space: nowrap; border: 1px solid var(--border-muted); }
  .set-menu-head { display: none; }
  .set-fields { grid-template-columns: 1fr; gap: 6px; }
  .set-fields > label:not(:first-child), .set-field-label:not(:first-child) { margin-top: 8px; }
  .install-row, .install-box, .node-form, .node-add > .hint { margin-left: 0; }
  .plan-sum-price { display: none; }
}
@media (max-width: 640px) {
  .set-card .list .item { flex-wrap: wrap; }
  .set-card .list .item > .grow { flex: 1 1 calc(100% - 40px); }
  .set-card .list .item .btns { flex-wrap: wrap; }
}

/* mod / plugin search */
.find-list { margin-top: 12px; }
.find-list .item { align-items: flex-start; }
.find-ic { width: 40px; height: 40px; flex: none; border-radius: 8px; background: var(--bg-inset); object-fit: cover; }
.find-list .desc { margin-top: 2px; color: var(--fg-muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.find-list .by { color: var(--fg-muted); font-size: 12.5px; font-weight: 400; }
.find-list .done { color: var(--success-fg); font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
#findMore { margin-top: 10px; }

/* server version change */
#versionBox .box-head { gap: 12px; }
#verMc { min-width: 140px; }
#verPlan { margin-top: 14px; border-top: 1px solid var(--border-muted); padding-top: 14px; }
#verPlan h3 { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
#verPlan ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
#verPlan .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
#verUndo { margin-top: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Bedrock (Geyser) */
.bedrock-line { margin-top: 6px; font-size: 13px; color: var(--fg-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bedrock-line .copy-btn { font-family: var(--mono); }
#bedrockBox .box-head { align-items: flex-start; gap: 16px; }
#bedrockBox .box-head p { margin-top: 2px; font-weight: 400; }
#bedrockBody:empty { display: none; }
#bedrockBody ol { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 13.5px; }

/* server templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0 18px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.tpl { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.tpl:hover { border-color: var(--fg-muted); }
.tpl[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--bg-subtle); }
.tpl:disabled { opacity: .5; cursor: not-allowed; }
.tpl img { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--bg-inset); object-fit: cover; }
.tpl b { display: block; font-weight: 600; }
.tpl small { display: block; margin-top: 3px; color: var(--fg-muted); font-size: 12.5px; line-height: 1.4; }
.tpl .tag { margin-top: 6px; }

/* invite friends */
#inviteBox { margin-top: 20px; }
#inviteBox .box-body > p { margin: 0 0 14px; line-height: 1.55; }
.invite-link { margin-bottom: 8px; }
.invite-link .address { font-size: 15px; word-break: break-all; }
#inviteList:not(:empty) { margin-top: 10px; }

/* free trial: no moving worlds in or out */
.trial-only { display: none; }
body.on-trial .trial-only { display: block; }
body.on-trial .no-trial { display: none !important; }

/* notification switches */
.notify-list { display: grid; gap: 4px; }
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.notify-row + .notify-row { border-top: 1px solid var(--border-muted); }
.notify-row b { display: block; font-weight: 500; }
.notify-row small { display: block; margin-top: 2px; color: var(--fg-muted); font-size: 13px; }

/* upload progress (mods, files, world backups) */
.upl { margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
#fmUploads, #backupUploads { margin: 12px 16px; }
.upl-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border-muted); flex-wrap: wrap; }
.upl-head .grow { min-width: 200px; }
.upl-title { font-weight: 500; }
.upl-sub { color: var(--fg-muted); font-size: 13px; margin-top: 2px; }
.upl-bar { height: 6px; border-radius: 3px; background: var(--bg-inset); overflow: hidden; margin-top: 8px; }
.upl-bar > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.upl-list { max-height: 260px; overflow-y: auto; }
.upl-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 7px 12px; font-size: 13.5px; }
.upl-row + .upl-row { border-top: 1px solid var(--border-muted); }
.upl-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.upl-row .st { color: var(--fg-muted); white-space: nowrap; font-size: 12.5px; }
.upl-row.done .st { color: var(--success-fg); }
.upl-row.fail .st { color: var(--danger); white-space: normal; text-align: right; }
.upl-row .upl-bar { grid-column: 1 / -1; margin-top: 4px; height: 4px; }
.upl-row:not(.going) .upl-bar { display: none; }

/* nickname */
.field-hint { margin: -4px 0 4px; font-size: 12.5px; }
.modal-card.narrow { max-width: 460px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-muted); }
.handle-preview { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); min-height: 1.4em; }
.handle-preview.bad { color: var(--danger); font-family: var(--font); }
.handle-preview.good b { color: var(--success-fg); }
.new-address { margin-top: 6px; font-family: var(--mono); font-size: 12.5px; }
.wl-hint { margin: 0 12px 8px; }

/* recently deleted servers */
.deleted-box { margin-top: 20px; }
.deleted-box .box-head { gap: 12px; flex-wrap: wrap; }
/* capacity summary above the node cards */
.cap-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cap-tile { padding: 14px 16px; border-radius: 12px; background: var(--bg-subtle); border: 1px solid var(--border-muted); }
.cap-tile .k { font-size: 12.5px; color: var(--fg-muted); }
.cap-tile .v { margin-top: 4px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cap-tile .s { margin-top: 4px; font-size: 12.5px; color: var(--fg-muted); }
.cap-tile.warn { border-color: var(--attention); }
.cap-tile.warn .v { color: var(--attention); }
.cap-tile.bad { border-color: var(--danger); }
.cap-tile.bad .v { color: var(--danger); }
@media (max-width: 760px) { .cap-summary { grid-template-columns: 1fr; } }
#nodeAddModal .node-form { display: grid; grid-template-columns: 1fr; gap: 8px; margin-left: 34px; }
#nodeAddModal .node-form .btn { justify-self: start; }
