:root {
  color-scheme: light;
  --ink: #172d27;
  --muted: #53675e;
  --line: #dbe6de;
  --background: #f3f7f4;
  --paper: #fff;
  --green: #185747;
  --green-dark: #103f32;
  --green-soft: #e4f1e8;
  --orange: #a44d24;
  --orange-soft: #faf0e5;
  --red: #9c302b;
  --radius: 16px;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, figure { margin: 0; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #518d66; outline-offset: 3px; }
::selection { background: #c9e9d3; }
.skip { position: absolute; top: -5rem; left: 1rem; z-index: 1100; padding: 8px 12px; background: var(--paper); }
.skip:focus { top: 1rem; }

.shell { width: min(100% - 64px, 1360px); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner, .nav, .actions, .card-meta, .card-bottom, .section-heading, .regions { display: flex; align-items: center; }
.topbar-inner { min-height: 68px; gap: 48px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.35rem; font-weight: 760; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--green-dark); color: #fff; font-size: 1rem; letter-spacing: 0; }
.nav { gap: 26px; align-self: stretch; }
.nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: .91rem; font-weight: 650; text-decoration: none; padding-inline: 2px; }
.nav a[aria-current], .nav a:hover { color: var(--green-dark); border-bottom-color: var(--green); }
.logout { margin-left: auto; }

main { padding-block: 32px 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin-top: 2px; font-size: clamp(1.85rem, 3vw, 2.8rem); line-height: 1.2; font-weight: 770; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.23rem; line-height: 1.35; font-weight: 720; }
h3 { font-size: 1.08rem; line-height: 1.4; }
.overline, .back { color: var(--muted); font-size: .88rem; font-weight: 650; }
.overline { letter-spacing: .09em; }
.back { display: inline-block; margin-bottom: 8px; }
.lead { color: var(--muted); }
.meta { color: var(--muted); font-size: .86rem; }
.break, .preserve { overflow-wrap: anywhere; }
.preserve { white-space: pre-wrap; }
.narrow { width: min(100%, 880px); margin-inline: auto; }
.panel { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); }
.stack { display: grid; gap: 16px; align-content: start; }
.compact { gap: 12px; }
.actions { flex-wrap: wrap; gap: 10px; }

.quiet, .button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; line-height: 1.35; font-size: .9rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.button { min-height: 42px; padding: 8px 15px; }
.quiet { color: var(--green); background: transparent; padding: 4px 7px; }
.quiet:hover, .quiet:focus-visible { background: var(--green-soft); }
.quiet.danger { color: var(--red); }
.primary, .primary:hover { color: #fff; }
.primary { background: var(--green); }
.primary:hover, .primary:focus-visible { background: var(--green-dark); }
.secondary { background: #fff; border-color: #cdded4; color: var(--green); }
.secondary:hover { background: #edf6ef; border-color: #92b6a4; }
.text-link { font-size: .89rem; font-weight: 650; }
.regions { gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.regions a { border-radius: 8px; padding: 8px 15px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: .94rem; }
.regions a:hover { background: #e8f1ea; color: var(--green-dark); }
.regions a[aria-current] { background: var(--green-soft); color: var(--green-dark); }
.regions .add-region { margin-left: auto; color: var(--green); text-decoration: underline; }

label { display: grid; align-content: start; gap: 6px; font-size: .87rem; font-weight: 650; min-width: 0; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; min-height: 42px; color: var(--ink); background: #fff;
  border: 1px solid #bdcec3; border-radius: 8px; padding: 8px 10px; font-size: .95rem; font-weight: 450;
}
input::placeholder, textarea::placeholder { color: #64786d; opacity: 1; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 26px; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-size: 5px 5px;
  background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px); background-repeat: no-repeat; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { color: var(--ink); font-weight: 720; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.filters { padding: 16px 18px; margin-bottom: 22px; }
.filter-grid { display: grid; grid-template-columns: minmax(11rem, 1.5fr) minmax(6.5rem, .8fr) minmax(6.5rem, .8fr) minmax(10rem, 1fr) minmax(9rem, 1fr) minmax(7rem, .75fr); gap: 12px; align-items: end; }
.filter-bottom { margin-top: 12px; display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.tag-filter legend { font-size: .85rem; margin-bottom: 5px; }
.tags { display: flex; align-items: flex-start; gap: 5px; flex-wrap: wrap; }
.tag, .tag-option { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 8px; color: var(--green-dark); background: #eef5ef; border: 1px solid #e2ede4; border-radius: 6px; line-height: 1.4; font-size: .84rem; text-decoration: none; overflow-wrap: anywhere; }
.tag:hover { background: var(--green-soft); }
.tag-option { cursor: pointer; }
.tag-option:has(input:checked) { background: #d7efdf; border-color: #93bc9e; }
.tag-option input { margin: 0; accent-color: var(--green); }
.tag-origin { font-size: .72rem; font-weight: 700; }
.tag-ai, .tag-option.tag-ai:has(input:checked) { color: #3c3977; background: #edf0ff; border-color: #c8cef0; }
a.tag-ai:hover { background: #e0e5fc; }
.tag-ai input { accent-color: #535399; }
.tag-legacy, .tag-option.tag-legacy:has(input:checked) { color: #4b5553; background: #f0f2f2; border-color: #dce1e0; }
a.tag-legacy:hover { background: #e5e9e8; }
.tag-legacy input { accent-color: #596460; }
.tag-candidates { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.tag-candidates li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag-filter > .text-link { display: inline-block; margin-top: 5px; }

.catalogue, .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 22px; align-items: start; }
.detail-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.section-heading { justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.count { color: var(--muted); font-size: .86rem; font-weight: 550; margin-left: 5px; }
.place-list { display: grid; gap: 8px; }
.place-card { display: flex; align-items: stretch; padding: 13px 15px; gap: 14px; transition: border-color .15s ease; }
.place-card.is-selected, .place-card:focus-within { border-color: #629a77; }
.place-card .thumb { width: 104px; align-self: center; flex: none; }
.thumb img { display: block; object-fit: cover; border-radius: 10px; }
.card-body { min-width: 0; flex: 1; }
.card-meta { gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.kind { display: inline-flex; border-radius: 5px; background: var(--green-soft); color: var(--green-dark); padding: 2px 7px; font-size: .82rem; font-weight: 720; }
.place-card h3 { margin-block: 5px 3px; overflow-wrap: anywhere; }
.place-card h3 a { color: var(--ink); text-decoration: none; }
.place-card h3 a:hover { text-decoration: underline; }
.address { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.card-rating { margin-top: 4px; }
.card-body .tags { margin-top: 7px; }
.card-bottom { gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-top: 7px; min-height: 28px; }
.pin-button { min-height: 28px; }
.status { color: var(--green-dark); font-size: .86rem; font-weight: 650; }
.status-closed, .status-outside { color: var(--muted); }
.status-unknown { color: var(--orange); }
.status-open { color: var(--green); }
.status span { color: var(--muted); font-size: .82rem; font-weight: 500; }
.empty { min-height: 155px; display: grid; place-content: center; padding: 23px 17px; text-align: center; gap: 8px; }
.empty p { color: var(--muted); }
.map-column { position: sticky; top: 18px; }
.map-panel { position: relative; overflow: hidden; }
.map-canvas { height: min(535px, 65vh); min-height: 310px; background: #e8efe7; border-radius: inherit; font-family: inherit; }
.map-small .map-canvas { height: 250px; min-height: 180px; }
.map-small { border: 1px solid var(--line); border-radius: 11px; }
.map-message { padding: 8px 12px; border-top: 1px solid var(--line); }
.map-cover { display: inline-block; border-radius: 50%; background: var(--green); border: 2px solid white; box-shadow: 0 1px 5px #17372f65; }
.map-cover-sight { background: #33688d; }
.map-cover-lodging { background: #9b542d; }
.map-cover-other { background: #52675e; }
.map-logo { display: block; width: 84px; height: auto; margin: 0 6px 5px; }
.leaflet-popup-content { font-family: inherit; margin: 10px 14px !important; }
.popup-name { display: block; font-weight: 740; }

.form-panel, .detail-panel, .message-panel { padding: 21px 23px; }
.form-panel:not(form) > .stack, .form-panel details { margin-top: 10px; }
.error { background: #fff1ed; color: #852c28; border: 1px solid #edccc3; border-radius: 8px; padding: 9px 12px; }
.geo-fields { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.geo-fields legend { padding-right: 9px; }
.detail-address, .map-links, .detail-panel > .tags, .detail-panel > .meta, .detail-panel > .preserve { margin-top: 8px; }
.detail-panel .map-small { margin-top: 12px; }
.small-heading { margin-block: 16px 6px; font-size: 1rem; }
.detail-entry, .exception, .history-entry { padding-block: 11px; border-bottom: 1px solid #e7efe9; }
.detail-entry > * + * { margin-top: 5px; }
.detail-entry h3, .history-entry h2, .candidate h3 { overflow-wrap: anywhere; }
.history-entry, .exception, .import-source { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.candidate > * + *, .exception p, .history-entry p { margin-top: 6px; }
.candidate-cover img { display: block; max-width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 10px; }
.history-entry:first-child { padding-top: 0; }
.history-entry:last-child { border-bottom: 0; padding-bottom: 0; }
.history-entry h2 { font-size: 1.02rem; }
.history-entry .tag { flex: none; }
.browser-queue-entry > div:first-child { min-width: 0; }
.browser-queue-entry .actions { flex-shrink: 0; }
.editor, .inline-details { margin-top: 12px; }
summary { color: var(--green); font-weight: 700; cursor: pointer; }
.inline-details summary { font-size: .85rem; }
details[open] > summary { margin-bottom: 10px; }
.editor form, .inline-details form { background: #f7faf7; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.photos figure { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.photos img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.photos figcaption { display: grid; gap: 4px; padding: 8px 10px; font-size: .88rem; }
.photos figcaption form .quiet { min-height: 26px; }
.file-field { border: 1px dashed #a9c0af; border-radius: 8px; background: #fff; padding: 8px 10px; }
.file-field .meta { margin-top: 5px; }
.embed-frame { display: block; width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hours-today { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: #eaf5ed; font-size: .88rem; }
.hours-today strong { display: block; color: var(--green-dark); }
.rating-overview, .rating-stars { display: grid; gap: 8px; margin: 0; }
.rating-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rating-overview > div, .rating-stars > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rating-overview dt, .rating-stars dt { color: var(--muted); font-size: .86rem; }
.rating-overview dd, .rating-stars dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.rating-overview strong { color: var(--green-dark); font-size: 1.3rem; }
.rating-stars { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); margin-top: 8px; font-size: .88rem; }
.rating-origin { margin-top: 10px; }
.rating-form-stars legend { margin-bottom: 6px; }
.rating-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.hours-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours-table caption { text-align: left; margin: 13px 0 4px; font-weight: 700; }
.hours-table th, .hours-table td { padding: 7px 6px; border-bottom: 1px solid #e8efe9; text-align: left; vertical-align: top; }
.hours-table th { width: 4rem; white-space: nowrap; }
.hours-table td .meta, .exception .meta { display: block; }
.rule-fields { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rule-fields legend { font-size: .88rem; padding: 0 4px; }
.login-panel { width: min(100%, 430px); padding: 24px; margin: min(12vh, 95px) auto 0; display: grid; gap: 18px; }
.login-heading h1 { font-size: 1.55rem; }
.login-heading p, .message-panel p { color: var(--muted); margin-block: 6px 12px; }
.message-panel h1 { font-size: 1.43rem; }
pre, .code, code { font-family: "Cascadia Code", "Consolas", monospace; }
pre { overflow: auto; background: #f2f6f3; border-radius: 7px; padding: 10px; margin: 0; font-size: .9rem; }

@media (max-width: 1080px) {
  .shell { width: min(100% - 40px, 1360px); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalogue, .detail-grid { gap: 15px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { gap: 15px; min-height: 59px; }
  .nav { gap: 10px; }
  .nav a, .quiet { font-size: .83rem; }
  main { padding-block: 21px 38px; }
  .page-heading { flex-wrap: wrap; align-items: start; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue, .detail-grid { grid-template-columns: 1fr; }
  .map-column { position: static; }
  .place-card .thumb { width: 78px; }
  .thumb img { width: 78px; height: 78px; }
  .form-panel, .detail-panel { padding: 15px; }
}
@media (max-width: 520px) {
  .topbar-inner { flex-wrap: wrap; gap: 0 15px; padding-top: 8px; }
  .nav { order: 1; flex-basis: 100%; min-height: 36px; flex-wrap: wrap; }
  .browser-queue-entry { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
