/* Путь — палитра «Сад» (как Дозор и карта MoTiv): мятная шапка, белые карточки, внизу три вкладки */
@font-face { font-family: Onest; src: url(/fonts/onest-cyr.woff2) format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(/fonts/onest-lat.woff2) format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #F7F4EE; --mint: #DCE8DA; --ink: #22261F; --soft: #6B6A64; --line: #ECE8DF; --chip: #F1EEE7; --grey: #EFEDE8;
  --green: #234A2C; --green-2: #1E3A24; --green-3: #3F5E45; --ok: #E3EFE1; --ok-ink: #2E5A37;
  --soon: #F6EBCF; --soon-ink: #6F5310; --fire: #F8DCDC; --fire-ink: #93303A;
  --tab: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 Onest, system-ui, sans-serif; padding-bottom: calc(var(--tab) + 24px + env(safe-area-inset-bottom)); }
a { color: var(--ok-ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
main { max-width: 760px; margin: 0 auto; }
.muted { color: var(--soft); }
.small { font-size: 14px; }
.pad { padding: 24px 20px; }

/* Шапка */
.hero { background: var(--mint); border-radius: 0 0 32px 32px; padding: 20px; padding-top: calc(20px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar .grow { flex: 1; min-width: 0; }
.logo { font-size: 26px; font-weight: 600; color: var(--green); letter-spacing: -.01em; }
.kicker { font-size: 14px; color: var(--green-3); }
.round { width: 44px; height: 44px; border-radius: 22px; background: rgba(255, 255, 255, .7); border: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--green); text-decoration: none; flex: 0 0 auto; position: relative; }
.round.dot::after { content: ''; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 5px; background: #D9822B; border: 2px solid #fff; }
.search { position: relative; }
.search svg.i { position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; color: var(--soft); }
.search input { padding-left: 42px; border-color: transparent; height: 48px; border-radius: 16px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 36px; border: 0; border-radius: 18px; padding: 0 14px; background: rgba(255, 255, 255, .55); color: var(--green-3); font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--green); color: #fff; }

/* Список адресов */
.list { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.pl { background: #fff; border-radius: 20px; padding: 12px 12px 12px 14px; display: flex; gap: 12px; align-items: center; border: 0; text-align: left; width: 100%; color: var(--ink); }
.av { width: 44px; height: 44px; border-radius: 15px; background: var(--ok); color: var(--ok-ink); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; flex: 0 0 auto; }
.av.place { background: var(--soon); color: var(--soon-ink); }
.av.home { background: var(--green); color: #fff; }
.av svg.i { width: 20px; height: 20px; }
.pl .w { flex: 1; min-width: 0; }
.pl .t { font-weight: 600; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.pl .a { font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .code { font-size: 12px; font-weight: 600; color: var(--ok-ink); background: var(--ok); border-radius: 8px; padding: 2px 7px; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.go { width: 44px; height: 44px; border-radius: 15px; border: 0; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.go svg.i { width: 20px; height: 20px; }
.letter { font-size: 13px; font-weight: 600; color: var(--soft); margin: 10px 6px 0; }
.hint { margin: 0 16px; border: 1.5px dashed #C9C5BB; border-radius: 22px; padding: 18px; color: var(--soft); font-size: 15px; }
.hint b { color: var(--ink); font-weight: 600; }

/* Кнопки */
.btn { min-height: 44px; border: 0; border-radius: 14px; background: var(--chip); color: var(--ink); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; text-decoration: none; white-space: nowrap; }
.btn svg.i { width: 19px; height: 19px; }
.btn.ok { background: var(--ok); color: var(--green); font-weight: 600; }
.btn.main { background: var(--green); color: #fff; font-weight: 600; }
.btn.white { background: #fff; }
.btn.danger { background: var(--fire); color: var(--fire-ink); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.fab { position: fixed; right: max(16px, calc(50% - 364px)); bottom: calc(var(--tab) + 16px + env(safe-area-inset-bottom)); z-index: 9; height: 52px; border-radius: 26px; border: 0; background: var(--green); color: #fff; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; padding: 0 20px 0 16px; box-shadow: 0 6px 20px rgba(30, 58, 36, .25); }

/* Нижние вкладки — сплошной фон до самого низа, под системными кнопками ничего не просвечивает */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; max-width: 200px; height: var(--tab); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--soft); text-decoration: none; }
.tabs a.on { color: var(--green); font-weight: 600; }
.tabs a.on svg.i { stroke-width: 2.1; }

/* Карточка места */
.card { background: #fff; border-radius: 22px; padding: 16px; margin: 0 16px 10px; }
.card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--soft); }
.addr { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.addr small { display: block; color: var(--soft); font-size: 14px; margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { background: var(--bg); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.facts small { display: block; font-size: 12px; color: var(--soft); }
.facts b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.intercom { display: flex; align-items: center; gap: 12px; background: var(--ok); border-radius: 16px; padding: 10px 10px 10px 14px; margin-bottom: 8px; border: 0; width: 100%; text-align: left; color: var(--ink); }
.intercom .w { flex: 1; min-width: 0; }
.intercom small { display: block; font-size: 12px; color: var(--ok-ink); }
.intercom b { font-size: 22px; font-weight: 600; letter-spacing: .04em; color: var(--green-2); overflow-wrap: anywhere; }
.intercom svg.i { color: var(--ok-ink); }
.note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modes .btn { flex-direction: column; gap: 2px; min-height: 64px; padding: 8px 4px; font-size: 13px; background: var(--ok); color: var(--green); font-weight: 600; }
.row-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1 1 0; min-width: 0; }

/* План дня */
.days { display: flex; align-items: center; gap: 6px; }
.days .d { flex: 1; min-width: 0; height: 56px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .55); color: var(--green-3); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-size: 12px; }
.days .d b { font-size: 18px; font-weight: 600; }
.days .d.on { background: var(--green); color: #fff; }
.days .d.has::after { content: ''; width: 5px; height: 5px; border-radius: 3px; background: currentColor; margin-top: 3px; }
.days .round { width: 36px; height: 36px; }
.sum { display: flex; gap: 8px; }
.sum div { flex: 1; background: rgba(255, 255, 255, .75); border-radius: 14px; padding: 8px 12px; font-size: 13px; color: var(--green-3); }
.sum b { display: block; font-size: 18px; font-weight: 600; color: var(--green-2); }
.route { padding: 0 16px; }
.stop { display: flex; gap: 12px; align-items: stretch; }
.stop .tm { width: 52px; flex: 0 0 auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 14px; font-size: 15px; }
.stop .tm small { display: block; font-weight: 400; font-size: 12px; color: var(--soft); }
.stop .rail { width: 14px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.stop .rail i { width: 14px; height: 14px; border-radius: 7px; background: var(--green); border: 3px solid var(--mint); margin-top: 17px; flex: 0 0 auto; }
.stop .rail s { flex: 1; width: 2px; background: #D3DCCF; text-decoration: none; }
.stop.home .rail i { background: #fff; border-color: var(--green); }
.stop.done .rail i { background: #A9C4A7; }
.stop .box { flex: 1; min-width: 0; background: #fff; border-radius: 18px; padding: 12px 14px; margin: 4px 0; border: 0; text-align: left; color: var(--ink); display: block; width: 100%; }
.stop.done .box { opacity: .6; }
.stop .box .t { font-weight: 600; overflow-wrap: anywhere; }
.stop .box .a { font-size: 14px; color: var(--soft); overflow-wrap: anywhere; }
.stop .box .code { font-size: 12px; font-weight: 600; color: var(--ok-ink); }
.leg { display: flex; gap: 12px; align-items: stretch; min-height: 44px; }
.leg .tm { width: 52px; flex: 0 0 auto; }
.leg .rail { width: 14px; flex: 0 0 auto; display: flex; justify-content: center; }
.leg .rail s { width: 2px; background: repeating-linear-gradient(#C7D3C3 0 4px, transparent 4px 8px); text-decoration: none; }
.leg button { flex: 1; min-width: 0; border: 0; background: none; text-align: left; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); padding: 6px 0; }
.leg button svg.i { width: 18px; height: 18px; }
.leg.tight button { color: var(--soon-ink); }
.leg .pill { background: var(--soon); color: var(--soon-ink); border-radius: 8px; padding: 2px 7px; font-size: 12px; font-weight: 600; }
.daybtns { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }

/* Карта */
.mapwrap { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--tab) + env(safe-area-inset-bottom)); background: #E2E6D7; }
.mapbox { position: absolute; inset: 0; }
.maptop { position: absolute; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 5; display: flex; gap: 8px; }
.maptop .seg { background: rgba(255, 255, 255, .9); border-radius: 22px; padding: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.maptop .seg button { background: transparent; }
.maptop .seg button.on { background: var(--green); }
.zoom { position: absolute; right: 12px; bottom: 64px; /* над логотипом и «Открыть Яндекс Карты» — их закрывать нельзя */ z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.zoom .round { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.mapoff { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center; color: var(--soft); }
.pin { transform: translate(-16px, -38px); cursor: pointer; }
.pin svg { display: block; }
.pin path { fill: var(--green); stroke: #fff; stroke-width: 2; }
.pin.place path { fill: #B07A1C; }
.pin.home path { fill: var(--green-2); }
.pin circle { fill: #fff; }
.pin.on path { fill: #D9822B; }
.pin span { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); white-space: nowrap; background: #fff; border-radius: 8px; padding: 2px 6px; font: 600 12px Onest, system-ui; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.pin.num b { position: absolute; left: 16px; top: 5px; width: 0; text-align: center; }
.pin.num b::before { content: attr(data-n); position: absolute; transform: translateX(-50%); font: 600 13px Onest, system-ui; color: #fff; }
.pin.num circle { display: none; }
.me { width: 18px; height: 18px; border-radius: 9px; background: #2F6FEB; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 235, .2); transform: translate(-9px, -9px); }
.mini { height: 180px; border-radius: 18px; overflow: hidden; position: relative; background: #E2E6D7; margin-bottom: 10px; }

/* Нижний лист и формы */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(34, 38, 31, .35); display: flex; align-items: flex-end; justify-content: center; }
.sheet .box { background: var(--bg); width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; padding: 20px 16px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); max-height: 94vh; max-height: 94dvh; overflow: auto; overscroll-behavior: contain; }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet .box { border-radius: 26px; } }
.sheet .hd { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; }
.sheet .hd .grow { flex: 1; min-width: 0; }
.sheet h3 { margin: 0; font-size: 22px; font-weight: 600; color: var(--green-2); line-height: 1.2; overflow-wrap: anywhere; }
.sheet .hd .round { background: #fff; width: 40px; height: 40px; }
.sheet .card { margin: 0 0 10px; }
label { display: block; font-size: 14px; color: var(--soft); margin: 12px 0 4px; }
input, textarea, select { width: 100%; border: 1px solid #E4E0D6; background: #fff; border-radius: 14px; padding: 11px 13px; font-size: 16px; min-height: 46px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--mint); border-color: #A9C4A7; }
textarea { min-height: 76px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.find { display: flex; gap: 8px; }
.find textarea { min-height: 46px; height: 46px; }
.find .btn { flex: 0 0 auto; }
.found { margin-top: 8px; background: var(--ok); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: var(--ok-ink); }
.found.warn { background: var(--soon); color: var(--soon-ink); }
.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--chip); border-radius: 16px; padding: 4px; }
.kind button { height: 40px; border: 0; border-radius: 12px; background: transparent; font-size: 15px; font-weight: 500; color: var(--soft); display: flex; align-items: center; justify-content: center; gap: 6px; }
.kind button.on { background: #fff; color: var(--green); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.chk { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 15px; cursor: pointer; color: var(--ink); }
.chk input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; accent-color: var(--green-2); }
.err { color: var(--fire-ink); font-size: 14px; margin-top: 8px; min-height: 1em; }
.pick { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.pick .pl { background: #fff; padding: 8px 10px; }
.pick .pl.on { outline: 2px solid var(--green); }
.pick .av { width: 36px; height: 36px; border-radius: 12px; font-size: 15px; }
.set { display: flex; flex-direction: column; gap: 8px; }
.set .card { margin: 0; }
.set .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: var(--green-2); color: #fff; border-radius: 16px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); font-size: 15px; }
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast button { background: none; border: 0; color: var(--soon); font-weight: 600; white-space: nowrap; padding: 4px 0; }

.login { max-width: 380px; margin: 0 auto; padding: 0 20px; }
.login .hero { margin: 0 -20px 24px; align-items: center; text-align: center; padding-top: calc(48px + env(safe-area-inset-top)); padding-bottom: 32px; }
.login .hero img { width: 64px; height: 64px; }
.login .btn { width: 100%; margin-top: 12px; min-height: 52px; }
body.nologin { padding-bottom: 0; }
.found.busy { background: var(--chip); color: var(--soft); }
