*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  color: #e0e0e0;
}

/* ── Canvas container ── */
#game-container {
  position: fixed;
  inset: 0;
  bottom: 110px; /* leave room for toolbar + bottom-bar */
}

#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Bottom HUD ── */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #0d0d1a;
  border-top: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 12px;
  z-index: 100;
}

#bottom-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

#bottom-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#city-name-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

#city-name-display {
  font-weight: 600;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

#btn-edit-city-name {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 0.8em;
  padding: 1px 2px;
  line-height: 1;
}
#btn-edit-city-name:hover { color: #fff; }

#speed-controls {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
}

#speed-controls button {
  padding: 2px 6px;
  border: 1px solid #2a2a45;
  background: transparent;
  color: #666;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.4;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}
#speed-controls button:hover {
  background: #1e1e3a;
  border-color: #444;
  color: #ccc;
}
.speed-btn.active {
  background: #2a2a5a;
  border-color: #6060cc;
  color: #aac8ff;
}

/* RCI bars in toolbar group */
#group-rci .rci-bars {
  margin-left: 0;
  height: 38px;
}

.stat {
  white-space: nowrap;
  font-size: 12px;
  color: #ccc;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
}

.stat.warning { color: #ff7043; }
.stat.ok      { color: #81c784; }

/* RCI demand bars */
.rci-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 34px;
}

.rci-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #aaa;
}

.rci-track {
  width: 12px;
  height: 24px;
  background: #1e1e2e;
  border: 1px solid #444;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.rci-fill {
  width: 100%;
  transition: height 0.5s ease;
  border-radius: 1px;
}

.rci-r { background: #66bb6a; }
.rci-c { background: #42a5f5; }
.rci-i { background: #9e9e9e; }

.rci-min-badge {
  font-size: 8px;
  color: #888;
  line-height: 1;
  display: block;
  text-align: center;
}

/* ── Toolbar ── */
#toolbar {
  position: fixed;
  bottom: 50px;
  left: 0;
  right: 0;
  height: 54px;
  background: #12122a;
  border-top: 1px solid #2a2a45;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  z-index: 100;
  overflow-x: auto;
  overflow-y: hidden;
}

#toolbar::-webkit-scrollbar { height: 3px; }
#toolbar::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border-right: 1px solid #2a2a45;
  height: 100%;
}

.toolbar-group:last-child { border-right: none; }

.toolbar-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
  white-space: nowrap;
}

#toolbar button {
  padding: 4px 8px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}

#toolbar button:hover:not(.locked):not(:disabled) {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}

#toolbar button.active {
  background: #3a3a70;
  border-color: #6060cc;
  color: #fff;
}

#toolbar button.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Zone button accent colors */
.btn-zone-r { border-left: 3px solid #66bb6a; }
.btn-zone-c { border-left: 3px solid #42a5f5; }
.btn-zone-i { border-left: 3px solid #9e9e9e; }

/* ── Info Panel ── */
#info-panel {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 210px;
  background: rgba(13, 13, 26, 0.92);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  z-index: 200;
  backdrop-filter: blur(4px);
}

#info-panel.hidden { display: none; }

#info-panel-title {
  font-size: 13px;
  font-weight: bold;
  color: #aac8ff;
  margin-bottom: 8px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

#info-panel-body {
  font-size: 12px;
  color: #ccc;
  line-height: 1.7;
}

#info-panel-body .row {
  display: flex;
  justify-content: space-between;
}

#info-panel-body .label { color: #888; }
#info-panel-body .value { color: #ddd; font-weight: 500; }

/* Progress bars — info panel (land value / desirability) */
.info-pbar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ddd;
  font-weight: 500;
}
.info-pbar-track {
  display: inline-block;
  width: 64px;
  height: 7px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
}
.info-pbar-fill {
  display: block;
  height: 100%;
  background: #4caf50;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Progress bars — debug panel */
.dbg-pbar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dbg-pbar-track {
  display: inline-block;
  width: 56px;
  height: 6px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
}
.dbg-pbar-fill {
  display: block;
  height: 100%;
  background: #4caf50;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Notification toast ── */
#notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 50, 0.95);
  border: 1px solid #555;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  color: #fff;
  z-index: 300;
  pointer-events: none;
  transition: opacity 0.4s;
}

#notification.hidden { opacity: 0; pointer-events: none; }
#notification.levelup {
  border-color: #ffd54f;
  color: #ffd54f;
  font-size: 16px;
  font-weight: bold;
}
#notification.error {
  border-color: #ef5350;
  color: #ef9a9a;
}

/* ── Drag-to-build cost tooltip ── */
#drag-info {
  position: fixed;
  bottom: 115px;   /* sits just above the toolbar */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 30, 0.88);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 4px 14px;
  font-size: 12px;
  color: #e0e0e0;
  pointer-events: none;
  z-index: 150;
  white-space: nowrap;
  backdrop-filter: blur(3px);
}

#drag-info.hidden { display: none; }

/* ── Debug panel ── */
#debug-panel {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 260px;
  background: rgba(8, 8, 20, 0.92);
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 11px;
  color: #ccc;
  z-index: 200;
  backdrop-filter: blur(3px);
}
#debug-panel.hidden { display: none; }

#debug-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid #333;
  font-size: 11px;
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#debug-close {
  background: none;
  border: none;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
#debug-close:hover { color: #fff; }

#debug-body {
  padding: 6px 8px;
  line-height: 1.9;
}
.dbg-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.dbg-label { color: #666; }
.dbg-value { color: #e0e0e0; font-variant-numeric: tabular-nums; }
.dbg-section {
  color: #555;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
  border-top: 1px solid #1e1e30;
  padding-top: 3px;
}
.dbg-good { color: #81c784; }
.dbg-bad  { color: #e57373; }

#debug-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(8,8,20,0.85);
  border: 1px solid #444;
  color: #888;
  font-size: 11px;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  z-index: 201;
}
#debug-toggle.hidden { display: none; }
#debug-toggle:hover { color: #fff; border-color: #666; }

/* ── Debug hover tooltip ── */
#debug-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  background: rgba(6, 8, 18, 0.93);
  border: 1px solid #39ff8a;
  border-radius: 6px;
  padding: 8px 11px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.75;
  color: #c8ffd4;
  white-space: pre;
  max-width: 280px;
  box-shadow: 0 0 12px rgba(57,255,138,0.18);
}
#debug-tooltip.hidden { display: none; }
#debug-tooltip .dbgt-header { color: #39ff8a; font-weight: bold; margin-bottom: 2px; }
#debug-tooltip .dbgt-key    { color: #7ecfff; }
#debug-tooltip .dbgt-val    { color: #ffe97e; }
#debug-tooltip .dbgt-warn   { color: #ff7e7e; }

/* ── Clickable stats ── */
.clickable-stat {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.clickable-stat:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 4px;
}

/* ── Modal overlay ── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-overlay.hidden { display: none; }

#modal-box {
  background: #0d0d1f;
  border: 1px solid #444;
  border-radius: 8px;
  width: min(520px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

#modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

#modal-header {
  font-size: 15px;
  font-weight: bold;
  color: #aac8ff;
}

#modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
#modal-close:hover { background: #222; color: #fff; }

#modal-body {
  overflow-y: auto;
  padding: 14px 16px 16px;
  flex: 1;
}
#modal-body::-webkit-scrollbar { width: 5px; }
#modal-body::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Modal sections */
.modal-section {
  margin-bottom: 14px;
}
.modal-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #666;
  margin-bottom: 6px;
}

/* Modal table */
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.modal-table th {
  text-align: left;
  color: #666;
  font-weight: normal;
  padding: 2px 4px 4px;
  border-bottom: 1px solid #222;
  font-size: 11px;
}
.modal-table td {
  padding: 4px 4px;
  border-bottom: 1px solid #1a1a2a;
  vertical-align: top;
}
.modal-label { color: #aaa; }
.modal-value { color: #eee; text-align: right; }
.modal-note  { color: #666; font-size: 11px; padding-left: 8px; }

.total-row td  { border-top: 1px solid #444; color: #fff; font-weight: bold; padding-top: 6px; }
.zone-r td:first-child { color: #81c784; }
.zone-c td:first-child { color: #64b5f6; }
.zone-i td:first-child { color: #b0b0b0; }
.modal-sub-row td { color: #888; font-size: 11px; }
.modal-sub-row td.modal-label::before { content: '└ '; }

/* Employment split bar ─────────────────────────────────── */
.emp-bar-track {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: #0e0e1e;
  margin-bottom: 5px;
}
.emp-bar-employed   { background: #43a047; flex-shrink: 0; }
.emp-bar-unemployed { background: #e53935; flex-shrink: 0; }
.emp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.emp-label-good { color: #81c784; }
.emp-label-bad  { color: #e57373; }

/* Zone occupation bars ─────────────────────────────────── */
.zone-occ-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 12px;
}
.zone-occ-label { width: 90px; flex-shrink: 0; font-size: 11px; }
.zone-occ-track {
  flex: 1;
  height: 8px;
  background: #0e0e1e;
  border-radius: 4px;
  overflow: hidden;
}
.zone-occ-fill  { height: 100%; border-radius: 4px; transition: width 0.3s; }
.zone-occ-r     { background: #43a047; }
.zone-occ-c     { background: #1e88e5; }
.zone-occ-i     { background: #757575; }
.zone-occ-count { color: #888; font-size: 11px; white-space: nowrap; }

/* Population modal bars ─────────────────────────────────── */
.pop-emp-bar-wrap {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a2a;
  margin-bottom: 6px;
}
.pop-emp-green {
  display: block;
  height: 100%;
  background: #388e3c;
  transition: width 0.3s;
}
.pop-emp-red {
  display: block;
  height: 100%;
  background: #c62828;
  transition: width 0.3s;
}
.pop-emp-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #888;
  flex-wrap: wrap;
}

/* Zone occupancy progress bars */
.pop-zone-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.pop-zone-bar-track {
  flex: 1;
  height: 8px;
  background: #1a1a2a;
  border-radius: 3px;
  overflow: hidden;
}
.pop-zone-bar-fill {
  display: block;
  height: 100%;
  background: #4a7c59;
  border-radius: 3px;
  transition: width 0.3s;
}
.pop-zone-bar-label {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* Net balance line */
.modal-net {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}
.net-positive { color: #81c784; }
.net-negative { color: #e57373; }

.modal-sub {
  font-size: 11px;
  color: #888;
  margin-bottom: 12px;
}

/* Modifier rows */
.modifier-row.mod-good td.modal-label { color: #81c784; }
.modifier-row.mod-bad  td.modal-label { color: #e57373; }
.modifier-row td.modal-value { color: #ddd; text-align: right; white-space: nowrap; }

/* RCI demand blocks */
.rci-demand-block h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: none;
  color: #ccc;
  letter-spacing: 0;
}
.rci-letter {
  font-size: 14px;
  font-weight: bold;
}
.rci-r-txt { color: #81c784; }
.rci-c-txt { color: #64b5f6; }
.rci-i-txt { color: #b0b0b0; }
.rci-demand-val {
  margin-left: auto;
  font-size: 11px;
  color: #888;
  font-weight: normal;
}

.modal-hint {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
}

/* ── Speed controls (bottom bar) ── */
.speed-group {
  display: flex;
  gap: 2px;
  align-items: center;
  margin: 0 6px;
}

.speed-group button {
  padding: 2px 5px;
  border: 1px solid #2a2a45;
  background: transparent;
  color: #666;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.4;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}
.speed-group button:hover {
  background: #1e1e3a;
  border-color: #444;
  color: #ccc;
}
.speed-group button.speed-active {
  background: #2a2a5a;
  border-color: #6060cc;
  color: #aac8ff;
}

/* ── Toolbar flyout menus ── */
.toolbar-flyout {
  position: fixed;
  background: #12122a;
  border: 1px solid #2a2a45;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px;
  z-index: 150;
  max-width: 400px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}
.toolbar-flyout.hidden { display: none; }

.flyout-label {
  width: 100%;
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

/* Flyout buttons mirror #toolbar button styles (they live outside #toolbar). */
.toolbar-flyout button {
  padding: 4px 8px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}
.toolbar-flyout button:hover:not(.locked) {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}
.toolbar-flyout button.active {
  background: #3a3a70;
  border-color: #6060cc;
  color: #fff;
}
.toolbar-flyout button.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Toggle button that replaces a collapsed toolbar group */
.toolbar-menu-toggle {
  padding: 4px 10px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}
.toolbar-menu-toggle:hover {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}
/* Toggle is highlighted when a tool from its group is active */
.toolbar-menu-toggle.menu-group-active {
  background: #3a3a70;
  border-color: #6060cc;
  color: #fff;
}

/* ── Pause overlay ── */
#pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
#pause-overlay.hidden { display: none; }

#pause-panel {
  background: #0d0d1f;
  border: 1px solid #444;
  border-radius: 10px;
  width: min(300px, 90vw);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
}

#pause-title {
  font-size: 18px;
  font-weight: bold;
  color: #aac8ff;
  text-align: center;
}

#pause-subtitle {
  font-size: 11px;
  color: #555;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.pause-divider {
  height: 1px;
  background: #222;
  margin: 4px 0;
}

.pause-btn {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.pause-btn:hover:not(:disabled) {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}
.pause-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pause-primary {
  background: #2a3a70;
  border-color: #4a5aaa;
  color: #aac8ff;
  font-weight: bold;
}
.pause-primary:hover {
  background: #3a4a80;
  border-color: #6a7acc;
}

.pause-secondary {
  background: #1e2a3a;
  border-color: #3a5070;
  color: #80b0d0;
  font-size: 0.82em;
}
.pause-secondary:hover {
  background: #263444;
  border-color: #4a6080;
}

.pause-danger {
  background: #3a1a1a;
  border-color: #7a3030;
  color: #ef9a9a;
}
.pause-danger:hover {
  background: #4a2020;
  border-color: #cc5555;
}

.pause-confirm {
  background: #151528;
  border: 1px solid #2a1a1a;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pause-confirm.hidden { display: none; }
.pause-confirm p {
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
}

.slot-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 2px;
}
.slot-picker.hidden { display: none; }

.slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #151528;
  border: 1px solid #222;
  border-radius: 5px;
}

.slot-label {
  font-size: 12px;
  color: #888;
  min-width: 42px;
  white-space: nowrap;
}

.slot-desc {
  font-size: 11px;
  color: #666;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-action-btn {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.1s, border-color 0.1s;
}
.slot-action-btn:hover:not(:disabled) {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}
.slot-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#pause-footer {
  font-size: 10px;
  color: #444;
  text-align: center;
  letter-spacing: 0.5px;
}


/* ── Pause menu settings section ── */
.pause-section {
  padding: 8px 0 4px;
}

.pause-section h3 {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
  color: #ccc;
}

.setting-row span {
  flex: 1;
}

.setting-toggle {
  flex-shrink: 0;
  padding: 4px 12px;
  border: 1px solid #333;
  background: #1e1e3a;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.1s, border-color 0.1s;
}

.setting-toggle:hover {
  background: #2a2a50;
  border-color: #555;
  color: #fff;
}

/* ── Cost toast ── */
.cost-toast {
  position: fixed;
  font-size: 1.0rem;
  font-weight: bold;
  color: #ff4444;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  animation: cost-toast-rise 2s ease-out forwards;
}

@keyframes cost-toast-rise {
  0%   { opacity: 1; transform: translate(-50%, -50%); }
  20%  { opacity: 1; transform: translate(-50%, -80%); }
  100% { opacity: 0; transform: translate(-50%, -200%); }
}

/* ── City level tooltip ── */
.level-tooltip {
  position: fixed;
  z-index: 600;
  background: rgba(6, 8, 18, 0.96);
  border: 1px solid #4a9eff;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 240px;
  font-size: 12px;
  color: #cce4ff;
  box-shadow: 0 0 16px rgba(74,158,255,0.2);
  pointer-events: none;
}
.level-tooltip.hidden { display: none; }
.lvlt-title  { font-size: 14px; font-weight: bold; color: #7ec8ff; margin-bottom: 6px; }
.lvlt-pop    { margin-bottom: 4px; }
.lvlt-next   { color: #aac8ff; margin-bottom: 6px; font-size: 11px; }
.lvlt-bar-wrap { background: #1a2a3a; border-radius: 4px; height: 8px; margin-bottom: 4px; overflow: hidden; }
.lvlt-bar    { height: 100%; background: linear-gradient(90deg, #2266cc, #4a9eff); border-radius: 4px; transition: width 0.3s; }
.lvlt-pct    { font-size: 11px; color: #7ec8ff; margin-bottom: 8px; }
.lvlt-divider { border-top: 1px solid #1e3050; margin: 6px 0; }
.lvlt-levels  { font-size: 10px; line-height: 1.8; }
.lvlt-row    { display: flex; justify-content: space-between; color: #556677; }
.lvlt-row.done { color: #4488aa; }
.lvlt-row.cur  { color: #7ec8ff; font-weight: bold; }
