:root {
  color-scheme: dark;
  --bg: #0b0e0b;
  --surface: #131813;
  --surface-2: #192019;
  --surface-3: #202820;
  --line: #2b352b;
  --line-strong: #3b493a;
  --text: #eef2e8;
  --muted: #98a294;
  --quiet: #687264;
  --lime: #afd15e;
  --lime-strong: #c2e36f;
  --lime-soft: rgba(175, 209, 94, .12);
  --red: #e86f68;
  --red-soft: rgba(232, 111, 104, .1);
  --amber: #e5a94d;
  --blue: #69b7c4;
  --purple: #a388cf;
  --radius: 14px;
  --shadow: 0 22px 65px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.muted { color: var(--muted); }
.muted.compact { margin: 0 0 14px; font-size: 11px; }

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 26% 16%, rgba(175, 209, 94, .11), transparent 28%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    #0b0e0b;
  background-size: auto, 44px 44px, 44px 44px, auto;
}
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(19, 24, 19, .96);
  box-shadow: var(--shadow);
}
.login-mark, .brand {
  display: grid;
  place-items: center;
  border: 1px solid #78933c;
  background: linear-gradient(145deg, #c5e271, #78993b);
  color: #11170a;
  font-weight: 950;
  letter-spacing: -.08em;
  box-shadow: 0 8px 25px rgba(151, 188, 72, .18);
}
.login-mark { width: 52px; height: 52px; margin-bottom: 24px; border-radius: 14px; font-size: 17px; }
.login-card h1 { margin: 4px 0 8px; font-size: 30px; letter-spacing: -.045em; }
.login-copy { margin: 0 0 26px; color: var(--muted); }
.login-foot { margin: 20px 0 0; color: var(--quiet); font-size: 12px; text-align: center; }
.form-error { min-height: 20px; margin: -2px 0 8px; color: #f0a29d; font-size: 12px; }

.app { display: grid; grid-template-columns: 76px minmax(0, 1fr); height: 100vh; overflow: hidden; }
.rail {
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: #0f130f;
}
.brand { width: 44px; height: 44px; margin-bottom: 18px; border-radius: 12px; }
.rail-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
}
.rail-button span { font-size: 19px; font-weight: 800; line-height: 1; }
.rail-button:hover { background: var(--surface-2); color: var(--text); }
.rail-button.active { background: var(--lime-soft); color: var(--lime); }
.rail-button.active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 24px;
  border-radius: 0 5px 5px 0;
  background: var(--lime);
}
.rail-spacer { flex: 1; }
.shell { min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.topbar {
  z-index: 7;
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 19, 15, .96);
  backdrop-filter: blur(16px);
}
.title-block { min-width: 205px; }
.eyebrow {
  margin: 0;
  color: var(--lime);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.topbar h1 { margin: 2px 0 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.top-stats { display: flex; align-items: center; gap: 8px; }
.status-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.status-chip strong { color: var(--text); }
.game-clock-chip { display: grid; grid-template-columns: auto auto; column-gap: 7px; padding-block: 5px; }
.game-clock-chip small { grid-column: 1 / -1; color: var(--quiet); font-size: 8px; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.game-clock-chip.night { border-color: rgba(105, 183, 196, .35); background: rgba(44, 56, 75, .38); }
.game-clock-chip.night strong { color: #a9cfe0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); }
.dot.online { background: var(--lime); box-shadow: 0 0 0 4px rgba(175, 209, 94, .1); }
.dot.demo { background: var(--amber); box-shadow: 0 0 0 4px rgba(229, 169, 77, .1); }
.top-spacer { flex: 1; }
.preview-badge, .safe-pill {
  padding: 7px 10px;
  border: 1px solid rgba(229, 169, 77, .34);
  border-radius: 9px;
  background: rgba(229, 169, 77, .08);
  color: #f0bf71;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.account { display: flex; align-items: center; gap: 9px; }
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 850;
}
.account-copy { display: flex; flex-direction: column; min-width: 105px; }
.account-copy strong { font-size: 12px; }
.account-copy span { color: var(--quiet); font-size: 10px; }

.operation-countdown {
  display: flex;
  z-index: 6;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  border-bottom: 1px solid rgba(229, 169, 77, .35);
  background: linear-gradient(90deg, rgba(229, 169, 77, .14), rgba(35, 29, 18, .94));
}
.operation-countdown > div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.operation-countdown strong { color: #f0c47f; font-size: 12px; }
.operation-countdown span { color: var(--muted); font-size: 10px; }
.operation-countdown time { color: #ffd18a; font: 800 21px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.operation-countdown-pulse { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(229, 169, 77, .35); animation: countdown-pulse 1.5s infinite; }
@keyframes countdown-pulse { 70% { box-shadow: 0 0 0 8px rgba(229, 169, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 169, 77, 0); } }

.view { display: none; min-height: 0; flex: 1; }
.view.active { display: flex; }
.overview, .content-view { overflow: auto; padding: 24px; flex-direction: column; gap: 16px; }
.content-view > * { flex: 0 0 auto; }
.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px;
  border: 1px solid rgba(175, 209, 94, .22);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(175, 209, 94, .11), rgba(105, 183, 196, .035));
}
.hero-strip h2 { margin: 4px 0; font-size: 18px; }
.hero-strip p:last-child { margin: 0; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .17);
}
.metric-card { display: flex; min-height: 132px; padding: 18px; flex-direction: column; }
.metric-label { margin: 0; color: var(--quiet); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-value { margin: auto 0 1px; font-size: 25px; line-height: 1.1; letter-spacing: -.04em; }
.metric-value.small { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > span { color: var(--muted); font-size: 11px; }
.state-online { color: var(--lime); }
.state-demo { color: var(--amber); }
.state-offline { color: var(--red); }
.overview-panels { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.panel { padding: 20px; }
.panel h2, .content-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.025em; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button-row.wrap { display: flex; flex-wrap: wrap; }
.button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}
.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: .42; cursor: not-allowed; filter: none; }
.button.primary { border-color: #8eaa4c; background: var(--lime); color: #11170b; }
.button.wide { width: 100%; }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger-soft { border-color: rgba(232, 111, 104, .35); background: var(--red-soft); }
.danger-text { color: #e99b96 !important; }
.server-control { margin-top: 18px; }
.readiness-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.readiness-list li { position: relative; padding-left: 25px; }
.readiness-list li::before { content: "○"; position: absolute; left: 0; color: var(--quiet); }
.readiness-list li.done { color: var(--text); }
.readiness-list li.done::before { content: "✓"; color: var(--lime); }

.director { min-height: 0; flex: 1; }
.event-sidebar {
  z-index: 3;
  width: 245px;
  min-width: 245px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-section { padding: 17px 14px; border-bottom: 1px solid var(--line); }
.section-kicker { margin: 0 0 10px; color: var(--quiet); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-head { display: flex; justify-content: space-between; color: var(--quiet); font-size: 10px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tool {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.tool:hover { border-color: var(--line-strong); color: var(--text); }
.tool.active { border-color: rgba(175, 209, 94, .62); background: var(--lime-soft); color: var(--text); }
.tool-symbol { display: block; min-height: 22px; margin-bottom: 6px; color: var(--lime); font-size: 17px; font-weight: 900; }
.tool-name { display: block; font-size: 12px; font-weight: 750; }
.tool-hint { display: block; margin-top: 2px; color: var(--quiet); font-size: 10px; }
.event-list { display: flex; flex-direction: column; gap: 7px; }
.event-row {
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.event-row:hover { background: var(--surface-2); }
.event-row.active { border-color: var(--line-strong); background: var(--surface-2); }
.event-row-top { display: flex; align-items: center; gap: 8px; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.event-dot.population { background: var(--red); }
.event-dot.sound { background: var(--amber); }
.event-row-title { min-width: 0; flex: 1; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.event-row-meta { margin: 5px 0 0 16px; color: var(--quiet); font-size: 10px; }
.status-mini { font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.status-mini.scheduled { color: var(--amber); }
.status-mini.draft { color: var(--muted); }

.map-stage { position: relative; min-width: 0; flex: 1; overflow: hidden; background: #101610; }
#mapCanvas { display: block; width: 100%; height: 100%; cursor: default; touch-action: none; }
.map-toolbar { position: absolute; top: 14px; right: 14px; left: 14px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.map-toolbar > * { pointer-events: auto; }
.map-search {
  display: flex;
  width: min(290px, 38vw);
  align-items: center;
  padding: 9px 11px;
  border: 1px solid rgba(58, 71, 57, .9);
  border-radius: 10px;
  background: rgba(18, 23, 18, .92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.map-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.map-search input::placeholder { color: var(--quiet); }
.map-tools-spacer { flex: 1; }
.layer-menu { display: flex; gap: 6px; }
.layer-toggle {
  padding: 8px 10px;
  border: 1px solid rgba(58, 71, 57, .9);
  border-radius: 9px;
  background: rgba(18, 23, 18, .92);
  color: var(--muted);
  font-size: 11px;
  box-shadow: var(--shadow);
  cursor: pointer;
  backdrop-filter: blur(14px);
}
.layer-toggle.on { color: var(--text); border-color: rgba(175, 209, 94, .35); }
.layer-toggle.on::before { content: "•"; margin-right: 6px; color: var(--lime); }
.zoom-stack {
  position: absolute;
  bottom: 72px;
  left: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(58, 71, 57, .9);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.zoom-stack button { width: 38px; height: 36px; border: 0; border-bottom: 1px solid var(--line); background: rgba(18, 23, 18, .94); color: var(--muted); cursor: pointer; }
.zoom-stack button:last-child { border-bottom: 0; }
.zoom-stack button:hover { color: var(--text); background: var(--surface-3); }
.coordinate-bar {
  position: absolute;
  bottom: 14px;
  left: 66px;
  padding: 8px 11px;
  border: 1px solid rgba(58, 71, 57, .9);
  border-radius: 9px;
  background: rgba(18, 23, 18, .92);
  color: var(--muted);
  font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  box-shadow: var(--shadow);
}
.map-player-panel {
  position: absolute;
  z-index: 7;
  top: 62px;
  right: 14px;
  width: min(250px, calc(100% - 28px));
  overflow: hidden;
  border: 1px solid rgba(58, 71, 57, .92);
  border-radius: 11px;
  background: rgba(14, 20, 17, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.map-player-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.map-player-head span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.map-player-head span i { width: 7px; height: 7px; border-radius: 50%; background: #69b7c4; box-shadow: 0 0 0 3px rgba(105, 183, 196, .14); }
.map-player-head strong { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(105, 183, 196, .13); color: #bde4e9; font-size: 11px; text-align: center; }
.map-player-freshness { display: block; padding: 0 11px 8px; color: var(--quiet); font-size: 9px; }
.map-player-list { display: grid; gap: 3px; max-height: min(300px, 42vh); overflow-y: auto; padding: 0 6px 7px; }
.map-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.map-player-row:hover { border-color: rgba(105, 183, 196, .28); background: rgba(105, 183, 196, .08); }
.map-player-row:disabled { cursor: default; opacity: .58; }
.map-player-identity { display: flex; min-width: 0; align-items: center; gap: 7px; }
.map-player-identity i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #69b7c4; }
.map-player-identity strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.map-player-row small { color: #90a79c; font: 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.map-player-empty { margin: 2px 5px 6px; color: var(--quiet); font-size: 10px; line-height: 1.4; }
.map-player-panel.collapsed .map-player-freshness, .map-player-panel.collapsed .map-player-list { display: none; }
.map-player-panel.collapsed .map-player-head { padding-bottom: 10px; }
.density-panel {
  position: absolute;
  bottom: 54px;
  left: 66px;
  width: min(330px, calc(100% - 150px));
  padding: 10px 12px;
  border: 1px solid rgba(58, 71, 57, .9);
  border-radius: 10px;
  background: rgba(18, 23, 18, .94);
  color: var(--muted);
  box-shadow: var(--shadow);
  pointer-events: none;
  backdrop-filter: blur(14px);
}
.density-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.density-heading span { color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.density-heading strong { color: var(--text); font-size: 22px; line-height: 1; }
.density-status { margin-top: 3px; color: var(--text); font-size: 10px; }
.density-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; font-size: 9px; }
.density-legend span { display: inline-flex; align-items: center; gap: 4px; }
.density-swatch { width: 9px; height: 9px; border-radius: 2px; }
.density-low { background: rgba(232, 159, 73, .42); }
.density-medium { background: rgba(236, 128, 61, .58); }
.density-high { background: rgba(240, 91, 52, .72); }
.density-critical { background: rgba(247, 59, 46, .88); }
.density-panel small { display: block; margin-top: 6px; color: var(--quiet); font-size: 9px; line-height: 1.35; }
.density-tooltip {
  position: absolute;
  z-index: 8;
  width: 235px;
  padding: 9px 11px;
  border: 1px solid rgba(232, 111, 104, .5);
  border-radius: 9px;
  background: rgba(26, 20, 18, .96);
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.density-tooltip strong, .density-tooltip small { display: block; }
.density-tooltip strong { font-size: 11px; }
.density-tooltip small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.map-attribution { position: absolute; right: 14px; bottom: 14px; color: rgba(196, 205, 190, .58); font-size: 10px; text-align: right; }
.map-attribution a { color: #b9c8ae; }
.route-tip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  display: none;
  padding: 9px 13px;
  transform: translateX(-50%);
  border: 1px solid rgba(163, 136, 207, .5);
  border-radius: 999px;
  background: rgba(34, 27, 43, .94);
  color: #d8c9ef;
  font-size: 11px;
  box-shadow: var(--shadow);
}
.route-tip.show { display: block; }

.inspector {
  z-index: 3;
  width: 292px;
  min-width: 292px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.inspector-head { padding: 17px 17px 13px; border-bottom: 1px solid var(--line); }
.inspector-title-row { display: flex; align-items: flex-start; gap: 9px; }
.inspector-title-row h2 { min-width: 0; flex: 1; margin: 0; font-size: 16px; letter-spacing: -.02em; }
.type-badge { padding: 4px 6px; border-radius: 6px; background: rgba(163, 136, 207, .13); color: #c5afe6; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.inspector-sub { margin: 5px 0 0; color: var(--quiet); font-size: 11px; }
.form { padding: 15px 17px; }
.field { display: block; margin-bottom: 15px; color: var(--muted); font-size: 11px; }
.field > span:first-child { display: block; margin-bottom: 7px; }
.field-label { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; }
.field output { color: var(--text); font: 11px ui-monospace, Consolas, monospace; }
input, select, textarea, .text-input, .select-input {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0f140f;
  color: var(--text);
}
textarea { resize: vertical; font: inherit; }
input[type="range"] { min-height: 20px; padding: 0; border: 0; accent-color: var(--lime); }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.segmented button { padding: 7px 4px; border: 1px solid var(--line); border-radius: 8px; background: #101510; color: var(--muted); cursor: pointer; }
.segmented button.active { border-color: rgba(175, 209, 94, .5); background: var(--lime-soft); color: var(--text); }
.validation { display: flex; gap: 9px; margin: 2px 0 14px; padding: 10px; border: 1px solid rgba(105, 183, 196, .22); border-radius: 9px; background: rgba(105, 183, 196, .07); color: #a8cbd1; font-size: 10px; }
.validation.success { border-color: rgba(175, 209, 94, .25); background: var(--lime-soft); color: #c7dd92; }
.validation.warning { border-color: rgba(229, 169, 77, .3); background: rgba(229, 169, 77, .07); color: #efc987; }
.empty-inspector { display: grid; min-height: 280px; padding: 34px 20px; place-content: center; color: var(--muted); text-align: center; }
.empty-inspector h2 { margin: 8px 0 2px; color: var(--text); font-size: 16px; }
.empty-inspector p { max-width: 190px; margin: 0; font-size: 11px; }
.empty-symbol { color: var(--lime); font-size: 30px; }

.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 4px 2px 8px; }
.content-heading h2 { font-size: 23px; }
.content-heading p:last-child { margin: 6px 0 0; color: var(--muted); }
.content-grid { display: grid; gap: 16px; }
.settings-layout { display: grid; gap: 16px; }
#serverMemoryForm { margin-top: 16px; }
#wipeSection { margin-top: 16px; }
.settings-grid { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.settings-mods-panel { grid-column: 1 / -1; }
.settings-mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.settings-mod-grid textarea { min-height: 210px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.settings-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 18px; margin-top: 16px; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 34px; color: var(--muted); font-size: 11px; }
.check-row input { width: 18px; min-height: 18px; flex: 0 0 auto; accent-color: var(--lime); }
.settings-actions-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: rgba(175, 209, 94, .25); }
.settings-actions-panel h2 { margin: 3px 0 6px; }
.settings-actions-panel .form-error { margin-bottom: 0; }
.advanced-ini-panel { margin: 16px 0; padding: 0; overflow: hidden; }
.advanced-ini-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; color: inherit; text-align: left; }
.advanced-ini-summary strong { display: block; margin-top: 4px; font-size: 17px; }
.advanced-ini-content { border-top: 1px solid var(--line); padding: 20px; }
.raw-ini-text { min-height: 520px; white-space: pre; overflow: auto; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; tab-size: 4; }
.raw-ini-confirm-grid { display: grid; grid-template-columns: minmax(260px, 420px) minmax(320px, 1fr); gap: 18px; align-items: end; margin-top: 16px; }
.wipe-panel { border-color: rgba(232, 111, 104, .42); background: linear-gradient(180deg, rgba(232, 111, 104, .055), rgba(15, 20, 15, .96)); }
.wipe-panel h2 { color: #f0b0ac; }
.wipe-confirm-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); align-items: end; gap: 16px; margin-top: 16px; }
.wipe-confirm-grid .field { margin-bottom: 0; }
.button.danger { border-color: rgba(232, 111, 104, .7); background: #8d332f; color: #fff; }
.button.danger:hover:not(:disabled) { background: #a73b36; }
.users-grid { grid-template-columns: minmax(280px, .7fr) minmax(500px, 1.3fr); }
.players-grid { grid-template-columns: minmax(520px, 1.35fr) minmax(280px, .65fr); align-items: start; }
.whitelist-table-panel { grid-column: 1 / -1; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-actions .access-level-select { width: auto; min-width: 112px; min-height: 30px; padding: 5px 8px; font-size: 10px; }
.admin-role-select { width: 100%; min-width: 145px; min-height: 34px; }
.admin-user-actions { min-width: 255px; align-items: center; }
.self-account-note { color: var(--quiet); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.button.tiny { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.empty-cell { padding: 28px 12px; color: var(--quiet); text-align: center; }
.environment-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; }
.environment-panel { min-height: 100%; }
.climate-panel { grid-column: 1 / -1; }
.climate-preset-group + .climate-preset-group { margin-top: 14px; }
.climate-preset-group h3 { margin: 0 0 7px; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.climate-preset-grid { margin: 0; }
.danger-preset { border-color: rgba(232, 111, 104, .3); }
.danger-preset:hover { border-color: rgba(232, 111, 104, .68); background: rgba(232, 111, 104, .09); }
.reset-preset { border-color: rgba(105, 183, 196, .34); }
.reset-preset:hover { border-color: rgba(105, 183, 196, .68); background: rgba(105, 183, 196, .09); }
.environment-symbol { color: var(--lime); font: 700 25px/1 ui-monospace, Consolas, monospace; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0; }
.preset-card, .effect-card {
  border: 1px solid var(--line); border-radius: 11px; background: #0f140f; color: var(--text); cursor: pointer; text-align: left;
}
.preset-card { min-height: 82px; padding: 13px; }
.preset-card strong, .preset-card span, .effect-card strong, .effect-card small { display: block; }
.preset-card span, .effect-card small { margin-top: 5px; color: var(--quiet); font-size: 10px; }
.preset-card:hover, .effect-card:hover { border-color: rgba(175, 209, 94, .45); background: var(--lime-soft); }
.preset-card:disabled, .effect-card:disabled { opacity: .45; cursor: not-allowed; }
.storm-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.storm-row .field { margin-bottom: 0; }
.effect-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 4px 0 14px; }
.effect-card { display: flex; min-height: 72px; padding: 11px; align-items: center; gap: 11px; }
.effect-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(175, 209, 94, .24); border-radius: 50%; color: var(--lime); font: 800 18px/1 ui-monospace, Consolas, monospace; }
.chopper-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.environment-result-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: rgba(105, 183, 196, .22); }
.environment-result-panel h2 { margin-top: 3px; }
.environment-result-panel > p { max-width: 560px; margin: 0; text-align: right; }
.automation-layout { display: grid; gap: 16px; }
.automation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.automation-master { border-color: rgba(175, 209, 94, .25); }
.automation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.automation-actions .form-error { margin: 0 auto 0 0; }
.backup-time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.availability-panel input[type="time"] { width: 120px; min-height: 34px; }
.availability-panel input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--lime); }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.operations-panel { margin-top: 2px; }
.backup-summary-grid { display: grid; grid-template-columns: 210px 210px minmax(360px, 1fr); gap: 16px; margin-bottom: 16px; }
.backup-create-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.backup-create-card h2 { margin: 3px 0 6px; }
.backup-tools-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; margin-bottom: 16px; }
.inline-action-form { display: grid; grid-template-columns: minmax(160px, 1fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.inline-action-form .field { margin: 0; }
.message-presets { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 12px; }
.broadcast-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.backup-filename { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.console-heading-actions { display: flex; align-items: center; gap: 10px; }
.console-panel { padding: 0; overflow: hidden; border-color: rgba(105, 183, 196, .25); }
.console-toolbar { display: grid; grid-template-columns: 180px minmax(280px, 1fr) auto auto; align-items: end; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: rgba(105, 183, 196, .035); }
.console-toolbar .field { margin: 0; }
.console-filter-field { min-width: 0; }
.console-check { margin-bottom: 2px; white-space: nowrap; }
.console-output { min-height: 420px; max-height: calc(100vh - 320px); margin: 0; padding: 18px; overflow: auto; background: #070a07; color: #b9d4aa; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 4; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-color: #344433 #090c09; }
.console-output:focus { outline: 1px solid rgba(175, 209, 94, .45); outline-offset: -1px; }
.operation-output { max-height: 320px; max-width: 65vw; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.console-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }

.diagnostics-heading-actions { display: flex; align-items: center; gap: 10px; }
.diagnostics-score { min-width: 86px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font: 850 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
.diagnostics-score.healthy { border-color: rgba(175, 209, 94, .4); background: var(--lime-soft); color: var(--lime-strong); }
.diagnostics-score.warning { border-color: rgba(229, 169, 77, .4); background: rgba(229, 169, 77, .08); color: #efc987; }
.diagnostics-score.critical { border-color: rgba(232, 111, 104, .5); background: var(--red-soft); color: #f2a39e; }
.rack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rack-card { min-height: 128px; padding: 16px; border: 1px solid #303a30; border-radius: 9px; background: linear-gradient(180deg, #151b15, #0e120e); box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 10px 30px rgba(0, 0, 0, .16); }
.rack-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rack-card-head span { color: var(--quiet); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.rack-card-head strong { color: var(--text); font: 800 18px ui-monospace, SFMono-Regular, Consolas, monospace; }
.rack-card small { display: block; margin-top: 12px; overflow: hidden; color: var(--quiet); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.meter { height: 8px; margin-top: 20px; overflow: hidden; border: 1px solid #2d372d; border-radius: 999px; background: #090c09; }
.meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6f9840, var(--lime)); transition: width .35s ease; }
.meter.process span { background: linear-gradient(90deg, #407b87, var(--blue)); }
.meter.memory span { background: linear-gradient(90deg, #745c9a, var(--purple)); }
.meter.danger span { background: linear-gradient(90deg, #b86d37, var(--amber)); }
.rack-led-row { display: flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--muted); font-size: 11px; }
.rack-led { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); }
.rack-led.online { background: var(--lime); box-shadow: 0 0 8px rgba(175, 209, 94, .5); }
.rack-led.demo { background: var(--amber); }
.rack-led.offline { background: var(--red); }
.diagnostics-columns { display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; }
.diagnostics-findings { display: grid; gap: 8px; }
.diagnostic-finding { padding: 12px 13px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 9px; background: #101510; }
.diagnostic-finding > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diagnostic-finding > div span { color: var(--quiet); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.diagnostic-finding p { margin: 5px 0 3px; color: var(--muted); font-size: 11px; }
.diagnostic-finding small { color: var(--quiet); font-size: 9px; }
.diagnostic-finding.healthy { border-left-color: var(--lime); }
.diagnostic-finding.info { border-left-color: var(--blue); }
.diagnostic-finding.warning { border-left-color: var(--amber); }
.diagnostic-finding.critical { border-color: rgba(232, 111, 104, .26); border-left-color: var(--red); background: rgba(232, 111, 104, .045); }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }
.signal-grid span { display: flex; padding: 8px; border: 1px solid var(--line); border-radius: 7px; flex-direction: column; color: var(--quiet); font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
.signal-grid strong { color: var(--text); font: 800 18px ui-monospace, SFMono-Regular, Consolas, monospace; }
.diagnostics-log-lines { display: grid; max-height: 310px; gap: 5px; overflow: auto; }
.diagnostics-log-lines code { display: block; padding: 8px; border-left: 2px solid var(--amber); background: #090c09; color: #c5b590; font: 9px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.diagnostics-log-lines code.critical { border-left-color: var(--red); color: #e6aaa5; }
.switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.switch input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.switch span { display: block; position: relative; width: 44px; height: 24px; border: 1px solid var(--line-strong); border-radius: 999px; background: #0e130e; cursor: pointer; transition: .18s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--quiet); transition: .18s ease; }
.switch input:checked + span { border-color: rgba(175, 209, 94, .7); background: var(--lime-soft); }
.switch input:checked + span::after { left: 23px; background: var(--lime); }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.stack-form { display: grid; }
.table-panel { min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); color: var(--quiet); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; vertical-align: middle; }
td strong { display: block; color: var(--text); }
td small { color: var(--quiet); }
.user-status { display: inline-flex; align-items: center; gap: 6px; }
.user-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.user-status.active::before { background: var(--lime); }

.toast {
  z-index: 30;
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #1b231b;
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(232, 111, 104, .45); background: #291817; }

@media (max-width: 1160px) {
  .inspector { width: 265px; min-width: 265px; }
  .event-sidebar { width: 210px; min-width: 210px; }
  .top-stats .status-chip:nth-child(3) { display: none; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .rack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 58px minmax(0, 1fr); height: auto; min-height: 100vh; overflow: visible; }
  .rail { position: sticky; top: 0; height: 100vh; padding: 12px 6px; }
  .rail-button.active::before { left: -6px; }
  .shell { height: auto; min-height: 100vh; }
  .topbar { position: sticky; top: 0; }
  .director.active { display: grid; grid-template-columns: 1fr; }
  .event-sidebar { width: 100%; min-width: 0; max-height: none; border-right: 0; }
  .sidebar-section.events-section { display: none; }
  .tool-grid { grid-template-columns: repeat(6, 1fr); }
  .map-stage { min-height: 60vh; }
  .inspector { width: 100%; min-width: 0; border-top: 1px solid var(--line); border-left: 0; }
  .top-stats { display: none; }
  .users-grid, .players-grid, .automation-grid, .overview-panels, .environment-grid, .settings-grid, .settings-toggle-grid, .settings-mod-grid, .backup-summary-grid, .backup-tools-grid, .raw-ini-confirm-grid, .console-toolbar, .diagnostics-columns { grid-template-columns: 1fr; }
  .whitelist-table-panel { grid-column: auto; }
}
@media (max-width: 620px) {
  .topbar { padding: 10px 12px; }
  .preview-badge, .account-copy { display: none; }
  .overview, .content-view { padding: 14px; }
  .hero-strip { align-items: flex-start; flex-direction: column; }
  .overview-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .map-toolbar { right: 10px; left: 10px; }
  .map-search { display: none; }
  .layer-toggle { padding: 8px; }
  .layer-toggle span { display: none; }
  .map-player-panel { top: 56px; right: 10px; width: 210px; }
  .map-player-list { max-height: 180px; }
  .map-player-row { grid-template-columns: 1fr; gap: 2px; }
  .density-panel { right: 10px; bottom: 52px; left: 58px; width: auto; }
  .density-legend, .density-panel small { display: none; }
  .content-heading { align-items: flex-start; flex-direction: column; }
  .preset-grid, .effect-list, .backup-time-grid { grid-template-columns: 1fr; }
  .storm-row { grid-template-columns: 1fr; }
  .environment-result-panel { align-items: flex-start; flex-direction: column; }
  .settings-actions-panel { align-items: flex-start; flex-direction: column; }
  .environment-result-panel > p { text-align: left; }
  .mini-grid { grid-template-columns: 1fr; }
  .backup-create-card { align-items: flex-start; flex-direction: column; }
  .console-heading-actions, .console-footer { align-items: flex-start; flex-direction: column; }
  .console-output { max-height: 65vh; }
  .inline-action-form { grid-template-columns: 1fr; }
  .rack-grid { grid-template-columns: 1fr; }
  .operation-countdown { padding-inline: 14px; }
  .login-card { padding: 26px; }
}
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 230px;
}

.danger-text {
  color: var(--danger, #ef8f8f);
}
.update-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.update-card { display: flex; flex-direction: column; gap: 14px; }
.update-card .wide { margin-top: auto; }
.update-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.update-facts div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.12); }
.update-facts dt { color: var(--muted); font-size: .75rem; margin-bottom: 7px; }
.update-facts dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.workshop-list { display: grid; gap: 8px; max-height: 390px; overflow: auto; padding-right: 4px; }
.workshop-update-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.workshop-update-row strong, .workshop-update-row small { display: block; }
.workshop-update-row small { color: var(--muted); margin-top: 3px; }
.workshop-update-row a { color: inherit; text-decoration: none; }
.workshop-update-row.update { border-color: rgba(245,166,35,.55); background: rgba(245,166,35,.06); }
.workshop-update-row.preserved { border-color: #597581; background: rgba(75,115,133,.09); }
.workshop-policy { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.update-check-grid { margin: 14px 0; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 1050px) {
  .update-grid { grid-template-columns: 1fr; }
  .update-check-grid, .update-facts { grid-template-columns: 1fr; }
}
/* Warnings use the existing dark panel language, with a distinct 3/3 state. */
.warnings-view { padding: 24px; overflow: auto; }
.warnings-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.5fr); gap: 20px; align-items: start; }
.warnings-grid .field { margin-bottom: 14px; }
.warnings-grid hr { border: 0; border-top: 1px solid #35432e; margin: 24px 0; }
#warningDiscordIdentity { margin-top: 16px; padding: 12px; border: 1px solid #35432e; border-radius: 9px; overflow-wrap: anywhere; }
#warningDiscordAvatar { border-radius: 50%; }
#warningLinkCurrent { overflow-wrap: anywhere; }
.warnings-grid textarea { width: 100%; resize: vertical; min-height: 60px; font: inherit; color: inherit; background: #0e140f; border: 1px solid #35432e; border-radius: 9px; padding: 10px; }
.warnings-filters { display: grid; grid-template-columns: 1fr 180px; gap: 12px; }
.warnings-list { display: grid; gap: 12px; }
.warning-card { border: 1px solid #35432e; border-radius: 10px; padding: 14px; overflow-wrap: anywhere; }
.warning-card summary { cursor: pointer; }
.warning-card summary strong, .warning-card summary span, .warning-card summary small { display: block; margin: 5px 0; }
.warning-card summary small { color: #aab6a0; }
.warning-card.warning-limit { border-color: #bb574c; background: #291b18; }
.warning-card.warning-limit summary strong { color: #ffb2a8; }
@media (max-width: 1000px) { .warnings-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .warnings-filters { grid-template-columns: 1fr; } .warnings-view { padding: 12px; } }

.sandbox-banner{position:relative;z-index:1000;padding:10px 16px;background:#f2bf58;color:#171a12;font:600 13px/1.5 sans-serif;text-align:center}.sandbox-banner a{color:#171a12;text-decoration:underline}.login-screen{padding-top:55px}
