/* ServerPanel pieces on top of app.css */
:root {
  --on: #34d399; --asleep: #a78bfa; --off: #64748b; --busy: #fbbf24; --crash: #f87171; --ext: #38bdf8;
  --top-h: 62px;
}
body { background: var(--bg); }

/* stash-style hairline on top of cards */
.card::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #4d8bff, #ff64c8, transparent); opacity: .45;
}
.card.flush::before, .card.no-line::before, .auth .card::before { opacity: .35; }

/* sidebar extras */
.nav-servers { display: grid; gap: 1px; max-height: 38vh; overflow-y: auto; scrollbar-width: thin; }
.nav-item.sub { padding: 7px 10px 7px 14px; font-size: 13.5px; gap: 10px; }
.nav-item.sub .dot { width: 7px; height: 7px; }
.user-chip .signout { margin-left: auto; color: var(--text-3); padding: 6px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.user-chip .signout:hover { color: var(--bad); background: rgba(248, 113, 113, .1); }
.user-chip form { margin-left: auto; }

/* topbar search is a button that opens the palette */
.top-search {
  margin-left: auto; position: relative; width: min(420px, 42vw); height: 40px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  color: var(--text-3); font: 500 14px var(--sans); cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
}
.top-search:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); }
.top-search > .i { position: static; }
.top-search span { flex: 1; }
.top-search kbd { position: static; }
.topbar { min-height: var(--top-h); }

/* dots per state */
.dot.s-online { background: var(--on); box-shadow: 0 0 10px var(--on); }
.dot.s-online::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--on); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
.dot.s-asleep { background: var(--asleep); box-shadow: 0 0 8px var(--asleep); }
.dot.s-starting, .dot.s-stopping { background: var(--busy); box-shadow: 0 0 10px var(--busy); animation: glowPulse 1.2s ease-in-out infinite; }
.dot.s-off, .dot.s-unknown { background: var(--off); }
.dot.s-crashed { background: var(--crash); box-shadow: 0 0 10px var(--crash); }
.state-pill {
  --c: var(--off);
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px;
  font: 600 12.5px var(--sans); color: var(--text); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.state-pill.s-online { --c: var(--on); } .state-pill.s-asleep { --c: var(--asleep); } .state-pill.s-starting, .state-pill.s-stopping { --c: var(--busy); }
.state-pill.s-crashed { --c: var(--crash); }

/* dashboard */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.server-card { display: grid; gap: 13px; align-content: start; color: var(--text); padding: 18px; transition: transform .25s var(--spring), border-color .2s, box-shadow .2s; overflow: hidden; }
.server-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, .45); color: var(--text); box-shadow: 0 18px 40px -22px rgba(139, 92, 246, .55), var(--shadow); }
/* the whole card opens the server, buttons and the address sit above that link */
.server-card .stretch { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.server-card .stretch:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.server-card .join-chip, .server-card .quick, .server-card .motd-peek { position: relative; z-index: 2; }
.server-card .join-chip { min-width: 0; max-width: 100%; }
.server-card.s-crashed { border-color: rgba(248, 113, 113, .35); }
.server-card .quick { display: inline-flex; gap: 6px; flex: none; }
.server-card .quick:empty { display: none; }
.server-card .quick .btn span { display: none; }
.server-card:hover .quick .btn span, .server-card .quick .btn:focus-visible span { display: inline; }
@media (hover: none) { .server-card .quick .btn span { display: inline; } }
.card-note { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border-radius: 10px; font-size: 12.5px; color: var(--text-3); background: rgba(255, 255, 255, .025); border: 1px dashed var(--line); min-width: 0; }
.card-note span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-note .i { flex: none; }
.card-note.asleep { color: #c4b5fd; border-color: rgba(167, 139, 250, .25); background: rgba(167, 139, 250, .06); }
.card-note.busy { color: #fde68a; border-color: rgba(251, 191, 36, .3); }
.card-note.bad { color: #fca5a5; border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .06); }
.card-note.warn { color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.card-spark { height: 34px; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, rgba(139, 92, 246, .05), transparent); }
.card-spark .spark-mini { margin: 0; height: 34px; }
/* the joke the server list shows right now, in minecraft colours */
.motd-peek { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 10px; background: #0b0b10; border: 1px solid rgba(255, 255, 255, .06); font: 500 12.5px/1.45 var(--mono); color: #aaa; cursor: default; min-width: 0; }
.motd-peek .mc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }
.motd-peek.bad { background: rgba(248, 113, 113, .07); border-color: rgba(248, 113, 113, .35); color: #fca5a5; font-family: var(--sans); }
.motd-peek.bad .i { flex: none; }

/* overview tiles, the karma api stat look */
.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.ov-stats:empty { display: none; }
.ov-tile { position: relative; overflow: hidden; padding: 16px 18px 18px; min-height: 118px; }
.ov-tile .label { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tile .label .i { width: 15px; height: 15px; color: var(--c); flex: none; }
.ov-tile .value { font: 700 28px/1.1 var(--display); letter-spacing: -.03em; margin: 10px 0 5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.ov-tile .value small { font: 500 13px var(--mono); color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.ov-tile .sub { font-size: 12.5px; color: var(--text-3); line-height: 1.45; position: relative; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ov-tile .sub .bad { color: #fca5a5; }
.ov-tile .sub .warnc { color: #fcd34d; }
.ov-tile::after { content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%; background: var(--c); filter: blur(55px); opacity: .17; top: -62px; right: -30px; pointer-events: none; }
.ov-tile.t-go { --c: var(--on); } .ov-tile.t-bad { --c: var(--crash); } .ov-tile.t-violet { --c: #a78bfa; } .ov-tile.t-cyan { --c: var(--cyan); } .ov-tile.t-pink { --c: var(--pink); }
.ov-tile .ov-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; opacity: .8; pointer-events: none; }
.ov-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin-top: 10px; overflow: hidden; position: relative; }
.ov-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--c, var(--violet)); border-radius: inherit; box-shadow: 0 0 10px var(--c, var(--violet)); transition: width .6s var(--ease); }

/* machines + activity under the cards */
.ov-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; margin-top: 18px; align-items: start; }
.node-list { display: grid; gap: 10px; }
.node-list > .empty { padding: 26px 10px; }
.node-row { padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); display: grid; gap: 11px; }
.node-row.off { opacity: .7; }
.node-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.node-head b { font: 700 14.5px var(--display); letter-spacing: -.01em; flex: none; max-width: 50%; }
.node-head small { color: var(--text-3); font-size: 12px; min-width: 0; }
.node-bars { display: grid; gap: 8px; }
.nb { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 10px; }
.nb span { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.nb .ov-bar { margin: 0; height: 6px; }
.nb b { font: 600 12px var(--mono); color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 104px; }
.act-list { display: grid; margin: -4px -6px; }
.act-list > .empty { padding: 26px 10px; }
.act-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 8px; }
.act-row + .act-row { border-top: 1px solid var(--line); }
.act-row:hover { background: rgba(255, 255, 255, .02); }
.act-row .t { min-width: 0; }
.act-row p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.act-row p b { color: var(--text); font-weight: 600; }
.act-row small { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.act-row time { align-self: start; padding-top: 3px; }
.act-ic { --c: #94a3b8; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.act-ic.t-go { --c: var(--on); } .act-ic.t-warn { --c: var(--busy); } .act-ic.t-bad { --c: var(--crash); } .act-ic.t-cyan { --c: var(--cyan); } .act-ic.t-blue { --c: #60a5fa; } .act-ic.t-violet { --c: #a78bfa; } .act-ic.t-pink { --c: var(--pink); }
.act-srv { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); font: 600 11.5px var(--mono); color: var(--text); vertical-align: 1px; }
a.act-srv:hover { border-color: rgba(167, 139, 250, .5); color: #fff; }
.act-srv.gone { color: var(--text-3); text-decoration: line-through; }
.act-srv.dim { color: var(--text-3); font-weight: 500; }
.list-rows > .act-row { padding: 11px 18px; }
.plan-row { display: grid; gap: 7px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; padding-bottom: 0; }
.plan-opts { padding-left: 46px; }
.select.xs { height: 28px; font-size: 12px; padding: 0 26px 0 9px; border-radius: 8px; width: auto; background-position: right 9px center; }
@media (max-width: 1240px) { .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .ov-lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .ov-stats { gap: 10px; }
  .ov-tile { padding: 13px 14px 15px; min-height: 104px; }
  .ov-tile .value { font-size: 23px; }
  .nb b { min-width: 0; }
  .server-grid .add-card { min-height: 120px; }
}
.server-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.type-tile {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; position: relative;
  font: 700 15px var(--display); letter-spacing: -.02em; color: #fff; background: var(--tile, var(--grad)); box-shadow: 0 8px 22px -10px var(--tile-glow, rgba(139, 92, 246, .8));
}
.type-tile.lg { width: 58px; height: 58px; border-radius: 16px; font-size: 20px; }
.type-tile.t-folia { --tile: linear-gradient(135deg, #22d3ee, #059669); --tile-glow: rgba(16, 185, 129, .8); }
.type-tile.t-paper { --tile: linear-gradient(135deg, #e2e8f0, #64748b); --tile-glow: rgba(148, 163, 184, .8); color: #0b0f1c; }
.type-tile.t-purpur { --tile: linear-gradient(135deg, #c084fc, #7c3aed); }
.type-tile.t-vanilla { --tile: linear-gradient(135deg, #84cc16, #4d7c0f); --tile-glow: rgba(132, 204, 22, .7); }
.type-tile.t-fabric { --tile: linear-gradient(135deg, #fcd34d, #b45309); --tile-glow: rgba(245, 158, 11, .7); }
.type-tile.t-velocity { --tile: linear-gradient(135deg, #38bdf8, #1d4ed8); --tile-glow: rgba(56, 189, 248, .7); }
.type-tile.t-pumpkin { --tile: linear-gradient(135deg, #fb923c, #c2410c); --tile-glow: rgba(251, 146, 60, .7); }
.type-tile.t-external { --tile: linear-gradient(135deg, #38bdf8, #8b5cf6); }
.server-card .name { min-width: 0; flex: 1; }
.server-card .name b { display: block; font: 700 16.5px/1.2 var(--display); letter-spacing: -.02em; }
.server-card .name small { font: 500 11.5px var(--mono); color: var(--text-3); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mini-stats > div { background: rgba(10, 12, 20, .8); padding: 9px 11px; min-width: 0; }
.mini-stats span { display: block; font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.mini-stats b { font: 700 14.5px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.server-card .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); min-width: 0; }
.server-card .foot .mono { color: var(--text-2); }
.spark-mini { height: 34px; width: 100%; display: block; margin: -4px 0 -6px; }
.add-card { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 196px; border-style: dashed; color: var(--text-3); }
.add-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); color: #c4b5fd; }

/* server page head */
.server-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px; margin-bottom: 16px; }
.server-hero h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: clamp(22px, 2.8vw, 30px); }
.server-hero .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--text-3); font-size: 13px; }
.join-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); font: 500 12px var(--mono); color: var(--text-2); cursor: pointer; }
.join-chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.power { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.go { --bg: rgba(52, 211, 153, .12); --bd: rgba(52, 211, 153, .4); --fg: #a7f3d0; }
.btn.go:hover { --bg: rgba(52, 211, 153, .2); --bd: rgba(52, 211, 153, .65); }
.btn.soft { --bg: rgba(139, 92, 246, .14); --bd: rgba(139, 92, 246, .38); --fg: #ddd6fe; }
.btn.soft:hover { --bg: rgba(139, 92, 246, .22); --bd: rgba(139, 92, 246, .6); }
.btn.flat { --bg: #731ffb; --bd: transparent; --fg: #fff; box-shadow: 0 8px 22px -12px rgba(115, 31, 251, .9); }
.btn.flat:hover { --bg: #651be1; }
.btn.discord { --bg: rgba(88, 101, 242, .16); --bd: rgba(88, 101, 242, .45); --fg: #c7d2fe; }
.btn.discord:hover { --bg: rgba(88, 101, 242, .26); }
.stat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-row .card { padding: 14px 16px; overflow: hidden; }
.stat-row .label { display: flex; align-items: center; gap: 7px; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.stat-row .label .i { width: 14px; height: 14px; color: var(--c, var(--text-3)); }
.stat-row .value { font: 700 21px/1.15 var(--display); letter-spacing: -.02em; margin-top: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-row .value small { font: 500 12px var(--mono); color: var(--text-3); margin-left: 3px; }
.stat-row .value small.sleeps-in { margin-left: 6px; }
.stat-row .value small.sleeps-in .i { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; color: var(--violet); }
.stat-row .bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin-top: 9px; overflow: hidden; }
.stat-row .bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--c, var(--violet)); border-radius: inherit; transition: width .6s var(--ease); box-shadow: 0 0 10px var(--c, var(--violet)); }
.tabs.server-tabs { margin-bottom: 16px; }

/* console */
.console-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.console-tools { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.console-tools .input { height: 32px; font-size: 13px; max-width: 220px; }
.console {
  height: min(62vh, 640px); overflow-y: auto; padding: 14px 16px; background: rgba(3, 4, 8, .72);
  font: 400 12.8px/1.6 var(--mono); color: #d7dcea; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin;
}
.console .ln { min-height: 1.6em; }
.console .ln.panel { color: #c4b5fd; }
.console .ln.warn { color: #fcd34d; }
.console .ln.err { color: #fca5a5; }
.console .hide { display: none; }
.console-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.console-input .prompt { font: 700 14px var(--mono); color: #a78bfa; padding-left: 4px; }
.console-input .input { border: 0; background: transparent; height: 38px; font-family: var(--mono); font-size: 13.5px; box-shadow: none; }
.console-input .input:focus { box-shadow: none; background: transparent; }
.console-input:focus-within { background: rgba(139, 92, 246, .06); }
.console-asleep { display: grid; place-items: center; gap: 10px; padding: 26px; text-align: center; color: var(--text-2); border-top: 1px solid var(--line); }

/* files */
.path-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font: 500 13px var(--mono); min-width: 0; }
.path-bar a, .path-bar b { padding: 3px 7px; border-radius: 7px; }
.path-bar a { color: var(--text-2); }
.path-bar a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.path-bar b { color: var(--text); }
.files .table td { padding-top: 8px; padding-bottom: 8px; }
.files .fname { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; cursor: pointer; min-width: 0; }
.files .fname .i { color: var(--text-3); }
.files .fname.dir .i { color: #a78bfa; }
.files tr.sel td { background: rgba(139, 92, 246, .08); }
.files .check { width: 34px; }
.drop-zone { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; border-radius: inherit; background: rgba(139, 92, 246, .12); border: 2px dashed rgba(167, 139, 250, .7); font: 600 16px var(--display); color: #ede9fe; backdrop-filter: blur(3px); }
.drop-zone.on { display: grid; }
.uploads { display: grid; gap: 8px; margin-top: 12px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 60px; gap: 12px; align-items: center; font-size: 12.5px; }
.editor { width: 100%; min-height: 56vh; resize: vertical; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(3, 4, 8, .7); color: #e2e8f0; font: 400 13px/1.6 var(--mono); tab-size: 2; outline: none; white-space: pre; overflow: auto; }
.editor:focus { border-color: rgba(139, 92, 246, .6); }

/* modal */
/* the dim fades in and the box springs up out of the page, closing is quicker and accelerates away (no blur on the box, it is nearly opaque) */
.modal-wrap { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 20px; background: rgba(2, 3, 6, .62); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity var(--t-pop) var(--ease-in); }
.modal-wrap.open { opacity: 1; pointer-events: auto; transition: opacity .22s var(--ease); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 0; background: rgba(13, 16, 26, .97); backdrop-filter: none; transform: translateY(8px) scale(.97); transition: transform var(--t-pop) var(--ease-in); }
.modal.wide { width: min(980px, 100%); }
.modal-wrap.open .modal { transform: none; transition: transform .34s var(--spring-soft); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.modal-foot:empty { display: none; }

/* switches */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2); position: relative; transition: background .2s, border-color .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; transition: transform .25s var(--spring), background .2s; }
.switch input:checked + .track { background: linear-gradient(90deg, #4d8bff, #8f7bff); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch input:disabled + .track { opacity: .45; }

/* permission toggle grid */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255, 255, 255, .02); display: grid; gap: 8px; align-content: start; }
.perm-group h4 { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 2px; }
.perm-group .switch { font-size: 13px; color: var(--text-2); }
.perm-group .switch.on { color: var(--text); }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* lists */
.list-rows { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: rgba(255, 255, 255, .02); }
.list-row .t { min-width: 0; }
.list-row .t b { display: block; font-weight: 600; }
.list-row .t small { color: var(--text-3); font-size: 12.5px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.step-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); font: 500 12px var(--sans); color: var(--text-2); }
.step-chip .i { width: 13px; height: 13px; }
.step-edit { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 8px; align-items: center; }

/* motd */
.motd-preview { padding: 14px 16px; border-radius: 12px; background: #1d1f21 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23262626'/%3E%3Crect width='4' height='4' fill='%23202020'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23202020'/%3E%3C/svg%3E"); font: 500 14px/1.45 var(--mono); color: #aaa; image-rendering: pixelated; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); white-space: pre-wrap; }
.motd-preview .srv { color: #fff; display: flex; justify-content: space-between; margin-bottom: 2px; }
.joke-list { max-height: 52vh; overflow-y: auto; }
.joke { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.joke .n { font: 500 11px var(--mono); color: var(--text-3); text-align: right; }
.joke .txt { overflow-wrap: anywhere; }
.joke .acts { opacity: 0; transition: opacity .15s; display: flex; gap: 4px; }
.joke:hover .acts { opacity: 1; }
@media (hover: none) { .joke .acts { opacity: 1; } }
.health { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); }
.health.good { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .07); }
.health.bad { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }

/* misc */
.small { font-size: 12.5px; }
.center-page { display: grid; place-items: center; min-height: 60vh; }
.error-card { width: min(460px, 100%); }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fine { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 16px; }
.center-link { text-align: center; margin-top: 14px; }
.linkish { background: none; border: 0; color: #a5b4fc; cursor: pointer; font: 500 13px var(--sans); }
.linkish:hover { color: #c7d2fe; }
.code-input { text-align: center; font: 600 24px var(--mono); letter-spacing: .3em; }
.qr { width: 210px; margin: 6px auto 16px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2); }
.qr svg { display: block; width: 100%; height: auto; }
.keyline { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); text-align: center; letter-spacing: .08em; margin-top: 8px; }
.banner.bad { background: rgba(248, 113, 113, .09); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.banner.good { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .4); color: #bbf7d0; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(250, 204, 21, .35); font: 500 12.5px var(--mono); overflow-wrap: anywhere; }
.secret-box code { flex: 1; min-width: 0; }
.menu { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; border-radius: 13px; background: rgb(14, 16, 26); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: none; transform-origin: top right; }
/* it grows out of its button and shrinks back into it (app.js closeMenu keeps it shown while .closing) */
.menu.open .menu-pop { display: grid; animation: menuIn var(--t-pop) var(--ease) both; }
.menu.closing .menu-pop { display: grid; pointer-events: none; animation: menuOut .13s var(--ease-in) both; }
.menu.up .menu-pop { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 0; background: none; color: var(--text-2); font: 500 13px var(--sans); cursor: pointer; text-align: left; transition: background-color var(--t-fast), color var(--t-fast); }
.menu-pop button:hover, .menu-pop a:hover { background: rgba(139, 92, 246, .14); color: var(--text); }
.menu-pop .danger { color: #fca5a5; }
.menu-pop hr { border: 0; height: 1px; background: var(--line); margin: 4px 2px; }
.menu-pop button:disabled { cursor: not-allowed; opacity: .55; background: none; color: var(--text-2); }
.menu-pop .mi { display: grid; gap: 2px; }
.menu-pop .mi small { font: 500 11.5px var(--sans); color: var(--text-3); white-space: nowrap; }
/* every card is its own stacking context (blur + isolation, and .reveal's fill-mode animation), so a menu could never
   rise above the cards that come after it (the 3 dots under the server header vanished behind the tps/uptime tiles).
   the card holding the open menu goes up instead, still under the topbar, drawers and dialogs */
.card:has(.menu.open, .menu.closing) { z-index: 25; }
.kbd-hint { font: 500 11px var(--mono); color: var(--text-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); gap: 2px; position: relative; isolation: isolate; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: var(--text-2); font: 600 12.5px var(--sans); cursor: pointer; transition: color var(--t-pop) var(--ease), transform var(--t-move) var(--spring); }
.seg button:hover { color: var(--text); }
.seg button:active { transform: scale(.96); transition-duration: .06s; }
.seg button[aria-pressed='true'] { background: rgba(139, 92, 246, .22); color: #fff; }
/* while the pick changes, a copy of the highlight glides from the old button to the new one (app.js segSlide) */
.seg-ghost { position: absolute; z-index: -1; border-radius: 8px; background: rgba(139, 92, 246, .22); pointer-events: none; }
.seg button.seg-to { background: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 12px; color: var(--text-3); }
.page.bare { padding: 0; max-width: none; }

@media (max-width: 1240px) { .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .server-hero { grid-template-columns: auto minmax(0, 1fr); }
  .server-hero .power { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .top-search span, .top-search kbd { display: none; }
  .top-search { width: 40px; flex: none; padding: 0; justify-content: center; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .server-hero { padding: 16px; gap: 12px; }
  .type-tile.lg { width: 46px; height: 46px; font-size: 17px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .step-edit { grid-template-columns: minmax(0, 1fr) auto; }
  .step-edit > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .console { height: 56vh; font-size: 12px; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .upload-row > :last-child { display: none; }
  .files .hide-sm { display: none; }
}
.avatar-sq { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); font: 700 14px var(--display); color: #fff; }
.type-tile .i { width: 20px; height: 20px; }

/* new server gallery */
.type-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.type-card { display: grid; gap: 8px; justify-items: start; align-content: start; text-align: left; padding: 16px; cursor: pointer; color: var(--text); font: inherit; transition: transform .25s var(--spring), border-color .2s; }
.type-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, .5); }
.type-card b { font: 700 15.5px var(--display); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.type-tile.t-import { --tile: linear-gradient(135deg, #f472b6, #8b5cf6); }
.type-tile.t-leaf { --tile: linear-gradient(135deg, #4ade80, #15803d); --tile-glow: rgba(74, 222, 128, .7); }
.type-tile.t-quilt { --tile: linear-gradient(135deg, #c084fc, #db2777); }
.type-tile.t-forge { --tile: linear-gradient(135deg, #94a3b8, #1e293b); }
.type-tile.t-neoforge { --tile: linear-gradient(135deg, #fb923c, #9a3412); }
.section-title { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 26px 0 12px; }
input[type=range] { width: 100%; accent-color: #8b5cf6; }

/* store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; padding: 12px; max-height: 70vh; overflow-y: auto; }
.store-card { display: grid; gap: 8px; align-content: start; padding: 13px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); transition: border-color .2s, transform .2s var(--spring); }
.store-card:hover { border-color: rgba(167, 139, 250, .45); transform: translateY(-2px); }
.store-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; object-fit: cover; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-3); }
.store-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.prop-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prop-row:last-child { border-bottom: 0; }
.list-row.sel { background: rgba(139, 92, 246, .12); }
a.list-row { color: var(--text); }
@media (max-width: 640px) { .prop-row { grid-template-columns: minmax(0, 1fr); } }

/* machines */
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 280px; overflow-y: auto; }
.os-pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer; }
.os-pick:hover { border-color: rgba(167, 139, 250, .45); }
.os-pick input { position: absolute; opacity: 0; pointer-events: none; }
.os-pick:has(input:checked) { border-color: rgba(139, 92, 246, .7); background: rgba(139, 92, 246, .12); }
.os-pick b { display: block; font-size: 13px; }
.os-pick small { color: var(--text-3); font-size: 11.5px; }
.os-pick .type-tile { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.term { height: 60vh; min-height: 320px; border-radius: 12px; overflow: hidden; background: #05060a; border: 1px solid var(--line-2); padding: 6px; }
.term .xterm { height: 100%; }

.server-grid.selecting .server-card { cursor: pointer; }
.server-grid.selecting .server-card .quick { visibility: hidden; }
.server-grid.selecting .server-card[data-id]::after { content: ''; position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); background: rgba(0, 0, 0, .3); }
.server-grid.selecting .server-card.picked { border-color: rgba(139, 92, 246, .8); box-shadow: 0 0 0 1px rgba(139, 92, 246, .5), var(--shadow); }
.server-grid.selecting .server-card.picked::after { background: var(--grad); border-color: transparent; }
.bulk-bar { position: sticky; top: 72px; z-index: 20; }

/* right-click menu */
.ctx-menu {
  position: fixed; z-index: 120; min-width: 210px; max-width: 300px; padding: 6px; border-radius: 13px;
  background: rgba(14, 17, 29, .96); border: 1px solid var(--line-2); box-shadow: 0 22px 60px -14px rgba(0, 0, 0, .85), 0 0 0 1px rgba(139, 92, 246, .08);
  backdrop-filter: blur(18px) saturate(140%); animation: menuIn .15s var(--ease) both; outline: none; user-select: none;
}
/* closing: a quick fade back into the corner it came from (app.js sets the transform-origin) */
.ctx-menu.out { pointer-events: none; animation: menuOut .11s var(--ease-in) both; }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 33px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: 500 13px var(--sans); text-align: left; cursor: pointer; transition: background-color var(--t-fast);
}
.ctx-item .i { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.ctx-noic { width: 15px; flex: none; }
.ctx-item .ctx-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-item kbd { font-size: 10.5px; opacity: .8; }
.ctx-item:hover, .ctx-item:focus-visible { background: rgba(139, 92, 246, .16); outline: none; }
.ctx-item:hover .i, .ctx-item:focus-visible .i { color: #c4b5fd; }
.ctx-item.danger { color: #fca5a5; }
.ctx-item.danger .i { color: #f87171; }
.ctx-item.danger:hover, .ctx-item.danger:focus-visible { background: rgba(248, 113, 113, .14); }
.ctx-item[disabled] { opacity: .4; cursor: default; background: none; }
.ctx-sep { height: 1px; margin: 5px 8px; background: var(--line); }
.ctx-foot { margin: 5px 4px 1px; padding: 6px 6px 2px; border-top: 1px solid var(--line); font: 500 10.5px var(--sans); color: var(--text-3); }
@media (hover: none) { .ctx-foot { display: none; } .ctx-item { height: 40px; font-size: 14px; } }
/* the thing the menu is for gets a soft outline while it is open */
.ctx-target { outline: 1px solid rgba(167, 139, 250, .55); outline-offset: -1px; }
tr.ctx-target > td { background: rgba(139, 92, 246, .07); }
@media (hover: none) { .server-card, .list-row, .act-row, .store-card, .nav-item, tr { -webkit-touch-callout: none; } }
.input-suffix { display: flex; align-items: center; gap: 8px; min-width: 0; }
.input-suffix .input { flex: 1; min-width: 0; }
.input-suffix > span { font-size: 13px; white-space: nowrap; }

.kv-mini { display: grid; gap: 6px; }
.kv-mini > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 13px; }
.kv-mini span { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.kv-mini b { font-weight: 500; color: var(--text); min-width: 0; }
.kv-mini b[data-copy] { cursor: pointer; }
.kv-mini b i { color: var(--text-3); font-style: normal; }

.srv-icon { width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; background: #0b0b10; border: 1px solid var(--line-2); display: grid; place-items: center; }
.srv-icon img { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.srv-icon.none img { display: none; }
.srv-icon.none::after { content: 'none'; font: 600 10px var(--mono); color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }
.net-row { cursor: pointer; }
.net-row.off { opacity: .55; cursor: default; }
.net-row input[type=checkbox] { width: 17px; height: 17px; flex: none; }
.first-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

.vnc-box { height: min(68vh, 720px); background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line-2); }
.vnc-box > div { width: 100%; height: 100%; }

/* config tab: file list on the left, editor or the server.properties form on the right */
.cfg-side { position: sticky; top: 80px; align-self: start; }
.cfg-side .console-tools .input { max-width: none; }
.cfg-list { max-height: calc(100vh - 200px); overflow: auto; scrollbar-width: thin; padding-bottom: 8px; }
.cfg-head { display: flex; align-items: center; gap: 7px; padding: 14px 16px 6px; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.cfg-sub { padding: 9px 16px 2px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.list-row.cfg-row { padding: 6px 16px 6px 24px; gap: 8px; border-bottom: 0; border-radius: 0; }
.cfg-dot { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, .6); }
.cfg-ed .editor { border: 0; border-radius: 0; min-height: 64vh; }
.cfg-ed > .row { padding: 8px 12px; margin: 0 !important; border-top: 1px solid var(--line); }
.cfg-ed .cfg-err { margin: 10px 12px; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
.cfg-props-head { display: flex; align-items: center; gap: 14px; }
@media (max-width: 980px) { .cfg-side { position: static; } .cfg-list { max-height: 36vh; } .cfg-ed .editor { min-height: 55vh; } }

/* api docs: contents on the left, the rendered markdown on the right */
.docs-out { padding: 28px; max-width: 1480px; margin: 0 auto; }
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.docs-toc { position: sticky; top: 80px; padding: 14px 8px 10px 14px; }
.docs-toc summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 2px 0 8px; }
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc nav { display: grid; gap: 1px; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.docs-toc nav a { display: block; padding: 5px 9px; border-radius: 8px; color: var(--text-2); font-size: 13px; line-height: 1.35; }
.docs-toc nav a.lv3 { padding-left: 21px; font-size: 12.5px; color: var(--text-3); }
.docs-toc nav a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.docs-toc nav a.on { background: rgba(139, 92, 246, .16); color: #fff; }
.md { padding: 26px 30px 34px; font-size: 14.5px; line-height: 1.7; min-width: 0; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { position: relative; scroll-margin-top: 80px; }
.md h1 { font-size: 28px; margin: 0 0 14px; }
.md h2 { font-size: 21px; margin: 38px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.md h3 { font-size: 16.5px; margin: 28px 0 10px; }
.md h4 { font-size: 14.5px; margin: 22px 0 8px; color: var(--text-2); }
.md-anchor { position: absolute; left: -18px; padding-right: 6px; color: var(--text-3); opacity: 0; font-weight: 400; }
.md h1:hover .md-anchor, .md h2:hover .md-anchor, .md h3:hover .md-anchor, .md h4:hover .md-anchor { opacity: 1; }
.md p, .md ul, .md ol, .md blockquote, .md .md-table, .md .md-code { margin: 0 0 14px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md li > p { margin: 6px 0; }
.md li > .md-code { margin: 8px 0; }
.md strong { color: #fff; font-weight: 650; }
.md a { color: #a5b4fc; text-decoration: underline; text-decoration-color: rgba(165, 180, 252, .35); text-underline-offset: 3px; }
.md a.md-anchor { text-decoration: none; }
.md :not(pre) > code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: .86em; overflow-wrap: anywhere; color: #e2e8f0; }
.md hr { border: 0; height: 1px; background: var(--line); margin: 26px 0; }
.md blockquote { padding: 10px 16px; border-left: 3px solid #8b5cf6; background: rgba(139, 92, 246, .08); border-radius: 0 12px 12px 0; color: var(--text-2); }
.md blockquote > :last-child { margin-bottom: 0; }
.md-code { position: relative; border-radius: 12px; background: rgba(0, 0, 0, .42); border: 1px solid var(--line-2); }
.md-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 500 12.5px/1.6 var(--mono); color: #dbe2f0; scrollbar-width: thin; tab-size: 2; }
.md-code[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 74px; font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); pointer-events: none; }
.md-copy { position: absolute; top: 5px; right: 6px; opacity: .55; background: rgba(13, 16, 26, .9); }
.md-code:hover .md-copy, .md-copy:focus-visible { opacity: 1; }
.md-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.md-table th { text-align: left; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 9px 12px; background: rgba(255, 255, 255, .02); border-bottom: 1px solid var(--line); white-space: nowrap; }
.md-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table td code { white-space: nowrap; }
@media (max-width: 980px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { position: static; padding: 12px 14px; }
  .docs-toc summary { padding: 2px 0; }
  .docs-toc[open] summary { padding-bottom: 8px; }
  .docs-toc nav { max-height: 50vh; }
}
@media (max-width: 640px) {
  .docs-out { padding: 18px 14px; }
  .public-top { padding: 12px 14px; }
  .md { padding: 18px 16px 24px; font-size: 14px; }
  .md h2 { font-size: 19px; margin-top: 30px; padding-top: 18px; }
  .md-anchor { display: none; }
  .md-code pre { font-size: 12px; padding: 12px; }
  .md-code[data-lang]::before { display: none; }
  .md-table td code { white-space: normal; }
}

/* api keys page */
.key-row { align-items: start; }
.key-row .t > b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-pre { font: 500 12px var(--mono); color: var(--text-3); }
.key-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 4px; font-size: 13px; color: var(--text-2); }
.key-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.key-meta .i { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.key-new { display: grid; gap: 12px; }
.key-new .secret-box code { font-size: 13px; }
.key-pick { display: grid; gap: 2px; max-height: 236px; overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: rgba(0, 0, 0, .18); }
.key-pick label { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; min-width: 0; }
.key-pick label:hover { background: rgba(255, 255, 255, .04); }
.key-pick input { width: 17px; height: 17px; flex: none; accent-color: #8b5cf6; }
.key-pick .mono { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.key-access { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key-access button { display: grid; gap: 3px; text-align: left; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--text-2); font: inherit; font-size: 12.5px; line-height: 1.4; cursor: pointer; transition: border-color .15s, background .15s; }
.key-access button b { color: var(--text); font-size: 13.5px; font-weight: 600; }
.key-access button:hover { border-color: rgba(167, 139, 250, .45); }
.key-access button[aria-pressed='true'] { border-color: rgba(139, 92, 246, .8); background: rgba(139, 92, 246, .14); }
.perm-group .off-limits { opacity: .45; }
@media (max-width: 640px) {
  .key-access { grid-template-columns: minmax(0, 1fr); }
  .key-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* roles tab (luckperms) */
.roles { display: grid; gap: 16px; }
.roles .pad { padding-left: 18px; padding-right: 18px; }
.roles .card-head.pad { padding-top: 14px; margin-bottom: 6px; }
.roles p.help.pad { padding-bottom: 14px; margin: 10px 0 0; }
.roles-title h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 2px; }
.roles-title p { margin: 0; }
.roles-notes { display: grid; gap: 6px; margin-top: 12px; color: var(--text-2); }
.roles-notes p { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.roles-notes .i { flex: none; margin-top: 2px; color: var(--text-3); }
.roles-notes .warnline { color: #fde68a; }
.roles-notes .warnline .i { color: var(--caution); }
.roles .seg .i { width: 14px; height: 14px; vertical-align: -2px; }
.person-row { grid-template-columns: minmax(0, 1fr) auto; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .t { min-width: 0; display: grid; gap: 5px; }
.person .t b { display: flex; align-items: center; gap: 7px; }
.person .chips { gap: 6px; }
.role-chip { --c: #c4b5fd; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; font: 600 12px var(--sans); color: #fff; background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); max-width: 100%; }
.role-chip:not(:has(button)) { padding-right: 10px; }
.role-chip small { font: 500 11px var(--mono); color: var(--text-2); }
.role-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.role-chip button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.found { display: grid; gap: 12px; margin-top: 12px; }
.role-pick { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.role-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer; }
.role-opt:hover { border-color: var(--line-2); }
.role-opt:has(input:checked) { border-color: rgba(139, 92, 246, .8); background: rgba(139, 92, 246, .12); }
.role-opt input { accent-color: #8b5cf6; flex: none; }
.role-opt .t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.mc-line { font: 500 13px/1.4 var(--mono); background: #1d1f21; border-radius: 6px; padding: 1px 7px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.mc-line.sm { font-size: 11.5px; padding: 0 6px; }
.roles-list .list-row { grid-template-columns: minmax(0, 1fr) auto; }
.roles-list .list-row small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.look-grid { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 14px; }
.look-grid .full { grid-column: 1 / -1; }
.look-grid [data-simple] { display: grid; gap: 8px; }
.look-grid [data-simple][hidden] { display: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { --c: #fff; width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: var(--c); cursor: pointer; padding: 0; position: relative; display: grid; place-items: center; }
.sw[aria-pressed='true'], .sw.custom.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #c4b5fd; }
.sw.none { background: transparent; color: var(--text-3); }
.sw.custom { background: conic-gradient(#f55, #ff5, #5f5, #5ff, #55f, #f5f, #f55); color: #fff; overflow: hidden; }
.sw.custom.on { background: var(--c); }
.sw.custom .i { width: 13px; height: 13px; filter: drop-shadow(0 0 2px #000); }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.code-edit summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.previews { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.previews .eyebrow { margin-bottom: 6px; }
.mc-chat, .mc-tab { border-radius: 10px; font: 500 14px/1.5 var(--mono); padding: 10px 12px; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); overflow: hidden; }
.mc-chat { background: linear-gradient(180deg, #355b2a 0%, #2a4a21 100%); }
.mc-chat > div { background: rgba(0, 0, 0, .5); padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-chat > div.dim { opacity: .6; }
.mc-tab { background: rgba(0, 0, 0, .55); }
.mc-tab > div { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); padding: 2px 6px; white-space: nowrap; overflow: hidden; }
.mc-tab .head { border-radius: 2px; box-shadow: none; }
.roles-perms .perm-group { gap: 2px; }
.roles-perms .perm-group h4 { display: flex; align-items: center; gap: 6px; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 9px; cursor: pointer; }
.perm-row:hover { background: rgba(255, 255, 255, .03); }
.perm-row .t { display: grid; gap: 1px; flex: 1; min-width: 0; }
.perm-row .t b { font-size: 13px; font-weight: 600; color: var(--text); }
.perm-row .t small { font-size: 11.5px; color: var(--text-3); overflow-wrap: anywhere; }
.perm-row .t i { font-style: normal; color: #a5b4fc; }
.perm-row.warn .t b::after { content: ' !'; color: var(--danger); }
.perm-row.everything { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 12px; }
.switch.part .track { background: linear-gradient(90deg, rgba(77, 139, 255, .55), rgba(255, 255, 255, .08)); }
.switch.part .track::after { transform: translateX(8px); }
.card.adv > summary { list-style: none; cursor: pointer; }
.card.adv > summary::-webkit-details-marker { display: none; }
.card.adv > summary h3 { display: flex; align-items: center; gap: 9px; margin: 0; }
@media (max-width: 640px) {
  .look-grid, .previews { grid-template-columns: minmax(0, 1fr); }
  .person-row { grid-template-columns: minmax(0, 1fr); }
  .person-row > .btn { justify-self: start; margin-left: 44px; }
  .roles .seg { width: 100%; }
  .roles .seg button { flex: 1; }
}
.role-chip.gone { opacity: .75; border-style: dashed; }
/* new server: "like folia" or another type, and the plugins it takes */
.new-pick { margin: 0 0 16px; }
.plug-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 2px 8px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: rgba(0, 0, 0, .18); }
.plug-pick label { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px; cursor: pointer; min-width: 0; font-size: 13px; }
.plug-pick label:hover { background: rgba(255, 255, 255, .04); }
.plug-pick label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plug-pick label b { font-weight: 600; }
.plug-pick small { color: var(--text-3); font-size: 11.5px; }
.plug-pick small.bad { color: #fca5a5; }
.plug-pick input { width: 16px; height: 16px; flex: none; accent-color: #8b5cf6; }
.plug-pick input:disabled { cursor: default; }
.plug-pick .nofit { opacity: .7; }
/* sync tab: what syncs to this server, a switch per kind, plugin, folder and file */
.so-search { margin: 0 0 10px; }
.so-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .14); }
.so-row { display: grid; grid-template-columns: 22px 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 46px; padding: 7px 12px 7px calc(8px + var(--d, 0) * 18px); border-top: 1px solid var(--line); transition: background .15s; }
.so-list > .so-row:first-child { border-top: 0; }
.so-row:hover { background: rgba(255, 255, 255, .025); }
.so-row.exp { cursor: pointer; }
.so-row.cat { min-height: 56px; }
.so-row .t { min-width: 0; display: grid; gap: 2px; }
.so-row .t b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-row .t b.mono { font: 500 12.5px var(--mono); }
.so-row .t small { color: var(--text-3); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.so-row .t small .badge { height: 17px; padding: 0 6px; font-size: 9.5px; vertical-align: 1px; }
.so-row.off > .t b { color: var(--text-3); }
.so-row.off > .so-ic { opacity: .55; }
.so-why { color: #fcd34d; }
.so-tw { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--text-3); border-radius: 6px; padding: 0; cursor: pointer; }
.so-tw:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.so-tw .i { transition: transform .2s var(--spring); }
.so-tw.open .i { transform: rotate(90deg); }
.so-ic { display: grid; place-items: center; color: var(--text-3); }
.so-row.cat > .so-ic { color: #a78bfa; }
.so-kids { display: grid; background: rgba(255, 255, 255, .018); }
.so-sw { justify-self: end; }
@media (max-width: 640px) {
  .so-row { grid-template-columns: 20px 18px minmax(0, 1fr) auto; gap: 6px; padding: 7px 10px 7px calc(4px + var(--d, 0) * 11px); }
  .so-row .t b { font-size: 13px; }
}
/* partly off (some of what is under it): on, with the knob half way */
.so-sw.part input:checked + .track { background: linear-gradient(90deg, #4d8bff, rgba(143, 123, 255, .35)); }
.so-sw.part input:checked + .track::after { transform: translateX(8px); }

/* ---------------------------------------------------- motion polish (with js/motion.js) */
/* switches: the colour fades in under the knob, the knob springs across and stretches while pressed */
.switch .track { transition: border-color .25s var(--ease), box-shadow .2s; }
.switch .track::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; background: linear-gradient(90deg, #4d8bff, #8f7bff); opacity: 0; transition: opacity .28s var(--ease); }
.switch input:checked + .track { background: rgba(255, 255, 255, .1); }
.switch input:checked + .track::before { opacity: 1; }
.so-sw.part input:checked + .track::before { background: linear-gradient(90deg, #4d8bff, rgba(143, 123, 255, .35)); }
.switch .track::after { transition: transform .34s var(--spring), width .18s var(--ease), background .2s; }
.switch:active input:not(:disabled) + .track::after { width: 20px; }
.switch:active input:not(:disabled):checked + .track::after { transform: translateX(12px); }
.so-sw.part:active input:not(:disabled):checked + .track::after { transform: translateX(6px); }
/* the three key choices: the picked one glows, a press gives a little */
.key-access button { transition: border-color .22s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease); }
.key-access button:active { transform: scale(.985); }
.key-access button[aria-pressed='true'] { box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.perm-group .off-limits { transition: opacity .2s; }

/* ---- motion: chrome */
/* hover and press feel the same everywhere: colours fade quickly, a press gives a little, clickable cards lift */
.path-bar a, .so-tw, .user-chip .signout, .role-chip button, .docs-toc nav a, .linkish { transition: background-color var(--t-fast), color var(--t-fast); }
.act-row, .perm-row, .key-pick label, .role-opt, .net-row { transition: background-color var(--t-fast), border-color var(--t-fast); }
.join-chip { transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-move) var(--spring); }
.join-chip:active { transform: scale(.96); transition-duration: .06s; }
.server-card:active:not(:has(.quick:active, .join-chip:active, .motd-peek:active)), .type-card:active, .store-card:active { transform: translateY(-1px) scale(.99); transition-duration: .08s; }
a.list-row:active, .net-row:active, .perm-row:active, .key-pick label:active, .role-opt:active { background: rgba(255, 255, 255, .05); }
/* state colours fade over instead of flipping when a server changes state */
.state-pill, .badge, .card-note { transition: background-color var(--t-move), border-color var(--t-move), color var(--t-move); }
.btn.flat:focus-visible { box-shadow: var(--ring), 0 8px 22px -12px rgba(115, 31, 251, .9); }
/* the sidebar's server list scrolls and would cut an outside ring off, so its items get an inside one */
.nav-servers .nav-item:focus-visible { box-shadow: inset 0 0 0 2px rgba(139, 92, 246, .6); animation-name: ringInset; }
@keyframes ringInset { from { box-shadow: inset 0 0 0 0 rgba(139, 92, 246, .6); } }

/* ---- motion: pages */
/* the new machine choices wrap on a phone: the button grows with its text instead of the text spilling out */
.seg.seg-fit button { height: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; line-height: 1.25; }
/* os, iso and plugin picks: the border and tint fade over to the picked one, a press gives a little */
.os-pick { transition: border-color var(--t-move) var(--ease), background-color var(--t-move) var(--ease), transform var(--t-move) var(--spring); }
.os-pick:active { transform: scale(.985); transition-duration: .06s; }
.plug-pick label { transition: background-color var(--t-fast); }

/* ---- motion: server */
/* the motd check fades to its new colour (checking, working, broken) */
.health { transition: border-color var(--t-move) var(--ease), background-color var(--t-move) var(--ease); }
/* a ticked file row tints over instead of flipping */
.files .table td { transition: background-color var(--t-fast); }

/* ---- motion: sync-ranks-dash */
/* sync tab: a row turned off dims smoothly */
.so-row > .t b, .so-row > .so-ic { transition: color var(--t-move) var(--ease), opacity var(--t-move) var(--ease); }
/* switches waiting for a change to save only dim when the wait is long, a quick save does not blink */
.so-list .switch .track, .roles .perm-row .switch .track { transition: border-color .25s var(--ease), box-shadow .2s, opacity .2s var(--ease); }
.so-list .switch input:disabled + .track, .roles .perm-row .switch input:disabled + .track { transition-delay: 0s, 0s, .18s; }
/* roles: the ring moves to the picked swatch, a press gives a little, a picked colour fades over the preview */
.swatches .sw { transition: box-shadow var(--t-pop) var(--ease), transform var(--t-move) var(--spring); }
.swatches .sw:active { transform: scale(.9); transition-duration: .06s; }
.previews.pv-fade .mc-chat span, .previews.pv-fade .mc-tab span { transition: color var(--t-move) var(--ease); }
/* dashboard: the tile glow fades to its new colour, a machine that drops off dims */
.ov-tile::after { transition: background-color var(--t-slow) var(--ease); }
.node-row { transition: opacity var(--t-move) var(--ease); }
/* the bulk bar wraps its buttons on a phone instead of squeezing them */
@media (max-width: 640px) { .bulk-bar { flex-wrap: wrap; gap: 8px 10px; } }
