.route-planner {
  position: fixed;
  z-index: 9;
  top: 84px;
  left: 190px;
  width: min(440px, calc(100vw - 540px));
  max-height: calc(100vh - 112px);
  overflow: auto;
  border: 1px solid rgba(85, 73, 48, .46);
  border-radius: 12px;
  background: rgba(250, 247, 238, .98);
  box-shadow: 0 14px 38px rgba(35, 38, 31, .3);
}

.route-planner[hidden] { display: none; }

.route-planner-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #d5cfc1;
  background: rgba(250, 247, 238, .98);
}

.route-planner-head strong {
  display: block;
  font: 700 17px Georgia, "Noto Serif KR", serif;
}

.route-planner-head small { color: #786f61; font-size: 11px; }
.route-planner-head button { height: 28px; padding: 0 9px; }
.route-planner-body { display: grid; gap: 12px; padding: 14px 16px 16px; }

.route-point-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.route-point-grid label,
.route-options-grid label:not(.route-check) {
  display: grid;
  gap: 4px;
  color: #716858;
  font-size: 11px;
  font-weight: 700;
}

.route-point-grid input { width: 100%; }
.route-point-grid button { align-self: end; white-space: nowrap; }

.route-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  padding: 11px;
  border-radius: 8px;
  background: #eee9dc;
}

.route-options-grid select,
.route-options-grid input[type="number"] { width: 100%; padding: 0 8px; }
.route-check { display: flex; align-items: center; gap: 6px; min-height: 36px; font-size: 12px; }
.route-assumption { margin: 0; color: #7b6a50; font-size: 11px; line-height: 1.45; }
.route-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.route-primary { border-color: #805d21; background: #3c392f; color: #ffe5a2; }
.route-primary:hover { background: #514a38; }
.route-progress { min-height: 18px; color: #6e6659; font-size: 12px; }
.route-progress[data-state="error"] { color: #a1302a; font-weight: 700; }
.route-progress[data-state="success"] { color: #247748; font-weight: 700; }
.route-results { display: grid; gap: 9px; }

.route-result-card {
  padding: 10px 11px;
  border: 1px solid #d4ccbc;
  border-left: 4px solid #2f6fc5;
  border-radius: 8px;
  background: #fffdf7;
}

.route-result-card[data-mode="ROADWORK"] { border-left-color: #e89b2e; }
.route-result-card h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.route-result-card h3 span { color: #75664c; font-size: 11px; }
.route-result-card dl { display: grid; grid-template-columns: 92px 1fr; gap: 5px 8px; margin: 0; font-size: 11px; }
.route-result-card dt { color: #817969; }
.route-result-card dd { margin: 0; font-weight: 700; }
.route-result-card .route-error { color: #a1302a; }

@media (max-width: 900px) {
  .topbar { right: 16px; flex-wrap: wrap; }
  .brand { width: 100%; border: 0; }
  .panel { top: auto; left: 16px; width: auto; height: 210px; }
  .panel header { display: none; }
  .route-planner {
    top: auto;
    right: 16px;
    bottom: 242px;
    left: 16px;
    width: auto;
    max-height: 44vh;
  }
}

@media (max-width: 560px) {
  .route-options-grid { grid-template-columns: 1fr; }
  .route-point-grid { grid-template-columns: 1fr; }
  .route-point-grid button { width: 100%; }
}
:root {
  --ink: #273029;
  --paper: #f5f1e7;
  --panel: rgba(250, 247, 238, .96);
  --line: #bbb9ad;
  --gold: #a6782a;
  --red: #b43c35;
  --green: #247748;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: #d9d7cb; font-family: "Noto Sans KR", "Malgun Gothic", sans-serif; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
.topbar { position: fixed; z-index: 5; top: 16px; left: 16px; right: 332px; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; border: 1px solid rgba(85, 73, 48, .3); border-radius: 10px; background: var(--panel); box-shadow: 0 8px 30px rgba(41, 43, 35, .18); }
.brand { padding: 0 10px 0 2px; border-right: 1px solid #cbc5b7; }
.brand strong { display: block; white-space: nowrap; font-family: Georgia, "Noto Serif KR", serif; font-size: 17px; }
.brand small { color: #756e60; }
select, input, button { height: 36px; border: 1px solid #bdb6a8; border-radius: 6px; background: #fffdf7; color: var(--ink); font: inherit; }
select, input[type="text"] { padding: 0 10px; }
input[type="text"] { width: 150px; }
.city-search { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.city-search input { width: 132px; padding: 0 10px; }
.city-search button { white-space: nowrap; }
input[type="color"] { width: 40px; padding: 3px; }
button { padding: 0 12px; cursor: pointer; font-weight: 700; }
button:hover { border-color: var(--gold); background: #fff7df; }
#collaboration-toggle { display: none !important; }
.danger { color: #9d302a; }
.panel { position: fixed; z-index: 5; top: 16px; right: 16px; bottom: 16px; width: 300px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(85, 73, 48, .3); border-radius: 10px; background: var(--panel); box-shadow: 0 8px 30px rgba(41, 43, 35, .18); }
.panel header { padding: 17px 18px 13px; border-bottom: 1px solid #d5cfc1; }
.panel h1 { margin: 0 0 5px; font: 700 20px Georgia, "Noto Serif KR", serif; }
.panel header p { margin: 0; color: #7d7568; font-size: 12px; }
.section { padding: 14px 18px; border-bottom: 1px solid #ddd7ca; }
.section h2 { margin: 0 0 10px; font-size: 13px; color: #75664c; letter-spacing: .06em; }
.tile-info { display: grid; grid-template-columns: 74px 1fr; gap: 7px; margin: 0; font-size: 13px; }
.tile-info dt { color: #817969; }
.tile-info dd { margin: 0; font-weight: 700; word-break: break-all; }
#annotations { flex: 1; overflow: auto; padding: 8px 10px 16px; }
.annotation { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #e4dfd4; font-size: 12px; cursor: pointer; }
.annotation:hover { background: #fff7df; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.annotation b { display: block; font-size: 13px; }
.annotation button { height: 26px; padding: 0 7px; }
.status { position: fixed; z-index: 5; left: 16px; bottom: 16px; padding: 8px 12px; border-radius: 7px; background: rgba(35, 40, 35, .88); color: #fff; font-size: 12px; }
.display-settings { position: fixed; z-index: 8; top: 84px; left: 16px; width: 340px; max-height: calc(100vh - 116px); overflow: auto; border: 1px solid rgba(85, 73, 48, .42); border-radius: 10px; background: rgba(250, 247, 238, .98); box-shadow: 0 12px 34px rgba(35, 38, 31, .28); }
.display-settings[hidden] { display: none; }
.province-menu { position: fixed; z-index: 6; top: 84px; left: 16px; width: 164px; padding: 11px; border: 1px solid rgba(85, 73, 48, .42); border-radius: 10px; background: rgba(250, 247, 238, .95); box-shadow: 0 10px 28px rgba(35, 38, 31, .2); }
.province-menu header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.province-menu-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; flex: 1; }
.province-menu header strong { font: 700 15px Georgia, "Noto Serif KR", serif; }
.province-menu header span { color: #94651e; font-size: 11px; font-weight: 800; }
.panel-toggle { height: 28px; min-width: 46px; padding: 0 8px; font-size: 11px; }
.collapsible-panel-body[hidden] { display: none !important; }
.province-menu.is-collapsed header { margin-bottom: 0; }
.province-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 7px; }
.province-actions button { height: 29px; padding: 0 6px; font-size: 11px; }
.province-list { display: grid; grid-template-columns: 1fr; gap: 5px; }
.province-list button { height: 30px; padding: 0 5px; color: #766f62; font-size: 12px; }
.province-list button.active { border-color: #9c681d; background: #3c392f; color: #ffe5a2; box-shadow: inset 0 0 0 1px rgba(255, 201, 78, .35); }
.province-fit { width: 100%; height: 31px; margin-top: 8px; font-size: 11px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid #d5cfc1; }
.settings-head strong { font-family: Georgia, "Noto Serif KR", serif; font-size: 16px; }
.settings-head button { height: 28px; padding: 0 8px; }
.settings-body { display: grid; gap: 13px; padding: 14px 15px 16px; }
.setting-row { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; align-items: center; font-size: 12px; }
.setting-row b { font-size: 12px; }
.setting-row output { min-width: 50px; text-align: right; color: #8a5e1d; font-weight: 800; }
.setting-row input[type="range"] { grid-column: 1 / -1; width: 100%; height: 24px; accent-color: #ae792b; }
.resource-filter { min-width: 0; margin: 0; padding: 10px; border: 1px solid #d2c5ac; border-radius: 8px; background: #f3eee2; }
.resource-filter legend { padding: 0 6px; color: #655530; font-size: 12px; font-weight: 900; }
.resource-filter.is-disabled { opacity: .48; }
.resource-type-grid, .resource-level-grid { display: grid; gap: 6px; }
.resource-type-grid { grid-template-columns: repeat(4, 1fr); }
.resource-level-grid { grid-template-columns: repeat(6, 1fr); }
.resource-filter label { position: relative; min-width: 0; }
.resource-filter input { position: absolute; opacity: 0; pointer-events: none; }
.resource-filter span { display: grid; min-height: 30px; place-items: center; border: 1px solid #c7b99e; border-radius: 5px; background: #fffdf6; color: #625b4e; font-size: 11px; font-weight: 800; cursor: pointer; }
.resource-filter input:checked + span { border-color: #b4791f; background: #3c392f; color: #ffe5a2; box-shadow: inset 0 0 0 1px rgba(255,201,78,.35); }
.resource-filter input:focus-visible + span { outline: 2px solid #d49b3f; outline-offset: 2px; }
.setting-colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.setting-color { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.setting-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 10px; background: #eee9dc; border-radius: 6px; }
.setting-wide { grid-column: 1 / -1; }
.setting-checks label { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.settings-note { margin: 0; color: #777064; font-size: 11px; line-height: 1.5; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; color: #696358; font-size: 11px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 4px; border: 1px solid rgba(0,0,0,.15); }
.legend .land::before { background: #696954; }
.legend .water::before { background: #3d7fd9; }
.legend .forest::before { background: #2eaa5b; }
.legend .mountain::before { background: #1f2622; }
.loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #edeade; font-size: 18px; }
.loading[hidden] { display: none !important; }
.operations-panel { position: fixed; z-index: 24; top: 88px; right: 22px; width: min(340px, calc(100vw - 44px)); max-height: calc(100vh - 112px); overflow: auto; padding: 18px; border: 1px solid rgba(124, 91, 43, .35); border-radius: 18px; background: rgba(250, 247, 237, .97); box-shadow: 0 20px 55px rgba(33, 31, 24, .25); color: #292d27; }
.operations-panel[hidden] { display: none; }
.operations-panel header, .operations-layer-heading, .operations-layer-options, .operations-edit-actions, .operations-import-preview div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.operations-panel header { margin-bottom: 14px; }
.operations-panel h2 { margin: 2px 0 0; font-family: 'Nanum Myeongjo', serif; font-size: 22px; }
.operations-panel small { color: #896f42; font-weight: 800; letter-spacing: .12em; }
.operations-panel label { display: grid; gap: 5px; margin: 10px 0; color: #625a49; font-size: 12px; font-weight: 800; }
.operations-panel input:not([type='checkbox']):not([type='color']), .operations-panel select { box-sizing: border-box; width: 100%; padding: 9px 10px; border: 1px solid #d2c6ad; border-radius: 9px; background: #fffdf6; color: #292d27; }
.operations-panel button { padding: 8px 10px; border: 1px solid #cbbb9d; border-radius: 9px; background: #fffdf7; color: #34382f; font-weight: 800; cursor: pointer; }
.operations-panel button:hover { border-color: #94733c; }
.operations-panel button:disabled { opacity: .42; cursor: default; }
.operations-panel .danger { color: #9e3029; }
.operations-layer-options label { display: flex; align-items: center; margin: 8px 0; }
.operations-edit-actions { flex-wrap: wrap; justify-content: flex-start; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ddd2bd; }
.operations-import-preview { margin-top: 14px; padding: 12px; border-radius: 10px; background: #eee6d5; }
.operations-import-preview p { line-height: 1.5; }
.operation-feature-row { display: grid; width: 100%; margin: 7px 0; padding: 10px 12px; text-align: left; border: 1px solid #ded5c3; border-radius: 10px; background: rgba(255,255,255,.72); }
.operation-feature-row[data-selected='true'] { border-color: #a97725; box-shadow: inset 3px 0 #c68b29; }
.operation-feature-row span { margin-top: 3px; color: #766f61; font-size: 11px; }
@media (max-width: 760px) { .operations-panel { top: 142px; right: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 162px); } }
.ownership-panel { position: fixed; z-index: 24; top: 88px; left: 22px; width: min(350px, calc(100vw - 44px)); max-height: calc(100vh - 112px); overflow: auto; padding: 18px; border: 1px solid rgba(80, 108, 78, .4); border-radius: 18px; background: rgba(247, 248, 238, .97); box-shadow: 0 20px 55px rgba(28, 39, 29, .25); color: #293129; }
.ownership-panel[hidden] { display: none; }
.ownership-panel header, .ownership-actions, .ownership-import-preview div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ownership-panel h2 { margin: 2px 0 0; font-family: 'Nanum Myeongjo', serif; font-size: 22px; }
.ownership-panel h3 { margin: 18px 0 8px; font-size: 14px; }
.ownership-panel small { color: #557253; font-weight: 800; }
.ownership-panel label { display: grid; gap: 5px; margin: 12px 0; color: #5e6c5d; font-size: 12px; font-weight: 800; }
.ownership-panel select { width: 100%; padding: 9px 10px; border: 1px solid #c9d1bd; border-radius: 9px; background: #fffef7; }
.ownership-panel button { padding: 8px 10px; border: 1px solid #bdcbb5; border-radius: 9px; background: #fffef7; color: #324034; font-weight: 800; cursor: pointer; }
.ownership-panel button:disabled { opacity: .45; cursor: default; }
.ownership-influence { margin: 12px 0; padding: 10px; border-radius: 10px; background: #e9eee2; }
.ownership-influence label { display: flex; align-items: center; margin: 0 0 4px; }
.ownership-age[data-stale='true'] { color: #9a552b; font-weight: 800; }
.ownership-import-preview { margin-top: 14px; padding: 12px; border-radius: 10px; background: #e4eadc; }
.ownership-change-row { display: grid; width: 100%; margin: 6px 0; text-align: left; }
.ownership-change-row span { color: #697567; font-size: 11px; }
@media (max-width: 760px) { .ownership-panel { top: 142px; left: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 162px); } }
.intake-panel { position: fixed; z-index: 25; top: 72px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 36px)); max-height: calc(100vh - 96px); overflow: auto; padding: 20px; border: 1px solid rgba(70, 92, 102, .38); border-radius: 18px; background: rgba(245, 248, 244, .98); box-shadow: 0 22px 64px rgba(24, 34, 38, .3); color: #283335; }
.intake-panel[hidden] { display: none; }
.intake-panel header, .intake-form > div, .intake-candidate > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.intake-panel h2 { margin: 2px 0 0; font-family: 'Nanum Myeongjo', serif; font-size: 23px; }
.intake-panel h3 { margin: 18px 0 8px; font-size: 14px; }
.intake-panel small { color: #557079; font-weight: 800; }
.intake-panel label { display: grid; flex: 1; gap: 5px; margin: 8px 0; color: #5b6b6d; font-size: 12px; font-weight: 800; }
.intake-panel input, .intake-panel select { box-sizing: border-box; width: 100%; padding: 8px 9px; border: 1px solid #c2d0ce; border-radius: 8px; background: #fff; }
.intake-panel button { padding: 8px 10px; border: 1px solid #b8c9c5; border-radius: 9px; background: #fff; color: #304447; font-weight: 800; cursor: pointer; }
.intake-panel button:disabled { opacity: .45; cursor: default; }
.intake-screenshot { padding: 12px; border-radius: 12px; background: #e9efec; }
.intake-screenshot img { display: block; max-width: 100%; max-height: 240px; margin: 10px auto; border-radius: 8px; object-fit: contain; }
.intake-screenshot img[hidden] { display: none; }
.intake-files { display: grid; gap: 7px; }
.intake-candidate { margin: 8px 0; padding: 11px; border: 1px solid #cbd6d2; border-radius: 10px; background: #fff; }
.intake-candidate p { margin: 5px 0; }
.intake-conflict { padding: 8px; border-radius: 7px; background: #fae5d3; color: #8a472c; }
@media (max-width: 760px) { .intake-panel { top: 132px; width: calc(100vw - 20px); max-height: calc(100vh - 152px); } }

/* Map-first UX layer */
.operation-tool-select, .topbar > #tool { display: none !important; }
.topbar { right: 16px; width: auto; max-width: none; min-width: 0; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; }
.topbar-quick-actions, .topbar-more-menu, .quick-panel-actions, .route-quick-points, .city-quick-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-quick-actions { margin-left: auto; }
.topbar-quick-actions button, .topbar-more summary, .topbar-more-menu button { white-space: nowrap; }
.topbar-more { position: relative; }
.topbar-more > summary { cursor: pointer; list-style: none; border: 1px solid rgba(113,84,36,.34); border-radius: 10px; padding: 9px 12px; background: rgba(255,252,242,.92); font-weight: 800; }
.topbar-more > summary::-webkit-details-marker { display: none; }
.topbar-more-menu { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: max-content; max-width: min(540px, calc(100vw - 32px)); flex-wrap: wrap; justify-content: flex-end; padding: 10px; border: 1px solid rgba(113,84,36,.3); border-radius: 12px; background: rgba(250,247,237,.98); box-shadow: 0 16px 40px rgba(37,31,21,.18); }
.route-quick-dock, .operations-quick-panel { position: fixed; z-index: 24; border: 1px solid rgba(111,81,30,.38); border-radius: 16px; background: rgba(250,247,237,.97); box-shadow: 0 18px 54px rgba(32,29,22,.22); backdrop-filter: blur(10px); }
.route-quick-dock { left: 50%; bottom: 22px; width: min(760px, calc(100vw - 44px)); transform: translateX(-50%); padding: 14px 16px; }
.operations-quick-panel { left: 16px; top: 88px; bottom: 22px; width: 72px; padding: 8px; overflow: visible; }
.quick-panel-header, .route-quick-header, .city-quick-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.quick-panel-header h2, .route-quick-header h2, .city-quick-header h2 { margin: 0; font-size: 17px; }
.quick-panel-close { min-width: 34px; padding: 6px 9px; border-radius: 9px; }
.operations-quick-panel .quick-panel-header h2 { font-size: 13px; }
.operations-quick-panel .quick-panel-header { gap: 4px; }
.operations-quick-panel .quick-panel-close { min-width: 26px; padding: 4px; }
.route-quick-points { justify-content: center; margin: 8px 0; }
.route-point-chip { min-width: 150px; padding: 9px 12px; border: 1px solid rgba(111,81,30,.25); border-radius: 10px; background: rgba(255,255,255,.72); text-align: center; font-weight: 800; }
.route-point-chip.is-pending { border-color: #c18a27; box-shadow: 0 0 0 3px rgba(193,138,39,.16); }
.route-quick-help, .operations-quick-help, .ownership-direct-help, .city-quick-hint { margin: 6px 0 10px; color: #615a4e; font-size: 13px; line-height: 1.45; }
.route-quick-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.route-quick-result { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #25332e; color: #fff8df; font-weight: 750; line-height: 1.5; }
.operation-symbol-grid { display: grid; grid-template-columns: 1fr; gap: 5px; }
.operation-symbol-grid button { display: grid; place-items: center; min-width: 0; height: 48px; padding: 3px; overflow: hidden; white-space: nowrap; }
.operation-symbol-grid button span { font-size: 21px; line-height: 1; }
.operation-symbol-grid button small { font-size: 9px; line-height: 1; }
.operation-symbol-grid button.is-active { border-color: #af7422; background: #3a3528; color: #ffe4a6; box-shadow: 0 0 0 2px rgba(175,116,34,.18); }
.operation-options-popover { position: absolute; z-index: 2; top: 0; left: calc(100% + 10px); width: 290px; max-height: calc(100vh - 110px); overflow: auto; padding: 13px; border: 1px solid rgba(111,81,30,.38); border-radius: 14px; background: rgba(250,247,237,.98); box-shadow: 0 18px 54px rgba(32,29,22,.22); }
.operation-options-popover[hidden] { display: none !important; }
.operation-options-head { display: flex; align-items: center; justify-content: space-between; }
.operation-options-head button { min-width: 30px; padding: 5px; }
.operations-quick-fields { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 10px; }
.operations-quick-fields input[type="text"] { width: 100%; min-width: 0; }
.operations-quick-fields textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 68px; resize: vertical; padding: 8px 9px; border: 1px solid rgba(111,81,30,.3); border-radius: 9px; background: #fffef8; font: inherit; }
.operations-quick-fields input[type="color"] { width: 48px; min-width: 48px; height: 38px; }
.operations-tool-options { display: grid; gap: 8px; margin-top: 10px; }
.operations-tool-options > [hidden] { display: none !important; }
.operations-tool-options label { display: grid; grid-template-columns: auto minmax(88px, 1fr); gap: 10px; align-items: center; font-size: 12px; font-weight: 800; }
.operations-tool-options fieldset { display: flex; gap: 6px; align-items: center; margin: 0; padding: 7px 9px; border: 1px solid rgba(111,81,30,.24); border-radius: 10px; }
.operations-tool-options legend { padding: 0 5px; color: #615a4e; font-size: 11px; font-weight: 800; }
.operations-tool-options button.is-active { background: #3a3528; color: #ffe4a6; }
.quick-panel-actions { justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.operations-canvas-confirm { position: fixed; z-index: 75; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid rgba(179,119,30,.72); border-radius: 11px; background: rgba(42,39,31,.96); color: #fff2c7; box-shadow: 0 12px 30px rgba(24,21,16,.32); }
.operations-canvas-confirm[hidden] { display: none !important; }
.operations-canvas-confirm strong { margin-right: 6px; font-size: 13px; }
.operations-canvas-confirm button { min-width: 64px; }
.operation-selection-actions { position: fixed; z-index: 78; display: flex; align-items: center; gap: 7px; max-width: calc(100vw - 16px); padding: 8px 9px; border: 1px solid rgba(179,119,30,.72); border-radius: 11px; background: rgba(42,39,31,.96); color: #fff2c7; box-shadow: 0 12px 30px rgba(24,21,16,.32); }
.operation-selection-actions[hidden] { display: none !important; }
.operation-selection-actions strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-selection-actions button { min-width: 58px; }
body[data-operation-interaction="pan"] #map { cursor: grab; }
body[data-operation-interaction="pan"] #map.dragging { cursor: grabbing; }
body[data-operation-interaction="select"] #map { cursor: pointer; }
body[data-operation-interaction="edit"] #map { cursor: move; }
body[data-operation-mode="enemy-capital"] #map,
body[data-operation-mode="camp"] #map,
body[data-operation-mode="barricade"] #map,
body[data-operation-mode="arrow-tower"] #map,
body[data-operation-mode="marker"] #map,
body[data-operation-mode="memo"] #map { cursor: crosshair; }
body[data-operation-mode="arrow"] #map,
body[data-operation-mode="polyline"] #map,
body[data-operation-mode="zone"] #map,
body[data-operation-mode="freehand"] #map { cursor: cell; }
.operations-tree-layer-row, .operation-feature-entry { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 4px; align-items: stretch; }
.operation-feature-entry { grid-template-columns: minmax(0,1fr) auto auto; }
.operations-tree-layer-row .operations-tree-layer, .operation-feature-entry .operation-feature-row { min-width: 0; }
.operations-row-action { width: auto; min-width: 46px; padding: 5px 7px; opacity: .18; transition: opacity .15s ease, background .15s ease; }
.operations-tree-layer-row:hover .operations-row-action, .operation-feature-entry:hover .operations-row-action, .operations-row-action:focus-visible { opacity: 1; }
.city-quick-card { margin-top: 16px; padding: 13px; border: 1px solid rgba(111,81,30,.25); border-radius: 12px; background: rgba(250,247,237,.9); }
.city-quick-card label { display: grid; gap: 5px; margin-top: 8px; color: #50493e; font-size: 12px; font-weight: 800; }
.city-quick-owner-row { display: grid; grid-template-columns: minmax(0,1fr) 48px auto; gap: 7px; align-items: end; }
.city-quick-owner-row input { min-width: 0; }
.tile-panel-head { display: grid !important; grid-template-columns: 1fr auto; gap: 4px 10px; }
.tile-panel-head .legend { grid-column: 1 / -1; }
#tile-panel-hide { align-self: start; min-width: 30px; padding: 5px; }
.map-inspector-stack { position: fixed; z-index: 5; top: 88px; right: 16px; width: 300px; max-height: calc(100vh - 112px); display: grid; gap: 8px; overflow: auto; }
#tile-info-panel { position: relative; inset: auto; width: 100%; height: auto; max-height: none; }
#tile-info-panel[hidden] { display: none !important; }
#tile-info-panel.is-collapsed .tile-panel-head { border-bottom: 0; }
#tile-info-panel.is-collapsed .tile-panel-head p,
#tile-info-panel.is-collapsed .tile-panel-head .legend { display: none; }
.resource-map-panel { overflow: hidden; border: 1px solid rgba(85,73,48,.3); border-radius: 9px; background: var(--panel); box-shadow: 0 7px 22px rgba(41,43,35,.16); }
.resource-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.resource-panel-head div { display: flex; align-items: baseline; gap: 7px; }
.resource-panel-head strong { font: 700 14px Georgia, "Noto Serif KR", serif; }
.resource-panel-head small { color: #827868; font-size: 10px; }
.resource-panel-body { display: grid; gap: 11px; max-height: min(520px, calc(100vh - 280px)); overflow: auto; padding: 11px; border-top: 1px solid #d5cfc1; }
.resource-visibility { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 9px; border-radius: 6px; background: #eee9dc; }
.resource-visibility label { display: flex; align-items: center; gap: 5px; font-size: 12px; }
#operations-panel { top: auto; right: auto; bottom: 22px; left: 102px; width: min(360px, calc(100vw - 124px)); max-height: 52vh; }
.ownership-panel { max-height: calc(100vh - 120px); overflow: auto; }
.ownership-direct-help { padding: 10px 12px; border-radius: 10px; background: rgba(213,234,207,.56); color: #31452e; }
.route-planner, .operations-panel, .ownership-panel, .intake-panel { width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 1500px) {
  .topbar { left: 12px; right: 12px; width: auto; padding: 9px 10px; }
  .topbar .brand small { display: none; }
  .topbar button, .topbar-more > summary { padding: 7px 9px; font-size: 13px; }
  .panel { top: 88px; right: 12px; width: min(300px, calc(100vw - 24px)); max-height: calc(100vh - 112px); overflow: auto; }
  .map-inspector-stack { right: 12px; width: min(300px, calc(100vw - 24px)); }
  .province-menu { top: 88px; left: 12px; width: 186px; max-height: calc(100vh - 112px); overflow: auto; }
}
@media (max-width: 1080px) {
  .topbar { overflow-x: auto; flex-wrap: nowrap; }
  .topbar .brand, .topbar-quick-actions { flex: 0 0 auto; }
  .topbar-quick-actions { margin-left: 0; }
  .map-inspector-stack { top: 82px; right: 12px; max-height: calc(100vh - 100px); }
  #tile-info-panel { max-height: 46vh; }
  .province-menu { width: 164px; }
  .route-quick-dock { bottom: 12px; }
}
@media (max-width: 720px) {
  .route-quick-points, .route-quick-options, .city-quick-actions { align-items: stretch; flex-direction: column; }
  .route-point-chip { min-width: 0; }
  .operation-symbol-grid { grid-template-columns: 1fr; }
  .operations-quick-panel { left: 10px; top: 78px; bottom: 10px; width: 64px; }
  .operation-options-popover { width: min(270px, calc(100vw - 94px)); }
  #operations-panel { left: 84px; bottom: 10px; width: calc(100vw - 94px); }
  .operations-canvas-confirm { width: min(280px, calc(100vw - 20px)); grid-template-columns: 1fr 1fr; }
  .operations-canvas-confirm strong { grid-column: 1 / -1; }
  .city-quick-owner-row { grid-template-columns: minmax(0,1fr) 44px; }
  .city-quick-owner-row button { grid-column: 1 / -1; }
}

.map-context-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 190px;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(111,81,30,.42);
  border-radius: 12px;
  background: rgba(250,247,237,.98);
  box-shadow: 0 18px 48px rgba(24,22,17,.28);
}
.map-context-menu[hidden] { display: none; }

.context-action-editor {
  position: fixed;
  z-index: 72;
  width: min(300px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid rgba(157, 116, 50, .58);
  border-radius: 14px;
  background: rgba(250, 247, 237, .98);
  box-shadow: 0 16px 42px rgba(35, 31, 24, .24);
}
.context-action-editor[hidden] { display: none; }
.context-action-editor, .context-action-editor label, .context-action-editor div { display: grid; gap: 8px; }
.context-action-editor div { grid-template-columns: 1fr 1fr; margin-top: 4px; }
.context-action-editor input { min-width: 0; padding: 9px 10px; border: 1px solid #c9bea9; border-radius: 8px; }
.map-context-menu strong { padding: 5px 7px; color: #6a5125; }
.map-context-menu button { width: 100%; text-align: left; white-space: nowrap; }
.map-context-menu button:disabled { opacity: .48; cursor: not-allowed; }
.context-route-bar {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: min(1120px, calc(100vw - 36px));
  min-width: 0;
  padding: 12px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(111,81,30,.38);
  border-radius: 14px;
  background: rgba(250,247,237,.97);
  box-shadow: 0 16px 48px rgba(24,22,17,.24);
}
.context-route-bar[hidden] { display: none; }
#context-route-summary { min-width: 0; flex: 1; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-route-toggle { flex: 0 0 auto; height: 32px; padding: 0 10px; }
.context-route-options { display: flex; align-items: center; gap: 12px; }
.context-route-level, .context-route-night { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.context-route-level select { min-width: 72px; padding: 7px 8px; }
.context-route-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.context-route-result { flex: 1 0 100%; min-width: 0; }
.context-route-result .route-result-card { margin: 0; }
.context-route-actions #context-route-calculate { display: none; }
.context-route-bar.is-collapsed { width: min(520px, calc(100vw - 24px)); padding: 9px 11px; }
.context-route-bar.is-collapsed .context-route-options,
.context-route-bar.is-collapsed .context-route-actions,
.context-route-bar.is-collapsed .context-route-result { display: none !important; }
.route-limited-notice { margin: 0 0 8px; padding: 8px 10px; border-left: 4px solid #ef7e32; border-radius: 7px; background: #fff0dc; color: #713a18; font-size: 12px; font-weight: 800; }
.operations-advanced { margin-top: 16px; padding-top: 14px; border-top: 1px solid #ddd2bd; }
.operations-advanced h3 { margin: 0 0 8px; font-size: 14px; }
.operations-layer-actions, .operations-feature-actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0; }
.operations-structure-fields { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; margin: 12px 0; padding: 10px; border: 1px solid #d8cbae; border-radius: 10px; background: #f2ecde; }
.operations-structure-fields legend { padding: 0 6px; color: #6e5428; font-size: 12px; font-weight: 900; }
.operations-structure-fields label { margin: 0; }
.operations-structure-fields output, .operations-structure-fields button { grid-column: 1 / -1; }
.operations-structure-fields output { min-height: 18px; color: #7d5820; font-size: 11px; font-weight: 800; }
.operations-property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.operations-property-grid .wide { grid-column: 1 / -1; }
.operations-property-grid label { min-width: 0; }
.operations-property-grid output { float: right; color: #9a6720; }
.operations-property-grid input[type='range'] { width: 100%; accent-color: #a77020; }
.operations-feature-actions button { flex: 1 1 auto; }
@media (max-width: 960px) {
  .context-route-bar { align-items: stretch; flex-direction: column; }
  #context-route-summary { width: auto; white-space: normal; }
  .context-route-bar.is-collapsed { right: 12px; bottom: 12px; left: 12px; width: auto; transform: none; flex-direction: row; align-items: center; }
  .context-route-options { align-items: stretch; flex-wrap: wrap; }
  .context-route-actions { justify-content: flex-end; }
  .panel { display: none; }
  .operations-property-grid { grid-template-columns: 1fr; }
  .operations-property-grid .wide { grid-column: auto; }
}
@media (max-width: 480px) {
  .map-context-menu { left: 10px !important; right: 10px; bottom: 10px; top: auto !important; max-height: 38vh; overflow: auto; }
  .context-route-night { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .map-context-menu, .context-route-bar { transition: none !important; animation: none !important; }
}
