:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  --ink: #172531;
  --muted: #5a6870;
  --paper: #f7f3eb;
  --surface: #fffdf8;
  --line: #d8d2c6;
  --navy: #152a38;
  --blue: #1f5d79;
  --gold: #a77528;
  --good: #247145;
  --alert: #99421e;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; }
button, .button { min-height: 44px; border-radius: 12px; border: 1px solid var(--navy); background: var(--navy); color: white; padding: .55rem .8rem; font-weight: 650; text-align: center; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .button.secondary { background: transparent; color: var(--navy); }
button.ghost { border-color: transparent; background: transparent; color: var(--blue); padding-inline: .25rem; }
button.warning { background: var(--alert); border-color: var(--alert); }
button.selected { background: var(--gold); border-color: var(--gold); color: #17110a; }
a { color: var(--blue); }
.skip-link { position: fixed; left: .75rem; top: -100px; z-index: 100; background: #fff; color: #000; padding: .7rem; }
.skip-link:focus { top: .75rem; }
.app-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: calc(.65rem + env(safe-area-inset-top)) 1rem .65rem; }
.brand { display: flex; align-items: center; gap: .7rem; max-width: 920px; margin: auto; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand h1 { font-size: 1.05rem; margin: 0; letter-spacing: .02em; }
.brand p { font-size: .76rem; color: var(--muted); margin: .12rem 0 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.header-actions button { min-height: 34px; padding: .35rem .5rem; font-size: .8rem; }
main { max-width: 920px; margin: auto; padding: 1rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left)); }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: calc(66px + env(safe-area-inset-bottom)); padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--navy); display: grid; grid-template-columns: repeat(5, 1fr); gap: .12rem; box-shadow: 0 -4px 18px #0002; }
.bottom-nav button { border: 0; background: transparent; border-radius: 10px; min-height: 52px; padding: .25rem; color: #dce7ec; font-size: .72rem; display: grid; align-content: center; gap: .05rem; }
.bottom-nav button[aria-current="page"] { background: #ffffff20; color: white; }
.nav-icon { font-size: 1.22rem; line-height: 1; }
.hero { background: linear-gradient(135deg, #152a38, #294e5d); color: #fff; border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.hero h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.eyebrow { color: #f5d18a !important; font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.hero p { margin: .25rem 0; color: #e1ecf0; }
.hero .stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.stat { padding: .45rem .55rem; border-radius: 10px; background: #fff2; font-size: .86rem; }
.notice { border-left: 4px solid var(--gold); background: #fff6df; padding: .75rem .85rem; border-radius: 0 10px 10px 0; margin: .8rem 0; }
.notice.danger { border-left-color: var(--alert); background: #fff0ea; }
.notice.good { border-left-color: var(--good); background: #eaf7ee; }
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.section-head { display: flex; gap: .65rem; justify-content: space-between; align-items: baseline; margin: 1.25rem 0 .65rem; }
.section-head h2, .section-head h3 { font-size: 1.12rem; margin: 0; }
.section-head span { color: var(--muted); font-size: .86rem; }
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: 0 1px 2px #26303c0d; }
.panel + .panel, .card + .card { margin-top: .7rem; }
.filter-row { display: grid; grid-template-columns: 1fr auto; gap: .55rem; align-items: end; }
.filter-row.three { grid-template-columns: 1fr 1fr auto; }
label { display: grid; gap: .3rem; font-size: .86rem; font-weight: 650; }
input, select { width: 100%; min-height: 44px; border: 1px solid #aeb8bc; border-radius: 11px; padding: .55rem .65rem; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus, a:focus { outline: 3px solid #e7bd5f; outline-offset: 2px; }
.hint, .muted { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.pill { display: inline-block; padding: .22rem .45rem; border-radius: 999px; background: #e9eef0; color: #29424e; font-size: .74rem; font-weight: 650; }
.pill.good { background: #dcefe3; color: #13542e; }
.pill.warn { background: #fae4b5; color: #694509; }
.pill.bad { background: #f7d9cf; color: #7d2713; }
.art-card { display: grid; gap: .6rem; }
.art-card h3 { font-size: 1rem; line-height: 1.35; margin: 0; }
.art-card p { margin: 0; line-height: 1.45; }
.art-card .sub { color: var(--muted); font-size: .88rem; }
.art-card .actions, .action-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.home-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; margin: 1rem 0 1.2rem; }
.home-actions button { min-height: 54px; font-size: .92rem; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem; }
.featured-grid .card { margin-top: 0; }
.genre-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.genre-button { min-height: 42px; font-size: .85rem; }
.guide-panel { line-height: 1.7; }
.guide-panel h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.guide-intro { font-weight: 700; font-size: 1.03rem; }
.guide-highlights { margin: .4rem 0 1rem; padding-left: 1.25rem; }
.guide-highlights li { margin: .45rem 0; }
.source-list { padding-left: 1.15rem; font-size: .88rem; }
.source-list li { margin: .45rem 0; }
.art-card .actions button, .action-row button { min-height: 39px; font-size: .86rem; }
.art-thumb { float: right; width: 52px; height: 52px; border-radius: 8px; display: grid; place-content: center; background: #e9e6dc; color: #70726d; font-size: .7rem; text-align: center; margin-left: .75rem; }
.art-thumb.art-image { object-fit: cover; display: block; background: #d8d1c1; color: transparent; }
.art-image-large { display: block; width: min(100%, 390px); max-height: 65vh; object-fit: contain; background: #e9e6dc; border-radius: 12px; margin: .8rem auto; }
.image-figure { margin: 0; }
.image-figure figcaption { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.room-card { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; }
.room-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.room-card p { margin: 0; font-size: .87rem; color: var(--muted); }
.room-card button { min-height: 40px; }
.back { margin-bottom: .75rem; }
.detail-title { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .35rem; }
.detail-subtitle { margin: 0; color: var(--muted); }
.detail-actions { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.detail-actions button { min-height: 42px; }
.definition-list { display: grid; grid-template-columns: minmax(105px, 30%) 1fr; margin: .5rem 0 0; border-top: 1px solid var(--line); }
.definition-list dt, .definition-list dd { border-bottom: 1px solid var(--line); padding: .6rem .25rem; margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.definition-list dt { color: var(--muted); font-weight: 650; }
.definition-list dd { padding-left: .75rem; }
.map-controls { display: flex; flex-wrap: wrap; gap: .45rem; align-items: end; margin: .7rem 0; }
.map-controls label { min-width: 110px; flex: 1; }
.map-controls button { min-height: 40px; }
.pdf-scroller { width: 100%; min-height: 310px; max-height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #40454b; touch-action: pan-x pan-y pinch-zoom; }
.pdf-stage { position: relative; width: max-content; min-height: 100%; }
.pdf-stage canvas { display: block; background: #fff; }
.map-marker { position: absolute; width: 25px; height: 25px; margin: -12.5px 0 0 -12.5px; border: 4px solid #d8491f; border-radius: 50%; background: #fff8; box-shadow: 0 0 0 3px #fff9; pointer-events: none; }
.map-loading { padding: 1rem; color: white; }
.map-caption { margin: .6rem 0 0; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.map-edition { margin: .7rem 0 0; padding: .55rem .65rem; border-radius: 9px; font-size: .86rem; }
.map-edition.good { color: #13542e; background: #eaf7ee; }
.map-edition.warn { color: #694509; background: #fff3d6; }
.facility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: .65rem; }
.facility { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; }
.facility h3 { margin: 0 0 .35rem; font-size: .97rem; }
.facility p { margin: 0 0 .45rem; font-size: .84rem; color: var(--muted); }
.verified-points { display: grid; gap: .5rem; }
.verified-point { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .65rem; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; }
.verified-point p { margin: 0; font-size: .9rem; }
.settings-list { display: grid; gap: .7rem; }
.setting { display: flex; gap: .8rem; justify-content: space-between; align-items: center; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; padding-bottom: 0; }
.install-steps { padding-left: 1.25rem; line-height: 1.55; }
.empty { text-align: center; color: var(--muted); padding: 1.6rem .8rem; }
.loading { min-height: 50vh; display: grid; place-content: center; gap: .75rem; color: var(--muted); text-align: center; }
.spinner { width: 32px; height: 32px; border: 4px solid #d6e0e4; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) {
  .filter-row, .filter-row.three { grid-template-columns: 1fr; }
  .filter-row button { width: 100%; }
  .definition-list { grid-template-columns: 1fr; }
  .definition-list dt { padding-bottom: .1rem; border-bottom: 0; }
  .definition-list dd { padding: .15rem .25rem .6rem; }
  .map-controls label { flex-basis: 100%; }
  .bottom-nav button { font-size: .65rem; }
  .nav-icon { font-size: 1.08rem; }
  .featured-grid { grid-template-columns: 1fr; }
}
@media (prefers-contrast: more) {
  :root { --line: #52616a; --muted: #34434b; }
  .card, .panel, input, select { border-width: 2px; }
}
