/* FarmWorld — Komplett überarbeitetes UI-Stylesheet
   Stil: Warmes Glassmorphism-HUD, symbolzentriert, entzerrtes Layout, lebendige Effekte */
:root {
  --paper: #faf6eb;
  --paper-card: rgba(255, 252, 244, 0.92);
  --paper-dark: #efe5ce;
  --paper-hover: #f5ebd4;
  --ink: #2c2419;
  --ink-soft: #6e6049;
  --accent: #3d8b37;
  --accent-light: #52b74a;
  --accent-dark: #2b6627;
  --accent-glow: rgba(61, 139, 55, 0.32);
  --blue: #2f76b8;
  --blue-light: #eef6fc;
  --gold: #c88a14;
  --gold-bright: #ffd452;
  --gold-bg: #fff8e1;
  --danger: #c93b2b;
  --danger-bg: #fdf0ed;
  --panel-bg: rgba(249, 244, 231, 0.90);
  --panel-border: rgba(168, 144, 96, 0.55);
  --hud-bg: rgba(28, 24, 17, 0.86);
  --hud-border: rgba(255, 235, 190, 0.16);
  --shadow-sm: 0 3px 10px rgba(30, 22, 8, 0.12);
  --shadow: 0 10px 32px rgba(25, 18, 6, 0.28), 0 2px 8px rgba(25, 18, 6, 0.14);
  --shadow-lg: 0 20px 50px rgba(18, 12, 4, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

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

html, body { height: 100%; overflow: hidden; user-select: none; }

body {
  font-family: 'Inter', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #232118;
  -webkit-font-smoothing: antialiased;
}

#map {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: grab; transition: filter 0.3s ease;
  touch-action: none; /* Browser-Gesten dürfen Drag/Zoom nicht abbrechen (kein pointercancel) */
}
#map.dragging { cursor: grabbing; }
#map.hovering { cursor: pointer; }

.hidden { display: none !important; }

/* --- Keyframe Animations & Effects --- */
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideInRight {
  0% { opacity: 0; transform: translateX(24px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-24px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes toastDrop {
  0% { opacity: 0; transform: translateY(-16px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 139, 55, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(61, 139, 55, 0); }
}
@keyframes pulseAmber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 138, 20, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(200, 138, 20, 0); }
}
@keyframes shimmerBar {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}
@keyframes moneyPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); filter: brightness(1.3); }
  100% { transform: scale(1); }
}
@keyframes floatDelta {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  20% { opacity: 1; transform: translateY(-4px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

/* --- Overlays / Start Screen --- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(32, 28, 16, 0.55), rgba(14, 12, 6, 0.78));
  backdrop-filter: blur(8px);
}

.start-card, .modal-card {
  background: linear-gradient(165deg, rgba(253, 249, 240, 0.96), rgba(240, 231, 210, 0.96));
  border: 2px solid rgba(168, 136, 82, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 36px 42px;
  max-width: 520px;
  text-align: center;
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Startbildschirm (#109): Hintergrund aus der eigenen 3D-Szene (styles/start-bg.jpg, mit der 3D-Welt gerendert), ruhig abgedunkelt;
   die Karte steht mittig und rollt auf kleinen Bildschirmen mit (margin: auto statt Zentrieren, sonst würde oben abgeschnitten) */
#start-screen {
  align-items: flex-start; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px 16px; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(18, 24, 14, 0.25), rgba(12, 16, 9, 0.72)), url('start-bg.jpg') center / cover no-repeat, #1c2218;
  backdrop-filter: none;
}
#start-screen .start-card { margin: auto; width: 100%; max-width: 540px; box-sizing: border-box; }
/* Wortmarke FarmWorld (play.html, SVG und Schrift, kein Fremdmaterial) */
.wordmark { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 6px; }
.wm-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; box-shadow: 0 6px 18px rgba(47, 74, 38, 0.35); }
.wm-text { font: 700 40px/1 Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; letter-spacing: -0.5px; color: #2f4a26; }
.wm-text span { color: #a8740f; }
@media (max-width: 480px) {
  #start-screen .start-card { padding: 24px 18px; border-radius: 18px; }
  .wm-icon { width: 42px; height: 42px; } .wm-text { font-size: 32px; }
}
.subtitle { color: var(--ink-soft); font-size: 14.5px; font-weight: 600; margin-bottom: 14px; }
.start-features {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 16px;
}
.feat-chip {
  background: rgba(61, 139, 55, 0.11); color: var(--accent-dark);
  border: 1px solid rgba(61, 139, 55, 0.25);
  border-radius: var(--radius-pill); padding: 4px 11px; font-size: 12.5px; font-weight: 600;
}
.intro { font-size: 14px; line-height: 1.5; margin-bottom: 22px; color: var(--ink); }
.start-buttons { display: flex; flex-direction: column; gap: 10px; }
.hint-pills {
  display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap;
}
.hint-pills span {
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
  background: rgba(160, 140, 96, 0.14); padding: 4px 10px; border-radius: var(--radius-pill);
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 13.5px/1.1 inherit; color: var(--ink);
  background: linear-gradient(180deg, #faf4e4, #eadcc0);
  border: 1.5px solid #baa57a; border-radius: var(--radius-sm);
  padding: 8px 14px; cursor: pointer;
  box-shadow: 0 2px 4px rgba(40, 30, 10, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.14s, background 0.14s, border-color 0.14s;
}
.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #fffdf7, #efe2c6);
  border-color: #9e8656;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(40, 30, 10, 0.15), inset 0 1px 0 #fff;
}
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 10px; }
.btn.primary {
  background: linear-gradient(180deg, #4da146, #377d31);
  border-color: #296124; color: #fff;
  box-shadow: 0 3px 10px rgba(55, 125, 49, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #57b34f, #3e8c37);
  box-shadow: 0 6px 16px rgba(55, 125, 49, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.tiny { padding: 3px 7px; font-size: 11px; border-radius: 6px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(0.35); }
.btn.danger {
  background: linear-gradient(180deg, #fff5f3, #f9ded9);
  border-color: #d9776c; color: var(--danger);
}
.btn.danger:hover:not(:disabled) { background: #fbe4e0; border-color: var(--danger); }
.btn.queue {
  background: linear-gradient(180deg, #fffaf0, #f7e8c3);
  border-color: #d4a038; color: #9c6806; font-weight: 700;
}
.btn.queue:hover:not(:disabled) { background: #faecc8; box-shadow: 0 3px 10px rgba(200, 138, 20, 0.25); }
.btn.contractor {
  background: linear-gradient(180deg, #f2f8fd, #dcecf9);
  border-color: #6ca8d8; color: #1f5c8c;
}
.btn.contractor:hover:not(:disabled) { background: #e5f2fc; border-color: #498ec4; }

/* --- Top HUD Bar (Entzerrt in schwebende Glas-Inseln) --- */
#topbar {
  position: fixed; top: 10px; left: 14px; right: 14px; z-index: 35;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.tb-pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--hud-bg);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--hud-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  color: var(--paper);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.tb-divider {
  width: 1px; height: 18px; background: rgba(255, 240, 200, 0.18); margin: 0 2px;
}
.tb-title { font-weight: 800; font-size: 15px; letter-spacing: 0.2px; display: flex; align-items: center; gap: 5px; }
.tb-weather { font-size: 16px; line-height: 1; }
.tb-clock { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 88px; }
.tb-speed-bar {
  display: flex; align-items: center; gap: 3px;
  background: rgba(0, 0, 0, 0.28); padding: 3px; border-radius: var(--radius-pill);
}
.tbtn {
  font: 700 12px/1 inherit; color: rgba(250, 246, 235, 0.85);
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 5px 9px; cursor: pointer;
  transition: all 0.14s ease;
}
.tbtn.icon-btn { font-size: 14px; padding: 5px 8px; }
.tbtn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.tbtn.active {
  background: linear-gradient(180deg, #52b74a, #388532);
  color: #fff; border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(61, 139, 55, 0.5);
}

.tb-stat {
  display: flex; align-items: center; gap: 6px; position: relative;
  padding: 2px 6px; border-radius: var(--radius-pill);
}
.tb-quick-btn {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--paper); font: inherit; cursor: pointer; padding: 4px 10px;
  transition: all 0.15s ease;
}
.tb-quick-btn:hover {
  background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.tb-ico { font-size: 15px; line-height: 1; }
.tb-item { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tb-item.money { color: var(--gold-bright); font-size: 15.5px; transition: transform 0.2s; }
.tb-item.money.pop { animation: moneyPop 0.4s ease-out; }
.tb-item.rep { color: #ffe082; font-size: 14px; }
.tb-badge.loan {
  background: rgba(201, 59, 43, 0.28); border: 1px solid rgba(255, 130, 110, 0.45);
  color: #ffb09c; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill);
}
.money-delta {
  position: absolute; top: 24px; right: 0; pointer-events: none;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  padding: 2px 6px; border-radius: 6px;
}
.money-delta.show-pos {
  color: #80ff72; background: rgba(20, 40, 18, 0.88);
  animation: floatDelta 1.3s ease-out forwards;
}
.money-delta.show-neg {
  color: #ff8a75; background: rgba(45, 16, 14, 0.88);
  animation: floatDelta 1.3s ease-out forwards;
}
.tb-mini-col { display: flex; flex-direction: column; gap: 2px; min-width: 58px; }
.tb-mini-val { font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tb-mini-bar {
  height: 4px; width: 100%; background: rgba(255, 255, 255, 0.18);
  border-radius: 2px; overflow: hidden;
}
.tb-mini-bar > div { height: 100%; background: #66d95b; transition: width 0.3s ease; }

/* --- Glass Panels --- */
.panel {
  position: fixed; z-index: 25;
  background: var(--panel-bg);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* --- Left Selection Panel (Kontextmenü für Feld / Betrieb / Hof) --- */
#selection-panel {
  left: 14px; top: 62px; width: 326px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  animation: slideInLeft 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* --- Right Panel: NUR NOCH AUFTRÄGE & EINSÄTZE --- */
#side-panel {
  right: 14px; top: 62px; width: 348px;
  max-height: calc(100vh - 82px);
  display: flex; flex-direction: column;
  transition: max-height 0.25s ease, transform 0.2s ease;
}
#side-panel.collapsed .tab-content { display: none !important; }
#side-panel.collapsed { max-height: 52px; }

.side-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(236, 226, 201, 0.95), rgba(226, 213, 182, 0.95));
  border-bottom: 1.5px solid rgba(160, 140, 96, 0.45);
  padding: 5px 6px; gap: 6px;
}
.orders-tabs {
  display: flex; flex: 1; gap: 4px;
  background: rgba(58, 49, 37, 0.08);
  padding: 3px; border-radius: 10px;
}
.orders-tabs .tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 8px; border: none; border-radius: 8px; cursor: pointer;
  font: 700 13px/1 inherit; color: var(--ink-soft); background: transparent;
  transition: all 0.15s ease;
}
.orders-tabs .tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.45); }
.orders-tabs .tab.active {
  color: var(--ink); background: var(--paper);
  box-shadow: 0 2px 6px rgba(40, 30, 10, 0.12);
}
.tab-ico { font-size: 14px; }
.tab-badge {
  background: rgba(61, 139, 55, 0.16); color: var(--accent-dark);
  font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: var(--radius-pill);
}
.tab.active .tab-badge { background: var(--accent); color: #fff; }
.icon-toggle {
  border: none; background: rgba(255, 255, 255, 0.5); color: var(--ink-soft);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: all 0.14s;
}
.icon-toggle:hover { background: #fff; color: var(--ink); }

.tab-content { padding: 10px 12px; overflow-y: auto; font-size: 13px; }

/* Filter-Leiste im Aufträge-Panel */
.filter-bar {
  display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: nowrap;
}
.filter-pill {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 5px; font: 700 11px/1 inherit; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65); border: 1px solid #d5c5a1;
  border-radius: var(--radius-pill); cursor: pointer; transition: all 0.12s;
  white-space: nowrap;
}
.filter-pill:hover { background: #fff; color: var(--ink); }
.filter-pill.active {
  background: var(--accent); border-color: var(--accent-dark); color: #fff;
  box-shadow: 0 2px 6px var(--accent-glow);
}

/* Spedition Status-Strip (kompakt mit Symbolen statt Textwüste) */
.spedition-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: linear-gradient(135deg, #f3f7fb, #e5eff8);
  border: 1.5px solid #b5cde2; border-radius: 10px;
  padding: 7px 10px; margin-bottom: 10px; font-size: 12px;
}
.spedition-strip .sp-name { font-weight: 700; color: #244766; display: flex; align-items: center; gap: 5px; }
.spedition-strip .sp-chips { display: flex; align-items: center; gap: 5px; }

/* --- Bottom Dock (Schnellzugriff auf Hof/Lager, Betrieb/Shop, Markt, Log) --- */
#bottom-dock {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 32;
  display: flex; align-items: center; gap: 8px;
  background: var(--hud-bg);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1.5px solid rgba(255, 235, 190, 0.22);
  border-radius: 20px;
  padding: 6px 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.dock-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 7px 14px;
  color: var(--paper); cursor: pointer;
  font: 600 13px/1.1 inherit;
  transition: all 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dock-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.dock-btn.active {
  background: linear-gradient(180deg, #52b74a, #377d31);
  border-color: #8be882;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(61, 139, 55, 0.55);
}
.dock-ico { font-size: 19px; line-height: 1; }
.dock-label { font-weight: 700; font-size: 13px; }
.dock-sub {
  font-size: 10.5px; font-weight: 700;
  background: rgba(0, 0, 0, 0.32); color: #ffd970;
  padding: 2px 6px; border-radius: var(--radius-pill);
}
.dock-btn.active .dock-sub { background: rgba(0, 0, 0, 0.25); color: #fff; }

/* --- Central Management Drawer / Modal (Hof, Betrieb, Markt, Log) --- */
.drawer-modal {
  left: 354px; right: 376px; top: 62px;
  width: auto; max-width: 880px; margin: 0 auto;
  max-height: calc(100vh - 148px);
  z-index: 44;
  display: flex; flex-direction: column;
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (max-width: 1280px) {
  .drawer-modal { left: 16px; right: 374px; }
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #efe4ca, #e4d5b4);
  border-bottom: 1.5px solid #c4b086;
}
.drawer-title-group { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.drawer-ico { font-size: 20px; }
.drawer-header h2 { font-size: 15.5px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.drawer-nav {
  display: flex; gap: 4px; background: rgba(58, 49, 37, 0.09);
  padding: 3px; border-radius: 10px;
}
.drawer-tab {
  border: none; background: transparent; color: var(--ink-soft);
  font: 600 12.5px/1 inherit; padding: 6px 11px; border-radius: 7px; cursor: pointer;
  transition: all 0.12s;
}
.drawer-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.45); }
.drawer-tab.active {
  background: var(--paper); color: var(--accent-dark); font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.drawer-close { position: static !important; width: 30px; height: 30px; border-radius: 8px; }
.drawer-close:hover { background: rgba(0, 0, 0, 0.08); }
.drawer-body { padding: 14px 16px; overflow-y: auto; font-size: 13.5px; }

/* --- Grids & Cards inside Drawer & Panels --- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px;
  margin-bottom: 12px;
}
.kpi-box {
  background: var(--paper-card); border: 1.5px solid #dfd1b0;
  border-radius: 10px; padding: 8px 11px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow-sm);
}
.kpi-box .kpi-ico { font-size: 22px; }
.kpi-box .kpi-lbl { font-size: 11px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.kpi-box .kpi-val { font-size: 15px; font-weight: 800; color: var(--ink); }

.panel h3 {
  font-size: 14.5px; font-weight: 800; padding: 10px 14px 8px; color: var(--accent-dark);
  border-bottom: 1px solid #dfd1b0; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.sec-head {
  font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--ink-soft); margin: 10px 0 6px; display: flex; align-items: center; gap: 6px;
}
.sec-head:first-child { margin-top: 0; }
.panel .body { padding: 6px 12px 12px; }
.panel .close-x {
  position: absolute; top: 8px; right: 10px; border: none; background: rgba(0,0,0,0.06);
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 14px; cursor: pointer; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.14s;
}
.panel .close-x:hover { background: rgba(201, 59, 43, 0.15); color: var(--danger); transform: scale(1.08); }

/* --- Chips & Visual Badges (Mehr Symbole, weniger Text) --- */
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(160, 140, 96, 0.14); border: 1px solid rgba(160, 140, 96, 0.3);
  border-radius: var(--radius-pill); padding: 3px 8px;
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.chip.good, .chip.ok { background: rgba(61, 139, 55, 0.13); border-color: rgba(61, 139, 55, 0.32); color: var(--accent-dark); }
.chip.bad { background: var(--danger-bg); border-color: rgba(201, 59, 43, 0.35); color: var(--danger); }
.chip.warn { background: var(--gold-bg); border-color: rgba(200, 138, 20, 0.4); color: #946200; }
.chip.gold { background: linear-gradient(135deg, #fff8df, #f9e7af); border-color: #d9aa38; color: #7a5200; font-weight: 700; }
.chip.blue { background: var(--blue-light); border-color: #9bc4e8; color: #1d578a; }

.good-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(0,0,0,0.2);
}

.kv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3.5px 0; }
.kv b { font-weight: 700; }
.muted { color: var(--ink-soft); font-size: 12px; }
.good { color: var(--accent-dark); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.warn { color: var(--gold); font-weight: 600; }
.money-pos { color: var(--accent-dark); font-weight: 800; }
.money-neg { color: var(--danger); font-weight: 700; }

.action-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* --- Cards --- */
.card {
  background: var(--paper-card);
  border: 1.5px solid #dfd1b0;
  border-radius: var(--radius-md);
  padding: 10px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.card:hover {
  border-color: #c5b184;
  box-shadow: 0 5px 14px rgba(35, 25, 8, 0.12);
}
.card .title {
  font-weight: 700; font-size: 13.5px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.card .meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.card.accepted {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f9fdf7, #f1f9ee);
}
.card.running {
  border-color: var(--blue);
  background: linear-gradient(180deg, #f7fbff, #edf5fc);
}
.card.queued {
  border-color: var(--gold); border-style: dashed;
  background: #fffcf2;
}
.card .prog { font-weight: 700; color: var(--accent-dark); }

/* Voraussetzungs-Anzeigen */
.req-ok { font-size: 12px; font-weight: 600; color: var(--accent-dark); margin: 3px 0 6px; display: flex; align-items: center; gap: 4px; }
.req-bad { font-size: 12px; font-weight: 600; color: var(--danger); margin: 3px 0 6px; display: flex; align-items: center; gap: 4px; }

/* Aktionszeilen bei Feldarbeit/Aufträgen */
.job-action-box {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #e2d4b5; border-radius: 9px;
  padding: 6px; margin-bottom: 6px;
}
.job-line { display: flex; gap: 5px; align-items: center; margin: 3px 0; }
.job-line .btn.primary, .job-line .btn.contractor { flex: 1; justify-content: space-between; }
.lu-status { font-size: 11px; white-space: nowrap; }

/* Trend-Symbol bei Preisen */
.trend {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; cursor: help; margin-left: 4px;
  width: 18px; height: 18px; border-radius: 50%;
}
.trend.up { color: #2b7a1f; background: rgba(61, 139, 55, 0.15); }
.trend.down { color: var(--danger); background: rgba(201, 59, 43, 0.14); }
.trend.flat { color: #8c7f65; font-size: 8px; }

/* Akkordeon-Sektionen */
.card.accordion { padding: 0; overflow: hidden; }
.acc-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; cursor: pointer;
  padding: 10px 12px; font: inherit; text-align: left; color: var(--ink);
  transition: background 0.12s;
}
.acc-head:hover { background: var(--paper-hover); }
.acc-chev { font-size: 12px; color: var(--ink-soft); width: 12px; }
.acc-title { font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.acc-summary { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: right; }
.acc-body { padding: 8px 12px 12px; border-top: 1px solid #e6dabd; }

.machine-row {
  padding: 7px 9px; margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #e4d7b8; border-radius: 8px;
}
.machine-row:last-of-type { margin-bottom: 0; }

/* Tier-Grid im Stall */
.animal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 5px; margin: 6px 0;
}
.animal-chip {
  background: rgba(255, 255, 255, 0.72); border: 1px solid #dfd1b0;
  border-radius: 8px; padding: 5px 7px; font-size: 11.5px;
  display: flex; flex-direction: column; gap: 3px;
}
.animal-chip.ready { border-color: var(--accent); background: #f2faef; }

/* Mengenwahl im Verkaufsdialog */
.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-row input[type=range] { flex: 1; accent-color: var(--accent); }
.qty-row input[type=number] { width: 95px !important; margin: 0 !important; font-weight: 700; }

/* Fortschrittsbalken mit Shimmer-Effekt */
.bar {
  height: 8px; background: rgba(168, 144, 96, 0.25);
  border-radius: var(--radius-pill); overflow: hidden; margin: 5px 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}
.card.running .bar > div, .jm-bar > div {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.22) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.22) 75%,
    transparent 75%,
    transparent
  );
  background-size: 28px 28px;
  animation: shimmerBar 1s linear infinite;
}
.bar.wear > div { background: linear-gradient(90deg, #d99b1e, #f2b738); }
.bar.wear.crit > div { background: linear-gradient(90deg, #c93b2b, #e85a47); }

/* --- Kampagnen-Tracker (unten links, kompakt & einklappbar) --- */
#campaign-panel {
  left: 14px; bottom: 12px; width: 295px;
  max-height: 195px; overflow-y: auto;
  border-color: rgba(61, 139, 55, 0.55);
}
#campaign-panel .cp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 11px; cursor: pointer;
  background: linear-gradient(90deg, rgba(61, 139, 55, 0.15), rgba(61, 139, 55, 0.04));
  border-bottom: 1px solid rgba(61, 139, 55, 0.2);
}
#campaign-panel .ch-title { font-weight: 800; font-size: 12.5px; color: var(--accent-dark); }
#campaign-panel .body { padding: 7px 11px 9px; }
#campaign-panel.collapsed .body { display: none; }
#campaign-panel .ch-brief { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 5px; line-height: 1.35; }
.goal {
  font-size: 12px; font-weight: 600; padding: 2.5px 0;
  display: flex; align-items: center; gap: 5px;
}
.goal.done { color: var(--accent-dark); text-decoration: line-through; opacity: 0.72; }

/* --- Tutorial-Hinweis (schwebend über dem Bottom-Dock) --- */
#tutorial-hint {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%); z-index: 38;
  background: linear-gradient(135deg, #fffdf2, #ffefc2);
  border: 2px solid #e0a82e; border-radius: var(--radius-pill);
  box-shadow: var(--shadow), 0 0 20px rgba(240, 180, 40, 0.3);
  padding: 8px 16px; max-width: 560px;
  font-size: 13px; display: flex; gap: 10px; align-items: center;
  animation: popIn 0.25s ease-out, pulseAmber 2.5s infinite;
}
#tutorial-hint .t-icon { font-size: 20px; }
#tutorial-hint button { flex-shrink: 0; border-radius: var(--radius-pill); }

/* --- Sell-Modal --- */
#sell-modal-content { text-align: left; min-width: 420px; }
#sell-modal-content h3 { font-size: 18px; margin-bottom: 10px; color: var(--accent-dark); }
#sell-modal-content select, #sell-modal-content input[type=number] {
  width: 100%; padding: 8px 10px; margin: 4px 0 10px;
  border: 1.5px solid #baa57a; border-radius: 8px; font: 600 13.5px inherit;
  background: #fffdf7; color: var(--ink);
}
#sell-modal-content input[type=range] { width: 100%; margin: 4px 0; }
.price-preview {
  background: var(--paper-dark); border: 1px solid #d5c49e; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin: 8px 0;
}

/* --- Toasts (Oben rechts neben dem Auftragsmenü als kompakte Glas-Pills) --- */
#toasts {
  position: fixed; top: 62px; right: 374px;
  z-index: 36; display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  pointer-events: none; width: auto; max-width: 340px;
}
.toast {
  background: rgba(28, 24, 17, 0.90);
  backdrop-filter: blur(10px);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid var(--accent-light);
  border-radius: var(--radius-pill);
  padding: 6px 14px; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: toastDrop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.toast.warn { border-left-color: var(--gold-bright); }
.toast.bad { border-left-color: #ff6b57; background: rgba(48, 18, 15, 0.92); }
.toast.good { border-left-color: #6dbb54; }
.toast.money { border-left-color: var(--gold-bright); color: var(--gold-bright); }
.toast.contract { border-left-color: #5ca8e6; }

/* --- Log-Tab --- */
.log-entry {
  font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid #e6dabd;
  display: flex; align-items: center; gap: 8px;
}
.log-entry .day {
  background: var(--paper-dark); color: var(--ink-soft);
  padding: 2px 7px; border-radius: var(--radius-pill); font-weight: 700; font-size: 11px;
  white-space: nowrap;
}

/* --- Hilfe-Overlay --- */
.help-list { text-align: left; font-size: 13px; line-height: 1.55; max-height: 60vh; overflow-y: auto; padding-right: 6px; }
.help-list p { margin-bottom: 8px; padding: 6px 8px; background: rgba(255,255,255,0.55); border-radius: 8px; }
.help-list b { color: var(--accent-dark); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(155, 134, 92, 0.65); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* --- Auftragsmonitor (kompaktes Status-Widget unten rechts) --- */
#job-monitor {
  right: 374px; bottom: 12px; z-index: 33;
  min-width: 185px; max-width: 330px;
  border-color: rgba(138, 111, 69, 0.65);
  border-radius: 14px;
}
#job-monitor .jm-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 11px; cursor: pointer; user-select: none;
  background: linear-gradient(180deg, #efe4ca, #e4d5b4);
}
#job-monitor .jm-head:hover { background: #e8d8b5; }
#job-monitor .jm-title { font: 800 12px/1 inherit; color: var(--accent-dark); white-space: nowrap; }
#job-monitor .jm-mini { display: flex; gap: 7px; font: 700 12px/1 inherit; white-space: nowrap; }
#job-monitor .jm-caret { margin-left: auto; color: var(--ink-soft); font-size: 11px; }
#job-monitor .jm-body { padding: 6px 10px 8px; max-height: 30vh; overflow-y: auto; }
#job-monitor .jm-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 3px 6px; padding: 4px 2px 6px; border-bottom: 1px solid #e3d7ba;
  font-size: 11.5px;
}
#job-monitor .jm-row:last-child { border-bottom: none; }
#job-monitor .jm-row .jm-ico { font-size: 13px; }
#job-monitor .jm-row .jm-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#job-monitor .jm-row .jm-status { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
#job-monitor .jm-row .jm-bar { grid-column: 1 / -1; height: 4px; background: #e3d7ba; border-radius: 2px; overflow: hidden; }
#job-monitor .jm-row .jm-bar > div { height: 100%; background: var(--accent); border-radius: 2px; }
#job-monitor .jm-row.queued .jm-status { font-style: italic; }

/* --- Sprachumschaltung (i18n) --- */
.lang-select {
  font: 700 11.5px/1 inherit; color: var(--ink);
  background: linear-gradient(180deg, #f6eed9, #eadfc2);
  border: 1px solid rgba(168, 136, 82, 0.6);
  border-radius: var(--radius-pill);
  padding: 4px 8px; cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.start-lang {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px;
}
.start-lang .lang-label { font: 700 11.5px/1 inherit; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }

#map { z-index: 1; }

/* Feld-Panel: Aktionen zuerst, kompakt und abgesetzt */
.field-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px; margin: 0 0 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(60, 70, 50, 0.14); }
.field-actions .job-action-box .btn { margin: 0; }

/* Feld-Fenster: Tabs für Aktionen und Boden/Ertrag */
.sel-tabs { display: flex; gap: 4px; margin: 0 0 8px; padding: 3px; border-radius: 9px; background: rgba(60, 70, 50, 0.1); }
.sel-tabs .tab { flex: 1; border: 0; background: transparent; border-radius: 7px; padding: 5px 8px; font: 600 12px system-ui, sans-serif; color: var(--ink-soft, #555); cursor: pointer; }
.sel-tabs .tab:hover { background: rgba(255, 255, 255, 0.55); }
.sel-tabs .tab.active { background: #fff; color: var(--ink, #222); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

/* Feld-Kopf im Aktionen-Tab: Name/Chips/Status über den Aktionsbuttons */
.field-head { padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(60, 70, 50, 0.14); margin-bottom: 8px; }

/* Fehlermeldungen deutlich sichtbar */
.req-bad {
  font-size: 13px; font-weight: 700; color: #7c2d12;
  background: rgba(190, 60, 30, 0.12); border: 1px solid rgba(190, 60, 30, 0.35);
  border-radius: 7px; padding: 5px 8px; margin: 4px 0;
  display: flex; align-items: center; gap: 5px;
}

/* ==========================================================================
   HUD-Redesign (Claude Design „Wiesental HUD", Variante Aktionsleiste)
   Kopfleiste in vier Pillen · Zu-tun-Liste links · Aufträge rechts (eingeklappt)
   · Feld-Aktionsleiste unten · Verwaltungsfenster mittig
   ========================================================================== */
#topbar { flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
.tb-pill { min-height: 48px; padding: 0 8px 0 12px; flex: none; }
.tb-time-group { padding-right: 6px; }
.tb-title { font-size: 20px; line-height: 1; }
.tb-speed-bar { background: rgba(0, 0, 0, 0.28); padding: 3px; border-radius: var(--radius-pill); }
.tbtn.speed, #btn-pause { min-width: 34px; min-height: 34px; border-radius: var(--radius-pill); }
.tb-stats-group { gap: 6px; padding-left: 14px; }
.tb-stats-group .tb-quick-btn, .tb-store {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill); color: var(--paper); cursor: pointer;
  font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tb-stats-group .tb-quick-btn:hover, .tb-store:hover { background: rgba(255, 255, 255, 0.18); }
.tb-stores { gap: 6px; padding: 0 6px; margin-left: auto; }
.tb-stores:empty { display: none; }
.tb-store { gap: 8px; }
.tb-store-col { display: flex; flex-direction: column; gap: 3px; }
.tb-store-goods { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; line-height: 1; }
.tb-store .tb-mini-bar { display: block; height: 4px; background: rgba(255, 255, 255, 0.18); border-radius: 2px; overflow: hidden; margin: 0; }
.tb-store .tb-mini-bar > span { display: block; height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.tb-store-cap { font-size: 10.5px; font-weight: 700; color: rgba(250, 246, 235, 0.6); }
.tb-store-cap:empty { display: none; }
.tb-sys-group { position: relative; gap: 2px; padding: 0 4px; }
.tb-sys-group .tbtn.icon-btn { width: 40px; height: 40px; font-size: 17px; border-radius: var(--radius-pill); }
.sys-menu {
  position: absolute; top: 54px; right: 0; width: 230px; z-index: 50;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: rgba(28, 24, 17, 0.94); border: 1px solid rgba(255, 235, 190, 0.2);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.sys-item {
  min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: transparent; border: 0; border-radius: 10px; color: var(--paper);
  font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: left;
}
.sys-item:hover { background: rgba(255, 255, 255, 0.12); }
.sys-item > span:first-child { width: 20px; text-align: center; }
.sys-lang .lang-select { margin-left: auto; }
@media (max-width: 1380px) { .tb-store-cap { display: none; } }
@media (max-width: 1180px) { .tb-stores { display: none; } }

/* --- Statusringe (Karte, Zu-tun-Liste, Aktionsleiste) --- */
.ring {
  --rc: #b8ad93;
  flex: none; width: 36px; height: 36px; padding: 3px; border-radius: 50%;
  background: var(--rc); display: flex; align-items: center; justify-content: center;
}
.ring > span {
  width: 100%; height: 100%; border-radius: 50%; background: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1;
}
.ring.big { width: 48px; height: 48px; padding: 4px; }
.ring.big > span { font-size: 22px; }
.ring-critical { --rc: #e2523f; }
.ring-high { --rc: #f2a33a; }
.ring-normal { --rc: #6fb24a; }
.ring-run { --rc: #4a90d9; }
.ring-gold { --rc: #e0a82e; }
.ring-idle, .ring-sale { --rc: #b8ad93; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }

/* --- Links: Zu tun / Felder --- */
#todo-panel {
  left: 14px; top: 68px; width: 272px;
  max-height: calc(100vh - 68px - 150px);
  display: flex; flex-direction: column;
}
#todo-panel.collapsed .tab-content { display: none; }
#todo-content { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
body.has-side-sel #todo-panel { display: none; }
.todo-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 12px;
  padding: 5px 6px; box-shadow: 0 2px 0 #dccfae;
}
.todo-row.run { box-shadow: none; background: rgba(255, 252, 244, 0.7); }
.todo-main {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 9px;
  border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit;
}
.todo-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-txt b { font-size: 12.5px; line-height: 1.2; }
.todo-txt b, .todo-txt > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-txt span { font-size: 11px; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
.todo-row .btn { flex: none; }
.todo-chev { flex: none; color: #a8946a; font-size: 18px; font-weight: 800; padding: 0 4px; }
.todo-row:hover { border-color: #c9b78d; }
.todo-note { font-size: 11.5px; color: var(--ink-soft); text-align: center; padding: 10px 6px; line-height: 1.4; }
.todo-legend { display: flex; flex-wrap: wrap; gap: 5px 10px; padding: 6px 4px 0; border-top: 1px dashed #d5c5a1; }
.todo-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.tab-badge.zero { opacity: 0.45; }

/* --- Rechts: Aufträge (vier Reiter, standardmäßig eingeklappt) --- */
#side-panel { top: 68px; width: 430px; max-height: calc(100vh - 88px); }
#side-panel .orders-tabs .tab { min-width: 0; padding-left: 6px; padding-right: 6px; }
#side-panel .tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1380px) { #side-panel { width: 348px; } #side-panel .tab-ico { display: none; } }

/* --- Auswahl: Hof/Betrieb/Nachbarschlag links, Feld als Aktionsleiste unten --- */
#selection-panel { top: 68px; }
@keyframes sheetIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#selection-panel.field-sheet {
  left: 50%; top: auto; bottom: 74px; transform: translateX(-50%);
  width: min(960px, calc(100% - 28px)); max-height: min(46vh, 420px);
  z-index: 40; border: 2px solid rgba(61, 139, 55, 0.65);
  animation: sheetIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
#selection-panel.field-sheet:has(.fs-cropbox) { max-height: min(78vh, 680px); }   /* Fruchtwahl: das Blatt darf höher werden */
.fs-grid { display: flex; flex-wrap: wrap; gap: 12px 14px; padding: 12px; }
.fs-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fs-head { flex: 1 1 250px; }
.fs-steps { flex: 1.5 1 300px; }
.fs-exec { flex: 1 1 250px; gap: 6px; }
.fs-info { flex: 2 1 300px; justify-content: center; }
.fs-soil { flex: 1 1 260px; }
.fs-soil .card { margin: 0 !important; }
.fs-grid .sec-head { margin: 0; padding-right: 40px; }
.fs-title { display: flex; align-items: center; gap: 10px; padding-right: 36px; }
.fs-title h3 { padding: 0; margin: 0; border: 0; background: none; font-size: 16px; font-weight: 800; color: var(--accent-dark); line-height: 1.15; }
.fs-status { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.fs-tiles { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.fs-tile {
  position: relative; width: 104px; min-height: 86px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 12px;
  box-shadow: 0 2px 0 #dccfae; cursor: pointer; color: var(--ink); font: inherit; text-align: center;
}
.fs-tile:hover { border-color: #c9b78d; background: #fff; }
.fs-tile.active { border: 2px solid var(--accent); background: #f4faf0; box-shadow: 0 0 0 3px var(--accent-glow); }
.fs-tile-ico { font-size: 24px; line-height: 1; }
.fs-tile-name { font-size: 11.5px; font-weight: 700; line-height: 1.15; }
.fs-tile-bonus {
  background: rgba(61, 139, 55, 0.13); border: 1px solid rgba(61, 139, 55, 0.32); color: var(--accent-dark);
  border-radius: var(--radius-pill); padding: 1px 6px; font-size: 10.5px; font-weight: 700;
}
.fs-rec {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--gold-bright); color: #5a3d00; border: 1px solid var(--gold);
  font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-pill);
  white-space: nowrap; letter-spacing: 0.3px;
}
.fs-cropbox { margin-top: 8px; padding: 8px; border: 2px solid var(--accent); border-radius: 12px; background: #f4faf0; }
.fs-cropbox .sec-head { margin-top: 0; }
.fs-crops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
@media (min-width: 761px) {
  .fs-crops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Fruchtwahl: Kopf und Arbeitsschritte oben links, Auswahl darunter über zwei Spalten, die Ausführung rechts über beide Zeilen */
  .fs-grid:has(.fs-cropbox) { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.5fr) minmax(240px, 1fr); align-items: start; }
  .fs-grid:has(.fs-cropbox) > .fs-head { grid-column: 1; grid-row: 1; }
  .fs-grid:has(.fs-cropbox) > .fs-steps { grid-column: 2; grid-row: 1; }
  .fs-grid:has(.fs-cropbox) > .fs-exec { grid-column: 3; grid-row: 1 / span 2; }
  .fs-grid:has(.fs-cropbox) > .fs-cropbox { grid-column: 1 / span 2; grid-row: 2; margin-top: 0; }
}
.fs-crop {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; font: inherit; color: inherit;
  background: #fff; border: 2px solid #dfd1b0; border-radius: 10px; padding: 7px 9px; cursor: pointer; min-height: 44px;
}
.fs-crop:hover:not(:disabled) { border-color: #c9b78d; }
.fs-crop:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fs-crop.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.fs-crop.warn:not(.active) { border-color: #d99b1e; }
.fs-crop:disabled { opacity: 0.6; cursor: not-allowed; background: #eee8d8; }
.fs-crop-sym { font-weight: 700; }
.fs-crop-more { display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.3; padding-top: 3px; border-top: 1px dashed #d5c5a1; }
.fs-crop-more .ok { color: #2f6f2a; }
.fs-crop-more .bad { color: #a33a1c; font-weight: 700; }
.fs-crop-name { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fs-crop-name .fs-rec { position: static; transform: none; }
.fs-crop-line { font-size: 11px; line-height: 1.3; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 2px 8px; }
.fs-crop-line .ok { color: #2f6f2a; }
.fs-crop-line .bad { color: #a33a1c; font-weight: 700; }
.fs-crop-why { font-size: 11px; font-weight: 700; color: #7c2d12; line-height: 1.25; }
.fs-chosen { font-size: 16px; font-weight: 800; padding: 6px 9px; border-radius: 9px; background: #f4faf0; border: 2px solid var(--accent); }
.fs-stage { background: rgba(255, 255, 255, 0.55); border: 1px solid #e2d4b5; border-radius: 9px; padding: 5px 9px; display: flex; flex-direction: column; }
.fs-stage b { font-size: 12px; }
.fs-stage span { font-size: 11px; color: var(--ink-soft); line-height: 1.3; }
.fs-start { min-height: 48px; justify-content: space-between; font-size: 14px; padding: 8px 14px; }
.fs-meta { font-weight: 600; font-size: 12.5px; }
.fs-exec .btn { min-height: 40px; margin: 0; }
.fs-exec .job-line { margin: 0; gap: 6px; }
.fs-cfg { flex: none; width: 44px; justify-content: center; }
.fs-lu { justify-content: space-between; }
.fs-lu-meta { display: flex; align-items: center; gap: 6px; }
.fs-reason {
  font-size: 12px; font-weight: 700; color: #7c2d12; line-height: 1.3;
  background: rgba(190, 60, 30, 0.12); border: 1px solid rgba(190, 60, 30, 0.35); border-radius: 8px;
  padding: 5px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.fs-reason .btn { min-height: 32px; white-space: nowrap; }
.fs-infobox {
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.fs-infobox .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 13.5px; }
.fs-infobox .muted { line-height: 1.35; }
.fs-infobox .btn { align-self: flex-start; }
body.has-field-sheet #tutorial-hint { bottom: auto; top: 124px; }
body.has-field-sheet #job-monitor { display: none; }

/* --- Verwaltungsfenster mittig --- */
.drawer-modal {
  left: 50%; right: auto; top: 68px; transform: translateX(-50%);
  width: min(920px, calc(100% - 28px)); max-width: none; margin: 0;
  max-height: calc(100% - 150px);
  animation: sheetIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (max-width: 1280px) { .drawer-modal { left: 50%; right: auto; } }

/* --- Kampagnenziel (unten links, eingeklappt: Titel + Fortschritt) --- */
#campaign-panel { width: 300px; max-height: 300px; }
#campaign-panel.collapsed { border-radius: var(--radius-lg); }
#campaign-panel .cp-head { min-height: 48px; padding: 6px 10px; gap: 8px; justify-content: flex-start; }
#campaign-panel.collapsed .cp-head { border-bottom: 0; }
.cp-ico { font-size: 20px; line-height: 1; }
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#campaign-panel .ch-title { line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-prog { display: flex; align-items: center; gap: 6px; }
.cp-bar { flex: 1; height: 6px; background: rgba(168, 144, 96, 0.3); border-radius: var(--radius-pill); overflow: hidden; display: block; }
.cp-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width 0.3s ease; }
.cp-count { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.cp-caret { color: var(--ink-soft); font-size: 11px; }
.cp-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 2px; margin-bottom: 7px; font-size: 10px; font-weight: 800; }
.cp-step {
  width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(168, 144, 96, 0.3); color: var(--ink-soft);
}
.cp-step.done { background: var(--accent); color: #fff; }
.cp-step.cur { width: 23px; height: 23px; background: var(--gold-bright); color: #5a3d00; border: 2px solid var(--gold); }
.cp-line { width: 6px; height: 3px; background: rgba(168, 144, 96, 0.35); border-radius: 2px; }
.cp-line.done { background: var(--accent); }

/* --- Startbildschirm: Fortsetzen-Karte --- */
.start-continue { min-height: 64px; gap: 12px; padding: 8px 16px; text-align: left; justify-content: flex-start; border-radius: 12px; box-shadow: 0 4px 0 #1f4f1b, inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.sc-play { font-size: 24px; }
.sc-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sc-text b { font-size: 16px; }
.sc-meta { font-size: 12px; font-weight: 600; opacity: 0.92; }
.sc-meta:empty { display: none; }
.start-row { display: flex; gap: 10px; }
.start-row .btn { flex: 1; justify-content: center; min-height: 46px; font-size: 14px; }
#btn-legacy { align-self: center; }
.start-lang { gap: 6px; }

/* --- Kantenhinweis: Lohnarbeit außerhalb des Bildausschnitts --- */
#edge-hint {
  position: fixed; z-index: 30; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 5px 12px; border-radius: var(--radius-pill);
  background: rgba(255, 250, 235, 0.97); border: 2px solid #e0a82e; color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); cursor: pointer; font: inherit; white-space: nowrap;
  transform: translate(-50%, -50%);
}
#edge-hint .eh-ico { font-size: 18px; }
#edge-hint .eh-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
#edge-hint .eh-txt b { font-size: 12px; line-height: 1; }
#edge-hint .eh-txt span { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); line-height: 1; }
#edge-hint .eh-arrow { font-size: 15px; color: #946200; display: inline-block; }

/* --- Feinschliff: Toasts unter der Kartenwahl, Hinweis weicht der Aktionsleiste --- */
button, input, select { font-family: inherit; }
#toasts { top: 124px; right: auto; left: 50%; transform: translateX(-50%); align-items: center; max-width: min(560px, calc(100% - 28px)); z-index: 46; }
body.has-field-sheet #toasts { top: 176px; }
.todo-txt b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* links bleibt die Aufgabenliste (272 px) samt Rändern frei: zwischen 700 und 770 px berührten sich beide Listen (#137) */
#side-panel { width: min(456px, calc(100vw - 328px)); }
#side-panel .orders-tabs .tab { font-size: 12.5px; gap: 4px; }

/* --- Verwaltungsfenster: Unterreiter, Lagerkarten --- */
#drawer-icon { font-size: 22px; }
.drawer-nav { margin-left: auto; }
.drawer-nav:empty { display: none; }
.drawer-tab { min-height: 34px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-row .sec-head { margin: 0; }
.store-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.store-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.store-card .bar, .store-card .chip-row, .store-card .action-row { margin: 0; }
.store-card .title { margin: 0; }
.store-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px dashed #e6dabd; padding-top: 6px; min-height: 36px;
}
.store-val { display: flex; align-items: center; gap: 8px; flex: none; }
.store-card .action-row { margin-top: auto; padding-top: 4px; }
/* Der Reiter „Laufend" rechts ersetzt den Auftragsmonitor unten rechts */
#job-monitor { display: none !important; }

/* --- Verkaufsdialog: Ware als Pillen, Abnehmer als Liste --- */
#sell-modal-content { display: flex; flex-direction: column; gap: 8px; max-width: 500px; max-height: calc(100vh - 28px); overflow-y: auto; }
#sell-modal-content h3 { margin: 0; }
#sell-modal-content label.muted { font-weight: 700; }
.sell-goods { display: flex; flex-wrap: wrap; gap: 6px; }
.sell-buyers { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.sell-buyer {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 10px;
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 10px;
  cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.2; text-align: left;
}
.sell-buyer:hover { border-color: #c9b78d; background: #fff; }
.sell-buyer.active { border: 2px solid var(--accent); background: #f4faf0; padding: 4.5px 9.5px; }
.sell-buyer .sb-name { flex: 1; min-width: 0; }
.sell-buyer b { color: var(--accent-dark); }
.sell-qty-head { display: flex; align-items: center; justify-content: space-between; }
.sell-go { min-height: 48px; justify-content: center; font-size: 14px; }
.sell-alt { display: flex; flex-wrap: wrap; gap: 6px; }
.sell-alt .btn { flex: 1 1 120px; min-height: 44px; justify-content: center; }
.sell-who, .fs-who { font-size: 12px; line-height: 1.35; margin: 2px 0 6px; }   /* Wer fährt? (#138): was die Wahl bedeutet */
#sell-modal-content select, #sell-modal-content input[type=number] { margin: 0; }

/* --- Schmale Fenster (≤ 1380 px): Kopfleiste bleibt einzeilig --- */
.dock-label, .dock-sub { white-space: nowrap; }
@media (max-width: 1380px) {
  .tb-clock { min-width: 0; }
  .tbtn.speed, #btn-pause { min-width: 30px; padding-left: 5px; padding-right: 5px; }
  .tb-store:nth-child(n+3) { display: none; }
  .tb-pill { padding-left: 8px; }
}

/* ==========================================================================
   Fuhrpark · Händler · Hof · Ställe — dichte, gruppierte Listen fürs Lategame
   ========================================================================== */
/* Solange ein Verwaltungsfenster offen ist, weichen die Toasts aus: nach unten, auf breiten Fenstern nach rechts */
body:has(#drawer-panel:not(.hidden)) #toasts { top: auto; bottom: 70px; }
@media (min-width: 1600px) {
  body:has(#drawer-panel:not(.hidden)) #toasts { left: auto; right: 14px; top: 128px; bottom: auto; transform: none; align-items: flex-end; width: 300px; }
  body:has(#drawer-panel:not(.hidden)) .toast { max-width: 100%; }
}
.drawer-modal { width: min(960px, calc(100% - 28px)); }
.drawer-body .sec-head { margin-top: 14px; }
.drawer-body > .sec-head:first-child, .sec-row .sec-head { margin-top: 0; }

/* Betriebsleiste: Geld/Kredit · Fahrer · Werkstatt in einer Zeile */
.ops-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ops-box {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 10px;
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 10px;
}
.ops-txt { display: flex; flex-direction: column; gap: 1px; margin-right: auto; white-space: nowrap; }
.ops-txt .kpi-lbl { font-size: 10.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.ops-txt b { font-size: 14px; }

/* Fahrzeugzeilen (zweispaltig) */
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 6px; }
.fl-row {
  display: flex; flex-direction: column; gap: 4px; padding: 6px 9px; min-width: 0;
  background: var(--paper-card); border: 1.5px solid #dfd1b0; border-radius: 10px;
}
.fl-row.crit { border-color: var(--danger); background: var(--danger-bg); }
.fl-top, .fl-bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fl-top b { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-job { max-width: 190px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.fl-spec { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.fl-bot .bar { flex: 1; min-width: 40px; height: 6px; margin: 0; }
.fl-cond { font-size: 11.5px; font-weight: 700; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* Eigene Geräte: je Einsatzgebiet eine Zeile, Lücken als gestrichelte Chips */
.im-card { padding: 4px 12px; margin: 0; }
.im-cat { display: flex; gap: 10px; padding: 7px 0; border-top: 1px dashed #e6dabd; }
.im-cat:first-child { border-top: 0; }
.im-cat-name { flex: none; width: 138px; padding-top: 5px; font-size: 12px; font-weight: 700; }
.im-tiles { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.im-tile {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; padding: 4px 9px;
  background: rgba(255, 255, 255, 0.72); border: 1px solid #dfd1b0; border-radius: 8px;
}
.im-tile b { font-size: 12.5px; }
.im-n { color: var(--accent-dark); }
.im-missing { border-style: dashed; background: transparent; color: var(--ink-soft); cursor: pointer; font-family: inherit; }
.im-missing:hover { background: var(--gold-bg); border-color: var(--gold); color: var(--ink); }

/* Händler */
.shop-cards { align-items: start; }
.shop-cards .card { margin: 0; }
.shop-list { gap: 6px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.shop-filter { flex-wrap: wrap; position: sticky; top: -14px; z-index: 1; margin: -14px -16px 10px; padding: 10px 16px 8px; background: #f6efdd; border-bottom: 1px solid #dfd1b0; }
.shop-filter .filter-pill { flex: none; padding: 7px 11px; font-size: 12px; }
.shop-row {
  gap: 10px; padding: 6px 9px; margin-bottom: 5px; min-width: 0;
  background: rgba(255, 255, 255, 0.6); border: 1px solid #e4d7b8; border-radius: 9px;
}
.shop-list .shop-row { margin: 0; background: var(--paper-card); }
.shop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
/* Fahrzeug-Vorschau: Transportstellung, beim Überfahren der Zeile die Arbeitsstellung */
.veh-pic { flex: none; display: inline-block; position: relative; }
.veh-pic img { display: block; }
.veh-pic .open { display: none; }
.fl-row:hover .veh-pic .shut, .shop-row:hover .veh-pic .shut, .im-tile:hover .veh-pic .shut { display: none; }
.fl-row:hover .veh-pic .open, .shop-row:hover .veh-pic .open, .im-tile:hover .veh-pic .open { display: block; }
.shop-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.shop-row .btn { flex: none; min-width: 96px; }

/* Ställe & Hof-Überblick */
.stall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 10px; align-items: start; }
.stall-card { display: flex; flex-direction: column; gap: 6px; }
.stall-grid .stall-card { margin: 0; }
.stall-card .title, .stall-card .bar, .stall-card .chip-row, .stall-card .action-row, .stall-card .animal-grid { margin: 0; }
.stall-card > .bar { height: 5px; }
.stall-card .animal-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stall-card .animal-chip .kv { white-space: nowrap; }
.stall-card.unbuilt { background: rgba(255, 252, 244, 0.6); border-style: dashed; }
.stall-flow { font-size: 11px; line-height: 1.35; }
.stall-toggle { align-self: flex-start; }
.meter .kv { padding: 2px 0 0; font-size: 12.5px; }
.meter .bar { height: 5px; margin: 2px 0 4px; }
#selection-panel .sec-row { margin: 10px 0 6px; }

/* Flottenliste im linken Panel: Statusfilter + Fahrzeugbild im Ring */
.fleet-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.fleet-pills .filter-pill { padding: 4px 8px; font-size: 11.5px; }
.todo-row .ring .veh-pic img { display: block; }
#todo-panel .orders-tabs .tab { white-space: nowrap; padding-inline: 7px; gap: 4px; font-size: 12.5px; }

/* Hof, Betriebe, Nachbarschläge im Fenster unten mittig: Karten fließen in Spalten */
#selection-panel.sheet-flow { width: min(900px, calc(100% - 28px)); }
#selection-panel.sheet-flow .body { column-width: 270px; column-gap: 14px; }
#selection-panel.sheet-flow .body > * { break-inside: avoid; }
/* Hofwahl (src/ui/land.js): lange Liste der Hofstellen über die ganze Breite, eigene Bildlaufleiste */
#selection-panel .pick-list { column-span: all; list-style: none; padding: 0; margin: 6px 0 0; max-height: 42vh; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 10px; }
#selection-panel.sheet-flow .body > .card, #selection-panel.sheet-flow .body > .chip-row, #selection-panel.sheet-flow .body > .action-row { margin-top: 0; margin-bottom: 8px; }
#todo-panel .orders-tabs .tab { padding-inline: 5px; gap: 3px; font-size: 12px; }
#todo-panel .orders-tabs .tab .tab-ico { font-size: 12px; }

/* --- 3D-Welt: ein HUD-System. Ecken statt Mitte: links oben Schlag und Angebote, links unten Fahrzeug, rechts oben Knopfleiste und
   Übersichtskarte, rechts unten nur der Hinweis „Erste Schritte"; Meldungen oben mittig (#toasts). Tastenliste (I) und Wähler (T) liegen auf Abruf darüber. */
#world3d {
  --g: clamp(8px, 1.2vw, 16px); --side: clamp(210px, 23vw, 300px); --map: clamp(96px, 13vw, 180px); --bar: 30px;
  --bg: rgba(20, 24, 17, 0.84); --line: rgba(255, 255, 255, 0.14); --fg: #f4f1e6; --soft: #e8d88f; --hot: #d9b84a;
  position: fixed; inset: 0; z-index: 900; background: #bcd9ea; color: var(--fg); font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums;
}
#w3d-view, #w3d-view canvas { display: block; width: 100%; height: 100%; }
.w3d-box { position: absolute; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; backdrop-filter: blur(6px); }
#world3d button { font: inherit; color: inherit; cursor: pointer; }
#world3d :focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
#world3d kbd { display: inline-block; min-width: 1.5em; margin-right: 6px; padding: 0 4px; border: 1px solid currentColor; border-radius: 4px; font-family: inherit; font-size: 0.85em; font-weight: 600; line-height: 1.45; text-align: center; opacity: 0.9; }
/* Ladeanzeige (loading.js): Titel, Balken, darunter links der Schritt und rechts die Prozent. Feste Breite, damit der Kasten beim Wechsel der Schritte nicht springt */
#w3d-loading { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 2 * var(--g))); font-size: 16px; font-weight: 600; }
#w3d-loading .bar { height: 8px; border-radius: 4px; margin: 8px 0 0; }
#w3d-loading .sub { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 400; }
#w3d-loading .sub span:last-child { flex: none; }
#w3d-loading .w3d-retry { margin-top: 10px; width: 100%; }
.w3d-box .sub { margin-top: 4px; font-size: 12px; color: var(--soft); }
.w3d-box .bar { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); margin: 5px 0 0; overflow: hidden; }
.w3d-box .bar i { display: block; height: 100%; background: var(--ok, #9cc468); }
.w3d-box .bar.hot i { background: var(--bad, #e2643c); }
.w3d-box .bar u { position: absolute; top: 0; width: 2px; height: 100%; background: #fff; }
/* Stream-Einblendung der Reise (?stream, journey.js): statt des HUD. Oben eine Zeile mit Strecke, Ort und Ortszeit, unten Tempo, Kilometer,
   Ankunft und der Routenbalken, darunter klein die Datenquellen. Ruhig: keine Kästen, nur Schrift mit Schatten auf einem weichen Verlauf */
#world3d.stream > .w3d-box, #world3d.stream #w3d-bar, body.w3d-stream #toasts, body.w3d-stream #tutorial { display: none !important; }
#w3d-stream { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; padding: clamp(14px, 2.4vw, 34px); font-size: clamp(13px, 1.25vw, 20px); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); background: linear-gradient(rgba(10, 14, 10, 0.42), transparent 16%, transparent 72%, rgba(10, 14, 10, 0.62)); }
#w3d-stream .top { display: flex; align-items: baseline; gap: 1.2em; }
#w3d-stream .top b { font-size: 1.35em; letter-spacing: 0.02em; }
#w3d-stream .top span:last-child { margin-left: auto; font-size: 1.35em; font-weight: 600; }
#w3d-stream .note { align-self: center; margin-top: auto; margin-bottom: 1.2em; padding: 0.5em 1.1em; border-radius: 999px; background: rgba(20, 24, 17, 0.78); color: var(--soft); }
#w3d-stream .low { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.4em 2.4em; margin-top: auto; }
#w3d-stream .note + .low { margin-top: 0; }
#w3d-stream .num b { display: block; font-size: 2.1em; line-height: 1; font-weight: 600; }
#w3d-stream .num i { font-style: normal; font-size: 0.8em; color: var(--soft); text-transform: uppercase; letter-spacing: 0.08em; }
#w3d-stream .track { position: relative; flex: 1 1 100%; height: 4px; margin-top: 0.5em; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
#w3d-stream .track i { display: block; height: 100%; border-radius: 2px; background: var(--hot); }
#w3d-stream .track u { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35); }
#w3d-stream .src { margin-top: 0.7em; font-size: 0.68em; opacity: 0.85; }
/* Fotomodus und Wiederholung (src/world3d/photo.js): HUD weg (w3d-nohud), Bedienfeld rechts bzw. Leiste unten */
#world3d.w3d-nohud > .w3d-box:not(#w3d-photo):not(#w3d-replay), #world3d.w3d-nohud #w3d-bar, body:has(#world3d.w3d-nohud) #toasts { display: none !important; }
#world3d.w3d-photo #w3d-bar > :not(#w3d-photo-btn):not(#w3d-replay-btn) { display: none; }
#w3d-photo { right: var(--g); top: var(--g); width: min(260px, calc(100vw - 32px)); max-height: calc(100vh - var(--g) * 2); overflow: auto; font-size: 13px; }
#w3d-photo label { display: block; margin-top: 6px; }
#w3d-photo label output { float: right; color: var(--soft); }
#w3d-photo input[type=range], #w3d-photo select { display: block; width: 100%; }
#w3d-photo .chk input { display: inline; width: auto; }
#w3d-photo .btns, #w3d-replay .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#w3d-photo button, #w3d-replay button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.1); }
#w3d-replay { left: 50%; bottom: var(--g); transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); font-size: 13px; }
#w3d-replay .btns { margin-top: 0; }
#w3d-replay input[type=range] { display: block; width: 100%; margin-top: 6px; }
/* Fahrzeug (dauerhaft): Name, Tempo, Last, Gerätezustand als Chips mit Taste; Chips rollen statt umzubrechen */
#w3d-hud { left: var(--g); bottom: var(--g); width: var(--side); max-height: calc(50vh - var(--g) * 1.5); overflow: hidden auto; }
#w3d-hud > div:first-child { font-size: 12px; color: var(--soft); }
#w3d-hud b { font-size: 28px; line-height: 1.1; }
#w3d-hud .row { display: flex; gap: 5px; margin-top: 5px; overflow-x: auto; scrollbar-width: none; }
#w3d-hud .chip { flex: none; color: inherit; padding: 1px 8px 1px 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); font-size: 12px; white-space: nowrap; }
#w3d-hud .chip:not(:has(kbd)) { padding-left: 8px; }
#w3d-hud .chip kbd { margin-right: 4px; border: 0; background: rgba(0, 0, 0, 0.25); }
#w3d-hud .chip.on { background: var(--hot); color: #2a2412; }
/* Bedienpult (src/world3d/bedienpult.js, Taste 0): Instrumente oben, darunter die Fahrfunktionen als klickbare Chips mit Taste;
   gesperrte Funktionen sind grau, angeschaltete leuchten wie im Fahrzeugkasten. Rechts unter der Knopfleiste, mobil im Weg-Budget */
#w3d-panel { right: var(--g); top: calc(var(--bar) + var(--g) + 6px); width: max-content; max-width: min(340px, calc(100vw - 2 * var(--g))); }
#w3d-panel .bp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--soft); }
#w3d-panel .bp-x { padding: 0 6px; border: 0; background: none; color: inherit; }
#w3d-panel .bp-inst { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
#w3d-panel .bp-inst .bp-kmh b { font-size: 26px; line-height: 1.1; }
#w3d-panel .bp-inst .bp-cruise { color: var(--soft); }
#w3d-panel .bp-keys { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
#w3d-panel .bp-keys .chip { display: inline-flex; align-items: center; min-height: 30px; padding: 1px 9px 1px 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); font-size: 13px; white-space: nowrap; }
#w3d-panel .bp-keys .chip kbd { margin-right: 5px; border: 0; background: rgba(0, 0, 0, 0.25); }
#w3d-panel .bp-keys .chip.on { background: var(--hot); color: #2a2412; }
#w3d-panel .bp-keys .chip:disabled { opacity: 0.42; cursor: not-allowed; }
#world3d.touch #w3d-panel { bottom: calc(var(--bar) + 118px); top: auto; }   /* Touch: über den Fahrknöpfen statt unter der Leiste */
/* Schlag und Angebote (im Zusammenhang): höchstens vier Knöpfe, der markierte mit E */
#w3d-tasks { left: var(--g); top: var(--g); width: var(--side); max-height: calc(50vh - var(--g) * 1.5); overflow: hidden auto; }
#w3d-tasks .why { margin-top: 4px; font-size: 12px; color: var(--soft); }
#w3d-tasks .offers { margin-top: 6px; display: grid; gap: 4px; }
#w3d-tasks .offers button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.08); text-align: left; }
#w3d-tasks .offers button span:first-of-type { flex: 1; }
/* Missionsmodul (jobs/story.js, #164, #217, Taste 8): ein Kasten links, über dem Fahrzeugkasten (Touch: darunter). Eingeklappt eine Zeile: Symbol,
   Titel, genau ein Schritt mit Entfernung bzw. Frist, die gerade nötige Taste; aufgeklappt darunter genau eine Detailansicht und die Liste.
   --q-top / --q-bot misst jobs/story.js layout an den Nachbarn (Angebote, Knopfleiste, Meldungen, Fahrzeugkasten, Erste Schritte, Karte,
   Touch-Knöpfe), die die Spalte des Moduls kreuzen: das Modul liegt dazwischen und rollt seine Liste, statt etwas zu überdecken */
#w3d-quest { left: max(var(--g), env(safe-area-inset-left)); bottom: calc(var(--q-bot, 140px) + var(--g)); z-index: 4; width: var(--side); display: flex; flex-direction: column;
  max-height: calc(100vh - var(--q-top, 48px) - var(--q-bot, 140px) - var(--g) * 2); padding: 0; border: 0; background: none; }
#w3d-quest.q-empty { display: none; }
#w3d-quest.q-open { width: min(400px, calc(100vw - var(--g) * 2)); }
#world3d.touch #w3d-quest { top: calc(var(--q-top, 120px) + var(--g)); bottom: auto; max-height: calc(100vh - var(--q-top, 120px) - var(--q-bot, 0px) - var(--g) * 2); }
#w3d-quest .q-card { display: flex; flex-direction: column; min-height: 0; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--lt-col, var(--hot)); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); overflow: hidden; }
#w3d-quest .q-bar { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; text-align: left; }
#w3d-quest .q-bar:hover { background: rgba(255, 255, 255, 0.06); }
#w3d-quest .q-ico { flex: none; font-size: 18px; line-height: 1; }
#w3d-quest .q-txt { flex: 1; min-width: 0; display: grid; }
#w3d-quest .q-txt b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w3d-quest .q-step { font-size: 12px; color: var(--soft); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }   /* höchstens zwei Zeilen */
#w3d-quest .q-dir { display: inline-block; margin-right: 3px; font-style: normal; }
#w3d-quest .q-days { font-style: normal; white-space: nowrap; }
#w3d-quest .q-days.hot { color: #ff8a7a; font-weight: 600; }
#w3d-quest .q-bar kbd { flex: none; margin: 0; border-color: var(--hot); background: var(--hot); color: #2a2412; }
#w3d-quest .q-chev { flex: none; opacity: 0.75; }
#w3d-quest .q-urge { flex: none; font-size: 14px; line-height: 1; filter: drop-shadow(0 0 3px #ff8a7a); }   /* #226: Frist auf der Warteliste drängt */
#w3d-quest .q-prog { flex: none; margin: 0 8px 6px; }
#w3d-quest .q-more { min-height: 0; overflow: hidden auto; padding: 6px 10px 10px; border-top: 1px solid var(--line); }
#w3d-quest .q-char { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
#w3d-quest .q-pic { flex: none; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; border: 2px solid var(--lt-col, #d9b84a); background: var(--lt-col, #d9b84a); }
#w3d-quest .q-pic img { width: 100%; height: 100%; display: block; }
#w3d-quest .lt-who { flex: 1; min-width: 0; }
#w3d-quest .q-of { flex: none; align-self: flex-start; color: var(--soft); font-size: 11px; }
#w3d-quest .q-say { margin: 0 0 6px; font-style: italic; font-size: 13px; line-height: 1.4; }
#w3d-quest .q-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 4px; font-size: 12px; }
#w3d-quest .q-facts dt { color: var(--soft); }
#w3d-quest .q-facts dd { margin: 0; }
#w3d-quest .q-act, #w3d-quest button[data-q=pause], #w3d-quest .q-list button, #w3d-quest .q-phone { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.1); }
#w3d-quest .q-act { margin-top: 6px; width: 100%; background: var(--hot); color: #2a2412; font-weight: 600; border-color: var(--hot); }
#w3d-quest button[data-q=pause] { margin-top: 6px; width: 100%; }
#w3d-quest .q-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; margin-top: 8px; border-bottom: 1px solid var(--line); }
#w3d-quest .q-tabs [role=tab] { padding: 4px 8px; border: 0; border-radius: 6px 6px 0 0; background: none; font-size: 12px; white-space: nowrap; }
#w3d-quest .q-tabs [role=tab][aria-selected=true] { background: rgba(255, 255, 255, 0.14); font-weight: 600; }
#w3d-quest .q-tabs .q-phone { margin: 0 0 3px auto; padding: 2px 8px; border-radius: 99px; font-size: 12px; }
#w3d-quest .q-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
#w3d-quest .q-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
#w3d-quest .q-list button { flex: none; }
#w3d-quest .q-none { color: var(--soft); }
/* Feld-Info (src/world3d/fieldinfo.js): rechts unter der Übersichtskarte, zuklappbar (7); die Warnung bleibt auch eingeklappt sichtbar */
#w3d-field { right: var(--g); top: calc(var(--g) + var(--bar) + 6px); width: min(var(--side), 260px); max-height: calc(100vh - var(--map) - var(--bar) - var(--g) * 4 - 6px); overflow: hidden auto; font-size: 12px; }
#w3d-field .fi-head { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
#w3d-field .fi-head.bad, #w3d-field .fi-warn.bad { color: #ff8a7a; }
#w3d-field .fi-head.warn, #w3d-field .fi-warn.warn { color: #ffd452; }
#w3d-field .fi-warn { margin-top: 3px; font-weight: 600; }
#w3d-field .fi-warn.bad { padding: 3px 6px; border-radius: 6px; background: rgba(201, 59, 43, 0.35); }
#w3d-field .fi-kv { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
#w3d-field .fi-kv b { font-size: 12px; font-weight: 500; }
#w3d-field .fi-st { margin-top: 3px; color: var(--soft); }
#w3d-field .bar { position: relative; height: 6px; margin: 2px 0 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
#w3d-field .bar i { display: block; height: 100%; border-radius: 3px; background: #3d8b37; }
#w3d-field .bar.damp i { background: #d99b1e; } #w3d-field .bar.tooWet i { background: #c93b2b; } #w3d-field .bar.dry i { background: #b8ad93; }
#w3d-field .bar u { position: absolute; top: -2px; width: 2px; height: 10px; background: #fff; opacity: 0.7; }
#w3d-field .bad { color: #ff8a7a; } #w3d-field .warn { color: #ffd452; } #w3d-field .ok { color: #8fd17f; } #w3d-field .gold { color: #f0c85a; }
#world3d.touch #w3d-bau { top: calc(var(--g) + var(--bar) + var(--map) + 12px); }
#world3d.touch #w3d-field { top: calc(var(--g) + var(--bar) + var(--map) + 12px); width: min(190px, 40vw); font-size: 11px; }
#world3d.touch #w3d-field .fi-nut, #world3d.touch #w3d-field .minor { display: none; }
@media (max-height: 740px) { #w3d-field .minor { display: none; } }
/* Zielwahl der Autofahrt (journey.js): Ortssuche, Liste, Knöpfe */
#w3d-tasks .offers button.on { background: var(--hot); border-color: var(--hot); color: #2a2412; font-weight: 600; }
#w3d-tasks .legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--soft); }
/* rechts oben: Knopfleiste (Ton, Tasten, Zurück), darunter die Übersichtskarte */
#w3d-bar { position: absolute; right: var(--g); top: var(--g); display: flex; gap: 6px; height: var(--bar); }
#w3d-bar > button, #w3d-sound > button { position: static; height: var(--bar); padding: 0 10px; font-size: 12px; white-space: nowrap; }
#w3d-sound { position: relative; }
#w3d-sound .pop { display: none; top: calc(100% + 4px); right: 0; z-index: 2; padding: 6px 10px; }
#w3d-sound:hover .pop, #w3d-sound:focus-within .pop { display: block; }
#w3d-sound input { width: 110px; }
/* Minikarte unten rechts (#117); mit Touch bleibt sie oben rechts, unten rechts liegen dort Bremse und Arbeitsknöpfe */
#w3d-map { right: var(--g); bottom: var(--g); width: var(--map); height: var(--map); padding: 0; cursor: pointer; touch-action: none; }
#world3d.touch #w3d-map { top: calc(var(--g) + var(--bar) + 6px); bottom: auto; }
/* Navi (src/world3d/navmap.js, #113, #136): Kasten der Routenführung oben in der Mitte, Navi-Leiste über der 2D-Karte (M); Minikarte nachts wie die Welt abgedunkelt */
#w3d-map.night { filter: brightness(0.62) saturate(0.85); }
#w3d-navi { left: 50%; top: calc(var(--g) + var(--bar) + 6px); transform: translateX(-50%); min-width: 220px; max-width: calc(100vw - 2 * var(--side) - 4 * var(--g)); pointer-events: none; }
#w3d-navi .nv-turn { display: flex; align-items: center; gap: 10px; font-size: 15px; }
#w3d-navi .nv-turn b { font-size: 22px; }
#w3d-navi .nv-arrow { display: inline-flex; justify-content: center; width: 34px; font-size: 30px; line-height: 1; color: var(--hot); }
#w3d-navi .nv-arrow i { display: inline-block; font-style: normal; }
#world3d.navi-on #w3d-msg { top: calc(var(--g) + var(--bar) + 84px); }
#w3d-bau { right: var(--g); top: calc(var(--g) + var(--bar) + 6px); width: var(--side); max-height: calc(100vh - var(--map) - var(--bar) - var(--g) * 4); overflow: hidden auto; z-index: 4; font-size: 12px; }
#w3d-bau .types { margin-top: 6px; display: grid; gap: 3px; }
#w3d-bau button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.08); }
#w3d-bau .types button { width: 100%; text-align: left; }
#w3d-bau .types button span:first-child { flex: 1; }
#w3d-bau button.on, #w3d-bau button.go { background: var(--hot); border-color: var(--hot); color: #2a2412; font-weight: 600; }
#w3d-bau .row { display: flex; gap: 4px; margin-top: 6px; }
#w3d-bau .row button { flex: 1; }
#w3d-bau .why, #w3d-bau .legend { margin-top: 6px; color: var(--soft); }
#w3d-bau .why { font-weight: 600; color: var(--ok, #9cc468); }
#w3d-bau .why.bad { color: var(--bad, #e2643c); }
#w3d-bau .x { float: right; padding: 0 7px; }
/* Bau-Modus (#146, jobs/bau.js): Vogelperspektive – Fahr-HUD, Karte und Touch-Steuerung weichen, die Fläche darunter nimmt Ziehen, Rad und Tippen */
#w3d-bau-pad { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
#w3d-bau-pad.hidden { display: none; }
#world3d.bau #w3d-hud, #world3d.bau #w3d-quest, #world3d.bau #w3d-tasks, #world3d.bau #w3d-field, #world3d.bau #w3d-map, #world3d.bau #w3d-first, #world3d.bau #w3d-navi, #world3d.bau #w3d-touch, #world3d.bau #w3d-panel, #world3d.bau #w3d-bar > :not(#w3d-exit, #w3d-bau-btn) { display: none; }
#world3d.bau #w3d-bau { top: calc(var(--g) + var(--bar) + 6px); max-height: calc(100vh - var(--bar) - var(--g) * 3); }
@media (max-width: 640px) {
  #world3d.bau #w3d-bau { left: var(--g); right: var(--g); top: auto; bottom: max(var(--g), env(safe-area-inset-bottom)); width: auto; max-height: 46vh; }
  #world3d.bau #w3d-bau .types { grid-template-columns: 1fr 1fr; max-height: 19vh; overflow-y: auto; }   /* Bauen, Drehen und Grund bleiben ohne Blättern sichtbar */
  #world3d.bau #w3d-bau button { min-height: 36px; }
}
@media (max-height: 500px) and (min-width: 641px) {   /* Telefon quer: Liste blättert, Grund und Knöpfe bleiben sichtbar */
  #world3d.bau #w3d-bau .types { max-height: 30vh; overflow-y: auto; }
  #world3d.bau #w3d-bau .legend { display: none; }
}
/* Randpfeil zum Missionsziel außerhalb des Bildes (#218, src/world3d/randpfeil.js); Lage per transform, über der Welt, unter Kästen und Dialogen */
#w3d-rand { position: absolute; left: 0; top: 0; z-index: 1; width: 64px; height: 30px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 99px; background: rgba(20, 24, 17, 0.82); border: 2px solid var(--hot, #ffd452); color: #f4f1e6; font-size: 12px; pointer-events: none; }
#w3d-rand svg { flex: none; fill: var(--hot, #ffd452); }
#w3d-rand b { font-weight: 600; white-space: nowrap; }
#world3d.map #w3d-rand, #world3d.stream #w3d-rand, #world3d.w3d-nohud #w3d-rand { display: none; }
#w3d-first { right: calc(var(--g) * 2 + var(--map)); bottom: var(--g); width: min(240px, var(--side)); font-size: 12px; }
#w3d-first ul { list-style: none; margin: 6px 0; display: grid; gap: 3px; }
#w3d-first button { width: 100%; padding: 4px; border: 0; border-radius: 7px; background: var(--hot); color: #2a2412; font-weight: 600; }
/* Meldungen oben mittig zwischen den Ecken; Kartenhinweis (M) unter der Leiste der Karte */
body.in3d #toasts { z-index: 910; top: var(--g, 12px); max-width: calc(100vw - 2 * clamp(210px, 23vw, 300px) - 4 * clamp(8px, 1.2vw, 16px)); }
body.in3d .toast { white-space: normal; border-radius: 10px; text-align: center; }
#w3d-msg { left: 50%; top: 64px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2 * var(--g)); pointer-events: none; font-size: 12px; }
#w3d-msg.wait { top: 104px; padding: 10px 16px; border-color: var(--hot); font-size: 15px; font-weight: 600; text-align: center; }   /* Warten am Kartenrand: unter den Meldungen, gut sichtbar */
/* Tastenliste (I): auf Abruf, Gruppen in Spalten, passt in jedes Fenster (sonst rollt sie) */
#w3d-help { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(860px, calc(100vw - 2 * var(--g))); max-height: calc(100vh - 2 * var(--g)); overflow-y: auto; font-size: 12px; }
#w3d-help h3 { font-size: 13px; margin-bottom: 4px; }
#w3d-help .cols { column-width: 230px; column-gap: 18px; }
#w3d-help section { break-inside: avoid; margin-bottom: 8px; }
#w3d-help h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--soft); margin-bottom: 2px; }
#w3d-help table { border-collapse: collapse; }
#w3d-help td { padding: 1px 6px 1px 0; vertical-align: top; }
#w3d-help tr { display: grid; grid-template-columns: 6.2em 1fr; }
#w3d-help td:first-child { color: var(--soft); }
#w3d-pick { left: 50%; top: calc(var(--g) + var(--bar) + 6px); transform: translateX(-50%); z-index: 5; width: min(340px, calc(100vw - 2 * var(--g))); max-height: calc(100vh - 2 * var(--g) - var(--bar) - 6px); display: flex; flex-direction: column; font-size: 13px; }
#w3d-pick input { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 0; border-radius: 6px; font: inherit; }
#w3d-pick .rows { overflow-y: auto; margin-top: 6px; }
#w3d-pick h4 { margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; color: var(--soft); }
#w3d-pick .rows div { display: flex; justify-content: space-between; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
#w3d-pick .rows div.on, #w3d-pick .rows div:hover { background: var(--hot); color: #2a2412; }
#w3d-pick u { text-decoration: none; opacity: 0.7; font-size: 11px; }
#w3d-pick .rows div.off { opacity: 0.5; }
#w3d-pick:focus { outline: none; }
/* kleine Fenster (bis 1280 × 720): enger, Nebenzeilen weg; Telefon quer: nur das Nötigste */
@media (max-height: 740px) {
  #world3d { font-size: 12px; --bar: 28px; }
  #world3d .minor, #w3d-tasks .legend > span:last-child { display: none; }
  #w3d-hud b { font-size: 22px; }
}
@media (max-height: 460px) {
  #world3d { --side: clamp(190px, 26vw, 240px); --map: 84px; }
  #w3d-hud .bar, #w3d-tasks .why { display: none; }
  #w3d-first ul { gap: 1px; margin: 4px 0; }
  #w3d-tasks .offers button { padding: 2px 6px; }
}
@media (prefers-reduced-motion: reduce) { body.in3d .toast { animation: none; } #world3d .w3d-box { backdrop-filter: none; } }
/* Karten-Overlay (M): die 3D-Welt gibt den Blick auf die 2D-Karte frei, nur Hinweis und Zurück-Knopf bleiben */
body.in3d #btn-pause, body.in3d .tbtn.speed { opacity: .4; }
#world3d.map { background: none; pointer-events: none; }
#world3d.map > :not(#w3d-msg, #w3d-bar, #w3d-mapnav), #world3d.map #w3d-bar > :not(#w3d-exit, #w3d-drive), #world3d:not(.map) :is(#w3d-mapnav, #w3d-drive) { display: none; }
#world3d.map :is(#w3d-exit, #w3d-drive, #w3d-mapnav) { pointer-events: auto; }
#world3d #w3d-drive { background: var(--accent); color: #1c2218; font-weight: 700; }   /* Hinfahren (#137): Ziel des Navis, Autofahrt startet */
#w3d-mapnav { left: 50%; top: 64px; transform: translateX(-50%); width: min(380px, calc(100vw - 2 * var(--g))); display: grid; gap: 5px; font-size: 12px; z-index: 2; }
/* #294: Verwaltungsfenster (Hof & Lager, Fuhrpark, …) und Modale liegen über der Karte – das Suchfeld bleibt nicht davor (#world3d hat z-index 900, die Fenster 25–60) */
body:has(#drawer-panel:not(.hidden)) #w3d-mapnav, body:has(.overlay:not(.hidden)) #w3d-mapnav { display: none !important; }
#w3d-mapnav .mn-row { display: flex; align-items: center; gap: 5px; }
#w3d-mapnav input { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0, 0, 0, 0.25); color: inherit; font: inherit; }
#w3d-mapnav button { flex: none; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.08); }
#w3d-mapnav button.on { background: var(--hot); border-color: var(--hot); color: #2a2412; font-weight: 600; }
#w3d-mapnav .mn-list { display: grid; gap: 3px; max-height: 40vh; overflow-y: auto; }
#w3d-mapnav .mn-list:empty { display: none; }
#w3d-mapnav .mn-list button { display: flex; justify-content: space-between; gap: 8px; text-align: left; }
#w3d-mapnav .mn-list small { color: var(--soft); font-size: 11px; }
#w3d-mapnav .mn-dest { flex: 1; min-width: 0; color: var(--soft); }
#world3d.map #w3d-msg { top: 140px; }
/* während des Ladens nur Ladetext und Zurück-Knopf */
#world3d:has(#w3d-loading:not(.hidden)) > .w3d-box:not(#w3d-loading), #world3d:has(#w3d-loading:not(.hidden)) #w3d-bar > :not(#w3d-exit) { display: none; }
/* Kartenauswahl im Startbildschirm */
.start-world { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; font: 700 12px/1 inherit; color: var(--ink-soft); }

/* --- Telefon und Tablet (Touch): Grundlagen. Nur grobe Zeiger bzw. schmale Fenster; Maus und Tastatur am Desktop bleiben unberührt --- */
@media (pointer: coarse) {
  html, body { overscroll-behavior: none; }                /* kein Pull-to-Refresh */
  #map, #w3d-view canvas { touch-action: none; }           /* Ziehen und Pinch gehören dem Spiel, nicht dem Browser */
  button, select, a, input, label { touch-action: manipulation; }   /* kein Doppeltipp-Zoom */
  button, select, .tab, .dock-btn, .tbtn, #world3d button { min-height: 44px !important; min-width: 44px !important; }   /* Mindest-Tippfläche */
  #topbar { top: max(10px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); }
}
/* Schmal (Telefon hochkant) oder flach (Telefon quer): Topbar in einer Zeile, rollt waagrecht statt überzulaufen */
@media (max-width: 700px), (max-height: 500px) {
  #topbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; pointer-events: auto; left: env(safe-area-inset-left); right: env(safe-area-inset-right); padding: 0 8px; }
  #topbar .tb-pill { flex: none; }
  .tb-stores, .tb-title, .tb-divider { display: none; }
  #sys-menu { position: fixed; top: 64px; right: 8px; }
}
/* Telefon, 2D: Leiste unten als Tab-Leiste über die ganze Breite, Panels als Bottom-Sheet darüber (eins zugleich), Verwaltung und Dialoge bildschirmfüllend */
.dock-sheet { display: none; }
@media (max-width: 700px), (max-height: 500px) {
  .dock-sheet { display: flex; }
  #bottom-dock { left: 0; right: 0; bottom: 0; transform: none; gap: 2px; justify-content: space-around; border-radius: 16px 16px 0 0; padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .dock-btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 1px; padding: 4px 2px; font-size: 10.5px; }
  .dock-btn:hover { transform: none; }
  .dock-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-sub { display: none; }
  #todo-panel, #side-panel, #selection-panel { left: 0 !important; right: 0 !important; top: auto !important; width: auto !important; transform: none !important; bottom: calc(58px + env(safe-area-inset-bottom)) !important; max-height: 55vh !important; border-radius: 16px 16px 0 0; animation: none; }
  #todo-panel.collapsed, #side-panel.collapsed, #campaign-panel, #job-monitor { display: none !important; }
  .drawer-modal, #sell-modal .modal-card { position: fixed; top: 0 !important; left: 0 !important; right: 0 !important; bottom: calc(58px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none !important; max-height: none !important; min-width: 0 !important; transform: none !important; border-radius: 0; padding-top: env(safe-area-inset-top); overflow-y: auto; }
  #sell-modal-content { min-width: 0; }
  #tutorial-hint { left: 8px; right: 8px; width: auto; max-width: none; transform: none; border-radius: 16px; bottom: calc(66px + env(safe-area-inset-bottom)); }
  #toasts, body.has-field-sheet #toasts { top: 110px !important; left: 8px !important; right: 8px !important; bottom: auto !important; width: auto !important; transform: none !important; max-width: none !important; }
  .toast { max-width: 100%; }
}
/* 3D-Welt mit Touch (touch.js setzt #world3d.touch): links Joystick, rechts Kamera; Knöpfe rechts unten, oben Auftrag / Karte / Menü.
   Tastenhinweise (Erste Schritte, Tastenliste, kbd) entfallen; der Auftragskasten ist eingeklappt */
#w3d-touch { position: absolute; inset: 0; pointer-events: none; }
#w3d-touch > * { position: absolute; pointer-events: auto; z-index: 2; }
#w3d-touch .tc-pad { inset: 0; z-index: 0; touch-action: none; }
#world3d.touch .w3d-box, #world3d.touch #w3d-bar { z-index: 1; }
#world3d.touch #w3d-first, #world3d.touch #w3d-help-btn, #world3d.touch kbd { display: none; }
#world3d.touch:not(.tc-tasks) #w3d-tasks { display: none; }
#world3d.touch { --map: 84px; --pad: max(var(--g), env(safe-area-inset-left)); }
#world3d.touch #w3d-tasks { top: calc(var(--g) + 52px); left: var(--pad); max-height: calc(100vh - var(--g) * 2 - 52px); z-index: 3; }
#world3d.touch #w3d-hud { top: calc(var(--g) + 52px); bottom: auto; left: var(--pad); width: auto; max-width: 40vw; padding: 4px 8px; }
#world3d.touch #w3d-hud .row, #world3d.touch #w3d-hud .bar { display: none; }
#w3d-touch button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; }
#w3d-touch .tc-top { left: var(--pad); top: var(--g); display: flex; gap: 6px; }
#w3d-touch .tc-menu { left: var(--pad); top: calc(var(--g) + 52px); z-index: 4; display: grid; gap: 6px; }
#w3d-touch .tc-menu.hidden, #w3d-touch .tc-stick.hidden { display: none; }
#w3d-touch .tc-ctx { right: max(var(--g), env(safe-area-inset-right)); bottom: calc(var(--g) + 64px); max-width: 52vw; max-height: calc(100vh - var(--map) - var(--bar) - 3 * var(--g) - 70px); display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-content: flex-start; gap: 6px; overflow: hidden; }
#w3d-touch .tc-offer { flex-basis: 100%; min-height: 52px; background: var(--hot); border-color: var(--hot); color: #2a2412; }
#w3d-touch .tc-main { right: max(var(--g), env(safe-area-inset-right)); bottom: max(var(--g), env(safe-area-inset-bottom)); }
#w3d-touch .tc-brake { min-width: 96px; min-height: 52px; background: #7a2a1e; }
#w3d-touch .tc-brake:active, #w3d-touch [data-hold]:active { filter: brightness(1.4); }
#w3d-touch .tc-cruise { left: 50%; bottom: max(var(--g), env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; }
#w3d-touch .tc-cruise .on { background: var(--hot); color: #2a2412; }
#w3d-touch .tc-stick { width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; background: rgba(0, 0, 0, 0.15); pointer-events: none; }
#w3d-touch .tc-stick i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); }
#w3d-touch .tc-rotate { display: none; }
@media (orientation: portrait) {
  #w3d-touch .tc-rotate { display: flex; inset: 0; z-index: 20; align-items: center; justify-content: center; padding: 32px; text-align: center; font-size: 18px; font-weight: 600; background: #1c2218; }
}
/* Einstellungsmenü (src/ui/menu.js): ein Dialog für Grafik, Spielregeln, Verkehr, Wetter, Ton, Steuerung, Barrierefreiheit und Hilfe. Startbildschirm, Karte und 3D-Welt;
   Glas-Panel im Stil des HUDs (--bg, --line, --soft, --hot wie #world3d, hier mit eigenen Werten, weil das Menü auch außerhalb der 3D-Welt steht). Tippflächen mindestens 44 px. */
#gfx-scrim { position: fixed; inset: 0; z-index: 999; background: rgba(8, 10, 6, 0.5); }
#gfx { --bg: rgba(20, 24, 17, 0.94); --line: rgba(255, 255, 255, 0.14); --fg: #f4f1e6; --soft: #e8d88f; --hot: #d9b84a; --mute: #c9c4ae; --hi: #ffb4a0;
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1000; width: min(960px, calc((100vw - 16px) / var(--ui-scale, 1))); height: min(760px, calc((100dvh - 16px) / var(--ui-scale, 1)));
  color-scheme: dark; display: grid; grid-template-columns: 188px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: 'head head' 'nav body' 'nav foot';
  padding: 0; overflow: hidden; font-size: 13px; line-height: 1.4; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); }
#gfx :focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
#gfx .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#gfx :is(button, select, input[type=search]) { min-height: 44px; min-width: 44px; padding: 0 12px; font: inherit; color: var(--fg); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#gfx :is(button:hover:not(:disabled), select:hover:not(:disabled)) { background: rgba(255, 255, 255, 0.15); }
#gfx :is(button, select):disabled { opacity: 0.45; cursor: not-allowed; }
#gfx select option { color: #222; background: #fff; }
#gfx input[type=range] { width: min(200px, 40vw); min-height: 44px; accent-color: var(--hot); }
#gfx input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--hot); }
#gfx output { min-width: 3.6em; text-align: right; font-variant-numeric: tabular-nums; }
#gfx kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid currentColor; border-radius: 4px; font: inherit; font-size: 0.9em; font-weight: 600; text-align: center; }
#gfx .mhead { grid-area: head; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
#gfx h3 { flex: none; margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0.005em; }
#gfx .msearch { flex: 1; min-width: 0; cursor: text; background: rgba(0, 0, 0, 0.28); }
#gfx .msearch::placeholder { color: var(--mute); opacity: 1; }
#gfx .mnav { grid-area: nav; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; overflow-y: auto; border-right: 1px solid var(--line); }
#gfx .mnav button { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; background: none; border-color: transparent; border-radius: 6px; }
#gfx .mnav button[aria-current] { background: rgba(217, 184, 74, 0.16); border-color: var(--hot); color: var(--soft); font-weight: 600; }
#gfx .mnav .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); }
#gfx .mbody { grid-area: body; position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 24px; scroll-padding-top: 8px; }
#gfx section { padding-top: 14px; }
#gfx .mbody > section:last-of-type { min-height: 75%; }   /* auch der letzte Bereich lässt sich nach oben scrollen */
#gfx section + section { margin-top: 10px; border-top: 1px solid var(--line); }
#gfx .shead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#gfx h4 { margin: 0; font-size: 17px; font-weight: 650; }
#gfx h5 { margin: 14px 0 2px; font-size: 13px; font-weight: 650; color: var(--soft); }
#gfx .intro, #gfx .note { margin: 4px 0 6px; font-size: 12.5px; color: var(--mute); max-width: 68ch; }
#gfx .mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
#gfx .mtxt label { font-size: 14px; font-weight: 600; }
#gfx .mtxt p { margin: 2px 0 0; font-size: 12.5px; color: var(--mute); max-width: 62ch; }
#gfx .mctl { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#gfx .mctl select { min-width: 12em; max-width: 100%; }
#gfx .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
#gfx .chip { padding: 0 7px; font-size: 11.5px; line-height: 1.7; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; }
#gfx .chip.c-high { color: var(--hi); border-color: var(--hi); }
#gfx .chip.c-saves { color: #b9e0a5; border-color: #b9e0a5; }
#gfx .chip.rs, #gfx .chip.wait { color: var(--soft); border-color: var(--hot); }
#gfx .chip.chg { color: var(--fg); border-style: dashed; }
#gfx .presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
#gfx .presets button[aria-pressed="true"] { background: rgba(217, 184, 74, 0.22); border-color: var(--hot); color: var(--soft); font-weight: 600; }
#gfx .binds { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
#gfx .binds th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--soft); padding: 12px 0 2px; }
#gfx .binds td { padding: 1px 8px 1px 0; } #gfx .binds td:last-child { font-size: 12px; color: var(--hi); }
#gfx .binds button { min-width: 96px; } #gfx .binds button[aria-pressed="true"] { outline: 2px solid var(--gold-bright); }
#gfx .binds tr.conflict button { border: 2px dashed var(--hi); }
#gfx .mkeys { column-width: 220px; column-gap: 18px; }
#gfx .mkeys section { margin: 0 0 8px; padding: 0; border: 0; break-inside: avoid; }
#gfx .mkeys h4 { font-size: 12.5px; color: var(--soft); }
#gfx .mkeys table { border-collapse: collapse; } #gfx .mkeys td { padding: 1px 8px 1px 0; vertical-align: top; } #gfx .mkeys td:first-child { color: var(--soft); white-space: nowrap; }
#gfx .mnone { margin: 24px 0; text-align: center; color: var(--mute); }
#gfx .mfoot { grid-area: foot; padding: 0 16px; }
#gfx .mfoot:not(:empty) { padding-top: 8px; padding-bottom: 10px; border-top: 1px solid var(--line); background: rgba(217, 184, 74, 0.1); }
#gfx .mfoot p { margin: 0 0 4px; }
#gfx .restart button { background: var(--hot); border-color: var(--hot); color: #1c1a10; font-weight: 650; }
#gfx .restart button:hover:not(:disabled) { background: #ecca62; }
#gfx [hidden] { display: none !important; }
/* schmale Bildschirme: Bereichsleiste oben als wischbare Reihe, Zeilen untereinander */
@media (max-width: 720px) {
  #gfx { width: calc(100vw / var(--ui-scale, 1)); height: calc(100dvh / var(--ui-scale, 1)); border-radius: 0; border: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: 'head' 'nav' 'body' 'foot'; }
  #gfx .mhead { padding: 8px 10px; gap: 8px; } #gfx h3 { font-size: 16px; }
  #gfx .mnav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  #gfx .mnav button { flex: none; white-space: nowrap; border-color: var(--line); border-radius: 999px; }
  #gfx .mbody { padding: 0 12px 20px; }
  #gfx .mrow { grid-template-columns: minmax(0, 1fr); } #gfx .mctl { justify-content: flex-start; } #gfx .mctl select { width: 100%; } #gfx input[type=range] { width: 100%; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { #gfx { backdrop-filter: none; } }
#gfx-fps { position: fixed; left: 50%; top: 4px; transform: translateX(-50%); z-index: 999; font: 12px/1.4 ui-monospace, monospace; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 2px 8px; border-radius: 6px; pointer-events: none; }

/* --- Barrierefreiheit (src/ui/a11y.js, Oberfläche im Einstellungsmenü): Textgröße (--ui-scale, 90–150 %), Farbsehschwäche (Palette statt Vollbildfilter), Kontrast, reduzierte Bewegung --- */
:is(#topbar, aside.panel, #drawer-panel, #bottom-dock, #campaign-panel, #job-monitor, #tutorial-hint, #toasts, .start-card, .modal-card, #world3d .w3d-box, #gfx) { zoom: var(--ui-scale, 1); }
body.cb-protan, body.cb-deutan { --danger: #d55e00; --danger-bg: #fdeee4; --accent: #0072b2; --accent-light: #3a93cc; --accent-dark: #00507e; --accent-glow: rgba(0, 114, 178, 0.32); --gold: #b88200; --ok: #56b4e9; --bad: #d55e00; }
body.cb-tritan { --danger: #b2182b; --blue: #404040; --gold: #b35806; --ok: #1b7837; --bad: #b2182b; }
body.a11y-contrast { --panel-bg: #fffdf6; --paper-card: #fffdf6; --panel-border: #000; --ink: #000; --ink-soft: #222; --hud-bg: #000; --hud-border: #fff; }
body.a11y-contrast #world3d { --bg: rgba(0, 0, 0, 0.96); --line: #fff; --fg: #fff; --soft: #ffe14d; }
body.a11y-contrast #gfx { --line: #fff; --mute: #fff; --soft: #ffe14d; --hi: #ffd0c4; }
body.a11y-contrast :is(#gfx, .w3d-box, .toast) { background: #000; color: #fff; border: 2px solid #fff; backdrop-filter: none; text-shadow: none; }
body.a11y-contrast :is(.panel, .glass-panel, .glass-dock) { backdrop-filter: none; border: 2px solid #000; }
body.a11y-motion *, body.a11y-motion *::before, body.a11y-motion *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }

/* Verkaufsdialog über der Karte aus der 3D-Welt */
body.in3d #sell-modal { z-index: 930; }
/* Einsteigen am gewählten Fahrzeug auf der Karte (#136, main.js boardChip) */
#map-board { position: fixed; left: 0; top: 0; z-index: 30; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }

/* Leute in der 3D-Welt (jobs/leute.js, talk.js): Hinweis über dem Kopf und Gesprächsfenster. Unten mittig wie ein Spielfenster,
   Porträt mit Rollenfarbe (--lt-col), Missionskarte als Zettel, Stempel beim Bestätigen, große Antwortknöpfe mit Tastenkürzel */
#w3d-talk { position: absolute; left: 0; top: 0; z-index: 30; display: flex; align-items: center; gap: 2px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--bg); backdrop-filter: blur(6px); font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); animation: lt-bob 1.6s ease-in-out infinite; }
#w3d-talk kbd { background: var(--hot); color: #2a2412; border-color: var(--hot); }
#w3d-talk::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: var(--bg); border: 1px solid var(--line); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
#w3d-talk[hidden], #w3d-talk-dlg[hidden] { display: none; }
@keyframes lt-bob { 50% { margin-top: -4px; } }
#w3d-talk-dlg { position: absolute; inset: auto 0 calc(var(--g) * 2) 0; z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 var(--g); }
#w3d-talk-dlg .lt-card { pointer-events: auto; position: relative; width: min(720px, 100%); max-height: calc(100vh - 4 * var(--g)); overflow: auto; padding: 14px 16px 10px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 40, 28, 0.96), rgba(20, 24, 17, 0.96)); border: 1px solid var(--line); border-top: 4px solid var(--lt-col); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 15px; animation: lt-in 0.22s ease-out; }
/* #219, #217: ein offenes Gespräch hat Vorrang (aktiver Dialog vor Missionsliste vor passivem Tracker): Angebotsliste (sonst stünde dort weiter
   das Hofbüro auf E), Erste Schritte und Missionsmodul treten zurück. Breit liegt das Fenster zwischen der linken Spalte (Fahrzeugkasten,
   Missionsmodul) und der rechten (Karte, Feld-Info); schmal oder flach (Telefon) räumen auch Kasten, Karte, Feld-Info, Navi und Touch-Knöpfe */
#world3d.talking :is(#w3d-tasks, #w3d-first, #w3d-quest) { display: none; }
@media (min-width: 900px) and (min-height: 501px) { #w3d-talk-dlg { padding: 0 calc(var(--side) + var(--g) * 2); } }
@media (max-width: 899px), (max-height: 500px) {
  #world3d.talking :is(#w3d-hud, #w3d-map, #w3d-field, #w3d-navi), #world3d.talking #w3d-touch > :not(.tc-pad, .tc-rotate) { display: none; }
  #w3d-talk-dlg .lt-card { max-height: calc(100vh - var(--g) * 4 - var(--bar)); }
}
/* Telefon quer (#217): die Antworten bleiben ohne Blättern sichtbar – nur die Missionskarte rollt, Bild und Abstände kleiner
   (#world3d davor: gilt auch gegen die Grundregeln weiter unten) */
@media (max-height: 500px) {
  #world3d #w3d-talk-dlg .lt-card { display: flex; flex-direction: column; padding: 8px 12px; }
  #world3d #w3d-talk-dlg .lt-card > * { flex: none; }
  #world3d #w3d-talk-dlg .lt-card > .lt-mission { flex: 0 1 auto; min-height: 44px; overflow: auto; margin: 2px 0 6px; padding: 6px 10px; }
  #world3d #w3d-talk-dlg .lt-pic { width: 44px; height: 44px; border-width: 2px; }
  #world3d #w3d-talk-dlg h2 { font-size: 17px; }
  #world3d #w3d-talk-dlg .lt-text { margin: 6px 0; min-height: 0; font-size: 14px; }
  #world3d #w3d-talk-dlg .lt-answers { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  #world3d #w3d-talk-dlg .lt-answers button { padding: 4px 10px; }
  #world3d #w3d-talk-dlg .lt-legend { display: none; }
}
@keyframes lt-in { from { transform: translateY(24px); opacity: 0; } }
#w3d-talk-dlg header { display: flex; align-items: center; gap: 14px; }
#w3d-talk-dlg .lt-pic { flex: none; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; border: 3px solid var(--lt-col); background: var(--lt-col); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); }
#w3d-talk-dlg .lt-pic img { width: 100%; height: 100%; display: block; }
#w3d-talk-dlg .lt-who { flex: 1; min-width: 0; }
#w3d-talk-dlg h2 { margin: 0; font-size: 22px; line-height: 1.15; color: var(--fg); }
#w3d-talk-dlg .lt-who p { margin: 2px 0 0; color: var(--soft); font-size: 13px; }
#w3d-talk-dlg .lt-x { align-self: flex-start; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); font-size: 20px; line-height: 1; }
#w3d-talk-dlg .lt-text { position: relative; margin: 12px 0 8px; min-height: 3.2em; font-size: 17px; line-height: 1.45; cursor: pointer; }
#w3d-talk-dlg .lt-sr, #w3d-talk-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#w3d-talk-dlg .typing .lt-type::after { content: '▍'; margin-left: 1px; color: var(--hot); animation: lt-blink 0.7s steps(2) infinite; }
@keyframes lt-blink { 50% { opacity: 0; } }
#w3d-talk-dlg .lt-err { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: rgba(226, 100, 60, 0.22); border: 1px solid var(--bad, #e2643c); animation: lt-shake 0.3s; }
@keyframes lt-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
#w3d-talk-dlg .lt-mission { position: relative; margin: 4px 0 10px; padding: 10px 14px; border-radius: 6px; background: #f3ead2; color: #2d2a1f; box-shadow: 0 3px 0 #c9bb93, 0 6px 14px rgba(0, 0, 0, 0.3);
  transform: rotate(-0.6deg); background-image: repeating-linear-gradient(180deg, transparent 0 23px, rgba(60, 90, 140, 0.12) 23px 24px); }
#w3d-talk-dlg .lt-mission h3 { margin: 0 0 6px; padding-right: 110px; font-size: 17px; }
#w3d-talk-dlg .lt-mission h3 small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #7a6a3a; }
#w3d-talk-dlg .lt-mission dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 14px; }
#w3d-talk-dlg .lt-mission dt { font-weight: 700; color: #5d5233; }
#w3d-talk-dlg .lt-mission dd { margin: 0; }
#w3d-talk-dlg .lt-stamp { position: absolute; right: 14px; top: 10px; padding: 3px 10px; border: 3px solid #b8322a; border-radius: 6px; color: #b8322a; font-size: 18px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; transform: rotate(-12deg); opacity: 0.85; animation: lt-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
#w3d-talk-dlg > .lt-card > .lt-stamp.lt-big { top: 64px; right: 28px; }
#w3d-talk-dlg .lt-stamp.lt-big { z-index: 2; background: rgba(243, 234, 210, 0.92); color: #2f7d3a; border-color: #2f7d3a; font-size: 24px; animation: lt-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1), lt-fade 0.6s 2.2s forwards; }
@keyframes lt-stamp { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } }
@keyframes lt-fade { to { opacity: 0; visibility: hidden; } }
#w3d-talk-dlg .lt-answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
#w3d-talk-dlg .lt-answers button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08); text-align: left; font-size: 15px; transition: background 0.12s, transform 0.12s; }
#w3d-talk-dlg .lt-answers button:hover, #w3d-talk-dlg .lt-answers button:focus-visible { background: rgba(217, 184, 74, 0.22); border-color: var(--hot); transform: translateX(2px); }
#w3d-talk-dlg .lt-answers kbd { flex: none; background: rgba(0, 0, 0, 0.3); border: 0; }
#w3d-talk-dlg .lt-answers span { flex: 1; }
#w3d-talk-dlg .lt-answers em { flex: none; font-style: normal; color: var(--soft); font-weight: 600; }
#w3d-talk-dlg .lt-answers li:first-child .lt-act { border-color: var(--lt-col); }
#w3d-talk-dlg .lt-answers .lt-bye { opacity: 0.85; }
#w3d-talk-dlg .lt-legend { margin: 8px 0 0; font-size: 12px; color: var(--soft); opacity: 0.85; }
#world3d.touch #w3d-talk-dlg .lt-legend { display: none; }
#world3d.w3d-nohud #w3d-talk, #world3d.stream #w3d-talk, #world3d.w3d-photo #w3d-talk { display: none !important; }
/* Telefon (#165, jobs/leute.js): Smartphone unten rechts; im Anruf dasselbe Gesprächsfenster schmal im Telefonrahmen (.lt-phone) */
#w3d-phone { position: absolute; right: calc(var(--g) * 2); bottom: calc(var(--g) * 2); z-index: 59; width: min(300px, calc(100vw - var(--g) * 4)); }
#w3d-phone[hidden] { display: none; }
#w3d-phone .ph-frame { padding: 8px 12px 16px; border-radius: 32px; border: 6px solid #15171a; background: linear-gradient(180deg, #26302a, #141914); box-shadow: 0 0 0 2px #444a50, 0 14px 40px rgba(0, 0, 0, 0.55); animation: lt-in 0.22s ease-out; }
#w3d-phone .ph-bar { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--soft); padding: 0 6px 4px; }
#w3d-phone .ph-notch { width: 64px; height: 14px; border-radius: 0 0 10px 10px; background: #15171a; margin-top: -8px; }
#w3d-phone .ph-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 6px; }
#w3d-phone h3 { margin: 0; font-size: 16px; }
#w3d-phone .ph-head button { padding: 0 6px; border: 0; background: none; font-size: 18px; line-height: 1; }
#w3d-phone .ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
#w3d-phone .ph-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.06); text-align: left; }
#w3d-phone .ph-list button:hover, #w3d-phone .ph-list button:focus-visible { background: rgba(217, 184, 74, 0.2); border-color: var(--hot); }
#w3d-phone img { flex: none; width: 40px; height: 40px; border-radius: 50%; }
#w3d-phone .ph-list span { flex: 1; min-width: 0; display: grid; }
#w3d-phone small { color: var(--soft); font-size: 11px; }
#w3d-phone em { flex: none; padding: 1px 8px; border-radius: 10px; background: var(--hot); color: #2a2412; font-style: normal; font-size: 11px; font-weight: 700; }
#w3d-phone .ph-call { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 8px 0 0; }
#w3d-phone .ph-call img { width: 88px; height: 88px; }
#w3d-phone .ph-call p { margin: 4px 0; font-size: 14px; line-height: 1.4; }
#w3d-phone.ph-in .ph-call img, #w3d-phone.ph-dial .ph-call img { animation: ph-ring 0.9s ease-in-out infinite; }
#w3d-phone .ph-hang { padding: 6px 18px; border: 0; border-radius: 18px; background: #c0392b; color: #fff; font-weight: 600; }
@keyframes ph-ring { 50% { box-shadow: 0 0 0 8px rgba(217, 184, 74, 0.35); } }
/* Eingehende Missions-Meldungen & Anrufe im Player-Character-Design (.lt-card), nicht-blockierend oben mittig */
#w3d-ring { position: absolute; left: 50%; top: calc(var(--g) * 2 + 34px); transform: translateX(-50%); z-index: 58; width: min(560px, calc(100vw - var(--g) * 4)); pointer-events: none; }
#w3d-ring[hidden] { display: none; }
#world3d.navi-on #w3d-ring { top: calc(var(--g) + var(--bar) + 84px); }   /* #219: unter dem Kasten der Routenführung, nicht darüber */
/* #228: Meldungen (#toasts) und Anruf bzw. Hof-Funk liegen beide oben mittig – steht ein Anruf, rücken die Meldungen darunter (--w3d-ring-bottom
   setzt jobs/leute.js beim Zeigen); auf dem Telefon in 3D mittig statt über die ganze Breite, sonst lägen sie über Missionsmodul und Kasten */
body.in3d:has(#w3d-ring:not([hidden])) #toasts { top: calc(var(--w3d-ring-bottom, 190px) + 6px) !important; }
@media (max-width: 700px), (max-height: 500px) {
  body.in3d #toasts { left: 50% !important; right: auto !important; transform: translateX(-50%) !important; width: max-content !important; max-width: max(200px, calc(100vw - 480px)) !important; }
}
#w3d-ring .lt-toast { pointer-events: auto; position: relative; padding: 11px 14px; border-radius: 16px; background: linear-gradient(180deg, rgba(34, 40, 28, 0.96), rgba(20, 24, 17, 0.96)); border: 1px solid var(--line); border-top: 4px solid var(--lt-col, #d9b84a); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); animation: lt-in 0.22s ease-out; }
#w3d-ring header { display: flex; align-items: center; gap: 12px; }
#w3d-ring .lt-pic { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 2px solid var(--lt-col, #d9b84a); background: var(--lt-col, #d9b84a); }
#w3d-ring .lt-pic img { width: 100%; height: 100%; display: block; }
#w3d-ring .lt-who { flex: 1; min-width: 0; }
#w3d-ring .lt-badge { display: inline-block; margin-bottom: 2px; padding: 1px 7px; border-radius: 99px; background: rgba(217, 184, 74, 0.2); border: 1px solid var(--lt-col, #d9b84a); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hot); }
#w3d-ring h2 { margin: 0; font-size: 17px; line-height: 1.15; color: var(--fg); }
#w3d-ring .lt-who p { margin: 2px 0 0; color: var(--soft); font-size: 12px; }
#w3d-ring .lt-x { align-self: flex-start; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); font-size: 18px; line-height: 1; }
#w3d-ring .lt-text { margin: 8px 0 0; font-size: 14px; line-height: 1.4; }
#w3d-ring .lt-ring-acts { margin-top: 8px; display: flex; justify-content: flex-end; }
#w3d-ring .lt-act { padding: 6px 14px; border-radius: 9px; border: 1px solid var(--hot); background: var(--hot); color: #2a2412; font-weight: 700; font-size: 13px; }
/* Offener Anruf im Player-Character-Design (.lt-card statt schmalem Telefon-Pop-up) */
#w3d-talk-dlg.lt-phone { justify-content: center; }
#w3d-talk-dlg.lt-phone .lt-who p::before { content: '📞 '; }
#world3d.w3d-nohud #w3d-phone, #world3d.w3d-photo #w3d-phone, #world3d.w3d-nohud #w3d-ring, #world3d.w3d-photo #w3d-ring { display: none !important; }
@media (max-width: 600px) {
  #w3d-talk-dlg { inset: auto 0 0 0; padding: 0; }
  #w3d-talk-dlg .lt-card { border-radius: 16px 16px 0 0; padding: 12px 12px 14px; }
  #w3d-talk-dlg .lt-pic { width: 64px; height: 64px; }
  #w3d-talk-dlg h2 { font-size: 19px; }
  #w3d-talk-dlg .lt-answers { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { #w3d-talk, #w3d-talk-dlg .lt-card, #w3d-talk-dlg .lt-stamp { animation: none; } }

/* ==========================================================================
   Die eine Karte (#137, src/ui/atlas-ui.js): Kartenleiste (Stufen, Suche), Zoomleiste, Karteninfo, Quellenzeile.
   Papier für alles, was zur Karte gehört; die dunklen Pillen bleiben dem Spielstand (Zeit, Geld, Lager).
   ========================================================================== */
#atlas-bar, #atlas-zoom, #atlas-foot, #atlas-back { display: none; }
body.has-atlas #atlas-bar, body.has-atlas #atlas-zoom { display: flex; }
body.has-atlas #atlas-foot { display: block; }
body.atlas-browse #atlas-back { display: inline-flex; }
body.in3d:not(:has(#world3d.map)) :is(#atlas-bar, #atlas-zoom, #atlas-foot, #atlas-card, #atlas-tip) { display: none !important; }
#atlas-bar {
  position: fixed; z-index: 34; top: 68px; left: 300px; right: 484px; max-width: 620px; margin-inline: auto;
  align-items: center; gap: 8px; padding: 5px 6px 5px 12px; min-height: 44px;
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px);
}
body.atlas-browse #atlas-bar { top: 14px; left: 14px; right: 14px; max-width: 640px; }
#atlas-crumb { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
#atlas-crumb button { border: 0; background: transparent; padding: 6px 7px; border-radius: 8px; font-weight: 600; font-size: 12.5px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
#atlas-crumb button:hover { background: var(--paper-hover); color: var(--ink); }
#atlas-crumb button.on { color: var(--accent-dark); font-weight: 800; }
#atlas-crumb .sep { color: #b9a886; font-size: 13px; }
.atlas-search { position: relative; flex: 0 1 190px; min-width: 96px; }
#atlas-search { width: 100%; height: 34px; padding: 0 12px 0 30px; border: 1px solid #dfd1b0; border-radius: var(--radius-pill); background: #fffdf6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.8' cy='6.800' r='4.500' fill='none' stroke='%236e6049' stroke-width='1.800'/%3E%3Cpath d='M10.300 10.300 14 14' stroke='%236e6049' stroke-width='1.800' stroke-linecap='round'/%3E%3C/svg%3E") 10px 50% / 14px no-repeat; font-weight: 500; font-size: 13px; line-height: 1; color: var(--ink); outline: none; user-select: text; }
#atlas-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
#atlas-results { position: absolute; right: 0; top: 40px; width: max(100%, 280px); max-height: min(340px, 50vh); overflow: auto; list-style: none; padding: 5px; background: var(--paper); border: 1px solid var(--panel-border); border-radius: var(--radius-md); box-shadow: var(--shadow); }
#atlas-results[hidden] { display: none; }
#atlas-results li { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
#atlas-results li.on, #atlas-results li[role=option]:hover { background: var(--paper-hover); }
#atlas-results li.none { display: block; color: var(--ink-soft); cursor: default; }
#atlas-results small { grid-column: 2; color: var(--ink-soft); font-size: 11px; }
#atlas-results .ico { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: #b9a886; justify-self: center; }
#atlas-results .k-hand .ico, #atlas-results .k-home .ico { background: var(--gold); box-shadow: 0 0 0 2px var(--gold-bg); }
#atlas-results .k-town .ico, #atlas-results .k-place .ico { background: var(--accent); }
#atlas-results .k-country .ico { border-radius: 2px; background: #9a8a68; }
#atlas-results .k-world .ico, #atlas-results .k-coord .ico { background: var(--blue); }

#atlas-zoom {
  position: fixed; z-index: 34; right: 14px; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 2px; padding: 4px;
  background: var(--hud-bg); border: 1px solid var(--hud-border); border-radius: 26px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
#atlas-zoom button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--paper); font-weight: 500; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
#atlas-zoom button:hover { background: rgba(255, 255, 255, 0.16); }
#atlas-zoom svg { width: 20px; height: 20px; }
#atlas-zoom .az-home { color: var(--gold-bright); margin-top: 4px; border-top: 1px solid rgba(255, 240, 200, 0.18); border-radius: 0 0 20px 20px; }
:is(#atlas-zoom button, #atlas-crumb button, #atlas-foot button):focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 1px; }

#atlas-card { left: 14px; top: 68px; width: 300px; padding: 14px 14px 12px; }
body.has-atlas-card #todo-panel { display: none; }
body.atlas-browse #atlas-card { top: 70px; }
#atlas-card .close-x { position: absolute; right: 8px; top: 8px; }
#atlas-card h3 { margin: 8px 28px 2px 0; font: 700 19px/1.2 Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; color: var(--ink); }
.atlas-sub { margin-bottom: 10px; font-weight: 600; font-size: 11px; line-height: 1.4; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ink-soft); }
#atlas-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 10px 0; border-top: 1px solid #dfd1b0; font-size: 13px; }
#atlas-card dt { color: var(--ink-soft); } #atlas-card dd { font-weight: 600; }
.atlas-chip { display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill); font-weight: 700; font-size: 10.5px; line-height: 1.4; letter-spacing: 0.9px; text-transform: uppercase; color: #fffdf6; background: var(--accent); }
.atlas-chip.st-hand, .atlas-chip.st-home { background: linear-gradient(135deg, #e0aa2c, #b98316); color: #2c2419; }
.atlas-chip.st-building { background: #d9822b; } .atlas-chip.st-queued { background: #7a63a8; } .atlas-chip.st-failed { background: var(--danger); }
.atlas-chip.st-free { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(44, 36, 25, 0.45); }
.atlas-note { margin-bottom: 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.atlas-prog { height: 8px; margin-bottom: 8px; border-radius: 4px; background: #e3d7ba; overflow: hidden; }
.atlas-prog i { display: block; height: 100%; border-radius: 4px; background: #d9822b; transition: width 0.6s; }
.atlas-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.atlas-actions .btn { flex: 1 1 auto; justify-content: center; }

#atlas-tip { position: fixed; z-index: 60; left: 0; top: 0; max-width: 260px; padding: 8px 11px; border-radius: 10px; pointer-events: none; background: var(--hud-bg); color: var(--paper); font-size: 12.5px; line-height: 1.35; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--shadow-sm); }
#atlas-tip[hidden] { display: none; }
#atlas-tip b { font: 700 14px/1.2 Georgia, 'Iowan Old Style', serif; }
#atlas-tip em { font-style: normal; opacity: 0.7; font-size: 11.5px; margin-top: 2px; }
#atlas-status { position: fixed; z-index: 61; left: 50%; top: 124px; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px; background: var(--danger); color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; box-shadow: var(--shadow-sm); }
#atlas-status[hidden] { display: none; }
#atlas-foot { position: fixed; z-index: 11; left: 14px; bottom: 0; font: 500 10px/12px system-ui, sans-serif; color: #2c2419; text-shadow: 0 0 3px #fffdf6, 0 0 3px #fffdf6, 0 0 2px #fffdf6; pointer-events: none; white-space: nowrap; }
#atlas-foot button { pointer-events: auto; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; text-shadow: inherit; }

/* Spielart in der Kopfleiste: Einzelspiel ruhig, Mehrspieler mit grünem Punkt */
.tb-mode { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; margin-right: 2px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); font-weight: 700; font-size: 11.5px; line-height: 1; letter-spacing: 0.2px; white-space: nowrap; color: #e9dfc8; }
.tb-mode[data-mode="mp"] { color: #dff5d8; border-color: rgba(111, 211, 111, 0.45); }
.tb-mode[data-mode="mp"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6fd36f; box-shadow: 0 0 0 3px rgba(111, 211, 111, 0.22); }

/* Kopfleiste: eine Zeile in jeder Breite. Wird es eng, weichen erst die Lager, dann die Tempo-Knöpfe in ihre Kurzform; nichts bricht in die Zeile
   der Aufgabenliste um (Nebenbefund #137: bei ~1270 px lag die Schaltergruppe über der Liste) */
#topbar { flex-wrap: nowrap; }
#topbar .tb-pill { flex: 0 0 auto; }
#topbar .tb-stores { flex: 0 1 auto; min-width: 0; overflow: hidden; }
@media (max-width: 1340px) { .tb-stores { display: none; } }
@media (max-width: 1180px) { .tb-mode { font-size: 0; gap: 0; padding: 0 8px; } .tb-mode::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #c9bb9a; } .tb-speed-bar .tbtn.speed:not(.active) { display: none; } }
/* unter 1200 px passt die Kartenleiste nicht mehr zwischen Aufgabenliste und Auftragsreiter: eigene Zeile darunter, Meldungen rücken nach */
@media (max-width: 1199px) { #atlas-bar { top: 126px; right: 14px; } #toasts { top: 178px; } body.has-field-sheet #toasts { top: 226px; } }

/* Telefon: Kartenleiste über die Breite unter der Kopfleiste, Zoomleiste rechts über der Tab-Leiste, Karteninfo als Bottom-Sheet */
@media (max-width: 700px), (max-height: 500px) {
  #atlas-bar { left: 8px; right: 8px; top: 62px; min-height: 40px; padding-left: 8px; }
  body.atlas-browse #atlas-bar { top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; }
  .atlas-search { flex-basis: 132px; }
  #atlas-results { position: fixed; left: 8px; right: 8px; top: 108px; width: auto; }
  #atlas-zoom { top: auto; transform: none; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  #atlas-zoom button { width: 44px; height: 44px; }
  #atlas-card { left: 0 !important; right: 0; top: auto !important; width: auto; bottom: calc(58px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; max-height: 60vh; overflow: auto; }
  body.atlas-browse #atlas-card { bottom: 0; }
  body.has-atlas-card #atlas-zoom { display: none; }
  #atlas-foot { left: 8px; bottom: calc(60px + env(safe-area-inset-bottom)); font-size: 9px; }
  body.atlas-browse #atlas-foot { bottom: 2px; }
  #atlas-status { top: 108px; width: calc(100% - 16px); }
  .tb-mode { font-size: 0; gap: 0; padding: 0 8px; }
  .tb-mode[data-mode="sp"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #c9bb9a; }
}
@media (max-height: 500px) { #atlas-zoom { bottom: auto; top: 50%; transform: translateY(-50%); } #atlas-zoom button { width: 36px; height: 36px; } }
body.a11y-contrast :is(#atlas-bar, #atlas-zoom) { backdrop-filter: none; border: 2px solid #000; }
/* Karte aus der 3D-Welt (#136): mittig sitzt die Navi-Leiste mit eigener Suche – die Kartenleiste zeigt dort nur die Stufen, links daneben */
body.in3d:has(#world3d.map) #atlas-bar { right: auto; width: 142px; margin: 0; padding-right: 12px; }
body.in3d:has(#world3d.map) .atlas-search { display: none; }
/* Weltkarte vom Startbildschirm: nur die Karte und ihre Leisten, keine Spielpanels */
body.atlas-browse :is(#side-panel, #bottom-dock, #campaign-panel, #job-monitor, #todo-panel, #selection-panel, #edge-hint, #tutorial-hint) { display: none !important; }

/* --- Start: Ladehinweis und Ladefehler (play.html #boot, #158) --- */
#boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #1c2218; color: var(--paper, #f3ecd8); font-weight: 600; text-align: center; padding: 16px; }
html.ready #boot { display: none; }
#boot i { width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--gold-bright, #e8c34a); border-radius: 50%; animation: bootSpin .9s linear infinite; }
#boot button { display: none; }
#boot.bad i { display: none; }
#boot.bad button { display: inline-block; }
@keyframes bootSpin { to { transform: rotate(360deg); } }
.toast.keep { pointer-events: auto; white-space: normal; display: flex; align-items: center; gap: 10px; }
