:root {
  --ink: #182f2d;
  --muted: #506562;
  --line: #cbd4ce;
  --accent: #006047;
  --paper: #f6f7f2;
  --teal: #123f37;
  --cream: #e8f4d7;
  --serif: "Source Serif 4", "PT Serif", Georgia, serif;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, .button, .secondary { cursor: pointer; }
:focus-visible { outline: 3px solid #005a9c; outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.mast :focus-visible { outline-color: #fff; box-shadow: 0 0 0 3px #123f37; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.mast { border-bottom: 3px solid #a9c7a4; background: var(--teal); color: white; }
.mast-inner, nav, .brand, .page-heading, .tracker-identity, .source-badge, .access-head, .refresh-bar { display: flex; align-items: center; }
.mast-inner { justify-content: space-between; min-height: 70px; gap: 1.2rem; }
.brand { color: white; gap: .6rem; text-decoration: none; }
.brand strong { font-size: 1.55rem; letter-spacing: -.065em; line-height: 1; }
.beacon { display: grid; place-items: center; width: 29px; height: 29px; border: 1.5px solid #b9d4a8; border-radius: 50%; }
.beacon i { width: 17px; height: 17px; border: 1.5px solid #b9d4a8; border-radius: 50%; display: grid; place-items: center; }
.beacon i::after { content: ""; width: 6px; height: 6px; background: var(--cream); border-radius: 50%; }
nav { gap: 1.4rem; }
nav a, .nav-button { color: #eef6eb; font-size: .93rem; font-weight: 600; text-decoration: none; }
nav a:hover, .nav-button:hover { text-decoration: underline; text-underline-offset: .3em; }
.nav-button { background: none; border: 1px solid #799c92; padding: .4rem .75rem; border-radius: 5px; }
.skip { position: absolute; left: 10px; top: -80px; background: white; padding: .6rem; z-index: 10; }
.skip:focus { top: 10px; }
.page { padding: 56px 0 72px; }
.page-heading { justify-content: space-between; gap: 1rem; align-items: flex-end; padding-bottom: 24px; }
.section-label { font-size: .77rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0 0 .4rem; }
h1, h2, p, dl { margin-top: 0; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.5rem, 5vw, 4.1rem); line-height: 1.1; letter-spacing: -.048em; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { font-size: 1.16rem; font-weight: 650; letter-spacing: -.02em; margin-bottom: 1rem; }
.sub, .caption, small, .heading-note, .source-note, dt { color: var(--muted); }
.heading-note { font-size: .95rem; }
.back { display: inline-block; font-weight: 600; font-size: .9rem; margin-bottom: 25px; text-decoration: none; }
.back:hover, .tracker-row h2 a:hover { text-decoration: underline; }
.source-badge { border: 1px solid #d4c7a8; background: #f9efda; color: #6c4d18; gap: .4rem; border-radius: 4px; padding: .35rem .65rem; font-size: .82rem; font-weight: 650; }
.source-badge i { background: currentColor; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.source-badge.current { color: #155b3b; border-color: #bfd4bf; background: #e6efdf; }
.list-head, .tracker-row { display: grid; grid-template-columns: 1.2fr 1.15fr 1fr 1fr; gap: 1.1rem; align-items: center; }
.list-head { padding: .7rem 1.4rem; border-top: 2px solid var(--teal); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); font-weight: 650; }
.fleet { background: #fff; border-bottom: 1px solid var(--line); }
.tracker-row { padding: 1.5rem 1.4rem; }
.tracker-row + .tracker-row { border-top: 1px solid var(--line); }
.tracker-identity { gap: .8rem; }
.device-mark { flex-shrink: 0; width: 30px; height: 38px; border: 2px solid #507168; border-radius: 10px; background: #e8f1e6; display: grid; place-items: center; }
.device-mark::after { content: ""; width: 8px; height: 8px; border: 2px solid #507168; border-radius: 50%; }
.tracker-row h2 { margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
.tracker-row h2 a { text-decoration: none; color: #115844; }
.tracker-row small, .tracker-row .sub { display: block; margin-top: .24rem; font-size: .82rem; }
.tracker-row strong { font-size: .95rem; }
.mobile-label { display: none; }
.empty { padding: 36px; border: 1px solid var(--line); background: white; border-left: 4px solid var(--teal); }
.empty h2 { margin: 0 0 .5rem; }
.empty p, .caption { margin-bottom: 0; }
.overview-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.side-cards { display: grid; gap: 18px; }
.card { padding: clamp(1.2rem, 2.5vw, 2rem); border: 1px solid var(--line); background: white; }
.card h2 { margin-bottom: .95rem; }
.position-card { border-top: 4px solid var(--teal); }
.position-values { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.3rem 0 .8rem; }
.position-values span { display: block; font-size: .83rem; color: var(--muted); }
.position-values strong { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.45rem, 3vw, 2.35rem); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.position-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); font-size: .86rem; }
.position-meta span:first-child { color: var(--teal); font-weight: 650; }
.facts { margin: 1.3rem 0; font-size: .86rem; }
.facts div { display: flex; justify-content: space-between; gap: .65rem; align-items: baseline; border-top: 1px solid #e4e9e3; padding: .4rem 0; }
dd { margin: 0; }
.facts dd { text-align: right; }
.fix-foot { border-top: 1px solid var(--line); padding-top: .7rem; font-size: .84rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem; }
.reading { font-family: var(--serif); font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.035em; margin: 0 0 .3rem; }
.empty-position { font-family: var(--serif); font-size: 1.65rem; padding: 1rem 0; }
.caption, .source-note { font-size: .86rem; }
.health { margin-top: 24px; border-top: 2px solid var(--teal); padding-top: 16px; }
.health-list { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.health-list div + div { border-left: 1px solid var(--line); padding-left: 15px; }
.health-list dt { font-size: .84rem; }
.health-list dd { font-weight: 600; margin-top: 3px; }
.source-note { margin: 1.6rem 0 .6rem; }
.refresh-bar { border-top: 1px solid var(--line); justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .85rem; padding: .7rem 0; }
.text-button { color: var(--accent); border: 0; padding: .45rem 0; background: none; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.account { width: min(520px, 100%); margin: 20px auto; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); border-top: 4px solid var(--teal); background: #fff; }
.account h1 { font-size: clamp(2.4rem, 4vw, 3.25rem); }
.lede { color: var(--muted); margin: .85rem 0 1.45rem; }
label { display: block; font-weight: 600; }
input:not([type="hidden"]), select { display: block; width: 100%; background: white; color: var(--ink); border: 1px solid #62756b; border-radius: 4px; padding: .58rem .65rem; }
.field { margin: 0 0 1rem; }
.field label { margin-bottom: .3rem; }
.help, .form-foot { color: var(--muted); font-size: .88rem; }
.help { margin-top: .4rem; }
.help ul, .errorlist { margin: .35rem 0; padding-left: 1.2rem; }
.form-error { padding: .45rem .7rem; color: #7d2d29; background: #fae8e4; font-size: .9rem; }
.button, .secondary { display: inline-block; text-align: center; border-radius: 4px; padding: .65rem 1.05rem; font-weight: 650; text-decoration: none; }
.button { border: 1px solid var(--teal); background: var(--teal); color: #fff; }
.button:hover { background: #205445; }
.secondary { color: var(--accent); border: 1px solid #62756b; background: #f4f7f0; }
.danger { color: #833b32; background: #fff; border-color: #d5c5c2; }
.account-form .button { width: 100%; margin-top: .4rem; }
.form-foot { margin: 1.3rem 0 0; }
.awaiting-mark { display: block; width: 36px; height: 36px; border: 2px solid var(--teal); border-radius: 50%; margin-bottom: 1.1rem; position: relative; }
.awaiting-mark::before { content: ""; position: absolute; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); width: 8px; height: 11px; left: 15px; top: 6px; }
.access-card { border: 1px solid var(--line); background: #fff; margin-bottom: 1rem; padding: 1.3rem; }
.access-head { justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.access-head h2 { margin: 0; overflow-wrap: anywhere; }
.grant-list { padding: 0; margin: 1rem 0; list-style: none; }
.grant-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--line); }
.grant-form { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.grant-form label { font-size: .88rem; min-width: 125px; }
.grant-form select { margin-top: .2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tracker-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.tracker-tabs a { padding: .45rem 0 .65rem; color: var(--muted); border-bottom: 3px solid transparent; font-size: .95rem; font-weight: 650; }
.tracker-tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--teal); }
.field-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(245px,1fr); gap: 18px; align-items: stretch; }
.map-panel { min-width: 0; margin: 0; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; }
.map-toolbar { min-height: 44px; padding: .3rem .9rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-size: .85rem; }
.map-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .3rem .8rem; }
html:has([data-screen]) { overscroll-behavior-y: contain; }
.map-status { font-weight: 650; }
#tracker-map { position: relative; z-index: 0; width: 100%; height: 380px; min-height: 280px; flex: auto; background: #e6ecdf; }
.coordinate-tile { border-left: 1px solid #a7baab; border-top: 1px solid #a7baab; background-color: #e8eee2; background-image: linear-gradient(to right, #c9d6c7 1px, transparent 1px), linear-gradient(to bottom, #c9d6c7 1px, transparent 1px); background-size: 32px 32px; }
.coordinate-tile span { position: absolute; top: 3px; left: 8px; padding: 0 2px; color: #3d5649; background: #e8eee2; font: 11px/1.4 "Courier New", monospace; }
.map-panel figcaption, .map-provider { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; padding: .7rem .9rem; font-size: .78rem; color: var(--muted); }
.map-panel figcaption span { display: inline-flex; align-items: center; gap: .35rem; }
.map-panel figcaption i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.key-pin { background: #064c37; box-shadow: 0 0 0 1px #91a598; border: 2px solid white; }
.key-radius { border: 1px dashed #00634c; background: #d7e9df; }
.key-fix { border: 1px solid #744c18; background: #e7a744; }
.key-sample { border: 2px dashed #12435f; background: #fff; }
.map-provider { border-top: 1px solid var(--line); justify-content: space-between; }
.map-explanation { margin: .5rem .9rem; }
.local-map-credit { margin: 0; border-top: 1px solid var(--line); padding: .45rem .9rem; font-size: .77rem; color: #41534c; }
.coordinate-picker { display: flex; align-items: center; justify-content: space-between; gap: .15rem .75rem; flex-wrap: wrap; padding: .55rem .9rem; background: #f4f7f0; border-bottom: 1px solid var(--line); }
.coordinate-picker p { margin: 0; flex-basis: 100%; color: var(--muted); font-size: .8rem; }
.coordinate-picker output { font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.picked-cross { display: grid; place-items: center; color: #fff; background: #5e2a70; border: 2px solid white; outline: 2px solid #5e2a70; border-radius: 3px; font: bold 20px/1 monospace; }
.ottawa-streets { position: absolute; pointer-events: none; }
.map-panel .key-history-selected { background: white; border: 3px solid #602778; width: 14px; height: 14px; }
.map-panel .last-known-label { color: #fff; background: #064c37; border-color: #064c37; font-weight: 700; }
.map-panel .leaflet-tooltip-top.last-known-label::before { border-top-color: #064c37; }
.show-history-point { display: block; margin-top: .2rem; text-align: left; text-decoration: underline; }
.selected-history-row td { background-color: #f5edf8; }
.selected-history-row td:first-child { box-shadow: inset 4px 0 #602778; }
.map-history-selection { margin: 0; padding: .6rem .9rem; color: #452358; background: #f5edf8; font-weight: 650; }
.map-current { border-top: 4px solid var(--teal); padding: 1.2rem; }
.coordinate-pair { margin-bottom: .22rem; font: 500 clamp(1.25rem,2.1vw,1.9rem)/1.15 var(--serif); }
.map-facts { margin: .9rem 0 0; font-size: .86rem; }
.map-facts div { padding: .45rem 0; border-top: 1px solid #e3e8df; }
.map-facts dd { font-weight: 550; overflow-wrap: anywhere; }
.history-section { margin-top: 30px; }
.history-section h2 { margin-bottom: .15rem; font-size: 1.5rem; }
.history-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .55rem .75rem; margin: .85rem 0 1rem; }
.history-filters label { color: var(--muted); font-size: .82rem; }
.history-filters input, .history-filters select { min-height: 38px; margin-top: .2rem; padding: .35rem .45rem; font-size: .88rem; }
.history-filters input[type="number"] { width: 5rem; }
.history-filters button { min-height: 38px; padding: .35rem .85rem; font-size: .88rem; }
.history-filters a { padding: .4rem .2rem; font-size: .85rem; }
.records { border-collapse: collapse; width: 100%; background: #fff; font-size: .86rem; }
.records th, .records td { text-align: left; padding: .7rem .6rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.records th { background: #e8eee5; color: var(--teal); border-top: 2px solid var(--teal); font-size: .81rem; }
.records time, .records td { overflow-wrap: anywhere; }
.records td small { display: block; }
.empty-row { color: var(--muted); }
.pager { display: inline-block; padding: .75rem 0; font-weight: 600; }
.history-section + .refresh-bar { margin-top: 1.3rem; }
.packet-detail { max-width: 860px; }
.packet-detail dd { overflow-wrap: anywhere; }
.packet-hex { display: block; padding: .8rem; background: var(--paper); font-size: .88rem; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .field-grid { grid-template-columns: 1fr; }
  .map-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .2rem 1rem; }
  #tracker-map { height: 330px; }
  .overview-grid { grid-template-columns: 1fr; }
  .side-cards { grid-template-columns: 1fr 1fr; }
  .tracker-row, .list-head { grid-template-columns: 1.15fr 1.05fr 1fr 1fr; gap: .7rem; }
  .tracker-row, .list-head { padding-inline: 1rem; }
  .device-mark { display: none; }
}
@media (max-width: 620px) {
  #tracker-map { height: 295px; }
  .tracker-tabs { gap: .1rem .9rem; overflow-wrap: normal; }
  .tracker-tabs a { font-size: .85rem; }
  .history-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; }
  .history-filters input { min-width: 0; width: 100%; }
  .history-filters input[type="number"] { width: 100%; }
  .records, .records tbody, .records tr, .records td { display: block; }
  .records thead { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .records tr { border-top: 2px solid var(--teal); padding: .65rem .8rem; }
  .records td { padding: .17rem 0; border: 0; }
  .records td[data-label] { display: grid; grid-template-columns: minmax(5.5rem,.7fr) minmax(0,1.3fr); column-gap: .45rem; align-items: baseline; }
  .records td[data-label]::before { content: attr(data-label); font-size: .77rem; color: var(--muted); }
  .records td[data-label] small { grid-column: 2; }
  .wrap { width: calc(100% - 32px); }
  .mast-inner { min-height: 60px; gap: .6rem; }
  nav { gap: .7rem; }
  nav a, .nav-button { font-size: .85rem; }
  .nav-button { padding: .35rem .5rem; }
  .brand strong { font-size: 1.35rem; }
  .beacon { width: 24px; height: 24px; }
  .page { padding: 30px 0 48px; }
  .page-heading { flex-wrap: wrap; gap: .6rem; padding-bottom: 18px; }
  .list-head { display: none; }
  .fleet { background: none; border: 0; }
  .tracker-row { grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: #fff; padding: 1rem; gap: .95rem; margin-bottom: .75rem; }
  .tracker-identity { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: .7rem; }
  .device-mark { display: grid; }
  .mobile-label { display: block; color: var(--muted); font-size: .77rem; }
  .side-cards { grid-template-columns: 1fr; gap: 12px; }
  .overview-grid { gap: 12px; }
  .position-values { gap: .4rem; }
  .health-list { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .health-list div:nth-child(3) { border: 0; padding: 0; }
  .account { margin: 0 auto; }
  .grant-form { align-items: stretch; flex-direction: column; }
}
