@font-face {
  font-family: Golos;
  src: url("../fonts/golos-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: Golos;
  src: url("../fonts/golos-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20A0-20CF,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --ink: #19221b;
  --muted: #5a655a;
  --pine: #15372a;
  --green: #26674c;
  --lime: #d9f054;
  --surface: #f4f6f0;
  --line: #e1e7de;
  --amber: #976324;
  --radius: 15px;
  color: var(--ink);
  background: #f5f6f2;
  font: 400 14px/1.45 Golos, system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #3b7450; outline-offset: 3px; }
.icon { display: block; width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { position: fixed; inset: 10px auto auto 10px; z-index: 1200; padding: 10px 16px; border-radius: 8px; background: #fff; }
.header-inner, .content { width: min(1640px, calc(100% - 64px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner, .identity, .store-link { display: flex; align-items: center; }
.header-inner { min-height: 66px; justify-content: space-between; gap: 12px; }
.identity { gap: 18px; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-size: 28px; line-height: 1; font-weight: 820; letter-spacing: -.07em; white-space: nowrap; }
.wordmark span { margin-left: 4px; padding: 4px 5px 4px 3px; border-radius: 6px; background: var(--lime); font-size: .76em; }
.panel-name { padding-left: 18px; border-left: 1px solid var(--line); color: #465548; font-weight: 570; }
.store-link { min-height: 44px; gap: 6px; color: #465548; font-weight: 570; white-space: nowrap; }
.store-link .icon { width: 15px; height: 15px; }
.store-link:hover, .text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }

.content { padding-bottom: 24px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 13px; padding-block: 25px 20px; }
.page-heading h1 { font-size: clamp(28px, 3vw, 41px); line-height: 1.08; letter-spacing: -.055em; font-weight: 740; }
.page-heading p { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 13px; }
.page-heading .icon { width: 15px; height: 15px; }
.demo-note { padding-block: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(286px, 318px) minmax(280px, 1fr) minmax(282px, 326px); align-items: stretch; gap: 14px; height: max(650px, calc(100dvh - 190px)); }
.panel, .map-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel { display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px 10px; min-height: 55px; }
.panel-head h2 { font-size: 20px; font-weight: 710; letter-spacing: -.035em; line-height: 1.1; }
.order-tools { padding: 0 14px 11px; border-bottom: 1px solid var(--line); }
.order-search { position: relative; }
.order-search .icon { position: absolute; top: 12px; left: 10px; color: #647164; pointer-events: none; width: 16px; height: 16px; }
.order-search input { width: 100%; min-height: 40px; padding: 0 9px 0 33px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.order-search input::placeholder { color: #606c60; }
.order-search input:focus-visible { outline-offset: -2px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.filter { display: inline-flex; flex: 1 1 auto; justify-content: center; align-items: center; gap: 4px; padding: 0 6px; min-height: 34px; white-space: nowrap; border: 0; border-radius: 7px; background: transparent; color: #526054; font-size: 11px; font-weight: 600; }
.filter:hover { background: var(--surface); }
.filter[aria-pressed="true"] { background: #e8f0df; color: #234832; }
.filter span { font-variant-numeric: tabular-nums; color: inherit; }
.orders-scroll, .route-content, .trip-history { min-height: 0; overflow: auto; }
.orders-scroll, .route-content, .trip-history { flex: 1; }
.order-list, .stops, .suggestion-list, .trip-list { margin: 0; padding: 0; list-style: none; }
.order-row { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; min-height: 81px; padding: 11px 12px 11px 14px; border-bottom: 1px solid #eef0eb; }
.order-row:hover { background: #f7f9f5; }
.order-row.is-selected { background: #f0f6e9; }
.order-row.is-selected::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #7aa17a; content: ""; }
.order-check { display: grid; width: 26px; height: 36px; place-items: start center; padding-top: 4px; cursor: pointer; }
.order-check input { accent-color: var(--green); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.order-row-info { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.order-meta, .order-window, .orders-foot { display: flex; align-items: center; gap: 6px; }
.order-meta { justify-content: space-between; min-height: 22px; }
.order-id { color: var(--pine); font-weight: 700; font-size: 13px; white-space: nowrap; }
.order-address { display: block; margin-top: 2px; font-weight: 590; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.order-window { color: var(--muted); font-size: 11px; margin-top: 4px; }
.order-window .icon { width: 13px; height: 13px; }
.order-district { color: #667367; font-size: 11px; }
.order-status-icon { display: grid; place-items: center; align-self: start; width: 25px; height: 26px; color: #4b6c56; }
.order-status-icon .icon { width: 15px; height: 15px; }
.orders-foot { justify-content: space-between; min-height: 47px; padding: 5px 14px; border-top: 1px solid var(--line); color: #425144; font-size: 12px; }
.text-button { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #376348; font-size: 12px; font-weight: 650; }
.empty-message { color: var(--muted); font-size: 12px; }
.orders-scroll > .empty-message, .trip-history > .empty-message { padding: 14px 16px; }

.map-panel { position: relative; overflow: hidden; background: #e8ece0; isolation: isolate; }
.delivery-map { position: absolute; inset: 0; background: #e8ece0; z-index: 0; font-family: inherit; }
.map-top { position: absolute; z-index: 500; top: 12px; right: 12px; display: grid; gap: 8px; }
.map-control { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #d9e1d6; border-radius: 8px; background: #fff; color: var(--pine); }
.map-control .icon { width: 18px; height: 18px; }
.map-control:hover { background: #f1f6ed; }
.map-control:focus-visible { outline-offset: -2px; }
.map-zoom .map-control:first-child { border-radius: 8px 8px 0 0; }
.map-zoom .map-control:last-child { margin-top: -1px; border-radius: 0 0 8px 8px; }
.map-legend { position: absolute; left: 12px; bottom: 15px; z-index: 450; display: flex; gap: 12px; padding: 8px 10px; border: 1px solid #dfe5da; border-radius: 7px; background: #fff; color: #455347; font-size: 11px; pointer-events: none; }
.map-legend > span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-route { background: #226345; }
.legend-ready { background: #d98e44; }
.legend-history { background: #617585; }
.map-credit { position: absolute; z-index: 450; right: 0; bottom: 0; padding: 2px 5px; border-radius: 4px 0 0; background: #fffffff0; color: #405746; font-size: 10px; }
.map-credit a { text-decoration: underline; }
.map-error { position: absolute; inset: 45% 15px auto; text-align: center; }
.map-marker { display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #276448; color: #fff; box-shadow: 0 1px 5px #203a3558; font-weight: 730; font-size: 13px; }
.map-marker.ready { border-color: #fff; background: #e7ad68; color: #412912; }
.map-marker.ready .icon { width: 15px; height: 15px; }
.map-marker.origin, .map-marker.destination { border-radius: 9px; background: var(--pine); color: #fff; font-size: 13px; }
.map-marker.destination { background: #d9f054; color: #243920; }
.map-marker.delivered, .map-marker.enroute { background: #617585; color: #fff; }
.map-label { width: 144px !important; margin-left: -72px !important; color: #5e715d; text-align: center; font-weight: 650; font-size: 12px; text-shadow: 0 1px #fff, 1px 0 #fff; letter-spacing: .015em; white-space: nowrap; }
.map-label.water { color: #477d94; font-size: 11px; font-style: italic; }
.map-label.street { color: #727671; font-weight: 520; font-size: 10px; }
.leaflet-popup-content { margin: 12px 15px; font-family: Golos, system-ui, sans-serif; }
.leaflet-popup-content p { margin: 4px 0; }
.leaflet-popup-content button { margin-top: 6px; }

.route-head { border-bottom: 1px solid #edf0e9; }
#trip-count { margin-left: 2px; color: var(--muted); }
.direction { position: relative; padding: 9px 48px 8px 14px; border-bottom: 1px solid var(--line); }
.direction::before { position: absolute; top: 29px; bottom: 31px; left: 20px; border-left: 1px dashed #9eac9d; content: ""; }
.direction-field { display: flex; align-items: center; gap: 9px; min-height: 51px; }
.direction-field > div { flex: 1; min-width: 0; }
.direction-field label { display: block; color: var(--muted); font-size: 11px; }
.direction-field select { width: 100%; min-height: 29px; padding: 0 3px 0 0; border: 0; border-radius: 4px; background: transparent; font-size: 13px; font-weight: 650; }
.direction-field select:focus-visible { outline-offset: 1px; }
.direction-dot { position: relative; flex: 0 0 13px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid #42684c; }
.direction-dot.destination { border-color: #6d7f39; background: var(--lime); }
.icon-button { display: grid; flex: none; place-items: center; width: 28px; height: 31px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #496351; }
.icon-button:not(:disabled):hover { background: #e9f1e5; color: var(--pine); }
.icon-button .icon { width: 15px; height: 15px; }
.reverse { position: absolute; top: 50%; right: 10px; width: 35px; height: 35px; border: 1px solid var(--line); transform: translateY(-50%); }
.reverse .icon { width: 18px; height: 18px; }
.route-section { padding: 13px 14px; }
.route-section + .route-section { border-top: 1px solid var(--line); }
.route-section h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 14px; font-weight: 720; }
.route-section h3 span { color: #55705c; font-size: 12px; }
.stop-row, .suggestion-row { display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; padding: 6px 0; }
.stop-row + .stop-row, .suggestion-row + .suggestion-row { border-top: 1px solid #edf0ec; }
.stop-num { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #e6f0e1; color: #24543b; font-weight: 680; font-size: 12px; }
.stop-title, .suggestion-title { padding: 0; border: 0; background: transparent; color: #2b4433; text-align: left; font-weight: 660; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.stop-title:hover, .suggestion-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.stop-label, .suggestion-label { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.stop-actions { display: flex; }
.stop-actions .icon-button { width: 22px; }
.stop-actions .icon { width: 13px; }
.suggestion-row { grid-template-columns: minmax(0, 1fr) auto; }
.detour { color: #356747; font-weight: 650; }
.suggestion-row .icon-button { width: 33px; height: 33px; border: 1px solid #dfe9da; background: #f1f7ec; }
.route-foot { padding: 10px 14px 13px; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.route-metrics { display: flex; align-items: center; gap: 13px; min-height: 32px; margin-bottom: 7px; color: #355642; font-size: 12px; }
.route-metrics span { display: inline-flex; align-items: center; gap: 4px; }
.route-metrics .icon { width: 16px; height: 16px; }
.route-metrics strong { color: var(--pine); font-size: 14px; font-weight: 700; white-space: nowrap; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--pine); color: #fff; font-weight: 660; }
.primary-button:not(:disabled):hover { background: #244a38; }
.primary-button .icon { width: 17px; height: 17px; }
.trip-list { padding: 0 14px; }
.trip-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.trip-row-table { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.trip-name { font-size: 13px; font-weight: 700; }
.trip-progress { color: #2f6547; font-size: 11px; text-align: right; }
.trip-address { color: var(--muted); font-size: 12px; }
.trip-order-numbers { color: var(--muted); font-size: 11px; margin-top: 5px; }
.trip-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.trip-actions button[aria-pressed="true"] { color: var(--ink); }

.order-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.order-dialog::backdrop { background: #11271d65; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 21px; letter-spacing: -.03em; }
.dialog-heading .icon-button { width: 38px; height: 38px; }
.dialog-heading .icon { width: 18px; height: 18px; }
#order-detail { padding: 15px 16px 16px; }
.order-detail-data { display: grid; gap: 8px; margin: 0 0 15px; }
.order-detail-data > div { display: grid; grid-template-columns: minmax(90px, .6fr) 1fr; gap: 10px; }
.order-detail-data dt { color: var(--muted); }
.order-detail-data dd { margin: 0; }
.order-detail-actions { display: grid; gap: 8px; }
.order-detail-actions .text-button { justify-content: center; }
.notice { position: fixed; right: max(12px, calc((100vw - 1640px)/2)); bottom: 14px; z-index: 950; max-width: calc(100% - 24px); padding: 10px 14px; border-radius: 8px; background: var(--pine); color: #fff; }
.notice:empty { display: none; }

@media (max-width: 1190px) {
  .header-inner, .content { width: calc(100% - 32px); }
  .workspace { grid-template-columns: minmax(245px, 274px) minmax(240px, 1fr) minmax(252px, 279px); gap: 9px; }
  .filter { font-size: 10px; }
}

@media (max-width: 870px) {
  .workspace { height: auto; grid-template-columns: minmax(250px, .82fr) minmax(0, 1fr); }
  .orders, .route-panel { max-height: 645px; }
  .map-panel { grid-column: 2; grid-row: 1 / span 2; min-height: 570px; align-self: start; position: sticky; top: 8px; }
  .route-panel { grid-column: 1; }
  .filter { font-size: 11px; }
}

@media (max-width: 570px) {
  .header-inner, .content { width: calc(100% - 24px); }
  .header-inner { min-height: 55px; }
  .identity { gap: 8px; }
  .wordmark { font-size: 22px; }
  .panel-name { padding-left: 8px; font-size: 10px; }
  .store-link { font-size: 11px; }
  .store-link .icon { display: none; }
  .page-heading { align-items: start; flex-direction: column; gap: 3px; padding-block: 18px 13px; }
  .demo-note { font-size: 11px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; }
  .map-panel { position: relative; inset: auto; order: -1; width: 100%; min-height: 345px; }
  .orders-scroll { max-height: 314px; }
  .filter, .text-button { min-height: 40px; }
  .icon-button { min-height: 36px; }
  .orders, .route-panel { max-height: none; }
  .route-content, .trip-history { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
