/* Mobile UI stabilization pass — 2026-09-17 */

/* Forms: predictable vertical rhythm; prevents labels/inputs/buttons overlapping. */
form > label + label { margin-top: 12px; }
form > input + label,
form > select + label,
form > textarea + label { margin-top: 12px; }

/* Login portals */
body:not(.dispatcher-ui):not(.courier-ui) main.wrap > .card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
body:not(.dispatcher-ui):not(.courier-ui) main.wrap > .card form label { margin: 0; }
body:not(.dispatcher-ui):not(.courier-ui) main.wrap > .card form input { margin: 0 0 6px; min-height: 48px; }
body:not(.dispatcher-ui):not(.courier-ui) main.wrap > .card form .btn { margin-top: 6px; }

/* Dashboard KPI cards */
.kpi > div { min-width: 0; }
.kpi-label { white-space: nowrap; }
.kpi-icon.total { font-size: 0; }
.kpi-icon.total::before { content: "▤"; font-size: 18px; line-height: 1; }

/* Route template mobile editor */
.mobile-template-edit { gap: 12px !important; }
.mobile-template-edit label { display: grid; gap: 6px; margin: 0 !important; }
.mobile-template-edit label input { margin: 0; }
.mobile-template-edit .btn { margin-top: 2px !important; }
.mobile-template-actions { margin-top: 12px !important; }

@media (max-width: 700px) {
  /* Keep all mobile content inside the viewport. */
  .dispatcher-main,
  .dashboard-page,
  .period-card,
  .period-card form,
  .form-shell,
  .form-shell .card { min-width: 0; max-width: 100%; }

  /* Dashboard KPIs: content-sized swipe cards, no wrapped labels. */
  .kpi-grid {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    margin: 0 0 14px !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kpi-grid::-webkit-scrollbar { display: none; }
  .kpi {
    flex: 0 0 auto;
    width: max-content;
    min-width: 174px !important;
    max-width: 220px;
    scroll-snap-align: start;
  }
  .kpi-label { font-size: 12px; }

  /* Statistics period picker: two equal columns contained by the card. */
  .period-card form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100%;
  }
  .period-card form label { min-width: 0; width: 100%; margin: 0 !important; }
  .period-card form input {\n    display: block;\n    box-sizing: border-box;\n    min-width: 0 !important;\n    width: 0 !important;\n    min-inline-size: 100% !important;\n    max-inline-size: 100% !important;\n    -webkit-appearance: none;\n    appearance: none;\n  }
  .period-card form button { grid-column: 1 / -1 !important; width: 100%; }

  /* Statistics metrics: swipe + snap without an intrusive scrollbar. */
  .metric-grid {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    margin: 10px 0 14px !important;
    padding: 2px 2px 8px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .metric-grid::-webkit-scrollbar { display: none; }
  .metric {
    flex: 0 0 145px;
    min-width: 145px !important;
    scroll-snap-align: start;
  }

  /* Courier form actions belong to document flow on iOS. */
  .form-actions {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 10px !important;
    margin-top: 18px !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .form-actions .btn { width: 100%; min-width: 0; }
  .toggle-row { position: relative; z-index: auto; }

  /* Route editor spacing. */
  .mobile-template-edit { margin-top: 12px !important; }

  /* iOS date controls sometimes keep an intrinsic minimum width. */
  input[type="date"] { min-width: 0; }
}

@media (max-width: 390px) {
  .form-actions { grid-template-columns: 1fr; }
  .kpi { min-width: 166px !important; }
  .metric { flex-basis: 138px; min-width: 138px !important; }
}


/* UI Forge iteration #2 — dashboard candidate */
.page-title-icon svg,
.kpi-icon svg { width: 22px; height: 22px; display: block; }
.kpi-icon.total::before { content: none; }
.filter-row label { display: grid; gap: 8px; }
.filter-row label input,
.filter-row label select { margin-top: 0; }

.mobile-brand { display: none; }

@media (max-width: 700px) {
  .dispatcher-top {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 10px !important;
    padding: 8px 14px !important;
    height: 64px !important;
  }
  .mobile-menu {
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
    color: var(--blue);
    font-size: 0 !important;
  }
  .mobile-menu span { font-size: 20px; line-height: 1; }
  .mobile-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -.02em;
    white-space: nowrap;
  }
  .mobile-brand-mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(145deg,#3c9cff,#0567e8);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(8,119,249,.22);
  }
  .top-user { justify-self: end; }
  .avatar { width: 40px; height: 40px; }

  .page-title { align-items: flex-start; }
  .page-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #0877f9;
    background: #eef5ff;
    border-color: #d8e8ff;
  }

  .date-nav {
    width: 100%;
    display: grid !important;
    grid-template-columns: 46px minmax(0,1fr) 46px;
    gap: 10px !important;
    margin-top: 12px !important;
  }
  .date-nav .date-arrow {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px !important;
    padding: 0 !important;
    border-radius: 12px;
    font-size: 20px !important;
  }
  .date-current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    font-size: 16px;
  }
  .date-nav > .btn:not(.date-arrow) { grid-column: 1 / -1; }

  .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .kpi-icon svg { width: 23px; height: 23px; }

  .filter-row label { gap: 9px; }
}


/* UI Forge iteration #3 — approved mockup direction */
@media (max-width: 700px) {
  .mobile-menu svg { width: 23px; height: 23px; display: block; }
  .mobile-menu {
    color: #0877f9;
    background: #fff;
    border-color: #dbe5f1;
    box-shadow: 0 3px 10px rgba(17,33,58,.05);
  }
  .page-sub {
    font-size: 14px !important;
    line-height: 1.35;
    font-weight: 650;
    color: #718096;
    margin-top: 4px;
  }
  .kpi-icon.problem {
    background: #fff0f2;
    color: #ee3f52;
  }
  .kpi-icon.route {
    background: #fff5e8;
    color: #e79218;
  }
}


/* Excel import action */
.excel-action {
  background: #217346 !important;
  border-color: #217346 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(33,115,70,.18);
}
.excel-action:hover { background: #1d633d !important; border-color: #1d633d !important; }
.excel-action svg { width: 19px; height: 19px; flex: none; }


/* UI Forge iteration #4 — compact date return and paired primary actions */
.date-today { gap: 6px; }

@media (max-width: 700px) {
  .date-nav > .date-today {
    grid-column: 2 !important;
    justify-self: center;
    width: auto !important;
    min-height: 34px !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    color: #0877f9;
    border-color: #d6e7fb;
    background: #f5f9ff;
  }

  .head-actions {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1.18fr);
    gap: 8px !important;
    width: 100%;
  }
  .head-actions .btn {
    width: 100%;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
  }
  .head-actions .excel-action svg { width: 17px; height: 17px; }
}


/* UI Forge iteration #5 — generated reference translated to real staging */
@media (max-width: 700px) {
  .dispatcher-top {
    height: 72px !important;
    grid-template-columns: 44px minmax(0,1fr) 44px;
  }
  .mobile-brand {
    gap: 9px;
    line-height: 1.05;
  }
  .mobile-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: transparent;
    color: #1978f2;
    box-shadow: none;
  }
  .mobile-brand-mark svg {
    display: block;
    width: 38px;
    height: 38px;
  }
  .mobile-brand-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    text-align: left;
  }
  .mobile-brand-copy strong {
    color: var(--ink);
    font-size: 17px;
    font-weight: 850;
    letter-spacing: -.025em;
    white-space: nowrap;
  }
  .mobile-brand-copy small {
    color: #718096;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .date-nav > .date-today {
    grid-column: 2 !important;
    min-height: 38px !important;
    padding: 7px 15px !important;
    gap: 7px;
    border: 1px solid #cfe4fb !important;
    border-radius: 999px !important;
    background: #eef7ff !important;
    color: #1878ef !important;
    box-shadow: 0 3px 9px rgba(8,119,249,.08);
    font-size: 13px !important;
    font-weight: 750;
  }

  .head-actions {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    gap: 9px !important;
  }
  .head-actions .btn {
    min-height: 52px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 750;
    white-space: nowrap;
    box-shadow: 0 5px 13px rgba(17,33,58,.09);
  }
  .head-actions .excel-action {
    background: #079b58 !important;
    border-color: #079b58 !important;
  }
  .head-actions .excel-action:hover {
    background: #07884e !important;
    border-color: #07884e !important;
  }
  .head-actions .excel-action svg {
    width: 20px;
    height: 20px;
  }
}


/* UI Forge iteration #6 — final reference fidelity pass */
@media (max-width: 700px) {
  .date-nav > .date-today svg {
    width: 18px;
    height: 18px;
    display: block;
    flex: none;
  }
  .date-nav > .date-today {
    min-height: 36px !important;
    padding: 7px 14px !important;
    background: #eef7ff !important;
    border-color: #cfe4fb !important;
    box-shadow: 0 3px 10px rgba(8,119,249,.07);
  }
  .head-actions .excel-action {
    background: #0aa35c !important;
    border-color: #0aa35c !important;
  }
}


/* UX refinement — 2026-09-18 */
.route-live { margin-top: 8px; font-size: 13px; line-height: 1.4; }
.route-live span { font-weight: 800; margin-left: 6px; }
.filter-details > summary { width: max-content; list-style: none; cursor: pointer; }
.filter-details > summary::-webkit-details-marker { display:none; }
.route-lpu { font-weight: 800; color: #52657a; }
.route-inline-done { margin-top: 10px; }
.phone-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:end; }
.phone-form input,.phone-form .btn { margin:0 !important; }

@media (max-width:700px) {
  .route-detail-actions { display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px !important; }
  .route-detail-actions .btn { width:100%; min-width:0; padding-left:8px; padding-right:8px; font-size:12px; }
  .route-inline-done .btn { width:100%; }
  .route-labline .route-sub:not(.route-lpu) { display:none; }
  .route-time { font-weight:750; }
  .filter-details { padding:10px !important; }
  .filter-details[open] > summary { margin-bottom:12px; }
  .filter-row { display:grid !important; grid-template-columns:1fr !important; }
  .live-search-label { order:-1; }
  .route-card { padding:14px !important; }
  .route-live { overflow-wrap:anywhere; }
}

/* Route-centric operations board — 2026-09-18 */
.route-summary { grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); align-items:stretch; }
.route-card { display:flex; flex-direction:column; min-height:220px; }
.route-card-head strong { font-size:18px; }
.route-courier { margin-top:8px; font-weight:750; }
.route-facts { display:flex; gap:8px 14px; flex-wrap:wrap; margin-top:10px; font-size:13px; color:var(--muted); }
.route-complete { color:var(--green); font-weight:850; }
.route-card .progress-track { margin-top:12px; }
.route-card .route-actions { margin-top:auto; padding-top:14px; }
.route-state-attention { border-color:#f0c66e; }
.route-state-completed { border-color:#b9e4cf; }
.route-kpi-grid { margin-top:14px; }
@media (min-width:1200px) { .route-summary { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (min-width:1600px) { .route-summary { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:700px) { .route-summary { grid-template-columns:1fr; } .route-card { min-height:0; } }

/* Full route/courier workspace refinement — 2026-09-19 */
.route-board-tools{display:grid;grid-template-columns:minmax(220px,2fr) minmax(160px,1fr) minmax(180px,1fr) auto auto;gap:10px;align-items:end;margin-bottom:12px}
.route-board-tools label{margin:0}.route-board-tools .btn{margin:0;min-height:42px}
.route-open-primary{font-weight:850}
.selected-nav{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.selected-nav .btn:last-child{grid-column:2}.selected-note{margin:10px 0}
.route-select-btn{width:100%;margin:0 0 10px}
.selected-card .next-bar{position:relative}
@media(max-width:900px){.route-board-tools{grid-template-columns:1fr 1fr}.route-board-tools label:first-of-type{grid-column:1/-1}}
@media(max-width:560px){.route-board-tools{grid-template-columns:1fr}.route-board-tools label:first-of-type{grid-column:auto}.selected-nav{grid-template-columns:1fr 1fr}.selected-nav .btn{white-space:normal;min-width:0}.selected-card .action-row{grid-template-columns:1fr 1fr}.selected-card .action-row .btn{white-space:normal;overflow-wrap:anywhere}}

.courier-note{border-left:3px solid #f0b429;background:#fff8e6}.courier-note-form{margin:10px 0}.courier-note-form label{margin:0}.courier-note-form input{margin-top:5px}

/* Courier daily history: keep completed trips out of the active work surface. */
.completed-trips{margin-top:16px;border:1px solid var(--line,#d9dee7);border-radius:14px;background:var(--surface,#fff);overflow:hidden}
.completed-trips-summary{cursor:pointer;font-weight:700;padding:14px 16px;list-style:none}
.completed-trips-summary::-webkit-details-marker{display:none}
.completed-trips-summary::after{content:"▾";float:right;transition:transform .15s ease}
.completed-trips[open]>.completed-trips-summary::after{transform:rotate(180deg)}
.completed-trip-list{border-top:1px solid var(--line,#d9dee7)}

/* Keep quick filters fully inside narrow viewports. */
@media (max-width: 768px){
  .quick-filters{display:flex;max-width:100%;min-width:0;overflow:visible;flex-wrap:wrap}
  .quick-filters .filter-chip{flex:0 0 auto;max-width:100%}
}


/* Selected courier card — compact production layout, 2026-09-20 */
.selected-note-editor{margin:10px 0;border:1px solid var(--line,#d9dee7);border-radius:12px;background:#fff;overflow:hidden}
.selected-note-toggle{list-style:none;cursor:pointer;padding:12px 14px;font-weight:800;color:var(--ink);display:flex;align-items:center;justify-content:space-between}
.selected-note-toggle::-webkit-details-marker{display:none}
.selected-note-toggle::after{content:"⌄";color:var(--muted);font-size:18px}
.selected-note-editor[open] .selected-note-toggle::after{transform:rotate(180deg)}
.selected-note-editor .courier-note-form{margin:0;padding:0 14px 14px}
.selected-nav.single-nav{grid-template-columns:1fr}
.selected-nav.single-nav .btn{grid-column:1!important;width:100%}
@media(max-width:560px){
  .selected-card .next-body{padding-top:14px;padding-bottom:14px}
  .selected-card .next-lab{margin-bottom:8px}
  .selected-card .next-meta{margin-top:10px;margin-bottom:10px}
  .selected-card .action-row{gap:8px}
  .selected-card .action-row .btn:first-child{font-weight:850}
  .selected-card .action-row .btn:last-child{font-weight:750}
  .selected-card .selected-nav{margin:10px 0}
  .selected-card .big-actions{gap:8px}
  .selected-note-editor{margin:10px 0}
}


/* Selected courier card — reference fidelity pass */
.courier-head-compact{display:block!important;margin-bottom:12px}
.courier-head-compact .muted{font-size:16px}
.selected-note-toggle{justify-content:flex-start;gap:12px}
.selected-note-toggle::after{margin-left:auto}
.selected-note-toggle>span:nth-child(2){display:grid;gap:2px;min-width:0}
.selected-note-toggle small{display:block;color:var(--muted);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.note-doc-icon{font-size:20px;color:#52657a;line-height:1}
.selected-phone{background:#fff!important;color:var(--ink)!important;border:1px solid var(--line,#d9dee7)!important;box-shadow:none!important}
@media(max-width:560px){
  .courier-head-compact{padding:0 2px!important;margin:0 0 10px!important}
  .courier-head-compact .muted{font-size:15px!important;line-height:1.3}
  .selected-card .next-bar{padding:10px 14px!important;font-size:13px!important}
  .selected-card .next-body{padding:12px 14px 14px!important}
  .selected-card .address-line{gap:10px!important;margin-bottom:8px!important}
  .selected-card .address-pin{width:20px!important;min-width:20px!important}
  .selected-card .next-address{font-size:21px!important;line-height:1.12!important;margin:0!important}
  .selected-card .lab-caption{font-size:13px!important;margin-top:3px!important}
  .selected-card .next-meta{margin:8px 0!important}
  .selected-card .meta-line{font-size:18px!important;gap:8px!important}
  .selected-card .action-row{margin-top:8px!important;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)!important}
  .selected-card .action-row .btn{min-height:58px!important;padding:9px 10px!important;font-size:16px!important;line-height:1.15!important}
  .selected-card .selected-note-editor{margin:10px 0!important;border-radius:10px!important}
  .selected-card .selected-note-toggle{min-height:54px;padding:9px 12px!important}
  .selected-card .selected-note-toggle b{font-size:14px}
  .selected-card .selected-note-toggle small{font-size:11px}
  .selected-card .selected-nav .btn{min-height:50px!important;padding:9px 10px!important;font-size:16px!important}
  .selected-card .big-actions .btn{min-height:54px!important;padding:10px 12px!important;font-size:17px!important}
  .selected-card .courier-note{margin:9px 0!important;padding:8px 10px!important;font-size:13px!important}
}


/* Courier selected card polish — phone/note controls */
.selected-phone{display:flex!important;align-items:center;justify-content:center;gap:7px!important;white-space:nowrap!important}
.phone-icon{width:20px;height:20px;display:inline-flex;color:#2f78ed;flex:none}
.phone-icon svg{width:100%;height:100%;display:block}
.note-doc-icon{width:22px;height:22px;display:inline-flex!important;color:#52657a;flex:none}
.note-doc-icon svg{width:100%;height:100%;display:block}
@media(max-width:560px){
  .selected-card .action-row{grid-template-columns:minmax(0,1.7fr) minmax(112px,.8fr)!important}
  .selected-card .selected-phone{font-size:14px!important;padding:8px 9px!important}
  .selected-card .selected-phone .phone-icon{width:19px;height:19px}
  .selected-card .selected-note-toggle{gap:10px!important}
}


/* Selected phone action — compact and functional */
.selected-phone{appearance:none;cursor:pointer;border-radius:12px!important}
.selected-phone .phone-label{line-height:1;white-space:nowrap}
.selected-phone.has-phone{color:#1f5fbf!important;background:#f7fbff!important;border-color:#cfe0f7!important}
.selected-phone-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:8px 0 10px;padding:10px;border:1px solid var(--line,#d9dee7);border-radius:12px;background:#f8fbff}
.selected-phone-form[hidden]{display:none!important}
.selected-phone-form input{min-width:0;margin:0!important}
.selected-phone-form .btn{margin:0!important;min-height:42px!important;padding:8px 12px!important}
@media(max-width:560px){
  .selected-card .action-row{grid-template-columns:minmax(0,1fr) auto!important}
  .selected-card .selected-phone{width:auto!important;min-width:126px!important;min-height:58px!important;padding:8px 14px!important;font-size:15px!important}
  .selected-card .selected-phone .phone-icon{width:18px;height:18px}
  .selected-phone-form{grid-template-columns:minmax(0,1fr) auto;padding:8px}
}


/* Selected lab + LPU identity line */
.selected-labline{display:flex!important;align-items:center;gap:9px;flex-wrap:wrap}
.selected-lpu{display:inline-flex;align-items:center;min-height:28px;border:1px solid #d8e2ef;border-radius:9px;background:#f7f9fc;overflow:hidden;color:#24364f;font-size:13px;line-height:1}
.selected-lpu-label{display:inline-flex;align-items:center;align-self:stretch;padding:0 7px;background:#edf2f8;color:#687b93;font-size:10px;font-weight:850;letter-spacing:.07em}
.selected-lpu strong{padding:0 9px;font-size:13px;font-weight:850;letter-spacing:.01em}
.selected-card .lab-caption:empty{display:none}
@media(max-width:560px){
  .selected-card .selected-labline{margin-bottom:8px!important;gap:7px}
  .selected-card .selected-lpu{min-height:25px;border-radius:8px}
  .selected-card .selected-lpu-label{padding:0 6px;font-size:9px}
  .selected-card .selected-lpu strong{padding:0 8px;font-size:12px}
}


/* Keep lab and LPU together as one left-to-right identity group. */
.selected-labline{justify-content:flex-start!important;width:100%!important}
.selected-labline .selected-lpu{margin-left:0!important;margin-right:auto!important}
@media(max-width:560px){
  .selected-card .selected-labline{justify-content:flex-start!important;gap:7px!important}
  .selected-card .selected-labline .selected-lpu{margin-left:0!important;margin-right:auto!important}
}


/* LPU badge legibility at arm's-length / in-car viewing. */
.selected-lpu{min-height:32px!important;border-width:1.5px!important;border-color:#c8d6e8!important;box-shadow:0 1px 2px rgba(28,52,84,.06)}
.selected-lpu-label{padding:0 9px!important;font-size:12px!important;font-weight:900!important;color:#536a86!important;letter-spacing:.06em}
.selected-lpu strong{padding:0 11px!important;font-size:16px!important;font-weight:900!important;color:#1d3150!important;letter-spacing:.02em}
@media(max-width:560px){
  .selected-card .selected-lpu{min-height:30px!important;border-radius:8px!important}
  .selected-card .selected-lpu-label{padding:0 8px!important;font-size:11px!important}
  .selected-card .selected-lpu strong{padding:0 10px!important;font-size:15px!important}
}


/* Unified selected-stop lab badges: CMD / INVITRO match LPU height. */
.selected-card .selected-labline>.lab-badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  min-height:32px!important;
  height:32px!important;
  padding:0 11px!important;
  border-width:1.5px!important;
  border-radius:9px!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:.04em!important;
  white-space:nowrap!important;
}
.selected-card .selected-labline>.lab-badge--invitro{padding-left:10px!important;padding-right:10px!important;font-size:14px!important;letter-spacing:.035em!important}
.selected-card .selected-labline>.selected-lpu{height:32px!important;min-height:32px!important;box-sizing:border-box!important}
@media(max-width:560px){
  .selected-card .selected-labline>.lab-badge,
  .selected-card .selected-labline>.selected-lpu{
    height:30px!important;
    min-height:30px!important;
    border-radius:8px!important;
  }
  .selected-card .selected-labline>.lab-badge{padding:0 10px!important;font-size:15px!important}
  .selected-card .selected-labline>.lab-badge--invitro{padding:0 9px!important;font-size:13px!important}
}


/* Smooth in-place courier reorder */
.route-accordion-list .route-item{will-change:transform}
.route-item.reorder-moving{position:relative;z-index:3;box-shadow:0 10px 24px rgba(27,55,92,.14)!important}
.route-item.reorder-error{animation:reorder-error-shake .32s ease 2}
.ajax-reorder-form[data-busy="1"] .btn{opacity:.6;pointer-events:none}
@keyframes reorder-error-shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media(prefers-reduced-motion:reduce){.route-accordion-list .route-item{transition:none!important;animation:none!important}}


/* Compact expanded route card — keep every control inside the card. */
.compact-route-detail{box-sizing:border-box;max-width:100%;overflow:hidden;display:grid;gap:10px;padding:12px 14px!important}
.compact-route-detail>*{min-width:0;max-width:100%;box-sizing:border-box;margin-top:0!important;margin-bottom:0!important}
.compact-route-detail .route-select-btn{width:100%;min-height:44px;padding:9px 12px}
.compact-primary-actions{display:grid!important;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr)!important;gap:8px!important}
.compact-primary-actions .btn{min-width:0;min-height:48px!important;padding:8px 10px!important;font-size:15px!important;white-space:normal;text-align:center}
.compact-note-panel,.compact-phone-panel{width:100%;min-width:0}
.compact-note-panel>summary,.compact-phone-panel>summary{list-style:none;width:100%;min-height:44px;padding:8px 12px!important;font-size:14px!important;box-sizing:border-box}
.compact-note-panel>summary::-webkit-details-marker,.compact-phone-panel>summary::-webkit-details-marker{display:none}
.compact-note-panel .route-detail-form,.compact-phone-panel .route-detail-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:8px 0 0!important;padding:0!important}
.compact-note-panel input,.compact-phone-panel input{min-width:0;width:100%;margin:0!important}
.compact-note-panel .btn,.compact-phone-panel .btn{margin:0!important;min-height:42px!important;padding:8px 11px!important}
.compact-status-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:start}
.compact-status-actions .done-form,.compact-status-actions .problem-panel{min-width:0;width:100%;margin:0!important}
.compact-status-actions>.done-form>.btn,.compact-status-actions>.problem-panel>summary{width:100%;min-height:50px!important;padding:9px 8px!important;font-size:16px!important;box-sizing:border-box}
.compact-status-actions .problem-panel[open]{grid-column:1/-1}
.compact-status-actions .problem-panel .route-detail-form{margin:8px 0 0!important}
.compact-secondary-actions{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start}
.compact-secondary-actions>.reorder-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin:0!important;min-width:0}
.compact-secondary-actions>.reorder-actions form{min-width:0;margin:0!important}
.compact-secondary-actions>.reorder-actions .btn{width:100%;min-width:0;min-height:44px!important;padding:8px 7px!important;font-size:14px!important;white-space:nowrap}
.compact-secondary-actions>.compact-phone-panel>summary{width:auto;white-space:nowrap}
@media(max-width:560px){
  .route-accordion-list{overflow:hidden}
  .route-accordion-list .route-item{max-width:100%;box-sizing:border-box;overflow:hidden}
  .compact-route-detail{padding:10px 12px!important;gap:8px!important;width:100%}
  .compact-primary-actions{grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr)!important}
  .compact-primary-actions .btn{font-size:14px!important;min-height:46px!important}
  .compact-status-actions>.done-form>.btn,.compact-status-actions>.problem-panel>summary{min-height:48px!important;font-size:15px!important}
  .compact-secondary-actions{grid-template-columns:1fr!important}
  .compact-secondary-actions>.compact-phone-panel>summary{width:100%}
  .compact-secondary-actions>.reorder-actions .btn{font-size:14px!important}
}


/* Empty note/phone controls share one compact utility row. */
.compact-tool-actions{display:flex;gap:8px;min-width:0}
.compact-tool-actions:empty{display:none}
.compact-tool-actions>details{flex:1 1 0;min-width:0}
.compact-tool-actions>details>summary{width:100%!important;min-width:0;white-space:nowrap;text-align:center;justify-content:center}
.compact-secondary-actions{grid-template-columns:1fr!important}
.compact-secondary-actions>.reorder-actions{width:100%}
.compact-note-add .route-detail-form,.compact-tool-actions .compact-phone-panel .route-detail-form{width:100%;box-sizing:border-box}
@media(max-width:560px){
  .compact-tool-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .compact-tool-actions>details:only-child{grid-column:1/-1}
  .compact-tool-actions>details>summary{font-size:13px!important;padding:8px 6px!important}
}


/* Final compact expanded-point composition */
.compact-top-actions{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:stretch;max-width:100%}
.compact-top-actions>.btn,.compact-top-actions>details>summary{min-height:44px!important;padding:8px 10px!important;font-size:14px!important;box-sizing:border-box;white-space:nowrap}
.compact-top-actions .route-select-btn{width:auto!important;color:#2868c7!important;background:#f4f8ff!important;border-color:#cfe0f7!important}
.compact-top-actions .compact-map-action{min-width:0;color:#fff!important}
.compact-top-actions>details{min-width:0}
.compact-top-actions>details>summary{list-style:none;display:flex;align-items:center;justify-content:center}
.compact-top-actions>details>summary::-webkit-details-marker{display:none}
.compact-top-actions>details[open]{grid-column:1/-1}
.inline-note-add>summary{min-height:42px!important;padding:7px 11px!important;font-size:14px!important}
.compact-note-display{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px 12px!important}
.note-inline-editor{min-width:0}
.note-inline-editor>summary{list-style:none;cursor:pointer;color:#2868c7;font-weight:800;font-size:13px;white-space:nowrap}
.note-inline-editor>summary::-webkit-details-marker{display:none}
.note-inline-editor[open]{grid-column:1/-1}
.note-inline-editor .route-detail-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:8px 0 0!important;padding:0!important}
.note-inline-editor input{min-width:0;margin:0!important}
.note-inline-editor .btn{min-height:40px!important;margin:0!important;padding:7px 10px!important}
.compact-reorder-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin:0!important}
.compact-reorder-actions form{min-width:0;margin:0!important}
.compact-reorder-actions .btn{width:100%;min-height:42px!important;padding:7px 8px!important;font-size:14px!important}
@media(max-width:560px){
 .compact-route-detail{gap:8px!important}
 .compact-top-actions{grid-template-columns:auto minmax(0,1fr) auto;gap:6px}
 .compact-top-actions>.btn,.compact-top-actions>details>summary{min-height:42px!important;padding:7px 8px!important;font-size:13px!important}
 .compact-top-actions .route-select-btn{font-size:12px!important;padding-left:8px!important;padding-right:8px!important}
 .compact-top-actions .compact-map-action{font-size:13px!important}
 .compact-top-actions .compact-phone-panel>summary,.compact-top-actions .compact-phone-call{font-size:12px!important}
 .compact-status-actions>.done-form>.btn,.compact-status-actions>.problem-panel>summary{min-height:46px!important}
}


/* Expanded point action hierarchy: one primary action, compact utilities. */
.compact-top-actions{display:grid!important;grid-template-columns:minmax(0,1fr) repeat(3,minmax(68px,auto))!important;gap:7px!important;align-items:stretch}
.compact-top-actions .compact-map-action{grid-column:1;min-width:0!important;min-height:48px!important;font-size:15px!important;font-weight:850!important;padding:8px 12px!important}
.compact-top-actions .compact-icon-action{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%!important;min-width:68px!important;min-height:48px!important;padding:5px 7px!important;font-size:11px!important;font-weight:800!important;line-height:1.05!important;white-space:nowrap}
.compact-top-actions .compact-icon-action>span:first-child{font-size:17px;line-height:1}
.compact-top-actions>details{min-width:0;margin:0!important}
.compact-top-actions>details>summary{height:100%}
.compact-top-actions>details[open]{grid-column:1/-1!important}
.compact-top-actions>details[open]>summary{width:max-content!important;min-width:90px!important;height:auto!important}
.compact-top-actions>details .route-detail-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;margin:7px 0 0!important;padding:0!important}
.compact-top-actions>details .route-detail-form input{min-width:0;margin:0!important}
.compact-top-actions>details .route-detail-form .btn{margin:0!important;min-height:40px!important;padding:7px 10px!important}
.compact-reorder-actions .btn{min-height:38px!important;color:#4c607a!important;background:#fbfcfe!important;border-color:#e0e6ee!important;font-size:13px!important;font-weight:750!important}
@media(max-width:560px){
 .compact-top-actions{grid-template-columns:minmax(0,1fr) repeat(3,64px)!important;gap:6px!important}
 .compact-top-actions .compact-map-action{min-height:46px!important;font-size:14px!important;padding:7px 9px!important}
 .compact-top-actions .compact-icon-action{min-width:0!important;min-height:46px!important;padding:4px 3px!important;font-size:10px!important}
 .compact-top-actions .compact-icon-action>span:first-child{font-size:16px}
 .compact-reorder-actions .btn{min-height:38px!important;font-size:13px!important}
}
@media(max-width:390px){
 .compact-top-actions{grid-template-columns:minmax(0,1fr) repeat(3,58px)!important}
 .compact-top-actions .compact-icon-action{font-size:9px!important}
}


/* Modern utility actions in expanded courier point */
.compact-top-actions{grid-template-columns:minmax(0,1fr) repeat(3,72px)!important;gap:8px!important}
.compact-top-actions .compact-map-action{border:0!important;border-radius:12px!important;box-shadow:0 3px 10px rgba(47,116,238,.18)!important;letter-spacing:-.01em}
.compact-top-actions .compact-icon-action{box-sizing:border-box!important;width:72px!important;min-width:72px!important;height:48px!important;min-height:48px!important;border:1px solid #dce5f1!important;border-radius:12px!important;background:#f8fbff!important;color:#203653!important;box-shadow:0 2px 6px rgba(28,52,84,.06)!important;padding:5px 4px!important;transition:transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease!important}
.compact-top-actions .compact-icon-action:active{transform:scale(.96);background:#eef5ff!important;border-color:#c7d9ef!important;box-shadow:none!important}
.compact-top-actions .route-select-btn{width:72px!important;min-width:72px!important;height:48px!important;min-height:48px!important;padding:5px 4px!important;color:#203653!important;background:#f8fbff!important;border-color:#dce5f1!important}
.compact-top-actions .compact-icon-action>span:first-child{display:flex;align-items:center;justify-content:center;height:18px;font-size:16px!important;font-weight:850;color:#3476dc;line-height:1}
.compact-top-actions .compact-icon-action>span:last-child{font-size:10px!important;font-weight:800;line-height:1;letter-spacing:0}
.compact-reorder-actions{gap:8px!important}
.compact-reorder-actions .btn{border-radius:11px!important;background:#f8fafc!important;border:1px solid #e0e7f0!important;box-shadow:none!important;color:#53677f!important;font-weight:750!important}
@media(max-width:560px){
 .compact-top-actions{grid-template-columns:minmax(0,1fr) repeat(3,64px)!important;gap:6px!important}
 .compact-top-actions .compact-icon-action,.compact-top-actions .route-select-btn{width:64px!important;min-width:64px!important;height:46px!important;min-height:46px!important;border-radius:11px!important}
 .compact-top-actions .compact-icon-action>span:last-child{font-size:9.5px!important}
}
@media(max-width:390px){
 .compact-top-actions{grid-template-columns:minmax(0,1fr) repeat(3,58px)!important;gap:5px!important}
 .compact-top-actions .compact-icon-action,.compact-top-actions .route-select-btn{width:58px!important;min-width:58px!important}
 .compact-top-actions .compact-icon-action>span:last-child{font-size:9px!important}
}


/* Align all four quick actions to one visual row. */
.compact-top-actions{align-items:stretch!important}
.compact-top-actions .compact-map-action,
.compact-top-actions .compact-icon-action,
.compact-top-actions .route-select-btn,
.compact-top-actions>details,
.compact-top-actions>details>summary{height:48px!important;min-height:48px!important;max-height:48px!important;box-sizing:border-box!important;margin:0!important}
.compact-top-actions .compact-map-action{display:flex!important;align-items:center!important;justify-content:center!important;border-radius:12px!important;line-height:1.1!important}
.compact-top-actions>details{display:block!important}
.compact-top-actions>details>summary{display:flex!important}
@media(max-width:560px){
 .compact-top-actions .compact-map-action,
 .compact-top-actions .compact-icon-action,
 .compact-top-actions .route-select-btn,
 .compact-top-actions>details,
 .compact-top-actions>details>summary{height:46px!important;min-height:46px!important;max-height:46px!important}
}


/* Consistent modern line icons for courier utility actions. */
.compact-top-actions .action-icon{display:block;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.compact-top-actions .compact-icon-action>span:first-child:has(.action-icon){color:#3476dc}
@media(max-width:560px){.compact-top-actions .action-icon{width:18px;height:18px}}


/* Keep quick-action row stable while phone/note editors are open. */
.compact-top-actions>details.compact-icon-panel{display:contents!important}
.compact-top-actions>details.compact-icon-panel>summary{grid-row:1;height:48px!important;min-height:48px!important;max-height:48px!important;margin:0!important}
.compact-top-actions>details.compact-phone-panel>summary{grid-column:3}
.compact-top-actions>details.compact-note-panel>summary{grid-column:4}
.compact-top-actions>details.compact-icon-panel[open]{display:contents!important}
.compact-top-actions>details.compact-icon-panel[open]>summary{width:72px!important;min-width:72px!important;height:48px!important;min-height:48px!important;max-height:48px!important}
.compact-top-actions>details.compact-icon-panel>.route-detail-form{grid-column:1/-1;grid-row:2;display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px;width:100%;min-width:0;margin:2px 0 0!important;padding:0!important;box-sizing:border-box}
.compact-top-actions>details.compact-icon-panel>.route-detail-form input{width:100%;min-width:0;height:44px!important;margin:0!important;box-sizing:border-box}
.compact-top-actions>details.compact-icon-panel>.route-detail-form .btn{height:44px!important;min-height:44px!important;margin:0!important;padding:7px 12px!important;white-space:nowrap}
@media(max-width:560px){
 .compact-top-actions>details.compact-icon-panel>summary,.compact-top-actions>details.compact-icon-panel[open]>summary{width:64px!important;min-width:64px!important;height:46px!important;min-height:46px!important;max-height:46px!important}
 .compact-top-actions>details.compact-icon-panel>.route-detail-form{gap:6px}
}
@media(max-width:390px){
 .compact-top-actions>details.compact-icon-panel>summary,.compact-top-actions>details.compact-icon-panel[open]>summary{width:58px!important;min-width:58px!important}
}


/* Phone/note editor is a true full-width second row. */
.compact-top-actions .quick-action-editor{grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) max-content!important;align-items:stretch!important;gap:8px!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:2px 0 0!important;padding:0!important;box-sizing:border-box!important}
.compact-top-actions .quick-action-editor>input:not([type=hidden]){grid-column:1!important;display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;margin:0!important;padding:8px 12px!important;box-sizing:border-box!important}
.compact-top-actions .quick-action-editor>button{grid-column:2!important;width:auto!important;min-width:108px!important;height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:8px 12px!important;box-sizing:border-box!important;white-space:nowrap!important}
@media(max-width:390px){.compact-top-actions .quick-action-editor{gap:6px!important}.compact-top-actions .quick-action-editor>button{min-width:96px!important;padding-left:9px!important;padding-right:9px!important}}


/* Final inline editor layout: details participates in the grid without collapsing its form. */
.compact-top-actions{position:relative!important}
.compact-top-actions>details.compact-icon-panel[open]>.quick-action-editor{position:relative!important;grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 108px!important;gap:8px!important;width:100%!important;max-width:none!important;min-width:0!important;margin:4px 0 0!important;overflow:visible!important}
.compact-top-actions .quick-editor-field{display:flex!important;align-items:center!important;min-width:0!important;height:44px!important;border:1px solid #d9e2ee!important;border-radius:11px!important;background:#fff!important;box-shadow:0 1px 3px rgba(26,49,78,.04)!important;overflow:hidden!important}
.compact-top-actions .quick-editor-field .quick-editor-icon{flex:0 0 20px;width:20px;height:20px;margin-left:11px;fill:none;stroke:#54708f;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.compact-top-actions .quick-editor-field input{flex:1 1 auto!important;width:0!important;min-width:0!important;height:42px!important;min-height:42px!important;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;padding:7px 9px!important;font-size:16px!important;color:#162842!important}
.compact-top-actions .quick-editor-field input::placeholder{color:#8b99ab!important;opacity:1}
.compact-top-actions .quick-action-editor>.quick-editor-save{grid-column:2!important;width:108px!important;min-width:108px!important;height:44px!important;min-height:44px!important;border:0!important;border-radius:11px!important;background:#3478ee!important;color:#fff!important;font-weight:800!important;box-shadow:0 2px 7px rgba(47,116,238,.16)!important;padding:7px 9px!important}
@media(max-width:390px){.compact-top-actions>details.compact-icon-panel[open]>.quick-action-editor{grid-template-columns:minmax(0,1fr) 96px!important;gap:6px!important}.compact-top-actions .quick-action-editor>.quick-editor-save{width:96px!important;min-width:96px!important;font-size:14px!important}}


/* Safari-safe phone editor: direct grid child, no <details>/display:contents dependency. */
.compact-top-actions>.phone-editor-toggle{grid-column:3!important;grid-row:1!important}
.compact-top-actions>.phone-editor-toggle.is-active{border-color:#8eb7ff!important;background:#f1f6ff!important;box-shadow:0 0 0 2px rgba(52,120,238,.08)!important}
.compact-top-actions>.phone-inline-editor{grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 116px!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;margin:4px 0 0!important;padding:0!important;box-sizing:border-box!important}
.compact-top-actions>.phone-inline-editor[hidden]{display:none!important}
.phone-inline-field{display:flex!important;align-items:center!important;width:100%!important;min-width:0!important;height:44px!important;border:1px solid #d7e0ec!important;border-radius:11px!important;background:#fff!important;overflow:hidden!important;box-sizing:border-box!important}
.phone-inline-field>svg{flex:0 0 20px;width:20px;height:20px;margin:0 0 0 11px;fill:none;stroke:#55708f;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.phone-inline-field>input{flex:1 1 0!important;width:0!important;min-width:0!important;height:42px!important;min-height:42px!important;margin:0!important;padding:7px 10px!important;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;font-size:16px!important;color:#162842!important;box-sizing:border-box!important}
.phone-inline-field>input::placeholder{color:#8a98aa!important;opacity:1!important}
.compact-top-actions>.phone-inline-editor>.phone-inline-save{width:116px!important;min-width:116px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:7px 10px!important;border:0!important;border-radius:11px!important;background:#3478ee!important;color:#fff!important;font-weight:800!important;box-shadow:0 2px 7px rgba(47,116,238,.16)!important;white-space:nowrap!important}
@media(max-width:390px){.compact-top-actions>.phone-inline-editor{grid-template-columns:minmax(0,1fr) 102px!important;gap:6px!important}.compact-top-actions>.phone-inline-editor>.phone-inline-save{width:102px!important;min-width:102px!important;font-size:14px!important}}


/* Safari-safe note editor, matching the phone editor geometry. */
.compact-top-actions>.note-editor-toggle{grid-column:4!important;grid-row:1!important}
.compact-top-actions>.note-editor-toggle.is-active{border-color:#8eb7ff!important;background:#f1f6ff!important;box-shadow:0 0 0 2px rgba(52,120,238,.08)!important}
.compact-top-actions>.note-inline-editor{grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 116px!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;margin:4px 0 0!important;padding:0!important;box-sizing:border-box!important}
.compact-top-actions>.note-inline-editor[hidden]{display:none!important}
.note-inline-field{display:flex!important;align-items:center!important;width:100%!important;min-width:0!important;height:44px!important;border:1px solid #d7e0ec!important;border-radius:11px!important;background:#fff!important;overflow:hidden!important;box-sizing:border-box!important}
.note-inline-field>svg{flex:0 0 20px;width:20px;height:20px;margin-left:11px;fill:none;stroke:#55708f;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.note-inline-field>input{flex:1 1 0!important;width:0!important;min-width:0!important;height:42px!important;min-height:42px!important;margin:0!important;padding:7px 10px!important;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;font-size:15px!important;color:#162842!important;box-sizing:border-box!important}
.note-inline-field>input::placeholder{color:#8a98aa!important;opacity:1!important}
.compact-top-actions>.note-inline-editor>.note-inline-save{width:116px!important;min-width:116px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:7px 10px!important;border:0!important;border-radius:11px!important;background:#3478ee!important;color:#fff!important;font-weight:800!important;box-shadow:0 2px 7px rgba(47,116,238,.16)!important;white-space:nowrap!important}
@media(max-width:390px){.compact-top-actions>.note-inline-editor{grid-template-columns:minmax(0,1fr) 102px!important;gap:6px!important}.compact-top-actions>.note-inline-editor>.note-inline-save{width:102px!important;min-width:102px!important;font-size:14px!important}}


/* Shared modern action language — courier + dispatcher. Loaded last intentionally. */
.dispatcher-ui .btn,.courier-ui .btn,
.dispatcher-ui .filter-chip,.dispatcher-ui .mobile-menu,
.courier-ui .logout{
  border-radius:11px;
  transition:transform .11s ease,box-shadow .14s ease,filter .14s ease,background-color .14s ease,border-color .14s ease;
  -webkit-tap-highlight-color:transparent;
}
.dispatcher-ui .btn{
  border:1px solid #1768dc;
  background:linear-gradient(180deg,#3d8cff,#2876ed);
  box-shadow:0 4px 11px rgba(38,112,225,.18),inset 0 1px 0 rgba(255,255,255,.18);
}
.dispatcher-ui .btn.alt{
  color:#24466f;background:linear-gradient(180deg,#fff,#f0f6fd);
  border-color:#c2d2e5;box-shadow:0 3px 8px rgba(31,62,101,.09),inset 0 1px 0 #fff;
}
.dispatcher-ui .btn.good{
  border-color:#2da95f;background:linear-gradient(180deg,#58c77e,#42b66c);
  box-shadow:0 4px 11px rgba(39,166,91,.18),inset 0 1px 0 rgba(255,255,255,.18);
}
.dispatcher-ui .btn.bad{
  border-color:#e34250;background:linear-gradient(180deg,#fa6670,#ed505c);
  box-shadow:0 4px 11px rgba(224,63,78,.17),inset 0 1px 0 rgba(255,255,255,.16);
}
.dispatcher-ui .filter-chip,.dispatcher-ui .mobile-menu{
  background:linear-gradient(180deg,#fff,#f3f7fc);border:1px solid #c9d7e7;
  box-shadow:0 2px 7px rgba(31,62,101,.08),inset 0 1px 0 #fff;
}
.dispatcher-ui .filter-chip.active{
  color:#fff;border-color:#1768dc;background:linear-gradient(180deg,#3d8cff,#2876ed);
  box-shadow:0 4px 10px rgba(38,112,225,.18);
}
.dispatcher-ui .side-logout{background:rgba(255,255,255,.055);border-color:rgba(255,255,255,.18);box-shadow:none}
.courier-ui .logout{
  border:1px solid #d4dfec!important;background:linear-gradient(180deg,#fff,#f5f8fc)!important;
  box-shadow:0 2px 7px rgba(31,62,101,.07)!important;padding:8px 12px!important;
}
.dispatcher-ui .btn:active,.courier-ui .btn:active,
.dispatcher-ui .filter-chip:active,.dispatcher-ui .mobile-menu:active,.courier-ui .logout:active{
  transform:translateY(1px) scale(.97)!important;filter:brightness(.98);
  box-shadow:0 1px 3px rgba(25,65,115,.12)!important;
}
.dispatcher-ui button:disabled,.courier-ui button:disabled{
  opacity:.58!important;cursor:not-allowed!important;box-shadow:none!important;transform:none!important;
}


/* Daily route: keep four KPI cards as a contained, equal 2x2 grid on phones.
   This intentionally overrides the generic swipe-card KPI treatment above. */
@media (max-width: 700px) {
  body.dispatcher-ui .route-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }
  body.dispatcher-ui .route-kpi-grid .kpi {
    display: flex !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: initial !important;
    scroll-snap-align: none !important;
    overflow: hidden !important;
  }
  body.dispatcher-ui .route-kpi-grid .kpi-value {
    font-size: 24px !important;
    white-space: nowrap;
  }
}

/* iOS Safari enlarges the viewport when a focused form control renders below 16px.
   Keep native pinch zoom available; only raise editable fields to the safe threshold. */
@media (hover:none) and (pointer:coarse) {
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  select,
  textarea {
    font-size:16px!important;
  }
}
