/* WardenOS interface.
   Deep Dark palette: deepslate greys, sculk teal for anything you can act
   on, ore colours for states. Blocks instead of cards: square corners, 2px
   edges, a bevel only on things that can be pressed. */

@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("fonts/fira-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url("fonts/fira-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url("fonts/archivo-black.woff2") format("woff2"); }

:root {
  --deepslate: #1d2028;
  --tuff: #262a34;
  --cobble: #303542;
  --edge: #424959;
  --edge-dark: #0d0f14;
  --text: #e7eaf0;
  --mute: #a0a8b9;
  --faint: #6f778a;
  --sculk: #2fd6c2;
  --sculk-dim: #1b8f85;
  --sculk-deep: #103f42;
  --emerald: #46de86;
  --gold: #ffc44d;
  --redstone: #ff5f57;
  --lapis: #7d9bff;
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo Black", "Fira Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "DejaVu Sans Mono", Menlo, monospace;
  --side: 236px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--deepslate); color: var(--text);
  font: 400 15px/1.45 var(--font); font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font: 400 26px/1.15 var(--display); letter-spacing: .01em; }
h2 { font: 600 17px/1.3 var(--font); }
h3 { font: 600 15px/1.3 var(--font); color: var(--mute); }
p { margin: 0 0 .7em; max-width: 72ch; }
a { color: var(--sculk); text-decoration-thickness: 1px; text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
small, .small { font-size: 13px; }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sculk); outline-offset: 2px; }
::selection { background: var(--sculk-deep); color: #fff; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side {
  background: var(--tuff); border-right: 2px solid var(--edge-dark);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand { padding: 18px 18px 14px; display: block; text-decoration: none; color: inherit; }
.brand svg { display: block; }
.brand .sub { color: var(--faint); font-size: 12px; margin-top: 8px; }
.nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--mute);
  text-decoration: none; border: 2px solid transparent;
}
.nav a svg { flex: none; }
.nav a:hover { color: var(--text); background: var(--cobble); }
.nav a.on { color: var(--text); background: var(--deepslate); border-color: var(--edge-dark); box-shadow: inset 3px 0 0 var(--sculk); }
.side h3 { padding: 16px 20px 6px; font-size: 13px; }
.side .mini { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 20px; color: var(--mute); text-decoration: none; font-size: 14px; }
.side .mini:hover, .side .mini.on { color: var(--text); background: var(--cobble); }
.side .mini .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .foot { margin-top: auto; padding: 12px 10px; border-top: 2px solid var(--edge-dark); }
.side .foot .who { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--mute); text-decoration: none; }
.side .foot .who:hover { color: var(--text); background: var(--cobble); }
.main { padding: 26px 30px 60px; min-width: 0; max-width: 1240px; width: 100%; }
.bottomnav { display: none; }

.head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.head .grow { flex: 1; min-width: 200px; }
.head .sub { color: var(--mute); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }

/* ---------- buttons: the only bevelled things ---------- */
.btn {
  font: 600 14px/1 var(--font); color: var(--text); background: var(--cobble);
  border: 2px solid var(--edge-dark); padding: 9px 13px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; min-height: 38px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.13), inset -2px -2px 0 rgba(0,0,0,.34);
}
.btn:hover { background: #3a4050; }
.btn:active { box-shadow: inset 2px 2px 0 rgba(0,0,0,.4), inset -2px -2px 0 rgba(255,255,255,.07); transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--sculk-dim); color: #04201d; }
.btn.primary:hover { background: #22a89b; }
.btn.go { background: #2c8f58; color: #04200f; }
.btn.go:hover { background: #35a567; }
.btn.danger { background: #8f3531; color: #fff; }
.btn.danger:hover { background: #a8403a; }
.btn.small { padding: 5px 9px; min-height: 30px; font-size: 13px; }
.btn.icon { padding: 0; width: 38px; justify-content: center; }
.btn.icon.small { width: 30px; }
.btn.flat { background: none; box-shadow: none; border-color: transparent; color: var(--mute); }
.btn.flat:hover { color: var(--text); background: var(--cobble); }

/* ---------- forms ---------- */
input, select, textarea {
  font: 400 15px/1.3 var(--font); color: var(--text); background: var(--deepslate);
  border: 2px solid var(--edge); padding: 8px 10px; width: 100%; border-radius: 0; min-height: 38px;
}
input:hover, select:hover, textarea:hover { border-color: #57607a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sculk); }
textarea { resize: vertical; min-height: 84px; }
textarea.code, input.code { font-family: var(--mono); font-size: 13.5px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--sculk); flex: none; margin: 0; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > .lbl { font-weight: 600; font-size: 14px; }
.field > .hint { color: var(--faint); font-size: 13px; }
/* save bar: stays in reach at the lower edge while a long form scrolls */
.savebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 5; margin: 16px 0; padding: 10px 0; background: var(--deepslate); border-top: 2px solid var(--edge-dark); }
.show-s { display: none; }
/* server.properties */
.props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; align-items: start; }
.props .wide { grid-column: 1 / -1; }
code.key { font: 12.5px var(--mono); color: var(--faint); margin-left: 8px; font-weight: 400; white-space: nowrap; }
.hint.caution, .check .hint.caution { color: var(--gold); }
.prop .check .hint { margin-top: 2px; }
.propbar { margin-bottom: 14px; }
.propbar input[type=search] { flex: 1 1 260px; max-width: 480px; width: auto; }
.absent > p { margin-bottom: 4px; }
.absent .missing { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--edge); }
.absent .missing:first-of-type { border-top: 0; }
.absent .missing .hint { display: block; margin-top: 3px; color: var(--faint); font-size: 13px; }
.absent .missing .hint.caution { color: var(--gold); }
.absent .missing .btn { flex: none; }
table.more td:first-child { width: 34%; }
table.more tr.gone code, table.more tr.gone input { text-decoration: line-through; opacity: .55; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.check > span { padding-top: 1px; }
.check .hint { display: block; color: var(--faint); font-size: 13px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- blocks ---------- */
.block { background: var(--tuff); border: 2px solid var(--edge-dark); padding: 16px 18px; }
.block > h2 { margin-bottom: 12px; }
.block + .block { margin-top: 16px; }
.block .lead { color: var(--mute); margin: -6px 0 14px; max-width: 76ch; }
.note { border-left: 4px solid var(--lapis); background: #232a40; padding: 10px 14px; }
.note.warn { border-color: var(--gold); background: #3a321d; }
.note.bad { border-color: var(--redstone); background: #3d2424; }
.note.good { border-color: var(--emerald); background: #1f3529; }
.note p:last-child { margin: 0; }
.empty { border: 2px dashed var(--edge); padding: 34px 20px; text-align: center; color: var(--mute); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- server list ---------- */
.servers { display: flex; flex-direction: column; gap: 8px; }
.server {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center;
  background: var(--tuff); border: 2px solid var(--edge-dark); padding: 10px 14px 10px 10px;
  color: inherit; text-decoration: none; cursor: pointer;
}
.server:hover { border-color: var(--sculk-dim); }
.server .face {
  width: 52px; height: 52px; display: grid; place-items: center; font: 400 19px/1 var(--display); color: #0c0e12;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.22), inset -3px -3px 0 rgba(0,0,0,.28);
}
.server .nm { font: 400 18px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server .meta { color: var(--mute); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 3px; }
.server .meta .addr { font-family: var(--mono); font-size: 13px; }
.server .load { text-align: right; color: var(--mute); font-size: 13px; line-height: 1.35; min-width: 86px; }
.server .players { text-align: right; min-width: 64px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.server .players b { font: 400 18px/1 var(--display); display: block; }
.server .players span { color: var(--faint); font-size: 12px; }
.server .acts { display: flex; gap: 6px; }

/* header of an instance page */
.ihead { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; flex: 1; min-width: 220px; }
.ihead .face { width: 52px; height: 52px; display: grid; place-items: center; font: 400 19px/1 var(--display); color: #0c0e12;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.22), inset -3px -3px 0 rgba(0,0,0,.28); }
.imeta { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 5px; color: var(--mute); align-items: center; }
.imeta .btn { margin: -4px -6px; }

/* signal bars: the state of a server, as in the multiplayer list */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; flex: none; }
.bars i { width: 4px; background: #4b5263; display: block; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; }
.bars i:nth-child(4) { height: 14px; } .bars i:nth-child(5) { height: 18px; }
.bars.running i { background: var(--emerald); }
.bars.starting i, .bars.stopping i, .bars.installing i { background: var(--gold); animation: climb 1s steps(1) infinite; }
.bars.starting i:nth-child(2), .bars.stopping i:nth-child(2), .bars.installing i:nth-child(2) { animation-delay: .2s; }
.bars.starting i:nth-child(3), .bars.stopping i:nth-child(3), .bars.installing i:nth-child(3) { animation-delay: .4s; }
.bars.starting i:nth-child(4), .bars.stopping i:nth-child(4), .bars.installing i:nth-child(4) { animation-delay: .6s; }
.bars.starting i:nth-child(5), .bars.stopping i:nth-child(5), .bars.installing i:nth-child(5) { animation-delay: .8s; }
.bars.crashed i { background: var(--redstone); height: 4px; }
.bars.crashed i:nth-child(3) { height: 18px; }
.bars.offline i { background: #3a4050; height: 4px; }
@keyframes climb { 0%, 100% { background: #4b5263; } 20%, 60% { background: var(--gold); } }
.state { font-weight: 600; white-space: nowrap; }
.state.running { color: var(--emerald); } .state.starting, .state.stopping, .state.installing { color: var(--gold); }
.state.crashed { color: var(--redstone); } .state.stopped, .state.offline { color: var(--mute); }

/* ---------- host strip ---------- */
.host { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2px; background: var(--edge-dark); border: 2px solid var(--edge-dark); margin-bottom: 22px; }
.host > div { background: var(--tuff); padding: 12px 14px; min-width: 0; }
.host .k { color: var(--mute); font-size: 13px; }
.host .v { font: 400 21px/1.2 var(--display); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host .v small { font: 400 13px var(--font); color: var(--mute); }
.meter { height: 6px; background: var(--deepslate); margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--sculk); width: 0; }
.meter i.hot { background: var(--gold); } .meter i.crit { background: var(--redstone); }
.spark { display: block; width: 100%; height: 30px; margin-top: 6px; }

/* ---------- tabs ---------- */
.grant { border: 2px solid var(--edge); background: var(--deepslate); padding: 8px; }
.pickbtn { width: 100%; justify-content: space-between; font-weight: 400; text-align: left; }
.pickbtn.none { color: var(--gold); }
.pickbox { margin-top: 8px; padding: 10px 12px; border-top: 1px solid var(--edge); display: flex; flex-direction: column; gap: 10px; }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; max-height: 240px; overflow: auto; padding: 2px; }
.cpudetails { border: 2px solid var(--edge); background: var(--deepslate); padding: 10px 12px; }
.cpudetails > summary { cursor: pointer; font-weight: 600; }
.cpudetails[open] > summary { margin-bottom: 10px; }
.cpupick { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cpupick p { margin: 0; max-width: none; }
.cpuhead { font-weight: 600; }
.cpuquick { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.cpunum { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mute); }
.cpunum input { width: 92px; }
.cpugroups { display: flex; flex-direction: column; gap: 10px; }
.cpugroup { border: 2px solid var(--edge); background: var(--deepslate); padding: 10px; }
.cpugrouphead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.cpucores { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.cpucore { border: 1px solid var(--edge); padding: 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cpucorename { font-size: 12px; color: var(--faint); }
.cputhreads { display: flex; gap: 5px; }
.cputhread { flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; color: var(--text);
  background: var(--tuff); border: 2px solid var(--edge-dark); cursor: pointer; padding: 3px 2px; line-height: 1.15; }
.cputhread b { font: 400 15px/1.1 var(--display); }
.cputhread .cpuload { font-size: 12px; color: var(--mute); }
.cputhread .cpurole { font-size: 11px; color: var(--faint); }
.cputhread:hover { border-color: var(--mute); }
.cputhread:focus-visible { outline: 2px solid var(--sculk); outline-offset: 2px; }
.cputhread.other { background: repeating-linear-gradient(135deg, var(--tuff) 0 6px, var(--deepslate) 6px 12px); }
.cputhread.h { background: var(--sculk-dim); border-color: var(--sculk); }
.cputhread.n { background: #2c3f6b; border-color: #7d9bff; }
.cputhread.h .cpuload, .cputhread.h .cpurole, .cputhread.n .cpuload, .cputhread.n .cpurole { color: var(--text); }
.cpucache { font-size: 11.5px; color: var(--faint); }
.cpuused { font-size: 12px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpusum { font-weight: 600; }
.cpuwrap { margin-top: 4px; }
/* Domain and certificate. */
.domainblock .stack { max-width: 720px; }
.domstate { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; max-width: 720px; }
.domstate:empty { display: none; }
.domstate .portline { margin: 0; color: var(--mute); }
.domstate .note .row { margin-top: 8px; flex-wrap: wrap; gap: 8px 12px; }
/* Key and value pairs, as in the SFTP dialog. */
.kvs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; border: 2px solid var(--edge); background: var(--deepslate); padding: 10px 12px; }
.kv { display: contents; }
.kv .k { color: var(--mute); }
.kv .v { min-width: 0; overflow-wrap: anywhere; }
.cmdline { flex: 1; min-width: 0; padding: 7px 10px; background: var(--edge-dark); overflow-wrap: anywhere; }
@media (max-width: 560px) { .kvs { grid-template-columns: 1fr; gap: 0 0; } .kv .k { margin-top: 8px; font-size: 13px; } .kv:first-child .k { margin-top: 0; } }
/* File manager: ticked entries and what can be done with them. */
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; padding: 8px 12px; border: 2px solid var(--sculk-dim); background: var(--sculk-deep); }
.selbar strong { margin-right: 4px; }
table.files .selcell { width: 34px; padding-right: 0; }
.files td.ficon { width: 28px; padding-right: 0; color: var(--mute); }
/* On a phone the tick box takes the place of the icon, so the name keeps its room; folders show a slash instead. */
@media (max-width: 860px) {
  table.files .selcell + .ficon, table.files th.selcell + th { display: none; }
  table.files .selcell ~ td .fname.dir::after { content: "/"; color: var(--faint); }
}
/* Unknown ports: where the number comes from, and what to do about it. */
.portbadge { font: inherit; font-size: 12.5px; font-weight: 600; background: #3a321d; cursor: pointer; margin: 0; }
.portbadge:hover { color: var(--text); border-color: var(--gold); }
.portbadge:focus-visible { outline: 2px solid var(--sculk); outline-offset: 2px; }
.portplan { margin: -4px 0 0; max-width: none; }
.portdialog p { margin: 0; max-width: none; }
.portsrc { border: 2px solid var(--edge); background: var(--deepslate); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hits { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hitrow { display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
.hitrow > span { min-width: 0; flex: 1; }
.hitrow input { margin-top: 4px; }
.hitfile { font-weight: 600; overflow-wrap: anywhere; }
.hitline { display: block; margin-top: 4px; padding: 5px 8px; background: var(--edge-dark); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--edge); cursor: pointer; }
.choice:hover { border-color: var(--mute); }
.choice.on { border-color: var(--sculk); background: var(--sculk-deep); }
.choice.off { cursor: default; color: var(--faint); }
.choice.off:hover { border-color: var(--edge); }
.choice input[type=radio] { margin-top: 4px; flex: none; }
.choice > span { min-width: 0; flex: 1; }
.choice .hint { display: block; color: var(--mute); font-size: 13px; margin-top: 3px; }
.choice.off .hint { color: var(--gold); }
.portnum { width: 92px; margin: 0 0 0 8px; padding: 3px 8px; font-weight: 600; }
.linkbtn { font: inherit; color: var(--sculk); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--text); }
.linkbtn:focus-visible { outline: 2px solid var(--sculk); outline-offset: 2px; }
.linkbtn:disabled { color: var(--faint); cursor: default; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg button { font: inherit; font-weight: 600; padding: 7px 13px; color: var(--mute); background: var(--deepslate); border: 2px solid var(--edge-dark); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-selected=true] { color: var(--text); background: var(--tuff); box-shadow: inset 0 3px 0 var(--sculk); }
.seg button:focus-visible { outline: 2px solid var(--sculk); outline-offset: 2px; }
.picker .note { margin-top: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--edge-dark); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--mute); text-decoration: none; font-weight: 600; white-space: nowrap; border: 2px solid transparent; border-bottom: 0; margin-bottom: -2px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); background: var(--tuff); border-color: var(--edge-dark); box-shadow: inset 0 3px 0 var(--sculk); }

/* ---------- console ---------- */
.console { background: #0f1116; border: 2px solid var(--edge-dark); display: flex; flex-direction: column; height: min(62dvh, 720px); min-height: 320px; }
.console .out { flex: 1; overflow-y: auto; padding: 10px 12px; font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; overscroll-behavior: contain; }
/* Lines outside the visible part are neither measured nor painted. A server
   that loads mods prints thousands of lines; this keeps the page smooth. */
.console .out { contain: content; }
.console .ln { content-visibility: auto; contain-intrinsic-height: auto 19.5px; }
.console .ln.warn { color: var(--gold); } .console .ln.err { color: var(--redstone); }
.console .ln.sys { color: var(--sculk); } .console .ln.in { color: var(--lapis); } .console .ln.probe { color: var(--faint); }
.console .bar { display: flex; gap: 0; border-top: 2px solid var(--edge-dark); }
.console .bar input { border: 0; background: #151820; font-family: var(--mono); font-size: 14px; min-height: 44px; }
.console .bar .btn { border: 0; border-left: 2px solid var(--edge-dark); min-height: 44px; }
.console .tools { display: flex; gap: 12px; align-items: center; padding: 6px 12px; border-bottom: 2px solid var(--edge-dark); background: var(--tuff); font-size: 13px; color: var(--mute); flex-wrap: wrap; }
.console .tools input[type=text] { width: 180px; min-height: 28px; padding: 3px 8px; font-size: 13px; }
.jump { position: sticky; bottom: 6px; float: right; margin-right: 6px; }
.progress { height: 8px; background: var(--deepslate); border: 2px solid var(--edge-dark); }
.progress i { display: block; height: 100%; background: var(--sculk); transition: width .3s linear; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 2px solid var(--edge-dark); background: var(--tuff); }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--mute); padding: 9px 12px; border-bottom: 2px solid var(--edge-dark); white-space: nowrap; background: var(--tuff); }
td { padding: 9px 12px; border-bottom: 1px solid #343a48; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.tight { width: 1%; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--cobble); }
td .mono { color: var(--text); }
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 7px; border: 2px solid var(--edge); color: var(--mute); white-space: nowrap; margin: 1px 4px 1px 0; }
.tag.on { border-color: var(--sculk-dim); color: var(--sculk); }
.tag.warn { border-color: #8a6a22; color: var(--gold); }
.tag.bad { border-color: #8f3531; color: var(--redstone); }
.tag.good { border-color: #2c8f58; color: var(--emerald); }

/* ---------- files ---------- */
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 14px; }
.crumbs a { text-decoration: none; padding: 2px 4px; }
.crumbs a:hover { background: var(--cobble); }
.files .fname { cursor: pointer; overflow-wrap: anywhere; }
.files .fname:hover { color: var(--sculk); }
.drop { outline: 2px dashed var(--sculk); outline-offset: -6px; }
.editor textarea { min-height: 56dvh; font: 13.5px/1.5 var(--mono); white-space: pre; overflow-wrap: normal; tab-size: 4; }
.editnote { margin-top: -4px; max-width: none; }

/* ---------- tasks ---------- */
.steps { display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.step { display: grid; grid-template-columns: 26px 170px minmax(0, 1fr) auto; gap: 8px; align-items: start; background: var(--deepslate); border: 2px solid var(--edge); padding: 8px; counter-increment: step; }
.step::before { content: counter(step); font: 400 15px/38px var(--display); color: var(--faint); text-align: center; }
.step .ctl { display: flex; gap: 4px; }
.step .stepnote { display: block; padding: 9px 0; line-height: 1.4; }
.step.timed { grid-template-columns: 104px 170px minmax(0, 1fr) auto; }
.step.timed::before { display: none; }
.step.timed textarea { min-height: 38px; }
.step .steptime { text-align: center; padding-left: 6px; padding-right: 6px; }
.step textarea { min-height: 56px; }
.runs .r { border-bottom: 1px solid #343a48; padding: 8px 0; }
.runs .r:last-child { border: 0; }
.runs .r summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.runs .r summary::-webkit-details-marker { display: none; }
.runs ol { margin: 8px 0 2px; padding-left: 22px; color: var(--mute); font-size: 14px; }
.runs li.failed { color: var(--redstone); }
.runs ul.timeline { list-style: none; margin: 8px 0 2px; padding: 0; color: var(--mute); font-size: 14px; }
.runs ul.timeline code { margin-right: 10px; color: var(--text); }
.runs ul.timeline li { padding: 1px 0; }
.runs ul.timeline li.pending { color: var(--faint); }
.runs ul.timeline li.pending code { color: var(--faint); }
.runs ul.timeline .tag { margin-left: 8px; }

/* ---------- permissions matrix ---------- */
.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.perms h3 { margin-bottom: 6px; }
.perms .check { padding: 3px 0; }
.perms .wrn { color: var(--gold); }

/* ---------- modal & toast ---------- */
.veil { position: fixed; inset: 0; background: rgba(8, 9, 12, .72); display: grid; place-items: start center; padding: 6dvh 14px 14px; overflow-y: auto; z-index: 40; }
.modal { background: var(--tuff); border: 2px solid var(--edge-dark); box-shadow: 8px 8px 0 rgba(0,0,0,.45); width: min(680px, 100%); min-width: 0; }
.modal.wide { width: min(980px, 100%); }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 2px solid var(--edge-dark); }
.modal > header h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 400 19px/1.2 var(--display); }
.modal > .body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal > footer { padding: 14px 18px; border-top: 2px solid var(--edge-dark); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--cobble); border: 2px solid var(--edge-dark); border-left: 6px solid var(--sculk); padding: 10px 14px; box-shadow: 5px 5px 0 rgba(0,0,0,.4); }
.toast.bad { border-left-color: var(--redstone); } .toast.warn { border-left-color: var(--gold); }

/* ---------- login ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background-color: var(--deepslate);
  background-image: repeating-linear-gradient(0deg, rgba(47,214,194,.045) 0 2px, transparent 2px 32px), repeating-linear-gradient(90deg, rgba(47,214,194,.045) 0 2px, transparent 2px 32px); }
.gate .box { width: min(420px, 100%); background: var(--tuff); border: 2px solid var(--edge-dark); box-shadow: 10px 10px 0 rgba(0,0,0,.45); padding: 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.gate .box h1 { font-size: 22px; }
.gate .mark { margin-bottom: 6px; }
.err { color: var(--redstone); font-weight: 600; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 16px 14px 96px; }
  h1 { font-size: 22px; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--tuff); border-top: 2px solid var(--edge-dark);
    padding-bottom: env(safe-area-inset-bottom); z-index: 30;
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; color: var(--mute); text-decoration: none; font-size: 11.5px; font-weight: 600; min-width: 0; }
  .bottomnav a.on { color: var(--sculk); box-shadow: inset 0 3px 0 var(--sculk); }
  .grid2, .grid3, .props { grid-template-columns: minmax(0, 1fr); }
  .savebar { bottom: calc(57px + env(safe-area-inset-bottom)); gap: 8px; flex-wrap: nowrap; }
  .savebar .mute { display: none; }
  .show-s { display: inline; }
  .propbar input[type=search] { flex-basis: 100%; max-width: none; }
  .propbar .spacer { display: none; }
  table.more td:first-child { width: 42%; }
  .server { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px 8px 8px; }
  .server .face { width: 44px; height: 44px; font-size: 16px; }
  .server .load { display: none; }
  .server .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .server .players { min-width: 0; gap: 8px; }
  .server .players div span { display: none; }
  .host { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
  .host > div { padding: 9px 10px; }
  .host > div:nth-last-child(-n+2) { display: none; }
  .host .v { font-size: 16px; } .host .v small { display: none; }
  .host .k { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ihead { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .ihead .face { width: 40px; height: 40px; font-size: 15px; }
  .imeta { font-size: 14px; }
  .head { gap: 10px; margin-bottom: 14px; }
  .head .actions .btn { min-height: 34px; padding: 6px 10px; }
  .step { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .step > :nth-child(2) { grid-column: 2; } .step > :nth-child(3) { grid-column: 2 / -1; }
  .step .ctl { grid-row: 1; grid-column: 3; }
  .step.timed { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .step.timed > :nth-child(2) { grid-column: 2; } .step.timed > :nth-child(3) { grid-column: 1 / -1; }
  .console .tools input[type=text] { width: 120px; }
  .toasts { left: 12px; right: 12px; bottom: 78px; }
  td, th { padding: 8px 9px; }
  .hide-s { display: none; }
  /* name/value tables: long values (paths, CPU names) wrap instead of running off the screen */
  table.kv td:first-child { width: 38% !important; }
  table.kv td:last-child { overflow-wrap: anywhere; }
  /* address list: one block per address instead of a wide table */
  table.ips thead { display: none; }
  table.ips, table.ips tbody, table.ips tr, table.ips td { display: block; width: auto; }
  table.ips tr { padding: 10px 4px; border-bottom: 2px solid var(--edge-dark); position: relative; }
  table.ips tr:last-child { border-bottom: 0; }
  table.ips td { border: 0; padding: 4px 9px; }
  table.ips td.hide-s { display: none; }
  table.ips td.tight { position: absolute; top: 8px; right: 4px; }
}
/* A page that needs longer than a moment to load says so with a thin line. */
body.loading .main::before { content: ""; position: fixed; z-index: 30; top: 0; left: var(--side); right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--sculk), transparent) no-repeat -40% 0 / 35% 100%; animation: loading 1.1s linear infinite; }
@keyframes loading { to { background-position: 160% 0; } }
@media (max-width: 860px) { body.loading .main::before { left: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bars i { animation: none !important; }
  .progress i { transition: none; }
  body.loading .main::before { animation: none; background: var(--sculk); }
}
