.home-territory{padding-top:0}
.territory-layout{display:grid;gap:24px;align-items:start}
.territory-landmarks{padding:20px;border:1px solid var(--line);border-radius:20px;background:var(--white)}
.home-territory .territory-landmarks h3{margin:0 0 18px;font-size:18px;line-height:1.3}
.territory-landmarks .territory-legend{margin:0}
.territory-inline{position:relative;border-radius:24px;overflow:hidden;background:#d8dfcc}
.territory-inline .territory-viewport{width:100%;aspect-ratio:1447/1087;touch-action:pan-y;overscroll-behavior:auto;cursor:default}
.territory-inline .territory-viewport.is-zoomed{touch-action:none;overscroll-behavior:contain;cursor:grab}
.territory-inline .territory-viewport.is-dragging{cursor:grabbing}
.territory-inline .territory-tools{display:none;position:absolute;z-index:1;left:12px;top:12px;padding:6px;gap:6px;background:var(--paper);border:1px solid var(--line);border-radius:14px;box-shadow:0 2px 10px #203c3020}
.territory-inline.is-interactive .territory-tools{display:flex}
.territory-inline .territory-tools p{display:none}
.territory-inline .territory-tools button{padding:6px 10px}
.territory-inline .territory-tools output{min-width:44px}
.territory-inline .territory-status{position:absolute;inset:0 0 auto;background:var(--paper);padding:12px 18px}
.territory-inline:not(.is-interactive) .territory-canvas{display:block;width:100%;height:auto}
.territory-inline:not(.is-interactive) .territory-map-layer{width:100%;height:auto}
@media(max-width:639px){
 .territory-inline{border-radius:16px}
 .territory-inline .territory-tools{flex-direction:column;top:8px;left:8px;padding:4px;gap:4px}
 .territory-inline .territory-tools output{display:none}
 .territory-inline [data-territory-in]{order:0}
 .territory-inline [data-territory-out]{order:1}
 .territory-inline [data-territory-fit]{order:2;font-size:0}
 .territory-inline [data-territory-fit]::after{content:'↺';font-size:22px}
}
.territory-preview,.territory-map-layer{position:relative}
.territory-map-layer{width:var(--map-width,100%);height:var(--map-height,auto)}
.territory-annotations{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.territory-annotations__line{stroke:#315749;stroke-width:3}
.territory-annotations__line .territory-annotations__halo{stroke:#f8f3df;stroke-width:6}
.territory-annotations__text{font:600 20px Georgia,serif;fill:#244638;stroke:#f8f3df;stroke-width:5;paint-order:stroke;stroke-linejoin:round}
.territory-note{font-size:15px;line-height:1.6;color:var(--muted);margin-top:18px;max-width:76ch}
.home-territory .territory-video{margin-top:32px;padding-top:28px;border-top:1px solid var(--line)}
.territory-video>p:not(.home-embed-status){margin-top:10px;color:var(--muted)}
.territory-map-layer:has(img[style*="hidden"]) .territory-annotations{visibility:hidden}
.territory-preview{display:block;overflow:hidden;border-radius:24px;cursor:zoom-in;background:var(--line)}
.territory-preview img{display:block;width:100%;height:auto}
.territory-legend{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 24px;list-style:none;margin:26px 0 0;padding:0}
.territory-legend li{display:flex;align-items:center;gap:10px;font-size:15px;line-height:1.4}
.territory-number{display:inline-grid;place-items:center;flex:0 0 28px;height:28px;border-radius:50%;background:var(--green);color:var(--white);font-size:13px;font-weight:500}
.territory-dialog{position:fixed;inset:0;margin:auto;width:min(1440px,calc(100vw - 40px));height:calc(100dvh - 40px);max-width:none;max-height:none;border-radius:20px;overflow:hidden}
.territory-dialog[open]{display:flex;flex-direction:column}
.territory-dialog__header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 24px 12px}
.territory-dialog__header h2{font-size:24px;line-height:1.2}
.territory-close{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;white-space:nowrap;border:1px solid var(--line);border-radius:10px}
.territory-close span{font-size:24px;line-height:1}
.territory-tools{display:flex;gap:8px;align-items:center;padding:0 24px 12px}
.territory-tools button{min-width:44px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--white)}
.territory-tools button:disabled{opacity:.45;cursor:default}
.territory-tools output{min-width:52px;text-align:center;font-size:14px;font-variant-numeric:tabular-nums}
.territory-tools p{margin-left:auto;font-size:14px;color:var(--muted)}
.territory-viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:none;background:#d8dfcc;cursor:grab}
.territory-viewport.is-dragging{cursor:grabbing}
.territory-canvas{display:grid;place-items:center;width:max(100%,var(--map-width,100%));height:max(100%,var(--map-height,100%))}
.territory-canvas img{display:block;width:var(--map-width,100%);height:var(--map-height,auto);max-width:none;user-select:none;-webkit-user-drag:none}
.territory-status{padding:10px 24px;font-size:14px}
.territory-key{flex:none;padding:0 24px;max-height:32dvh;overflow:auto;border-top:1px solid var(--line)}
.territory-key summary{padding:14px 0;cursor:pointer;font-size:15px}
.territory-key .territory-legend{margin:0 0 20px}
@media(min-width:900px){
 .territory-layout{grid-template-columns:minmax(0,1fr) 240px}
 .territory-layout .territory-inline.is-interactive .territory-viewport{height:min(64vh,640px);aspect-ratio:auto}
 .territory-landmarks .territory-legend{grid-template-columns:1fr;gap:10px}
 .territory-landmarks .territory-legend li{font-size:14px}
}
@media(max-width:899px){.territory-legend{grid-template-columns:repeat(3,minmax(0,1fr))}.territory-tools p{display:none}.territory-dialog__header h2{font-size:21px}}
@media(max-width:639px){.territory-preview{border-radius:16px}.home-territory .home-heading{align-items:start;flex-direction:column;gap:8px;margin-bottom:18px}.territory-legend{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;margin-top:20px}.territory-legend li{font-size:13px;gap:8px}.territory-number{flex-basis:25px;height:25px;font-size:12px}.territory-dialog{width:100%;height:100dvh;border:0;border-radius:0}.territory-dialog__header{padding:calc(12px + env(safe-area-inset-top)) 16px 12px;gap:8px}.territory-dialog__header h2{font-size:19px;max-width:14ch}.territory-close{font-size:13px;padding:6px 10px}.territory-tools{padding:0 16px 12px;gap:6px}.territory-tools button{font-size:14px}.territory-key{padding:0 16px env(safe-area-inset-bottom)}.territory-key summary{font-size:14px}}
