/* ---------------------------------------------------------------------------
   GamePanel — "Control room"

   Dark, calm surfaces with one lime signal colour. Status is shown the way a
   rack shows it: small lit LEDs and tabular numbers. Everything is driven by
   the tokens below, so the light theme only redefines tokens.

   Sections: tokens · base · forms · buttons · shell · page parts · data ·
   server · files · cards & chips · modal · feedback · utilities
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  --bg: #111210;
  --sidebar: #141513;
  --surface: #191a17;
  --raised: #20211e;
  --hover: #262723;
  --border: #2c2d29;
  --border-strong: #3a3b36;
  --inset: #0c0d0b;

  --text: #ecebe6;
  --muted: #a19f96;
  --faint: #6f6d66;

  --lime: #c6f432;
  --lime-ink: #111210;
  --lime-text: #c6f432;
  --lime-soft: rgba(198, 244, 50, 0.1);
  --lime-glow: 0 0 10px rgba(198, 244, 50, 0.55);
  --amber: #ffb340;
  --amber-soft: rgba(255, 179, 64, 0.12);
  --red: #ff5f57;
  --red-soft: rgba(255, 95, 87, 0.12);
  --blue: #6cb6ff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-width: 232px;
  --topbar-height: 52px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Older names some markup still uses. */
  --accent: var(--lime);
  --warning: var(--amber);
  --danger: var(--red);
  --success: var(--lime);
  --text-secondary: var(--muted);
  --text-tertiary: var(--faint);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f2ed;
  --sidebar: #ebeae4;
  --surface: #ffffff;
  --raised: #f5f4ef;
  --hover: #ecebe5;
  --border: #dcdbd3;
  --border-strong: #c9c8bf;
  --inset: #1a1b18;

  --text: #1b1c18;
  --muted: #5d5b53;
  --faint: #8c8a81;

  --lime: #c6f432;
  --lime-ink: #1b1c18;
  --lime-text: #4f6e00;
  --lime-soft: rgba(120, 160, 0, 0.12);
  --lime-glow: 0 0 6px rgba(120, 160, 0, 0.45);
  --amber: #b86e00;
  --amber-soft: rgba(184, 110, 0, 0.1);
  --red: #d63a32;
  --red-soft: rgba(214, 58, 50, 0.09);
  --shadow: 0 20px 50px -24px rgba(30, 30, 20, 0.3);
}

/* ------------------------------------------------------------------ base */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lime-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

svg {
  flex-shrink: 0;
}

::selection {
  background: var(--lime);
  color: var(--lime-ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-strong);
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--raised);
}

/* ----------------------------------------------------------------- forms */

form label,
label.field,
label:not([class]):not([for]) {
  display: block;
  margin-bottom: 14px;
}
/* A field right after a row of checkboxes needs its own breathing room. */
.checkbox-row + label:not([class]) {
  margin-top: 14px;
}
/* The last field of a form-grid sits on the grid's own bottom edge. */
.form-grid + .btn,
.form-grid + button {
  margin-top: 2px;
}

form label > span,
.field-label,
label > span:first-child {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: #fff;
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input[disabled],
textarea[disabled],
select[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--lime);
  flex-shrink: 0;
  cursor: pointer;
}
textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: var(--faint);
  margin-top: 6px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 2px;
}
.checkbox-row input {
  margin-top: 2px;
}
.checkbox-row label {
  margin: 0;
  color: var(--text);
  cursor: pointer;
}

.input-row {
  display: flex;
  gap: 8px;
}
.input-row input {
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible,
.chip:focus-visible,
.icon-btn:focus-visible,
.tab:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lime-ink);
  font-weight: 600;
}
.btn-primary:hover {
  background: #d4ff4f;
  border-color: #d4ff4f;
}

.btn-danger {
  color: var(--red);
}
.btn-danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--hover);
  border-color: transparent;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  gap: 5px;
}
.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--hover);
}

/* ----------------------------------------------------------------- shell */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-height);
  padding: 0 16px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
}
.sidebar-close {
  display: none;
  margin-left: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 10px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav-item:hover {
  color: var(--text);
  background: var(--hover);
  text-decoration: none;
}
.nav-item.active {
  color: var(--text);
  background: var(--raised);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
}
.nav-item svg {
  opacity: 0.8;
}
.nav-item.active svg {
  color: var(--lime-text);
  opacity: 1;
}

.sidebar-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-heading,
.label-caps {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.sidebar-heading {
  display: flex;
  align-items: center;
  padding: 6px 10px 8px;
}
.sidebar-server {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.sidebar-server:hover {
  color: var(--text);
  background: var(--hover);
  text-decoration: none;
}
.sidebar-server.active {
  color: var(--text);
  background: var(--raised);
}
.sidebar-server .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-empty {
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--faint);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.host-mini {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.host-mini-row {
  display: grid;
  grid-template-columns: 34px 1fr 38px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.host-mini-row .label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.host-mini-row .value {
  font-family: var(--mono);
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
}
.user-meta {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-weight: 550;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  font-size: 11.5px;
  color: var(--faint);
}

.sidebar-backdrop {
  display: none;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-btn {
  display: none;
}
.crumbs {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--text);
  text-decoration: none;
}
.crumbs .sep {
  color: var(--faint);
  margin: 0 6px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* The bell: recent events, unread count, pop-up switch. */
.bell-wrap {
  position: relative;
}
#bell-btn {
  position: relative;
}
.bell-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font: 600 10px/16px var(--mono);
  text-align: center;
  color: var(--lime-ink);
  background: var(--lime);
  border-radius: 99px;
}
.bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.bell-head b {
  margin-right: auto;
}
.bell-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.bell-toggle input {
  width: auto;
  margin: 0;
}
.bell-list {
  overflow-y: auto;
}
.bell-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.bell-item:last-child {
  border-bottom: 0;
}
a.bell-item[href]:hover {
  background: var(--hover);
  text-decoration: none;
}
.bell-text {
  display: grid;
  gap: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bell-text .faint {
  font-size: 11px;
}
.bell-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--faint);
}
.bell-item.unread .bell-dot {
  background: var(--lime);
}
.bell-item.unread.warn .bell-dot {
  background: var(--amber);
}
.bell-item.unread.error .bell-dot {
  background: var(--red);
}
@media (max-width: 640px) {
  .bell-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 6px);
    right: 12px;
  }
}

.conn-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  height: 26px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 99px;
}
.conn-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}
.conn-dot::after {
  content: "Offline";
}
.conn-dot.online {
  color: var(--muted);
}
.conn-dot.online::before {
  background: var(--lime);
  box-shadow: var(--lime-glow);
}
.conn-dot.online::after {
  content: "Live";
}

.view {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

/* ------------------------------------------------------------ page parts */

.page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 24px;
  letter-spacing: -0.025em;
}
.page-head .lede {
  color: var(--muted);
  margin-top: 2px;
  font-size: 13.5px;
}
.page-head .spacer,
.spacer {
  flex: 1;
}

.section-title {
  font-size: 15px;
  margin: 28px 0 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.card h4::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--lime);
}
.card > p:first-of-type {
  margin-top: 0;
}
.card-flush {
  padding: 0;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head h4 {
  margin: 0;
}

.stack {
  display: grid;
  gap: 16px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.split > *,
.stack > * {
  min-width: 0;
}

/* ------------------------------------------------------------------ data */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 132px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tile-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.tile-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  margin-top: 4px;
}
.tile-value .unit {
  font-size: 0.55em;
  color: var(--faint);
  margin-left: 3px;
  letter-spacing: 0;
}
.tile-sub {
  font-size: 12px;
  color: var(--muted);
}
.tile canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 44px;
}
.metrics.compact .tile {
  min-height: 0;
  padding: 11px 14px;
}
.metrics.compact .tile-value {
  font-size: 18px;
}

.meter {
  display: block;
  height: 4px;
  margin-top: auto;
  border-radius: 4px;
  background: var(--raised);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
  transition: width 0.4s var(--ease);
}
.meter.accent > i,
.meter.success > i {
  background: var(--lime);
}
.meter.warning > i {
  background: var(--amber);
}
.meter.danger > i {
  background: var(--red);
}

/* Status: an LED and a word. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.status .dot,
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.status.running {
  color: var(--text);
}
.status.running .dot,
.led.on {
  background: var(--lime);
  box-shadow: var(--lime-glow);
}
.status.starting .dot,
.status.stopping .dot,
.status.installing .dot,
.led.busy {
  background: var(--amber);
  animation: blink 1.1s steps(2, start) infinite;
}
.status.crashed,
.status.install_failed {
  color: var(--red);
}
.status.crashed .dot,
.status.install_failed .dot,
.led.bad {
  background: var(--red);
}
@keyframes blink {
  to {
    opacity: 0.3;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  white-space: nowrap;
}
.badge.accent,
.badge.admin {
  color: var(--lime-text);
  background: var(--lime-soft);
  border-color: transparent;
}
.badge.warn-badge,
.badge.warn {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: transparent;
}
.badge.bad {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
tr:last-child td,
tr:last-child th {
  border-bottom: 0;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--hover) 50%, transparent);
}
.table-wrap {
  overflow-x: auto;
}
.card table td:first-child,
.card table th:first-child {
  padding-left: 0;
}
.card table td:last-child,
.card table th:last-child {
  padding-right: 0;
}
/* Edge-to-edge tables still need breathing room at the card's edges. */
.card-flush table td:first-child,
.card-flush table th:first-child {
  padding-left: 18px;
}
.card-flush table td:last-child,
.card-flush table th:last-child {
  padding-right: 18px;
}

/* --------------------------------------------------------------- servers */

.srv-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.srv-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.4fr) 110px 70px 110px 80px 70px minmax(170px, auto);
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.srv-row:last-child {
  border-bottom: 0;
}
.srv-row:hover {
  background: color-mix(in srgb, var(--hover) 45%, transparent);
}
.srv-head {
  padding-top: 9px;
  padding-bottom: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.srv-head:hover {
  background: none;
}
.srv-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
}
.srv-identity:hover {
  text-decoration: none;
}
.srv-identity:hover .title {
  color: var(--lime-text);
}
.srv-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 18px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.srv-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.srv-name .title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srv-name .sub {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srv-name .ver {
  color: var(--muted);
}
.srv-metric {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.srv-metric b {
  font-weight: 500;
  color: var(--text);
}
.srv-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.address {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 8px;
  color: var(--muted);
  background: var(--raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: copy;
}
.address:hover {
  color: var(--text);
  border-color: var(--lime);
}
.address.copied {
  color: var(--lime-ink);
  background: var(--lime);
  border-color: var(--lime);
}

/* Server header: name, status and power in one strip. */
.srv-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.srv-header .srv-icon {
  width: 46px;
  height: 46px;
  font-size: 23px;
}
.srv-header h1 {
  font-size: 20px;
}
.srv-header .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.tabs {
  display: flex;
  gap: 2px;
  margin: 18px 0 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  position: relative;
  padding: 9px 13px 11px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
  text-decoration: none;
}
.tab.active {
  color: var(--text);
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--lime);
}

.console-wrap {
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.console {
  height: 520px;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #d9d8d0;
  white-space: pre-wrap;
  word-break: break-word;
}
.console .ts {
  color: #5d5c55;
  margin-right: 10px;
  user-select: none;
}
.console .l.warn {
  color: #ffc966;
}
.console .l.err,
.console .l.stderr {
  color: #ff7d76;
}
.console .l.system {
  color: var(--lime);
}
:root[data-theme="light"] .console .l.system {
  color: #c6f432;
}
.console .l.system .ts {
  color: #5f7a1a;
}
.console .l.input {
  color: var(--blue);
}
.console-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #22231f;
}
.console-form input {
  background: transparent;
  border-color: transparent;
  color: #ecebe6;
  font-family: var(--mono);
  font-size: 12.5px;
}
.console-form input:focus {
  box-shadow: none;
  border-color: #33342f;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.chart-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.chart-card h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.chart-card .chart-value {
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 8px;
}
.chart-card canvas {
  width: 100%;
  height: 150px;
  display: block;
}

/* ----------------------------------------------------------------- files */

.file-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}
.file-path a {
  color: var(--muted);
}
.file-path a:hover {
  color: var(--lime-text);
}
.file-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}
.file-name:hover {
  color: var(--lime-text);
}
.file-check {
  width: 28px;
}
/* Config history: versions on the left, the diff on the right. */
.history-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}
.history-list {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}
.history-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.history-item:hover {
  background: var(--hover);
}
.history-item.active {
  background: var(--lime-soft);
  border-color: var(--border-strong);
}
.history-item .faint {
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.diff {
  max-height: 60vh;
  overflow: auto;
  padding: 8px 0;
  font: 12px/1.55 var(--mono);
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.diff-line {
  padding: 0 12px 0 0;
  white-space: pre;
}
.diff-op {
  display: inline-block;
  width: 26px;
  text-align: center;
  color: var(--faint);
  user-select: none;
}
.diff-line.add {
  background: var(--lime-soft);
}
.diff-line.add .diff-op {
  color: var(--lime-text);
}
.diff-line.del {
  background: var(--red-soft);
}
.diff-line.del .diff-op {
  color: var(--red);
}
.diff-fold {
  padding: 2px 12px 2px 26px;
  color: var(--faint);
  font-style: italic;
}
@media (max-width: 760px) {
  .history-grid {
    grid-template-columns: 1fr;
  }
  .history-list {
    max-height: 30vh;
  }
}

.editor {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  background: var(--inset);
  color: #e3e2da;
  border-radius: var(--radius);
  line-height: 1.55;
  tab-size: 2;
}
.dropzone {
  position: relative;
}
.dropzone-hint {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-weight: 600;
  color: var(--lime-text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 2px dashed var(--lime);
  border-radius: var(--radius-lg);
  z-index: 2;
}
.dropzone.dragging .dropzone-hint {
  display: grid;
}

/* -------------------------------------------------------- cards & chips */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.tile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s var(--ease);
}
.tile-card:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}
.tile-card:active {
  transform: scale(0.995);
}
.tile-card .t-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tile-card .t-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  font-size: 20px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tile-card .t-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-card h3 {
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-card .t-meta {
  font-size: 12px;
  color: var(--faint);
}
.tile-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-card .t-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  user-select: none;
}
.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.chip.active {
  color: var(--lime-ink);
  background: var(--lime);
  border-color: var(--lime);
}
.chip .count {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.7;
}
.search-input {
  max-width: 280px;
  margin-left: auto;
}

.share-box {
  padding: 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.share-link {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--inset);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* First-run checklist on the dashboard. */
.checklist {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
}
.checklist img {
  width: 150px;
  height: auto;
}
.checklist ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.checklist li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.checklist li a:hover {
  background: var(--hover);
  text-decoration: none;
}
.checklist .tick {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  font-size: 11px;
  color: transparent;
}
.checklist li.done .tick {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lime-ink);
}
.checklist li.done .text {
  color: var(--faint);
  text-decoration: line-through;
}

/* List rows used by mods and schedules. */
.list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}
.list-row .title {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .sub {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row.is-off .title {
  color: var(--faint);
}
.list-row .thumb {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--raised);
  border: 1px solid var(--border);
  overflow: hidden;
  color: var(--faint);
}
.list-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.list-row.child {
  padding-left: 22px;
}

.filter-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--lime-soft);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text);
}
.filter-note b {
  color: var(--lime-text);
}

/* Toggle switch on a checkbox. */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border-strong);
  transition: background 0.15s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s var(--ease);
}
.switch input:checked + i {
  background: var(--lime);
}
.switch input:checked + i::after {
  transform: translateX(14px);
  background: var(--lime-ink);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.perm-group-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.perm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  cursor: pointer;
}
.perm-row span {
  color: var(--text);
}

/* ----------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 9, 7, 0.72);
  backdrop-filter: blur(3px);
  animation: fade 0.15s ease-out;
}
.modal {
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: rise 0.22s var(--ease);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  flex: 1;
  font-size: 16px;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

.wizard-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}
.wizard-progress i {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
}
.wizard-progress i.active {
  background: var(--lime);
}
.wizard-head {
  margin-bottom: 16px;
}
.wizard-count {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime-text);
}
.wizard-head h3 {
  font-size: 18px;
  margin: 4px 0 2px;
}
.wizard-head p {
  margin: 0;
  color: var(--muted);
}

/* -------------------------------------------------------------- feedback */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  font-size: 13px;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.2s var(--ease);
}
.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--lime);
  flex-shrink: 0;
}
.toast.error::before {
  background: var(--red);
}
.toast.warn::before {
  background: var(--amber);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty img {
  width: 140px;
  margin-bottom: 8px;
}
.empty h3 {
  font-size: 16px;
}
.empty p {
  margin: 0 0 10px;
  max-width: 420px;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Cursor spotlight on tiles (set by ui/fx.js). */
.spot {
  position: relative;
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--lime-soft), transparent 70%);
}
.spot:hover::before {
  opacity: 1;
}
.reveal {
  animation: rise 0.35s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

/* ----------------------------------------------------------------- auth */

.auth-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #111210 url("/img/login-bg.jpg") center / cover no-repeat;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 30px 28px;
  background: rgba(25, 26, 23, 0.92);
  color: #ecebe6;
  border: 1px solid #2c2d29;
  border-radius: 16px;
  box-shadow: 0 30px 80px -30px #000;
  backdrop-filter: blur(6px);
}
.auth-card input {
  background: #0c0d0b;
  border-color: #2c2d29;
  color: #ecebe6;
}
.auth-brand {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-bottom: 22px;
}
.auth-brand img {
  height: 44px;
  width: auto;
  margin-bottom: 14px;
}
.auth-brand h1 {
  font-size: 19px;
}
.auth-brand p {
  margin: 0;
  color: #a19f96;
}
.auth-error {
  margin: 0 0 12px;
  padding: 8px 11px;
  font-size: 12.5px;
  color: #ff8a84;
  background: rgba(255, 95, 87, 0.1);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------- two-factor code entry */

/* Pill switch with a lit active half ("Authenticator | Recovery code"). */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 18px;
  background: #0c0d0b;
  border: 1px solid #2c2d29;
  border-radius: 999px;
}
.seg-item {
  flex: 1;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: #a19f96;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.seg-item.active {
  color: var(--lime-ink);
  background: var(--lime);
  box-shadow: var(--lime-glow);
}
.otp {
  --otp-surface: #0c0d0b;
  --otp-border: #2c2d29;
  --otp-text: #ecebe6;
}
.otp-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 72px;
  margin-bottom: 14px;
}
.otp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.otp-gap {
  width: 6px;
  height: 2px;
  background: var(--otp-border);
  border-radius: 2px;
}
.otp-digit {
  width: 44px !important;
  height: 54px;
  padding: 0 !important;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--otp-text) !important;
  background: var(--otp-surface) !important;
  border: 1px solid var(--otp-border) !important;
  border-radius: 10px !important;
  caret-color: var(--lime);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease);
}
.otp-digit:focus {
  outline: none;
  border-color: var(--lime) !important;
  box-shadow: 0 0 0 3px var(--lime-soft);
}
.otp.checking .otp-digit {
  border-color: var(--lime) !important;
  animation: otp-wait 0.9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms);
}
.otp.shake .otp-row {
  animation: otp-shake 0.4s;
}
.otp.shake .otp-digit {
  border-color: var(--red) !important;
}
/* Success: the digits spiral into the middle of the row, where a phone ticks. */
.otp.success .otp-digit {
  opacity: 0;
  border-color: var(--lime) !important;
  box-shadow: var(--lime-glow);
  transform-origin: calc(50% + var(--dx, 0px)) calc(50% + var(--dy, 0px));
  animation: otp-swirl 0.75s cubic-bezier(0.55, 0, 0.35, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}
.otp.success .otp-gap,
.otp.success .seg,
.otp.success .otp-back {
  opacity: 0;
  transition: opacity 0.25s;
}
.otp-phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 126px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.4) rotate(-10deg);
}
.otp-phone-body {
  fill: #20211e;
  stroke: #3a3b36;
  stroke-width: 1.5;
}
.otp-phone-screen {
  fill: #0c0d0b;
}
.otp-phone-notch {
  fill: #3a3b36;
}
.otp-phone-ring,
.otp-phone-check {
  fill: none;
  stroke: var(--lime);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.otp-phone-ring {
  stroke-dasharray: 88;
  stroke-dashoffset: 88;
  transform: rotate(-90deg);
  transform-origin: 40px 56px;
}
.otp-phone-check {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}
.otp.success .otp-phone {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0);
  animation: otp-phone-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.42s both;
}
.otp.success .otp-phone-screen {
  fill: rgba(198, 244, 50, 0.12);
  transition: fill 0.4s 0.8s;
}
.otp.success .otp-phone-ring {
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 4px rgba(198, 244, 50, 0.7));
  animation: otp-draw-ring 0.45s var(--ease) 0.78s both;
}
.otp.success .otp-phone-check {
  stroke-dashoffset: 0;
  animation: otp-draw-check 0.35s var(--ease) 1.12s both;
}
.otp-recovery label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.otp-back {
  display: block;
  margin: 14px auto 0;
  font: inherit;
  font-size: 12.5px;
  color: #a19f96;
  background: none;
  border: 0;
  cursor: pointer;
}
.otp-back:hover {
  color: #ecebe6;
}
@keyframes otp-swirl {
  0% {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(320deg) scale(0);
  }
}
@keyframes otp-phone-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(-10deg);
  }
}
@keyframes otp-draw-ring {
  from {
    stroke-dashoffset: 88;
  }
}
@keyframes otp-draw-check {
  from {
    stroke-dashoffset: 26;
  }
}
@keyframes otp-wait {
  50% {
    transform: translateY(-3px);
  }
}
@keyframes otp-shake {
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}
/* Inside the app (two-factor setup) the boxes follow the theme. */
.card .otp {
  --otp-surface: var(--inset);
  --otp-border: var(--border-strong);
  --otp-text: var(--text);
}
:root[data-theme="light"] .card .otp {
  --otp-surface: var(--surface);
}
.qr-box {
  justify-self: start;
  display: inline-grid;
  padding: 10px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--border);
}
.user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.user-link:hover .user-name {
  color: var(--lime-text);
}
@media (max-width: 640px) {
  .tf-setup {
    grid-template-columns: 1fr !important;
  }
}
.players-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.players-count {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--lime-text);
}
.players-card table th:first-child,
.players-card table td:first-child {
  padding-left: 18px;
}
.players-card table th:last-child,
.players-card table td:last-child {
  padding-right: 18px;
}
.player {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 550;
}
.player-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--lime-glow);
}
.player-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 12px;
  border-radius: 8px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
}
/* Game settings tab: one row per key, label left and control right. */
.gs-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: center;
  gap: 8px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.gs-field:first-child {
  border-top: 0;
}
.gs-field.is-bool .gs-control {
  display: flex;
  justify-content: flex-end;
}
.gs-field.changed .gs-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--amber);
}
.gs-label {
  font-weight: 550;
}
.gs-key {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
.gs-control select,
.gs-control input:not([type="checkbox"]) {
  width: 100%;
}
.warn-card {
  line-height: 1.6;
  background: var(--amber-soft);
  border-color: rgba(255, 179, 64, 0.35);
}
.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 18px;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: rise 0.25s var(--ease) both;
}
.save-bar .spacer {
  flex: 1;
}
@media (max-width: 640px) {
  .gs-field {
    grid-template-columns: 1fr;
  }
  .gs-field.is-bool {
    grid-template-columns: 1fr auto;
  }
}
/* Players tab: history, KPIs, the players-online graph and the activity log. */
.pl-seg {
  max-width: 520px;
  background: var(--raised);
  border-color: var(--border);
}
.pl-seg .seg-item {
  color: var(--muted);
}
.pl-seg .seg-item.active {
  color: var(--lime-ink);
}
.player-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  image-rendering: pixelated;
}
.player-avatar {
  overflow: hidden;
  flex-shrink: 0;
}
.player-dot.off {
  background: var(--border-strong);
  box-shadow: none;
}
.player a {
  color: inherit;
}
.player a:hover {
  color: var(--lime-text);
}
.players-card th a {
  color: inherit;
}
.lime {
  color: var(--lime-text);
}
.bad-text {
  color: var(--red);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.kpi {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
}
.kpi-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.kpi-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
}
.kpi-small .kpi-value {
  font-size: 16px;
}
.pl-chart-wrap {
  position: relative;
  padding-left: 0;
}
.pl-svg {
  display: block;
  width: 100%;
  height: 160px;
}
.pl-grid {
  stroke: var(--border);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.pl-chart-top {
  position: absolute;
  top: -2px;
  left: 0;
  font-size: 11px;
}
.pl-ticks {
  position: relative;
  height: 16px;
  margin-top: 6px;
  font-size: 11px;
}
.pl-ticks span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
.pl-ticks span:first-child {
  transform: none;
}
.pl-ticks span:last-child {
  transform: translateX(-100%);
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.profile-name {
  font-size: 20px;
  font-weight: 650;
}
.pl-sessions {
  display: grid;
  gap: 2px;
}
.pl-session {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.act-list {
  max-height: 640px;
  overflow-y: auto;
}
.act-compact {
  max-height: 260px;
}
.act-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.act-row {
  display: grid;
  grid-template-columns: 64px 22px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 7px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.act-compact .act-row {
  padding: 6px 0;
}
.act-time {
  font-size: 11.5px;
  white-space: nowrap;
}
.act-icon {
  text-align: center;
  color: var(--faint);
}
.act-join .act-icon,
.act-start .act-icon {
  color: var(--lime-text);
}
.act-leave .act-icon,
.act-stop .act-icon {
  color: var(--muted);
}
.act-ban .act-icon,
.act-kick .act-icon,
.act-crash .act-icon {
  color: var(--red);
}
.act-text {
  overflow-wrap: anywhere;
}
.act-chat {
  color: var(--muted);
}
.act-start,
.act-stop,
.act-crash {
  background: var(--raised);
}
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.list-hint {
  margin: 12px 18px 0;
  font-size: 12.5px;
}
.list-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.list-add input {
  flex: 1;
  min-width: 120px;
}
.list-entries {
  max-height: 360px;
  overflow-y: auto;
}
.list-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
}
.list-entry:last-child {
  border-bottom: 0;
}
.list-name {
  font-weight: 550;
  overflow-wrap: anywhere;
}
.list-meta {
  font-size: 12px;
}
.list-empty {
  padding: 18px;
  font-size: 13px;
}
.wl-toggle {
  align-items: center;
  gap: 14px;
}
.version-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.version-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 21px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.version-now {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin: 6px 0 16px;
}
.type-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.type-tile:hover {
  border-color: var(--border-strong);
}
.type-tile.active {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime) inset;
}
.console-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -6px 0 8px;
}
.console-find {
  flex: 1;
  max-width: 320px;
}
.doctor-card {
  border-color: rgba(255, 179, 64, 0.35);
  background: linear-gradient(180deg, rgba(255, 179, 64, 0.07), transparent 70%), var(--surface);
}
.doctor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.doctor-head .icon-btn {
  margin-left: auto;
}
.doctor-badge {
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111210;
  background: var(--amber, #ffb340);
  border-radius: 99px;
}
.doctor-item {
  padding: 12px 0 2px;
}
.doctor-item + .doctor-item {
  border-top: 1px solid var(--border);
}
.doctor-title {
  font-weight: 650;
  font-size: 15px;
}
.doctor-detail {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
/* Minecraft multiplayer list preview */
.mc-list {
  padding: 10px;
  margin-bottom: 16px;
  background: #0f0f0f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%23171512'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23171512'/%3E%3C/svg%3E");
  border-radius: 6px;
}
.mc-entry {
  display: flex;
  gap: 8px;
  max-width: 560px;
  padding: 4px;
  border: 2px solid #808080;
  background: rgba(0, 0, 0, 0.5);
  font: 15px/1.3 "Minecraft", "Minecraftia", ui-monospace, "SF Mono", Menlo, monospace;
  text-shadow: 2px 2px 0 #3f3f3f;
}
.mc-icon {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.mc-text {
  flex: 1;
  min-width: 0;
}
.mc-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.mc-name {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-count {
  color: #aaa;
  white-space: nowrap;
}
.mc-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
  margin-left: 4px;
}
.mc-bars i {
  width: 2px;
  background: #55ff55;
  box-shadow: 1px 1px 0 #164216;
}
.mc-bars i:nth-child(1) { height: 4px; }
.mc-bars i:nth-child(2) { height: 6px; }
.mc-bars i:nth-child(3) { height: 8px; }
.mc-bars i:nth-child(4) { height: 10px; }
.mc-bars i:nth-child(5) { height: 12px; }
.mc-motd {
  margin-top: 2px;
  min-height: 40px;
  overflow-wrap: anywhere;
}
.mc-obf {
  animation: mc-obf 0.15s steps(2) infinite;
}
@keyframes mc-obf {
  50% {
    opacity: 0.4;
    filter: blur(1px);
  }
}
.ap-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .ap-grid {
    grid-template-columns: 1fr;
  }
}
.mc-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.mc-swatch,
.mc-fmt {
  width: 24px;
  height: 24px;
  padding: 0;
  font: 700 12px var(--mono);
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
}
.mc-swatch:hover,
.mc-fmt:hover {
  transform: translateY(-1px);
  border-color: var(--lime);
}
#ap-motd {
  width: 100%;
  resize: vertical;
}
/* Worlds card */
.world-list { display: flex; flex-direction: column; gap: 8px; }
.world-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--raised);
}
.world-row.active { border-color: var(--lime-soft); }
.world-icon { font-size: 22px; }
.world-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .world-row { flex-wrap: wrap; }
  .world-row > .row { width: 100%; justify-content: flex-start !important; }
}

tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
}

.bb-crumbs {
  margin: 12px 0 6px;
  font-size: 13px;
}
.bb-list {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 0;
}
.bb-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}
.bb-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.bb-row > :nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bb-list > .faint {
  padding: 10px 12px;
}

/* Between phone and wide desktop the server rows tighten up instead of clipping the buttons. */
@media (max-width: 1320px) {
  .srv-row {
    grid-template-columns: minmax(180px, 2fr) 100px 60px 100px 64px 56px minmax(170px, auto);
    gap: 10px;
  }
}

.pt-grid {
  display: grid;
  grid-template-columns: 34px repeat(24, 1fr);
  gap: 3px;
  align-items: center;
}
.pt-grid i {
  height: 16px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) calc(var(--a, 0) * 100%), var(--hover));
}
.pt-grid i.none {
  background: transparent;
  outline: 1px dashed var(--border);
  outline-offset: -1px;
}
.pt-day,
.pt-hour {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
}

.old-logs {
  height: min(60vh, 520px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-stats-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.con-player {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.fs-results {
  max-height: min(60vh, 520px);
  overflow: auto;
}

.fs-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  font-size: 12.5px;
  word-break: break-all;
}

.fs-hit:hover {
  background: var(--hover);
}

.gr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 18px;
  align-items: center;
}

.gr-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}

.gr-num input {
  width: 90px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------ utilities */

.hidden,
.admin-only.hidden {
  display: none !important;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.93em;
}
.num {
  font-variant-numeric: tabular-nums;
}
.dim,
.faint {
  color: var(--faint);
}
.muted {
  color: var(--muted);
}
.nowrap {
  white-space: nowrap;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mb-16 {
  margin-bottom: 16px;
}
.warning {
  color: var(--amber);
}
.success {
  color: var(--lime-text);
}
.port-hint {
  color: var(--amber);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .hide-md {
    display: none !important;
  }
  .srv-row {
    grid-template-columns: minmax(200px, 2fr) 110px 60px 100px minmax(150px, auto);
  }
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hide-sm {
    display: none !important;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar-close,
  .menu-btn {
    display: inline-grid;
  }
  .sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.55);
  }
  .topbar {
    padding: 0 12px;
  }
  .view {
    padding: 18px 16px 48px;
  }
  .srv-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .srv-head {
    display: none;
  }
  .srv-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .checklist {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .tile {
    min-height: 112px;
    padding: 12px 14px;
  }
  .tile-value {
    font-size: 21px;
  }
  .tile canvas {
    display: none;
  }
  .tile [data-host="net"] {
    white-space: normal !important;
    font-size: 14px !important;
  }
  .checklist img {
    display: none;
  }
  .search-input {
    max-width: none;
    margin-left: 0;
  }
  .console {
    height: 60vh;
  }
  #new-server-btn {
    display: none;
  }
  /* Tables scroll sideways instead of squeezing every cell into a word-per-line column. */
  .table-wrap table {
    min-width: 600px;
  }
  /* Long server names get the full width; the power buttons drop under them. */
  .srv-header {
    padding: 14px 16px;
    gap: 12px;
  }
  .srv-header h1 {
    font-size: 18px;
    overflow-wrap: anywhere;
  }
  .srv-header #detail-power {
    flex-basis: 100%;
  }
}

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

/* ------------------------------------------------------------ game art */

.min-w-0 {
  min-width: 0;
}
.game-card {
  padding-top: 0;
  overflow: hidden;
}
.game-card .g-art {
  display: grid;
  place-items: center;
  margin: 0 -16px;
  aspect-ratio: 460 / 215;
  font-size: 40px;
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.game-card .g-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease);
}
.game-card .g-art img.art-contain {
  width: 40%;
  height: 80%;
  object-fit: contain;
}
.game-card:hover .g-art img {
  transform: scale(1.03);
}
.tile-card .t-foot {
  flex-wrap: wrap;
}
.tile-card .t-foot .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-card .t-deploy {
  margin-left: auto;
}
.srv-icon img,
.t-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.srv-icon img.art-contain {
  object-fit: contain;
  padding: 3px;
}
.update-notes {
  max-height: 240px;
  margin: 0 0 12px;
  overflow: auto;
  font-size: 12.5px;
  white-space: pre-wrap;
  color: var(--muted);
}

/* ------------------------------------------------------------- backdrop */

/* A quiet contour-line hero behind the top of every page, with a lime glow. */
.main {
  background:
    radial-gradient(ellipse 60% 340px at 78% -60px, color-mix(in srgb, var(--lime) 9%, transparent), transparent 70%),
    url("/img/hero-dark.svg") top center / max(1600px, 100%) auto no-repeat;
}
:root[data-theme="light"] .main {
  background:
    radial-gradient(ellipse 60% 340px at 78% -60px, color-mix(in srgb, var(--lime) 22%, transparent), transparent 70%),
    url("/img/hero-light.svg") top center / max(1600px, 100%) auto no-repeat;
}
/* Line drawings are dark on transparent; flip them for the light theme. */
:root[data-theme="light"] .line-art {
  filter: invert(1) hue-rotate(180deg);
}

/* -------------------------------------------------- bridge: extra ports */

.bridge-port {
  display: grid;
  grid-template-columns: minmax(90px, 1.4fr) 84px 84px 92px minmax(90px, 1.2fr) 30px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.bridge-port input,
.bridge-port select {
  min-width: 0;
}
.bridge-port-head {
  font-size: 11.5px;
  margin-bottom: 4px;
}
@media (max-width: 760px) {
  .bridge-port {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .bridge-port-head {
    display: none;
  }
}
.hint.warn-text {
  color: var(--amber);
}
.hint.warn-text:empty {
  display: none;
}

/* Games page: what a self-service account has left. */
.quota-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 12px 18px;
  font-size: 13px;
}
.quota-card span {
  color: var(--muted);
}

/* Settings: servers on the public list, each with an optional line about it. */
.sp-servers {
  display: grid;
  gap: 8px;
}
.sp-server {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.sp-server .perm-row {
  margin: 0;
}
@media (max-width: 640px) {
  .sp-server {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 6px;
  }
}

/* Scheduled events: one row per setting the event changes. */
.ev-change {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ev-value > * {
  width: 100%;
}

/* First-run tour: a ring around one part of the panel, and a bubble about it. */
.tour {
  position: fixed;
  inset: 0;
  z-index: 300;
}
.tour-ring {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px var(--lime), 0 0 0 9999px rgba(0, 0, 0, 0.55);
  transition: all 0.25s var(--ease);
  pointer-events: none;
}
.tour-bubble {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: left 0.25s var(--ease), top 0.25s var(--ease);
}
.tour-bubble h3 {
  margin: 2px 0 6px;
  font-size: 16px;
}
.tour-bubble p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.tour-count {
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  color: var(--lime-text);
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mods tab: saved Workshop packs. */
.ws-packs {
  padding: 12px 14px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ws-pack-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.ws-pack {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.ws-pack .grow {
  flex: 1;
}
.ws-preview {
  display: grid;
  gap: 6px;
  max-height: 40vh;
  overflow-y: auto;
}
.ws-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}
.ws-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Modpack install: what changes between the installed version and the chosen one. */
.pack-diff {
  margin-top: 12px;
}
.pack-diff details {
  margin: 6px 0;
}
.pack-diff summary {
  cursor: pointer;
  font-size: 13px;
}
.pack-diff summary .add {
  color: var(--lime-text);
}
.pack-diff summary .del {
  color: var(--red);
}
.pack-diff ul {
  margin: 6px 0 0;
  padding-left: 18px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.7;
}
.pack-diff-head {
  font-size: 13px;
  margin-bottom: 4px;
}

/* Sign in with Google / Discord / GitHub. */
.oauth-buttons {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.oauth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--faint);
}
.oauth-or::before,
.oauth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.oauth-btn {
  height: 38px;
}
.oauth-provider {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

/* Games page: ready-made setups above the games. */
#setups {
  margin-bottom: 26px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 4px 0 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
}
.setup-card .t-foot {
  flex-wrap: wrap;
  row-gap: 6px;
}
.setup-card .t-foot .btn {
  margin-left: auto;
}
