:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  font-weight: 450;
  color: #283b4d;
  background: #f6f7f9;
  --navy: #253c51;
  --ink: #283b4d;
  --muted: #83909e;
  --line: #e1e6eb;
  --soft: #f3f6f8;
  --gold: #c7a45c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; min-width: 280px; }
body.map-expanded { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .42; cursor: not-allowed; }
button, input, textarea, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid #6485a1; }
a { color: inherit; }
.hidden { display: none !important; }

/* A restrained frame keeps the map, rather than the chrome, in focus. */
.topbar {
  height: 56px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 740;
  letter-spacing: .3px;
  white-space: nowrap;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
  color: #edcf88;
  font-size: 18px;
  letter-spacing: -.5px;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: #98a2ad;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1.7px;
}
.header-right { display: flex; align-items: center; gap: 18px; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.connection::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; background: #aeb6bf; border-radius: 50%; }
.connection.online::before { background: #5a9d7b; box-shadow: 0 0 0 3px #5a9d7b10; }
.connection.error::before { background: #cf796a; }
.button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #dce3ea;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  font-weight: 570;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.button:hover { background: #f7f9fb; border-color: #b8c6d2; }
.button.primary { color: #fff; border-color: var(--navy); background: var(--navy); }
.button.primary:hover { background: #36536b; border-color: #36536b; }
.button.danger { color: #b45e54; }
.text-button { padding: 5px 0; border: 0; background: none; color: #698095; font-size: 11px; white-space: nowrap; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; padding: 0; border: 0; border-radius: 7px; background: #f2f5f7; color: #6f8192; font-size: 22px; line-height: 1; }
.icon-button:hover { background: #e9eff4; }

main { max-width: 1920px; margin: 0 auto; padding: 16px 30px 22px; transition: padding-right .2s; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 10px; }
.heading-row > div:first-child { min-width: 0; }
.heading-row .eyebrow { display: none; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #97a2ac; font-size: 9px; font-weight: 650; letter-spacing: 1.35px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: #c5a05b; }
h1 { margin: 0 0 5px; color: #243a4f; font-size: 24px; font-weight: 730; line-height: 1.3; letter-spacing: -.45px; overflow-wrap: anywhere; }
#plan-subtitle { max-width: 900px; margin: 0; color: #8291a0; font-size: 11px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 100%; flex-shrink: 0; }
.collaboration-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 10px; padding: 5px 11px; border: 1px solid #e4e9ef; border-radius: 7px; background: #eef2f6; font-size: 11px; }
.collaboration-strip > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.strip-divider { width: 1px; height: 12px; flex-shrink: 0; background: #d1dbe4; }
#room-label { flex-shrink: 0; font-weight: 620; }
#collaborators { color: #8798a8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 13px 20px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: #566c80; font-size: 11px; font-weight: 520; white-space: nowrap; }
.swatch { width: 12px; height: 12px; flex: 0 0 12px; display: inline-block; border: 1px solid #00000008; border-radius: 3px; vertical-align: middle; }
.map-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.segmented { display: flex; padding: 3px; border: 1px solid #e0e6ed; border-radius: 8px; background: #edf1f5; white-space: nowrap; }
.segmented button { min-height: 30px; padding: 6px 11px; border: 0; border-radius: 5px; background: transparent; color: #93a0ad; font-size: 10px; }
.segmented button.active { color: #3b566e; background: #fff; box-shadow: 0 1px 4px #243b4e10; }
.search { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.search span { color: #8797a5; font-size: 21px; line-height: 1; }
.search input { width: 145px; min-width: 0; padding: 2px 0; border: 0; background: none; color: #3c5369; font-size: 11px; }
.search input::placeholder { color: #9aa6b3; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: #9bb2c6; box-shadow: 0 0 0 2px #9bb2c610; }
.hint-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; color: #96a4b1; font-size: 9px; line-height: 1.6; }
.hint-row > span:last-child { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mini-line, .mini-dash { display: inline-block; width: 12px; height: 8px; margin-left: 9px; border: 1.3px solid #a07c40; border-radius: 1px; }
.mini-dash { border-style: dashed; }
.mini-hatch { width: 12px; height: 8px; margin-left: 9px; background: repeating-linear-gradient(135deg, #84cbd8 0 1px, transparent 1px 3px); }
.mini-note { width: 4px; height: 4px; margin-left: 9px; border-radius: 50%; background: #698197; }
.stage-tabs { display: flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; margin: 0 auto 8px; padding: 4px; border: 1px solid #e0e6ec; border-radius: 9px; background: #edf1f5; }
.stage-tabs button { min-height: 30px; padding: 6px 16px; border: 0; border-radius: 6px; background: transparent; color: #8b9aa8; font-size: 11px; white-space: nowrap; }
.stage-tabs button.active { color: #314c64; background: #fff; box-shadow: 0 1px 5px #253e5310; font-weight: 650; }

/* Map cards and a deliberately quiet, separate camera control bar. */
.boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
.board { display: flex; min-width: 0; flex-direction: column; overflow: hidden; position: relative; border: 1px solid #dce4ec; border-radius: 13px; background: #fff; box-shadow: 0 2px 4px #243b4e02; transition: border-color .18s; }
.board.active-board { border-color: #aebfd0; }
.board-top { padding: 19px 20px 15px; }
.board-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #a3aebb; font-size: 8px; font-weight: 600; letter-spacing: 1.6px; }
.board-kicker button { width: 26px; height: 26px; display: grid; place-items: center; margin: -5px -5px -5px 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #a1aebb; font-size: 15px; }
.board-kicker button:hover { background: #f1f5f8; color: #496b88; }
.board h2 { margin: 8px 0 15px; color: #2f475d; font-size: 19px; line-height: 1.4; font-weight: 700; letter-spacing: -.3px; }
.scoreline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 25px; }
.score { display: flex; align-items: center; gap: 7px; color: #8a9aaa; font-size: 10px; line-height: 1.6; }
.score strong { color: #36516a; font-size: 20px; font-weight: 690; line-height: 1.3; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.score small { color: #8c9bab; font-size: 10px; }
.score .warning { color: #bc7842; }
.map-wrap { position: relative; min-width: 0; padding: 0 13px; }
.map-viewport { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid #e2e8ef; border-radius: 8px; background: #f4f7fa; cursor: grab; isolation: isolate; touch-action: none; }
.map-viewport.is-dragging, .map-viewport.is-dragging * { cursor: grabbing !important; }
.map-svg { display: block; width: 100%; height: 100%; min-width: 0; background: #f4f7fa; touch-action: none; user-select: none; -webkit-user-select: none; }
.map-viewport > .map-svg { position: absolute; inset: 0; }
.map-wrap > .map-svg { aspect-ratio: 1 / 1; height: auto; border: 1px solid #e2e8ef; border-radius: 8px; }
.city { cursor: pointer; outline: none; }
.city-fill { vector-effect: non-scaling-stroke; transition: fill .12s, filter .12s; }
.city:hover .city-fill, .city:focus-visible .city-fill { filter: brightness(.98); stroke: #69849a; stroke-width: 1.6px; }
.city.selected .city-fill { stroke: #365b7a; stroke-width: 2.2px; }
.city-label, .city-name-label, .city-status-label, .city-level-label { font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; pointer-events: none; user-select: none; paint-order: stroke fill; stroke: #ffffffdf; stroke-linejoin: round; }
.city-label { font-weight: 620; }
.city-name-label { fill: #5f7387; font-weight: 450; opacity: 0; visibility: hidden; }
.city-note-dot { stroke: #fff; }
.map-svg[data-zoom-detail="true"] .city-name-label, .map-svg.is-detailed .city-name-label, .map-svg[data-detail="true"] .city-name-label { opacity: 1; visibility: visible; }
.map-svg[data-compact-labels="true"] .city-label[data-level="1"] { opacity: 0; visibility: hidden; }
.map-controlbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 49px; padding: 7px 1px 3px; }
.map-gesture-hint { min-width: 0; color: #a2aeba; font-size: 9px; line-height: 1.5; }
.zoom-tools { display: inline-flex; align-items: center; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid #e2e8ee; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px #263d5105; }
.zoom-tools button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: #698095; font-size: 17px; line-height: 1; }
.zoom-tools button:hover { color: #2b4c69; background: #f0f4f7; }
.zoom-tools button:active { background: #e7eef4; }
.zoom-tools button[data-map-action="reset"], .zoom-tools button[data-zoom="reset"] { font-size: 10px; }
.zoom-tools button svg { width: 16px; height: 16px; }
.zoom-level { min-width: 40px; color: #768b9e; text-align: center; font-size: 10px; font-weight: 570; font-variant-numeric: tabular-nums; }
.map-chrome { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.map-caption { color: #a0adba; font-size: 10px; }
.map-actions { display: flex; align-items: center; gap: 5px; }
.board-notes { flex: 1; min-width: 0; padding: 9px 20px 15px; }
.board-notes textarea { width: 100%; min-height: 110px; margin: 0; padding: 7px 9px; resize: vertical; border: 1px solid transparent; border-radius: 6px; background: #fafbfd; color: #778b9e; font-size: 11px; line-height: 1.85; white-space: pre-wrap; }
.board-notes textarea:hover { border-color: #e4eaf0; }
.board-notes textarea:focus { border-color: #b5c6d5; background: #fff; outline: none; box-shadow: 0 0 0 2px #9db6ca0c; }
.board-notes textarea[readonly] { resize: none; }
.board-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 8px 20px; border-top: 1px solid #edf1f5; color: #a3afba; font-size: 9px; line-height: 1.5; }
.board-bottom > span { min-width: 0; overflow-wrap: anywhere; }
.all-stats { flex-shrink: 0; padding: 3px 0; border: 0; background: transparent; color: #7c92a6; font-size: 9px; }
.boards.focus { display: block; max-width: 1240px; margin: 0 auto; }
.boards.focus .board-top { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 14px 22px 12px; }
.boards.focus .board h2 { margin: 7px 0 0; font-size: 21px; }
.boards.focus .board-kicker button { display: none; }
.boards.focus .scoreline { gap: 27px; flex-shrink: 0; }
.boards.focus .score strong { font-size: 23px; }
.boards.focus .map-viewport { height: clamp(420px, 63dvh, 820px); aspect-ratio: auto; }
.boards.focus .map-wrap { padding: 0 14px; }
.boards.focus .map-controlbar { min-height: 51px; padding: 8px 1px 2px; }
.boards.focus .map-gesture-hint { font-size: 10px; }
.boards.focus .zoom-tools button { width: 36px; height: 34px; }
.boards.focus .zoom-level { min-width: 45px; }
.boards.focus .board-notes { padding: 8px 22px 16px; }
.boards.focus .board-notes textarea { min-height: 65px; font-size: 12px; }

/* Expanded view uses the same SVG and camera, with its controls always in reach. */
.expanded-map-heading { display: none; }
.map-wrap.is-expanded { position: fixed; inset: 16px; z-index: 50; display: flex; flex-direction: column; min-width: 0; padding: 0 !important; border: 1px solid #dce5ed; border-radius: 14px; background: #fff; box-shadow: 0 20px 90px #1c344a2e; }
.map-wrap.is-expanded .expanded-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-shrink: 0; min-height: 62px; padding: 15px 22px; color: #3d5870; font-size: 16px; font-weight: 650; }
.map-wrap.is-expanded .expanded-map-heading button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: #f0f4f7; color: #7890a4; font-size: 22px; }
.map-wrap.is-expanded .map-viewport { flex: 1; width: calc(100% - 30px); height: auto !important; min-height: 0; max-height: none; margin: 0 15px; border-radius: 9px; aspect-ratio: auto; }
.map-wrap.is-expanded .map-controlbar { flex-shrink: 0; min-height: 63px; padding: 9px 20px; }
.map-wrap.is-expanded .map-gesture-hint { font-size: 11px; }
.map-wrap.is-expanded .zoom-tools button { width: 38px; height: 36px; }
body.map-expanded.city-panel-open .map-wrap.is-expanded { right: 368px; }
.footer-info { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 20px 2px 0; color: #a2adb8; font-size: 9px; line-height: 1.85; }
.footer-info > p { max-width: 380px; text-align: right; }
.footer-info p { margin: 4px 0; }
.source-badge { color: #8093a5; font-size: 9px; font-weight: 550; letter-spacing: .35px; }

/* The editor stays separate from the map camera and retains comfortable targets. */
.inspector { position: fixed; z-index: 70; top: 86px; right: 20px; bottom: 20px; width: 330px; padding: 20px; overflow: auto; overscroll-behavior: contain; border: 1px solid #dce5ee; border-radius: 13px; background: #fff; box-shadow: 0 12px 50px #243d5620; }
.inspector-header { position: sticky; top: -20px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 13px; margin: -4px 0 17px; padding: 8px 0 13px; border-bottom: 1px solid #edf1f5; background: #fff; }
.inspector h2 { margin: 7px 0 0; color: #2f4c64; font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.field-label { display: block; margin: 20px 0 8px; color: #7c8fa1; font-size: 11px; font-weight: 620; }
.owner-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.owner-option { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 9px 8px; border: 1px solid #e1e7ee; border-radius: 7px; background: #fff; color: #718699; font-size: 11px; text-align: left; }
.owner-option:hover { background: #f7fafc; border-color: #b6c8d8; }
.owner-option.active { color: #345a77; border-color: #7896b0; background: #f2f7fb; box-shadow: 0 0 0 1px #7896b018; }
.inspector select, .inspector textarea, .form-input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #dce5ed; border-radius: 7px; background: #fff; color: #4a637a; font-size: 12px; line-height: 1.5; }
.inspector select { min-height: 42px; }
.inspector textarea { min-height: 94px; resize: vertical; line-height: 1.8; }
.inspector textarea::placeholder { color: #a5b1bd; }
.city-meta { display: flex; flex-wrap: wrap; gap: 6px; color: #8d9eac; font-size: 9px; }
.meta-chip { padding: 5px 7px; border: 1px solid #e8edf2; border-radius: 5px; background: #f7f9fb; }
.small-help { color: #97a6b5; font-size: 10px; line-height: 1.8; }
.adjacent { display: flex; flex-wrap: wrap; gap: 6px; }
.adjacent button { min-height: 32px; padding: 6px 10px; border: 1px solid #dce6ee; border-radius: 5px; background: #f6f9fb; color: #6d879e; font-size: 11px; }
.adjacent button:hover { background: #eaf2f8; }
.inspector .save-note { width: 100%; min-height: 39px; margin-top: 8px; }
.inspector .selected-info { margin-top: 18px; padding: 11px 12px; border-radius: 7px; background: #f5f8fa; color: #8a9dac; font-size: 10px; line-height: 1.85; }
.annotation-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf1f5; }
.annotation-actions .button { min-width: 0; min-height: 40px; padding: 9px 8px; white-space: normal; overflow-wrap: anywhere; }
.annotation-actions .button.danger, #clear-annotations-button { color: #a16050; border-color: #e6d6ce; background: #fff9f5; }
.annotation-actions .button.danger:hover, #clear-annotations-button:hover { border-color: #cfb1a3; background: #fbf0e9; }
.annotation-actions [data-undo-annotations], #undo-annotations-button { color: #58748c; border-color: #d9e3ec; background: #f7fafc; }
.annotation-actions [data-undo-annotations]:hover, #undo-annotations-button:hover { border-color: #b5c8d8; background: #edf4f9; }

/* Existing sharing, settings and history flows retain their layout. */
dialog { width: 510px; max-width: calc(100vw - 28px); max-height: 88dvh; padding: 25px; border: 1px solid #dce5ed; border-radius: 14px; color: #39556d; background: #fff; box-shadow: 0 18px 100px #18364f30; }
dialog::backdrop { background: #253b504f; backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.modal-head h2 { margin: 0; color: #304c63; font-size: 19px; font-weight: 680; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.clear-scope-options { display: grid; gap: 9px; margin: 15px 0; }
.clear-scope-options label { display: flex; align-items: flex-start; gap: 10px; min-height: 60px; padding: 12px; border: 1px solid #e1e7ee; border-radius: 8px; background: #fff; color: #627c91; cursor: pointer; font-size: 12px; line-height: 1.7; }
.clear-scope-options label:hover { border-color: #b6c9d8; background: #fafcfd; }
.clear-scope-options label:has(input:checked) { border-color: #9db6cb; background: #f3f8fb; box-shadow: 0 0 0 1px #9db6cb10; }
.clear-scope-options label:focus-within { outline: 2px solid #9db6cb; outline-offset: 2px; }
.clear-scope-options input[type="radio"], .clear-notes-option input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 3px 0 0; accent-color: #456780; cursor: pointer; }
.clear-scope-options label > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.clear-scope-options strong { display: block; color: #415f77; font-weight: 650; }
.clear-scope-options small { display: block; margin-top: 2px; color: #91a1af; font-size: 11px; line-height: 1.6; }
.clear-summary { margin: 14px 0 8px; padding: 11px 12px; border: 1px solid #e6ebef; border-radius: 7px; background: #f6f9fb; color: #738a9d; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.clear-summary strong { color: #44667e; font-weight: 650; }
.clear-summary p { margin: 3px 0; }
.clear-notes-option { display: flex; align-items: flex-start; gap: 9px; min-height: 44px; padding: 11px 0; color: #8195a5; cursor: pointer; font-size: 12px; line-height: 1.7; }
.clear-notes-option > span { min-width: 0; overflow-wrap: anywhere; }
dialog .modal-actions .button.danger { color: #fff; border-color: #a36250; background: #a36250; }
dialog .modal-actions .button.danger:hover { border-color: #91543f; background: #91543f; }
.share-link { display: flex; gap: 7px; }
.share-link input { min-width: 0; flex: 1; color: #889cab; font-size: 11px; }
.modal-copy { margin: 5px 0 18px; color: #8a9daa; font-size: 12px; line-height: 1.9; }
.form-row { display: flex; align-items: flex-end; gap: 10px; margin: 7px 0; }
.form-row > label { min-width: 0; flex: 1; }
.form-row input[type="color"] { width: 43px; height: 39px; flex: 0 0 43px; padding: 3px; }
.form-label { display: block; margin: 14px 0 6px; color: #7d93a5; font-size: 11px; }
.form-input + .form-input { margin-top: 7px; }
.events { display: flex; flex-direction: column; gap: 0; max-height: 52dvh; overflow: auto; }
.event { padding: 13px 0; border-bottom: 1px solid #edf1f5; font-size: 11px; line-height: 1.8; }
.event time { float: right; color: #a3b1be; font-size: 10px; }
.event strong { color: #5a7890; }
.event p { margin: 3px 0; color: #8b9fac; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 100; bottom: 24px; left: 50%; max-width: min(520px, 90vw); padding: 11px 18px; transform: translateX(-50%) translateY(15px); transition: opacity .18s, transform .18s; border: 1px solid #ffffff12; border-radius: 8px; background: #2c485f; color: #fff; box-shadow: 0 6px 30px #213b521f; font-size: 12px; line-height: 1.7; opacity: 0; pointer-events: none; }
.toast.visible { transform: translateX(-50%); opacity: 1; }
.backup-actions { display: grid; gap: 9px; }
.conflict { padding: 12px; border: 1px solid #ecd8b7; border-radius: 7px; background: #fff8ed; color: #9a7b4c; font-size: 12px; line-height: 1.8; }
.readonly-note { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #f3e6cf; border-radius: 7px; background: #fffaf1; color: #ab8b57; font-size: 11px; line-height: 1.8; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-table td, .stat-table th { padding: 11px 6px; border-bottom: 1px solid #edf1f5; text-align: left; }
.stat-table th { color: #9dabb8; font-size: 10px; font-weight: 500; }
.empty-state { padding: 28px; color: #9aabb8; font-size: 12px; text-align: center; }
.no-script { padding: 30px; text-align: center; }
.print-heading { display: none; }

@media (min-width: 1024px) {
  body.city-panel-open main { padding-right: 378px; }
  body.city-panel-open .heading-row { align-items: flex-start; flex-wrap: wrap; gap: 13px; }
  body.city-panel-open .workspace-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  body.city-panel-open .boards.focus .board-top { gap: 16px; }
  body.city-panel-open .boards.focus .scoreline { gap: 18px; }
}

@media (min-width: 1700px) {
  .board-top { padding: 23px 24px 18px; }
  .board h2 { font-size: 21px; }
  .score strong { font-size: 23px; }
  .score, .legend-item { font-size: 12px; }
  .board-notes { padding: 11px 24px 18px; }
  .board-notes textarea { min-height: 120px; font-size: 12px; }
  .board-bottom { font-size: 10px; }
  .map-gesture-hint { font-size: 10px; }
}

@media (max-width: 1150px) {
  .connection { display: none; }
  .workspace-toolbar { flex-wrap: wrap; gap: 13px; }
  .map-tools { margin-left: auto; }
  .board-top { padding: 16px 15px 13px; }
  .board h2 { font-size: 17px; }
  .scoreline { gap: 10px; }
  .score strong { font-size: 18px; }
  .map-wrap { padding: 0 10px; }
  .map-controlbar { justify-content: flex-end; }
  .map-gesture-hint { display: none; }
  .board-notes { padding: 8px 15px 14px; }
  .board-bottom { padding: 8px 15px; }
}

@media (max-width: 1023px) {
  .topbar { padding: 0 22px; }
  main { padding: 16px 22px 22px; }
  .heading-row { align-items: flex-start; gap: 16px; }
  h1 { font-size: 25px; }
  .heading-actions { gap: 5px; }
  .heading-actions .button { padding: 8px 10px; }
  .boards { gap: 13px; }
  .boards.focus .board-top { gap: 18px; }
  .boards.focus .board h2 { font-size: 20px; }
  .boards.focus .score strong { font-size: 21px; }
  .boards.focus .map-viewport { height: clamp(260px, 60dvh, 640px); }
  .boards.focus .map-gesture-hint { display: block; }
  .inspector { top: auto; right: 12px; bottom: 0; left: 12px; width: auto; height: 46dvh; max-height: 46dvh; padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 45px #233f581b; }
  .inspector::before { content: ''; display: block; width: 38px; height: 4px; margin: -4px auto 8px; border-radius: 4px; background: #d3dce4; }
  .inspector-header { top: -14px; margin-bottom: 12px; padding: 8px 0 11px; }
  .inspector h2 { font-size: 20px; }
  .field-label { margin-top: 16px; }
  body.city-panel-open { padding-bottom: calc(46dvh + 20px); }
  body.city-panel-open .boards.focus .map-viewport { height: min(40dvh, calc(54dvh - 112px)); min-height: 0; }
  body.map-expanded.city-panel-open .map-wrap.is-expanded .map-viewport { min-height: 0; }
  body.map-expanded.city-panel-open .map-wrap.is-expanded { right: 16px; bottom: calc(46dvh + 8px); }
  body.map-expanded.city-panel-open { padding-bottom: 0; }
}

@media (max-width: 900px) {
  .boards { grid-template-columns: minmax(0, 1fr); }
  .boards:not(.focus) .board { max-width: 680px; width: 100%; margin: 0 auto; }
  .boards:not(.focus) .map-viewport { max-height: 65dvh; aspect-ratio: auto; height: 65dvh; }
  .board-top { padding: 18px; }
  .board h2 { font-size: 20px; }
  .scoreline { gap: 24px; }
  .score strong { font-size: 21px; }
  .map-wrap { padding: 0 12px; }
  .map-gesture-hint { display: block; }
  .map-controlbar { justify-content: space-between; }
  .board-notes { padding: 8px 18px 15px; }
  .board-notes textarea { min-height: 85px; font-size: 12px; }
  .board-bottom { padding: 9px 18px; }
}

@media (max-width: 600px) {
  .topbar { height: 56px; padding: 0 15px; gap: 12px; }
  .brand { gap: 9px; font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
  .brand small { margin-top: 3px; font-size: 6.5px; letter-spacing: 1.25px; }
  .header-right { gap: 0; }
  .header-right .button { min-height: 35px; padding: 8px 10px; font-size: 10px; }
  main { padding: 16px 13px 20px; }
  .heading-row { display: block; margin-bottom: 10px; }
  .eyebrow { font-size: 8px; letter-spacing: 1px; }
  h1 { margin-top: 0; font-size: 22px; line-height: 1.35; letter-spacing: -.4px; }
  #plan-subtitle { color: #91a0ad; font-size: 10px; line-height: 1.75; }
  .heading-actions { justify-content: flex-end; gap: 5px; margin-top: 12px; }
  .heading-actions .button { min-height: 32px; padding: 7px 10px; font-size: 10px; }
  .collaboration-strip { align-items: flex-start; gap: 8px; min-height: 30px; margin-bottom: 10px; padding: 5px 9px; font-size: 9px; }
  .collaboration-strip > div { flex: 1; gap: 7px; padding-top: 3px; }
  #room-label { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
  .strip-divider { height: 10px; }
  #nickname-button { max-width: 120px; min-width: 0; overflow: hidden; color: #8297a8; text-overflow: ellipsis; font-size: 9px; }
  .workspace-toolbar { display: block; margin-bottom: 9px; }
  .legend { gap: 8px 13px; margin-bottom: 13px; }
  .legend-item { gap: 5px; font-size: 10px; }
  .swatch { width: 11px; height: 11px; flex-basis: 11px; }
  .map-tools { width: 100%; gap: 8px; margin: 0; }
  .segmented { flex: 0 0 auto; padding: 3px; }
  .segmented button { min-height: 30px; padding: 6px 8px; font-size: 10px; }
  .search { min-width: 0; flex: 1; gap: 4px; padding: 6px 8px; }
  .search span { font-size: 19px; }
  .search input { width: 100%; min-width: 0; font-size: 10px; }
  .hint-row { justify-content: flex-end; gap: 5px; margin-bottom: 8px; font-size: 8px; }
  .hint-row > span:first-child { display: none; }
  .hint-row > span:last-child { justify-content: flex-end; gap: 4px; }
  .mini-line, .mini-dash, .mini-hatch, .mini-note { margin-left: 7px; }
  .mini-line, .mini-dash, .mini-hatch { width: 10px; height: 7px; }
  .stage-tabs { position: sticky; top: 0; z-index: 10; justify-content: space-between; width: 100%; gap: 3px; margin-bottom: 8px; padding: 4px; border-radius: 8px; box-shadow: 0 1px 0 #ffffffc0; }
  body.city-panel-open .stage-tabs { position: static; }
  .stage-tabs button { min-width: 0; min-height: 36px; flex: 1; padding: 7px 4px; font-size: 10px; }
  .board { border-radius: 11px; }
  .board-top { padding: 16px 15px 13px; }
  .board h2 { font-size: 18px; }
  .board-kicker { font-size: 7px; letter-spacing: 1.3px; }
  .scoreline { gap: 22px; }
  .score { font-size: 9px; }
  .score strong { font-size: 20px; }
  .score small { font-size: 9px; }
  .boards.focus .board-top { display: block; padding: 14px 15px 12px; }
  .boards.focus .board h2 { margin-top: 6px; font-size: 18px; }
  .boards.focus .scoreline { margin-top: 13px; gap: 24px; }
  .boards.focus .score strong { font-size: 20px; }
  .boards.focus .map-wrap, .map-wrap { padding: 0 8px; }
  .boards.focus .map-viewport { height: auto; min-height: 0; aspect-ratio: 1 / 1; border-radius: 7px; }
  .map-controlbar, .boards.focus .map-controlbar { min-height: 58px; padding: 6px 0 3px; gap: 6px; }
  .map-gesture-hint, .boards.focus .map-gesture-hint { max-width: 95px; color: #9dabba; font-size: 8px; line-height: 1.7; }
  .zoom-tools { gap: 0; padding: 1px; border-radius: 7px; }
  .zoom-tools button, .boards.focus .zoom-tools button { width: 44px; min-width: 44px; height: 44px; padding: 5px; font-size: 18px; }
  .zoom-level, .boards.focus .zoom-level { min-width: 37px; font-size: 9px; }
  .zoom-tools button[data-map-action="reset"], .boards.focus .zoom-tools button[data-map-action="reset"] { font-size: 12px; white-space: nowrap; }
  .board-notes, .boards.focus .board-notes { padding: 7px 14px 13px; }
  .board-notes textarea, .boards.focus .board-notes textarea { min-height: 80px; padding: 7px 8px; color: #8599aa; font-size: 11px; }
  .board-bottom { align-items: flex-start; gap: 9px; padding: 8px 14px; font-size: 8px; }
  .all-stats { font-size: 9px; }
  .footer-info { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 15px; font-size: 8px; }
  .footer-info > p { max-width: none; text-align: left; }
  .source-badge { font-size: 8px; }
  .map-wrap.is-expanded { inset: 0; border: 0; border-radius: 0; }
  .map-wrap.is-expanded .expanded-map-heading { min-height: 55px; padding: calc(9px + env(safe-area-inset-top, 0px)) 13px 9px; font-size: 14px; }
  .map-wrap.is-expanded .expanded-map-heading button { width: 44px; height: 44px; font-size: 23px; }
  .map-wrap.is-expanded .map-viewport { width: calc(100% - 16px); margin: 0 8px; min-height: 0; border-radius: 7px; }
  .map-wrap.is-expanded .map-controlbar { min-height: 63px; padding: 7px 11px calc(7px + env(safe-area-inset-bottom, 0px)); }
  .map-wrap.is-expanded .map-gesture-hint { max-width: 100px; font-size: 9px; }
  .map-wrap.is-expanded .zoom-tools button { width: 44px; height: 44px; }
  .inspector { right: 0; left: 0; height: 46dvh; max-height: 46dvh; padding: 12px 17px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 17px 17px 0 0; }
  .inspector-header { top: -12px; padding-top: 7px; margin-bottom: 12px; }
  .inspector h2 { font-size: 19px; }
  .inspector .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .city-meta { font-size: 9px; }
  .owner-option { min-height: 44px; padding: 10px; font-size: 11px; }
  .inspector select { min-height: 44px; font-size: 13px; }
  .inspector textarea { font-size: 13px; }
  .inspector .save-note { min-height: 44px; }
  .adjacent button { min-height: 38px; min-width: 44px; }
  body.city-panel-open .boards.focus .map-viewport { height: min(40dvh, calc(54dvh - 112px)); min-height: 0; }
  body.map-expanded.city-panel-open .map-wrap.is-expanded { inset: 0 0 46dvh; }
  body.city-panel-open .toast { bottom: calc(46dvh + 12px); }
  dialog { max-width: calc(100vw - 22px); padding: 19px; border-radius: 12px; }
  .modal-head h2 { font-size: 18px; }
  .modal-copy { font-size: 11px; }
  .form-input, .share-link input { font-size: 12px; }
  .modal-actions .button, .backup-actions .button { min-height: 42px; }
}

@media (max-width: 360px) {
  .topbar { padding: 0 11px; }
  .brand small { letter-spacing: .8px; }
  main { padding-right: 10px; padding-left: 10px; }
  h1 { font-size: 20px; }
  .heading-actions .button { padding-right: 9px; padding-left: 9px; }
  .legend { gap: 8px 10px; }
  .legend-item { font-size: 9px; }
  .segmented button { padding-right: 6px; padding-left: 6px; font-size: 9px; }
  .search input { font-size: 9px; }
  .map-gesture-hint, .boards.focus .map-gesture-hint { display: none; }
  .map-controlbar, .boards.focus .map-controlbar { justify-content: flex-end; }
  .zoom-tools button, .boards.focus .zoom-tools button { width: 44px; min-width: 44px; height: 44px; }
  .zoom-level, .boards.focus .zoom-level { min-width: 33px; }
  .stage-tabs button { font-size: 9px; }
}

@media (max-width: 1023px) {
  /* Native-size inputs avoid focus zoom in iOS browsers. */
  .search input, .form-input, .share-link input,
  .inspector select, .inspector textarea,
  .board-notes textarea, .boards.focus .board-notes textarea { font-size: 16px; }
}

@media (pointer: coarse) {
  .zoom-tools button, .boards.focus .zoom-tools button, .map-wrap.is-expanded .zoom-tools button { min-width: 44px; width: 44px; height: 44px; }
  .map-controlbar, .boards.focus .map-controlbar { min-height: 58px; }
  .stage-tabs button { min-height: 44px; }
  .expanded-map-heading button, .map-wrap.is-expanded .expanded-map-heading button { min-width: 44px; min-height: 44px; }
  .inspector .icon-button { min-width: 44px; min-height: 44px; flex-basis: 44px; }
  .annotation-actions .button, .heading-actions .button, dialog .modal-actions .button { min-height: 44px; }
  .clear-scope-options label { min-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media print {
  @page { size: A3 landscape; margin: 10mm; }
  body { min-width: 0; padding-bottom: 0 !important; overflow: visible !important; background: #fff; }
  .topbar, .heading-actions, .collaboration-strip, .workspace-toolbar, .hint-row, .footer-info, .inspector, dialog, .toast, .board-kicker button, .all-stats, .stage-tabs, .map-controlbar, .expanded-map-heading { display: none !important; }
  main, body.city-panel-open main { max-width: none; padding: 0; }
  .heading-row { display: block; margin-bottom: 13px; }
  h1 { font-size: 22px; }
  #plan-subtitle { max-width: none; font-size: 10px; }
  .boards, .boards.focus { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: none; }
  .board, .board.hidden { display: flex !important; break-inside: avoid; border-color: #dfe6ed; border-radius: 9px; box-shadow: none; }
  .board-top, .boards.focus .board-top { display: block; padding: 13px; }
  .board h2, .boards.focus .board h2 { margin: 8px 0 12px; font-size: 17px; }
  .scoreline, .boards.focus .scoreline { margin-top: 0; gap: 14px; }
  .score strong, .boards.focus .score strong { font-size: 17px; }
  .map-wrap, .boards.focus .map-wrap, .map-wrap.is-expanded { position: relative; inset: auto; z-index: auto; display: block; width: auto; min-height: 0; padding: 0 9px !important; border: 0; border-radius: 0; box-shadow: none; }
  .map-viewport, .boards.focus .map-viewport, .map-wrap.is-expanded .map-viewport { display: block; flex: none; width: 100%; height: auto !important; min-height: 0 !important; max-height: none; aspect-ratio: 1 / 1; margin: 0; overflow: hidden; border: 1px solid #e1e7ef; border-radius: 5px; }
  .map-svg { width: 100%; height: 100%; min-height: 0; }
  .city-fill { vector-effect: none; }
  .map-svg[data-compact-labels="true"] .city-label[data-level="1"] { opacity: 1; visibility: visible; }
  .board-notes, .boards.focus .board-notes { padding: 9px 12px; }
  .board-notes textarea, .boards.focus .board-notes textarea { min-height: 110px; padding: 5px 0; border: 0; background: transparent; color: #71869b; font-size: 10px; resize: none; }
  .board-bottom { padding: 8px 12px; }
  .board, .map-svg, .map-viewport { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
