:root {
  color-scheme: light;
  --ink: #153343;
  --muted: #536975;
  --teal: #006e65;
  --line: #d9e1e0;
  --paper: #fff;
  --bg: #f3f5f3;
  --sea: #234956;
  font-family: "Segoe UI",Arial,sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,select,input {
  font: inherit;
  color: inherit;
}

button,select {
  cursor: pointer;
}

button,a,select,input {
  touch-action: manipulation;
}

button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible {
  outline: 3px solid #378fbd;
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  opacity: .45;
}

[hidden] {
  display: none!important;
}

.shell {
  max-width: 1440px;
  width: 100%;
  margin: auto;
  padding: 0 clamp(16px,4.8vw,78px);
}

.mast {
  background: #142f3d;
  color: #fff;
  border-bottom: 3px solid #dcb267;
}

.mast-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 67px;
}

.brand,.mast a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand b {
  font-size: 22px;
  letter-spacing: -.04em;
}

.brand span {
  font-size: 15px;
  padding-left: 13px;
  border-left: 1px solid #60727c;
  white-space: nowrap;
  color: #d6e0e3;
}

.mast nav {
  display: flex;
  gap: 21px;
  margin-left: auto;
}

.mast nav a {
  font-size: 13px;
}

.mast nav a:hover {
  text-decoration: underline;
}

.mast .company-link {
  color: #f2c88b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .06em;
}

.company-link:hover {
  text-decoration: underline;
}

footer a {
  color: var(--teal);
  font-weight: 650;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 37px 0 23px;
}

.kicker,.scope label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  line-height: 1.5;
  color: #48646d;
}

.kicker i {
  width: 20px;
  height: 2px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
  background: #b48342;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: clamp(32px,4.2vw,52px);
  line-height: 1.14;
  letter-spacing: -.052em;
  margin: 7px 0 8px;
  font-weight: 620;
}

h2 {
  font-size: clamp(21px,2.3vw,28px);
  line-height: 1.25;
  letter-spacing: -.04em;
  font-weight: 640;
  margin-top: 2px;
}

.intro p {
  color: var(--muted);
  font-size: 15px;
}

.scope {
  display: grid;
  gap: 5px;
  min-width: 200px;
}

select,input,button {
  background: var(--paper);
  border: 1px solid #c8d3d4;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 14px;
}

select {
  padding-right: 22px;
}

.scope select {
  font-weight: 600;
  max-width: 320px;
}

button:hover:not(:disabled) {
  background: #edf2f1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  margin-bottom: 20px;
}

.metrics article {
  padding: 19px clamp(14px,2vw,30px);
  min-width: 0;
}

.metrics article+article {
  border-left: 1px solid var(--line);
}

.metrics .metric {
  font-size: clamp(23px,2.6vw,35px);
  font-weight: 620;
  color: var(--ink);
  letter-spacing: -.045em;
  margin: 3px 0;
}

.metric small {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.metrics article>span,.metrics article>div:not(.kicker):not(.metric):not(.bar) {
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 4px;
  background: #e6edeb;
  border-radius: 3px;
  margin-top: 11px;
}

.bar i {
  display: block;
  height: 100%;
  background: #197568;
  border-radius: 3px;
}

#delivery-records h2 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  margin: 0;
}

.workspace,.register {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
  margin: 0 0 20px;
  scroll-margin-top: 10px;
}

.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 19px clamp(16px,2vw,28px);
}

.tabs {
  display: flex;
  background: #edf1f0;
  border: 1px solid #d3ddda;
  border-radius: 7px;
  padding: 3px;
}

.tabs button {
  min-width: 67px;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
}

.tabs button[aria-pressed=true] {
  background: var(--ink);
  color: white;
}

.map-frame {
  height: clamp(315px,46vh,490px);
  position: relative;
  border-block: 1px solid #cedbd5;
}

.leaflet-container {
  font-family: inherit;
  background: #e9eeea;
  background-image: linear-gradient(#456c7410 1px,transparent 1px),linear-gradient(90deg,#456c7410 1px,transparent 1px);
  background-size: 28px 28px;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 0;
}

.map-caption,.reset,.north {
  position: absolute;
  z-index: 1;
}

.map-caption {
  background: #fbfcf9f2;
  color: #29454d;
  left: 15px;
  top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #cbd7d2;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
}

.selected-region { pointer-events: none; }

.map-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px clamp(12px, 2vw, 28px);
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.map-selection button { flex-shrink: 0; }

.map-caption span {
  border-left: 1px solid #ced9d4;
  padding-left: 9px;
}

.reset {
  right: 12px;
  top: 87px;
  padding: 0;
  font-size: 22px;
  width: 32px;
  height: 32px;
  line-height: 24px;
  border-color: #aab8b4;
}

.north {
  left: 16px;
  bottom: 30px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  line-height: 14px;
}

.leaflet-control-scale {
  margin-left: 14px!important;
}

.leaflet-control-attribution {
  font-size: 9px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 22px;
  row-gap: 8px;
  padding: 13px 20px;
}

.legend span,.pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color,#9aa2a3);
  flex: none;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.sync:before {
  content: "";
  height: 7px;
  width: 7px;
  background: #a6a5a0;
  border-radius: 50%;
}

.sync.live:before {
  background: #119571;
}

.sync.off:before {
  background: #b56e17;
}

#notice {
  background: #fff2da;
  border: 1px solid #dfc9a6;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 6px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 clamp(16px,2vw,28px) 15px;
}

.search {
  display: flex;
  align-items: center;
  border: 1px solid #c8d3d4;
  border-radius: 5px;
  gap: 5px;
  padding-left: 9px;
}

.search span {
  font: 24px/1 Georgia;
}

.search input {
  border: 0;
  padding: 8px;
  width: 190px;
}

.export {
  margin-left: auto;
}

.export span {
  font-weight: bold;
  margin-left: 5px;
}

.table-scroll {
  position: relative;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

thead {
  background: #f4f6f4;
  color: #4c626c;
}

th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

th,td {
  padding: 10px 14px;
  border-block-start: 1px solid #e3e8e5;
}

th:first-child,td:first-child {
  padding-left: clamp(16px,2vw,28px);
}

td:first-child {
  font-weight: 600;
  max-width: 37ch;
  overflow-wrap: anywhere;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-btn {
  border: none;
  background: transparent;
  padding: 4px;
  color: var(--teal);
  font-weight: 700;
}

.pill {
  border-radius: 18px;
  padding: 4px 8px;
  background: var(--wash);
  color: #1c3e42;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 9px 20px;
  font-size: 12px;
  color: var(--muted);
}

.pager button {
  padding: 4px 9px;
  margin-left: 4px;
}

.register tr[data-id]:hover {
  background: #f5f8f7;
  cursor: pointer;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  padding: 4px 0 28px;
  font-size: 11px;
}

dialog {
  border: 1px solid #c9d6d2;
  border-radius: 12px;
  width: min(440px,calc(100% - 28px));
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 18px 60px #09262b38;
}

dialog::backdrop {
  background: #0c263c51;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close {
  border: 0;
  font-size: 23px;
  padding: 3px 9px;
}

.detail-fields {
  margin: 14px 0;
}

.detail-fields dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.detail-fields dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-fields dd {
  margin: 0;
  text-align: right;
  font-size: 13px;
}

h3 {
  margin: 23px 0 5px;
  overflow-wrap: anywhere;
}

#detailScope,#dateHint,.feedback {
  font-size: 13px;
  color: var(--muted);
}

#edit {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  gap: 12px;
}

#edit label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

#edit :is(input,select) {
  width: 100%;
}

.primary {
  background: var(--teal);
  color: white;
  border: 0;
  font-weight: 600;
}

.primary:hover:not(:disabled) {
  background: #035b53;
}

.feedback:not(:empty) {
  margin-top: 13px;
}

#reloadRecord {
  margin-top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width:680px) {
  .mast-inner {
    min-height: 58px;
    gap: 10px;
  }
  .mast nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
  }
  .mast .company-link {
    font-size: 10px;
  }
  .intro {
    align-items: stretch;
    flex-direction: column;
    padding: 25px 0 16px;
    gap: 13px;
  }
  .scope {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .scope select {
    flex: 1;
    min-width: 0;
  }
  .metrics article {
    padding: 12px 9px;
  }
  .metrics .kicker {
    font-size: 8px;
    letter-spacing: .06em;
  }
  .metrics article>span,.metrics article>div:not(.kicker):not(.metric):not(.bar) {
    font-size: 10px;
  }
  .metric small {
    font-size: 10px;
  }
  .metrics .metric {
    font-size: 21px;
  }
  .section-top {
    padding: 15px 12px;
  }
  .legend {
    gap: 7px 14px;
    padding: 10px;
  }
  .legend span {
    font-size: 10px;
  }
  .map-caption {
    max-width: calc(100% - 66px);
  }
  .search {
    flex: 1;
  }
  .search input {
    width: 100%;
    min-width: 60px;
  }
  .filters {
    padding: 0 12px 10px;
    gap: 7px;
  }
  .filters select,.filters button {
    font-size: 12px;
    padding: 7px 5px;
  }
  .table-scroll {
    max-width: 100%;
  }
  table {
    font-size: 12px;
  }
  th,td {
    padding: 8px;
  }
  td:first-child {
    min-width: 120px;
  }
  th {
    white-space: normal;
  }
  footer {
    flex-wrap: wrap;
  }
  .tabs button {
    min-width: 46px;
  }
  .brand span {
    font-size: 13px;
  }
}

@media (max-width: 460px) {
  .mast-inner { flex-wrap: wrap; gap: 0 10px; padding-top: 8px; }
  .mast nav { order: 1; flex-basis: 100%; margin-left: 0; }
  .mast .company-link { margin-left: auto; }
}