@font-face{font-family:Proxima;src:url('assets/proxima-nova-400.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:Proxima;src:url('assets/proxima-nova-600.woff2') format('woff2');font-weight:600;font-display:swap}
@font-face{font-family:Proxima;src:url('assets/proxima-nova-700.woff2') format('woff2');font-weight:700;font-display:swap}
@font-face{font-family:Montserrat;src:url('assets/Montserrat-700-western.woff2') format('woff2');font-weight:700;font-display:swap}

:root{
  --ground:#101416;--surface:#1a2023;--sunk:#242c30;--ink:#f1f5f6;--muted:#9eabb0;--line:#2c363a;
  --accent:#2fbcde;--accent-soft:#12323b;--accent-ink:#08191e;--primary:#f1f5f6;--primary-ink:#101416;
  --green:#2a9a44;--green-soft:#15301c;--green-ink:#8fdb9f;--amber-soft:#35300f;--amber-ink:#f0dc6a;
  --map:#1d2528;--map-road:#2f3a3f;--shadow:0 1px 2px #0006,0 10px 28px #0007;
  --error:#ff9d80;--error-bg:#351e18;--display:Montserrat,system-ui,sans-serif;--gutter:20px;
  --page:var(--ground);--card:var(--surface);--raised:var(--sunk);--success:var(--green-ink);--success-bg:var(--green-soft);--warning-bg:var(--amber-soft);--info-bg:var(--accent-soft);--amber:var(--amber-ink);
  color-scheme:dark;font:16px/1.5 Proxima,system-ui,sans-serif;background:var(--ground);color:var(--ink);-webkit-text-size-adjust:100%
}
:root[data-theme=light]{
  --ground:#eef2f3;--surface:#fff;--sunk:#e4eaec;--ink:#14191b;--muted:#5a666b;--line:#d8e0e3;
  --accent:#067b98;--accent-soft:#e0f2f7;--accent-ink:#fff;--primary:#14191b;--primary-ink:#fff;
  --green:#1f7a33;--green-soft:#e2f3e6;--green-ink:#17602a;--amber-soft:#fff3c9;--amber-ink:#735600;
  --map:#e6ece9;--map-road:#fff;--shadow:0 1px 2px #14191b14,0 8px 24px #14191b14;--error:#a63715;--error-bg:#fff0eb;color-scheme:light
}
*{box-sizing:border-box}
html{background:var(--ground);scroll-behavior:smooth}
body{margin:0;min-width:320px;min-height:100dvh;background:var(--ground);color:var(--ink)}
p{margin:0}a{color:var(--accent)}
button,input,select,textarea{font:inherit;color:inherit}
button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
[hidden],.hidden{display:none!important}
h1,h2,h3{font-family:var(--display);font-weight:700;letter-spacing:-.015em;line-height:1.2;margin:0;text-wrap:balance;overflow-wrap:anywhere}
h1{font-size:24px}h2{font-size:22px}h3{font-size:18px}
.small{font-size:14px;color:var(--muted)}.eyebrow{font-size:14px;font-weight:600;color:var(--accent)}
.icon{display:inline-flex;flex:none;width:20px;height:20px}.icon svg{width:100%;height:100%}

button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font-weight:600;text-align:center;text-decoration:none;cursor:pointer;touch-action:manipulation;transition:background .16s,color .16s,border-color .16s,transform .12s}
button:active:not(:disabled){transform:scale(.985)}button:disabled{opacity:.4;cursor:not-allowed}
button.primary{background:var(--primary);color:var(--primary-ink);border-color:var(--primary)}
button.icon-end .icon{order:2}.done-action{background:var(--green);color:#fff;border-color:var(--green)}
button.link{border-color:transparent;background:transparent;color:var(--accent)}
button.link.quiet,.quiet-button{border-color:transparent;background:transparent;color:var(--muted);font-size:14px}
button.wide{width:100%}
@media(hover:hover){button:hover:not(:disabled){background:var(--sunk)}button.primary:hover:not(:disabled){background:var(--primary);opacity:.88}.done-action:hover:not(:disabled){background:var(--green);opacity:.9}}

.skip-link{position:absolute;left:-9999px}.skip-link:focus{left:16px;top:8px;z-index:60;padding:12px;background:var(--surface)}
.site-header{position:sticky;top:0;z-index:20;padding-top:env(safe-area-inset-top);background:var(--surface);border-bottom:1px solid var(--line)}
.header-inner{max-width:1280px;min-height:60px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:8px 20px}
.brand{display:flex;align-items:center;gap:20px;text-decoration:none;color:var(--ink);min-width:0}.brand img{width:112px;height:40px;object-fit:contain}.brand-product{font-family:var(--display);font-size:14px;border-left:1px solid var(--line);padding-left:20px}
.logo-light{display:none}[data-theme=light] .logo-dark{display:none}[data-theme=light] .logo-light{display:block}
.header-tools{display:flex;align-items:center;gap:8px}#theme-toggle,#header-logout{min-height:40px;padding:4px 12px;border-radius:999px;font-size:14px}
.connection{min-height:40px;padding:4px 10px;border:0;background:transparent;color:var(--muted);font-size:13px;white-space:nowrap}.connection:before{content:'';width:7px;height:7px;border-radius:50%;background:var(--green)}.connection.waiting{color:var(--amber-ink)}.connection.waiting:before{background:var(--amber-ink)}.connection:disabled{opacity:1;cursor:default}

main{position:relative;max-width:1184px;margin:auto;padding:20px var(--gutter) calc(40px + env(safe-area-inset-bottom));min-height:calc(100dvh - 61px)}
.stack,.route-list,.edition-list{display:grid;gap:20px}.page-head{display:grid;gap:4px}.rowbet{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.rowbet>:first-child{min-width:0}.baseline{align-items:baseline}
.card,.login-card{padding:20px 24px;background:var(--surface);border-radius:20px;box-shadow:0 0 0 1px var(--line)}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.actions>*{flex:1 1 130px}
.view-snapshot{position:fixed;z-index:15;inset:61px 0 0;overflow:hidden;padding:20px var(--gutter);background:var(--ground);pointer-events:none}

.chip{flex:none;display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:12.5px;line-height:18px;font-weight:600;white-space:nowrap;background:var(--sunk);color:var(--muted)}
.chip.big{padding:5px 12px;font-size:14px;justify-self:start}.chip.run{background:var(--accent-soft);color:var(--accent)}.chip.done{background:var(--green-soft);color:var(--green-ink)}.chip.later{background:var(--amber-soft);color:var(--amber-ink)}
.num{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--sunk);font-weight:700;font-size:14px}.num.done{background:var(--green-soft);color:var(--green-ink)}.num .icon{width:16px;height:16px}
.progress{height:6px;border-radius:3px;background:var(--sunk);overflow:hidden}.progress>span{height:100%;display:block;border-radius:3px;background:var(--accent);transition:width .35s}.progress.complete>span{background:var(--green)}
.progress-row{display:flex;align-items:center;gap:12px}.progress-row .progress{flex:1}.progress-row p{white-space:nowrap}

.notice{padding:12px 16px;border-radius:14px;background:var(--amber-soft);color:var(--amber-ink);margin:0}.notice.error{background:var(--error-bg);color:var(--error)}.notice.success{background:var(--green-soft);color:var(--green-ink)}
main>.notice{max-width:720px;margin:0 auto 20px}main[data-role=admin]>.notice{max-width:none}
.notice.hint{display:grid;gap:2px;margin-top:16px;font-size:16px;line-height:1.45}.hint-label{font-size:12.5px;font-weight:700}
.toast{position:fixed;z-index:35;left:50%;top:76px;transform:translateX(-50%);width:min(688px,calc(100% - 32px));display:flex;align-items:center;gap:10px;padding:6px 6px 6px 16px;border-radius:16px;background:var(--primary);color:var(--primary-ink);font-size:14px;font-weight:600;box-shadow:var(--shadow);animation:toast-in .18s ease-out}.toast>span{flex:1}.toast button{min-height:40px;border:0;background:#8884;color:inherit}.toast .icon{width:16px;height:16px}@keyframes toast-in{from{opacity:0;transform:translate(-50%,-12px)}}

.login-card{max-width:460px;margin:32px auto;display:grid;gap:18px}.login-card h1{font-size:24px}.login-card .primary{width:100%;margin-top:20px;min-height:52px}
input,select,textarea{width:100%;min-height:48px;padding:10px 14px;border:1px solid var(--line);border-radius:14px;background:var(--ground)}textarea{min-height:88px}
input[type=checkbox],input[type=radio]{width:24px;height:24px;min-height:24px;accent-color:var(--accent);margin:0 8px 0 0}
label{display:block;font-weight:600;margin:12px 0 5px}.check-row{display:flex;align-items:center;min-height:48px}.form-error{color:var(--error);margin-top:12px}.form-error:empty{display:none}
fieldset{border:0;padding:0;margin:0;display:grid!important;grid-template-columns:1fr 1fr;gap:10px}fieldset legend{grid-column:1/-1;font-size:14px;color:var(--muted);margin-bottom:6px}
#login-form fieldset label{position:relative;display:flex;align-items:center;justify-content:center;min-height:56px;margin:0;border-radius:14px;background:var(--ground);font-weight:600;cursor:pointer}
#login-form fieldset input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0}#login-form fieldset label:has(input:checked){background:var(--accent-soft);color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent)}#login-form fieldset label:has(input:focus-visible){outline:3px solid var(--accent);outline-offset:2px}#password{font-size:18px}#login-form>.small{margin-top:14px}

.edition-list{max-width:720px}.edition-button{width:100%;display:grid;gap:10px;text-align:left;justify-items:stretch;padding:20px 24px;background:var(--surface);box-shadow:0 0 0 1px var(--line)}.edition-button strong{display:block;font-family:var(--display);font-size:18px}.edition-button span{display:block;color:var(--muted);font-size:14px;font-weight:400;margin-top:3px}.edition-button>span{margin:0}.edition-button .rowbet{align-items:center}.edition-button .progress{height:6px;margin:2px 0}

.route-overview,.driver-view{max-width:720px;margin:auto}.route-summary.card{display:grid;gap:14px}.route-summary h2{font-size:18px;margin-bottom:3px}.route-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin-top:4px}.route-actions button{min-height:48px}.quiet-button{width:100%}
.driver-view{display:grid;gap:20px}.driver-topbar{display:flex;justify-content:space-between;gap:10px}.nav-button{min-height:44px;padding:0 16px 0 10px;border-radius:999px}.nav-button:last-child{margin-left:auto}.tour-head{display:grid;gap:10px}.tour-head h1{font-size:18px}
.tour-times{display:flex;gap:20px;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}.tour-times span{display:grid}.tour-times strong{font-size:16px;color:var(--ink)}.tour-times .overrun strong{color:var(--amber-ink)}
.next-stop{display:grid;overflow:hidden;border-radius:24px;background:var(--surface);box-shadow:var(--shadow)}.next-stop.is-done .stop-body{opacity:.55}.next-stop.is-done .stop-name{text-decoration:line-through;text-decoration-thickness:1.5px}.navigation-active{outline:3px solid var(--accent);outline-offset:2px}
.stop-pager{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:12px 12px 0;color:var(--muted);font-size:14px}.pager-button{justify-self:start;min-height:40px;padding:0 12px;border:0;border-radius:999px;background:var(--ground);font-size:14px}.pager-button.icon-end{justify-self:end}.pager-position{text-align:center;white-space:nowrap}.pager-position strong{color:var(--ink)}
.stop-body{display:grid;gap:2px;padding:20px 24px 24px}.stop-name{font-size:22px;margin:8px 0}.stop-street{font-size:18px;font-weight:600;line-height:1.35}.stop-city{color:var(--muted)}.stop-meta{display:flex;align-items:baseline;gap:10px;margin-top:14px;color:var(--muted);font-size:15px}.stop-meta strong{font-size:17px;color:var(--ink)}
.next-preview{display:flex;align-items:center;gap:14px;width:100%;min-height:60px;padding:10px 16px;border-radius:18px;background:transparent;box-shadow:inset 0 0 0 1px var(--line);text-align:left}.next-preview>.icon{margin-left:auto;color:var(--muted)}.next-text{display:grid;min-width:0;flex:1}.next-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.next-preview.is-last{cursor:default}
.planning-details{border-radius:18px;box-shadow:inset 0 0 0 1px var(--line);background:transparent;padding:0 16px}.planning-details summary,.stop-editor summary{list-style:none;display:flex;align-items:center;gap:10px;min-height:56px;cursor:pointer}.planning-details summary::-webkit-details-marker,.stop-editor summary::-webkit-details-marker{display:none}.planning-details summary:after,.stop-editor summary:after{content:'';width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-left:auto}.planning-details[open]>summary:after,.stop-editor[open]>summary:after{transform:rotate(-135deg)}.summary-text{display:grid;min-width:0}.planning-details .card{margin:0 0 16px;padding:16px}.actions.stacked{flex-direction:column}.actions.stacked>*{flex:none}
.time-list{margin:0}.time-row{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid var(--line)}.time-row dd{margin:0;font-weight:700}.time-row.total{border:0;font-size:18px}
.pause-button{justify-self:center;width:auto}.tour-complete{display:grid;align-content:center;justify-items:center;gap:14px;text-align:center;min-height:55dvh}.done-badge{display:grid;place-items:center;width:80px;height:80px;border-radius:50%;background:var(--green-soft);color:var(--green-ink)}.done-badge .icon{width:38px;height:38px}.tour-complete .primary{margin-top:12px}
.driver-actions{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter) calc(20px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -8px 24px #14191b0f}.driver-actions button{width:100%;min-height:52px;background:var(--ground);border-color:transparent}.driver-actions .nav-action{background:var(--accent);color:var(--accent-ink)}.driver-actions .done-action,.driver-actions .next-action{grid-column:1/-1;min-height:60px;font-size:18px}.driver-actions .done-action{background:var(--green)}.driver-actions.is-done{grid-template-columns:1fr 1fr}.driver-actions.is-done .next-action{background:var(--primary)}
.map-peek{grid-column:1/-1;display:grid;justify-items:center;gap:5px;min-height:48px!important;padding:8px 0 4px!important;border:0;background:transparent!important;color:var(--muted);font-size:14px}.map-peek-label{display:inline-flex;align-items:center;gap:7px}.grabber{display:block;width:40px;height:4px;border-radius:2px;background:var(--line)}

.route-switch{display:flex;gap:8px;overflow:auto;padding-bottom:4px}.route-switch button{white-space:nowrap;border-radius:999px}.list-row{background:var(--surface)}.stop-row{display:grid;grid-template-columns:minmax(0,1fr) 52px;align-items:stretch;border-radius:0;box-shadow:none}.stop-row:first-child{border-radius:20px 20px 0 0}.stop-row:last-child{border-radius:0 0 20px 20px}.stop-row:only-child{border-radius:20px}.stop-row+.stop-row{border-top:1px solid var(--line)}.route-list{gap:0;border-radius:20px;box-shadow:0 0 0 1px var(--line);overflow:hidden}.stop-row-main{display:grid;grid-template-columns:32px minmax(0,1fr);gap:14px;align-items:center;min-height:68px;padding:14px 4px 14px 16px;border:0;border-radius:0;background:transparent;text-align:left}.stop-row-map{border:0;border-radius:0;background:transparent;color:var(--accent);padding:0}.stop-row .row-body{display:grid;min-width:0}.stop-row .row-body strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stop-row.done .row-body{opacity:.6}.row-hint{grid-column:1/-1;margin-top:4px;color:var(--muted);font-size:13px}.rowbet{display:flex!important}.rowbet>.chip{margin-left:auto}

.edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.edit-grid h2{grid-column:1/-1}.edit-grid label{font-size:14px;margin:0}.edit-grid label>input:not([type=checkbox]),.edit-grid label>select,.edit-grid label>textarea{margin-top:5px}
.office{gap:18px}.office-head{display:flex;align-items:center;gap:18px;padding:4px 0 16px;border-bottom:1px solid var(--line)}.office-title{flex:1;min-width:180px;display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:4px}.office-title>strong{grid-column:1/-1;font-family:var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.office-title>.small{white-space:nowrap}.office-title>.progress{height:4px}.office-actions{flex:none;flex-wrap:nowrap;margin:0}.office-actions>*{flex:none;min-height:40px;padding:0 14px;border-radius:999px;font-size:14px;white-space:nowrap}.settings-count{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--amber-soft);color:var(--amber-ink);font-size:12px}.office-settings{padding:0 20px;border-radius:20px;background:var(--surface);box-shadow:0 0 0 1px var(--line)}.office-settings>summary{min-height:52px;display:flex;align-items:center;list-style:none;cursor:pointer;font-weight:600}.office-settings>summary::-webkit-details-marker{display:none}.office-settings>summary:after{content:'';width:8px;height:8px;margin-left:auto;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}.office-settings[open]>summary:after{transform:rotate(-135deg)}.office-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:0 0 20px}.office-settings-grid>.notice{grid-column:1/-1}.settings-block,.office-settings-grid>.card{padding:18px;border-radius:20px;background:var(--ground);box-shadow:0 0 0 1px var(--line)}
.office-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-items:start}.office-tours,.office-stop-panel,.office-map{min-width:0;border-radius:20px;background:var(--surface);box-shadow:0 0 0 1px var(--line)}.office-tours{display:grid;align-content:start;gap:8px;padding:16px}.office-tours>h2,.office-stop-panel>h2{font-size:18px;margin:2px 4px 8px}.office-tours>button{display:grid;justify-items:start;gap:8px;width:100%;padding:14px;border:0;text-align:left;background:transparent}.office-tours button>*{justify-self:stretch}.office-tours>button[aria-current=true]{background:var(--sunk);box-shadow:0 0 0 1px var(--line)}.office-tours button .rowbet{align-items:center}.route-list-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.office-split-hint{padding:8px 4px}.office-stop-panel{padding:16px 0;overflow:hidden}.office-stop-panel>h2{padding:0 20px}.office-stop-list{display:grid}.office-route-section{scroll-margin-top:84px}.office-route-section+.office-route-section{border-top:8px solid var(--ground)}.route-divider{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:68px;padding:12px 20px;background:var(--sunk);border-bottom:1px solid var(--line)}.route-divider-main{min-width:0;display:grid;grid-template-columns:minmax(0,auto) auto;align-items:center;justify-content:start;gap:2px 6px}.route-divider-main>.small{grid-column:1/-1}.route-divider-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.route-rename{width:36px;height:36px;min-height:36px;padding:0;border:0;border-radius:50%;background:transparent}.route-rename .icon{width:16px;height:16px}.route-divider-actions{display:flex;align-items:center;gap:8px}.divider-remove{min-height:36px;padding:0 12px;border:0;background:transparent;color:var(--muted);font-size:13px}.route-title-input{min-height:38px;padding:6px 10px}.office-route-section>.route-list{border-radius:0;box-shadow:none;overflow:visible}.split-control{width:100%;min-height:30px;padding:0;border:0;border-top:1px dashed var(--line);border-radius:0;background:transparent;color:var(--muted);font-size:12px;font-weight:600;opacity:.58}.list-row.editable{display:grid;grid-template-columns:32px minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 20px;border-top:1px solid var(--line)}.list-row.editable.is-focused{background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}.office-stop-summary{display:grid;min-width:0}.office-stop-summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-controls{display:flex;gap:4px}.editable .row-controls button{width:40px;height:40px;min-width:40px;padding:0;border:0;border-radius:50%;background:var(--ground);font-size:18px}.editable .row-controls .icon{width:17px;height:17px}.stop-editor{grid-column:1/-1}.stop-editor summary{min-height:44px;color:var(--accent)}.stop-editor[open] summary{margin-bottom:10px}.editable[draggable=true]{cursor:grab}.drag-over{outline:2px dashed var(--accent);outline-offset:-3px}.unassigned-stops{padding:20px;border-top:8px solid var(--ground)}.unassigned-stops>h2{font-size:18px}.unassigned-stops>.small{margin:4px 0 14px}.office-map{padding:16px}.conflict-list{padding-left:20px}.conflict-list button{margin:8px 8px 0 0}
@media(hover:hover){.split-control{opacity:.18}.split-control:hover,.split-control:focus-visible,.list-row.editable:hover+.split-control{opacity:1;background:var(--sunk)}}

.map-section{max-width:1100px;margin:auto}.map-section h1{font-size:24px}.map-section>.small{margin-top:4px}.route-map{height:clamp(360px,62dvh,760px);width:100%;margin-top:12px;background:var(--map);border-radius:18px;z-index:0}.map-legend{display:flex;gap:8px 16px;flex-wrap:wrap;margin-top:10px;font-size:13px}.map-legend span{display:inline-flex;align-items:center}.map-legend span:before{content:'';width:10px;height:10px;border-radius:50%;background:#067b98;margin-right:5px}.map-legend .map-done:before{background:#228834}.map-legend .map-later:before{background:#a66d00}.stop-marker{display:grid;place-items:center;border:2px solid #fff;border-radius:50%;font:700 14px Proxima,system-ui,sans-serif;background:#067b98;color:#fff;box-shadow:0 2px 5px #0005;transition:none}.stop-marker.map-done{background:#228834}.stop-marker.map-later{background:#a66d00}.stop-marker.map-depot{background:#100f0f;border-radius:0}.map-popup{font:16px/1.4 Proxima,system-ui,sans-serif;color:#100f0f}.map-popup p{margin:6px 0}.map-popup button{width:100%;margin-top:8px;background:#100f0f;color:#fff}.map-stop-strip{display:flex;gap:8px;overflow-x:auto;padding:14px 0 4px}.map-stop-strip button{flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--sunk)}.map-stop-strip button[aria-pressed=true]{background:var(--primary);color:var(--primary-ink)}.map-stop-info{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 0}.map-stop-info .small{margin-top:2px}.map-fit{width:100%;margin-bottom:10px}.map-privacy{margin-top:10px}.leaflet-control-attribution{font:11px/1.4 Proxima,system-ui,sans-serif!important}.leaflet-touch .leaflet-bar a{width:44px;height:44px;line-height:44px}.leaflet-container{font-family:Proxima,system-ui,sans-serif}.leaflet-container a.leaflet-popup-close-button{width:40px;height:40px;line-height:40px}.leaflet-popup-content-wrapper{border-radius:14px}

body.sheet-open{overflow:hidden}.map-sheet{position:fixed;inset:0;z-index:40}.map-sheet-backdrop{position:absolute;inset:0;background:#0b0f1180;opacity:0;transition:opacity .25s}.map-sheet-panel{position:absolute;left:0;right:0;bottom:0;top:48px;max-width:900px;margin:auto;display:flex;flex-direction:column;overflow:hidden;border-radius:24px 24px 0 0;background:var(--surface);transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.8,.2,1);box-shadow:0 -12px 40px #0004}.map-sheet.open .map-sheet-backdrop{opacity:1}.map-sheet.open .map-sheet-panel{transform:none}.sheet-handle{flex:none;display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px 10px;width:100%;padding:10px 20px 14px;border:0;border-radius:0;background:transparent;text-align:left;touch-action:none}.sheet-handle .grabber{grid-column:1/-1;justify-self:center;margin-bottom:4px}.sheet-title{display:grid}.sheet-title .small{font-weight:400;font-size:13px}.map-sheet-body{flex:1;min-height:0;overflow:auto;padding:0 20px calc(20px + env(safe-area-inset-bottom))}.map-sheet .map-section h1,.map-sheet .map-section>.small:first-of-type{display:none}.map-sheet .route-map{height:calc(100dvh - 390px);min-height:260px;margin-top:0}

@media(max-width:767px){
  .header-inner{padding:6px var(--gutter)}.brand img{width:92px;height:34px}.brand-product{display:none}.header-tools{gap:2px}.connection{max-width:150px;white-space:normal;line-height:1.15;text-align:left;padding:4px 7px}#theme-toggle,#header-logout{padding:4px 9px}
  main{padding-top:20px}.card,.login-card{padding:20px}.route-actions{grid-template-columns:minmax(0,1fr) auto}.tour-times{gap:14px}.driver-actions{margin-left:calc(var(--gutter) * -1);margin-right:calc(var(--gutter) * -1)}
  .office-head{align-items:flex-start;flex-wrap:wrap}.office-title{flex:1 1 100%}.office-actions{width:100%;overflow-x:auto;padding-bottom:2px}.office-actions>*{flex:none}.office-settings-grid{grid-template-columns:1fr}.office-settings-grid>.notice{grid-column:auto}.route-divider{align-items:flex-start;flex-direction:column}.route-divider-actions{width:100%;justify-content:space-between}.list-row.editable{grid-template-columns:32px minmax(0,1fr) auto;padding:12px 16px}.list-row.editable>.chip{grid-column:2}.list-row.editable>.row-controls{grid-column:3;grid-row:1/3;flex-direction:column}.edit-grid{grid-template-columns:1fr}
}
@media(max-width:430px){.header-tools{font-size:13px}.connection{max-width:108px}.tour-times{justify-content:space-between;gap:8px}.tour-times strong{font-size:15px}.stop-pager{gap:3px;padding-inline:8px}.pager-button{padding:0 8px}.route-actions button{padding-inline:12px}.map-stop-info{grid-template-columns:1fr}.map-stop-info button{width:100%}}
@media(min-width:768px){:root{--gutter:24px}.driver-actions{margin-left:0;margin-right:0;padding-left:0;padding-right:0}.driver-actions button{min-height:56px}.driver-actions .done-action,.driver-actions .next-action{min-height:64px}.stop-body{padding:20px 24px 24px}}
@media(max-height:520px){.driver-actions{position:static}.site-header{position:static}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}.view-snapshot{display:none!important}}

#print-content{display:none}
@media print{
  @page{margin:12mm}
  body>*{display:none!important}
  #print-content{display:block!important;font:10.5pt/1.3 Proxima,system-ui,sans-serif;color:#111;background:#fff}
  #print-content h1{font-size:17pt;margin:0 0 2pt;color:#111}
  #print-content h2{font-size:13pt;margin:0 0 2pt;color:#111}
  .print-summary{margin:0 0 8pt;color:#333;font-size:9.5pt}
  .print-route{break-before:page}
  .print-route:first-of-type{break-before:auto}
  .print-table{width:100%;border-collapse:collapse;table-layout:fixed}
  .print-table thead{display:table-header-group}
  .print-table th{text-align:left;font-size:9pt;border-bottom:1.5pt solid #111;padding:3pt 4pt}
  .print-table td{vertical-align:top;border-bottom:.6pt solid #999;padding:4pt;overflow-wrap:anywhere}
  .print-table tr{break-inside:avoid}
  .print-table th:nth-child(1),.print-table td:nth-child(1){width:8%}
  .print-table th:nth-child(3),.print-table td:nth-child(3){width:11%}
  .print-table th:nth-child(4),.print-table td:nth-child(4){width:11%}
  .print-table th:nth-child(5),.print-table td:nth-child(5){width:28%}
  .print-table .num-col{text-align:right;font-variant-numeric:tabular-nums}
  .print-table .nr-col{font-weight:700}
  .print-table tfoot td{border-bottom:0;border-top:1.5pt solid #111;font-weight:700}
  .print-hint{font-style:italic;margin-top:1pt}
  .print-packsize{font-size:8.5pt;color:#444}
  .print-box{display:inline-block;width:11pt;height:11pt;border:1pt solid #111;margin-right:6pt;text-align:center;line-height:10pt;font-size:9pt;vertical-align:top}
  .print-table tr.is-done td:nth-child(2){color:#555}
  .print-depot{margin-top:10pt;font-size:10pt}
}

/* Map: details sit beside the map on wide screens, below it on phones */
.map-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
.map-stop-hint{margin-top:8px;padding:8px 12px;border-radius:12px;background:var(--amber-soft);color:var(--amber-ink);font-size:14px}
.leaflet-bottom.leaflet-right .leaflet-control-zoom{margin-bottom:26px}
@media(min-width:1000px){
  .map-sheet-panel{top:32px;max-width:min(1560px,calc(100% - 64px))}
  .map-sheet-body{overflow:hidden;display:flex;flex-direction:column}
  .map-sheet .map-section{flex:1;min-height:0;max-width:none;display:flex;flex-direction:column;width:100%}
  .map-layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) 380px;gap:28px;margin-top:12px}
  .map-sheet .route-map,.map-layout .route-map{height:100%;min-height:420px;margin-top:0}
  .map-section:not(.map-sheet *) .map-layout{height:min(78dvh,900px)}
  .map-section{max-width:none}
  .map-side{min-height:0;overflow:auto;padding-right:4px}
  .map-stop-strip{flex-wrap:wrap;overflow:visible;padding-top:0}
  .map-stop-info{grid-template-columns:minmax(0,1fr)}
  .map-stop-info .primary{width:100%}
}

/* Action bar reads as its own layer: tinted ground, firm edge, clear lift over the stop card */
.driver-actions{background:var(--sunk);border-top:1px solid color-mix(in srgb,var(--ink) 18%,transparent);box-shadow:0 -10px 28px color-mix(in srgb,var(--ink) 16%,transparent)}
.driver-actions button{background:var(--surface);box-shadow:0 0 0 1px var(--line)}
.driver-actions .nav-action,.driver-actions .done-action,.driver-actions .next-action{box-shadow:none}
.driver-actions .map-peek{background:transparent;box-shadow:none;color:var(--ink)}
.driver-actions .map-peek .grabber{background:color-mix(in srgb,var(--ink) 35%,transparent)}
.driver-actions .next-action{background:var(--primary);color:var(--primary-ink)}
/* Skip is the minor action: small and left. Navigate takes the room on the right. */
.driver-actions:not(.is-done){grid-template-columns:auto minmax(0,1fr)}
.driver-actions .later-action{font-size:14px;font-weight:600;padding:0 14px;gap:6px;color:var(--muted)}
.driver-actions .later-action .icon{width:18px;height:18px}
.map-side{min-width:0}
/* Pager pills: text never touches the rounded edge, also with two-digit stop numbers */
.stop-pager{grid-template-columns:auto minmax(0,1fr) auto;gap:6px}
.stop-pager .pager-button{min-height:44px;padding:0 16px 0 10px;gap:4px;white-space:nowrap;flex:none}
.stop-pager .pager-button.icon-end{padding:0 10px 0 16px}
.stop-pager .pager-button .icon{width:18px;height:18px}
.pager-position{overflow:hidden;text-overflow:ellipsis}

/* Phone: the recipient must fit on the first screen. Chrome above the stop card is compressed. */
@media(max-width:767px){
  .header-inner{min-height:48px;padding:4px var(--gutter)}
  .brand img{width:78px;height:28px}
  #header-logout,#theme-toggle{min-height:36px;padding:0 12px;font-size:13px}
  main[data-page=tour][data-role=driver]{padding-top:10px}
  main[data-page=tour] .driver-view{gap:10px}
  main[data-page=tour] .nav-button{min-height:40px;font-size:14px}
  main[data-page=tour] .route-summary h1{font-size:15px;margin:0}
  main[data-page=tour] .route-summary{display:grid;gap:6px}
  main[data-page=tour] .progress{height:4px}
  /* One quiet line instead of three stacked values */
  main[data-page=tour] .tour-times{justify-content:flex-start;gap:4px 14px;flex-wrap:wrap;font-size:12.5px}
  main[data-page=tour] .tour-times span{display:inline-flex;align-items:baseline;gap:4px}
  main[data-page=tour] .tour-times strong{font-size:13px}
  main[data-page=tour] .stop-pager{padding:8px 8px 0}
  main[data-page=tour] .stop-pager .pager-button{min-height:40px}
  main[data-page=tour] .stop-body{padding:12px 20px 18px}
  main[data-page=tour] .stop-name{font-size:21px;margin:0 0 4px}
  main[data-page=tour] .stop-street{font-size:17px}
  main[data-page=tour] .stop-meta{margin-top:10px!important}
  main[data-page=tour] .notice.hint{margin-top:10px;padding:10px 14px;font-size:15px}
  .driver-actions{gap:8px;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .driver-actions .map-peek{min-height:38px!important;padding:6px 0 2px!important}
  .driver-actions button{min-height:48px}
  .driver-actions .done-action,.driver-actions .next-action{min-height:56px}
}
/* Without this iOS claims the vertical swipe and cancels the drag */
.map-peek,.sheet-handle{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* Selected stop on the map: inverted, larger, ringed */
.stop-marker.is-selected{background:#100f0f!important;color:#fff;border-color:#fff;font-size:15px;box-shadow:0 0 0 4px #100f0f,0 0 0 8px #fff,0 6px 16px #0008}
.map-stop-strip,.map-stop-strip button,.stop-marker{-webkit-user-select:none;user-select:none}

/* Desktop: stop on the left, live map on the right. No phone-style bottom bar. */
@media(min-width:1100px){
  main:has(.driver-view.has-map){max-width:1560px}
  .driver-view.has-map{max-width:none;grid-template-columns:minmax(0,540px) minmax(0,1fr);column-gap:36px;align-items:start}
  .driver-view.has-map>*{grid-column:1}
  .driver-view.has-map>.tour-map{grid-column:2;grid-row:1/span 12;position:sticky;top:84px;height:calc(100dvh - 112px);min-height:520px;display:flex;flex-direction:column;padding:16px;border-radius:24px;background:var(--surface);box-shadow:0 0 0 1px var(--line)}
  .tour-map .map-section{flex:1;min-height:0;display:flex;flex-direction:column;max-width:none;margin:0;width:100%}
  .tour-map .map-section h1,.tour-map .map-section>.small:first-of-type,.tour-map .map-privacy,.tour-map .map-section a[href*="fixthemap"]{display:none}
  .tour-map .map-legend{margin:0 0 10px}
  .tour-map .map-layout{flex:1;min-height:0;display:flex;flex-direction:column;gap:0;margin:0}
  .tour-map .route-map{flex:1;min-height:0;height:auto;margin:0}
  .tour-map .map-side{flex:none;overflow:visible;padding:0}
  .tour-map .map-stop-strip{flex-wrap:nowrap;overflow-x:auto;padding:12px 0 6px}
  .tour-map .map-stop-info{grid-template-columns:minmax(0,1fr) auto;padding:8px 0}
  .tour-map .map-stop-info .primary{width:auto}
  .tour-map .map-fit{margin:0}
  .tour-map .map-side>.small[role=status]{display:none}
  .driver-view.has-map .driver-actions{position:static;margin:0;padding:16px;border:0;border-radius:20px;box-shadow:0 0 0 1px var(--line)}
  .driver-view.has-map .map-peek{display:none}
}
/* Narrow pages sit in the middle instead of hugging the left edge */
.page-narrow{max-width:720px;margin-inline:auto;width:100%}
.page-narrow .edition-list{max-width:none}
main>.notice{max-width:720px;margin-inline:auto}
/* Office only: look at the app as a driver or as the office */
.view-switch{display:inline-flex;padding:3px;gap:2px;border-radius:999px;background:var(--sunk)}
.view-switch button{min-height:36px;padding:0 14px;border:0;border-radius:999px;background:transparent;font-size:14px;font-weight:600;color:var(--muted)}
.view-switch button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px #0003}
@media(max-width:767px){.view-switch button{min-height:32px;padding:0 10px;font-size:13px}.header-tools:has(.view-switch:not([hidden])) .connection{font-size:0;gap:0}}
/* Finished tours: collapsed group below the open ones */
.finished-tours{display:grid;gap:14px}
.finished-tours>summary{display:flex;align-items:center;gap:8px;min-height:48px;padding:0 4px;list-style:none;cursor:pointer;font-weight:600;color:var(--muted)}
.finished-tours>summary::-webkit-details-marker{display:none}
.finished-tours>summary .icon{width:18px;height:18px;color:var(--green-ink)}
.finished-tours>summary:after{content:'';margin-left:auto;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s}
.finished-tours[open]>summary:after{transform:rotate(-135deg)}
.finished-tours>.card{margin-top:12px;opacity:.85}
main[data-role=admin],main[data-role=admin]:has(.driver-view.has-map){max-width:1560px}
main[data-role=admin] .driver-view:not(.has-map),main[data-role=admin] .route-overview{max-width:900px;margin-inline:0}
main[data-role=admin] .map-section{margin:0}
/* Preview: looking at another stop than the one the driver is working on */
.preview-hint{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin:10px 12px 0;padding:10px 10px 10px 14px;border-radius:14px;background:var(--accent-soft);color:var(--ink);font-size:14px}
.preview-hint strong{color:var(--accent)}
.preview-hint button{min-height:40px;padding:0 14px;border:0;border-radius:999px;background:var(--surface);font-size:14px;gap:4px;white-space:nowrap;box-shadow:0 0 0 1px var(--line)}
.preview-hint button .icon{width:16px;height:16px}
.next-stop.is-preview{box-shadow:0 0 0 2px var(--accent),var(--shadow)}

main[data-role=admin]{padding-top:20px}
@media(min-width:1100px){.office-grid{grid-template-columns:260px minmax(420px,1fr) minmax(360px,1fr)}.office-tours{position:sticky;top:84px}.office-map{position:sticky;top:84px;height:calc(100dvh - 112px);min-height:520px;display:flex;flex-direction:column}.office-map .map-section{flex:1;min-height:0;display:flex;flex-direction:column;width:100%}.office-map .map-layout{flex:1;min-height:0;height:auto!important}.office-map .route-map{flex:1;min-height:0;height:auto}.office-map .map-stop-strip{flex-wrap:nowrap;overflow-x:auto}}

/* Office controls form usable rows on phones and tablets instead of widening the page. */
@media(max-width:1099px){
  .office-head{align-items:flex-start;flex-wrap:wrap}
  .office-title{flex:1 1 100%;width:100%;min-width:0}
  .office-progress{min-width:0;flex-wrap:wrap;gap:6px 12px}
  .office-progress .progress{flex:1 1 180px;min-width:0}
  .office-progress .small{min-width:0;white-space:normal}
  .office-actions{flex:1 1 100%;width:100%;min-width:0;max-width:100%;flex-wrap:wrap;overflow:visible;padding-bottom:0}
  .office-actions>*{flex:1 1 calc(50% - 5px);min-width:0;white-space:normal}
}
@media(max-width:430px){.office-actions{gap:8px}.office-actions>*{min-height:44px;padding-inline:10px;font-size:13px}}

/* Final component refinements */
/* icon-only round buttons: the empty label span and the gap pushed the icon off centre */
.row-controls button{gap:0}
.row-controls button>span:not(.icon):empty{display:none}
.row-controls button .icon{margin:0}
/* the edit button opens the editor, so the lone summary chevron is redundant in the office list */
.office-stop-list .stop-editor:not([open])>summary{display:none}
.office-stop-list .stop-editor[open]>summary{min-height:32px;color:var(--muted);font-size:14px}
.office-stop-list .stop-editor>summary:after{display:none}
.office-progress{display:flex;align-items:center;gap:12px}
.office-progress .progress{flex:0 1 220px;height:6px;margin:0}
.office-progress .small{white-space:nowrap;color:var(--ink);font-weight:600}
.office-sync{font-size:12.5px}
#save-plan.is-dirty{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 45%,transparent)}
.office-map-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.office-map-head button{min-height:40px;padding:0 14px;border-radius:999px;font-size:14px}
.office-map-head .icon{width:16px;height:16px}
.position-editor{grid-column:1/-1;border-top:1px solid var(--line);padding-top:8px}
.position-editor>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--muted);font-size:14px}
.position-editor .small{margin:4px 0 12px;max-width:70ch}
.edit-save-note{grid-column:1/-1;margin:4px 0 0}
/* Settings cards take their own height. */
#office-settings .edit-grid,#office-settings>div{align-items:start;align-content:start}
/* Map texts: tucked into one quiet disclosure */
.map-note{margin-top:10px;font-size:13px;color:var(--muted)}
.map-note>summary{min-height:36px;display:inline-flex;align-items:center;cursor:pointer}
.map-note .map-privacy{display:block!important;margin:4px 0 8px}
.map-note a{display:inline!important}
.tour-map .map-note{display:none}
/* Live: a driver reported within the last minutes */
.chip.live{background:var(--green-soft);color:var(--green-ink);display:inline-flex;align-items:center;gap:6px}
.chip.live:before,.live-dot{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 0 color-mix(in srgb,var(--green) 60%,transparent);animation:live-pulse 1.8s ease-out infinite}
.office-sync.is-live{display:flex;align-items:center;gap:8px;color:var(--green-ink);font-weight:600}
@keyframes live-pulse{70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){.chip.live:before,.live-dot{animation:none}}
.driver-actions.is-done button:not(.next-action):not(.map-peek){white-space:normal;line-height:1.15;font-size:15px}
/* Office saves by itself; the head shows the state instead of a save button */
.save-state{min-height:40px;padding:0 16px;border-radius:999px;font-size:14px;font-weight:600;border:0;box-shadow:0 0 0 1px var(--line);background:var(--surface);color:var(--muted)}
.save-state.is-saved{color:var(--green-ink)}
.save-state.is-saved .icon{color:var(--green)}
.save-state.is-dirty{color:var(--ink);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 55%,transparent)}
.save-state.is-error{color:#b3261e;box-shadow:0 0 0 2px #b3261e}
.address-note{grid-column:1/-1;margin:0;font-size:14px}
.address-search{display:grid;gap:10px}
.address-search>p{margin:0}
.address-candidate{display:grid;gap:4px;padding:12px 0;border-top:1px solid var(--line)}
.address-candidate:first-of-type{border-top:0}
.address-candidate .small{margin:0}
.address-candidate-actions{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 12px}
.address-candidate-actions button{min-height:40px;padding:0 14px;font-size:14px}
.stop-marker.map-candidate{background:var(--surface);color:var(--ink);border:3px dashed var(--accent);font-size:20px;box-shadow:0 0 0 4px color-mix(in srgb,var(--surface) 80%,transparent),0 5px 16px #0007}
.settings-note{grid-column:1/-1;margin:0}
.usual-times{grid-column:1/-1;justify-self:start;min-height:40px;border-radius:999px;font-size:14px}
/* Map side: actions on top side by side, then the stop, then the numbers */
.map-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 14px}
.map-actions button{width:100%;min-height:48px;margin:0;white-space:nowrap;padding:0 12px}
@media(max-width:430px){.map-actions{grid-template-columns:1fr}}
.map-side .map-fit{margin:0}
.map-stop-info{display:block;padding:0 0 12px;grid-template-columns:none}
.map-side .map-stop-strip{padding-top:4px}
@media(max-width:999px){.map-actions{margin-top:12px}}
.tour-map .map-actions{margin-top:12px}
/* Confirm step for Erledigt / Überspringen, in place of the action bar */
.driver-actions.is-asking{grid-template-columns:auto minmax(0,1fr)}
.driver-actions.is-asking .map-peek{display:none}
.confirm-question{grid-column:1/-1;margin:14px 0 2px;font-size:18px;line-height:1.3;text-align:center}
.confirm-question .small{display:block;font-size:13px}
.confirm-question strong{font-family:var(--display)}
.driver-actions .cancel-action{min-height:60px;padding:0 18px;color:var(--muted)}
.driver-actions .confirm-yes{min-height:60px;font-size:18px;font-weight:700}
.driver-actions .confirm-yes.primary{background:var(--primary);color:var(--primary-ink)}
.driver-actions .confirm-yes{grid-column:1/-1}.driver-actions .cancel-action{grid-column:1/-1;justify-self:start}

/* Office settings live in a dialog so the tour workspace stays visible. */
body.office-settings-open{overflow:hidden}
.office-settings-overlay{position:fixed;z-index:80;inset:0;display:grid;place-items:center;padding:24px;background:color-mix(in srgb,var(--ink) 42%,transparent);backdrop-filter:blur(3px)}
.office-settings-dialog{width:min(900px,100%);max-height:min(86dvh,820px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:0 28px 80px color-mix(in srgb,var(--ink) 35%,transparent)}
.office-settings-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.office-settings-dialog-head h2{margin:0;font-family:var(--display)}.office-settings-close{flex:none}
.office-settings-dialog .office-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.office-settings-dialog .office-settings-grid>.notice{grid-column:1/-1}.office-settings-dialog .settings-block,.office-settings-dialog .office-settings-grid>.card{padding:18px;border-radius:20px;background:var(--ground);box-shadow:0 0 0 1px var(--line)}
@media (max-width:700px){.office-settings-overlay{align-items:end;padding:10px}.office-settings-dialog{max-height:calc(100dvh - 20px);padding:18px;border-radius:22px}.office-settings-dialog .office-settings-grid{grid-template-columns:1fr}.office-settings-dialog .office-settings-grid>.notice{grid-column:auto}}
