/* Mudhut - one look on both sides: warm ivory, olive accent, serif headings (the admin took the
   player page's palette in 0.44.1). Components are shared, so buttons, forms, dialogs and feedback
   match everywhere. body.play keeps its own block so the player page can still drift on its own. */
:root {
  --bg: #f8f3ea;
  --bg-glow: #f8f3ea;
  --panel: #fdfaf4;
  --panel-2: #f3ede0;
  --panel-3: #eae2d1;
  --line: #e5dcc9;
  --line-strong: #d0c4aa;
  --text: #231f19;
  --muted: #6c6455;
  --faint: #978e7d;
  --accent: #4a5a34;
  --accent-hover: #3b4a28;
  --accent-ink: #fbf8f1;
  --accent-soft: #ecebd9;
  --accent-line: #d2d3b0;
  --ok: #237249;
  --ok-soft: #e4f3ea;
  --ok-line: #b4dcc4;
  --warn: #8c5609;
  --warn-soft: #fbf1de;
  --warn-line: #ebcb8f;
  --bad: #bb3a30;
  --bad-soft: #fae6e3;
  --sleep: #56677a;
  --sleep-soft: #ece8df;
  --bar-bg: #231f19;
  --bar-ink: #fbf8f1;
  --bar-muted: #b9b0a0;
  --bar-line: #4a443a;
  --bar-go: #6d8a45;
  --chart-1: #4a5a34;
  --chart-2: #a3977f;
  --shadow: 0 1px 2px rgb(60 45 20 / .05), 0 3px 12px rgb(60 45 20 / .04);
  --shadow-lg: 0 12px 40px rgb(15 25 40 / .18);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
/* Player page: ivory neutrals, same accent and shapes. */
body.play {
  --bg: #f8f3ea;
  --bg-glow: #f8f3ea;
  --panel: #fdfaf4;
  --panel-2: #f3ede0;
  --panel-3: #eae2d1;
  --line: #e5dcc9;
  --line-strong: #d0c4aa;
  --text: #231f19;
  --muted: #6c6455;
  --faint: #978e7d;
  --accent: #4a5a34;
  --accent-hover: #3b4a28;
  --accent-ink: #fbf8f1;
  --accent-soft: #ecebd9;
  --accent-line: #d2d3b0;
  --chart-1: #4a5a34;
  --sleep-soft: #ece8df;
  --shadow: 0 1px 2px rgb(60 45 20 / .05), 0 3px 12px rgb(60 45 20 / .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15110c;
    --bg-glow: #15110c;
    --panel: #1e1813;
    --panel-2: #261f18;
    --panel-3: #30271e;
    --line: #342a20;
    --line-strong: #4a3c2d;
    --text: #f1e9de;
    --muted: #ab9d8c;
    --faint: #7d6f61;
    --accent: #b4c48f;
    --accent-hover: #c8d6a8;
    --accent-ink: #1a2010;
    --accent-soft: #232a18;
    --accent-line: #4a5535;
    --ok: #5cc28a;
    --ok-soft: #12291d;
    --ok-line: #285a3f;
    --warn: #e5ad54;
    --warn-soft: #30240f;
    --warn-line: #6a4f20;
    --bad: #ee7d70;
    --bad-soft: #381a17;
    --sleep: #94a7bb;
    --sleep-soft: #221f1b;
    --bar-bg: #0d0a07;
    --bar-ink: #f1e9de;
    --bar-muted: #a89b8a;
    --bar-line: #3a3025;
    --bar-go: #6d8a45;
    --chart-1: #b4c48f;
    --chart-2: #8a7d6c;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 4px 16px rgb(0 0 0 / .25);
    --shadow-lg: 0 16px 50px rgb(0 0 0 / .55);
    color-scheme: dark;
  }
  body.play {
    --bg: #15110c;
    --bg-glow: #15110c;
    --panel: #1e1813;
    --panel-2: #261f18;
    --panel-3: #30271e;
    --line: #342a20;
    --line-strong: #4a3c2d;
    --text: #f1e9de;
    --muted: #ab9d8c;
    --faint: #7d6f61;
    --accent: #b4c48f;
    --accent-hover: #c8d6a8;
    --accent-ink: #1a2010;
    --accent-soft: #232a18;
    --accent-line: #4a5535;
    --chart-1: #b4c48f;
    --sleep-soft: #221f1b;
  }
}

* { box-sizing: border-box; }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
:is(h1, h2, h3) :is(.pill, .badge, .chip, small, button) { font-family: var(--sans); letter-spacing: 0; }   /* badges keep the UI font */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 500px at 70% -10%, var(--bg-glow), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; } h2 { font-size: 1.1rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--accent); text-underline-offset: 2px; }
code { overflow-wrap: anywhere; font-family: var(--mono); font-size: .86em; background: var(--panel-2); padding: .1em .4em; border-radius: 5px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); min-height: 1.2em; margin: .5em 0 0; font-size: .9rem; }
.note { color: var(--muted); font-size: .85rem; padding: 4px 18px; }
.ico { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- controls ---- */
button, .btnlink {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--radius-sm); padding: .5em .95em;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  text-decoration: none; line-height: 1.3;
}
button:hover, .btnlink:hover { border-color: var(--line-strong); background: var(--panel-2); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary, .btnlink.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; box-shadow: 0 1px 2px rgb(40 80 20 / .25); }
button.primary:hover, .btnlink.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--bad); }
button.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--panel-2); border-color: transparent; }
button.small, .btnlink.small { padding: .32em .7em; font-size: .88rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55em .7em;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, .btnlink:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 1em; }
label input, label select, label textarea { margin-top: .35em; font-weight: 400; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: .3em; font-size: .82rem; line-height: 1.4; }
label.check { display: flex; gap: .65em; align-items: flex-start; font-weight: 400; padding: .55em .7em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; }
label.check:hover { border-color: var(--line-strong); }
label.check b { font-weight: 600; }
label.check input { width: 1.05em; height: 1.05em; margin-top: .2em; accent-color: var(--accent); flex: none; }
input[type=checkbox] { accent-color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: .5em; }
.brand { display: flex; align-items: center; gap: .6em; font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .2)); }
a.brand { color: inherit; text-decoration: none; border-radius: 10px; }
a.brand:hover img { transform: translateY(-1px) rotate(-4deg); }
a.brand img { transition: transform .15s ease; }

/* ---- pills / tags ---- */
.pill { display: inline-flex; align-items: center; gap: .45em; font-size: .8rem; font-weight: 600; padding: .22em .7em .22em .55em; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.running { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.pill.exited, .pill.created { color: var(--sleep); background: var(--sleep-soft); border-color: transparent; }
.pill.restarting { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
/* Phases (status.phase): asleep wakes on join, stopped does not, held = the crash guard keeps it off. */
.pill.asleep { color: var(--sleep); background: var(--sleep-soft); border-color: transparent; }
.pill.stopped, .pill.paused { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.pill.starting { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill.held { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.tag { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; padding: .1em .55em; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.tag.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.tag.keep { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.running { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2.4s ease-in-out infinite; }
.dot.exited, .dot.created { background: var(--sleep); }
.dot.restarting { background: var(--warn); }
.dot.asleep { background: var(--sleep); }
.dot.stopped, .dot.paused { background: transparent; border: 2px solid var(--sleep); }
.dot.starting { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.held { background: var(--bad); }
.dot.missing, .dot.unknown { background: transparent; border: 2px solid var(--faint); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---- gate ---- */
.gate {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background:
    linear-gradient(transparent 0 0),
    repeating-linear-gradient(0deg, rgb(127 100 70 / .05) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgb(127 100 70 / .05) 0 1px, transparent 1px 32px);
}
.gate-card { width: min(440px, 100%); padding: 28px; box-shadow: var(--shadow-lg); }
.gate-card .brand { margin-bottom: 1.4em; font-size: 1.4rem; }
.gate-card .brand img { width: 40px; height: 40px; }
.gate-card h1 { font-size: 1.35rem; }
.gate-card button.primary { width: 100%; padding: .7em; margin-top: .3em; }

/* ---- layout ---- */
.app { display: grid; height: 100%; grid-template: "top top" auto "side main" 1fr / 280px minmax(0, 1fr); }
.topbar {
  grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: blur(8px); position: relative; z-index: 2;
}
.topbar .brand small { font-weight: 500; font-size: .78rem; color: var(--muted); margin-left: .2em; letter-spacing: 0; }
.topbar-right { display: flex; gap: 4px; align-items: center; white-space: nowrap; min-width: 0; }
.sidebar { grid-area: side; border-right: 1px solid var(--line); overflow-y: auto; background: color-mix(in srgb, var(--panel) 70%, transparent); padding-bottom: 20px; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 6px; }
.sidebar-head h2 { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.main { grid-area: main; overflow-y: auto; padding: 24px 28px 0; min-width: 0; }
.main::after { content: ""; display: block; height: 80px; }      /* the room below the page, outside the padding so a sticky bar can sit on the very bottom edge */
.main > * { max-width: 1180px; }

.server-list { list-style: none; margin: 0; padding: 2px 10px; display: grid; gap: 3px; }
.server-list li button {
  width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 11px;
  display: grid; grid-template-columns: 38px 1fr; gap: 1px 11px; align-items: center; padding: 8px 10px; justify-content: stretch;
}
.server-list li button:hover { background: var(--panel-2); }
.server-list li button.active { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
.server-list .tile { grid-row: span 2; }
.server-list .name { font-weight: 600; display: flex; align-items: center; gap: .45em; min-width: 0; }
.server-list .name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-list .sub { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: .45em; }
.server-list .changed { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.nav-all { padding-top: 12px; }
.empty-list { color: var(--muted); font-size: .88rem; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 11px; margin: 4px 0; }

/* server tile (letter avatar) */
.tile {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 1rem;
  color: #fff; text-shadow: 0 1px 1px rgb(0 0 0 / .3); position: relative; flex: none;
  background: linear-gradient(145deg, var(--t1), var(--t2));
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), inset 0 2px 0 rgb(255 255 255 / .18);
}
.tile.big { width: 56px; height: 56px; border-radius: 14px; font-size: 1.5rem; }
.tile .dot { position: absolute; right: -3px; bottom: -3px; border: 2px solid var(--panel); width: 12px; height: 12px; box-shadow: none; animation: none; }
.tile.big .dot { width: 15px; height: 15px; }
.tile.t-vanilla { --t1: #6fae4f; --t2: #3f7a2c; }
.tile.t-paper { --t1: #e0e0e0; --t2: #9a9a9a; color: #2a2a2a; text-shadow: none; }
.tile.t-fabric { --t1: #d9c3a0; --t2: #a3865e; }
.tile.t-quilt { --t1: #c58ad8; --t2: #8b4fa3; }
.tile.t-neoforge, .tile.t-forge { --t1: #e08a4b; --t2: #a6512a; }
.tile.t-modrinth { --t1: #3fc77e; --t2: #198a50; }
.tile.t-curseforge { --t1: #f37744; --t2: #c24a1b; }
.tile.t-packwiz { --t1: #7f8ff0; --t2: #4b5bc0; }
.tile.t-all { --t1: #8a7663; --t2: #5c4b3c; }

/* ---- detail ---- */
.hero {
  display: flex; flex-wrap: wrap; gap: 16px 20px; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-left { display: flex; gap: 16px; align-items: center; min-width: 0; }
.hero h1 { margin: 0; display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: .45em; }
.address { display: inline-flex; align-items: center; gap: .3em; font-family: var(--mono); font-size: .88rem; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .15em .25em .15em .6em; max-width: 100%; }
.address span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.address button { padding: .2em .45em; border: none; background: transparent; color: var(--muted); }
.address button:hover { color: var(--text); background: var(--panel-3); }
.address button.copied { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner .b-text { display: flex; gap: 12px; align-items: flex-start; }
.banner .b-text > .ico { margin-top: .15em; width: 1.25em; height: 1.25em; }
.banner.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.banner.warn .b-text > .ico { color: var(--warn); }
.banner.bad { background: var(--bad-soft); border: 1px solid var(--bad); }
.banner.bad .b-text > .ico { color: var(--bad); }
.banner.info { background: var(--accent-soft); border: 1px solid var(--accent-line); justify-content: flex-start; }
.banner .banner-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.banner.info .banner-btns { margin-left: auto; }
.banner .fields { display: flex; flex-wrap: wrap; gap: 4px; margin: .35em 0 .2em; }
.banner .fields code { background: var(--panel); }

.tabs { display: flex; gap: 2px; margin-bottom: 18px; overflow-x: auto; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1px solid transparent; border-radius: 9px; background: transparent; padding: .45em .85em; color: var(--muted); white-space: nowrap; font-weight: 550; }
.tabs button:hover { color: var(--text); background: transparent; border-color: transparent; }
.tabs button.active { color: var(--text); background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
.tabs button .ico { opacity: .8; }
.tabs button.active .ico { color: var(--accent); opacity: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; display: flex; align-items: center; gap: .5em; }
.stat .label .ico { color: var(--faint); width: 1.15em; height: 1.15em; }
.stat .value { font-size: 1.55rem; font-weight: 700; margin-top: .25em; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .4em; }
.stat .value small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat .hint { color: var(--muted); font-size: .84rem; margin-top: .15em; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 7px; background: var(--panel-3); border-radius: 4px; margin-top: .7em; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 4px; transition: width .4s; }
.meter.hot span { background: linear-gradient(90deg, var(--warn), var(--bad)); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin: 4px -20px -18px; background: var(--line); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.facts div { padding: 12px 20px; background: var(--panel); }
.facts dt { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.facts dd { margin: .15em 0 0; font-weight: 600; overflow-wrap: anywhere; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 4px; margin: 0 0 18px; background: var(--panel); box-shadow: var(--shadow); }
legend { font-weight: 700; padding: 0 .5em; margin-left: -.5em; font-size: .95rem; letter-spacing: 0; color: var(--text); }
.form-actions { display: flex; gap: 12px; align-items: center; position: sticky; bottom: 0; padding: 12px 16px; margin: 0 -4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; }

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.person-list { list-style: none; padding: 0; margin: 12px 0 0; }
.person-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.person-list .face { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(145deg, #8a7663, #5c4b3c); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .2); }
.person-list .pname { flex: 1; font-weight: 550; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
.inline-form select { width: auto; flex: 0 0 auto; max-width: 45%; }   /* the global select rule is width:100%, which squeezed the search box to nothing */

pre.log, pre.yaml {
  font-family: var(--mono); font-size: .8rem; line-height: 1.55; background: #0f0b08; color: #e6dacb;
  border-radius: 11px; padding: 14px 16px; overflow: auto; max-height: 60vh; white-space: pre-wrap; word-break: break-word; margin: 0;
  border: 1px solid #2a2018; box-shadow: inset 0 2px 8px rgb(0 0 0 / .4);
}
.console-reply { margin-top: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }

.history { list-style: none; padding: 0; margin: 0; position: relative; }
.history li { position: relative; padding: 0 0 18px 26px; }
.history li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.history li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.history li:last-child::after { display: none; }
.history li.fail::before { border-color: var(--bad); }
.history .when { color: var(--muted); font-size: .84rem; }
.history .changes { font-family: var(--mono); font-size: .8rem; margin-top: .4em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.history .changes div { overflow-wrap: anywhere; }
.history .changes .arrow { color: var(--faint); }

dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); padding: 24px; width: min(580px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop .18s ease-out; }
dialog::backdrop { background: rgb(20 12 5 / .55); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dlg-section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.dlg-section summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dlg-section form { margin-top: 10px; }
.choice { display: grid; gap: 10px; margin: 14px 0; }
.choice button, .choice-row button { text-align: left; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; justify-content: stretch; border-radius: 12px; }
.choice button > .ico, .choice-row button > .ico { grid-row: span 2; width: 1.6em; height: 1.6em; color: var(--accent); }
.choice small, .choice-row button small { display: block; color: var(--muted); font-weight: 400; font-size: .84rem; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice-row button.picked { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

.pack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pack-list button { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 10px 14px; border-radius: 12px; justify-content: stretch; }
.pack-list img, .pack-list .noicon { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.pack-list small { color: var(--muted); font-weight: 400; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: var(--panel-2); }
.table tr:last-child td { border-bottom: none; }
.table tr.pinned td { background: var(--accent-soft); }
.table .num { font-variant-numeric: tabular-nums; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 4px; }
.table-card { padding: 6px 10px; overflow-x: auto; }

.empty { text-align: center; margin: 12vh auto 0; max-width: 420px; }
.empty img { width: 84px; height: 84px; opacity: .9; filter: drop-shadow(0 8px 18px rgb(0 0 0 / .25)); margin-bottom: 14px; }
.empty h2 { font-size: 1.3rem; }
.empty button { margin-top: 10px; }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(150%); opacity: 0;
  background: var(--text); color: var(--bg); padding: .7em 1.2em; border-radius: 12px; transition: transform .25s cubic-bezier(.2,.9,.3,1.2), opacity .2s;
  max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); font-weight: 550; display: flex; gap: .55em; align-items: center; z-index: 10;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }

#tab { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 760px) {
  .app { grid-template: "top" auto "side" auto "main" 1fr / minmax(0, 1fr); height: auto; min-height: 100%; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); max-height: 42vh; }
  .main { padding: 16px; overflow: visible; }
  .topbar { padding: 8px 12px; }
  .topbar .brand small { display: none; }
  .topbar-right .label { display: none; }
  .hero { padding: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .value { font-size: 1.3rem; }
  .card { padding: 14px 16px; }
  .facts { margin: 4px -16px -14px; }
  .hero h1 { font-size: 1.3rem; }
  .tile.big { width: 46px; height: 46px; font-size: 1.25rem; }
  .table th.hide-sm, .table td.hide-sm { display: none; }
  .row-actions { white-space: normal; }
}

.tile .ico { width: 20px; height: 20px; stroke-width: 2.2; }
.tile.big .ico { width: 28px; height: 28px; }
#all-btn .tile { --t1: #8a7663; --t2: #5c4b3c; }

.port-help { margin: -.5em 0 1em; display: grid; gap: 6px; grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { padding: .15em .6em; font-size: .82rem; border-radius: 99px; font-family: var(--mono); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---- stats charts ---- */
.range-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.range-row button.active { background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; transition: opacity .15s; }
.charts.loading { opacity: .5; }
.chart-card { position: relative; padding: 14px 16px 10px; }
.chart-card h3 { margin: 0; font-size: .95rem; }
.chart-card .now { font-size: 1.35rem; font-weight: 700; margin: 2px 0 4px; }
.chart-card .now small { font-size: .8rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.chart-card svg { display: block; width: 100%; height: 170px; overflow: visible; touch-action: pan-y; }
.chart-card .grid { stroke: var(--line); stroke-width: 1; }
.chart-card .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-card .ref { stroke: var(--faint); stroke-width: 1; }
.chart-card .ref-label { fill: var(--muted); font-size: 11px; }
.chart-card .end-label { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.chart-card .xhair { stroke: var(--line-strong); stroke-width: 1; }
.chart-legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); margin: 0 0 4px; }
.chart-legend i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 6px 9px; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; z-index: 2; }
.chart-tip .tt { color: var(--muted); margin-bottom: 2px; }
.chart-tip .row { display: flex; align-items: center; gap: 7px; }
.chart-tip .row i { width: 12px; height: 2px; border-radius: 1px; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-empty { color: var(--muted); font-size: .85rem; padding: 50px 0; text-align: center; }
.data-table { margin-top: 14px; }
.data-table summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.data-table table td, .data-table table th { font-variant-numeric: tabular-nums; }

/* ---- health ---- */
.health-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.health-head .big-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.big-dot.ok { background: var(--accent); } .big-dot.warn { background: var(--warn); } .big-dot.bad { background: var(--bad); }
.rec { border-left: 4px solid var(--line-strong); margin-bottom: 12px; }
.rec.bad { border-left-color: var(--bad); } .rec.warn { border-left-color: var(--warn); } .rec.info { border-left-color: var(--sleep); }
.rec h3 { margin: 0 0 4px; } .rec p { margin: 0 0 8px; }
.rec ul { margin: 0 0 8px; padding-left: 20px; } .rec li { margin: 3px 0; overflow-wrap: anywhere; }
.rec .links { display: flex; gap: 12px; flex-wrap: wrap; font-size: .9rem; margin-bottom: 8px; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.events .when { color: var(--muted); font-size: .8rem; grid-column: 2; }
.events .t { overflow-wrap: anywhere; }
.health-mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.health-mark.warn { background: var(--warn); } .health-mark.bad { background: var(--bad); }
.update-mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle; background: var(--accent); }
.compose-box { width: 100%; min-height: 140px; font-family: ui-monospace, monospace; font-size: 12px; }
.compose-notes { margin: 8px 0 0; padding-left: 18px; }

/* Import picker: one tappable row per folder under the servers root. */
.folder-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.folder-pick { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; justify-content: stretch; }
.folder-pick .fp-text { min-width: 0; display: grid; gap: 2px; }
.folder-pick .fp-text b, .folder-pick .fp-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-pick .tag { white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.folder-pick:disabled { opacity: .55; cursor: default; }
@media (max-width: 480px) { .folder-pick { grid-template-columns: auto 1fr; } .folder-pick .tag { grid-column: 2; justify-self: start; } }
.zip-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 2px 12px; }
.link { color: var(--accent); text-decoration: underline; cursor: pointer; }
#dp-box summary code { overflow-wrap: anywhere; }

/* backups: read-back + test boot results */
.ok-text { color: var(--accent); }
.ok-text .ico, td .error .ico { width: 1em; height: 1em; vertical-align: -.15em; margin-right: .25em; }
/* settings: remove from Mudhut */
.remove-card { margin-top: 20px; border-color: var(--bad); }
.remove-card .check { display: flex; gap: 8px; align-items: center; margin: .2em 0 .8em; }

/* what's new */
#news-btn { position: relative; }
.new-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); }
.news h2 { display: flex; align-items: center; gap: .4em; margin-bottom: .1em; }
.news section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.news section.latest h3::after { content: "new since you last looked"; font-size: .72rem; font-weight: 600; color: var(--accent); margin-left: .3em; }
.news h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .45em; margin: 0 0 .5em; font-size: 1rem; }
.news ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.news li { display: grid; grid-template-columns: 4.2em 1fr; gap: 8px; align-items: baseline; line-height: 1.45; }
.news li .tag { justify-content: center; }
.news .tag.keep { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
dialog:has(.news) { max-height: min(86vh, 900px); overflow-y: auto; }
@media (max-width: 760px) { #news-btn .label { display: none; } }

/* players */
.faint { color: var(--muted); }
.notice { font-size: .88rem; padding: 9px 12px; border-radius: 10px; display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; }
.notice.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.notice.ok { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.notice .ico { margin-top: .12em; }
.tile.face { position: relative; overflow: visible; }
.tile.face img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; image-rendering: pixelated; }
.tile.face .dot { z-index: 1; }
.pl-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.pl-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.pl-search:focus-within { border-color: var(--accent); }
.pl-search .ico { color: var(--faint); }
.pl-search input { border: 0; margin: 0; padding: .6em 0; background: transparent; box-shadow: none !important; min-width: 0; }
#pl-filters .chip { font-family: inherit; padding: .3em .75em; display: inline-flex; gap: .45em; align-items: center; }
#pl-filters .chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
#pl-filters .chip.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
#pl-filters .chip.active span { color: inherit; opacity: .8; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 10px; }
.pcard { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; justify-content: stretch;
  padding: 12px 14px; border-radius: var(--radius); background: var(--panel); white-space: normal; }
.pcard:hover { border-color: var(--accent-line); background: var(--panel); box-shadow: var(--shadow); }
.pcard.off { opacity: .6; }
.pcard .tile { width: 42px; height: 42px; }
.pc-text { min-width: 0; display: grid; gap: 2px; }
.pc-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; white-space: normal !important; }
.pc-side { display: grid; gap: 4px; justify-items: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.psheet h2 { margin: 0; overflow-wrap: anywhere; }
.psheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.psheet section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.psheet h3 { display: flex; gap: .45em; align-items: center; font-size: .95rem; margin-bottom: .6em; }
.psheet h3 .ico { color: var(--faint); }
.psheet .actions { margin: 6px 0; }
.psheet p.small { margin: .6em 0 0; }
.facts.compact { margin: 0 0 10px; border-radius: 10px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.facts.compact div { padding: 8px 12px; }
.paccess { list-style: none; margin: 0 0 10px; padding: 0; }
.paccess li { display: flex; gap: 6px 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.paccess li:first-child { border-top: 0; }
.pa-name { flex: 1 1 140px; display: flex; gap: 8px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.mini-check { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; font-size: .88rem; cursor: pointer; }
.mini-check input { width: 1.05em; height: 1.05em; margin: 0; }
dialog:has(.psheet) { max-height: min(90vh, 900px); overflow-y: auto; }
@media (max-width: 480px) { .pcard { grid-template-columns: auto 1fr; } .pc-side { grid-column: 2; display: flex; justify-items: start; gap: 10px; } }

/* access requests */
.req-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px;
  background: var(--warn); color: #fff; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.req-card { margin-bottom: 16px; border-color: var(--warn-line); background: color-mix(in srgb, var(--warn-soft) 55%, var(--panel)); }
.req-card h3 { margin: 0 0 6px; } .req-card h3 .ico { color: var(--warn); }
.ok-text { color: var(--accent); }
.bad-text { color: var(--bad); }
.wq-row { flex-wrap: wrap; row-gap: 4px; }
.wq-radius input { width: 6.5em; }
.wq-row > label:first-child { display: flex; align-items: center; gap: 8px; flex: 1 1 11em; }
.wq-est { flex-basis: 100%; }
.wq-grow { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wq-warn { flex-basis: 100%; color: var(--warn); }
.settings-intro { margin: 0 0 14px; max-width: 70ch; }
.settings-live { margin: 26px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-live h3 { margin: 0 0 2px; }
.settings-live p { margin: 0; }
.save-bar { justify-content: flex-end; z-index: 5; }
.save-bar[hidden] { display: none; }
.save-bar .save-count { margin-right: auto; font-weight: 600; color: var(--warn); }
.sug-list { display: grid; gap: 10px; }
.sug-list li.card { padding: 12px 14px; display: flex; gap: 10px 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-top: 0; }
.sug-list li.done { opacity: .72; }
.sug-main { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.sug-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sug-hits { margin-top: 10px; }
.mod-hits { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.mod-hits li { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; border: 0; padding: 0; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li { display: flex; gap: 10px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.req-list li:first-child { border-top: 0; }
.req-list .tile { width: 36px; height: 36px; }
.rq-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.rq-actions, .pa-req { display: inline-flex; gap: 6px; }

/* server settings: player page picture */
.pic-card { margin-top: 20px; }
.pic-row { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 16px; align-items: start; }
.pic-preview { aspect-ratio: 16 / 7; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px dashed var(--line-strong);
  display: grid; place-items: center; text-align: center; padding: 0; }
.pic-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-preview span { padding: 10px; }
@media (max-width: 560px) { .pic-row { grid-template-columns: 1fr; } }

/* ---- home dashboard ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.home-col { display: grid; gap: 16px; min-width: 0; }
.home-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.home-srv { display: grid; gap: 10px; text-align: left; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; font: inherit; cursor: pointer; justify-content: stretch; align-content: start; }
.home-srv:hover { border-color: var(--line-strong); }
.home-srv .hs-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.home-srv .hs-name { min-width: 0; display: grid; gap: 2px; }
.home-srv .hs-name b, .home-srv .hs-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-srv .hs-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--muted); }
.home-srv .hs-facts b { color: var(--text); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter.hot i { background: var(--warn); }
.attn-list, .feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attn-list button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 11px; border-radius: 10px; justify-content: flex-start; }
.attn-list .ico { flex: none; }
.attn-list .bad .ico { color: var(--bad); }
.attn-list .warn .ico { color: var(--warn); }
.attn-list .info .ico { color: var(--accent); }
.all-good { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.all-good .ico { color: var(--accent); }
.feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: .88rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: none; }
.feed .f-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .f-when { color: var(--muted); white-space: nowrap; font-size: .8rem; }
.feed .f-who { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.removed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.removed-row:last-child { border-bottom: none; }
.removed-row .rr-text { min-width: 0; display: grid; gap: 2px; }
.removed-row .rr-text small { overflow-wrap: anywhere; }
@media (max-width: 480px) { .removed-row { grid-template-columns: minmax(0, 1fr); } }

/* ---- map tab ---- */
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.callout { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.ico.spin { animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ico.spin { animation: none; } }

/* ---- admins (settings dialog) ---- */
.admin-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.admin-who { display: flex; flex-direction: column; min-width: 0; }
.admin-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.admin-add label { flex: 1; min-width: 160px; margin: 0; }
.link-row { display: flex; gap: 6px; }
.link-row input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: .85rem; }

/* ---- playtime (stats tab) ---- */
.face-sm { width: 20px; height: 20px; border-radius: 4px; vertical-align: -5px; margin-right: 8px; image-rendering: pixelated; }

/* ---- build your own pack ---- */
.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mod-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mod-row.bad { border-color: var(--bad); background: var(--bad-soft); }
.mod-row img, .mod-row .noicon { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; background: var(--panel-2); }
.mod-row.adopt-row { display: block; }           /* one text column: the 3-column icon/text/buttons grid squeezed it into 32px */
.adopt-row code { overflow-wrap: anywhere; word-break: break-all; }
.mod-text { min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.mod-text > .small { flex-basis: 100%; }
.sp-zip-row .mod-text { align-items: center; }
.sp-zip-row .mod-text > button.small { flex-basis: auto; margin-left: auto; }   /* a button, not a full-width bar */
.pack-list small.hit-meta { display: block; -webkit-line-clamp: unset; overflow: visible; font-weight: 600; overflow-wrap: anywhere; }
.ver-panel { grid-column: 1 / -1; display: grid; gap: 8px; padding: 8px 4px 2px; }
.ver-panel select { max-width: 100%; }
.ver-actions { display: flex; gap: 8px; }
.mod-btns { display: flex; align-items: center; gap: 6px; }
.mod-btns .check { margin: 0; gap: 4px; }
.mod-deps { margin-top: 10px; }
.mod-deps summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.bad-callout { border-color: var(--bad); background: var(--bad-soft); margin-bottom: 12px; }
@media (max-width: 520px) {
  .mod-row { grid-template-columns: 32px 1fr; }
  .mod-btns { grid-column: 2; justify-content: flex-start; }
}
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
/* Player access: shared server rows, matrix, phone cards and permission panels. */
.au-workspace { min-width:0; }
.au-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.au-heading h2 { margin:0 0 4px; font-size:1.35rem; }
.au-heading p { margin:0; color:var(--muted); font-size:.9rem; }
.au-eyebrow { margin:0 0 5px!important; color:var(--muted); text-transform:uppercase; letter-spacing:.09em; font-size:.7rem!important; font-weight:700; }
.au-more { position:relative; flex:none; }
.au-more summary,.au-advanced summary { cursor:pointer; border-radius:var(--radius-sm); padding:10px 12px; font-weight:600; font-size:.85rem; }
.au-more summary { border:1px solid var(--line); background:var(--panel); display:flex; align-items:center; gap:7px; }
.au-more>div { position:absolute; right:0; top:calc(100% + 6px); display:grid; gap:5px; min-width:220px; padding:8px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); z-index:3; }
.au-attention { border:1px solid var(--warn-line); background:var(--warn-soft); border-radius:var(--radius); padding:14px 16px; margin-bottom:20px; }
.au-attention>div:first-child { display:flex; align-items:center; gap:12px; margin-bottom:10px; color:var(--warn); font-size:.8rem; }
.au-attention strong { display:flex; align-items:center; gap:7px; }
.au-attention-links { display:flex; gap:8px; flex-wrap:wrap; }
.au-attention-links button { display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; max-width:100%; border-color:var(--warn-line); padding:8px 10px; }
.au-attention-links b { overflow-wrap:anywhere; font-size:.83rem; }
.au-attention-links span { color:var(--muted); font-size:.72rem; }
.au-tools { display:flex; flex-direction:column; gap:12px; }
.au-search { display:flex; align-items:center; gap:10px; border:1px solid var(--line-strong); border-radius:var(--radius-sm); padding:0 12px; background:var(--panel); margin:0; max-width:480px; }
.au-search .ico { color:var(--muted); flex:none; }
.au-search input { border:0; background:transparent; margin:0; min-width:0; padding:12px 0; box-shadow:none!important; }
.au-search:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.au-filters { display:flex; flex-wrap:wrap; gap:6px; }
.au-filters button { font-size:.8rem; min-height:36px; border-radius:99px; padding:6px 12px; }
.au-filters [aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent); font-weight:700; }
.au-results { display:flex; justify-content:space-between; align-items:center; margin:12px 0; font-size:.8rem; color:var(--muted); }
.au-list { display:grid; gap:8px; }
.au-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px 20px; border:1px solid var(--line); background:var(--panel); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); }
.au-identity { display:flex; gap:12px; align-items:center; min-width:0; }
.au-identity>.tile { flex:none; width:44px; height:44px; border-radius:10px; }
.au-person-text { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
.au-name { border:0; background:transparent; box-shadow:none; padding:0; border-radius:3px; text-align:left; font-size:1rem; font-weight:700; line-height:1.35; overflow-wrap:anywhere; max-width:100%; }
.au-name:hover { background:transparent; color:var(--accent); text-decoration:underline; }
.au-person-text>strong { font-size:1rem; overflow-wrap:anywhere; }
.au-minecraft,.au-seen { color:var(--muted); font-size:.75rem; overflow-wrap:anywhere; }
.au-seen { font-size:.75rem; }
.au-identity>.tag { margin-left:auto; flex:none; }
.au-control-block { display:flex; flex-direction:column; align-items:flex-end; gap:5px; min-width:0; }
.au-toggles { display:flex; gap:7px; flex-wrap:wrap; }
.au-toggle { min-height:42px; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-size:.8rem; padding:8px 10px; white-space:nowrap; }
.au-toggle b { font-size:.72rem; font-weight: 600; color:var(--muted); }
.au-toggle.is-on { border-color:var(--accent-line); background:var(--accent-soft); color:var(--accent); }
.au-toggle.is-on b { color:var(--accent); }
.au-toggle:disabled { opacity:.65; cursor:not-allowed; }
.au-switch { display:inline-block; width:25px; height:15px; border-radius:20px; background:var(--line-strong); position:relative; flex:none; }
.au-switch:after { content:''; width:11px; height:11px; border-radius:50%; position:absolute; top:2px; left:2px; background:var(--panel); }
.is-on .au-switch { background:var(--accent); }
.is-on .au-switch:after { left:12px; }
.au-disabled-reason { font-size:.68rem; color:var(--muted); max-width:280px; text-align:right; overflow-wrap:anywhere; }
.au-row-note { grid-column:1/-1; display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding-top:8px; border-top:1px solid var(--line); color:var(--muted); font-size:.75rem; margin:0; }
.au-row-note.error { color:var(--bad); }
.au-help { color:var(--muted); font-size:.78rem; line-height:1.6; margin:18px 0; }
.au-help .ico { vertical-align:middle; }
.au-advanced { border:1px solid var(--line); border-radius:var(--radius-sm); margin-top:16px; padding:4px 10px; background:var(--panel); }
.au-advanced[open] { padding-bottom:14px; }
.au-advanced label { max-width:320px; font-size:.85rem; margin:10px 0; }
.au-matrix-wrap { border:1px solid var(--line); border-radius:var(--radius); overflow:auto; background:var(--panel); }
.au-matrix { width:100%; border-collapse:separate; border-spacing:0; }
.au-matrix th,.au-matrix td { padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; text-align:left; }
.au-matrix thead th { background:var(--panel-2); font-size:.78rem; font-weight:600; color:var(--muted); min-width:155px; overflow-wrap:anywhere; }
.au-matrix thead th:first-child { min-width:235px; }
.au-matrix tbody th { font-weight:400; }
.au-matrix tbody tr:last-child>* { border-bottom:0; }
.au-matrix tbody tr:hover>* { background:var(--panel-2); }
.au-cell { display:flex; flex-wrap:wrap; gap:5px; align-items:center; justify-content:flex-start; padding:7px; width:100%; min-height:44px; background:transparent; border-color:transparent; text-align:left; }
.au-cell:hover { border-color:var(--accent-line); }
.au-mini { border:1px solid var(--line); border-radius:6px; padding:3px 6px; font-size:.72rem; font-weight:600; color:var(--muted); background:var(--panel-2); white-space:nowrap; }
.au-mini.on { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent); }
.au-cell-note { display:block; flex-basis:100%; color:var(--warn); font-size:.72rem; }
.au-mobile-cards { display:none; }
.au-empty { padding:36px 20px; text-align:center; border:1px dashed var(--line-strong); background:var(--panel); border-radius:var(--radius); }
.au-empty>.tile { margin:0 auto 12px; }
.au-empty h3 { font-size:1rem; margin:0 0 6px; }
.au-empty p { color:var(--muted); font-size:.85rem; }
.au-panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:20px; }
.au-panel-head h2 { margin:0; font-size:1.25rem; }
.au-panel>.au-identity { margin-bottom:20px; flex-wrap:wrap; }
.au-panel>.au-control-block { align-items:flex-start; }
.au-panel .au-disabled-reason { text-align:left; }
.au-sheet-server { display:flex; flex-wrap:wrap; gap:12px!important; justify-content:space-between; }
.au-sheet-server>div:first-child { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; }
.au-sheet-server strong { overflow-wrap:anywhere; }
summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:760px) {
  .au-attention-links>button:nth-child(n+3):not(:last-child) { display:none; }
  .au-row { grid-template-columns:minmax(0,1fr); padding:14px; }
  .au-control-block { align-items:flex-start; }
  .au-disabled-reason { text-align:left; }
  .au-identity { flex-wrap:wrap; }
  .au-person-text { flex:1; min-width:120px; }
  .au-identity>.tag { margin-left:56px; }
  .au-matrix-wrap { display:none; }
  .au-mobile-cards { display:grid; gap:12px; }
  .au-player-card { border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); padding:14px; }
  .au-server-rows { margin-top:14px; border-top:1px solid var(--line); }
  .au-server-row { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:8px 0; border-bottom:1px solid var(--line); }
  .au-server-row:last-child { border:0; }
  .au-server-row>strong { font-size:.8rem; flex:1 1 100px; overflow-wrap:anywhere; }
  .au-server-row>.au-cell { width:auto; flex:1 1 145px; justify-content:flex-end; }
  .au-heading { flex-wrap:wrap; }
  .au-more { margin-left:auto; }
  .au-page-hero { flex-wrap:wrap; }
}

/* 0.13: fluid workspace, shared wrapping and dashboard history. */
.main > #detail { max-width: 2160px; width:100%; margin-inline:auto; }
.main { min-height:0; }
#detail > *, .card, .home-col, .chart-card { min-width:0; }
.hero-left, .hero-left > div, .hero > div, .card-head > * { min-width:0; }
.hero h1, .card h3, .hs-name, .feed .f-what { overflow-wrap:anywhere; white-space:normal; }
.stat .hint { overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.home-srv .hs-name b, .home-srv .hs-name small { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
.hero, .card-head, .actions { flex-wrap:wrap; }
.form-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.dash-section { margin:24px 0; }
.dash-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:14px; }
.dash-eyebrow { color:var(--muted); text-transform:uppercase; letter-spacing:.1em; font-size:.7rem; margin:0 0 5px; font-weight:700; }
.dash-health { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:12px; }
.dash-reading { position:relative; padding:16px; }
.dash-reading .label { color:var(--muted); font-size:.8rem; font-weight:600; }
.dash-reading strong { display:block; font-size:1.4rem; letter-spacing:-.03em; margin:6px 0 2px; }
.dash-reading small { display:block; color:var(--muted); font-size:.76rem; }
.dash-spark { width:100%; height:32px; margin-top:10px; color:var(--accent); }
.segmented { display:flex; flex-wrap:wrap; gap:4px; padding:4px; background:var(--panel-2); border:1px solid var(--line); border-radius:12px; }
.segmented button { border-color:transparent; background:transparent; padding:6px 12px; }
.segmented button[aria-pressed=true] { background:var(--panel); border-color:var(--accent-line); color:var(--accent); box-shadow:var(--shadow); }
#dash-server-charts { margin-top:24px; }
#home .charts { grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr)); }
.chart-card .chart-tip { max-width:calc(100% - 8px); overflow-wrap:anywhere; }
.chart-card svg:focus-visible { outline:2px solid var(--accent); border-radius:5px; }
.dash-section-title { margin:28px 0 16px; }
.dash-home-grid { grid-template-columns:minmax(0,1fr); }
.dash-home-grid .home-servers { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr)); gap:14px; }
.dash-home-grid > .home-col:last-child { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr)); gap:16px; }
.dash-open { color:var(--accent); font-size:.82rem; font-weight: 600; margin-top:6px; }
.dash-empty { margin:16px 0; }
@media(max-width:1000px) and (min-width:761px) { .app { grid-template-columns:230px minmax(0,1fr); } .main { padding:20px; } }
@media(max-width:480px) {
 .dash-health { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 .dash-reading { padding:12px; }
 .dash-reading strong { font-size:1.15rem; }
 .hero-left { flex-wrap:wrap; }
 .chart-card { padding:14px 12px; }
 .charts { gap:10px; }
 .facts { grid-template-columns:minmax(0,1fr); }
 .form-row { flex-wrap:wrap; }
}

.dash-tile { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow); min-width:0; }
.dash-tile .home-srv { width:100%; border:0; box-shadow:none; border-radius:var(--radius) var(--radius) 0 0; flex:1; }
.dash-tile-actions { display:flex; flex-wrap:wrap; gap:6px; padding:10px 14px; border-top:1px solid var(--line); }

/* Keep navigation discoverable and readable rather than silently cutting it off. */
.server-list .name span.t, .server-list .sub { white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip; }
.server-list .sub { flex-wrap:wrap; }
.tabs { flex-wrap:wrap; overflow:visible; }
.tabs button { flex:0 1 auto; }

/* World plans: readable targets and schedule controls without horizontal page scroll. */
.wp-card { margin-bottom:18px; }
.wp-card p { overflow-wrap:anywhere; }
.wp-dimension { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.wp-dimension>div { min-width:0; flex:1 1 260px; overflow-wrap:anywhere; }
.wp-target { margin:14px 0; min-width:0; }
.wp-target legend { overflow-wrap:anywhere; max-width:100%; }
.wp-defaults { margin-top:14px; }
.wp-schedule { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.wp-card summary,.wp-legacy summary { cursor:pointer; font-weight: 600; margin-bottom:12px; }
.wp-history article { border-top:1px solid var(--line); padding:12px 0; }
.wp-history p { margin:4px 0; }
.wp-table { overflow-x:auto; max-width:100%; }
.wp-legacy>form { max-width:600px; }
.wp-empty { border:1px dashed var(--line-strong); padding:20px; border-radius:var(--radius); }
@media(max-width:480px) { .wp-target { padding:12px; } .wp-card .actions button { flex:1 1 auto; } .wp-defaults { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* One-button updates */
.upd-table { width: 100%; border-collapse: collapse; margin: 12px 0 4px; }
.upd-table th, .upd-table td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border, rgba(127,127,127,.25)); font-size: .95em; }
.upd-table th { font-weight: 600; color: var(--muted, inherit); }
.upd-details { margin: 10px 0; }
.upd-details summary { cursor: pointer; padding: 4px 0; }

.wq-card { margin-bottom:18px; }
.wq-sizes { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin:12px 0; }
.wq-size { position:relative; display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid var(--line, #3a4a3a); border-radius:10px; cursor:pointer; }
.wq-size.on { border-color:var(--accent, #62a84a); box-shadow:0 0 0 1px var(--accent, #62a84a) inset; }
.wq-size input { position:absolute; top:0; left:0; opacity:0; pointer-events:none; }
.wq-size:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.wq-list { list-style:none; margin:10px 0; padding:0; }
.wq-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:7px 2px; border-bottom:1px solid var(--line, #2c382c); flex-wrap:wrap; }
.wq-status { margin-top:10px; }
.wp-adv { margin-bottom:18px; }
.wp-adv > summary { cursor:pointer; font-weight: 600; }
.wp-adv[open] > summary { margin-bottom:12px; }
.dropzone { display: grid; gap: 4px; justify-items: center; text-align: center; margin-top: 10px; padding: 26px 14px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--panel-2); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone .meter { width: min(420px, 90%); margin-top: 8px; }
.dropzone .meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---- polish layer: one rhythm, one weight scale ---------------------------------------- */
:root { --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; }
h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; line-height: 1.25; }
h3 { font-size: 1.02rem; line-height: 1.3; }
h4 { font-size: .95rem; line-height: 1.3; }
.card { box-shadow: none; }
fieldset { box-shadow: none; }
/* tabs: text only on wide screens so all of them fit on one row */
@media (min-width: 1100px) { .tabs { max-width: 100%; } .tabs button { padding-inline: .62em; gap: 0; white-space: nowrap; font-size: .9rem; } .tabs button .ico { display: none; } }
@media (min-width: 1440px) { .tabs { flex-wrap: nowrap; } }
#detail { min-width: 0; }
/* "At a glance": no empty filled cells, long values wrap */
.facts:not(.compact) { display: flex; flex-wrap: wrap; background: transparent; gap: 0; border-top: 0; }
.facts:not(.compact) > div { flex: 1 1 200px; background: transparent; border-top: 1px solid var(--line); }
.facts dd code { display: block; background: none; border: 0; padding: 0; font-size: .8rem; word-break: break-all; }

/* ---- overview dashboard: quick actions, what needs attention, what just happened ---- */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.quick button { padding: .45em .9em; }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ov-grid .card h3 { margin-top: 0; }
@media (max-width: 760px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
.care, .activity { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.care li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left-width: 4px; background: var(--panel-2); }
.care li span { min-width: 0; overflow-wrap: anywhere; }
.care li.bad { border-left-color: var(--bad, #b3382c); } .care li.warn { border-left-color: #c9962b; } .care li.info { border-left-color: var(--accent); }
.ok-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; color: var(--accent); font-weight: 600; }
.activity li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity .what { font-weight: 600; text-transform: capitalize; min-width: 0; overflow-wrap: anywhere; }
.activity li.fail .what { color: var(--bad, #b3382c); }
.activity .muted { white-space: nowrap; }
/* phones: the tabs are one swipeable row (with a fade at the edge) instead of four rows of buttons */
@media (max-width: 640px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 28px; }
  .tabs button { flex: none; }
}

/* ---- console ---- */
.console-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.console-tools input[type=search] { width: 12rem; max-width: 100%; padding: .35em .7em; }
pre.console-log { min-height: 42vh; max-height: 68vh; }
.console-log .ln-err { color: #ff8f84; } .console-log .ln-warn { color: #f2c46d; } .console-log .ln-dim { color: #9c8f7f; }
.console-form { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.console-form .prompt { font-family: var(--mono); color: var(--muted); font-size: 1.05rem; }
.console-form input { flex: 1; min-width: 0; font-family: var(--mono); }
.quick-cmds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-cmds button { font-family: var(--mono); }

/* action rows inside a card sit quietly in the card; only the Settings Save bar sticks to the screen */
.card .form-actions { position: static; margin: 4px 0 0; padding: 8px 0 0; background: none; backdrop-filter: none; border-top: 0; border-radius: 0; }
.card .form-grid { align-items: end; }
.card .form-grid > label.check { margin-bottom: 14px; }

/* a table that turns into a list of small cards on a phone (backups): when + type on one line, the buttons underneath */
@media (max-width: 640px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody { display: block; }
  .table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: block; padding: 0; border: 0; }
  .table.stack tbody tr:hover td { background: none; }
  .table.stack td.row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .table.stack td.row-actions > * { margin-left: 0; }
}

/* ---- game rules ---- */
#gamerules { margin-bottom: 18px; }
.gr-group { margin: 14px 0 6px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
.gr-row { display: flex; align-items: center; gap: .65em; }
.gr-row small { display: block; color: var(--muted); font-weight: 400; }
.gr-row.off { opacity: .6; padding: .55em .7em; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.gr-num { justify-content: space-between; padding: .55em .7em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.gr-num input { width: 5.5rem; flex: none; }

/* ---- pack check ---- */
.pack-checks { margin-bottom: 14px; }
.pack-checks h3 { margin-top: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--panel-2); }
.check-row > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.check-row.warn { border-left-color: #c9962b; } .check-row.info { border-left-color: var(--accent); }
.check-row button { flex: none; }

.swap-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; border-left: 4px solid var(--accent); }

/* ---- health summary ---- */
.health-card { margin-bottom: 16px; }
.health-card .health-head { margin-bottom: 14px; }
.health-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 0 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.health-facts > div { padding: 10px 12px 10px 0; }
.health-facts dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.health-facts dd { margin: .15em 0 0; font-size: 1.15rem; font-weight: 700; }
.health-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.health-checks li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.health-checks li.ok { color: var(--muted); } .health-checks li.ok .ico { color: var(--accent); }
.health-checks li.bad { color: var(--bad); font-weight: 600; }
#stats-summary { margin-bottom: 14px; }

/* ---- settings jump bar ---- */
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; position: sticky; top: 0; z-index: 3; padding: 8px 0; background: var(--bg); }
.jump button { border-radius: 99px; border: 1px solid var(--line-strong); background: var(--panel); }
#settings-form fieldset, #set-game-rules, #set-daily-restart, #set-crash-guard, #set-picture, #set-remove { scroll-margin-top: 64px; }
#set-game-rules, #set-daily-restart { min-height: 1.5rem; }

/* ---- access summary, world tidy-ups ---- */
.au-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 0 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.au-summary > div { padding: 10px 12px 10px 0; }
.au-summary dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.au-summary dd { margin: .15em 0 0; font-size: 1.3rem; font-weight: 700; }
.au-help { display: flex; gap: 8px; align-items: flex-start; }
.au-help-ico { flex: none; display: inline-flex; padding-top: 2px; }
.wq-card .callout { margin: 12px 0; }
.wq-card .actions { margin-top: 12px; }

/* ---- history tab ---- */
.hist-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.hist-filters button { border-radius: 99px; border: 1px solid var(--line-strong); background: var(--panel); }
.hist-filters [aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 700; }
.hist-day { font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
.hist-day:first-of-type { margin-top: 4px; }

/* ---- pack mod list tools ---- */
.mod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mod-stats > div { padding: 8px 12px 8px 0; }
.mod-stats dt { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mod-stats dd { margin: .1em 0 0; font-size: 1.2rem; font-weight: 700; }
.mod-tools { margin: 0 0 12px; }
.mod-tools input[type=search] { max-width: 420px; margin-bottom: 8px; }
.mod-list li[hidden] { display: none; }

/* ---- compose copy ---- */
.compose-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 12px; flex-wrap: wrap; }

/* ---- update preview ---- */
.upd-card { margin-top: 12px; }
.upd-card h4 { margin: 14px 0 6px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.upd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.upd-list li { padding: 4px 0; border-top: 1px solid var(--line); }
.upd-list li:first-child { border-top: 0; }

/* ---- player extras (admin) ---- */
.extra-admin { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); list-style: none; }
.extra-admin img, .extra-admin .noicon { width: 36px; height: 36px; border-radius: 8px; }
.extra-main { min-width: 0; display: grid; gap: 6px; }
.pe-list { list-style: none; margin: 0; padding: 0; }
.pe-player { padding: 10px 0; border-top: 1px solid var(--line); }
.pe-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.pe-items { list-style: none; margin: 6px 0 0; padding: 0 0 0 4px; display: grid; gap: 4px; }
.pe-items li { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.pe-what { min-width: 0; overflow-wrap: anywhere; }
.pe-world { padding: 8px 0; border-top: 1px solid var(--line); }
.pe-world h4 { margin: 0 0 2px; }
.extra-main input[type=text] { max-width: 520px; }
.extra-btns { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) { .extra-admin { grid-template-columns: 36px minmax(0, 1fr); } .extra-btns { grid-column: 1 / -1; } }
#extras-card #extra-search { margin-top: 12px; }

/* ---- quick picks ---- */
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; }
.quick-picks .muted { margin-right: 4px; }
#mining-card[hidden] { display: none; }
.recs-head { margin-bottom: 4px; }
.recs-head .ico { vertical-align: -.15em; margin-right: 6px; }
.recs-sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0 14px; }
/* two columns (text, button): the three-column icon/text/buttons grid put the text in the 32px icon column */
.mod-row.mining-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 10px 12px; }
.mod-row.mining-row .mod-text { display: grid; gap: 4px; justify-items: start; }
.mod-row.mining-row.unfit { opacity: .85; }
@media (max-width: 600px) { .mod-row.mining-row { grid-template-columns: minmax(0, 1fr); } .mod-row.mining-row .mod-btns { grid-column: 1; } }


/* ==== redesign: the shared system (admin and player use the same parts) ==== */
body { background: var(--bg); }
h1, h2, h3 { letter-spacing: -.015em; }
h1 { font-weight: 750; }
body.play h1 { font-weight: 500; }
.brand { font-weight: 750; }
.brand img { filter: none; }

/* "online" is green everywhere; blue is for actions and selection */
.pill.running { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.dot.running { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.big-dot.ok, .meter i { background: var(--ok); }
.ok-text { color: var(--ok); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.all-good .ico, .tag.keep { color: var(--ok); }
.meter i { background: var(--accent); }

/* controls: one button language */
button, .btnlink { border-radius: var(--radius-sm); font-weight: 550; }
button.primary, .btnlink.primary { box-shadow: none; }
input, select, textarea { border-color: var(--line-strong); }
.card { box-shadow: var(--shadow); }
fieldset { box-shadow: none; }
legend { background: transparent; border: 0; padding: 0 .4em; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.tile { box-shadow: none; text-shadow: none; }
.tile .dot { border-color: var(--panel); }
.tile .dot.stopped, .tile .dot.paused { background: var(--panel); box-shadow: inset 0 0 0 2px var(--sleep); }

/* sign in / setup */
.gate { background: var(--bg); }
.gate-card { box-shadow: var(--shadow-lg); border-radius: 16px; }
.gate-card .brand { font-size: 1.5rem; }

/* admin frame: slim sidebar, white panels on a soft grey */
.app { grid-template: "top top" auto "side main" 1fr / 232px minmax(0, 1fr); }
.topbar { background: var(--panel); backdrop-filter: none; padding: 10px 20px; }
.topbar .brand small { color: var(--muted); }
.sidebar { background: var(--panel); padding-bottom: 20px; }
.sidebar-head { padding: 16px 18px 6px; }
.server-list { padding: 2px 10px; gap: 2px; }
.server-list li button { border-radius: var(--radius-sm); grid-template-columns: 34px 1fr; padding: 7px 9px; }
.server-list li button:hover { background: var(--panel-2); }
.server-list li button.active { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.server-list li button.active .t { color: var(--accent); }
.server-list .tile { width: 34px; height: 34px; border-radius: 9px; }
.nav-all { padding-top: 14px; }
.nav-all li button { align-items: center; }
.nav-all .sub { display: none; }
.nav-all .tile { grid-row: auto; width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); text-shadow: none; }
.nav-all li button.active .tile { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.nav-all li button.active .t { color: var(--accent); }
.nav-all .name { font-weight: 600; }
.main { padding: 28px 32px 80px; }
.main > * { max-width: 1240px; }

/* page headings in the admin */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 750; letter-spacing: -.03em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.hero { box-shadow: none; }

/* tabs: quiet underline */
.tabs { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 2px; margin-bottom: 20px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .65em .95em; margin-bottom: -1px; color: var(--muted); }
.tabs button:hover { background: transparent; color: var(--text); }
.tabs button.active { background: transparent; box-shadow: none; border-bottom-color: var(--accent); color: var(--text); }
/* the pages inside a tab (0.49.3) */
.subtabs { display: flex; gap: 6px; margin: -8px 0 18px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: .3em .85em; font-size: .86rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
.subtabs button:hover { color: var(--text); background: var(--panel-2); }
.subtabs button.active { color: var(--text); background: var(--panel-2); border-color: var(--accent); }
.subtabs button .ico { opacity: .8; }
.subtabs button.active .ico { color: var(--accent); opacity: 1; }

/* tables */
.table th { background: var(--panel-2); color: var(--muted); font-size: .7rem; border-bottom: 1px solid var(--line); }
.table th:first-child { border-top-left-radius: 8px; } .table th:last-child { border-top-right-radius: 8px; }

/* stat cards */
.stats { gap: 14px; }
.stat .value { font-weight: 750; }

/* ---- Overview ---- */
.hm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.hm-stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.hm-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.hm-ico .ico { width: 22px; height: 22px; }
.hm-ico.ok { background: var(--ok-soft); color: var(--ok); } .hm-ico.warn { background: var(--warn-soft); color: var(--warn); }
.hm-stat b { display: block; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hm-stat b.word { font-size: 1.25rem; letter-spacing: -.01em; }
.hm-stat span { color: var(--muted); font-size: .86rem; }
.hm-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.hm-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.hm-pair.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) { .hm-pair.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-pair.three > :last-child { grid-column: 1 / -1; } }
.hm-card { padding: 16px 20px 12px; min-width: 0; }
/* Getting started checklist */
.gs { margin-bottom: 16px; }
.gs-side { display: flex; align-items: center; gap: 12px; }
.gs-meter { margin: 2px 0 10px; }
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-step { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.gs-step:first-child { border-top: 0; }
.gs-step p { margin: 2px 0 0; }
.gs-step.done .gs-text b { color: var(--muted); font-weight: 600; }
.gs-step.done p { display: none; }
.gs-step.next { background: var(--accent-soft); border-radius: 10px; padding: 10px; margin: 0 -10px; }
.gs-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.gs-mark svg { width: 14px; height: 14px; }
.gs-mark.done { background: var(--ok, #2f8f4e); color: #fff; }
.gs-mark.warn { background: var(--warn, #c7831f); color: #fff; }
.gs-mark.todo { border: 2px solid var(--line); }
.gs-step button { white-space: nowrap; }
.hm-card h2 { margin: 0; font-size: 1.05rem; }
.hm-card .sub { color: var(--muted); font-size: .84rem; margin: 2px 0 0; }
.hm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.hm-head .big { text-align: right; font-weight: 750; font-size: 1.15rem; color: var(--accent); line-height: 1.2; font-variant-numeric: tabular-nums; }
.hm-head .big small { display: block; color: var(--muted); font-size: .74rem; font-weight: 500; }
.hm-table { display: grid; }
.hm-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.3fr) 32px; gap: 14px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line); }
.hm-row.h { border-top: 0; padding: 4px 0 8px; color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.hm-row > * { min-width: 0; }
.hm-name { display: flex; gap: 12px; align-items: center; text-align: left; padding: 0; border: 0; background: none; color: inherit; font: inherit; justify-content: flex-start; }
.hm-name:hover { background: none; }
.hm-name .tile { width: 40px; height: 40px; }
.hm-name b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-name small { display: block; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-name:hover b { color: var(--accent); }
.hm-mem small { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.hm-mem .meter { margin-top: 5px; max-width: 150px; }
.hm-more { width: 30px; height: 30px; padding: 0; }
.hm-state { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; }
.hm-state.on { color: var(--ok); } .hm-state.off { color: var(--muted); }
.hm-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; border-top: 1px solid var(--line); }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { border-top: 1px solid var(--line); }
.attn li:first-child { border-top: 0; }
.attn button { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 11px 0;
  border: 0; background: none; justify-content: stretch; border-radius: 0; font-weight: 400; }
.attn button:hover { background: none; }
.attn button:hover .go { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.attn .ai { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.attn .bad .ai { background: var(--bad-soft); color: var(--bad); } .attn .warn .ai { background: var(--warn-soft); color: var(--warn); }
.attn span.t { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.attn .go { border: 1px solid var(--line-strong); border-radius: 7px; padding: .15em .65em; font-size: .78rem; font-weight: 600; background: var(--panel); }
.attn-empty { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 12px 0; }
.attn-empty .ico { color: var(--ok); }
.hm-chart svg { display: block; width: 100%; height: 150px; overflow: visible; }
.hm-chart .grid { stroke: var(--line); stroke-width: 1; }
.hm-chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hm-chart .bar { fill: var(--accent); opacity: .85; }
.hm-chart .bar:hover { opacity: 1; }
.hm-chart .l1 { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hm-chart .l2 { fill: none; stroke: var(--chart-2); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hm-chart .area { fill: var(--accent); opacity: .1; }
.hm-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); justify-content: center; margin-top: 6px; }
.hm-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.hm-empty { color: var(--muted); font-size: .88rem; padding: 40px 0; text-align: center; }
details.hm-more-sections { margin-top: 8px; }
details.hm-more-sections > summary { cursor: pointer; font-weight: 650; color: var(--muted); padding: 10px 0; list-style: none; display: flex; gap: 8px; align-items: center; }
details.hm-more-sections > summary::-webkit-details-marker { display: none; }
details.hm-more-sections > summary::after { content: "▾"; margin-left: 6px; }
details.hm-more-sections[open] > summary::after { content: "▴"; }

@media (max-width: 1100px) { .hm-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .hm-pair, .hm-pair.three { grid-template-columns: minmax(0, 1fr); } .hm-stats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hm-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .hm-row.h { display: none; }
  .hm-row .hm-mem, .hm-row .hm-pl { grid-column: 1; }
  .hm-row .hm-mem .meter { max-width: none; }
  .hm-row .hm-menu { grid-column: 2; grid-row: 1; }
  .hm-row .hm-name { grid-column: 1; grid-row: 1; }
  .hm-row .hm-state, .hm-row .hm-pl, .hm-row .hm-mem { grid-column: 1 / -1; grid-row: auto; }
}

/* the log and console panes share one dark terminal look, cool to match the rest */
pre.log, pre.yaml { background: #0e1217; border-color: #232a35; color: #d3dae5; }
pre.log .ln-dim { color: #6d7a8c; }

/* ---- mobile admin frame ---- */
@media (max-width: 760px) {
  .app { grid-template: "top" auto "side" auto "main" 1fr / minmax(0, 1fr); }
  .main { padding: 18px 16px 70px; }
  .sidebar { max-height: 36vh; }
  .page-head h1 { font-size: 1.7rem; }
}

/* painted block-world covers (scene.js) and the small version used in tables */
.cover { display: block; background-size: cover; background-position: center; }
canvas.cv { image-rendering: pixelated; object-fit: cover; width: 100%; height: 100%; }
.hm-thumb { position: relative; width: 58px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; flex: none; background: var(--panel-3); }
.hm-thumb .cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-menu { position: relative; }
.hm-menu > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.hm-menu > summary::-webkit-details-marker { display: none; }
.hm-menu > summary:hover, .hm-menu[open] > summary { background: var(--panel-2); color: var(--text); }
.hm-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 180px; padding: 6px; display: grid; gap: 2px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }
.hm-pop button { justify-content: flex-start; border-color: transparent; background: transparent; width: 100%; }
.hm-pop button:hover { background: var(--panel-2); }
.hm-ychart { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; align-items: stretch; }
.hm-ychart .yl { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .7rem; text-align: right; font-variant-numeric: tabular-nums; padding: 0 0 0; }
.hm-x { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; margin: 6px 0 0 36px; font-variant-numeric: tabular-nums; }
.banner.info:not(.mc-note) { flex-wrap: nowrap; align-items: flex-start; }
.banner.info:not(.mc-note) > .ico { flex: none; margin-top: .15em; }

/* phone: the sidebar becomes two short scrolling strips (views, then servers) */
@media (max-width: 760px) {
  .sidebar { max-height: none; overflow: visible; padding: 6px 0 8px; }
  .nav-all { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 4px; scrollbar-width: none; }
  .nav-all::-webkit-scrollbar, #server-list::-webkit-scrollbar { display: none; }
  .nav-all li { flex: none; }
  .nav-all li button { display: flex; width: auto; gap: 8px; padding: 5px 14px 5px 5px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
  .nav-all .tile { width: 26px; height: 26px; border-radius: 99px; }
  .nav-all li button.active { background: var(--accent-soft); border-color: var(--accent-line); }
  .sidebar-head { padding: 6px 16px 0; }
  #server-list { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 4px; scrollbar-width: none; }
  #server-list li { flex: none; min-width: 200px; }
  #server-list li button { border: 1px solid var(--line); background: var(--panel); }
  #server-list li button.active { border-color: var(--accent-line); }
  .empty-list { margin: 4px 12px; }
}
@media (max-width: 640px) { .hm-row .hm-pl:has(> .muted), .hm-row .hm-mem:has(> small.muted) { display: none; } }

/* All containers: grouped cards */
.ct-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.ct-search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 420px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.ct-search .ico { width: 16px; height: 16px; color: var(--faint); flex: none; }
.ct-search input { border: 0; background: transparent; padding: 9px 0; flex: 1; min-width: 0; box-shadow: none; outline: none; }
.ct-search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-group { margin-bottom: 22px; }
.ct-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.ct-group-h h2 { margin: 0; font-size: 1.25rem; }
.ct-group-h p { margin: 0; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ct-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; margin: 0; }
.ct-card.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.ct-card.warn { border-color: var(--warn-line); }
.ct-card header { display: flex; align-items: center; gap: 10px; }
.ct-card header .dot { flex: none; }
.ct-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ct-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-title .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-status { margin-top: -4px; }
.ct-prob { display: flex; gap: 6px; align-items: center; font-size: .86rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.ct-prob .ico { width: 15px; height: 15px; flex: none; }
.ct-prob.bad { color: var(--bad); background: var(--bad-soft); }
.ct-prob.warn { color: var(--warn); background: var(--warn-soft); }
.ct-bars { display: grid; gap: 8px; }
.ct-bar-l { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.ct-bar-l b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-bar .meter { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.ct-bar .meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.ct-bar .meter.warm span { background: var(--warn); }
.ct-bar .meter.hot span { background: var(--bad); }
.ct-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.ct-meta code { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ct-meta:empty { display: none; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Requests: replies, problems; News & events */
.sug-replies { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.sug-replies li { background: var(--panel-2); border-radius: 10px; padding: 7px 10px; font-size: .9rem; }
.sug-replies li.admin { background: var(--accent-soft); }
.sug-replies li > div { margin-top: 2px; overflow-wrap: anywhere; }
.sug-reply { display: flex; gap: 6px; margin-top: 8px; }
.sug-reply input { flex: 1; min-width: 0; padding: 6px 10px; font-size: .9rem; }
.sug-kind { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sug-kind .ico { width: 14px; height: 14px; }
.sug-list li.problem { border-left: 3px solid var(--warn); }
.sug-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-admin { margin-bottom: 24px; }
.ev-list li { align-items: center; }
.ev-when { flex: none; min-width: 9.5em; font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-what { flex: 1 1 220px; min-width: 0; }

/* 0.47: "will it fit?" and the mod finder */
.warn-text { color: var(--warn, #b7791f); }
label small[data-fit] { display: block; margin-top: 4px; }
.fit-more { margin-top: 8px; }
.fit-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.fit-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; }
.fit-list li > span:last-child { grid-column: 1 / -1; margin-top: -4px; }
.fm-result { margin-top: 12px; border-top: 1px solid var(--line, #ddd); padding-top: 10px; }
.fm-result h4 { margin: 0 0 6px; display: flex; gap: 8px; align-items: baseline; }
@media (max-width: 640px) { .ov-row .ov-pl:has(> .muted), .ov-row .ov-mem:has(> small.muted) { display: none; } }

/* Files tab */
.files-crumbs a { text-decoration: none; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 4px; border-top: 1px solid var(--line); }
.file-list li:first-child { border-top: 0; }
.file-list a { text-decoration: none; }
.file-text { width: 100%; min-height: 380px; resize: vertical; font: .84rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 4; white-space: pre; overflow: auto; margin: 8px 0; }
.files-actions { align-items: center; }
.file-diff { max-height: 320px; overflow: auto; white-space: pre; }
.file-diff .d-add { color: #1a7f37; background: rgba(46, 160, 67, .13); display: inline-block; width: 100%; }
.file-diff .d-del { color: #b42318; background: rgba(217, 45, 32, .12); display: inline-block; width: 100%; }
.file-diff .d-hunk { color: var(--muted, #6b7685); }
.callout.warn { border-color: #d9a441; background: rgba(217, 164, 65, .12); margin-bottom: 8px; }

/* Moderators: hide what only admins can use (the server refuses it anyway) */
body[data-role="moderator"] #all-btn, body[data-role="moderator"] #overview-btn, body[data-role="moderator"] #add-btn,
body[data-role="moderator"] #empty .primary, body[data-role="moderator"] .admin-only,
body[data-role="moderator"] #domain-form, body[data-role="moderator"] #admins-section,
body[data-role="moderator"] #email-section, body[data-role="moderator"] #proxy-section,
body[data-role="moderator"] #update-section, body[data-role="moderator"] #update-banner { display: none !important; }
body[data-role="moderator"]:not([data-perms~="players"]) #players-btn,
body[data-role="moderator"]:not([data-perms~="players"]) #sugg-btn,
body[data-role="moderator"]:not([data-perms~="backups_manage"]) td.row-actions { display: none !important; }
body[data-role="moderator"] .topbar .brand small::after { content: " · moderator"; }
label.locked input { opacity: .65; cursor: not-allowed; }

/* Admin roles */
.access-pick { display: grid; gap: 8px; margin: 6px 0; }
.servers-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.servers-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 4px; }
.access-panel { flex-basis: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-list li { flex-wrap: wrap; }

.perms-list { display: grid; gap: 6px; margin: 6px 0; }
.perms-list .check small { display: block; }
.perm-risky { border-left: 3px solid #d9a441; padding-left: 8px; }
.ram-cap input { max-width: 140px; }

/* Schedule tab */
.tasks-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tasks-head h3 { margin: 0; }
.task-list { list-style: none; margin: 8px 0 0; padding: 0; }
.task-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.task-list li:first-child { border-top: 0; }
.task-list li.paused .task-main { opacity: .6; }
.task-main { display: grid; gap: 2px; min-width: 0; }
.task-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.task-form { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.task-form h4 { margin: 0; }
.day-row { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.day-presets { display: flex; gap: 6px; margin-top: 6px; }

/* New version notice */
.update-banner { margin-bottom: 14px; border: 1px solid var(--accent-line, var(--line)); border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 14px; background: var(--accent-soft, rgba(60, 140, 90, .12)); }
.update-banner[hidden] { display: none; }
.update-notes { max-height: 220px; overflow: auto; white-space: pre-wrap; }
.cmd { margin: 6px 0; }

.qr { display: inline-block; margin: 8px 0; padding: 6px; background: #fff; border-radius: 6px; line-height: 0; }
.qr svg { width: 180px; height: 180px; }

.servers-head .ghost, .day-presets .ghost { border: 1px solid var(--line); }
.dlg-close-row { display: none; }
body[data-role="moderator"] .dlg-close-row { display: flex; }

/* Mudhut settings page: a section menu on the left, one section at a time on the right */
.set-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 76px; }
.set-nav button { display: flex; gap: 10px; align-items: flex-start; justify-content: flex-start; text-align: left; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 10px; background: none; color: inherit; cursor: pointer; width: 100%; }
.set-nav button:hover { background: var(--accent-soft); }
.set-nav button.active { background: var(--accent-soft); border-color: var(--accent-line); }
.set-nav button .ico { flex: none; margin-top: 2px; }
.set-nav button span { display: flex; flex-direction: column; min-width: 0; }
.set-nav button small { color: var(--muted); font-size: .78rem; line-height: 1.3; margin-top: 2px; }
.set-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-card { padding: 18px 22px; }
.set-card h2 { margin: 0 0 4px; font-size: 1.15rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.set-card > p.muted { margin: 0 0 12px; }
.set-card form { max-width: 640px; }
@media (max-width: 860px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .set-nav button { width: auto; flex: none; }
  .set-nav button small { display: none; }
}

/* Admins & moderators: pick one of your players */
.admin-add { display: block; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; max-width: 640px; }
.admin-add label { display: block; margin: 0 0 10px; }
.admin-add h3 { margin: 0 0 8px; }
.pick-list { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.pick-list button { width: 100%; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: none; color: inherit; cursor: pointer; }
.pick-list button:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
.pick-list button:disabled { opacity: .55; cursor: default; }
.pick-chosen { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }

/* Files tab downloads */
.files-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.files-top .files-crumbs { margin: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; }
.file-list li > span.muted.small { margin-left: auto; }
.file-dl { display: inline-flex; padding: 4px; border-radius: 6px; color: var(--muted); }
.file-dl:hover { color: var(--accent); background: var(--accent-soft); }

/* ---- failures and waiting: say it plainly, offer Try again, keep the raw error folded away ---- */
.load-failed { border: 1px solid var(--bad-soft); background: var(--panel); border-left: 3px solid var(--bad); border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.load-failed p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; color: var(--text, inherit); }
.load-failed p .ico { color: var(--bad); flex: none; margin-top: 2px; }
.load-failed details { margin-top: 8px; font-size: .82rem; color: var(--muted); }
.load-failed pre, .toast-tech pre { white-space: pre-wrap; word-break: break-word; max-height: 12em; overflow: auto; margin: 6px 0 0; font-size: .78rem; }
.inline-error { margin-top: 8px; }
.inline-error .load-failed { margin: 0; }
.toast-tech { margin-top: 4px; font-size: .82rem; opacity: .92; }
.toast-tech summary { cursor: pointer; text-decoration: underline; }
.toast-tech pre { background: rgb(0 0 0 / .18); padding: 6px 8px; border-radius: 6px; max-width: min(560px, 80vw); }
.loading-line { display: flex; align-items: center; gap: 8px; padding: 24px 4px; }
.big-dot.pending { background: transparent; border: 3px solid var(--faint); }
.health-checks li.wait { color: var(--muted); }
.leave-dlg { max-width: 440px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--panel); color: inherit; box-shadow: var(--shadow-lg); }
.leave-dlg::backdrop { background: rgb(0 0 0 / .35); }
.leave-dlg .form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
