:root {
  --green: #1f6f43;
  --green-dark: #164e30;
  --bg: #f5f7f6;
  --border: #e0e4e2;
  --text: #1c1f1e;
  --muted: #6b7570;
  --warn: #b8860b;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.topbar {
  background: var(--green);
  color: white;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }

.content { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

.flash { background: #fff3cd; border: 1px solid #ffe08a; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

.auth-box {
  max-width: 360px; margin: 60px auto; background: white;
  padding: 28px; border-radius: 12px; border: 1px solid var(--border);
}
.auth-box h1 { font-size: 1.3rem; margin-top: 0; }

label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px; margin-top: 4px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; font-family: inherit;
}

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: none;
  font-size: 0.95rem; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.5); }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }
.btn-danger { background: white; color: var(--danger); border: 1px solid var(--danger); }

.muted { color: var(--muted); }
.warn { color: var(--warn); font-size: 0.85rem; }
/* Scheduled pickup/delivery time ("📅 15.10. 14:00"): must stand out. */
.sched { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.pill {
  background: rgba(255,255,255,0.15); padding: 6px 12px; border-radius: 20px; font-size: 0.85rem;
}

.content-wide { max-width: 1800px; }

/* Dashboard: map above the table on narrow screens; from 1280px the table
   takes ~60% and the (sticky) map ~40%. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.map-panel { order: -1; }
#orders-list { overflow-x: auto; }
/* Compact inline fields so all columns fit in ~60% of a 1440px screen. */
#orders-list .order-table th, #orders-list .order-table td { padding: 8px 3px; }
#orders-list .inline-form input, #orders-list .inline-form select {
  font-size: 0.85rem; padding: 5px 6px; margin-top: 2px;
}
#orders-list .inline-form select { width: auto; min-width: 7.5em; max-width: 10em; }
#map { width: 100%; height: 450px; max-height: 65vh; border-radius: 8px; }
@media (min-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .map-panel { order: 0; position: sticky; top: 16px; }
}

.panel { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.panel.narrow { max-width: 480px; margin: 0 auto; }

/* Order edit page (/orders/<id>/edit) */
.edit-form fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 14px; padding: 10px 12px 0; }
.edit-form legend { font-weight: 600; padding: 0 4px; }
.edit-form input:disabled { background: var(--bg); color: var(--muted); }
.edit-row { display: flex; gap: 12px; }
.edit-row label { flex: 1; min-width: 0; }
.btn-cancel { background: white; color: var(--text); border: 1px solid var(--border); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-header h2 { margin: 0; font-size: 1.1rem; }

.order-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.order-table th, .order-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.inline-form { display: inline; }

.status { padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.status-waiting { background: #fdecd2; color: #a15c00; }
.status-picked_up { background: #d6e8ff; color: #1a5aa0; }
.status-delivered { background: #d9f2df; color: #1f6f43; }

.driver-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.9rem; }
.driver-list li { padding: 4px 0; border-bottom: 1px solid var(--border); }

.stop-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.stop-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.stat-box {
  flex: 1; background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; text-align: center;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.stats-grid .stat-box { padding: 16px 10px; }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--green); }

.price-box {
  background: #eaf5ee; border: 1px solid #cfe8d8; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 14px; font-size: 1.1rem; font-weight: 600; color: var(--green-dark);
  text-align: center;
}

/* Driver PWA navigation: one <nav> in the top bar's markup. Phones get it
   fixed to the bottom of the screen; from 768px it sits inline in the green
   bar next to the brand. The dispatcher's phone nav (_dispatcher_nav.html)
   looks the same at the bottom and is hidden from 768px. */
.driver-nav, .dispatcher-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: white; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.driver-nav a, .dispatcher-nav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px; font-size: 0.75rem; color: var(--muted); text-decoration: none;
}
.driver-nav a.active, .dispatcher-nav a.active { color: var(--green); font-weight: 600; }
.driver-nav-icon { font-size: 1.3rem; line-height: 1; }
/* Keep the last bit of the page clear of the fixed bar. */
body:has(.driver-nav) .content, body:has(.dispatcher-nav) .content {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .driver-nav {
    position: static; background: none; border: 0; padding: 0;
    margin: 0 auto 0 24px; gap: 4px;
  }
  .driver-nav a {
    flex: none; flex-direction: row; gap: 6px; padding: 6px 14px; border-radius: 20px;
    font-size: 0.9rem; color: rgba(255,255,255,0.85);
  }
  .driver-nav a:hover { background: rgba(255,255,255,0.1); color: white; }
  .driver-nav a.active { background: rgba(255,255,255,0.22); color: white; }
  .driver-nav-icon { font-size: 1rem; }
  body:has(.driver-nav) .content, body:has(.dispatcher-nav) .content { padding-bottom: 60px; }
  .dispatcher-nav { display: none; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Dashboard map */
.map-legend { font-size: 0.85rem; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.legend-jump {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 5px 12px 5px 6px; border-radius: 20px; font: inherit; color: var(--text);
  background: white; border: 1px solid var(--border);
}
.legend-jump:hover:not(:disabled) { border-color: var(--muted); }
.legend-jump:disabled { cursor: default; opacity: 0.4; filter: grayscale(1); background: var(--bg); }
.map-ctrl-btn {
  margin: 10px; height: 40px; padding: 0 14px; border: 0; border-radius: 2px; cursor: pointer;
  background: white; color: #333; font: 500 14px Roboto, Arial, sans-serif;
  box-shadow: rgba(0, 0, 0, 0.3) 0 1px 4px -1px;
}
.map-ctrl-btn:hover { background: #f1f1f1; }
.order-table tr.has-map { cursor: pointer; }
.order-table tr.has-map:hover td { background: #f7faf8; }
.order-link { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@keyframes row-flash { from { background: #fff1b8; } to { background: transparent; } }
.order-table tr.row-flash td { animation: row-flash 2s ease-out; }
.legend-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: white; border: 3px solid; font-size: 0.7rem;
}
.legend-pickup { border-color: #d9822b; }
.legend-delivery { border-color: #1a5aa0; }
.legend-pin {
  display: inline-block; width: 12px; height: 12px; background: #ea4335;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
}
.map-info { font-size: 0.85rem; line-height: 1.5; color: var(--text); }

/* Dispatcher statistics */
.period-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period-link {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.9rem; background: white;
}
.period-link.active { background: var(--green); border-color: var(--green); color: white; }
.period-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.period-form input[type=date] { width: auto; margin: 0; padding: 6px 8px; font-size: 0.9rem; }
.stats-grid-3 { margin: 12px 0 8px; }
@media (min-width: 768px) { .stats-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stat-box small { display: block; margin-top: 2px; font-size: 0.75rem; }
.csv-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-bar .btn:not(.btn-primary) { background: white; color: var(--text); border: 1px solid var(--border); }
.stats-drivers td:not(:first-child), .stats-drivers th:not(:first-child) { text-align: right; width: 7em; }
.stats-drivers tr.selected td { background: #eaf5ee; font-weight: 600; }
.stats-drivers a { color: inherit; }
.driver-filter { width: auto; margin: 0; padding: 6px 8px; font-size: 0.9rem; }

/* Settings: driver management */
.notice { background: #eaf5ee; border: 1px solid #cfe8d8; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.link-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; word-break: break-all; }
.small { font-size: 0.85rem; }
.add-driver { margin-bottom: 14px; }
.add-driver summary { list-style: none; }
.add-driver summary::-webkit-details-marker { display: none; }
.narrow-form { max-width: 420px; margin-top: 12px; }
.order-table tr.inactive td { color: var(--muted); }
.order-table td.actions { white-space: nowrap; }
.order-table td.actions .inline-form + .inline-form { margin-left: 4px; }
/* Edit above Delete, so the column stays narrow at 1440px. */
.order-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.order-actions .btn { width: 100%; white-space: nowrap; }
.btn-edit { background: white; color: var(--green); border: 1px solid var(--green); }
.approx-warn { cursor: pointer; text-decoration: underline dotted; }
/* Driver route page: "route changed" notice, stays in view while scrolling. */
.route-changed {
  position: sticky; top: 8px; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 14px;
  background: #fff8e1; border: 1px solid var(--warn); border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.route-changed[hidden] { display: none; }
/* Dashboard map: moving an order marker (see startMove in dashboard.html). */
.map-move-btn { display: block; margin-top: 8px; }
.map-move-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; padding: 8px 12px; border-radius: 8px;
  background: #fff8e1; border: 1px solid var(--warn); font-size: 0.9rem;
}
.map-move-bar[hidden] { display: none; }
.panel h3 { font-size: 1rem; margin: 20px 0 4px; }

.forgot-link { margin: -6px 0 14px; font-size: 0.85rem; text-align: right; }

/* LV / EN / RU switch at the right end of the green top bar (every page,
   see _lang_switch.html). Inline from 1024px, a compact "LV ▾" menu below
   (at 768-1023px the driver nav already fills the bar).
   The brand's auto margin keeps the actions and the switch on the right;
   the driver nav keeps its own spot next to the brand. */
.topbar { gap: 8px; }
.topbar .brand { margin-right: auto; }
.lang-form { margin: 0; display: contents; }
.lang-switch { display: none; gap: 2px; margin-left: 4px; }
.lang-switch a, .lang-switch button {
  color: white; text-decoration: none; font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 4px 8px; border-radius: 6px; opacity: 0.75; background: none; border: 0; cursor: pointer;
}
.lang-switch a:hover, .lang-switch button:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.lang-switch .active { opacity: 1; background: rgba(255,255,255,0.22); }

.lang-menu { position: relative; flex: none; }
.lang-menu summary {
  list-style: none; cursor: pointer; color: white; font-size: 0.85rem; font-weight: 600;
  padding: 5px 10px; border: 1px solid rgba(255,255,255,0.5); border-radius: 8px; white-space: nowrap;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 130px;
  background: white; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15); padding: 4px; display: flex; flex-direction: column;
}
.lang-menu-list a, .lang-menu-list button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none;
  font: inherit; font-size: 0.95rem; color: var(--text); text-decoration: none; border-radius: 6px; cursor: pointer;
}
.lang-menu-list a:hover, .lang-menu-list button:hover { background: var(--bg); }
.lang-menu-list .active { font-weight: 700; color: var(--green); }
.lang-menu-list .active::after { content: " ✓"; }

@media (min-width: 1024px) {
  .lang-switch { display: flex; }
  .lang-menu { display: none; }
}
@media (min-width: 768px) {
  /* the inline driver nav sits next to the brand (its own auto margin) */
  body:has(.driver-nav) .topbar .brand { margin-right: 0; }
  .topbar .brand { white-space: nowrap; }
}

/* Phones: a wide dispatcher table (settings, statistics, schedule) scrolls
   inside its panel instead of widening the whole page. */
@media (max-width: 767px) {
  .panel { overflow-x: auto; }
}

/* Checkbox + text on one line (labels are block with a full-width input by default) */
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; margin: 0; }

/* Driver route panel under the dashboard map (dashboard.html, routing.py) */
.route-pick { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem; }
.route-pick select { width: auto; max-width: 12em; margin: 0; padding: 6px 8px; font-size: 0.9rem; }
.route-panel { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.route-head strong { font-size: 1rem; }
.route-return { margin: 0; font-size: 0.85rem; }
.route-panel p { margin: 6px 0; }
.route-panel h3 { font-size: 0.9rem; margin: 12px 0 4px; }
.route-stops { list-style: none; padding: 0; margin: 8px 0 0; }
.route-stop {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid var(--border); background: white; cursor: pointer;
}
.route-stop:hover { background: var(--bg); }
.route-stop.dragging { box-shadow: 0 4px 14px rgba(0,0,0,0.18); position: relative; z-index: 2; cursor: grabbing; }
.drag-handle {
  flex: none; border: 0; background: none; font-size: 1.2rem; line-height: 1; color: var(--muted);
  padding: 2px 4px; cursor: grab; touch-action: none; border-radius: 4px;
}
.drag-handle:focus-visible { outline: 2px solid var(--green); }
.route-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--muted);
  font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.route-num-warn { background: none; color: var(--warn); font-size: 1rem; }
.route-body { display: flex; flex-direction: column; min-width: 0; font-size: 0.9rem; }
.route-body strong { font-weight: 600; overflow-wrap: anywhere; }
.route-unrouted .route-stop { cursor: default; }
.route-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.route-all { list-style: none; padding: 0; margin: 8px 0 0; }
.route-all li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 4px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.9rem;
}
.route-all li:hover, .driver-row:hover { background: var(--bg); }
.route-all li small { flex-basis: 100%; padding-left: 20px; }
.route-dot { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.driver-row { cursor: pointer; }
/* Wide screens: the sticky map column scrolls on its own once the stop list
   makes it taller than the window. */
@media (min-width: 1280px) {
  .map-panel { max-height: calc(100vh - 32px); overflow-y: auto; }
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Driver app navigation buttons: big, full width on phones (thumb target) */
.btn-nav {
  display: block; width: 100%; margin: 10px 0; padding: 14px 18px; font-size: 1.05rem; font-weight: 600;
  background: #e8f0fe; color: #1a4fa0; border: 1px solid #c6d7f5;
}
.btn-nav:hover { background: #dbe7fd; }
.btn-primary.btn-nav { background: var(--green); color: white; border-color: var(--green); }
.btn-primary.btn-nav:hover { background: var(--green-dark); }
.route-nav { margin: 0 0 16px; }
.route-nav p { margin: 4px 0 0; }
@media (min-width: 768px) { .btn-nav { display: inline-block; width: auto; min-width: 16em; } }
fieldset.choice { border: 0; padding: 0; margin: 0 0 8px; }
fieldset.choice legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
fieldset.choice label.check { margin-bottom: 8px; font-size: 1rem; }

/* Dashboard bits that phones restyle below (they were inline styles). */
.new-order-buttons { display: flex; gap: 8px; }
#orders-list .inline-form .in-addr, #orders-list .inline-form .in-dt { width: 9em; }
#orders-list .inline-form .in-seq { width: 4em; }
.tel { color: inherit; text-decoration: none; }
@media (min-width: 768px) {
  .phone-only { display: none !important; }
}

/* ---- Dispatcher on phones (< 768px) ----
   Bottom nav instead of the top-bar buttons, the dashboard as two tabs
   (body[data-tab], dashboard.html), the order table as cards and a floating
   "+" for new orders. Wider screens never see any of this. */
@media (max-width: 767px) {
  body:has(.dispatcher-nav) .topbar-actions,
  body:has(.dispatcher-nav) .topbar > .btn { display: none; }
  body:has(.dispatcher-nav) .topbar .brand { white-space: nowrap; }
  .dispatcher-nav a { font-size: 0.7rem; text-align: center; }
  body:has(.dispatcher-nav) .panel { padding: 14px; }
  .settings-logout { text-align: right; margin: 0 0 12px; }

  /* Tabs. The map panel only moves off-screen, so Google Maps keeps its
     size (and its first framing) while the order tab is showing. */
  body:not([data-tab="map"]) .map-panel {
    position: absolute; left: -200vw; width: calc(100vw - 32px); visibility: hidden;
  }
  body[data-tab="map"] .orders-panel, body[data-tab="map"] .fab { display: none; }
  #map { height: calc(100vh - 290px); height: calc(100dvh - 290px); min-height: 280px; max-height: none; }
  .map-panel .panel-header { gap: 8px; }
  .route-pick select { max-width: 9.5em; }
  .map-legend { gap: 6px; font-size: 0.78rem; margin-top: 8px; }
  .legend-jump { padding: 3px 8px 3px 4px; gap: 4px; }
  .legend-dot { width: 18px; height: 18px; border-width: 2px; font-size: 0.6rem; }

  /* Orders tab: no panel frame, every order is its own card. */
  body:has(.dispatcher-nav) .orders-panel { background: none; border: 0; padding: 0; overflow: visible; }
  .orders-panel .panel-header { flex-wrap: wrap; gap: 4px 12px; }
  .new-order-buttons { display: none; }
  .today-count { font-size: 0.85rem; color: var(--muted); }
  .today-count strong { color: var(--green); }
  #orders-list { overflow: visible; }
  #orders-list .order-table, #orders-list .order-table tbody { display: block; }
  #orders-list .order-table thead { display: none; }
  #orders-list .order-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px;
    grid-template-areas: "num status" "pickup pickup" "delivery delivery"
                         "customer customer" "driver seq" "actions actions";
    margin-bottom: 12px; padding: 12px 14px; background: white;
    border: 1px solid var(--border); border-radius: 12px;
  }
  #orders-list .order-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  #orders-list .order-table tr.row-flash { animation: row-flash 2s ease-out; }
  #orders-list td.c-num { grid-area: num; align-self: center; font-weight: 600; }
  #orders-list td.c-status { grid-area: status; align-self: center; }
  #orders-list td.c-pickup { grid-area: pickup; }
  #orders-list td.c-delivery { grid-area: delivery; }
  #orders-list td.c-customer { grid-area: customer; }
  #orders-list td.c-driver { grid-area: driver; }
  #orders-list td.c-seq { grid-area: seq; }
  #orders-list td.c-actions { grid-area: actions; justify-self: end; }
  #orders-list .order-actions { flex-direction: row; }
  #orders-list .order-actions .btn { width: auto; padding: 8px 14px; }
  #orders-list td.c-pickup, #orders-list td.c-delivery { position: relative; padding-left: 1.8em; }
  #orders-list td.c-pickup::before { content: "📦"; position: absolute; left: 0; top: 0; }
  #orders-list td.c-delivery::before { content: "📍"; position: absolute; left: 0; top: 0; }
  #orders-list td.c-driver::before, #orders-list td.c-seq::before {
    content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; color: var(--muted);
  }
  #orders-list .tel { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
  #orders-list .tel::before { content: "📞 "; }
  /* Inline forms fill the card; 16px text so iOS doesn't zoom on focus. */
  #orders-list .inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  #orders-list .inline-form input, #orders-list .inline-form select { font-size: 1rem; padding: 7px 8px; margin: 0; }
  #orders-list .inline-form select { width: 100%; min-width: 0; max-width: none; }
  #orders-list .inline-form .in-addr { flex: 1 1 100%; width: auto; }
  #orders-list .inline-form .in-dt { flex: 1 1 0; width: auto; min-width: 0; }
  #orders-list .inline-form .in-seq { width: 4.5em; }
  #orders-list .inline-form .btn-small { padding: 8px 12px; font-size: 0.85rem; }

  /* Floating "+" (dashboard order tab) with the pickup / delivery choice. */
  body:has(.fab) .content { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 11; }
  .fab summary {
    list-style: none; width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
    background: var(--green); color: white; font-size: 2rem; line-height: 56px; text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: transform 0.15s;
  }
  .fab summary::-webkit-details-marker { display: none; }
  .fab[open] summary { transform: rotate(45deg); }
  .fab-menu {
    position: absolute; right: 0; bottom: 66px; padding: 6px 0; min-width: 13em;
    background: white; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  }
  .fab-menu a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; white-space: nowrap; }
  .fab-menu a:active { background: var(--bg); }
}
