@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #172019;
  --muted: #68716a;
  --paper: #f3f2ec;
  --card: #fffef9;
  --line: #d8ddd4;
  --green: #176448;
  --green-dark: #112c21;
  --lime: #c9f36c;
  --parcel: #2f80ed;
  --draw: #165dcc;
  --selected: #19b8ff;
  --cadastral-orange: #ff7f00;
  --shadow: 0 12px 32px rgba(20, 38, 28, .13);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--paper); font-family: "Noto Sans KR", sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }

.topbar { height: 62px; padding: 0 20px; display: grid; grid-template-columns: 250px 1fr 250px; align-items: center; background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 1001; }
.site-title { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.05em; text-decoration: none; }
.header-note { margin: 0; justify-self: center; color: var(--muted); font-size: 12px; font-weight: 500; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.header-link { color: #315f4b; font-size: 11px; font-weight: 700; text-decoration: none; }
.header-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.server-state { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.server-state span { width: 8px; height: 8px; border-radius: 50%; background: #c69236; box-shadow: 0 0 0 4px rgba(198,146,54,.13); }
.server-state.online span { background: #3d9b69; box-shadow: 0 0 0 4px rgba(61,155,105,.13); }

.map-workspace { height: calc(100vh - 62px); display: grid; grid-template-columns: 374px minmax(0, 1fr); }
.control-panel { position: relative; z-index: 800; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(26, 45, 33, .08); scrollbar-width: thin; }
.panel-section { padding: 20px 22px; border-bottom: 1px solid #e5e8e1; }
.panel-section.compact { padding-top: 18px; padding-bottom: 18px; }
.section-heading { margin-bottom: 14px; display: flex; align-items: flex-start; gap: 11px; }
.section-heading .step { margin-top: 2px; color: var(--green); font: 500 10px/1 "IBM Plex Mono", monospace; }
.section-heading div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.section-heading strong { font-size: 14px; }
.section-heading small { color: var(--muted); font-size: 10px; }

.search-line { display: grid; grid-template-columns: minmax(0,1fr) 60px; }
input, select { width: 100%; height: 44px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #cbd2c8; border-radius: 4px; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,100,72,.09); }
input::placeholder { color: #a3aaa3; }
.search-line input { min-width: 0; border-radius: 4px 0 0 4px; font-size: 12px; }
.search-line button { border: 0; border-radius: 0 4px 4px 0; color: #fff; background: var(--green-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.search-line button:disabled { opacity: .55; cursor: wait; }
.address-results { margin-top: 7px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); }
.address-results:empty { display: none; }
.address-result { width: 100%; padding: 10px 11px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; border-bottom: 1px solid #e6e9e3; background: #fff; text-align: left; cursor: pointer; }
.address-result:last-child { border-bottom: 0; }
.address-result:hover { background: #f2f7ef; }
.address-result strong { font-size: 11px; }
.address-result small { color: var(--muted); font-size: 9px; }

.draw-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.output-shape-tools { grid-template-columns: repeat(3, 1fr); }
.tool { min-width: 0; padding: 10px 3px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 10px; font-weight: 700; }
.tool-icon { font: 500 21px/1 Arial, sans-serif; }
.tool:hover { border-color: #96aa9b; background: #f5f8f2; }
.tool.active { color: var(--green-dark); border-color: var(--green); background: #edf5e8; box-shadow: inset 0 0 0 1px var(--green); }
.tool.danger { color: #9b443a; }
.tool-utility-row { margin-bottom: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tool.tool-horizontal { min-height: 37px; padding: 6px 9px; flex-direction: row; justify-content: center; gap: 7px; }
.tool.tool-horizontal .tool-icon { font-size: 17px; }
.tool-category { margin-top: 8px; padding: 9px; border: 1px solid #dbe2dc; border-left-width: 3px; border-radius: 6px; background: #f8faf8; }
.tool-category-heading { margin-bottom: 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tool-category-heading strong { color: #2c3d32; font-size: 10px; }
.tool-category-heading small { color: #7b867e; font-size: 8px; text-align: right; }
.output-tool-group { border-left-color: var(--green); }
.measurement-tool-group { border-left-color: var(--parcel); background: #f6f9fd; }
.measurement-tool-group .tool.active { color: #174e9c; border-color: var(--parcel); background: #edf5ff; box-shadow: inset 0 0 0 1px var(--parcel); }
.draw-hint { min-height: 31px; margin-top: 11px; padding: 8px 10px; color: var(--muted); background: #f2f3ed; border-radius: 4px; font-size: 10px; line-height: 1.45; }
.measurement-results { margin-top: 8px; }
.measurement-results-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px; color: #55708f; }
.measurement-results-heading span { font-size: 9px; font-weight: 800; }
.measurement-results-heading small { font-size: 8px; }
.measurement-list { max-height: 188px; overflow-y: auto; }
.measurement-result { margin-top: 5px; padding: 10px 11px; border: 1px solid #b8d3f5; border-radius: 5px; background: #edf5ff; }
.measurement-result.draft { border-style: dashed; }
.measurement-result span, .measurement-result strong, .measurement-result small { display: block; }
.measurement-result-heading { display: flex; align-items: center; justify-content: space-between; }
.measurement-result-heading button { width: 23px; height: 23px; padding: 0; border: 0; border-radius: 4px; color: #5d7590; background: #dcecff; cursor: pointer; font-size: 17px; line-height: 1; }
.measurement-result-heading button:hover { color: #fff; background: #165dcc; }
.measurement-result span { color: #55708f; font-size: 8px; font-weight: 700; }
.measurement-result strong { margin-top: 3px; color: #174e9c; font-size: 14px; }
.measurement-result small { margin-top: 3px; color: #5f7186; font-size: 9px; }
.measurement-number-icon { display: grid !important; place-items: center; color: #fff; background: #165dcc; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(11,54,116,.42); font: 800 10px/18px "Noto Sans KR", sans-serif; }
.measurement-number-icon span { display: block; width: 18px; height: 18px; text-align: center; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #ebeee8; border-radius: 5px; }
.map-style-button { padding: 8px 4px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.map-style-button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 5px rgba(25,42,30,.12); }
.layer-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; }
.layer-toggle[aria-pressed="true"] { border-color: var(--parcel); background: #edf5ff; color: #174e9c; box-shadow: inset 0 0 0 1px var(--parcel); }
.layer-swatch { width: 14px; height: 10px; border: 2px solid var(--parcel); background: rgba(255,123,61,.1); }
#cadastralToggle[aria-pressed="true"] { border-color: var(--cadastral-orange); color: #a94f00; background: #fff4e8; box-shadow: inset 0 0 0 1px var(--cadastral-orange); }
#cadastralToggle .layer-swatch { border-color: var(--cadastral-orange); background: rgba(242,140,0,.14); }
.development-swatch { border-color: #5a67d8; background: rgba(90,103,216,.16); }
.land-use-swatch { border-color: #2280bf; background: rgba(34,128,191,.16); }
.district-swatch { border-color: #4458bc; background: rgba(68,88,188,.16); }
.road-swatch { border-color: #1269a4; background: rgba(18,105,164,.16); }
.zoning-swatch { border-color: #2b6cb0; background: linear-gradient(90deg, #9ed3f7 0 25%, #b9d7a8 25% 50%, #d9c98f 50% 75%, #8fb99b 75%); }
.label-swatch { border-color: #34495e; background: linear-gradient(90deg, transparent 0 35%, #34495e 35% 65%, transparent 65%); }
.satellite-label-toggle { width: 100%; min-height: 34px; margin-top: 8px; }
.thematic-layer-grid { margin-top: 7px; display: grid; grid-template-columns: 1fr; gap: 7px; }
.thematic-layer-grid .layer-toggle { min-height: 37px; padding: 6px 5px; font-size: 12px; }
.layer-status { margin-top: 8px; color: var(--muted); font-size: 9px; }

.selection-summary { display: grid; gap: 10px; background: #f6f6f0; }
.summary-block { padding-left: 10px; border-left: 3px solid #cbd3c8; }
.summary-block:first-child { border-left-color: var(--green); }
.summary-block span, .summary-block strong, .summary-block small { display: block; }
.summary-block span { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.summary-block strong { font-size: 12px; line-height: 1.4; }
.summary-block small { margin-top: 3px; color: #899188; font: 500 8px/1.4 "IBM Plex Mono", monospace; }

.output-form { padding: 20px 22px 28px; }
.output-form label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.output-form label:not(:first-child) { margin-top: 11px; }
.output-form select { font-size: 12px; }
.form-note { display: block; margin-top: 6px; color: #647068; font-size: 10px; line-height: 1.55; }
.primary { width: 100%; height: 50px; margin-top: 12px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 5px; color: #fff; background: var(--green); cursor: pointer; font-size: 12px; font-weight: 800; }
.primary:hover:not(:disabled) { background: #0f5139; }
.primary:disabled { color: #929992; background: #e2e5df; cursor: not-allowed; }
.form-error { min-height: 16px; margin: 8px 0 0; color: #a33c32; font-size: 10px; }

.map-stage { min-width: 0; position: relative; overflow: hidden; background: #dce3d8; }
#parcelMap { width: 100%; height: 100%; background: #dce3d8; }
.leaflet-cadastral-pane .leaflet-tile { filter: brightness(0) saturate(100%) invert(33.3%) sepia(54.3%) saturate(4217%) hue-rotate(21.9deg) brightness(140.6%) contrast(128.1%); }
.cadastral-parcel-label { display: flex !important; align-items: center; justify-content: center; border: 0 !important; background: transparent !important; color: #fff; font-family: "Malgun Gothic", "Noto Sans KR", Arial, sans-serif; font-size: 15px; font-weight: 400; line-height: 1; text-align: center; white-space: nowrap; text-shadow: 0 1px 2px rgba(20,24,21,.98), 0 0 3px rgba(20,24,21,.88); pointer-events: none !important; }
.cadastral-parcel-label span { display: block; transform: translateY(-1px); }
.map-stage.drawing #parcelMap { cursor: crosshair; }
.map-message { position: absolute; z-index: 700; top: 18px; left: 50%; transform: translateX(-50%); min-width: 340px; padding: 10px 15px; background: rgba(18,41,31,.92); color: #fff; border-radius: 5px; box-shadow: var(--shadow); pointer-events: none; text-align: center; transition: opacity .2s; }
.map-message strong, .map-message span { display: block; }
.map-message strong { font-size: 11px; }
.map-message span { margin-top: 3px; color: rgba(255,255,255,.68); font-size: 9px; }
.map-message.quiet { opacity: 0; }
.map-layer-control { position: absolute; z-index: 760; top: 18px; right: 18px; }
.layer-tool-button { width: 126px; height: 40px; padding: 0 9px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; border: 1px solid rgba(34,65,110,.3); border-radius: 6px; color: #203027; background: rgba(255,255,255,.98); box-shadow: 0 7px 22px rgba(20,38,28,.16); cursor: pointer; }
.layer-tool-button[aria-expanded="true"] { color: #174e9c; border-color: var(--parcel); background: #edf5ff; }
.layer-tool-button strong { text-align: left; font-size: 11px; }
.layer-tool-button small { color: #6d7871; font: 500 8px/1 "IBM Plex Mono", monospace; }
.layer-tool-icon { font-size: 16px; line-height: 1; }
.layer-tool-state { display: flex; align-items: center; gap: 5px; }
.layer-tool-state i { color: #47574d; font-size: 17px; font-style: normal; line-height: 1; transform: translateY(-1px); transition: transform .18s ease; }
.layer-tool-button[aria-expanded="true"] .layer-tool-state i { transform: translateY(1px) rotate(180deg); }
.map-layer-toolbox { position: absolute; top: 46px; right: 0; width: 232px; max-height: calc(100vh - 140px); overflow-y: auto; box-sizing: border-box; padding: 10px; border: 1px solid #b8c7d8; border-radius: 7px; color: #1f3027; background: rgba(255,255,255,.99); box-shadow: 0 14px 36px rgba(20,38,28,.22); scrollbar-width: thin; }
.map-layer-toolbox .layer-toggle { font-size: 12px; }
.map-layer-toolbox .segmented { grid-template-columns: 1fr 1fr; gap: 3px; background: #e7ece8; }
.map-layer-toolbox .map-style-button { min-height: 33px; color: #56635a; font-size: 12px; }
.map-layer-toolbox .map-style-button.active { color: #123f7d; background: #fff; box-shadow: 0 1px 5px rgba(25,42,30,.16); }
.toolbox-heading { padding: 1px 1px 9px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #d9e0da; }
.toolbox-heading strong, .toolbox-heading small { display: block; }
.toolbox-heading strong { font-size: 13px; color: #1e3327; }
.toolbox-heading small { margin-top: 3px; color: #68766d; font-size: 9px; }
.toolbox-heading button { width: 25px; height: 25px; border: 1px solid #d7ded8; border-radius: 4px; color: #526158; background: #f1f4f1; cursor: pointer; font-size: 18px; line-height: 1; }
.toolbox-section { padding: 9px 0; border-bottom: 1px solid #e3e8e4; }
.toolbox-section:last-child { padding-bottom: 2px; border-bottom: 0; }
.toolbox-label { display: block; margin-bottom: 6px; color: #526258; font-size: 10px; font-weight: 800; }
.toolbox-wide { width: 100%; min-height: 36px; font-size: 12px; }
.zoning-toggle { margin-bottom: 8px; }
.toolbox-group-toggle { width: 100%; min-height: 35px; padding: 0 8px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; border: 1px solid #cfd8d1; border-radius: 5px; color: var(--ink); background: #f5f7f4; cursor: pointer; text-align: left; }
.toolbox-group-toggle span { font-size: 12px; font-weight: 800; }
.toolbox-group-toggle small { color: #6d7871; font: 500 9px/1 "IBM Plex Mono", monospace; }
.toolbox-group-toggle i { font-style: normal; transition: transform .18s ease; }
.toolbox-group-toggle[aria-expanded="true"] { color: #174e9c; border-color: #b8d3f5; background: #edf5ff; }
.toolbox-group-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.planning-group { padding-top: 7px; }
.zoom-indicator { width: 100%; box-sizing: border-box; margin-bottom: 7px; padding: 8px 9px; color: #3e4d43; background: #f9fbf9; border: 1px solid #cbd6cc; border-radius: 5px; box-shadow: none; }
.zoom-title { display: block; margin-bottom: 7px; color: #68756c; font-size: 10px; font-weight: 700; }
.zoom-control-row { margin-bottom: 0; display: grid; grid-template-columns: 26px 1fr 26px; align-items: start; gap: 6px; }
.zoom-control-row button { width: 26px; height: 26px; padding: 0; border: 1px solid #bfcbbf; border-radius: 4px; color: #174e9c; background: #fff; cursor: pointer; font: 700 17px/1 Arial, sans-serif; }
.zoom-control-row button:disabled { color: #adb5af; background: #eef1ed; cursor: default; }
.zoom-gauge-column { min-width: 0; padding-top: 10px; }
.zoom-track { height: 6px; position: relative; overflow: visible; background: #dfe5e0; border-radius: 999px; }
.zoom-track span { display: block; width: 0; height: 100%; background: var(--parcel); border-radius: inherit; transition: width .22s ease; }
.zoom-track i { position: absolute; left: var(--cadastral-start, 66.667%); top: -3px; width: 2px; height: 12px; background: #174e9c; transform: translateX(-1px); transition: left .22s ease; }
.zoom-track i::after { content: "연속지적도 표시 가능"; position: absolute; top: 13px; left: 50%; width: max-content; color: #174e9c; font-size: 8px; font-weight: 700; line-height: 1; white-space: nowrap; writing-mode: horizontal-tb; transform: translateX(-50%); }
.zoom-indicator small { display: block; color: #78827a; font-size: 9px; }
.zoom-gauge-column small { margin-top: 16px; line-height: 1.25; text-align: center; white-space: nowrap; }
.zoom-indicator.ready { border-color: var(--parcel); background: #edf5ff; }
.zoom-indicator.ready .zoom-track span { background: #19b8ff; }
.zoom-indicator.ready small { color: #174e9c; font-weight: 700; }
.map-progress { position: absolute; z-index: 720; top: 151px; right: 18px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; color: var(--green-dark); background: rgba(255,254,249,.94); border-radius: 4px; box-shadow: var(--shadow); font-size: 10px; transition: right .18s ease; }
.map-stage.layer-tool-open .map-progress { right: 268px; }
.map-progress span { width: 10px; height: 10px; border: 2px solid #c8d3c9; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.map-progress b { font-weight: 700; }
.measurement-notice { position: absolute; z-index: 760; left: 50%; bottom: 48px; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 10px 14px; color: #fff; background: rgba(20,78,156,.94); border: 1px solid rgba(255,255,255,.28); border-radius: 5px; box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; font-size: 10px; font-weight: 700; }
.map-footer-status { position: absolute; z-index: 700; left: 15px; right: 15px; bottom: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.map-footer-status span { padding: 5px 8px; color: #4f5d52; background: rgba(255,255,255,.88); border-radius: 3px; box-shadow: 0 1px 6px rgba(23,39,27,.1); font-size: 8px; }

.job-card { position: absolute; z-index: 900; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(460px, calc(100% - 40px)); min-height: 130px; padding: 26px; display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: center; color: #fff; background: var(--green-dark); border: 1px solid rgba(255,255,255,.13); border-radius: 8px; box-shadow: 0 22px 70px rgba(11,28,20,.36); }
.job-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 5px; }
.job-card span { color: var(--lime); font: 500 8px/1 "IBM Plex Mono", monospace; letter-spacing: .14em; }
.job-card strong { font-size: 16px; }
.job-card small { color: rgba(255,255,255,.64); font-size: 10px; }
.job-spinner { width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.16); border-top-color: var(--lime); border-radius: 50%; animation: spin 1s linear infinite; }
.job-card.complete .job-spinner { display: grid; place-items: center; border: 0; background: var(--lime); color: var(--green-dark); animation: none; }
.job-card.complete .job-spinner::after { content: "✓"; font-size: 22px; font-weight: 800; }
.download { grid-column: 1 / -1; height: 44px; padding: 0 13px; display: flex; align-items: center; justify-content: center; color: var(--green-dark); background: var(--lime); border-radius: 4px; text-decoration: none; font-size: 11px; font-weight: 800; }
.job-close { position: absolute; top: 9px; right: 10px; border: 0; color: rgba(255,255,255,.62); background: transparent; cursor: pointer; font-size: 20px; }
.hidden { display: none !important; }

.parcel-map-label { padding: 0 !important; color: #0d4598 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; font: 700 9px/1 "Noto Sans KR", sans-serif !important; text-shadow: 0 1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff, 0 -1px 2px #fff; pointer-events: none; }
.parcel-map-label::before { display: none; }

/* Leaflet의 외부 CSS가 늦게 로드되어도 지도 타일이 흐트러지지 않도록 핵심 배치를 포함합니다. */
.leaflet-container { position: relative; overflow: hidden; outline-offset: 1px; font-family: "Noto Sans KR", sans-serif; }
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas { position: absolute; left: 0; top: 0; }
.leaflet-map-pane, .leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-tile { visibility: hidden; user-select: none; -webkit-user-drag: none; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; }.leaflet-right { right: 0; }.leaflet-bottom { bottom: 0; }.leaflet-left { left: 0; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.leaflet-top .leaflet-control { margin-top: 14px; }.leaflet-left .leaflet-control { margin-left: 14px; }
.leaflet-right .leaflet-control { margin-right: 14px; }.leaflet-bottom .leaflet-control { margin-bottom: 36px; }
.leaflet-bar { border: 1px solid rgba(20,40,29,.18); border-radius: 4px; box-shadow: 0 2px 10px rgba(20,40,29,.15); overflow: hidden; }
.leaflet-bar a { width: 32px; height: 32px; display: block; color: var(--ink); background: #fff; border-bottom: 1px solid #d8ddd7; text-align: center; text-decoration: none; font: 700 20px/32px Arial,sans-serif; }
.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-control-attribution { padding: 2px 6px; color: #657068; background: rgba(255,255,255,.85); font-size: 8px; }
.leaflet-control-attribution a { color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .header-note { display: none; }
  .map-workspace { grid-template-columns: 320px minmax(0,1fr); }
}

@media (max-width: 680px) {
  html, body { overflow: auto; }
  .topbar { position: sticky; top: 0; height: 56px; padding: 0 13px; }
  .server-state { font-size: 9px; }
  .topbar-actions { gap: 9px; }
  .header-link { font-size: 10px; }
  .map-workspace { height: auto; display: flex; flex-direction: column; }
  .map-stage { order: 1; height: 58vh; min-height: 390px; }
  .control-panel { order: 2; overflow: visible; border-right: 0; }
  .map-message { top: 10px; min-width: 0; width: calc(100% - 90px); }
  .map-message span { display: none; }
  .map-layer-control { top: 10px; right: 10px; }
  .map-layer-toolbox { width: min(232px, calc(100vw - 20px)); max-height: calc(58vh - 70px); }
  .map-stage.layer-tool-open .map-progress { opacity: 0; }
  .map-footer-status span:last-child { display: none; }
}
