* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--text-14) / 1.45 var(--font);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.kicker {
  font-size: var(--text-11);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
button:disabled, .btn:disabled { opacity: .5; }

.shell { display: flex; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; }
.nav {
  width: var(--menu);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3) var(--space-3);
  transition: width var(--dur) var(--ease);
}
.nav .nav-close { display: none; align-self: flex-end; }
.nav-kicker { padding: var(--space-2) var(--space-2) var(--space-1); }
.nav a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control);
  padding: 0 var(--space-2);
  border-radius: var(--radius-nav);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-14);
  font-weight: 600;
}
.nav a svg { flex: none; }
.nav a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.nav a:hover { background: var(--surface-2); }
.nav .spacer { flex: 1; }
.pin {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-nav);
  border: 0;
  background: transparent;
  color: var(--muted);
  opacity: .4;
  align-self: flex-end;
}
.pin[aria-pressed="true"] {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
html[data-menu="collapsed"] .nav { width: var(--menu-collapsed); padding-left: var(--space-2); padding-right: var(--space-2); }
html[data-menu="collapsed"] .nav .label,
html[data-menu="collapsed"] .nav .nav-kicker {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
html[data-menu="collapsed"] .nav[data-hover="1"] { width: var(--menu); }
html[data-menu="collapsed"] .nav[data-hover="1"] .label,
html[data-menu="collapsed"] .nav[data-hover="1"] .nav-kicker {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 22;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: inherit; flex: none; }
/* the pin-and-derrick mark (art/brand-wellatlas); token-coloured so it holds in both themes */
.mark { width: 30px; height: 30px; display: block; flex: none; }
.brandword { font-size: var(--text-16); font-weight: 700; letter-spacing: -.01em; }
.searchwrap { position: relative; flex: 1; min-width: 0; max-width: 420px; }
.search-ic {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search {
  width: 100%;
  height: var(--bar);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 0 var(--space-3) 0 32px;
  font-size: var(--text-14);
}
.search::placeholder { color: var(--muted); }
.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--bar) + var(--space-2));
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
  z-index: 30;
  max-height: 320px;
  overflow: auto;
}
.suggest[hidden] { display: none; }
.suggest button {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-nav);
  background: transparent;
  font-weight: 600;
}
.suggest button:hover,
.suggest button[aria-selected="true"] { background: var(--surface-2); }
.suggest .kind { font-size: var(--text-12); font-weight: 600; color: var(--muted); margin-left: auto; }
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: var(--text-11);
  font-weight: 600;
  flex: none;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.info { background: var(--info-soft); color: var(--info); }
.bar-pill { height: var(--bar); padding: 0 var(--space-3); font-size: var(--text-12); }
.iconbtn {
  width: var(--bar);
  height: var(--bar);
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--line-strong) 50%, transparent);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
  flex: none;
}
.iconbtn::before { content: ""; position: absolute; inset: -6px; }
.iconbtn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.iconbtn:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.nav-toggle { display: none; }
/* theme disc: the FleetSpartan sun/moon pair; the glyph is the mode a click switches to */
.theme-disc { border-color: var(--line-strong); }
.theme-glyph { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-glyph--sun { display: none; }
html[data-theme="dark"] .theme-glyph--moon { display: none; }
html[data-theme="dark"] .theme-glyph--sun { display: block; }
.who {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--bar);
  padding: 0 var(--space-2) 0 0;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  font-weight: 600;
  flex: none;
}
.avatar {
  width: var(--bar);
  height: var(--bar);
  border-radius: 50%;
  background: var(--soft);
  color: var(--on-soft);
  display: grid;
  place-items: center;
  font-size: var(--text-12);
  font-weight: 700;
}
.caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
.idwrap { position: relative; flex: none; }
.idmenu {
  position: absolute;
  right: 0;
  top: calc(var(--bar) + var(--space-2));
  width: 288px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
  padding: var(--space-2);
  z-index: 30;
}
.idmenu[hidden] { display: none; }
.idmenu header { padding: var(--space-2) var(--space-2) var(--space-3); }
.idmenu header b { display: block; }
.idmenu header span { display: block; font-size: var(--text-13); color: var(--muted); }
.idmenu header .pill { margin-top: var(--space-2); }
.idmenu button, .idmenu a {
  display: flex;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-nav);
  height: var(--control);
  padding: 0 var(--space-2);
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  align-items: center;
}
.idmenu button:hover, .idmenu a:hover { background: var(--surface-2); }
.idmenu .danger { color: var(--danger); }
.idmenu hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-2) 0; }
.idmenu :focus-visible, .suggest :focus-visible, .nav a:focus-visible { outline-offset: -2px; }
.idmenu .id-tag { margin-left: auto; }
.id-theme { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control); padding: 0 var(--space-2); font-weight: 600; }
.id-theme .seg { margin-left: auto; }
.idmenu .seg button { display: inline-flex; width: auto; height: 24px; padding: 0 8px; border-radius: 999px; font-size: var(--text-11); }
.idmenu .seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.nav-tag { margin-left: auto; height: 18px; font-size: var(--text-11); }
.who-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.work { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-width: 0; overflow: auto; padding: var(--space-4); }
.page-inner { max-width: 1440px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.head-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.head h1 { font-size: var(--text-22); }
.head .sub { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-14); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}
.card h2 { font-size: var(--text-18); margin-bottom: var(--space-2); }
.card > * + * { margin-top: var(--space-3); }
.empty {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-14);
  padding: 40px var(--space-4);
}
.banner {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 600;
}
.btn {
  height: var(--control);
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: var(--text-14);
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.secondary:hover, .btn.quiet:hover { background: var(--surface-2); }
.btn.quiet { border-color: transparent; color: var(--ink); }
.btn.danger { color: var(--danger); background: var(--surface); border-color: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.select { position: relative; display: inline-flex; align-items: center; width: 100%; }
.select select {
  appearance: none;
  height: var(--control);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 0 var(--space-6) 0 var(--space-3);
  font-size: var(--text-14);
  font-weight: 600;
}
.select .chev {
  position: absolute;
  right: var(--space-3);
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-12); font-weight: 600; }
.field label { display: block; font-size: var(--text-12); font-weight: 600; margin-bottom: var(--space-2); }
.tester-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.help {
  width: var(--help);
  flex: none;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  overflow: auto;
}
.help[hidden] { display: none; }
.help h2 { font-size: var(--text-22); }
.help-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ask {
  margin-top: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.ask small { display: block; font-weight: 400; color: var(--muted); margin-top: 0; font-size: var(--text-12); }
.help details { border-top: 1px solid var(--line); padding: var(--space-2) 0; }
.help details summary { font-weight: 600; cursor: pointer; }
.help details p { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-14); }
.scrim-help {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim);
  border: 0;
  padding: 0;
  z-index: 20;
}
html[data-help="1"] .scrim-help:not([hidden]) { display: block; }
@media (min-width: 1280px) {
  .scrim-help { display: none !important; }
}

.public { --control: 40px; font-size: var(--text-16); }
.sheet { max-width: 760px; margin: 0 auto; }
.public h1 { font-size: var(--text-26); }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-3) 0 var(--space-5); }
.wellmap { width: 100%; height: 160px; border-radius: var(--radius-card); border: 1px solid var(--line); margin: var(--space-3) 0 var(--space-5); }
.wellmap-box {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  margin: var(--space-3) 0 var(--space-5);
  overflow: hidden;
  background: var(--map-land);
}
.wellmap-box .wellmap { width: 100%; height: 100%; border: 0; margin: 0; border-radius: 0; }
.wellmap-box[data-map-live="1"] .wellmap { display: none; }
.where { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-4); }
.defs { display: grid; grid-template-columns: 160px 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.defs dt { color: var(--muted); font-size: var(--text-12); font-weight: 600; padding-top: var(--space-1); }
.defs dd { margin: 0; }
.src {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--text-13);
}
.src ul { margin: var(--space-3) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.more { margin-top: var(--space-4); color: var(--muted); }
.public .actions { margin-top: var(--space-5); }
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  max-width: 440px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: var(--space-3) var(--space-4);
  z-index: 50;
}
.toast[hidden] { display: none; }

.driver-popover {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
  font-family: var(--font);
  padding: var(--space-4);
}
.driver-popover, .driver-popover * { font-family: var(--font); }
.driver-popover-title {
  font-family: var(--font-display);
  font-size: var(--text-18);
  font-weight: 700;
  line-height: 1.2;
}
.driver-popover-description { font-size: var(--text-14); line-height: 1.45; color: var(--muted); }
.driver-popover-close-btn { color: var(--muted); }
.driver-popover-footer button {
  height: var(--control);
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: var(--text-14);
  font-weight: 600;
  text-shadow: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.driver-popover-next-btn {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-color: transparent !important;
}
.driver-popover-navigation-btns button + button { margin-left: var(--space-2); }
.driver-popover button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.driver-popover-arrow { display: none; }
.driver-popover-progress-text { color: var(--muted); font-size: var(--text-13); }

@media (max-width: 1279px) {
  html[data-help="1"] .help {
    position: fixed;
    top: var(--top);
    right: 0;
    bottom: 0;
    z-index: 21;
  }
}
@media (max-width: 1023px) {
  html[data-menu="pinned"] .nav { width: var(--menu-collapsed); }
  html[data-menu="pinned"] .nav .label,
  html[data-menu="pinned"] .nav .nav-kicker {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
@media (max-width: 767px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--top); padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .topbar .btn.secondary { height: var(--bar); padding: 0 10px; font-size: var(--text-13); }
  .bar-pill { padding: 0 var(--space-2); }
  .searchwrap { flex: 1 1 100%; order: 5; max-width: none; }
  .nav-toggle { display: grid; }
  .who-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav { display: none; }
  .nav .nav-close { display: grid; }
  html[data-menu="open"] .nav {
    display: flex;
    position: fixed;
    top: var(--top);
    bottom: 0;
    left: 0;
    z-index: 30;
    width: var(--menu);
    box-shadow: var(--shadow-2);
  }
  html[data-menu="open"] .nav .label,
  html[data-menu="open"] .nav .nav-kicker {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }
  .page { padding: var(--space-3); }
  .defs { grid-template-columns: 1fr; gap: var(--space-1); }
  .defs dt { padding-top: var(--space-3); }
}
@media (max-width: 639px) {
  html[data-help="1"] .help { width: 100%; left: 0; }
}
.head .actions { margin-left: auto; }
.cap { font-size: var(--text-12); color: var(--muted); }
.card.sheet { max-width: none; margin: 0; padding: 0; }
.card.sheet > * + * { margin-top: 0; }
.field input, .field select {
  height: var(--control);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 0 var(--space-3);
  font-size: var(--text-14);
  width: 100%;
}
.chips { display: flex; gap: var(--space-1); flex-wrap: wrap; align-items: center; }
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--text-13);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lock {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-size: var(--text-12);
  font-weight: 600;
  cursor: pointer;
}
.lock:hover { border-color: var(--line-strong); color: var(--ink); }
.pad { padding: var(--space-4); }
.notice { margin: 0; }
.notice.empty, .notice.start, .notice.broad, .notice.error { color: var(--ink); }
.tablewrap { overflow-x: auto; max-width: 100%; }
.welltable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.welltable th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  height: auto;
  min-height: 40px;
}
.welltable th,
.welltable td,
.welltable td.mono,
.welltable td.n,
.welltable td:nth-child(5),
.welltable td:nth-child(6),
.welltable .pill {
  white-space: normal;
  overflow-wrap: anywhere;
}
.welltable td:nth-child(2), .welltable td:nth-child(3), .welltable td:nth-child(4) { overflow-wrap: anywhere; }
.welltable td { padding: 6px 10px; min-height: 40px; height: auto; border-top: 1px solid var(--line); font-size: var(--text-14); }
.welltable th.n, .welltable td.n { text-align: right; font-variant-numeric: tabular-nums; }
.welltable tbody tr { cursor: pointer; }
.welltable tbody tr:hover { background: var(--surface-2); }
.welltable .sort {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
}
.statusdot { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; color: var(--on-ok); vertical-align: middle; }
.statusdot.ok, .mappin.point.ok { background: var(--ok); }
.statusdot.warn, .mappin.point.warn { background: var(--warn); color: var(--on-warn); }
.statusdot.danger, .mappin.point.danger { background: var(--danger); color: var(--on-danger); }
.statusdot.muted, .mappin.point.muted { background: var(--muted); color: var(--bg); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); color: var(--muted); font-size: var(--text-13); }
.mappane {
  display: none;
  width: 420px;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  overflow: auto;
}
.mappane h2 { font-size: var(--text-16); }
.map-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.map-modes .chip,
.map-layers .chip,
.map-layers .lock {
  height: 26px;
  padding: 0 10px;
  font-size: var(--text-12);
}
.map-layers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mapbox {
  position: relative;
  height: 420px;
  min-height: 340px;
  flex: 1;
  border-radius: 12px;
  background: var(--map-land);
  border: 1px solid var(--line);
  overflow: hidden;
}
.map-ssr { position: absolute; inset: 0; }
.mapbox[data-map-live="1"] .map-ssr,
.mappane[data-map-live="1"] .map-ssr-peeks { display: none; }
.scope {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100% - 64px);
}
.scope-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  max-width: 100%;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.scope-k { font-size: var(--text-12); font-weight: 600; color: var(--muted); white-space: nowrap; }
.scope-sep { color: var(--muted); font-size: var(--text-13); }
.segb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  max-width: 168px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-13);
  font-weight: 600;
  cursor: pointer;
}
.segb.is-placeholder { border-style: dashed; color: var(--muted); font-weight: 500; }
.segb.is-open, .segb[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.segb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segb-more { font-size: var(--text-11); font-weight: 700; color: var(--accent); }
.scope .pop { top: calc(100% + 8px); max-height: 320px; }
.scope .pop-list { flex: 1; }
.scope .star {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-14);
  cursor: pointer;
}
.scope .star[aria-pressed="true"] { color: var(--warn); }
.scope .check { flex: none; color: var(--accent); font-weight: 700; }
.scope .opt.is-selected { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.scope .opt.is-active { background: var(--surface-2); }
.pop-sec .pill { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.pop-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.pop-foot-act {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-nav);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-13);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.pop-foot-act:hover, .pop-foot-act:focus-visible { background: var(--surface-2); }
.region-outline { position: absolute; inset: 28px; z-index: 2; width: calc(100% - 56px); height: calc(100% - 56px); pointer-events: none; }
.region-outline polygon { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-width: 2; }
.mappin.state-bubble { background: var(--surface); color: var(--accent); border-color: var(--accent); font-size: 11px; letter-spacing: .02em; }
.mappin.state-bubble:hover { background: var(--soft); }
.map-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.map-msg { margin: 0; color: var(--muted); font-size: var(--text-12); flex: 1 1 180px; }
#map-search-here, #map-draw { height: 30px; padding: 0 10px; font-size: var(--text-13); }
.mappin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.mappin.cluster {
  min-width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--on-accent);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent), var(--shadow-1);
}
.mappin.cluster:hover { background: var(--accent-hover); }
.maplibregl-marker:hover, .maplibregl-marker:focus-within { z-index: 3; }
.mappin.point { width: 22px; height: 22px; min-width: 22px; padding: 0; color: var(--on-ok); }
.maplibregl-marker .mappin { position: static; transform: none; }
.maplibregl-popup-content {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-2) !important;
  padding: var(--space-2) var(--space-3) !important;
  font: 400 var(--text-13) / 1.4 var(--font);
}
.maplibregl-popup-tip { display: none; }
.map-popup-title { font-family: var(--mono); font-weight: 700; display: block; }
.map-popup-sub { color: var(--muted); font-size: var(--text-12); display: block; margin: 2px 0 6px; }
.peek { border-top: 1px solid var(--line); padding-top: var(--space-2); }
.peek p { margin: var(--space-2) 0; color: var(--muted); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0; padding: 0; font-size: var(--text-12); color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.legend .ok { background: var(--ok); }
.legend .warn { background: var(--warn); }
.legend .danger { background: var(--danger); }
.legend .muted { background: var(--muted); }
dialog {
  width: min(440px, calc(100% - 32px));
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: var(--space-5);
}
dialog::backdrop { background: var(--scrim); }
dialog h2 { font-size: var(--text-18); }
dialog p { color: var(--muted); margin: var(--space-3) 0 0; }
dialog .actions { justify-content: flex-end; margin-top: var(--space-5); }
@media (min-width: 1280px) {
  .mappane { display: flex; margin: var(--space-4) var(--space-4) var(--space-4) 0; align-self: stretch; }
  .map-open { display: none; }
}
@media (min-width: 1280px) and (max-width: 1679px) {
  html[data-help="1"] .listpane { display: none; }
  html[data-help="1"] .list-open { display: inline-flex; }
  html[data-help="1"][data-list="1"] .listpane { display: flex; width: 360px; }
}
@media (max-width: 1279px) {
  html[data-map="1"] .mappane {
    display: flex;
    position: fixed;
    top: var(--top);
    right: 0;
    bottom: 0;
    z-index: 24;
    margin: 0;
    border-radius: 12px 0 0 12px;
    box-shadow: var(--shadow-2);
  }
}
/* WA-PORTAL-2 section 3: strip, condition chips, popovers */
html:not([data-js]) .js-only { display: none; }
html[data-js] .nojs-only { display: none; }
.wells { display: flex; flex-direction: column; gap: var(--space-3); }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-height: 36px; }
.strip h1 { font-size: var(--text-22); }
.strip .actions { margin-left: auto; }
.count { display: inline-flex; align-items: baseline; gap: 6px; font-size: var(--text-14); color: var(--muted); }
.count b { font-size: var(--text-16); color: var(--ink); font-variant-numeric: tabular-nums; }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--text-13); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; gap: 2px; background: var(--surface); }
.condbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.cond {
  position: relative;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--text-13);
  white-space: nowrap;
  max-width: 100%;
}
.cond:hover { background: var(--surface-2); }
.cond-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  min-width: 0;
  padding: 0 4px 0 10px;
  border: 0;
  border-radius: 999px 0 0 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
span.cond-edit { cursor: default; }
.cond .k { color: var(--muted); font-weight: 400; }
.cond .v { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.cond .g { color: var(--accent); font-size: var(--text-12); }
.cond .x {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--text-14);
  text-decoration: none;
  flex: none;
}
.cond .x:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.cond.place { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.cond.gated { border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--muted); }
.cond.gated .k, .cond.gated .g { color: var(--muted); }
.cond.is-open { background: var(--soft); color: var(--on-soft); border-color: var(--accent); }
.cond.is-open .k { color: var(--on-soft); }
.cond-tag { height: 18px; font-size: var(--text-11); padding: 0 7px; }
.cond-add-wrap { position: relative; display: inline-flex; }
.cond-add {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-13);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.cond-add:hover, .cond-add[aria-expanded="true"] { background: var(--surface-2); }
.cond-clear { height: 32px; display: inline-flex; align-items: center; padding: 0 8px; color: var(--muted); font-size: var(--text-13); font-weight: 600; text-decoration: none; }
.cond-clear:hover { color: var(--danger); }
.suggest-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.suggest-chips .lbl { font-size: var(--text-12); color: var(--muted); }
.preset {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--text-12);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.preset:hover { border-color: var(--line-strong); }
.from-line { margin: 0; color: var(--muted); font-size: var(--text-13); }
.from-line[hidden] { display: none; }
.save-wrap { position: relative; }
.save-wrap .pop { left: auto; right: 0; width: 260px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); }
.card.saved h3 { font-size: var(--text-16); margin: 0; }
.card.saved .sum { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-2) 0 0; }
.card.saved .foot { padding: 0; justify-content: flex-start; }
.tree { margin: 0; font-family: var(--mono); font-size: var(--text-12); white-space: pre-wrap; color: var(--ink); }
.picker-manage { color: var(--accent); font-size: var(--text-13); font-weight: 600; text-decoration: none; }
.picker-manage:hover { color: var(--accent-hover); }
dialog label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-12); font-weight: 600; margin-top: var(--space-3); }
dialog input[type="text"] {
  height: var(--control);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  padding: 0 var(--space-3);
  font: inherit;
}
/* popover: the ScopePicker and menu shape, 340 wide, radius 12, --shadow-2 */
.pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100vh - 140px));
  padding: var(--space-2);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
  text-align: left;
  font-weight: 400;
  white-space: normal;
}
.pop[hidden] { display: none; }
.pop-search {
  flex-shrink: 0;
  height: var(--control);
  padding: 0 10px;
  margin-bottom: var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-nav);
  background: var(--bg);
  font-size: var(--text-14);
  width: 100%;
}
.pop-list { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pop-sec { padding: 8px 10px 4px; font-size: var(--text-11); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pop-sec[hidden], .opt[hidden] { display: none; }
.opt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-nav);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.opt:hover, .opt:focus-visible { background: var(--surface-2); }
.opt:focus-visible { outline-offset: -2px; }
.opt .t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.opt .l { font-size: var(--text-14); }
.opt .m { font-size: var(--text-12); color: var(--muted); }
.opt.gated { color: var(--muted); }
.opt.is-disabled { cursor: default; color: var(--muted); }
.opt.is-disabled:hover { background: transparent; }
.pop-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 6px 8px; overflow: auto; min-height: 0; }
.pop-body .row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; height: auto; padding: 0; border-bottom: 0; cursor: default; }
.pop-body label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-12); font-weight: 600; }
.pop-body input[type="text"], .pop-body input[type="date"] {
  height: 34px;
  width: 140px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: var(--text-14);
}
.pop-body label.ck { flex-direction: row; align-items: center; gap: var(--space-2); min-height: 32px; font-size: var(--text-14); font-weight: 400; }
.pop-body .note { font-size: var(--text-12); color: var(--muted); margin: 0; }
.pop-body .note:empty { display: none; }
.pop-body .apply { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: 4px; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice button, .seg-opt {
  position: relative;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-13);
  font-weight: 600;
  cursor: pointer;
}
.pop-body label.seg-opt { flex-direction: row; font-size: var(--text-13); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice button[aria-pressed="true"], .seg-opt:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg-opt.gated { border-style: dashed; color: var(--muted); background: transparent; }
html[data-js] .editor[data-mode="gt"] .f-max,
html[data-js] .editor[data-mode="lt"] .f-min,
html[data-js] .editor[data-mode="on"] .f-max,
html[data-js] .editor[data-mode="after"] .f-max,
html[data-js] .editor[data-mode="before"] .f-min { display: none; }
.foot-size { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; font-size: var(--text-12); font-weight: 600; }
.foot-size .select { width: 84px; }
@media (max-width: 767px) {
  .condbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .cond, .preset, .cond-clear { flex: none; }
  .suggest-chips { flex-wrap: nowrap; }
  .cond-add-wrap { position: sticky; right: 0; order: 10; flex: none; background: var(--bg); padding-left: 4px; }
  .strip h1 { font-size: var(--text-18); }
  .strip .actions .t { display: none; }
  .pop {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 70vh;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
}
/* WA-PORTAL-2 §2 and §5: map fills, list scrolls inside, table keeps the 420px pane. */
.work:has(.wells) .page { overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.page-inner.wells { max-width: none; flex: 1; min-height: 0; gap: 0; }
.wells .strip { min-height: 36px; padding: var(--space-2) var(--space-3) 0; }
.wells .condbar { padding: var(--space-2) var(--space-3); }
.modeseg { display: none; }
.layoutseg button, .modeseg button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: var(--text-12);
  font-weight: 600;
  cursor: pointer;
}
.layoutseg button[aria-pressed="true"], .modeseg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.list-open { display: none; }
.frame { flex: 1; min-height: 0; display: flex; flex-direction: row; }
.mapwrap { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; background: var(--map-land); }
.mapwrap #portal-map { height: auto; min-height: 0; flex: 1; border: 0; border-radius: 0; }
.layers-btn { position: absolute; top: 10px; right: 10px; z-index: 3; }
.layers-pop { top: 44px; right: 10px; left: auto; width: 280px; gap: 6px; }
.layers-pop .seg { align-self: flex-start; }
.layer-row, .layers-pop .lock {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-nav);
  background: transparent;
  text-align: left;
  font-size: var(--text-14);
  cursor: pointer;
}
.layer-row[aria-pressed="true"] { background: var(--surface-2); }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.swatch.counties { background: var(--muted); }
.swatch.fields { background: var(--ok); }
.swatch.basins { background: var(--accent); }
.swatch.offshore { background: var(--warn); }
.swatch.gcd { background: var(--line-strong); }
.mapwrap .legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  margin: 0;
  min-height: 28px;
  padding: 3px 12px;
  gap: 4px 12px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.mapwrap .legend li { display: inline-flex; align-items: center; }
.layers-pop .legend { position: static; left: auto; bottom: auto; display: flex; margin: 4px 0 0; padding: 6px 0 0; min-height: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.mapwrap .map-msg {
  position: absolute;
  left: 10px;
  top: 56px;
  z-index: 2;
  margin: 0;
  max-width: 380px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
  font-size: var(--text-12);
  line-height: 1.35;
}
.mapwrap .map-msg:empty { display: none; }
.mapctl { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; }
.maplibregl-ctrl-bottom-right { bottom: 46px !important; }
.listpane {
  width: 440px;
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
#fragment-list { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.listhead { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.listhead h2 { font-size: var(--text-16); flex: 1; min-width: 0; }
.sortpop { position: relative; }
.sortpop summary { cursor: pointer; font-weight: 600; font-size: var(--text-13); }
.sortpop .pop { width: 180px; right: 0; left: auto; padding: var(--space-1); }
.sortpop .pop a { display: block; padding: 6px 8px; text-decoration: none; color: inherit; border-radius: var(--radius-nav); }
.sortpop .pop a[aria-selected="true"] { background: var(--surface-2); }
.rows { flex: 1; min-height: 0; overflow: auto; }
.row {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  grid-template-rows: auto auto;
  align-items: center;
  row-gap: 2px;
  padding: 7px var(--space-3);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.row .l1 { display: flex; gap: 8px; min-width: 0; align-items: baseline; }
.row .api { font-family: var(--mono); font-weight: 600; font-size: var(--text-13); white-space: nowrap; flex: none; }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.row .pill { white-space: nowrap; }
.row .l2 { grid-column: 1 / 3; display: flex; gap: 8px; align-items: center; min-width: 0; color: var(--muted); font-size: var(--text-12); }
.row .op { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .n { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.is-selected { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.row.is-hot { background: var(--surface-2); }
.mappin.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.mappin.is-hot { transform: translate(-50%, -50%) scale(1.15); }
.maplibregl-marker .mappin.is-hot { transform: scale(1.15); }
.listfoot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-13); }
.listfoot-actions { display: flex; gap: var(--space-2); align-items: center; }
.list-empty { padding: var(--space-4); }
.tablecard { display: none; min-width: 0; min-height: 0; flex: 1; flex-direction: column; overflow: auto; background: var(--surface); }
.frame.table .listpane,
html[data-layout="table"] .frame .listpane { display: none; }
.frame.table .tablecard,
html[data-layout="table"] .frame .tablecard { display: flex; }
.frame.table .mapwrap,
html[data-layout="table"] .frame .mapwrap { width: 420px; flex: none; }
.welcome { padding: var(--space-4); }
.welcome h2 { font-size: var(--text-18); margin-bottom: var(--space-2); }
.welcome .grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin: var(--space-3) 0; }
.welcome.in-pane > p { margin: 0; color: var(--muted); }
.welcome .act {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 96px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.welcome .act:hover { border-color: var(--line-strong); background: var(--surface-2); }
.welcome .act .ic {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--on-soft);
  display: grid;
  place-items: center;
}
.welcome .act .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.welcome .act small { font-weight: 400; color: var(--muted); font-size: var(--text-12); }
.welcome .api { display: flex; gap: var(--space-2); }
.welcome .api input { flex: 1; min-width: 0; height: var(--control); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0 var(--space-2); background: var(--bg); }
.welcome .hint { color: var(--muted); font-size: var(--text-13); }
.welcome-float { display: none; }
.map-popup-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.map-popup-acts .btn { height: 26px; padding: 0 8px; font-size: var(--text-12); }
@media (min-width: 1280px) {
  html[data-help="1"] .listpane { width: 360px; }
  #map-pane { display: flex; }
}
@media (max-width: 1279px) {
  .frame:not(.table),
  html[data-layout="map"] .frame { flex-direction: column; }
  .frame:not(.table) .listpane { width: auto; flex: 1; border-left: 0; border-top: 1px solid var(--line); }
  .frame.table,
  html[data-layout="table"] .frame { flex-direction: column; }
  .frame.table .mapwrap,
  html[data-layout="table"] .frame .mapwrap { width: auto; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .frame:not(.table) .mapwrap,
  html[data-layout="map"] .frame .mapwrap,
  .frame.table .mapwrap,
  html[data-layout="table"] .frame .mapwrap { height: 46vh; flex: none; }
}
@media (max-width: 767px) {
  .modeseg { display: inline-flex; }
  .frame[data-mode="map"] .listpane,
  html[data-layout="map"] .frame[data-mode="map"] .listpane { display: none; }
  .frame[data-mode="map"] .mapwrap { flex: 1; height: auto; }
  .frame[data-mode="list"] .mapwrap { display: none; }
  .frame[data-mode="list"] .listpane { width: auto; flex: 1; display: flex; }
  .frame[data-mode="map"] .welcome-float {
    display: block;
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 56px;
    z-index: 3;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-2);
    max-height: 46%;
    overflow: auto;
  }
  .mapwrap > .legend, .mapwrap .map-msg { display: none; }
  .maplibregl-ctrl-bottom-right { bottom: 96px !important; }
  .layers-pop .legend { display: flex; }
  .welcome .grid { grid-template-columns: 1fr 1fr; }
}
/* WA-PORTAL-ASTRA-1: shared notices, Not applied group, map caption, row links, picker rows */
.notices-wrap { display: flex; flex-direction: column; gap: 4px; padding: 0 var(--space-3) var(--space-2); }
.notices-wrap:not(:has(.notice-line:not([hidden]))) { display: none; }
.notice-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--text-13);
}
.notice-line[hidden] { display: none; }
.notice-line .t { flex: 1 1 240px; }
.notice-line .acts { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.notice-line.unapplied { border-style: dashed; border-color: var(--line-strong); }
.notice-line.update { background: var(--info-soft); color: var(--info); border-color: transparent; font-weight: 600; }
.notice-line.update.is-error { background: var(--danger-soft); color: var(--danger); }
.notice-line.update .btn { color: inherit; border-color: currentColor; background: transparent; }
.notice-line.result { display: none; }
#count.is-stale b { color: var(--muted); }
.frame[aria-busy="true"] .rows, .frame[aria-busy="true"] .tablewrap { opacity: .72; }
.cond-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 2px 6px 2px 10px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
}
.cond-group:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cond-group-l { font-size: var(--text-12); font-weight: 600; color: var(--muted); white-space: nowrap; }
.sheet-head { display: none; }
.phoneband { display: none; }
.scrim-filters { display: none; position: fixed; inset: 0; background: var(--scrim); border: 0; padding: 0; z-index: 40; }
.map-coverage {
  position: absolute;
  left: 10px;
  bottom: 46px;
  z-index: 2;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  font-size: var(--text-12);
  color: var(--muted);
}
.map-coverage .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-coverage .btn { height: 22px; padding: 0 8px; font-size: var(--text-12); }
.map-coverage .btn[hidden] { display: none; }
.row .well-link { display: inline-flex; gap: 8px; min-width: 0; max-width: 100%; align-items: baseline; color: inherit; text-decoration: none; }
.row .well-link:hover .name, .row .well-link:focus-visible .name { text-decoration: underline; }
.row-select {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  align-self: center;
  justify-self: end;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.row.is-selected .row-select, .row-select[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.scope .opt { padding-right: 4px; }
.scope .opt-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.scope .opt-main .t { flex: 1; }
.scope .opt-main:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius-nav); }
.scope .star.is-signin { color: var(--muted); }
.mappin.near-centre { background: var(--accent); color: var(--on-accent); width: 24px; height: 24px; min-width: 24px; padding: 0; }
.pop-foot-toggle { cursor: pointer; }
.pop-foot-toggle input { margin: 0; }
.pop-foot-toggle .m { font-weight: 400; color: var(--muted); font-size: var(--text-12); }
.pop-head { display: none; }
.toast .toast-act {
  margin-left: 10px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--on-accent);
  background: transparent;
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
}
.welcome.compact .welcome-lead { margin: 0 0 6px; font-weight: 600; font-size: var(--text-13); }
.welcome.compact .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.welcome.compact .api { margin-top: 8px; }
.welcome.compact .api[hidden] { display: none; }
@media (pointer: coarse) {
  .condbar { gap: 10px; }
  .cond .x { position: relative; width: 30px; height: 30px; }
  .cond .x::before { content: ""; position: absolute; inset: -7px; }
  .row-select { width: 40px; height: 40px; }
  .mappin.point { width: 26px; height: 26px; min-width: 26px; font-size: 13px; }
}
@media (max-width: 767px) {
  .phoneband { display: flex; gap: var(--space-2); padding: 0 var(--space-3) var(--space-2); }
  .band-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    height: 44px;
    padding: 4px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
  }
  .band-btn .k { font-size: var(--text-11); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .band-btn .v { font-size: var(--text-13); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .band-btn[aria-expanded="true"] { border-color: var(--accent); }
  .notice-line.result { display: flex; }
  html[data-filters="1"] .scrim-filters { display: block; }
  html[data-filters="1"] .wells .condbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    flex-wrap: wrap;
    overflow: auto;
    max-height: 80vh;
    padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: var(--shadow-2);
  }
  html[data-filters="1"] .wells .condbar .sheet-head { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); font-size: var(--text-16); }
  html[data-filters="1"] .wells .condbar .cond-add-wrap { position: static; order: 0; background: transparent; padding-left: 0; }
  html[data-filters="1"] .wells .condbar .suggest-chips { flex-wrap: wrap; }
  .pop { padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom)); z-index: 45; }
  .scope .pop { top: auto; max-height: 70vh; }
  .save-wrap .pop { left: 0; right: 0; width: 100%; }
  /* the breadcrumb pill stops short of the Layers button */
  .scope { max-width: calc(100% - 104px); }
  .scope-row { overflow: hidden; padding-left: 8px; }
  .scope-k { display: none; }
  .segb { max-width: 96px; min-width: 0; flex: 0 1 auto; }
  /* a sticky Add control is a stacking context: its sheet must still paint above the map controls */
  .cond-add-wrap, .cond.is-open, .save-wrap { z-index: 46; }
  .pop .pop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 2px 4px 8px; font-size: var(--text-16); font-weight: 700; }
  .pop-body .apply { position: sticky; bottom: 0; background: var(--surface); padding-top: 6px; }
  .map-coverage { bottom: 48px; }
  .welcome.compact { bottom: auto; top: 56px; max-height: none; padding: var(--space-2) var(--space-3); }
}
/* WA-PORTAL-VISUAL-1: busy bar, map chrome lift, list sort, table columns, empty states, narrow map, phone */
.frame { position: relative; }
.frame[aria-busy="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 6;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: wa-busy 1.1s linear infinite;
}
@keyframes wa-busy {
  from { background-position: -60% 0; }
  to { background-position: 160% 0; }
}
.mapwrap .btn.secondary { box-shadow: var(--shadow-1); }
.row-select { display: grid; place-items: center; }
.row-select svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mapctl .btn svg, .welcome.compact .acts .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.listhead .muted.num { font-size: var(--text-13); }
.sortpop summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-12);
  font-weight: 600;
  cursor: pointer;
}
.sortpop summary::-webkit-details-marker { display: none; }
.sortpop summary::before { content: "Sort"; font-weight: 400; }
.sortpop summary:hover, .sortpop[open] summary { background: var(--surface-2); color: var(--ink); }
/* columns size to content: API, numbers and status pills stay on one line, names and operators wrap */
.welltable { table-layout: auto; }
.welltable td:first-child, .welltable td.n, .welltable td:nth-child(5) .pill { white-space: nowrap; }
.welltable td:first-child a { text-decoration: none; }
.welltable td:first-child a:hover { text-decoration: underline; }
.list-empty, .tablecard .pad[data-notice] { padding: 40px var(--space-4); text-align: center; }
.list-empty .notice, .tablecard .pad[data-notice] .notice { font-weight: 600; font-size: var(--text-16); color: var(--ink); }
.list-empty .notice.broad, .tablecard .pad[data-notice] .notice.broad { color: var(--warn); }
.list-empty .notice.error, .tablecard .pad[data-notice] .notice.error { color: var(--danger); }
.list-empty p + p, .tablecard .pad[data-notice] p + p { margin: var(--space-3) 0 0; }
@media (min-width: 1280px) {
  /* the 420px map beside the table: keep the caption, drop the duplicated legend and hint, stack the controls */
  .frame.table .mapwrap > .legend, html[data-layout="table"] .frame .mapwrap > .legend,
  .frame.table .mapwrap .map-msg, html[data-layout="table"] .frame .mapwrap .map-msg { display: none; }
  .frame.table .map-coverage, html[data-layout="table"] .frame .map-coverage { bottom: 10px; max-width: calc(100% - 20px); }
  .frame.table .mapctl, html[data-layout="table"] .frame .mapctl { flex-wrap: wrap; justify-content: flex-end; bottom: 46px; max-width: calc(100% - 20px); }
  .frame.table .maplibregl-ctrl-bottom-right, html[data-layout="table"] .frame .maplibregl-ctrl-bottom-right { bottom: 118px !important; }
}
@media (max-width: 767px) {
  .wells .strip { gap: var(--space-2); }
  .strip .count.muted { display: none; }
  .strip .actions { margin-left: auto; gap: 6px; }
  /* Map/List is a full-width segment under the title; Map/Table shows only while the table layout is on */
  .modeseg { order: 10; flex: 1 1 100%; }
  .modeseg button { flex: 1; height: 28px; }
  .layoutseg { display: none; }
  html[data-layout="table"] .layoutseg { display: inline-flex; order: 10; flex: 1 1 100%; }
  html[data-layout="table"] .layoutseg button { flex: 1; height: 28px; }
  html[data-layout="table"] .modeseg, html[data-layout="table"] .frame .mapwrap { display: none; }
  /* the sticky Add control fades in over the rail instead of cutting a chip, and reaches the edge */
  html:not([data-filters="1"]) .wells .condbar { padding-right: 0; }
  html:not([data-filters="1"]) .wells .condbar .cond-add-wrap { padding-left: 18px; padding-right: var(--space-3); background: linear-gradient(90deg, transparent 0, var(--bg) 14px); }
  .frame[data-mode="map"] .welcome-float.compact { top: 56px; bottom: auto; max-height: none; }
  .scope { max-width: calc(100% - 100px); }
  .segb { max-width: 126px; }
  .mapctl { left: 10px; right: 10px; justify-content: flex-end; gap: 6px; }
  .mapctl .btn { white-space: nowrap; font-size: var(--text-12); }
  .mapctl #map-search-here, .mapctl #map-draw { padding: 0 8px; font-size: var(--text-12); }
  /* the table reads as stacked rows: API and name, status at the right, then the rest with labels */
  .welltable thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .welltable, .welltable tbody { display: block; }
  .welltable tr {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    column-gap: var(--space-3);
    row-gap: 4px;
    padding: 10px var(--space-3);
    border-top: 1px solid var(--line);
  }
  .welltable td { display: block; padding: 0; border: 0; min-height: 0; font-size: var(--text-13); text-align: left; }
  .welltable td:first-child { grid-column: 1 / 3; grid-row: 1; }
  .welltable td:nth-child(2) { grid-column: 1 / 3; grid-row: 2; font-weight: 600; font-size: var(--text-14); }
  .welltable td:nth-child(5) { grid-column: 3; grid-row: 1 / span 2; justify-self: end; align-self: start; }
  .welltable td:nth-child(5) .pill { white-space: nowrap; }
  .welltable td:nth-child(3) { grid-column: 1 / 3; grid-row: 3; color: var(--muted); }
  .welltable td:nth-child(6) { grid-column: 3; grid-row: 3; justify-self: end; }
  .welltable td:nth-child(4) { grid-column: 1; grid-row: 4; }
  .welltable td:nth-child(7) { grid-column: 2; grid-row: 4; }
  .welltable td:nth-child(8) { grid-column: 3; grid-row: 4; }
  .welltable td:nth-child(4)::before, .welltable td:nth-child(7)::before, .welltable td:nth-child(8)::before {
    content: attr(data-label);
    display: block;
    font-size: var(--text-11);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
