@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f3f4f5;
  --paper: #fff;
  --ink: #17191d;
  --muted: #53575f;
  --line: #d9dce0;
  --quiet: #e9ebee;
  --field: #f4f5f7;
  --control-line: #767c86;
  --strong: #dadee4;
  --selected: #fff;
  --focus: #525c6b;
  --action: #24272d;
  --action-hover: #393d45;
  --on-action: #fff;
  --sidebar: #202226;
  --sidebar-text: #f6f7f9;
  --sidebar-muted: #cdd1d8;
  --sidebar-selected: #363a42;
  --line-panel: #262a30;
  --line-panel-text: #f4f5f7;
  --line-panel-muted: #d0d4da;
  --red: #963735;
  --status-green: #198047;
  --delivery-card: #fff;
  --delivery-detail: #f5f7fa;
  --delivery-border: #b6c0cd;
  --timer-lightness: 25%;
  --timer-overdue: #8e1726;
  --alert: #fae9e8;
  --shadow: 0 2px 4px #17191d09;
  --radius: 17px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font: 15px/1.38 Manrope, system-ui, 'Segoe UI', sans-serif;
}

:root[data-android-shell] { --safe-bottom: 0px; }

:root[data-theme='night'] {
  color-scheme: dark;
  --page: #121315;
  --paper: #1e2024;
  --ink: #f4f5f6;
  --muted: #b9bec7;
  --line: #363a41;
  --quiet: #2a2d33;
  --field: #22252a;
  --control-line: #797f89;
  --strong: #3b414a;
  --selected: #343840;
  --focus: #b9c5d7;
  --action: #eef0f3;
  --action-hover: #d8dce2;
  --on-action: #1b1d22;
  --sidebar: #16181c;
  --line-panel: #292d33;
  --line-panel-text: #f7f8fa;
  --line-panel-muted: #c9ced6;
  --red: #ffb7b4;
  --status-green: #39da82;
  --delivery-card: #2b3038;
  --delivery-detail: #323841;
  --delivery-border: #4a5463;
  --timer-lightness: 70%;
  --timer-overdue: #ed747d;
  --alert: #492b2e;
  --shadow: 0 2px 4px #00000024;
}

:root[data-theme='warcraft'] {
  color-scheme: dark;
  --page: #171311;
  --paper: #272019;
  --ink: #fff0d6;
  --muted: #d3baa0;
  --line: #60432e;
  --quiet: #3a2a21;
  --field: #211a16;
  --control-line: #9c754f;
  --strong: #56392b;
  --selected: #513827;
  --focus: #f7c77f;
  --action: #e0b176;
  --action-hover: #f5ca8d;
  --on-action: #26190f;
  --sidebar: #201613;
  --sidebar-text: #fce6c2;
  --sidebar-muted: #d6b89e;
  --sidebar-selected: #493023;
  --line-panel: #30221a;
  --line-panel-text: #fff2dd;
  --line-panel-muted: #dec6a9;
  --red: #ffaaa1;
  --status-green: #71dfa2;
  --delivery-card: #35281e;
  --delivery-detail: #423024;
  --delivery-border: #8c6441;
  --timer-lightness: 71%;
  --timer-overdue: #ff8b89;
  --alert: #512822;
  --shadow: 0 3px 12px #08050155;
  --radius: 12px;
}

:root[data-theme='warcraft'] :is(h1, h2, .brand) {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -.025em;
}

:root[data-theme='warcraft'] .main > .heading,
:root[data-theme='warcraft'] .orders-page > .heading {
  min-height: 88px;
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--delivery-border);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #261a14 8%, #261a14eb 34%, #261a1450 100%),
    #34241a url('/fantasy-waystation.jpg') right 46% / cover no-repeat;
  box-shadow: inset 0 0 0 3px #21171388, var(--shadow);
}

:root[data-theme='warcraft'] .login-brand {
  background: linear-gradient(90deg, #1d1513 2%, #241a15ab 54%, #241a1510),
    var(--sidebar) url('/fantasy-waystation.jpg') 62% center / cover no-repeat;
}

:root[data-theme='warcraft'] .login-brand::before,
:root[data-theme='warcraft'] .login-brand::after { display: none; }
:root[data-theme='warcraft'] .topbar,
:root[data-theme='warcraft'] .dialog-head { background: linear-gradient(115deg, #39271d, var(--paper) 60%); }
:root[data-theme='warcraft'] .brand-icon { color: #281a10; background: linear-gradient(#f6ce8e, #bb834b); }
:root[data-theme='warcraft'] .sidebar .nav button[aria-current='page'] { border-color: var(--delivery-border); }
:root[data-theme='warcraft'] .line-status.on-line { border-color: var(--delivery-border); }
:root[data-theme='warcraft'] .handoff { background: #8d342b; border-color: #bf7654; }
:root[data-theme='warcraft'] .handoff-thumb { color: #26190f; background: #f0c484; }
:root[data-theme='warcraft'] .batch-order-heading { background: #4a3123; border-inline-start-color: #ddb17b; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a, summary, select, [role='option'], .switch {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
button, select, input[type='checkbox'] { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus-visible + .track, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 36px; font-weight: 760; line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; font-weight: 750; letter-spacing: -.02em; }
h3 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -.015em; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.icon { display: inline-block; flex: none; width: 17px; height: 17px; vertical-align: -.2em; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.28rem; font-weight: 760; letter-spacing: -.03em; }
.brand-icon { display: inline-grid; flex: none; place-items: center; width: 35px; height: 35px; background: var(--action); color: var(--on-action); border-radius: 10px; font: 800 25px/1 system-ui; }
.brand-icon .icon { width: 21px; height: 21px; }
.opening { min-height: 100dvh; display: grid; place-items: center; }
.login-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); }
.login-brand { background: var(--sidebar); color: var(--sidebar-text); padding: clamp(30px, 6vw, 90px); display: flex; flex-direction: column; justify-content: space-between; gap: 48px; position: relative; overflow: hidden; }
.login-brand::before, .login-brand::after { content: ''; pointer-events: none; position: absolute; width: min(48vw, 670px); aspect-ratio: 1; right: -16%; bottom: -22%; border: 1px solid #ffffff24; border-radius: 32%; transform: rotate(-32deg); }
.login-brand::after { right: -4%; bottom: -35%; }
.login-brand h1 { position: relative; z-index: 1; max-width: 10ch; font-size: clamp(3.4rem, 7vw, 7.8rem); }
.login-main { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(100%, 390px); display: grid; gap: 22px; }
.login-form h2 { font-size: 2rem; line-height: 1.1; }
.app-layout { min-height: 100dvh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); min-height: 100dvh; position: sticky; top: 0; height: 100dvh; padding: 24px 16px; display: flex; flex-direction: column; gap: 34px; }
.sidebar .brand { padding-left: 9px; }
.sidebar .brand-icon, .login-brand .brand-icon { background: #eef0f3; color: #202226; }
.nav { display: grid; gap: 5px; }
.nav button { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: transparent; color: var(--sidebar-muted); border: 1px solid transparent; border-radius: 12px; text-align: left; font-weight: 650; }
.nav button[aria-current='page'] { color: var(--sidebar-text); background: var(--sidebar-selected); }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .nav button:hover { color: var(--sidebar-text); background: var(--sidebar-selected); }
}
.nav-icon { width: 22px; display: inline-grid; place-items: center; font-size: 1.28rem; line-height: 1; }
.sidebar-account { margin-top: auto; border-top: 1px solid #454a54; padding: 14px 4px 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.sidebar-account .small { color: var(--sidebar-muted); }
.sidebar-account .avatar { background: var(--sidebar-selected); color: var(--sidebar-text); }
.workspace { min-width: 0; }
.topbar { height: 72px; padding: 0 clamp(24px, 2.4vw, 42px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar .brand { display: none; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.topbar-actions .notifications-button { position: relative; flex: none; width: 44px; padding-inline: 0; border-radius: 50%; }
.unread-badge { position: absolute; top: 1px; right: 0; min-width: 16px; border-radius: 14px; padding: 1px 4px; background: var(--action); color: var(--on-action); text-align: center; font-size: .68rem; }
.today { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.profile-chip { display: flex; align-items: center; gap: 7px; min-height: 44px; border: 0; border-radius: 100px; padding: 4px 10px 4px 4px; font-size: .86rem; font-weight: 720; background: var(--quiet); color: var(--ink); min-width: 0; }
.profile-chip .icon { width: 13px; height: 13px; color: var(--muted); }
.topbar-actions .line-chip { min-height: 44px; padding-inline: 12px; white-space: nowrap; border-radius: 100px; font-size: .86rem; }
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; flex: none; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--quiet); color: var(--ink); font-size: .83rem; font-weight: 800; }
.main { max-width: 1440px; padding: 20px clamp(24px, 2.4vw, 42px) 60px; margin-inline: auto; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.heading .muted { margin-top: 4px; }
.heading > button { flex: none; }
.button { min-height: 44px; padding: 7px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; background: var(--quiet); color: var(--ink); font-weight: 710; text-decoration: none; text-align: center; }
.button:hover:not(:disabled) { background: var(--strong); }
.button:is(.primary, .dark) { background: var(--action); border-color: var(--action); color: var(--on-action); }
.button:is(.primary, .dark):hover:not(:disabled) { background: var(--action-hover); }
.button.danger { color: var(--red); }
.button.compact { min-height: 44px; font-size: .87rem; padding: 6px 11px; }
.button.text-button { min-height: 44px; padding: 5px 8px; border-color: transparent; background: transparent; font-size: .87rem; }
.button.icon-button { width: 48px; padding: 0; }
.button.full { width: 100%; }
.grid { display: grid; gap: 9px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.stat { min-width: 0; padding: 12px; display: grid; align-content: center; justify-items: start; gap: 4px; text-align: start; color: var(--ink); background: var(--paper); border: 0; border-radius: var(--radius); }
button.stat:hover { border-color: var(--control-line); }
.stat.highlight { background: var(--quiet); }
.stat strong { font-size: clamp(1.55rem, 3.3vw, 2rem); font-weight: 850; line-height: 1.05; letter-spacing: -.045em; overflow-wrap: anywhere; }
.stat span { font-size: .86rem; color: var(--muted); font-weight: 700; }
.stat .stat-icon { display: grid; place-items: center; width: 33px; height: 33px; margin-bottom: 8px; border-radius: 9px; background: var(--quiet); color: var(--ink); }
.stat.highlight .stat-icon { background: var(--strong); }
.panel, .order, .empty { background: var(--paper); border: 0; border-radius: var(--radius); }
.panel { padding: 13px; }
.panel h2 { margin-bottom: 7px; }
.panel + .panel { margin-top: 8px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 11px; margin-bottom: 17px; }
.switch-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.switch-label small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.switch { display: inline-flex; flex: none; position: relative; }
.switch input { position: absolute; margin: 0; width: 100%; height: 100%; opacity: 0; }
.track { pointer-events: none; position: relative; display: block; width: 39px; height: 23px; background: var(--strong); border: 1px solid var(--control-line); border-radius: 40px; transition: background .15s; }
.track::before { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch input:checked + .track { background: var(--action); border-color: var(--action); }
.switch input:checked + .track::before { background: var(--on-action); }
.switch input:checked + .track::before { transform: translateX(16px); }
.switch input:disabled + .track { opacity: .55; }
.tabs { display: flex; gap: 3px; padding: 4px; background: var(--quiet); border-radius: 13px; max-width: 100%; }
.tabs button { flex: 1; min-height: 44px; padding: 5px 16px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; font-size: .86rem; font-weight: 750; }
.tabs button[aria-pressed='true'] { color: var(--ink); background: var(--selected); box-shadow: var(--shadow); }
.tab-count { display: inline-block; padding: 2px 6px; margin-left: 6px; border-radius: 5px; background: var(--strong); font-size: 11px; line-height: 1.2; }
.order-filter { display: flex; align-items: center; gap: 9px; }
.order-filter .switch-label { flex: 1; }
.courier .order-controls .tabs { width: 100%; }
.order-tab-page { display: grid; gap: 8px; }
.orders-page.courier .order-tab-page, .orders-page.courier .order-controls { max-width: 710px; }
.empty { padding: 26px 15px; text-align: center; }
.empty .muted { margin: 7px auto 0; max-width: 41ch; }
.order { min-width: 0; overflow: hidden; }
.order.courier-delivery, .available-orders > .order { background: var(--delivery-card); }
.order-head { display: flex; gap: 8px; justify-content: space-between; align-items: start; padding: 14px 15px 0; }
.order-head > div { min-width: 0; }
.order-head > div > p { margin-top: 4px; }
.order-create-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.order-create-actions .button { min-width: 0; min-height: 48px; }
.order-create-actions .icon { width: 21px; height: 21px; }
.batch-destinations { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.batch-destinations li { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-top: 1px solid var(--line); }
.batch-destinations li span:first-child { overflow-wrap: anywhere; }
.batch-destinations li span:last-child { white-space: nowrap; }
.batch-pickup { display: grid; gap: 10px; }
.batch-pickup .batch-destinations li { align-items: center; padding-block: 4px; }
.batch-timeline { display: grid; gap: 8px; list-style: none; padding: 0 0 0 12px; margin: 0; border-left: 2px solid var(--line); }
.batch-timeline .order { box-shadow: none; }
.batch-timeline > li { min-width: 0; }
.batch-current { scroll-margin-top: 12px; }
.batch-step, .batch-timeline summary { padding: 9px 10px; border-radius: 9px; background: var(--field); }
.batch-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; }
.batch-timeline summary { cursor: pointer; }
.batch-accept .form-error:empty { display: none; }
.route-plan-dialog { width: min(660px, calc(100% - 24px)); }
.route-plan-dialog, .details-dialog:has(.route-plan) {
  block-size: var(--stable-route-height, auto); overflow-anchor: none; scrollbar-gutter: stable;
}
.route-plan-note { min-block-size: 2.8em; min-block-size: 2lh; }
.details-dialog .route-plan { padding: 14px; }
.route-map { position: relative; aspect-ratio: 8 / 5; overflow: hidden; background: var(--field); border-radius: 12px; }
.route-map > img { position: absolute; max-width: none; height: auto; }
.route-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-map { --route-ink: var(--line-panel); --route-paper: #f7f8fa; }
.route-map-lines { stroke: var(--route-ink); stroke-width: 4; stroke-dasharray: 8 5; stroke-linecap: round;
  filter: drop-shadow(0 0 1px var(--route-paper)); }
.route-map-bike { fill: none; stroke-width: 5; stroke-dasharray: none; stroke-linejoin: round; }
.route-map-pin rect { fill: var(--route-ink); stroke: var(--route-paper); stroke-width: 2; }
.route-map-pin text { fill: var(--route-paper); text-anchor: middle; font-size: 15px; font-weight: 750; }
.route-map-start rect { fill: var(--route-paper); stroke: var(--route-ink); }
.route-map-start text { fill: var(--route-ink); }
@media (prefers-reduced-motion: no-preference) {
  .route-map-animate polyline { stroke-dasharray: 1 1; animation: draw-bike-route 950ms linear both; }
  @keyframes draw-bike-route { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
}
.route-map-credit { position: absolute; inset: auto 0 0 auto; padding: 3px 6px; background: var(--paper); font-size: .7rem; }
.route-map-yandex { position: absolute; inset: auto 0 0 auto; }
.route-map-yandex img { display: block; width: 94px; height: auto; }
.route-map:not([data-map-provider="osm"]) .route-map-credit,
.route-map:not([data-map-provider="yandex"]) .route-map-yandex { display: none; }
.route-map[data-map-provider="yandex"] [data-bike-route] ~ .route-map-credit { display: block; inset: auto auto 0 0; }
.route-map-unavailable { position: absolute; inset: 6px auto auto 6px; font-size: .75rem; }
.route-map-empty { padding: 14px; border-radius: 12px; background: var(--field); }
.route-plan-stops { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.route-plan-stops li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center;
  gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.route-stop-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--quiet); font-weight: 750; }
.route-plan-stops .icon-button { min-width: 38px; min-height: 44px; padding-inline: 5px; }
.route-plan-stops .route-drag-handle { width: 44px; cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.route-drag-handle span { width: 17px; height: 2px; border-radius: 2px; background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor; }
.route-row-dragging { position: relative; z-index: 1; background: var(--paper); border-radius: 8px;
  box-shadow: var(--shadow); transform: translateY(var(--route-offset, 0px)); }
.route-row-dragging .route-drag-handle { cursor: grabbing; }
.route-plan-stops [data-route-drop="before"] { box-shadow: inset 0 3px #4671ce; }
.route-plan-stops [data-route-drop="after"] { box-shadow: inset 0 -3px #4671ce; }
.bike-timer { display: grid; justify-items: end; flex: 0 1 auto; min-width: 0; max-width: 46%; text-align: right; line-height: 1.15; }
.bike-timer [role="timer"] {
  font-size: 1.16rem; font-variant-numeric: tabular-nums;
  color: hsl(var(--timer-hue, 145), 82%, var(--timer-lightness)); transition: color .25s linear;
}
.bike-timer.overdue :is(.bike-timer-label, [role="timer"]) { color: var(--timer-overdue); }
@media (prefers-reduced-motion: reduce) { .bike-timer [role="timer"] { transition: none; } }
.order-ident, .order-actions, .tag-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-id { font-weight: 820; }
.order-price { font-size: 1.43rem; font-weight: 850; white-space: nowrap; letter-spacing: -.035em; }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 3px 7px; background: var(--quiet); font-size: .75rem; font-weight: 750; color: var(--ink); }
.tag.open { background: var(--strong); }
.tag:is(.open, .heading, .picked_up, .delivered, .returning, .returned, .cancelled)::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor;
}
.tag:is(.heading, .returning, .returned)::before { background: transparent; border: 1px solid currentColor; }
.tag.active-stage::before { background: var(--status-green); border: 0; }
.tag.cancelled, .tag.blocked { background: var(--alert); color: var(--red); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.online .dot { background: var(--status-green); }
.order-body { display: grid; gap: 8px; padding: 9px 14px; }
.route { display: grid; gap: 9px; padding: 12px 0; border-block: 1px solid var(--line); }
.route-stop { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: start; gap: 8px; position: relative; overflow-wrap: anywhere; }
.route-stop.with-action { grid-template-columns: 29px minmax(0, 1fr) auto; }
.route-stop.with-action > .button { align-self: center; }
.route-stop + .route-stop::before { content: ''; width: 1px; height: 9px; border-left: 1px dotted var(--control-line); position: absolute; top: -9px; left: 14px; }
.stop-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: var(--quiet); }
.route-stop + .route-stop .stop-icon { background: var(--strong); }
.stop-icon .icon { width: 15px; height: 15px; }
.route-stop .small { display: block; margin-bottom: 2px; }
.delivery-detail { margin-top: 4px; }
.order-note { padding: 9px 11px; background: var(--field); border-radius: 10px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-attention { display: grid; gap: 8px; border-inline-start: 3px solid var(--red); }
.order-attention-tag { margin-top: 4px; }
.order-actions { display: grid; gap: 6px; padding: 0 14px 12px; }
.order-actions .tag { justify-self: start; }
.delivery-service-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.delivery-service-actions .restaurant-contact { flex: 0 1 auto; min-width: 0; }
.delivery-service-actions .restaurant-contact .icon { flex: none; }
.order-action-pair { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: center; gap: 8px; }
.recipient-card { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; padding: 10px; background: var(--field); border-radius: 12px; }
.recipient-card > div { flex: 1; min-width: 0; }
.recipient-card .icon-button { flex: none; min-height: 44px; width: 44px; }
.delivery-sheet { display: grid; gap: 12px; }
.delivery-section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); overflow-wrap: anywhere; }
.courier-delivery .delivery-section { background: var(--delivery-detail); }
.delivery-section-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.delivery-section-main > div { min-width: 0; }
.delivery-section-main .small, .delivery-address-fields .small, .delivery-comment .small { display: block; margin-bottom: 5px; }
.delivery-section-main strong { display: block; font-size: 1.05rem; line-height: 1.35; font-weight: 750; }
.delivery-section-main .icon-button { flex: none; width: 46px; min-height: 46px; border-radius: 50%; }
.delivery-section-main p.small { margin: 5px 0 0; }
.delivery-comment { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.delivery-comment p { margin: 0; font-size: .96rem; line-height: 1.5; white-space: pre-wrap; }
.delivery-address-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.delivery-address-fields strong { display: block; font-size: 1rem; font-weight: 700; }
.delivery-address .route-note { margin-top: 13px; }
@media (max-width: 390px) { .delivery-address-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.order-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; gap: 4px; margin: 0; padding: 4px 0 0; }
.order-progress li::before { content: ''; display: block; height: 4px; margin-bottom: 5px; border-radius: 4px; background: var(--line); }
.order-progress .done::before { background: var(--control-line); }
.order-progress [aria-current='step'] { color: var(--ink); }
.order-progress [aria-current='step']::before { background: var(--action); }
.line-status { min-height: 76px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; background: var(--quiet); color: var(--ink); border-radius: var(--radius); margin-bottom: 12px; }
.line-status.on-line { background: var(--line-panel); color: var(--line-panel-text); }
.line-status-main { min-width: 0; }
.line-status strong { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; font-weight: 820; }
.line-status p { margin-top: 5px; color: var(--muted); }
.line-status.on-line p { color: var(--line-panel-muted); }
.line-signal { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #e34850; }
.on-line .line-signal { background: #39da82; box-shadow: 0 0 0 4px #39da8230; }
.line-actions { display: flex; justify-content: flex-end; }
.line-status .button { min-height: 44px; flex: none; font-size: .86rem; padding-inline: 12px; }
.line-status .line-button { background: #ffffff20; color: var(--line-panel-text); }
.line-status .line-button:hover:not(:disabled) { background: #ffffff25; }
.restaurant-card h3 { padding: 10px 15px 3px; overflow-wrap: anywhere; }
.restaurant-card h3 .icon { margin-right: 6px; width: 15px; height: 15px; }
.order-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 9px 8px 15px; }
.order-summary .small { overflow-wrap: anywhere; }
.order-summary .button { flex: none; }
.courier-phone { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; font-variant-numeric: tabular-nums; }
.courier-phone .icon { width: 14px; height: 14px; }
.restaurant-table, .restaurant-detail { display: none; }
.restaurant-contact { justify-self: start; text-align: start; }
.restaurant-contact small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.restaurant-table h2 { padding: 14px 16px 12px; font-size: 1.16rem; }
.restaurant-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.restaurant-table th, .restaurant-table td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.restaurant-table th { background: var(--field); color: var(--muted); font-size: .8rem; }
.restaurant-table th:first-child { width: 19%; }
.restaurant-table th:nth-child(2) { width: 38%; }
.restaurant-table th:nth-child(3) { width: 25%; }
.restaurant-table :is(th, td):last-child { text-align: right; }
.restaurant-table .selected { background: var(--quiet); }
.restaurant-table .selected td:first-child { box-shadow: inset 3px 0 var(--action); }
.restaurant-table .small { display: block; }
.order-number.button { margin-left: -5px; min-height: 35px; text-decoration: underline; }

.handoff { position: relative; isolation: isolate; overflow: hidden; width: 100%; min-width: 0; min-height: 56px; border: 1px solid transparent; border-radius: 14px; padding: 4px 10px 4px 56px; background: #b42338; color: #fff; touch-action: pan-y; user-select: none; }
.handoff::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #16764b; transform: scaleX(var(--slide-progress, 0)); transform-origin: left; }
.handoff-label { display: block; text-align: center; font-size: .93rem; font-weight: 800; }
.handoff-thumb { position: absolute; display: grid; place-items: center; top: 5px; left: 5px; width: 44px; bottom: 5px; min-height: 44px; border-radius: 10px; background: #fff; color: #24272d; transform: translateX(var(--slide-offset, 0px)); cursor: grab; }
.handoff::before, .handoff-thumb { transition: transform .16s ease; }
.handoff.dragging::before, .handoff.dragging .handoff-thumb { transition: none; }
.handoff.dragging .handoff-thumb { cursor: grabbing; }
.handoff-thumb .icon { width: 21px; height: 21px; }
.delivery-dock { display: none; }
@media (prefers-reduced-motion: reduce) { .handoff::before, .handoff-thumb { transition: none; } }
.directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.directory .panel + .panel { margin-top: 0; }
.block-reason { white-space: pre-wrap; }
.directory .panel { padding: 12px; display: grid; align-content: start; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.directory .shop-card { position: relative; min-height: 52px; }
.shop-card .directory-heading { padding-inline-end: 40px; }
.shop-card .favorite-star { position: absolute; inset: 4px 4px auto auto; width: 44px; padding: 0; background: transparent; color: var(--muted); }
.shop-card .favorite-star:hover:not(:disabled) { background: var(--quiet); }
.favorite-star .icon { width: 22px; height: 22px; }
.favorite-star[aria-pressed='true'] .icon { color: #b46c13; fill: currentColor; }
:root:is([data-theme='night'], [data-theme='warcraft']) .favorite-star[aria-pressed='true'] .icon { color: #f0bf75; }
.directory-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.courier-card-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; }
.rating { color: var(--ink); font-weight: 700; }
.review .muted { margin: 5px 0 9px; }
.review p:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); }
.setting-row p { margin-top: 4px; }
.order-sound-setting { align-items: flex-end; flex-wrap: wrap; column-gap: 8px; }
.order-sound-setting .field { flex: 1 1 150px; }
.account-profile { display: flex; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.courier-profile-page, .restaurant-settings { display: grid; gap: 8px; }
.courier-profile-page > .panel, .restaurant-settings > .panel { margin-top: 0; }
.restaurant-address { margin-top: 9px; }
.courier-profile-page .line-status { margin-bottom: 0; min-height: 0; }
.account-profile .avatar { width: 52px; height: 52px; font-size: 21px; }
.account-profile p:last-child { margin-top: 4px; }
.profile-menu { display: grid; background: var(--paper); border-radius: var(--radius); }
.profile-menu-button { display: grid; grid-template-columns: 20px minmax(0, 1fr) 16px; gap: 10px; align-items: center; width: 100%; padding: 7px 12px; text-align: left; background: transparent; }
.profile-menu-button + .profile-menu-button { border-top: 1px solid var(--line); border-radius: 0; }
.profile-menu-button > .icon:last-child { width: 16px; color: var(--muted); }
.courier-settings-screen .settings { max-width: none; }
.courier-settings-screen .panel > h2:only-of-type { font-size: 16px; }
.profile-setting-feedback { margin: 10px 0; }
.earnings { display: grid; gap: 9px; max-width: 680px; }
.earnings-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 14px; background: var(--quiet); }
.earnings-week .button { display: grid; gap: 2px; padding: 7px 0; min-height: 48px; min-width: 0; border: 0; background: transparent; }
.earnings-week .button span { font-size: 12px; }
.earnings-week .button strong { font-size: 16px; }
.earnings-week .button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
.earnings-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 79px; }
.earnings-statistics dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 0; }
.earnings-statistics dt { font-size: .85rem; color: var(--muted); }
.earnings-statistics dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 750; }
.earnings-total { display: block; font-size: clamp(29px, 8vw, 42px); line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.earnings-summary .loading-skeleton span:first-child { display: none; }
.earnings-summary .loading-skeleton span:last-child { width: min(35vw, 150px); height: 30px; }
.earnings-list { padding: 0; }
.earnings-list > header, .earnings-entry > summary, .earnings-entry li { padding: 13px 16px; }
.earnings-entry { border-top: 1px solid var(--line); }
.earnings-entry summary { display: grid; grid-template-columns: 1fr auto 16px; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.earnings-entry summary::-webkit-details-marker { display: none; }
.earnings-entry summary .icon { width: 16px; color: var(--muted); }
.earnings-entry[open] summary .icon { transform: rotate(90deg); }
.earnings-entry small { display: block; margin-top: 3px; }
.earnings-entry ul { list-style: none; margin: 0; padding: 0; background: var(--field); border-radius: 0 0 var(--radius) var(--radius); }
.earnings-entry li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.earnings-entry li > div { min-width: 0; overflow-wrap: anywhere; }
.earnings-entry li + li { border-top: 1px solid var(--line); }
.earnings-entry li > span:last-child { white-space: nowrap; }
.earnings-error .button { margin-top: 8px; }
.loading-skeleton { display: grid; gap: 20px; }
.loading-skeleton > div { display: grid; gap: 10px; }
.loading-skeleton span { display: block; background: var(--quiet); border-radius: 10px; }
.loading-skeleton span:first-child { width: min(42%, 200px); height: 16px; }
.loading-skeleton span:last-child { height: 66px; }
.settings { max-width: 710px; }
.zone-green { --zone-color: #237547; }
.zone-orange { --zone-color: #b95212; }
.zone-red { --zone-color: #b8213a; }
.zones-page, [data-zone-content], .zone-selection, .zone-map-page { display: grid; gap: 10px; }
.delivery-quote { max-width: 640px; }
.delivery-quote [data-quote-result] { font-size: 1.25rem; font-weight: 700; }
.zone-restaurant { width: min(390px, 100%); }
.zones-page .heading { margin-bottom: 0; }
.zones-page .heading:has(.zone-profile-back) { justify-content: flex-start; gap: 10px; }
.zone-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.zone-legend-item { justify-content: flex-start; min-width: 0; padding: 8px 11px; border-color: var(--line); font-size: .86rem; text-align: left; }
.zone-legend-item strong { color: var(--ink); margin-left: auto; white-space: nowrap; }
.zone-swatch { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--zone-color); }
.zone-map-frame { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.zone-map { height: max(470px, calc(100dvh - 232px)); background: #e8ebee; }
.zone-map-zoom { position: absolute; z-index: 1; display: grid; gap: 4px; top: 10px; left: 10px; }
.zone-map-zoom .button { padding: 0; width: 44px; font-size: 1.15rem; }
.zone-map-fit { position: absolute; z-index: 1000; top: 10px; right: 10px; }
.zone-map-status { position: absolute; z-index: 1000; top: 64px; right: 10px; max-width: calc(100% - 62px); padding: 7px 10px; border-radius: 8px; background: var(--paper); color: var(--ink); }
.zone-editor { display: grid; gap: 10px; }
.zone-editor-prices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.zone-editor .form-actions { margin: 0; }
.zone-editor .form-error { color: var(--red); }
.timeline { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.timeline li { padding-left: 13px; border-left: 3px solid var(--strong); overflow-wrap: anywhere; }
.timeline .order-note { margin-top: 6px; }
.tracking-dialog { width: min(680px, calc(100% - 24px)); }
.tracking-map { height: clamp(210px, 42vh, 360px); background: var(--field); border-radius: 12px; overflow: hidden; }
.tracking-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tracking-contact .button .icon { width: 16px; height: 16px; }
.notification-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.notification-list li { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.notification-list .unread { background: var(--field); border-inline-start: 3px solid var(--action); }
.report-form { display: grid; gap: 10px; justify-items: start; margin-bottom: 15px; }
.report-fields { width: 100%; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 185px)) auto; align-items: end; justify-content: start; gap: 10px; margin-bottom: 12px; }
.history-filters .form-error { grid-column: 1 / -1; }
.page-controls { margin-top: 12px; }
.report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-table { padding: 0; overflow-x: auto; }
.report-table table { width: 100%; min-width: 525px; border-collapse: collapse; }
.report-table th, .report-table td { padding: 11px 13px; text-align: left; }
.report-table th { font-size: .86rem; color: var(--muted); background: var(--field); }
.report-table td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.report-table td:last-child { white-space: nowrap; }
.forms { display: grid; gap: 9px; }
label.field { display: grid; gap: 5px; font-weight: 650; min-width: 0; }
label.field span { font-size: .9rem; }
input:not([type='checkbox']):not([type='file']), textarea, select { display: block; width: 100%; padding: 7px 10px; min-height: 44px; border: 0; border-radius: 10px; background: var(--quiet); color: var(--ink); font-size: 16px; font-weight: 500; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.field input[aria-invalid='true'] { border-color: var(--red); }
.field-error { color: var(--red); }
textarea { min-height: 98px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-error { color: var(--red); font-weight: 620; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
dialog { padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--radius); width: min(540px, calc(100% - 26px)); max-height: calc(100dvh - 28px); box-shadow: 0 22px 100px #11121650; overflow: auto; }
dialog::backdrop { background: #11121696; }
dialog.profile-screen { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; background: var(--page); }
dialog.screen-dialog { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; block-size: 100dvh;
  max-height: 100dvh; border: 0; border-radius: 0; background: var(--page); box-shadow: none; }
dialog.screen-dialog::backdrop { background: var(--page); }
.screen-dialog .dialog-head { justify-content: flex-start; padding-top: max(8px, env(safe-area-inset-top)); }
.screen-dialog .dialog-body { max-width: 760px; margin-inline: auto; padding-bottom: calc(20px + var(--safe-bottom)); }
.profile-screen .dialog-head { justify-content: flex-start; padding-top: max(8px, env(safe-area-inset-top)); }
.profile-screen .dialog-body { max-width: 710px; margin: 0 auto; padding-bottom: calc(20px + var(--safe-bottom)); }
dialog.courier-settings-screen[open] { overflow: hidden; animation: none; }
.profile-page { position: absolute; inset: 0; overflow: auto; background: var(--page); }
@media (prefers-reduced-motion: no-preference) {
  .page-enter { animation: page-enter .18s ease-out; }
  dialog[open] { animation: dialog-enter .2s ease-out; }
  dialog[open]::backdrop { animation: backdrop-enter .2s ease-out; }
  @keyframes page-enter { from { opacity: .55; transform: translateY(4px); } }
  @keyframes dialog-enter { from { opacity: 0; transform: translateY(8px); } }
  @keyframes backdrop-enter { from { opacity: 0; } }
}
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  :root { --tab-time: 340ms; --tab-ease: cubic-bezier(.42, 0, .24, 1); }
  :root[data-tab-transition] { view-transition-name: none; }
  :root[data-tab-transition]:not([data-tab-part]) .main,
  :root[data-tab-part="orders"] .order-tab-page,
  :root[data-tab-part="restaurants"] .restaurants-tab-page { view-transition-name: tab-page; }
  :root[data-tab-transition="forward"], [data-page-slide="forward"] { --tab-offset: 100%; --tab-exit: -100%; }
  :root[data-tab-transition="backward"], [data-page-slide="backward"] { --tab-offset: -100%; --tab-exit: 100%; }
  :root[data-tab-transition]::view-transition { pointer-events: none; clip-path: inset(var(--app-topbar-height) 0 calc(var(--mobile-nav-height) + var(--delivery-dock-space, 0px))); }
  ::view-transition-group(tab-page) { animation-name: none; }
  ::view-transition-old(tab-page), ::view-transition-new(tab-page) {
    height: auto;
    mix-blend-mode: normal;
    animation: var(--tab-time) var(--tab-ease) both;
  }
  ::view-transition-old(tab-page) { animation-name: tab-slide-out; }
  ::view-transition-new(tab-page) { animation-name: tab-slide-in; }
  [data-page-slide] {
    animation: tab-slide-in var(--tab-time) var(--tab-ease) both;
  }
  .workspace { overflow-x: clip; }
  @keyframes tab-slide-in { from { transform: translateX(var(--tab-offset)); } }
  @keyframes tab-slide-out {
    from { transform: translateY(var(--tab-old-y, 0px)); }
    to { transform: translate(var(--tab-exit), var(--tab-old-y, 0px)); }
  }
}
.dialog-head { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 6px 12px; background: var(--paper); }
.dialog-head button { min-width: 44px; min-height: 44px; padding: 0; border-color: transparent; font-size: 1.35rem; }
.dialog-body { padding: 12px; }
.dialog-body > img { display: block; max-width: 100%; max-height: 67vh; margin: auto; object-fit: contain; border-radius: 10px; }
.photo-preview { width: 100%; max-height: 200px; object-fit: contain; background: var(--quiet); border-radius: 10px; }
.photo-preview[hidden], [hidden] { display: none !important; }
.toasts { position: fixed; z-index: 5; right: 20px; bottom: 20px; display: grid; gap: 7px; max-width: min(370px, calc(100vw - 30px)); pointer-events: none; }
.toast { background: var(--line-panel); color: var(--line-panel-text); border: 1px solid var(--control-line); padding: 12px 15px; border-radius: 12px; box-shadow: var(--shadow); }
.toast.error, .connection { background: var(--alert); color: var(--red); border-color: var(--red); }
.connection { margin-bottom: 15px; padding: 9px 12px; border-radius: 10px; }
.details-dialog .dialog-body { padding: 0; }
.details-dialog .full-order { border: 0; border-radius: 0; box-shadow: none; }
.details-dialog .order-actions { padding-bottom: 20px; }
.order-dialog { width: min(590px, calc(100% - 26px)); }
.order-dialog .dialog-head h2 { font-size: 1.55rem; font-weight: 850; }
.order-dialog .dialog-body { padding: 0; }
.screen-dialog:is(.details-dialog, .order-dialog) .dialog-body { padding-bottom: var(--safe-bottom); }
.order-form { gap: 11px; padding-top: 12px; }
.order-form > :not(footer) { margin-inline: 18px; }
.order-form h3 { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.order-form .street-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.batch-visibility { padding: 14px 18px 0; }
.batch-order { padding-bottom: 16px; }
.batch-order + .batch-order { border-top: 1px solid var(--line); }
.batch-order-heading { min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 12px; padding: 8px 12px; border-inline-start: 4px solid #4671ce; border-radius: 10px; background: #e8efff; }
.batch-order-heading h3 { font-size: 1.06rem; }
:root[data-theme="night"] .batch-order-heading { background: #253550; border-inline-start-color: #77a6f6; }
.address-field { position: relative; min-width: 0; }
.address-options { position: absolute; top: 100%; z-index: 2; min-width: 100%; width: max-content; max-width: min(300px, 85vw);
  max-height: 216px; overflow: auto; margin: 3px 0 0; padding: 4px; list-style: none; border-radius: 11px;
  border: 1px solid var(--control-line); background: var(--paper); box-shadow: var(--shadow); }
.address-options li { display: grid; align-items: center; padding: 8px 10px; min-height: 44px; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.address-options li:hover, .address-options li[aria-selected='true'] { background: var(--quiet); }
[data-field='house'] { right: 0; }
.entrance-note:empty { display: none; }
.address-attribution { margin-top: -8px; }
.route-note { margin-top: -6px; }
.order-form-extra { border-block: 1px solid var(--line); }
.order-form-extra summary { padding: 12px 0; min-height: 44px; font-weight: 750; cursor: pointer; }
.order-form-extra[open] .forms { padding-bottom: 14px; }
.order-form-footer { position: sticky; bottom: 0; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: center; gap: 6px 10px; border-top: 1px solid var(--line); background: var(--paper); padding: 12px 18px calc(12px + var(--safe-bottom)); }
.order-form-footer .form-error { grid-column: 1 / -1; }
.order-form-footer [data-action="quote-batch"] { grid-column: 1 / -1; justify-self: start; }
.order-form-footer:has([data-order-price]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme-option { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 6px 8px; background: var(--field); color: var(--ink); border: 1px solid var(--control-line); border-radius: 12px; font-weight: 720; }
.theme-option[aria-pressed='true'] { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); background: var(--quiet); }
.theme-swatch { display: grid; place-items: center; flex: none; width: 29px; height: 31px; border-radius: 7px; color: #202226; background: #fff; border: 1px solid #797f89; }
.theme-swatch.night { color: #eef0f3; background: #202328; }
.theme-swatch.warcraft { color: #f6d29b; background: #36261c; border-color: #a27349; }
.theme-option[data-value="warcraft"] {
  grid-column: 1 / -1;
  min-height: 70px;
  color: #ffe8c2;
  border-color: #a27349;
  background: linear-gradient(90deg, #211713 0%, #211713ec 42%, #2117136b 100%),
    #38291e url('/fantasy-waystation.jpg') right 47% / cover no-repeat;
}
.theme-option[data-value="warcraft"][aria-pressed='true'] { border-color: #edbe80; box-shadow: inset 0 0 0 1px #edbe80; }
.theme-check { display: none; margin-left: auto; }
.theme-option[aria-pressed='true'] .theme-check { display: inline-flex; }

@media (min-width: 1160px) {
  .restaurant-orders { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 15px; }
  .restaurant-orders .restaurant-cards { display: none; }
  .restaurant-table, .restaurant-detail { display: block; }
}

@media (max-width: 899px) {
  :root { --app-topbar-height: 64px; --mobile-nav-height: calc(59px + var(--safe-bottom)); }
  :root:has(.courier-layout) { --app-topbar-height: 56px; }
  :root:has(.delivery-dock) { --delivery-dock-space: 116px; }
  .line-status { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 7px; padding: 12px; }
  .line-actions .button { width: 100%; min-width: 0; white-space: normal; }
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 21px; gap: 15px; min-height: 115px; }
  .login-brand h1 { display: none; }
  .login-brand::before, .login-brand::after { width: 280px; }
  .login-main { padding: 26px 19px; place-items: start center; }
  .app-layout { display: block; }
  .sidebar { height: auto; min-height: 0; position: fixed; z-index: 2; top: auto; bottom: 0; width: 100%; padding: 5px 9px calc(5px + var(--safe-bottom)); color: var(--ink); background: var(--paper); border-top: 1px solid var(--line); }
  .sidebar > .brand, .sidebar-account { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
  .nav button { flex-direction: column; justify-content: center; padding: 4px 2px; gap: 3px; font-size: .71rem; min-height: 48px; text-align: center; color: var(--muted); }
  .nav button[aria-current='page'] { color: var(--ink); background: var(--quiet); }
  .nav-icon { font-size: 1.11rem; }
  .topbar { height: var(--app-topbar-height); padding-inline: 20px; }
  .topbar > span { display: none; }
  .topbar .brand { display: flex; }
  .topbar .brand-icon { width: 34px; height: 34px; }
  .profile-name { max-width: 120px; }
  .main { padding: 15px 16px calc(68px + var(--safe-bottom)); }
  .main:has(+ .delivery-dock) { padding-bottom: calc(var(--mobile-nav-height) + var(--delivery-dock-space) + 12px); }
  .main:has(+ .delivery-dock) .inline-delivery-swipe { display: none; }
  .delivery-dock { display: block; position: fixed; z-index: 3; inset: auto 0 var(--mobile-nav-height); padding: 7px 14px; background: var(--paper); border-top: 1px solid var(--line); }
  .delivery-dock-inner { max-width: 710px; margin-inline: auto; display: grid; gap: 5px; }
  .delivery-dock-order { width: 100%; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  select.delivery-dock-order { min-height: 40px; padding: 4px 8px; border: 1px solid var(--control-line); border-radius: 9px; background: var(--field); color: var(--ink); }
  .heading { margin-bottom: 10px; gap: 8px; align-items: center; }
  .order-create-actions .button { padding-inline: 8px; font-size: .86rem; }
  .heading h1 { font-size: 29px; }
  .heading > .button { padding: 7px 11px; font-size: .89rem; max-width: 58%; }
  .courier-layout .topbar .brand-icon { width: 32px; height: 32px; }
  .courier-layout .main { padding-top: 16px; }
  .courier .heading { min-height: 40px; margin-bottom: 8px; }
  .courier .order-controls .tabs { padding: 3px; }
  .courier .order-head { padding-top: 11px; }
  .courier .order-body { gap: 9px; padding-block: 9px; }
  .courier .order-actions { gap: 7px; padding-bottom: 12px; }
  .courier .order-actions .button { min-height: 44px; }
  .courier .delivery-sheet { gap: 0; border-radius: 12px; background: var(--field); }
  .courier-delivery .delivery-sheet { background: var(--delivery-detail); }
  .courier .delivery-section { padding: 9px 11px; border: 0; border-radius: 0; background: transparent; }
  .courier .delivery-section + .delivery-section { border-top: 1px solid var(--line); }
  .courier .delivery-section-main { gap: 8px; }
  .courier .delivery-section-main .icon-button { min-height: 44px; width: 44px; }
  .courier :is(.delivery-section-main, .delivery-address-fields, .delivery-comment) .small { margin-bottom: 3px; }
  .courier :is(.delivery-comment, .delivery-address-fields) { margin-top: 10px; padding-top: 9px; }
  .courier .delivery-address-fields { grid-template-columns: repeat(auto-fit, minmax(min(60px, 100%), 1fr)); gap: 6px; }
  .courier .delivery-service-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .courier .delivery-service-actions > :last-child { grid-column: 2; }
  .courier .batch-timeline { padding-left: 8px; }
  .courier .batch-card > .order-body { gap: 7px; padding-inline: 11px; }
  .courier .empty { padding-block: 24px; }
  .courier-profile-page .line-status { padding: 12px 14px; gap: 8px; }
  .stats { gap: 7px; margin-bottom: 16px; }
  .stat { min-height: 82px; padding: 10px 9px; gap: 4px; }
  .stat span { font-size: .76rem; }
  .stat .stat-icon { display: none; }
  .controls { gap: 6px; margin-bottom: 11px; }
  .order-controls .tabs, .order-controls .order-filter { width: 100%; }
  .directory-controls .tabs { width: 100%; }
  .directory-controls .tabs button { flex: 1 1 auto; white-space: nowrap; padding-inline: 5px; font-size: .73rem; }
  .tabs button { padding-inline: 8px; }
  .order-list, .restaurant-cards { gap: 10px; }
  .directory { grid-template-columns: 1fr; }
  .report-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toasts { right: 12px; top: calc(61px + env(safe-area-inset-top)); bottom: auto; }
  .order-dialog { position: fixed; inset: auto 0 0; border-radius: 18px 18px 0 0; margin: 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 12px); }
  .zones-page { gap: 9px; }
  .zone-map { height: max(400px, calc(100dvh - 269px - var(--safe-bottom))); }
  .zone-legend { gap: 5px; }
  .zone-legend-item { display: grid; grid-template-columns: 9px auto; align-content: center; justify-content: center; gap: 2px 6px; padding: 6px 3px; font-size: .72rem; }
  .zone-legend-item strong { grid-column: 2; margin-left: 0; font-size: .9rem; }
  .zone-legend-item .zone-swatch { width: 8px; height: 8px; }
}

@media (max-width: 365px) {
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main, .topbar { padding-inline: 14px; }
  .heading h1 { font-size: 27px; }
  .order-ident { gap: 4px; }
  .order-price { font-size: 1.28rem; }
  .tab-count { margin-left: 3px; padding-inline: 4px; }
  .tabs button { padding-inline: 4px; font-size: .79rem; }
  .form-row { grid-template-columns: 1fr; }
}
