/* Mobile map chrome. Existing layers, account profiles and data keep their styles. */
.fw-map-tools {
  position: absolute; inset: auto 12px max(32px, env(safe-area-inset-bottom)) 12px;
  height: 56px; z-index: 1000; font-size: .8rem; pointer-events: none;
}
.fw-map-tools svg, .fw-map-view-controls svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fw-fab, .fw-bubble-icon { display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--accent-strong); box-shadow: 0 3px 12px #0005; }
.fw-fab { position: absolute; right: 0; bottom: 0; width: 56px; height: 56px; padding: 0; background: var(--accent-strong); color: var(--on-accent); pointer-events: auto; }
.fw-fab[hidden] { display: none; }
.fw-fab svg { width: 28px; height: 28px; transition: transform 150ms ease; }
.fw-map-tools[data-open="true"] .fw-fab svg { transform: rotate(45deg); }
.fw-fab.is-active { border: 2px solid var(--on-accent); box-shadow: 0 0 0 2px var(--accent-strong), 0 3px 12px #0004; }
.fw-tool-bubbles { position: absolute; right: 0; bottom: 70px; display: flex; flex-direction: column; gap: 12px; width: max-content; max-width: 100%; pointer-events: auto; }
.fw-tool-bubbles[hidden] { display: none; }
.fw-tool-bubbles button { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 48px; border: 0; padding: 0 4px 0 0; background: transparent; color: var(--text); }
.fw-bubble-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.fw-bubble-label { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; background: var(--panel); box-shadow: var(--fw-overlay-shadow); white-space: nowrap; }
.fw-tool-bubbles button[aria-pressed="true"] .fw-bubble-icon { color: var(--on-accent); background: var(--accent); border-color: var(--on-accent); }
.fw-tool-status {
  position: absolute; right: 72px; bottom: 0; box-sizing: border-box;
  width: min(284px, calc(100% - 72px));
  max-height: min(var(--fw-tool-available-height, 360px), calc(100dvh - 88px));
  padding: 14px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
  color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 5px 18px #0004; pointer-events: auto;
}
.fw-tool-status[hidden], .fw-map-tools[data-open="true"] .fw-tool-status { display: none; }
.fw-tool-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; gap: 10px; margin-bottom: 12px; }
.fw-tool-heading-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-strong); color: var(--on-accent); }
.fw-tool-heading-icon svg[hidden] { display: none; }
.fw-tool-heading-copy { min-width: 0; }
.fw-tool-heading strong { display: block; margin: 0; font-size: 1rem; line-height: 1.2; font-weight: 750; color: var(--accent-strong); }
.fw-tool-heading p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.fw-tool-status .fw-tool-gps { margin: 0 0 9px; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.fw-tool-status output { display: block; margin: 0 0 10px; color: var(--text); font-weight: 700; font-size: .76rem; }
.fw-tool-status output:empty { display: none; }
.fw-tool-status .fw-tool-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fw-tool-status button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; min-width: 0; min-height: 44px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; font-size: .74rem; font-weight: 650; line-height: 1.2; text-align: center; cursor: pointer; }
.fw-tool-status button svg { width: 20px; height: 20px; flex: 0 0 20px; }
.fw-tool-status button[hidden] { display: none; }
.fw-tool-status button.fw-tool-primary { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.fw-tool-status button:disabled { opacity: .48; cursor: not-allowed; }
.fw-tool-status .fw-tool-clear { width: 36px; min-height: 36px; height: 36px; padding: 0; align-self: start; background: transparent; }
.fw-tool-status .fw-tool-clear svg { width: 19px; height: 19px; }
.fw-pin-status { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .78rem; }
.fw-pin-status button { min-height: 44px; }
.fw-pin-shape { display: block; width: 44px; height: 48px; overflow: visible; filter: drop-shadow(0 2px 3px #000b); }
.fw-pin-shape path { fill: var(--fw-pin-color, #ffd27e); stroke: #fff7df; stroke-width: 2; }
.fw-pin-shape circle { fill: var(--fw-pin-ink, #151a1d); }
/* The teardrop's 41-unit silhouette becomes 28px tall around its fixed tip.
   Keep the SVG/hit frame and Leaflet coordinate anchor intact. */
.fw-custom-pin .fw-pin-artwork, .fw-draft-pin .fw-pin-artwork { transform: scale(.683); transform-origin: 22px 45px; }
.fw-pin-selected .fw-pin-shape path { stroke: var(--accent-strong); stroke-width: 3; }
.fw-draft-pin .fw-pin-shape path { stroke: #ff79d1; }
.fw-pin-badge { display: grid; place-items: center; width: var(--fw-map-symbol-size); height: var(--fw-map-symbol-size); border-radius: 50%; border: 0; background: transparent; box-shadow: 0 2px 5px #000b, 0 0 0 1px #11181bcc; }
.fw-pin-glyph { display: block; width: var(--fw-map-symbol-size); height: var(--fw-map-symbol-size); }
.fw-camera-pin :is(.fw-pin-badge, .fw-pin-glyph) { width: calc(var(--fw-map-symbol-size) * .75); height: calc(var(--fw-map-symbol-size) * .75); }
.fw-dot-pin :is(.fw-pin-badge, .fw-pin-glyph) { width: calc(var(--fw-map-symbol-size) * .3); height: calc(var(--fw-map-symbol-size) * .3); }
.fw-pin-selected .fw-pin-badge, .fw-draft-pin .fw-pin-badge { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.fw-custom-pin:focus-visible .fw-pin-badge { outline: 3px solid #fff; outline-offset: 3px; }
.fw-pin-icon-picker { margin: 10px 0; }
.fw-pin-icon-picker > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); list-style: none; cursor: pointer; }
.fw-pin-icon-picker > summary::-webkit-details-marker { display: none; }
.fw-pin-icon-picker > summary > [data-icon-current-label] { min-width: 0; font-size: .78rem; overflow-wrap: anywhere; }
.fw-pin-icon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; max-height: min(280px, 34dvh); overflow-y: auto; overscroll-behavior: contain; padding: 8px 2px 2px; }
.fw-pin-editor .fw-pin-icon-option { position: relative; display: block; min-width: 0; margin: 0; }
.fw-pin-editor .fw-pin-icon-option input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.fw-pin-icon-option-content { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 82px; height: 100%; padding: 8px 3px; border: 2px solid var(--border); border-radius: 8px; background: var(--panel); text-align: center; font-size: .68rem; line-height: 1.25; pointer-events: none; }
.fw-pin-icon-preview { display: grid; place-items: center; width: 32px; height: 36px; flex: 0 0 32px; }
.fw-pin-icon-preview svg { display: block; width: 32px; height: 32px; }
.fw-pin-icon-preview .fw-pin-shape { width: 30px; height: 33px; filter: none; }
.fw-pin-icon-option input:checked + .fw-pin-icon-option-content { border-color: var(--accent-strong); background: var(--accent-soft); }
.fw-pin-icon-check { display: none; position: absolute; top: 2px; right: 4px; color: var(--accent-strong); font-size: .8rem; }
.fw-pin-icon-option input:checked + .fw-pin-icon-option-content .fw-pin-icon-check { display: block; }
.fw-pin-icon-option input:focus-visible + .fw-pin-icon-option-content, .fw-pin-icon-picker > summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.fw-map-view-controls { position: absolute; top: 12px; right: 12px; z-index: 1000; display: flex; align-items: start; gap: 8px; }
.fw-map-expand, .fw-fullscreen-menu > summary { display: grid; place-items: center; min-width: var(--fw-control-size); height: var(--fw-control-size); padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--text); cursor: pointer; box-shadow: var(--fw-overlay-shadow); }
.fw-map-expand[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-strong); }
.fw-fullscreen-menu[hidden] { display: none; }
.fw-fullscreen-menu > summary { list-style: none; font-size: 1.3rem; }
.fw-fullscreen-menu > summary::-webkit-details-marker { display: none; }
.fw-fullscreen-menu > div { position: absolute; top: 52px; right: 0; width: 160px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.fw-fullscreen-menu button { width: 100%; min-height: 44px; color: var(--text); background: var(--panel-2); border: 0; border-radius: 6px; }
.viewer .mobile-property-menu { display: block; }
.viewer .mobile-property-menu > summary { width: 44px; height: 44px; }
.viewer .mobile-property-menu-panel { position: absolute; z-index: 1200; top: calc(100% + 8px); right: 0; width: 200px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); box-shadow: 0 6px 20px #0005; }
.viewer .mobile-menu-action, .viewer .mobile-presentation-control button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: .75rem; }
.viewer .mobile-menu-action { width: 100%; margin-top: 6px; }
.viewer .mobile-presentation-control { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.viewer .mobile-presentation-control[hidden] { display: none; }
.viewer .mobile-presentation-control button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-strong); }
body.fw-map-expanded, body.fw-layer-drawer-open { overflow: hidden; }
.map-panel.fw-map-fullscreen { position: fixed !important; inset: 0; z-index: 1600; width: 100%; height: 100dvh !important; min-height: 0; border: 0; border-radius: 0 !important; }
.map-panel.fw-map-fullscreen .fw-map-view-controls { top: max(12px, env(safe-area-inset-top)); }
.map-panel .mobile-imagery-strip { left: 12px; width: min(360px, calc(100% - 92px)); transform: none; }
.fw-layer-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(380px, calc(100vw - 44px)); height: 100dvh; max-width: none; max-height: 100dvh; border: 0; border-left: 1px solid var(--border); background: var(--panel); color: var(--text); box-shadow: -12px 0 36px #0005; }
.fw-layer-drawer[open] { display: flex; flex-direction: column; animation: fw-drawer-enter 180ms ease-out; }
.fw-layer-drawer::backdrop { background: #0008; }
.fw-drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(18px, env(safe-area-inset-top)) 18px 14px; border-bottom: 1px solid var(--border); }
.fw-drawer-heading h2 { margin: 0 0 4px; font-size: 1.1rem; }
.fw-drawer-heading p { margin: 0; font-size: .72rem; }
.fw-drawer-heading button { min-width: 44px; min-height: 44px; font-size: 1.4rem; }
.fw-layer-drawer .map-layer-panel { flex: 1; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; padding: 12px 18px max(24px, env(safe-area-inset-bottom)); scrollbar-gutter: stable; }
.fw-layer-drawer .layer-control-section { padding: 0 !important; border: 0; background: transparent; }
.fw-layer-drawer .layer-control-section > .section-heading { display: none; }
.fw-layer-drawer .layer-group { margin-top: 10px; }
.fw-layer-drawer .layer-group-heading { min-height: 48px; }
.fw-layer-drawer .layer-group-title { font-size: .86rem; }
.fw-layer-drawer .toggle-row { min-height: 56px; }
.fw-layer-key { margin-top: 20px; font-size: .72rem; }
.fw-layer-key > summary { min-height: 44px; padding-top: 12px; cursor: pointer; color: var(--muted); }
.fw-layer-key .map-legend-list { list-style: none; margin: 0; }
.fw-map-tools button:focus-visible, .fw-map-view-controls button:focus-visible, .fw-fullscreen-menu summary:focus-visible, .fw-layer-drawer button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
@keyframes fw-drawer-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .fw-layer-drawer[open] { animation: none; }
  .fw-fab svg { transition: none; }
}

/* The drawer shares the page's quiet topo paper; icons distinguish map uses. */
.fw-layer-drawer, .wmw-account-options, .viewer .mobile-property-menu-panel, .fw-fullscreen-menu > div {
  background-color: var(--bg);
  background-image: var(--fw-topo-image);
  background-size: 960px 720px;
}
.fw-drawer-heading { background: var(--surface-overlay); }
.fw-original-layer-group { display: none; }
.fw-guided-layers { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.fw-layer-use { margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-overlay); overflow: hidden; }
.fw-layer-use > summary { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; cursor: pointer; list-style: none; }
.fw-layer-use > summary::-webkit-details-marker, .fw-water-details > summary::-webkit-details-marker { display: none; }
.fw-layer-use > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.fw-layer-use > summary strong { display: block; font-size: .94rem; font-weight: 600; }
.fw-layer-use > summary small { display: block; margin-top: 3px; font-size: .73rem; color: var(--muted); }
.fw-layer-use-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.fw-layer-use-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-layer-use="hunting"] .fw-layer-use-icon { background: #edf0e2; color: #46552d; }
[data-layer-use="farming"] .fw-layer-use-icon { background: #e6f0e7; color: #24523b; }
[data-layer-use="appearance"] .fw-layer-use-icon { background: #f6ecdf; color: #80501c; }
:root[data-theme="dark"] [data-layer-use="hunting"] .fw-layer-use-icon { background: #2d3b2a; color: #d1dfb7; }
:root[data-theme="dark"] [data-layer-use="farming"] .fw-layer-use-icon { background: #244238; color: #bce0c8; }
:root[data-theme="dark"] [data-layer-use="appearance"] .fw-layer-use-icon { background: #483a2c; color: #efc994; }
.fw-layer-expander { display: inline-grid; place-items: center; min-width: 20px; margin-left: auto; font-size: 1.15rem; font-weight: 400; color: var(--muted); }
.fw-layer-expander::after { content: '+'; }
details[open] > summary > .fw-layer-expander::after { content: '−'; }
.fw-layer-use-body { padding: 0 12px 8px; border-top: 1px solid var(--border); }
.fw-guided-layers .toggle-row strong { font-size: .87rem; font-weight: 600; }
.fw-guided-layers .toggle-row small { font-size: .75rem; line-height: 1.45; }
.fw-guided-layers .control-copy, .fw-water-details { font-size: .75rem; color: var(--muted); }
.fw-water-details > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; }
.fw-water-details dl { margin-bottom: 6px; }
.fw-water-details dl > div { padding: 8px 0; border-top: 1px solid var(--border); }
.fw-water-details dt { font-weight: 600; color: var(--text); }
.fw-water-details dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.fw-guided-layers button { min-height: 44px; }
.fw-water-control input:indeterminate { border-color: var(--accent); background: radial-gradient(circle at 19px 50%, var(--on-accent) 0 6px, transparent 6.5px), var(--accent); }
.fw-layer-drawer .layer-group-heading::before { display: none; }

/* One small display preference in each existing options menu. */
.wmw-account-options [data-theme-toggle], .viewer [data-theme-toggle] {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 8px 10px; font-size: .75rem; text-align: left;
}
.fw-fullscreen-menu [data-theme-toggle] { margin-top: 6px; }
.fw-theme-track { display: inline-block; flex: 0 0 34px; width: 34px; height: 20px; border: 1px solid var(--muted); border-radius: 20px; background: var(--panel-2); }
.fw-theme-track::after { content: ''; display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; background: var(--muted); }
[data-theme-toggle][aria-checked="true"] .fw-theme-track { border-color: var(--accent); background: var(--accent); }
[data-theme-toggle][aria-checked="true"] .fw-theme-track::after { transform: translateX(14px); background: var(--on-accent); }
.fw-layer-drawer .layer-group-heading .fw-layer-use-icon { width: 32px; height: 32px; flex-basis: 32px; }


/* One full-height Viewer sidebar: navigation, the ORIGINAL layer inputs, then
   appearance/account. No duplicated layer state or technical-mode restyling. */
body.wmw-guided #map-layer-control.fw-layer-drawer {
  width: min(420px, calc(100vw - 16px));
  background-color: var(--bg);
}
body.wmw-guided #map-layer-control .map-layer-panel {
  padding: 12px 16px max(24px, env(safe-area-inset-bottom));
}
body.wmw-guided #map-layer-control [data-presentation="technical"] { display: none !important; }
body.wmw-guided #map-layer-control .fw-layer-key { display: none; }
.fw-viewer-menu-navigation { margin: 4px 0 18px; }
.fw-viewer-menu-navigation > h3,
.fw-viewer-sidebar-section-title > h3,
.fw-viewer-sidebar-settings > h3 {
  margin: 0 0 8px; color: var(--muted); font-size: .68rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.fw-viewer-menu-navigation a {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 10px; color: var(--text); font-size: .89rem;
  text-decoration: none; font-weight: 550;
}
.fw-viewer-menu-navigation a:hover { background: var(--accent-soft); }
.fw-viewer-menu-navigation a[aria-current="page"] {
  color: var(--accent-strong); background: var(--accent-soft);
  border-color: var(--border); font-weight: 700;
}
.fw-viewer-menu-navigation a svg {
  flex: 0 0 23px; width: 23px; height: 23px;
  fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round;
}
.fw-viewer-menu-navigation a:focus-visible,
.fw-viewer-sidebar-settings button:focus-visible {
  outline: 2px solid var(--accent-strong); outline-offset: 2px;
}
.fw-viewer-sidebar-section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 16px 0 4px; border-top: 1px solid var(--border);
}
.fw-viewer-sidebar-section-title > p { margin: 0; color: var(--muted); font-size: .72rem; }
body.wmw-guided #map-layer-control #layer-controls-section {
  padding: 0 !important; border: 0; background: transparent;
}
.fw-viewer-sidebar-settings {
  display: grid; gap: 7px; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.fw-viewer-sidebar-settings > button,
.fw-viewer-sidebar-settings .wmw-presentation-control button {
  min-height: 44px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--panel); color: var(--text);
  font: inherit; font-size: .82rem; text-align: left; cursor: pointer;
}
.fw-viewer-sidebar-settings [data-theme-toggle] {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fw-viewer-sidebar-settings .wmw-presentation-control { margin-top: 3px; }
.fw-viewer-sidebar-settings .wmw-presentation-control button { text-align: center; }
.fw-viewer-sidebar-settings .wmw-presentation-control button[aria-pressed="true"] {
  color: var(--on-accent); background: var(--accent); font-weight: 600;
}
.fw-viewer-sidebar-settings .wmw-preview {
  margin: 9px 0 0; text-align: left; font-size: .74rem;
}
.fw-viewer-sidebar-settings .fw-viewer-sign-out { margin-top: 4px; }
.fw-viewer-fullscreen-trigger {
  display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: var(--panel); color: var(--text); cursor: pointer;
  box-shadow: var(--fw-overlay-shadow);
}
.fw-viewer-fullscreen-trigger svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round;
}
.fw-viewer-fullscreen-trigger:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
@media (max-width: 520px) {
  body.wmw-guided #map-layer-control .map-layer-panel { padding: 12px 14px max(24px, env(safe-area-inset-bottom)); }
}
