:root {
  color-scheme: light;
  --ink: #102a32;
  --muted: #60757b;
  --surface: #ffffff;
  --mist: #eef5f5;
  --teal: #164e63;
  --teal-2: #0e7490;
  --line: #d9e5e5;
  --shadow: 0 16px 45px rgba(16, 42, 50, 0.18);
  --good: #1f9d6b;
  --concern: #e39b2e;
  --danger: #d95656;
  --idea: #6e65c7;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  color: var(--ink);
  background: var(--mist);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 16px;
}
button, input, textarea { font: inherit; }
button { color: inherit; }

.home-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(30px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  color: white;
  background:
    radial-gradient(circle at 85% 8%, rgba(87, 200, 184, .28), transparent 28%),
    radial-gradient(circle at 4% 74%, rgba(53, 159, 183, .24), transparent 32%),
    linear-gradient(152deg, #082d3c 0%, #104f61 55%, #0b394b 100%);
}
.home-page::before { content: ""; position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(to bottom, black, transparent 85%); }
.home-content { position: relative; z-index: 2; width: min(660px, 100%); margin: 0 auto; }
.home-brand { display: flex; justify-content: center; margin: 3px 0 34px; }
.home-logo { display: block; width: min(250px, 66vw); height: auto; padding: 9px 12px; border: 1px solid rgba(255,255,255,.46); border-radius: 18px; background: white; box-shadow: 0 14px 34px rgba(0,20,28,.2); }
.home-heading { text-align: center; }
.home-kicker, .section-eyebrow { margin: 0 0 10px; color: #91e2d4; font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.home-heading h1 { margin: 0; font-size: clamp(2.35rem, 11vw, 4rem); line-height: 1.08; letter-spacing: .04em; }
.home-byline { margin: 10px 0 22px; color: #b8dadf; font-size: .95rem; letter-spacing: .08em; }
.home-description { max-width: 460px; margin: 0 auto; color: rgba(255,255,255,.78); line-height: 1.8; }
.exploration-section { margin-top: 50px; }
.home-menu-section { margin-top: 44px; }
.event-section { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 2px 14px; }
.section-heading h2 { margin: 0; font-size: 1.18rem; }
.section-eyebrow { margin-bottom: 5px; }
.point-count { color: rgba(255,255,255,.52); font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.section-description { margin: -5px 2px 13px; color: rgba(255,255,255,.64); font-size: .84rem; line-height: 1.6; }
.current-location-card { width: 100%; min-height: 104px; padding: 17px 18px; display: grid; grid-template-columns: 62px 1fr 38px; align-items: center; gap: 15px; text-align: left; border: 1px solid rgba(145,226,212,.5); border-radius: 23px; color: white; background: linear-gradient(135deg, rgba(27,125,140,.94), rgba(12,76,93,.96)); box-shadow: 0 18px 38px rgba(0,20,28,.24); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.current-location-card:hover { transform: translateY(-3px); box-shadow: 0 24px 46px rgba(0,20,28,.3); }
.current-location-card:focus-visible { outline: 3px solid #91e2d4; outline-offset: 4px; }
.current-location-card .place-copy > span:last-child { color: rgba(255,255,255,.72); }
.current-location-card .place-enter { color: var(--teal); background: white; }
.current-location-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: white; background: rgba(255,255,255,.14); }
.current-location-icon svg { width: 31px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.place-card { width: 100%; min-height: 138px; padding: 18px; display: grid; grid-template-columns: 90px 1fr 38px; align-items: center; gap: 15px; text-align: left; border: 1px solid rgba(255,255,255,.24); border-radius: 23px; color: var(--ink); background: rgba(255,255,255,.96); box-shadow: 0 22px 45px rgba(0,20,28,.28); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.event-list { display: grid; gap: 14px; }
.place-card:hover { transform: translateY(-3px); box-shadow: 0 26px 52px rgba(0,20,28,.34); }
.place-card:focus-visible { outline: 3px solid #91e2d4; outline-offset: 4px; }
.place-visual { width: 88px; height: 94px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; color: white; background: linear-gradient(145deg, #1e8090, #164e63); }
.place-visual svg { width: 70px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.place-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.place-copy strong { font-size: 1.45rem; }.place-copy > span:last-child { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.place-prefecture { color: var(--teal-2); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.place-enter { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--teal); }
.place-enter svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-footer { position: relative; z-index: 2; margin: 46px 0 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); text-align: center; color: rgba(255,255,255,.42); font-size: .76rem; letter-spacing: .08em; }
.home-orbit { position: absolute; border: 1px solid rgba(145,226,212,.18); border-radius: 50%; }
.orbit-one { width: 310px; height: 310px; right: -170px; top: 18%; }.orbit-two { width: 230px; height: 230px; left: -145px; bottom: 9%; }

.app-shell { width: 100%; height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: relative;
  z-index: 500;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(217, 229, 229, 0.85);
  box-shadow: 0 3px 16px rgba(16, 42, 50, 0.07);
}
.back-button { flex: 0 0 auto; margin-right: 4px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--teal); color: white; flex: 0 0 auto; }
.brand-mark svg { width: 23px; fill: currentColor; }
h1 { margin: 0; font-size: 1.05rem; line-height: 1.25; letter-spacing: .01em; }
.brand p { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.icon-button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--mist); cursor: pointer; }
.icon-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.map-stage { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #dfe9e6; }
.record-list-view { position: absolute; z-index: 430; inset: 0; overflow-y: auto; padding: 76px 12px 150px; background: var(--mist); }
.record-list { width: min(720px, 100%); margin: 0 auto; display: grid; gap: 11px; }
.record-card { width: 100%; padding: 15px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 5px 18px rgba(16,42,50,.07); cursor: pointer; }
.record-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; font-weight: 900; }
.record-card-icon.good { background: var(--good); }.record-card-icon.concern { background: var(--concern); }.record-card-icon.danger { background: var(--danger); }.record-card-icon.idea { background: var(--idea); }
.record-card-copy { min-width: 0; }.record-card-note { margin: 0 0 7px; color: var(--ink); font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }.record-card-meta { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.empty-list { width: min(720px, 100%); margin: 30px auto; padding: 28px 16px; text-align: center; color: var(--muted); background: white; border-radius: 16px; }
.view-switch { position: absolute; z-index: 470; top: 62px; left: 50%; transform: translateX(-50%); display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.96); box-shadow: 0 5px 16px rgba(16,42,50,.13); }
.view-switch-button { min-width: 66px; min-height: 34px; padding: 5px 14px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 750; cursor: pointer; }.view-switch-button.active { color: white; background: var(--teal); }
.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-control-zoom { display: none; }
.map-overlay { position: absolute; z-index: 450; pointer-events: none; }
.top-overlay { top: 14px; left: 0; right: 0; padding: 0 12px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 3px 8px; scrollbar-width: none; pointer-events: auto; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 38px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(217,229,229,.95); border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 4px 14px rgba(16,42,50,.11); cursor: pointer; }
.filter-chip.active { color: white; border-color: var(--teal); background: var(--teal); }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.good { background: var(--good); }.dot.concern { background: var(--concern); }.dot.danger { background: var(--danger); }.dot.idea { background: var(--idea); }
.map-actions { position: absolute; z-index: 450; right: 16px; bottom: 142px; }
.map-action-button { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 7px 22px rgba(16,42,50,.17); cursor: pointer; }
.map-action-button svg { width: 24px; fill: none; stroke: var(--teal); stroke-width: 1.9; stroke-linecap: round; }
.map-action-button.locating svg { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.85); } }

.bottom-panel { position: absolute; z-index: 450; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 13px; background: rgba(255,255,255,.96); border: 1px solid rgba(217,229,229,.9); border-radius: 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.summary-row { padding: 0 4px 10px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .88rem; }
.summary-row strong { color: var(--ink); font-size: 1.12rem; }
.text-button { border: 0; background: transparent; color: var(--teal-2); font-weight: 700; cursor: pointer; }
.primary-button, .secondary-button { min-height: 50px; border-radius: 14px; font-weight: 750; cursor: pointer; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; color: white; background: var(--teal); box-shadow: 0 7px 17px rgba(22,78,99,.22); }
.primary-button:hover { background: #0f4052; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.secondary-button { padding: 0 18px; border: 1px solid var(--line); background: white; }
.full-width { width: 100%; }

.status-pill { position: absolute; z-index: 700; left: 50%; top: 76px; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 10px 14px; border-radius: 999px; color: white; background: rgba(16,42,50,.91); box-shadow: 0 6px 18px rgba(16,42,50,.2); font-size: .86rem; white-space: nowrap; }
.backdrop { position: fixed; z-index: 800; inset: 0; background: rgba(9,31,38,.44); backdrop-filter: blur(2px); }
.sheet { position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; padding: 10px 20px max(22px, env(safe-area-inset-bottom)); background: white; border-radius: 26px 26px 0 0; box-shadow: 0 -18px 55px rgba(16,42,50,.22); animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { transform: translateY(30px); opacity: .65; } }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 13px; border-radius: 99px; background: #cad8da; }
.sheet-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.sheet h2 { margin: 3px 0 0; font-size: 1.25rem; line-height: 1.4; }
.eyebrow { margin: 0; color: var(--teal-2); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
fieldset { margin: 0 0 20px; padding: 0; border: 0; }
legend, .field-label { display: block; margin: 0 0 9px; font-weight: 750; }
.field-label span { color: var(--danger); font-size: .77rem; }.field-label small { color: var(--muted); font-weight: 500; }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.category-option { position: relative; min-height: 56px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: .9rem; font-weight: 650; }
.category-option input { position: absolute; opacity: 0; }
.category-option:has(input:checked) { border-width: 2px; padding: 8px 9px; background: var(--mist); }
.good-option:has(input:checked) { border-color: var(--good); }.concern-option:has(input:checked) { border-color: var(--concern); }.danger-option:has(input:checked) { border-color: var(--danger); }.idea-option:has(input:checked) { border-color: var(--idea); }
.category-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: white; font-weight: 900; }
.good-option .category-icon { background: var(--good); }.concern-option .category-icon { background: var(--concern); }.danger-option .category-icon { background: var(--danger); }.idea-option .category-icon { background: var(--idea); }
textarea, input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fbfdfd; outline: none; }
textarea { padding: 13px 14px; resize: none; line-height: 1.55; }
input[type="text"] { height: 50px; padding: 0 14px; }
textarea:focus, input[type="text"]:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(14,116,144,.12); }
.field-meta { margin: 6px 2px 18px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .77rem; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 24px; }
.detail-note { margin: 4px 0 22px; font-size: 1.08rem; line-height: 1.7; white-space: pre-wrap; }
.detail-meta { margin: 0 0 22px; padding: 4px 14px; background: var(--mist); border-radius: 14px; }
.detail-meta div { padding: 11px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.detail-meta div:last-child { border-bottom: 0; }
.detail-meta dt { color: var(--muted); }.detail-meta dd { margin: 0; text-align: right; font-weight: 650; }
.help-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 18px; }
.help-list li { display: flex; gap: 13px; }
.help-list li > span { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--teal); font-weight: 800; }
.help-list strong { display: block; margin: 3px 0 4px; }.help-list p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }

.custom-marker { border: 0 !important; background: transparent !important; }
.marker-pin { width: 34px; height: 42px; position: relative; display: grid; place-items: center; color: white; filter: drop-shadow(0 5px 5px rgba(16,42,50,.28)); transform-origin: 50% 100%; transition: transform .15s ease; }
.marker-pin:hover { transform: translateY(-2px) scale(1.05); }
.marker-pin svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; }
.marker-pin span { position: relative; z-index: 1; margin-top: -7px; font-size: 14px; font-weight: 900; }
.marker-pin.good { color: var(--good); }.marker-pin.concern { color: var(--concern); }.marker-pin.danger { color: var(--danger); }.marker-pin.idea { color: var(--idea); }
.center-crosshair { position: absolute; z-index: 440; left: 50%; top: 50%; width: 36px; height: 44px; transform: translate(-50%,-100%); pointer-events: none; filter: drop-shadow(0 5px 5px rgba(16,42,50,.3)); }
.center-crosshair::before { content: ""; position: absolute; left: 3px; top: 1px; width: 30px; height: 30px; border: 3px solid white; border-radius: 50% 50% 50% 0; background: #e94f5f; transform: rotate(-45deg); box-shadow: 0 0 0 1px rgba(16,42,50,.18); }
.center-crosshair::after { content: ""; position: absolute; left: 14px; top: 10px; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: var(--teal); }
.center-crosshair-label { position: absolute; left: 50%; top: 48px; width: max-content; transform: translateX(-50%); padding: 5px 9px; border-radius: 999px; color: white; background: rgba(16,42,50,.86); box-shadow: 0 3px 10px rgba(16,42,50,.18); font-size: .68rem; font-weight: 750; white-space: nowrap; }

@media (min-width: 760px) {
  body { padding: 20px; background: #dceaea; }
  .app-shell { max-width: 1100px; margin: 0 auto; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 60px rgba(16,42,50,.2); }
  .home-page { max-width: 1100px; margin: 0 auto; padding-top: 54px; border-radius: 24px; box-shadow: 0 20px 60px rgba(16,42,50,.2); }
  .home-brand { margin-bottom: 42px; }
  .exploration-section { margin-top: 58px; }
  .topbar { padding: 12px 22px; }
  .bottom-panel { width: 360px; left: auto; right: 18px; bottom: 18px; }
  .map-actions { right: 395px; bottom: 18px; }
  .sheet { left: 50%; right: auto; bottom: 24px; width: min(520px, calc(100% - 40px)); max-height: calc(100vh - 48px); transform: translateX(-50%); border-radius: 26px; }
  @keyframes sheet-in { from { transform: translate(-50%, 30px); opacity: .65; } to { transform: translate(-50%,0); opacity: 1; } }
}

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
