:root {
  --ink: #172e29;
  --muted: #526963;
  --paper: #f5f7f3;
  --line: #d1dbd3;
  --green: #11634c;
  --deep: #173e34;
  --tint: #d9eee1;
  --focus: #ffb86a;
  color-scheme: light;
  font:
    15px/1.45 'Inter',
    'Segoe UI',
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.button {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  min-height: 38px;
  font-weight: 600;
  line-height: 1.24;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.primary,
.button.primary {
  background: var(--deep);
  color: white;
  border-color: var(--deep);
}
button[aria-pressed='true'] {
  background: var(--tint);
  color: var(--green);
  border-color: #a6c6b3;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
[hidden] {
  display: none !important;
}
header {
  background: #182d29;
  color: white;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px max(14px, env(safe-area-inset-left));
  flex: 0 0 auto;
  min-height: 46px;
  z-index: 2;
}
.brand {
  font-weight: 760;
  font-size: 19px;
  letter-spacing: -0.055em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  font: 700 19px/25px Arial;
  background: #b7e8b7;
  color: #173b2e;
  width: 25px;
  height: 25px;
  text-align: center;
  border-radius: 6px;
}
#account {
  padding: 4px 8px;
  min-height: 29px;
  font-size: 12px;
  color: white;
  border-color: #668077;
  background: transparent;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sync {
  margin-left: auto;
  font-size: 12px;
  color: #cee4da;
}
#login {
  padding: 28px;
  max-width: 420px;
  margin: auto;
  width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.055em;
  line-height: 1.2;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.04em;
  line-height: 1.25;
}
h3 {
  font-size: 15px;
}
p + p {
  margin-top: 6px;
}
.muted,
.hint,
small {
  color: var(--muted);
  font-size: 13px;
}
#widget,
#auth-status {
  margin-top: 15px;
}
#workspace,
#map-page,
#content {
  min-height: 0;
}
#workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#map-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
.toolbar {
  display: grid;
  gap: 8px;
  padding: 11px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  z-index: 1;
}
.toprow,
.searchrow,
.maprow,
.row,
.actions,
.sheethead {
  display: flex;
  gap: 8px;
  align-items: center;
}
.toprow,
.maprow,
.spread {
  justify-content: space-between;
}
.goal {
  font-size: 12px;
  color: var(--green);
  background: var(--tint);
  border-color: transparent;
  min-height: 29px;
  padding: 4px 9px;
}
input:not([type='checkbox']),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #becbc3;
  border-radius: 8px;
  background: white;
  padding: 8px;
  min-height: 38px;
}
textarea {
  min-height: 75px;
  resize: vertical;
}
.searchrow input {
  flex: 1;
}
.segmented {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 2px;
}
.segmented button {
  border: 0;
  min-height: 27px;
  padding: 4px 11px;
  font-size: 13px;
}
.maprow > button {
  min-height: 32px;
  padding: 4px 9px;
  font-size: 13px;
}
#shown {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
#map {
  flex: 1;
  background: #e5ece6;
  z-index: 0;
}
#map .leaflet-tooltip {
  font: 600 10px/1.1 Arial;
}
.zip-label {
  border: 0 !important;
  box-shadow: none !important;
  background: #ffffffe0 !important;
  color: #334e43 !important;
  pointer-events: none;
}
.zip-label:before {
  display: none;
}
.shop-marker,
.point-icon {
  background: none;
  border: 0;
}
.pin {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  background: var(--pin);
  border: 2px solid #fff;
  outline: 1px solid #3a534e;
  border-radius: 50%;
  font: 700 10px/1 Arial;
  color: #10231e;
  position: relative;
  box-shadow: 0 1px 3px #233a3850;
}
.pin.mine {
  border: 3px solid #172e29;
}
.pin.late {
  outline: 3px solid #ba3036;
}
.pin.chosen {
  transform: scale(1.3);
  outline: 2px solid var(--green);
}
.pin i {
  position: absolute;
  left: 13px;
  top: -8px;
  background: white;
  color: var(--ink);
  border: 1px solid #638071;
  border-radius: 3px;
  padding: 1px 2px;
  font: 700 8px Arial;
}
.start-flag {
  font-size: 26px;
  color: #173d32;
  text-shadow: 0 0 4px white;
}
#map-actions {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 25px;
  z-index: 1;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
#map-actions > * {
  pointer-events: auto;
}
.planbar {
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  border-radius: 13px;
  padding: 5px;
  box-shadow: 0 3px 16px #193b2c38;
  max-width: 100%;
}
.planbar select {
  min-width: 65px;
  width: auto;
}
.planbar button {
  font-size: 13px;
}
.planbar .pillclose {
  padding: 5px 9px;
}
.plan-list {
  background: white;
  display: grid;
  gap: 2px;
  font-size: 12px;
  padding: 5px;
  max-height: 55px;
  overflow: auto;
}
.plan-wrap {
  display: grid;
  justify-items: center;
  gap: 3px;
}
#shop-list,
#content {
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
}
.listrows {
  padding: 0 12px 100px;
}
.listrow {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 2px;
  background: transparent;
}
.listrow .muted {
  margin-top: 3px;
}
.tag {
  border-radius: 5px;
  background: #e7eee9;
  padding: 2px 5px;
  font-size: 11px;
}
.status {
  font-weight: 650;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.dot {
  width: 11px;
  height: 11px;
  background: var(--pin);
  border: 1px solid #688075;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
#content {
  padding: 17px 14px 28px;
}
.page-head,
.block {
  margin-bottom: 16px;
}
.card {
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  margin-top: 10px;
}
.card p,
.card h3 {
  overflow-wrap: anywhere;
}
.card .actions {
  margin-top: 8px;
}
.actions {
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 10px;
}
.spaced {
  margin-top: 12px;
}
nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px max(6px, env(safe-area-inset-bottom));
  background: white;
  border-top: 1px solid var(--line);
  z-index: 2;
}
nav button {
  flex: 1;
  max-width: 180px;
  background: none;
  border-color: transparent;
  min-height: 39px;
}
nav button.current {
  background: var(--tint);
  color: var(--green);
}
dialog {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, 560px);
  max-width: 100%;
  max-height: min(90dvh, 820px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 -8px 30px #213a341f;
  overflow: auto;
  background: var(--paper);
}
dialog::backdrop {
  background: #13272064;
}
.sheethead {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
  padding: 13px 16px 10px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
#close-sheet {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 22px;
}
#sheet-body {
  padding: 14px 16px max(22px, env(safe-area-inset-bottom));
  overflow-wrap: anywhere;
}
.field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  font-weight: 400;
}
.fields {
  display: grid;
  gap: 12px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.legend button {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.legend b {
  margin-left: auto;
}
.meta {
  margin: 6px 0 0;
  font-size: 14px;
}
.metric {
  font-size: 30px;
  letter-spacing: -0.05em;
  font-weight: 700;
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: #e3eae4;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--green);
}
.summary-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.summary-table td,
.summary-table th {
  vertical-align: top;
  text-align: left;
  padding: 7px 3px;
  border-bottom: 1px solid var(--line);
}
.map-frame { flex: 1; min-height: 0; position: relative; display: flex; }
#status-counts {
  position: absolute; top: 5px; left: 6px; right: 6px; z-index: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px 6px;
  max-width: 430px; margin: auto; padding: 4px 6px;
  border-radius: 7px; background: #fffffff2; border: 1px solid #bbc9c2;
  color: var(--ink); font-size: 10px; line-height: 1.45; pointer-events: none;
}
#status-counts span { display: flex; gap: 3px; align-items: center; white-space: nowrap; }
#status-counts i { flex: none; width: 6px; height: 6px; border-radius: 100%; background: var(--pin); }
#status-counts b { font-variant-numeric: tabular-nums; }
.shop-marker { display: grid; place-items: center; }
.pin sup { position: absolute; right: -7px; top: -5px; padding: 1px 3px; border-radius: 5px; background: #172e29; color: white; font: bold 10px/12px Arial; }
.locate-control button { min-height: 30px; min-width: 30px; border: 0; padding: 0; font: 23px/30px Arial; }
.area-key { display: flex; align-items: baseline; gap: 6px; }
.area-key i { width: 11px; height: 11px; flex: none; border-radius: 3px; }
.legend-note { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.legend-note b { text-align: center; min-width: 17px; }
.legend-mark { flex: none; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: #d1dad3; border: 1px solid currentColor; font: 700 10px/1 Arial; }
.legend-mark.overdue { outline: 2px solid #ba3036; outline-offset: 1px; }
.legend-mark.mine { border: 3px solid #172e29; }
.legend-mark.new, .legend-mark.legacy { border-radius: 3px; background: white; }
.visit-details { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); gap: 4px 10px; margin: 5px 0; }
.visit-details dt { color: var(--muted); font-size: 13px; }
.visit-details dd { margin: 0; }
.stack, .fields, .field { grid-template-columns: minmax(0, 1fr); }
.card, .field, .row > *, .sheethead h2, .legend button { min-width: 0; overflow-wrap: anywhere; }
.summary-table { table-layout: fixed; overflow-wrap: anywhere; }
.summary-table th:nth-child(2), .summary-table th:nth-child(3) { width: 17%; }
.summary-table th:last-child { width: 40%; }
.listrow { overflow-wrap: anywhere; }
.listrow .status { flex-shrink: 0; max-width: 48%; }
@media (max-width: 719px) {
  #status-counts { top: 3px; padding: 1px 6px; row-gap: 0; line-height: 1.15; }
  header { min-height: 35px; padding: 3px 10px; }
  .toolbar { padding: 4px 8px; gap: 3px; }
  .searchrow button, .searchrow input { min-height: 31px; padding: 3px 8px; }
  .maprow, .searchrow { gap: 5px; }
  .segmented button { min-height: 22px; }
  nav { padding: 3px 8px max(3px, env(safe-area-inset-bottom)); }
  nav button { min-height: 33px; }
}
#notice {
  position: fixed;
  z-index: 1000;
  inset: 46px 12px auto;
  margin: auto;
  width: fit-content;
  max-width: min(485px, calc(100% - 24px));
  color: white;
  background: #193b32;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  pointer-events: none;
}
#notice:empty {
  display: none;
}
body:has(dialog[open]) #notice { display: none; }
.error {
  color: #9c3435;
}
.save-note {
  font-size: 12px;
  color: var(--green);
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  margin: 0;
}
legend {
  padding: 0 5px;
  font-weight: 600;
  font-size: 13px;
}
@media (min-width: 720px) {
  .toolbar,
  #content {
    padding-left: max(18px, calc((100vw - 850px) / 2));
    padding-right: max(18px, calc((100vw - 850px) / 2));
  }
  .listrows {
    max-width: 850px;
    margin: auto;
  }
  dialog {
    bottom: 20px;
    border-radius: 14px;
    border-bottom: 1px solid var(--line);
  }
}
