/* Map 専用。共通クロムの調整もこの画面に閉じる。 */
:root {
  /* ロゴの5色から作る。区画の識別色と建物の状態色は情報の色なので、ここには含めない（docs/architecture.md「配色」） */
  --ink: #042b5a;
  --ink-soft: #4d6480;
  --panel: rgba(252, 253, 255, .96);
  --line: rgba(4, 43, 90, .14);
  --accent: #043a80;
  --teal: #09a7b2;
  --orange: #f99704;
  --purple: #6c5cb3;
  --tint: #e3f4f6;
  --shadow: 0 8px 28px rgba(4, 43, 90, .10), 0 1px 3px rgba(4, 43, 90, .05);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: #e3ecf3; color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
button, a, input { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, a { transition: background .15s, color .15s, border-color .15s; }
#canvas { position: fixed; inset: 0; touch-action: none; }
.city-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.city-webgl { position: relative; display: block; }
#canvas[data-sky="on"]::after { display: none; }
#canvas::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(227,236,243,.65), transparent 20%, transparent 85%, rgba(227,236,243,.6));
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .17em; color: var(--ink-soft); }

/* ヘッダーと統計。数値はイベント由来のものだけを表示する。 */
#topbar {
  position: fixed; inset: 20px 24px auto; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; min-height: 70px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
#chrome { flex-shrink: 0; flex-wrap: nowrap; background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 0; gap: 12px; }
#chrome .chrome-brand { font-size: 18px; letter-spacing: -.055em; }
#chrome .chrome-brand img { height: 32px; }
#chrome .chrome-tab { padding: 9px 13px; }
#chrome .chrome-tab[aria-current="page"] { background: var(--tint); color: var(--accent); }
#stats { display: flex; align-items: center; gap: 24px; margin-left: auto; border: 0; background: none; box-shadow: none; }
#stats span { display: flex; align-items: baseline; gap: 6px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
#stats b { font-size: 22px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
#stats span:last-child b { color: #c25443; }
#source-badge { display: flex; align-items: center; gap: 7px; font-size: 11px; white-space: nowrap; padding-left: 20px; border-left: 1px solid var(--line); }
#source-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
#source-badge[data-state="mock"]::before { background: var(--orange); }
#source-badge[data-state="stale"]::before { background: #c25443; }

/* 区画の案内 */
#explorer { position: fixed; top: 110px; left: 24px; width: 260px; z-index: 15; padding: 22px 14px 14px; }
.explorer-heading { padding: 0 8px; }
.explorer-heading h1 { font-size: 22px; font-weight: 600; letter-spacing: -.04em; margin: 9px 0 8px; }
.explorer-heading p { font-size: 11px; line-height: 1.9; color: var(--ink-soft); }
/* 検索はヘッダーに統合。スマホでは同じ欄を dialog に移す。 */
#search-slot { flex: 1; min-width: 170px; max-width: 300px; }
#search-wrap { position: relative; }
#search-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; }
#search-toggle:hover { background: var(--tint); }
#search-dialog { position: fixed; inset: max(20px, env(safe-area-inset-top)) 12px auto; width: calc(100% - 24px); max-width: 540px; max-height: calc(100dvh - 40px); margin: 0 auto; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); overflow-y: auto; }
#search-dialog::backdrop { background: rgba(4,43,90,.32); }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.search-heading h2 { font-size: 16px; }
#search-close { width: 44px; height: 44px; flex: none; border-radius: 50%; font-size: 26px; }
#search-close:hover { background: var(--tint); }
#search-dialog #results { position: static; margin-top: 10px; max-height: min(52dvh, 420px); box-shadow: none; }
#search-dialog #search { font-size: 16px; }
#search-wrap::before { content: ""; position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--ink-soft); border-radius: 50%; left: 14px; top: 14px; pointer-events: none; }
#search-wrap::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: var(--ink-soft); left: 23px; top: 25px; transform: rotate(45deg); pointer-events: none; }
#search { width: 100%; min-height: 44px; padding: 11px 10px 11px 36px; font-size: 12px; border: 1px solid var(--line); border-radius: 10px; background: #eef3f8; }
#search::placeholder { color: var(--ink-soft); }
#results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 42vh; overflow-y: auto; display: none; }
#results.open { display: block; }
#results button { display: block; width: 100%; text-align: left; padding: 12px; font-size: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#results p { padding: 16px 12px; font-size: 12px; color: var(--ink-soft); }
#results button:hover { background: var(--tint); }
#results .sub { display: block; font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
.district-heading { display: flex; justify-content: space-between; padding: 20px 8px 10px; }
.district-heading span:last-child { font-size: 10px; color: var(--ink-soft); }
#districts { display: flex; flex-direction: column; gap: 3px; max-height: calc(100dvh - 410px); overflow-y: auto; }
#districts button { flex-shrink: 0; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 9px; border: 1px solid transparent; border-radius: 9px; text-align: left; font-size: 11px; line-height: 1.5; }
#districts button:hover { background: #eef3f8; }
#districts button.active { background: var(--tint); border-color: #b6dfe3; color: var(--accent); }
#districts button i { flex-shrink: 0; width: 9px; height: 9px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
#districts button em { margin-left: auto; font-size: 10px; font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-soft); background: rgba(4,43,90,.06); padding: 2px 6px; border-radius: 5px; }
.explorer-footer { border-top: 1px solid var(--line); margin-top: 12px; padding: 14px 8px 0; }
.explorer-footer a { font-size: 11px; color: var(--accent); text-decoration: none; }

/* 操作は1つのドックにまとめ、街のための余白を残す。 */
#controls { position: fixed; left: 24px; bottom: calc(24px + var(--safe-b)); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
#controls .group { display: flex; gap: 4px; }
#controls button { padding: 12px; min-height: 44px; font-size: 11px; border-radius: 9px; white-space: nowrap; }
#controls button:hover { background: var(--tint); }
#controls #btn-overview { background: var(--ink); color: #fff; }
#controls #btn-overview:hover { background: var(--accent); }
#controls .label { font-size: 9px; color: var(--ink-soft); border-left: 1px solid var(--line); padding-left: 12px; }
#map-hint { position: fixed; bottom: calc(44px + var(--safe-b)); right: 24px; font-size: 11px; color: var(--ink-soft); pointer-events: none; }
.touch-hint { display: none; }
@media (pointer: coarse) { .desktop-hint { display: none; } .touch-hint { display: inline; } }

/* 屋根を指す吹き出し。スクロールは内側に閉じ、尾は切り取らない。 */
#card { position: fixed; top: 0; left: 0; width: 440px; z-index: 25; display: none; transform: translateY(-100%); visibility: hidden; }
#card.open { display: block; }
#card.positioned { visibility: visible; }
#card:focus { outline: none; }
#card .card-content { max-height: var(--card-height, 560px); overflow-y: auto; overscroll-behavior: contain; border-radius: inherit; }
.card-tail { position: absolute; left: -1px; bottom: -15px; width: calc(100% + 2px); overflow: visible; pointer-events: none; }
.card-tail path { fill: #fcfdff; stroke: var(--line); stroke-width: 1; }
body.card-open #map-hint { display: none; }
#card .head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; background: #fcfdff; }
#card .close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-soft); font-size: 20px; }
#card .close:hover { background: var(--tint); }
#card h2 { font-size: 18px; letter-spacing: -.03em; line-height: 1.4; padding-right: 30px; overflow-wrap: anywhere; }
#card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; background: #eaf0f6; overflow-wrap: anywhere; }
.chip i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chip.state[data-state="healthy"] { background: #e0efdf; color: #24653f; }
.chip.state[data-state="constructing"] { background: #f6edce; color: #80621b; }
.chip.state[data-state="repairing"] { background: #f8e5d0; color: #974b17; }
.chip.state[data-state="down"], .chip.state[data-state="degraded"] { background: #f7e1da; color: #a23529; }
#card .body { padding: 12px 16px 14px; }
#card .reason { font-size: 12px; line-height: 1.7; color: #a23529; background: #f9eae4; border-radius: 9px; padding: 12px; margin-bottom: 14px; overflow-wrap: anywhere; }
#card .reason:empty { display: none; }
#like { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px; border-radius: 10px; background: #fdebd2; color: var(--ink); font-size: 13px; font-weight: 600; }
#like:hover { background: #fbd9aa; }
#like[data-liked="true"] { background: #fdebd2; color: #8a5000; }
#like:disabled { background: #eaf0f6; color: var(--ink-soft); cursor: default; }
#like .count { font-variant-numeric: tabular-nums; }
#next-tier { margin-top: 9px; font-size: 10px; color: var(--ink-soft); text-align: center; }
.card-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-share button, .card-share a { display: flex; align-items: center; justify-content: center; flex: 1 1 140px; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.card-share button:hover, .card-share a:hover { background: var(--tint); }
.card-share button:disabled { color: var(--ink-soft); cursor: wait; }
#building-share-status { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); }
#building-share-status:empty { display: none; }
#building-share-url { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font-size: 12px; }
#open-app {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; margin-top: 12px; padding: 15px 22px;
  text-align: center; font-size: 16px; font-weight: 800; line-height: 1.4;
  border: 1px solid var(--orange); border-radius: 12px;
  background: linear-gradient(120deg, #ffd58b, var(--orange)); color: var(--ink); text-decoration: none;
  box-shadow: 0 4px 14px rgba(249,151,4,.28), inset 0 1px 0 rgba(255,255,255,.65);
}
#open-app:hover { background: linear-gradient(120deg, #ffe3b0, #ffac30); }
#open-app:active { background: var(--orange); }
#open-app-label, .open-app-icon { position: relative; z-index: 1; }
.open-app-icon { flex-shrink: 0; }
.open-app-effects { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.open-app-effects::before {
  content: ""; position: absolute; inset: -30% auto -30% 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  opacity: 0; transform: translateX(-150%) skewX(-20deg);
}
.open-app-effects::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.8), inset 0 0 18px rgba(255,255,255,.65);
}
.open-app-sparkle { position: absolute; top: 5px; left: 12px; color: #fff; font-size: 18px; line-height: 1; opacity: 0; }
.open-app-sparkle + .open-app-sparkle { top: auto; left: auto; right: 12px; bottom: 5px; font-size: 14px; }
/* 表示された選択中の1棟だけを短く強調する。常時点滅させない。 */
#card.open.positioned #open-app[href] .open-app-effects::before { animation: app-link-shine 1.6s ease-in-out 2; }
#card.open.positioned #open-app[href] .open-app-effects::after { animation: app-link-glow 1.6s ease-out 2; }
#card.open.positioned #open-app[href] .open-app-sparkle { animation: app-link-sparkle 1.6s ease-in-out .2s 2; }
#card.open.positioned #open-app[href] .open-app-sparkle + .open-app-sparkle { animation-delay: .55s; }
@keyframes app-link-shine {
  0% { opacity: 0; transform: translateX(-150%) skewX(-20deg); }
  15%, 50% { opacity: 1; }
  75%, 100% { opacity: 0; transform: translateX(350%) skewX(-20deg); }
}
@keyframes app-link-glow { 0%, 75%, 100% { opacity: 0; } 30% { opacity: 1; } }
@keyframes app-link-sparkle {
  0%, 65%, 100% { opacity: 0; transform: scale(.4) rotate(-25deg); }
  30% { opacity: 1; transform: scale(1.15) rotate(15deg); }
}
#open-app[aria-disabled="true"] { background: #eaf0f6; border-color: var(--line); color: var(--ink-soft); box-shadow: none; font-size: 12px; font-weight: 600; pointer-events: none; }
#open-app[aria-disabled="true"] :is(.open-app-effects, .open-app-icon) { display: none; }
#card .footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-soft); overflow-wrap: anywhere; }
#card .address { font-weight: 600; }
#card .guide-link { color: var(--ink-soft); }
#loading { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 20px; background: #e3ecf3; color: var(--ink-soft); font-size: 12px; transition: opacity .4s; }
#loading img { width: 150px; height: auto; }
#loading-message { width: min(560px, calc(100vw - 40px)); min-height: 3.6em; display: grid; place-items: center; line-height: 1.8; text-align: center; overflow-wrap: anywhere; }
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
#loading .bar { width: 148px; height: 3px; background: #c6d6e4; border-radius: 2px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 40%; background: var(--teal); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

@media (max-width: 1250px) and (min-width: 901px) {
  #topbar { display: grid; grid-template-columns: auto minmax(170px, 1fr) auto; gap: 8px 18px; }
  #chrome { grid-column: 1; }
  #search-slot { grid-column: 2 / 4; max-width: none; }
  #stats { grid-column: 1 / 3; margin-left: 0; gap: 24px; }
  #stats b { font-size: 18px; }
  #source-badge { grid-column: 3; }
  #explorer { top: 156px; width: 232px; }
  #districts { max-height: calc(100dvh - 430px); }
  #map-hint { bottom: calc(96px + var(--safe-b)); }
}
@media (max-width: 900px) {
  #topbar { inset: max(12px, env(safe-area-inset-top)) 12px auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
  #chrome { grid-column: 1; grid-row: 1; gap: 2px; }
  #chrome .chrome-brand img { height: 24px; }
  #chrome .chrome-tab { padding: 9px; }
  #search-slot { display: none; }
  #search-toggle { display: flex; grid-column: 2; grid-row: 1; justify-self: end; }
  #stats { grid-column: 1; grid-row: 2; width: 100%; gap: 6px; justify-content: space-between; }
  #stats span { flex-direction: column; gap: 0; font-size: 9px; }
  #stats b { font-size: 18px; }
  #source-badge { grid-column: 2; grid-row: 2; font-size: 9px; border: 0; padding: 0; gap: 4px; }
  #explorer { top: 128px; left: 12px; right: 12px; width: auto; padding: 0; background: none; border: 0; box-shadow: none; pointer-events: none; }
  #explorer > * { pointer-events: auto; }
  .explorer-heading, .district-heading, .explorer-footer { display: none; }
  #districts { position: fixed; left: 0; right: 0; bottom: calc(12px + var(--safe-b)); flex-direction: row; gap: 6px; padding: 0 12px; overflow-x: auto; max-height: none; scrollbar-width: none; }
  #districts button { width: auto; white-space: nowrap; background: var(--panel); border-color: var(--line); padding: 10px 12px; box-shadow: var(--shadow); }
  #controls { left: 12px; bottom: calc(70px + var(--safe-b)); right: auto; max-width: calc(100% - 24px); gap: 3px; padding: 5px; overflow-x: auto; }
  #controls button { padding: 10px; font-size: 10px; }
  #controls .label { padding-left: 8px; }
  #map-hint { right: 14px; bottom: calc(138px + var(--safe-b)); font-size: 10px; }
}
@media (max-width: 600px) {
  #chrome .chrome-brand img { content: url(/assets/platform_city_logomark.svg); width: 28px; height: 28px; }
  #chrome .chrome-brand { padding-right: 4px; }
}
@media (max-width: 360px) {
  #topbar { padding-inline: 8px; gap: 6px; }
  #chrome .chrome-tab { padding-inline: 6px; }
  #source-badge { font-size: 8px; }
}
@media (max-height: 500px) {
  body.card-open :is(#controls, #districts) { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 投影中は DOM を保ったまま隠す。選択・検索・カードは解除時に戻る。 */
body.auto-mode :is(#explorer, #search-slot, #search-toggle, #controls, #map-hint, #card, #chrome, #stats) {
  visibility: hidden;
  pointer-events: none;
}
body.auto-mode #topbar {
  inset: max(20px, env(safe-area-inset-top)) auto auto max(24px, env(safe-area-inset-left));
  display: flex; gap: 14px; min-height: 0; padding: 10px 14px;
  background: rgba(252,253,255,.85); border-radius: 12px; box-shadow: none;
}
body.auto-mode #topbar::before { content: ""; width: 98px; height: 29px; background: url(/assets/platform_city_horizontal.svg) center / contain no-repeat; }
body.auto-mode #topbar :is(#chrome, #stats, #search-slot, #search-toggle) { display: none; }
body.auto-mode #source-badge { font-size: 10px; padding-left: 12px; }
#auto-bar {
  position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(20px + var(--safe-b));
  z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 5px 5px 5px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(252,253,255,.85);
}
.auto-caption { font-size: 9px; letter-spacing: .2em; color: var(--ink-soft); }
#btn-auto-stop { min-height: 44px; padding: 10px 12px; border-radius: 8px; font-size: 11px; }
#btn-auto-stop:hover { background: var(--tint); }
#btn-auto-stop kbd { margin-left: 10px; font: inherit; color: var(--ink-soft); }
/* 数棟ずつ紹介する名前。位置の追従と出現アニメーションは別の要素で扱う。 */
#auto-building-labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.auto-building-label { position: absolute; top: 0; left: 0; height: var(--auto-label-height); padding-bottom: 12px; }
.auto-building-name {
  position: relative; display: block; height: 100%; padding: 8px 12px;
  border: 1px solid rgba(4,43,90,.2); border-radius: 10px;
  background: rgba(252,253,255,.96); color: var(--ink);
  box-shadow: 0 4px 14px rgba(4,43,90,.14);
  font-size: 13px; font-weight: 700; line-height: 20px;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: auto-label-pop .22s cubic-bezier(.2,.8,.3,1) both;
  transform-origin: 50% 100%;
}
.auto-building-label::after {
  content: ""; position: absolute; left: calc(50% - 1px); bottom: 0;
  width: 2px; height: 12px; background: var(--ink); opacity: .55;
}
@keyframes auto-label-pop {
  from { opacity: 0; transform: translateY(7px) scale(.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  body.auto-mode #topbar { left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
  #auto-bar { right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + var(--safe-b)); }
  #btn-auto-stop kbd { display: none; }
}


/* 中央広場の視聴施設。iframe は移動・リサイズ可能な非モーダルウィンドウに1つだけ生成する。 */
.viewing-entry { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.viewing-entry p { margin: 6px 0 10px; font-size: 12px; }
#viewing-tracks { display: flex; gap: 8px; }
#viewing-tracks button, #viewing-labels button {
  border: 1px solid var(--track-color); border-radius: 9px; background: #fbfcfe;
  color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
  border-top: 3px solid var(--track-color);
}
#viewing-labels { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#viewing-labels button { position: absolute; top: 0; left: 0; padding: 6px 10px; font-size: 12px; pointer-events: auto; }
#viewing-labels button[hidden], .auto-mode #viewing-labels { display: none; }
#public-viewing {
  position: fixed; inset: auto; z-index: 40; margin: 0; padding: 0;
  max-width: none; max-height: none; min-width: 0;
  border: 1px solid #c3d1de; border-radius: 14px;
  background: #f8fafc; color: var(--ink); box-shadow: 0 12px 48px rgba(4,43,90,.2), 0 2px 8px rgba(4,43,90,.1);
  overflow: hidden;
}
#public-viewing[open] { display: flex; flex-direction: column; }
.viewing-header {
  display: flex; align-items: center; gap: 8px; flex: none; padding: 8px 10px 0;
  cursor: grab; touch-action: none; user-select: none;
}
.viewing-header > div { flex: 1; min-width: 0; }
.viewing-header .eyebrow { font-size: 9px; letter-spacing: .12em; }
.viewing-header h2 { margin: 4px 0 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewing-move { flex: none; width: 28px; height: 44px; font-size: 24px; color: #7b8ea6; cursor: grab; touch-action: none; }
#viewing-close { flex: none; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-soft); font-size: 26px; }
#viewing-close:hover, #viewing-reset:hover { background: var(--tint); }
#viewing-description { flex: none; margin: 7px 12px 10px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#viewing-tracks { flex: none; gap: 6px; padding: 0 12px 10px; }
#viewing-tracks button { flex: 1; min-height: 36px; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
#viewing-tracks button[aria-pressed="true"] { background: var(--tint); color: var(--ink); box-shadow: inset 0 -3px var(--track-color); }
#viewing-player { display: grid; flex: 1; min-height: 0; min-width: 0; margin: 0 12px; background: #0b1f3d; border-radius: 8px; overflow: hidden; }
#viewing-player iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; }
#viewing-player p { align-self: center; justify-self: center; padding: 16px; max-width: 430px; text-align: center; color: #e8f0f9; line-height: 1.7; }
#viewing-player strong { display: block; font-size: 18px; margin-bottom: 8px; }
#viewing-player span { font-size: 12px; }
.keynote-links { display: grid; gap: 8px; align-self: center; width: min(280px, calc(100% - 32px)); margin: 0 auto 20px; }
.keynote-links a { padding: 10px 12px; border: 1px solid var(--track-color); border-radius: 8px; background: #fffaf0; color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; }
.keynote-links a:hover { background: #fff0ca; }
.viewing-footer { display: flex; align-items: center; flex: none; gap: 8px; min-height: 44px; padding: 4px 26px 4px 12px; font-size: 10px; }
#viewing-reset { flex: none; min-height: 32px; padding: 0 4px; border-radius: 5px; font-size: 10px; }
#viewing-youtube { flex: none; margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }
#viewing-resize { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; padding: 5px; color: #7b8ea6; font-size: 16px; cursor: nwse-resize; touch-action: none; }
#public-viewing.is-adjusting { user-select: none; }
#public-viewing.is-adjusting .viewing-header, #public-viewing.is-adjusting #viewing-move { cursor: grabbing; }
#public-viewing.is-adjusting iframe { pointer-events: none; }
.viewing-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#public-viewing button:focus-visible, #viewing-labels button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 600px) {
  .viewing-entry { margin-top: 10px; padding-top: 10px; }
}

@media (min-width: 901px) {
  #districts { max-height: max(88px, calc(100dvh - 620px)); }
}
@media (max-width: 900px) {
  .viewing-entry { width: fit-content; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
  .viewing-entry > .eyebrow, .viewing-entry > p { display: none; }
}

/* グルメ掲示板（ADR-043）。視聴ウィンドウと同じ浮くダイアログ。左に地図、右に一覧。 */
#food-shortcuts button { width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid #d9b98f; border-radius: 10px; background: #fff6e6; color: #6a3f1f; font-size: 12px; font-weight: 700; white-space: nowrap; }
#food-shortcuts button:hover { background: #fdeccf; }
#food-panel {
  position: fixed; inset: auto; z-index: 40; margin: 0; padding: 0;
  max-width: none; max-height: none; min-width: 0;
  border: 1px solid #c9ae87; border-radius: 14px;
  background: #fbf7ee; color: #3a2a1c; box-shadow: 0 12px 48px #2c1a0833, 0 2px 8px #2c1a081a;
  overflow: hidden;
}
#food-panel[open] { display: flex; flex-direction: column; }
#food-panel .viewing-header { background: linear-gradient(#8e5a2f, #7a4b25); color: #fff3d6; }
#food-panel .viewing-header .eyebrow, #food-panel .viewing-header h2 { color: #fff3d6; }
#food-panel [data-window="move"] { flex: none; width: 28px; height: 44px; font-size: 24px; color: #e8d6b3; cursor: grab; touch-action: none; }
#food-close { flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff3d6; font-size: 26px; }
#food-close:hover { background: #6a3f1f; }
#food-description { flex: none; margin: 8px 12px 6px; color: #6a5340; font-size: 11px; line-height: 1.5; }
.food-toolbar { display: flex; flex: none; gap: 6px; padding: 0 12px 6px; }
#food-search { flex: 1; min-width: 0; min-height: 34px; padding: 4px 10px; border: 1px solid #d9c6a8; border-radius: 8px; background: #fff; font-size: 12px; }
#food-sort { flex: none; min-height: 34px; padding: 4px 8px; border: 1px solid #d9c6a8; border-radius: 8px; background: #fff; font-size: 12px; }
#food-genres { display: flex; flex: none; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px; }
#food-genres button { min-height: 26px; padding: 2px 10px; border: 1px solid #d9c6a8; border-radius: 999px; background: #fff; color: #5a4634; font-size: 11px; white-space: nowrap; }
#food-genres button[aria-pressed="true"] { background: var(--genre-color, #7a4b25); border-color: var(--genre-color, #7a4b25); color: #fff; }
.food-body { display: grid; flex: 1; grid-template-columns: minmax(200px, 42%) 1fr; gap: 10px; min-height: 0; padding: 0 12px; }
.food-map-fold { align-self: start; min-width: 0; }
.food-map-fold > summary { display: none; }   /* 広い画面では常に開いていて、折りたたみは見せない */
.food-map { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border: 2px solid #8b5a2b; border-radius: 10px; background: #eef0e6; }
.food-map img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; }
#food-pins { position: absolute; inset: 0; }
.food-pin, .food-venue { position: absolute; transform: translate(-50%, -50%); }
.food-pin { width: 24px; height: 24px; padding: 0; border: 2px solid #fff6e5; border-radius: 50%; background: #d2452f; color: #fff6e5; font-size: 12px; font-weight: 700; box-shadow: 0 2px 4px #0006; cursor: pointer; }
.food-pin.is-highlighted { background: #ffb000; color: #3a2a1c; transform: translate(-50%, -50%) scale(1.25); z-index: 1; }
.food-venue { padding: 2px 8px; border-radius: 6px; background: #dde6f2; color: #3b4c62; font-size: 11px; font-weight: 700; pointer-events: none; }
.food-list { margin: 0; padding: 0 4px 8px 0; list-style: none; overflow: auto; min-height: 0; }
.food-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; padding: 8px 6px; border-bottom: 1px solid #ead9c0; }
.food-list li.is-highlighted { background: #fff1d6; border-radius: 8px; }
.food-list li.food-empty { display: block; padding: 16px 8px; color: #6a5340; font-size: 12px; line-height: 1.6; }
.food-number { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: #d2452f; color: #fff6e5; font-size: 12px; font-weight: 700; cursor: pointer; }
.food-number.is-nomap { display: inline-grid; place-items: center; background: #d9c6a8; color: #6a5340; }
.food-main { min-width: 0; font-size: 12px; line-height: 1.5; }
.food-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.food-head strong { font-size: 13px; }
.food-genre { padding: 0 8px; border-radius: 999px; background: var(--genre-color, #7f8a8c); color: #fff; font-size: 10px; line-height: 18px; }
.food-walk, .food-price { color: #6a5340; font-size: 11px; }
.food-recommend { color: #8b3a1e; }
.food-comment, .food-address { color: #5a4634; }
.food-address { font-size: 11px; }
.food-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 11px; }
.food-links a { color: var(--accent); font-weight: 700; }
.food-building { padding: 0; border: 0; background: none; color: #5a4634; font-size: 11px; text-decoration: underline; cursor: pointer; }
.food-like { align-self: center; min-width: 88px; min-height: 40px; padding: 4px 8px; border: 1px solid #cf9bb8; border-radius: 10px; background: #fff0f7; color: #893b69; font-size: 12px; font-weight: 600; white-space: nowrap; }
.food-like b { font-size: 13px; }
.food-like[aria-pressed="true"] { background: #893b69; border-color: #893b69; color: #fff; }
.food-like:hover { filter: brightness(0.97); }
#food-panel .viewing-footer { gap: 10px; }
.food-status { flex: 1; min-width: 0; color: #6a5340; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-attribution { flex: none; color: #8a7a68; font-size: 9px; white-space: nowrap; }
#food-panel [data-window="reset"] { flex: none; min-height: 32px; padding: 0 4px; border-radius: 5px; font-size: 10px; }
#food-panel [data-window="resize"] { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; padding: 5px; color: #8a7a68; font-size: 16px; cursor: nwse-resize; touch-action: none; }
#food-panel.is-adjusting { user-select: none; }
#food-panel.is-adjusting .viewing-header { cursor: grabbing; }
#food-panel button:focus-visible, #food-shortcuts button:focus-visible { outline: 2px solid #bd8e26; outline-offset: -2px; }
@media (max-width: 600px) {
  .food-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .food-entry { margin-left: 8px; }
}


/* ADR-046: 建物選択時の通信カード。 */
#card-traffic[hidden] { display: none; }
#card-traffic { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
#card-traffic h3 { font-size: 13px; }
#card-traffic ul { list-style: none; padding: 0; margin: 0; }
#card-traffic li { display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding: 10px 0; }
#card-traffic button { text-align: left; font-size: 12px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
#card-traffic button:hover { text-decoration: underline; }
#card-traffic small, .traffic-note, .traffic-empty { font-size: 10px; line-height: 1.6; color: var(--ink-soft); }
.traffic-result { font-size: 11px; }
.traffic-result[data-kind="clientError"], .traffic-result[data-kind="unreachable"] { color: #875d08; }
.traffic-result[data-kind="serverError"] { color: #a23529; }

/* 紹介が無いカードには余白を残さない（ADR-052）。 */
#card-preview { display: block; width: 100%; max-height: 180px; object-fit: contain; border-radius: 8px; margin: 0 0 10px; }
#card-description { margin: 0 0 12px; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
#card-preview[hidden], #card-description[hidden] { display: none; }

/* 行政区画。地図上の施設ラベルから運営サービスやスポンサー紹介を開く。 */
#operations-labels { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#operations-labels :is(a, button) {
  position: absolute; top: 0; left: 0; pointer-events: auto;
  padding: 6px 10px; border: 1px solid var(--facility-color); border-top-width: 3px;
  border-radius: 9px; background: #fbfcfe; color: var(--ink);
  font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
#operations-labels :is(a, button):hover { background: var(--tint); }
#operations-labels :is(a, button)[hidden], .auto-mode #operations-labels { display: none; }
@media (max-width: 900px) {
  #operations-labels :is(a, button) { padding: 8px; min-height: 44px; display: flex; align-items: center; font-size: 11px; }
}

/* 地図と吹き出しのロゴは縦横比を保つ。 */
.sponsor-label { display: flex; justify-content: center; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#operations-labels .sponsor-label { width: 78px; height: 44px; padding: 5px; }
#operations-labels .sponsor-label img { width: 100%; height: 100%; object-fit: contain; }
.sponsor-label:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sponsor-logo { display: block; width: 100%; height: 104px; object-fit: contain; }
.sponsor-jobs { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.sponsor-jobs h3 { margin: 0 0 14px; font-size: 16px; }
.sponsor-jobs p { margin: 0 0 16px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.sponsor-jobs a { color: #086886; text-decoration: underline; text-underline-offset: 3px; }
.sponsor-jobs .sponsor-source { border-top: 1px solid var(--line); margin: 24px 0 0; padding-top: 16px; font-size: 11px; }

/* BGMと環境音の共通ミュート。音の有無はスピーカーのピクトグラムで示す。 */
:is(#controls, #auto-bar) [data-audio-mute] { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; padding: 10px; }
[data-audio-mute] svg { display: block; flex: none; }
[data-audio-mute][aria-pressed="true"] .audio-waves,
[data-audio-mute][aria-pressed="false"] .audio-cross { display: none; }
[data-audio-mute][aria-pressed="true"] { color: var(--accent); background: var(--tint); }
:is([data-audio-mute], [data-audio-retry])[hidden] { display: none; }
#auto-bar :is([data-audio-mute], [data-audio-retry]) { min-height: 44px; padding: 10px 12px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
@media (max-width: 600px) {
  #auto-bar { gap: 4px; max-width: calc(100% - 24px); padding-left: 5px; }
  #auto-bar .auto-caption { display: none; }
}

/* 新着だけ、小鳥と吹き出しを短く表示する。待機時は操作対象も残さない。 */
#news-ticker { position:fixed; left:50%; bottom:calc(90px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:12; display:flex; align-items:center; gap:10px; width:max-content; max-width:min(680px,calc(100% - 560px)); animation:news-pop .42s cubic-bezier(.2,.8,.3,1.15) both; }
#news-ticker[hidden] { display:none; }
.news-ticker-bird { flex:none; width:64px; height:64px; align-self:flex-end; filter:drop-shadow(0 3px 3px #042b5a12); transform-origin:50% 85%; animation:news-chirp .55s ease-out; }
.news-ticker-bubble { position:relative; display:flex; align-items:center; min-width:0; gap:8px; padding:11px 10px 11px 17px; border:1px solid #b7d7da; border-radius:17px; background:#fffffff5; box-shadow:0 5px 22px #042b5a16; }
.news-ticker-bubble::before { content:""; position:absolute; left:-6px; bottom:19px; width:10px; height:10px; background:#fff; border-left:1px solid #b7d7da; border-bottom:1px solid #b7d7da; transform:rotate(45deg); }
#news-ticker a { display:flex; flex-direction:column; gap:4px; min-width:0; color:#043a80; text-decoration:none; }
#news-ticker a:hover .news-ticker-message { text-decoration:underline; text-underline-offset:3px; }
.news-ticker-meta { color:#087f88; font-size:10px; font-weight:700; letter-spacing:.03em; }
.news-ticker-message { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; line-height:1.6; }
#news-ticker button { flex:none; width:32px; height:32px; padding:0; border:0; border-radius:50%; background:transparent; color:#6c8291; font-size:22px; cursor:pointer; }
#news-ticker button:hover { background:#e9f5f5; color:#043a80; }
#news-ticker a:focus-visible,#news-ticker button:focus-visible { outline:3px solid #f99704; outline-offset:3px; }
@keyframes news-pop { from { opacity:0; transform:translate(-50%,12px) scale(.92); } 70% { opacity:1; transform:translate(-50%,-2px) scale(1.015); } to { opacity:1; transform:translate(-50%,0) scale(1); } }
@keyframes news-chirp { 0%,100% { transform:rotate(0); } 35% { transform:rotate(-9deg); } 65% { transform:rotate(5deg); } }
@media(prefers-reduced-motion:reduce) { #news-ticker,.news-ticker-bird { animation:none; } }
@media(max-width:900px) {
  #news-ticker { bottom:calc(130px + env(safe-area-inset-bottom,0px)); max-width:calc(100% - 24px); gap:5px; }
  .news-ticker-bird { width:48px; height:48px; }
  .news-ticker-bubble { padding:9px 6px 9px 12px; border-radius:14px; gap:4px; }
  .news-ticker-meta { font-size:9px; }
  .news-ticker-message { font-size:12px; }
  body:has(#news-ticker:not([hidden])) #map-hint { bottom:calc(204px + var(--safe-b)); }
  body.card-open #news-ticker { visibility:hidden; }
}


/* 曲名はマップを遮らない小さなクレジットにする。 */
#bgm-credit { position: fixed; left: 50%; bottom: calc(3px + var(--safe-b)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 7px; max-width: calc(100% - 32px); padding: 3px 10px; border-radius: 8px; background: rgba(252,253,255,.88); color: var(--ink-soft); font-size: 10px; line-height: 20px; }
#bgm-credit[hidden] { display: none; }
#bgm-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#bgm-suno { flex: none; color: inherit; text-underline-offset: 3px; }
#bgm-suno:hover, #bgm-suno:focus-visible { color: var(--accent); }
@media (max-width: 600px) {
  #bgm-credit { bottom: calc(122px + var(--safe-b)); }
  body:has(#bgm-credit:not([hidden])) #news-ticker { bottom: calc(158px + var(--safe-b)); }
  body:has(#bgm-credit:not([hidden])) #map-hint { bottom: calc(155px + var(--safe-b)); }
  body:has(#bgm-credit:not([hidden])):has(#news-ticker:not([hidden])) #map-hint { bottom: calc(232px + var(--safe-b)); }
  body.auto-mode #bgm-credit { bottom: calc(76px + var(--safe-b)); }
  #auto-bar { gap: 4px; max-width: calc(100% - 24px); padding-left: 5px; }
  #auto-bar .auto-caption { display: none; }
}

/* 住民名簿（Issue #325）。グルメ掲示板と同じ浮くダイアログで、街の全建物を区画ごとに並べる。 */
#directory-panel {
  position: fixed; inset: auto; z-index: 40; margin: 0; padding: 0;
  max-width: none; max-height: none; min-width: 0;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow), 0 12px 48px rgba(4,43,90,.18);
  overflow: hidden;
}
#directory-panel[open] { display: flex; flex-direction: column; }
#directory-panel .viewing-header { background: var(--ink); color: #fff; }
#directory-panel .viewing-header .eyebrow, #directory-panel .viewing-header h2 { color: #fff; }
#directory-panel [data-window="move"] { flex: none; width: 28px; height: 44px; font-size: 24px; color: rgba(255,255,255,.7); cursor: grab; touch-action: none; }
#directory-close { flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 26px; }
#directory-close:hover { background: rgba(255,255,255,.18); }
#directory-description { flex: none; margin: 8px 12px 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.directory-toolbar { display: flex; flex: none; gap: 6px; padding: 0 12px 6px; }
#directory-search { flex: 1; min-width: 0; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #eef3f8; font-size: 12px; }
#directory-sort { flex: none; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
#directory-districts { display: flex; flex: none; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px; }
#directory-districts button { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 11px; white-space: nowrap; }
#directory-districts button i { width: 8px; height: 8px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
#directory-districts button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.directory-list { flex: 1; margin: 0; padding: 0 8px 8px 12px; list-style: none; overflow: auto; min-height: 0; }
.directory-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.directory-list li.is-mine { background: var(--tint); border-radius: 8px; }
.directory-list li.directory-group { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; margin-top: 6px; padding: 8px 4px 6px; background: var(--panel); border-bottom: 1px solid var(--line); }
.directory-list li.directory-group em { font-size: 10px; font-style: normal; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.directory-list li.directory-empty { display: block; padding: 16px 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.directory-row { min-width: 0; min-height: 44px; padding: 4px 6px; border-radius: 8px; text-align: left; line-height: 1.4; }
.directory-row:hover { background: var(--tint); }
.directory-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.directory-row .sub { display: block; font-size: 10px; color: var(--ink-soft); overflow-wrap: anywhere; }
.directory-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.directory-likes { font-size: 11px; font-weight: 700; color: #c25443; white-space: nowrap; font-variant-numeric: tabular-nums; }
.directory-open { flex: none; min-height: 32px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; background: #f2a541; color: #2b1a05; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.directory-open:hover { background: #ffb95a; }
.directory-open.is-unpublished { background: none; color: var(--ink-soft); font-weight: 400; }
#directory-panel .viewing-footer { gap: 10px; }
#directory-panel [data-window="reset"] { flex: none; min-height: 32px; padding: 0 4px; border-radius: 5px; font-size: 10px; }
.directory-status { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#directory-panel [data-window="resize"] { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; padding: 5px; color: var(--ink-soft); font-size: 16px; cursor: nwse-resize; touch-action: none; }
#directory-panel.is-adjusting { user-select: none; }
#directory-panel.is-adjusting .viewing-header { cursor: grabbing; }
#directory-panel button:focus-visible, #directory-panel a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#results button[data-action="directory"] { font-weight: 700; color: var(--accent); }
/* 狭い画面: 掲示板と名簿は浮かせず全画面のシートにする（Issue #331 / ADR-072）。
   説明文・移動/サイズ変更のハンドルをなくし、チップは横 1 行に畳んで、一覧に高さを渡す。 */
@media (max-width: 600px) {
  #food-panel.is-sheet, #directory-panel.is-sheet {
    inset: 0; width: auto; height: auto; border: 0; border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .is-sheet [data-window="move"], .is-sheet [data-window="resize"], .is-sheet [data-window="reset"] { display: none; }
  .is-sheet .viewing-header { cursor: default; padding-left: 14px; }
  .is-sheet #food-description, .is-sheet #directory-description { display: none; }
  .is-sheet #food-genres, .is-sheet #directory-districts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .is-sheet #food-genres::-webkit-scrollbar, .is-sheet #directory-districts::-webkit-scrollbar { display: none; }
  .is-sheet .viewing-footer { min-height: 36px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .is-sheet .food-map-fold > summary { display: list-item; padding: 2px 0 8px; font-size: 12px; font-weight: 700; color: #6a3f1f; cursor: pointer; }
}

@media (max-width: 900px) {
  /* 1 行目に名前と「開く」、2 行目に区画・状態・いいね。「開く」を全幅に伸ばさない。 */
  .directory-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .directory-list li .directory-row { grid-column: 1; grid-row: 1; }
  .directory-list li .directory-open { grid-column: 2; grid-row: 1; }
  .directory-meta { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

/* 参加者の紹介画像は小さな屋上看板。寸法はconfig、操作は背後の建物へ通す（ADR-078）。 */
#rooftop-signs { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.rooftop-sign {
  position: absolute; top: 0; left: 0; padding: 2px;
  border: 1px solid #73858b; border-radius: 2px; background: #fff;
  pointer-events: none;
}
.rooftop-sign::after {
  content: ''; position: absolute; top: 100%; left: calc(50% - 1px); width: 2px; height: 3px;
  background: #73858b;
}
.rooftop-sign img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rooftop-sign[hidden], .auto-mode #rooftop-signs { display: none; }
