/* =========================================================
   odload — simple dark theme
   Black background · amber accent · green for donate
   ========================================================= */

:root {
  --bg: #0a0a0b;
  --bg-2: #131316;
  --card: #161619;
  --line: #26262b;
  --line-2: #37373e;
  --text: #ececef;
  --muted: #9a9aa4;
  --muted-2: #6b6b74;

  /* amber primary (oversize-load signage vibe) */
  --primary: #f0a92b;
  --primary-h: #ffbe4d;
  --primary-ink: #241802;

  /* green — donate identity */
  --donate: #2fbf6b;
  --donate-h: #47d883;
  --donate-ink: #04240f;

  /* status */
  --ok: #35d39a;
  --warn: #f0a92b;
  --bad: #f8717a;

  --radius: 12px;
  --radius-sm: 8px;
  --input-h: 40px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

input { font: inherit; color: inherit; }
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
button { cursor: pointer; border: 0; background: none; font: inherit; color: inherit; }

.app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 20px 28px;
}

/* ---------- Top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.top-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand b {
  display: inline-flex;
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: lowercase;
  margin-right: 9px;
  color: var(--primary-ink);
}
.tag {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}
.donate-top {
  text-decoration: none;
  color: var(--donate);
  border: 1px solid rgba(47, 191, 107, 0.4);
  border-radius: var(--radius-sm);
  padding: 7px 15px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.donate-top:hover { background: rgba(47, 191, 107, 0.12); }

/* ---------- Scope strip ---------- */
.scope {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.scope > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.scope strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}
.scope span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
@media (max-width: 760px) { .scope { grid-template-columns: 1fr; } }

/* ---------- Board layout ---------- */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.05fr) minmax(240px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 1080px) {
  .board { grid-template-columns: 1.2fr 1fr; }
  .support-panel { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.card-h h2 {
  position: relative;
  margin: 0;
  padding-left: 13px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.card-h h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
}
.card-h span { color: var(--muted); font-size: 12px; font-family: var(--mono); }

.row-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-family: var(--mono);
  margin: 18px 0 8px;
}
.row-label:first-of-type { margin-top: 0; }

/* ---------- Grids / fields ---------- */
.grid {
  display: grid;
  gap: 10px;
  align-items: end;
}
.eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cargo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .cargo-grid, .eq-grid { grid-template-columns: 1fr 1fr; }
}

label.f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  min-width: 0;
}

.pair {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: var(--input-h);
  flex-wrap: nowrap;
}
/* Shell: number + unit. Unit never collapses; number has room for digits. */
.pair .u {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 8px 0 10px;
  min-height: var(--input-h);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pair .u:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 169, 43, 0.14);
}
.pair .u.grow {
  flex: 1 1 auto;
  min-width: 6.5rem;
}
.pair .u input {
  flex: 1 1 auto;
  width: 3.25ch;          /* base; grows with container */
  min-width: 3.25ch;      /* at least ~3 digits visible */
  max-width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* Feet-ish values (12, 40, 53…) */
.pair .u:has(input[id$="Ft"]),
.pair .u:has(input[id*="Len"]),
.pair .u:has(input[id*="Width"]),
.pair .u:has(input[id*="Deck"]),
.pair .u:has(input[id*="Overlap"]) {
  flex: 0 0 auto;
  width: 5.6rem;
}
.pair .u:has(input[id$="Ft"]) input,
.pair .u:has(input[id*="Len"]) input,
.pair .u:has(input[id*="Width"]) input {
  min-width: 3.5ch;
  width: 100%;
}
/* Inches 0–11 */
.pair .u:has(input[id$="In"]) {
  flex: 0 0 auto;
  width: 4.6rem;
}
.pair .u:has(input[id$="In"]) input {
  min-width: 2.5ch;
  width: 100%;
}
/* Weight / empty lb */
.pair .u:has(input[id="weight"]),
.pair .u:has(input[id="emptyWeightLb"]) {
  flex: 1 1 auto;
  min-width: 7rem;
}
.pair .u:has(input[id="weight"]) input,
.pair .u:has(input[id="emptyWeightLb"]) input {
  min-width: 5.5ch;
  width: 100%;
}
.pair .u i {
  font-style: normal;
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 600;
  flex: 0 0 auto;
  width: 1.4em;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- Trailer button ---------- */
.trailer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 46px;
  text-align: left;
  margin-bottom: 4px;
  transition: border-color 0.15s;
}
.trailer-btn:hover { border-color: var(--line-2); }
.trailer-preview { flex: 1; min-width: 0; }
.trailer-preview b { display: block; font-size: 13px; }
.trailer-preview small { display: block; font-size: 11px; color: var(--muted); }
.chev { color: var(--muted); font-size: 13px; }

/* ---------- Route ---------- */
.route-card { display: flex; flex-direction: column; }
.route-entry input[type="text"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  outline: none;
  min-height: var(--input-h);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.route-entry input::placeholder { color: var(--muted-2); }
.route-entry input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 169, 43, 0.14);
}
.route-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); }

.route-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.route-state {
  display: grid;
  grid-template-columns: 26px 32px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13px;
}
.route-state small { color: var(--muted-2); font-size: 11px; font-family: var(--mono); }
.route-state b { color: var(--primary); font-family: var(--mono); }
.route-state span { color: var(--muted); }

.check-bar {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.check-bar strong { display: block; font-size: 14px; font-family: var(--mono); }
.check-bar span { font-size: 11px; color: var(--muted); }
.check-go {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  transition: filter 0.15s;
}
.check-go:hover { filter: brightness(1.08); }

/* ---------- Support / donate (green) ---------- */
.support-panel {
  display: flex;
  flex-direction: column;
  border-color: rgba(47, 191, 107, 0.28);
}
.support-panel .card-h h2::before { background: var(--donate); }
.support-lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.support-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.support-list li {
  position: relative;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.support-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--donate);
}
.support-list li strong { color: var(--text); font-weight: 600; }
.support-note {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.45;
}
.support-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--donate);
  color: var(--donate-ink);
  font-weight: 800;
  font-size: 15px;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  transition: filter 0.15s, transform 0.1s;
}
.support-btn:hover { filter: brightness(1.08); }
.support-btn:active { transform: translateY(1px); }

/* ---------- Results ---------- */
.results-card { margin-top: 14px; }
.results-h { justify-content: space-between; }
.results-h h2 { text-transform: none; font-size: 15px; letter-spacing: 0; }

.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary > div {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.summary span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}
.summary b {
  display: block;
  font-size: 22px;
  margin-top: 5px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) { .summary { grid-template-columns: repeat(3, 1fr); } }

.results-scroll { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
.results-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: var(--mono);
  border-bottom: 1px solid var(--line);
}
.results-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .st {
  font-weight: 700;
  font-family: var(--mono);
}
.results-table .st small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--font);
  font-size: 11px;
}
.results-table td.yes { color: var(--text); font-weight: 600; }
.results-table td.no { color: var(--muted-2); }
.results-table .notes { color: var(--muted); }

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(154, 154, 164, 0.15);
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.ok { background: rgba(53, 211, 154, 0.15); color: var(--ok); }
.badge.warn { background: rgba(240, 169, 43, 0.15); color: var(--warn); }
.badge.bad { background: rgba(248, 113, 122, 0.15); color: var(--bad); }

/* status accent on the left of each result row */
.results-table tr.legal .st { box-shadow: inset 3px 0 0 var(--ok); padding-left: 15px; }
.results-table tr.permit_required .st { box-shadow: inset 3px 0 0 var(--warn); padding-left: 15px; }
.results-table tr.manual_review .st { box-shadow: inset 3px 0 0 var(--bad); padding-left: 15px; }

/* ---------- Footer ---------- */
.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  font-family: var(--mono);
}



/* ---- Functional pieces (IDs / panels used by script.js) ---- */
[hidden] { display: none !important; }

.input-error-banner {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 113, 122, 0.55);
  background: rgba(248, 113, 122, 0.12);
  color: #fecaca;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.pair .u.field-error {
  border-color: var(--bad) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 122, 0.22) !important;
  background: rgba(248, 113, 122, 0.08);
}
@keyframes od-field-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}
.pair .u.field-shake { animation: od-field-shake 0.55s ease-in-out 0s 2; }

.link {
  font-size: 12px;
  color: var(--primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.link:hover { text-decoration: underline; }

.mini-presets { display: flex; gap: 4px; flex-shrink: 0; margin-left: 4px; }
.preset {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  min-height: 26px;
}
.preset:hover { color: var(--text); border-color: var(--line-2); }
.preset.active {
  border-color: var(--primary);
  color: var(--primary-ink);
  background: var(--primary);
}

.trailer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 44px;
  text-align: left;
}
.trailer-btn:hover, .trailer-btn.open { border-color: var(--line-2); }
.trailer-preview { flex: 1; min-width: 0; }
.trailer-preview .ph { color: var(--muted); font-size: 13px; }
.trailer-preview b { display: block; font-size: 13px; }
.trailer-preview small { display: block; font-size: 11px; color: var(--muted); }
.chev { color: var(--muted); }
.trailer-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  padding: 8px;
}
.trailer-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.trailer-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.trailer-tabs button.active {
  border-color: var(--primary);
  color: var(--primary-ink);
  background: var(--primary);
}
.trailer-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 230px;
  overflow-y: auto;
}
.trailer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  width: 100%;
  text-align: left;
}
.trailer-card:hover, .trailer-card.selected {
  border-color: var(--primary);
  background: rgba(240, 169, 43, 0.08);
}
.trailer-card b { font-size: 13px; }
.trailer-card small { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.route-card { display: flex; flex-direction: column; min-height: 0; }
.route-entry input[type="text"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  outline: none;
  min-height: var(--input-h);
}
.route-entry input:focus { border-color: var(--primary); }
.route-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  min-height: 32px;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn.primary {
  background: var(--donate);
  color: var(--donate-ink);
  border: 0;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 800;
}

.picker {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  padding: 8px;
}
.picker input[type="search"] {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--text);
  outline: none;
  margin-bottom: 6px;
}
#stateOptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  max-height: 140px;
  overflow-y: auto;
}
#stateOptions button {
  text-align: left;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 12px;
}
#stateOptions button:hover { background: rgba(240, 169, 43, 0.1); }
#stateOptions button b {
  display: inline-block;
  width: 26px;
  color: var(--primary);
  margin-right: 4px;
  font-family: var(--mono);
}

.route-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(5 * 44px + 4 * 4px); /* 5 rows visible, scroll from 6th */
  overflow-y: auto;
}
.route-state {
  display: grid;
  grid-template-columns: 26px 30px 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
}
.route-state b { color: var(--primary); font-family: var(--mono); }
.route-state span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-state div { display: flex; gap: 3px; }
.route-state button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.route-state button:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }
.route-state button:disabled { opacity: 0.3; }

.check-bar {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.check-bar strong { display: block; font-size: 14px; font-family: var(--mono); }
.check-bar span { font-size: 12px; color: var(--muted); }
.check-bar > button {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}
.check-bar > button:disabled { opacity: 0.55; cursor: not-allowed; }

.support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--donate);
  color: var(--donate-ink);
  font-weight: 800;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}
.support-btn-lg { margin-top: auto; width: 100%; font-size: 14px; }
.support-btn:hover { filter: brightness(1.06); }

.results-card { margin-top: 14px; }
.results-h { justify-content: space-between; }
.results-h h2 { text-transform: none; letter-spacing: 0; font-size: 15px; }
.effective-load {
  background: rgba(240, 169, 43, 0.08);
  border: 1px solid rgba(240, 169, 43, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.effective-load strong {
  display: block;
  font-size: 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
  margin-bottom: 4px;
}
.effective-load > span { display: block; font-size: 13px; font-weight: 600; font-family: var(--mono); }
.effective-load small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.results-table .badge { /* filled by JS status classes too */ }
.results-table tr.legal .badge { background: rgba(53, 211, 154, 0.15); color: var(--ok); }
.results-table tr.permit_required .badge { background: rgba(240, 169, 43, 0.15); color: var(--warn); }
.results-table tr.special .badge { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.results-table tr.manual_review .badge { background: rgba(248, 113, 122, 0.15); color: var(--bad); }
.results-table .verified-date {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: normal;
}
.results-table a { color: var(--primary); text-decoration: none; }
.results-table a:hover { text-decoration: underline; }

.explanations { margin-top: 14px; display: grid; gap: 8px; }
.explanations-heading { display: flex; align-items: baseline; gap: 8px; }
.explanations-heading span { color: var(--muted); font-size: 12px; }
.state-explanation {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.state-explanation.legal { border-left-color: var(--ok); }
.state-explanation.permit_required { border-left-color: var(--warn); }
.state-explanation.manual_review { border-left-color: var(--bad); }
.state-explanation summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.state-explanation summary::-webkit-details-marker { display: none; }
.state-explanation summary span { font-weight: 700; font-family: var(--mono); }
.state-explanation summary b { color: var(--primary); font-size: 12px; margin-left: auto; }
.explanation-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
  gap: 14px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}
.explanation-body h3 {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: var(--mono);
}
.explanation-body ul { margin: 0; padding-left: 18px; }
.explanation-body li { margin: 3px 0; font-size: 12px; }
.data-source dl { margin: 0; display: grid; gap: 3px; }
.data-source dl > div { display: grid; grid-template-columns: 90px 1fr; gap: 5px; font-size: 12px; }
.data-source dt { color: var(--muted); }
.data-source dd { margin: 0; }
.data-source a { color: var(--primary); font-size: 12px; }
.explanation-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
.state-explanation .verified-banner {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(154, 154, 164, 0.08);
  border: 1px solid var(--line);
}
@media (max-width: 700px) {
  .explanation-body { grid-template-columns: 1fr; }
}

.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}
.donate-modal[hidden] { display: none !important; }
.donate-modal-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.donate-modal-card h3 { margin: 0 0 10px; font-size: 17px; }
.donate-modal-card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.donate-modal-note { font-size: 12px !important; }
.donate-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.donate-modal-actions .btn { flex: 1 1 auto; min-width: 120px; }

/* Print report */
#odloadPrintSheet { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fafaf9 !important; }
  body * { visibility: hidden !important; }
  #odloadPrintSheet, #odloadPrintSheet * { visibility: visible !important; }
  .top, .board, .foot, .scope, .results-card, .support-panel, .donate-modal, .input-error-banner {
    display: none !important;
  }
  #odloadPrintSheet {
    display: block !important;
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    background: #fafaf9 !important;
    color: #2c2c2a !important;
    font-size: 11px;
    line-height: 1.32;
  }
  #odloadPrintSheet h1 { font-size: 16px; margin: 0 0 2px; color: #1f1f1e !important; }
  #odloadPrintSheet h2 {
    font-size: 11px; margin: 10px 0 4px; font-weight: 700;
    color: #3a3a36 !important; border-bottom: 1px solid #e4e4e0; padding-bottom: 2px;
  }
  #odloadPrintSheet .sub { color: #5c5c56 !important; margin-bottom: 6px; font-size: 10px; }
  #odloadPrintSheet .brand-mark { color: #3d5a80 !important; font-weight: 700; }
  #odloadPrintSheet .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; }
  #odloadPrintSheet .meta span { display: block; color: #6b6b66 !important; font-size: 9px; }
  #odloadPrintSheet .meta b { font-size: 13px; color: #2c2c2a !important; }
  #odloadPrintSheet table { width: 100%; border-collapse: collapse; margin-bottom: 6px; table-layout: fixed; }
  #odloadPrintSheet th, #odloadPrintSheet td {
    border: 1px solid #ddd9d0 !important;
    padding: 3px 5px;
    vertical-align: top;
    color: #2c2c2a !important;
    background: #fffcf7 !important;
    font-size: 10.5px;
  }
  #odloadPrintSheet th { background: #f0eee9 !important; font-weight: 700; text-align: left; color: #3a3a36 !important; }
  #odloadPrintSheet table.load col.c-label { width: 18%; }
  #odloadPrintSheet table.load col.c-val { width: 32%; }
  #odloadPrintSheet table.load th { white-space: nowrap; }
  #odloadPrintSheet .muted { color: #6b6b66 !important; font-size: 9.5px; }
  #odloadPrintSheet .small { font-size: 9px; word-break: break-all; color: #5c5c56 !important; }
  #odloadPrintSheet .note {
    margin-top: 8px; padding-top: 5px; border-top: 1px solid #e4e4e0;
    color: #5c5c56 !important; font-size: 9.5px;
  }
  #odloadPrintSheet table.results tr { page-break-inside: avoid; }
  #odloadPrintSheet table.results tr:nth-child(even) td { background: #f7f5f0 !important; }
}


/* Dropdowns float over layout — do not push other cards */
.dropdown-anchor {
  position: relative;
  z-index: 5;
}
.trailer-dd { margin-bottom: 4px; z-index: 20; }
.trailer-panel {
  position: absolute !important;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin-top: 0 !important;
  z-index: 40;
  max-height: min(320px, 50vh);
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line-2);
  background: var(--card) !important;
}
.trailer-grid {
  max-height: none;
}
.route-entry.dropdown-anchor { z-index: 15; }
.picker {
  position: absolute !important;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px !important;
  z-index: 40;
  max-height: min(280px, 45vh);
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line-2);
  background: var(--card) !important;
}
#stateOptions { max-height: 180px; }
/* When open, keep card above siblings */
.card:has(.trailer-panel:not([hidden])),
.card:has(.picker:not([hidden])) {
  z-index: 30;
}
.donate-top { display: none !important; }


/* Input sizing (digits visible, unit never covered) */
:root { --input-h: 40px; }
.foot {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}
.foot p { margin: 0 0 6px; }
.foot a { color: var(--primary); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.support-note a { color: var(--donate-h); }

/* Cargo: Width/Height/Length on row 1; Weight on row 2 (no overflow) */
.cargo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.cargo-grid > label.f {
  min-width: 0;
}
/* Weight is 4th label — full row, limited width so it doesn't stretch awkwardly */
.cargo-grid > label.f:nth-child(4) {
  grid-column: 1 / 2;
  max-width: 11rem;
}
.cargo-grid .pair {
  width: 100%;
  gap: 5px;
  min-width: 0;
}
.cargo-grid .pair .u:has(input[id$="Ft"]) {
  flex: 1 1 auto;
  width: auto;
  min-width: 3.8rem;
  padding: 0 8px;
  box-sizing: border-box;
  overflow: hidden;
}
.cargo-grid .pair .u:has(input[id$="In"]) {
  flex: 0 0 3.75rem;
  width: 3.75rem;
  min-width: 3.75rem;
  padding: 0 7px;
  box-sizing: border-box;
  overflow: hidden;
}
.cargo-grid .pair .u:has(input[id="weight"]) {
  flex: 1 1 auto;
  width: auto;
  min-width: 6rem;
  padding: 0 10px;
  overflow: hidden;
}
.cargo-grid .pair .u input {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}
.cargo-grid .pair .u i {
  flex: 0 0 auto;
  width: auto;
  min-width: 1.15em;
  margin: 0;
  padding: 0;
  text-align: left;
}
@media (max-width: 900px) {
  .cargo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cargo-grid > label.f:nth-child(4) {
    grid-column: 1 / 2;
    max-width: none;
  }
}

/* Presets sit beside the input, never inside / overlapping the shell */
.pair-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.pair-wrap .pair {
  flex: 1 1 auto;
  min-width: 0;
}
.pair-wrap .mini-presets {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: 0;
  align-items: center;
}
.pair-wrap .preset {
  min-width: 2.1rem;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1;
}
.pair-wrap .preset:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.pair-wrap .preset.active {
  border-color: var(--primary);
  color: var(--primary-ink);
  background: var(--primary);
}

