/* Local variable fonts; licenses are shipped in /static/fonts/. */
@font-face {
  font-family: "Golos Text";
  src: url("/static/fonts/golos-text-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

/* ============ QOSYU брендбук ============ */
:root {
  --wine: #990011;
  --wine-dark: #6E000C;
  --cream: #FCF6F5;
  --blush: #FBEEEE;
  --ink: #262223;
  --muted: #706A6B;
  --green: #1E7B3C;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 10px 30px -18px rgba(110, 0, 12, 0.35);
  --serif: var(--sans);
  --brand-font: "Manrope", "Golos Text", sans-serif;
  --sans: "Golos Text", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  font-size: 17px;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
img { max-width: 100%; }
a { color: var(--wine); text-decoration: none; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--wine); border-radius: 8px; }

/* ============ Кнопки ============ */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.72rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-wine { background: var(--wine); color: var(--cream); }
.btn-wine:hover { background: var(--wine-dark); }
.btn-outline { background: transparent; color: var(--wine); border-color: var(--wine); }
.btn-outline:hover { background: var(--blush); }
.btn-cream { background: var(--cream); color: var(--wine-dark); }
.btn-cream:hover { background: var(--white); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.88rem; }

/* ============ Шапка ============ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(252, 246, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(153, 0, 17, 0.12);
}
.header-inner {
  max-width: 1160px; margin: 0 auto; padding: 0.65rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.main-nav { display: flex; gap: 1.3rem; margin-left: auto; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--wine); }
.header-right { display: flex; align-items: center; gap: 0.9rem; }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.header-user { font-size: 0.92rem; color: var(--muted); }
.header-user strong { color: var(--ink); }

/* Переключатель языка */
.lang-switch { display: flex; border: 1px solid rgba(153, 0, 17, 0.25); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700; color: var(--muted);
  padding: 0.3rem 0.6rem; transition: background 0.15s, color 0.15s;
}
.lang-switch button:hover { color: var(--wine); }
.lang-switch button.lang-active { background: var(--wine); color: var(--cream); }

/* Гамбургер */
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; margin-left: auto; }
.nav-toggle span { width: 22px; height: 2px; background: var(--wine); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ Секции ============ */
.section { max-width: 1160px; margin: 0 auto; padding: 4.2rem 1.25rem; }
.section-blush { max-width: none; background: var(--blush); }
.section-blush > * { max-width: 1160px; margin-left: auto; margin-right: auto; }
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem); text-align: center;
  color: var(--wine-dark); margin-bottom: 0.9rem;
}
.section-sub { text-align: center; color: var(--muted); max-width: 760px; margin: 0 auto 2.4rem; }

/* Карточки */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card {
  background: var(--blush);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.section-blush .card { background: var(--white); }
.card h3 { color: var(--wine-dark); font-size: 1.15rem; margin: 0.9rem 0 0.4rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.num-circle {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--wine); color: var(--cream);
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
}

.note-plate {
  max-width: 860px; margin: 2rem auto 0;
  background: var(--blush); border-radius: var(--radius);
  padding: 1.2rem 1.6rem; color: var(--wine-dark); font-size: 0.98rem;
  text-align: center;
}
.section-blush .note-plate { background: var(--white); }

.check-list { list-style: none; }
.check-list li {
  position: relative; padding-left: 1.7rem; margin-bottom: 0.65rem;
  color: var(--muted); font-size: 0.97rem;
}
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--wine); font-weight: 700;
}

/* Автор проекта */
.project-author { padding-block: 2.8rem; }
.project-author .section-title { margin-bottom: 1rem; }
.author-credit { max-width: 820px; margin: 0 auto; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }

/* Финал */
.final-band {
  background: linear-gradient(160deg, var(--wine) 0%, var(--wine-dark) 100%);
  color: var(--cream); text-align: center; padding: 5rem 1.25rem;
}
.final-band h2 { font-size: clamp(1.5rem, 3.2vw, 2.4rem); max-width: 860px; margin: 0 auto 1.2rem; }

/* Футер */
.site-footer {
  background: var(--cream); text-align: center;
  padding: 2rem 1.25rem; font-size: 0.82rem; color: var(--muted);
  border-top: 1px solid rgba(153, 0, 17, 0.1);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; margin-bottom: 0.7rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--wine); }
.footer-contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; margin-bottom: .7rem; }
.footer-contacts a { color: var(--muted); }
.footer-contacts a:hover { color: var(--wine); }
.footer-community { max-width: 640px; margin: 0 auto 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid rgba(153, 0, 17, 0.1); }
.footer-note { color: var(--ink); font-size: .9rem; line-height: 1.5; margin-bottom: .75rem; }
.footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.footer-social a {
  display: inline-block; min-height: 36px; padding: .5rem .85rem; line-height: 1.35;
  border: 1px solid rgba(153, 0, 17, 0.15); border-radius: 18px; background: var(--white);
  color: var(--muted); overflow-wrap: anywhere;
}
.footer-social a span { color: var(--ink); font-weight: 600; }
.footer-social a:hover, .footer-social a:focus-visible { color: var(--wine); border-color: var(--wine); }
.pilot-section .public-contacts { margin-top: 1.5rem; }
.demo-options { display: grid; gap: .65rem; margin-bottom: 1rem; }
.pilot-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.recycler-filter-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.legal-page .policy-text { max-height: none; overflow: visible; }

/* ============ Кабинет ============ */
#cabinetPage { min-height: calc(100vh - 62px); display: flex; flex-direction: column; background: var(--cream); }
.cabinet-tabs {
  display: flex; gap: 0.4rem; padding: 0.6rem 1.25rem 0;
  background: var(--white); border-bottom: 1px solid rgba(153, 0, 17, 0.12);
  overflow-x: auto;
}
.tab-btn {
  border: none; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--muted);
  padding: 0.7rem 1.1rem; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab-btn:hover { color: var(--wine); }
.tab-active { color: var(--wine); border-bottom-color: var(--wine); }
.badge {
  background: var(--wine); color: var(--cream); border-radius: 999px;
  font-size: 0.7rem; padding: 0.05rem 0.45rem; margin-left: 0.2rem;
}

.tab-pane { flex: 1; display: flex; min-height: 0; }
.cabinet-side {
  width: 360px; flex: none; background: var(--white);
  border-right: 1px solid rgba(153, 0, 17, 0.1);
  padding: 1.1rem; overflow-y: auto;
}
.cabinet-map-wrap { flex: 1; position: relative; min-height: 420px; }
#pane-map { height: calc(100dvh - 116px); min-height: 420px; flex: none; }
#cabinetMap { position: absolute; inset: 0; }

.side-card {
  background: var(--blush); border-radius: var(--radius); padding: 1rem 1.2rem;
  margin-bottom: 1rem; font-size: 0.95rem;
}
.side-stack { display: flex; flex-direction: column; gap: 0.8rem; }
.side-block { background: var(--blush); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.side-block h3 { font-size: 1.02rem; color: var(--wine-dark); margin-bottom: 0.7rem; }
.side-block label { display: block; font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0.2rem; }
.field {
  width: 100%; padding: 0.55rem 0.7rem; font-family: var(--sans); font-size: 0.95rem;
  border: 1px solid rgba(112, 106, 107, 0.4); border-radius: 9px; background: var(--white);
  color: var(--ink);
}
.field:focus { outline: 2px solid rgba(153, 0, 17, 0.35); border-color: var(--wine); }
.side-block .btn { width: 100%; margin-top: 0.8rem; }
.role-chip {
  display: inline-block; background: var(--wine); color: var(--cream);
  border-radius: 999px; font-size: 0.72rem; padding: 0.1rem 0.6rem; margin-left: 0.4rem;
}
.list-item {
  background: var(--white); border: 1px solid rgba(153, 0, 17, 0.1);
  border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.9rem;
  display: flex; justify-content: space-between; align-items: center; gap: 0.7rem;
}
.cabinet-side .list-item { background: var(--cream); }
.list-item .meta { color: var(--muted); font-size: 0.78rem; }
.status-chip { font-size: 0.75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.status-chip.ok { color: var(--green); }
.status-chip.warn { color: var(--wine); }

.pane-narrow { max-width: 760px; margin: 0 auto; padding: 1.6rem 1.25rem; width: 100%; }
.pane-wide { max-width: 1060px; margin: 0 auto; padding: 1.6rem 1.25rem; width: 100%; }
.pane-title { font-size: 1.25rem; color: var(--wine-dark); margin-bottom: 1rem; }
.pane-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pane-head-row .pane-title { margin-bottom: 0; }

/* Чат */
.chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  padding: 0.9rem 1.3rem; background: var(--white);
  border-bottom: 1px solid rgba(153, 0, 17, 0.1);
  font-weight: 700; color: var(--wine-dark); font-family: var(--serif);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; }
.chat-bubble {
  max-width: 72%; padding: 0.6rem 0.95rem; border-radius: 14px; font-size: 0.93rem;
  background: var(--white); border: 1px solid rgba(153, 0, 17, 0.08); align-self: flex-start;
  overflow-wrap: anywhere;
}
.chat-bubble.own { background: var(--wine); color: var(--cream); align-self: flex-end; }
.chat-bubble time { display: block; font-size: 0.68rem; opacity: 0.65; margin-top: 0.2rem; }
.chat-input-row {
  display: flex; gap: 0.6rem; padding: 0.8rem 1.2rem;
  background: var(--white); border-top: 1px solid rgba(153, 0, 17, 0.1);
}
.chat-input-row input { flex: 1; }
#chatInput { padding: 0.6rem 0.9rem; border: 1px solid rgba(112, 106, 107, 0.4); border-radius: 999px; font-family: var(--sans); font-size: 0.95rem; }
#chatInput:focus { outline: 2px solid rgba(153, 0, 17, 0.35); }

/* Маркетплейс */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.market-card {
  background: var(--white); border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.5rem;
}
.market-card .head { display: flex; justify-content: space-between; align-items: baseline; }
.market-card .type { font-family: var(--serif); font-weight: 700; color: var(--wine-dark); }
.market-card .price { color: var(--wine); font-weight: 700; }
.market-card .desc { color: var(--muted); font-size: 0.88rem; flex: 1; overflow-wrap: anywhere; }

/* ============ Модалки и тосты ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(38, 34, 35, 0.55);
  display: grid; place-items: center; z-index: 2000; padding: 1rem;
}
.modal-box {
  background: var(--white); border-radius: var(--radius); width: 100%;
  max-width: 430px; padding: 1.8rem; position: relative;
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 0.7rem; right: 0.9rem; border: none; background: none;
  font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--wine); }
.modal-box h3 { font-size: 1.3rem; color: var(--wine-dark); margin-bottom: 1.1rem; }
.modal-box label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0.7rem 0 0.2rem; }
.modal-box .btn { width: 100%; margin-top: 1.2rem; }
.modal-switch { display: block; text-align: center; margin-top: 0.9rem; font-size: 0.88rem; background: none; border: none; color: var(--wine); cursor: pointer; width: 100%; }
.form-error { color: var(--wine); font-size: 0.85rem; margin-top: 0.7rem; min-height: 1.1em; }
.policy-text { color: var(--muted); font-size: 0.92rem; max-height: 55vh; overflow-y: auto; }
.policy-text p { margin-bottom: 0.7rem; }
.policy-text ul { margin: 0 0 0.7rem 1.2rem; }
.policy-text li { margin-bottom: 0.45rem; }

.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 2100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--ink); color: var(--cream); border-radius: 10px;
  padding: 0.75rem 1.2rem; font-size: 0.92rem; box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
  max-width: 340px;
}
.toast.error { background: var(--wine-dark); }
.toast.success { background: var(--green); }
@keyframes toast-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Маркер на карте */
.route-stop, .route-depot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 0.85rem;
  color: var(--cream); background: var(--wine);
  border: 2px solid var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.route-depot { background: var(--green); font-size: 1rem; }

/* Панель маршрута поверх карты */
.route-panel {
  position: absolute; top: 12px; right: 12px; z-index: 500;
  width: 300px; max-height: calc(100% - 24px); overflow-y: auto;
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 12px 32px -10px rgba(38, 34, 35, 0.35);
  padding: 1rem;
}
.route-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.route-head strong { font-family: var(--serif); color: var(--wine-dark); }
.route-head button { border: none; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; line-height: 1; }
.route-head button:hover { color: var(--wine); }
.route-metrics { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.route-metrics div { flex: 1; background: var(--blush); border-radius: 9px; padding: 0.5rem; text-align: center; }
.route-metrics span { display: block; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.route-metrics b { font-family: var(--serif); color: var(--wine-dark); font-size: 1.05rem; }
.route-load { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: .25rem 0 .75rem; padding: .55rem .7rem; border: 1px solid #eceef1; border-radius: 9px; color: var(--muted); font-size: .8rem; }
.route-load strong { color: var(--ink); font-size: .9rem; }
.route-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.route-list li { font-size: 0.85rem; color: var(--ink); display: flex; gap: 0.5rem; align-items: center; }
.route-num {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--wine); color: var(--cream); font-size: 0.72rem; font-weight: 700;
  display: grid; place-items: center;
}
.route-src { margin-top: 0.6rem; text-align: right; }

.tg-code {
  background: var(--ink); color: var(--cream); font-family: var(--sans); font-variant-numeric: tabular-nums;
  padding: 0.7rem 1rem; border-radius: 9px; margin: 0.6rem 0; font-size: 1rem;
  user-select: all; text-align: center;
}

/* AI-помощник */
.assistant-wrap { display: flex; flex-direction: column; height: calc(100vh - 130px); }
.assistant-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.assistant-log {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--white); border: 1px solid rgba(153, 0, 17, 0.1);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 0.9rem;
}
.assistant-msg {
  max-width: 82%; padding: 0.65rem 1rem; border-radius: 14px; font-size: 0.95rem;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.assistant-msg.user { align-self: flex-end; background: var(--wine); color: var(--cream); }
.assistant-msg.bot { align-self: flex-start; background: var(--blush); color: var(--ink); }
.assistant-msg.typing { color: var(--muted); letter-spacing: 3px; }
.assistant-form { display: flex; gap: 0.6rem; }
.assistant-form input {
  flex: 1; padding: 0.65rem 1rem; border: 1px solid rgba(112, 106, 107, 0.4);
  border-radius: 999px; font-family: var(--sans); font-size: 0.95rem;
}
.assistant-form input:focus { outline: 2px solid rgba(153, 0, 17, 0.35); }
.assistant-form input:disabled { background: var(--blush); }
.assistant-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
#mapSearchForm button { margin: .6rem 0; }
#mapSearchResults { font-size: .8rem; }
.point-label { font-variant-numeric: tabular-nums; font-size: .85rem; margin: .65rem 0; }
.meta { color: var(--muted); font-size: .82rem; }
.zone-buttons { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.route-warning { margin: .6rem 0; padding: .7rem; background: #fff3d6; color: #674400; border-radius: 8px; font-size: .85rem; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }
button:disabled { cursor: wait; opacity: .55; }

/* Админ-панель */
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.4rem; }
.admin-tile { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; text-align: center; }
.tile-num { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--wine-dark); }
.tile-cap { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.admin-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.admin-chart-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.admin-chart-card h3 { font-size: 1rem; color: var(--wine-dark); margin-bottom: 0.9rem; }
.line-chart { width: 100%; height: auto; }
.bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 48px; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.bar-label { color: var(--ink); }
.bar-track { background: var(--blush); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--wine), var(--wine-dark)); border-radius: 6px; }
.bar-val { text-align: right; color: var(--muted); font-weight: 600; }
#adminInsights { margin-top: 0.2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============ Адаптив ============ */
@media (max-width: 940px) {
  #pane-map { height: auto; }
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--cream);
    border-bottom: 1px solid rgba(153, 0, 17, 0.15); padding: 0.5rem 1.25rem 1rem;
    box-shadow: 0 10px 20px -12px rgba(38, 34, 35, 0.3);
  }
  .main-nav.nav-open { display: flex; }
  .main-nav a { padding: 0.6rem 0; border-bottom: 1px solid rgba(153, 0, 17, 0.08); }
  .header-inner { flex-wrap: wrap; position: relative; }
  .admin-charts { grid-template-columns: 1fr; }
  .route-panel {
    position: absolute; top: auto; bottom: 8px; left: 8px; right: 8px;
    width: auto; max-height: 45%; margin: 0;
  }
  .cards-3 { grid-template-columns: 1fr; }
  .tab-pane { flex-direction: column; }
  .cabinet-side { width: 100%; border-right: none; border-bottom: 1px solid rgba(153, 0, 17, 0.1); max-height: 45vh; }
  .cabinet-map-wrap { height: 50vh; min-height: 360px; flex: none; }
}

/* Map workspace: restrained surfaces, stable map area, accessible stop cards. */
.landing-refresh { background: #fff; }
.landing-refresh h1, .landing-refresh h2, .landing-refresh h3 { font-family: var(--sans); letter-spacing: -.035em; }
.landing-refresh .section { padding-top: 72px; padding-bottom: 72px; }
.landing-refresh .section-title { color: #282b34; font-size: clamp(26px, 3vw, 36px); }
.landing-refresh .section-sub { max-width: 720px; color: #69707c; }
.landing-refresh .card { border: 1px solid #e8e9ed; border-radius: 18px; box-shadow: none; padding: 28px; background: #fff; }
.landing-refresh .card p { color: #69707c; font-size: 15px; }
.landing-refresh .section-blush { background: #f7f8fa; }
.landing-refresh .feature-number { display: inline-block; color: #990011; font-weight: 700; margin-bottom: 24px; }
.product-hero { max-width: 1200px; margin: auto; padding: 88px 32px 72px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: center; }
.product-eyebrow { color: #990011; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: 24px; }
.product-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: #fbf2f4; border: 1px solid #f0d9df; font-size: 12px; letter-spacing: .08em; line-height: 1.2;
}
.product-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #990011; flex: none; }
.product-intro h1 { white-space: pre-line; font-size: clamp(38px, 4.3vw, 62px); line-height: 1.07; color: #282b34; }
.product-sub { margin: 26px 0; color: #69707c; font-size: 18px; max-width: 550px; }
.product-caption { font-size: 12px; color: #747b87; margin-top: 20px; }
.product-scheme { background: #f4f5f7; padding: 32px; border: 1px solid #e8e9ed; border-radius: 24px; }
.product-scheme h2 { font-size: 20px; color: #363c48; }
.scheme-track { position: relative; display: grid; gap: 22px; padding: 30px 0 4px; }
.scheme-track:before { content: ""; position: absolute; left: 24px; top: 40px; bottom: 35px; border-left: 2px dashed #c6a2ab; }
.scheme-place { position: relative; display: flex; align-items: center; gap: 16px; border-radius: 14px; padding: 12px; background: #fff; border: 1px solid #e8e9ed; box-shadow: 0 6px 15px #26222308; }
.scheme-place span { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: #f8edf0; color: #990011; font-weight: 700; font-size: 14px; }
.scheme-place p { font-size: 14px; font-weight: 600; color: #444b58; }
.scheme-finish { margin-left: 32px; }
.scheme-symbol { width: 36px; height: 36px; object-fit: contain; flex: none; }
.pilot-section { text-align: center; }
.pilot-section .note-plate { max-width: 760px; margin: 24px auto; color: #69707c; background: #f7f8fa; border: 0; }
.landing-refresh .final-band h2 { color: white; }
@media (max-width: 760px) {
  .product-hero { grid-template-columns: 1fr; padding: 40px 20px 48px; gap: 32px; }
  .product-hero > * { min-width: 0; }
  .product-intro h1 { font-size: clamp(32px, 9vw, 40px); overflow-wrap: break-word; }
  .product-sub { font-size: 16px; margin: 20px 0 24px; }
  .product-intro .btn { width: 100%; text-align: center; }
  .product-scheme { padding: 24px; }
  .pilot-actions .btn { flex: 1 1 100%; }
  .landing-refresh .section { padding-top: 44px; padding-bottom: 44px; }
}
.map-sheet-toggle { display: none; }
.workspace { --cream: #f4f5f7; --blush: #f8f1f3; font-size: 15px; }
.workspace .site-header { position: relative; height: 64px; box-shadow: none; border-bottom: 1px solid #e8e9ed; }
.workspace .header-inner { max-width: none; height: 100%; padding: 0 24px; flex-wrap: nowrap; }
.workspace .header-right { margin-left: auto; }
.workspace #mainNav, .workspace #navToggle, .workspace [data-hdr="cabinet"] { display: none; }
.workspace .header-user { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace #cabinetPage { height: calc(100dvh - 64px); min-height: 0; }
.workspace .cabinet-tabs { padding: 6px 20px; gap: 6px; flex-shrink: 0; }
.workspace .tab-btn { border: 0; border-radius: 10px; padding: 9px 16px; font-size: 14px; }
.workspace .tab-active { background: #f8edf0; color: #8e1639; }
.workspace .tab-pane { overflow: auto; }
.workspace #pane-map { position: relative; height: auto; flex: 1; min-height: 0; overflow: hidden; }
.workspace #pane-map > .cabinet-side { width: 350px; padding: 18px; border-color: #e8e9ed; background: #fff; }
.workspace .cabinet-map-wrap { min-height: 0; height: auto; flex: 1; }
.workspace .side-card { background: transparent; padding: 0 0 14px; margin: 0; }
.workspace .role-chip { background: #f8edf0; color: #8e1639; }
.workspace .side-block { background: #fff; padding: 16px 0; border-top: 1px solid #eceef1; border-radius: 0; }
.workspace h2, .workspace h3, .workspace .route-head strong, .workspace .route-metrics b { font-family: var(--sans); }
.workspace .side-block h3 { color: #282b34; font-size: 16px; }
.workspace .btn { border-radius: 10px; font-size: 14px; }
.workspace .btn-outline { border: 1px solid #dedfe5; color: #3d414e; background: #fff; }
.workspace .btn-outline:hover { background: #f4f5f7; border-color: #a4a8b2; }
.workspace .field { background: #f8f9fb; border-color: #e0e2e8; min-height: 42px; font-size: 14px; }
.workspace textarea.field { resize: vertical; }
.workspace .list-item { background: #fff; border-color: #e8e9ed; align-items: flex-start; }
.workspace .point-label { background: #f8f9fb; overflow-wrap: anywhere; }
.workspace .route-panel { width: 320px; border: 1px solid #e8e9ed; border-radius: 16px; padding: 18px; }
.workspace .route-head { gap: 12px; }
.workspace .route-head button { width: 32px; height: 32px; flex: none; background: #f4f5f7; border-radius: 50%; }
.workspace .route-metrics div { background: #f4f5f7; }
.workspace .route-metrics b { font-size: 18px; color: #282b34; }
.route-note { font-size: 12px; color: #656b77; margin: 10px 0; }
.route-stop-button { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px; text-align: left; border: 1px solid #eceef1; border-radius: 10px; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.route-stop-button:hover { background: #faf3f5; border-color: #d9a8b6; }
.route-stop-button:focus-visible, .map-sheet-toggle:focus-visible { outline: 2px solid #990011; outline-offset: 2px; }
.route-stop-button .route-num { width: 25px; height: 25px; }
.route-list li.route-item { flex-direction: column; align-items: stretch; gap: 4px; }
.route-2gis { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; max-width: calc(100% - 43px); margin-left: 43px; padding: 4px 10px; border: 1px solid #d9a8b6; border-radius: 999px; background: #fff; color: #990011; font-size: 12px; font-weight: 600; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; }
.route-2gis:hover { background: #faf3f5; }
.route-2gis:focus-visible { outline: 2px solid #990011; outline-offset: 2px; }
@media (max-width: 760px) { .route-2gis { min-height: 40px; padding: 6px 14px; font-size: 13px; } }
.pickup-address { font-size: 13px; color: #363c48; overflow-wrap: anywhere; }
.pickup-note { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 761px) and (max-width: 1100px) {
  .workspace #pane-map > .cabinet-side { width: 300px; }
  .workspace .route-panel { width: 260px; }
}
@media (max-width: 760px) {
  .workspace .site-header { height: 60px; }
  .workspace .header-inner { padding: 0 12px; gap: 10px; }
  .workspace .header-user { display: none; }
  .workspace .header-right { gap: 8px; }
  .workspace .header-actions { gap: 0; }
  .workspace .brand { font-size: 24px; }
  .workspace #cabinetPage { height: calc(100dvh - 60px); }
  .workspace .cabinet-tabs { padding: 6px; gap: 2px; }
  .workspace .tab-btn { padding: 9px 12px; }
  .workspace #pane-map { display: block; }
  .workspace .cabinet-map-wrap { position: absolute; inset: 0; height: 100%; min-height: 0; }
  .workspace #pane-map > .cabinet-side { position: absolute; z-index: 600; bottom: 42px; left: 8px; right: 8px; width: auto; max-height: 48%; padding: 14px; border: 1px solid #e0e2e8; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px #26222316; }
  .workspace #pane-map.sheet-collapsed > .cabinet-side { display: none; }
  .workspace .map-sheet-toggle { display: block; position: absolute; z-index: 610; left: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); height: 36px; border: 1px solid #e0e2e8; border-radius: 10px; background: #fff; color: #8e1639; font: 600 13px var(--sans); cursor: pointer; }
  .workspace .route-panel { top: auto; bottom: 52px; left: 8px; right: 8px; width: auto; max-height: 43%; padding: 14px; }
  .workspace .route-metrics { margin-bottom: 5px; }
  .workspace .route-note { font-size: 11px; }
}

/* Keep form controls, map popups and chart labels in the interface family. */
button, input, select, textarea, .workspace .leaflet-container, .leaflet-popup-content,
.leaflet-container .leaflet-control-attribution, svg text { font-family: var(--sans); }
.brand-wordmark { display: block; width: 172px; height: 57px; object-fit: contain; }
.product-eyebrow, .scheme-finish span { font-family: var(--brand-font); }
@media (max-width: 760px) {
  .brand-wordmark { width: 132px; height: 44px; }
  .header-inner { gap: 12px; }
  .header-right { width: 100%; flex-wrap: wrap; gap: 10px; }
  .lang-switch { flex: none; }
  .header-actions { flex: 1; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  .header-user { width: 100%; text-align: right; overflow-wrap: anywhere; }
  .header-actions .btn { white-space: normal; text-align: center; }
}

/* Optional form sections: pickup window, fleet override */
.form-extra { margin: 0.4rem 0 0.6rem; }
.form-extra > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 0.25rem 0; }
.form-extra .field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.form-extra .field-pair .field { width: 100%; min-width: 0; }

/* Public routing-model demo */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.model-demo { text-align: center; }
.model-demo-eyebrow { margin-bottom: 12px; }
.model-demo-open { display: flex; justify-content: center; }
.model-demo-body { margin-top: 28px; display: grid; gap: 16px; text-align: left; }
.model-demo-controls { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.model-demo-control { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; color: #69707c; }
.segmented { display: inline-flex; border: 1px solid #e1d3d7; border-radius: 999px; padding: 3px; background: #fff; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer; color: #444b58; }
.segmented button[aria-pressed="true"] { background: #990011; color: #fff; }
.segmented button:focus-visible { outline: 2px solid #990011; outline-offset: 2px; }
.model-demo-map { position: relative; height: 440px; border-radius: 18px; border: 1px solid #e8e9ed; overflow: hidden; background: #f4f5f7; }
.model-demo-status { position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 16px; border-radius: 12px; background: #fff; box-shadow: 0 6px 20px #26222320; font-size: 14px; color: #444b58; }
.model-demo-status:empty { display: none; }
.model-demo-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #555b66; }
.legend-swatch { display: inline-block; width: 20px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.model-demo-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.saving-card { background: #fff; border: 1px solid #e8e9ed; border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.saving-card.is-shown { border-color: #c6a2ab; box-shadow: 0 6px 15px #99001110; }
.saving-card h3 { font-size: 14px; color: #69707c; font-weight: 600; }
.saving-card .saving-main { font-size: 28px; font-weight: 700; color: #990011; line-height: 1.2; }
.saving-card .saving-main.worse { color: #444b58; }
.saving-model .saving-main { color: #282b34; }
.saving-card p { font-size: 13px; color: #69707c; }
.model-demo-method { background: #f7f8fa; border-radius: 14px; padding: 12px 16px; }
.model-demo-method summary { cursor: pointer; font-weight: 600; color: #363c48; }
.model-demo-method p { font-size: 13px; color: #555b66; margin-top: 8px; max-width: 880px; }
@media (max-width: 760px) {
  .hero-actions .btn { width: 100%; }
  .model-demo-cards { grid-template-columns: 1fr; }
  .model-demo-map { height: 340px; }
  .model-demo-control, .segmented { width: 100%; }
  .segmented button { flex: 1 1 0; padding: 7px 6px; font-size: 13px; }
}
