:root {
  --forest-950: #0b2823;
  --forest-900: #103a31;
  --forest-800: #185044;
  --forest-700: #246657;
  --forest-100: #e3efea;
  --gold-600: #a57a2d;
  --gold-400: #d1ae69;
  --ink: #17241f;
  --muted: #65736d;
  --line: #dce4df;
  --surface: #ffffff;
  --canvas: #f3f6f3;
  --exact: #23826c;
  --review: #c3862d;
  --unmatched: #b64f4b;
  --blue: #467f98;
  --shadow: 0 12px 35px rgba(15, 48, 40, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(193, 146, 54, .48); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-size: 29px; margin-bottom: 0; }
h2 { font-size: 27px; margin-bottom: 0; }
h3 { font-size: 17px; margin-bottom: 0; }
label { display: block; color: #405048; font-size: 12px; font-weight: 700; margin: 14px 0 6px; }
input, select { width: 100%; min-height: 43px; border: 1px solid #cfdad3; border-radius: 9px; background: #fff; color: var(--ink); padding: 10px 12px; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(36, 102, 87, .1); outline: none; }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--forest-700); font-size: 10px; font-weight: 800; letter-spacing: .16em; margin-bottom: 6px; }
.eyebrow--light { color: #bcd6ca; }
.text-review { color: var(--review); font-weight: 700; }
.text-unmatched { color: var(--unmatched); font-weight: 700; }
.field-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; margin: 9px 0; }

.loading-bar { position: fixed; z-index: 5000; left: 0; top: 0; width: 38%; height: 3px; background: var(--gold-400); box-shadow: 0 0 14px var(--gold-400); animation: loading 1.1s ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(360%); } }

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 43px; height: 43px; flex: 0 0 auto; }
.official-logo { width: 210px; height: 82px; flex: 0 0 auto; object-fit: contain; object-position: left center; background: #fff; border-radius: 7px; padding: 5px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .07em; }
.brand span { display: block; font-size: 11px; margin-top: 2px; opacity: .72; }
.brand--light { color: #eef7f1; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.18fr) minmax(400px, .82fr); }
.login-story { position: relative; overflow: hidden; padding: 48px 58px; display: flex; flex-direction: column; background: var(--forest-950); color: #eef7f1; }
.login-story::before { content: ""; position: absolute; inset: 0; opacity: .2; background-image: radial-gradient(circle at 85% 20%, transparent 0 100px, #93b7a3 101px 102px, transparent 103px 160px, #93b7a3 161px 162px, transparent 163px), linear-gradient(125deg, transparent 60%, rgba(126, 166, 146, .18)); }
.login-story::after { content: ""; position: absolute; width: 480px; height: 480px; border: 1px solid rgba(181, 208, 192, .13); border-radius: 50%; right: -170px; bottom: -160px; box-shadow: 0 0 0 70px rgba(181, 208, 192, .035), 0 0 0 140px rgba(181, 208, 192, .025); }
.login-story > * { position: relative; z-index: 1; }
.story-copy { max-width: 650px; margin: auto 0; padding: 70px 0; }
.story-copy h1 { font-size: clamp(42px, 5vw, 70px); line-height: 1.04; font-weight: 560; letter-spacing: -.05em; margin: 15px 0 25px; }
.story-copy h1 em { display: block; color: var(--gold-400); font-family: Georgia, serif; font-weight: 400; }
.story-copy p { max-width: 550px; color: #bdd0c5; font-size: 16px; line-height: 1.8; }
.story-facts { display: flex; flex-wrap: wrap; gap: 24px; padding: 22px 0; border-top: 1px solid rgba(207, 229, 215, .16); }
.story-facts span { color: var(--gold-400); font-size: 11px; letter-spacing: .08em; }
.story-facts b { display: block; color: #d8e6dd; font-size: 12px; letter-spacing: 0; margin-top: 5px; }
.story-credit { color: #92aa9c; font-size: 11px; margin: 10px 0 0; }
.login-panel { display: grid; place-items: center; padding: 42px; background: #f7f8f5; }
.login-card { width: min(100%, 430px); }
.login-card h2 { font-size: 34px; margin: 22px 0 8px; }
.login-card > .muted { margin-bottom: 26px; }
.login-notice { background: #edf2ed; border-left: 3px solid #9caf9f; color: #56655c; padding: 12px 14px; border-radius: 4px 8px 8px 4px; font-size: 11px; line-height: 1.6; margin-top: 24px; }
.form-message { border-radius: 9px; padding: 11px 13px; margin: 12px 0; font-size: 12px; background: #e5f2eb; color: #245d46; border: 1px solid #c7e2d3; }
.form-message.is-error { background: #f9ece9; color: #873d38; border-color: #eccdca; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; border-radius: 9px; border: 1px solid transparent; padding: 9px 16px; font-size: 12px; font-weight: 750; text-decoration: none; transition: transform .15s, background .15s, border-color .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--forest-800); border-color: var(--forest-800); box-shadow: 0 6px 14px rgba(24, 80, 68, .13); }
.button--primary:hover:not(:disabled) { background: var(--forest-900); }
.button--secondary { color: var(--forest-800); background: #fff; border-color: #c5d3ca; }
.button--secondary:hover:not(:disabled) { border-color: var(--forest-700); }
.button--ghost { color: #4c5d54; background: transparent; border-color: var(--line); }
.button--wide { width: 100%; margin-top: 17px; }
.text-button { display: block; width: 100%; border: 0; background: none; color: var(--forest-700); font-size: 12px; padding: 18px 8px 8px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #c8d9cf; background: rgba(255,255,255,.07); font-size: 19px; }
.icon-button--dark { color: var(--forest-900); background: var(--forest-100); font-size: 26px; }

.status-pill { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 99px; background: var(--forest-100); color: var(--forest-700); padding: 5px 10px; font-size: 9px; font-weight: 850; letter-spacing: .09em; }
.status-pill--review { background: #f4ead8; color: #8a5c16; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 100; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; padding: 30px 19px 18px; background: var(--forest-950); color: #e8f1eb; }
.sidebar-brand { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); flex-direction: column; align-items: flex-start; gap: 10px; }
.sidebar-brand .official-logo { width: 100%; height: 75px; }
.sidebar-brand .brand strong { font-size: 15px; }
.main-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 10px 13px; border: 0; border-radius: 10px; background: transparent; color: #a9c0b3; text-align: left; font-size: 12px; font-weight: 650; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.is-active { background: #235348; color: #fff; box-shadow: inset 3px 0 var(--gold-400); }
.nav-icon { width: 22px; font-size: 20px; text-align: center; }
.sidebar-spacer { flex: 1; }
.release-card { display: flex; gap: 10px; align-items: flex-start; margin: 14px 4px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.025); }
.release-card b, .release-card small { display: block; }
.release-card b { font-size: 11px; }
.release-card small { color: #91aa9b; font-size: 9px; margin-top: 3px; overflow-wrap: anywhere; }
.release-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--gold-400); box-shadow: 0 0 0 4px rgba(209,174,105,.1); }
.user-card { display: flex; align-items: center; gap: 9px; padding: 14px 4px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #315f52; color: #fff; font-size: 11px; font-weight: 800; }
.user-card-copy { min-width: 0; flex: 1; }
.user-card-copy b, .user-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-copy b { font-size: 10px; }
.user-card-copy small { color: #8fa99a; font-size: 9px; }

.main-content { min-height: 100vh; margin-left: 248px; padding: 0 34px 24px; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar-kicker { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.topbar h1 { font-size: 25px; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.snapshot-date { color: var(--muted); font-size: 11px; }
.review-banner { margin: 20px 0 26px; border: 1px solid #ead9b9; border-radius: 10px; padding: 11px 15px; background: #faf4e9; color: #6c572f; font-size: 11px; }
.workspace-view { animation: view-in .2s ease-out; }
@keyframes view-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 26px 0 20px; }
.section-heading h2 { font-size: 25px; }
.panel { min-width: 0; border: 1px solid #e0e7e2; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-heading small { color: var(--muted); font-size: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi-card { position: relative; overflow: hidden; min-width: 0; padding: 21px; border: 1px solid #e0e7e2; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.kpi-label { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.kpi-card strong { display: block; margin: 11px 0 4px; font-size: clamp(25px, 2.4vw, 36px); line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.kpi-card small { color: var(--muted); font-size: 10px; }
.kpi-accent { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--forest-700); }
.kpi-accent--gold { background: var(--gold-400); }
.kpi-accent--blue { background: var(--blue); }
.kpi-accent--green { background: var(--exact); }
.quality-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; overflow: hidden; margin: 16px 0; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.quality-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; border: 0; padding: 15px 20px; background: #fff; text-align: left; }
.quality-item:hover { background: #f8faf8; }
.quality-item span { font-size: 11px; font-weight: 750; }
.quality-item strong { grid-row: span 2; font-size: 24px; }
.quality-item small { color: var(--muted); font-size: 10px; }
.quality-item--exact strong { color: var(--exact); }
.quality-item--review strong { color: var(--review); }
.quality-item--unmatched strong { color: var(--unmatched); }
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.chart-panel--wide { grid-row: span 1; }
.chart { width: 100%; height: 285px; }
.chart--tall { height: 330px; }
.chart-fallback { color: var(--muted); font-size: 11px; }
.chart-fallback button { display: flex; justify-content: space-between; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 7px 3px; }
.source-footnote { color: var(--muted); font-size: 10px; margin: 17px 3px; }
.filter-summary { border-radius: 9px; padding: 9px 13px; margin-bottom: 15px; color: var(--forest-700); background: var(--forest-100); font-size: 11px; }

.filter-panel { display: grid; grid-template-columns: 1fr 1fr 1fr 1.65fr auto; gap: 11px; align-items: end; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filter-field label { margin-top: 0; }
.filter-field input, .filter-field select { min-height: 39px; padding: 8px 10px; font-size: 11px; }
.filter-actions { display: flex; gap: 7px; }
.filter-actions .button { min-height: 39px; padding: 8px 12px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; }
.map-panel { position: relative; overflow: hidden; padding: 0; }
#map { width: 100%; height: 500px; background: #e8eee9; }
.map-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.segmented { display: flex; padding: 3px; border-radius: 8px; background: #edf1ed; }
.segmented button, .map-tools button { border: 0; border-radius: 6px; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.segmented button.is-active { background: #fff; color: var(--forest-800); box-shadow: 0 2px 7px rgba(20,50,40,.09); }
.map-tools { display: flex; gap: 2px; }
.map-tools button:hover, .map-tools button.is-active { background: var(--forest-100); color: var(--forest-800); }
.map-message { position: absolute; z-index: 20; left: 50%; top: 58%; transform: translate(-50%,-50%); max-width: 80%; border-radius: 9px; padding: 10px 14px; background: rgba(255,255,255,.94); color: var(--muted); box-shadow: var(--shadow); font-size: 11px; text-align: center; }
.measure-result { position: absolute; z-index: 30; left: 15px; bottom: 43px; border-radius: 8px; padding: 8px 12px; background: var(--forest-950); color: #fff; font-size: 11px; box-shadow: var(--shadow); }
.map-sidebar { display: flex; flex-direction: column; gap: 16px; }
.layer-panel { box-shadow: none; }
.layer-help { margin: 12px 0; padding: 11px 12px; border-radius: 8px; background: #f2f6f3; color: var(--muted); }
.layer-help p { margin: 0 0 8px; font-size: 10px; line-height: 1.55; }
.layer-help p:last-child { margin-bottom: 0; }
.layer-help b { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.legend-swatch { width: 13px; height: 13px; border: 2px solid; border-radius: 3px; }
.legend-swatch--exact { border-color: var(--exact); background: rgba(35,130,108,.18); }
.legend-swatch--review { border-color: var(--review); background: rgba(195,134,45,.18); }
.legend-swatch--unmatched { border-color: var(--unmatched); background: rgba(182,79,75,.18); }
.switch { margin: 0; }
.switch input { width: 38px; min-height: 20px; accent-color: var(--forest-700); }
.range-label { display: flex; justify-content: space-between; margin: 8px 0; }
#layer-opacity { min-height: 20px; padding: 0; accent-color: var(--forest-700); }
.map-count { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
.map-count strong { font-size: 21px; }
.attribution-note { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 10px 0 0; }
.boundary-panel { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.boundary-panel h4 { margin: 0 0 10px; color: var(--ink); font-size: 12px; }
.boundary-panel h4 small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.boundary-layer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.boundary-layer-list label { display: flex; align-items: center; gap: 7px; min-height: 32px; margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 10px; cursor: pointer; }
.boundary-layer-list input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--forest-700); }
.boundary-layer-list input:disabled + span { color: var(--muted); }
#boundary-status { margin: 8px 0 0; line-height: 1.45; }
.maplibregl-ctrl-attrib { font-size: 9px; }
.maplibregl-popup-content { border-radius: 10px; box-shadow: 0 10px 35px rgba(10,40,30,.2); padding: 14px; }
.maplibregl-popup-content h4 { margin: 0 0 7px; color: var(--forest-900); font-size: 13px; }
.maplibregl-popup-content p { margin: 3px 0; color: #55635c; font-size: 10px; }
.maplibregl-popup-content button { margin-top: 8px; margin-right: 5px; border: 0; border-radius: 6px; padding: 7px 9px; background: var(--forest-800); color: white; font-size: 10px; cursor: pointer; }
.maplibregl-popup-content .popup-zoom-button { background: #e8efea; color: var(--forest-900); }

.data-panel { margin-top: 16px; padding: 0; overflow: hidden; }
.data-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 21px 10px; }
.dataset-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 8px; background: #edf1ed; }
.dataset-tabs button { border: 0; border-radius: 6px; padding: 6px 19px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.dataset-tabs button.is-active { background: #fff; color: var(--forest-800); box-shadow: 0 2px 7px rgba(20,50,40,.08); }
.table-meta { display: flex; justify-content: space-between; padding: 0 21px 11px; color: var(--muted); font-size: 10px; }
.swipe-hint { display: none; }
.data-table { width: 100%; min-height: 160px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table .ag-root-wrapper { border: 0; border-radius: 0; }
.fallback-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 11px; }
.fallback-table th, .fallback-table td { max-width: 240px; padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fallback-table th { position: sticky; top: 0; background: #f5f7f4; color: var(--muted); font-size: 9px; letter-spacing: .07em; }
.fallback-table tbody tr { cursor: pointer; }
.fallback-table tbody tr:hover { background: #f3f7f4; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 42px 20px; color: var(--muted); }
.empty-state b { color: var(--ink); margin-bottom: 5px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; color: var(--muted); font-size: 11px; }
.pagination .button { min-height: 33px; padding: 5px 10px; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 0; font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.permission-card { padding: 12px 8px; border-radius: 9px; background: #f0f4f1; text-align: center; }
.permission-card b, .permission-card span { display: block; }
.permission-card b { font-size: 19px; }
.permission-card span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.admin-activation p { color: var(--muted); font-size: 11px; }
.admin-activation .button { margin-top: 16px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding: 20px 2px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.drawer-backdrop { position: fixed; z-index: 1000; inset: 0; background: rgba(5,26,21,.45); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; z-index: 1001; inset: 0 0 0 auto; width: min(520px, 100vw); display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 60px rgba(5,30,24,.18); }
.drawer-header { display: flex; justify-content: space-between; gap: 15px; padding: 25px 25px 18px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { font-size: 22px; overflow-wrap: anywhere; }
.drawer-status { padding: 13px 25px; background: #f5f7f4; }
.drawer-content { flex: 1; overflow-y: auto; padding: 20px 25px; }
.drawer-actions { display: flex; gap: 9px; padding: 16px 25px; border-top: 1px solid var(--line); }
.detail-section { margin-bottom: 25px; }
.detail-section h3 { margin-bottom: 10px; font-size: 13px; }
.detail-row { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1ed; }
.detail-row span { color: var(--muted); font-size: 11px; }
.detail-row b { font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.related-record { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 6px 0; background: #fff; text-align: left; }
.related-record:hover { border-color: var(--forest-700); }
.related-record b, .related-record small { display: block; }
.related-record small { color: var(--muted); margin-top: 3px; }
.source-json { max-height: 280px; overflow: auto; padding: 12px; border-radius: 8px; background: #f3f5f2; color: #405048; font: 10px/1.55 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast-region { position: fixed; z-index: 4000; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { border-radius: 10px; padding: 12px 15px; background: var(--forest-950); color: #fff; box-shadow: 0 12px 35px rgba(10,35,28,.2); font-size: 11px; animation: view-in .2s ease-out; }
.toast--error { background: #783c38; }

@media (max-width: 1200px) {
  .main-content { padding: 0 22px 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .filter-field--search { grid-column: span 2; }
  .map-layout { grid-template-columns: minmax(0,1fr) 210px; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 380px; padding: 32px; }
  .story-copy { padding: 55px 0 30px; }
  .story-copy h1 { font-size: 45px; }
  .story-facts { margin-top: 10px; }
  .login-panel { padding: 45px 25px; }
  .sidebar { position: static; width: 100%; min-height: auto; padding: 15px 20px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-brand { border: 0; padding: 0; flex-direction: row; align-items: center; }
  .sidebar-brand .official-logo { width: 150px; height: 56px; }
  .main-nav { order: 3; width: 100%; flex-direction: row; margin-top: 14px; }
  .nav-item { justify-content: center; }
  .nav-item.is-active { box-shadow: inset 0 -3px var(--gold-400); }
  .sidebar-spacer, .release-card { display: none; }
  .user-card { margin-left: auto; padding: 0; border: 0; }
  .user-card-copy { display: none; }
  .main-content { margin-left: 0; }
  .map-layout { grid-template-columns: 1fr; }
  .map-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 13px; }
  .login-story { min-height: 330px; padding: 25px 22px; }
  .story-copy { padding: 42px 0 20px; }
  .story-copy h1 { font-size: 37px; }
  .story-copy p { font-size: 13px; }
  .story-facts { gap: 14px; }
  .story-credit { display: none; }
  .login-panel { padding: 34px 21px; }
  .login-card h2 { font-size: 29px; }
  .sidebar { padding: 12px 14px; }
  .sidebar-brand .official-logo { width: 120px; height: 47px; }
  .sidebar-brand .brand strong { font-size: 12px; }
  .main-nav { gap: 2px; }
  .nav-item { min-height: 47px; flex-direction: column; gap: 0; padding: 5px 3px; font-size: 9px; }
  .nav-icon { font-size: 16px; }
  .main-content { padding: 0 13px 18px; }
  .topbar { min-height: 82px; }
  .topbar h1 { font-size: 20px; }
  .topbar-kicker { font-size: 8px; }
  .topbar-actions { flex-direction: column; align-items: flex-end; gap: 3px; }
  .snapshot-date { font-size: 9px; }
  .review-banner { margin: 13px 0 18px; }
  .section-heading { align-items: flex-start; margin: 18px 0 15px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading .button { padding: 7px 9px; font-size: 10px; }
  .kpi-grid { gap: 9px; }
  .kpi-card { padding: 15px 13px; }
  .kpi-card strong { font-size: 24px; }
  .kpi-card small { font-size: 9px; }
  .quality-strip { grid-template-columns: 1fr; }
  .quality-item { padding: 11px 15px; }
  .panel { border-radius: 12px; padding: 16px; }
  .chart { height: 260px; }
  .filter-panel { grid-template-columns: 1fr 1fr; padding: 12px; gap: 8px; }
  .filter-field input, .filter-field select { min-height: 44px; }
  .filter-field--search { grid-column: span 2; }
  .filter-actions { grid-column: span 2; }
  .button, .filter-actions .button { min-height: 44px; }
  .filter-actions .button { flex: 1; }
  .map-panel { padding: 0; }
  #map { height: 380px; }
  .map-toolbar { align-items: flex-start; }
  .segmented button { min-width: 44px; min-height: 44px; }
  .map-tools { flex-wrap: wrap; justify-content: flex-end; }
  .map-tools button { min-width: 44px; min-height: 44px; padding: 8px; }
  .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .map-sidebar { grid-template-columns: 1fr; }
  .data-panel { padding: 0; }
  .data-panel-heading { padding: 16px 15px 10px; }
  .table-meta { padding: 0 15px 10px; }
  .swipe-hint { display: inline; }
  .pagination { padding: 10px 12px; }
  .pagination .button { font-size: 10px; }
  .detail-drawer { width: 100vw; }
  .drawer-header, .drawer-content { padding-left: 19px; padding-right: 19px; }
  .drawer-status, .drawer-actions { padding-left: 19px; padding-right: 19px; }
  .detail-row { grid-template-columns: 115px minmax(0,1fr); }
  .app-footer { flex-direction: column; gap: 4px; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media print {
  .sidebar, .topbar-actions, .review-banner, .filter-panel, .map-toolbar, .map-sidebar, .data-panel, .app-footer, .drawer-backdrop, .detail-drawer, .toast-region { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .topbar { min-height: 70px; }
  .workspace-view[hidden] { display: none !important; }
  .map-layout { display: block; }
  .map-panel { border: 0; box-shadow: none; }
  #map { height: 700px; }
  .maplibregl-ctrl { display: none; }
}
