/* NetMC. A precise tool, not a game launcher: paper and ink (light) or graphite (dark), thin
   rules instead of boxes, IBM Plex for text and Plex Mono for anything technical (addresses,
   versions, ports, sizes). One accent colour, used only where it means something: online,
   success, focus. No gradients, no glow, no emoji. The console and the server list preview stay
   dark in both themes, like in Minecraft. */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Minecraft"; src: url("fonts/Minecraft.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "MinecraftBold"; src: url("fonts/Minecraft-Bold.otf") format("opentype"); font-display: swap; }

/* ---------- themes ---------- */
:root {
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 3px;
  --control: 32px;

  /* Light: paper and ink */
  --bg: #f6f5f1;
  --sidebar: #efeee8;
  --surface: #ffffff;
  --raised: #ffffff;
  --inset: #fbfaf7;
  --hover: rgba(23, 23, 26, .045);
  --selected: rgba(23, 23, 26, .075);
  --line: #e2e0d8;
  --border: #d3d0c6;
  --border-strong: #aeaa9e;
  --text: #17171a;
  --text-2: #45443e;
  --muted: #74726a;
  --faint: #a29f95;
  --accent: #1f7a49;
  --accent-text: #19693d;
  --accent-tint: rgba(31, 122, 73, .09);
  --warn: #a5640c;
  --warn-tint: rgba(165, 100, 12, .09);
  --error: #c0362f;
  --error-text: #b1302a;
  --error-tint: rgba(192, 54, 47, .08);
  --sleep: #5558c4;
  --primary: #17171a;
  --primary-text: #f6f5f1;
  --primary-hover: #000000;
  --overlay: rgba(23, 23, 26, .32);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .12);
  --tier-free: #6b6e76;
  --tier-pro: #5847cf;
  --tier-ultra: #a85f00;
  --tier-admin: #bd2947;
  --wm-light: block;
  --wm-dark: none;
  color-scheme: light;

  /* Always dark: the console and Minecraft's own look */
  --console: #121315;
  --console-line: #26272b;
  --console-text: #c8c7c0;
  --console-faint: #6d6c66;
}

/* Dark: graphite. Used when Windows is dark (unless "Light" is chosen) or "Dark" is chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18191b; --sidebar: #131416; --surface: #1e1f22; --raised: #232428; --inset: #141517;
    --hover: rgba(255, 255, 255, .045); --selected: rgba(255, 255, 255, .08);
    --line: #2a2b2f; --border: #35363b; --border-strong: #4c4d53;
    --text: #ebeae6; --text-2: #b9b7b0; --muted: #8c8a83; --faint: #62605a;
    --accent: #3fa86c; --accent-text: #6cc792; --accent-tint: rgba(63, 168, 108, .13);
    --warn: #d99a3a; --warn-tint: rgba(217, 154, 58, .12);
    --error: #df625a; --error-text: #ef8a83; --error-tint: rgba(223, 98, 90, .12);
    --sleep: #9a9cf0;
    --primary: #ebeae6; --primary-text: #141517; --primary-hover: #ffffff;
    --overlay: rgba(0, 0, 0, .55); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .45);
    --tier-free: #a4a7af; --tier-pro: #a294f6; --tier-ultra: #eda33f; --tier-admin: #f0627d;
    --wm-light: none; --wm-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18191b; --sidebar: #131416; --surface: #1e1f22; --raised: #232428; --inset: #141517;
  --hover: rgba(255, 255, 255, .045); --selected: rgba(255, 255, 255, .08);
  --line: #2a2b2f; --border: #35363b; --border-strong: #4c4d53;
  --text: #ebeae6; --text-2: #b9b7b0; --muted: #8c8a83; --faint: #62605a;
  --accent: #3fa86c; --accent-text: #6cc792; --accent-tint: rgba(63, 168, 108, .13);
  --warn: #d99a3a; --warn-tint: rgba(217, 154, 58, .12);
  --error: #df625a; --error-text: #ef8a83; --error-tint: rgba(223, 98, 90, .12);
  --sleep: #9a9cf0;
  --primary: #ebeae6; --primary-text: #141517; --primary-hover: #ffffff;
  --overlay: rgba(0, 0, 0, .55); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .45);
  --tier-free: #a4a7af; --tier-pro: #a294f6; --tier-ultra: #eda33f; --tier-admin: #f0627d;
  --wm-light: none; --wm-dark: block;
  color-scheme: dark;
}

/* #pinky (easter egg, typed into a server console): pink, round and happy. Settings → Appearance
   turns it off again. */
:root[data-theme="pinky"] {
  --radius: 12px;
  --bg: #ffb3da; --sidebar: #ff85c4; --surface: #ffe0f0; --raised: #fff0f8; --inset: #ffcce6;
  --hover: rgba(255, 20, 147, .14); --selected: rgba(255, 20, 147, .26);
  --line: #ff9ccf; --border: #ff74b8; --border-strong: #f0389a;
  --text: #4d0429; --text-2: #7a0e48; --muted: #9c2563; --faint: #c94d8d;
  --accent: #ff1493; --accent-text: #b8005a; --accent-tint: rgba(255, 20, 147, .2);
  --warn: #d9772b; --warn-tint: rgba(217, 119, 43, .12);
  --error: #e0435f; --error-text: #c42d4a; --error-tint: rgba(224, 67, 95, .1);
  --sleep: #a78bfa;
  --primary: #ff1493; --primary-text: #ffffff; --primary-hover: #e0007a;
  --overlay: rgba(140, 0, 75, .3); --shadow: 0 2px 6px rgba(255, 20, 147, .2), 0 14px 36px rgba(255, 20, 147, .28);
  --tier-free: #b07a99; --tier-pro: #a855f7; --tier-ultra: #f59e0b; --tier-admin: #e11d74;
  --console: #4a0730; --console-line: #7a0f50; --console-text: #ffd1ea; --console-faint: #ff8cc8;
  --wm-light: block; --wm-dark: none;
  color-scheme: light;
  scrollbar-color: #ff5aad transparent;
}
[data-theme="pinky"] body {
  background: radial-gradient(circle at 15% 10%, #ff7cc0 0, transparent 42%), radial-gradient(circle at 85% 90%, #e08cff 0, transparent 48%), var(--bg);
  /* a small heart as the mouse pointer (text fields keep their own) */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'%3E%3Cpath fill='%23ff1493' stroke='white' stroke-width='1.5' d='M12 21s-7.5-4.6-9.6-9.2C.9 8.5 3 4.5 6.8 4.5c2.1 0 3.6 1.2 5.2 3.1 1.6-1.9 3.1-3.1 5.2-3.1 3.8 0 5.9 4 4.4 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") 11 11, auto;
}
[data-theme="pinky"] button.primary, [data-theme="pinky"] .tier-word { border-radius: 999px; }
[data-theme="pinky"] .title-block h1::after { content: " ♡"; color: var(--accent); }
[data-theme="pinky"] .brand::after { content: "✿"; color: var(--accent); font-size: 15px; margin-left: 4px; }
[data-theme="pinky"] .toast::before { content: "💖 "; }
[data-theme="pinky"] .dot.online { box-shadow: 0 0 0 3px rgba(255, 20, 147, .3); }
.pinky-sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.pinky-sky span { position: absolute; bottom: -40px; font-size: 22px; opacity: .45; animation: pinky-drift linear infinite; }
.pinky-burst { position: fixed; bottom: -40px; z-index: 50; pointer-events: none; animation: pinky-rise 3.4s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes pinky-drift {
  from { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-55vh) translateX(18px) rotate(12deg); }
  to { transform: translateY(-115vh) rotate(-8deg); }
}
@keyframes pinky-rise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.15) rotate(20deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pinky-sky { display: none; } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; background: var(--bg); color: var(--text);
  font: 13.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.012em; line-height: 1.25; }
h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
a { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.muted { color: var(--muted); font-size: 12.5px; }
.small { font-size: 12px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text) 30%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

/* Small uppercase labels in Plex Mono: the "instrument" voice for column and stat names. */
.stat span, .admin-table th, .side-group-title, .label-mono {
  font: 500 10.5px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}

/* ---------- controls ---------- */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control); padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .1s, border-color .1s, color .1s;
}
button:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--raised) 92%, var(--text)); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.small { height: 26px; padding: 0 9px; font-size: 12.5px; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--hover); color: var(--text); }
button.big { height: 40px; padding: 0 20px; font-size: 14px; }
.danger-btn { background: transparent; border-color: color-mix(in srgb, var(--error) 50%, transparent); color: var(--error-text); }
.danger-btn:hover { background: var(--error-tint); border-color: var(--error); }

input, select, textarea {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 0 10px; height: var(--control);
  transition: border-color .1s, box-shadow .1s;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] { width: 15px; height: 15px; padding: 0; margin: 0; accent-color: var(--accent); }
select { padding-right: 6px; }

.icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- sidebar ---------- */
.sidebar {
  width: clamp(240px, 15vw, 288px); flex: none; height: 100vh; overflow: hidden;
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 0 0 8px; user-select: none; -webkit-user-select: none;
}
.brand { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; flex: none; }
.wordmark { height: 26px; width: auto; }
.wordmark.for-light { display: var(--wm-light); }
.wordmark.for-dark { display: var(--wm-dark); }
.server-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.server-nav::-webkit-scrollbar { width: 8px; }
.server-list { list-style: none; margin: 0; padding: 0; }
.server-item, .nav-item, .add-server-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: auto;
  padding: 7px 16px 7px 16px; text-align: left; justify-content: flex-start;
  background: transparent; border: 0; border-left: 2px solid transparent; border-radius: 0;
  color: var(--text-2); font-weight: 400;
}
.server-item:hover, .nav-item:hover, .add-server-btn:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.server-item.selected, .nav-item.active, .add-server-btn.active { background: var(--selected); border-left-color: var(--text); color: var(--text); }
.server-item-label { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.server-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }
.server-item-sub { color: var(--muted); font: 11.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-item-meta { flex: none; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.live { flex: none; font: 600 10px var(--mono); letter-spacing: .08em; color: var(--accent-text); }
.sidebar-create { display: grid; padding: 6px 0; border-top: 1px solid var(--line); flex: none; position: relative; }
.new-menu {
  position: absolute; bottom: calc(100% - 2px); left: 8px; right: 8px; z-index: 20; display: grid; gap: 1px; padding: 4px;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.new-menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto; padding: 7px 10px;
  border: 0; border-radius: 2px; background: transparent; color: var(--text); text-align: left; font-weight: 400;
}
.new-menu button:hover, .new-menu button:focus-visible { background: var(--hover); outline: none; }
.new-menu button b { font-weight: 500; font-size: 13px; }
.new-menu button span { font-size: 12px; line-height: 1.35; color: var(--muted); white-space: normal; }
.add-server-btn { color: var(--text-2); }
.sidebar-bottom { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); display: grid; flex: none; position: relative; }
.update-nav { color: var(--accent-text); font-weight: 500; }
.update-nav:hover { color: var(--accent-text); }
.update-nav-version { margin-left: auto; font: 11px var(--mono); color: var(--muted); }
.side-group-title { padding: 12px 18px 5px; list-style: none; color: var(--faint); }
.side-group-title:first-child { padding-top: 4px; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on, .dot.running, .dot.online { background: var(--accent); }
.dot.starting, .dot.stopping, .dot.connecting, .dot.retrying { background: var(--warn); }
.dot.rejected { background: var(--error); }
.dot.sleeping { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sleep); }

/* Networks: their servers indented underneath */
.net-group { margin: 0; }
.net-head { display: flex; align-items: center; }
.net-head .server-item { flex: 1; min-width: 0; }
.net-head:has(> .server-item.selected) { background: var(--selected); box-shadow: inset 2px 0 0 var(--text); }
.net-head:has(> .server-item:hover) { background: var(--hover); }
.net-head .server-item:hover, .net-head .server-item.selected { background: transparent; }
.network-item .server-item-name { font-weight: 600; }
.net-caret {
  flex: none; width: 28px; height: 28px; margin-right: 8px; padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); transition: transform .15s, color .1s, background .1s;
}
.net-caret .icon { width: 17px; height: 17px; stroke-width: 1.6; }
.net-caret:hover { color: var(--text); background: var(--hover); }
.net-caret.collapsed { transform: rotate(-90deg); }
.lobby-group-title { padding-right: 10px; }
.lobby-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0;
  background: transparent; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer;
}
.lobby-toggle:hover { color: var(--text); }
.lobby-toggle .net-caret { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0; }
.net-members { padding: 0 0 4px; }
.member-row .server-item { padding-left: 34px; }
.member-empty { padding: 4px 18px 8px 34px; color: var(--faint); font-size: 12px; }
.member-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.25; }
.member-platform { font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.role-tag { flex: none; font: 500 11px var(--mono); color: var(--text); }


/* Dragging servers in the sidebar */
.member-item, #server-list li[data-drop="loose"] .server-item { touch-action: none; }
body.dragging-server, body.dragging-server * { cursor: grabbing !important; user-select: none; }
#server-list [data-drop] { position: relative; }
#server-list .drop-into > .server-item, #server-list .member-empty.drop-into, #server-list .drop-out > .server-item { background: var(--hover); }
#server-list .drop-before::after, #server-list .drop-after::after {
  content: ""; position: absolute; left: 34px; right: 18px; height: 2px; background: var(--text); z-index: 1;
}
#server-list li[data-drop="loose"].drop-before::after, #server-list li[data-drop="loose"].drop-after::after { left: 16px; }
#server-list .drop-before::after { top: -1px; }
#server-list .drop-after::after { bottom: -1px; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 500; white-space: nowrap;
}

/* Plan tier: a small mono label in the tier's colour (next to the logo, in lists) */
.tier-word { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tier-word.free { color: var(--tier-free); }
.tier-word.pro { color: var(--tier-pro); }
.tier-word.ultra { color: var(--tier-ultra); }
.tier-word.admin { color: var(--tier-admin); }
.tier-word.web { color: #2fbf63; }
.tier-word.remote { color: #2a9fd6; }
/* Web hosting (web.js): things about the host PC are hidden in the browser. */
.web .pc-only, html:not(.web) .web-only, .remote .no-remote { display: none !important; }
.brand-tier { padding: 3px 6px 2px; border: 1px solid currentColor; border-radius: 2px; font-size: 9.5px; letter-spacing: .16em; }

/* ---------- main area ---------- */
/* Pages sit next to the sidebar at any size: server pages use the full width (console, files),
   text pages a readable column. `main` is a size container, so parts adapt to the space they get. */
main { flex: 1; height: 100vh; overflow-y: auto; padding: 26px clamp(20px, 3vw, 48px) 28px; min-width: 0; container-type: inline-size; display: flex; flex-direction: column; }
.view { flex: none; margin: 0; }
#view-new, #view-new-network, #view-online, #view-settings { max-width: 820px; }
.server-view { display: flex; flex-direction: column; flex: 1 0 auto; }
.server-view.fill { flex: 1 1 0; min-height: 0; }
.server-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 18px; }
.title-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.title-block h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-block .muted { font-size: 13px; color: var(--muted); max-width: 640px; }
.server-view .title-block .muted, #admin-sub { font: 12px var(--mono); }
.actions { display: flex; gap: 8px; flex: none; }
.empty { max-width: 460px; margin: 18vh auto 0; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty h1 { font-size: 26px; }
.empty.welcome { max-width: 560px; text-align: left; justify-items: start; margin-top: 12vh; gap: 16px; }
.welcome h1 { font-size: 30px; letter-spacing: -.02em; }
.welcome-steps { margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.welcome-steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.welcome-steps li::before { content: "0" counter(step); grid-row: span 2; font: 500 13px var(--mono); color: var(--accent-text); padding-top: 2px; }
.welcome-steps b { font-weight: 600; }
.welcome-steps span { color: var(--text-2); font-size: 13px; }

/* Tabs: text only; the active one underlined in ink. Scroll sideways when narrow. */
.tabs { display: flex; gap: clamp(18px, 2vw, 28px); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * { flex: none; }
.tabs button {
  height: auto; padding: 8px 0 10px; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tabs button:hover { background: transparent; color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.tab-split { display: inline-flex; align-items: center; gap: 5px; }
.tabs button.tab-open {
  height: 20px; width: 20px; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 2px;
  color: var(--muted); font-size: 11px;
}
.tabs button.tab-open:hover { color: var(--text); border-color: var(--border-strong); background: var(--hover); }

/* Sections are separated by rules, not boxed. */
.card { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 20px 0 22px; }
.view > .card:last-child { border-bottom: 0; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px; margin-bottom: 14px; border: 1px solid; border-radius: var(--radius); font-size: 13px;
}
.banner.warn { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.info { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.banner.error { background: var(--error-tint); border-color: color-mix(in srgb, var(--error) 35%, transparent); color: var(--error-text); }

/* ---------- overview ---------- */
.overview { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* Status + stats: equal columns, divided by rules (2 x 2 when narrow) */
.ov-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.ov-stats { display: contents; }
.status-pill {
  display: flex; align-items: center; gap: 9px; padding: 16px 20px 16px 0;
  border-right: 1px solid var(--line); color: var(--text-2); font-weight: 500; min-width: 0;
}
.status-pill.running { color: var(--accent-text); }
.status-pill.running .dot { background: var(--accent); }
.status-pill.starting, .status-pill.stopping { color: var(--warn); }
.status-pill.starting .dot, .status-pill.stopping .dot { background: var(--warn); }
.status-pill.sleeping { color: var(--sleep); }
.status-pill.sleeping .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sleep); }
.stat { padding: 13px 20px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat span { display: block; margin-bottom: 4px; }
.stat b { font: 500 16px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.ram-bar { width: 100%; max-width: 180px; height: 2px; background: var(--line); overflow: hidden; margin-top: 8px; }
.ram-bar.wide { max-width: none; margin-top: 4px; }
.ram-bar-fill { height: 100%; width: 0; background: var(--text); transition: width .3s; }
.ram-bar-fill.high { background: var(--warn); }
@container (max-width: 780px) {
  .ov-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-pill, .stat { border-right: 0; padding: 10px 12px 10px 0; }
  .stat { border-top: 1px solid var(--line); }
  .ov-stats .stat:first-child { border-top: 0; }
}

/* The whole PC: one slim line under the stats. Each bar: grey = the rest of what the PC uses,
   then the Minecraft servers' part in green at its end, then the free part. */
.ov-pc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 32px; padding: 9px 0 10px; }
.pc-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; min-width: 0; }
.pc-name { color: var(--text-2); }
.pc-bar { position: relative; flex: none; width: 80px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pc-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .5s, left .5s; }
.pc-bar i.all { background: color-mix(in srgb, var(--text) 32%, transparent); }
.pc-bar i.mc { background: var(--accent); }
.pc-item b { font: 500 12.5px var(--mono); white-space: nowrap; }
.pc-mc { font: 12px var(--mono); color: var(--accent-text); white-space: nowrap; }
.pc-mc::before { content: "· "; color: var(--faint); }
.pc-mc:empty { display: none; }.field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

.field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

/* Online address: the address with its status dot, then one quiet line (status · proxy). */
.share { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 12px 0; flex-wrap: wrap; }
.share-main { min-width: 0; display: grid; gap: 2px; }
.address-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.address { font: 500 15px var(--mono); letter-spacing: -.01em; overflow-wrap: anywhere; }
.address.none { color: var(--muted); font: 400 13px var(--sans); }
.addr-copy { width: 24px; height: 24px; padding: 0; color: var(--muted); }
.addr-copy:hover { color: var(--text); }
.addr-copy .icon { width: 14px; height: 14px; }
.share-meta { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding-left: 15px; font-size: 12px; color: var(--muted); }
.proxy-current { display: flex; align-items: center; gap: 7px; }
.proxy-current::before { content: "·"; color: var(--faint); margin-right: 1px; }
.proxy-current:empty { display: none; }
.country {
  flex: none; min-width: 22px; text-align: center; font: 500 10px var(--mono); letter-spacing: .05em;
  color: var(--text-2); border: 1px solid var(--border); border-radius: 2px; padding: 0 4px;
}
.link-btn { height: auto; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 12px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.link-btn:hover { background: none; color: var(--text); text-decoration-color: currentColor; }.ping { flex: none; font: 500 12px var(--mono); display: flex; align-items: center; gap: 7px; }
.ping.good { color: var(--accent-text); }
.ping.ok { color: var(--warn); }
.ping.bad { color: var(--error-text); }
.ping.off { color: var(--muted); font-weight: 400; }

/* Network overview: its servers */
.ov-members { padding: 16px 0 18px; }
.ov-members-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-members-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.member-card {
  display: grid; grid-template-columns: 70px 10px minmax(0, 1fr) auto 80px; align-items: center; gap: 10px;
  height: auto; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; text-align: left; justify-content: stretch; font-weight: 400;
}
.member-card:last-child { border-bottom: 0; }
.member-card:hover { background: var(--hover); }
.member-card .role-tag { justify-self: start; }
.member-card .muted { font: 11.5px var(--mono); }
.member-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-state { text-align: right; font-size: 12px; }

/* ---------- console (always dark, like a terminal) ---------- */
.ov-console { flex: 1; display: flex; flex-direction: column; min-height: 240px; padding: 16px 0 0; border-bottom: 0; }
.ov-console-head { display: flex; justify-content: space-between; align-items: center; height: 26px; margin-bottom: 8px; }
.console-actions { display: flex; align-items: center; gap: 6px; }
.console-jump[hidden] { display: none; }
.console-log {
  flex: 1; min-height: 120px; height: 0; overflow: auto;
  background: var(--console); border: 1px solid var(--console); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; padding: 12px 14px;
  font: 12px/1.65 var(--mono); color: var(--console-text); color-scheme: dark;
}
.log-line { white-space: pre-wrap; word-break: break-word; color: var(--console-text); }
.log-line.log-error { color: #ef8a83; }
.log-line.log-warn { color: #dcaa55; }
.log-line.log-join { color: #7fcf9f; }
.log-line.log-empty { color: var(--console-faint); }
.log-line.log-expected { color: var(--console-faint); }
.log-line.log-note { color: #7fcf9f; opacity: .9; }
.console-form { position: relative; }
.console-form::before { content: ""; position: absolute; inset: 0; background: var(--console); border-radius: 0 0 var(--radius) var(--radius); }
.console-form input {
  position: relative; z-index: 2; width: 100%; height: 40px; margin: 0; padding: 0 14px;
  background: transparent; border: 1px solid var(--console); border-top-color: var(--console-line);
  border-radius: 0 0 var(--radius) var(--radius); color: #ecebe6; font: 12px var(--mono); color-scheme: dark;
}
.console-form input:focus { border-color: var(--accent); box-shadow: none; }
.console-form input::placeholder { color: var(--console-faint); }
/* Command suggestions, like Minecraft's chat: the list starts where the word starts, the chosen
   entry yellow, the rest of it as grey ghost text. */
.cmd-ghost {
  position: absolute; left: 15px; right: 15px; top: 0; height: 40px; display: flex; align-items: center; overflow: hidden;
  font: 12px var(--mono); white-space: pre; pointer-events: none; color: var(--console-faint); z-index: 1;
}
.cmd-ghost .typed { visibility: hidden; }
.cmd-suggest {
  position: absolute; bottom: calc(100% + 2px); left: 14px; z-index: 5; min-width: 180px; max-width: calc(100% - 28px);
  max-height: calc(10 * 22px + 8px); overflow-y: auto; padding: 4px 0; color-scheme: dark;
  background: rgba(10, 10, 11, .97); border: 1px solid #2c2d31; border-radius: 2px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  font: 12px/22px var(--mono);
}
.cmd-suggest div { padding: 0 10px; color: #a8a8a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cmd-suggest div.sel, .cmd-suggest div.sel:hover { color: #ffff55; }
.cmd-suggest div:hover { color: #e8e8e8; }
.cmd-suggest .note { color: #8d8c86; cursor: default; font-family: var(--sans); }
/* "#": NetMC's own commands, at the right end of the console input */
.console-form input { padding-right: 52px; }
.cmd-hash {
  position: absolute; right: 7px; top: 7px; z-index: 3; width: 28px; height: 26px; padding: 0;
  background: transparent; border: 1px solid #34353a; border-radius: 2px; color: #9a9993; font: 600 13px var(--mono); color-scheme: dark;
}
.cmd-hash:hover, .cmd-hash[aria-expanded="true"] { background: #212226; border-color: #4a4b51; color: #ecebe6; }
.cmd-hash-menu {
  position: absolute; bottom: calc(100% + 2px); right: 7px; z-index: 6; min-width: 300px; padding: 4px; color-scheme: dark;
  background: rgba(10, 10, 11, .97); border: 1px solid #2c2d31; border-radius: 3px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}
.cmd-hash-head { padding: 6px 10px 4px; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #6d6c66; }
.cmd-hash-menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto; padding: 7px 10px;
  border: 0; border-radius: 2px; background: transparent; color: #c8c7c0; text-align: left; font-weight: 400;
}
.cmd-hash-menu button:hover, .cmd-hash-menu button:focus-visible { background: #1d1e21; outline: none; }
.cmd-hash-menu button b { font: 500 12.5px var(--mono); color: #ffff55; }
.cmd-hash-menu button span { font-size: 12px; color: #8d8c86; }

/* ---------- settings pages ---------- */
.quick-settings { display: grid; grid-template-columns: 172px minmax(0, 680px); gap: 0 40px; align-items: start; padding-top: 16px; }
.qs-nav { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 0; }
.qs-nav button {
  justify-content: flex-start; height: 32px; padding: 0 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-weight: 500; border-left: 2px solid transparent;
}
.qs-nav button:hover { background: var(--hover); color: var(--text); }
.qs-nav button.active { background: var(--selected); color: var(--text); border-left-color: var(--text); }
.qs-panes { min-width: 0; }
.qs-pane > .card:first-child { padding-top: 4px; }
.qs-pane > .card:last-child { border-bottom: 0; }
.qs-section { padding: 20px 0 22px; }
.qs-section.narrow { max-width: 760px; }
.qs-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.qs-section-head.no-line { margin-bottom: 0; align-items: center; }
.qs-section-head h3 { margin: 0 0 3px; }
.qs-section-head p { margin: 0; line-height: 1.5; font-size: 12.5px; }
.qs-save { display: flex; align-items: center; gap: 10px; flex: none; }
.qs-field { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.qs-properties-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.qs-toggles { display: flex; gap: 28px; margin-top: 18px; color: var(--text-2); }
.qs-toggles label, label.check { display: flex; align-items: center; gap: 9px; color: var(--text-2); }
.apply-row { display: flex; align-items: center; gap: 8px; }
.apply-row input { flex: 1; min-width: 0; }
.apply-row.end { justify-content: flex-end; }
.danger h3 { color: var(--error-text); }
.live-tag { font: 500 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-left: 6px; }
@container (max-width: 680px) { .quick-settings { grid-template-columns: 1fr; gap: 12px; } .qs-nav { flex-direction: row; position: static; flex-wrap: wrap; } .qs-nav button { border-left: 0; border-bottom: 2px solid transparent; } .qs-nav button.active { border-bottom-color: var(--text); } }
@container (max-width: 520px) { .qs-properties-grid { grid-template-columns: 1fr; } .qs-section-head { flex-wrap: wrap; } }
@media (max-width: 900px) { .sidebar { width: 220px; } }

/* Server icon */
.icon-drop-row { display: flex; align-items: center; gap: 14px; }
.icon-drop {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center; color: var(--faint);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
  cursor: pointer; transition: border-color .1s, background .1s;
}
.icon-drop:hover, .icon-drop.dragging { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-text); }
.icon-preview { width: 64px; height: 64px; border-radius: 2px; image-rendering: pixelated; }
.icon-placeholder .icon { width: 22px; height: 22px; }
.icon-drop-info { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }

/* MOTD editor; the preview looks like Minecraft's server list (always dark) */
.motd-editor { display: grid; gap: 0; }
.motd-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--inset); border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; padding: 6px 8px;
}
.motd-swatches, .motd-formats { display: flex; flex-wrap: wrap; gap: 3px; }
.motd-swatch { width: 18px; height: 18px; padding: 0; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); }
.motd-swatch:hover { border-color: var(--text); }
.motd-toolbar-divider { width: 1px; align-self: stretch; background: var(--border); }
.motd-formats button { height: 22px; padding: 0 7px; font-size: 12px; background: transparent; border-color: transparent; }
.motd-formats button:hover { background: var(--hover); border-color: var(--border); }
.motd-input { width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
.motd-editor + .apply-row { margin-top: 8px; }
.mc-row { display: flex; align-items: center; gap: 14px; background: #101011; border: 1px solid #101011; border-radius: var(--radius); padding: 10px 12px; color: #e0e0e0; color-scheme: dark; }
.mc-row-icon { width: 48px; height: 48px; border-radius: 2px; image-rendering: pixelated; flex: none; }
.mc-row-icon-placeholder { display: grid; place-items: center; background: #1c1c1e; color: #5c5c60; }
.mc-row-icon-placeholder .icon { width: 20px; height: 20px; }
.mc-row-motd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-family: "Minecraft", monospace; font-size: 15px; letter-spacing: .5px; }
.motd-line { overflow: hidden; text-overflow: ellipsis; white-space: pre; line-height: 1.4; min-height: 1.4em; }
.motd-line .mc-bold { font-family: "MinecraftBold", monospace; }
.mc-row-count { flex: none; font: 12px var(--mono); color: #c8c8c8; min-width: 56px; text-align: right; }
.mc-row-count .muted { color: #8a8a8a; }
.mc-player-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; max-height: 110px; overflow-y: auto; }
.mc-player-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 1px 8px; font: 12px var(--mono); color: var(--text-2); }

/* Discord */
.discord-events { display: grid; gap: 8px; margin: 14px 0 6px; }
#discord-webhook { font-family: var(--mono); font-size: 12.5px; }

/* Schedule */
.sched-list { display: grid; gap: 6px; }
.sched-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sched-row.off { opacity: .6; }
.sched-row input[type="time"] { width: 96px; font-family: var(--mono); }
.sched-row select { width: auto; }
.sched-row input:not([type]) { flex: 1; min-width: 160px; }
.sched-on { margin-left: auto; font-size: 12.5px; }
.sched-row .fm-del { width: 28px; padding: 0; color: var(--muted); }
.sched-empty { margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.sched-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* Bedrock players */
.bedrock-info { display: grid; gap: 6px; margin-top: 12px; }
.bedrock-info:empty { display: none; }
.bedrock-info p { margin: 0; }
.bedrock-soon { font-size: 13px; color: var(--text-2); }
.bedrock-soon b { color: var(--accent-text); font-weight: 600; }
.bedrock-warn { padding: 8px 12px; border-left: 2px solid var(--warn); background: var(--warn-tint); font-size: 12.5px; color: var(--text-2); }
.bedrock-row { display: flex; align-items: baseline; gap: 14px; font-size: 13px; }
.bedrock-row .label-mono { width: 84px; flex: none; }
.bedrock-row b { font: 500 13px var(--mono); }
.bedrock-restart { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-left: 2px solid var(--accent); background: var(--accent-tint); font-size: 12.5px; }

/* Sleep mode */
.sleep-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sleep-row select { width: 140px; }
#sleep-note { margin: 10px 0 0; }
#sleep-note:empty { display: none; }

/* Backups */
.backup-list { display: grid; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.backup-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); }
.backup-row:last-child { border-bottom: 0; }
.backup-row:hover { background: var(--hover); }
.backup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.backup-date { font: 500 13px var(--mono); }
.backup-row .muted { font-size: 12px; }
.backup-row .fm-del { width: 28px; padding: 0; color: var(--muted); }
.backup-empty { padding: 14px; margin: 0; }
.plan-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 2px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cloud-used { margin: 8px 2px 0; font-size: 12px; }
#cloud-section { margin-top: 14px; }

/* Server software */
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
#sw-note { margin: 10px 0 0; }
#sw-note:empty { display: none; }
#sw-progress { margin-top: 12px; }
.tab-panel.software, .tab-panel.delete { max-width: 640px; }
.tab-panel.software > .card, .tab-panel.delete > .card { border-bottom: 0; }

/* ---------- lists: proxies, Java, keys ---------- */
.proxy-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.proxy-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: auto; text-align: left; justify-content: flex-start;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-left: 2px solid transparent;
  border-radius: 0; padding: 11px 14px 11px 12px; font-weight: 400;
}
.proxy-row:last-child { border-bottom: 0; }
.proxy-row:hover { background: var(--hover); border-color: var(--line); border-left-color: transparent; }
.proxy-row.selected { background: var(--selected); border-left-color: var(--text); }
.proxy-row .radio { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.proxy-row.selected .radio { border-color: var(--text); background: radial-gradient(var(--text) 38%, transparent 44%); }
.proxy-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.proxy-name { font-weight: 500; }
.proxy-loc { color: var(--muted); font-size: 12px; }
.proxy-picker { width: min(560px, 94vw); max-height: 80vh; overflow: auto; }
.proxy-picker .proxy-list { min-height: 60px; }
.picker-empty { text-align: center; padding: 18px 8px; }
.java-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.java-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.java-list li:last-child { border-bottom: 0; }
.java-list li strong { flex: none; width: 60px; font: 500 12.5px var(--mono); }
.java-src { flex: none; width: 70px; font-size: 12px; color: var(--muted); }
.key { background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; word-break: break-all; flex: 1; font-size: 12px; }
#license-active .key { font-size: 12.5px; }
.token-info { background: var(--inset); border: 1px solid var(--line); border-left: 2px solid var(--border-strong); padding: 9px 12px; display: grid; gap: 3px; font-size: 12.5px; }
.token-info .bad { color: var(--error-text); font-weight: 600; }

/* Forms */
.form { display: grid; gap: 16px; max-width: 540px; }
#view-new .form { border-bottom: 0; padding-top: 4px; }
.progress { display: grid; gap: 4px; }
.ram-custom { display: flex; align-items: center; gap: 8px; }
.ram-custom input { width: 110px; }
details summary { cursor: pointer; color: var(--text-2); font-weight: 500; margin: 4px 0 10px; }
details[open] { display: grid; gap: 12px; }
details.advanced { padding-top: 16px; }
details.advanced > summary { color: var(--muted); list-style: none; }
details.advanced > summary::before { content: "+ "; font-family: var(--mono); }
details.advanced[open] > summary::before { content: "− "; }
details.advanced[open] { gap: 18px; }
.credits { max-width: 760px; margin-top: 18px; }

/* New server: start with a world, modpack or template */
.new-mode button { padding: 0 12px; }
.new-source { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.new-source p { margin: 0; }
.new-source .apply-row input { flex: 1; min-width: 0; }
.source-info { font-size: 13px; }
.source-info p { margin: 4px 0 0; }
.error-text { color: var(--error-text); }
.template-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.template { display: grid; gap: 3px; height: auto; padding: 10px 12px; text-align: left; justify-items: start; align-content: start; font-weight: 400; white-space: normal; }
.template b { font-weight: 600; }
.template.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.template-platform { font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.template-desc { font-size: 12px; color: var(--text-2); line-height: 1.45; }
#view-new .form { max-width: 640px; }

/* Online access: plan and license */
.plan-badge { display: inline-block; margin-left: 10px; vertical-align: 2px; padding: 3px 7px 2px; border: 1px solid currentColor; border-radius: 2px; font-size: 10px; }
.plan-addresses { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-addresses:empty { display: none; }
.plan-address { font: 12px var(--mono); color: var(--text-2); border: 1px solid var(--line); background: var(--surface); border-radius: 2px; padding: 3px 8px; }
.plan-address.used { color: var(--muted); }
.plan-address small { font-family: inherit; color: var(--faint); margin-left: 6px; }
.plan-status { margin: 12px 0 0; font-size: 12px; }
.plan-status.bad { color: var(--error-text); }

/* ---------- Online access ---------- */
.oa { max-width: 760px; display: grid; gap: 14px; padding: 18px 0 24px; }
.oa-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; }
.oa-panel-head { margin-bottom: 14px; }
.oa-panel-head h3 { margin: 0 0 3px; }
.oa-panel-head p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.oa-plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.oa-eyebrow { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.oa-tier { font-size: 26px; letter-spacing: .12em; line-height: 1; }
.oa-plan-actions { display: flex; align-items: center; gap: 10px; }
.oa-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.oa-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.oa-state.ok { color: var(--accent-text); }
.oa-state.ok .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.oa-state.bad { color: var(--error-text); }
.oa-state.bad .dot { background: var(--error); }
.oa-desc { margin: 14px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.55; max-width: 600px; }
.oa-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.oa-stats:empty { display: none; }
.oa-stat { display: grid; gap: 3px; padding: 12px 14px; background: var(--inset); }
.oa-stat + .oa-stat { border-left: 1px solid var(--line); }
.oa-stat-label { font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.oa-stat-value { font: 500 17px var(--mono); color: var(--text); }
.oa-stat-sub { font-size: 11.5px; color: var(--muted); }
.oa-features { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.oa-features:empty { display: none; }
.oa-features li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.oa-features li .icon { width: 13px; height: 13px; }
.oa-features li.has { color: var(--text-2); }
.oa-features li.has .icon { color: var(--accent); stroke-width: 1.8; }
.oa-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.oa-note:empty { display: none; }
.oa-note.bad { color: var(--error-text); }
.oa-key { display: flex; align-items: center; gap: 4px; background: var(--inset); border: 1px solid var(--border); border-radius: 4px; padding: 4px 4px 4px 12px; }
.oa-key code { flex: 1; min-width: 0; font: 13px var(--mono); letter-spacing: .03em; color: var(--text); overflow-wrap: anywhere; padding: 4px 0; }
.icon-btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn .eye-off { display: none; }
.icon-btn.on .eye-off { display: inline; }
.icon-btn.on { color: var(--text); }
.link-plain { background: none; border: 0; padding: 0; min-height: 0; height: auto; margin-top: 10px; color: var(--text-2); font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.link-plain:hover { color: var(--text); }
.oa-account-hint { margin: 8px 0 0; }
.oa-account { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.oa-account b { color: var(--text); font-weight: 500; }
#account-code { max-width: 140px; font: 500 16px var(--mono); letter-spacing: 0.25em; }
.info-btn { display: inline-grid; place-items: center; width: 17px; height: 17px; min-height: 0; padding: 0; margin-left: 6px; vertical-align: 2px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: italic 600 11px/1 Georgia, serif; cursor: pointer; }
.info-btn:hover, .info-btn:focus-visible { border-color: var(--accent); color: var(--accent-text); }
.info-steps { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.info-code { margin: 0 0 10px; padding: 8px 12px; border-radius: 4px; background: var(--inset); border: 1px solid var(--border); font: 12.5px var(--mono); white-space: pre-wrap; }
.ports-list { display: grid; gap: 6px; margin-bottom: 12px; }
.ports-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 120px; align-items: center; gap: 10px; }
.ports-row .ports-public, .ports-row code { font-size: 12.5px; overflow-wrap: anywhere; }
.ports-row input { width: 100%; }
#ports-hint code { font-size: 11.5px; }
.oa-key-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; }
.link-danger { height: auto; padding: 0; border: 0; background: none; color: var(--error-text); font-size: 12.5px; font-weight: 500; }
.link-danger:hover { background: none; text-decoration: underline; color: var(--error-text); }
.oa .advanced { padding-top: 16px; padding-bottom: 16px; }
.oa .advanced > summary { margin: 0; }
.oa .advanced[open] > summary { margin-bottom: 4px; }
@container (max-width: 560px) { .oa-stats { grid-template-columns: 1fr; } .oa-stat + .oa-stat { border-left: 0; border-top: 1px solid var(--line); } }

/* Appearance (theme switch in Settings) */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented button { height: 30px; border: 0; border-radius: 0; background: transparent; color: var(--text-2); padding: 0 14px; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button:hover { background: var(--hover); color: var(--text); }
.segmented button.active { background: var(--primary); color: var(--primary-text); }

/* Phone page */
.phone-info { display: flex; gap: 18px; align-items: flex-start; margin-top: 14px; }
.phone-qr { flex: none; width: 150px; height: 150px; background: #fff; border-radius: 4px; padding: 4px; }
.phone-qr svg { width: 100%; height: 100%; display: block; }
.phone-text { display: grid; gap: 8px; min-width: 0; }
.phone-text p { margin: 0; }
#phone-link { font-size: 12px; overflow-wrap: anywhere; color: var(--text); background: var(--inset); border: 1px solid var(--line); border-radius: 2px; padding: 6px 8px; }

/* Feedback */
.feedback-form { max-width: none; gap: 12px; }
.feedback-form textarea { width: 100%; font-family: var(--sans); font-size: 13.5px; }
.feedback-list, .my-feedback-list { display: grid; gap: 10px; }
.feedback-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; background: var(--surface); }
.feedback-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 12px var(--mono); }
.feedback-text { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.feedback-item .small { margin: 0; }
.feedback-item.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.feedback-item.unread { box-shadow: inset 2px 0 0 var(--warn); }
.feedback-reply { border-left: 2px solid var(--accent); background: var(--inset); padding: 8px 12px; border-radius: 0 4px 4px 0; display: grid; gap: 4px; }
.inbox-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.inbox-actions .link-danger { margin-left: auto; }
.inbox-editor { display: grid; gap: 8px; }
.inbox-editor textarea { width: 100%; font-family: var(--sans); font-size: 13.5px; }
.admin-tabs { margin: 4px 0 14px; align-self: flex-start; }
.admin-tab-count:not(:empty) { margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--accent); color: var(--primary-text); font: 600 10.5px/16px var(--mono); }
/* The ⋯ menu uses the "+ New" popup; its entries are plain one-line items. */
.nav-more button { flex-direction: row; align-items: center; gap: 8px; border-left: 0; }
.nav-more button.active { background: var(--selected); }
.nav-more-btn { font-size: 18px; line-height: 1; letter-spacing: 2px; }
.nav-more-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-badge { margin-left: auto; padding: 0 6px; border-radius: 8px; background: var(--accent); color: var(--primary-text); font: 600 10px/16px var(--mono); text-transform: uppercase; }

/* ---------- Performance tab ---------- */
.tab-panel.perf { max-width: 1100px; }
.pf-status { padding: 18px 0 16px; }
.pf-headline { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.pf-headline b { font-weight: 600; }
.pf-headline.good .dot { background: var(--accent); }
.pf-headline.good b { color: var(--accent-text); }
.pf-headline.lag .dot { background: var(--error); }
.pf-headline.lag b { color: var(--error-text); }
.pf-headline.measuring .dot { background: var(--warn); }
.pf-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 4px 0 20px; border-bottom: 1px solid var(--line); }
@container (max-width: 760px) { .pf-charts { grid-template-columns: 1fr; } }
.pf-chart { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px 12px 8px; min-width: 0; }
.pf-chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pf-chart-head b { font: 500 13px var(--mono); }
.pf-chart-head b.bad { color: var(--error-text); }
.pf-chart svg { display: block; width: 100%; height: 90px; overflow: visible; }
.pf-line { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pf-area { fill: color-mix(in srgb, var(--text) 7%, transparent); stroke: none; }
.pf-line.bad { stroke: var(--error); }
.pf-area.bad { fill: color-mix(in srgb, var(--error) 10%, transparent); }
.pf-guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pf-axis { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--faint); margin-top: 4px; }
.pf-issues { display: grid; gap: 8px; }
.pf-issue { display: flex; align-items: center; gap: 16px; padding: 11px 14px; border: 1px solid var(--line); border-left: 3px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.pf-issue.bad { border-left-color: var(--error); }
.pf-issue.warn { border-left-color: var(--warn); }
.pf-issue.tip { border-left-color: var(--accent); }
.pf-issue-main { flex: 1; min-width: 0; }
.pf-issue-main b { font-weight: 600; }
.pf-issue-main p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.pf-issue button { flex: none; }
.pf-ok { margin: 0; color: var(--accent-text); }
.pf-pregen-body { display: grid; gap: 10px; }
.pf-pregen-body .apply-row select { width: 240px; }
.pf-pregen-body > p { margin: 0; }
.pf-inline { margin-left: 10px; }
.pf-progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pf-progress-fill { height: 100%; background: var(--accent); transition: width .4s; }
.pf-progress-text { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.pf-progress-text b { font: 500 14px var(--mono); color: var(--text); }

/* ---------- Players tab ---------- */
.tab-panel.players { max-width: 1000px; }
.pl-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.pl-title h2 { font-size: 17px; }
.pl-join { padding-top: 16px; }
.pl-card { padding-top: 18px; border-bottom: 0; }
.pl-add { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-add input { flex: 1; min-width: 180px; max-width: 320px; font-family: var(--mono); }
.pl-filters { display: flex; gap: 2px; margin: 18px 0 10px; flex-wrap: wrap; }
.pl-filters button { height: 28px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-weight: 500; border-radius: var(--radius); }
.pl-filters button:hover { background: var(--hover); color: var(--text); }
.pl-filters button.active { background: var(--selected); color: var(--text); }
.pl-count { margin-left: 6px; font: 11px var(--mono); opacity: .75; }
.pl-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pl-list:has(> .pl-empty) { border-style: dashed; background: transparent; }
.pl-empty { margin: 0; padding: 26px; text-align: center; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--line); min-height: 56px; }
.pl-row:last-child { border-bottom: 0; }
.pl-row:hover { background: var(--hover); }
.pl-head { flex: none; width: 34px; height: 34px; border-radius: 3px; overflow: hidden; background: var(--inset); border: 1px solid var(--line); display: grid; place-items: center; }
.pl-head img { width: 100%; height: 100%; image-rendering: pixelated; }
.pl-initial { font: 600 14px var(--mono); color: var(--muted); }
.pl-row.banned .pl-head, .pl-row.banned .pl-name b { opacity: .55; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-name { display: flex; align-items: baseline; gap: 8px; }
.pl-name b { font: 600 13.5px var(--mono); }
.pl-online { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.pl-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row.banned .pl-sub { color: var(--error-text); }
.pl-chips { flex: none; display: flex; gap: 6px; }
/* Toggle chips: outlined when off, filled when on */
.pl-chip { height: 26px; padding: 0 10px; font-size: 12px; color: var(--muted); background: transparent; border-color: var(--border); }
.pl-chip:hover { color: var(--text); }
.pl-chip.on { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }
.pl-chip.on::before { content: "✓"; font-size: 11px; }
.pl-kick { flex: none; width: 48px; }
.pl-ban { color: var(--muted); }
.pl-ban:hover { color: var(--error-text); }
.pl-note { margin: 10px 0 0; }
@container (max-width: 640px) { .pl-sub { display: none; } .pl-chip { padding: 0 7px; } }

/* ---------- Mods / Plugins tab ---------- */
.tab-panel.addons { max-width: 1100px; }
.addons-card { padding-top: 16px; border-bottom: 0; }
.addons-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.addons-count { margin-left: 6px; font: 11px var(--mono); opacity: .7; }
.addons-search { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.addons-search input { flex: 1; min-width: 0; }
.addons-search select { width: 170px; }
#addons-update-all { margin-left: auto; }
.addons-note { margin: 10px 0 0; }
.addons-note:empty { display: none; }
.addons-list { margin-top: 12px; display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.addons-list:has(> .addons-empty) { border-style: dashed; background: transparent; }
.addons-empty { margin: 0; padding: 28px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.addons-empty p { margin: 0; }
.addon-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); min-height: 58px; }
.addon-row:last-child { border-bottom: 0; }
.addon-row:hover { background: var(--hover); }
.addon-row.off .addon-icon, .addon-row.off .addon-main { opacity: .5; }
.addon-icon { flex: none; width: 36px; height: 36px; border-radius: 3px; overflow: hidden; display: grid; place-items: center; background: var(--inset); border: 1px solid var(--line); color: var(--faint); }
.addon-icon img { width: 100%; height: 100%; object-fit: cover; }
.addon-icon .icon { width: 18px; height: 18px; }
.addon-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.addon-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.addon-title b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addon-version, .addon-author { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addon-side { flex: none; font: 500 10.5px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 2px; padding: 0 5px; white-space: nowrap; }
.addon-side.server { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.addon-side.client { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.addon-tag { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.addon-file { font: 11.5px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addon-file:empty { display: none; }
.addon-desc { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.addon-downloads { flex: none; width: 64px; text-align: right; font: 12px var(--mono); color: var(--muted); }
.addon-installed { flex: none; width: 78px; text-align: center; font: 500 12px var(--mono); color: var(--accent-text); }
.addon-row .addon-install { width: 78px; }
.addon-switch { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.addon-row .fm-del { width: 28px; padding: 0; color: var(--muted); }
.addon-row .fm-del:hover { color: var(--error-text); }
.addons-more { display: flex; justify-content: center; padding-top: 12px; }
/* The arrow that shows the mods/plugins folder in the Files tab */
.addons-folder { height: 30px; width: 30px; padding: 0; color: var(--muted); }
.addons-folder:hover { color: var(--text); }
.addons-folder .icon { width: 13px; height: 13px; }
.addon-open { flex: none; height: auto; padding: 0; border: 0; background: transparent; border-radius: 3px; }
.addon-open:hover { background: transparent; border: 0; }
.addon-open:hover .addon-icon { border-color: var(--border-strong); }
.addon-clickable { cursor: pointer; }
.addon-clickable:hover .addon-title b { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }

/* Details window: header, actions, then the description (scrolls) */
.addon-modal { place-items: center; }
.modal-box.addon-details { width: min(860px, 94vw); height: min(820px, 90vh); display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.ad-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 14px 22px; }
.addon-icon.ad-icon { width: 56px; height: 56px; }
.ad-icon .icon { width: 24px; height: 24px; }
.ad-heading { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ad-heading h2 { font-size: 20px; overflow-wrap: anywhere; }
.ad-sub { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.ad-sub:empty { display: none; }
.ad-meta { font: 12px var(--mono); color: var(--muted); }
.ad-close { width: 30px; height: 30px; padding: 0; flex: none; }
.ad-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 22px 16px; border-bottom: 1px solid var(--line); }
.ad-actions .addon-installed { width: auto; padding: 0 6px 0 0; }
.ad-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 28px; }
.ad-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.ad-gallery img { height: 110px; width: auto; border-radius: 3px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }

/* Rendered descriptions */
.md { font-size: 14px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; max-width: 760px; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.4em 0 .5em; line-height: 1.3; }
.md h2 { font-size: 19px; }
.md h3 { font-size: 16px; }
.md h4, .md h5, .md h6 { font-size: 14px; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table, .md details { margin: 0 0 .9em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md img { max-width: 100%; height: auto; vertical-align: middle; border-radius: 2px; }
.md a { color: var(--accent-text); cursor: pointer; }
.md code { font: 12.5px var(--mono); background: var(--inset); border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; color: var(--text); }
.md pre { background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { padding: 2px 0 2px 14px; border-left: 2px solid var(--border-strong); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.md th { background: var(--inset); }
.md details summary { cursor: pointer; font-weight: 500; }
.md center, .md [align="center"] { text-align: center; }
@container (max-width: 640px) { .addon-downloads, .addon-switch span { display: none; } }

/* ---------- Files tab ---------- */
.tab-panel.files { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab-panel.files > .card[hidden] { display: none; }
.fm, .fm-editor { flex: 1; display: flex; flex-direction: column; min-height: 260px; padding: 14px 0 0; border-bottom: 0; position: relative; }
.fm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.fm-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; font: 12.5px var(--mono); }
.fm-crumbs .crumb { height: 24px; padding: 0 6px; border: 1px solid transparent; background: transparent; color: var(--text-2); font: inherit; }
.fm-crumbs .crumb:last-child { color: var(--text); font-weight: 500; }
.fm-crumbs .crumb:hover { background: var(--hover); color: var(--text); }
.fm-crumbs .crumb.drag-over { border-color: var(--accent); background: var(--accent-tint); }
.crumb-sep { color: var(--faint); }
.fm-actions { display: flex; gap: 6px; }
.fm-list { flex: 1; height: 0; min-height: 120px; overflow: auto; outline: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.fm-list:focus-visible { border-color: var(--border-strong); }
.fm-row { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); cursor: default; user-select: none; }
.fm-row:hover { background: var(--hover); }
.fm-row.selected { background: var(--selected); box-shadow: inset 2px 0 0 var(--text); }
.fm-row.drag-over { background: var(--accent-tint); outline: 1px solid var(--accent); outline-offset: -1px; }
.fm-row.cut { opacity: .45; }
.fm-icon { flex: none; width: 18px; display: grid; place-items: center; color: var(--muted); }
.fm-row.dir .fm-icon { color: var(--text-2); }
.fm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-row.dir .fm-name { font-weight: 500; }
.fm-size { flex: none; width: 84px; text-align: right; color: var(--muted); font: 12px var(--mono); }
.fm-row-actions { flex: none; display: flex; gap: 2px; opacity: 0; }
.fm-row:hover .fm-row-actions, .fm-row.selected .fm-row-actions { opacity: 1; }
.fm-row-actions button { width: 26px; padding: 0; color: var(--muted); }
.fm-row-actions .fm-del:hover { color: var(--error-text); }
.fm-empty { padding: 28px; text-align: center; }
.fm-hint { padding: 8px 2px 0; font-size: 12px; color: var(--muted); }
.fm-drop {
  position: absolute; inset: 52px 0 26px; display: grid; place-items: center; pointer-events: none; z-index: 2;
  border: 1px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--text-2); font-size: 14px;
}
.fm-drop[hidden] { display: none; }
.fm-drop b { color: var(--accent-text); font-weight: 600; }
.fm-menu-overlay { position: fixed; inset: 0; z-index: 30; }
.fm-menu { position: fixed; min-width: 180px; padding: 4px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.fm-menu button { justify-content: flex-start; height: 28px; padding: 0 10px; border: 0; background: transparent; font-weight: 400; color: var(--text); }
.fm-menu button:hover { background: var(--hover); }
.fm-menu button.danger { color: var(--error-text); }
.fm-menu button.danger:hover { background: var(--error-tint); }
.fm-menu-sep { height: 1px; margin: 4px 2px; background: var(--line); }

/* Editor: tab, toolbar, gutter + text, status bar */
.fe-tabs { display: flex; border-bottom: 1px solid var(--line); }
.fe-tab {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; margin-bottom: -1px;
  border: 1px solid var(--line); border-bottom-color: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface); font: 500 12.5px var(--mono);
}
.fe-dirty { color: var(--warn); font-size: 11px; }
.fe-dirty[hidden] { display: none; }
.fe-close { height: 20px; width: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.fe-close:hover { color: var(--text); background: var(--hover); }
.fe-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-bottom: 0; }
.fe-path { font: 12px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-buttons { display: flex; gap: 6px; flex: none; }
.fe-body { flex: 1; display: flex; min-height: 0; height: 0; border: 1px solid var(--line); background: var(--surface); }
.fe-gutter, #fe-text { font: 12.5px/1.6 var(--mono); padding: 10px 0; margin: 0; }
.fe-gutter { flex: none; min-width: 48px; padding-left: 10px; padding-right: 10px; text-align: right; overflow: hidden; color: var(--faint); background: var(--inset); border-right: 1px solid var(--line); user-select: none; }
#fe-text { flex: 1; height: auto; min-width: 0; resize: none; border: 0; border-radius: 0; background: transparent; padding-left: 12px; padding-right: 12px; white-space: pre; overflow: auto; tab-size: 4; }
#fe-text:focus { border: 0; box-shadow: none; }
.fe-status { display: flex; height: 24px; align-items: center; padding: 0 10px; font: 11.5px var(--mono); color: var(--muted); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--inset); white-space: pre; }

/* ---------- Admin ---------- */
.admin-search { width: 260px; }
.admin-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.admin-stats .stat:first-child { padding-left: 0; }
@container (max-width: 760px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-stats .stat { border-right: 0; padding-left: 0; } }
.admin-section { padding: 18px 0 20px; }
.admin-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.admin-section-head .muted { font: 12px var(--mono); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; padding: 9px 12px 8px; border-bottom: 1px solid var(--line); background: var(--inset); white-space: nowrap; }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tr.admin-total td { border-top: 1px solid var(--line); background: var(--inset); font-weight: 600; }
.admin-table tbody tr:hover td { background: var(--hover); }
.admin-table td .dot { display: inline-block; margin-right: 8px; vertical-align: 1px; }
.admin-table code { font-size: 12.5px; color: var(--text); }
.admin-empty { text-align: center; padding: 18px; }
.admin-tier { font-size: 10.5px; }
.admin-tier:not(.free):not(.pro):not(.ultra):not(.admin) { color: var(--muted); }
.admin-badge { font: 500 11px var(--mono); padding: 1px 7px; border-radius: 2px; border: 1px solid var(--border); color: var(--text-2); }
.admin-badge.live { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); background: var(--accent-tint); }
.admin-badge.idle { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); background: var(--warn-tint); }

/* ---------- dialogs, toasts, update gate ---------- */
.modal { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 10; }
.modal-box { width: min(460px, 92vw); display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 20px 22px 18px; box-shadow: var(--shadow); }
.modal-box .qs-section-head { margin-bottom: 4px; }
.modal-box .apply-row.end { margin-top: 8px; }
#modal-text { font-size: 13px; color: var(--text-2); }
#modal-text ul { margin: 2px 0 4px; padding-left: 16px; display: grid; gap: 7px; line-height: 1.5; }
#modal-input { width: 100%; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; max-width: 80vw;
  background: var(--primary); color: var(--primary-text); padding: 9px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 13px;
}
.toast.error { background: var(--error); color: #fff; }
.update-gate { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.update-box { width: min(520px, 100%); display: grid; gap: 14px; justify-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 28px 30px 26px; box-shadow: var(--shadow); }
.update-box .wordmark { height: 24px; margin-bottom: 6px; }
.update-box p { margin: 0; color: var(--text-2); line-height: 1.5; }
.update-box b { color: var(--text); }
.update-notes { width: 100%; max-height: 180px; overflow-y: auto; white-space: pre-wrap; font-size: 12.5px; color: var(--text-2); background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.update-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.update-progress { font-size: 12.5px; }
.update-progress:empty { display: none; }

/* Settings → Web share key */
.share-key { font: 500 13px/1.4 var(--mono); padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; user-select: all; overflow-wrap: anywhere; }
