:root {
  color-scheme: light;
  font-family: Inter, Roboto, system-ui, sans-serif;
  color: #182a2a;
  background: #f4f7f6;
  --ink: #182a2a;
  --muted: #576866;
  --border: #dce5e2;
  --green: #0d7468;
  --green-dark: #085c53;
  --surface: #fff;
  --danger: #a32b38;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
}
button { padding: 8px 13px; font-size: .88rem; font-weight: 620; cursor: pointer; }
button:hover:not(:disabled) { background: #eaf2ef; }
button:disabled { cursor: default; opacity: .52; }
button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover:not(:disabled) { background: var(--green-dark); }
button.danger { color: var(--danger); }
button.small { font-size: .81rem; min-height: 35px; padding: 6px 10px; }
button.text-button { min-height: 34px; padding-inline: 0; border: 0; background: transparent; color: var(--green-dark); text-align: left; }
:focus-visible { outline: 3px solid #388ddd; outline-offset: 3px; }
select, input, textarea { padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.25rem, 2.2vw, 1.72rem); letter-spacing: -.04em; }
h2 { font-size: .98rem; letter-spacing: -.015em; }
h3 { font-size: 1.15rem; margin: 5px 0 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.app-header {
  min-height: 66px; padding: 12px clamp(12px, 3vw, 32px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: white; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.035em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; color: white; background: var(--green); font-size: 1.1rem; }
.header-actions, .tool-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-chip { font-size: .8rem; font-weight: 600; color: var(--green-dark); padding: 5px 9px; border-radius: 7px; background: #e6f4f0; }
.status-chip[data-state="warning"] { color: #8c4b0d; background: #fff1db; }
.workspace { display: grid; grid-template-columns: minmax(184px, 220px) minmax(0, 1fr) minmax(184px, 225px); min-height: calc(100vh - 66px); }
.project-panel, .detail-panel { background: white; padding: 22px 16px; min-width: 0; }
.project-panel { border-right: 1px solid var(--border); }
.detail-panel { border-left: 1px solid var(--border); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.list-heading { margin-top: 26px; }
.feature-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 5px; }
.feature-list button { width: 100%; text-align: left; display: grid; gap: 2px; overflow-wrap: anywhere; }
.feature-list button[aria-pressed="true"] { border-color: #81baae; background: #e6f4ef; }
.feature-list small { color: var(--muted); font-weight: 400; }
.map-workspace { padding: clamp(12px, 2vw, 25px); min-width: 0; }
.map-header, .map-footer, .track-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.map-header { margin-bottom: 14px; }
.section-label { color: var(--green-dark); font-size: .78rem; font-weight: 660; margin-bottom: 4px; }
.map-shell { position: relative; height: clamp(420px, 64vh, 800px); border: 1px solid #cbd9d5; border-radius: 12px; overflow: hidden; background: #edf3f1; }
#map { width: 100%; height: 100%; display: block; touch-action: none; }
.map-controls { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 60px); }
.map-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(320px, calc(100% - 32px)); text-align: center; background: white; border: 1px solid var(--border); padding: 22px 16px; border-radius: 12px; box-shadow: 0 8px 30px #24423712; }
.map-empty strong { font-size: 1.18rem; }
.map-empty p { font-size: .88rem; line-height: 1.45; color: var(--muted); margin: 7px 0 14px; }
.map-notice { position: absolute; bottom: 42px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--border); padding: 7px 10px; border-radius: 8px; font-size: .85rem; }
.map-footer, .track-toolbar { margin-top: 10px; }
.track-toolbar { padding: 11px 12px; border: 1px solid #add2c9; border-radius: 9px; background: #e9f6f1; }
.track-toolbar strong, .track-toolbar span { display: block; }
.notice { padding: 9px 12px; border-left: 3px solid var(--green); background: #e6f4f0; margin-top: 12px; font-size: .9rem; overflow-wrap: anywhere; }
.notice[data-error="true"] { border-color: var(--danger); background: #fff0f0; color: #702631; }
.detail-panel > h2 { margin-bottom: 12px; }
dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 10px 0 13px; font-size: .84rem; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; max-width: 120px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-notes { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; }
.project-summary { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
dialog { width: min(445px, calc(100vw - 26px)); max-height: 92dvh; overflow: auto; border: 1px solid var(--border); border-radius: 13px; padding: 20px; color: var(--ink); background: white; }
dialog::backdrop { background: #122d2b69; }
dialog h2 { font-size: 1.15rem; margin-bottom: 12px; }
dialog form { display: grid; gap: 10px; }
dialog form h2 { margin-bottom: 2px; }
dialog label { display: grid; gap: 5px; font-size: .88rem; font-weight: 610; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
#survey-fields { min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 10px; margin: 0; display: grid; gap: 9px; }
#survey-fields legend { padding: 0 5px; font-weight: 650; }
.gps-chip { background: white; }
.map-attribution { position: absolute; left: 12px; bottom: 40px; background: #fffffff2; color: var(--ink); padding: 3px 6px; border-radius: 3px; font-size: .7rem; }
.account-list { margin: 0; padding-left: 20px; }
.detail-photos { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.detail-photos h3 { margin: 0; font-size: .95rem; }
.photo-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.photo-list li { display: grid; grid-template-columns: 1fr auto; gap: 5px; align-items: center; }
.photo-list .photo-item { display: flex; align-items: center; gap: 8px; text-align: left; }
.photo-item img { width: 44px; height: 38px; object-fit: cover; border-radius: 4px; }
#photo-full { display: block; max-width: 100%; max-height: 70dvh; margin: auto; object-fit: contain; }
.form-error { color: var(--danger); font-size: .87rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 188px minmax(0, 1fr); }
  .detail-panel { grid-column: 2; border: 0; border-top: 1px solid var(--border); }
  .project-panel { grid-row: 1 / 3; }
}
@media (max-width: 690px) {
  .workspace { display: flex; flex-direction: column; }
  .project-panel { padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .project-panel:has(#inventory:not([hidden])) { display: contents; }
  .project-panel:has(#inventory:not([hidden])) > :not(#inventory):not(label) { margin: 3px 12px; width: calc(100% - 24px); }
  #inventory { order: 2; padding: 12px; background: white; border-top: 1px solid var(--border); }
  .list-heading { margin-top: 0; }
  .detail-panel { order: 3; padding: 14px 12px; }
  .app-header { gap: 7px; align-items: flex-start; }
  .header-actions { justify-content: flex-end; gap: 5px; }
  .status-chip { order: 3; padding-block: 2px; }
  .map-shell { height: clamp(335px, 52dvh, 520px); }
  .map-header { gap: 9px; }
  .map-workspace { padding: 12px; }
}
