:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #172e27;
  background: #f6f8f5;
  --forest: #132823;
  --ink: #172e27;
  --muted: #4e625b;
  --line: #dbe4dd;
  --lime: #d8f18f;
  --gps: #176bc3;
  --actual: #087b59;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #197cc4; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }

.masthead {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px max(22px, env(safe-area-inset-right)) 12px max(22px, env(safe-area-inset-left));
  padding-top: max(12px, env(safe-area-inset-top));
  min-height: 72px;
  color: #fff;
  background: var(--forest);
}
.brand { font-size: .75rem; font-weight: 750; letter-spacing: .13em; color: #c9e2b0; }
h1 { font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.2; letter-spacing: -.025em; }
.storage-badge {
  margin-inline-start: auto;
  padding: 6px 10px;
  border: 1px solid #527066;
  border-radius: 60px;
  font-size: .84rem;
  color: #e2eee7;
  text-align: center;
}

.workspace { min-height: calc(100dvh - 72px); display: grid; grid-template-columns: 1fr minmax(370px, 420px); align-items: start; }
.map-panel { position: sticky; top: 0; height: calc(100dvh - 72px); isolation: isolate; background: #e2e9e3; min-width: 0; overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-controls { position: absolute; inset: 15px 15px auto; display: flex; justify-content: space-between; gap: 9px; pointer-events: none; }
.map-selectors {
  display: flex;
  min-width: 0;
  padding: 7px;
  gap: 8px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 12px #1328232b;
  pointer-events: auto;
}
.map-selectors label, .review-filters label {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: .875rem;
  color: var(--muted);
  font-weight: 650;
}
.map-selectors label { padding-inline-start: 3px; }
select {
  width: 100%;
  min-height: 44px;
  padding: 5px 31px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%234e625b' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") right 8px center / 16px no-repeat;
  color: var(--ink);
  font-size: .94rem;
  font-weight: 650;
}
.map-selectors select { max-width: min(34vw, 165px); }
.locate-button {
  flex: 0 0 47px;
  align-self: start;
  display: grid;
  place-items: center;
  height: 47px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 11px;
  pointer-events: auto;
  box-shadow: 0 2px 12px #1328232b;
}
.map-status {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: max-content;
  max-width: min(86%, 360px);
  padding: 13px 16px;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 2px 14px #13282324;
}
.legend {
  position: absolute;
  left: 15px;
  bottom: 35px;
  display: flex;
  gap: 14px;
  background: #fffffff5;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 650;
  pointer-events: none;
}
.legend span, .step-heading { display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; }
.gps { background: var(--gps); }
.actual { background: var(--actual); }
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px #28483c;
  pointer-events: none;
}
.crosshair::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #28483c;
}

.sidebar { min-width: 0; padding: 22px 24px max(22px, env(safe-area-inset-bottom)); }
.tabs { display: flex; gap: 5px; padding: 4px; margin-bottom: 22px; border-radius: 9px; background: #e8eee9; }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 6px; color: var(--muted); background: none; font-weight: 700; }
.tabs button[aria-pressed="true"] { color: var(--ink); background: white; box-shadow: 0 1px 5px #1328231c; }
#record-count { display: inline-block; min-width: 22px; padding: 2px 5px; margin-left: 4px; border-radius: 20px; font-size: .8rem; background: #dfe9dd; }
h2 { font-size: 1.52rem; letter-spacing: -.035em; }
h3 { font-size: 1rem; font-weight: 700; }
.intro { margin: 6px 0 17px; color: var(--muted); line-height: 1.45; }
.detail { color: var(--muted); font-size: .925rem; line-height: 1.45; }
.step { padding: 14px; margin-bottom: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.step .detail { margin-top: 4px; }
.step .button { margin-top: 9px; }
.button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; color: var(--ink); background: white; font-weight: 700; }
.button.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.button.primary:hover:not(:disabled), .button.primary:active:not(:disabled) { background: #274638; }
.button.compact { font-size: .9rem; }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button:not(.primary):hover:not(:disabled) { border-color: #8bab99; }
.note-label { display: block; margin: 15px 0 5px; font-size: .92rem; font-weight: 700; }
.note-label span { margin-left: 4px; color: var(--muted); font-weight: 400; }
#note { min-height: 44px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.collect-actions { display: flex; gap: 7px; margin-top: 12px; }
#save { flex: 1; }
#save:enabled { color: var(--forest); background: var(--lime); border-color: #a9bd77; }
#save:enabled:hover { background: #c5e579; }
.notice { padding: 10px 12px; margin: -10px 0 14px; color: #234837; background: #e3efe4; border-radius: 8px; font-size: .92rem; }
.notice[data-error="true"] { color: #782d19; background: #f8e6da; }
.privacy { margin-top: 19px; color: var(--muted); font-size: .875rem; line-height: 1.45; }

.review-filters { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-bottom: 13px; }
.empty { min-height: 68px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.shift-card { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; padding: 13px; border-radius: 10px; background: var(--forest); color: #fff; }
.shift-card p { grid-column: span 2; color: #c9e2b0; font-size: .9rem; }
.shift-card strong { color: var(--lime); font-size: 1.65rem; letter-spacing: -.04em; }
.shift-card span { align-self: center; font-size: .92rem; }
.metrics { display: grid; grid-template-columns: 1fr 1fr 1.2fr; margin: 10px 0; gap: 7px; }
.metrics div { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.metrics dt { color: var(--muted); font-size: .875rem; }
.metrics dd { margin-top: 2px; font-size: 1.08rem; font-weight: 750; }
.method { margin-top: 5px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.method summary { font-weight: 700; cursor: pointer; padding-block: 7px; }
.method p { padding-bottom: 8px; }
.records { list-style: none; padding: 0; margin: 13px 0; }
.records li { margin-top: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.record-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; text-align: left; width: 100%; padding: 10px 12px; gap: 2px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); }
.record-card:hover, .record-card[aria-pressed="true"] { background: #e8f1e7; }
.record-card strong, .record-card span { overflow-wrap: anywhere; }
.record-card .delta { text-align: end; }
.record-card .detail { grid-column: span 2; }
.record-details { padding: 4px 12px 12px; }
.record-details button { margin-top: 8px; }
.record-details .delete { color: #8a3324; }
.exports { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

@media (max-width: 760px) {
  .masthead { min-height: 63px; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .brand-icon { width: 33px; height: 33px; }
  .masthead { gap: 9px; }
  .storage-badge { padding: 4px 7px; font-size: .76rem; }
  .workspace { display: block; min-height: 0; }
  .map-panel { position: relative; height: clamp(270px, 43svh, 430px); }
  .map-controls { inset: 9px 10px auto; }
  .legend { left: 10px; bottom: 27px; }
  .sidebar { padding: 12px 13px max(20px, env(safe-area-inset-bottom)); }
  .tabs { margin-bottom: 13px; }
  .notice { margin-top: 0; }
}
