@page { size: A4 landscape; margin: 0; }
:root {
  --bg: #EEF2EA;
  --surface: #FFFFFF;
  --ink: #1F2A27;
  --ink-soft: #55615C;
  --line: #CBD5C7;
  --river: #2A6F9E;
  --accent: #A8322D;
  --chip: #E1E8DC;
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic", sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161C1A; --surface: #212926; --ink: #E8EEEA; --ink-soft: #A7B3AD;
    --line: #36423D; --river: #7FB6D9; --accent: #E0796E; --chip: #2B3531;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161C1A; --surface: #212926; --ink: #E8EEEA; --ink-soft: #A7B3AD;
  --line: #36423D; --river: #7FB6D9; --accent: #E0796E; --chip: #2B3531;
  color-scheme: dark;
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.7; -webkit-text-size-adjust: 100%; word-break: auto-phrase; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--river); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { padding: 22px 0 10px; }
.top h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(28px, 6vw, 44px); line-height: 1.25; margin: 0; letter-spacing: .02em; }
.top p { margin: 6px 0 0; color: var(--ink-soft); font-size: 16px; }

.notice { margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: var(--chip); font-size: 15px; }
.notice.error { background: #F6DCD8; color: #6B1D16; }

/* category chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 2px solid transparent; background: var(--chip); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--surface); border-color: var(--ink); font-weight: 700; }

/* map */
.map-wrap { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.map-scroll { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 78vh; }
.map { position: relative; width: 100%; }
.map img.bg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; color: #fff; font-weight: 700; font-size: 15px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 2px 4px rgba(20,30,25,.35); }
.pin.dim { opacity: .25; }
.home { --ax: 50%; position: absolute; transform: translate(calc(-1 * var(--ax)), calc(-100% - 8px)); background: #1F2A27; color: #fff; padding: 6px 10px 6px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.home::after { content: ""; position: absolute; left: var(--ax); bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 0; border-top-color: #1F2A27; }
.home svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .pin { width: 28px; height: 28px; font-size: 13px; border-width: 2px; } }
.zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.zoom button:disabled { opacity: .4; cursor: default; }

/* list */
.list { margin: 26px 0 10px; }
.list h2 { font-family: var(--font-head); font-size: 22px; margin: 22px 0 8px; display: flex; align-items: center; gap: 10px; }
.list h2 .bar { width: 6px; height: 22px; border-radius: 3px; }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; cursor: pointer; }
.item .num { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.item .name { font-weight: 700; font-size: 18px; line-height: 1.4; }
.item .catch { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.item .far { color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.tag-sponsor { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }

.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 18px 0 40px; color: var(--ink-soft); font-size: 14px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--ink); background: var(--surface); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); }

/* detail sheet */
/* article (blog-style detail) */
#article { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.a-bar { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.a-bar .wrap { max-width: 720px; display: flex; align-items: center; min-height: 56px; }
.a-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 4px; border: none; background: none; font-weight: 700; font-size: 17px; cursor: pointer; color: var(--ink); }
.a-back svg { width: 22px; height: 22px; }
.a-main { max-width: 720px; margin: 0 auto; padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; min-width: 0; width: auto; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; background: var(--chip); display: block; }
.gallery.multi img { flex-basis: 86%; }
@media (min-width: 720px) { .gallery { padding: 16px 16px 0; } .gallery img { border-radius: 14px; aspect-ratio: 3 / 2; } }
.g-count { text-align: right; font-size: 13px; color: var(--ink-soft); padding: 4px 16px 0; }
.a-body { padding: 18px 20px 0; }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 15px; color: var(--ink-soft); }
.a-meta .cat { display: inline-flex; align-items: center; gap: 6px; }
.a-meta .dot { width: 10px; height: 10px; border-radius: 50%; }
.a-meta .far { background: var(--chip); color: var(--ink); border-radius: 999px; padding: 2px 12px; }
.a-title:focus { outline: none; }
.a-title { font-family: var(--font-head); font-size: clamp(28px, 7vw, 38px); line-height: 1.3; margin: 10px 0 8px; }
.a-lead { font-size: 19px; line-height: 1.6; margin: 0 0 22px; font-weight: 700; }
.a-text p { margin: 0 0 1em; white-space: pre-wrap; line-height: 1.95; }
.staff { margin: 28px 0; background: var(--surface); border: 2px solid var(--river); border-radius: 16px; padding: 18px 18px 14px; }
.staff h2 { font-family: var(--font-head); font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; color: var(--river); }
.staff .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--river); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.staff p { margin: 0; white-space: pre-wrap; line-height: 1.9; }
.staff .sign { text-align: right; color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.a-sec h2 { font-family: var(--font-head); font-size: 20px; margin: 32px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu li { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; }
.menu .leader { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--line); transform: translateY(-5px); }
.menu .price { font-weight: 700; white-space: nowrap; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.info dt { color: var(--ink-soft); }
.info dd { margin: 0; }
.a-actions { display: grid; gap: 10px; margin-top: 28px; }
.a-checked { font-size: 13px; color: var(--ink-soft); margin-top: 16px; }
.item .lead { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.item .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; display: block; background: var(--chip); }
.item .lead .num.badge { position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; font-size: 13px; border: 2px solid var(--surface); }

/* edit mode */
.editbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: #2A6F9E; color: #fff; padding: 10px 16px; font-size: 15px; }
.editbar strong { font-size: 16px; }
.coord { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: #1F2A27; color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); font-size: 18px; width: min(460px, calc(100% - 24px)); justify-content: space-between; }
.coord .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.coord button { flex: none; background: #fff; color: #1F2A27; border: none; border-radius: 8px; min-height: 42px; padding: 0 14px; font-weight: 700; cursor: pointer; }
.coord small { display: block; font-size: 12px; opacity: .8; }
.cross { position: absolute; width: 30px; height: 30px; transform: translate(-50%, -50%); pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: #E0302A; }
.cross::before { left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; }
.cross::after { top: 50%; left: 0; right: 0; height: 3px; margin-top: -1.5px; }
.edit-mode .map { cursor: crosshair; }

/* print preview */
#printView { position: fixed; inset: 0; z-index: 50; background: #5D6763; display: flex; flex-direction: column; }
#printView[hidden] { display: none; }
.pv-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: #1F2A27; color: #fff; }
.pv-group { display: flex; align-items: center; gap: 6px; }
.pv-group span { font-size: 14px; opacity: .85; margin-right: 2px; }
.seg { border: 1px solid #8A9792; background: transparent; color: #fff; border-radius: 8px; min-height: 40px; padding: 0 14px; cursor: pointer; }
.seg[aria-pressed="true"] { background: #fff; color: #1F2A27; font-weight: 700; }
.pv-bar .spacer { flex: 1; }
.pv-bar .btn { min-height: 42px; border-color: #fff; }
.pv-bar .btn.primary { background: #fff; color: #1F2A27; }
.pv-bar .btn.ghost { background: transparent; color: #fff; }
.pv-note { width: 100%; font-size: 13px; opacity: .8; }
.stage { flex: 1; overflow: auto; padding: 20px; }
.stage-inner { transform-origin: top left; }

/* ===== printed sheet (always light) ===== */
.sheet {
  --s: 1;
  position: relative; overflow: hidden; background: #FFFFFF; color: #1F2A27;
  font-family: var(--font-body);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  padding: calc(var(--s) * 9mm);
  display: grid; gap: calc(var(--s) * 4mm);
}
.s-head { grid-area: head; display: flex; align-items: flex-end; justify-content: space-between; gap: calc(var(--s) * 6mm); border-bottom: calc(var(--s) * 0.6mm) solid #1F2A27; padding-bottom: calc(var(--s) * 2mm); }
.s-title { font-family: var(--font-head); font-weight: 700; font-size: calc(var(--s) * 8.4mm); line-height: 1.15; margin: 0; }
.s-sub { font-size: calc(var(--s) * 3.4mm); margin: calc(var(--s) * 1mm) 0 0; color: #4A5551; }
.s-map { grid-area: map; position: relative; align-self: start; border-radius: calc(var(--s) * 2mm); overflow: hidden; border: calc(var(--s) * 0.3mm) solid #B9C4B6; }
.s-map img { display: block; width: 100%; height: 100%; }
.s-pin { position: absolute; transform: translate(-50%, -50%); width: calc(var(--s) * 5.6mm); height: calc(var(--s) * 5.6mm); border-radius: 50%; border: calc(var(--s) * 0.5mm) solid #fff; color: #fff; font-weight: 700; font-size: calc(var(--s) * 3mm); display: grid; place-items: center; line-height: 1; }
.s-home { --ax: 50%; position: absolute; transform: translate(calc(-1 * var(--ax)), calc(-100% - var(--s) * 1.4mm)); background: #1F2A27; color: #fff; font-weight: 700; font-size: calc(var(--s) * 2.8mm); padding: calc(var(--s) * 0.8mm) calc(var(--s) * 1.8mm); border-radius: calc(var(--s) * 1.2mm); white-space: nowrap; }
.s-home::after { content: ""; position: absolute; left: var(--ax); bottom: calc(var(--s) * -1.4mm); transform: translateX(-50%); border: calc(var(--s) * 1.4mm) solid transparent; border-bottom: 0; border-top-color: #1F2A27; }
.s-legend { grid-area: legend; overflow: hidden; min-height: 0; --lf: 1; column-gap: calc(var(--s) * 5mm); column-fill: balance; }
.s-cat { break-inside: avoid; font-family: var(--font-head); font-weight: 700; font-size: calc(var(--s) * var(--lf) * 3.8mm); margin: 0 0 calc(var(--s) * 1mm); padding-top: calc(var(--s) * var(--lf) * 1.6mm); display: flex; align-items: center; gap: calc(var(--s) * 1.5mm); }
.s-cat:first-child { padding-top: 0; }
.s-cat i { display: inline-block; width: calc(var(--s) * 1.4mm); height: calc(var(--s) * var(--lf) * 4mm); border-radius: calc(var(--s) * 0.7mm); }
.s-item { break-inside: avoid; display: grid; grid-template-columns: calc(var(--s) * var(--lf) * 5mm) 1fr; gap: calc(var(--s) * 1.8mm); margin: 0 0 calc(var(--s) * var(--lf) * 1.6mm); }
.s-num { width: calc(var(--s) * var(--lf) * 5mm); height: calc(var(--s) * var(--lf) * 5mm); border-radius: 50%; color: #fff; font-weight: 700; font-size: calc(var(--s) * var(--lf) * 2.7mm); display: grid; place-items: center; line-height: 1; margin-top: calc(var(--s) * var(--lf) * 0.3mm); }
.s-name { font-weight: 700; font-size: calc(var(--s) * var(--lf) * 3.5mm); line-height: 1.35; }
.s-far { white-space: nowrap; display: inline-block; font-weight: 400; font-size: calc(var(--s) * var(--lf) * 2.8mm); color: #4A5551; margin-left: calc(var(--s) * 1.5mm); }
.s-catch { font-size: calc(var(--s) * var(--lf) * 2.9mm); line-height: 1.4; color: #3B4642; }
.s-qr { grid-area: qr; display: flex; gap: calc(var(--s) * 3mm); align-items: center; min-height: 0; }
.s-qr .code { flex: none; width: var(--qr); height: var(--qr); }
.s-qr .code svg { width: 100%; height: 100%; display: block; }
.s-qr p { margin: 0; font-size: calc(var(--s) * 3.2mm); line-height: 1.45; }
.s-qr p b { font-family: var(--font-head); font-size: calc(var(--s) * 3.9mm); display: block; margin-bottom: calc(var(--s) * 0.8mm); }
.sheet.portrait .s-qr { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: calc(var(--s) * 2mm); }
.sheet.portrait .s-qr p { font-size: calc(var(--s) * 2.8mm); }
.s-foot { grid-area: foot; font-size: calc(var(--s) * 2.5mm); color: #5B6662; display: flex; justify-content: space-between; gap: calc(var(--s) * 4mm); }

@media print {
  html, body { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  :root { padding: 0 !important; }
  body > *:not(#printView) { display: none !important; }
  #printView { position: static; display: block !important; background: none; }
  .pv-bar { display: none !important; }
  .stage { padding: 0 !important; overflow: visible !important; }
  .stage-inner { transform: none !important; width: auto !important; height: auto !important; }
  .sheet { box-shadow: none; page-break-after: avoid; break-after: avoid; }
}
@media (prefers-reduced-motion: no-preference) {
  .pin { transition: transform .15s ease; }
  .pin:active { transform: translate(-50%, -50%) scale(.92); }
}
