/* Production Fieldbook: all-in-one map */
.fbm { margin: 0; background: var(--ws-paper); color: var(--ws-ink); font: 15px/1.45 var(--ws-ui); }
.fbm *, .fbm *::before, .fbm *::after { box-sizing: border-box; }
.fbm a { color: inherit; }
.fbm-rail { position: fixed; inset: 0 auto 0 0; width: 72px; z-index: 50; background: var(--ws-rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; }
.fbm-rail a { width: 64px; min-height: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ws-rail-soft); text-decoration: none; font-size: 11px; }
.fbm-rail a svg { width: 20px; height: 20px; padding: 6px 12px; box-sizing: content-box; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.fbm-rail a.is-active { color: var(--ws-rail-ink); }
.fbm-rail a.is-active svg { background: rgba(255,255,255,.12); }
.fbm-rail-brand { min-height: 48px !important; margin-bottom: 8px; }
.fbm-main { margin-left: 72px; display: flex; height: 100vh; }
.fbm-panel { width: 380px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--ws-line); background: var(--ws-sheet); min-height: 0; }
.fbm-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.fbm-head h1 { margin: 0; font: 800 34px/1 var(--ws-display); text-transform: uppercase; letter-spacing: .01em; }
.fbm .fb-theme-icons { display: inline-flex; border: 1px solid var(--ws-line-strong); }
.fbm .fb-theme-icons button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--ws-ink); display: inline-flex; align-items: center; justify-content: center; }
.fbm .fb-theme-icons button[aria-pressed='true'] { background: var(--ws-ink); color: var(--ws-sheet); }
.fbm .fb-theme-icons svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.fbm-search { margin: 8px 18px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--ws-line-strong); padding: 0 12px; min-height: 44px; }
.fbm-search input { flex: 1; border: 0; background: transparent; color: var(--ws-ink); font: inherit; min-height: 42px; outline: none; }
.fbm-regions { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 18px; }
.fbm-regions button, .fbm-layers label { border: 1px solid var(--ws-line); background: var(--ws-sheet); color: var(--ws-ink); font: inherit; font-size: 13px; min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.fbm-regions button[aria-pressed='true'] { background: var(--ws-ink); color: var(--ws-sheet); border-color: var(--ws-ink); }
.fbm-layers { border: 0; margin: 0; padding: 8px 18px 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.fbm-layers legend { font: 500 10.5px/1 var(--ws-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ws-soft); padding: 0 0 8px; }
.fbm-layers input { position: absolute; opacity: 0; pointer-events: none; }
.fbm-layers label:has(input:checked) { border-color: var(--ws-ink); font-weight: 600; }
.fbm-layers label:has(input:not(:checked)) { color: var(--ws-soft); }
.fbm-layers label:has(input:focus-visible) { outline: 2px solid var(--ws-ink); outline-offset: 1px; }
.fbm-layers .n { font: 500 11px/1 var(--ws-mono); color: var(--ws-soft); }
.fbm-mark { width: 14px; height: 14px; display: inline-block; flex: none; }
.fbm-mark svg { width: 14px; height: 14px; display: block; }
.fbm-count { margin: 6px 18px; font-size: 13px; color: var(--ws-soft); }
.fbm-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; border-top: 1px solid var(--ws-line); }
.fbm-list button { width: 100%; text-align: left; display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--ws-line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.fbm-list button:hover, .fbm-list button[aria-current='true'] { background: var(--ws-sunk); }
.fbm-list .t { display: flex; flex-direction: column; min-width: 0; }
.fbm-list b { font-weight: 600; font-size: 14.5px; }
.fbm-list .t span { font-size: 12.5px; color: var(--ws-soft); }
.fbm-list .fbm-mark { margin-top: 3px; }
.fbm-mapwrap { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
#fbmMap { flex: 1; background: var(--ws-sunk); }
.fbm-note { margin: 0; padding: 8px 14px; font-size: 14px; line-height: 1.4; color: var(--ws-soft); border-top: 1px solid var(--ws-line); background: var(--ws-sheet); white-space: normal; overflow-wrap: anywhere; }
.fbm-detail { position: absolute; top: 14px; right: 14px; width: min(380px, calc(100% - 28px)); max-height: calc(100% - 70px); overflow-y: auto; z-index: 500; background: var(--ws-sheet); border: 1px solid var(--ws-line-strong); padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.fbm-detail h2 { margin: 2px 0 6px; font-size: 20px; line-height: 1.2; }
.fbm-detail .k { font: 500 10.5px/1 var(--ws-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ws-soft); }
.fbm-detail p { margin: 6px 0; font-size: 14px; }
.fbm-detail dl { margin: 10px 0; display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13.5px; }
.fbm-detail dt { color: var(--ws-soft); }
.fbm-detail dd { margin: 0; }
.fbm-detail .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fbm-detail .acts a, .fbm-detail .close { min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; border: 1px solid var(--ws-line-strong); text-decoration: none; font-size: 13.5px; background: var(--ws-sheet); color: var(--ws-ink); font-family: inherit; cursor: pointer; }
.fbm-detail .acts a.primary { background: var(--ws-ink); color: var(--ws-sheet); border-color: var(--ws-ink); }
.fbm-detail .close { position: absolute; top: 10px; right: 10px; min-height: 32px; padding: 0 9px; }
.fbm-detail .prec { font-size: 12.5px; color: var(--ws-soft); }
.fbm-pin { background: none; border: 0; }
.fbm-pin svg { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.fbm-pin.is-on svg { transform: scale(1.5); }
.fbm-cluster { display: grid; place-items: center; width: 34px; height: 34px; background: #121416; color: #fff; font: 600 12px/1 var(--ws-ui); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.leaflet-container { font: inherit; }
@media (max-width: 860px) {
  .fbm-rail { position: fixed; inset: auto 0 0 0; width: auto; height: 60px; flex-direction: row; justify-content: space-around; padding: 0; }
  .fbm-rail a { min-height: 56px; }
  .fbm-rail-brand { display: none !important; }
  .fbm-main { margin-left: 0; flex-direction: column-reverse; height: calc(100vh - 60px); }
  .fbm-panel { width: auto; height: 46vh; border-right: 0; border-top: 1px solid var(--ws-line); }
  .fbm-head { padding-top: 10px; } .fbm-head h1 { font-size: 26px; }
  .fbm-note { padding: 6px 12px; }
}

/* Speed and accessibility pass */
.fbm-skip { position: fixed; top: -100px; left: 80px; z-index: 5000; padding: 12px 16px; background: var(--ws-accent); color: var(--ws-on-accent); font-weight: 600; text-decoration: none; }
.fbm-skip:focus { top: 8px; }
.fbm :focus-visible { outline: 2px solid var(--ws-ink); outline-offset: 2px; }
.fbm-detail:focus { outline: none; }
.fbm-pin { display: grid; place-items: center; }
/* 14px text floor; the rail labels keep their size to fit the 64px rail. */
.fbm-regions button, .fbm-layers label, .fbm-layers legend, .fbm-layers .n, .fbm-count, .fbm-list .t span, .fbm-detail .k,
.fbm-detail dl, .fbm-detail .acts a, .fbm-detail .close, .fbm-detail .prec, .fbm-cluster { font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .fbm *, .fbm *::before, .fbm *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- Visual pass: the list is the panel surface; the chosen place is a tinted row; filters read as tapes when on. ---------- */
@media screen {
  .fbm-panel { background: var(--ws-panel); }
  .fbm-list button:hover { background: var(--ws-hover); }
  .fbm-list button[aria-current='true'] { background: var(--ph-tint); }
  .fbm-regions button[aria-pressed='true'] { background: var(--ws-page); color: var(--ws-ink); border-color: var(--ws-ink); font-weight: 600; }
  .fbm-regions button, .fbm-layers label { border-color: var(--ws-page-edge); background: var(--ws-page); }
  .fbm-layers label:has(input:checked) { border-color: var(--ws-ink); }
  .fbm-search { background: var(--ws-page); }
}
