/* Look & feel matched to the LARC portal (mdolark.dsapp.io), tokens scraped
   from the live site 2026-11-09:
     ink #2D2D42 · amber #FBA900 (buttons carry WHITE text, links are amber)
     Lato · 4px corners · inputs 1px #CCC with a soft inset shadow
     uppercase bold field labels · light-blue street-map background texture.
   The texture is our own inline SVG (no hotlinking of DS assets). */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-400.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lato-700.woff2") format("woff2");
}
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --text: #2d2d42;
  --text-2: #55566b;
  --text-3: #6b7280;
  --border: #cccccc;
  --track-off: #9a9aa6;
  --accent: #2d2d42;
  --accent-soft: #e9ebf2;
  --accent-text: #2d2d42;
  --amber: #fba900;
  --amber-strong: #c98700;
  --amber-soft: #fdeecb;
  --amber-text: #8a6100;
  --danger: #a03232;
  --danger-soft: #f9e9e9;
  --radius: 4px;      /* DS/Kendo geometry — sharp, not rounded */
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(45, 45, 66, 0.07);
  --input-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  --header-bg: #ffffff;
  --header-text: #2d2d42;
  --map-tex: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NjAiIGhlaWdodD0iNTYwIj48ZyBmaWxsPSJub25lIiBzdHJva2U9IiM1QjhGRDQiIHN0cm9rZS1vcGFjaXR5PSIwLjEwIiBzdHJva2Utd2lkdGg9IjEuMyI+PHBhdGggZD0iTTAgODQgSDU2MCBNMCAxOTYgSDU2MCBNMCAzMTQgSDU2MCBNMCA0NTIgSDU2MCIvPjxwYXRoIGQ9Ik05NiAwIFY1NjAgTTIzMiAwIFY1NjAgTTM1MiAwIFY1NjAgTTQ4NiAwIFY1NjAiLz48cGF0aCBkPSJNMCAwIEw1NjAgNTYwIiBzdHJva2Utd2lkdGg9IjIiLz48cGF0aCBkPSJNNTYwIDEyMCBMMTQwIDU2MCIvPjxwYXRoIGQ9Ik0wIDQyMCBDMTIwIDM4MCAxODAgNDcwIDMwMCA0MzAgUzQ4MCAzNjAgNTYwIDM5MCIgc3Ryb2tlLXdpZHRoPSIyLjIiIHN0cm9rZS1vcGFjaXR5PSIwLjA4Ii8+PHBhdGggZD0iTTE2MCA4NCBWMTk2IE0xNjAgMTk2IEgyMzIgTTI5MCAxOTYgVjMxNCBNMjkwIDMxNCBIMzUyIE00MjAgMzE0IFY0NTIgTTQyMCA4NCBINDg2IE00MCAzMTQgVjQ1MiBNNDAgNDUyIEg5NiBNNTIwIDE5NiBWODQiLz48L2c+PGcgZmlsbD0iIzVCOEZENCIgZmlsbC1vcGFjaXR5PSIwLjA5Ij48cmVjdCB4PSIxMDQiIHk9IjkyIiB3aWR0aD0iNDYiIGhlaWdodD0iMzQiLz48cmVjdCB4PSIyNDAiIHk9IjIxMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIi8+PHJlY3QgeD0iMzYwIiB5PSIzMzAiIHdpZHRoPSI1MCIgaGVpZ2h0PSIzMCIvPjxyZWN0IHg9IjQ2IiB5PSIzMzAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0NCIvPjxyZWN0IHg9IjQ5NCIgeT0iMTAwIiB3aWR0aD0iNDAiIGhlaWdodD0iMzYiLz48L2c+PC9zdmc+");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171c;
    --surface: #1f2027;
    --surface-2: #24252d;
    --text: #e8e8ec;
    --text-2: #a7abb8;
    --text-3: #9aa0ae;
    --border: #3c3e49;
    --track-off: #4b4e5a;
    --accent: #aeb4cf;
    --accent-soft: #2a2c3a;
    --accent-text: #c3c9e3;
    --amber: #fba900;
    --amber-strong: #ffb61c;
    --amber-soft: #3a3018;
    --amber-text: #e5b64f;
    --danger: #e08a8a;
    --danger-soft: #402626;
    --shadow: none;
    --input-shadow: none;
    --map-tex: none;
  }
}

* { box-sizing: border-box; }
/* Author display rules (e.g. .stop-grid { display: grid }) would otherwise
   defeat the hidden attribute — this must win over all of them. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image: var(--map-tex);
  color: var(--text);
  line-height: 1.5;
  overscroll-behavior-y: contain;
}
.btn, .step-btn, .switch, .chk, input, a { -webkit-tap-highlight-color: transparent; }
.btn, .step-btn, .switch, .chk { touch-action: manipulation; }

/* Header stays white in both modes so the logo reads correctly. */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 12px 16px 0;
  border-bottom: 3px solid var(--amber);
}
.header-inner { max-width: 720px; margin: 0 auto; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { height: 44px; width: auto; display: block; }
.header-links { display: flex; gap: 16px; }
.header-links a {
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 0;
}
.header-links a:hover { color: var(--amber-strong); text-decoration: underline; }
.portal-title {
  margin: 12px 0 12px;
  font-size: 21px;
  font-weight: 400; /* DS headings are light (Lato 400/500), labels carry the bold */
  color: #2d2d42;
  letter-spacing: 0.2px;
}
.portal-title span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8a8f9c;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-top: 2px;
}

.view { max-width: 720px; margin: 0 auto; padding: 16px 16px 32px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.field-label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px;
}
.date-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input[type="date"] {
  flex: 1;
  font-size: 17px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--input-shadow);
  color: var(--text);
  min-height: 48px;
}
.weekday-chip {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 3px;
  white-space: nowrap;
}
.hint { font-size: 13.5px; color: var(--text-2); margin: 10px 0 0; }
.hint:empty { display: none; }
.relative-chip {
  background: var(--amber-soft);
  color: var(--amber-text);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 3px;
  white-space: nowrap;
}
.relative-chip:empty { display: none; }
.chip-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn-mini {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: var(--radius);
}

.section-title { font-size: 17px; font-weight: 400; margin: 24px 0 2px; }
.section-sub { font-size: 13px; color: var(--text-3); margin: 0 0 10px; }

.stop-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .stop-grid { grid-template-columns: 1fr 1fr; } }

.stop-card { margin-bottom: 0; padding: 0; overflow: hidden; }
.stop-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; }
.stop-label { display: flex; flex-direction: column; cursor: pointer; flex: 1; min-width: 0; }
.stop-code { font-weight: 700; font-size: 15px; }
.stop-facility { font-size: 12.5px; color: var(--text-2); }
.stop-city { font-size: 12px; color: var(--text-3); }

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; padding: 8px; margin: -8px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  width: 52px; height: 32px; border-radius: 999px;
  background: var(--track-off);
  transition: background 0.15s ease;
  display: inline-block; position: relative;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: left 0.15s ease;
}
.switch input:checked + .track { background: var(--amber); }
.switch input:checked + .track .knob { left: 23px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.stop-body { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: var(--surface-2); }
.pkg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.step-btn {
  width: 48px; height: 48px; border: none; background: var(--surface);
  font-size: 22px; color: var(--accent); cursor: pointer; flex: none;
}
.step-btn:active { background: var(--accent-soft); }
.stepper input {
  width: 64px; height: 48px; border: none; text-align: center;
  font-size: 18px; font-weight: 700; color: var(--text);
  background: var(--surface); border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.point-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.point-name { font-size: 14.5px; flex: 1; min-width: 0; }
.point-total { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--text-2); }

fieldset.points { border: none; margin: 0; padding: 0; }
fieldset.points legend {
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.6px; padding: 0; margin-bottom: 6px;
}
.chk {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; font-size: 15px; cursor: pointer; min-height: 44px;
}
.chk input { width: 22px; height: 22px; accent-color: var(--amber-strong); flex: none; }
.other-text {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--input-shadow);
  color: var(--text); min-height: 44px;
  margin-top: 4px;
}

.ra-subpanel { margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--amber); }

.field-error { color: var(--danger); font-size: 13px; margin: 8px 0 0; font-weight: 700; }
.banner { border-radius: var(--radius-lg); padding: 12px 16px; margin: 12px 0; font-size: 14px; }
.banner-error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.banner-error ul { margin: 6px 0 0; padding-left: 18px; }
.banner-title { margin: 0; font-weight: 700; }
.banner-warn { background: var(--amber-soft); color: var(--amber-text); border: 1px solid var(--amber-strong); }

.footer-spacer { height: 84px; }
.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  max-width: 100%;
}
.action-bar .summary { flex: 1; font-size: 13.5px; color: var(--text-2); min-width: 0; }
@media (min-width: 720px) {
  .action-bar { max-width: 720px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; left: 50%; transform: translateX(-50%); }
}

.btn {
  font-size: 15px; font-weight: 700;
  padding: 12px 18px; min-height: 48px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
/* DS primary: amber with WHITE text (scraped from the live Log in button). */
.btn-primary { background: var(--amber); border-color: var(--amber); color: #ffffff; }
.btn-primary:hover { background: var(--amber-strong); border-color: var(--amber-strong); color: #ffffff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent-text); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.back-btn { margin: 0 0 6px -8px; }

.review-date-line { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.order-card { display: flex; gap: 12px; align-items: flex-start; }
.order-main { flex: 1; min-width: 0; }
.order-template { margin: 0; font-weight: 700; font-size: 15px; }
.order-loc { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.order-notes { margin: 6px 0 0; font-size: 13px; color: var(--text-2); font-style: italic; }
.order-pkgs { flex: none; text-align: center; background: var(--accent-soft); color: var(--accent-text); border-radius: 3px; padding: 8px 12px; font-size: 12px; }
.order-pkgs strong { display: block; font-size: 18px; }
.status-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 10px; border-radius: 3px; margin-top: 6px;
  text-transform: uppercase;
}
.chip-ok { background: #e5f2e3; color: #2c6127; }
.chip-warn { background: var(--amber-soft); color: var(--amber-text); }
.chip-fail { background: var(--danger-soft); color: var(--danger); }
.chip-preview { background: var(--accent-soft); color: var(--accent-text); }
@media (prefers-color-scheme: dark) {
  .chip-ok { background: #24361f; color: #9ed194; }
}
.order-pkgs-zero { background: var(--amber-soft); color: var(--amber-text); }
.totals-card { background: var(--surface-2); }
.totals-row { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; }

.success-card { text-align: center; padding: 28px 16px; }
.success-check {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--amber); color: #ffffff;
  font-size: 30px; line-height: 56px; font-weight: 700;
}
.success-title { margin: 0; font-size: 21px; font-weight: 400; }
.payload {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; font-size: 12px; overflow-x: auto; max-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.next-steps-text { font-size: 14px; color: var(--text-2); margin: 6px 0 12px; }
.change-line { margin: 12px 0 0; }
.change-line a { color: var(--amber); font-weight: 700; }
.change-line a:hover { color: var(--amber-strong); }
.preview-mode .success-card { border-color: var(--amber-strong); }
.preview-mode .success-check { background: var(--amber-soft); color: var(--amber-text); }
.preview-mode .success-title { color: var(--amber-text); }

.history-card { padding: 12px 16px; }
.history-head { margin: 0; font-weight: 700; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.history-head .status-chip { margin-top: 0; }
.history-sub { margin: 2px 0 6px; font-size: 13px; color: var(--text-2); }
.history-details summary { cursor: pointer; font-size: 13px; color: var(--amber); font-weight: 700; min-height: 32px; }
.history-details summary:hover { color: var(--amber-strong); }
.history-line { margin: 4px 0; font-size: 13px; color: var(--text-2); }
.history-labels { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--amber); text-decoration: none; }
.history-labels:hover { color: var(--amber-strong); text-decoration: underline; }

.pin-label { margin-top: 12px; }
.pin-input { letter-spacing: 8px; font-weight: 700; width: 130px; text-align: center; }
#dup-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.manage-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.manage-row:first-of-type { border-top: none; }
.manage-chk { width: 22px; height: 22px; accent-color: var(--danger); flex: none; margin-top: 3px; }
.manage-main { flex: 1; min-width: 0; }
.manage-title { margin: 0; font-weight: 700; font-size: 14px; }
.manage-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.manage-head { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
.manage-cancelled .manage-title, .manage-cancelled .manage-sub { text-decoration: line-through; color: var(--text-3); }
.manage-date-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; }
.count-editor { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px 10px; margin-top: 8px; }
.count-input { width: 76px; padding: 8px 10px; font-size: 16px; font-weight: 700; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--input-shadow); color: var(--text); }
.btn:disabled { opacity: 0.65; cursor: default; }
.btn-busy::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  vertical-align: -2px; animation: nnm-spin 0.8s linear infinite;
}
@keyframes nnm-spin { to { transform: rotate(360deg); } }

.offline-banner { max-width: 720px; margin: 12px auto 0; }
#draft-chip { display: flex; align-items: center; gap: 12px; justify-content: space-between; }

@media print {
  .app-header .header-links, .app-footer, .action-bar, .btn, .btn-row, .back-btn,
  .offline-banner, .chip-row, #draft-chip { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

.app-footer { max-width: 720px; margin: 0 auto; padding: 8px 16px 24px; }
.app-footer p { font-size: 12px; color: var(--text-3); margin: 0 0 4px; }
.app-footer a { color: var(--amber); font-weight: 700; text-decoration: none; }
.app-footer a:hover { color: var(--amber-strong); text-decoration: underline; }
.card.has-error { border-color: var(--danger); }
