/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0d1117;
  --panel:        #161b22;
  --panel-light:  #1c2333;
  --border:       #30363d;
  --amber:        #f0a500;
  --amber-dim:    #a87400;
  --teal:         #00d4aa;
  --red:          #e05c5c;
  --muted:        #8b949e;
  --text:         #e6edf3;
  --text-dim:     #c9d1d9;
  --font-mono:    'Courier New', 'JetBrains Mono', monospace;
  --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:       6px;
  --radius-lg:    12px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.5;
  overflow: hidden;
}

/* ===== Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#header {
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(7,10,15,0.98);
  border-bottom: 2px solid #1c2630;
  flex-shrink: 0;
  height: 72px;
  font-family: var(--font-mono);
  gap: 0;
}
#header.hidden { display: none; }

.hdr-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-right: 24px;
  border-right: 1px solid #1c2630;
  flex-shrink: 0;
}
.hdr-logout-section {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-right: 1px solid #1c2630;
  flex-shrink: 0;
}

#header .logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--amber);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hdr-handle {
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0;
}

.hdr-city-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdr-city {
  font-size: 26px;
  font-weight: bold;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hdr-stats {
  display: flex;
  align-items: center;
  padding-left: 20px;
  border-left: 1px solid #1c2630;
  flex-shrink: 0;
}

.hdr-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 14px;
}

.hdr-chip--xp {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.hdr-lbl {
  font-size: 14px;
  color: #4a6070;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.hdr-val {
  font-size: 24px;
  font-weight: bold;
  color: #c0d0e0;
  white-space: nowrap;
}
.hdr-val.good  { color: var(--teal); }
.hdr-val.warn  { color: var(--red);  }
.hdr-val.muted { color: #506070;     }
.cond-good { color: #4caf50; }
.cond-fair { color: #f0c040; }
.cond-poor { color: #e05050; }
.hdr-chip--clock { background: #0c0800; border-radius: 4px; padding: 4px 10px; border: 1px solid #2a1800; box-shadow: inset 0 1px 4px rgba(0,0,0,0.7); }
.hdr-clock-val { font-family: 'DSEG7Classic', 'Courier New', monospace; color: #ff9800; font-size: 18px; letter-spacing: 0.05em; text-shadow: 0 0 6px rgba(255,152,0,0.9), 0 0 14px rgba(255,120,0,0.4); }

.hdr-divider {
  width: 1px;
  height: 36px;
  background: #1c2630;
  flex-shrink: 0;
}

.hdr-xp-track {
  width: 64px;
  height: 6px;
  background: #1c2630;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.hdr-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #0080d0, #00b8f0);
  border-radius: 2px;
  transition: width 0.4s ease;
}

#view-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== Views ===== */
.view { display: none; height: 100%; }
.view.active { display: flex; }

/* ===== Onboarding ===== */
#view-onboarding {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #161b22 0%, #0d1117 100%);
}

.onboarding-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 560px;
  max-width: 95vw;
}

.onboarding-card h1 {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 28px;
  letter-spacing: 6px;
  text-align: center;
  margin-bottom: 4px;
}

.onboarding-card .tagline {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.step-dot.active { background: var(--amber); }
.step-dot.done   { background: var(--teal); }

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

.onboarding-step h2 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: var(--muted);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.form-group input[type="text"] {
  width: 100%;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: var(--amber);
}

.hub-cards, .truck-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.hub-card, .truck-card {
  flex: 1;
  background: var(--panel-light);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.hub-card:hover, .truck-card:hover {
  border-color: var(--amber-dim);
  background: #1f2937;
}

.hub-card.selected, .truck-card.selected {
  border-color: var(--amber);
  background: #1f2430;
}

.hub-card .hub-icon, .truck-card .truck-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.hub-card .hub-name, .truck-card .truck-name {
  font-weight: bold;
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 4px;
}

.hub-card .hub-desc, .truck-card .truck-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.truck-card .truck-stat {
  margin-top: 8px;
  font-size: 11px;
}

.truck-card .stat-good { color: var(--teal); }
.truck-card .stat-bad  { color: var(--red); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-transform: uppercase;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--amber);
  color: #0d1117;
  width: 100%;
}

.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.btn-secondary {
  background: var(--panel-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--amber); }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-teal {
  background: var(--teal);
  color: #0d1117;
}

.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-xs { padding: 3px 9px; font-size: 11px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

.error-msg {
  color: var(--red);
  font-size: 15px;
  margin-top: 8px;
  min-height: 16px;
}

/* ===== Job Board ===== */
#view-jobboard {
  flex-direction: row;
}

.jobboard-left {
  width: 360px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jobboard-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.jobboard-header h2 {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.jobboard-header .location {
  color: var(--muted);
  font-size: 14px;
}

.job-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.job-card:hover { border-color: var(--amber-dim); }
.job-card.selected { border-color: var(--amber); }

.job-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 15px;
}

.job-route .origin { color: var(--teal); }
.job-route .arrow  { color: var(--muted); }
.job-route .dest   { color: var(--amber); }

.job-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.job-meta .pay          { color: var(--teal); font-weight: bold; }
.job-meta .pay-per-mile { color: var(--text-dim); font-size: 12px; }
.job-meta .xp           { color: var(--amber); }
.job-meta .legs         { color: var(--text-dim); }

.job-cargo {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.job-tutorial-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
}

.job-accept-bar {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.jobboard-right { flex: 1; }

/* ===== Driving View ===== */
#view-driving {
  flex-direction: row;
}

.driving-map { flex: 1; position: relative; }

.driving-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  overflow-y: auto;
}

.panel-section h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* HOS Bars */
.hos-bar-wrap {
  margin-bottom: 10px;
}

.hos-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.hos-bar-label .val { color: var(--text); }

.hos-bar {
  height: 10px;
  background: var(--panel-light);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hos-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.hos-bar-fill.low   { background: var(--red); }
.hos-bar-fill.med   { background: #f0c040; }

.hos-segments {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}

.hos-seg {
  flex: 1;
  height: 14px;
  border-radius: 2px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  transition: background 0.3s;
}

.hos-seg.filled { background: var(--amber); border-color: var(--amber); }
.hos-seg.filled.low { background: var(--red); border-color: var(--red); }

/* Stat rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: var(--muted); }
.stat-row .value { font-family: var(--font-mono); color: var(--text); }
.stat-row .value.money  { color: var(--teal); }
.stat-row .value.warn   { color: var(--red); }
.stat-row .value.good   { color: var(--teal); }

/* Drive button */
.drive-btn-wrap {
  margin-top: auto;
  padding-top: 8px;
}

/* Event feed */
.event-feed {
  position: absolute;
  bottom: 16px;
  left: 16px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 500;
}

.event-toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  animation: slideIn 0.3s ease, fadeOut 0.5s ease 4.5s forwards;
}

.event-toast.good { border-left-color: var(--teal); }
.event-toast.bad  { border-left-color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 420px;
  max-width: 95vw;
}

.modal-box h2 {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 16px;
  margin-bottom: 8px;
}

.modal-box .modal-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Rest View ===== */
#view-rest {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  overflow-y: auto;
}

.rest-header {
  text-align: center;
  padding: 40px 20px 20px;
  width: 100%;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.rest-header h2 {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.rest-timer {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: bold;
  color: var(--amber);
  letter-spacing: 4px;
}

.rest-timer.done { color: var(--teal); }

.rest-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.rest-content {
  width: 100%;
  max-width: 900px;
  padding: 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  width: 100%;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }

.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: block; }

/* CB Radio */
.cb-messages {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
}

.cb-msg { margin-bottom: 2px; }
.cb-msg .handle { color: var(--amber); }
.cb-msg .ch     { color: var(--muted); font-size: 11px; }
.cb-msg .text   { color: var(--text-dim); }

/* Skills */
.skill-tree {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.skill-branch {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.skill-branch h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}

.skill-item:last-child { border-bottom: none; }
.skill-item .skill-name { color: var(--text-dim); }
.skill-item .skill-cost { color: var(--muted); font-family: var(--font-mono); }
.skill-item.locked      { opacity: 0.5; }

.skill-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-light);
  border: 1px solid var(--amber);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 16px;
}

/* Garage */
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.upgrade-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.upgrade-card .upgrade-icon { font-size: 24px; margin-bottom: 8px; }
.upgrade-card .upgrade-name {
  font-weight: bold;
  font-size: 20px;
  color: var(--text);
  margin-bottom: 4px;
}
.upgrade-card .upgrade-desc { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.upgrade-card .upgrade-cost { font-family: var(--font-mono); font-size: 15px; color: var(--amber); }

/* ===== Delivery / Trip Summary ===== */
#view-delivery {
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  background: var(--bg);
  padding: 0 16px;
}

.dlv-wrap {
  width: 100%;
  max-width: 700px;
  padding: 32px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dlv-header { text-align: center; }
.dlv-check  { font-size: 52px; margin-bottom: 4px; }
.dlv-title  {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 30px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.dlv-route {
  font-size: 20px;
  color: var(--text-dim);
  line-height: 1.4;
}

.dlv-levelup {
  background: linear-gradient(135deg, #1f2430, #2a1f10);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 20px;
  letter-spacing: 2px;
  animation: pulse 0.6s ease;
}
.dlv-skillpt {
  background: linear-gradient(135deg, #0d1a22, #101a2a);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 17px;
  letter-spacing: 1px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.03); }
}

.dlv-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .dlv-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dlv-stat-val   { font-size: 22px; }
}
.dlv-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center;
}
.dlv-stat-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1;
}
.dlv-stat-val.dlv-amber { color: var(--amber); }
.dlv-stat-lbl {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dlv-details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dlv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
}
.dlv-row:last-child { border-bottom: none; }
.dlv-row-payout { background: rgba(0,212,170,0.04); }
.dlv-lbl { color: var(--muted); }
.dlv-val { font-family: var(--font-mono); color: var(--text); }
.dlv-val.dlv-teal  { color: var(--teal); font-weight: bold; }
.dlv-val.dlv-large { font-size: 24px; }
.dlv-val.dlv-amber { color: var(--amber); font-weight: bold; }

.dlv-xp-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
}
.dlv-xp-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.dlv-xp-bar {
  height: 10px;
  background: var(--panel-light);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.dlv-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 5px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dlv-btn-exit {
  width: 100%;
  height: 58px;
  font-size: 20px;
}

/* ===== Map placeholder ===== */
#map { width: 100%; height: 100%; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ===== Utility ===== */
.hidden  { display: none !important; }
/* ── Login / Landing Screen ────────────────────────────────── */
#view-login {
  position: fixed; inset: 0;
  overflow: hidden;
  background: #0d1117;
  display: none;
}
#view-login.active { display: block; }

#login-road-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.lgn-panel {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
}
.lgn-panel.active { opacity: 1; pointer-events: all; }

/* Landing */
.lgn-lnd-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 36px;
  text-align: center; padding: 24px;
  position: relative; z-index: 1;
}
.lgn-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lgn-domain {
  font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--muted);
}
.lgn-title {
  font-family: 'Impact', 'Arial Narrow', 'Arial Black', sans-serif;
  font-size: clamp(72px, 14vw, 152px);
  font-weight: 900; color: var(--text);
  letter-spacing: 0.07em; line-height: 0.93;
  text-shadow: 0 0 80px rgba(0,212,170,0.2), 0 2px 0 rgba(0,0,0,0.6);
}
.lgn-tag {
  font-size: clamp(13px, 1.7vw, 17px);
  color: var(--muted); letter-spacing: 0.07em; margin-top: 4px;
}
.lgn-pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lgn-pill {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); padding: 5px 13px; border-radius: 1px;
}
.lgn-btn-hitroad {
  font-family: 'Impact', 'Arial Narrow', 'Arial Black', sans-serif;
  font-size: clamp(18px, 2.8vw, 24px); letter-spacing: 0.16em;
  background: var(--teal); color: #0d1117;
  border: none; padding: 18px 68px; cursor: pointer; border-radius: 2px;
  transition: background 0.14s, box-shadow 0.14s, transform 0.1s;
  box-shadow: 0 4px 28px rgba(0,212,170,0.25);
}
.lgn-btn-hitroad:hover {
  background: #1af0c4;
  box-shadow: 0 6px 40px rgba(0,212,170,0.4);
  transform: translateY(-1px);
}

/* Auth panel */
.lgn-auth-dim {
  position: absolute; inset: 0;
  background: rgba(5,8,13,0.78);
  backdrop-filter: blur(3px);
}
.lgn-auth-outer {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  width: 100%; padding: 24px 16px;
}
.lgn-card {
  background: var(--panel); border: 1px solid var(--border);
  width: 100%; max-width: 390px; border-radius: 3px; overflow: hidden;
}
.lgn-brand {
  font-family: 'Impact', 'Arial Narrow', 'Arial Black', sans-serif;
  font-size: 21px; letter-spacing: 0.24em;
  color: var(--teal); text-align: center;
  padding: 18px 0 15px; border-bottom: 1px solid var(--border);
}
.lgn-tabs { display: flex; border-bottom: 1px solid var(--border); }
.lgn-tab {
  flex: 1; padding: 13px 12px;
  font-family: 'Impact', 'Arial Narrow', 'Arial Black', sans-serif;
  font-size: 12px; letter-spacing: 0.16em;
  background: transparent; color: var(--muted);
  border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.14s, background 0.14s;
}
.lgn-tab.active { color: var(--teal); background: rgba(0,212,170,0.08); border-bottom-color: var(--teal); }
.lgn-tab:hover:not(.active) { color: var(--text); }

.lgn-form { display: none; flex-direction: column; gap: 13px; padding: 22px 22px 20px; }
.lgn-form.active { display: flex; }

.lgn-field { display: flex; flex-direction: column; gap: 5px; }
.lgn-field label {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
.lgn-field input {
  background: #0d1117; border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-sans, 'Segoe UI', sans-serif);
  font-size: 15px; padding: 11px 12px; border-radius: 2px;
  outline: none; width: 100%;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.lgn-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.1);
}
.lgn-btn-submit {
  font-family: 'Impact', 'Arial Narrow', 'Arial Black', sans-serif;
  font-size: 16px; letter-spacing: 0.13em;
  background: var(--teal); color: #0d1117;
  border: none; padding: 14px; cursor: pointer;
  border-radius: 2px; width: 100%; margin-top: 4px;
  transition: background 0.14s;
}
.lgn-btn-submit:hover:not(:disabled) { background: #1af0c4; }
.lgn-btn-submit:disabled { opacity: 0.6; cursor: default; }

.lgn-error {
  font-size: 13px; color: #e05c5c;
  background: rgba(224,92,92,0.08);
  border: 1px solid rgba(224,92,92,0.25);
  border-radius: 2px; padding: 8px 12px;
}
.lgn-form-footer { text-align: center; padding-top: 2px; }
.lgn-link {
  font-size: 13px; color: var(--muted); cursor: pointer;
  background: none; border: none; padding: 4px;
  transition: color 0.14s;
}
.lgn-link:hover { color: var(--teal); }
.lgn-hint { font-size: 13px; color: var(--muted); line-height: 1.55; }
.lgn-sent-msg {
  font-size: 14px; color: var(--teal);
  background: rgba(0,212,170,0.07);
  border: 1px solid rgba(0,212,170,0.22);
  border-radius: 2px; padding: 12px 14px;
  text-align: center; line-height: 1.5; display: none;
}
.lgn-sent-msg.show { display: block; }
.lgn-back {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); padding: 7px 18px;
  cursor: pointer; border-radius: 2px;
  transition: color 0.14s, border-color 0.14s;
}
.lgn-back:hover { color: var(--text); border-color: var(--muted); }

.flex    { display: flex; }
.gap-8   { gap: 8px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.w-full  { width: 100%; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); font-size: 14px; }
.text-amber { color: var(--amber); }
.text-teal  { color: var(--teal); }
.text-red   { color: var(--red); }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Condition bar */
.condition-bar { height: 6px; border-radius: 3px; background: var(--panel-light); overflow: hidden; border: 1px solid var(--border); margin-top: 4px; }
.condition-fill { height: 100%; transition: width 0.4s; }
.condition-fill.great { background: var(--teal); }
.condition-fill.ok    { background: var(--amber); }
.condition-fill.bad   { background: var(--red); }

/* ===== Truck Dashboard HUD ===== */
#view-driving {
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
  gap: 10px;
}

.dash-wrap {
  background: #181818;
  border-radius: 16px;
  border: 2px solid #2a2a2a;
  padding: 20px 18px 16px;
  font-family: var(--font-sans);
  flex-shrink: 0;
}

.dash-top {
  display: grid;
  grid-template-columns: 1fr 210px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.gauge-group { display: flex; flex-direction: column; gap: 10px; }
.gauge-row   { display: flex; gap: 10px; justify-content: center; }
.gauge-wrap  { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.gauge-face {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: #0e0e0e;
  border: 2px solid #3a3a3a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
}
.gauge-face svg { position: absolute; top: 0; left: 0; }

.gauge-val  { font-size: 20px; font-weight: 500; color: #f0c040; font-family: var(--font-mono); position: relative; z-index: 1; }
.gauge-unit { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; position: relative; z-index: 1; }
.gauge-name { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.8px; }

/* Speed gauge row with +/- buttons */
.speed-ctrl-row { display: flex; align-items: center; gap: 6px; }
.speed-adj-btn {
  background: #222; border: 1.5px solid #444; border-radius: 6px;
  color: #f0c040; font-size: 13px; font-weight: bold; font-family: var(--font-mono);
  width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.speed-adj-btn:hover  { background: #2e2e2e; border-color: #f0c040; }
.speed-adj-btn:active { background: #1a1a1a; }
.speed-adj-btn:disabled { color: #444; border-color: #333; cursor: not-allowed; background: #1a1a1a; }


.speed-limit-lbl {
  font-size: 11px; letter-spacing: 0.5px;
  color: #555; font-family: var(--font-mono);
  text-align: center;
}
.speed-limit-lbl.over-limit { color: #e74c3c; }

/* Steering wheel center */
.wheel-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.odo-box { background: #0a0a0a; border: 1.5px solid #444; border-radius: 6px; padding: 4px 12px; font-family: var(--font-mono); font-size: 18px; color: #f0c040; letter-spacing: 3px; }
.odo-lbl { font-size: 9px; color: #555; text-transform: uppercase; letter-spacing: 1px; }

.status-row { display: flex; gap: 8px; margin-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2a2a2a; cursor: default; }
.dot.g { background: #27ae60; }
.dot.y { background: #f0c040; }
.dot.r { background: #e74c3c; }

/* HUD divider */
.hud-divider { height: 1px; background: #2a2a2a; margin: 6px 0 12px; }

/* Job info strip */
.hud-job-strip {
  display: flex; justify-content: space-between; align-items: center;
  background: #111; border: 1px solid #2a2a2a; border-radius: 8px;
  padding: 6px 12px; margin-bottom: 10px;
  font-size: 12px; color: #888;
}
.hud-strip-val { color: #ccc; font-family: var(--font-mono); }
.hud-strip-val.money { color: #27ae60; }

/* HUD action buttons */
.hud-btn-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.act-btn {
  background: #222; border: 1.5px solid #3a3a3a; border-radius: 12px;
  padding: 16px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; color: #aaa; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.act-btn i { font-size: 28px; color: #f0c040; }
.act-btn:hover  { background: #2a2a2a; border-color: #555; }
.act-btn:active { transform: scale(0.95); background: #1a1a1a; border-color: #f0c040; }
.act-btn.on     { border-color: #27ae60; }
.act-btn.on i   { color: #27ae60; }
.act-btn:disabled, .act-btn[disabled] { opacity: 0.35; cursor: not-allowed; transform: none; }

/* HUD bars */
.hud-bar-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.hud-bar-card { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; padding: 8px 12px; }
.hud-bar-head { display: flex; justify-content: space-between; font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.hud-bar-track{ background: #1e1e1e; border-radius: 4px; height: 7px; overflow: hidden; }
.hud-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
.hud-bar-fill.amber { background: #f0c040; }
.hud-bar-fill.red   { background: #e74c3c; }
.hud-bar-fill.green { background: #27ae60; }

/* HUD toast */
.hud-toast { margin-top: 10px; text-align: center; font-size: 12px; color: #f0c040; letter-spacing: 0.4px; min-height: 16px; opacity: 0; transition: opacity 0.3s; }
.hud-toast.show { opacity: 1; }

/* Map panel (collapsible below HUD) */
.drive-map-panel { border-radius: 10px; overflow: hidden; border: 1px solid #2a2a2a; flex-shrink: 0; }
.drive-map-panel #drive-map { height: 320px; }

/* Job card via-cities line */
.job-via { font-size: 11px; color: var(--muted); margin: 2px 0 4px; }

/* ===== Story Onboarding ===== */
#view-onboarding {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, rgba(0,212,170,0.07) 0%, #0d1117 65%);
  gap: 20px;
  padding: 0;
  overflow-y: auto;
}

.story-dots {
  display: flex;
  gap: 10px;
  padding-top: 20px;
}
.story-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.story-dot.active { background: var(--teal); }
.story-dot.done   { background: var(--teal); opacity: 0.45; }

.story-screen { display: none; width: 100%; gap: 24px; align-items: center; }
.story-screen.active { display: flex; }

/* Screen 1: graduation — same card pattern as intro/arrival story screens */
#story-1 {
  flex-direction: column;
  align-items: center;
  max-width: min(980px, 96vw);
  width: 100%;
  margin: auto;
  gap: 0;
}
#story-1 .story-illustration {
  width: 100%;
  height: clamp(280px, 44vh, 480px);
  border-radius: 12px 12px 0 0;
  border: none;
  flex-shrink: 0;
}
#story-1 .story-img {
  object-fit: cover;
  object-position: top center;
}
#story-1 .story-card {
  flex: 0 0 auto;
  border-radius: 0 0 12px 12px;
  border-top: none;
  border: 1px solid rgba(0,212,170,0.2);
  max-width: 100%;
  align-self: stretch;
  margin: 0;
}

/* Screens 2 & 3 keep centered card layout */
#story-2, #story-3 {
  max-width: min(980px, 96vw);
  width: 100%;
  padding: 0 24px 24px;
}
#story-2 .story-card--center {
  max-width: 640px;
}

/* Story illustrations (screens 2 & 3) */
.story-illustration {
  flex-shrink: 0;
  width: 260px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(0,212,170,0.25);
  align-self: stretch;
  display: flex;
}
.story-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Story text card */
.story-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.story-card h2 {
  font-size: 20px;
  color: var(--teal);
  margin-bottom: 12px;
}
.story-card p {
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0;
}
.story-card--center {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.story-solo-icon { font-size: 48px; margin-bottom: 12px; }

/* Teal button overrides for onboarding */
#view-onboarding .btn-primary {
  background: var(--teal);
  color: #0d1117;
}
#view-onboarding .btn-secondary:hover:not(:disabled) {
  border-color: var(--teal);
}

/* ===== City Hub ===== */
#view-hub {
  flex-direction: column;
  overflow: hidden;
}

/* --- Hub resume button (floats over town canvas) --- */
.hub-resume-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(7,10,15,0.92);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: bold;
  padding: 10px 22px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s;
}
.hub-resume-btn:hover { background: rgba(240,160,0,0.12); }
.hub-resume-btn.hidden { display: none; }
.hub-resume-sub {
  color: #7090a0;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

/* --- Town Canvas --- */
.hub-town-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.hub-town-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}


/* River */
.hub-river-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.hub-river-back  { fill: none; stroke: var(--river-color, #162533); stroke-width: 5; }
.hub-river-front { fill: none; stroke: var(--river-color, #162533); stroke-width: 3.5; filter: brightness(1.4); }

/* Parks + Urban blocks */
.hub-park {
  position: absolute;
  background-color: var(--park-color, #0d1f14);
  border: 1px dashed rgba(255,255,255,0.07);
  border-radius: 10px;
  z-index: 2;
}
.hub-block {
  position: absolute;
  background-color: var(--block-color, #171f27);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 3px;
  z-index: 2;
}

/* Roads */
.hub-highway {
  position: absolute;
  background-color: var(--hw-color, #252e3a);
  z-index: 3;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.hub-hw-h::after {
  content: '';
  position: absolute;
  top: calc(50% - 1px);
  left: 0; width: 100%; height: 2px;
  background-image: linear-gradient(90deg, var(--stripe-color, #d4a000) 50%, transparent 50%);
  background-size: 2.5% 2px;
}
.hub-hw-v::after {
  content: '';
  position: absolute;
  left: calc(50% - 1px);
  top: 0; width: 2px; height: 100%;
  background-image: linear-gradient(var(--stripe-color, #d4a000) 50%, transparent 50%);
  background-size: 2px 5%;
}
.hub-spur {
  position: absolute;
  background-color: var(--spur-color, #1c2630);
  border: 1px solid rgba(255,255,255,0.04);
  z-index: 2;
}

/* Business nodes — each one IS a building tile */
.hub-biz-node {
  position: absolute;
  width: 340px;
  height: 80px;
  background: rgba(12, 16, 22, 0.93);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: 4px solid var(--shop-color, #00bcd4);
  border-radius: 3px;
  cursor: pointer;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px 12px 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.65);
  transition: box-shadow 0.15s, background 0.15s;
  overflow: hidden;
  user-select: none;
}
.hub-biz-node:hover {
  background: rgba(20, 26, 36, 0.97);
  box-shadow: 0 0 0 2px var(--shop-color, #00bcd4), 0 6px 22px rgba(0,0,0,0.75);
}
.hub-biz-name {
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  color: #dce8f0;
  line-height: 1.25;
  letter-spacing: 0.03em;
  position: relative;
  white-space: nowrap;
}
.hub-biz-sub {
  font-size: 15px;
  color: var(--shop-color, #00bcd4);
  margin-top: 2px;
  position: relative;
}
.hub-biz-node--locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.hub-biz-node--pulse {
  animation: hub-node-pulse 1.4s ease-in-out infinite;
}
@keyframes hub-node-pulse {
  0%, 100% { box-shadow: 0 0 0 0   var(--shop-color, rgba(0,212,170,0.7)), 0 4px 18px rgba(0,0,0,0.65); }
  50%       { box-shadow: 0 0 0 12px transparent,                           0 4px 18px rgba(0,0,0,0.65); }
}
.hub-biz-node--tutorial-disabled {
  opacity: 0.18;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hub toast */
.hub-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 15px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
  z-index: 100;
}
.hub-toast.show { opacity: 1; }

/* ===== Sub-views (Warehouse / Bank / TruckStop / TruckLot) ===== */
.subview-left {
  width: 360px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.subview-map-right {
  flex: 1;
  position: relative;
}
.subview-map-right #map {
  position: absolute;
  inset: 0;
}

.subview-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.subview-header h2 {
  font-size: 15px;
  color: var(--text);
  flex: 1;
}
.subview-header .location {
  font-size: 11px;
  color: var(--muted);
}

.subview-panel {
  width: 480px;
  max-width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.subview-panel--wide { width: 640px; }

#view-warehouse { flex-direction: row; }
#view-trucklot {
  flex-direction: row;
  background: var(--bg);
}
#view-truckstop {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  background: var(--bg);
}

#view-bank {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  background: var(--bg);
}

/* ===== Arrival banner (shown in warehouse after delivering) ===== */
.arrival-banner {
  margin: 0;
  padding: 10px 14px 12px;
  background: rgba(64, 200, 100, 0.10);
  border-bottom: 2px solid var(--teal);
  flex-shrink: 0;
}
.arrival-banner.hidden { display: none; }
.arrival-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}
.arrival-dismiss-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
.arrival-dismiss-btn:hover { color: var(--text); }
.arrival-route {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.arrival-stats {
  display: flex;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}
.arrival-pay  { color: var(--teal); }
.arrival-xp   { color: var(--amber, #f0c040); }
.arrival-legs { color: var(--text); }
.arrival-levelup {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--amber, #f0c040);
}
.arrival-levelup.hidden { display: none; }

/* ===== Warehouse ===== */
#wh-screen-contracts {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  max-width: 1400px;
}
#wh-screen-contracts .bank-scene-img-wrap {
  height: 200px;
}
#wh-screen-market {
  flex: 1; width: 100%; height: 100%;
  max-width: none; padding: 0; margin: 0; gap: 0; align-items: stretch;
  display: flex; flex-direction: column; overflow: hidden;
}
#market-map { flex: 1; min-height: 0; }

/* Shared map action bar (Supply & Demand + Hit the Road) */
.map-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 1001;
}
.map-action-bar h2 {
  flex: 1;
  font-size: 18px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  color: var(--amber);
  margin: 0;
}

/* Commodity filter bar */
#mkt-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px; background: rgba(0,0,0,0.25); border-bottom: 1px solid var(--border);
}
.mkt-filter-label {
  font-size: 13px; color: var(--text-muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-right: 4px;
}
.mkt-filter-btn {
  padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.05); color: var(--text); font-size: 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mkt-filter-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--teal); }
.mkt-filter-btn.active { background: var(--teal); border-color: var(--teal); color: #000; font-weight: 700; }

/* Legend — inside the action bar */
.mkt-map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.mkt-legend-supply { color: #2196f3; }
.mkt-legend-demand { color: #e91e8c; }
.mkt-legend-hint   { color: var(--text-muted); }

/* Leaflet popup — dark theme override */
.mkt-popup-wrap .leaflet-popup-content-wrapper {
  background: rgba(10, 22, 34, 0.95); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.7);
  padding: 0; color: var(--text);
}
.mkt-popup-wrap .leaflet-popup-tip { background: rgba(10, 22, 34, 0.95); }
.mkt-popup-wrap .leaflet-popup-content { margin: 0; }

/* Popup content */
.mkt-popup { min-width: 260px; padding-bottom: 6px; }
.mkt-popup-header {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: var(--amber); padding: 12px 16px 10px; border-bottom: 1px solid var(--border);
}
.mkt-popup-nodata { color: var(--text-muted); font-size: 15px; padding: 10px 16px; }
.mkt-popup-line {
  display: flex; flex-direction: column;
  padding: 10px 16px 6px;
}
.mkt-popup-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 4px;
}
.mkt-label-sale   { color: #2196f3; }
.mkt-label-demand { color: #e91e8c; }
.mkt-popup-val {
  font-size: 16px; color: var(--text); line-height: 1.4;
}
.mkt-popup-prices {
  padding: 8px 16px 6px; border-top: 1px solid var(--border); margin-top: 2px;
}
.mkt-popup-prices-hdr {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 5px;
}
.mkt-popup-price {
  font-size: 14px; color: var(--text); margin: 2px 0; display: flex; align-items: center; gap: 6px;
}
.mkt-popup-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 1px 5px; border-radius: 3px;
}
.mkt-tag-buy  { background: rgba(33,150,243,0.25); color: #64b5f6; }
.mkt-tag-sell { background: rgba(233,30,140,0.25); color: #f48fb1; }

/* ===== Warehouse market board ===== */
.wh-market-board {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--panel);
}
.wh-market-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.wh-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wh-market-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
}
.wh-mkt-icon { font-size: 13px; width: 18px; text-align: center; }
.wh-mkt-name { width: 100px; color: var(--text-dim); }
.wh-mkt-bar-wrap { display: flex; align-items: center; gap: 4px; flex: 1; }
.wh-mkt-bar-label { font-size: 11px; color: var(--muted); width: 42px; text-align: right; }
.wh-mkt-bar { flex: 1; height: 6px; background: var(--panel-light); border-radius: 3px; overflow: hidden; }
.wh-mkt-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.wh-mkt-fill.supply { background: var(--teal); opacity: 0.7; }
.wh-mkt-fill.demand.hot  { background: #e74c3c; }
.wh-mkt-fill.demand.warm { background: var(--amber); }
.wh-mkt-fill.demand.cold { background: var(--muted); opacity: 0.6; }
.wh-market-row--empty { opacity: 0.5; }
.wh-mkt-prices { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 110px; }
.wh-mkt-buy  { font-size: 13px; color: var(--teal); }
.wh-mkt-sell { font-size: 13px; color: var(--amber); }
.wh-mkt-oos  { color: var(--muted); font-style: italic; }

/* ===== Warehouse goods screen ===== */
.goods-card { overflow-y: auto; display: flex; flex-direction: column; max-height: 100%; gap: 10px; }
.goods-card #wh-goods-content { flex: 1; overflow-y: auto; }
.goods-card .wh-contracts-intro-header h2 { color: var(--teal); font-size: 20px; margin: 0; }
.goods-card .wh-contracts-intro-text { margin: 0; }
.goods-header { margin-bottom: 10px; }
.goods-header h2 { color: var(--teal); font-size: 18px; margin-bottom: 2px; }
.goods-trailer-info { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.goods-row-list { display: flex; flex-direction: column; gap: 6px; }
.goods-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.goods-row--empty { opacity: 0.45; }
.goods-row-info { display: flex; align-items: center; gap: 8px; flex: 0 0 130px; }
.goods-icon { font-size: 18px; line-height: 1; }
.goods-row-name { font-weight: 600; font-size: 15px; color: var(--text); }
.goods-row-meta { font-size: 12px; color: var(--text-dim); }
.goods-supply-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.goods-supply-label { font-size: 11px; color: var(--muted); }
.goods-supply-bar-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.goods-supply-bar-fill { height: 100%; background: var(--teal); opacity: 0.7; border-radius: 3px; transition: width 0.4s ease; }
.goods-price { flex: 0 0 75px; text-align: right; color: var(--amber); font-weight: 600; font-size: 13px; }
.goods-buy-ctrl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.goods-auto-buy { white-space: nowrap; min-width: 160px; }
.goods-out-of-stock { font-size: 12px; color: var(--muted); font-style: italic; margin-left: auto; }

/* Sell panel */
.goods-sell-section { display: flex; flex-direction: column; gap: 10px; }
.goods-sell-section h2 { color: var(--teal); font-size: 18px; margin-bottom: 4px; }
.goods-loaded-card {
  background: var(--panel-light); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.goods-loaded-commodity { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.goods-loaded-detail { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.goods-sell-calc {
  background: var(--panel-light); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 15px; line-height: 1.8;
}
.goods-sell-payout { font-weight: 700; color: var(--amber); }
.goods-sell-profit-pos { color: #4caf50; font-weight: 700; }
.goods-sell-profit-neg { color: var(--red); font-weight: 700; }

.goods-sell-math { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.goods-sell-math-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; font-size: 15px; }
.goods-sell-math-lbl { color: var(--text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.goods-sell-math-expr { color: var(--text-dim); }
.goods-sell-math-val { text-align: right; font-weight: 600; font-family: var(--font-mono); }
.goods-sell-math-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.goods-demand-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.goods-demand-label { color: var(--text-dim); width: 55px; }
.goods-demand-bar { flex: 1; height: 6px; background: var(--panel-light); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.goods-demand-fill { height: 100%; border-radius: 3px; }
.goods-demand-fill.hot  { background: #e74c3c; }
.goods-demand-fill.warm { background: var(--amber); }
.goods-demand-fill.cold { background: var(--muted); opacity: 0.6; }
.goods-demand-num { color: var(--text-dim); font-size: 11px; width: 26px; text-align: right; }

/* ===== Warehouse contracts screen ===== */
.wh-contracts-content {
  width: 100%; display: flex; flex-direction: column; gap: 16px;
}
.wh-contracts-intro-header {
  display: flex; align-items: center; gap: 14px;
}
.wh-contracts-intro-header h2 { margin: 0; font-size: 22px; }
.wh-contracts-intro-text {
  margin: 0; font-size: 15px; color: var(--text-dim); line-height: 1.65;
}
.job-list {
  display: grid; gap: 16px;
}

/* Contract card */
.job-card {
  background: var(--panel-light); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: border-color 0.15s;
  overflow: hidden; display: flex; flex-direction: column;
}
.job-card:hover    { border-color: var(--amber-dim); }
.job-card.selected { border-color: var(--amber); background: rgba(240,165,0,0.06); }
.job-card--locked  { opacity: 0.45; cursor: default; border-color: var(--border); }
.job-card--locked:hover { border-color: var(--border); }
.job-locked-reason { font-size: 15px; color: var(--muted); padding: 0 16px 12px; }

.job-row {
  display: flex; flex-direction: column; padding: 16px; gap: 10px;
}
.job-col-company {
  font-size: 15px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--teal); padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.job-col-dest {
  font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--text); line-height: 1.2;
}
.job-dest-state { display: block; font-size: 15px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.job-col-cargo  { font-size: 17px; color: var(--text-dim); }
.job-col-legs   { font-size: 15px; color: var(--text-muted); }
.job-col-pay    { font-size: 26px; font-weight: 700; color: var(--amber); padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: baseline; gap: 10px; }
.job-col-ppm    { font-size: 15px; font-weight: 400; color: var(--text-muted); }
.job-priority-badge {
  float: right; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #0d1a26; background: #f0d500;
  padding: 2px 7px; border-radius: 4px; vertical-align: middle;
}
.job-card--special {
  border-color: #8a5cbf;
  background: linear-gradient(135deg, rgba(138,92,191,0.08) 0%, rgba(0,0,0,0) 60%);
}
.job-card--special:hover { border-color: #b07ae0; }
.job-special-badge {
  float: right; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #fff; background: #6a3caf;
  padding: 2px 7px; border-radius: 4px; vertical-align: middle;
}
.job-tutorial-note { font-size: 15px; color: var(--teal); padding: 0 16px 12px; }

.job-accept-bar {
  padding: 0;
}

/* ===== Truck Stop ===== */
.ts-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  padding: 28px 32px;
  margin: 0 auto;
  gap: 22px;
}
.ts-screen.hidden { display: none; }

.ts-lobby-name {
  font-size: 22px;
  font-weight: bold;
  color: var(--amber);
  margin: 12px 0 4px;
  letter-spacing: 0.5px;
}

/* Fuel screen */
.ts-fuel-wrap {
  width: 100%;
  max-width: 480px;
  padding: 0 16px 24px;
}
.ts-fuel-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.ts-fuel-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
  margin: 0 0 16px;
}
.ts-fuel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-dim);
}
#ts-fuel-pct { font-family: var(--font-mono); color: var(--amber); font-size: 17px; }
.ts-fuel-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.ts-fuel-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--text-dim);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.ts-fuel-total {
  font-size: 17px;
  color: var(--text);
  border-bottom: none;
  padding-top: 4px;
}
.ts-fuel-total strong { color: var(--teal); font-family: var(--font-mono); }
.ts-fuel-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.ts-fuel-actions .btn { flex: 1; }

/* Repair screen */
.ts-repair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.ts-repair-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.ts-repair-pct {
  font-size: 32px;
  font-family: var(--font-mono);
  color: var(--teal);
}
.ts-repair-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.ts-repair-tier {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.ts-repair-tier-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.ts-repair-tier-target {
  font-size: 13px;
  color: var(--text-dim);
}
.ts-repair-tier-pts {
  font-size: 15px;
  color: var(--teal);
  font-family: var(--font-mono);
}
.ts-repair-tier-cost {
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
  font-family: var(--font-mono);
}
.ts-repair-tier .btn {
  width: 100%;
  margin-top: 4px;
}
.ts-repair-tier.disabled {
  opacity: 0.45;
}


/* Arcade game screens (Road Dodger, Breakout, future games) */
#ts-screen-roadrunner,
#ts-screen-breakout,
#ts-screen-snake,
#ts-screen-si,
#ts-screen-tj {
  max-width: 100%;
  padding: 0;
  height: 100%;
  justify-content: stretch;
}
.ts-roadrunner-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #07070f;
  align-items: stretch;
}
.ts-roadrunner-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  flex-shrink: 0;
}
.btn-arcade-back {
  background: #e67e22;
  color: #000;
  border: none;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: bold;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.btn-arcade-back:hover { background: #d35400; }
.ts-roadrunner-game-row {
  display: flex;
  flex-direction: row;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  padding: 0 20px 12px;
  flex: 1;
  overflow: auto;
}
.ts-roadrunner-canvas-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
}
#ts-roadrunner-canvas,
#ts-breakout-canvas {
  display: block;
  border: 1px solid rgba(0,212,170,0.18);
  box-shadow: 0 0 40px rgba(0,212,170,0.08);
}
/* Arcade leaderboard panel */
.ts-arcade-leaderboard {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0,212,170,0.22);
  border-radius: 8px;
  padding: 20px 16px;
  min-width: 200px;
  max-width: 260px;
  flex-shrink: 0;
  margin-top: 4px;
}
.ts-arcade-lb-title {
  color: #00d4aa;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-align: center;
}
.ts-arcade-lb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ts-arcade-lb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-mono);
}
.ts-arcade-lb-item:last-child { border-bottom: none; }
.ts-arcade-lb-rank {
  color: #555;
  font-size: 13px;
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.ts-arcade-lb-rank--top { color: #f1c40f; }
.ts-arcade-lb-handle {
  color: #ccc;
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ts-arcade-lb-score {
  color: #00d4aa;
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
}
.ts-arcade-lb-empty {
  list-style: none;
  color: #555;
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

/* ===== Bank ===== */
.bank-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  padding: 28px 32px;
  margin: 0 auto;
  gap: 22px;
}
.bank-screen.hidden { display: none; }

.bank-scene-img-wrap {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(0,212,170,0.2);
  flex-shrink: 0;
}
.bank-scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.bank-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}
.bank-option-grid--narrow {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
}
.bank-option-grid--wide {
  grid-template-columns: repeat(4, 1fr);
}

.bank-opt-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.bank-opt-card:hover:not(.bank-opt-card--disabled) {
  border-color: var(--amber);
  background: var(--panel-light);
}
.bank-opt-card--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bank-opt-icon  { font-size: 38px; }
.bank-opt-name  { font-size: 20px; font-weight: bold; color: var(--text); }
.bank-opt-sub   { font-size: 15px; color: var(--muted); }

.bank-officer-intro {
  background: var(--panel);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius);
  padding: 20px 26px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dim);
  width: 100%;
  font-style: italic;
}

.bank-result-card {
  background: var(--panel);
  border: 1px solid rgba(240,165,0,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
}
.bank-result-card h2 {
  color: var(--red);
  font-size: 24px;
  margin-bottom: 14px;
}
.bank-result-card p {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.75;
}

/* ===== Bank Teller ===== */
.teller-card {
  background: var(--panel);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.teller-greeting {
  font-size: 17px;
  font-style: italic;
  color: var(--text-dim);
}

.teller-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--amber);
  margin: 0;
}

.teller-balances {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teller-balance-row,
.teller-avail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.teller-balance-label {
  font-size: 16px;
  color: var(--text-dim);
}

.teller-balance-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.teller-amount--red { color: var(--red); }

.teller-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teller-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 22px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.teller-input:focus { border-color: var(--amber); }

.teller-quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.teller-quick {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.teller-quick:hover {
  border-color: var(--amber);
  background: var(--panel);
}
.teller-quick--all {
  border-color: var(--amber);
  color: var(--amber);
}

.teller-error {
  background: rgba(220,50,50,0.1);
  border: 1px solid rgba(220,50,50,0.4);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--red);
}
.teller-error.hidden { display: none; }

.teller-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.teller-note {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}

/* ===== NYSE Terminal ===== */
#bank-screen-nyse {
  max-width: 100%;
  align-items: center;
}
#bank-screen-nyse .bank-scene-img-wrap {
  max-width: 900px;
  border: none;
  border-radius: 0;
  background: transparent;
}
#bank-screen-nyse #nyse-panel {
  width: 100%;
}
#bank-screen-nyse .bank-scene-img {
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.nyse-top-wrap {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.nyse-terminal {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px 0;
  background: transparent;
  color: #e0e8ff;
  box-sizing: border-box;
}
.nyse-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 0 4px;
}
.nyse-body {
  width: 100%;
}
.nyse-title {
  font-size: 24px;
  font-weight: 700;
  color: #7ec8ff;
  flex: 1;
}
.nyse-updated {
  font-size: 13px;
  color: #667;
}
.nyse-back-btn {
  margin-left: auto;
}
.nyse-activate-wrap {
  background: #111827;
  border: 1px solid #2a3a5c;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.nyse-activate-note {
  font-size: 16px;
  color: #a0b0d0;
  margin: 0 0 12px;
}
.nyse-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #7ec8ff;
  margin: 16px 0 10px;
  border-bottom: 1px solid #1e2d4a;
  padding-bottom: 6px;
}
.nyse-portfolio-summary {
  display: flex;
  gap: 24px;
  font-size: 16px;
  flex-wrap: wrap;
  background: #111827;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.nyse-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  width: 100%;
  padding: 0 28px 28px;
  box-sizing: border-box;
}
.nyse-card {
  background: #111827;
  border: 1px solid #1e2d4a;
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.nyse-card:hover {
  border-color: #3a5a8c;
}
.nyse-card--locked {
  opacity: 0.6;
}
.nyse-card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.nyse-ticker {
  font-size: 20px;
  font-weight: 700;
  color: #7ec8ff;
  min-width: 52px;
}
.nyse-price {
  font-size: 20px;
  font-weight: 600;
  color: #e0e8ff;
}
.nyse-change {
  font-size: 15px;
  font-weight: 600;
  margin-left: auto;
}
.nyse-gain { color: #4caf88; }
.nyse-loss { color: #e05555; }
.nyse-card-name {
  font-size: 15px;
  color: #8a9abb;
  margin-bottom: 8px;
}
.nyse-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #667;
  margin-bottom: 8px;
}
.nyse-owned {
  font-size: 14px;
  color: #7ec8ff;
  margin-bottom: 8px;
}
.nyse-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.nyse-loading, .nyse-error {
  padding: 40px;
  text-align: center;
  font-size: 18px;
  color: #667;
}
.nyse-error { color: #e05555; }
.nyse-muted { color: #667; }
.nyse-intro-text {
  background: #111827;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
.nyse-intro-text p {
  font-size: 16px;
  color: #a0b0d0;
  margin: 0 0 8px;
  line-height: 1.5;
}
.nyse-intro-text p:last-child { margin-bottom: 0; }

/* Detail screen */
#bank-screen-nyse-detail {
  max-width: 100%;
  align-items: stretch;
  padding: 0;
}
#bank-screen-nyse-detail .nyse-terminal {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px;
}
.nyse-chart-wrap {
  position: relative;
  width: 100%;
  background: #0d1320;
  border-bottom: 1px solid #1e2d4a;
  margin-bottom: 16px;
}
.nyse-sparkline {
  width: 100%;
  height: auto;
  display: block;
}
.nyse-chart-empty {
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #445;
  font-size: 16px;
}
.nyse-tooltip {
  position: absolute;
  background: #1a2540;
  border: 1px solid #3a5a8c;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  color: #e0e8ff;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transform: translateX(-50%);
}
.nyse-tooltip.hidden { display: none; }
.nyse-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  background: #0d1320;
  border-bottom: 1px solid #1e2d4a;
}
.nyse-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nyse-stat-label {
  font-size: 13px;
  color: #667;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nyse-stat-val {
  font-size: 20px;
  font-weight: 600;
  color: #e0e8ff;
}
.nyse-trade-panel {
  background: #111827;
  border: 1px solid #1e2d4a;
  border-radius: 8px;
  padding: 18px 22px;
  margin-top: 8px;
}
.nyse-trade-avail {
  font-size: 15px;
  color: #8a9abb;
  margin-bottom: 14px;
}
.nyse-qty-wrap {
  margin-bottom: 10px;
}
.nyse-qty-input {
  width: 100%;
  font-size: 18px;
  padding: 10px 14px;
  box-sizing: border-box;
}
.nyse-quick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.nyse-trade-cost {
  font-size: 15px;
  color: #a0b0d0;
  min-height: 22px;
  margin-bottom: 14px;
}
.nyse-trade-btns {
  display: flex;
  gap: 12px;
}
.nyse-trade-btns .btn {
  flex: 1;
  font-size: 17px;
  padding: 12px 20px;
}
.nyse-trade-btns .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
/* Market screen search bar */
.nyse-search-wrap {
  margin-bottom: 14px;
}
.nyse-search-input {
  width: 100%;
  max-width: 380px;
  background: #111827;
  border: 1px solid #2a3a5c;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 16px;
  color: #e0e8ff;
  box-sizing: border-box;
}
.nyse-search-input::placeholder { color: #4a5a7a; }
.nyse-search-input:focus { outline: none; border-color: #4a7ac0; }

/* ===== Truck Lot ===== */
.tl-section-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 16px 16px 0;
}

.tl-current-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 16px 8px;
}
.tl-no-truck {
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
}

.tl-listing {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tl-truck-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.tl-truck-card--new { border-color: #5c6bc0; }

.tl-new-badge {
  position: absolute;
  top: -1px; right: 12px;
  background: #5c6bc0;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
}

/* ===== Truck Lot (TruckPaper-style grid) ===== */

.lot-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

.lot-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: #0a0f16;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.lot-topbar h2 {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  color: var(--amber);
  flex: 1;
  text-align: center;
}

.lot-your-rig {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.lot-no-rig        { color: var(--muted); font-style: italic; }
.lot-rig-label     { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.lot-rig-name      { color: var(--text); font-weight: bold; }
.lot-rig-cond      { color: var(--teal); }
.lot-rig-trade     { color: var(--amber); }

.lot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* Truck lot: fixed 3-column thumbnail grid */
#tl-listing {
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
}

.lot-card {
  background: #0d1520;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.12s;
}

.lot-card:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}

.lot-card--new    { border-color: #1a3050; }
.lot-card--locked { opacity: 0.45; filter: grayscale(60%); pointer-events: none; }
.lot-locked-badge { margin-top: 8px; font-size: 15px; color: #7a8a9a; font-family: var(--font-mono); }

.lot-year-header {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 3px;
  padding: 24px 4px 8px;
  border-bottom: 2px solid var(--amber);
  margin-bottom: 4px;
}
.lot-year-header:first-child { padding-top: 4px; }

.lot-make-header {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 4px 6px;
}

/* Thumbnail card elements */
.lot-card-thumb-img {
  width: 100%;
  height: 165px;
  object-fit: contain;
  display: block;
  background: #08111a;
}

.lot-card-thumb-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lot-card-thumb-name {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.lot-card-thumb-price {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: bold;
  color: var(--amber);
}

.lot-thumb-afford {
  font-size: 11px;
  font-weight: bold;
}
.lot-thumb-afford.can  { color: #00b878; }
.lot-thumb-afford.cant { color: #e05800; }

.lot-details-btn { margin-top: 6px; font-size: 18px; padding: 10px 20px; }

.lot-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  background: #08111a;
  border-bottom: 1px solid var(--border);
}

.lot-card-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: bold;
  color: var(--text);
  letter-spacing: 0.5px;
  flex: 1;
}

.lot-card-badge {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.lot-badge--good    { background: rgba(0,180,120,0.18); color: #00b878; border: 1px solid rgba(0,180,120,0.3); }
.lot-badge--fair    { background: rgba(200,160,0,0.18); color: #c8a000; border: 1px solid rgba(200,160,0,0.3); }
.lot-badge--poor    { background: rgba(220,80,0,0.18);  color: #e05800; border: 1px solid rgba(220,80,0,0.3); }
.lot-badge--wreck   { background: rgba(180,0,0,0.18);   color: #cc3333; border: 1px solid rgba(180,0,0,0.3); }
.lot-badge--new     { background: rgba(0,130,220,0.2);  color: #40a8ff; border: 1px solid rgba(0,130,220,0.4); }
.lot-badge--soldout { background: rgba(100,110,120,0.18); color: #8899aa; border: 1px solid rgba(100,110,120,0.3); }
.lot-badge--locked  { background: rgba(140,80,180,0.18); color: #b060e0; border: 1px solid rgba(140,80,180,0.3); }
.lot-badge--info    { background: rgba(0,130,220,0.15);  color: #40a8ff; border: 1px solid rgba(0,130,220,0.3); }

.lot-card--muted { opacity: 0.55; filter: grayscale(50%); }

.parts-card-icon {
  font-size: 52px;
  text-align: center;
  padding: 22px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.lot-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.lot-card-no-img {
  width: 100%;
  height: 140px;
  background: #08111a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a3a4a;
  font-size: 28px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 6px;
}

.lot-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.lot-buy-btn {
  margin-top: auto;
}

.lot-card-price {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: bold;
  color: #e0f0ff;
  letter-spacing: 0.5px;
}

.lot-financed-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  letter-spacing: 1px;
}

.lot-card-trade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lot-trade-credit {
  font-size: 11px;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #2a3a4a;
}

.lot-you-pay {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--teal);
  font-weight: bold;
}

.lot-you-pay.cant-afford { color: var(--red); }

.lot-card-engine {
  font-size: 11px;
  color: var(--teal);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.lot-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.lot-specialty {
  color: var(--amber);
  font-size: 11px;
  width: 100%;
}

.lot-card-desc {
  font-size: 15px;
  color: #506070;
  line-height: 1.45;
  flex: 1;
}

.lot-buy-btn {
  width: 100%;
  margin-top: 8px;
}

.lot-loan-block {
  font-size: 11px;
  color: var(--red);
  padding: 6px 0;
  margin: 0;
}

/* ===== Truck detail panel ===== */
.lot-detail-body {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0; /* must not shrink — outer container scrolls its overflow */
}

.lot-detail-photo-col {
  flex: 0 0 38%;
  background: #08111a;
  align-self: flex-start;
  overflow: hidden;
}

.lot-detail-photo {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: #08111a;
}

.lot-detail-info-col {
  flex: 1;
  padding: 16px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lot-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lot-detail-name {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: bold;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1.2;
  flex: 1;
}

.lot-detail-cond-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lot-detail-cond-track {
  flex: 1;
  height: 6px;
  background: #1a2535;
  border-radius: 3px;
  overflow: hidden;
}

.lot-detail-cond-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.lot-detail-cond-label {
  font-size: 18px;
  color: var(--muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.lot-detail-specs {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.lot-detail-spec-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.lot-detail-spec-row:last-child { border-bottom: none; }

.lot-detail-spec-label {
  flex: 0 0 150px;
  padding: 8px 14px;
  background: #08111a;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid var(--border);
}

.lot-detail-spec-val {
  flex: 1;
  padding: 8px 14px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

.lot-detail-story {}

.lot-detail-story-label {
  font-size: 16px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.lot-detail-story-text {
  font-size: 20px;
  color: #7090a8;
  line-height: 1.7;
  margin: 0 0 14px;
}

.lot-detail-pricing {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.lot-detail-price {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: bold;
  color: #e0f0ff;
  letter-spacing: 0.5px;
}

.lot-detail-down-note {
  font-size: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.lot-detail-buy-btn {
  margin-top: 6px;
  align-self: flex-start;
  min-width: 200px;
}

/* ===== Tutorial views: teal buttons, no display override ===== */
#view-smalltown .btn-primary,
#view-intro-story .btn-primary,
#view-tutorial-drive .btn-primary,
#view-arrival-story .btn-primary {
  background: var(--teal);
  color: #0d1117;
}
#view-smalltown .btn-secondary:hover:not(:disabled),
#view-intro-story .btn-secondary:hover:not(:disabled),
#view-tutorial-drive .btn-secondary:hover:not(:disabled),
#view-arrival-story .btn-secondary:hover:not(:disabled) {
  border-color: var(--teal);
}


/* ===== Small Town Map ===== */
/* No display property here — .view / .view.active handles show/hide */
.st-map-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #0b0f12;
}
.st-city-grid {
  position: absolute;
  inset: 0;
  background: #12181f;
}
.st-dirt-road {
  position: absolute;
  top: 60%;
  left: 0;
  right: 0;
  height: 7%;
  min-height: 40px;
  background: linear-gradient(180deg, #795548 0%, #6d4c41 40%, #5d4037 100%);
  border-top: 4px dashed #3e2723;
  border-bottom: 4px dashed #3e2723;
  box-shadow: 0 0 16px rgba(0,0,0,0.8);
}
.st-cdl-school {
  position: absolute;
  /* bottom flush with road top (60%), height 22% → top = 38% */
  top: 38%;
  right: 4%;
  width: 18%;
  min-width: 180px;
  height: 22%;
  background: #1a2a1a;
  border: 3px solid #4caf50;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.st-cdl-school:hover {
  border-color: #81c784;
  box-shadow: 0 0 36px rgba(76,175,80,0.65);
}
.st-school-sign {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 700;
  color: #81c784;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.5px;
}
.st-school-pulse {
  width: 16px;
  height: 16px;
  background: #4caf50;
  border-radius: 50%;
  animation: st-pulse 1.4s ease-in-out infinite;
}
@keyframes st-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.45; }
}
.st-school-label {
  font-size: clamp(12px, 1.1vw, 16px);
  color: #4caf50;
  letter-spacing: 0.3px;
}
.st-town-title {
  position: absolute;
  top: 5%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 700;
  color: #8899aa;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.st-town-sub {
  position: absolute;
  top: 13%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(13px, 1.2vw, 18px);
  color: #445566;
}

/* ===== Intro Story & Arrival Story ===== */
/* Use .active selector so display:none from .view still applies when hidden */
#view-intro-story.active,
#view-arrival-story.active {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 28px;
}

/* ===== CDL School ===== */
/* Lobby uses bank-screen layout; cert screen uses story-screen layout inside */
#view-cdlschool {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  background: var(--bg);
}
/* Training screen needs full width — override centering */
#view-cdlschool.training-mode {
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}

#view-intro-story .story-screen,
#view-arrival-story .story-screen,
#view-cdlschool .story-screen,
#view-partsshop .story-screen {
  flex-direction: column;
  max-width: min(980px, 96vw);
  width: 100%;
  margin: auto;
  gap: 0;
}
#view-intro-story .story-illustration,
#view-arrival-story .story-illustration,
#view-cdlschool .story-illustration,
#view-partsshop .story-illustration {
  width: 100%;
  height: clamp(280px, 42vh, 480px);
  border-radius: 12px 12px 0 0;
  border: none;
  border-bottom: 2px solid rgba(0,212,170,0.3);
}
#view-intro-story .story-img,
#view-arrival-story .story-img,
#view-cdlschool .story-img,
#view-partsshop .story-img {
  object-fit: cover;
  object-position: top center;
}
#view-intro-story .story-card,
#view-arrival-story .story-card,
#view-cdlschool .story-card,
#view-partsshop .story-card {
  border-radius: 0 0 12px 12px;
  border-top: none;
  border: 1px solid rgba(0,212,170,0.2);
}
#view-intro-story .story-card h2,
#view-arrival-story .story-card h2,
#view-cdlschool .story-card h2,
#view-partsshop .story-card h2 {
  font-size: 28px;
}

/* Rig story: show the full truck+trailer image, no cropping */
#parts-screen-rig-story .story-illustration {
  height: auto;
  max-height: 72vh;
  background: #000;
  border-bottom: 3px solid var(--teal);
}
#parts-screen-rig-story .story-img {
  object-fit: contain;
  object-position: center;
  max-height: 72vh;
  width: 100%;
}
#view-intro-story .story-card p,
#view-arrival-story .story-card p,
#view-cdlschool .story-card p,
#view-partsshop .story-card p {
  font-size: 18px;
  line-height: 1.8;
}
/* story-card paragraphs should never shrink to the global text-muted 12px */
.story-card .text-muted { font-size: inherit; }

/* ===== Cert store ===== */
#cdl-cert-listing {
  grid-template-columns: repeat(5, 1fr);
  padding: 0;
  gap: 20px;
}
#cdl-cert-listing .lot-card-desc  { font-size: 20px; line-height: 1.75; }
#cdl-cert-listing .lot-card-title { font-size: 22px; letter-spacing: .04em; }
#cdl-cert-listing .lot-card-badge { font-size: 14px; }
#cdl-cert-listing .lot-card-price { font-size: 30px; }
#cdl-cert-listing .lot-buy-btn    { font-size: 20px; padding: 14px; }
#cdl-cert-listing .cert-effect    { font-size: 20px; }
#cdl-cert-listing .cert-level-tag { font-size: 18px; }

/* ===== Parts shop + Trailer shop ===== */
#parts-listing .lot-card-title,
#trailer-listing .lot-card-title  { font-size: 20px; letter-spacing: .04em; }
#parts-listing .lot-card-badge,
#trailer-listing .lot-card-badge  { font-size: 13px; }
#parts-listing .lot-card-price,
#trailer-listing .lot-card-price  { font-size: 28px; }
#parts-listing .lot-card-desc,
#trailer-listing .lot-card-desc   { font-size: 15px; line-height: 1.6; color: #607080; }
#parts-listing .lot-buy-btn,
#trailer-listing .lot-buy-btn     { font-size: 18px; padding: 12px; }
#parts-listing .parts-card-icon   { font-size: 58px; }
.cert-effect {
  font-size: 12px;
  color: var(--teal);
  margin: 8px 0 10px;
  line-height: 1.5;
}
.cert-req-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cert-level-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.cert-level--met   { background: rgba(0,180,120,0.15); color: #00b878; }
.cert-level--locked{ background: rgba(180,0,0,0.15);   color: #cc3333; }
.lot-card--owned   { opacity: 0.6; }

/* ── Skill Tree ──────────────────────────────────────────── */
:root { --sth-lbl: 140px; --sth-road: 56px; }

.skill-tree-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.skill-tree-title {
  margin: 0;
  color: var(--teal);
  font-size: 20px;
  flex: 1;
}
.skill-pts-badge {
  font-size: 16px;
  font-weight: 700;
  color: #f5a623;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.35);
  border-radius: 20px;
  padding: 6px 16px;
}
/* Container */
.skill-tree-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

/* Tier header row */
.sth-tier-header {
  display: flex;
  align-items: center;
  padding: 9px 24px 7px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sth-lbl-sp  { width: var(--sth-lbl); flex-shrink: 0; }
.sth-road-sp { width: var(--sth-road); flex-shrink: 0; }
.sth-tier-hdr {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2a3e58;
}

/* Branch lane */
.sth-lane {
  display: flex;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

/* Branch label */
.sth-branch-lbl {
  width: var(--sth-lbl);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-right: 8px;
}
.sth-branch-icon { font-size: 32px; }
.sth-branch-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  color: #4a6888;
}
.sth-branch-prog { font-size: 14px; color: #2a4060; }

/* Path stack */
.sth-paths { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sth-path-row { display: flex; align-items: center; }

/* Gap between Path A and Path B */
.sth-path-spacer {
  height: 20px;
  position: relative;
  margin: 1px 0;
}
.sth-path-spacer::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, #141e2c 0, #141e2c 6px, transparent 6px, transparent 14px);
}

/* Tier cell — equal-width, fills available space */
.sth-tier-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Road connector — hub highway style */
.sth-road {
  width: var(--sth-road);
  flex-shrink: 0;
  height: 13px;
  align-self: center;
  position: relative;
  background: #141e2c;
  box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 1px 0 rgba(0,0,0,.3);
}
.sth-road::after {
  content: '';
  position: absolute;
  top: calc(50% - 1px);
  left: 0; right: 0; height: 2px;
  background-image: repeating-linear-gradient(90deg, #607080 0, #607080 7px, transparent 7px, transparent 16px);
}
/* Fork road — stretches full cell height, contains SVG Y-junction */
.sth-road--fork {
  align-self: stretch;
  height: auto;
  background: transparent;
  box-shadow: none;
}
.sth-road--fork::after { display: none; }

.sth-fork-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sth-fork-line {
  stroke: #607080;
  stroke-width: 2;
  stroke-dasharray: 5 7;
  fill: none;
}
.sth-lane[data-b="fuel"]       .sth-road--fork .sth-fork-line { stroke: #c07030; }
.sth-lane[data-b="mechanical"] .sth-road--fork .sth-fork-line { stroke: #3870b8; }
.sth-lane[data-b="contracts"]  .sth-road--fork .sth-fork-line { stroke: #8050c8; }
.sth-lane[data-b="market"]     .sth-road--fork .sth-fork-line { stroke: #2898a8; }
.sth-lane[data-b="safety"]     .sth-road--fork .sth-fork-line { stroke: #c03050; }
.sth-lane[data-b="experience"] .sth-road--fork .sth-fork-line { stroke: #60a828; }

/* Branch-tinted roads */
.sth-lane[data-b="fuel"]       .sth-road { background: #1e1308; }
.sth-lane[data-b="fuel"]       .sth-road::after { background-image: repeating-linear-gradient(90deg, #c07030 0, #c07030 7px, transparent 7px, transparent 16px); }
.sth-lane[data-b="mechanical"] .sth-road { background: #0a1828; }
.sth-lane[data-b="mechanical"] .sth-road::after { background-image: repeating-linear-gradient(90deg, #3870b8 0, #3870b8 7px, transparent 7px, transparent 16px); }
.sth-lane[data-b="contracts"]  .sth-road { background: #140e22; }
.sth-lane[data-b="contracts"]  .sth-road::after { background-image: repeating-linear-gradient(90deg, #8050c8 0, #8050c8 7px, transparent 7px, transparent 16px); }
.sth-lane[data-b="market"]     .sth-road { background: #0a1c18; }
.sth-lane[data-b="market"]     .sth-road::after { background-image: repeating-linear-gradient(90deg, #2898a8 0, #2898a8 7px, transparent 7px, transparent 16px); }
.sth-lane[data-b="safety"]     .sth-road { background: #1c0c10; }
.sth-lane[data-b="safety"]     .sth-road::after { background-image: repeating-linear-gradient(90deg, #c03050 0, #c03050 7px, transparent 7px, transparent 16px); }
.sth-lane[data-b="experience"] .sth-road { background: #0c1a08; }
.sth-lane[data-b="experience"] .sth-road::after { background-image: repeating-linear-gradient(90deg, #60a828 0, #60a828 7px, transparent 7px, transparent 16px); }
/* Fork road must stay transparent regardless of branch color or lit overrides */
.sth-lane[data-b] .sth-road.sth-road--fork,
.sth-lane[data-b] .sth-road.sth-road--fork.sth-lit { background: transparent; box-shadow: none; }

/* Lit road when previous tier is owned */
.sth-lane[data-b="fuel"]       .sth-road.sth-lit { box-shadow: 0 0 8px rgba(200,110,30,.3), 0 2px 5px rgba(0,0,0,.5); }
.sth-lane[data-b="mechanical"] .sth-road.sth-lit { box-shadow: 0 0 8px rgba(60,120,200,.3), 0 2px 5px rgba(0,0,0,.5); }
.sth-lane[data-b="contracts"]  .sth-road.sth-lit { box-shadow: 0 0 8px rgba(140,70,210,.3), 0 2px 5px rgba(0,0,0,.5); }
.sth-lane[data-b="market"]     .sth-road.sth-lit { box-shadow: 0 0 8px rgba(40,155,170,.3), 0 2px 5px rgba(0,0,0,.5); }
.sth-lane[data-b="safety"]     .sth-road.sth-lit { box-shadow: 0 0 8px rgba(200,45,75,.3),  0 2px 5px rgba(0,0,0,.5); }
.sth-lane[data-b="experience"] .sth-road.sth-lit { box-shadow: 0 0 8px rgba(95,175,35,.3),  0 2px 5px rgba(0,0,0,.5); }

/* Exit sign (skill card) */
.sth-exit {
  background: #0d1420;
  border: 1px solid #1a2535;
  border-radius: 7px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.sth-exit:hover:not(.sth-exit--locked) { transform: translateY(-1px); border-color: #2a4070; }
.sth-exit--owned  { background: #0a1812; border-color: #1e4828; }
.sth-exit--avail  { border-color: #1e3860; }
.sth-exit--locked { opacity: .35; cursor: default; }
.sth-exit--coming { opacity: .45; font-style: italic; }

.sth-lane[data-b="fuel"]       .sth-exit--owned { border-left: 3px solid #e07b30; }
.sth-lane[data-b="mechanical"] .sth-exit--owned { border-left: 3px solid #4080c0; }
.sth-lane[data-b="contracts"]  .sth-exit--owned { border-left: 3px solid #9060d0; }
.sth-lane[data-b="market"]     .sth-exit--owned { border-left: 3px solid #30a890; }
.sth-lane[data-b="safety"]     .sth-exit--owned { border-left: 3px solid #d04060; }
.sth-lane[data-b="experience"] .sth-exit--owned { border-left: 3px solid #70b030; }

.sth-exit-meta {
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #283850; margin-bottom: 4px; display: flex; align-items: center; gap: 4px;
}
.sth-exit--owned .sth-exit-meta { color: #226040; }
.sth-exit-meta .sth-badge { background: #131e30; border-radius: 3px; padding: 1px 5px; }
.sth-exit--owned .sth-exit-meta .sth-badge { background: #0e2018; color: #40b870; }

.sth-exit-name { font-size: 20px; font-weight: 700; color: #b0c8e8; margin-bottom: 4px; line-height: 1.2; }
.sth-exit--owned .sth-exit-name { color: #50d880; }

.sth-exit-effect { font-size: 15px; color: #48607e; line-height: 1.4; }
.sth-exit--owned .sth-exit-effect { color: #2e6050; }

.sth-exit-cost {
  margin-top: 7px; font-size: 15px; font-weight: 700; color: #b08828;
  display: flex; align-items: center; gap: 4px;
}
.sth-exit-cost::before { content: '●'; font-size: 9px; }
.sth-exit--owned .sth-exit-cost { color: #38a060; }
.sth-exit--locked .sth-exit-cost { color: #2a3a50; }
.sth-exit--locked .sth-exit-cost::before { color: #2a3a50; }

.mt-8 { margin-top: 8px; }

/* ===== Tutorial Drive ===== */
/* No display property — .view.active handles it */
#view-tutorial-drive.active {
  align-items: center;
  justify-content: center;
}
.tut-drive-wrap {
  width: 100%;
  max-width: 860px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.tut-drive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.tut-route-label {
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.tut-leg-counter {
  font-size: 24px;
  font-weight: 700;
  color: var(--teal);
}
.tut-drive-body {
  display: flex;
  gap: 24px;
}
.tut-tip-panel {
  flex: 1;
  background: #0d1520;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.tut-tip-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 14px;
}
.tut-tip-content {
  font-size: 18px;
  line-height: 1.75;
  color: #c0d0e0;
}
.tut-truck-panel {
  width: 240px;
  background: #0d1520;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.tut-truck-icon { font-size: 56px; }
.tut-truck-name {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}
.tut-progress-track {
  width: 100%;
  height: 10px;
  background: #1e2d3d;
  border-radius: 5px;
  overflow: hidden;
}
.tut-progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.tut-progress-label {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.tut-drive-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.tut-disclaimer {
  font-size: 13px;
  color: #445566;
  text-align: center;
}
.btn-lg {
  padding: 16px 48px;
  font-size: 18px;
}

/* ===== Utility ===== */
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.flex   { display: flex; }
.gap-8  { gap: 8px; }
.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.text-red    { color: var(--red); }
.hidden { display: none !important; }

/* =====================================================================
   DRIVER'S LOG OVERLAY
   ===================================================================== */

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.hdr-htr-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 16px;
  letter-spacing: 0.5px;
}

.htr-back-btn {
  font-size: 13px;
  padding: 7px 14px;
}

.htr-drive-btn {
  font-size: 13px;
  padding: 7px 16px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}
.htr-drive-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.hdr-log-btn {
  margin-left: 12px;
  flex-shrink: 0;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s;
}
.hdr-log-btn:hover {
  background: rgba(240,165,0,0.1);
  border-color: var(--amber);
}
.hdr-logout-btn { margin-left: 0; }
.hdr-logout-btn:hover {
  background: rgba(224,92,92,0.08);
  border-color: #e05c5c;
  color: #e05c5c;
}

/* Overlay backdrop */
#driverlog-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  transition: opacity 0.2s;
}
#driverlog-overlay.dl-hidden {
  display: none;
}

/* Book container */
.dl-book {
  display: flex;
  width: min(1080px, 95vw);
  height: min(88vh, 840px);
  border: 1px solid #253040;
  box-shadow: 0 24px 80px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}

/* Left spine */
.dl-spine {
  width: 200px;
  flex-shrink: 0;
  background: #060a0e;
  border-right: 2px solid var(--amber);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.dl-spine-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--amber);
  text-align: center;
  line-height: 1.5;
  padding: 22px 16px 18px;
  border-bottom: 1px solid #1a2530;
}

.dl-tab-rail {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.dl-tab {
  display: block;
  width: 100%;
  padding: 15px 22px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: #445566;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.dl-tab:hover {
  color: #7a9ab0;
  background: rgba(255,255,255,0.03);
}
.dl-tab--active {
  color: var(--amber) !important;
  border-left-color: var(--amber) !important;
  background: rgba(240,165,0,0.07) !important;
}

.dl-close-btn {
  margin: 16px 12px;
  padding: 12px;
  background: transparent;
  border: 1px solid #253040;
  color: #445566;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s, border-color 0.12s;
}
.dl-close-btn:hover {
  color: var(--text);
  border-color: #445566;
}

/* Right page */
.dl-page {
  flex: 1;
  background: #f8f2e0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 31px,
    rgba(0,0,0,0.05) 31px,
    rgba(0,0,0,0.05) 32px
  );
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dl-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 28px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.dl-chapter {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-style: italic;
  color: #7a5000;
  letter-spacing: 0.5px;
}

.dl-page-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #9a8a70;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dl-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
}
.dl-content::-webkit-scrollbar { width: 4px; }
.dl-content::-webkit-scrollbar-track { background: transparent; }
.dl-content::-webkit-scrollbar-thumb { background: #c8b890; border-radius: 2px; }

/* Content blocks */
.dl-block {
  margin-bottom: 4px;
}

.dl-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(0,0,0,0.14) 60%, transparent);
  margin: 18px 0;
}

.dl-block-label {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8a6a20;
  margin-bottom: 12px;
}

/* Career — identity */
.dl-identity-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dl-driver-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  color: #1c1c1c;
  margin-bottom: 5px;
}

.dl-identity-line {
  font-family: var(--font-mono);
  font-size: 19px;
  color: #4a5060;
  margin-bottom: 3px;
}

.dl-level-seal {
  text-align: center;
  border: 1px solid #c8a000;
  padding: 10px 18px;
  flex-shrink: 0;
}

/* ===== Driving View v2 ===== */
#view-driving { flex-direction: column; overflow: hidden; }

.drv-top { display: flex; flex: 1 1 0; min-height: 0; }

/* Road view (left half) */
.drv-road {
  flex: 1 1 50%; position: relative; overflow: hidden;
  background: #0a0a0a;
}
.drv-road-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 0;
}
.drv-road-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 58%;
  background: linear-gradient(180deg, transparent 0%, #2d2e2b 8%),
    repeating-linear-gradient(180deg, transparent 0px, transparent 28px, #f5e642 28px, #f5e642 52px, transparent 52px, transparent 100px);
  background-size: 100% 100%, 12px 200px;
  background-position: center, center;
  background-repeat: no-repeat, repeat-y;
  mask-image: linear-gradient(180deg, transparent 0%, black 25%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 25%);
}
.drv-scenery-left  { position: absolute; left: 0; top: 36%; width: 30%; height: 64%; background: linear-gradient(180deg, #3a5a2a 0%, #2d4420 60%, #1e3015 100%); clip-path: polygon(0 0, 100% 0, 40% 100%, 0 100%); }
.drv-scenery-right { position: absolute; right: 0; top: 36%; width: 30%; height: 64%; background: linear-gradient(180deg, #3a5a2a 0%, #2d4420 60%, #1e3015 100%); clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%); }
.drv-cloud { position: absolute; background: rgba(255,255,255,0.7); border-radius: 50px; }
.drv-cloud-1 { top: 6%; left: 12%; width: 120px; height: 28px; }
.drv-cloud-1::before { content:''; position:absolute; top:-14px; left:20px; width:50px; height:40px; background:rgba(255,255,255,0.7); border-radius:50%; }
.drv-cloud-1::after  { content:''; position:absolute; top:-8px; left:55px; width:38px; height:30px; background:rgba(255,255,255,0.7); border-radius:50%; }
.drv-cloud-2 { top: 11%; left: 58%; width: 90px; height: 22px; }
.drv-cloud-2::before { content:''; position:absolute; top:-10px; left:14px; width:36px; height:28px; background:rgba(255,255,255,0.65); border-radius:50%; }
.drv-windshield-frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(0,0,0,0.45); }
.drv-a-pillar-left  { position: absolute; top: 0; left: 0; width: 18px; height: 100%; background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, transparent 100%); pointer-events: none; }
.drv-a-pillar-right { position: absolute; top: 0; right: 0; width: 18px; height: 100%; background: linear-gradient(270deg, rgba(0,0,0,0.7) 0%, transparent 100%); pointer-events: none; }
.drv-road-label { position: absolute; bottom: 12px; right: 14px; font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 0.05em; text-transform: uppercase; pointer-events: none; }

/* MFD (right half) */
.drv-mfd { flex: 1 1 50%; background: #080d10; border-left: 2px solid #000; display: flex; flex-direction: column; padding: 14px 16px; gap: 10px; overflow: hidden; }
.drv-mfd-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1a4a3a; padding-bottom: 8px; flex-shrink: 0; }
.drv-mfd-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.15em; color: #00e8b8; font-weight: 600; }
.drv-mfd-clock { font-size: 13px; color: #6b7280; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.drv-mfd-dot { width: 6px; height: 6px; border-radius: 50%; background: #00c8a0; animation: drv-pulse 2s infinite; }
@keyframes drv-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* MFD content panels */
.drv-panel { display: none; flex-direction: column; gap: 10px; flex: 1 1 0; min-height: 0; overflow-y: auto; }
.drv-panel.active { display: flex; }

.drv-mfd-section { background: rgba(0,200,160,0.04); border: 1px solid #1a4a3a; border-radius: 6px; padding: 10px 12px; flex-shrink: 0; }
.drv-mfd-section-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.15em; color: #007a62; margin-bottom: 8px; font-weight: 600; }

/* Job info */
.drv-job-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.drv-job-dest { font-size: 22px; font-weight: 700; color: #00e8b8; line-height: 1.1; }
.drv-job-sub  { font-size: 16px; color: #6b7280; margin-top: 3px; }
.drv-job-meta { font-size: 16px; color: #4a9a8a; margin-top: 4px; }
.drv-driver-row { display: flex; align-items: center; margin-bottom: 8px; }
.drv-driver-info { display: flex; align-items: baseline; gap: 8px; }
.drv-driver-handle { font-size: 22px; font-weight: 700; color: #00e8b8; font-family: var(--font-mono); }
.drv-driver-level  { font-size: 15px; color: #f0c040; background: #1a2a1a; border: 1px solid #2a4a2a; border-radius: 4px; padding: 1px 7px; }
.drv-job-pay  { text-align: right; }
.drv-job-pay-val { font-size: 22px; font-weight: 700; color: #4ade80; }
.drv-job-pay-lbl { font-size: 14px; color: #6b7280; }

/* Route stops */
.drv-route-stops { display: flex; align-items: center; margin-top: 8px; position: relative; }
.drv-stop { display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; z-index: 1; }
.drv-stop-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #007a62; background: #080d10; }
.drv-stop-dot.done { background: #00c8a0; border-color: #00c8a0; }
.drv-stop-dot.here { background: #f0c040; border-color: #f0c040; box-shadow: 0 0 6px #f0c040; }
.drv-stop-name { font-size: 11px; color: #6b7280; text-align: center; width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-stop-name.here { color: #f0c040; font-weight: 600; }
.drv-stop-name.done { color: #007a62; }
.drv-route-line { flex: 1; height: 2px; margin-bottom: 13px; z-index: 0; }
.drv-route-line.done  { background: #00c8a0; }
.drv-route-line.ahead { background: #2a3a30; }

/* Progress bar */
.drv-progress-wrap { margin-top: 10px; }
.drv-progress-row  { display: flex; justify-content: space-between; font-size: 14px; color: #6b7280; margin-bottom: 4px; }
.drv-progress-bar  { height: 6px; background: #1a2a22; border-radius: 3px; overflow: hidden; }
.drv-progress-fill { height: 100%; background: linear-gradient(90deg, #007a62, #00c8a0); border-radius: 3px; width: 0%; transition: width 0.5s; }

/* Segment stats */
.drv-seg-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.drv-seg-stat  { display: flex; flex-direction: column; gap: 2px; }
.drv-seg-stat-lbl { font-size: 13px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.1em; }
.drv-seg-stat-val { font-size: 22px; font-weight: 600; color: #00e8b8; font-variant-numeric: tabular-nums; }
.drv-seg-stat-val.warn { color: #f0c040; }

/* Weather panel */
.drv-weather-now { font-size: 26px; font-weight: 700; color: #00e8b8; margin-top: 4px; }
.drv-weather-seg { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #1a2a22; font-size: 13px; }
.drv-weather-seg:last-child { border-bottom: none; }
.drv-weather-seg.active .drv-weather-seg-route { color: #f0c040; }
.drv-weather-seg-route { color: #6b7280; }
.drv-weather-seg-cond { font-weight: 600; font-size: 14px; }
.drv-weather-seg-cond.clear   { color: #f0c040; }
.drv-weather-seg-cond.cloudy  { color: #8a9ab0; }
.drv-weather-seg-cond.rain    { color: #4a90d9; }
.drv-weather-seg-cond.snowing { color: #b0d8ff; }

/* Status panel */
.drv-status-grid { display: flex; flex-direction: column; gap: 8px; }
.drv-status-item { display: flex; align-items: center; gap: 8px; }
.drv-status-lbl  { font-size: 11px; color: #4a7a6a; text-transform: uppercase; letter-spacing: 0.06em; width: 90px; flex-shrink: 0; }
.drv-status-val  { font-size: 13px; color: #b0c4b8; }
.drv-status-val--lg   { font-size: 17px; font-weight: 700; color: #00e8b8; }
.drv-status-val--cash { color: #4ade80; }
.drv-status-bar-wrap { display: flex; align-items: center; gap: 6px; flex: 1; }
.drv-status-bar { flex: 1; height: 6px; background: #0d1f16; border-radius: 3px; overflow: hidden; }
.drv-status-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.drv-status-bar--fuel { background: #4ade80; }
.drv-status-bar--cond { background: #f0c040; }
.drv-status-bar--xp   { background: #7c6cf0; }
.drv-status-bar--tire { background: #4ade80; }
.drv-status-bar--tire.worn     { background: #f0c040; }
.drv-status-bar--tire.critical { background: #e05050; }

/* CB panel */
.drv-cb-messages { flex: 1; min-height: 60px; background: #0a0d10; border: 1px solid #1a4a3a; border-radius: 6px; padding: 10px 14px; display: flex; flex-direction: column-reverse; gap: 10px; overflow-y: auto; font-size: 12px; }
.drv-cb-msg { display: flex; gap: 8px; line-height: 1.4; }
.drv-cb-handle { color: #f0c040; font-weight: 700; flex-shrink: 0; font-family: var(--font-mono); }
.drv-cb-text { color: rgba(0,232,184,0.8); }

/* TBD placeholder */
.drv-tbd-msg { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #6b7280; letter-spacing: 0.06em; }

/* Screen buttons */
.drv-screen-btns { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid #1a4a3a; flex-shrink: 0; }
.drv-screen-btn { flex: 1; padding: 10px 6px; background: #0d1f18; border: 1px solid #1a4a3a; border-radius: 6px; color: #6b7280; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.drv-screen-btn:hover  { background: #1a4a3a; color: #d0d4dc; border-color: #007a62; }
.drv-screen-btn.active { color: #00e8b8; border-color: #007a62; background: rgba(0,200,160,0.08); }
.drv-screen-btn--disabled { opacity: 0.25; cursor: default; pointer-events: none; min-width: 0; flex: 0 0 32px; padding: 10px 0; }

/* Dashboard */
.drv-dash { flex: 0 0 auto; min-height: 420px; background: #111214; border-top: 3px solid #000; display: flex; align-items: center; padding: 18px 24px; gap: 20px; position: relative; flex-shrink: 0; }
.drv-dash::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #007a62 20%, #007a62 80%, transparent); opacity: 0.4; }
.drv-gauge-group { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.drv-vdiv { width: 1px; height: 220px; background: #2a2d33; flex-shrink: 0; margin: 0 4px; align-self: center; }

/* Switch bank columns (flanking the gauges) */
.drv-sw-bank { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.drv-sw-bank-lbl { font-size: 9px; color: #3a3e48; text-transform: uppercase; letter-spacing: 0.15em; }
.drv-sw-bank-row { display: flex; gap: 10px; align-items: flex-end; justify-content: center; }
.drv-sw-col { display: flex; flex-direction: column; gap: 14px; justify-content: center; flex-shrink: 0; }

/* Dashboard center */
.drv-dash-center { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.drv-dash-info-row { display: flex; gap: 16px; }
.drv-info-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drv-info-lbl { font-size: 9px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.08em; }
.drv-info-val { font-size: 14px; font-weight: 600; color: #d0d4dc; }
.drv-info-val.teal  { color: #00e8b8; }
.drv-info-val.green { color: #4ade80; }
.drv-bar-card { background: #1c1e22 !important; border-color: #2a2d33 !important; }

/* Map inside MFD */
.drv-map-wrap { flex: 1; min-height: 0; border-radius: 6px; overflow: hidden; border: 1px solid #1a4a3a; }
.drv-map-wrap #drive-map { height: 100%; min-height: 200px; }

/* Dashboard action buttons */
.drv-dash-actions { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; margin-left: auto; align-items: center; }

.drv-clock-display { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px; background: #090600; border: 1px solid #2a1800; border-radius: 5px; box-shadow: inset 0 2px 8px rgba(0,0,0,0.9), 0 0 12px rgba(255,140,0,0.08); }
.drv-clock-lbl { font-size: 9px; color: #5a3800; text-transform: uppercase; letter-spacing: 0.2em; }
.drv-clock-val { font-family: 'DSEG7Classic', 'Courier New', monospace; font-size: 30px; color: #ff9800; letter-spacing: 0.05em; text-shadow: 0 0 8px rgba(255,152,0,1), 0 0 20px rgba(255,120,0,0.5), 0 0 40px rgba(255,100,0,0.2); line-height: 1; }
.drv-act-btn { padding: 18px 32px; border-radius: 8px; border: none; font-size: 17px; font-weight: 700; letter-spacing: 0.03em; cursor: pointer; min-width: 220px; text-align: center; transition: filter 0.15s, transform 0.1s; }
.drv-act-btn:hover    { filter: brightness(1.12); transform: translateY(-1px); }
.drv-act-btn:active   { transform: none; filter: brightness(0.95); }
.drv-act-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; filter: none; }
.drv-act-primary   { background: #00c8a0; color: #000; }
.drv-act-secondary { background: #1c1e22; color: #d0d4dc; border: 1px solid #2a2d33; }
.drv-act-danger    { background: #8b0000; color: #fff; border: 1px solid #cc0000; }

/* ==================== BORDER CROSSING OVERLAY ==================== */
.bdr-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bdr-overlay.hidden { display: none; }

.bdr-screen {
  display: flex;
  gap: 36px;
  width: 100%;
  max-width: 920px;
  align-items: flex-start;
}
.bdr-screen.hidden { display: none; }

.bdr-photo {
  width: 420px;
  min-width: 320px;
  height: 310px;
  object-fit: cover;
  border: 2px solid #2a4a3a;
  border-radius: 6px;
  flex-shrink: 0;
}

.bdr-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
}
.bdr-content--solo {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  align-items: center;
}

.bdr-poe-badge {
  display: inline-block;
  background: rgba(0,200,160,0.12);
  color: #00c8a0;
  border: 1px solid #00c8a0;
  border-radius: 4px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: fit-content;
}
.bdr-badge--good { color: #00c8a0; border-color: #00c8a0; background: rgba(0,200,160,0.12); }
.bdr-badge--bad  { color: #e05c5c; border-color: #e05c5c; background: rgba(224,92,92,0.12); }

.bdr-title {
  font-size: 24px;
  font-weight: 700;
  color: #e8f0e8;
  line-height: 1.2;
}
.bdr-title--good { color: #00c8a0; }
.bdr-title--bad  { color: #e05c5c; }

.bdr-body {
  font-size: 16px;
  line-height: 1.7;
  color: #9ab0a0;
  flex: 1;
}

.bdr-notice {
  font-size: 14px;
  color: #f0c040;
  background: rgba(240,192,64,0.08);
  border-left: 3px solid #f0c040;
  padding: 8px 14px;
  border-radius: 0 4px 4px 0;
}

.bdr-btn {
  padding: 14px 28px;
  background: #00c8a0;
  color: #0a1a10;
  border: none;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  width: 100%;
  max-width: 340px;
  margin-top: auto;
}
.bdr-btn:hover     { filter: brightness(1.12); transform: translateY(-1px); }
.bdr-btn:active    { transform: none; filter: brightness(0.95); }
.bdr-btn:disabled  { background: #2a4a3a; color: #4a6a5a; cursor: not-allowed; transform: none; filter: none; }
.bdr-btn--good     { background: #00c8a0; color: #0a1a10; }
.bdr-btn--bad      { background: #8b1c1c; color: #fff; }
.bdr-btn--bad:hover { filter: brightness(1.15); }

/* Dashboard-specific size overrides */
.drv-dash .gauge-face { width: 155px; height: 155px; }
.drv-dash .gauge-face svg { width: 100%; height: 100%; }
.drv-dash .gauge-val  { font-size: 32px; }
.drv-dash .gauge-unit { font-size: 16px; }
.drv-dash .gauge-name { font-size: 16px; }
.drv-dash .speed-limit-lbl { font-size: 16px; }
.drv-dash .speed-adj-btn { width: 46px; height: 46px; font-size: 18px; }
.drv-dash .odo-box { font-size: 30px; padding: 8px 20px; letter-spacing: 4px; }
.drv-dash .odo-lbl { font-size: 13px; }
.drv-dash .dot { width: 17px; height: 17px; }
.drv-dash .status-row { gap: 12px; }

/* RPM + Turbo side gauges (to the right of the steering wheel) */
.drv-side-gauges { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; flex-shrink: 0; }
.drv-side-gauges .gauge-face { width: 120px; height: 120px; }
.drv-side-gauges .gauge-val  { font-size: 20px; }
.drv-side-gauges .gauge-unit { font-size: 12px; }
.drv-side-gauges .gauge-name { font-size: 12px; }

/* Center instruments: 3-column row (switches | gauges+radio | switches) */
.drv-center-instr { display: flex; flex-direction: row; gap: 16px; flex: 1; min-width: 0; align-items: center; align-self: stretch; padding: 4px 0; }
.drv-center-mid { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; flex: 1; min-width: 0; }

/* Mini gauges */
.drv-mini-cluster { display: flex; gap: 14px; align-items: center; justify-content: center; }
.mini-gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-gauge-face { width: 84px; height: 84px; border-radius: 50%; background: #0e0e0e; border: 2px solid #2a2a2a; position: relative; flex-shrink: 0; }
.mini-gauge-face svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.mini-gauge-name { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.1em; }

/* Radio head unit */
.drv-radio { background: #0a0c0e; border: 1px solid #2a2d33; border-radius: 5px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; max-width: 340px; align-self: center; width: 100%; }
.drv-radio-display { background: #030a05; border: 1px solid #1a3a20; border-radius: 3px; padding: 4px 8px; text-align: center; min-width: 72px; flex-shrink: 0; }
.drv-radio-band { display: block; font-size: 10px; color: #007a62; font-family: var(--font-mono); letter-spacing: 0.12em; }
.drv-radio-freq { display: block; font-size: 22px; font-weight: 700; color: #00e8b8; font-family: var(--font-mono); letter-spacing: 2px; line-height: 1.15; }
.drv-radio-mid { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.drv-radio-presets { display: flex; gap: 4px; }
.drv-radio-btn { width: 28px; height: 22px; background: #1a1c20; border: 1px solid #2a2d33; border-radius: 2px; color: #6b7280; font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; }
.drv-radio-btn.active { background: #1a3a2a; border-color: #007a62; color: #00e8b8; }
.drv-radio-bar { height: 5px; background: #1a1c20; border-radius: 2px; overflow: hidden; }
.drv-radio-bar-fill { height: 100%; background: linear-gradient(90deg, #007a62, #00e8b8); border-radius: 2px; }
.drv-knob { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #3a3c42, #18191e); border: 2px solid #3a3d46; position: relative; cursor: pointer; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.drv-knob::after { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 2px; height: 9px; background: #f0c040; border-radius: 1px; }
.drv-knob--tune::after { top: auto; bottom: 4px; transform: translateX(-50%) rotate(180deg); }

/* Toggle switches */
.drv-switches { display: flex; gap: 18px; align-items: center; justify-content: center; padding: 2px 0; }
.drv-switch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.drv-switch-lever { width: 18px; height: 34px; background: #141618; border: 1px solid #2a2d33; border-radius: 3px; position: relative; overflow: hidden; }
.drv-switch-lever::before { content: ''; position: absolute; inset: 2px; background: #0e0f12; border-radius: 1px; }
.drv-switch-lever::after { content: ''; position: absolute; width: 12px; height: 13px; background: #2a2c32; border: 1px solid #3a3d44; border-radius: 1px; left: 2px; bottom: 2px; transition: bottom 0.12s, top 0.12s, background 0.12s, border-color 0.12s; }
.drv-switch.on .drv-switch-lever::after { bottom: auto; top: 2px; background: #00c8a0; border-color: #007a62; box-shadow: 0 0 5px rgba(0,200,160,0.5); }
.drv-switch-indicator { width: 8px; height: 8px; border-radius: 50%; background: #4a0f0f; border: 1px solid #2a0808; transition: background 0.15s, box-shadow 0.15s; }
.drv-switch.on .drv-switch-indicator { background: #00c860; border-color: #009040; box-shadow: 0 0 5px rgba(0,200,100,0.8); }
.drv-switch-lbl { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.08em; }
.drv-switch.on .drv-switch-lbl { color: #00c8a0; }

.dl-level-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: #c8a000;
  line-height: 1;
}

.dl-level-word {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 3px;
  color: #a08030;
  margin-top: 3px;
}

/* XP bar */
.dl-xp-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dl-field-lbl {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 2px;
  color: #7a6848;
  flex-shrink: 0;
}

.dl-bar-track {
  flex: 1;
  height: 6px;
  background: #e0d8c0;
  border: 1px solid #c8b890;
  border-radius: 1px;
  overflow: hidden;
}
.dl-bar-track--slim { height: 4px; }

.dl-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.3s;
}
.dl-bar-amber  { background: var(--amber); }
.dl-bar-green  { background: #007a50; }

.dl-xp-nums {
  font-family: var(--font-mono);
  font-size: 18px;
  color: #7a6848;
  flex-shrink: 0;
}

/* Ledger rows */
.dl-ledger {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dl-ledger-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dl-ledger-key {
  font-family: var(--font-mono);
  font-size: 22px;
  color: #2a2418;
  flex-shrink: 0;
}

.dl-ledger-dots {
  flex: 1;
  border-bottom: 1px dotted rgba(0,0,0,0.20);
  margin: 0 4px 3px;
  min-width: 20px;
}

.dl-ledger-val {
  font-family: var(--font-mono);
  font-size: 22px;
  color: #1c1c1c;
  flex-shrink: 0;
  text-align: right;
}

.dl-amber { color: #c8a000; }
.dl-red   { color: #aa2020; }
.dl-green { color: #007850; }

/* Exploration bars */
.dl-explore-grid { display: flex; flex-direction: column; gap: 10px; }

.dl-explore-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dl-explore-lbl {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #7a6848;
  width: 200px;
  flex-shrink: 0;
}

.dl-explore-num {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #7a6848;
  flex-shrink: 0;
  width: 90px;
  text-align: right;
}

/* Rig tab */
.dl-rig-photo-wrap {
  width: 100%;
  background: #060e14;
  border-bottom: 1px solid #1a2a38;
  margin-bottom: 20px;
  overflow: hidden;
  max-height: 240px;
}

.dl-rig-photo {
  width: 100%;
  height: 240px;
  object-fit: contain;
  display: block;
}

.dl-rig-title {
  margin-bottom: 12px;
}

.dl-cond-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.dl-cond-label {
  font-family: var(--font-mono);
  font-size: 19px;
  flex-shrink: 0;
}

/* Finances */
.dl-big-figure {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  margin: 6px 0 2px;
}
.dl-big-green { color: #007850; }
.dl-big-red   { color: #aa2020; }

.dl-empty-inline {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #7a6848;
  font-style: italic;
}

/* Skills */
.dl-skill-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  gap: 16px;
}

.dl-skill-name {
  font-family: var(--font-mono);
  font-size: 22px;
  color: #1c1c1c;
}

.dl-skill-effect {
  font-family: var(--font-mono);
  font-size: 19px;
  color: #3a7040;
  text-align: right;
  flex-shrink: 0;
}

/* Mileage */
.dl-odometer {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #00d490;
  background: #030e08;
  border: 1px solid #0a2018;
  display: inline-block;
  padding: 10px 20px;
  border-radius: 2px;
  margin: 8px 0 4px;
}

.dl-odo-unit {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 4px;
  color: #6a6050;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dl-state-block {
  margin-bottom: 14px;
}

.dl-state-header {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8a6a20;
  margin-bottom: 4px;
}

.dl-city-list {
  font-family: var(--font-mono);
  font-size: 19px;
  color: #4a5060;
  line-height: 1.7;
}

.dl-empty {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #7a6848;
  font-style: italic;
  padding: 20px 0;
}

/* Trailer fleet grid */
.dl-fleet-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.dl-fleet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 2px;
  padding: 10px 8px 8px;
  gap: 6px;
}

.dl-fleet-img {
  width: 120px;
  height: 60px;
  object-fit: contain;
}

.dl-fleet-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #2a2418;
  text-align: center;
  line-height: 1.3;
}

/* Certification grid */
.dl-cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.dl-cert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 2px;
  padding: 10px 8px 8px;
  gap: 6px;
}

.dl-cert-img {
  width: 100px;
  height: 70px;
  object-fit: contain;
}

.dl-cert-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #2a2418;
  text-align: center;
}

.dl-cert-effect {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #5a6070;
  text-align: center;
  line-height: 1.4;
}


/* ==================== DRIVER'S LOG — Companies tab ==================== */
.dl-rep-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.dl-rep-card {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dl-rep-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.dl-rep-name {
  font-family: var(--font-mono);
  font-size: 17px;
  color: #d0c9b0;
  font-weight: bold;
}

.dl-rep-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #6a7060;
  white-space: nowrap;
}

.dl-rep-tier-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-rep-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 9px;
  border-radius: 3px;
}

.dl-rep-miles {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #7a8070;
}

.dl-rep-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.dl-rep-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dl-rep-next {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #5a6058;
}

.dl-rep-bonuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.dl-rep-bonus {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a0c890;
  background: rgba(80,140,80,0.15);
  border: 1px solid rgba(80,140,80,0.25);
  border-radius: 3px;
  padding: 2px 7px;
}

/* ==================== HUB — Hit the Road button ==================== */
.hub-htr-btn {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(7,10,15,0.92);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: bold;
  padding: 10px 24px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s;
}
.hub-htr-btn:hover  { background: rgba(0,212,170,0.10); }
.hub-htr-btn.hidden { display: none; }


/* ==================== HIT THE ROAD view ==================== */
.htr-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #07090f;
}



#htr-map {
  flex: 1;
  min-height: 0;
}

/* Floating notice inside the map */
.htr-notice {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7,10,15,0.92);
  border: 1px solid #2a4060;
  border-radius: var(--radius);
  color: #c0d0e0;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 10px 20px;
  white-space: nowrap;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.htr-notice.show { opacity: 1; }
