/* Lunar - monochrome, quiet, San Francisco. Colour appears only where something is wrong. */

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --well: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #a1a1a6;
  --line: rgba(0, 0, 0, 0.08);
  --fill: rgba(0, 0, 0, 0.05);
  --fill-2: rgba(0, 0, 0, 0.09);
  --red: #d70015;
  --green: #1a8f3c;
  --amber: #b25000;
  --scrim: rgba(0, 0, 0, 0.28);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111112;
    --card: #1c1c1e;
    --well: #151516;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #6e6e73;
    --line: rgba(255, 255, 255, 0.1);
    --fill: rgba(255, 255, 255, 0.07);
    --fill-2: rgba(255, 255, 255, 0.12);
    --red: #ff453a;
    --green: #30d158;
    --amber: #ff9f0a;
    --scrim: rgba(0, 0, 0, 0.55);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  }
}
:root[data-theme="dark"] {
  --bg: #111112;
  --card: #1c1c1e;
  --well: #151516;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --line: rgba(255, 255, 255, 0.1);
  --fill: rgba(255, 255, 255, 0.07);
  --fill-2: rgba(255, 255, 255, 0.12);
  --red: #ff453a;
  --green: #30d158;
  --amber: #ff9f0a;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--fill-2); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }

/* ---- the moon: one glyph for every state ------------------------------------------ */
.moon { display: block; flex: none; color: var(--ink); }
.moon .lit { transform-origin: center; }
.moon.busy .lit { animation: breathe 1.8s ease-in-out infinite; }
.moon .err { fill: var(--red); }
.moon.error circle:first-child { stroke: var(--red); stroke-opacity: 0.55; }
.moon.update .err { fill: var(--amber); }
.moon.update circle:first-child { stroke: var(--amber); stroke-opacity: 0.6; }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ---- shell ------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 12px 14px;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 600 17px/1 var(--display); letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--fill); color: var(--ink); }
.nav svg { flex: none; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; }
.who { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.who:hover, .who[aria-current="page"] { background: var(--fill); color: var(--ink); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 44px 44px 96px; max-width: 1160px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { font: 600 32px/1.1 var(--display); letter-spacing: -0.024em; }
.lede { margin-top: 8px; color: var(--ink-2); font-size: 15px; max-width: 62ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- controls ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 15px; border: 0; border-radius: 980px;
  background: var(--fill); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
a.btn { text-decoration: none; }
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: 0.86; background: var(--ink); }
.btn.danger { color: var(--red); }
.btn.small { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn.big { height: 44px; font-size: 15px; width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--fill-2); color: var(--ink); }

.field {
  width: 100%; border: 0; border-radius: 10px;
  background: var(--fill); padding: 9px 12px;
  transition: box-shadow 0.15s, background 0.15s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { box-shadow: 0 0 0 3px var(--fill-2); outline: none; }
textarea.field { min-height: 168px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; letter-spacing: 0; }
select.field { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
label.lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.hint { font-size: 12.5px; color: var(--ink-2); }

.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { border: 0; background: none; height: 28px; padding: 0 13px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: color 0.15s; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .field { width: 220px; height: 32px; padding: 0 12px; }
.spacer { flex: 1; }

/* ---- surfaces ---------------------------------------------------------------------- */
.card { background: var(--card); border-radius: 16px; }
.card h2 { font: 600 15px/1.2 var(--display); letter-spacing: -0.012em; }
.pad { padding: 22px 24px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }

/* ---- the sky: every bot as a moon --------------------------------------------------- */
.sky { padding: 26px 26px 20px; }
.sky-grid { display: grid; grid-template-columns: repeat(auto-fill, 20px); gap: 12px; min-height: 52px; }
.sky-grid button { width: 20px; height: 20px; padding: 0; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; transition: transform 0.18s var(--ease); }
.sky-grid button:hover { transform: scale(1.35); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.empty { padding: 44px 24px; text-align: center; }
.empty h2 { font: 600 19px/1.25 var(--display); letter-spacing: -0.018em; }
.empty p { margin: 8px auto 20px; color: var(--ink-2); max-width: 44ch; }
.empty .moon { margin: 0 auto 18px; color: var(--ink-3); }

.kv { display: grid; gap: 14px; margin-top: 16px; }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.kv dt { color: var(--ink-2); }
.kv dd { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.kv dd .bad { color: var(--red); }
.meter { height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 18px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 4px; transition: width 0.4s var(--ease); }

/* ---- lists ------------------------------------------------------------------------- */
.list { overflow: hidden; }
.row, .list-head {
  display: grid; align-items: center; gap: 14px;
  padding: 0 20px; min-height: 52px;
}
.list-head { min-height: 38px; color: var(--ink-2); font-size: 12px; border-bottom: 1px solid var(--line); }
.row { position: relative; width: 100%; border: 0; background: none; text-align: left; transition: background 0.12s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; height: 1px; background: var(--line); }
.row.tap { cursor: pointer; }
.row.tap:hover { background: var(--fill); }
.bots .row, .bots .list-head { grid-template-columns: 20px minmax(110px, 1fr) minmax(150px, 1.5fr) 172px minmax(110px, 1.1fr) 52px 88px; }
.proxies .row, .proxies .list-head { grid-template-columns: minmax(215px, 1.3fr) minmax(84px, 0.55fr) minmax(250px, 2.4fr) 40px 138px; padding-top: 10px; padding-bottom: 10px; }
.pid { display: inline-block; min-width: 34px; color: var(--ink-3); }
.proxies .list-head { padding-top: 0; padding-bottom: 0; }
.cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name { font-weight: 500; }
.state-cell { display: flex; flex-direction: column; min-width: 0; }
.state-cell small { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-cell.error span { color: var(--red); }
.state-cell.update span { color: var(--amber); }
.right { text-align: right; justify-self: end; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.checks { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 12.5px; }
.check { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink-2); }
.check b { font-weight: 500; color: var(--ink); }
.check.fail b { color: var(--red); }
.check i { font-style: normal; font-variant-numeric: tabular-nums; }
.why { display: block; margin-top: 3px; font-size: 12px; color: var(--red); white-space: normal; }
.why.trouble { color: var(--amber); }
.why.good { color: var(--ink-2); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--fill-2); border-top-color: var(--ink); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- log console ------------------------------------------------------------------- */
.console { background: var(--well); border-radius: 12px; padding: 12px 14px; font: 12px/1.7 var(--mono); letter-spacing: 0; overflow: auto; }
.card > .console, .card .console.inset { background: var(--well); }
.console .ln { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
.console.wide .ln { grid-template-columns: 64px 120px minmax(0, 1fr); }
.console time { color: var(--ink-3); }
.console .who-bot { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console .tx { overflow-wrap: anywhere; }
.console .error .tx { color: var(--red); }
.console .warn .tx { color: var(--amber); }
.console .none { color: var(--ink-3); font-family: var(--sans); font-size: 13px; }
.logs-page .console { height: calc(100dvh - 250px); min-height: 280px; }
.feed { margin-top: 14px; }

/* ---- sheet (bot detail) ------------------------------------------------------------ */
.scrim { position: fixed; inset: 0; background: var(--scrim); animation: fade 0.2s ease both; z-index: 20; }
.sheet {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 21;
  width: min(468px, calc(100vw - 20px));
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  animation: slide 0.36s var(--ease) both;
}
.sheet-scroll { overflow: auto; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.sheet-top { display: flex; align-items: center; gap: 14px; }
.sheet-top h2 { font: 600 22px/1.15 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.sheet-top p { color: var(--ink-2); margin-top: 2px; }
.sheet-top .icon-btn { margin-left: auto; align-self: flex-start; }
.sheet h3 { font: 600 13px/1 var(--sans); color: var(--ink-2); margin-bottom: 12px; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--well); color: var(--ink-2); font-size: 13px; }
.note.error { color: var(--red); }
.note.update { color: var(--amber); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row strong { font-weight: 500; }
.switch-row p { margin-top: 2px; color: var(--ink-2); font-size: 12.5px; }
.switch { flex: none; position: relative; width: 44px; height: 26px; border: 0; border-radius: 26px; background: var(--fill-2); transition: background 0.22s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.22s var(--ease); }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--card); }
.steps { display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; color: var(--ink-3); }
.steps li em { font-style: normal; font-size: 12px; }
.steps .dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 5px; box-shadow: inset 0 0 0 1.25px var(--ink-3); }
.steps .done { color: var(--ink); }
.steps .done .dot { background: var(--ink); box-shadow: none; }
.steps .current { color: var(--ink); font-weight: 500; }
.steps .current .dot { box-shadow: inset 0 0 0 1.25px var(--ink); animation: breathe 1.8s ease-in-out infinite; }
.steps .failed { color: var(--red); font-weight: 500; }
.steps .failed .dot { background: var(--red); box-shadow: none; }
.sheet .console { max-height: 300px; min-height: 96px; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---- modal ------------------------------------------------------------------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: var(--scrim); animation: fade 0.18s ease both; }
.modal { width: min(520px, 100%); background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; display: grid; gap: 16px; animation: pop 0.3s var(--ease) both; }
.modal h2 { font: 600 20px/1.2 var(--display); letter-spacing: -0.02em; }
.modal .actions { justify-content: flex-end; margin-top: 4px; }
@keyframes pop { from { transform: scale(0.96) translateY(8px); opacity: 0; } }

#toasts { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 40; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 980px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); animation: pop 0.3s var(--ease) both; max-width: min(520px, calc(100vw - 32px)); }

/* ---- settings ---------------------------------------------------------------------- */
.settings { display: grid; gap: 16px; max-width: 620px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 22px; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting p { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.setting strong { font-weight: 500; }
/* ---- licences ---------------------------------------------------------------------- */
/* Vend search (administrator): what the vending machines were seen to sell. */
.vends-page { display: grid; gap: 14px; }
.vend-find { display: grid; gap: 12px; }
.vend-form { display: flex; gap: 8px; }
.vend-form .field { flex: 1 1 auto; min-width: 0; }
.vend-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.vend-head h2 { font-size: 16px; font-weight: 600; }
.vend-head h2 small { font-weight: 400; font-size: 12.5px; }
.vend-head p { font-size: 12.5px; margin-top: 2px; }
.vend-head > .vend-pic { width: 32px; height: 32px; transform: scale(1.5); margin: 8px; }
.vend-others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.vend-pic { display: block; flex: none; width: 32px; height: 32px; image-rendering: pixelated; background-repeat: no-repeat; border-radius: 4px; }
.vend-pic.none { background: var(--fill); }
.vends .row, .vends .list-head { grid-template-columns: minmax(190px, 1.6fr) minmax(96px, 0.7fr) minmax(130px, 1fr) 76px minmax(110px, 0.8fr) minmax(170px, 1.2fr); padding-top: 8px; padding-bottom: 8px; }
.vends .list-head { padding-top: 0; padding-bottom: 0; }
.vend-item { display: flex; align-items: center; gap: 10px; }
.vend-item > span { display: grid; min-width: 0; }
.vend-item strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.vend-item small { font-size: 11.5px; }
.vend-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.vends .link.mono { font-size: 12.5px; padding: 0; }
/* The price over time: one line in the page's own ink (the panel is monochrome), a wash under it, hairline grid. */
.vp { display: grid; gap: 14px; }
.vp[hidden] { display: none; }
.vp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; }
.vp-head h2 { font-size: 16px; font-weight: 600; }
.vp-head p { font-size: 12.5px; margin-top: 2px; max-width: 62ch; }
.vp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.vp-facts > div { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--fill); min-width: 0; }
.vp-facts small { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-facts strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vp-wrap { position: relative; }
.vp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.vp-grid, .vp-axis { stroke: var(--line); stroke-width: 1; }
.vp-tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.vp-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vp-wash { fill: var(--ink); opacity: 0.08; stroke: none; }
.vp-dot { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.vp-cross { stroke: var(--ink-3); stroke-width: 1; }
.vp-hit { fill: transparent; cursor: crosshair; }
.vp-tip { position: absolute; top: 4px; transform: translateX(-50%); display: grid; gap: 2px; padding: 8px 10px; border-radius: 9px; background: var(--card); box-shadow: var(--shadow); font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; }
.vp-tip strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.vp-tip[hidden], .vp-svg [hidden] { display: none; }
.vp-list { margin: 0 -22px; border-top: 1px solid var(--line); max-height: 320px; overflow: auto; }
.vp-list .row, .vp-list .list-head { grid-template-columns: minmax(150px, 1.4fr) repeat(5, minmax(84px, 1fr)) 64px; min-height: 40px; }
.vp-list .list-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
@media (max-width: 860px) {
  .vp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vp-list .row, .vp-list .list-head { grid-template-columns: minmax(110px, 1.3fr) repeat(2, minmax(80px, 1fr)); }
  .vp-list .row > :nth-child(n+4), .vp-list .list-head > :nth-child(n+4) { display: none; }
}
.vend-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 12.5px; }
.vend-pages { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vend-pages .btn.small { min-width: 34px; justify-content: center; font-variant-numeric: tabular-nums; }
.vend-gap { color: var(--ink-3); padding: 0 2px; }
.vend-walk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.vend-walk::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.vend-walk.yes { color: var(--ink); }
.vend-walk.yes::before { background: var(--green); }
.vend-walk.no::before { background: var(--red); }
@media (max-width: 860px) {
  .vends .list-head { display: none; }
  .vends .row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4px 12px; padding-top: 12px; padding-bottom: 12px; }
  .vend-form { flex-wrap: wrap; }
  .vend-form .field { flex-basis: 100%; }
}
.licenses-page { display: grid; gap: 14px; }
.lic-title { font-size: 15px; font-weight: 600; margin: 10px 2px -4px; }
.lic-new { display: grid; gap: 14px; }
.lic-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lic-form .wide { grid-column: span 3; }
.lic-go { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.lic-made { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 9px; background: var(--fill); margin-top: 6px; }
.lic-made .mono { font-size: 14px; user-select: all; }
.licenses .row, .licenses .list-head { grid-template-columns: minmax(210px, 1.3fr) minmax(110px, 0.6fr) minmax(170px, 1fr) minmax(90px, 0.6fr) 268px; padding-top: 10px; padding-bottom: 10px; }
.lic-users .row, .lic-users .list-head { grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(100px, 0.6fr) minmax(190px, 1.3fr); }
.licenses .list-head, .lic-users .list-head { padding-top: 0; padding-bottom: 0; }
.lic-key { user-select: all; white-space: normal; }
.lic-key small { display: block; font-family: var(--sans, inherit); color: var(--ink-2); font-size: 12px; user-select: none; }
.lic-state { font-weight: 500; }
.lic-state.active { color: var(--green); }
.lic-state.expired, .lic-state.revoked { color: var(--red); }
.lic-state.waiting { color: var(--amber); }
.state-cell.right { align-items: flex-end; text-align: right; }
@media (max-width: 900px) {
  .lic-form { grid-template-columns: 1fr 1fr; }
  .lic-form .wide { grid-column: span 2; }
  .licenses .row, .licenses .list-head { grid-template-columns: 1fr; gap: 4px; padding-top: 12px; padding-bottom: 12px; }
  .licenses .list-head, .lic-users .list-head { display: none; }
  .licenses .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .lic-users .row { grid-template-columns: 1fr 1fr; padding-top: 10px; padding-bottom: 10px; }
}
/* The Discord webhook under its heading: the address, what to do with it, which news. */
.wh { display: grid; gap: 10px; padding: 0 22px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.wh[hidden] { display: none; }
.wh .hint { margin: 0; }
.wh .switch-row p { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

/* ---- sign in ----------------------------------------------------------------------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(360px, 100%); display: grid; gap: 14px; text-align: center; }
.auth-card .moon { margin: 0 auto 6px; }
.auth-card h1 { font: 600 34px/1.05 var(--display); letter-spacing: -0.028em; }
.auth-card .lede { margin: 0 auto 10px; font-size: 15px; }
.auth-card form { display: grid; gap: 10px; text-align: left; }
.auth-card .field { height: 44px; font-size: 15px; border-radius: 12px; padding: 0 14px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }
.auth-switch { color: var(--ink-2); font-size: 13px; }

/* ---- small screens ----------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 10;
    flex-direction: row; align-items: center; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .brand, .nav .count, .who span:last-child { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 8px; }
  .nav a[aria-current="page"] { background: none; }
  .side-foot { margin: 0; }
  main { padding: 28px 16px 110px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-head h1 { font-size: 28px; }
  .cols { grid-template-columns: 1fr; }
  .toolbar .field { flex: 1; width: auto; }
  .bots .list-head, .proxies .list-head { display: none; }
  .bots .row { grid-template-columns: 20px minmax(0, 1fr) auto; row-gap: 0; padding: 10px 16px; }
  .bots .row .c-server, .bots .row .c-proxy, .bots .row .c-since { display: none; }
  .bots .row .c-state { grid-column: 2; grid-row: 2; }
  .bots .row .row-actions { grid-row: 1 / span 2; grid-column: 3; }
  .proxies .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 12px 16px; }
  .proxies .row .c-user, .proxies .row .c-bots { display: none; }
  .proxies .row .c-test { grid-column: 1 / -1; grid-row: 2; }
  .sheet { top: 40px; left: 0; right: 0; bottom: 0; width: auto; border-radius: 20px 20px 0 0; animation-name: rise; }
  .console.wide .ln { grid-template-columns: 60px minmax(0, 1fr); }
  .console.wide .who-bot { display: none; }
  #toasts { bottom: 84px; }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.file-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 4px; }
.file-row .hint { margin: 0; }

/* ---- the bot's panel: a stage for the world, a column for everything else ---- */
.sheet { left: 10px; width: auto; max-width: 1560px; margin-left: auto; }
.sheet-cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; flex: 1; min-height: 0; }
.sheet-stage { display: flex; flex-direction: column; gap: 12px; padding: 22px 0 22px 24px; min-width: 0; min-height: 0; }
.sheet-cols .sheet-scroll { border-left: 1px solid var(--line); margin-left: 22px; }
.warp { display: flex; gap: 8px; flex-wrap: wrap; }
.warp .field { flex: 1 1 180px; min-width: 0; text-transform: uppercase; }
.map-wrap { flex: 1; min-height: 0; display: grid; place-items: center; border-radius: 14px; background: hsl(215 30% 12%); overflow: hidden; }
#map { max-width: 100%; max-height: 100%; aspect-ratio: auto; image-rendering: pixelated; cursor: crosshair; display: block; }
#map[hidden], .stage-empty[hidden] { display: none; }
.stage-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 24px; color: var(--ink-2); margin: auto; }
.map-wrap .stage-empty { color: rgba(255, 255, 255, 0.72); }
.map-wrap .stage-empty h2 { color: #fff; }
.stage-empty h2 { font: 600 19px/1.2 var(--display); color: var(--ink); }
.tile-info { min-height: 44px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.tile-info small { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.tile-info em { font-style: normal; color: var(--ink-3); margin-left: 6px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.pad-row { display: flex; gap: 16px; align-items: center; }
.pad-row .hint { margin: 0; }
.dpad { display: grid; grid-template: repeat(3, 46px) / repeat(3, 46px); gap: 6px; flex: none; }
.pad-key { display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); cursor: pointer; transition: transform 0.08s, background 0.15s; }
.pad-key:hover { background: var(--fill-2); }
.pad-key:active { transform: scale(0.92); }
.pad-key.enter { background: var(--ink); color: var(--bg); border-radius: 50%; }
.pad-key.enter:hover { opacity: 0.86; background: var(--ink); }
@media (max-width: 1080px) {
  .sheet-cols { display: block; overflow: auto; }
  .sheet-stage { padding: 18px 16px 0; }
  .map-wrap { min-height: 220px; }
  .sheet-cols .sheet-scroll { border-left: 0; margin-left: 0; overflow: visible; padding: 18px 16px 24px; }
}
@media (max-width: 860px) { .sheet { left: 0; } }
#sheet-side { display: grid; gap: 22px; }
#sheet-side:empty, #sheet-more:empty { display: none; }

/* ---- state colours: green online, amber on the way, red stopped by a problem ---- */
.moon.online, .moon.verified { color: var(--green); }
.moon.busy, .moon.waiting, .moon.update { color: var(--amber); }
.moon.error { color: var(--red); }
.c-state.online > .cell, .c-state.verified > .cell { color: var(--green); }
.c-state.queued > .cell, .c-state.lookup > .cell, .c-state.relay > .cell, .c-state.connecting > .cell, .c-state.login > .cell, .c-state.waiting > .cell, .c-state.update > .cell { color: var(--amber); }
.c-state.error > .cell { color: var(--red); }
.ping { display: inline-flex; align-items: center; gap: 6px; }
.ping::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ping.good { color: var(--green); } .ping.fair { color: var(--amber); } .ping.poor { color: var(--red); }
/* ---- the side column's pages ---- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--fill); }
.tabs button { flex: 1; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 500 13px var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
[data-tab="control"] [data-pane]:not([data-pane="control"]), [data-tab="settings"] [data-pane]:not([data-pane="settings"]), [data-tab="log"] [data-pane]:not([data-pane="log"]) { display: none; }
[data-tab="log"] .console { max-height: none; min-height: 320px; }

/* ---- bot panel, second layout: a rail of pages on the left, one page at a time ---- */
.sheet-cols { grid-template-columns: 270px minmax(0, 1fr); }
.sheet-rail { display: flex; flex-direction: column; gap: 18px; padding: 22px 18px; border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
.sheet-rail .sheet-top h2 { font-size: 16px; }
.sheet-rail .tabs { flex-direction: column; background: none; padding: 0; gap: 2px; }
.sheet-rail .tabs button { flex: none; height: 38px; text-align: left; padding: 0 12px; font-size: 14px; }
.sheet-rail .tabs button[aria-selected="true"] { background: var(--fill-2); box-shadow: none; }
.sheet-page { padding: 22px 24px; overflow: auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.sheet-page.narrow { max-width: 640px; }
.sheet-page[data-pane="map"] { flex-direction: row; gap: 20px; overflow: hidden; }
.sheet-page[data-pane="map"] .sheet-stage { flex: 1; padding: 0; }
.sheet-move { width: 200px; flex: none; }
.sheet-move .pad-row { flex-direction: column; align-items: flex-start; }
.sheet-page[data-pane="log"] .console { flex: 1; max-height: none; min-height: 200px; }
[data-tab="map"] [data-pane]:not([data-pane="map"]), [data-tab="account"] [data-pane]:not([data-pane="account"]), [data-tab="settings"] [data-pane]:not([data-pane="settings"]), [data-tab="log"] [data-pane]:not([data-pane="log"]) { display: none; }
@media (max-width: 1080px) {
  .sheet-rail { border-right: 0; padding: 18px 16px 0; overflow: visible; }
  .sheet-rail .tabs { flex-direction: row; overflow-x: auto; }
  .sheet-rail .tabs button { white-space: nowrap; }
  .sheet-page, .sheet-page[data-pane="map"] { flex-direction: column; overflow: visible; padding: 16px; }
  .sheet-move { width: auto; }
  .sheet-move .pad-row { flex-direction: row; align-items: center; }
}

/* ---- map page side: pad, speed, account ---- */
.sheet-move { width: 250px; display: flex; flex-direction: column; gap: 22px; overflow: auto; }
.speed { display: grid; gap: 6px; width: 100%; font-size: 12px; color: var(--ink-2); }
.speed .seg { display: grid; grid-template-columns: repeat(8, 1fr); }
.speed .seg button { padding: 0; min-width: 0; }
[data-tab="console"] [data-pane]:not([data-pane="console"]) { display: none; }
/* ---- the game's console, in the game's colours ---- */
.gt-console { flex: 1; min-height: 240px; overflow: auto; padding: 14px 16px; border-radius: 14px; background: #0f2b3d; color: #fff; font: 600 13.5px/1.55 "Century Gothic", "Avenir Next", var(--sans); }
.gt-console .none { color: rgba(255, 255, 255, 0.6); font-weight: 400; }
.gt-line { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 1px 0; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55); overflow-wrap: anywhere; }
.gt-line time { color: rgba(255, 255, 255, 0.4); font: 400 11px/1.9 var(--mono); text-shadow: none; }
.gt-dialog { display: inline-grid; gap: 6px; margin: 6px 0; padding: 12px 14px; max-width: 520px; border: 2px solid #5fc7e8; border-radius: 10px; background: #145a7c; }
.gt-dialog .d-title { font-size: 16px; }
.gt-dialog .d-text { font-weight: 500; }
.gt-dialog .d-button { display: inline-block; padding: 3px 12px; border-radius: 6px; background: #0e3f58; border: 1px solid #5fc7e8; width: fit-content; }
.gt-dialog .d-input { padding: 3px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.3); }
.gt-dialog .d-space { height: 4px; }
.chip i.spr { width: 16px; height: 16px; border-radius: 0; background-size: 512px 512px; image-rendering: pixelated; }
.map-wrap { background: hsl(205 60% 74%); }

/* ---- console page: tabs, the console, and dialogs that can be answered ---- */
.gt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gt-head h3, .sheet-page[data-pane="console"] > h3 { margin: 0; }
.sheet-page[data-pane="console"] .gt-console { flex: 1 1 40%; min-height: 160px; }
.gt-dialogs { flex: 1 1 60%; min-height: 180px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-content: start; padding: 14px; border-radius: 14px; background: #0f2b3d; color: #fff; font: 600 13.5px/1.5 "Century Gothic", "Avenir Next", var(--sans); }
.gt-dialogs .none { color: rgba(255, 255, 255, 0.6); font-weight: 400; margin: 0; }
.gt-dialogs .gt-dialog { display: grid; margin: 0; max-width: none; max-height: 420px; overflow: auto; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); overflow-wrap: anywhere; }
.gt-dialog > time { color: rgba(255, 255, 255, 0.45); font: 400 11px var(--mono); text-shadow: none; }
.gt-dialog .d-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; position: sticky; bottom: -12px; padding: 8px 0 4px; background: #145a7c; }
.gt-dialog button.d-button { color: #fff; font: inherit; cursor: pointer; }
.gt-dialog button.d-button:hover { background: #0a2f43; }
.gt-dialog button.d-button.ok { background: #1f7d3a; border-color: #7be08f; }
.gt-dialog .d-input { display: grid; gap: 4px; background: none; padding: 0; }
.gt-dialog .d-input input { height: 30px; border-radius: 6px; border: 1px solid #5fc7e8; background: rgba(0, 0, 0, 0.35); color: #fff; padding: 0 8px; font: inherit; }
.gt-dialog .d-check { display: flex; gap: 8px; align-items: center; }

/* ---- chat box, world menu, players ---- */
.say { display: flex; gap: 8px; }
.say .field { flex: 1; min-width: 0; }
.gt-head .actions { gap: 6px; }
.stage-empty.menu { align-content: start; width: 100%; max-height: 100%; overflow: auto; }
.world-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; max-width: 900px; margin-top: 10px; }
.world-chip { display: grid; gap: 2px; padding: 10px 12px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.32); color: #fff; text-align: left; cursor: pointer; font: inherit; }
.world-chip:hover { background: rgba(0, 0, 0, 0.5); }
.world-chip b { font-weight: 600; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; }
.world-chip span { font-size: 12px; opacity: 0.75; }
.world-list p { grid-column: 1 / -1; }

/* ---- packs and items ---- */
[data-tab="packs"] [data-pane]:not([data-pane="packs"]), [data-tab="items"] [data-pane]:not([data-pane="items"]) { display: none; }
.pack-list, .bag, .item-results { overflow: auto; min-height: 0; }
.pack-list { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; align-content: start; }
.pack { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.pack.first { box-shadow: inset 0 0 0 1px var(--line); background: var(--fill-2); }
.pack b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack span { font-size: 12px; color: var(--ink-2); }
.pack .field { height: 30px; padding: 0 8px; text-align: center; }
.bag { flex: 1 1 45%; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; align-content: start; }
.bag-item { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ink); cursor: pointer; font: inherit; }
.bag-item:hover { background: var(--fill-2); }
.bag-item b { position: absolute; top: 6px; right: 8px; font: 600 12px var(--mono); }
.bag-item span { font-size: 11px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-results { flex: 1 1 40%; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; align-content: start; }
.item-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--fill); }
.item-row b { display: block; font-weight: 600; }
.item-row span { font-size: 12px; color: var(--ink-2); }
i.spr { display: block; flex: none; image-rendering: pixelated; border-radius: 4px; }
.pack-list .none, .bag .none, .item-results .none { grid-column: 1 / -1; color: var(--ink-3); }
#pack-run .btn { margin-left: 8px; }

/* ---- inventory as a table: item, amount, actions ---- */
.bag { display: block; }
.bag-head, .bag-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 12px; align-items: center; padding: 6px 10px; }
.bag-head { position: sticky; top: 0; background: var(--card); font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.bag-row { border-bottom: 1px solid var(--line); }
.bag-row b { font: 600 13px var(--mono); }
.bag-name { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; padding: 0; }
.bag-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-row .actions { gap: 4px; flex-wrap: nowrap; }
.worn { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
@media (max-width: 860px) { .bag-head, .bag-row { grid-template-columns: minmax(0, 1fr) 44px; } .bag-row .actions { grid-column: 1 / -1; flex-wrap: wrap; } .bag-head span:last-child { display: none; } }

/* ---- map click modes, world tables ---- */
.seg.mode { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-bottom: 8px; }
.seg.mode button { padding: 0; }
.pace .seg { grid-template-columns: repeat(3, 1fr); }
.reach .seg { grid-template-columns: repeat(5, 1fr); }
.reach { margin-top: 8px; }
.actions.quick { margin-top: 10px; gap: 6px; }
.tick { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; cursor: pointer; }
.tick input { margin-top: 3px; flex: none; }
.tick span { color: var(--ink-2); }
.tick strong { color: var(--ink); font-weight: 600; }
.line-room { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; font-size: 13px; }
.line-room > span { font-weight: 500; }
.line-room .hint { flex: 1 1 320px; margin: 0; }
.farm-grid { display: grid; grid-template-columns: repeat(5, 34px); gap: 5px; padding: 12px 0 8px; }
.farm-tile, .farm-me { width: 34px; height: 34px; border-radius: 8px; }
.farm-tile { border: 0; background: var(--fill); cursor: pointer; transition: background 0.15s var(--ease); }
.farm-tile:hover { background: var(--fill-2); }
.farm-tile[aria-pressed="true"] { background: var(--ink); }
.farm-tile:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.farm-me { display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.trash-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.trash-list .hint { margin: 0; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 0; border-radius: 13px; background: var(--fill); color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip-x em { font-style: normal; color: var(--ink-3); }
.chip-x:hover { background: var(--fill-2); }
.wt-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.wt-row .bad { color: var(--red); font: 600 12px/1 inherit; font-family: inherit; }
#place-item { width: 100%; margin-bottom: 8px; }
#place-item[hidden] { display: none; }
[data-tab="world"] [data-pane]:not([data-pane="world"]) { display: none; }
.wt { flex: 1 1 50%; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; align-content: start; }
.wt-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--fill); }
.wt-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-row em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.wt-row b { font: 600 13px var(--mono); }
.wt .none { grid-column: 1 / -1; color: var(--ink-3); }
.bag-head, .bag-row { grid-template-columns: minmax(0, 1fr) 60px 330px; }
.bag-row .actions { justify-content: flex-end; }
.bag-head span:last-child { text-align: right; }

/* ---- items page: search on top, bag, then matches from the whole game; pack pictures ---- */
.sheet-page[data-pane="items"] .bag { flex: 1 1 0; min-height: 120px; }
.sheet-page[data-pane="items"] .item-results { flex: 0 1 44%; min-height: 120px; }
.item-results[hidden], #item-results-head[hidden] { display: none; }
.pack { grid-template-columns: 64px minmax(0, 1fr) 64px auto; }
.pack-art { display: block; width: 64px; height: 40px; border-radius: 6px; background-color: var(--fill-2); background-repeat: no-repeat; }
.pack-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.wt.short { flex: 0 0 auto; max-height: 30%; }

/* ---- picking bots for the same action ---- */
.pick { display: grid; place-items: center; width: 22px; height: 22px; margin: -2px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; position: relative; }
.pick:hover { background: var(--fill-2); }
.list-head .pick::after, .pick.on::after { content: ""; position: absolute; inset: 3px; border-radius: 5px; border: 1.5px solid var(--ink-3); }
.pick.on::after { border-color: var(--ink); background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat; }
.row .pick.on .moon { visibility: hidden; }
.row.picked { background: var(--fill); }
.pickbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--fill-2); }
.pickbar[hidden] { display: none; }
.pickbar .field { width: 170px; height: 30px; text-transform: uppercase; }
.pickbar strong { margin-right: 6px; }

/* ---- automations --------------------------------------------------------------------- */
.autos { display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.au-nav { display: grid; gap: 2px; padding: 10px; }
.au-link { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; transition: background 0.15s var(--ease), color 0.15s; }
.au-link:hover { background: var(--fill); color: var(--ink); }
.au-link[aria-current="page"] { background: var(--fill-2); color: var(--ink); font-weight: 600; }
.au-link .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--fill); color: var(--ink); }
.au-link[aria-current="page"] .au-ico { background: var(--ink); color: var(--card); }
.au-ico.big { width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: var(--card); }
.au-ico.big svg { width: 22px; height: 22px; }
.au-count { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.au-count:empty { display: none; }
.au-main { display: grid; gap: 16px; min-width: 0; }
.au-card { display: grid; gap: 18px; }
.au-card > h2 { margin: 0; }
.au-head { display: flex; align-items: center; gap: 16px; }
.au-head h2 { font-size: 19px; margin: 0 0 3px; }
.au-head .hint { max-width: 62ch; font-size: 13px; line-height: 1.45; }
.au-form { border-top: 1px solid var(--line); padding-top: 4px; }
.au-go { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.au-find { width: 250px; height: 34px; padding: 0 12px; flex: none; }
.au-find.wide { width: 100%; }
.au-hits { padding: 0; }
.au-hits:not(:empty) { padding: 0 0 12px; }
.au-hits .chip-x { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.au-hits .chip-x:hover { background: var(--fill); }
.au-tiles { display: flex; align-items: flex-start; gap: 26px; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.au-tiles .farm-grid { flex: none; padding: 0; }
.au-tiles-side { display: grid; gap: 8px; justify-items: start; }
.au-tiles-side strong { font-weight: 500; }
.au-tiles-side .hint { max-width: 40ch; }
.au-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.au-gap { margin-top: 10px; }
.sc-bot .tag.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-weight: 600; }
@media (max-width: 1180px) {
  .autos { grid-template-columns: minmax(0, 1fr) 250px; }
  .autos > .au-nav { grid-column: 1 / -1; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; align-items: center; }
  .autos > .au-nav .au-group { margin: 0 4px 0 12px; }
  .autos > .au-nav .au-group:first-child { margin-left: 4px; }
}
@media (max-width: 860px) {
  .autos { grid-template-columns: minmax(0, 1fr); }
  .au-tiles { flex-direction: column; gap: 14px; }
  .au-find { width: 100%; flex: 1; }
}

.au-route { display: grid; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.au-route > div > strong { font-weight: 500; }
.au-stops { display: grid; gap: 4px; }
.au-stop { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 6px 0 10px; border-radius: 10px; background: var(--well); font-size: 13px; }
.au-stop .num { width: 16px; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.au-stop b { font-weight: 600; letter-spacing: 0.01em; }
.au-stop .muted:last-of-type { flex: 1; text-align: right; }
.au-stop .icon-btn { width: 26px; height: 26px; font-size: 16px; line-height: 1; }
.au-farms { max-height: 232px; overflow-y: auto; }
.au-farms .au-stop { padding-right: 10px; }
.au-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.au-add .field { flex: 1 1 140px; min-width: 0; height: 34px; padding: 0 12px; }
.au-add select.field { padding-right: 30px; background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.icon-btn[disabled] { opacity: 0.35; pointer-events: none; }
#sw-box[hidden] { display: none; }
/* The farm world the builder makes, in small: rows of blocks with rows left for seeds. */
.au-plan { display: grid; gap: 3px; width: 210px; padding: 12px 0 4px; }
.au-plan i { display: block; height: 9px; margin: 0 12px; border-radius: 3px; }
.au-plan .plan-blocks { background: var(--ink); }
.au-plan .plan-seeds { background: repeating-linear-gradient(90deg, var(--green) 0 3px, transparent 3px 12px); opacity: 0.55; height: 7px; }
.au-group { margin: 10px 10px 4px; font: 600 11.5px/1.2 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.au-group:first-child { margin-top: 4px; }
/* A bot's settings that are set like automations, in its Ayarlar. */
.sheet-settings { display: grid; gap: 22px; align-content: start; }
.bs-item + .bs-item { border-top: 1px solid var(--line); }
.bs-form { padding: 0 0 12px; }
.switch-row .seg { flex: none; }
.switch-row .seg button { white-space: nowrap; }
.bs-form .switch-row { padding-top: 2px; }
.bs-more { display: grid; gap: 10px; }
.bs-more h2 { font: 500 13px/1.2 var(--sans); margin: 0; }
.bs-form .au-find { width: 220px; }
.bs-form .au-find.wide { width: 100%; }
.bs-foot { margin-top: 10px; }
.bs-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* A bot's own automations, in its window. */
[data-tab="autos"] [data-pane]:not([data-pane="autos"]) { display: none; }
.bau-nav { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.bau-tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 5px; border: 0; border-radius: 11px; background: none; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; transition: background 0.15s var(--ease), color 0.15s; }
.bau-tab:hover { background: var(--fill); color: var(--ink); }
.bau-tab[aria-selected="true"] { background: var(--fill-2); color: var(--ink); font-weight: 600; }
.bau-tab .au-ico { width: 28px; height: 28px; border-radius: 8px; }
.bau-tab[aria-selected="true"] .au-ico { background: var(--ink); color: var(--card); }
.bau-tab:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.bau-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; transition: background 0.2s; }
.bau-dot.on { background: var(--green); }
.bau-body { display: grid; gap: 14px; }
.bau-body .au-head h2 { font: 600 19px/1.2 var(--display); letter-spacing: -0.012em; margin: 0 0 3px; }
.bau-on { padding: 14px 16px; border-radius: 14px; background: var(--well); }
.bau-more { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.bau-more h2 { font: 600 15px/1.2 var(--display); margin: 0; }
.bau-body .au-find { width: 220px; }
.bau-body .au-find.wide { width: 100%; }
.bau-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---- scripts ------------------------------------------------------------------------- */
.scripts { display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.sc-main { display: grid; gap: 16px; min-width: 0; }
.sc-side { display: grid; gap: 12px; align-content: start; }
.sc-side h2, .sc-main h2 { margin: 0; }
.sc-side .btn { justify-self: start; }
.sc-saved, .sc-bots { display: grid; gap: 2px; max-height: 60vh; overflow: auto; margin: 0 -8px; }
.sc-item, .sc-bot { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sc-item:hover, .sc-bot:hover { background: var(--fill); }
.sc-item.on { background: var(--fill-2); font-weight: 600; }
.sc-sub { margin-top: 8px; }
.file-view { max-height: 50vh; overflow: auto; padding: 12px; border-radius: 10px; background: var(--fill); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-item.ex { color: var(--ink-2); }
.sc-item.ex:hover { color: inherit; }
.sc-item span, .sc-bot .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.sc-bot .pick { flex: none; margin: 0; pointer-events: none; }
.sc-bot.head { color: var(--ink-2); font-size: 12.5px; }
.sc-bot.head .pick::after { content: ""; position: absolute; inset: 3px; border-radius: 5px; border: 1.5px solid var(--ink-3); }
.sc-bot .tag { flex: none; font-size: 11.5px; color: var(--ink-2); padding: 1px 7px; border-radius: 999px; background: var(--fill-2); }
.sc-bar, .sc-run { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-bar .btn[hidden] { display: none; }
.sc-bar .field { flex: 1 1 220px; max-width: 360px; height: 32px; padding: 0 12px; }
.sc-bar .spacer { flex: 1; }
textarea.field.sc-code { display: block; width: 100%; min-height: 46vh; margin: 12px 0; padding: 14px 16px; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; font-size: 13px; line-height: 1.65; }
.sc-out { min-height: 120px; max-height: 38vh; }
.console .ln.jump { cursor: pointer; }
.console .ln.jump:hover .tx { text-decoration: underline; }
@media (max-width: 1180px) {
  .scripts { grid-template-columns: minmax(0, 1fr) 250px; }
  .scripts > .sc-side:first-child { grid-column: 1 / -1; }
  .sc-saved { max-height: 150px; }
}
@media (max-width: 860px) {
  .scripts { grid-template-columns: minmax(0, 1fr); }
  .sc-bots { max-height: 220px; }
  textarea.field.sc-code { min-height: 300px; }
}

/* ---- small screens and touch -------------------------------------------------------
   Kept last on purpose: several rules further up are written after the breakpoint that
   was meant to undo them (the map page's side stayed 250px wide on a phone and cut its
   own content off), so what a small screen needs is said once more here, where nothing
   takes it back. Checked at 375, 768 and 1024px wide. */

/* The bot window stacks from here down: its side goes under the map, as wide as the page. */
@media (max-width: 1080px) {
  .sheet-move { width: auto; overflow: visible; }
  .sheet-move .pad-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sheet-move .pad-row .speed { flex: 1 1 240px; width: auto; }
  .sheet-page { min-width: 0; }
  .sheet-page > *, .sheet-rail > * { min-width: 0; max-width: 100%; }
  /* The window's pages are a strip that scrolls sideways; its end fades so that it is
     seen to go on, and the chosen page is brought into view (`sheet-tab`). */
  .sheet-rail .tabs { scroll-snap-type: x proximity; scrollbar-width: none; padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .sheet-rail .tabs::-webkit-scrollbar { display: none; }
  .sheet-rail .tabs button { flex: none; padding: 0 14px; scroll-snap-align: start; }
  /* Nothing pushes the window sideways: a row of choices scrolls inside itself, lists
     take one column, a long word breaks. */
  .gt-head .seg, .sheet-page .seg:not(.mode) { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .gt-head .seg::-webkit-scrollbar, .sheet-page .seg::-webkit-scrollbar { display: none; }
  .gt-head .seg button, .sheet-page .seg:not(.mode) button { flex: none; }
  .gt-dialogs, .pack-list { grid-template-columns: minmax(0, 1fr); }
  .sheet .switch-row > div, .sheet .setting > div { min-width: 0; overflow-wrap: anywhere; }
  .sheet .kv dd { min-width: 0; }
  /* The window itself scrolls here: a list inside it is as long as it is, and does not
     shrink to one line with a scroll bar of its own. */
  .sheet-page .bag, .sheet-page .pack-list, .sheet-page .item-results { overflow: visible; flex: none; }
  .sheet-page .bag-head { position: static; }
}

@media (max-width: 860px) {
  /* The page is as wide as the screen, whatever stands in it (a long key, a wide form). */
  .shell { grid-template-columns: minmax(0, 1fr); }
  main { min-width: 0; }
  main > *, .card > * { min-width: 0; }
  /* Movement on a phone: the pad in the middle, then the two rows of choices at full width. */
  .sheet-move .pad-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .sheet-move .pad-row .speed { flex: none; }
  .sheet-move .dpad { align-self: center; grid-template: repeat(3, 54px) / repeat(3, 54px); gap: 8px; }
  .sheet-move .actions.quick { gap: 8px; }
  .sheet-top { flex-wrap: wrap; }
  /* A setting whose choice is a row of buttons: the row goes under its text, at full width. */
  .switch-row:has(> .seg) { flex-wrap: wrap; gap: 10px; }
  .switch-row:has(> .seg) > .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  .switch-row:has(> .seg) > .seg button { padding: 0; }
  /* A bag row: the item and how many, and under them what can be done with it. */
  .bag-head, .bag-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bag-row .actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; }
  /* The bar at the bottom: every page gets the same room. With more pages than fit with
     their names (the administrator's), only the open page says its name. */
  .side { padding-left: 4px; padding-right: 4px; }
  .nav { justify-content: stretch; min-width: 0; }
  .nav a { flex: 1 1 0; min-width: 0; padding: 6px 2px; align-items: center; text-align: center; }
  .nav a span:not(.count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav:has(a:nth-child(7)) a:not([aria-current="page"]) span:not(.count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav:has(a:nth-child(7)) a { min-height: 44px; justify-content: center; }
  .nav:has(a:nth-child(7)) a[aria-current="page"] { flex: 0 0 auto; padding: 6px 10px; }
  /* A machine on a phone: item and price, world and tile, then whether it can be walked
     to, and under it when it was seen - in full. */
  .vends .row > .cell:nth-child(6) { grid-column: 1 / -1; white-space: normal; }
  .who { padding: 7px 8px; }
  /* A field that is typed into at less than 16px makes a phone zoom the whole page in. */
  .field:not(.sc-code), .modal .field, .gt-dialog .d-input input { font-size: 16px; }
  .modal-wrap { padding: 12px; align-items: end; }
  .modal { padding: 20px; max-height: calc(100dvh - 24px); overflow: auto; }
  .modal .actions { position: sticky; bottom: -20px; padding: 10px 0; margin-bottom: -10px; background: var(--card); }
}

/* Fingers: what is pressed is at least about 36px high, and small marks answer around
   themselves as well (the mark keeps its size; the room around it is what grows). */
@media (max-width: 860px), (pointer: coarse) {
  .btn.small { height: auto; min-height: 36px; padding: 0 14px; font-size: 13px; }
  .seg button { height: 34px; }
  .tabs button { height: 36px; }
  .sheet-rail .tabs button { height: 38px; }
  .chip-x { height: 32px; padding: 0 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .switch::before, .pick::before, .sky-grid button::before { content: ""; position: absolute; }
  .switch::before { inset: -9px -6px; }
  .pick::before { inset: -11px; }
  .sky-grid { grid-template-columns: repeat(auto-fill, 24px); gap: 14px; }
  .sky-grid button { position: relative; width: 24px; height: 24px; }
  .sky-grid button::before { inset: -7px; }
  .vends .link.mono, .sheet a[data-action] { display: inline-block; padding: 8px 0; }
  .vend-pages .btn.small { min-width: 38px; }
  .d-button { min-height: 34px; }
  .bag-name { min-height: 36px; }
}

/* A small laptop or half a screen (861-1180px): the lists were laid out for more room
   than is left beside the menu, and the buttons at the end of a row were cut off. The
   columns share what room there is, the least needed one goes, and nothing is cut. */
@media (min-width: 861px) and (max-width: 1180px) {
  main { padding-left: 28px; padding-right: 28px; }
  .bots .row, .bots .list-head { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) 52px 88px; }
  .bots .row .c-server, .bots .list-head > :nth-child(4) { display: none; }
  .proxies .row, .proxies .list-head { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.6fr) minmax(0, 1.8fr) 40px auto; }
  .licenses .row, .licenses .list-head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 0.7fr); row-gap: 8px; }
  .licenses .row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .licenses .list-head > :nth-child(5) { display: none; }
  .vends .row, .vends .list-head { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 1fr) 64px minmax(0, 0.9fr) minmax(0, 1.2fr); }
  .vp-list .row, .vp-list .list-head { grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr)) 56px; }
}

/* The automations' menu is a strip that scrolls sideways below 1180px: its end fades, so
   that it is seen to go on, and its own scroll bar is put away. */
@media (max-width: 1180px) {
  .autos > .au-nav { scrollbar-width: none; scroll-snap-type: x proximity; padding-right: 30px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .autos > .au-nav::-webkit-scrollbar { display: none; }
  .autos > .au-nav .au-link { scroll-snap-align: start; }
}

/* A field with buttons beside it, on a phone: the field takes the line (an address was cut
   to a few letters next to three buttons), the buttons go under it. */
@media (max-width: 560px) {
  .au-add > .field, .au-add > input.field, .au-add > select.field { flex: 1 1 100%; height: 40px; }
  .vend-form .field { height: 44px; }
}
