:root {
  color-scheme: light;
  --ink: #12221e;
  --muted: #66736f;
  --line: #dce4e0;
  --paper: #ffffff;
  --mist: #f3f7f5;
  --forest: #12382f;
  --forest-2: #1f5a49;
  --lime: #d7ff84;
  --blue: #2463eb;
  --amber: #a96308;
  --shadow: 0 18px 50px rgba(18, 56, 47, 0.08);
  --radius: 24px;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7faf8 0, #fff 420px);
  font-size: 16px;
  line-height: 1.6;
}

button, input, select { font: inherit; }
button, select, summary, .button { cursor: pointer; }
a { color: inherit; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.region-home {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(260px, .55fr) minmax(650px, 1.45fr);
  gap: 34px;
  align-items: center;
  padding-block: 34px;
}
.region-home.shell { width: min(1320px, calc(100% - 40px)); }
.region-home-copy { max-width: 470px; }
.region-home-copy h1 { margin-bottom: 22px; font-size: clamp(2.3rem, 4.8vw, 4.1rem); word-break: keep-all; }
.region-home-copy > p:last-child { max-width: 420px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.region-map-card { position: relative; min-width: 0; height: clamp(500px, calc(100svh - 150px), 680px); min-height: 500px; overflow: hidden; border: 1px solid #cfdad5; border-radius: 32px; background: #dfe9e4; box-shadow: 0 28px 80px rgba(18, 56, 47, .16); }
#region-map { width: 100%; height: 100%; }
.region-map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--mist); color: var(--muted); text-align: center; }
.region-map-legend { position: absolute; left: 18px; bottom: 18px; z-index: 500; padding: 10px 13px; display: flex; flex-wrap: wrap; gap: 12px; border: 1px solid rgba(18,56,47,.14); border-radius: 13px; background: rgba(255,255,255,.94); color: var(--muted); box-shadow: 0 10px 30px rgba(18,56,47,.12); backdrop-filter: blur(12px); font-size: .75rem; }
.region-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.region-map-legend b { color: var(--ink); }
.legend-dot { width: 9px; height: 9px; border: 2px solid #93a39d; border-radius: 50%; background: white; }
.legend-dot--active { border-color: var(--forest); background: var(--lime); }
.region-choice { min-height: 86px; padding: 16px 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid rgba(18,56,47,.14); border-radius: 18px; background: rgba(255,255,255,.94); color: var(--ink); text-align: left; box-shadow: 0 10px 30px rgba(18,56,47,.12); backdrop-filter: blur(12px); transition: transform .2s ease, box-shadow .2s ease; }
.region-choice:hover, .region-choice:focus-visible { outline: 3px solid rgba(215,255,132,.9); outline-offset: 2px; transform: translateY(-3px); box-shadow: 0 15px 36px rgba(18,56,47,.18); }
.region-choice--featured { border-color: var(--forest); background: var(--forest); color: white; }
.region-choice--empty { opacity: .82; }
.region-choice-name { font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.region-choice-full { color: var(--muted); font-size: .72rem; }
.region-choice-count { color: var(--muted); font-size: .78rem; }
.region-choice--featured .region-choice-full,
.region-choice--featured .region-choice-count { color: #c4d5cf; }
.region-map-marker-wrap { background: transparent; border: 0; }
.region-map-marker { width: 62px; min-height: 28px; padding: 3px 5px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1.5px solid white; border-radius: 9px; font-size: .59rem; font-weight: 900; line-height: 1; white-space: nowrap; box-shadow: 0 5px 14px rgba(18,56,47,.22); transition: transform .2s ease; }
.region-map-marker-name { display: block; }
.region-map-marker-count { display: block; font-size: .5rem; font-weight: 800; letter-spacing: -.03em; opacity: .78; }
.region-map-marker:hover { transform: translateY(-3px) scale(1.04); }
.region-map-marker--active { background: var(--forest); color: var(--lime); }
.region-map-marker--pending { border-color: #dce4e0; background: rgba(255,255,255,.94); color: #52645e; }

.region-directory { padding-block: 12px 72px; }
.region-directory-heading { margin-bottom: 18px; }
.region-directory-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.region-choice--directory { min-height: 112px; box-shadow: none; backdrop-filter: none; }
.region-choice--directory:hover,
.region-choice--directory:focus-visible { transform: translateY(-2px); }
.region-choice--directory.region-choice--empty { border-style: dashed; background: #fbfcfb; }

.results-intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: end; padding-block: 48px 36px; }
.results-intro h1 { margin-bottom: 12px; }
.back-button { margin-bottom: 24px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--forest-2); font-size: .82rem; font-weight: 850; }
.back-button:hover, .back-button:focus-visible { border-color: var(--forest-2); outline: 0; }

.site-header {
  height: 72px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(18, 56, 47, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 800; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--forest); color: var(--lime); font-size: .9rem; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.primary-menu { padding: 3px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.header-nav-button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 850; }
.header-nav-button.is-active { background: var(--forest); color: var(--lime); }
.header-nav-button:hover, .header-nav-button:focus-visible { outline: 3px solid rgba(215,255,132,.65); outline-offset: 2px; }
.header-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #18a36b; box-shadow: 0 0 0 5px #e4f8ef; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: end; padding-block: 72px 50px; }
.eyebrow { margin: 0 0 8px; color: var(--forest-2); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(2.4rem, 5.3vw, 4.5rem); line-height: 1.08; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.25; letter-spacing: -.03em; }
.intro-copy { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

.summary-card { background: var(--forest); color: white; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.summary-card > p { margin-bottom: 5px; color: #b9ccc6; font-size: .85rem; }
.summary-card > strong { display: block; font-size: 2.5rem; line-height: 1.15; letter-spacing: -.04em; }
.summary-card > span { color: #b9ccc6; font-size: .88rem; }
.summary-divider { height: 1px; margin: 20px 0 14px; background: rgba(255,255,255,.13); }
.summary-row { display: flex; justify-content: space-between; gap: 16px; color: #c8d8d3; font-size: .9rem; }
.summary-row + .summary-row { margin-top: 8px; }
.summary-row b { color: var(--lime); }

.parliament-entry { margin-bottom: 26px; padding: 26px 28px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 24px; border-radius: 24px; background: var(--forest); color: white; box-shadow: var(--shadow); }
.parliament-entry .eyebrow { color: var(--lime); }
.parliament-entry h2 { margin-bottom: 6px; }
.parliament-entry p:last-child { margin-bottom: 0; color: #c4d5cf; font-size: .9rem; }
.parliament-entry-stats { display: flex; gap: 22px; }
.parliament-entry-stats span { color: #c4d5cf; font-size: .78rem; white-space: nowrap; }
.parliament-entry-stats b { display: block; color: white; font-size: 1.15rem; }
.button.parliament-button { border-color: var(--lime); background: var(--lime); color: var(--forest); white-space: nowrap; }

.parliament-region-home { padding-bottom: 42px; }
.parliament-map-copy > p { max-width: 430px; color: var(--muted); font-size: 1.03rem; }
.parliament-map-stats { margin: 26px 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.parliament-map-stats span { padding: 12px 11px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.parliament-map-stats b { display: block; color: var(--forest); font-size: 1.05rem; }
#parliament-region-map { width: 100%; height: 100%; }
.parliament-region-map-card .region-map-marker--active { background: #46341f; color: #ffe4a3; }

.parliament-intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: end; padding-block: 54px 36px; }
.parliament-intro h1 { margin-bottom: 14px; }
.parliament-explorer { padding-bottom: 24px; }
.parliament-notice { margin-bottom: 18px; padding: 14px 18px; display: flex; gap: 12px 22px; border: 1px solid #cfe0d8; border-radius: 15px; background: #f2f8f5; color: var(--muted); font-size: .85rem; }
.parliament-notice strong { flex: 0 0 auto; color: var(--forest-2); }
.parliament-toolbar { grid-template-columns: minmax(250px, 1.3fr) repeat(4, minmax(130px, .5fr)); }
.parliament-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.parliament-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.parliament-card { min-width: 0; padding: 20px 22px; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; color: inherit; text-align: left; }
.parliament-card:nth-child(even) { border-right: 0; }
.parliament-card:hover, .parliament-card:focus-visible { outline: 0; background: #f6faf8; }
.parliament-card--premium { background: linear-gradient(145deg, #fffdf5, #fff); }
.parliament-card--premium:hover, .parliament-card--premium:focus-visible { background: #fff9e8; }
.parliament-card .rank { width: 36px; height: 36px; }
.parliament-card-name { display: block; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.08rem; font-weight: 900; }
.parliament-card-address { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .76rem; }
.parliament-card-members { margin-top: 9px; color: var(--forest-2); font-size: .82rem; font-weight: 750; }
.parliament-card-stats { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.parliament-card-note { margin-top: 7px; color: var(--muted); font-size: .72rem; }
.stat-chip--premium { background: #fff0bf; color: #7e4b00; }
.stat-chip--fallback { background: #e7f0ff; color: #315c8c; }
.source-grid--parliament { grid-template-columns: repeat(2, minmax(0,1fr)); }
.source-grid--parliament .source-card { min-height: 150px; }
.member-row-meta { margin-top: 3px; color: var(--muted); font-size: .78rem; }

.explorer { padding-bottom: 68px; }
.toolbar { display: grid; grid-template-columns: minmax(270px, 1.4fr) minmax(150px, .5fr) minmax(180px, .6fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.search-box, .select-wrap { min-height: 54px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.search-box { display: flex; align-items: center; gap: 10px; padding-inline: 16px; }
.search-box svg { width: 21px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: #87918e; }
.select-wrap { position: relative; padding: 6px 13px; }
.select-wrap span { display: block; color: var(--muted); font-size: .7rem; line-height: 1.2; }
.select-wrap select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 700; }
.confidence-toggle { min-height: 54px; padding: 0 10px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .87rem; white-space: nowrap; }
.confidence-toggle input { width: 18px; height: 18px; accent-color: var(--forest); }

.explorer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(350px, .8fr); gap: 18px; }
.map-panel, .ranking-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-head { min-height: 88px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head .eyebrow { margin-bottom: 3px; }
.count-pill { padding: 5px 10px; border-radius: 999px; background: var(--mist); color: var(--forest-2); font-size: .8rem; font-weight: 800; }
#sort-order { max-width: 145px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: white; color: var(--ink); font-size: .82rem; }
#map { height: 548px; background: #dfe9e4; }
.map-note { margin: 0; padding: 11px 18px 14px; color: var(--muted); font-size: .78rem; }
.map-fallback { height: 548px; display: grid; place-content: center; gap: 4px; text-align: center; background: var(--mist); color: var(--muted); }
.map-fallback strong { color: var(--ink); }

.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper { border-radius: 15px; box-shadow: 0 16px 35px rgba(18,56,47,.16); }
.leaflet-popup-content { margin: 14px 16px; }
.map-popup strong { display: block; font-size: 1rem; }
.map-popup span { color: var(--muted); font-size: .8rem; }
.map-popup button { display: inline-block; margin-top: 8px; border: 0; padding: 0; background: transparent; color: var(--forest-2); font-weight: 800; }
.custom-marker { width: 34px !important; height: 34px !important; margin-left: -17px !important; margin-top: -17px !important; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--forest); color: var(--lime); box-shadow: 0 7px 18px rgba(18,56,47,.3); }
.custom-marker span { transform: rotate(45deg); font-size: .72rem; font-weight: 900; }
.custom-marker--approx { border-style: dashed; background: #355f53; }

.restaurant-list { height: 578px; overflow: auto; border-top: 1px solid var(--line); }
.list-footer { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.button.compact { min-height: 36px; padding: 8px 13px; font-size: .82rem; }
.source-card--primary { border-color: #9fc9b8; background: linear-gradient(145deg, #f4fbf7, #fff); }
.source-card--empty { grid-column: 1 / -1; min-height: 140px; justify-content: center; border-style: dashed; box-shadow: none; }
.restaurant-card { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: white; color: inherit; text-align: left; transition: background .2s ease; }
.restaurant-card:hover, .restaurant-card:focus-visible { outline: 0; background: #f6faf8; }
.rank { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--mist); color: var(--forest-2); font-weight: 900; }
.restaurant-card:first-child .rank { background: var(--lime); color: var(--forest); }
.restaurant-card--source { background: #fbfcfb; }
.rank--source { background: #edf2ef !important; color: #557066 !important; font-size: .7rem; }
.source-status { align-self: center; color: #60766d; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.restaurant-name { display: block; margin-bottom: 3px; font-size: 1rem; font-weight: 850; }
.restaurant-meta { color: var(--muted); font-size: .78rem; }
.restaurant-stats { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.stat-chip { padding: 3px 7px; border-radius: 7px; background: var(--mist); color: var(--forest-2); font-size: .72rem; font-weight: 700; }
.score { min-width: 48px; text-align: right; }
.score strong { display: block; color: var(--forest-2); font-size: 1.2rem; line-height: 1.1; }
.score span { color: var(--muted); font-size: .68rem; }
.empty-state { min-height: 240px; display: grid; place-content: center; gap: 3px; padding: 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); }

.sources { padding: 56px 0 72px; }
.section-heading { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading > p { max-width: 360px; margin-bottom: 0; color: var(--muted); font-size: .9rem; text-align: right; }
.source-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.source-card { min-height: 168px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 18px; background: white; text-decoration: none; transition: transform .2s, border-color .2s; }
.source-card:hover { transform: translateY(-3px); border-color: #9ebbb2; }
.source-card strong { display: block; margin-bottom: 5px; }
.source-card p { margin-bottom: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.source-link { color: var(--forest-2); font-size: .75rem; font-weight: 850; }

.admin-section { padding-bottom: 72px; }
.admin-section details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.admin-section summary { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.admin-section summary::-webkit-details-marker { display: none; }
.admin-section summary strong { display: block; font-size: 1.1rem; }
.admin-section summary .eyebrow { margin-bottom: 0; }
.summary-action { color: var(--forest-2); font-size: .85rem; font-weight: 800; }
details[open] .summary-action { font-size: 0; }
details[open] .summary-action::after { content: "닫기"; font-size: .85rem; }
.admin-card { padding: 28px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px 36px; border-top: 1px solid var(--line); }
.admin-card h2 { margin-bottom: 8px; font-size: 1.65rem; }
.admin-card p { margin-bottom: 0; color: var(--muted); }
.admin-actions { align-self: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.button { min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 14px; font-weight: 850; text-decoration: none; }
.button.secondary { background: white; color: var(--ink); }
.button.primary { border-color: var(--blue); background: var(--blue); color: white; }
.button:hover { filter: brightness(.98); transform: translateY(-1px); }
.upload-result { grid-column: 1 / -1; min-height: 48px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; border-radius: 13px; background: var(--mist); color: var(--muted); font-size: .85rem; }
.upload-result.success { background: #e7f8ef; color: #11663f; }
.upload-result.error { background: #fff1ec; color: #a13e21; }
.result-icon { width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 900; }

.site-footer { padding: 25px 0 38px; display: flex; justify-content: space-between; gap: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.site-footer p { margin-bottom: 0; }

.restaurant-dialog { width: min(680px, calc(100% - 28px)); max-height: min(780px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 30px 90px rgba(18,56,47,.26); }
.restaurant-dialog::backdrop { background: rgba(12,28,23,.55); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; top: 16px; float: right; margin: 16px 16px 0 0; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 1.4rem; line-height: 1; z-index: 1; }
.detail-wrap { padding: 34px; }
.detail-kicker { color: var(--forest-2); font-size: .8rem; font-weight: 850; }
.detail-title { margin: 3px 0 6px; font-size: 2rem; letter-spacing: -.04em; }
.detail-address { color: var(--muted); font-size: .88rem; }
.detail-metrics { margin: 24px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.detail-metrics--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-metric { padding: 15px; border-radius: 15px; background: var(--mist); }
.detail-metric span { display: block; color: var(--muted); font-size: .72rem; }
.detail-metric strong { font-size: 1.15rem; }
.confidence-line { margin-bottom: 24px; padding: 12px 14px; border-radius: 12px; background: #f6f8f7; color: var(--muted); font-size: .8rem; }
.confidence-line b { color: var(--forest-2); }
.record-list { border-top: 1px solid var(--line); }
.record-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.record-top { display: flex; justify-content: space-between; gap: 16px; }
.record-row strong { font-size: .9rem; }
.record-row time { color: var(--muted); font-size: .78rem; }
.record-row p { margin: 5px 0 7px; color: var(--muted); font-size: .82rem; }
.record-row a { color: var(--forest-2); font-size: .76rem; font-weight: 800; }
.record-row--summary { padding-block: 18px; }
.record-row--summary .record-top { align-items: center; }
.record-row--summary strong { font-size: 1rem; }
.agency-visit-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--lime); color: var(--forest); font-size: .8rem; font-weight: 900; }
.agency-more { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.agency-more summary { padding: 13px 15px; list-style: none; color: var(--forest-2); font-size: .85rem; font-weight: 850; cursor: pointer; }
.agency-more summary::-webkit-details-marker { display: none; }
.agency-more[open] summary { border-bottom: 1px solid var(--line); }
.agency-more .record-list { padding-inline: 15px; border-top: 0; }
.detail-source-link { display: inline-flex; margin-top: 16px; color: var(--forest-2); font-size: .82rem; font-weight: 850; }
.detail-map-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-map-link { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--mist); color: var(--forest-2); font-size: .8rem; font-weight: 850; text-decoration: none; }
.detail-tags { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.detail-geocode-status { margin: 10px 0 0; color: var(--muted); font-size: .76rem; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 980px) {
  .region-home { grid-template-columns: minmax(220px, .52fr) minmax(500px, 1.48fr); gap: 24px; }
  .region-map-card { min-height: 580px; }
  .results-intro { grid-template-columns: 1fr 260px; gap: 34px; }
  .intro { grid-template-columns: 1fr 260px; gap: 34px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .explorer-grid { grid-template-columns: 1fr; }
  #map { height: 440px; }
  .restaurant-list { height: auto; max-height: 620px; }
  .source-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .region-directory-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .parliament-entry { grid-template-columns: 1fr auto; }
  .parliament-entry-stats { grid-column: 1; }
  .parliament-button { grid-column: 2; grid-row: 1 / span 2; }
  .parliament-intro { grid-template-columns: 1fr 260px; gap: 34px; }
  .parliament-toolbar { grid-template-columns: 1fr 1fr; }
  .parliament-toolbar .search-box { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { height: 62px; padding-inline: 14px; }
  .header-meta { font-size: .74rem; }
  .header-actions { gap: 8px; }
  .header-nav-button { min-height: 34px; padding-inline: 11px; font-size: .75rem; }
  .header-meta { display: none; }
  .region-home { min-height: auto; grid-template-columns: 1fr; gap: 26px; padding-block: 38px 30px; }
  .region-home-copy h1 { font-size: clamp(2.15rem, 10.5vw, 3.05rem); }
  .region-map-card { height: min(54svh, 480px); min-height: 430px; border-radius: 24px; }
  .region-map-legend { left: 10px; bottom: 10px; }
  .region-choice { min-height: 78px; padding: 13px; border-radius: 15px; }
  .region-choice-name { font-size: 1.1rem; }
  .region-choice-count { font-size: .7rem; line-height: 1.35; }
  .region-map-marker { width: 56px; min-height: 26px; padding-inline: 4px; font-size: .55rem; }
  .region-map-marker-count { font-size: .46rem; }
  .region-directory { padding-block: 8px 48px; }
  .region-directory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .region-choice--directory { min-height: 100px; }
  .results-intro { grid-template-columns: 1fr; gap: 24px; padding-block: 34px 26px; }
  .results-intro h1 { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .parliament-entry { margin-bottom: 18px; padding: 22px 18px; grid-template-columns: 1fr; gap: 17px; }
  .parliament-entry-stats { grid-column: auto; flex-wrap: wrap; gap: 10px 24px; }
  .parliament-button { grid-column: auto; grid-row: auto; width: 100%; }
  .parliament-intro { grid-template-columns: 1fr; gap: 24px; padding-block: 34px 26px; }
  .parliament-intro h1 { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .parliament-region-home { padding-bottom: 28px; }
  .parliament-map-stats { margin-block: 20px 16px; }
  .parliament-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
  .parliament-toolbar { grid-template-columns: 1fr; }
  .parliament-toolbar .search-box { grid-column: auto; }
  .parliament-list { grid-template-columns: 1fr; }
  .parliament-card { border-right: 0; padding: 17px 16px; }
  .source-grid--parliament { grid-template-columns: 1fr; }
  .back-button { margin-bottom: 18px; }
  .intro { grid-template-columns: 1fr; padding-block: 48px 34px; }
  h1 { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .summary-card { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
  .summary-card > p, .summary-card > strong, .summary-card > span { grid-column: 1 / -1; }
  .summary-divider { display: none; }
  .summary-row { margin-top: 15px !important; display: block; }
  .summary-row b { display: block; }
  .toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .ranking-panel { order: -1; }
  .confidence-toggle { padding-left: 3px; }
  .panel-head { min-height: 78px; padding: 16px; }
  #map { height: 370px; }
  .restaurant-card { grid-template-columns: 34px minmax(0,1fr); padding: 16px; }
  .score { grid-column: 2; text-align: left; display: flex; align-items: baseline; gap: 6px; }
  .source-status { grid-column: 2; justify-self: start; }
  .score strong { font-size: 1rem; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card { min-height: 138px; }
  .admin-card { grid-template-columns: 1fr; padding: 22px 18px; }
  .admin-actions { justify-content: stretch; }
  .admin-actions .button { flex: 1 1 130px; }
  .upload-result { grid-column: auto; align-items: flex-start; }
  .site-footer { flex-direction: column; gap: 7px; }
  .detail-wrap { padding: 26px 20px; }
  .detail-title { font-size: 1.7rem; }
  .detail-metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 520px) {
  .brand > span:last-child { display: none; }
  .header-nav-button { padding-inline: 10px; font-size: .72rem; }
  .region-home-copy h1 { font-size: clamp(2.05rem, 10vw, 2.8rem); }
  .region-map-card { height: 440px; min-height: 400px; }
}
