.territory-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 18px; flex: 1; min-width: 0; min-height: 0; }
.territory-map-layout > canvas { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.territory-panel { --territory-gang: #a6a18d; width: min(264px, 100%); min-width: 0; max-height: 100%; align-self: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #746c54 transparent; box-sizing: border-box; padding: 14px; border: 1px solid #77705a70; border-top: 3px solid var(--territory-gang); background: var(--wear, none), #191c16f5; color: #ded4b9; font: 13px/1.4 system-ui, sans-serif; pointer-events: auto; text-shadow: none; }
.territory-panel *, .territory-panel *::before, .territory-panel *::after { box-sizing: border-box; }
.territory-panel[hidden], .territory-panel [hidden] { display: none !important; }
.territory-gang { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.territory-eyebrow { grid-column: 1 / -1; font-size: 10px; letter-spacing: 1.4px; color: #b6b09a; }
.territory-icon { display: inline-flex; flex: 0 0 auto; width: 20px; height: 20px; color: currentColor; }
.territory-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: square; }
.territory-gang > .territory-icon { grid-row: span 2; width: 26px; height: 30px; color: var(--territory-gang); }
.territory-gang-name { min-width: 0; font-size: 21px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.territory-count { color: #aea58b; font-size: 12px; font-variant-numeric: tabular-nums; }
.territory-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 15px; }
.territory-panel .territory-name { width: 100%; min-width: 0; padding: 8px; border: 1px solid #756c51; border-radius: 0; background: #11150f; color: #eee2c7; font: inherit; }
.territory-panel .territory-name::placeholder { color: #a49b82; }
.territory-panel .territory-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #77705a; background: var(--wear, none), #2b2d23; color: #ddd1b4; cursor: pointer; font: inherit; line-height: 1.2; text-align: center; box-shadow: 0 2px #0c0f09; }
.territory-panel .territory-button:hover:not(:disabled) { border-color: #d1b674; background-color: #3b3c2d; color: #fff0cd; }
.territory-panel .territory-button:focus-visible, .territory-panel .territory-name:focus-visible { outline: 2px solid #dbc58e; outline-offset: 2px; }
.territory-panel .territory-button:disabled { opacity: .45; cursor: default; box-shadow: none; }
.territory-panel .territory-primary { border-color: #b7a271; background: var(--wear, none), #bbab84; color: #181b14; }
.territory-panel .territory-primary:hover:not(:disabled) { background-color: #d6c498; color: #11150e; }
.territory-panel .territory-quiet { border-color: transparent; background: none; box-shadow: none; color: #b7ad95; }
.territory-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.territory-actions > .territory-button { flex: 1 1 auto; }
.territory-actions > .territory-quiet { flex: 0 0 auto; }
.territory-gang-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.territory-gang-choices .territory-button { flex-direction: column; padding: 7px 4px; border-bottom: 3px solid var(--choice-color); font-size: 12px; }
.territory-gang-choices .territory-button[aria-pressed="true"] { opacity: 1; background-color: #373b30; outline: 1px solid var(--choice-color); outline-offset: -3px; }
.territory-home-icon { display: inline-flex; width: 25px; height: 25px; color: var(--choice-color); }
.territory-home-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.territory-legend { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 12px; color: #b8b39e; font-size: 10px; }
.territory-you-key { color: #fff5db; font-weight: 700; white-space: nowrap; }
.territory-fight-key::before { content: ''; display: inline-block; width: 15px; border-top: 1px dashed #ddc18a; margin-right: 5px; vertical-align: middle; }
.territory-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 14px; padding: 11px; border: 1px dashed #bda56e; background: #a58b3c0d; }
.territory-invite-name { font-weight: 400; overflow-wrap: anywhere; }
.territory-invite > .territory-button { grid-column: 1 / -1; }
.territory-zone { margin-top: 14px; padding-top: 12px; border-top: 1px solid #77705a70; }
.territory-zone-heading { display: flex; gap: 8px; align-items: baseline; }
.territory-zone-heading > .territory-icon { align-self: center; width: 16px; height: 18px; color: #9e9278; }
.territory-zone-name { margin: 0; color: #dfd3b7; font-size: 16px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.territory-owner { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 11px; color: #d0c8af; overflow-wrap: anywhere; }
.territory-owner::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; background: var(--territory-owner, #a6a18d); }
.territory-capture { margin-top: 14px; padding: 11px 10px 8px; border: 1px solid #77705a70; border-left: 3px solid var(--territory-owner, #a6a18d); background: #11150da8; }
.territory-capture-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.territory-role { font-size: 16px; color: #ede4c9; }
.territory-capture[data-role="defend"] .territory-role { color: #e9ba95; }
.territory-round { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.territory-panel .territory-capture-zone { justify-content: flex-start; min-height: 36px; padding: 4px 0; border: 0; box-shadow: none; background: none; color: #d5c9aa; font-size: 14px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.territory-direction { display: block; margin-top: 4px; color: #b8b49d; font-size: 12px; font-variant-numeric: tabular-nums; }
.territory-capture-label { display: block; margin: 8px 0; font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.territory-track { height: 5px; overflow: hidden; background: #756b473d; }
.territory-fill { display: block; height: 100%; transform-origin: left; background: var(--territory-owner, #bba16e); transition: transform .15s linear; }
.territory-capture[data-contested="true"] .territory-capture-label { color: #e4a68c; }
.territory-capture[data-contested="true"] .territory-fill { background: #c5866e; }
.territory-panel .territory-cancel { min-height: 38px; padding: 5px 0 0; margin-top: 5px; font-size: 12px; }
.territory-message { display: block; margin-top: 10px; color: #e1a28d; font-size: 12px; }
@media (max-width: 760px) {
  .territory-map-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(130px, 1fr) auto; gap: 10px; }
  .territory-panel { width: 100%; max-height: min(38dvh, 270px); padding: 10px 12px; }
  .territory-gang { grid-template-columns: minmax(0, 1fr) auto; }
  .territory-gang > .territory-icon { grid-row: auto; width: 22px; height: 24px; }
  .territory-gang-name { font-size: 19px; }
  .territory-create, .territory-actions { margin-top: 9px; }
  .territory-zone { margin-top: 10px; padding-top: 10px; }
  .territory-capture { margin-top: 10px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .territory-map-layout { grid-template-columns: minmax(0, 1fr) 228px; grid-template-rows: minmax(0, 1fr); gap: 10px; }
  .territory-panel { width: 100%; max-height: 100%; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .territory-fill { transition: none; } }
