/* SAWA 公開デモ v2（2026-11-11）。色と書体は本番の style.css の変数に合わせる。v2: 所有者への問い合わせ・スマホ向けの直し */
:root {
  --ink: #1c2733;
  --ink2: #4a5663;
  --paper: #f7f5f0;
  --panel: #fffdf8;
  --rule: #c9c2b4;
  --rule2: #e4dfd3;
  --accent: #0b7285;
  --accent-d: #095c6b;
  --warn: #e03131;
  --sans: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --bar-h: 52px;
}
* { box-sizing: border-box; }
/* hidden 属性は必ず効かせる（.btn などの display 指定に負けて、隠したはずのボタンが出ていた） */
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.7; -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; height: 100%; height: 100dvh; }
a, button, label, select, input, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(11,114,133,.15); }
a { color: var(--accent-d); }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* 上の帯 */
.bar { flex: none; min-height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border-bottom: 1px solid var(--rule);
  padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: .08em; color: var(--ink); text-decoration: none; }
.tag { font-size: 11.5px; font-weight: 600; color: #fff; background: var(--accent); padding: 1px 8px; border-radius: 2px; white-space: nowrap; }
.brand-area { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-nav { display: flex; gap: 8px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.ghost { background: transparent; color: var(--accent-d); }
.btn.ghost:hover { background: #e6f1f3; }
.btn.wide { width: 100%; min-height: 42px; }

/* 全体の割り付け */
/* 地図は左、条件は右。176pxのパネル内に4つの44pxタブを収める。 */
.stage { --panel-size: clamp(176px, var(--panel-width, 372px), calc(100% - 144px)); position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-size); }
.panel { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; background: var(--panel); border: 0; box-shadow: inset 1px 0 var(--rule); overflow: hidden; display: flex; flex-direction: column; }
.panel-tools { flex: none; padding: 6px 10px; border-bottom: 1px solid var(--rule2); }
.panel-grip { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--accent-d); font-size: 13px; font-weight: 600; cursor: pointer; }
.panel-grip:hover { background: #e6f1f3; }
.grip-bar { display: none; }
.grip-label { min-width: 0; overflow-wrap: anywhere; }
.panel-status { display: flex; flex-wrap: wrap; gap: 2px 8px; flex: none; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--rule2); color: var(--ink2); font-size: 12px; overflow-wrap: anywhere; }
.grip-count { font-family: var(--mono); }
#panelTabs { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; border-bottom: 1px solid var(--rule); background: var(--panel); }
#panelTabs button { min-width: 0; min-height: 44px; padding: 6px 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink2); font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer; }
#panelTabs button:hover { background: #edf4f4; }
#panelTabs button[aria-selected="true"] { border-bottom-color: var(--accent); background: #e3f1f3; color: var(--accent-d); }
#panelTabs button:focus-visible { outline-offset: -3px; }
.panel-body { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: hidden; padding: 0; }
.tab-pane { height: 100%; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px max(24px, env(safe-area-inset-bottom, 0px)); overflow-wrap: anywhere; }
.tab-pane.sec { border-bottom: 0; padding: 14px 16px max(24px, env(safe-area-inset-bottom, 0px)); }
.panel:not(.panel-ready) .panel-body { overflow-y: auto; }
.panel:not(.panel-ready) .tab-pane { height: auto; overflow: visible; }
.pane-head { margin: 0 0 10px; }
.panel-hint { margin: 0 0 12px; padding: 8px; border-left: 3px solid var(--accent); background: #edf4f4; }
.legend-subhead { font-size: 13.5px; font-weight: 600; margin: 14px 0 8px; }
.tab-pane .pane-head h1, .tab-pane .pane-head h2 { margin-top: 0; }
.tab-pane select, .tab-pane input, .tab-pane label, .tab-pane .fs, .tab-pane .ck > span { min-width: 0; max-width: 100%; }
.tab-pane .diff { display: block; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.mapwrap { position: relative; grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; overflow: hidden; }
.stage.panel-compact { --panel-size: 44px; }
.panel-compact .panel-tools, .panel-compact .panel-status, .panel-compact .panel-body { display: none; }
.panel-compact #panelTabs { display: flex; flex-direction: column; border-bottom: 0; }
.panel-compact #panelTabs button { width: 44px; min-height: 44px; flex: none; border-bottom: 1px solid var(--rule2); border-left: 3px solid transparent; padding: 5px 0; }
.panel-compact #panelTabs button[aria-selected="true"] { border-left-color: var(--accent); }
#panelResize { position: absolute; z-index: 10; right: var(--panel-size); top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 24px; height: 64px; padding: 0; border: 1px solid var(--accent); border-radius: 6px; background: var(--panel); color: var(--accent-d); box-shadow: 0 2px 8px rgba(28,39,51,.22); cursor: col-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
#panelResize > span { display: none; }
#panelResize::before { content: ""; width: 6px; height: 26px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
#panelResize:hover, #panelResize:focus-visible, #panelResize.is-dragging, .stage.is-resizing #panelResize, .stage.panel-dragging #panelResize { background: #d7eef1; box-shadow: 0 0 0 3px rgba(11,114,133,.22); }
#panelResize:focus-visible { outline: 2px solid var(--accent-d); outline-offset: 2px; }
.stage.is-resizing, .stage.panel-dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.panel-compact #panelResize { display: none; }
#map { position: absolute; inset: 0; background: #dfe6e2; }

/* パネルの中 */
.sec { padding: 16px 0 18px; border-bottom: 1px solid var(--rule2); }
.sec:last-child { border-bottom: 0; }
.sec h1 { font-size: 17px; line-height: 1.5; margin: 0 0 6px; font-weight: 600; }
.sec h2 { font-size: 13.5px; margin: 0 0 10px; font-weight: 600; letter-spacing: .02em; }
.sec h2.h2b { margin-top: 18px; }
.lead { margin: 0 0 8px; }
.limits { margin: 0; padding: 0; list-style: none; font-size: 12.8px; }
.limits li { position: relative; padding: 5px 0 5px 14px; border-top: 1px dotted var(--rule); }
.limits li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 5px; height: 5px; background: var(--ink2); border-radius: 50%; }
.note { font-size: 12px; color: var(--ink2); margin: 8px 0 0; line-height: 1.65; }
.fs { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.fs legend, .rg-label, .fs.two label, .sortrow label { font-size: 12px; color: var(--ink2); padding: 0; margin-bottom: 3px; display: block; }
.ck { display: flex; align-items: center; gap: 7px; min-height: 30px; font-size: 13px; cursor: pointer; }
.ck input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--accent); }
.ck.fixed { color: var(--ink2); cursor: default; }
.ck small { display: block; font-size: 11.5px; color: var(--ink2); line-height: 1.4; }
.legend .ck { align-items: flex-start; padding: 4px 0; }
.legend .ck input, .legend .ck i { margin-top: 3px; }
.legend .ck i.ln { margin-top: 10px; }
.rg { width: 100%; accent-color: var(--accent); margin: 2px 0 0; }
.rg-label output { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.fs.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select { width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; }
.sortrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.sortrow label { margin: 0; }
.lnk { border: 0; background: none; color: var(--accent-d); text-decoration: underline; cursor: pointer; padding: 6px 2px; font-size: 12.5px; }

.result-head { margin: 14px 0 6px; font-size: 13px; }
.result-head b { font-family: var(--mono); font-size: 20px; }
.result-head .of { color: var(--ink2); font-size: 12px; margin-left: 4px; }
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.results li { border-bottom: 1px solid var(--rule2); }
.results button { display: grid; grid-template-columns: 56px 1fr auto; gap: 0 8px; align-items: baseline; width: 100%; padding: 7px 4px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 12.5px; }
.results button:hover, .results button[aria-current="true"] { background: #e6f1f3; }
.results .rid { font-family: var(--mono); font-weight: 600; }
.results .rsc { font-family: var(--mono); }
.results .rsc::after { content: "点"; font-family: var(--sans); font-size: 11px; color: var(--ink2); margin-left: 1px; }
.results .rmeta { grid-column: 1 / -1; color: var(--ink2); font-size: 12px; line-height: 1.5; }
.results .rarea { font-family: var(--mono); white-space: nowrap; }
.results .empty { padding: 12px 4px; color: var(--ink2); font-size: 12.5px; }
.result-more { font-size: 12px; color: var(--ink2); margin: 6px 0 0; }

/* 凡例 */
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.legend.fills li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sw-m { background: #2b6cb0; } .sw-L { background: #7a4a17; } .sw-M { background: #a8742f; } .sw-S { background: #c8b08c; }
.ln { display: inline-block; width: 30px; height: 0; border-top: 3px dashed; flex: none; }
.ln-m { border-color: #2b6cb0; } .ln-L { border-color: #7a4a17; } .ln-M { border-color: #a8742f; border-top-width: 2.5px; }
.ln-S { border-color: #c8b08c; border-top-width: 2px; } .ln-x { border-color: #868e96; border-top-width: 2px; } .ln-f { border-color: #adb5bd; border-top-width: 1.5px; }
.fl { display: inline-block; width: 22px; height: 14px; border: 1px solid rgba(28,39,51,.45); flex: none; }
.fl-80 { background: #0b7285; } .fl-60 { background: #4aa3b3; } .fl-40 { background: #9fd3da; } .fl-0 { background: #e3f1f3; }
.fl-pub { background: repeating-linear-gradient(135deg, #868e96 0 2px, #dee2e6 2px 5px); }
.fl-hit { background: transparent; border: 3px solid #ffd43b; box-shadow: 0 0 0 1px #1c2733; width: 20px; height: 12px; margin: 1px; }
.ol { display: inline-block; width: 22px; height: 14px; flex: none; background: transparent; }
.ol-deb { border: 2px dashed var(--warn); } .ol-fl { border: 2px dashed #1c7ed6; }

/* 製品版との違い */
.diff { width: 100%; border-collapse: collapse; font-size: 12.3px; }
.diff th, .diff td { border-bottom: 1px solid var(--rule2); padding: 6px 6px 6px 0; text-align: left; vertical-align: top; }
.diff thead th { font-size: 11.5px; color: var(--ink2); font-weight: 600; border-bottom-color: var(--rule); }
.diff tbody th { white-space: nowrap; font-weight: 600; width: 4.6em; }
.price { margin: 12px 0 10px; font-size: 13px; }
.price b { font-family: var(--mono); font-size: 15px; }
.cta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sec.small { font-size: 12px; color: var(--ink2); }
.sec.small h2 { color: var(--ink); }
.sec.small p { margin: 0 0 8px; }
.src summary { cursor: pointer; color: var(--accent-d); padding: 4px 0; }
.src ul { margin: 6px 0; padding-left: 18px; }
.src li { margin-bottom: 4px; }
.org { margin-top: 12px !important; line-height: 1.8; }

/* 地図の上の部品 */
.mapctl { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: calc(100% - 20px); z-index: 3; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.seg button { border: 0; background: none; min-width: 52px; min-height: 34px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.mini { border: 1px solid var(--rule); background: var(--panel); border-radius: 3px; min-height: 36px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.mapnote { position: absolute; left: 10px; bottom: 26px; max-width: calc(100% - 20px); overflow-wrap: anywhere; margin: 0; z-index: 2; background: rgba(28,39,51,.82); color: #fff; font-size: 11.5px; padding: 3px 9px; border-radius: 2px; pointer-events: none; }
.loading, .nojs { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: var(--panel); border: 1px solid var(--rule); padding: 10px 16px; border-radius: 3px; z-index: 4; font-size: 13px; margin: 0; }
.loading.err { border-color: var(--warn); max-width: 80%; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.maplibregl-popup-content { font: 12.5px/1.6 var(--sans); color: var(--ink); padding: 9px 12px; border-radius: 3px; }
.pp b { font-weight: 600; } .pp small { color: var(--ink2); display: block; }

/* 沢の線の説明（狭い画面では地図の上の帯に出す。吹き出しは端で切れるため） */
.sinfo { position: absolute; left: 10px; right: 10px; top: 62px; z-index: 4; display: flex; gap: 6px; align-items: flex-start; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 3px 12px rgba(0,0,0,.25); padding: 10px 2px 10px 14px; font-size: 13.5px; line-height: 1.6; }
.sinfo[hidden] { display: none; }
.sinfo .pp { flex: 1 1 auto; min-width: 0; }
.sinfo .x { flex: none; }

/* 調査票の見本 */
.card { position: absolute; right: 10px; top: 10px; bottom: 34px; width: 336px; max-width: calc(100% - 20px); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.25); z-index: 5; display: flex; flex-direction: column; overflow: hidden; }
.card[hidden] { display: none; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--rule); }
.card-eyebrow { margin: 0; font-size: 11.5px; color: var(--ink2); }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.card h2 span { font-family: var(--mono); }
.x { border: 0; background: none; width: 36px; height: 36px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink2); border-radius: 3px; }
.x:hover { background: var(--rule2); }
.card-body { overflow-y: auto; padding: 4px 14px 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; }
.card-foot { flex: none; padding: 10px 14px 12px; border-top: 1px solid var(--rule); background: var(--panel); }
.card-foot .btn { margin-top: 0; min-height: 48px; font-size: 14.5px; }
.owner-na { margin: 0; font-size: 12.5px; color: var(--ink2); }

/* 所有者への問い合わせの画面 */
.sheet-back { position: fixed; inset: 0; background: rgba(28,39,51,.5); z-index: 20; }
.sheet-back[hidden], .sheet[hidden] { display: none; }
.sheet { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); max-height: min(86vh, 640px); max-height: min(86dvh, 640px);
  background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.sheet h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 16px 14px; flex: 1 1 auto; min-height: 0; }
.sheet-body .note:last-child { margin-bottom: 0; }
.sheet-body a.inl { display: inline-block; padding: 6px 0; }
.sheet-body .idline { color: var(--ink); font-size: 13px; }
.sheet-body .idline .lnk { margin-left: 4px; }
/* 押すボタンは下に固定する（小さい画面や横向きでも、動かさずに押せる） */
.sheet-foot { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--rule); background: var(--panel); }
.sheet-lead { margin: 0 0 8px; font-size: 13.5px; }
.sheet .btn { margin-top: 0; min-height: 48px; font-size: 14.5px; }
.card h3 { font-size: 12px; color: var(--ink2); margin: 14px 0 2px; font-weight: 600; letter-spacing: .04em; border-bottom: 1px solid var(--rule); padding-bottom: 3px; }
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 9.2em 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--rule2); font-size: 13px; }
.kv dt { color: var(--ink2); font-size: 12.3px; }
.kv dd { margin: 0; }
.kv dd .num { font-family: var(--mono); font-weight: 600; }
.kv dd small { color: var(--ink2); font-size: 11.5px; font-weight: 400; display: block; line-height: 1.5; }
.kv .locked dd { color: var(--ink2); }
.kv .locked dd::before { content: "—  "; }
.kv .na { color: var(--ink2); }
.kv .warnv { color: #b02525; font-weight: 600; }
.pubflag { margin: 10px 0 0; padding: 8px 10px; background: #eef0f2; border-left: 3px solid #868e96; font-size: 12.5px; }
.lockedlist { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink2); }
.card .btn { margin-top: 12px; }

/* 狭い画面・スマホ横向きも左右分割。地図をパネルで覆わない。 */
@media (max-width: 860px), (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  :root { --bar-h: 54px; }
  .brand-area { display: none; }
  .bar-nav .ghost { display: none; }
  .bar .btn { min-height: 44px; }
  .brand-name { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px 0 0; }
  .brand { align-items: center; }
  .stage { --panel-size: clamp(176px, var(--panel-width, 50%), calc(100% - 144px)); }
  .stage.panel-compact { --panel-size: 44px; }
  .panel-tools { padding: 5px 8px; }
  .panel-status { padding: 5px 10px; }
  .tab-pane, .tab-pane.sec { padding: 12px 10px max(20px, env(safe-area-inset-bottom, 0px)); }
  /* 押す場所を 44px 以上に。入力は 16px（iOS が勝手に拡大しない大きさ） */
  .ck { min-height: 44px; font-size: 14px; }
  .ck input { width: 20px; height: 20px; }
  .legend .ck { padding: 2px 0; }
  .legend .ck input, .legend .ck i { margin-top: 12px; }
  .legend .ck i.ln { margin-top: 20px; }
  select { min-height: 46px; font-size: 16px; }
  .rg { height: 44px; }
  .lnk { min-height: 44px; padding: 8px 6px; font-size: 13.5px; }
  .results button { padding: 11px 4px; font-size: 13.5px; }
  .results .rmeta { font-size: 12.5px; }
  .seg button { min-width: 56px; min-height: 44px; font-size: 13.5px; }
  .mini { min-height: 46px; padding: 4px 12px; font-size: 13.5px; }
  .x { width: 44px; height: 44px; }
  .src summary { min-height: 44px; display: flex; align-items: center; }
  .cta-row .btn, .card .btn { min-height: 46px; }
  .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .maplibregl-popup-close-button { width: 44px; height: 44px; font-size: 22px; }
  .maplibregl-popup-content { padding: 12px 44px 12px 14px; font-size: 13.5px; }
  .mapctl { left: 10px; }
  .stage:not(.panel-compact) .sinfo { top: 116px; max-height: calc(100% - 126px); overflow-y: auto; }
  .mapnote { top: auto; bottom: 26px; left: 10px; font-size: 10.5px; line-height: 1.4; }
  .card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 66%; border-radius: 12px 12px 0 0; border-width: 1px 0 0; z-index: 7; }
  .card-head { padding: 10px 10px 8px 16px; }
  .card-body { padding: 2px 16px 14px; }
  .card-foot { padding: 10px 16px 12px; }
  .kv > div { font-size: 13.5px; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 90%; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .sheet-body { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
  .sheet-foot { padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .card-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
/* 横向きのスマホ: 調査票は右に出す（下に出すと地図が残らない） */
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  :root { --bar-h: 44px; }
  .card { left: auto; right: 0; top: 0; bottom: 0; width: min(calc(360px + env(safe-area-inset-right, 0px)), 52%); max-height: none; border-radius: 0; border-width: 0 0 0 1px; padding-right: env(safe-area-inset-right, 0px); }
  .sheet { left: 50%; right: auto; width: min(560px, 92%); transform: translateX(-50%); max-height: 96%; }
  .sheet-foot { flex-direction: row; }
  .sheet-foot .btn { flex: 1 1 0; white-space: normal; text-align: center; line-height: 1.35; }
  .sheet .card-head { padding-top: 6px; padding-bottom: 6px; }
  /* 調査票が右に出ている間は、出典の表示を調査票の左へ寄せる */
  .mapwrap.has-card .maplibregl-ctrl-bottom-right { right: min(calc(360px + env(safe-area-inset-right, 0px)), 52%); }
  .card-foot { padding-bottom: 12px; }
  .mapnote { display: none; }
  .sinfo { top: 56px; right: auto; width: min(360px, 50%); left: max(10px, env(safe-area-inset-left, 0px)); }
}
/* 本文幅に合わせる。画面が広くても右パネルを狭くした時に適用する。 */
.panel-slim .tab-pane { padding-left: 8px; padding-right: 8px; }
.panel-slim .fs.two { grid-template-columns: minmax(0, 1fr); }
.panel-slim .sortrow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.panel-slim .sortrow .lnk { justify-self: start; min-height: 44px; }
.panel-slim .results button { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 5px; padding-left: 2px; padding-right: 2px; }
.panel-slim .results .rsc { text-align: right; }
.panel-slim .results .rarea { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
.panel-slim .results .rmeta { min-width: 0; overflow-wrap: anywhere; }
.panel-slim .result-head .of { display: block; margin-left: 0; }
.panel-slim .legend { font-size: 12.5px; }
.panel-slim .legend .ck { flex-wrap: nowrap; gap: 5px; overflow-wrap: anywhere; }
.panel-slim .legend .ck > span { flex: 1 1 auto; min-width: 0; }
.panel-slim .legend .ln { width: 18px; }
.panel-slim .legend .fl, .panel-slim .legend .ol { width: 18px; }
.panel-slim .legend.fills li { align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.panel-slim .legend.fills .fl { margin-top: 4px; }
.panel-slim .sec h1 { font-size: 16px; }
.panel-slim .cta-row { flex-direction: column; }
.panel-slim .cta-row .btn { white-space: normal; text-align: center; }
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
@media print { .panel, #panelResize, .mapctl, .bar-nav { display: none; } .stage { display: block; } }

.tab-pane:focus-visible { outline-offset: -3px; }
