:root {
  color-scheme: dark;
  --ink-950: #071018;
  --ink-900: #0b1720;
  --ink-850: #101f2a;
  --ink-800: #142733;
  --ink-700: #203844;
  --muted: #7f98a5;
  --muted-strong: #d7e4df;
  --paper: #ffffff;
  --teal: #35d07f;
  --teal-bright: #75e6a4;
  --teal-deep: #1b8c50;
  --amber: #ef5350;
  --coral: #ffffff;
  --blue: #5ca8ff;
  --violet: #b28cff;
  --orange: #ff9a4d;
  --yellow: #f5d76e;
  --map-bg: #0d252d;
  --line: rgba(174, 209, 211, .15);
  --glass: rgba(11, 23, 32, .88);
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --radius: 14px;
  --font-display: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-body);
  background: var(--ink-950);
  color: var(--paper);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; background: var(--ink-950); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.start-screen { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 24px; background: radial-gradient(circle at 74% 18%, rgba(26, 75, 76, .28), transparent 32%), radial-gradient(circle at 12% 86%, rgba(245, 184, 75, .09), transparent 25%), var(--ink-950); }
.start-screen::before { position: absolute; inset: 0; opacity: .32; background-image: linear-gradient(rgba(174, 209, 211, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(174, 209, 211, .07) 1px, transparent 1px); background-size: 44px 44px; content: ""; mask-image: linear-gradient(to bottom, black, transparent 86%); }
.menu-glow { position: absolute; width: 260px; height: 260px; border-radius: 50%; filter: blur(70px); opacity: .15; pointer-events: none; }
.menu-glow-one { top: 12%; left: 8%; background: var(--teal); }
.menu-glow-two { right: 5%; bottom: 8%; background: var(--amber); }
.menu-card { position: relative; z-index: 1; width: min(680px, 100%); padding: clamp(24px, 5vw, 52px); border: 1px solid var(--line); border-radius: 24px; background: rgba(11, 23, 32, .84); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.menu-brand, .brand-lockup, .company-strip, .top-actions, .phase-row, .phase-meta, .card-title-row, .panel-heading, .selected-head, .event-bar, .event-label, .event-actions, .map-toolbar, .map-tools { display: flex; align-items: center; }
.menu-brand { gap: 13px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); grid-template-rows: repeat(2, 9px); gap: 3px; transform: rotate(45deg); }
.brand-mark.large { grid-template-columns: repeat(2, 13px); grid-template-rows: repeat(2, 13px); gap: 4px; }
.brand-mark i { display: block; border-radius: 2px; background: var(--teal); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--amber); }
.brand-name { letter-spacing: .19em; font: 700 16px/1 var(--font-display); }
.brand-caption, .section-kicker, .event-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.menu-heading { margin: 58px 0 28px; }
.menu-heading h1 { margin: 7px 0 10px; font: 700 clamp(32px, 6vw, 52px)/.95 var(--font-display); letter-spacing: -.035em; }
.menu-heading p { max-width: 470px; margin: 0; color: var(--muted-strong); font-size: 14px; line-height: 1.55; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { position: relative; min-height: 170px; display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: 14px; color: var(--paper); background: rgba(20, 39, 51, .6); text-align: left; transition: .22s; }
.mode-card:hover { transform: translateY(-3px); border-color: var(--teal); background: rgba(57, 210, 188, .1); box-shadow: 0 12px 28px rgba(0, 0, 0, .2); }
.mode-card.sandbox:hover { border-color: var(--amber); background: rgba(245, 184, 75, .1); }
.mode-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 11px; }
.career .mode-icon { background: rgba(57, 210, 188, .13); }
.sandbox .mode-icon { background: rgba(245, 184, 75, .13); }
.career-icon { grid-template-columns: repeat(3, 5px); align-items: end; gap: 4px; }
.career-icon i { width: 5px; border-radius: 3px 3px 1px 1px; background: var(--teal); }
.career-icon i:nth-child(1) { height: 11px; }.career-icon i:nth-child(2) { height: 20px; }.career-icon i:nth-child(3) { height: 29px; }
.sandbox-icon { position: relative; }
.sandbox-icon::before, .sandbox-icon::after, .sandbox-icon i { position: absolute; display: block; border: 2px solid var(--amber); content: ""; }
.sandbox-icon::before { width: 21px; height: 14px; transform: translate(-5px, -5px); }.sandbox-icon::after { width: 21px; height: 14px; transform: translate(5px, 5px); }.sandbox-icon i:first-child { width: 9px; height: 9px; border-color: var(--paper); transform: translate(-2px, -2px); }.sandbox-icon i:last-child { width: 9px; height: 9px; border-color: var(--paper); transform: translate(2px, 2px); }
.mode-copy { display: grid; gap: 7px; padding-right: 22px; }.mode-copy strong { font: 700 19px var(--font-display); }.mode-copy span { color: var(--muted); font-size: 11px; line-height: 1.45; }.mode-arrow { position: absolute; right: 18px; bottom: 18px; color: var(--teal); font-size: 20px; }.sandbox .mode-arrow { color: var(--amber); }
.continue-button { width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-strong); background: transparent; font-size: 12px; font-weight: 700; }.continue-button:hover { color: var(--paper); border-color: var(--teal-deep); background: rgba(57, 210, 188, .07); }
.menu-hint { margin: 24px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.app-shell { position: relative; min-height: 100svh; overflow: hidden; background: var(--ink-950); }
.topbar { position: absolute; z-index: 1000; top: 0; left: 0; right: 0; min-height: 68px; padding: 0 24px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(7, 16, 24, .82); backdrop-filter: blur(14px); }
.brand-lockup { gap: 11px; min-width: 230px; }.company-strip { gap: 10px; flex: 1; }.company-avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(57, 210, 188, .45); border-radius: 50%; color: var(--teal); background: rgba(57, 210, 188, .1); font-size: 10px; font-weight: 800; }.company-name { max-width: 230px; overflow: hidden; color: var(--muted-strong); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.level-badge, .mode-badge, .status-pill, .object-count { padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }.level-badge { color: var(--amber); background: rgba(245, 184, 75, .11); }.mode-badge { color: var(--teal); background: rgba(57, 210, 188, .1); }.top-actions { gap: 9px; }.cash-block { margin-right: 8px; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-align: right; text-transform: uppercase; }.cash-block strong { display: block; margin-top: 2px; color: var(--paper); font: 700 15px var(--font-display); letter-spacing: .01em; }.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); background: var(--ink-850); font-size: 19px; transition: .2s; }.icon-button:hover { border-color: var(--teal-deep); color: var(--teal); }
.workspace { position: relative; min-height: 100svh; }.map-stage { position: absolute; z-index: 1; inset: 0; overflow: hidden; background: var(--map-bg); }.map-canvas { width: 100%; height: 100%; min-height: 100svh; background: var(--map-bg); }.map-toolbar { position: absolute; z-index: 500; top: 86px; left: 280px; right: 360px; justify-content: space-between; pointer-events: none; }.map-toolbar > *, .map-tools { pointer-events: auto; }.map-toolbar h1 { margin: 4px 0 0; font: 700 24px var(--font-display); letter-spacing: -.025em; }.map-tools { gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7, 16, 24, .84); }.tool-button, .text-button { border: 0; color: var(--muted); background: transparent; font-size: 11px; }.tool-button { padding: 8px 10px; border-radius: 5px; }.tool-button.active, .tool-button:hover { color: var(--paper); background: var(--ink-700); }
.map-legend { position: absolute; z-index: 500; left: 24px; bottom: 54px; display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); background: rgba(7, 16, 24, .86); font-size: 10px; }.map-legend span { display: inline-flex; align-items: center; gap: 6px; }.legend-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }.legend-dot.city { border: 2px solid var(--paper); background: var(--teal); box-shadow: 0 0 0 3px rgba(57, 210, 188, .14); }.legend-dot.warehouse { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 184, 75, .18); }.legend-dot.store { background: var(--teal); box-shadow: 0 0 0 3px rgba(57, 210, 188, .18); }.legend-line { width: 15px; height: 2px; display: inline-block; background: var(--teal); }.map-note { position: absolute; z-index: 600; top: 86px; left: 50%; transform: translateX(-50%); padding: 9px 13px; border: 1px solid rgba(57, 210, 188, .3); border-radius: 8px; color: var(--paper); background: var(--ink-850); font-size: 11px; box-shadow: var(--shadow); }

.left-rail, .right-panel { position: absolute; z-index: 700; top: 82px; bottom: 47px; overflow: auto; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(16px); }.left-rail { left: 18px; width: 236px; padding: 14px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 15px; }.right-panel { right: 18px; width: 320px; padding: 16px; border-radius: var(--radius); }.side-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(20, 39, 51, .5); }.phase-row { gap: 7px; margin: 9px 0 12px; color: var(--muted); font-size: 11px; }.phase-row strong { color: var(--paper); font: 700 22px var(--font-display); letter-spacing: -.02em; }.live-dot, .signal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(57, 210, 188, .1); }.progress-track, .stock-bar { width: 100%; height: 5px; overflow: hidden; border-radius: 6px; background: var(--ink-700); }.progress-track span, .stock-bar span { display: block; width: 26%; height: 100%; border-radius: inherit; background: var(--teal); transition: width .4s; }.phase-meta, .stock-foot { justify-content: space-between; margin: 8px 0 14px; color: var(--muted); font-size: 10px; }.primary-button, .secondary-button { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-radius: 8px; font-size: 12px; font-weight: 750; transition: .2s; }.primary-button { border: 1px solid rgba(57, 210, 188, .55); color: var(--ink-950); background: var(--teal); }.primary-button:hover { background: var(--teal-bright); transform: translateY(-1px); }.secondary-button { border: 1px solid var(--line); color: var(--muted-strong); background: var(--ink-850); }.secondary-button:hover { border-color: var(--teal-deep); color: var(--teal); }.full-width { width: 100%; }
.side-nav { display: grid; gap: 5px; }.nav-item { min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; font-size: 11px; transition: .2s; }.nav-item:hover { color: var(--muted-strong); background: rgba(32, 56, 68, .35); }.nav-item.active { border-color: rgba(57, 210, 188, .18); color: var(--paper); background: rgba(57, 210, 188, .08); }.nav-item b { min-width: 17px; margin-left: auto; color: var(--teal); text-align: right; font-size: 10px; }.nav-icon { width: 17px; color: var(--teal); text-align: center; font-size: 17px; }.insight-card { margin-top: auto; }.card-title-row { justify-content: space-between; gap: 10px; }.card-title-row h2 { margin: 0; font: 700 12px var(--font-display); letter-spacing: .03em; }.status-pill.good { color: var(--teal); background: rgba(57, 210, 188, .1); }.mini-metric { display: flex; justify-content: space-between; margin-top: 15px; color: var(--muted); font-size: 10px; }.mini-metric strong { color: var(--paper); }.rail-footer { display: flex; align-items: center; gap: 7px; padding: 0 3px; color: var(--muted); font-size: 9px; }.footer-version { margin-left: auto; opacity: .55; }

.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; }.leaflet-control-zoom a { border-color: var(--line) !important; color: var(--muted-strong) !important; background: var(--ink-850) !important; }.leaflet-control-attribution { color: rgba(175, 192, 199, .6) !important; background: rgba(7, 16, 24, .65) !important; }.leaflet-control-attribution a { color: var(--teal) !important; }.leaflet-popup-content-wrapper, .leaflet-popup-tip { color: var(--paper); background: var(--ink-850); }.grid-marker-wrap, .city-pin-wrap { border: 0; background: transparent; }.grid-marker { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--marker-color); border-radius: 9px; background: rgba(7, 16, 24, .94); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-color) 20%, transparent), 0 4px 10px rgba(0, 0, 0, .4); }.marker-glyph { position: relative; display: block; width: 14px; height: 12px; }.marker-glyph::before, .marker-glyph::after { position: absolute; content: ""; }.grid-marker.store { border-radius: 50%; }.grid-marker.store .marker-glyph { width: 16px; height: 11px; border: 2px solid var(--marker-color); border-top: 0; border-radius: 1px; }.grid-marker.store .marker-glyph::before { top: -5px; left: -2px; width: 16px; height: 5px; border: 2px solid var(--marker-color); border-bottom: 0; transform: skewX(-22deg); }.grid-marker.warehouse .marker-glyph { border: 2px solid var(--marker-color); border-radius: 2px; }.grid-marker.warehouse .marker-glyph::before { top: 3px; left: 2px; width: 6px; height: 2px; border-top: 2px solid var(--marker-color); box-shadow: 0 3px 0 var(--marker-color); }.city-pin { position: relative; display: flex; align-items: center; gap: 6px; white-space: nowrap; }.city-pin i { width: 11px; height: 11px; display: block; border: 2px solid var(--paper); border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(57, 210, 188, .15); }.city-pin b { padding: 3px 5px; border: 1px solid rgba(174, 209, 211, .16); border-radius: 4px; color: var(--muted-strong); background: rgba(7, 16, 24, .76); font-size: 9px; font-weight: 700; }

.panel-view { min-height: 300px; }.panel-heading { justify-content: space-between; gap: 10px; margin-bottom: 17px; }.panel-heading h2 { margin: 4px 0 0; font: 700 21px var(--font-display); }.object-count { color: var(--muted); background: var(--ink-800); font-weight: 600; letter-spacing: 0; }.object-list { display: grid; gap: 8px; }.object-card { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--paper); background: rgba(20, 39, 51, .42); text-align: left; }.object-card:hover, .object-card.selected { border-color: rgba(57, 210, 188, .55); background: rgba(57, 210, 188, .08); }.object-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; font-size: 15px; }.object-symbol.store { color: var(--teal); background: rgba(57, 210, 188, .11); }.object-symbol.warehouse { color: var(--amber); background: rgba(245, 184, 75, .12); }.object-main strong, .selected-object h3 { display: block; font-size: 12px; }.object-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }.object-tail { color: var(--muted); font-size: 10px; text-align: right; }.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }.empty-icon { margin-bottom: 9px; color: var(--teal); font-size: 30px; }.empty-state strong { color: var(--muted-strong); font-size: 12px; }.empty-state p { margin: 7px 0 0; font-size: 11px; line-height: 1.5; }
.form-stack { display: grid; gap: 9px; }.field-label { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }.field-select, .field-input { width: 100%; min-height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--paper); background: var(--ink-850); font-size: 12px; }.field-select option { color: var(--paper); background: var(--ink-850); }.cost-preview, .order-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 6px 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }.cost-preview strong, .order-summary strong { color: var(--paper); }.order-summary strong:nth-of-type(1) { grid-column: 2; grid-row: 1; }.order-summary span:nth-of-type(2) { grid-column: 1; }.order-summary strong:nth-of-type(2) { grid-column: 2; }.tip-box, .unlock-card, .stock-card { margin-top: 16px; padding: 12px; border: 1px solid rgba(245, 184, 75, .2); border-radius: 9px; background: rgba(245, 184, 75, .06); }.tip-box strong, .unlock-card strong { color: var(--amber); font-size: 11px; }.tip-box p, .unlock-card p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }.stock-card { border-color: var(--line); background: rgba(20, 39, 51, .4); }.stock-card .card-title-row { margin-bottom: 12px; color: var(--muted-strong); font-size: 11px; }.stock-card .card-title-row span { color: var(--teal); font-size: 10px; }.stock-foot { margin: 8px 0 0; }.stock-foot span:first-child { color: var(--paper); font-weight: 700; }.color-picker { display: flex; gap: 9px; padding: 4px 0 7px; }.color-swatch { width: 30px; height: 30px; border: 3px solid transparent; border-radius: 50%; background: var(--teal); box-shadow: inset 0 0 0 4px var(--ink-850); }.color-swatch.amber { background: var(--amber); }.color-swatch.coral { background: var(--coral); }.color-swatch.selected { border-color: var(--paper); }.unlock-card { display: flex; gap: 10px; border-color: rgba(57, 210, 188, .2); background: rgba(57, 210, 188, .05); }.unlock-icon { color: var(--teal); font-size: 20px; }.unlock-card strong { color: var(--teal); }.selected-object { margin-top: 18px; padding: 13px; border: 1px solid rgba(57, 210, 188, .27); border-radius: 10px; background: rgba(57, 210, 188, .06); }.selected-head { justify-content: space-between; }.selected-type { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }.close-selection { border: 0; color: var(--muted); background: transparent; font-size: 21px; }.selected-object h3 { margin: 9px 0 13px; font-size: 16px; }.selected-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }.selected-stat { padding: 8px; border-radius: 7px; background: rgba(7, 16, 24, .35); }.selected-stat span { display: block; color: var(--muted); font-size: 9px; }.selected-stat strong { display: block; margin-top: 3px; color: var(--paper); font-size: 11px; }
.event-bar { position: absolute; z-index: 1000; right: 0; bottom: 0; left: 0; min-height: 38px; gap: 18px; padding: 0 23px; border-top: 1px solid var(--line); background: rgba(11, 23, 32, .9); backdrop-filter: blur(12px); }.event-label { gap: 8px; min-width: 120px; color: var(--amber); }.event-pulse { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }.event-feed { flex: 1; min-width: 0; overflow: hidden; color: var(--muted-strong); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }.event-feed strong { color: var(--paper); }.text-button { padding: 6px; font-size: 10px; }.text-button:hover { color: var(--teal); }

@media (max-width: 900px) { .brand-lockup { min-width: auto; }.company-name { max-width: 150px; }.left-rail { left: 12px; width: 220px; }.right-panel { right: 12px; width: 290px; }.map-toolbar { left: 250px; right: 320px; } }
@media (max-width: 700px) { body { overflow: auto; }.topbar { min-height: 60px; padding: 0 12px; gap: 10px; }.brand-lockup { flex: 1; }.brand-caption, .company-strip { display: none; }.cash-block { display: none; }.workspace { min-height: 100svh; padding-top: 0; }.map-canvas { min-height: 100svh; }.map-toolbar { top: 75px; left: 14px; right: 14px; }.map-toolbar h1 { font-size: 19px; }.map-tools { display: none; }.left-rail, .right-panel { position: relative; top: auto; right: auto; bottom: auto; left: auto; width: auto; margin: 10px 10px 0; border-radius: 12px; }.left-rail { display: grid; grid-template-columns: 1fr 1fr; padding: 10px; }.phase-card { grid-column: span 2; }.side-nav { grid-column: span 2; grid-template-columns: repeat(4, 1fr); }.nav-item { justify-content: center; padding: 0 4px; }.nav-item b, .nav-icon { display: none; }.insight-card { margin-top: 0; }.right-panel { padding: 15px; margin-bottom: 48px; }.map-stage { position: absolute; min-height: 100svh; }.map-legend { left: 12px; right: 12px; bottom: 54px; gap: 8px; }.event-bar { padding: 0 12px; gap: 9px; }.event-actions { display: none; }.menu-card { padding: 26px 20px; }.menu-heading { margin-top: 42px; }.mode-grid { grid-template-columns: 1fr; }.mode-card { min-height: 135px; }.mode-icon { margin-bottom: 15px; } }
@media (max-width: 430px) { .left-rail { grid-template-columns: 1fr; }.phase-card, .side-nav { grid-column: auto; }.side-nav { grid-template-columns: repeat(2, 1fr); }.nav-item { justify-content: flex-start; padding: 0 10px; }.nav-icon { display: block; }.map-legend { font-size: 9px; }.map-legend span:nth-child(4) { display: none; }.menu-heading h1 { font-size: 36px; } }

/* Полноэкранная карта: управление живёт поверх неё и не отнимает рабочее поле. */
.app-shell { height: 100svh; }
.workspace { height: 100svh; min-height: 0; }
.map-stage { position: fixed; inset: 0; height: 100svh; }
.map-canvas { height: 100svh; min-height: 0; }
.left-rail { top: 82px; bottom: auto; left: 16px; width: 222px; max-height: calc(100svh - 136px); padding: 10px; gap: 10px; border-radius: 13px; }
.side-card { padding: 11px; }
.phase-row strong { font-size: 19px; }
.map-toolbar { top: 84px; left: 258px; right: 24px; }
.map-legend { left: 258px; bottom: 52px; }
.right-panel { top: 82px; right: 16px; bottom: 52px; width: min(340px, calc(100vw - 270px)); max-height: none; opacity: 0; visibility: hidden; transform: translateX(24px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.app-shell.panel-open .right-panel { opacity: 1; visibility: visible; transform: translateX(0); }
.panel-close { position: absolute; z-index: 2; top: 11px; right: 11px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-strong); background: var(--ink-850); font-size: 20px; line-height: 1; }
.panel-close:hover { border-color: var(--teal-deep); color: var(--teal); }
.right-panel .panel-view { padding-top: 12px; }

@media (max-width: 900px) and (min-width: 701px) {
  .left-rail { left: 12px; width: 208px; }
  .map-toolbar { left: 238px; right: 18px; }
  .map-legend { left: 238px; }
  .right-panel { right: 12px; width: min(310px, calc(100vw - 245px)); }
}

@media (max-width: 700px) {
  body { overflow: hidden; }
  .topbar { position: fixed; }
  .map-toolbar { top: 72px; left: 12px; right: 12px; }
  .map-toolbar h1 { margin-top: 3px; font-size: 18px; }
  .map-toolbar .section-kicker { font-size: 8px; }
  .map-tools { display: none; }
  .left-rail { position: fixed; z-index: 850; top: auto; right: 10px; bottom: 48px; left: 10px; width: auto; max-height: none; margin: 0; padding: 7px; display: block; border-radius: 13px; }
  .phase-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; }
  .phase-card .section-kicker, .phase-card .progress-track, .phase-meta { display: none; }
  .phase-row { min-width: 62px; gap: 5px; margin: 0; }
  .phase-row strong { font-size: 16px; }
  .phase-row [data-i18n="phase.live"], .live-dot { display: none; }
  .phase-card .primary-button { min-height: 36px; grid-column: 3; width: auto; min-width: 128px; }
  .side-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
  .nav-item { min-height: 38px; justify-content: center; gap: 3px; padding: 0 4px; font-size: 0; }
  .nav-icon { display: block; width: auto; font-size: 18px; }
  .nav-item b { min-width: 0; margin-left: 0; font-size: 9px; }
  .insight-card, .rail-footer { display: none; }
  .map-legend { left: 10px; right: 10px; bottom: 160px; max-width: calc(100vw - 20px); padding: 7px 9px; gap: 7px; font-size: 9px; }
  .event-bar { position: fixed; z-index: 900; min-height: 40px; padding: 0 10px; }
  .right-panel { position: fixed; z-index: 880; top: auto; right: 10px; bottom: 112px; left: 10px; width: auto; max-height: calc(100svh - 190px); margin: 0; padding: 15px; overflow: auto; border-radius: 14px; transform: translateY(18px); }
  .app-shell.panel-open .right-panel { transform: translateY(0); }
  .right-panel .panel-view { padding-top: 14px; }
}

@media (max-width: 430px) {
  .phase-card .primary-button { min-width: 112px; padding: 0 9px; }
  .map-legend { bottom: 164px; }
}

/* Карта — главный экран. На компьютере управление свёрнуто в узкую панель-рейл. */
@media (min-width: 701px) {
  .topbar {
    top: 14px;
    right: auto;
    left: 14px;
    min-height: 44px;
    width: auto;
    padding: 6px 8px;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 16, 24, .78);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-lockup .brand-caption, .company-strip, .cash-block { display: none; }
  .brand-name { font-size: 13px; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button { width: 32px; height: 32px; }

  .map-toolbar {
    top: 18px;
    left: 224px;
    right: 18px;
  }
  .map-toolbar .section-kicker { font-size: 8px; }
  .map-toolbar h1 { margin-top: 2px; font-size: 19px; }
  .map-legend { left: 96px; bottom: 52px; }

  .left-rail {
    top: 76px;
    bottom: 52px;
    left: 14px;
    width: 64px;
    max-height: none;
    padding: 7px;
    gap: 8px;
    overflow-x: hidden;
    transition: width .2s ease, box-shadow .2s ease;
  }
  .left-rail:hover, .left-rail:focus-within {
    width: 220px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  }
  .phase-card {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 8px 5px;
  }
  .phase-card .section-kicker, .phase-card .progress-track, .phase-meta,
  .insight-card, .rail-footer { display: none; }
  .phase-row { display: block; margin: 0; text-align: center; }
  .phase-row strong { display: block; font-size: 15px; white-space: nowrap; }
  .phase-row .live-dot, .phase-row [data-i18n="phase.live"] { display: none; }
  .phase-card .primary-button {
    width: 36px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
  }
  .phase-card .primary-button span { display: none; }
  .phase-card .primary-button b { font-size: 17px; }
  .side-nav { gap: 4px; }
  .nav-item {
    min-height: 40px;
    justify-content: center;
    gap: 8px;
    padding: 0;
  }
  .nav-item > span[data-i18n] { display: none; }
  .nav-item b { display: none; }
  .nav-icon { width: auto; font-size: 19px; }
  .left-rail:hover .phase-card { display: block; padding: 11px; }
  .left-rail:hover .phase-row { display: flex; margin: 9px 0 12px; text-align: left; }
  .left-rail:hover .phase-row strong { font-size: 19px; }
  .left-rail:hover .phase-row .live-dot,
  .left-rail:hover .phase-row [data-i18n="phase.live"] { display: inline; }
  .left-rail:hover .phase-card .progress-track,
  .left-rail:hover .phase-meta { display: flex; }
  .left-rail:hover .phase-card .primary-button { width: 100%; min-height: 42px; padding: 0 13px; }
  .left-rail:hover .phase-card .primary-button span { display: inline; }
  .left-rail:hover .nav-item { justify-content: flex-start; padding: 0 10px; }
  .left-rail:hover .nav-item > span[data-i18n],
  .left-rail:hover .nav-item b { display: inline; }
  .left-rail:hover .nav-item b { margin-left: auto; }
  .left-rail:hover .nav-icon { width: 17px; }

  .right-panel {
    top: 76px;
    right: 14px;
    bottom: 52px;
    width: 320px;
  }
}

@media (max-width: 700px) {
  .topbar {
    top: 9px;
    right: 9px;
    left: 9px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
  }
  .map-toolbar { top: 62px; }
  .map-legend { bottom: 160px; }
}

/* На телефоне рабочая панель остаётся компактной: карта всегда видна вокруг неё. */
@media (max-width: 700px) {
  .right-panel {
    right: 14px;
    bottom: 122px;
    left: 14px;
    max-height: min(360px, 44svh);
    padding: 12px;
    border-color: rgba(255, 255, 255, .2);
    background: rgba(11, 23, 32, .78);
  }
  .right-panel .panel-view {
    min-height: 0;
  }
  .panel-heading {
    margin-bottom: 10px;
  }
  .panel-heading h2 {
    font-size: 18px;
  }
  .right-panel .tip-box,
  .right-panel .unlock-card {
    display: none;
  }
}

@media (max-width: 430px) {
  .right-panel {
    bottom: 118px;
    max-height: 40svh;
  }
}

/* Стартовая анкета компании и компактная логистическая панель. */
.setup-form { display: grid; gap: 9px; }
.setup-form h2 { margin: 5px 0 0; font: 700 26px var(--font-display); }
.setup-form p { margin: 0 0 7px; color: var(--muted-strong); font-size: 12px; line-height: 1.45; }
.setup-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 6px; }
.setup-actions .secondary-button { justify-content: center; padding: 0 14px; }
.setup-actions .primary-button { width: 100%; }
.fleet-list { display: grid; gap: 7px; margin-bottom: 12px; }
.fleet-card { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(20, 39, 51, .42); }
.vehicle-symbol { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--teal); background: rgba(53, 208, 127, .12); font-size: 16px; }
.vehicle-symbol.truck { color: var(--amber); background: rgba(239, 83, 80, .12); }
.vehicle-status { padding: 4px 5px; border-radius: 5px; color: var(--teal); background: rgba(53, 208, 127, .1); font-size: 8px; font-weight: 800; }
.vehicle-status.busy { color: var(--amber); background: rgba(239, 83, 80, .1); }
.fleet-form { padding-top: 10px; border-top: 1px solid var(--line); }
.dispatch-form { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-divider { color: var(--muted-strong); font: 700 13px var(--font-display); }
.fleet-empty { padding: 16px 8px 9px; }
.fleet-empty .empty-icon { margin-bottom: 4px; }
.fleet-empty p { margin-bottom: 0; }

/* События живут сверху и не перекрывают игровое поле. */
.event-bar { top: 64px; bottom: auto; right: 18px; left: auto; width: min(540px, calc(100vw - 36px)); min-height: 30px; padding: 0 10px; gap: 10px; border: 1px solid var(--line); border-radius: 8px; }
.event-label { min-width: 96px; font-size: 8px; }
.event-feed { font-size: 9px; }
.event-actions { display: none; }

/* Города заметны даже на пустой карте. */
.city-pin { gap: 7px; padding: 3px 6px 3px 3px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 7px; background: rgba(7, 16, 24, .9); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.city-pin i { width: 16px; height: 16px; border-width: 3px; box-shadow: 0 0 0 4px rgba(53, 208, 127, .24), 0 0 14px rgba(53, 208, 127, .62); }
.city-pin b { color: var(--paper); font-size: 11px; font-weight: 800; }
.city-pin-wrap { z-index: 20 !important; }

@media (max-width: 700px) {
  .event-bar { top: 55px; right: 10px; left: 10px; width: auto; min-height: 27px; padding: 0 8px; border-radius: 7px; }
  .event-label { min-width: 72px; font-size: 7px; }
  .event-feed { font-size: 8px; }
  .map-toolbar { top: 91px; }
  .side-nav { grid-template-columns: repeat(5, 1fr); }
  .nav-item { min-width: 0; }
}

@media (max-width: 430px) {
  .side-nav { grid-template-columns: repeat(5, 1fr); }
  .nav-item { padding: 0 2px; }
  .nav-icon { font-size: 16px; }
  .nav-item b { display: none; }
  .city-pin b { font-size: 10px; }
}

/* Красные городские ориентиры и живой слой рейсов поверх карты. */
.city-pin i {
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 24%, transparent), 0 0 16px color-mix(in srgb, var(--amber) 72%, transparent);
}
.legend-dot.city { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent); }
.traffic-hud {
  position: absolute;
  z-index: 650;
  top: 122px;
  left: 258px;
  width: min(330px, calc(100vw - 540px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 16, 24, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.traffic-hud-heading { display: flex; align-items: center; gap: 7px; color: var(--paper); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.traffic-hud-caption { margin-left: auto; color: var(--muted); font-size: 8px; letter-spacing: 0; text-transform: none; }
.traffic-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent); }
.traffic-list { display: grid; gap: 5px; margin-top: 7px; max-height: 112px; overflow: auto; }
.traffic-card { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px; min-height: 38px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: rgba(20, 39, 51, .58); }
.traffic-card-icon { position: relative; width: 24px; height: 14px; border: 2px solid var(--teal); border-radius: 3px; background: var(--ink-950); }
.traffic-card-icon.truck { border-color: var(--amber); }
.traffic-card-icon::before { position: absolute; right: -5px; bottom: -2px; width: 7px; height: 8px; border: 2px solid currentColor; border-left: 0; border-radius: 0 3px 3px 0; content: ""; }
.traffic-card-main { min-width: 0; }
.traffic-card-main strong, .traffic-card-main span, .traffic-card-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-card-main strong { color: var(--paper); font-size: 10px; }
.traffic-card-main span { margin-top: 2px; color: var(--muted-strong); font-size: 9px; }
.traffic-card-main small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.traffic-card > b { color: var(--teal); font-size: 7px; letter-spacing: .04em; text-align: right; }
.traffic-card > b.traffic-stop { color: var(--amber); }
.traffic-vehicle-wrap { border: 0; background: transparent; }
.traffic-vehicle { position: relative; display: block; width: 36px; height: 19px; border: 2px solid var(--teal); border-radius: 4px; color: var(--teal); background: var(--ink-950); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent), 0 3px 8px rgba(0, 0, 0, .55); transform: rotate(var(--vehicle-heading, 0deg)); transform-origin: 50% 50%; transition: opacity .2s ease, filter .2s ease; }
.traffic-vehicle.truck { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent), 0 3px 8px rgba(0, 0, 0, .55); }
.traffic-vehicle.is-stopped { opacity: .72; filter: saturate(.65); }
.traffic-cab { position: absolute; right: -7px; bottom: -2px; width: 9px; height: 13px; border: 2px solid currentColor; border-left: 0; border-radius: 0 3px 3px 0; color: inherit; }
.traffic-wheel { position: absolute; bottom: -6px; width: 7px; height: 7px; border: 2px solid var(--paper); border-radius: 50%; background: var(--ink-950); }
.traffic-wheel.one { left: 5px; }.traffic-wheel.two { right: 4px; }

/* Точки строительства, расширенная палитра и редактор логотипа. */
.color-picker { flex-wrap: wrap; }
.color-swatch.blue { background: var(--blue); }
.color-swatch.violet { background: var(--violet); }
.color-swatch.orange { background: var(--orange); }
.color-swatch.yellow { background: var(--yellow); }
.color-swatch.selected { box-shadow: inset 0 0 0 4px var(--ink-850), 0 0 0 2px var(--paper); }
.color-hint { color: var(--muted); font-size: 9px; }
.location-picker-button { min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border: 1px dashed var(--teal); border-radius: 8px; color: var(--muted-strong); background: rgba(53, 208, 127, .08); font-size: 11px; text-align: left; }
.location-picker-button:hover, .location-picker-button.active { color: var(--paper); background: rgba(53, 208, 127, .16); }
.location-picker-button b { color: var(--teal); font-size: 20px; }
.location-value { min-height: 18px; color: var(--muted); font-size: 10px; }
.logo-editor { display: grid; gap: 7px; margin-top: 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.logo-workspace { position: relative; overflow: hidden; min-height: 92px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 24, .75); }
#logoCanvas, #logoPreview { display: block; width: 100%; height: 92px; object-fit: contain; touch-action: none; }
#logoCanvas { cursor: crosshair; }
#logoPreview { position: absolute; inset: 0; }
.logo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.upload-button, .logo-actions .secondary-button { min-height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-strong); background: var(--ink-850); font-size: 10px; font-weight: 700; text-align: center; }
.upload-button:hover, .logo-actions .secondary-button:hover { border-color: var(--teal); color: var(--paper); }
.upload-button input { display: none; }
.logo-hint { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.company-avatar { overflow: hidden; }
.company-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.city-pin { width: 148px; height: 28px; }
.city-pin b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) and (min-width: 701px) {
  .traffic-hud { left: 238px; width: min(300px, calc(100vw - 490px)); }
}
@media (max-width: 700px) {
  .traffic-hud { top: 123px; right: 10px; left: 10px; width: auto; padding: 6px; }
  .traffic-list { max-height: 78px; }
  .traffic-card { min-height: 34px; }
  .traffic-hud-caption { display: none; }
}
