/* Allied Transport — Rates desk
   A plain office tool for Rob and the team: white panels, readable type,
   Allied yellow only for the main action and the current page. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/archivo.woff2") format("woff2"); }

:root {
  --y: #ffc61a;
  --y-soft: #fff6d6;
  --ink: #1a1a18;
  --muted: #5f5f58;
  --bg: #f4f4f1;
  --panel: #fff;
  --line: #e1e1db;
  --line-2: #c4c4bc;
  --ok: #2e7d4a;
  --err: #b42318;
  --r: 10px;
  --f: "Archivo", "Segoe UI", system-ui, sans-serif;
}

/* Shared demo access: keep existing office/customer layouts behind authenticated loading. */
body:not(.cloud-ready) > .app,
body:not(.cloud-ready) > .cust-hero,
body:not(.cloud-ready) > .cust-main,
body:not(.cloud-ready) > .cust-foot,
body:not(.cloud-ready) > .skip { display: none; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 430px; border-top: 5px solid var(--y) !important; }
.auth-card img { margin-bottom: 1.4rem; }
.auth-card h1 { font-size: 1.6rem; line-height: 1.2; margin-top: .35rem; }
.auth-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.auth-card form { display: grid; gap: 1rem; margin: 1.3rem 0; }
.auth-card .footnote { margin-top: 1rem; }
#cloudLoading { font-size: .85rem; color: var(--muted); margin-top: .8rem; }
.cloud-session { display: flex; gap: 1rem; align-items: center; padding: .45rem 1.5rem; background: var(--ink); color: white; font-size: .8rem; }
.cloud-session span { flex: 1; overflow-wrap: anywhere; }
.cloud-session .text-button { color: white; font-size: .8rem; }
.cloud-saving > .app { pointer-events: none; opacity: .65; }
.cloud-saving::after { content: 'Saving shared rates…'; position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: .8rem 1.2rem; border-radius: 8px; z-index: 1000; }
.customer-quote { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.customer-quote:last-child { border: 0; }
.customer-quote > div:first-child { flex: 1 1 220px; }
.customer-quote small { color: var(--muted); }
#savedEstimateDetails { margin-top: 1rem; }
@media (max-width: 760px) { .cloud-session { padding: .5rem 1rem; flex-wrap: wrap; gap: .35rem 1rem; } .cloud-session span { flex-basis: 100%; } }
@media print { .cloud-session, #customerHistory, #historyTitle { display: none !important; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--f); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--y); padding: .6rem 1rem; font-weight: 700; border-radius: 6px; }
.skip:focus { top: 1rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 42px; padding: .55em 1.1em; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: .95rem; line-height: 1.1; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--yellow { background: var(--y); color: var(--ink); border-color: #e6ad00; }
.btn--yellow:hover:not(:disabled) { background: #ffd24d; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover:not(:disabled) { background: #000; }
.btn--line { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.btn--line:hover:not(:disabled) { border-color: var(--ink); }
.btn--sm { min-height: 38px; padding: .4em .85em; font-size: .88rem; }
.btn--block { width: 100%; }
.text-button { border: 0; background: none; padding: .4rem 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); cursor: pointer; }
.text-button:hover { text-decoration-color: currentColor; }
#resetDemo:hover { color: var(--err); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-underline-offset: 3px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem .9rem; background: var(--panel); border-right: 1px solid var(--line); }
.rail__brand { display: flex; align-items: center; gap: .7rem; padding: 0 .4rem; }
.rail__brand img { width: 52px; }
.rail__brand strong { font-size: 1.1rem; }
.rail__nav { display: grid; gap: .2rem; }
.rail__nav button { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 42px; padding: .5rem .7rem; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; text-align: left; cursor: pointer; }
.rail__nav button:hover { background: var(--bg); color: var(--ink); }
.rail__nav button[aria-current="page"] { background: var(--y); color: var(--ink); }
.rail__fuel { margin-top: auto; padding: .8rem; border: 1px solid var(--line); border-radius: var(--r); font-size: .85rem; }
.rail__fuel span { color: var(--muted); }
.rail__fuel strong { display: block; font-size: 1.15rem; }
.rail__fuel small { display: block; color: var(--muted); line-height: 1.4; margin-top: .2rem; }

.shell { display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.top__logo { display: none; width: 40px; }
.top h1 { flex: 1; font-size: 1.15rem; }
.status { font-size: .85rem; color: var(--muted); }
.fuel-chip { display: none; }
.notice { margin: 1rem 1.5rem 0; padding: .6rem .9rem; border-radius: 8px; background: var(--y-soft); border: 1px solid #f0d77a; font-size: .88rem; }
main { padding: 1.25rem 1.5rem 2rem; width: 100%; max-width: 1280px; }
.view { display: none; }
.view.active { display: block; }
.foot { margin-top: auto; padding: 1rem 1.5rem; font-size: .8rem; color: var(--muted); }

/* ---------- Headings and panels ---------- */
.sect-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.sect-head h2 { font-size: 1.5rem; line-height: 1.2; }
.sect-head p { color: var(--muted); margin-top: .2rem; max-width: 60ch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.panel h3 { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; }
.panel__intro { color: var(--muted); margin: .3rem 0 1rem; max-width: 70ch; }
.step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); font-size: .78rem; font-weight: 700; }
.label { display: block; font-size: .85rem; color: var(--muted); }
.footnote { font-size: .82rem; color: var(--muted); }
.badge { font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--y-soft); border: 1px solid #f0d77a; }
.req { color: var(--err); }

/* ---------- Fields ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .3rem; align-content: start; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > label, .checks legend { font-size: .88rem; font-weight: 600; }
.helper { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.field input, .field select { width: 100%; min-height: 42px; padding: .5rem .7rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 1rem; }
.field select { appearance: none; padding-right: 2.2rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a18' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right .7rem center / 1rem no-repeat; }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--y); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--err); background: #fff6f5; }
.field--search { position: relative; }
.field--search .i { position: absolute; left: .7rem; bottom: 12px; color: var(--muted); pointer-events: none; }
.field--search input { padding-left: 2.1rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; padding: .3rem 0; cursor: pointer; font-weight: 600; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--ink); flex: none; }
.form-error:empty { display: none; }
.form-error { margin-top: .9rem; padding: .55rem .8rem; border-radius: 8px; background: #fff0ee; border: 1px solid #f3c2bc; color: var(--err); font-weight: 600; font-size: .92rem; }

/* ---------- Overview ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.quick__item { display: flex; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); text-align: left; cursor: pointer; }
.quick__item:hover { border-color: var(--ink); }
.quick__item .i { width: 1.6rem; height: 1.6rem; }
.quick__item b { display: block; font-size: 1.02rem; }
.quick__item small { color: var(--muted); font-size: .86rem; }
.quick__item--main { background: var(--y); border-color: #e6ad00; }
.quick__item--main small { color: var(--ink); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { border-top: 1px solid var(--line); }
.recent button { display: grid; grid-template-columns: 5rem minmax(0, 1fr) auto 6rem; gap: 1rem; align-items: center; width: 100%; padding: .7rem 1.25rem; border: 0; background: none; text-align: left; cursor: pointer; }
.recent button:hover { background: var(--bg); }
.recent .num { text-align: right; font-weight: 600; }
.recent__empty { padding: .9rem 1.25rem; color: var(--muted); }
.tag { justify-self: end; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }

/* ---------- Quote ---------- */
.quote-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.group { padding: 1rem 0; border-top: 1px solid var(--line); }
.group legend { float: left; width: 100%; margin-bottom: .6rem; font-weight: 700; }
.group legend + * { clear: both; }
.fields--route { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; margin-top: .9rem; }
.route-arrow { display: grid; place-items: center; width: 40px; height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; }
.route-arrow:hover { border-color: var(--ink); }
#quoteForm > .btn--block { margin-top: 1rem; min-height: 48px; font-size: 1rem; }
.options__msg { color: var(--muted); margin-bottom: .5rem; }
.options__msg--warn { color: var(--err); font-weight: 600; }
.options__list { display: grid; gap: .45rem; }
.option { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; }
.option:hover { border-color: var(--ink); }
.option:has(input:checked) { border-color: var(--ink); background: var(--y-soft); box-shadow: inset 4px 0 0 var(--y); }
.option input { margin-top: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--ink); flex: none; }
.option__body { display: grid; gap: .1rem; min-width: 0; }
.option__body span, .option__body small { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { min-height: 36px; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.load-hint { margin-bottom: .8rem; padding: .5rem .75rem; border-radius: 8px; background: var(--bg); font-size: .88rem; }
#loadGroup .fields + .volume, #loadGroup .volume + .extras, #loadGroup .extras + .fields { margin-top: .9rem; }
.volume { padding: .85rem; border: 1px dashed var(--line-2); border-radius: 8px; }
.volume__title { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.volume__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.volume__out { font-size: .86rem; margin-top: .5rem; }
.volume__out:empty, .extras:empty { display: none; }

.docket { position: sticky; top: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; scroll-margin-top: 4.5rem; outline: none; }
.docket__bar { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem 1.1rem; background: var(--bg); border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted); }
.docket__body { padding: 1.1rem; }
.docket__empty { display: grid; justify-items: start; gap: .4rem; padding: .5rem 0; }
.docket__empty h3 { font-size: 1.05rem; }
.docket__empty p { color: var(--muted); }
.docket__mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--bg); font-weight: 800; }
.docket__mark--warn { background: #fff0ee; color: var(--err); }
.docket__total { padding-bottom: .8rem; border-bottom: 2px solid var(--ink); }
.price { font-size: 2rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.price-sub { color: var(--muted); font-size: .9rem; }
.lines { margin: 0; padding: .3rem 0; }
.line { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.line dt { color: var(--muted); }
.line dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.lines--sum { border-top: 2px solid var(--ink); }
.line--total dt, .line--total dd { color: var(--ink); font-weight: 800; }
.line--total:last-child { border-bottom: 0; }
.docket .footnote { margin-top: .7rem; }
.docket__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.docket__actions .btn { flex: 1 1 auto; }

/* ---------- Tables ---------- */
.toolbar { display: grid; grid-template-columns: minmax(170px, 240px) minmax(150px, 190px) minmax(190px, 300px) 1fr; gap: .9rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.toolbar__count { justify-self: end; padding-bottom: .65rem; font-size: .85rem; color: var(--muted); }
.sheet-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .7rem 1.25rem; background: var(--bg); border-bottom: 1px solid var(--line); font-size: .92rem; }
.sheet-bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.table-wrap { overflow-x: auto; }
table.rates { width: 100%; border-collapse: collapse; text-align: left; }
.rates th { padding: .6rem .7rem; background: var(--bg); font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
.rates td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.rates td:first-child, .rates th:first-child { padding-left: 1.25rem; }
.rates tbody tr:hover { background: #fafaf7; }
.rates .num { text-align: right; white-space: nowrap; }
.rates td.cust { font-weight: 700; min-width: 150px; }
.rates .src, .rates .unit, .rates td .band { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.rates .src { max-width: 26ch; }
.rates .dir { color: var(--muted); padding-inline: .25rem; }
.svc { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; white-space: nowrap; background: var(--bg); border: 1px solid var(--line-2); }
.svc--vehicle { background: var(--ink); color: #fff; border-color: var(--ink); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.row-actions button { min-height: 34px; padding: .25rem .7rem; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-size: .85rem; font-weight: 600; cursor: pointer; }
.row-actions button:hover { border-color: var(--ink); }
.row-actions button[data-delete]:hover, .row-actions button[data-delete-quote]:hover { border-color: var(--err); color: var(--err); }
.rates .empty-row td { padding: 1.5rem 1.25rem; text-align: center; color: var(--muted); }
.panel__foot { padding: .9rem 1.25rem 1.1rem; }
.status-select { min-height: 34px; padding: .2rem 1.9rem .2rem .6rem; border: 1px solid var(--line-2); border-radius: 6px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a18' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right .5rem center / .85rem no-repeat; appearance: none; font-size: .88rem; cursor: pointer; }
.quotes { margin-top: 1rem; }
.quotes__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem .2rem; }
.quotes__head .panel__intro { margin-bottom: .6rem; }

/* ---------- Fuel & backup ---------- */
.in-use { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.5rem; margin-bottom: 1rem; }
.in-use strong { display: block; font-size: 1.5rem; }
.in-use p { color: var(--muted); }
.in-use__note { flex-basis: 100%; font-size: .88rem; }
.fuel-ref h3 { margin-top: .2rem; }
.pumps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.pump { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px; }
.pump strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pump strong small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.pump p { font-size: .85rem; color: var(--muted); }
.fuel-ref__text { color: var(--muted); font-size: .92rem; max-width: 80ch; }
.fuel-ref__links { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; margin-top: .7rem; }
.movement, .history, .backup { margin-top: 1rem; }
.formula { font-size: .85rem; padding: .25rem .65rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.movement__inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem 1.25rem; align-items: start; }
.fuel-diff:empty { display: none; }
.movement .fuel-diff { margin: 1rem 0; padding: .55rem .8rem; border-radius: 8px; background: var(--y-soft); font-size: .92rem; }
.preview-wrap { max-height: 400px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.preview { width: 100%; border-collapse: collapse; font-size: .9rem; }
.preview th, .preview td { padding: .45rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.preview thead th { position: sticky; top: 0; background: var(--bg); font-size: .8rem; color: var(--muted); }
.preview .num { text-align: right; white-space: nowrap; }
.preview .changed { font-weight: 700; background: var(--y-soft); }
.preview .muted { color: var(--muted); }
.movement__actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.history__master { margin-bottom: .7rem; }
.history__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.history__list li { display: grid; grid-template-columns: minmax(130px, auto) 1fr auto; gap: .2rem 1rem; align-items: baseline; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; }
.history__list li small { color: var(--muted); }
.history__list .history__empty { display: block; border: 0; padding: 0; color: var(--muted); }
.history__undo { background: var(--bg); }
.history__btn { grid-column: 1 / -1; justify-self: start; margin-top: .3rem; }
.backup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; }
.backup__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.file { cursor: pointer; }

/* ---------- Dialog and toast ---------- */
dialog { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h3 { font-size: 1.2rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 1.25rem; transform: translateX(-50%); max-width: calc(100vw - 2rem); padding: .7rem 1rem; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); visibility: hidden; opacity: 0; transition: opacity .2s, visibility 0s .2s; pointer-events: none; }
.toast.show { visibility: visible; opacity: 1; transition: opacity .2s; }

/* ---------- Mobile dock ---------- */
.dock { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .quote-grid { grid-template-columns: minmax(0, 1fr); }
  .docket { position: static; }
  .movement__inputs, .toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .checks { grid-column: 1 / -1; }
  .toolbar__count { justify-self: start; padding: 0; }
}
@media (max-width: 960px) {
  .app { display: block; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .top { position: sticky; top: 0; z-index: 30; padding: .55rem 1rem; }
  .top__logo { display: block; }
  .status { display: none; }
  .fuel-chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .3rem .75rem; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: .88rem; font-weight: 600; cursor: pointer; }
  .notice, main, .foot { margin-inline: 0; padding-inline: 1rem; }
  .notice { margin: .8rem 1rem 0; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .dock { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .dock button { display: grid; justify-items: center; align-content: center; gap: .15rem; min-height: 60px; border: 0; background: none; color: var(--muted); font-size: .78rem; font-weight: 600; cursor: pointer; }
  .dock .i { width: 1.35rem; height: 1.35rem; }
  .dock button[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--y); background: var(--y-soft); }
}
@media (max-width: 760px) {
  .quick { grid-template-columns: minmax(0, 1fr); }
  .recent button { grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; padding: .7rem 1rem; }
  .recent button span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: .88rem; }
  .recent .tag { grid-column: 2; grid-row: 2; }
  .sect-head .btn { width: 100%; }
  .fields, .movement__inputs, .toolbar, .pumps, .backup { grid-template-columns: minmax(0, 1fr); }
  .fields--route { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .route-arrow { justify-self: center; transform: rotate(90deg); }
  .volume__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel__head .btn, .movement__actions .btn { width: 100%; }
  .toolbar { padding: 1rem; }
  .sheet-bar, .quotes__head { padding-inline: 1rem; }
  /* Tables become stacked cards */
  .rates thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rates, .rates tbody, .rates tr, .rates td { display: block; }
  .rates tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .rates td, .rates td:first-child { padding: .15rem 0; border: 0; }
  .rates td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); }
  .rates td.cust, .rates td.route-cell, .rates td.actions { grid-column: 1 / -1; }
  .rates td.cust::before, .rates td.actions::before { display: none; }
  .rates .num { text-align: left; }
  .rates .src { max-width: none; }
  .row-actions { justify-content: stretch; margin-top: .4rem; }
  .row-actions button { flex: 1; min-height: 40px; }
  .quotes__table tbody tr { grid-template-columns: 1fr 1fr; }
  .history__list li { grid-template-columns: minmax(0, 1fr); }
  .docket__actions .btn { width: 100%; }
}
@media (max-width: 360px) {
  .line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .line dd { text-align: left; }
}
@media print {
  .rail, .dock, .top, .notice, .foot, .toast { display: none !important; }
  body { background: #fff; }
}

/* ---------- Help guide (scripted; the Nucleus mascot from the rate-portal demo) ---------- */
.guide { position: fixed; z-index: 50; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.guide__panel { order: -1; width: min(380px, calc(100vw - 2rem)); max-height: min(620px, calc(100vh - 6rem)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .2); overflow: hidden; outline: none; }
.guide__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: #f6f3ff; }
.guide__bot .mascot { width: 46px; height: 48px; }
.guide__head h2 { font-size: 1.02rem; line-height: 1.3; }
.guide__head p { font-size: .86rem; color: var(--muted); margin-top: .15rem; }
.guide__body { padding: .8rem 1rem 1rem; overflow-y: auto; }
.guide__group { font-size: .78rem; font-weight: 700; color: var(--muted); margin: .4rem 0 .35rem; }
.guide__list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .3rem; }
.guide__list button { width: 100%; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; font-size: .92rem; cursor: pointer; }
.guide__list button:hover { border-color: var(--ink); background: var(--bg); }
.guide__steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .45rem; font-size: .93rem; }
.guide__steps li::marker { font-weight: 700; }
.guide__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: 1rem; }
.guide__note { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.mascot { display: block; overflow: visible; }
.mascot .e { display: none; }
.mascot[data-mood="happy"] .e-happy, .mascot[data-mood="alert"] .e-alert, .mascot[data-mood="think"] .e-think, .mascot[data-mood="relaxed"] .e-relaxed, .mascot[data-mood="wink"] .e-wink { display: inline; }
.help-flash { outline: 3px solid var(--y) !important; outline-offset: 3px; border-radius: 8px; transition: outline-color .3s; }
@media (max-width: 960px) {
  .guide { right: .75rem; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .guide.is-open { left: .75rem; }
  .guide__panel { width: 100%; max-height: calc(100dvh - 160px); }
}
@media print { .guide { display: none !important; } }

/* Customer links */
.links-panel { margin-top: 1rem; }
.slug { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; padding: .1rem .4rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.row-link { display: inline-flex; align-items: center; min-height: 34px; padding: .25rem .7rem; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-size: .85rem; font-weight: 600; text-decoration: none; }
.row-link:hover { border-color: var(--ink); }
.links__table .src { max-width: none; overflow-wrap: anywhere; }
@media (max-width: 760px) { .row-link { flex: 1; justify-content: center; min-height: 40px; } }


/* ==========================================================================
   Layout pass: one heading per page, help in the sidebar, quieter rows
   ========================================================================== */
/* Desktop: the sidebar carries the brand and status, so no top bar. */
@media (min-width: 961px) {
  .app .top { display: none; }
  .notice { margin-top: 1.25rem; }
}
.notice { font-size: .84rem; padding: .45rem .8rem; }
main { padding-top: 1.1rem; }
.sect-head { margin-bottom: 1rem; }
.sect-head p { font-size: .95rem; }

.rail__foot { margin-top: auto; display: grid; gap: .6rem; }
.rail__help { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 42px; padding: .5rem .7rem; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; text-align: left; cursor: pointer; }
.rail__help:hover, .rail__help[aria-expanded="true"] { background: var(--bg); color: var(--ink); }
.rail__fuel { margin-top: 0; width: 100%; text-align: left; background: var(--panel); cursor: pointer; font: inherit; color: inherit; }
.rail__fuel:hover { border-color: var(--ink); }
.rail__status { font-size: .78rem; color: var(--muted); padding: 0 .4rem; }
[data-help].is-new { box-shadow: 0 0 0 3px var(--y); }

.top__help { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.top__help .i { width: 1.2rem; height: 1.2rem; }

/* Overview */
.quick { margin-bottom: 1rem; }
.quick__item { min-height: 76px; }
.quick__item small { display: block; margin-top: .1rem; }
.count { font-weight: 400; color: var(--muted); }

/* Forms: tighter sections, no repeated intros */
#quoteForm .panel__head { margin-bottom: .3rem; }
.group:first-of-type { border-top: 0; padding-top: .4rem; }

/* Rates: grouped rows */
.toolbar__end { justify-self: end; display: grid; justify-items: end; gap: .2rem; }
.toolbar__end .toolbar__count { padding: 0; }
.toolbar__end .text-button { padding: 0; font-size: .88rem; }
.rates .group-row th { padding: .55rem 1.25rem; background: #fafaf7; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); text-align: left; font-size: .95rem; font-weight: 700; color: var(--ink); white-space: normal; }
.rates .group-row th span { font-weight: 400; font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.rates tbody tr.group-row:hover { background: none; }
.rates .route-cell { font-weight: 600; }
.rates .route-cell .src { font-weight: 400; }
.dialog-actions .text-button--danger { margin-right: auto; color: var(--err); text-decoration-color: currentColor; }

/* Fuel: the reference folds away */
details.fuel-ref { margin-top: 1rem; padding: 0; }
details.fuel-ref > summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.25rem; cursor: pointer; list-style: none; }
details.fuel-ref > summary::-webkit-details-marker { display: none; }
details.fuel-ref > summary > span:first-child { display: grid; }
details.fuel-ref > summary small { font-size: .82rem; color: var(--muted); }
details.fuel-ref > summary::after { content: ""; width: .55rem; height: .55rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); margin: 0 .3rem; flex: none; }
details.fuel-ref[open] > summary::after { transform: rotate(-135deg); }
details.fuel-ref[open] > summary { border-bottom: 1px solid var(--line); }
details.fuel-ref > :not(summary) { margin-inline: 1.25rem; }
details.fuel-ref > :last-child { margin-bottom: 1.1rem; }
details.fuel-ref .badge { margin-left: auto; }
.movement { margin-top: 0; }

/* Help panel, opened from the sidebar or the phone header */
.guide { right: 1.25rem; bottom: 1.25rem; }

@media (max-width: 960px) {
  .top { gap: .6rem; }
  .top h1 { font-size: 1.05rem; }
  .guide { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .notice { margin: .7rem 1rem 0; }
  main { padding-top: .9rem; }
}
@media (max-width: 760px) {
  .sect-head { margin-bottom: .8rem; }
  .sect-head h2 { font-size: 1.3rem; }
  .sect-head p { display: none; }
  .toolbar__end { justify-self: start; justify-items: start; }
  .rates .group-row { display: block; padding: 0; border: 0; }
  .rates .group-row th { display: block; padding: .6rem 1rem; }
  .rates td.route-cell::before { display: none; }
  .rates td.route-cell { font-size: 1rem; }
  details.fuel-ref > summary { padding: .85rem 1rem; flex-wrap: wrap; }
  details.fuel-ref > :not(summary) { margin-inline: 1rem; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .text-button--danger { flex-basis: 100%; order: 3; text-align: left; }
}
.movement__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin: 1rem 0; padding: .6rem .6rem .6rem .9rem; border-radius: 8px; background: var(--y-soft); }
.movement__bar .fuel-diff { margin: 0 !important; padding: 0 !important; background: none !important; flex: 1 1 260px; }
.preview-wrap { max-height: 300px; }
@media (max-width: 760px) { .movement__bar .btn { width: 100%; } }
@media (max-width: 960px) {
  /* The header already names the page; keep the heading for screen readers and focus only. */
  .app .sect-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app .sect-head:not(:has(.btn)) { margin: 0; }
}
@media (max-width: 760px) {
  .fields--route { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: .4rem; align-items: end; }
  .route-arrow { width: 36px; height: 42px; transform: none; justify-self: auto; }
  .notice { font-size: .8rem; }
}
@media (max-width: 760px) {
  #rateRows tr:not(.group-row) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  #rateRows td.route-cell { grid-column: 1 / 3; grid-row: 1; }
  #rateRows td.actions { grid-column: 3; grid-row: 1; align-self: start; }
  #rateRows .row-actions { margin-top: 0; }
  #rateRows .row-actions button { flex: none; min-height: 38px; padding-inline: .9rem; }
  #rateRows td:not(.route-cell):not(.actions) { grid-column: auto; }
}
@media (max-width: 760px) {
  #rateRows tr:not(.group-row) > td:nth-child(2), #rateRows tr:not(.group-row) > td:nth-child(4) { grid-column: 1; }
  #rateRows tr:not(.group-row) > td:nth-child(3), #rateRows tr:not(.group-row) > td:nth-child(5) { grid-column: 2 / 4; }
}
@media (max-width: 760px) { .in-use__note { display: none; } }
@media (max-width: 760px) {
  .fields--route { grid-template-columns: minmax(0, 1fr) 42px; gap: .6rem .5rem; }
  .fields--route > .field:first-child { grid-column: 1 / -1; }
  .fields--route > .route-arrow { grid-column: 2; grid-row: 2; width: 42px; transform: rotate(90deg); }
  .fields--route > .field:last-child { grid-column: 1; grid-row: 2; }
}
.cust-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.cust-link:hover { text-decoration-color: currentColor; }
.cust-link .i { width: .9em; height: .9em; color: var(--muted); }
.rates .group-row th .cust-link span.sr-only { margin: -1px; }

/* ==========================================================================
   Customer page (estimate.html): Allied livery, route cards, visual estimate.
   The office desk stays plain; this is what customers see.
   ========================================================================== */
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("assets/archivo-italic.woff2") format("woff2"); }
.cust-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.cust-hero { position: relative; overflow: hidden; color: #fff; background: #1a1a18; border-bottom: 5px solid var(--y); }
.cust-hero::before { content: ""; position: absolute; inset: 0 0 0 38%; background: url("assets/fleet-1536.jpg") 30% 70% / cover no-repeat; opacity: .55; }
.cust-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #1a1a18 36%, rgba(26, 26, 24, .55) 62%, rgba(26, 26, 24, .1)); }
.cust-hero__inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.5rem 2rem; display: flex; align-items: center; gap: 1.5rem; }
.cust-hero__logo { width: 92px; padding: 8px 10px; background: #fff; border-radius: 12px; flex: none; }
.cust-hero__kicker { color: var(--y); font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
.cust-hero h1 { font-style: italic; font-weight: 850; font-stretch: 115%; text-transform: uppercase; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1; letter-spacing: -.01em; margin: .25rem 0 .6rem; }
.cust-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.chip-fuel { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; background: var(--y); color: var(--ink); font-weight: 700; font-size: .85rem; }

.cust-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.5rem 2rem; }
.cust-main > .notice { margin: 0 0 1.5rem; }
.cust-unknown { max-width: 520px; margin: 2rem auto; }
.cust-section + .cust-section { margin-top: 2rem; }
.cust-section__head { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; margin-bottom: 1rem; }
.cust-section__head h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; }
.cust-section__head p { color: var(--muted); }
.cust-num { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: var(--y); font-size: .9rem; font-weight: 800; }

/* Route cards */
.route-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.route-card { position: relative; display: grid; gap: .35rem; padding: 1rem 1.05rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.route-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.route-card input { position: absolute; opacity: 0; pointer-events: none; }
.route-card:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.route-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 -4px 0 var(--y), 0 6px 18px rgba(0, 0, 0, .08); }
.route-card__trip { display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: center; gap: .5rem; font-size: .98rem; }
.route-card__trip b { overflow-wrap: anywhere; }
.route-card__line { height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); position: relative; }
.route-card__line::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--line-2); border-right: 0; }
.route-card:has(input:checked) .route-card__line { background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 11px); }
.route-card:has(input:checked) .route-card__line::after { border-left-color: var(--ink); }
.route-card__rate { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.route-card__kinds { font-size: .82rem; color: var(--muted); }

/* Estimate card */
.est-card { position: sticky; top: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; outline: none; scroll-margin-top: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.est-card__top { padding: 1.2rem 1.3rem 1.1rem; background: #1a1a18; color: #fff; }
.est-card__top--empty { background: #fff; color: var(--ink); text-align: center; padding: 2rem 1.3rem; }
.est-card__label { font-size: .85rem; color: rgba(255, 255, 255, .7); margin-top: 1rem; }
.est-total { font-style: italic; font-weight: 850; font-stretch: 112%; font-size: clamp(2.1rem, 4vw, 2.8rem); line-height: 1.05; color: var(--y); font-variant-numeric: tabular-nums; }
.est-card__sub { font-size: .9rem; color: rgba(255, 255, 255, .8); margin-top: .2rem; }
.est-card__title { font-size: 1.1rem; margin-top: 1rem; }
.est-card__hint { color: var(--muted); margin-top: .9rem; }
.est-card__body { padding: 1.1rem 1.3rem 1.3rem; }

/* Route line with the truck */
.trip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.trip__dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--y); background: transparent; }
.trip__dot--end { background: var(--y); }
.est-card__top--empty .trip__dot { border-color: var(--line-2); }
.est-card__top--empty .trip__dot--end { background: var(--line-2); }
.trip__road { position: relative; height: 26px; background: linear-gradient(var(--line-2), var(--line-2)) center / 100% 2px no-repeat; }
.est-card__top:not(.est-card__top--empty) .trip__road { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 10px, transparent 10px 18px) center / 100% 2px no-repeat; }
.trip__names { display: flex; justify-content: space-between; gap: 1rem; margin-top: .3rem; font-weight: 700; font-size: .95rem; }
.trip__names span:last-child { text-align: right; }

/* Price split */
.mix { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.mix__part { flex-basis: 0; min-width: 4px; }
.mix__part--freight, .mix__key--freight { background: #1a1a18; }
.mix__part--fuel, .mix__key--fuel { background: var(--y); }
.mix__part--fees, .mix__key--fees { background: #9a9a92; }
.mix__legend { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .35rem; }
.mix__legend li { display: grid; grid-template-columns: 12px 1fr auto 3.2rem; align-items: center; gap: .6rem; font-size: .92rem; }
.mix__legend b { font-variant-numeric: tabular-nums; }
.mix__legend small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mix__key { width: 12px; height: 12px; border-radius: 3px; }
.est-working { margin-top: 1rem; border-top: 1px solid var(--line); }
.est-working summary { padding: .7rem 0; font-weight: 600; cursor: pointer; }
.est-card .footnote { margin-top: .9rem; }

.cust-foot { width: 100%; max-width: 1180px; margin: auto auto 0; padding: 1rem 1.5rem 1.5rem; font-size: .82rem; color: var(--muted); }

@media (max-width: 1180px) { .est-card { position: static; } }
@media (max-width: 760px) {
  .cust-hero::before { inset: 0; opacity: .35; }
  .cust-hero::after { background: linear-gradient(180deg, rgba(26, 26, 24, .7), #1a1a18 85%); }
  .cust-hero__inner { padding: 1.1rem 1rem 1.4rem; flex-direction: column; align-items: flex-start; gap: .9rem; }
  .cust-hero__logo { width: 70px; }
  .cust-main { padding: 1.1rem 1rem 1.5rem; }
  .cust-section__head { flex-direction: column; }
  .route-cards { grid-template-columns: minmax(0, 1fr); }
  .cust-foot { padding-inline: 1rem; }
}
@media print {
  .cust-page { background: #fff; }
  .cust-hero { color: #000; background: #fff; border-bottom-width: 3px; }
  .cust-hero::before, .cust-hero::after { display: none; }
  .cust-hero h1 { color: #000; }
  .cust-page #estForm, .cust-page .docket__actions, .cust-page #eRoutes, .cust-page .cust-section__head, .cust-page .toast { display: none !important; }
  .cust-page .quote-grid { display: block; }
  .est-card { box-shadow: none; position: static; }
  .est-card__top { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .est-total { color: #000; }
  .est-card__label, .est-card__sub { color: #444; }
  .trip { display: none; }
}
@media (max-width: 760px) {
  /* Compact route cards: the trip on one line, rate and types on the next. */
  .route-cards { gap: .45rem; }
  .route-card { grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .75rem; padding: .7rem .85rem; }
  .route-card__trip { grid-column: 1 / -1; font-size: .95rem; }
  .route-card__rate { font-size: .95rem; }
  .route-card__kinds { align-self: center; text-align: right; }
}

/* The Allied superlink from the website, in the estimate card */
.trip__road { background: linear-gradient(var(--line-2), var(--line-2)) center / 100% 2px no-repeat; height: 14px; }
.rig { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.rig--parked { width: 88%; margin: 0 auto 1.1rem; }
.est-card__top:not(.est-card__top--empty) { overflow: hidden; }
.rig--drive { width: calc(100% + 1.3rem); max-width: none; margin: .9rem -1.3rem -.4rem 0; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.rig--in { animation: rig-in 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rig-in { from { transform: translateX(70%); opacity: 0; } 30% { opacity: 1; } }
@media print { .rig { display: none; } }

.route-request-form { margin-bottom: 1rem; }
.route-request-form h3 { margin-top: 0; }
.route-request-form .field { margin-bottom: .8rem; }
.route-request-form textarea { width: 100%; padding: .65rem .8rem; border: 1px solid var(--line-2); border-radius: 7px; background: white; font: inherit; color: inherit; resize: vertical; }
.cust-section__head > div { flex: 1; min-width: 0; }
.cust-section__head > div > p { margin-top: .35rem; }
@media(max-width:760px) { .cust-section__head { align-items: flex-start; } }
.route-request-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.route-requests-section { margin-top: 1.5rem; }
.route-request-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.route-request-row p { margin: .35rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.route-request-row small { color: var(--muted); }
.route-request-row select { max-width: 10rem; }
@media(max-width:760px) { .route-request-row { align-items: flex-start; flex-direction: column; gap: .5rem; } }
@media print { #routeRequestToggle, #routeRequestForm, #routeRequestSuccess, .route-requests-section { display:none !important; } }

/* Route pulse: a dot travels from the start town to the destination, which answers with a ring. */
.trip__road { position: relative; }
.trip__pulse { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--y); box-shadow: 0 0 0 3px rgba(255, 198, 26, .3), 0 0 12px 2px rgba(255, 198, 26, .7); animation: trip-pulse 2.4s cubic-bezier(.45, 0, .55, 1) infinite; }
.est-card__top--empty .trip__pulse { background: var(--ink); box-shadow: 0 0 0 3px rgba(26, 26, 24, .15), 0 0 10px 1px rgba(26, 26, 24, .35); }
@keyframes trip-pulse {
  0% { left: 0; opacity: 0; transform: scale(.6); }
  12% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  100% { left: 100%; opacity: 0; transform: scale(.6); }
}
.trip--live .trip__dot--end { position: relative; }
.trip--live .trip__dot--end::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--y); opacity: 0; animation: trip-arrive 2.4s ease-out infinite; }
.est-card__top--empty .trip--live .trip__dot--end::after { border-color: var(--ink); }
@keyframes trip-arrive { 0%, 82% { transform: scale(.4); opacity: 0; } 88% { opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.est-card__top--empty .trip--live .trip__dot { border-color: var(--ink); }
.est-card__top--empty .trip--live .trip__dot--end { background: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .trip__pulse { animation: none; left: 50%; }
  .trip--live .trip__dot--end::after { display: none; }
}
@media print { .trip__pulse { display: none; } }

