:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b2c40;
  background: #edf2f6;
  --navy: #142539;
  --ink: #172b3f;
  --muted: #53667a;
  --line: #dce5ed;
  --teal: #087969;
  --teal-dark: #066354;
  --cream: #f8fbfc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
a { color: var(--teal-dark); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px; border-radius: 8px; border: 1px solid #c8d6e2; background: #fff; color: var(--ink); font-weight: 650; font-size: .9rem; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #eef5f7; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #13a591; outline-offset: 3px; }
.primary { background: var(--teal); border-color: var(--teal); color: white; }
.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.danger { color: #923b33; }
.top { background: var(--navy); color: #fff; }
.top-inner { max-width: 1230px; margin: auto; min-height: 74px; padding: 13px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 730; text-decoration: none; line-height: 1.2; }
.brand small { display: block; color: #bfcfdb; font-size: .78rem; font-weight: 500; margin-top: 4px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; color: #123739; background: #83dfca; border-radius: 9px; font-size: .85rem; letter-spacing: -.04em; font-weight: 850; }
.top-action button { min-height: 38px; padding: 7px 12px; background: transparent; border-color: #657789; color: white; }
.top-action button:hover { background: #2d4256; }
main { margin: auto; max-width: 1230px; padding: 32px 28px 60px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 4vw, 2.45rem); line-height: 1.12; letter-spacing: -.045em; color: var(--ink); }
h2 { font-size: 1.26rem; line-height: 1.25; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
p { line-height: 1.55; }
.subtle, .loading { color: var(--muted); }
.intro { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.intro p { margin-top: 8px; }
.card { background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 5px #1c38510b; min-width: 0; }
.padded { padding: 23px; }
.layout { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 19px; align-items: start; }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; min-height: 61px; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.list { display: grid; padding: 7px; gap: 3px; max-height: 640px; overflow: auto; }
.load-row { display: grid; justify-items: start; text-align: left; width: 100%; padding: 12px; gap: 7px; border-color: transparent; }
.load-row[aria-current="true"] { background: #e8f5f2; border-color: #a0d5cb; }
.row-line { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reference, .route, .break { overflow-wrap: anywhere; }
.reference { font-size: 1rem; }
.route-preview { font-weight: 500; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; padding: 4px 9px; font-size: .8rem; line-height: 1.3; font-weight: 700; color: #455f73; background: #eaf0f6; border-radius: 100px; white-space: nowrap; }
.status.live { background: #dbf4eb; color: #08604f; }
.status.stale, .status.paused, .status.acquiring-gps { background: #fff0d4; color: #77500f; }
.status.delivered { background: #e4ebff; color: #394e8b; }
.detail-header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; }
.detail-header .route { color: var(--muted); margin-top: 6px; }
.map-box { margin-top: 18px; }
.empty-map { min-height: 205px; display: grid; place-content: center; text-align: center; gap: 5px; background: #eaf2f5; border: 1px dashed #bdcdd9; color: #38526a; border-radius: 10px; padding: 18px; }
.map-frame { display: block; width: 100%; height: 310px; border: 1px solid var(--line); border-radius: 10px; background: #eaf2f5; }
.map-meta { display: flex; flex-wrap: wrap; gap: 7px 19px; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: .87rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 17px 0 0; }
.facts div { padding: 11px 13px; background: var(--cream); border-radius: 8px; border: 1px solid var(--line); }
dt { color: var(--muted); font-size: .83rem; }
dd { margin: 4px 0 0; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.block { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 16px; }
.block p { margin: 5px 0 11px; color: var(--muted); }
.actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form { display: grid; gap: 13px; }
label { color: var(--ink); font-size: .9rem; font-weight: 650; display: grid; gap: 5px; }
input, select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; border: 1px solid #aebfcd; border-radius: 7px; color: var(--ink); background: white; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg,transparent 50%, #53667a 50%),linear-gradient(135deg,#53667a 50%,transparent 50%); background-position: calc(100% - 17px) 19px,calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-actions { margin-top: 3px; }
.narrow { max-width: 490px; margin: 30px auto 0; }
.shared-page { max-width: 780px; margin: auto; }
.shared-page h1 { margin-bottom: 9px; }
.share-card { margin-top: 18px; }
.share-card .actions { margin-top: 16px; }
.note { padding: 12px 14px; background: #e9f4f4; color: #304d59; border-radius: 8px; margin-top: 14px; }
.error { background: #fcebe8; color: #863128; border-radius: 8px; padding: 10px 12px; }
.toast { position: fixed; z-index: 2; bottom: 20px; right: 20px; max-width: calc(100vw - 40px); color: white; background: var(--navy); box-shadow: 0 3px 14px #14253942; padding: 11px 16px; border-radius: 8px; }
dialog { width: min(540px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 14px; padding: 23px; color: var(--ink); }
dialog::backdrop { background: #14253980; }
dialog h2 { margin-bottom: 15px; }
summary { cursor: pointer; font-weight: 700; }
.history { display: grid; margin: 10px 0 0; padding: 0; list-style: none; }
.history li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; border-top: 1px solid var(--line); padding: 8px 0; font-size: .86rem; color: var(--muted); }
.empty-list { padding: 12px; }
@media (max-width: 735px) {
  main { padding: 23px 16px 42px; }
  .top-inner { padding: 11px 16px; }
  .layout { grid-template-columns: 1fr; gap: 13px; }
  .list { max-height: 242px; }
  .padded { padding: 16px; }
  .map-frame { height: 260px; }
}
@media (max-width: 460px) {
  .facts, .form-grid { grid-template-columns: 1fr; }
  .facts { gap: 7px; }
}
