/* Locations (lane V9). Tokens only — every colour, size and radius is a
   console.css token, so both themes follow without a block of their own.
   Built to docs/brand-kit.md: a box with 42px rows, mono figures, a state as a
   word, never colour alone. */

.loc { display: flex; flex-direction: column; gap: 14px; }
.loc-head { display: flex; flex-direction: column; gap: 10px; }
.loc-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.loc-title { margin: 0; font-size: var(--text-xl); font-weight: 600; color: var(--ink); }

.loc-seg { display: inline-flex; border: 1px solid var(--ctl-edge, var(--line)); border-radius: var(--r-sm); overflow: hidden; }
.loc-segb {
  font: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text-sm); height: var(--ctl-h-sm); padding: 0 12px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.loc-segb + .loc-segb { border-left: 1px solid var(--line); }
.loc-segb.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.loc-segb:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.loc-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.loc-pick { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--muted); }
.loc-pick select {
  font: inherit; font-size: var(--text-sm); height: var(--ctl-h-sm); padding: 0 8px; color: var(--body);
  background: var(--surface); border: 1px solid var(--ctl-edge, var(--line)); border-radius: var(--r-sm);
}

.loc-strip {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 16px; font-size: var(--text-xs);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
}
.loc-none { margin: 0; font-size: var(--text-sm); color: var(--muted); }

.loc-table {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-1);
  overflow-x: auto;
}
.loc-row {
  display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(150px, 1.4fr) minmax(190px, 1.1fr) minmax(170px, 1.4fr);
  align-items: center; gap: 12px; min-height: 42px; padding: 6px 16px; border-top: 1px solid var(--line-light);
  font-size: var(--text-sm); color: var(--body); min-width: 760px;
}
.loc-haschange .loc-row { grid-template-columns: minmax(220px, 2.2fr) minmax(150px, 1.4fr) minmax(110px, 1fr) minmax(150px, 1.1fr) minmax(170px, 1.4fr); }
.loc-rowh { border-top: 0; min-height: 36px; font-size: var(--text-xs); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.loc-row[data-loc-row] { cursor: pointer; }
.loc-row[data-loc-row]:hover { background: var(--wash-hover); }
.loc-row[data-loc-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.loc-row.open { background: var(--accent-soft); }
.loc-within { color: var(--muted); min-height: 34px; }

.loc-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-left: calc(var(--depth, 0) * 18px); min-width: 0; }
.loc-name b { color: var(--ink); font-weight: 600; }
/* A place row's Ask Agent (AGT B4-8): at the name's end, on the row's hover or focus, always on touch. */
.loc-name .loc-agent { margin-left: auto; opacity: 0; align-self: center; }
.loc-row:hover .loc-agent, .loc-row:focus-within .loc-agent, .loc-agent:focus-visible { opacity: 1; }
@media (hover: none) { .loc-name .loc-agent { opacity: 1; } }
.loc-lvl { font-size: var(--text-xs); color: var(--faint); }
.loc-tag {
  font-size: var(--text-xs); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 6px; line-height: 18px; white-space: nowrap;
}
.loc-proposed { border-style: dashed; }

.loc-res { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.loc-fig, .loc-fig-s { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.loc-fig { font-weight: 600; }
.loc-ev, .loc-del { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-rg, .loc-sub, .loc-ev, .loc-chg {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums;
  font-size: var(--text-xs); color: var(--muted);
}
.loc-state { color: var(--muted); }
.loc-tone { font-size: var(--text-xs); color: var(--body); }
.loc-del { font-size: var(--text-xs); color: var(--muted); }

.loc-detail { border-top: 1px solid var(--line-light); background: var(--canvas); }
.loc-detailin { display: flex; gap: 24px; flex-wrap: wrap; padding: 12px 16px 14px calc(16px + 18px); }
.loc-detail h3, .loc-one h3, .loc-pg h3 { margin: 0 0 6px; font-size: var(--text-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.loc-kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--text-sm); }
.loc-kv li { display: flex; justify-content: space-between; gap: 16px; min-width: 240px; }
.loc-doors { display: flex; align-items: center; gap: 12px; }
.loc-door { font-size: var(--text-sm); color: var(--accent-text); text-decoration: none; }
/* Two of the doors are buttons: the browser's own button face painted under the link ink (grey 107 on dark, 2.33:1). */
button.loc-door { padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; }
.loc-door:hover { text-decoration: underline; }

.loc-empty, .loc-one, .loc-note {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-1); padding: 18px;
}
.loc-empty h2, .loc-one h2 { margin: 0 0 6px; font-size: var(--text-lg); font-weight: 600; color: var(--ink); }
.loc-empty p { margin: 0 0 12px; color: var(--muted); font-size: var(--text-sm); }
.loc-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--text-sm); }
.loc-crumb { margin: 0 0 6px; font-size: var(--text-xs); color: var(--faint); }
.loc-onefig { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.loc-onefig .loc-fig { font-size: var(--fig-sm); }
.loc-lbl { font-size: var(--text-xs); color: var(--muted); }
.loc-onegrid { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.loc-nomatch { margin: 0; padding: 14px 16px; font-size: var(--text-sm); color: var(--muted); border-top: 1px solid var(--line-light); }

@media (max-width: 700px) {
  /* The result column wraps within half the row: sized to its whole text (`auto`), a
     long state squeezed a nested row's name down to a sliver it overprinted. */
  .loc-row, .loc-haschange .loc-row { min-width: 0; grid-template-columns: minmax(0, 1fr) fit-content(50%); }
  .loc-row > .loc-res { min-width: 0; }
  .loc-row > .loc-ev, .loc-row > .loc-del, .loc-row > .loc-chg { grid-column: 1 / -1; }
  .loc-rowh { display: none; }
}
@media (prefers-reduced-motion: reduce) { .loc * { transition: none !important; } }

/* A place's own page, in S's drawer frame (Phase 3). */
.loc-pg { display: grid; gap: 16px; }
.loc-pg section { display: grid; gap: 6px; }
.loc-pg .loc-crumb, .loc-pg .loc-onefig { margin: 0; }
.loc-idline, .loc-def { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.loc-pg .loc-kv li { min-width: 0; align-items: baseline; }
.loc-pg .loc-kv li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.loc-pg .loc-kv .loc-fig-s, .loc-pg .loc-kv .loc-door { flex: none; white-space: nowrap; }

/* Regional opportunities (Phase 4): one row each, the words left, the doors right. */
.loc-opps { display: grid; gap: 10px; margin-top: 24px; }
/* Every product (Phase 6): one row per product and place. */
.loc-products { display: grid; gap: 10px; margin-top: 24px; }
.loc-plist { list-style: none; margin: 0; padding: 0; }
.loc-prow { display: grid; grid-template-columns: minmax(8rem, 1.2fr) minmax(8rem, 1.2fr) minmax(7rem, 1fr) minmax(8rem, 1fr);
  gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--ink); }
.loc-prowh { border-top: 0; font-size: var(--text-xs); color: var(--muted); }
.loc-pname { font-weight: 600; }
.loc-pwide { grid-column: 2 / -1; }
.loc-prow .loc-ev, .loc-prow .loc-res { white-space: normal; overflow: visible; text-overflow: clip; min-width: 0; }
@media (max-width: 640px) {
  .loc-prow { grid-template-columns: 1fr 1fr; }
  .loc-prowh { display: none; }
  .loc-pwide { grid-column: 1 / -1; }
}
.loc-h2 { margin: 0; font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.loc-opplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.loc-opp { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.loc-opptext { display: grid; gap: 2px; min-width: 0; font-size: var(--text-sm); color: var(--muted); }
.loc-opptext b { color: var(--ink); font-weight: 600; }
.loc-oppnext { color: var(--ink); }
.loc-oppdoors { display: flex; align-items: center; gap: 10px; flex: none; }

/* The map (Phase 2). One sequential scale, a single hue in five steps of lightness (a
   lightness ramp reads the same under every colour-vision deficiency), fixed at 0-100%
   and written at both ends. Themed for light and for the dark themes. Every state that is
   not a figure is a hatch or an outline, and says its words on hover and to a reader. */
.loc {
  --loc-seq-1: #d9efee; --loc-seq-2: #a3d8d6; --loc-seq-3: #62b8b6; --loc-seq-4: #2a8b8a; --loc-seq-5: #045a5a;
  --loc-land: var(--wash-hover, #f3f4f6);
}
html[data-theme="dark"] .loc, html[data-theme="phosphor"] .loc {
  --loc-seq-1: #143a39; --loc-seq-2: #1b5d5c; --loc-seq-3: #218382; --loc-seq-4: #3fb0ae; --loc-seq-5: #9be0de;
  --loc-land: #1c1c1c;
}
.loc-map { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-1); }
.loc-maphead { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.loc-mapshow { display: none; }
.loc-zoom { display: inline-flex; gap: 4px; }
.loc-zoom .v2-btn { min-width: var(--ctl-h-sm); height: var(--ctl-h-sm); padding: 0 8px; }
.loc-svg { width: 100%; height: auto; max-height: 360px; display: block; }
/* Mouse controls (owner, 2026-09-24): drag pans once zoomed, a scroll zooms at the pointer.
   No motion. */
/* Draggable at every zoom (owner, 2026-09-26): the grab cursor always, a place's own pointer over it. */
.loc-svg { cursor: grab; }
.loc-svg.dragging { cursor: grabbing; user-select: none; }
.loc-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.loc-mbase { fill: var(--loc-land); stroke: var(--line); stroke-width: .6; }
.loc-munit { fill: var(--loc-land); stroke: var(--line); stroke-width: .4; }
.loc-mf { stroke: var(--ink); stroke-width: .6; cursor: pointer; }
.loc-mf.outline { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 3 2; }
.loc-mark { stroke: var(--ink); stroke-width: 1.2; }
.loc-hatchbg { fill: var(--surface); }
.loc-hatchline { stroke: var(--muted); stroke-width: 2; }
.loc-mf:hover, .loc-mf.hl { stroke: var(--accent); stroke-width: 2.4; }
.loc-mf.sel { stroke: var(--accent); stroke-width: 2.4; }
.loc-mf:focus-visible { outline: none; stroke: var(--accent); stroke-width: 3; }
.loc-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted); }
.loc-lend { font-variant-numeric: tabular-nums; }
.loc-ramp { display: inline-flex; }
.loc-ramp i { width: 22px; height: 10px; }
.loc-key { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.loc-keyedge { stroke: var(--muted); }
.loc-credit { margin: 0; font-size: var(--text-xs); color: var(--faint); }
@media (max-width: 700px) {
  .loc-mapshow { display: inline-flex; margin-right: auto; }
  .loc-map:not(.shown) .loc-mapbody, .loc-map:not(.shown) .loc-zoom { display: none; }
}
.loc-keydash { stroke-dasharray: 3 2; }

/* Who is named at a place, a bar per brand (POS P2, V9 decision 26): the share, its range as a whisker, the
   owned brand marked in words and shape. Brand kit tokens only. */
.loc-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.loc-bar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; align-items: center; gap: 10px; min-height: 30px;
  border-bottom: 1px solid var(--line-light); padding: 0 6px; }
.loc-bar.you { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.loc-barname { color: var(--ink); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-own { font-family: var(--mono); font-size: var(--text-xs); color: var(--accent-text); }
.loc-bartrack { position: relative; height: 8px; background: var(--track); border-radius: 4px; }
.loc-bartrack i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--muted); border-radius: 4px; }
.loc-bar.you .loc-bartrack i { background: var(--accent); }
.loc-bartrack b { position: absolute; top: 3px; height: 2px; background: var(--ink); opacity: .45; }

/* A country's two populations as one paired range (POS P2): asked in market above, named in question below. */
.loc-pair { display: inline-flex; flex-direction: column; gap: 3px; width: 72px; margin-left: 8px; vertical-align: middle; }
.loc-pr { position: relative; height: 5px; background: var(--track); border-radius: 3px; }
.loc-pr b { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--line-hover); }
.loc-pr i { position: absolute; top: -1px; width: 2px; height: 7px; margin-left: -1px; background: var(--ink); }
.loc-pr.at i { background: var(--muted); }

/* Product × place as a grid (POS P2): a row per product, a column per place. */
.loc-pscroll { overflow-x: auto; max-width: 100%; }
.loc-pgrid { border-collapse: collapse; font-size: var(--text-sm); color: var(--body); }
.loc-pgrid th, .loc-pgrid td { border-bottom: 1px solid var(--line-light); padding: 8px 10px; text-align: left; vertical-align: middle; white-space: nowrap; }
.loc-pgrid thead th { border-bottom: 1px solid var(--line); font-weight: 500; }
.loc-pgrid .loc-pgh { display: block; color: var(--ink); }
.loc-pgrid .loc-pname { color: var(--ink); font-weight: 500; }
.loc-pgrid .loc-pcell.none { color: var(--faint); }

/* An opportunity as a mark on the map (POS P2): a diamond above its place, the ink of a mark, never a fill tone. */
.loc-oppmark { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }

/* A parent's places within as small multiples (POS P2): one shared scale, a line beside its summary. */
.loc-sms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.loc-sm { display: flex; flex-direction: column; gap: 4px; }
.loc-smname { color: var(--ink); font-size: var(--text-sm); font-weight: 500; }
.loc-smline path { fill: none; stroke: var(--accent); stroke-width: 1.5; }

