:root {
  --ink: #172322;
  --muted: #6f7d78;
  --paper: #f4f1e9;
  --panel: #fffdf7;
  --line: #d9ddd2;
  --pine: #1e5d54;
  --mint: #d9eee4;
  --amber: #de9b48;
  --rose: #d87562;
  --shadow: 0 22px 65px rgba(29, 52, 44, .12);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 0%, #e7eee4, transparent 35%), var(--paper); font-family: "Trebuchet MS", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.topbar, .toolbar, .workspace, .stats { display: flex; gap: 20px; }
.topbar { align-items: flex-start; justify-content: space-between; margin-bottom: 30px; }
.brand-lockup { display: flex; align-items: flex-start; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 3px; border-radius: 50%; color: white; background: var(--pine); font-size: 12px; }
.top-actions { display: none; gap: 8px; }
.top-action { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--pine); background: var(--panel); font-size: 25px; line-height: 1; }
.eyebrow { margin: 0 0 8px; color: var(--pine); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 70px); font-weight: 500; letter-spacing: -.05em; line-height: .96; }
h1 em, h1 span { color: var(--pine); font-style: normal; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.subhead { color: var(--muted); font-size: 15px; }
.cemetery-chip { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 247, .68); font-size: 13px; font-weight: 800; }
.cemetery-thumb { display: grid; place-items: center; width: 48px; height: 48px; grid-row: span 2; border-radius: 10px; color: white; background: linear-gradient(145deg, #6c8d77, #1e5d54); font-size: 20px; }
.cemetery-copy { display: grid; gap: 3px; }
.cemetery-copy strong { font-size: 14px; }
.cemetery-summary { color: var(--muted); font-size: 11px; font-weight: 400; }
.cemetery-summary b { color: var(--pine); }
.cemetery-chip small { grid-column: 2; color: var(--muted); font-weight: 400; }
.cemetery-chip select { grid-column: 1 / -1; min-width: 180px; margin-top: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--pine); background: var(--panel); font-size: 12px; }
.status-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #5cac77; box-shadow: 0 0 0 5px #dcefe0; }
.stats { margin-bottom: 28px; }
.stats div { flex: 1; padding: 18px 20px; border-top: 2px solid var(--line); }
.stats strong, .stats span { display: block; }
.stats strong { font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.stats span { margin-top: 3px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.toolbar { align-items: center; margin-bottom: 18px; }
.primary-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.secondary-toolbar { flex-wrap: wrap; }
.secondary-toolbar > #walk-status, .secondary-toolbar > #moderation-status, .secondary-toolbar > #report-list, .secondary-toolbar > #source-status, .secondary-toolbar > #source-records, .secondary-toolbar > .public-data-notice { flex-basis: 100%; }
.search-box { display: flex; align-items: center; flex: 1; gap: 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.search-box span { color: var(--pine); font-size: 20px; font-weight: 800; }
.search-box input { width: 100%; padding: 15px 0; border: 0; outline: 0; background: transparent; }
.button { border: 0; border-radius: 9px; padding: 14px 17px; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(29, 52, 44, .12); }
.button-primary { color: white; background: var(--pine); }
.button-primary span { margin-right: 5px; font-size: 18px; }
.button-quiet { color: var(--pine); border: 1px solid var(--line); background: var(--panel); }
.bottom-nav { display: none; }
.start-screen { max-width: 760px; margin: 24px auto 0; padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,247,.82); box-shadow: var(--shadow); }
.start-intro h2 { margin: 0 0 10px; font-family: "Trebuchet MS", sans-serif; font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -.05em; }
.start-intro > p:last-child { max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.start-search { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(29,52,44,.06); }
.start-search span { color: var(--pine); font-size: 26px; }
.start-search input { width: 100%; padding: 18px 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.start-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.start-actions .button { min-height: 52px; }
.nearby-section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; font-size: 18px; }
.text-button { border: 0; color: var(--pine); background: transparent; font-size: 12px; font-weight: 800; }
.nearby-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nearby-tools .button { padding: 10px 12px; font-size: 12px; white-space: nowrap; }
.nearby-status { color: var(--muted); font-size: 11px; }
.nearby-results { display: grid; gap: 9px; }
.nearby-empty { margin: 10px 0; color: var(--muted); font-size: 13px; }
.nearby-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 13px; width: 100%; margin-top: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel); text-align: left; }
.nearby-thumb { width: 58px; height: 58px; border-radius: 10px; background: linear-gradient(145deg, #b0c8a9, #37675b); }
.nearby-thumb-beta { background: linear-gradient(145deg, #d8a46e, #315a51); }
.nearby-card span:not(.nearby-thumb) { display: grid; gap: 3px; }
.nearby-card strong { font-size: 14px; }
.nearby-card small, .nearby-card em { color: var(--muted); font-size: 11px; font-style: normal; }
.nearby-card em { color: var(--pine); }
.nearby-card > b { color: var(--muted); font-size: 25px; font-weight: 400; }
.workspace { align-items: stretch; }
.map-panel, .details-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.map-panel { flex: 1.55; min-width: 0; padding: 22px; }
.details-panel { flex: .75; min-width: 300px; overflow: hidden; }
.map-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 17px; }
.map-source { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.map-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.map-control { min-width: 42px; min-height: 42px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; color: var(--ink); background: rgba(255,253,247,.92); font-weight: 800; box-shadow: 0 4px 13px rgba(29,52,44,.12); }
.map-control-wide { color: var(--pine); font-size: 12px; }
.map-layer-status { margin-left: auto; color: var(--muted); font-size: 11px; }
.map-level-status { padding: 5px 8px; border-radius: 999px; color: var(--pine); background: var(--mint); font-size: 10px; font-weight: 800; white-space: nowrap; }

.walk-status, .moderation-status, .report-list { display: flex; flex-direction: column; gap: 12px; }
.walk-status > *, .moderation-status > *, .report-list > * { padding: 14px 18px; border-radius: 14px; background: var(--panel); }
.walk-status .status-dot, .moderation-status .status-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #5cac77; box-shadow: 0 0 0 5px #dcefe0; }
.report-list { gap: 16px; }
.report-list > * { padding: 18px 20px; border: 1px solid var(--line); }

@media (max-width: 560px) {
  .walk-status, .moderation-status, .report-list { gap: 10px; }
  .walk-status > *, .moderation-status > *, .report-list > * { padding: 12px 16px; }
  .report-list > * { padding: 14px 16px; }
}
@media (max-width: 560px) { .toolbar > * { min-height: 48px; } .map-shell { min-height: 360px; } #source-records { overflow-x: auto; } }
@media (max-width: 560px) { .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .stats div { min-width: 0; padding: 13px 6px; } .stats strong { font-size: 24px; } .stats span { overflow-wrap: anywhere; font-size: 8px; } .primary-toolbar { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; } .primary-toolbar .search-box { grid-column: auto; min-width: 0; } .primary-toolbar #add-grave, .primary-toolbar #locate { width: 100%; } .secondary-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; } .primary-toolbar > *, .secondary-toolbar > * { min-width: 0; } .secondary-toolbar > #walk-status, .secondary-toolbar > #moderation-status, .secondary-toolbar > #report-list, .secondary-toolbar > #source-status, .secondary-toolbar > #source-records, .secondary-toolbar > #field-preflight-status, .secondary-toolbar > .public-data-notice { grid-column: 1 / -1; } .button, .import-label, .filter-label, .checkbox-label { width: 100%; min-width: 0; } .button { padding: 12px 9px; font-size: 13px; } .map-panel { padding: 14px; } }
@media (max-width: 560px) { body { overflow-x: hidden; } .app-shell { width: calc(100% - 24px); } .filter-label select { width: 100%; min-width: 0; } .checkbox-label { display: flex; align-items: center; gap: 7px; } .checkbox-label input { flex: 0 0 auto; width: auto; } .import-label { overflow-wrap: anywhere; } .stats span { word-break: break-word; } }
@media (max-width: 560px) { .primary-toolbar > *, .secondary-toolbar > * { width: 100%; max-width: 100%; } .secondary-toolbar { grid-template-columns: 1fr; } .filter-label select { display: block; box-sizing: border-box; } .stats { width: 100%; min-width: 0; overflow: hidden; } .stats div { min-width: 0; overflow: hidden; } .stats span { max-width: 100%; white-space: normal; overflow-wrap: anywhere; } }
@media (max-width: 560px) { .workspace, .map-panel, .details-panel, .map-shell { width: 100%; max-width: 100%; min-width: 0; } .map-panel, .details-panel { overflow: hidden; } }
.gps-status { max-width: 220px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.map-shell { position: relative; min-height: 570px; overflow: hidden; border: 1px solid #c6d6c5; border-radius: 13px; background: #d8e7d4; background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.18) 25%, transparent 25%); background-size: 34px 34px; }
.map-tiles, .map-path-layer, .maplibre-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.maplibre-map { z-index: 2; background: #d8e7d4; }
.maplibre-map .maplibregl-ctrl-group { border-radius: 9px; overflow: hidden; box-shadow: 0 4px 13px rgba(29,52,44,.16); }
.maplibre-map .maplibregl-ctrl button { min-width: 40px; min-height: 40px; }
.maplibre-map .maplibregl-ctrl-attrib { font-size: 9px; }
.maplibre-grave-cross { width: 30px; height: 30px; padding: 0; border: 0; color: white; background: transparent; font-size: 28px; line-height: 30px; text-shadow: -2px -2px 0 #fffdf7, 2px -2px 0 #fffdf7, -2px 2px 0 #fffdf7, 2px 2px 0 #fffdf7, 0 3px 7px rgba(23,35,34,.55); transform: scale(1); transition: transform .16s ease, filter .16s ease; }
.maplibre-grave-hit-target { width: 38px; height: 38px; padding: 0; border: 0; opacity: 0; background: transparent; cursor: pointer; }
.maplibre-grave-cross.community { color: var(--pine); }.maplibre-grave-cross.family { color: var(--amber); }.maplibre-grave-cross.official { color: var(--rose); }.maplibre-grave-cross:hover, .maplibre-grave-cross.selected { transform: scale(1.25); filter: brightness(1.1); }
.map-shell.map-engine-maplibre::before, .map-shell.map-engine-maplibre::after { display: none; }
.map-tiles { z-index: 0; overflow: hidden; background: #d8e7d4; }
.map-tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map-street-overlay { z-index: 1; opacity: .2; mix-blend-mode: multiply; pointer-events: none; }
.map-path-layer { z-index: 3; pointer-events: none; }
.cemetery-path { fill: none; stroke: #d34d4d; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(20,40,35,.45)); }
.walking-route { fill: none; stroke: #8f1d2c; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12 8; filter: drop-shadow(0 1px 2px rgba(20,40,35,.5)); }
.map-grid { position: absolute; inset: 0; z-index: 4; background-image: none; }
.grave-marker { position: absolute; width: 40px; height: 40px; border: 4px solid rgba(255,253,247,.9); border-radius: 50% 50% 50% 7px; color: white; background: var(--pine); box-shadow: 0 5px 12px rgba(22, 52, 42, .25); transform: translate(-50%, -100%) rotate(-45deg); transition: transform .2s ease, filter .2s ease; }
.grave-marker span { display: block; font-size: 9px; font-weight: 900; transform: rotate(45deg); }
.grave-marker:hover, .grave-marker.selected { filter: brightness(1.13); transform: translate(-50%, -100%) rotate(-45deg) scale(1.13); }
.grave-marker.family { background: var(--amber); }.grave-marker.official { background: var(--rose); }
.user-position { position: absolute; z-index: 4; width: 18px; height: 18px; border: 3px solid white; border-radius: 50%; background: #2875d0; box-shadow: 0 0 0 8px rgba(40,117,208,.2); transform: translate(-50%, -50%); }.user-position span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #2875d0; }.hidden { display: none !important; }
.map-hint { position: absolute; right: 18px; bottom: 16px; z-index: 5; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: rgba(255,253,247,.8); font-size: 11px; }
.route-status { margin-top: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--pine); background: var(--mint); font-size: 12px; line-height: 1.45; }
.map-layer-select { display: flex; align-items: center; gap: 7px; min-width: 160px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }.map-layer-select select { min-width: 125px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--pine); background: var(--panel); font-size: 11px; text-transform: none; letter-spacing: 0; }
.map-layer-legend, .legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 15px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }.map-layer-legend span, .legend span { display: flex; align-items: center; gap: 7px; }.legend-line { display: inline-block; width: 22px; height: 3px; border-radius: 99px; background: rgba(43,85,74,.34); }.legend-line.street { border-top: 2px dotted rgba(43,85,74,.65); background: transparent; }.legend-line.cemetery-path { background: #d34d4d; box-shadow: 0 1px 2px rgba(20,40,35,.4); }.legend-line.active-route { background: repeating-linear-gradient(90deg, #8f1d2c 0 7px, transparent 7px 11px); }.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pine); }.legend-dot.family { background: var(--amber); }.legend-dot.official { background: var(--rose); }
.empty-state { display: grid; place-items: center; min-height: 570px; padding: 35px; text-align: center; }.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 50%; color: var(--pine); background: var(--mint); font-size: 28px; }.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.grave-detail { padding: 25px; }.detail-image { display: grid; place-items: center; min-height: 150px; margin: -25px -25px 23px; color: rgba(255,255,255,.75); background: linear-gradient(135deg, #38655d, #183f3a); font-family: Georgia, serif; font-size: 20px; }.grave-detail h2 { font-size: 33px; }.grave-number { color: var(--pine); font-size: 12px; font-weight: 900; letter-spacing: .12em; }.years { color: var(--muted); }.trust-badge { display: inline-block; margin: 18px 0; padding: 6px 9px; border-radius: 5px; color: var(--pine); background: var(--mint); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }.detail-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.detail-title { min-width: 0; }.detail-photo-status { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; color: var(--pine); background: var(--mint); font-size: 16px; }.detail-quick-actions { display: flex; gap: 9px; margin-top: 18px; }.detail-quick-actions .button { flex: 1; }.detail-quick-actions .detail-expand-button { flex: 0 0 48px; padding: 8px; }.button-icon { display: inline-grid; place-items: center; min-width: 1.1em; font-size: 1.15em; line-height: 1; }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }.detail-actions { display: grid; gap: 9px; margin-top: 23px; }.detail-meta { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.detail-meta { gap: 12px; }.detail-meta strong { min-width: 0; max-width: 65%; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.photo-capture { display: grid; gap: 8px; }.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.photo-choice { position: relative; min-height: 74px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--pine); background: var(--mint); cursor: pointer; }.photo-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }.photo-choice strong, .photo-choice small { display: block; }.photo-choice strong { font-size: 13px; }.photo-choice small { margin-top: 5px; }.photo-choice:focus-within, .photo-choice:has(input:focus-visible) { outline: 3px solid rgba(30,93,84,.2); border-color: var(--pine); }.photo-preview { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; }.photo-preview img { width: 58px; height: 58px; border-radius: 7px; object-fit: cover; }
.parcel-help { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--pine); border-radius: 10px; color: var(--pine); background: rgba(217,238,228,.55); }.parcel-help p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }.parcel-help strong { font-size: 12px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 20; max-width: 330px; padding: 13px 16px; border-radius: 9px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }.toast.visible { opacity: 1; transform: translateY(0); }
.save-progress { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; background: rgba(23,35,34,.42); }.save-progress-card { width: min(360px, 100%); padding: 28px 24px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--panel); box-shadow: 0 20px 70px rgba(23,35,34,.3); text-align: center; }.save-progress-card h2 { margin: 14px 0 6px; font-size: 22px; }.save-progress-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }.save-progress-card small { display: block; margin-top: 14px; color: var(--muted); font-size: 11px; }.save-spinner { display: inline-block; width: 34px; height: 34px; border: 4px solid #c7ddd7; border-top-color: var(--pine); border-radius: 50%; animation: save-spin .8s linear infinite; }.save-progress-active .map-focus-overlay, .save-progress-active .details-panel, .save-progress-active .bottom-nav, .save-progress-active .primary-toolbar, .save-progress-active .secondary-toolbar { pointer-events: none; }.save-progress-active { overflow: hidden; }@keyframes save-spin { to { transform: rotate(360deg); } }
.field-preflight-status { display: grid; gap: 8px; flex-basis: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.65); }.field-preflight-status > strong { color: var(--pine); font-size: 13px; }.field-preflight-status > small { font-size: 12px; }.preflight-summary.is-pass { color: #17654e; }.preflight-summary.is-warn { color: #9a6614; }.preflight-summary.is-fail { color: #9a382d; }.preflight-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }.preflight-list li { display: grid; grid-template-columns: 16px 120px 1fr; gap: 6px; align-items: baseline; font-size: 12px; }.preflight-list li > span { font-weight: 900; }.preflight-list li > small { color: var(--muted); }.preflight-pass > span { color: #17654e; }.preflight-fail > span { color: #9a382d; }.preflight-warn > span { color: #9a6614; }
.grave-dialog { width: min(560px, calc(100% - 32px)); padding: 25px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); box-shadow: var(--shadow); }.grave-dialog::backdrop { background: rgba(23,35,34,.45); }.grave-dialog form { display: grid; gap: 16px; }.dialog-header, .location-row, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }.dialog-note, label small { color: var(--muted); font-size: 12px; line-height: 1.5; }.form-status { margin: -6px 0 0; padding: 10px 12px; border: 1px solid #e4b8b1; border-radius: 9px; color: #8c3328; background: #fff1ee; font-size: 12px; font-weight: 800; line-height: 1.4; }.form-status.progress { border-color: #b8d7cf; color: var(--pine); background: var(--mint); }.field-invalid { border-color: #b84b3d !important; outline-color: #b84b3d !important; }label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }label input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; outline-color: var(--pine); background: white; color: var(--ink); }.form-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }.location-row { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; }.field-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 18px; }
@media (max-width: 850px) { .app-shell { width: min(100% - 24px, 650px); padding-top: 24px; }.topbar, .workspace { display: block; }.cemetery-chip { width: max-content; margin-top: 22px; }.toolbar { flex-wrap: wrap; }.search-box { flex-basis: 100%; }.details-panel { min-width: 0; margin-top: 16px; }.empty-state { min-height: 300px; }.map-shell { min-height: 440px; }.stats { gap: 8px; }.stats div { padding: 13px 8px; }.stats strong { font-size: 24px; }.stats span { font-size: 9px; }.form-row { grid-template-columns: 1fr; } }
.local-only-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--pine); background: var(--mint); font-size: 13px; }
.local-only-banner p { margin: 0; }
.reset-demo { min-height: 48px; padding: 10px 14px; border: 1px solid var(--pine); border-radius: 8px; color: var(--pine); background: transparent; font-size: 12px; font-weight: 800; }
@media (max-width: 560px) { .local-only-banner { align-items: stretch; flex-direction: column; margin-bottom: 18px; } .reset-demo { width: 100%; } }
@media (max-width: 560px) { .cemetery-chip { width: 100%; } .cemetery-chip select { width: 100%; min-width: 0; } .map-heading { align-items: flex-start; gap: 10px; } .map-source { max-width: 220px; } .map-controls { flex-wrap: wrap; } .map-layer-select { flex: 1 1 100%; justify-content: space-between; } .map-layer-select select { flex: 1; } .map-layer-status, .map-level-status { flex-basis: 100%; margin-left: 0; } .map-control-wide { flex: 1; } .route-status { font-size: 11px; } }
@media (max-width: 560px) { .map-controls #engine-toggle { flex: 1 1 100%; width: 100%; } .map-controls .map-control-wide { min-width: 0; } }
@media (max-width: 560px) { .map-controls #map-recenter, .map-controls #zoom-context-10, .map-controls #zoom-precision-3 { flex: 1 1 100%; width: 100%; } }

body.map-focus-active { overflow: hidden; }
body.map-focus-active .primary-toolbar #add-grave,
body.map-focus-active .bottom-nav { display: none !important; }
body.map-focus-active .map-shell { position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
body.map-focus-active .map-panel > :not(.map-shell), body.map-focus-active .map-hint { display: none; }
.map-focus-overlay { position: absolute; inset: 0; z-index: 30; color: var(--ink); pointer-events: none; }
.focus-topbar { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 7px 9px; border: 1px solid rgba(255,253,247,.8); border-radius: 14px; background: rgba(255,253,247,.92); box-shadow: 0 8px 24px rgba(23,35,34,.18); pointer-events: auto; }
.focus-topbar strong { flex: 1; font-size: 13px; }
.focus-icon-button { min-width: 42px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--pine); background: white; font-weight: 900; }
#focus-layer-select { max-width: 112px; min-height: 40px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--pine); background: white; font-size: 11px; }
.focus-crosshair { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 54px; height: 54px; border: 2px solid rgba(255,253,247,.95); border-radius: 50%; background: rgba(30,93,84,.18); box-shadow: 0 0 0 8px rgba(30,93,84,.13), 0 3px 14px rgba(23,35,34,.3); transform: translate(-50%, -50%); pointer-events: none; }
.focus-crosshair span { color: var(--rose); font-size: 32px; line-height: 1; text-shadow: 0 1px 4px rgba(255,253,247,.9); }
.focus-bottom-sheet { position: absolute; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; padding: 11px 12px 12px; border: 1px solid rgba(255,253,247,.85); border-radius: 16px; background: rgba(255,253,247,.94); box-shadow: 0 8px 28px rgba(23,35,34,.22); pointer-events: auto; }
.focus-status { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.focus-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.focus-actions .button { min-height: 46px; margin: 0; }
.focus-action { display: flex; align-items: center; justify-content: center; gap: 8px; }
.focus-action-icon { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid currentColor; border-radius: 50%; font-size: 18px; line-height: 1; }
.focus-action-square { border-radius: 6px; font-size: 17px; }
.focus-crosshair small { position: absolute; top: calc(100% + 6px); padding: 3px 6px; border-radius: 999px; color: white; background: rgba(23,35,34,.78); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
body.map-focus-active .details-panel { position: fixed; right: 12px; bottom: 122px; left: 12px; z-index: 60; display: none !important; max-height: min(42dvh, 390px); overflow: auto; margin: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 10px 35px rgba(23,35,34,.24); }
body.map-focus-active .details-panel .grave-detail { padding: 18px; }
body.map-focus-active .details-panel .detail-image { min-height: 76px; margin: -18px -18px 15px; }
body.map-focus-active .details-panel .grave-detail h2 { margin: 0; font-size: 25px; }
body.map-focus-active .details-panel .detail-actions { grid-template-columns: 1fr 1fr; margin-top: 14px; }
body.map-focus-active .details-panel .detail-actions .button { min-height: 42px; }
@media (min-width: 851px) { body.map-focus-active .details-panel { top: 88px; right: 24px; bottom: 24px; left: auto; width: min(370px, calc(100vw - 48px)); max-height: none; } body.map-focus-active .focus-bottom-sheet { right: 50%; bottom: 24px; left: 50%; width: min(560px, calc(100vw - 48px)); transform: translateX(-50%); } }
@media (max-width: 560px) { .focus-topbar { left: 10px; right: 10px; } .focus-topbar strong { font-size: 12px; } #focus-layer-select { max-width: 96px; } .focus-bottom-sheet { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; } }
body.map-focus-active.grave-form-active .focus-bottom-sheet, body.map-focus-active.grave-form-active .details-panel { display: none; }
body.map-focus-active .secondary-toolbar,
body.map-focus-active .bottom-nav,
body.map-focus-active.menu-open .secondary-toolbar,
body.grave-form-active .secondary-toolbar,
body.grave-form-active .bottom-nav,
body.grave-form-active .details-panel,
body.grave-form-active .map-focus-overlay { display: none !important; }

/* Mobile product surface: map first, secondary tools behind the menu. */
@media (max-width: 560px) {
  body { background: #f7f6f1; }
  .app-shell { width: 100%; margin: 0; padding: 0 0 82px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin: 0; padding: 16px 16px 12px; border-bottom: 1px solid rgba(217,221,210,.8); background: rgba(255,253,247,.96); }
  .brand-lockup { align-items: center; gap: 0; }
  .brand-mark, .topbar .eyebrow, .topbar .subhead { display: none; }
  h1 { margin: 0; font-family: "Trebuchet MS", sans-serif; font-size: 27px; font-weight: 800; letter-spacing: -.06em; line-height: 1; }
  .top-actions { display: flex; }
  .top-action { width: 40px; height: 40px; border: 0; background: transparent; }
  .cemetery-chip { grid-column: 1 / -1; grid-template-columns: 48px minmax(0, 1fr); width: 100%; margin: 2px 0 0; padding: 11px 12px; border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 8px 25px rgba(29,52,44,.08); }
  .cemetery-thumb { grid-row: span 2; }
  .cemetery-copy strong { font-size: 16px; }
  .cemetery-copy small { font-size: 13px; }
  .cemetery-summary { font-size: 11px; }
  .cemetery-chip select { grid-column: 2; min-width: 0; width: 100%; margin-top: 5px; padding: 0; border: 0; background: transparent; font-size: 11px; }
  body.start-active .cemetery-chip { display: none; }
  .start-screen { max-width: none; margin: 0; padding: 32px 16px 30px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .start-intro h2 { font-size: 34px; }
  .start-intro > p:last-child { font-size: 14px; }
  .start-search { margin-top: 24px; }
  .start-actions { grid-template-columns: 1fr; }
  .nearby-section { margin-top: 32px; }
  .nearby-card { min-height: 80px; }
  .nearby-tools { align-items: flex-start; flex-direction: column; gap: 7px; }
  .nearby-tools .button { width: 100%; }
  .local-only-banner { display: none; }
  .primary-toolbar { display: block; height: 0; margin: 0; padding: 0; }
  .primary-toolbar .search-box { display: none; }
  .primary-toolbar #add-grave { position: fixed; bottom: 78px; left: 50%; z-index: 55; display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border: 5px solid rgba(255,253,247,.92); border-radius: 50%; font-size: 0; box-shadow: 0 8px 24px rgba(29,52,44,.28); transform: translateX(-50%); pointer-events: auto; touch-action: manipulation; }
  body.map-selected .primary-toolbar #add-grave { display: none !important; }
  body.map-selected .primary-toolbar #locate { display: none !important; }
  .primary-toolbar #add-grave span { margin: 0; font-size: 31px; font-weight: 400; }
  .primary-toolbar #locate { position: fixed; right: 16px; bottom: 164px; z-index: 20; display: grid; place-items: center; width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 50%; font-size: 0; box-shadow: 0 6px 18px rgba(29,52,44,.18); }
  .primary-toolbar #locate::before { content: "◎"; font-size: 25px; }
  .workspace { display: block; }
  .map-panel { position: relative; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .map-heading { display: none; }
  .map-controls { position: absolute; top: 14px; right: 12px; z-index: 8; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin: 0; }
  .map-control { min-width: 42px; width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; font-size: 0; }
  #map-zoom-in::before { content: "+"; font-size: 22px; }
  #map-zoom-out::before { content: "−"; font-size: 22px; }
  #map-recenter::before { content: "⌖"; font-size: 22px; }
  #zoom-context-10::before { content: "10"; font-size: 11px; }
  #zoom-precision-3::before { content: "3"; font-size: 12px; }
  #engine-toggle { display: none; }
  .map-layer-select { min-width: 42px; width: 42px; height: 42px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); font-size: 0; }
  .map-layer-select select { width: 100%; min-width: 42px; height: 100%; padding: 0; border: 0; background: transparent; font-size: 0; }
  .map-layer-status { display: none; }
  .map-level-status { position: absolute; top: 14px; right: 58px; margin: 0; padding: 7px 9px; font-size: 9px; }
  .map-shell { min-height: calc(100dvh - 240px); height: calc(100dvh - 240px); border: 0; border-radius: 0; background: #d8e7d4; }
  body.map-selected .map-shell { min-height: calc(100dvh - 240px); height: calc(100dvh - 240px); }
  body.map-selected.details-expanded .map-shell { min-height: calc(100dvh - 344px); height: calc(100dvh - 344px); }
  .map-hint { display: none; }
  .map-layer-legend, .legend { display: none; }
  #route-status { display: none; }
  body.route-active #route-status { position: fixed; top: 160px; right: 62px; left: 12px; z-index: 18; display: block; margin: 0; padding: 9px 11px; overflow: hidden; border: 1px solid rgba(143,29,44,.22); border-left: 4px solid #8f1d2c; border-radius: 12px; color: #6f1e2a; background: rgba(255,253,247,.94); box-shadow: 0 8px 22px rgba(29,52,44,.16); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  body.route-active.map-focus-active #route-status { display: none; }
  .details-panel { display: none; }
  .details-panel.has-content { display: block; min-width: 0; max-height: 112px; margin: -100px 12px 86px; position: relative; z-index: 12; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(29,52,44,.18); overflow: hidden; }
  .details-panel.has-content .grave-detail { padding: 9px 12px 10px; }
  .details-panel.has-content .detail-image, .details-panel.has-content .detail-expanded-content { display: none; }
  .details-panel.has-content .detail-summary { gap: 8px; }
  .details-panel.has-content .detail-photo-status { width: 26px; height: 26px; flex-basis: 26px; font-size: 13px; }
  .details-panel.has-content .grave-number { font-size: 9px; }
  .details-panel.has-content .grave-detail h2 { overflow: hidden; margin: 1px 0 0; font-size: 17px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
  .details-panel.has-content .years { margin: 1px 0 0; font-size: 11px; line-height: 1.1; }
  .details-panel.has-content .detail-quick-actions { gap: 6px; margin-top: 6px; }
  .details-panel.has-content .detail-quick-actions .button { min-height: 40px; padding: 6px 8px; font-size: 11px; }
  .details-panel.has-content .detail-quick-actions .detail-expand-button { flex-basis: 44px; }
  body.details-expanded .details-panel.has-content { max-height: 330px; margin: -245px 12px 86px; border-radius: 24px 24px 0 0; overflow: auto; }
  body.details-expanded .details-panel.has-content .grave-detail { padding: 18px 18px 20px; }
  body.details-expanded .details-panel.has-content .detail-image { display: grid; min-height: 56px; margin: -18px -18px 10px; font-size: 15px; }
  body.details-expanded .details-panel.has-content .detail-expanded-content { display: block; }
  body.details-expanded .details-panel.has-content .grave-detail h2 { margin-bottom: 2px; font-size: 24px; }
  body.details-expanded .details-panel.has-content .trust-badge { margin: 10px 0; }
  body.details-expanded .details-panel.has-content .detail-meta { padding: 8px 0; }
  body.details-expanded .details-panel.has-content .detail-actions { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
  body.details-expanded .details-panel.has-content .detail-actions .button { min-height: 38px; padding: 8px 6px; font-size: 11px; }
  body.details-expanded .details-panel.has-content .detail-quick-actions { margin-top: 10px; }
  .stats, .secondary-toolbar { display: none; }
  body.menu-open .secondary-toolbar { display: grid; position: fixed; right: 12px; bottom: 82px; left: 12px; z-index: 60; max-height: 70vh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,247,.98); box-shadow: 0 15px 40px rgba(29,52,44,.22); }
  .bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 54; display: flex; justify-content: space-around; height: 74px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,247,.97); }
  .bottom-nav-item { display: grid; place-items: center; gap: 2px; min-width: 76px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
  .bottom-nav-item span { font-size: 24px; line-height: 1; }
  .bottom-nav-item.active { color: var(--pine); }
  .bottom-nav-item strong { font-size: 11px; font-weight: 700; }
}
body.map-focus-active.grave-form-active .focus-crosshair { top: 27%; z-index: 31; }
body.map-focus-active .grave-dialog { position: fixed; inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px; z-index: 90; width: auto; max-width: none; max-height: min(58dvh, 520px); margin: 0 !important; padding: 18px; overflow: auto; border-radius: 18px; }
body.map-focus-active .grave-dialog::backdrop { background: rgba(23,35,34,.18); }
body.map-focus-active .grave-dialog form { gap: 12px; }
body.map-focus-active .grave-dialog .dialog-actions { position: sticky; bottom: -18px; z-index: 2; margin: 0 -2px -2px; padding: 12px 0 2px; background: var(--panel); }
@media (min-width: 851px) { body.map-focus-active .grave-dialog { right: 24px; bottom: 24px; left: auto; width: min(520px, calc(100vw - 48px)); max-height: min(78dvh, 720px); } body.map-focus-active.grave-form-active .focus-crosshair { top: 42%; } }
