/* ===== Trade and area pages (/territories/<region>/<trade>), written by scripts/trade_pages.py =====
   Loaded by those pages only, after style.css. Uses the tokens set on :root there. */
.tp-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; max-width: 860px; }
.tp-figs .figure .n { font-size: clamp(1.7rem, 3.4vw, 2.5rem); overflow-wrap: anywhere; }
.standfirst a { color: var(--carbon); text-underline-offset: 3px; }
.tp-h3 { margin-top: 30px; font-size: clamp(22px, 3vw, 28px); line-height: 1.05; }
.tp-h3 + p { margin-top: 8px; max-width: 68ch; }
.rail .tp-figs + p, .rail p + p { margin-top: 14px; max-width: 68ch; }
.tp-table { width: 100%; max-width: 640px; margin-top: 14px; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--paper); border: 1.5px solid var(--line); }
.tp-table th, .tp-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line-soft); }
.tp-table th:first-child, .tp-table td:first-child { text-align: left; overflow-wrap: anywhere; }
.tp-table th { font: 600 11.5px/1.2 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-table + .pencil.note { margin-top: 10px; max-width: 72ch; }

@media (max-width: 520px) {
  .tp-figs { grid-template-columns: 1fr 1fr; }
  .tp-table th, .tp-table td { padding: 8px 8px; }
}
/* Desktop: the record sits in two columns so the page is not a narrow strip with an empty right third */
.tp-figs { max-width: none; }
.tp-grid > div { min-width: 0; }
@media (min-width: 900px) {
  .tp-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; align-items: start; }
  .tp-grid .tp-table { max-width: none; }
  .tp-table.tp-wide { max-width: none; }
}

/* ===== Territory sheets, 27 Nov 2026: sheet head, drawn map, week chart. Also loaded by the region pages. ===== */
.tp-hero { padding-block: clamp(28px, 5vw, 56px) clamp(28px, 5vw, 52px); }
.tp-head { display: grid; gap: 28px; margin-top: 14px; }
.tp-text, .tp-side { min-width: 0; }
.tp-hero .plate { font-size: clamp(2.5rem, 8.6vw, 5.6rem); overflow-wrap: anywhere; }
.tp-hero .standfirst { margin-top: 18px; }

.tp-since { margin-top: 16px; }
/* the framed site, or the territory plan when no screenshot is on file */
.tp-frame { display: block; margin: 0; border: 2px solid var(--ink); background: var(--paper); --lift: 8px; --shade: var(--ink); box-shadow: var(--lift) var(--lift) 0 var(--shade); text-decoration: none; color: inherit; max-width: 520px; }
/* a.tp-frame lifts on hover and pushes into its shadow on press: the rule is in the motion system at the end of style.css */
.tp-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 2px solid var(--ink); background: var(--canary); min-width: 0; }
.tp-bar i { width: 9px; height: 9px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); flex: none; }
.tp-bar b { font: 600 11.5px/1.2 var(--m); letter-spacing: .06em; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-plan .tp-bar b { margin-left: 0; }
.tp-frame img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; }
.tp-frame svg { display: block; width: 100%; height: auto; max-height: 420px; padding: 14px; }
@media (max-width: 899px) { .tp-side:has(.tp-plan .tm-mini) { display: none; } }  /* the full map is the next thing down the page on a phone */
.tm-mini .tm-geo path { vector-effect: non-scaling-stroke; }
@media (min-width: 900px) {
  .tp-head { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 44px; align-items: center; }
  .tp-hero.solo .tp-head { grid-template-columns: 1fr; }
  .tp-head .plate { font-size: clamp(2.6rem, 5.4vw, 4.6rem); }
  .tp-frame { max-width: none; }
}
/* the map */
.tp-figs.three { max-width: 760px; }
@media (min-width: 900px) { .tp-figs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-sheet { display: grid; gap: 22px; margin-top: 22px; align-items: start; }
.tm-sheet > * { min-width: 0; }
.tm-map { margin: 0; border: 2px solid var(--ink); background: var(--paper); box-shadow: 8px 8px 0 var(--ink); }
.tm-svg { display: block; width: 100%; height: auto; background:
  linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 40px,
  linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 40px 100%, var(--paper); }
.tm-geo path { stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; transition: fill var(--t-press) var(--ease); }
.tm-geo .s-available path { fill: var(--canary); }
.tm-geo .s-claimed path { fill: var(--carbon); stroke: var(--paper); }
.tm-geo .s-coming path { fill: var(--canary-soft); stroke-dasharray: 5 4; }
.tm-geo path:hover { fill: #ffe978; }
.tm-geo .s-claimed path:hover { fill: var(--carbon-deep); }
.tm-svg text { font-family: var(--m); font-weight: 600; text-anchor: middle; fill: var(--ink); letter-spacing: .02em; pointer-events: none; }
.tm-svg text.on-dark { fill: var(--paper); }
.tm-svg text.n { paint-order: stroke; stroke: var(--canary); stroke-width: 4px; stroke-linejoin: round; }
.tm-svg text.n.on-dark { stroke: var(--carbon); }
.tm-svg text.sc { text-anchor: start; fill: var(--muted); font-weight: 400; letter-spacing: .08em; }
.tm-svg text.sc.end { text-anchor: end; }
.tm-svg .bar { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.tm-svg .lab-m { display: none; }
@media (max-width: 720px) { .tm-svg .lab-d { display: none; } .tm-svg .lab-m { display: inline; } .tm-svg .lab-m .bar { stroke-width: 4; } }
.tp-plan figcaption.pencil { font-size: 11px; line-height: 1.5; text-transform: none; letter-spacing: .02em; border-top: 2px solid var(--ink); }
.tm-map figcaption.pencil { font-size: 11.5px; line-height: 1.6; text-transform: none; letter-spacing: .02em; border-top: 2px solid var(--ink); }
.tm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.tm-sw { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.tm-sw::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--ink); background: var(--canary); }
.tm-sw.s-claimed::before { background: var(--carbon); }
.tm-sw.s-coming::before { background: var(--canary-soft); border-style: dashed; }
.tm-map.nomap { max-width: 460px; }
.tm-map.nomap svg { display: block; width: 100%; height: auto; max-height: 380px; padding: 18px; }
.tm-gap { margin-top: 18px; }
.tm-after { margin-top: 26px; }
/* where in the state */
.tm-loc .st { fill: var(--canary-soft); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tm-loc .dot { fill: var(--carbon); }
.tm-loc .ring { fill: none; stroke: var(--carbon); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tm-where { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1.5px solid var(--line); }
.tm-where svg { width: 84px; height: auto; max-height: 96px; flex: none; }
.tm-where .pencil { color: var(--ink); font-weight: 600; line-height: 1.5; }
/* the numbered list that goes with the map */
.tm-keyhead { margin-bottom: 8px; }
.tm-key { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 22px; font: 400 12.5px/1.25 var(--m); }
.tm-key li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line-soft); break-inside: avoid; }
.tm-key .k { color: var(--carbon); font-weight: 600; flex: none; }
.tm-key .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--b); font-size: 14px; font-weight: 600; }
.tm-key .v { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tm-key.wide { columns: 220px 4; }
@media (max-width: 420px) { .tm-key, .tm-key.wide { columns: 1; } }
@media (min-width: 900px) {
  .tm-sheet { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 34px; }
  .tm-sheet.stack { grid-template-columns: 1fr; }
}
/* fold-away detail */
.tp-more { margin-top: 18px; }
.tp-more summary { cursor: pointer; font: 600 12.5px/1.3 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--carbon); padding: 6px 0; }
/* the search record */
.tp-record { display: grid; gap: 26px; align-items: start; margin-top: 4px; }
.tp-record > * { min-width: 0; }
.tp-record .tp-figs { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tp-record p { margin-top: 14px; max-width: 60ch; }
.tp-weeks { margin: 22px 0 0; border: 2px solid var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); padding: 14px 16px 12px; }
.tp-weeks figcaption.pencil { background: none; border: 0; padding: 0 0 6px; color: var(--ink); font-weight: 600; }
.tp-chart { display: block; width: 100%; max-width: 560px; height: auto; }
.tp-chart .b { fill: var(--carbon); }
.tp-chart .b.last { fill: var(--canary); stroke: var(--ink); stroke-width: 2; }
.tp-chart .ax { stroke: var(--ink); stroke-width: 2; fill: none; }
.tp-chart text { font-family: var(--m); text-anchor: middle; }
.tp-chart .v { font-size: 13px; font-weight: 600; fill: var(--ink); }
.tp-chart .w { font-size: 11px; fill: var(--muted); letter-spacing: .02em; }
.tp-weeks .pencil.note { margin-top: 6px; font-size: 11px; text-transform: none; letter-spacing: .02em; }
.tp-weeks .tp-more { margin-top: 6px; }
@media (min-width: 900px) { .tp-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; } }
/* region pages */
.tr-map { margin-top: 30px; }
.tr-trades { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tr-trades a { font: 600 12px/1 var(--m); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--ink); border: 2px solid var(--ink); padding: 7px 9px 6px; background: var(--canary); }
.tr-trades a.claimed { background: var(--carbon); color: var(--paper); }
.tr-trades a.coming { background: var(--canary-soft); border-style: dashed; }
/* .tr-trades a lifts on hover and sits back on press: motion system, end of style.css */
/* ===== end trade and area pages ===== */
