:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #193c31;
  background: #f5f5ee;
  font-size: 16px;
  font-synthesis: none;
  --ink: #193c31;
  --muted: #52675d;
  --line: #d5ded4;
  --accent: #234f41;
  --paper: #fff;
  --soft: #edf3ec;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 11px 16px;
  min-height: 44px;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.secondary {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}
button.danger {
  background: #8b302e;
  border-color: #8b302e;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  background: #fff;
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
:focus-visible {
  outline: 3px solid #b66b05;
  outline-offset: 4px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin-bottom: 16px;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
h3 {
  font-size: 18px;
}
small {
  font-size: 12px;
}
.app-header {
  max-width: 1440px;
  margin: auto;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}
.brand small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.brand-mark {
  border: 1px solid var(--accent);
  padding: 10px 8px;
  border-radius: 50%;
  font-size: 14px;
  letter-spacing: -0.1em;
}
.brand-mark span {
  color: #85622f;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 30px;
  background: #e1eadf;
  color: #24462f;
  white-space: nowrap;
}
.pill.offline {
  background: #fff0ca;
  color: #694c08;
}
main {
  max-width: 1320px;
  padding: 42px 40px 100px;
  margin: auto;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 12px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 30px;
}
.intro p {
  max-width: 600px;
  color: var(--muted);
  line-height: 1.7;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.top-actions {
  margin-bottom: 22px;
}
.visit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.visit-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.visit-card h2 {
  overflow-wrap: anywhere;
  margin: 8px 0 12px;
}
.visit-card p {
  color: var(--muted);
  line-height: 1.5;
}
.visit-card button {
  align-self: flex-start;
  margin-top: auto;
}
.count-line {
  font-size: 13px;
  margin-bottom: 24px;
}
.empty {
  border: 1px dashed #afc1af;
  border-radius: 16px;
  padding: 56px 30px;
  text-align: center;
  background: linear-gradient(130deg, #edf3e7, #faf7ef);
}
.empty p {
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 22px;
  line-height: 1.6;
}
.storage-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 26px 0 0;
  max-width: 820px;
}
.workspace-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}
.workspace-head h1 {
  font-size: 36px;
  max-width: 800px;
  overflow-wrap: anywhere;
}
.workspace-head p {
  color: var(--muted);
}
.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  margin-top: 26px;
}
.workspace-sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #edf1e7;
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 18px;
}
.workspace-sidebar .actions {
  display: grid;
}
.workspace-sidebar button {
  width: 100%;
  text-align: left;
}
.workspace-sidebar p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.obs-list {
  display: grid;
  gap: 16px;
}
.obs-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
}
.obs-image {
  width: 100%;
  height: 100%;
  max-height: 240px;
  min-height: 180px;
  object-fit: cover;
  background: #e6ebe2;
}
.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #e6ebe2;
  padding: 24px;
  font-size: 13px;
  min-height: 180px;
}
.obs-body {
  padding: 22px;
}
.obs-body h3,
.obs-body p {
  overflow-wrap: anywhere;
}
.obs-body p {
  line-height: 1.55;
  white-space: pre-wrap;
  font-size: 14px;
}
.obs-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
.obs-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.obs-actions button {
  font-size: 13px;
  padding: 7px 12px;
}
.number {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 750;
  margin-bottom: 8px;
}
.map-panel {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
}
.map-panel h2 {
  padding: 22px 22px 0;
  margin-bottom: 10px;
}
.map-panel p {
  padding: 0 22px;
  font-size: 13px;
  color: var(--muted);
}
.map-panel svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 330px;
}
.map-panel .map-legend {
  padding: 0 22px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.map-legend button {
  font-size: 12px;
  min-height: 36px;
  padding: 6px 10px;
}
.notice {
  padding: 14px 18px;
  background: #fff3d5;
  border: 1px solid #e8d4a8;
  border-radius: 9px;
  color: #665020;
  font-size: 13px;
  line-height: 1.6;
}
.report-frame {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  margin-top: 24px;
}
.report-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.report-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(600px, calc(100% - 28px));
  max-height: 90dvh;
  padding: 30px;
  box-shadow: 0 25px 100px #193c3144;
}
dialog::backdrop {
  background: #182c2477;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 15px 0;
}
input:not([type="checkbox"]):not([type="file"]),
textarea,
select {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #a9b9aa;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  margin-top: 7px;
}
input[type="file"] {
  display: block;
  max-width: 100%;
  margin: 10px 0;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
textarea {
  resize: vertical;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  margin: 18px 0;
}
legend {
  font-size: 14px;
  font-weight: 650;
  padding: 0 6px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.help {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 400;
}
.photo-picker {
  background: var(--soft);
  padding: 1px 16px 8px;
  border-radius: 9px;
}
.photo-picker img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin: 10px auto;
}
.photo-picker img[hidden] {
  display: none;
}
.form-error {
  color: #a02422;
  font-size: 14px;
}
.loading {
  padding: 60px;
  text-align: center;
}
#status:not(:empty) {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #193c31;
  color: white;
  padding: 13px 20px;
  border-radius: 12px;
  z-index: 20;
  max-width: calc(100% - 32px);
  box-shadow: 0 4px 30px #0002;
}
#alert:not([hidden]) {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff4dd;
  color: #622b1b;
  border: 2px solid #985830;
  padding: 14px 20px;
  z-index: 30;
  border-radius: 10px;
  width: min(640px, calc(100% - 24px));
}
#access-panel {
  max-width: 1320px;
  margin: auto;
  padding: 12px 40px;
  background: #e3eadf;
}
#access-panel label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 24px 8px 0;
}
.larger-text {
  font-size: 20px;
}
.high-contrast {
  --ink: #071c10;
  --muted: #203b2d;
  --line: #375643;
  --paper: #fff;
  --soft: #fff;
  --accent: #00351d;
  background: #fff;
}
.high-contrast .pill,
.high-contrast .workspace-sidebar,
.high-contrast .photo-picker {
  background: #fff;
  border-color: #375643;
}
.reduce-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 800px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .workspace-sidebar {
    position: static;
  }
  .workspace-sidebar .actions {
    display: flex;
    flex-wrap: wrap;
  }
  .workspace-sidebar button {
    width: auto;
  }
  .intro {
    display: block;
  }
  .workspace-head {
    display: block;
  }
  .app-header,
  main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .intro .actions {
    margin-top: 20px;
  }
}
@media (max-width: 480px) {
  main {
    padding: 26px 16px 90px;
  }
  .app-header {
    padding: 16px;
    gap: 8px;
  }
  .brand {
    font-size: 16px;
    gap: 8px;
  }
  .brand-mark {
    display: none;
  }
  .header-tools {
    gap: 6px;
  }
  .header-tools button {
    padding: 8px 10px;
    font-size: 13px;
  }
  .header-tools .pill {
    font-size: 10px;
    padding: 5px 7px;
  }
  .obs-card {
    grid-template-columns: 1fr;
  }
  .obs-image {
    max-height: 220px;
    height: 180px;
  }
  .no-photo {
    min-height: 70px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .workspace-head h1 {
    font-size: 30px;
  }
  .visit-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 22px;
  }
  .report-controls {
    align-items: stretch;
  }
  .report-controls button {
    width: 100%;
  }
  #access-panel {
    padding: 12px 16px;
  }
}

[hidden] {
  display: none !important;
}

.draft-list {
  border: 1px solid #cab76b;
  background: #fff7dd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.draft-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #ded2a6;
  padding: 12px 0;
}
.draft-row > span {
  flex: 1;
  min-width: 130px;
  overflow-wrap: anywhere;
}
.draft-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.field-map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.field-map-tools button {
  font-size: 12px;
  padding: 8px;
  min-height: 44px;
}
.field-map-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 5/3;
  overflow: hidden;
  border: 1px solid #8aab9d;
  background-color: #eaf1ec;
  background-image:
    linear-gradient(#a9c5b355 1px, transparent 1px),
    linear-gradient(90deg, #a9c5b355 1px, transparent 1px);
  background-size: 10% 10%;
  cursor: crosshair;
}
.field-basemap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none !important;
  object-fit: fill;
  pointer-events: none;
}
.field-map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.field-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 36px;
  min-height: 36px;
  padding: 4px !important;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #234f41;
  color: #fff;
  box-shadow: 0 1px 6px #0005;
  pointer-events: auto;
  z-index: 2;
}
.field-map-selected {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 40px;
  font-weight: 800;
  color: #a62b06;
  line-height: 1;
  text-shadow: 0 0 3px white;
  z-index: 3;
}
.field-map-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #142e27;
  font-size: 30px;
  pointer-events: none;
  opacity: 0.65;
}
.field-map-status,
.field-map-attribution {
  font-size: 12px !important;
  overflow-wrap: anywhere;
}
.field-map-attribution {
  line-height: 1.45;
}
.field-map-help {
  font-size: 13px;
}
.location-picker {
  margin: 14px 0;
}
.high-contrast .field-map-pin {
  background: #000;
  color: #fff;
}
.field-map-viewport:focus-visible {
  outline: 3px solid #ae5600;
  outline-offset: 3px;
}

/* Evidence-led notebook: visits are a working ledger, not equal-weight feature cards. */
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.notebook-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
}
.notebook-heading p {
  color: var(--muted);
  font-size: 13px;
}
.notebook-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  margin: 20px 0 8px;
}
.notebook-tools label {
  margin: 0;
}
.visit-grid {
  display: block;
  border-top: 1px solid var(--line);
}
.visit-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 24px;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 24px 0;
  background: transparent;
  align-items: start;
}
.visit-card h3 {
  font-size: 22px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.visit-card p {
  margin-bottom: 10px;
}
.visit-card .count-line {
  margin-bottom: 8px;
}
.visit-card button {
  margin: 0;
  align-self: center;
}
.visit-date .eyebrow {
  display: block;
  margin-bottom: 10px;
  line-height: 1.5;
}
.recent-label {
  font-size: 12px;
  font-weight: 650;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.visit-summary small {
  color: var(--muted);
}
.review-brief {
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  background: var(--paper);
  margin: 26px 0;
}
.review-brief h2 {
  margin-bottom: 10px;
}
.review-brief > p {
  margin-bottom: 12px;
}
.review-brief details {
  margin-top: 16px;
}
.review-brief summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.evidence-warning {
  color: #8b302e;
  font-weight: 650;
}
.empty {
  background: var(--soft);
}
@media (max-width: 700px) {
  .notebook-heading {
    display: block;
  }
  .notebook-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .visit-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 22px 0;
  }
  .visit-date {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
  }
  .visit-date .eyebrow {
    margin: 0;
  }
  .visit-card button {
    width: 100%;
  }
  .review-brief {
    padding: 18px 16px;
  }
}

.notebook-intro h1 {
  font-size: clamp(28px, 3vw, 38px);
  max-width: 650px;
}
.notebook-intro p {
  font-size: 15px;
  margin-bottom: 0;
}
.notebook-intro {
  margin-bottom: 20px;
}
.preview-details summary {
  min-height: 44px;
  display: list-item;
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
}
.preview-details {
  padding-top: 0;
  padding-bottom: 0;
}
.preview-details p {
  margin: 4px 0 16px;
}
