:root {
  --bg: #f1eee6;
  --card: #fbf9f4;
  --ink: #1d1b16;
  --muted: #6d675b;
  --line: #ddd7c9;
  --field: #eee9de;
  --accent: #b45309;
  --shadow: 0 1px 2px rgb(40 30 10 / 8%), 0 8px 24px rgb(40 30 10 / 10%);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --residential: #c026a3;
  --commercial: #2563eb;
  --industrial: #8a5a2b;
  --homes: #e879b9;
  --city: #b45309;
  --etj: #0f766e;
  --done: #8b8f97;
}

:root[data-theme='dark'] {
  --city: #f4b740;
  --etj: #5eead4;
  --bg: #14151a;
  --card: #1d1f26;
  --ink: #f0ede6;
  --muted: #a09b90;
  --line: #33363f;
  --field: #2a2d36;
  --accent: #f4b740;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 45%);
  --residential: #f070d6;
  --commercial: #6ea0ff;
  --industrial: #d09a5c;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

#map {
  position: fixed;
  inset: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--btn-radius);
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--accent);
}

/* ---------- top bar ---------- */

.bar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(620px, calc(100vw - 24px));
  padding: 10px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.brand p {
  margin: 1px 0 0;
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.search input::placeholder {
  color: var(--muted);
}

.results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 50vh;
  overflow: auto;
}

.results li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.results li:hover,
.results li[aria-selected='true'] {
  background: var(--field);
}

.results small {
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.results .empty {
  color: var(--muted);
  cursor: default;
}

.tools {
  display: flex;
  gap: 2px;
  flex: none;
}

.tools button {
  width: 32px;
  height: 32px;
  border-radius: var(--btn-radius);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.tools button:hover {
  background: var(--field);
}

.tools svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- layers ---------- */

.layers {
  position: fixed;
  top: 78px;
  left: 12px;
  z-index: 4;
  width: 248px;
  max-height: calc(100vh - 78px - 96px);
  overflow: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-head[aria-expanded='false'] .caret {
  transform: rotate(-90deg);
}

#layers-body {
  padding: 0 12px 12px;
}

#layers-body[hidden] {
  display: none;
}

.rows {
  display: grid;
  gap: 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px;
  border-radius: 6px;
  text-align: left;
}

.row:hover {
  background: var(--field);
}

.row .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--c);
  flex: none;
}

.row .swatch.dot {
  border-radius: 50%;
  width: 9px;
  height: 9px;
  margin: 0 1.5px;
}

.row .swatch.outline {
  background: none;
  border: 2px dashed var(--c);
}

.row .n {
  margin-left: auto;
  font: 11px var(--mono);
  color: var(--muted);
}

.row .switch {
  width: 26px;
  height: 15px;
  border-radius: 8px;
  background: var(--line);
  position: relative;
  flex: none;
  transition: background 0.15s;
}

.row .switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--card);
  transition: transform 0.15s;
}

.row[aria-checked='true'] .switch {
  background: var(--ink);
}

.row[aria-checked='true'] .switch::after {
  transform: translateX(11px);
}

.row[aria-checked='false'] .name,
.row[aria-checked='false'] .swatch {
  opacity: 0.45;
}

.group-label {
  margin: 12px 4px 6px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 6px;
}

.chip,
.view-row button,
.timeline #today {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.view-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.view-row button:hover,
.timeline #today:hover {
  background: var(--field);
}

/* ---------- detail ---------- */

.detail {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 24px - 84px);
  overflow: auto;
  padding: 16px 16px 14px;
}

.detail .close,
.about .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 20px;
  line-height: 1;
}

.detail .close:hover,
.about .close:hover {
  background: var(--field);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 30px 6px 0;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--c);
}

.detail h2,
.about h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--c);
  color: var(--c);
}

.badge.active {
  background: var(--c);
  color: #fff;
}

.badge.complete {
  --c: var(--done);
}

.detail .where {
  margin: 8px 0 0;
  color: var(--muted);
}

.detail .desc {
  margin: 10px 0 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.facts div.wide {
  grid-column: 1 / -1;
}

.facts dt {
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 1px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.facts dd small {
  font-weight: 400;
  color: var(--muted);
}

.detail h3,
.about h3 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.filings {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.filings li {
  display: grid;
  gap: 1px;
}

.filings small,
.note {
  color: var(--muted);
  font-size: 12px;
}

.note {
  margin: 12px 0 0;
}

/* ---------- timeline ---------- */

.timeline {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(430px, calc(100vw - 24px));
  padding: 10px 14px;
}

.timeline #play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  flex: none;
}

.timeline #play:hover {
  background: var(--field);
}

.track {
  flex: 1;
  min-width: 0;
}

.track input {
  width: 100%;
  margin: 0;
  accent-color: var(--ink);
}

.ticks {
  display: flex;
  justify-content: space-between;
  font: 11px var(--mono);
  color: var(--muted);
}

#time-label {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- about ---------- */

.about {
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 22px 24px;
  color: var(--ink);
}

.about::backdrop {
  background: rgb(20 18 12 / 45%);
}

.about h2 {
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.about ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.about .num {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 10;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- map chrome ---------- */

.maplibregl-ctrl-bottom-right {
  bottom: 4px;
}

.maplibregl-ctrl-group {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow) !important;
}

:root[data-theme='dark'] .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1);
}

.maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--card) 80%, transparent) !important;
  color: var(--muted);
  font-size: 11px;
}

.maplibregl-ctrl-attrib a {
  color: inherit;
}

.maplibregl-popup-content {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font: 13px/1.4 system-ui, sans-serif;
  max-width: 250px;
}

.maplibregl-popup-content b {
  display: block;
}

.maplibregl-popup-content small {
  color: var(--muted);
}

.maplibregl-popup-tip {
  display: none;
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .bar {
    gap: 8px;
    padding: 8px;
  }

  .brand p {
    display: none;
  }

  .brand h1 {
    font-size: 14px;
  }

  .layers {
    top: 68px;
    width: 220px;
    max-height: calc(100vh - 68px - 150px);
  }

  .detail {
    top: auto;
    right: 12px;
    bottom: 78px;
    max-height: 52vh;
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- editing ---------- */

#edit-toggle[aria-pressed='true'] {
  background: var(--ink);
  color: var(--card);
}

#edit-toggle.dirty {
  position: relative;
}

#edit-toggle.dirty::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.editbar {
  position: fixed;
  left: calc(12px + min(430px, 100vw - 24px) + 12px);
  bottom: 12px;
  z-index: 4;
  max-width: calc(100vw - 480px);
  padding: 10px 12px 10px;
}

.edit-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.edit-head span {
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.edit-tools,
.actions,
.drawhint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.edit-tools button,
.actions button,
.drawhint button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.edit-tools button:hover,
.actions button:hover,
.drawhint button:hover {
  background: var(--field);
}

button.primary {
  background: var(--ink);
  border-color: var(--ink) !important;
  color: var(--card);
}

button.primary:hover {
  background: var(--ink) !important;
  opacity: 0.88;
}

button.danger {
  color: #c62828;
  margin-left: auto;
}

:root[data-theme='dark'] button.danger {
  color: #ff8a80;
}

.detail .actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.drawhint {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 12px;
  font-weight: 600;
  border-color: var(--accent);
}

.drawhint span {
  margin-right: 4px;
}

.editform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 4px;
}

.editform .wide {
  grid-column: 1 / -1;
}

.editform label {
  display: grid;
  align-content: start;
  gap: 4px;
}

.editform label span {
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.editform input,
.editform select,
.editform textarea {
  width: 100%;
  padding: 8px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.editform textarea {
  resize: vertical;
}

/* Every one-line box the same height, dates and lists included */
.editform input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']):not([type='range']),
.editform select {
  height: 36px;
}

.editform .note {
  margin: 0;
}

.editform .actions {
  margin-top: 2px;
}

@media (max-width: 1000px) {
  .editbar {
    left: 12px;
    bottom: 78px;
    max-width: calc(100vw - 24px);
  }

  body.editing .detail {
    max-height: 46vh;
  }
}

@media (max-width: 720px) {
  .drawhint {
    top: 68px;
  }

  body.editing .detail {
    bottom: 170px;
  }
}

[hidden] {
  display: none !important;
}

.login {
  width: min(380px, calc(100vw - 24px));
}

.login h2 {
  font-size: 20px;
  text-transform: capitalize;
}

.login input {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.login .note {
  min-height: 18px;
  margin: 8px 0;
  color: #c62828;
}

/* ---------- listing types and map key ---------- */

.group-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

button.link {
  font: 600 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.uses {
  display: grid;
  gap: 1px;
  margin-bottom: 4px;
}

.use {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 4px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}

.use:hover {
  background: var(--field);
}

.use .n {
  margin-left: auto;
  font: 11px var(--mono);
  color: var(--muted);
}

.use[aria-pressed='false'] {
  opacity: 0.4;
  text-decoration: line-through;
}

.use.none {
  display: none;
}

.key {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
  font-size: 12px;
}

.key li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key .k {
  flex: none;
  width: 14px;
  height: 11px;
  border-radius: 2px;
  border: 1.5px solid var(--commercial);
}

.key .solid {
  background: color-mix(in srgb, var(--commercial) 55%, transparent);
}

.key .hatch {
  background: repeating-linear-gradient(135deg, var(--commercial) 0 1.5px, transparent 1.5px 4.5px);
  border-style: dashed;
}

.key .gray {
  background: color-mix(in srgb, var(--done) 40%, transparent);
  border-color: var(--done);
}

.key .ring,
.key .dot,
.key .home {
  width: 11px;
  border-radius: 50%;
}

.key .ring {
  border-width: 2.5px;
  background: var(--card);
}

.key .dot {
  background: var(--commercial);
}

.key .home {
  width: 8px;
  height: 8px;
  margin: 0 4px 0 4px;
  border: 0;
  background: var(--homes);
}

.layers {
  overflow-x: hidden;
}

/* ---------- dropdown options ---------- */

.options {
  width: min(520px, calc(100vw - 24px));
}

.options h2 {
  font-size: 20px;
  text-transform: capitalize;
}

.optlist {
  display: grid !important;
  gap: 6px !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  list-style: none;
}

.optlist li {
  display: flex;
  gap: 6px;
  align-items: center;
}

.optlist input[type='text'],
.optlist select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.optlist input.icon {
  flex: none;
  width: 46px;
  text-align: center;
}

.optlist input[type='color'] {
  flex: none;
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
}

.optlist select {
  flex: 0 0 170px;
}

.optlist button,
.options section > button {
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
}

.optlist button {
  flex: none;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
}

.optlist button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.options section > button {
  padding: 6px 10px;
}

.options section > button:hover,
.optlist button:not(:disabled):hover {
  background: var(--field);
}

.options .actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.edit-tools button.publish {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

:root[data-theme='dark'] .edit-tools button.publish {
  color: #1d1b16;
}

.edit-tools button.publish:hover {
  background: var(--accent);
  opacity: 0.88;
}

.edit-tools .auto {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- status styles ---------- */

.badge.filled {
  background: var(--c);
  color: #fff;
}

.key .k {
  border: 1.5px solid var(--c);
  background: none;
}

.key .f-solid {
  background: color-mix(in srgb, var(--c) 60%, transparent);
}

.key .f-light {
  background: color-mix(in srgb, var(--c) 28%, transparent);
}

.key .f-hatch {
  background: repeating-linear-gradient(135deg, var(--c) 0 1.5px, transparent 1.5px 4.5px);
  border-style: dashed;
}

.key .f-cross {
  background: repeating-linear-gradient(135deg, var(--c) 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, var(--c) 0 1px, transparent 1px 4px);
}

.key .f-dots {
  background: radial-gradient(var(--c) 1.1px, transparent 1.4px) 0 0 / 4px 4px;
}

.key .home {
  border: 0;
  background: var(--homes);
}

.optlist .own {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.optlist select {
  flex: 0 0 130px;
}

.options {
  width: min(600px, calc(100vw - 24px));
}

@media (max-width: 560px) {
  .optlist li {
    flex-wrap: wrap;
  }
}

/* ---------- edit bar "More" menu ---------- */

.more {
  position: relative;
  display: flex;
  gap: 6px;
}

.menu.inline {
  display: contents;
}

.menu.pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.menu.pop button {
  border: 0;
  border-radius: var(--btn-radius);
  text-align: left;
  padding: 8px 10px;
}

/* ---------- deleted listings ---------- */

.deleted {
  display: grid !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  max-height: 46vh;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.deleted li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}

.deleted li div {
  flex: 1;
  min-width: 0;
  display: grid;
}

.deleted small {
  color: var(--muted);
}

.deleted button {
  flex: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
}

.deleted button:hover {
  background: var(--field);
}

.row .swatch.outline.solid {
  border-style: solid;
}

/* ---------- property lots and permanent delete ---------- */

.popup-add {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
}

.deleted li {
  flex-wrap: wrap;
}

.deleted button.danger {
  margin-left: 0;
}

.detail .actions button.danger + button.danger {
  margin-left: 0;
}

/* ---------- sign-in and user accounts ---------- */

.login label,
.userform > label:not(.check) {
  display: block;
  margin: 10px 0 4px;
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

#edit-who {
  margin-left: auto;
}

#edit-who.as-support {
  text-transform: none;
}

.userform {
  margin-top: 14px;
  padding: 4px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--field) 45%, transparent);
}

.userform input[type='text'],
.userform input[type='password'] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.userform fieldset {
  margin: 12px 0 8px;
  padding: 8px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.userform legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 12px;
}

.perms {
  display: grid;
  gap: 6px;
}

.perms label,
.userform .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.userform .note {
  min-height: 16px;
  margin: 8px 0;
  color: #c62828;
}

.userform .actions {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

.userlog {
  display: grid !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  max-height: 150px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
}

.userlog strong {
  color: var(--ink);
}

#users .deleted {
  max-height: 34vh;
}

/* ---------- roles and bulk tools ---------- */

.userform select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.userform .muted {
  margin: 6px 0 0;
}

.options textarea,
.filters input,
.filters select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.options textarea {
  margin-top: 10px;
  font: 12px var(--mono);
  white-space: pre;
  resize: vertical;
}

.options .actions.plain {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.filebtn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filebtn:hover {
  background: var(--field);
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 6px;
}

.deleted li.bad strong {
  color: #c62828;
}

.picklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
}

.picklist li {
  padding: 6px 2px;
}

.options button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- account and admin menu, top right ---------- */

.adminbar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 8;
  padding: 6px;
}

.adminbar > button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.adminbar > button:hover,
.adminbar > button[aria-expanded='true'] {
  background: var(--field);
}

.adminbar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.adminbar .menu.pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
  min-width: 210px;
}

.adminbar .menu.pop button {
  font-size: 13px;
  font-weight: 600;
}

.adminbar .menu.pop button:hover {
  background: var(--field);
}

.adminbar #edit-lock {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  padding-top: 10px;
}

/* A listing's card opens in the same corner; in edit mode it sits below the menu. */
body.editing .detail {
  top: 66px;
  max-height: calc(100vh - 66px - 24px - 84px);
}

@media (max-width: 900px) {
  .adminbar {
    top: 68px;
  }

  body.editing .detail {
    top: 122px;
    max-height: calc(100vh - 122px - 24px - 84px);
  }
}

@media (max-width: 720px) {
  body.editing .detail {
    top: auto;
    max-height: 46vh;
  }
}

/* A visitor's Sign In button sits in the same corner: the card opens below it. */
@media (min-width: 721px) {
  body:not(.editing):has(#signin-bar:not([hidden])) .detail {
    top: 66px;
    max-height: calc(100vh - 66px - 24px - 84px);
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  body:has(#signin-bar:not([hidden])) .bar {
    width: calc(100vw - 24px - 128px);
  }

  body:not(.editing):has(#signin-bar:not([hidden])) .detail {
    top: 80px;
    max-height: calc(100vh - 80px - 24px - 84px);
  }
}

/* ---------- tenants ---------- */

.stage {
  display: inline-block;
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--c);
  color: var(--c);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.tenants {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.tenants li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}

.tenants li div {
  flex: 1;
  min-width: 0;
  display: grid;
}

.tenants small {
  color: var(--muted);
  font-size: 12px;
}

.tenants .ti {
  flex: none;
  width: 20px;
  text-align: center;
}

.tenant-edit {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.tenant-edit:hover {
  background: var(--field);
}

/* ---------- moving a tenant between developments ---------- */

.editform .dev-filter {
  margin-bottom: 4px;
}

.editform select[size] {
  padding: 4px;
  overflow: auto;
}

.editform select[size] option {
  padding: 4px 6px;
  border-radius: 4px;
}

/* ---------- moving several tenants at once ---------- */

.movehead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.movehead span {
  margin-right: auto;
}

.movehead button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 11px;
  font-weight: 600;
}

.movelist {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.movelist li + li {
  border-top: 1px solid var(--line);
}

.editform .movelist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  cursor: pointer;
}

.editform .movelist input {
  width: auto;
  flex: none;
}

.movelist div {
  display: grid;
  min-width: 0;
}

.movelist small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- possible duplicates ---------- */

.dupes {
  width: min(720px, calc(100vw - 24px));
}

.dupelist {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  max-height: 56vh;
  overflow: auto;
}

.dupelist li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dupe-why {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.dupe-why span {
  margin-right: 6px;
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.dupe-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dupe-side {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--field);
  min-width: 0;
}

.dupe-side small {
  color: var(--muted);
  font-size: 12px;
}

.dupe-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dupes button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
}

.dupes .danger {
  margin-left: 0;
  background: var(--card);
}

.dupe-skip {
  margin-top: 8px;
  margin-right: 4px;
}

@media (max-width: 560px) {
  .dupe-pair {
    grid-template-columns: 1fr;
  }
}

.dupe-in {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.dupe-pair {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.dupe-bulk {
  margin: 0 0 10px !important;
}

.dupes .dupe-bulk .primary {
  background: var(--ink);
  color: var(--card);
}

.dupe-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dupe-keep {
  cursor: pointer;
}

/* ---------- insights dashboard ---------- */

/* The three stages of a project are a fixed series of colours wherever they
   appear in the dashboard. Each mode has its own steps, checked for colour-blind
   separation and contrast against that mode's surface. */
:root {
  --viz-planned: #2a78d6;
  --viz-active: #eb6834;
  --viz-complete: #1baf7a;
  --viz-other: #8b8f97;
}

:root[data-theme='dark'] {
  --viz-planned: #3987e5;
  --viz-active: #d95926;
  --viz-complete: #199e70;
  --viz-other: #7d828c;
}

.insights {
  position: fixed;
  inset: 0;
  width: min(1180px, calc(100vw - 24px));
  max-width: none;
  height: calc(100vh - 24px);
  max-height: none;
  margin: auto;
  padding: 0 22px 22px;
  color: var(--ink);
  overflow: hidden auto;
}

.insights::backdrop {
  background: rgb(20 18 12 / 55%);
}

.viz-top {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -22px;
  padding: 16px 22px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.viz-top h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.viz-top .eyebrow {
  margin: 0 0 2px;
}

.viz-top-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viz-top-acts .primary {
  padding: 8px 14px;
  border-radius: var(--btn-radius);
  font-weight: 700;
  font-size: 13px;
}

.viz-top-acts .close {
  position: static;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 22px;
}

.viz-top-acts .close:hover {
  background: var(--field);
}

.viz-filter {
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.viz-h {
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.viz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.viz-headline {
  margin-top: 14px;
}

.viz-tile {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--field) 40%, transparent);
}

/* The stage a tile belongs to is marked with a bar and named in its label, never by colour alone. */
.viz-tile.s-planned,
.viz-tile.s-active,
.viz-tile.s-complete {
  border-left-width: 4px;
}

.viz-tile.s-planned {
  border-left-color: var(--viz-planned);
}

.viz-tile.s-active {
  border-left-color: var(--viz-active);
}

.viz-tile.s-complete {
  border-left-color: var(--viz-complete);
}

.viz-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.viz-label {
  font-size: 13px;
  font-weight: 600;
}

.viz-note {
  font-size: 12px;
  color: var(--muted);
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.viz-panel {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}

.viz-panel h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
}

.viz-sub {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.viz-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viz-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.viz-bars {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.viz-row {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.viz-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viz-track {
  display: flex;
  gap: 2px;
  height: 14px;
  min-width: 0;
}

.viz-seg {
  display: block;
  min-width: 3px;
  height: 100%;
}

.viz-seg:first-child {
  border-radius: 2px 0 0 2px;
}

.viz-seg:last-child {
  border-radius: 0 4px 4px 0;
}

.viz-seg:hover,
.viz-colbar:hover {
  filter: brightness(1.12);
}

.viz-total {
  min-width: 44px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.viz-cols {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  margin-top: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.viz-col {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.viz-colbar {
  width: min(34px, 100%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--viz-planned);
}

.viz-colbar.future {
  background: color-mix(in srgb, var(--viz-planned) 45%, var(--card));
  outline: 1px dashed var(--viz-planned);
  outline-offset: -1px;
}

.viz-colnum {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.viz-year {
  position: absolute;
  bottom: -19px;
  font: 11px var(--mono);
  color: var(--muted);
}



.viz-table {
  margin-top: 10px;
  font-size: 12px;
}

.viz-table summary {
  cursor: pointer;
  color: var(--muted);
}

.viz-table table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
}

.viz-table th,
.viz-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.viz-table th:first-child {
  text-align: left;
}

.viz-list {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.viz-list button {
  display: grid;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--btn-radius);
  text-align: left;
}

.viz-list button:hover {
  background: var(--field);
}

.viz-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.viz-list small,
.viz-empty {
  color: var(--muted);
  font-size: 12px;
}

.viz-foot {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 90ch;
}

.viz-tip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

@media (max-width: 720px) {
  .insights {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0 12px 16px;
  }

  .viz-top {
    margin: 0 -12px;
    padding: 12px;
  }

  .viz-top h2 {
    font-size: 18px;
  }

  .viz-grid {
    grid-template-columns: 1fr;
  }

  .viz-num {
    font-size: 22px;
  }
}

.drawhint button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- mixed-use breakdown ---------- */

.editform .mix-field,
.editform .vis-field {
  margin: 4px 0 0;
  padding: 8px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editform .mix-field legend,
.editform .vis-field legend {
  padding: 0 6px;
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mix-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.editform .mix-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.editform .mix-check input {
  width: auto;
}

/* ---------- Title Case ----------
   Labels, options and buttons read in Title Case. :where() keeps this at zero
   specificity, so headings styled in capitals elsewhere stay in capitals. */
:where(button, label, legend, summary, select, option, th, .chip, .stage, .badge, .viz-label, .viz-name, .viz-legend span, .tally, .card h2, .card h3, .key li, .menu button) {
  text-transform: capitalize;
}

:where(button small, label small, label .muted, label .note, .viz-data td, .viz-list small, input, textarea, .viz-takeaways) {
  text-transform: none;
}

/* ---------- collapsible layer groups ---------- */

details.group > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.group > summary::-webkit-details-marker {
  display: none;
}

details.group > summary::before {
  content: '▸';
  display: inline-block;
  font-size: 11px;
  transition: transform 0.15s;
}

details.group[open] > summary::before {
  transform: rotate(90deg);
}

details.group > summary > span {
  flex: 1;
}

details.group > summary:hover {
  color: var(--ink);
}

details.group > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- tenant filter and sort ---------- */

.tenant-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 8px;
}

.tenant-filter {
  flex-wrap: wrap;
  gap: 4px;
}

.tenant-filter .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

.tenant-filter .chip b {
  font-weight: 700;
  opacity: 0.7;
}

.tenant-filter .stage-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.tenant-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tenant-sort select {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.tenant-none {
  margin: 4px 0 10px;
  font-size: 13px;
}

/* ---------- dashboard additions ---------- */

.viz-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viz-nav {
  display: flex;
  gap: 4px;
  margin: 10px -4px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.viz-nav button {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.viz-nav button:hover {
  background: var(--field);
  color: var(--ink);
}

.viz-h {
  scroll-margin-top: 120px;
}

.viz-intro {
  margin: -4px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.viz-panel.wide {
  grid-column: 1 / -1;
}

.viz-takeaways {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
}

.viz-panel .viz-bars + .viz-bars {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.link-btn {
  padding: 0;
  /* Links wear the main color (Branding: "buttons and links"), not the highlight color. */
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.viz-cols.dense {
  gap: 4px;
}

.viz-plain table {
  margin-top: 8px;
}

.viz-tablebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

.viz-tablebar input {
  flex: 1 1 240px;
  min-width: 0;
}

.viz-tablebar input,
.viz-tablebar select,
.viz-tablebar button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.viz-tablebar button:hover {
  border-color: var(--accent);
}

.viz-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.viz-scroll.short {
  max-height: 380px;
  margin-top: 8px;
}

.viz-data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.viz-data th,
.viz-data td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.viz-data td:first-child {
  white-space: normal;
  min-width: 200px;
}

/* Activity → People: many short number columns, so the headers wrap to fit */
.viz-data.people th {
  white-space: normal;
  vertical-align: bottom;
}

.viz-data.people td:first-child {
  min-width: 120px;
}

.viz-data td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.viz-data .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.viz-data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  font-weight: 700;
}

.viz-data thead button {
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
}

.viz-data tbody tr:hover {
  background: color-mix(in srgb, var(--field) 60%, transparent);
}

.viz-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.viz-more {
  display: block;
  margin: 10px auto 0;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 600;
}

.viz-more:hover {
  border-color: var(--accent);
}

/* ---------- data quality tools ---------- */

.dq {
  --good: #1baf7a;
  --fair: #d39a12;
  --poor: #d6453d;
}

:root[data-theme='dark'] .dq {
  --good: #22b884;
  --fair: #e0a92a;
  --poor: #e5605a;
}

.dq-score {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.dq-big {
  display: grid;
  justify-items: center;
  min-width: 96px;
  padding: 6px 12px;
  border: 2px solid currentColor;
  border-radius: 12px;
}

.dq-big strong {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.dq-big span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.dq-big.good { color: var(--good); }
.dq-big.fair { color: var(--fair); }
.dq-big.poor { color: var(--poor); }

.dq-sum {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.dq-sum p {
  margin: 6px 0 0;
}

.dq-muted,
.dq .dq-sum .dq-muted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}

.dq-bar {
  display: block;
  flex: 1;
  min-width: 60px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden;
}

.dq-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--fair);
}

.dq-bar.good i { background: var(--good); }
.dq-bar.poor i { background: var(--poor); }

.dq-tabs button[aria-selected='true'] {
  background: var(--ink);
  color: var(--card);
}

.dq-body {
  padding-top: 14px;
}

.dq-note {
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fair) 15%, transparent);
  font-size: 13px;
}

.dq-lvl {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.dq-lvl.lvl-critical { color: var(--poor); }
.dq-lvl.lvl-warning { color: var(--fair); }
.dq-lvl.lvl-info { color: var(--muted); }

.dq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.dq-panel {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  font-size: 13px;
}

.dq-panel.wide {
  grid-column: 1 / -1;
}

.dq-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.dq-done {
  color: var(--good);
  font-weight: 600;
  font-size: 14px;
}

.dq-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.dq-rows {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.dq-grow {
  display: grid;
  grid-template-columns: auto minmax(120px, 1.4fr) minmax(60px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
}

.dq-panel:not(.wide) .dq-grow {
  grid-template-columns: minmax(110px, 1.2fr) minmax(60px, 1fr) auto auto;
}

.dq-grow:hover {
  background: var(--field);
}

.dq-grow small {
  color: var(--muted);
  min-width: 52px;
  text-align: right;
}

.dq-worst {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.dq-worst button {
  display: grid;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--btn-radius);
  text-align: left;
}

.dq-worst button:hover {
  background: var(--field);
}

.dq-worst small,
.dq-legend {
  color: var(--muted);
  font-size: 12px;
}

.dq-legend {
  display: grid;
  gap: 6px;
  padding-left: 0;
  list-style: none;
}

.dq-filters,
.dq-bar-row,
.dq-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
}

.dq-filters input[type='search'] {
  flex: 1 1 220px;
}

.dq input[type='search'],
.dq input[type='text'],
.dq input[type='url'],
.dq input[type='email'],
.dq input[type='tel'],
.dq input[type='number'],
.dq input[type='password'],
.dq input[type='date'],
.dq select,
.dq textarea {
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.dq-body button:not(.link-btn):not(.dq-check-head):not(.dq-lhead):not(.dq-grow):not(.dq-worst button),
.dq-acts > button:not(.link-btn) {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}

.dq-body button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.dq-body button.suggest {
  border-color: var(--accent);
  color: var(--accent);
}

.dq-body button.danger {
  border-color: var(--poor);
  color: var(--poor);
}

.dq-body button.dq-na-btn {
  color: var(--muted);
  border-style: dashed;
}

.dq-body button:disabled {
  opacity: 0.45;
  cursor: default;
}

.dq-check-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.dq-gh {
  margin: 18px 0 6px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dq-check {
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 9px;
}

.dq-check.lvl-critical { border-left-color: var(--poor); }
.dq-check.lvl-warning { border-left-color: var(--fair); }

.dq-check-head {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto minmax(60px, 140px) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.dq-check-name {
  font-weight: 700;
}

.dq-check-head small {
  color: var(--muted);
  min-width: 80px;
  text-align: right;
}

.dq-caret {
  font-size: 11px;
  transition: transform 0.15s;
}

.open > .dq-check-head .dq-caret,
.open > .dq-lhead .dq-caret {
  transform: rotate(90deg);
}

.dq-check-body {
  padding: 0 12px 12px;
}

.dq-why {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.dq-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--field) 70%, transparent);
}

.dq-setall {
  display: inline-flex;
  align-items: end;
  gap: 6px;
}

.dq-list,
.dq-llist,
.dq-flist,
.dq-hist,
.dq-exempts,
.dq-devs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dq-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(260px, 2fr);
  gap: 10px;
  align-items: start;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
}

.dq-row.na,
.dq-frow.na {
  opacity: 0.7;
}

.dq-what {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dq-what small,
.dq-ftitle small {
  color: var(--muted);
  font-size: 12px;
}

.dq-now {
  color: var(--ink) !important;
  font-family: var(--mono);
  font-size: 12px !important;
  overflow-wrap: anywhere;
}

.dq-fix {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.dq-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dq-in {
  display: grid;
  align-content: start; /* a hint under one box never stretches its neighbours */
  gap: 2px;
  flex: 1 1 140px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.dq-in.wide {
  flex-basis: 100%;
}

.dq-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dq-signed {
  font-size: 13px;
  color: var(--muted);
}

.dq-signed.ok {
  color: var(--good);
}

.dq-more {
  display: block;
  margin: 10px auto 0;
}

.dq-lrow {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 6px;
}

.dq-lhead {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(120px, 220px) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
}

.dq-lname {
  display: grid;
  min-width: 0;
}

.dq-lname small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dq-lscore {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.dq-lscore b {
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dq-lcount {
  display: flex;
  gap: 4px;
}

.dq-lbody {
  padding: 0 12px 12px;
}

.dq-frow {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.6fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.dq-ftitle {
  display: grid;
  gap: 4px;
  align-content: start;
}

.dq-ftitle .dq-lvl {
  justify-self: start;
}

.dq-lacts {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dq-wizbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.dq-wiz {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dq-wiz header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 4px;
}

.dq-wiz h3 {
  margin: 0;
  font-size: 18px;
}

.dq-wiz header small {
  color: var(--muted);
  font-size: 13px;
}

.dq-wiz footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.dq-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 13px;
}

.dq-devs > li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.dq-devrow {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.dq-devrow label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.dq-devrow small {
  color: var(--muted);
}

.dq-devs .dq-acts {
  margin-top: 6px;
}

.dq-exempts li,
.dq-hist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.dq-exempts span,
.dq-hist div {
  flex: 1;
  min-width: 0;
}

.dq-hist div {
  display: grid;
}

.dq-hist small {
  color: var(--muted);
  font-size: 12px;
}

.dq-hist + button {
  margin-top: 12px;
}

.dq-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--fair, #d39a12);
  border-radius: var(--btn-radius);
  font-size: 13px;
}

.dq-chip.good { border-left-color: #1baf7a; }
.dq-chip.poor { border-left-color: #d6453d; }

.dq-chip button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .dq-score {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .dq-big {
    grid-auto-flow: column;
    gap: 8px;
    align-items: baseline;
  }

  .dq-row,
  .dq-frow {
    grid-template-columns: auto 1fr;
  }

  .dq-row .dq-fix,
  .dq-frow .dq-fix {
    grid-column: 1 / -1;
  }

  .dq-frow {
    grid-template-columns: 1fr;
  }

  .dq-check-head {
    grid-template-columns: auto auto 1fr auto;
  }

  .dq-check-head .dq-bar,
  .dq-check-head small {
    display: none;
  }

  .dq-lhead {
    grid-template-columns: auto 1fr auto;
  }

  .dq-lhead .dq-lcount {
    display: none;
  }

  .dq-grow,
  .dq-panel:not(.wide) .dq-grow {
    grid-template-columns: 1fr auto;
  }

  .dq-grow .dq-bar,
  .dq-grow .dq-lvl {
    display: none;
  }
}

/* ---------- top bar badges ---------- */

.tools .badged {
  position: relative;
}

.count-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 700 11px/16px system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
}

.tools button[aria-pressed='true'] {
  background: var(--field);
  color: var(--accent);
}

#edit-more.alert::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- filters and saved views ---------- */

.fltpanel {
  position: fixed;
  top: 78px;
  left: 272px;
  z-index: 5;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 78px - 96px);
  overflow: auto;
  padding: 12px 14px 14px;
  font-size: 13px;
}

.flt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.flt-head .close {
  position: static;
  width: 28px;
  height: 28px;
  font-size: 20px;
  border-radius: 6px;
}

.flt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flt-in {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.flt-in.wide,
.flt-check {
  grid-column: 1 / -1;
}

.fltpanel input,
.fltpanel select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.fltpanel input[type='checkbox'] {
  width: auto;
  height: auto;
}

.flt-pair,
.flt-near,
.flt-row,
.flt-acts {
  display: flex;
  gap: 6px;
  align-items: center;
}

.flt-near select {
  width: 84px;
  flex: none;
}

.flt-acts {
  margin-top: 4px;
  flex-wrap: wrap;
}

.flt-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.fltpanel button:not(.close):not(.link-btn) {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.fltpanel button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.fltpanel button:disabled {
  opacity: 0.45;
}

.flt-count {
  margin: 10px 0 6px;
  font-weight: 700;
}

.fltpanel h4 {
  margin: 14px 0 6px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.flt-views {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.flt-views li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.flt-views li > span {
  display: flex;
  gap: 4px;
}

/* ---------- what's new ---------- */

.news {
  width: min(560px, calc(100vw - 24px));
}

.news #news-tabs {
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

.news h4 {
  margin: 16px 0 6px;
  font-size: 14px;
}

.news h4 small {
  color: var(--muted);
  font-weight: 600;
}

.nw-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nw-list li > button,
.nw-gone {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.nw-list li > button:hover {
  background: var(--field);
}

.nw-icon {
  flex: none;
  width: 22px;
  text-align: center;
}

.nw-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nw-text small {
  color: var(--muted);
  font-size: 12px;
}

.nw-change {
  font-size: 13px;
}

.nw-status {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--viz-other);
  font-size: 11px;
  font-weight: 700;
}

.nw-status.s-planned { border-color: var(--viz-planned); color: var(--viz-planned); }
.nw-status.s-active { border-color: var(--viz-active); color: var(--viz-active); }
.nw-status.s-complete { border-color: var(--viz-complete); color: var(--viz-complete); }

.news .rss {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- suggest a project ---------- */

.tipform {
  width: min(460px, calc(100vw - 24px));
}

.tip-kind {
  display: grid;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 0;
  border: 0;
}

.tipform .tip-kind label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font: 600 14px var(--font);
  letter-spacing: 0;
  text-transform: none;
}

/* Not stretched like the text boxes. */
.tipform .tip-kind input {
  flex: none;
  width: auto;
  margin: 0;
}

.tipform textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.tipform .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tip-link {
  margin: 12px 0 0;
  font-size: 13px;
}

.editform .custom-field small {
  color: var(--muted);
  font-size: 11px;
}

/* ---------- admin center ---------- */

.adm-summary {
  margin-bottom: 12px;
  font-size: 13px;
}

.adm-summary .chips {
  flex-wrap: wrap;
  margin-top: 8px;
}

.adm-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
}

.adm-tag.good { color: var(--good); border-color: currentColor; }
.adm-tag.bad { color: var(--poor); border-color: currentColor; }
.adm-tag.info { color: var(--accent); border-color: currentColor; }

.adm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.adm-item {
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) minmax(240px, 1.2fr);
  gap: 12px;
  align-items: start;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.adm-item.done {
  opacity: 0.65;
}

.adm-what {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adm-what p {
  margin: 0;
}

.adm-what small {
  color: var(--muted);
  font-size: 12px;
}

.adm-change {
  font-size: 13px;
}

.adm-change del,
.adm-fields del {
  color: var(--poor);
}

.adm-change ins,
.adm-fields ins {
  color: var(--good);
  text-decoration: none;
}

.adm-acts {
  display: grid;
  gap: 6px;
  align-content: start;
}

.adm-note {
  margin: 2px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--line);
  background: color-mix(in srgb, var(--field) 60%, transparent);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  white-space: pre-wrap;
}

.adm-warn {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fair) 16%, transparent);
  font-size: 13px;
}

.adm-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adm-diff {
  margin: 8px 0 14px;
  padding: 0;
  list-style: none;
}

.adm-diff > li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.adm-fields {
  display: grid;
  gap: 4px;
  margin: 6px 0 0 4px;
  padding: 0;
  list-style: none;
}

.adm-fields li {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.adm-fields li span {
  color: var(--muted);
  font-weight: 600;
}

.adm-decide {
  margin-top: 10px;
}

.adm-log {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 460px;
  overflow: auto;
}

.adm-log li {
  display: grid;
  grid-template-columns: 150px auto 110px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.adm-log li > span:first-child {
  color: var(--muted);
}

.adm-tilebtn {
  text-align: left;
  cursor: pointer;
}

.adm-tilebtn:hover {
  border-color: var(--accent);
}

.adm-fieldform {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.adm-fieldform h3 {
  margin: 0;
  font-size: 16px;
}

.adm-applies {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.adm-applies legend {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.adm-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 720px) {
  .fltpanel {
    top: auto;
    bottom: 76px;
    left: 12px;
    max-height: 60vh;
  }

  .adm-item {
    grid-template-columns: auto 1fr;
  }

  .adm-item .adm-acts {
    grid-column: 1 / -1;
  }

  .adm-log li {
    grid-template-columns: 1fr auto;
  }

  .adm-fields li {
    grid-template-columns: 1fr;
  }
}

.adm .viz-year {
  white-space: nowrap;
}

/* ---------- top bar with more tools ---------- */

.bar {
  width: min(720px, calc(100vw - 24px));
}

@media (max-width: 720px) {
  .bar {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .bar .brand {
    order: 1;
  }

  .bar .tools {
    order: 2;
    margin-left: auto;
  }

  .bar .search {
    order: 3;
    flex: 1 1 100%;
  }

  .tools button {
    width: 30px;
  }

  .layers {
    top: 112px;
    max-height: calc(100vh - 112px - 150px);
  }
}

.brand .name-short {
  display: none;
}

/* A phone keeps the name (and the city menu) as just the city's name, beside the tools. */
@media (max-width: 480px) {
  .brand {
    gap: 6px;
  }

  .brand svg {
    width: 32px;
    height: 32px;
    padding: 6px;
  }

  .brand h1 {
    max-width: 92px;
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  .bar .tools {
    gap: 1px;
  }

  .bar .tools button {
    width: 30px;
  }

  .brand .city-btn {
    max-width: 100%;
    overflow: hidden;
  }

  .brand .name-long {
    display: none;
  }

  .brand .name-short {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Only what changes what you see (region, demo) is tagged on a phone. */
  .mode-tag.mode-city,
  .mode-tag.mode-market {
    display: none;
  }
}

/* ---------- combining two people's changes ---------- */

.mergelist {
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.mergelist li {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.mergelist p {
  margin: 0 0 2px;
}

.mergelist label {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.mergelist em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ---------- sources and verification ---------- */

.trust {
  display: inline-block;
  margin: 0 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.trust.ok {
  color: #1b8a5a;
}

.trust.stale {
  color: #b45309;
}

:root[data-theme='dark'] .trust.ok {
  color: #3fc489;
}

:root[data-theme='dark'] .trust.stale {
  color: #f4b740;
}

.src-ed {
  color: var(--accent);
  font-size: 12px;
  cursor: help;
}

.prov {
  margin: 12px 0 0;
  font-size: 13px;
}

.prov summary {
  cursor: pointer;
  color: var(--muted);
}

.prov ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.prov .note {
  margin: 6px 0 0;
}

.detail .actions .verify {
  border-color: #1b8a5a;
  color: #1b8a5a;
}

/* ---------- photos on the card ---------- */

.gallery {
  margin: 10px 0 4px;
}

.gallery button {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

.ph-main {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: var(--field);
}

.ph-main img,
.ph-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph-count,
.ph-tag {
  position: absolute;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.ph-count {
  right: 8px;
  bottom: 8px;
}

.ph-main .ph-tag {
  left: 8px;
  top: 8px;
}

.ph-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.ph-thumbs button {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
}

.gallery figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- the picture viewer ---------- */

.lightbox {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #eee;
  text-align: center;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 80%);
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 6px;
}

.lightbox .close {
  position: absolute;
  top: 6px;
  right: 10px;
  color: #fff;
  font-size: 26px;
}

.lb-nav {
  position: absolute;
  top: 45%;
  width: 44px;
  height: 64px;
  border-radius: 8px;
  background: rgb(0 0 0 / 50%);
  color: #fff;
  font-size: 34px;
}

.lb-nav.prev {
  left: 14px;
}

.lb-nav.next {
  right: 14px;
}

#lightbox-cap {
  margin: 8px 0 0;
  font-size: 14px;
}

#lightbox-cap small {
  margin-left: 6px;
  color: #aaa;
}

.lightbox .ph-tag {
  position: static;
  background: #444;
}

/* ---------- managing photos in edit mode ---------- */

.photo-admin {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.photo-admin h4 {
  margin: 0 0 8px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ph-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.ph-row img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
}

.ph-fields {
  display: grid;
  gap: 4px;
}

.ph-fields input[type='text'] {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.ph-kind {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.ph-acts {
  display: grid;
  gap: 4px;
}

.ph-acts button,
.ph-cover {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ph-cover {
  border: 0;
  color: var(--muted);
}

.ph-acts .danger {
  color: #c62828;
}

/* ---------- photo storage in the admin center ---------- */

.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ph-grid li {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.ph-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--field);
}

.ph-grid small {
  color: var(--muted);
}

/* ---------- the bulk editor ---------- */

.gridwin {
  width: calc(100vw - 24px);
}

.grid-tools,
.grid-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.grid-status .dq-muted {
  margin-left: auto;
}

.grid-tools button,
.grid-status button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 600;
}

.grid-status button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.grid-tools button:disabled,
.grid-status button:disabled {
  opacity: 0.45;
}

.grid-fill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.grid-cols {
  position: relative;
}

.grid-cols summary {
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 600;
}

.grid-cols > div {
  position: absolute;
  z-index: 3;
  top: 34px;
  left: 0;
  display: grid;
  gap: 4px;
  width: 260px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
}

.grid-body {
  overflow: auto;
}

.sheet {
  border-collapse: collapse;
  font-size: 13px;
}

.sheet th,
.sheet td {
  border: 1px solid var(--line);
  padding: 0;
}

.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  white-space: nowrap;
}

.sheet thead button {
  padding: 6px 8px;
  font: inherit;
  font-weight: 700;
}

.sheet .rowhead {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
}

.sheet thead .rowhead {
  z-index: 3;
}

.sheet .rowhead button {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.sheet input,
.sheet select {
  width: 100%;
  min-width: 110px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.sheet td:nth-child(2) input {
  min-width: 240px;
  font-weight: 600;
}

.sheet td.wide input {
  min-width: 280px;
}

.sheet td.n input {
  min-width: 90px;
  text-align: right;
}

.sheet input:focus,
.sheet select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--card);
}

.sheet td.changed {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.gridwin .sheet input,
.gridwin .sheet select {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
}

.gridwin .sheet input:focus,
.gridwin .sheet select:focus {
  background: var(--card);
}

/* ---------- developments ---------- */

.devkind {
  display: inline-block;
  margin: 0 0 0 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--field);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.glance {
  margin: 14px 0 4px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.glance h3 {
  margin: 0 0 8px;
}

.mixbar {
  display: flex;
  gap: 2px;
  height: 12px;
  overflow: hidden;
  border-radius: 6px;
}

.mixbar i {
  min-width: 4px;
}

.mixlist {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.mixlist i,
.key-groups i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.mixtypes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.mixstage {
  margin: 6px 0 0;
  font-size: 13px;
}

.tenants .tgroup {
  display: block;
  padding: 10px 2px 4px;
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 0;
}

.tenants li.flash {
  animation: tenant-flash 2.4s ease-out;
}

@keyframes tenant-flash {
  0%,
  40% {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
  }
  100% {
    background: transparent;
  }
}

.name-hint {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 13px;
}

.name-hint p {
  margin: 0 0 8px;
}

.key .devring {
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%);
  mask: radial-gradient(circle, transparent 38%, #000 40%);
}

.key .key-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
}

/* ---------- community phases ---------- */

.phase-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 13px;
}

.phase-table th,
.phase-table td {
  padding: 6px 4px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.phase-table thead th {
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0;
}

.phase-table .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.phase-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.phase-table .stage {
  white-space: nowrap;
}

.phase-form .ph-edit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin: 0 0 4px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.phase-form .ph-edit legend {
  padding: 0 6px;
  font-weight: 700;
}

.phase-form .ph-edit legend small {
  font-weight: 400;
  color: var(--muted);
}

.ph-geo,
.ph-links,
.ph-row-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ph-links > span:first-child {
  color: var(--muted);
}

.ph-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: var(--field);
  font-size: 12px;
}

.ph-chip button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.ph-geo button,
.ph-row-acts button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
}

.ph-row-acts .danger {
  margin-left: auto;
  color: #c62828;
}

.ph-links select {
  max-width: 100%;
}

.ph-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.ph-suggest button {
  padding: 2px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--btn-radius);
  color: var(--accent);
  font-weight: 700;
}

/* ---------- selecting several listings ---------- */

#sel-mode[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.selbox {
  position: absolute;
  z-index: 3;
  border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
}

.selbar {
  position: fixed;
  left: 50%;
  bottom: 150px;
  z-index: 6;
  display: grid;
  gap: 8px;
  width: min(720px, calc(100vw - 24px));
  max-height: 46vh;
  overflow: auto;
  padding: 10px 12px;
  transform: translateX(-50%);
  font-size: 13px;
}

.sel-head,
.sel-set,
.sel-acts,
.sel-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sel-head .muted {
  flex: 1;
  font-size: 12px;
}

.selbar button:not(.link-btn):not(.ph-chip button) {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
}

.selbar button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.selbar button.danger {
  color: #c62828;
}

.selbar select {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.selbar .ph-chip .link-btn {
  font-weight: 600;
  font-size: 12px;
}

.sel-note {
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 720px) {
  .selbar {
    bottom: 200px;
  }

  .sel-head .muted {
    display: none;
  }
}

.sel-chips {
  max-height: 62px;
  overflow: auto;
}

.sel-chips .ph-chip {
  max-width: 230px;
}

.sel-chips .ph-chip .link-btn {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sel-chips .ph-chip .link-btn {
  width: max-content;
}

.sel-chips .ph-chip {
  max-width: none;
}

/* =====================================================================
   CivMetryx visual identity: "Prairie Dusk"
   Designed by nVisionTeK LLC. A city's own logo and colors (site.json
   "brand") replace the mark and the --brand / --accent colors.

   Deep prairie teal for actions, a warm copper for highlights, and
   low-glare sage paper (or blue-black slate at night) for everything
   else. Panels float over the map as frosted glass, each carrying a
   thin teal-to-copper "dusk ribbon" along its top edge.
   ===================================================================== */

:root {
  --bg: #e7ebe4;
  --card: #f7f9f4;
  --glass: rgb(247 249 244 / 88%);
  --ink: #1c2a2f;
  --muted: #5b6a70;
  --line: #d2dad1;
  --field: #e8ede6;
  /* The CivMetryx logo's blue and green (deepened so white text on them stays readable). */
  --accent: #0a7d5e;
  --brand: #1663d6;
  --brand-2: #1f86ec;
  --on-brand: #ffffff;
  --brand-soft: rgb(22 99 214 / 11%);
  --accent-soft: rgb(10 125 94 / 12%);
  --danger: #b3261e;
  --danger-soft: rgb(179 38 30 / 9%);
  /* Good, fair and poor, everywhere (the data quality windows set the same). */
  --good: #1baf7a;
  --fair: #d39a12;
  --poor: #d6453d;
  --ribbon: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 45%, var(--accent) 100%);
  --radius: 16px;
  --radius-sm: 10px;
  /* Every button's corners: one size everywhere (chips, tags and round icons keep their own). */
  --btn-radius: 10px;
  --shadow: 0 1px 1px rgb(20 44 46 / 6%), 0 14px 34px -12px rgb(20 44 46 / 30%);
  --shadow-lift: 0 2px 4px rgb(20 44 46 / 8%), 0 20px 44px -14px rgb(20 44 46 / 38%);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  --city: #a9532a;
  --etj: #1f7a70;
}

:root[data-theme='dark'] {
  --bg: #0d1215;
  --card: #141b1f;
  --glass: rgb(20 27 31 / 88%);
  --ink: #e1e9e5;
  --muted: #8e9fa5;
  --line: #25313a;
  --field: #1b252b;
  --accent: #3fd39a;
  --brand: #5ea8ff;
  --brand-2: #3f8fef;
  --on-brand: #0d1215;
  --brand-soft: rgb(94 168 255 / 14%);
  --accent-soft: rgb(63 211 154 / 14%);
  --danger: #ff8f84;
  --danger-soft: rgb(255 143 132 / 12%);
  --good: #22b884;
  --fair: #e0a92a;
  --poor: #e5605a;
  --shadow: 0 1px 1px rgb(0 0 0 / 40%), 0 16px 38px -12px rgb(0 0 0 / 70%);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 45%), 0 22px 46px -14px rgb(0 0 0 / 80%);
  --city: #e39a62;
  --etj: #57b3a8;
}

body {
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--brand-soft);
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}

a {
  color: var(--brand);
  text-underline-offset: 2px;
}

:root[data-theme='dark'] a {
  color: var(--brand);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- floating panels ---------- */

.card {
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: var(--shadow);
}

.bar,
.layers,
.detail,
.timeline,
.editbar,
.selbar,
.fltpanel,
.drawhint,
.adminbar {
  background: var(--ribbon) top / 100% 3px no-repeat, var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
}

dialog.card {
  background: var(--ribbon) top / 100% 4px no-repeat, var(--card);
}

dialog::backdrop {
  background: rgb(8 18 20 / 42%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ---------- top bar ---------- */

.bar {
  padding: 10px 12px 10px 10px;
}

.brand svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 6px 14px -6px var(--brand);
}

.brand h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand p {
  font-family: var(--mono);
  color: var(--brand);
}

.search input {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--field);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.results {
  border-radius: 14px;
  overflow: hidden;
}

.results li[aria-selected='true'],
.results li:hover {
  background: var(--brand-soft);
}

.tools {
  gap: 4px;
}

.tools button {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--btn-radius);
  color: var(--muted);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.tools button:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.tools button:active {
  transform: scale(0.94);
}

/* Each tool says what it does when pointed at. */
.tools button[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--card);
  font: 600 12px var(--font);
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -3px);
  transition: opacity 0.14s, transform 0.14s;
}

.tools button[aria-label]:hover::after,
.tools button[aria-label]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0.25s;
}

.tools button:last-child[aria-label]::after {
  left: auto;
  right: 0;
  transform: translate(0, -3px);
}

.tools button:last-child[aria-label]:hover::after {
  transform: none;
}

#edit-toggle[aria-pressed='true'],
.tools button[aria-pressed='true'] {
  background: var(--brand);
  color: var(--on-brand);
}

.count-badge {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--card);
}

/* ---------- layers ---------- */

.layers {
  width: 258px;
}

.panel-head {
  padding: 12px 14px 10px;
  font-family: var(--mono);
  color: var(--brand);
}

.panel-head .caret {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand-soft);
  transition: transform 0.18s;
}

.group-label,
details.group > summary {
  font-family: var(--mono);
  color: var(--muted);
}

details.group > summary::before {
  color: var(--accent);
}

details.group {
  margin-top: 4px;
  padding-top: 2px;
  border-top: 1px dashed color-mix(in srgb, var(--line) 85%, transparent);
}

details.group:first-child {
  border-top: 0;
}

.row {
  border-radius: 9px;
  transition: background 0.12s;
}

.row:hover,
.use:hover {
  background: var(--brand-soft);
}

.row[aria-checked='true'] .switch {
  background: var(--brand);
}

.use {
  border-radius: 8px;
}

.chip {
  border-radius: 999px;
  border-color: var(--line);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.chip[aria-pressed='true']::before {
  content: '✓ ';
  font-weight: 800;
}

.tenant-filter .chip[aria-pressed='true']::before,
.viz-filter .chip[aria-pressed='true']::before,
#news-tabs .chip[aria-pressed='true']::before {
  content: '';
}

.credit {
  margin: 14px 2px 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.credit strong {
  background: var(--ribbon);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

.about-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}

.brand .brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 11px;
  flex: none;
}

.credit-mark {
  width: 18px;
  height: 18px;
  background: url('civmetryx-mark.svg') center / contain no-repeat;
}

/* The CivMetryx logo, wherever a city has not set its own: on a white tile in the big spots
   (start-up, welcome, sign-in), on its own in the header and the credits. */
img.cm-logo {
  display: block;
  flex: none;
  object-fit: contain;
}

.brand > .cm-logo {
  width: 36px;
  height: 36px;
}

.splash-mark:has(> .cm-logo),
.wl-mark:has(> .cm-logo),
.pg-mark:has(> .cm-logo),
.br-pv-mark:has(> .cm-logo) {
  border: 1px solid #e6e9ef;
  background: #fff;
  box-shadow: 0 1px 2px rgb(13 43 92 / 8%), 0 18px 44px -22px rgb(13 43 92 / 45%);
}

.splash-mark > .cm-logo,
.wl-mark > .cm-logo,
.pg-mark > .cm-logo,
.br-pv-mark > .cm-logo {
  width: 70%;
  height: 70%;
  border-radius: 0;
  background: none;
}

.splash-by-mark:has(> .cm-logo) {
  background: none;
}

.splash-by-mark > .cm-logo {
  width: 24px;
  height: 24px;
}

/* ---------- one family of buttons everywhere ---------- */

.edit-tools button,
.actions button,
.drawhint button,
.view-row button,
.timeline #today,
.selbar button:not(.link-btn),
.fltpanel button:not(.close):not(.link-btn),
.dq-body button:not(.link-btn):not(.dq-check-head):not(.dq-lhead):not(.dq-grow),
.dq-acts > button:not(.link-btn),
.acc-tools button,
.acc-acts button,
.acc-bulk button,
.acc-dup,
.grid-tools button,
.grid-status button,
.viz-tablebar button,
.tenant-edit {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-weight: 650;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.12s, box-shadow 0.14s;
}

.edit-tools button:hover,
.actions button:hover,
.drawhint button:hover,
.view-row button:hover,
.timeline #today:hover,
.selbar button:not(.link-btn):hover,
.fltpanel button:not(.close):not(.link-btn):hover,
.grid-tools button:hover,
.grid-status button:hover,
.viz-tablebar button:hover,
.dq-acts > button:not(.link-btn):hover,
.dq-filters > button:not(.link-btn):hover,
.acc-tools button:hover,
.acc-acts button:hover,
.acc-bulk button:hover,
.acc-dup:hover,
.tenant-edit:hover {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

.edit-tools button:active,
.actions button:active,
.selbar button:active {
  transform: translateY(1px);
}

button.primary,
.dq-body button.primary,
.selbar button.primary,
.fltpanel button.primary,
.grid-status button.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand)) !important;
  border-color: var(--brand) !important;
  color: var(--on-brand) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 6px 14px -8px var(--brand);
}

button.primary:hover {
  opacity: 1;
  filter: brightness(1.06);
}

button.danger,
.dq-body button.danger,
.selbar button.danger {
  background: var(--danger-soft) !important;
  border-color: transparent !important;
  color: var(--danger) !important;
}

button.danger:hover {
  border-color: var(--danger) !important;
}

.edit-tools button.publish {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -8px var(--accent);
  animation: publish-glow 2.6s ease-in-out infinite;
}

:root[data-theme='dark'] .edit-tools button.publish {
  color: #1a1009;
}

@keyframes publish-glow {
  0%,
  100% {
    box-shadow: 0 6px 16px -8px var(--accent);
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 16px -8px var(--accent);
  }
}

button:disabled {
  cursor: not-allowed;
}

/* A default only (no weight of its own), so each window's own boxes match each other. */
:where(input[type='text'], input[type='search'], input[type='number'], input[type='date'], input[type='email'], input[type='tel'], input[type='url'], input[type='password'], select, textarea) {
  border-radius: 9px;
  accent-color: var(--brand);
}

input[type='checkbox'],
input[type='radio'],
input[type='range'] {
  accent-color: var(--brand);
}

/* ---------- the listing card ---------- */

.detail {
  width: min(392px, calc(100vw - 24px));
  padding: 18px 18px 16px;
}

.detail .close,
.about .close {
  border-radius: 10px;
  color: var(--muted);
}

.detail .close:hover,
.about .close:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.eyebrow {
  font-family: var(--mono);
  color: var(--brand);
}

.detail h2,
.about h2 {
  font-weight: 800;
  letter-spacing: -0.015em;
}

.detail h3,
.about h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.detail dl dt,
.facts dt {
  font-family: var(--mono);
  color: var(--muted);
}

details.sect {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

details.sect > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 4px;
  cursor: pointer;
  list-style: none;
}

details.sect > summary::-webkit-details-marker {
  display: none;
}

details.sect > summary::after {
  content: '▸';
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  transition: transform 0.18s;
}

details.sect[open] > summary::after {
  transform: rotate(90deg);
}

details.sect > summary h3 {
  margin: 0;
}

details.sect > summary:hover h3 {
  color: var(--brand);
}

.glance {
  border-radius: 14px;
  background: color-mix(in srgb, var(--field) 55%, transparent);
  border-color: transparent;
}

.mixbar {
  height: 10px;
}

.devkind {
  background: var(--brand-soft);
  color: var(--brand);
}

.name-hint {
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.tenants li {
  border-radius: 10px;
}

.prov summary {
  color: var(--brand);
  font-weight: 600;
}

/* ---------- timeline ---------- */

.timeline #play {
  width: 34px;
  height: 34px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: var(--on-brand);
  box-shadow: 0 6px 14px -8px var(--brand);
}

.timeline #play:hover {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  filter: brightness(1.08);
}

.track input {
  accent-color: var(--brand);
}

.ticks span {
  font-family: var(--mono);
}

#time-label {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- editing bar ---------- */

.editbar {
  padding: 10px 12px 12px;
}

.edit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-family: var(--mono);
}

.edit-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
}

.edit-head strong::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.edit-head #edit-status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-head .edit-publish {
  flex-wrap: nowrap;
}

.edit-min,
.sel-fold {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border-radius: var(--btn-radius) !important;
  background: var(--brand-soft) !important;
  border: 0 !important;
  color: var(--brand) !important;
  font-size: 12px;
}

.edit-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 14px;
  margin-top: 10px;
}

.edit-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--line) 90%, transparent);
  position: relative;
}

.edit-group:first-child {
  padding-left: 0;
  border-left: 0;
}

.edit-group-h {
  flex-basis: 100%;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.editbar.min .edit-groups {
  display: none;
}

.editbar.min {
  padding-bottom: 10px;
}

/* ---------- account and admin menu ---------- */

.adminbar {
  border-radius: 999px;
}

.adminbar > button {
  border-radius: var(--btn-radius);
  font-weight: 700;
}

.adminbar > button svg {
  padding: 4px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
}

.adminbar .menu.pop {
  min-width: 275px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
}

.menu-group + .menu-group {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.menu-h {
  margin: 2px 8px 4px;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.menu.pop button {
  display: block;
  width: 100%;
  border-radius: var(--btn-radius);
  font-weight: 600;
}

.menu.pop button:hover {
  background: var(--brand-soft) !important;
  color: var(--brand);
}

/* ---------- selection bar ---------- */

.selbar.min > :not(.sel-head) {
  display: none;
}

.sel-head strong {
  color: var(--brand);
}

/* ---------- big windows: dashboard, admin center, data quality ---------- */

.viz-top {
  background: var(--card);
}

.viz-top h2 {
  letter-spacing: -0.02em;
}

.dq-tabs,
.viz-nav {
  gap: 4px;
}

.dq-tabs button,
.viz-nav button {
  border-radius: 10px;
  font-weight: 650;
}

.dq-tabs button[aria-selected='true'] {
  background: var(--brand);
  color: var(--on-brand);
}

.viz-nav button:hover,
.dq-tabs button:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.viz-panel,
.dq-panel,
.viz-tile {
  border-radius: 14px;
}

.viz-h {
  color: var(--brand);
}

.dq-big {
  border-radius: 14px;
}

/* ---------- small things ---------- */

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--accent)));
  color: var(--on-brand);
  box-shadow: var(--shadow-lift);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.maplibregl-ctrl-group {
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--glass) !important;
  box-shadow: var(--shadow) !important;
}

/* Zoom in and out are two halves of one rounded control, so their own corners stay square. */
.maplibregl-ctrl-group button {
  border-radius: 0;
}

:root[data-theme='dark'] .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(0.9);
}

.maplibregl-popup-content {
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  font-family: var(--font);
}

.maplibregl-ctrl-attrib {
  font-family: var(--font);
}

.drawhint {
  border-radius: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .edit-tools button.publish {
    animation: none;
  }

  .toast {
    animation: none;
  }
}

@media (max-width: 720px) {
  .edit-group {
    padding-left: 0;
    border-left: 0;
  }

  .tools button[aria-label]::after {
    display: none;
  }
}

/* ---------- choosing a city ---------- */

.brand {
  position: relative;
}

.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 4px;
  margin-left: -4px;
  border-radius: var(--btn-radius);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: background 0.15s;
}

.city-btn:hover,
.city-btn[aria-expanded='true'] {
  background: var(--brand-soft);
  color: var(--brand);
}

.city-caret {
  font-size: 11px;
  color: var(--accent);
}

.city-menu {
  top: calc(100% + 10px);
  bottom: auto !important;
  left: 0;
  min-width: 240px;
  padding: 8px;
  border-radius: 14px;
  background: var(--card) !important;
  box-shadow: var(--shadow-lift) !important;
}

.city-menu button {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.city-menu button[aria-current='true'] {
  color: var(--brand);
  font-weight: 800;
}

.city-menu small {
  color: var(--muted);
  font-size: 11px;
}

/* Every city together: first in the menu, set apart from the single cities. */
.city-menu .menu-region {
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 9px 9px 0 0 !important;
}

.city-menu .menu-region small {
  display: block;
  font-weight: 400;
}

.menu-note {
  margin: 6px 8px 2px;
  font-size: 12px;
  color: var(--muted);
}

.menu-manage {
  margin-top: 6px;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 0 9px 9px !important;
  color: var(--accent) !important;
}

.adm-cityview {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 13px;
}

.adm-cityview p {
  margin: 0 0 6px;
}

.adm-open {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}

/* ---------- city limits and ETJ ---------- */

.bndpanel {
  position: fixed;
  top: 78px;
  right: 12px;
  z-index: 7;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 14px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lift);
}

.bndpanel[hidden] {
  display: none;
}

.bnd-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bnd-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.bnd-head .eyebrow {
  margin: 0;
}

.bnd-x {
  padding: 0 8px;
  font-size: 20px;
  line-height: 1.4;
  border-radius: 8px;
}

.bnd-sect {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.bnd-sect > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 750;
}

.bnd-sect > summary small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}

.bnd-sw {
  flex: none;
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
}

.bnd-sw.city {
  border: 2px solid var(--city);
  background: color-mix(in srgb, var(--city) 14%, transparent);
}

.bnd-sw.etj {
  border: 2px dashed var(--etj);
  background: color-mix(in srgb, var(--etj) 14%, transparent);
}

.bnd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bnd-look input {
  flex: 1;
  min-width: 0;
}

.bnd-note,
.bnd-none {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.bnd-areas,
.bnd-found ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.bnd-areas li {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.bnd-area {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 650;
}

.bnd-area small,
.bnd-found small {
  color: var(--muted);
  font-weight: 500;
}

.bnd-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bnd-acts button,
.bnd-row button,
.bnd-foot button,
.bnd-add {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 650;
}

.bnd-add {
  margin-top: 8px;
  border-style: dashed;
  color: var(--brand);
}

.bnd-found {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
}

.bnd-found p {
  margin: 0;
}

.bnd-found label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bnd-foot {
  position: sticky;
  bottom: -14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 -16px -14px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.bnd-foot button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bnd-reset {
  color: var(--accent);
}

@media (max-width: 640px) {
  .bndpanel {
    top: auto;
    bottom: 96px;
    right: 16px;
    max-height: 48vh;
  }
}

/* A toast is a popover so it shows above open windows. */
.toast[popover] {
  inset: auto auto 84px 50%;
  margin: 0;
  border: 0;
  overflow: visible;
  max-width: min(520px, calc(100vw - 32px));
}

/* ---------- setting a city's map view ---------- */

.adm-cityview.is-set {
  background: color-mix(in srgb, var(--good, #1baf7a) 12%, transparent);
}

.adm-cityneed {
  color: var(--accent);
  font-weight: 700;
}

.adm-cityerr {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #c2410c 40%, transparent);
  background: color-mix(in srgb, #c2410c 10%, transparent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.cityview-bar {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 8;
  display: grid;
  gap: 8px;
  width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  transform: translateX(-50%);
  font-size: 13px;
  box-shadow: var(--shadow-lift);
}

.cityview-bar p {
  margin: 0;
}

/* ---------- data refresh review ---------- */

.rf-warn {
  margin: 6px 0 0;
  padding: 6px 10px 6px 24px;
  border-radius: 8px;
  background: color-mix(in srgb, #c2410c 9%, transparent);
  font-size: 13px;
}

.rf-warn li + li {
  margin-top: 2px;
}

#edit-refresh {
  font-weight: 650;
}

/* A chosen filter chip inside a window keeps its solid fill (a general window button style was washing it out). */
dialog .chip[aria-pressed='true'] {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--on-brand) !important;
}

/* ---------- permit types ---------- */

.pt-h {
  margin: 18px 0 6px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.pt-row select {
  max-width: 380px;
  width: 100%;
}

.pt-min {
  max-width: 520px;
}

.det-support summary {
  cursor: pointer;
  font-weight: 650;
}

.det-support ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

/* ---------- refresh schedule ---------- */

.rf-sched {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rf-sched .dq-in {
  min-width: 190px;
}

.rf-sched p {
  flex-basis: 100%;
  margin: 0;
}

/* Sign In for visitors: top right; on tablets in the header's corner, and on phones at the end of
   the search row (the tool buttons fill the first), as the staff account button does. */
@media (max-width: 900px) {
  #signin-bar {
    top: 20px;
    right: 22px;
    z-index: 9;
  }
}

@media (max-width: 720px) {
  #signin-bar {
    top: 68px;
    padding: 2px;
  }

  body:has(#signin-bar:not([hidden])) .bar .search {
    margin-right: 108px;
  }
}

/* ---------- inbox and outbox ---------- */

.rv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 6px;
}

.rv-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
}

.rv-item + .rv-item {
  margin-top: 8px;
}

.rv-item.approved {
  border-left-color: var(--good, #1baf7a);
}

.rv-item.rejected {
  border-left-color: #c2410c;
}

.rv-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rv-dec {
  display: flex;
  gap: 6px;
}

.rv-dec button {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 700;
}

.rv-dec button[data-act='dec-ok'][aria-pressed='true'] {
  background: var(--good, #1baf7a);
  border-color: var(--good, #1baf7a);
  color: #fff;
}

.rv-dec button[data-act='dec-no'][aria-pressed='true'] {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}

.rv-why {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .rv-why {
    grid-template-columns: 1fr;
  }
}

.rv-results {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.rv-results li.rejected {
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #c2410c 8%, transparent);
}

.rv-why-text {
  margin: 4px 0;
}

.rv-results button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 700;
}

.rv-thread {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.rv-thread li {
  max-width: 85%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.rv-thread li p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.rv-thread .from-reviewer {
  background: var(--brand-soft);
}

.rv-thread .from-sender {
  justify-self: end;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.rv-reply {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.rv-reply textarea {
  flex: 1;
  min-height: 34px;
  resize: vertical;
}

.rv-reply button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 700;
}

/* A chosen Approve / Reject keeps its solid colour inside the window. */
dialog .rv-dec button[data-act='dec-ok'][aria-pressed='true'] {
  background: var(--good, #1baf7a) !important;
  border-color: var(--good, #1baf7a) !important;
  color: #fff !important;
}

dialog .rv-dec button[data-act='dec-no'][aria-pressed='true'] {
  background: #c2410c !important;
  border-color: #c2410c !important;
  color: #fff !important;
}

/* ---------- accounts ---------- */

.acc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.acc-head h2 {
  margin: 2px 0 6px;
}

.acc-tools {
  flex-wrap: wrap;
}

.acc-tools input[type='search'] {
  flex: 1 1 220px;
}

.acc-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 13px;
}

.acc-bulk button,
.acc-tools button,
.acc-acts button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.acc-summary {
  margin: 4px 0 12px;
  padding: 8px 12px;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
  font-size: 14px;
}

.acc-form fieldset {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.acc-form legend {
  padding: 0 6px;
  font-weight: 800;
}

.acc-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
}

.acc-wide {
  grid-column: 1 / -1;
}

.acc-perms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 16px;
  margin-top: 8px;
}

.acc-perms .check {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 4px 0;
  font-size: 13px;
}

.acc-h {
  margin: 4px 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.acc-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.acc-gridwrap {
  overflow: auto;
  max-height: 60vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.acc-grid {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

.acc-grid th,
.acc-grid td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.acc-grid tbody th {
  text-align: left;
}

.acc-grid tbody th small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.acc-grid thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  font-size: 11px;
}

.acc-grid td {
  color: var(--good, #1baf7a);
  font-weight: 800;
}

/* The Users window and My Profile need room for their forms. */
dialog.acc-dialog,
dialog.acc-profile {
  width: min(980px, calc(100vw - 24px));
  max-width: none;
}

dialog.acc-profile {
  width: min(640px, calc(100vw - 24px));
}

.acc-profile-body {
  padding-top: 0;
}

/* The Users window borrows the Dropdown Options window; its notes are ordinary writing, not code. */
dialog.acc-dialog textarea,
dialog.acc-profile textarea {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.acc-profile-body > .dq-acts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- accounts, round two: rows, tabs, preset cards ---------- */

.acc-count {
  margin: 4px 0;
}

.acc-rows {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acc-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-pickgap {
  width: 16px;
}

.acc-open {
  flex: 1;
  display: grid;
  grid-template-columns: 38px minmax(150px, 1.3fr) minmax(150px, 1.4fr) minmax(120px, 0.9fr) 14px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
  font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.acc-open:hover,
.acc-open:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.acc-who,
.acc-access,
.acc-state {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.acc-who small,
.acc-access small,
.acc-state small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-access .adm-tag,
.acc-state .adm-tag {
  justify-self: start;
}

.acc-who em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.acc-chev {
  color: var(--muted);
  font-size: 20px;
}

.acc-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.acc-av-admin { background: color-mix(in srgb, #7c3aed 16%, transparent); color: #6d28d9; }
.acc-av-manager { background: color-mix(in srgb, #0f766e 16%, transparent); color: #0f766e; }
.acc-av-reviewer { background: color-mix(in srgb, #2563eb 16%, transparent); color: #1d4ed8; }
.acc-av-contributor { background: color-mix(in srgb, #b45309 16%, transparent); color: #b45309; }
.acc-av-viewer { background: color-mix(in srgb, #64748b 18%, transparent); color: #475569; }

@media (max-width: 760px) {
  .acc-open {
    grid-template-columns: 38px 1fr 14px;
  }

  .acc-access,
  .acc-state {
    grid-column: 2;
  }

  .acc-chev {
    grid-row: 1;
    grid-column: 3;
  }
}

/* nVisionTeK Support's sign-in, under the account list */
.acc-support {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.acc-idle select,
.acc-support-set select {
  width: auto;
  min-width: 150px;
}

/* How long nVisionTeK Support may sign in, and Apply on its right. */
.acc-support-set {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.acc-idle .acc-support-mark {
  background: var(--brand, #1663d6);
}

.acc-support.off {
  border-style: dashed;
}

.acc-support h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  font-size: 14px;
  text-transform: none;
}

.acc-support p {
  margin: 0;
  font-size: 13px;
}

.acc-support-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1663d6, #0a7d5e);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

@media (max-width: 560px) {
  .acc-support {
    grid-template-columns: auto 1fr;
  }

  .acc-support > button,
  .acc-support-set {
    grid-column: 1 / -1;
  }
}

.acc-recent summary {
  margin-top: 12px;
  cursor: pointer;
  font-weight: 700;
}

.acc-title h3 {
  margin: 0 0 4px;
}

.acc-title h3 small {
  color: var(--muted);
  font-weight: 500;
}

.acc-titlerow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.acc-titlerow .acc-avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.acc-tabs {
  display: flex;
  gap: 4px;
  margin: 10px 0 0;
  border-bottom: 1px solid var(--line);
}

.acc-tabs button {
  padding: 8px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  font-weight: 700;
  color: var(--muted);
}

.acc-tabs button[aria-selected='true'] {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

.acc-tabbody {
  padding: 14px 2px 6px;
}

.acc-plain {
  margin: 0;
  padding: 0;
  border: 0;
}

.acc-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 6px 0 12px;
}

.acc-preset {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.acc-preset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.acc-preset small {
  color: var(--muted);
  font-size: 12px;
}

.acc-preset.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--brand);
}

.acc-preset:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.acc-custom {
  margin: 4px 0 12px;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.acc-custom summary {
  cursor: pointer;
  font-weight: 700;
}

.acc-h .link-btn {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

.acc-check {
  font-size: 12px;
  color: var(--muted);
}

.acc-check.good {
  color: var(--good, #1baf7a);
  font-weight: 700;
}

.acc-check.bad {
  color: #c2410c;
  font-weight: 700;
}

.acc-pass {
  display: flex;
  gap: 6px;
}

.acc-pass input {
  flex: 1;
  font-family: var(--mono);
}

.acc-pass button {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  font-weight: 700;
}

.acc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.acc-facts div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
}

.acc-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.acc-foot {
  position: sticky;
  bottom: -16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px -16px -16px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.acc-foot [data-dirty] {
  font-weight: 700;
}

.acc-modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(8 18 20 / 38%);
}

.acc-modal-card {
  width: min(520px, 100%);
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
}

.acc-modal-card h3 {
  margin: 0 0 6px;
}

.acc-share {
  width: 100%;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 13px;
}

.acc-share {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}

/* ---------- progress on a listing card ---------- */

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 12px 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.progress li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.progress li::before {
  content: '';
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--line);
}

.progress li:first-child::before {
  display: none;
}

.progress li.done::before {
  background: var(--brand);
}

.progress .dot {
  position: absolute;
  top: 1px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
}

.progress li.done .dot {
  border-color: var(--brand);
  background: var(--brand);
}

.progress li.now .dot {
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.progress strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.progress li:not(.done) strong {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- list view ---------- */

.listpanel {
  position: fixed;
  top: 78px;
  right: 12px;
  bottom: 96px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(760px, calc(100vw - 24px));
  padding: 12px 14px;
  box-shadow: var(--shadow-lift);
}

.listpanel[hidden] {
  display: none;
}

.lv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lv-head h2 {
  margin: 0;
  font-size: 18px;
}

.lv-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.lv-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.lv-tools input[type='search'] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.lv-note {
  margin: 0;
  font-size: 12px;
}

.lv-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.lv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lv-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  text-align: left;
}

.lv-table th button {
  width: 100%;
  padding: 8px 6px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  text-align: inherit;
  cursor: pointer;
}

.lv-table td {
  padding: 6px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.lv-table .num {
  text-align: right;
  white-space: nowrap;
}

.lv-table tbody tr {
  cursor: pointer;
}

.lv-table tbody tr:hover,
.lv-table tbody tr:focus {
  background: var(--brand-soft);
  outline: none;
}

.lv-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.lv-status::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}

@media (max-width: 760px) {
  .listpanel {
    top: 170px;
    left: 8px;
    right: 8px;
    bottom: 88px;
    width: auto;
  }

  .lv-table td:nth-child(6),
  .lv-table th:nth-child(6),
  .lv-table td:nth-child(2),
  .lv-table th:nth-child(2) {
    display: none;
  }
}

/* A phone: name, status and finish date fit; the cost is in each listing's card. */
@media (max-width: 480px) {
  .lv-table td:nth-child(4),
  .lv-table th:nth-child(4) {
    display: none;
  }
}

/* ---------- undo ---------- */

.undo-toast {
  position: fixed;
  inset: auto auto 84px 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 8px 8px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--card);
  font-size: 14px;
  font-weight: 600;
  transform: translateX(-50%);
  box-shadow: var(--shadow-lift);
}

.undo-toast[hidden] {
  display: none;
}

.undo-toast button {
  padding: 6px 12px;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.undo-toast .undo-x {
  background: transparent;
  color: var(--card);
  font-size: 16px;
}

/* ---------- my work, settings, keyboard review ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.work-card {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.work-card:hover,
.work-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.work-card.has {
  border-left: 5px solid var(--accent);
}

.work-n {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--muted);
}

.work-card.has .work-n {
  color: var(--accent);
}

.work-card small {
  color: var(--muted);
  font-size: 13px;
}

.work-card .work-since {
  color: var(--ink);
}

.work-card .work-warn {
  color: #c2410c;
  font-weight: 700;
}

.work-card.setting strong {
  font-size: 16px;
}

/* Empty queues: one quiet line instead of a row of "0" cards. */
.work-clear {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 14px;
}

.work-clear-ico {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.work-clear-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.work-clear-item {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.work-clear-item:hover,
.work-clear-item:focus-visible {
  border-color: var(--brand);
  color: var(--ink);
}

.settings-nav {
  margin-bottom: 4px;
}

.menu-main {
  font-weight: 800 !important;
}

.kb-hint {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  font: 700 11px var(--mono);
  text-align: center;
}

.kb-focus {
  outline: 3px solid var(--brand) !important;
  outline-offset: 2px;
}

/* ---------- share menu and embedding ---------- */

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 60px;
  z-index: 20;
  min-width: 250px;
}

.share-menu button {
  display: block;
  width: 100%;
  text-align: left;
}

.embed-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin: 8px 0;
}

.embed-code {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-open {
  display: none;
}

/* The map inside another site: just the map, its cards, and a way out to the full site. */
html.embed .tools,
html.embed .search,
html.embed #editbar,
html.embed #adminbar,
html.embed #signin-bar,
html.embed #selbar,
html.embed .city-caret,
html.embed .insights,
html.embed .layers,
html.embed .timeline {
  display: none !important;
}

html.embed.embed-layers .layers,
html.embed.embed-timeline .timeline {
  display: revert !important;
}

html.embed #city-open {
  pointer-events: none;
}

html.embed .embed-open {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand, #fff);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

html.embed header.bar {
  right: auto;
  gap: 12px;
}

/* The share menu sits under its button. */
.tools {
  position: relative;
}

/* The list opens on the left, so a project's card (on the right) stays in view. */
@media (min-width: 761px) {
  .listpanel {
    right: auto;
    left: 12px;
    width: min(640px, calc(100vw - 440px));
    min-width: 420px;
  }
}

/* ---------- staff quick fixes ---------- */

/* The card ends above the editing bar on wide screens, so Publish stays visible. */
@media (min-width: 721px) {
  body.editing .detail {
    max-height: calc(100vh - 66px - var(--editbar-h, 190px) - 30px);
  }
}

/* While editing, messages appear at the top instead of on the editing bar. */
body.editing .toast[popover],
body.editing .undo-toast {
  inset: 78px auto auto 50%;
}

.rf-more {
  margin-top: 6px;
}

.rf-more > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand);
}

.more-fields {
  margin: 4px 0;
  padding: 6px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.more-fields > summary {
  cursor: pointer;
  font-weight: 700;
}

.more-fields > summary small {
  color: var(--muted);
  font-weight: 500;
}

.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 8px;
}

.more-grid .wide {
  grid-column: 1 / -1;
}

/* ---------- staff round: one-line editing bar, quick edits, tip matches ---------- */

/* Folded, the editing bar is one line; the Tools button opens the rest. */
.editbar.min .edit-min {
  width: auto;
  padding: 0 10px !important;
  font: 700 12px var(--mono);
  white-space: nowrap;
}

#edit-publish.flash {
  animation: publish-flash 0.5s ease-in-out 3;
}

@keyframes publish-flash {
  50% {
    box-shadow: 0 0 0 5px var(--accent-soft);
  }
}

/* The status and the cost change in place on the card while editing. */
.detail .qe {
  cursor: pointer;
}

.detail .badge.qe::after,
.detail dd.qe:not(:has(.src-ed))::after {
  content: ' ✎';
  opacity: 0.55;
  font-size: 0.9em;
}

.detail dd.qe:hover,
.detail dd.qe:focus-visible,
.detail .badge.qe:hover,
.detail .badge.qe:focus-visible {
  outline: 2px solid var(--brand-soft);
  outline-offset: 2px;
  border-radius: 6px;
}

.detail dd.qe-empty {
  color: var(--brand);
  font-weight: 700;
}

.detail .qe-select,
.detail .qe-input {
  font: inherit;
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

.detail .qe-input {
  width: 100%;
  max-width: 180px;
}

/* A tip that may already be on the map. */
.tip-match {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
}

.tip-match p {
  margin: 0 0 6px;
}

.tip-match ul {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.tip-match li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border-radius: 9px;
  background: var(--card);
}

.tip-match li > div {
  display: grid;
  flex: 1;
  min-width: 160px;
}

.tip-match li small {
  color: var(--muted);
}

/* My Work: Data Quality leads with the critical issues and a way in. */
.work-card.crit .work-n {
  color: #c2410c;
}

.work-card .work-cta {
  margin-top: 4px;
  color: var(--brand);
  font-weight: 800;
}

.dq-week {
  margin: 2px 0 0;
  font-weight: 700;
}

.dq-sprint-done {
  padding: 18px 0;
}

/* ---------- form boxes that had no style of their own (the Users window) ---------- */

:where(dialog, .detail) :where(input[type='text'], input[type='search'], input[type='number'], input[type='date'], input[type='email'], input[type='tel'], input[type='url'], input[type='password'], select, textarea) {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

/* ---------- staff on phones and tablets ---------- */

.add-here,
.det-quick {
  display: none;
}

@media (max-width: 720px) {
  /* On a phone the header has two rows: the tool buttons fill the top one, so the account
     button (just its icon) sits at the end of the search row, which makes room for it. */
  .adminbar {
    top: 68px;
    right: 22px;
    z-index: 9;
    padding: 2px;
  }

  body.editing .detail {
    top: auto;
  }
}

@media (max-width: 720px) {
  .who-role,
  #edit-who {
    display: none;
  }

  body:has(#adminbar:not([hidden])) .bar .search {
    margin-right: 66px;
  }

  .adminbar > button {
    padding: 6px 10px;
  }

  /* One-tap add where you are standing. */
  .add-here {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 0 12px !important;
    border-radius: 9px !important;
    font-weight: 800;
  }

  .edit-head #edit-status {
    font-size: 11px;
  }

  .add-here {
    min-height: 40px;
    border: 0 !important;
    background: var(--brand) !important;
    color: var(--on-brand, #fff) !important;
  }

  /* The dot says "editing"; the word gives its room to the status. */
  .edit-head strong {
    font-size: 0;
    gap: 0;
  }

  /* The card fills the space between the header and the editing bar. */
  body.editing .detail {
    bottom: calc(86px + var(--editbar-h, 50px));
    max-height: calc(100dvh - 172px - 86px - var(--editbar-h, 50px));
  }

  /* Editing a listing: the form gets the whole screen, one column, Save always in reach. */
  body.editing .detail:has(form.editform) {
    top: 12px;
    bottom: 12px;
    max-height: none;
    z-index: 30;
  }

  .detail form.editform {
    grid-template-columns: 1fr !important;
  }

  .detail form.editform .actions.wide {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 0 -18px -16px;
    padding: 10px 18px 14px;
    background: var(--card);
    border-top: 1px solid var(--line);
  }

  /* The common actions stay at the bottom of a long card. */
  .det-quick {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px -18px -16px;
    padding: 10px 14px 14px;
    background: var(--card);
    border-top: 1px solid var(--line);
    transition: opacity 0.15s;
  }

  .det-quick button {
    flex: 1;
    padding: 0 8px;
    white-space: nowrap;
  }

  .det-quick.away {
    opacity: 0;
    pointer-events: none;
  }

  /* Data Quality: the filters fold to one line, Save stays in reach. */
  .dq-fold {
    margin: 4px 0 8px;
  }

  .dq-fold > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--brand);
  }

  .dq-fold .dq-filters {
    margin-top: 8px;
  }

  .dq-wiz footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 10px 0;
    background: var(--card);
    border-top: 1px solid var(--line);
  }

  .dq-big strong {
    font-size: 30px;
  }

  /* My Work: two cards a row. */
  .work-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .work-card {
    padding: 10px 12px;
  }

  .work-n {
    font-size: 22px;
  }
}

/* Fingers, not a mouse: bigger targets, and form text large enough that iPhones do not zoom in. */
@media (max-width: 720px), (pointer: coarse) {
  dialog button,
  .detail button,
  .editbar button,
  .selbar button,
  .drawhint button,
  .menu.pop button,
  .chip {
    min-height: 40px;
  }

  #adm-tabs button,
  #dq-tabs button,
  .acc-tabs button {
    min-height: 38px;
  }

  .editbar .edit-min,
  .detail .close,
  dialog .bnd-x {
    min-width: 40px;
    min-height: 40px;
  }

  dialog input[type='checkbox'],
  .detail input[type='checkbox'],
  .editbar input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }

  dialog :is(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea),
  .detail :is(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea),
  .login input {
    min-height: 40px;
    font-size: 16px !important;
  }

  .detail .badge.qe {
    padding-block: 6px;
  }

  .detail dd.qe {
    padding-block: 8px;
  }
}

/* ---------- admin center: sidebar, page header, settings ---------- */

#adm.adm {
  width: min(1240px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
}

.adm-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  height: 100%;
}

.adm-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 12px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--field) 55%, var(--card));
}

.adm-brand {
  padding: 0 10px 2px;
}

.adm-brand h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.adm-nav {
  display: grid;
  gap: 16px;
}

.adm-group {
  display: grid;
  gap: 2px;
}

.adm-group-h {
  margin: 0 10px 4px;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

#adm .adm-tab,
#adm .adm-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--btn-radius);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#adm .adm-sub {
  padding: 6px 10px 6px 38px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.adm-tab svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
}

.adm-tab span,
.adm-sub span {
  flex: 1;
  min-width: 0;
}

.adm-sub i {
  font-style: normal;
  opacity: 0.6;
}

#adm .adm-tab:hover,
#adm .adm-sub:hover {
  background: var(--brand-soft);
  color: var(--ink);
}

#adm .adm-tab[aria-selected="true"],
#adm .adm-sub[aria-selected="true"] {
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.adm-tab[aria-selected="true"] svg {
  color: currentColor;
}

.adm-count {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.adm-count.warn {
  background: #c2410c;
}

.adm-tab[aria-selected="true"] .adm-count {
  background: var(--card);
  color: var(--brand);
}

.adm-phone-only {
  display: none !important;
}

.adm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}

.adm-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.adm-head {
  min-width: 0;
}

.adm-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.adm-title h3 {
  margin: 0;
  font-size: 22px;
}

.adm-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#adm .adm-crumb {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.adm-crumb-sep {
  color: var(--muted);
}

.adm-bar-acts {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

/* "Check For New" reads as a button, like every other action. */
#adm #adm-refresh {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}

#adm #adm-refresh:hover {
  border-color: var(--brand);
  color: var(--brand);
}

#adm #adm-body {
  flex: 1;
  padding: 18px 28px 28px;
}

.adm-help {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--field) 50%, transparent);
  font-size: 13px;
}

.adm-help summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand);
}

.adm-help p {
  max-width: 85ch;
  margin: 8px 0 2px;
  line-height: 1.55;
}

/* Lists: each item a card, its text on the left and its actions on the right. */
#adm .adm-list {
  display: grid;
  gap: 8px;
}

#adm .adm-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

#adm .adm-item:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}

#adm .adm-item .adm-acts {
  justify-items: end;
  max-width: 400px;
}

#adm .adm-item .adm-acts .dq-acts {
  justify-content: flex-end;
}

#adm .adm-what strong {
  font-size: 14px;
}

/* A two-way switch, such as Waiting For Approval / Recently Published. */
.seg {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 11px;
  background: var(--field);
}

#adm .seg button {
  padding: 8px 14px;
  border: 0;
  /* A piece of a switch: its frame's corners less the frame's padding, so the two nest. */
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#adm .seg button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(0 0 0 / 14%);
}

.seg b {
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
}

/* Data Refresh: the last refresh, the schedule and Refresh Now in one strip. */
.rf-strip {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.rf-strip > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.rf-k {
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.rf-strip small {
  color: var(--muted);
  font-size: 12px;
}

/* My Work */
.work-hello {
  margin-bottom: 4px;
  font-size: 14px;
}

.work-hello p {
  margin: 0 0 2px;
}

#adm .work-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

#adm .work-card {
  gap: 4px;
  padding: 16px;
}

.work-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.work-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.work-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-card.has .work-ico {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Settings */
.set-group {
  margin-bottom: 22px;
}

.set-group h4 {
  margin: 0 0 8px;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.set-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

#adm .set-card {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

#adm button.set-card:hover,
#adm button.set-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

#adm .set-card.static {
  cursor: default;
}

.set-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
}

.set-top i {
  font-style: normal;
  color: var(--brand);
}

.set-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.set-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.set-card .set-own {
  font-style: italic;
  opacity: 0.85;
}

.set-card .dq-acts {
  margin-top: 8px;
}

.set-panel {
  max-width: 820px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.set-panel .rf-sched {
  margin: 0;
  padding: 0;
  border: 0;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.set-row > div {
  display: grid;
  gap: 2px;
}

.set-row small {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  #adm.adm {
    width: 100vw;
    height: 100dvh;
    padding: 0;
  }

  .adm-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .adm-side {
    flex-direction: row;
    padding: 8px 10px;
    overflow: auto hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .adm-brand,
  .adm-group-h,
  #adm .adm-sub {
    display: none !important;
  }

  .adm-nav {
    display: flex;
    gap: 4px;
  }

  .adm-group {
    display: contents;
  }

  #adm .adm-tab {
    width: auto;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .adm-phone-only {
    display: flex !important;
  }

  .adm-bar {
    padding: 12px 14px 10px;
  }

  .adm-title h3 {
    font-size: 18px;
  }

  #adm #adm-body {
    padding: 12px 14px 20px;
  }

  .rf-strip {
    grid-template-columns: 1fr 1fr;
  }

  .rf-strip-act {
    grid-column: 1 / -1;
  }

  #adm .adm-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #adm .adm-item .adm-acts {
    grid-column: 1 / -1;
    justify-items: stretch;
    max-width: none;
  }

  #adm .adm-item .adm-acts .dq-acts {
    justify-content: flex-start;
  }
}

/* Admin Center on a phone: settings pages as one scrolling row, a compact header. */
.set-row button {
  flex: none;
  white-space: nowrap;
}

@media (max-width: 720px) {
  #adm-body .chips.adm-phone-only {
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 -14px 12px;
    padding: 0 14px 4px;
    overflow-x: auto;
  }

  #adm-body .chips.adm-phone-only .chip {
    flex: none;
    min-height: 36px;
    white-space: nowrap;
  }

  .adm-title {
    flex-wrap: wrap;
    row-gap: 0;
  }

  #adm #adm-refresh {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  #adm #adm-refresh::before {
    content: '↻';
    font-size: 18px;
  }

  .adm-head p {
    font-size: 13px;
  }
}

/* Permit Types before the first refresh that lists them. */
.pt-empty p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pt-defaults {
  display: grid;
  gap: 8px;
  margin: 8px 0 2px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

/* Status in Layers: rows like Categories, each swatch drawn the way the map draws that status. */
#statuses {
  display: grid;
  gap: 2px;
}

.row .swatch.st-hatch {
  background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1.5px var(--c);
}

.row .swatch.st-light {
  background: color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--c);
}

.row .swatch.st-outline,
.row .swatch.st-dashed {
  background: none;
  border: 2px dashed var(--c);
}

.row .swatch.st-cross {
  background: repeating-linear-gradient(45deg, var(--c) 0 1.5px, transparent 1.5px 4px), repeating-linear-gradient(135deg, var(--c) 0 1.5px, transparent 1.5px 4px);
  box-shadow: inset 0 0 0 1.5px var(--c);
}

.row .swatch.st-dots {
  background: radial-gradient(var(--c) 1.2px, transparent 1.4px) 0 0 / 4px 4px;
  box-shadow: inset 0 0 0 1.5px var(--c);
}

/* Development Rings: the sample ring and its sentence on one line across, the slice colours in two columns below. */
#key {
  grid-template-columns: 1fr;
  gap: 8px;
}

#key .key-dev {
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
  text-transform: none;
}

#key .key-dev .k {
  flex: none;
  width: 22px;
  height: 22px;
}

#key .key-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

/* 2D / 3D, Reset View and Start Here share the row; the forget link sits under it. */
.view-row {
  flex-wrap: wrap;
}

.view-row button {
  flex: 1 1 auto;
  white-space: nowrap;
}

.start-forget {
  display: block;
  margin: 6px 0 0 auto;
  font-size: 12px;
}

/* Your View: the viewer's own settings, set apart from the map's layers. */
.view-note {
  margin: 0 4px 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

[data-group='view'] .view-row {
  margin-top: 6px;
}

/* The About "?" as a map control, above the credits. */
.about-ctrl #about-open {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

/* ---------- news and announcements ---------- */

:root {
  --ann-news: #2563eb;
  --ann-announcement: var(--brand);
  --ann-alert: #c2410c;
}

.ann-pop {
  width: min(540px, calc(100vw - 24px));
  border-top: 5px solid var(--ann-announcement);
}

.ann-pop.is-news {
  border-top-color: var(--ann-news);
}

.ann-pop.is-alert {
  border-top-color: var(--ann-alert);
}

.ann-kind {
  margin: 0 0 4px;
  font: 700 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ann-announcement);
}

.ann-kind.ann-news {
  color: var(--ann-news);
}

.ann-kind.ann-alert {
  color: var(--ann-alert);
}

.ann-pop h2,
.ann-pop-preview h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  text-transform: none;
}

.ann-body {
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ann-body p {
  margin: 0 0 10px;
}

.ann-body ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.ann-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.ann-links .btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.ann-links .btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.ann-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ann-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

/* The banner: just under the header, centred. */
.ann-banner {
  position: fixed;
  left: 50%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(680px, calc(100vw - 24px));
  padding: 10px 10px 10px 14px;
  transform: translateX(-50%);
  border-left: 5px solid var(--ann-announcement);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.ann-banner.is-news {
  border-left-color: var(--ann-news);
}

.ann-banner.is-alert {
  border-left-color: var(--ann-alert);
}

.ann-ban-ic {
  font-size: 18px;
}

.ann-ban-text {
  display: grid;
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.ann-ban-text span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ann-banner button {
  flex: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ann-banner .ann-ban-x {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
}

/* What's New: the Announcements tab. */
.ann-feed {
  display: grid;
  gap: 10px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.ann-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ann-announcement);
  border-radius: 10px;
}

.ann-card.is-news {
  border-left-color: var(--ann-news);
}

.ann-card.is-alert {
  border-left-color: var(--ann-alert);
}

.ann-card h3 {
  margin: 2px 0 6px;
  font-size: 16px;
  text-transform: none;
}

.ann-new {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.04em;
}

/* Admin Center → Announcements */
.ann-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ann-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  font-size: 18px;
}

.ann-snippet {
  margin: 2px 0;
  color: var(--ink);
  font-size: 13px;
}

.ann-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.ann-fields {
  display: grid;
  gap: 10px;
}

.ann-fields h4 {
  margin: 0;
  font-size: 18px;
}

.ann-fields h5 {
  margin: 8px 0 0;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.ann-back {
  margin: 0;
}

.ann-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ann-fields .dq-in {
  font-size: 12px;
}

.ann-fields textarea {
  resize: vertical;
  min-height: 130px;
}

.ann-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ann-fields .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  text-transform: none;
}

.ann-save {
  margin-top: 6px;
}

.ann-preview {
  position: sticky;
  top: 0;
  display: grid;
  gap: 6px;
}

.ann-pop-preview {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--ann-announcement);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.ann-pop-preview.is-news {
  border-top-color: var(--ann-news);
}

.ann-pop-preview.is-alert {
  border-top-color: var(--ann-alert);
}

.ann-pop-preview .close,
.ann-pop-preview .ann-foot button {
  pointer-events: none;
}

.ann-pop-preview .close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 18px;
}

@media (max-width: 720px) {
  .ann-grid,
  .ann-row2 {
    grid-template-columns: 1fr;
  }

  .ann-preview {
    position: static;
  }

  .ann-banner {
    padding: 8px 8px 8px 12px;
  }

  .ann-banner [data-ban='next'] {
    display: none;
  }
}

/* Announcement form fields fill their column instead of running under the preview. */
.ann-fields,
.ann-preview {
  min-width: 0;
}

.ann-fields .dq-in input,
.ann-fields .dq-in select,
.ann-fields .dq-in textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ann-fields .seg {
  flex-wrap: wrap;
  justify-self: start;
}

/* Announcement types: each one's colour comes from its type (--ann-c). */
.ann-pop,
.ann-pop-preview {
  border-top-color: var(--ann-c, var(--brand)) !important;
}

.ann-kind {
  color: var(--ann-c, var(--brand)) !important;
}

.ann-banner,
.ann-card {
  border-left-color: var(--ann-c, var(--brand)) !important;
}

.ann-ico {
  background: color-mix(in srgb, var(--ann-c, var(--brand)) 14%, transparent);
}

.adm-tag.ann-tag {
  border-color: var(--ann-c, var(--brand));
  color: var(--ann-c, var(--brand));
}

.ann-types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#adm .ann-type-btn {
  padding: 6px 12px;
  border: 1.5px solid color-mix(in srgb, var(--ann-c) 45%, var(--line));
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#adm .ann-type-btn[aria-pressed="true"] {
  border-color: var(--ann-c);
  background: var(--ann-c);
  color: #fff;
}

.ann-n {
  float: right;
  color: var(--muted);
  font-weight: 500;
}

.ann-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ann-roles legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
}

.ann-hist {
  font-size: 12px;
}

.ann-hist summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.ann-hist ol {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.ann-prev-seg {
  justify-self: start;
  margin-bottom: 4px;
}

.ann-banner-preview {
  position: static;
  width: auto;
  transform: none;
}

.ann-prev-body .ann-feed {
  margin: 0;
}

/* Settings → Announcement Types */
.ty-list {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.ty-row {
  display: grid;
  grid-template-columns: 46px minmax(120px, 1fr) 44px minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ann-c, var(--brand));
  border-radius: 10px;
}

.ty-row.is-hidden {
  opacity: 0.6;
}

#adm .ty-row .ty-icon {
  width: 46px;
  padding: 6px 4px;
  font-size: 18px;
  text-align: center;
}

#adm .ty-row .ty-color {
  width: 44px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.ty-sample {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ty-used {
  color: var(--muted);
  white-space: nowrap;
}

.ty-acts {
  display: flex;
  gap: 4px;
}

.ty-ideas .chip {
  margin: 2px;
}

@media (max-width: 900px) {
  .ty-row {
    grid-template-columns: 46px 1fr 44px;
  }

  .ty-sample,
  .ty-used,
  .ty-acts {
    grid-column: 1 / -1;
  }
}

/* ---------- member accounts ---------- */

.mem-signin {
  margin-bottom: 4px;
}

.mem-signin h2 {
  margin: 0 0 6px;
}

.mem-why,
.mem-privacy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mem-privacy {
  font-size: 12px;
}

.mem-gbtn {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin: 10px 0 4px;
}

.mem-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  color: var(--muted);
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mem-or::before,
.mem-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}

.staff-form h2 {
  font-size: 18px;
}

/* ☆ Follow on a project's card */
.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--btn-radius);
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.follow-btn.on {
  background: var(--accent);
  color: #fff;
}

/* The member's menu, under the Sign In pill */
.mem-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 230px;
  padding: 8px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.mem-who {
  display: grid;
  margin: 2px 8px 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.mem-who small {
  color: var(--muted);
}

.mem-menu button {
  display: block;
  width: 100%;
  text-align: left;
}

/* Following, My Tips, Saved Views */
.mem-dlg {
  width: min(620px, calc(100vw - 24px));
}

.mem-tabs {
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.fl-list {
  display: grid;
  gap: 10px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.fl-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fl-card.has-new {
  border-left: 4px solid var(--accent);
}

.fl-head {
  display: grid;
  gap: 2px;
}

.fl-head small {
  color: var(--muted);
}

.fl-ev {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.fl-ev li {
  padding: 4px 0;
}

.fl-ev li span {
  display: inline-block;
  min-width: 92px;
  color: var(--muted);
  font-size: 12px;
}

.fl-ev li.is-new {
  font-weight: 700;
}

.mem-pitch {
  padding: 12px 14px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
}

.mem-tip {
  margin: 6px 0 0;
  font-size: 13px;
}

.mem-note {
  margin: 6px 0 0;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}

/* Admin Center → Members */
.mem-admin-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.mem-h {
  margin: 0 0 8px;
}

.mem-top {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
}

.mem-top li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}

.mem-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.mem-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .mem-admin-grid {
    grid-template-columns: 1fr;
  }

  .mem-menu {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
  }
}

.mem-msg {
  margin: 4px 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.mem-msg:empty {
  display: none;
}

.fl-head .ann-new {
  justify-self: start;
  margin: 2px 0 0;
}

.fl-card .ann-links button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fl-card .ann-links button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

/* The sign-in box: one side at a time, members (Google) or staff. */
#login[data-view='member'] #login-form,
#login[data-view='staff'] #mem-signin {
  display: none;
}

#login[data-view='staff'] {
  border-top: 5px solid var(--accent);
}

#login[data-view='staff'] .eyebrow {
  color: var(--accent);
}

.login-switch {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}

.login-switch .link-btn {
  color: var(--muted);
  font-weight: 600;
}

.login-switch .link-btn:hover {
  color: var(--brand);
}

/* The space for Google's button is fixed, so the sign-in box keeps its size while it loads. */
.mem-gbtn {
  align-items: center;
  height: 44px;
  min-height: 44px;
  overflow: hidden;
}

.mem-notme {
  margin: 2px 0 6px;
  text-align: center;
  font-size: 13px;
}

.mem-notme .link-btn {
  color: var(--muted);
}

.mem-notme .link-btn:hover {
  color: var(--brand);
}

.acc-seats {
  font-weight: 600;
  color: var(--ink);
}

.acc-seats.full {
  color: #b42318;
}

/* Admin Center: Subscription & Billing, Help & Feedback */
.sub-note {
  max-width: 820px;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand-soft, rgba(31, 100, 102, 0.08));
  border: 1px solid var(--line);
}

.sub-note.warn {
  background: #fff7e6;
  border-color: #f5c26b;
}

.sub-note.bad {
  background: #fdecea;
  border-color: #f1a7a0;
}

.sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.fb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.fb-card {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.fb-card:hover,
.fb-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.fb-card small {
  color: var(--muted);
}

/* See My Requests: a full-width bar under the four ways to ask */
.fb-card[data-portal='requests'] {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 12px 16px;
  background: var(--brand-soft);
}

.fb-card[data-portal='requests'] .fb-ico {
  grid-row: span 2;
  background: var(--card);
}

.fb-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.fb-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "Nothing here", the same on every Admin Center page */
.adm-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

.adm-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.adm-empty small {
  max-width: 46ch;
  font-size: 13px;
}

.adm-empty-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.adm-empty-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.adm-list > li:has(> .adm-empty),
.ph-grid > .ph-empty {
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}

/* Long reading (What's New, set-up steps, How this works) at a comfortable line length */
.wn-page,
.adm-help p {
  max-width: 78ch;
}

/* What the plan includes (Subscription & Billing) */
.feat-box {
  max-width: 820px;
  margin: 12px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.feat-list {
  columns: 2;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}

.feat-list li {
  padding: 2px 0;
  break-inside: avoid;
}

.feat-list li.off {
  color: var(--muted);
}

/* An add-on the site has stands out; one it does not is grey like any feature left out. */
.feat-list li.on.addon {
  color: var(--brand);
  font-weight: 600;
}

.feat-list li small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .feat-list {
    columns: 1;
  }
}

/* An embedded copy of the map on a plan without embedding */
.embed-off {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 24px;
  background: var(--bg, #f4f1ea);
  text-align: center;
}

.embed-off a {
  font-weight: 700;
}

/* =====================================================================
   Staff Dashboards (dashboards.js, widgets.js)
   ===================================================================== */

.dash {
  position: fixed;
  inset: 0;
  width: calc(100vw - 24px);
  max-width: none;
  height: calc(100vh - 24px);
  max-height: none;
  margin: auto;
  padding: 0;
  color: var(--ink);
  overflow: hidden;
}

.dash::backdrop {
  background: rgb(20 18 12 / 55%);
}

.dash-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  height: 100%;
}

.dash-side {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--field);
  overflow: auto;
}

.dash-side .eyebrow {
  margin: 0 6px 10px;
}

.dash-new {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--brand) !important;
  border-radius: 10px;
  color: var(--brand);
  font-weight: 700;
  text-align: left;
}

.dash-new:hover {
  background: var(--brand-soft);
}

.dash-h {
  margin: 14px 6px 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-none {
  margin: 2px 6px;
  font-size: 12px;
  color: var(--muted);
}

.dash-item {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
}

.dash-item small {
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}

.dash-item:hover {
  background: var(--card);
}

.dash-item.on {
  background: var(--brand-soft);
  color: var(--brand);
}

.dash-main {
  min-width: 0;
  padding: 0 22px 26px;
  overflow: auto;
}

.dash-top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 -22px;
  padding: 16px 22px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.dash-title {
  min-width: 0;
  flex: 1 1 280px;
}

.dash-title .eyebrow {
  margin: 0 0 2px;
}

.dash-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dash-title .viz-sub {
  margin: 4px 0 0;
}

.dash-rename {
  width: min(460px, 100%);
  padding: 6px 10px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--field);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: inherit;
}

.dash-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dash-acts > button,
.dash-more-wrap > button,
.dash-form-acts button,
.dash-welcome button.primary {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
}

.dash-acts > button:hover:not(.primary),
.dash-more-wrap > button:hover {
  background: var(--field);
}

.dash-acts .close {
  position: static;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  font-size: 22px;
}

.dash-unsaved {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.dash-more-wrap,
.dash-w-acts {
  position: relative;
}

.dash .menu.pop {
  top: calc(100% + 6px);
  bottom: auto;
  left: auto;
  right: 0;
  z-index: 6;
  min-width: 230px;
}

.dash .menu.pop[hidden] {
  display: none;
}

.dash .menu.pop .danger {
  margin: 0;
}

.dash-filters {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.dash-fwrap > summary {
  display: none;
}

.dash-fl {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
}

.dash-fi {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.dash-fi > span,
.dash-fi > summary {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-fi select,
.dash-fi input {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  font: inherit;
  color: inherit;
}

.dash-fi input[type='search'] {
  width: 170px;
}

.dash-fi.wide input {
  width: 100%;
}

.dash-fi.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dash-fi.chips > span {
  width: 100%;
}

.dash-fi .chip {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.dash-fi .chip[aria-pressed='true'] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.dash-uses {
  position: relative;
}

.dash-uses > summary {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink);
}

.dash-uses-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  display: grid;
  gap: 2px;
  min-width: 230px;
  max-height: 320px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.dash-uses-list label {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.dash-uses-list label:hover {
  background: var(--field);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dash-w {
  grid-column: span 2;
  min-width: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.dash-w.size-s {
  grid-column: span 1;
}

.dash-w.size-w {
  grid-column: 1 / -1;
}

.dash-w > header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dash-w h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.dash-own {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.dash-w-acts {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dash-w-acts > button,
.dash-w-acts > select {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  font-size: 14px;
  color: var(--muted);
}

.dash-w-acts > select {
  border-color: var(--line);
  background: var(--field);
  font: inherit;
  font-size: 12px;
  color: var(--ink);
}

.dash-w-acts > button:hover:not(:disabled) {
  background: var(--field);
  color: var(--ink);
}

.dash-w-acts > button:disabled {
  opacity: 0.35;
  cursor: default;
}

.dash-grip {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
}

.dash-grid.editing .dash-w {
  border-style: dashed;
}

.dash-w.dragging {
  opacity: 0.4;
}

.dash-w.drop {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.dash-w .viz-tiles {
  margin: 4px 0 0;
}

.dash-kpi {
  grid-template-columns: 1fr;
}

.dash-kpi .viz-tile {
  border: 0;
  padding: 2px 0;
  background: none;
  box-shadow: none;
}

.dash-kpi .viz-num {
  font-size: 32px;
}

.viz-tile.drillable,
.dash [data-drill].viz-seg,
.dash [data-drill].viz-colbar,
.dash circle[data-open] {
  cursor: pointer;
}

.viz-tile.drillable:hover .viz-num,
.viz-tile.drillable:focus-visible .viz-num {
  color: var(--brand);
}

.dash [data-drill].viz-seg:hover,
.dash [data-drill].viz-colbar:hover {
  filter: brightness(1.12);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.dash .viz-name.link-btn {
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}

.dash .viz-name.link-btn:hover {
  color: var(--brand);
  text-decoration: underline;
}

.dash-goal {
  height: 8px;
  margin: 8px 0 4px;
  border-radius: 999px;
  background: var(--field);
  overflow: hidden;
}

.dash-goal i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.dash-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  margin: 6px 0;
}

.dash-map path.city {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 1.2;
}

.dash-map path.etj {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.dash-map circle {
  stroke: var(--card);
  stroke-width: 1.5;
}

.dash-map circle:hover {
  stroke: var(--ink);
  stroke-width: 2;
}

.dash-tl {
  position: relative;
  padding-top: 22px;
  --tl-left: calc(34% + 8px);
}

.dash-tl-axis {
  position: absolute;
  top: 0;
  left: var(--tl-left);
  right: 0;
  height: 18px;
  font-size: 11px;
  color: var(--muted);
}

.dash-tl-axis span {
  position: absolute;
  transform: translateX(-50%);
}

.dash-tl-row {
  display: grid;
  grid-template-columns: 34% 1fr;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

.dash-tl-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-tl-track {
  position: relative;
  height: 12px;
  border-radius: 4px;
  background: var(--field);
}

.dash-tl-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
}

.dash-tl-today {
  position: absolute;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
}

.dash-ev {
  display: grid;
  padding: 6px 8px;
}

.dash-welcome {
  grid-column: 1 / -1;
  max-width: 900px;
  padding: 24px 4px;
}

.dash-welcome h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.dash-tpls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.dash-tpl {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
}

.dash-tpl small {
  font-size: 12px;
  color: var(--muted);
}

.dash-tpl:hover,
.dash-tpl:has(input:checked) {
  border-color: var(--brand) !important;
  background: var(--brand-soft);
}

.dash-tpl:has(input:focus-visible) {
  outline: 2px solid var(--brand);
}

.dash-tpl input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dash-pop {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 20px 22px;
  overflow: auto;
  color: var(--ink);
}

.dash-pop.wide {
  width: min(940px, calc(100vw - 24px));
}

.dash-pop::backdrop {
  background: rgb(20 18 12 / 40%);
}

.dash-pop > .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 22px;
}

.dash-pop h3 {
  margin: 0 0 10px;
  padding-right: 36px;
  font-size: 20px;
}

.dash-pop .eyebrow {
  margin: 0 0 2px;
}

.dash-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.dash-form > .dash-tpls,
.dash-form > .dash-fi.wide,
.dash-form > fieldset,
.dash-form > .dash-check,
.dash-form-acts {
  flex: 1 1 100%;
}

.dash-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
}

.dash-own-f {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dash-own-f legend {
  padding: 0 4px;
  font-weight: 700;
}

.dash-form-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 4px 0 10px;
}

.dash-form-acts.left {
  justify-content: flex-start;
}

.dash-lib {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 16px;
}

.dash-lib-item {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid var(--line) !important;
  border-radius: 10px;
  text-align: left;
}

.dash-lib-item small {
  font-size: 12px;
  color: var(--muted);
}

.dash-lib-item:hover {
  border-color: var(--brand) !important;
  background: var(--brand-soft);
}

.dash-tip {
  position: fixed;
  z-index: 10;
}

.dash-print-head {
  display: none;
}

.only-bar {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 14px;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
}

.only-bar[hidden] {
  display: none;
}

.only-bar button {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-w,
  .dash-w.size-w {
    grid-column: 1 / -1;
  }

  .dash-w.size-s {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .dash {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .dash-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dash-side {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dash-side .eyebrow,
  .dash-h,
  .dash-none {
    display: none;
  }

  .dash-new,
  .dash-item {
    flex: none;
    width: auto;
    margin: 0;
  }

  .dash-main {
    padding: 0 14px 20px;
  }

  .dash-top {
    margin: 0 -14px;
    padding: 12px 14px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-w.size-s {
    grid-column: 1 / -1;
  }

  .dash-fi input[type='search'] {
    width: 140px;
  }

  .dash-fwrap > summary {
    display: list-item;
    padding: 4px 0;
    font-weight: 700;
    cursor: pointer;
  }

  .dash-fwrap[open] > summary {
    margin-bottom: 8px;
  }

  .only-bar {
    top: auto;
    bottom: 90px;
  }
}

@media print {
  html.dash-printing body > *:not(#dash) {
    display: none !important;
  }

  html.dash-printing #dash {
    position: static;
    display: block;
    width: auto;
    height: auto;
    border: 0;
    box-shadow: none;
    background: #fff;
    color: #000;
    overflow: visible;
  }

  html.dash-printing #dash::backdrop {
    display: none;
  }

  html.dash-printing .dash-shell {
    display: block;
    height: auto;
  }

  html.dash-printing .dash-side,
  html.dash-printing .dash-top,
  html.dash-printing .dash-filters,
  html.dash-printing .dash-w-acts,
  html.dash-printing .dash-grip {
    display: none !important;
  }

  html.dash-printing .dash-print-head {
    display: block;
    margin-bottom: 12px;
  }

  html.dash-printing .dash-print-head h1 {
    margin: 0;
    font-size: 22px;
  }

  html.dash-printing .dash-print-head p {
    margin: 2px 0;
    font-size: 11px;
  }

  html.dash-printing .dash-main {
    padding: 0;
    overflow: visible;
  }

  html.dash-printing .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html.dash-printing .dash-w {
    grid-column: span 1;
    break-inside: avoid;
  }

  html.dash-printing .dash-w.size-w {
    grid-column: 1 / -1;
  }

  html.dash-printing .viz-scroll {
    max-height: none;
    overflow: visible;
  }
}

/* =====================================================================
   Admin Center → Settings → Branding (branding.js)
   ===================================================================== */

.br-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.br-form {
  display: grid;
  gap: 12px;
}

.br-form .set-card {
  display: grid;
  gap: 8px;
}

.br-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.br-field > span {
  font-weight: 600;
  color: var(--muted);
}

/* The same size as every other box in the Admin Center (.dq) */
.br-field input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  font: inherit;
  font-size: 13px;
  color: inherit;
}

.br-form code {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 12px;
}

.br-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.br-logo-box {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--field);
  overflow: hidden;
  text-align: center;
}

.br-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.br-logo-box img.cm-default {
  width: 70%;
  height: 70%;
}

.br-logo-box:has(.cm-default) {
  border-style: solid;
  background: #fff;
}

.br-logo-box small {
  padding: 4px;
  font-size: 11px;
  color: var(--muted);
}

.br-logo-acts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.br-upload {
  position: relative;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.br-upload:hover {
  background: var(--field);
}

.br-upload:focus-within {
  outline: 2px solid var(--brand);
}

.br-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.br-color {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 2px 12px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}

.br-color small {
  grid-column: 1;
}

.br-color input[type='color'] {
  grid-row: 1 / span 3;
  grid-column: 2;
  width: 52px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.br-color input[type='color']:disabled {
  opacity: 0.45;
  cursor: default;
}

.br-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.br-ok {
  color: #1b7f4a;
}

.br-warn {
  color: var(--danger);
  font-weight: 600;
}

:root[data-theme='dark'] .br-ok {
  color: #6fd29a;
}

.br-saved {
  border-color: var(--brand) !important;
}

.br-side {
  position: sticky;
  top: 0;
  display: grid;
  gap: 10px;
}

.br-side > div {
  display: grid;
  gap: 10px;
}

.br-pv-tab {
  margin: 0;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--field);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.br-pv {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d2dad1;
  border-radius: 12px;
  background: #f7f9f4;
  color: #1c2a2f;
}

.br-pv.dark {
  border-color: #25313a;
  background: #141b1f;
  color: #e1e9e5;
}

.br-pv-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-pv-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--pv-brand), var(--pv-accent));
  color: #fff;
  overflow: hidden;
}

.br-pv-mark.img {
  background: none;
}

.br-pv-mark svg {
  width: 22px;
  height: 22px;
}

.br-pv-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.br-pv-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.br-pv-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.br-pv-btn {
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  background: var(--pv-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.br-pv.dark .br-pv-btn {
  color: #0d1215;
}

.br-pv-link {
  color: var(--pv-accent);
  font-size: 12px;
  font-weight: 700;
}

.br-pv-line {
  flex: 1 1 60px;
  height: 0;
  border-top: 2px dashed var(--pv-accent);
}

.br-pv-credit {
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed currentColor;
  font-size: 11px;
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 900px) {
  .br-page {
    grid-template-columns: 1fr;
  }

  .br-side {
    position: static;
    order: -1;
  }
}

/* ---------- Duplicate (accounts) ---------- */

.acc-copied {
  margin: -6px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.acc-dup {
  margin: -4px 0 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.acc-dup:hover {
  background: var(--field);
}

.acc-copyfrom {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.acc-copyfrom > span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.acc-copyfrom select {
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  font: inherit;
  font-size: 14px;
  color: inherit;
}

/* A plan with one city: the name is a plain title. */
.city-btn.solo {
  cursor: default;
}

.city-btn.solo:hover {
  background: none;
  color: inherit;
}

/* Admin Center: settings pages are full items with icons, like the other sections. */
#adm .adm-sub.adm-set {
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

#adm .adm-sub.adm-set[aria-selected="true"] {
  color: var(--on-brand, #fff);
}

#adm .adm-sub.adm-set i {
  margin-left: auto;
  font-size: 12px;
}

/* ---------- Notices and access from nVisionTeK (notices.js) ---------- */

.nvt-notices {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 7;
  display: grid;
  gap: 8px;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.nvt-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: auto;
}

.nvt-notice.warning {
  border-left-color: #b45309;
}

.nvt-notice.urgent {
  border-left-color: var(--danger, #b3261e);
  background: color-mix(in srgb, var(--danger, #b3261e) 7%, var(--card));
}

.nvt-notice > details {
  flex: 1;
  min-width: 0;
}

.nvt-notice summary {
  cursor: pointer;
  list-style: none;
}

.nvt-notice summary::-webkit-details-marker {
  display: none;
}

.nvt-notice summary::after {
  content: "More ▾";
  margin-left: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.nvt-notice details[open] summary::after {
  content: "Less ▴";
}

.nvt-notice p {
  margin: 4px 0;
  white-space: pre-line;
}

.nvt-notice small {
  display: block;
}

.nvt-more {
  justify-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
}

.nvt-notice small {
  color: var(--muted);
}

.nvt-x {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 18px;
  color: var(--muted);
}

.nvt-x:hover {
  background: var(--field);
}

html.embed .nvt-notices {
  display: none;
}

.nvt-paused {
  padding: 0;
  border: 0;
  background: none;
}

.nvt-paused::backdrop {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
}

.nvt-paused-card {
  max-width: 420px;
  padding: 26px 28px;
  text-align: center;
}

.nvt-paused-card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
}

/* ---------- Branding: what a save did ---------- */

.br-result {
  border-width: 2px !important;
}

.br-result.ok {
  border-color: #1b7f4a !important;
}

.br-result.bad {
  border-color: var(--danger) !important;
}

.br-result > strong {
  font-size: 16px;
}

.br-result.ok > strong {
  color: #1b7f4a;
}

.br-result.bad > strong {
  color: var(--danger);
}

:root[data-theme='dark'] .br-result.ok > strong {
  color: #6fd29a;
}

.br-changes {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 13px;
}

.br-changes li {
  margin: 4px 0;
}

.fb-contact {
  margin-bottom: 12px;
}

.nvt-notice strong,
.nvt-notice summary,
.nvt-paused-card h2 {
  text-transform: none;
}

.br-page .br-check,
.br-page .set-card > strong {
  text-transform: none;
}

/* Activity: Visitors / Editing headings */
.adm-sub-h {
  margin: 18px 0 8px;
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- What's New ---------- */

.wn-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 22px 24px;
  overflow: auto;
  color: var(--ink);
}

.wn-dialog::backdrop {
  background: rgb(20 18 12 / 45%);
}

.wn-dialog h2 {
  margin: 2px 0 6px;
  font-size: 22px;
  text-transform: none;
}

.wn-rel {
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}

.wn-rel h3 {
  margin: 2px 0 6px;
  font-size: 16px;
  text-transform: none;
}

.wn-rel ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.wn-rel li {
  margin: 4px 0;
}

.wn-v {
  margin: 0;
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.wn-page .wn-rel:first-child {
  border-top: 0;
}

/* =====================================================================
   Start-up screen (index.html #splash, hidden by app.js)
   ===================================================================== */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 50% 38%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s;
}

.splash.done {
  opacity: 0;
  visibility: hidden;
}

.splash.done .splash-in {
  transform: scale(1.04);
}

.splash-in {
  display: grid;
  justify-items: center;
  gap: 14px;
  transition: transform 0.6s ease;
}

.splash-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 18px 50px -18px var(--brand);
  animation: splash-rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  overflow: hidden;
}

.splash-mark svg {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.splash-mark path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: splash-draw 0.9s 0.25s ease-out forwards;
}

.splash-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--card);
}

.splash-name {
  min-height: 1.3em;
  margin: 4px 0 0;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  animation: splash-fade 0.6s 0.35s ease both;
}

.splash-bar {
  position: relative;
  width: 180px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}

.splash-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  animation: splash-slide 1.2s ease-in-out infinite;
}

.splash-note {
  margin: 0;
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  animation: splash-fade 0.6s 0.5s ease both;
}

.splash-note::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: splash-dots 1.2s steps(4) infinite;
}

/* The product under the city's own brand: CivMetryx by nVisionTeK (gone with White label). */
.splash-by {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  transform: translateX(-50%);
  color: var(--muted);
  white-space: nowrap;
  animation: splash-fade 0.6s 0.7s ease both;
}

.splash-by-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1663d6, #0a7d5e);
}

.splash-by-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.6;
  stroke-linecap: round;
}

.splash-by > span:last-child {
  display: grid;
  line-height: 1.15;
  text-align: left;
}

.splash-by b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.splash-by small {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.86);
  }
}

@keyframes splash-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes splash-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes splash-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes splash-dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash *,
  .splash *::after {
    animation: none !important;
  }

  .splash-mark path {
    stroke-dashoffset: 0;
  }
}

html.embed .splash {
  display: none;
}

/* =====================================================================
   Quick Search (palette.js): Ctrl+K / ⌘K for staff
   ===================================================================== */

.palette {
  width: min(620px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 80px));
  margin: 12vh auto auto;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  flex-direction: column;
}

.palette[open] {
  display: flex;
}

.palette::backdrop {
  background: rgb(10 16 20 / 40%);
  backdrop-filter: blur(2px);
}

.pal-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pal-box > svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.pal-box input {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 16px var(--font, inherit);
  outline: none;
}

.pal-list {
  flex: 1;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.pal-h {
  padding: 10px 10px 4px;
  color: var(--muted);
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.pal-item[aria-selected='true'] {
  background: var(--brand-soft);
}

.pal-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--field);
  color: var(--brand);
}

.pal-ico svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pal-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.pal-text strong,
.pal-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pal-text strong {
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
}

.pal-text small {
  color: var(--muted);
  font-size: 12px;
}

.pal-item em {
  flex: none;
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.pal-none {
  padding: 24px 10px;
  color: var(--muted);
  text-align: center;
}

.pal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pal-foot kbd + kbd {
  margin-left: 2px;
}

@media (max-width: 560px) {
  .pal-foot {
    display: none;
  }
}

/* The search button at the top of the Admin Center sidebar, and in the account menu */
.adm-find {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 20px);
  margin: 10px 10px 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.adm-find:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.adm-find svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.adm-find span {
  flex: 1;
}

#edit-find kbd {
  margin-left: 6px;
}

/* =====================================================================
   "Since you were last here" (My Work)
   ===================================================================== */

.since {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), transparent 60%), var(--card);
}

.since-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.since-head strong {
  font-size: 16px;
}

.since-head small {
  color: var(--muted);
}

.since-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.since-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  text-transform: none;
}

button.since-row:hover {
  background: var(--brand-soft);
}

.since-row > span:nth-child(2) {
  flex: 1;
}

.since-row i {
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}

.since-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.since-ico svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.since-more {
  margin-top: 8px;
}

.since-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.since-more .userlog {
  margin-top: 6px !important;
  font-size: 13px;
}

.since-none {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

#adm .since-row {
  min-height: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-weight: 500;
}

#adm button.since-row:hover {
  background: var(--brand-soft);
}

/* Monthly Report and Project Timelines (reports.js): project names read as links, not buttons. */
#adm .rpt td button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  text-transform: none;
}

#adm .rpt td button:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* =====================================================================
   Welcome after signing in (welcome.js)
   ===================================================================== */

.welcome {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 520px at 50% 40%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    var(--bg);
  color: var(--ink);
  cursor: pointer;
  animation: wl-in 0.35s ease both;
}

.welcome::backdrop {
  background: var(--bg);
}

.welcome.out {
  animation: wl-out 0.42s ease forwards;
}

.wl-in {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.wl-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 18px 50px -18px var(--brand);
  animation: wl-rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.wl-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--card);
}

.wl-mark svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wl-mark path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: splash-draw 0.8s 0.15s ease-out forwards;
}

.wl-place {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  animation: wl-up 0.6s 0.15s ease both;
}

.wl-hello {
  margin: 0;
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: none;
  animation: wl-up 0.7s 0.25s ease both;
}

.wl-line {
  min-height: 1.6em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  animation: wl-up 0.6s 0.45s ease both;
}

.wl-line.in {
  color: var(--ink);
  font-weight: 600;
  animation: wl-up 0.45s ease both;
}

.wl-dots::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: splash-dots 1.2s steps(4) infinite;
}

.wl-credit {
  position: absolute;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  animation: wl-up 0.6s 0.6s ease both;
}

.wl-credit span {
  font-weight: 500;
}

@keyframes wl-in {
  from {
    opacity: 0;
  }
}

@keyframes wl-out {
  to {
    opacity: 0;
    transform: scale(1.03);
  }
}

@keyframes wl-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.86);
  }
}

@keyframes wl-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome,
  .welcome *,
  .welcome *::after {
    animation: none !important;
  }

  .wl-mark path {
    stroke-dashoffset: 0;
  }
}

/* "Still there?" before signing out for going unused (idle.js) */
.idle-warn {
  width: min(380px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.idle-warn::backdrop {
  background: rgba(10, 20, 24, 0.45);
  backdrop-filter: blur(2px);
}

.idle-warn h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.idle-warn p {
  margin: 0 0 16px;
  line-height: 1.45;
}

.idle-left {
  font-variant-numeric: tabular-nums;
}

.idle-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Questions in the site's own style instead of the browser's confirm() and prompt() (ask.js) */
.ask-dlg {
  width: min(420px, calc(100vw - 32px));
  padding: 20px 20px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.ask-dlg::backdrop {
  background: rgba(10, 20, 24, 0.45);
  backdrop-filter: blur(2px);
}

.ask-text p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.ask-text p:first-child {
  font-weight: 650;
}

.ask-input {
  width: 100%;
  margin: 4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.ask-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.ask-acts button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

/* ---------- a private site's sign-in page (app.js privateGate) ---------- */
.private-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--brand) 18%, var(--bg)), var(--bg) 70%);
}

.private-gate[hidden] {
  display: none;
}

.pg-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 32px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.pg-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-2, var(--brand)), var(--brand));
}

.pg-mark img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: contain;
  background: var(--card);
}

.pg-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pg-card h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.pg-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pg-card .pg-msg {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--ink);
}

.pg-card button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 26px;
  border-radius: var(--btn-radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pg-card button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.pg-card .pg-only {
  margin-top: -4px;
  font-size: 12px;
}

.pg-credit {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.pg-credit span {
  opacity: 0.75;
}

/* Admin Center → Settings → Who Can See The Map */
.vis-opts {
  display: grid;
  gap: 10px;
  margin: 6px 0 12px;
}

.vis-opt {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}

.vis-opt:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
  background: var(--brand-soft);
}

.vis-opt.locked {
  cursor: default;
  opacity: 0.6;
}

.vis-opt input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.vis-ico {
  font-size: 20px;
  line-height: 1.1;
}

.vis-opt strong {
  display: block;
  font-size: 14px;
}

.vis-opt small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.vis-opt .vis-lock {
  color: var(--brand);
  font-weight: 650;
}

.vis-check {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--field);
  font-size: 13px;
}

/* Mixed: a staff-only listing's badge on its card */
.staff-only-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 85%, transparent);
  color: var(--card);
  font-size: 12px;
  font-weight: 700;
}

/* Keyboard shortcuts on one line, and not shown on touch screens, which have no keyboard. */
.quick-keys {
  white-space: nowrap;
}

@media (hover: none) and (pointer: coarse) {
  .quick-keys,
  .pal-foot {
    display: none;
  }
}

/* Who Can See The Map: the sign-in page's message */
.vis-note {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
}

.vis-note textarea {
  width: 100%;
  resize: vertical;
}

.vis-note small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

/* ---------- Import From A Spreadsheet ---------- */

.impwin .imp-body {
  padding-bottom: 0;
}

.imp-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.imp-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.imp-steps i {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
  font-style: normal;
}

.imp-steps li.now {
  color: var(--ink);
}

.imp-steps li.now i {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.imp-steps li.done i {
  border-color: var(--good);
  color: var(--good);
}

.imp-lead {
  max-width: 760px;
  margin: 14px 0;
  line-height: 1.5;
}

.imp-drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.imp-drop.over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.imp-drop p {
  margin: 0;
}

.imp-drop textarea {
  width: min(560px, 100%);
  font: 12px var(--mono);
}

.filebtn.primary {
  padding: 8px 18px;
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
  font-size: 14px;
}

.filebtn.primary:hover {
  background: var(--brand);
  filter: brightness(1.08);
}

.imp-file {
  margin-top: 16px;
}

.imp-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 12px;
}

.imp-pick .dq-in {
  flex: 1 1 220px;
  max-width: 420px;
}

.imp-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.imp-table {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.imp-table th,
.imp-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.imp-table th {
  background: var(--field);
  font-weight: 700;
}

.imp-warn {
  margin: 0 0 12px;
  padding: 10px 14px 10px 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.5;
}

.imp-warn-line {
  margin: 0 0 10px;
  color: var(--danger);
  font-size: 13px;
}

.imp-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}

.imp-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.imp-col.on {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}

.imp-col strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imp-col small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imp-col select,
.imp-val select {
  width: 100%;
  min-width: 0;
}

.imp-vals {
  margin: 0 0 18px;
}

.imp-vals h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.imp-val-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.imp-val {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.imp-val span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.imp-val small {
  color: var(--muted);
  white-space: nowrap;
}

.imp-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.45;
}

.imp-check input {
  margin-top: 2px;
}

.imp-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

#importer button.imp-kpi {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: left;
}

.imp-kpi b {
  font-size: 24px;
  line-height: 1.1;
}

.imp-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#importer .imp-kpi.k-added {
  border-left-color: var(--good);
}

#importer .imp-kpi.k-updates {
  border-left-color: var(--brand);
}

#importer .imp-kpi.k-same {
  border-left-color: var(--line);
}

#importer .imp-kpi.k-skipped {
  border-left-color: var(--fair);
}

/* The tab on show: outlined, its colour edge kept. */
#importer button.imp-kpi[aria-pressed='true'] {
  border-top-color: var(--brand);
  border-right-color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-soft);
}

.imp-list {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.imp-list > li {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.imp-list strong {
  display: block;
}

.imp-list small {
  display: block;
  color: var(--muted);
}

.imp-n {
  color: var(--muted);
  font: 600 11px var(--mono);
}

.imp-how {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--field);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.imp-list small.imp-maybe {
  color: var(--fair);
}

.imp-list small.imp-why {
  color: var(--danger);
}

.imp-diff {
  margin: 4px 0 0;
  padding: 0 0 0 16px;
}

.imp-diff s {
  color: var(--muted);
}

.imp-foot {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 16px -22px 0;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.imp-busy,
.imp-done {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}

.imp-busy p,
.imp-done p {
  margin: 0;
}

.imp-busy .dq-acts {
  justify-content: center;
}

.imp-big {
  font-size: 22px;
  font-weight: 800;
}

.imp-done .imp-foot {
  position: static;
  justify-content: center;
  margin: 8px 0 0;
  border: 0;
  background: none;
}

@media (max-width: 720px) {
  .imp-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .imp-col,
  .imp-val {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .imp-cols,
  .imp-val-grid {
    grid-template-columns: 1fr;
  }

  .imp-list > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .imp-foot {
    margin: 16px -12px 0;
    padding: 10px 12px;
  }
}

/* The window ends at its button bar; the file's own headings and values are shown as written. */
.insights.impwin {
  padding-bottom: 0;
}

.imp-table th,
.imp-col strong,
.imp-val span,
.imp-list strong {
  text-transform: none;
}

.imp-check {
  text-transform: none;
}

.imp-val-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.imp-val {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 1.2fr);
}

/* Long headings and samples shorten with "…" instead of widening the card. */
.imp-col > div,
.imp-val > span {
  min-width: 0;
}

@media (max-width: 720px) {
  .imp-cols,
  .imp-val-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .imp-val {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- CivMetryx Capital ---------- */

.cap-swatch {
  border: 2px solid #111827;
  border-radius: 50%;
  background: var(--c);
}

.cap-group .cap-off {
  opacity: 0.45;
}

.cap-progress li.now .dot {
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.cap-money,
.cap-expect {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cap-money h3,
.cap-expect h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cap-expect {
  border-color: var(--fair);
  background: color-mix(in srgb, var(--fair) 10%, transparent);
}

.cap-expect p {
  margin: 0;
  line-height: 1.45;
}

.cap-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}

.cap-total b {
  font-size: 22px;
}

.cap-total span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.cap-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.cap-bar i.spent,
.cap-legend i.spent {
  background: var(--brand);
}

.cap-bar i.committed,
.cap-legend i.committed {
  background: repeating-linear-gradient(135deg, var(--brand) 0 3px, color-mix(in srgb, var(--brand) 35%, transparent) 3px 6px);
}

.cap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cap-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cap-fund {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.cap-fund li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
}

.cap-fund i {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.55;
}

.cap-shift {
  display: block;
  font-size: 12px;
}

.cap-shift.later {
  color: var(--danger);
}

.cap-shift.sooner {
  color: var(--good);
}

.cap-flags {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.cap-flags li {
  padding: 6px 10px;
  border-left: 3px solid var(--fair);
  border-radius: 6px;
  background: color-mix(in srgb, var(--fair) 10%, transparent);
}

.cap-flags li.over,
.cap-flags li.overdue {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.cap-flags li.info {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

.cap-flags.small {
  margin: 0;
  font-size: 12px;
}

.cap-flags.small li {
  padding: 4px 8px;
}

.cap-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* The edit form */
.cap-form {
  width: min(760px, calc(100vw - 24px));
}

.cap-edit fieldset {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cap-edit legend {
  padding: 0 6px;
  color: var(--muted);
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.cap-grid .wide {
  grid-column: 1 / -1;
}

.cap-edit input,
.cap-edit select,
.cap-edit textarea {
  width: 100%;
  min-width: 0;
}

.cap-check {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 8px;
  font-size: 13px;
}

.cap-check input {
  width: auto;
}

.cap-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.cap-row.co {
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 2fr) auto;
}

.cap-hint {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

/* Admin Center → Capital Projects */
.cap-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.cap-kpi {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.cap-kpi b {
  font-size: 22px;
  line-height: 1.15;
}

.cap-kpi span {
  font-size: 12px;
  font-weight: 700;
}

.cap-kpi small {
  color: var(--muted);
  font-size: 12px;
}

.cap-kpi.warn {
  border-left-color: var(--danger);
}

.cap-tools {
  margin-bottom: 14px;
}

.cap-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cap-charts section,
.cap-spend {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cap-spend {
  margin-bottom: 14px;
  background: var(--brand-soft);
}

.cap-charts h3,
.cap-spend h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.cap-bars {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.cap-bars li {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.cap-bars span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cap-bars i {
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.cap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cap-filters input {
  flex: 1 1 240px;
}

.cap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cap-table th,
.cap-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.cap-table th {
  background: var(--field);
  font-size: 12px;
}

.cap-table .num {
  text-align: right;
  white-space: nowrap;
}

.cap-table small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.cap-table .link-btn {
  font-weight: 700;
  text-align: left;
}

.cap-phase {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cap-mini {
  display: block;
  width: 80px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.cap-mini i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.cap-ok {
  color: var(--good);
  font-weight: 700;
}

@media (max-width: 720px) {
  .cap-row,
  .cap-row.co {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .cap-bars li {
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr) auto;
  }
}

/* A capital project has five steps, not four. */
.progress.cap-progress {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.progress.cap-progress li {
  font-size: 11px;
}

/* Each bar runs the full width under its label and amount. */
.cap-bars li {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
}

.cap-bars i {
  grid-column: 1 / -1;
  grid-row: 2;
}

@media (max-width: 720px) {
  .cap-bars li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.cap-spend h3 {
  text-transform: none;
}

.cap-edit textarea {
  font: inherit;
  font-size: 14px;
}

/* ---------- CivMetryx Capital: Bond Report Card ---------- */

.bond-card .viz-top-acts button:not(.close) {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font-weight: 600;
}

.bond-body {
  max-width: 980px;
  padding-bottom: 20px;
}

.bond-lead {
  margin: 14px 0;
  font-size: 16px;
  line-height: 1.5;
}

.bond-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.bond-kpi {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.bond-kpi b {
  font-size: 26px;
  line-height: 1.1;
}

.bond-kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.bond-meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.bond-meter i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.bond-meter.good i {
  background: var(--good);
}

.bond-prop {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius-sm);
}

.bond-prop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
}

.bond-prop-head h3 {
  margin: 0;
  font-size: 18px;
}

.bond-prop-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  margin: 12px 0;
  font-size: 13px;
}

.bond-prop-meters span {
  font-weight: 600;
}

.bond-prop-meters small {
  color: var(--muted);
}

.bond-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.bond-projects {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bond-proj {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.bond-proj .link-btn {
  margin-right: 6px;
  font-weight: 700;
  text-align: left;
}

.bond-proj small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.bond-money {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  font-size: 13px;
}

.bond-body .later,
.bond-money .later {
  color: var(--danger);
}

.bond-body .sooner,
.bond-money .sooner {
  color: var(--good);
}

.bond-why {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.bond-foot {
  color: var(--muted);
  font-size: 12px;
}

.bond-admin {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.bond-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bond-admin-head h3 {
  margin: 0;
  font-size: 14px;
}

.bond-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bond-admin-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13px;
}

.bond-admin-card small {
  color: var(--muted);
}

.cap-row.bond-row {
  grid-template-columns: 64px minmax(0, 2fr) minmax(0, 1fr) auto;
}

.cap-group .cap-bond-link .name {
  font-weight: 700;
}

@media (max-width: 720px) {
  .cap-row.bond-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

/* ---------- CivMetryx Economic Development ---------- */

.econ-swatch {
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px var(--line);
}

.econ-utils {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.econ-utils li.off {
  color: var(--muted);
}

.econ-broker {
  margin: 6px 0;
  font-size: 13px;
}

.cap-acts .btn-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cap-acts .btn-link.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.econ-keen {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px dashed var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 13px;
}

.econ-keen h3,
.econ-board-wrap h3,
.econ-incs h3,
.econ-sites h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.econ-keen ul {
  margin: 0;
  padding-left: 18px;
}

.econ-board-wrap h3 small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.econ-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 12px;
  font-size: 13px;
}

.econ-checks .cap-check {
  padding: 0;
}

.econ-board-wrap,
.econ-incs,
.econ-sites {
  margin: 0 0 16px;
}

.econ-board {
  display: grid;
  grid-auto-columns: minmax(170px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.econ-col {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 90px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--field);
}

.econ-col-h {
  display: flex;
  justify-content: space-between;
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
}

.econ-col-h span {
  color: var(--muted);
}

#adm button.econ-pcard {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: var(--card);
  text-align: left;
  font-size: 12px;
}

#adm button.econ-pcard.late {
  border-left-color: var(--danger);
}

.econ-pcard b {
  font-size: 13px;
}

.econ-pcard small {
  color: var(--muted);
}

.econ-pcard small.econ-next {
  color: var(--ink);
}

.econ-pcard.late small.econ-next {
  color: var(--danger);
}

.econ-lost summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.econ-lost-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.econ-board-wrap h3 small {
  text-transform: none;
}

#adm button.econ-pcard {
  text-transform: none;
}

/* ---------- importer: an online map service ---------- */

.imp-service {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.imp-service p {
  margin: 0;
  font-size: 13px;
}

.imp-service .dq-acts {
  flex-wrap: nowrap;
}

.imp-service input {
  flex: 1;
  min-width: 0;
  font: inherit;
}

/* ---------- Build A Demo City ---------- */

.demowin {
  max-width: 640px;
}

.demo-found {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--brand-soft);
}

.demo-found small,
.demo-opt small {
  color: var(--muted);
  font-size: 12px;
}

.demo-opts {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.demo-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.demo-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.demo-opt input {
  margin-top: 4px;
}

.demo-opt span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.demo-opt strong {
  overflow-wrap: anywhere;
}

.demo-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.demo-log a {
  overflow-wrap: anywhere;
}

.demo-err {
  margin: 8px 0 0;
  color: var(--poor);
  font-size: 13px;
}

/* ---------- What's New: My Areas ---------- */

.nw-area {
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}

.nw-area:last-child {
  border-bottom: 0;
}

.nw-area h4 small {
  color: var(--muted);
  font-weight: 400;
}

.nw-sub {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nw-area-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.nw-area-mail {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}

.adm-feedcities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 8px;
}

/* ---------- what kind of map this is (beside the site's name) ---------- */

.mode-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.mode-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}

.mode-tag.mode-city {
  color: var(--brand);
}

.mode-tag.mode-market {
  color: var(--accent);
}

.mode-tag.mode-demo {
  color: var(--fair);
}

.mode-tag.mode-region {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: transparent;
}

/* On a phone the tags sit on the line under the name. */
@media (max-width: 640px) {
  .mode-tags {
    display: flex;
    margin: 4px 0 0;
  }
}

/* ---------- comfort on phones and touch screens ---------- */

.progress small {
  font-size: 11px;
}

.viz-top-acts .primary {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .viz-top-acts .primary {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* A finger needs a bigger target than a mouse: about 40 px for anything tapped. */
@media (pointer: coarse) {
  .close,
  .bnd-x,
  .viz-top-acts .close {
    min-width: 40px;
    min-height: 40px;
  }

  .dq-acts > button,
  .dq-acts > a,
  .flt-acts button,
  .flt-row button,
  .imp-foot button,
  .nw-area-acts button,
  .adm-acts button,
  .viz-tablebar button,
  .viz-tablebar select {
    min-height: 40px;
  }

  .layers .use,
  .layers .row {
    min-height: 36px;
  }

  #uses-all {
    padding: 8px 6px;
  }

  .maplibregl-ctrl-group button {
    width: 36px !important;
    height: 36px !important;
  }

  #about-open,
  #today {
    min-width: 36px;
    min-height: 36px;
  }
}

/* ---------- tools with words (wide screens), and the phone tab bar ---------- */

.tool-label {
  display: none;
}

@media (min-width: 1440px) {
  .bar {
    width: min(1200px, calc(100vw - 250px));
  }

  .tools button:has(.tool-label:not(.wide)) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 0 10px;
  }

  .tool-label:not(.wide) {
    display: inline;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }
}

/* Wider still: Suggest, Share and Edit get their words too, with a wider bar to fit them. */
@media (min-width: 1600px) {
  .bar {
    width: min(1400px, calc(100vw - 250px));
  }

  .tools button:has(.tool-label) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 0 10px;
  }

  .tool-label.wide {
    display: inline;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }
}

.tabbar {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --tabbar: 58px;
  }

  html:not(.embed) .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    display: flex;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, 0.45);
  }

  .tabbar button {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .tabbar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .tabbar button[aria-current='page'] {
    color: var(--brand);
  }

  .tab-dot {
    position: absolute;
    top: 8px;
    left: calc(50% + 7px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }

  /* Those four live in the tab bar now. */
  html:not(.embed) .bar .tools #news-open,
  html:not(.embed) .bar .tools #list-open,
  html:not(.embed) .bar .tools #filters-open,
  html:not(.embed) .bar .tools #insights-open {
    display: none;
  }

  /* Everything that sits at the bottom moves up above the tab bar. */
  html:not(.embed) .timeline,
  html:not(.embed) #detail,
  html:not(.embed) #filters,
  html:not(.embed) #editbar,
  html:not(.embed) #selbar,
  html:not(.embed) #only-bar,
  html:not(.embed) #toast,
  html:not(.embed) .undo-toast,
  html:not(.embed) .maplibregl-ctrl-bottom-right,
  html:not(.embed) .maplibregl-ctrl-bottom-left {
    translate: 0 calc(-1 * var(--tabbar));
  }

  html:not(.embed) #listview {
    bottom: calc(88px + var(--tabbar));
  }
}

/* ---------- a project's card: picture, what happens next, key numbers, actions ---------- */

.card-hero {
  display: grid;
  place-items: center;
  height: 112px;
  margin: 0 0 10px;
  border-radius: 12px;
  background: var(--field);
}

.card-hero svg {
  width: 160px;
  height: 100px;
}

.card-next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.card-next::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.card-next.next {
  background: color-mix(in srgb, var(--good) 13%, transparent);
  color: var(--good);
}

.card-next.done {
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: var(--brand);
}

.card-next.wait {
  background: var(--field);
  color: var(--muted);
}

.card-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
}

.card-kpis div {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--field);
}

.card-kpis b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.card-kpis span {
  color: var(--muted);
  font-size: 11px;
}

.card-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.card-acts > button:not(.follow-btn),
.card-acts > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.card-acts > button:not(.follow-btn):hover,
.card-acts > a:hover {
  background: var(--field);
}

.card-acts .follow-btn {
  margin: 0;
}

.card-acts svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* On a phone the card is a sheet over the tab bar: a peek first, the whole card on a tap or swipe up. */
.sheet-handle {
  display: none;
}

@media (max-width: 720px) {
  html:not(.embed) #detail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - 166px - var(--tabbar));
    border-radius: 18px 18px 0 0;
    transition: max-height 0.28s ease;
  }

  html:not(.embed) #detail[data-sheet='peek'] {
    max-height: 214px;
    overflow: hidden;
  }

  html:not(.embed) #detail[data-sheet='peek'] .card-hero,
  html:not(.embed) #detail[data-sheet='peek'] .gallery {
    display: none;
  }

  html:not(.embed) .sheet-handle {
    position: relative;
    display: block;
    width: 64px;
    height: 20px;
    margin: -8px auto 2px;
  }

  .sheet-handle::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 14px;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.embed) #detail {
    transition: none;
  }
}

/* ---------- Layers: quick views and the shorter types list ---------- */

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
}

.presets .chip {
  padding: 4px 10px;
  font-size: 12px;
}

#uses.short .use.extra {
  display: none;
}

.uses-more {
  display: block;
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 600;
}

/* A view suggested by the search words, above the projects found. */
.results li.sugg span {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- loading: soft placeholder lines instead of "Loading…" (the words stay for screen readers) ---------- */

p.loading {
  position: relative;
  min-height: 58px;
  margin: 6px 0;
  color: transparent;
}

p.loading::before,
p.loading::after {
  content: '';
  position: absolute;
  left: 0;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--field) 0%, color-mix(in srgb, var(--field) 55%, var(--card)) 50%, var(--field) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}

p.loading::before {
  top: 4px;
  width: min(420px, 90%);
}

p.loading::after {
  top: 26px;
  width: min(300px, 65%);
  box-shadow: 0 22px 0 -0 var(--field);
}

@keyframes skel {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  p.loading::before,
  p.loading::after {
    animation: none;
  }
}

/* ---------- Today (Admin Center): shortcuts and watch areas ---------- */

.today-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}

.today-quick button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font-size: 13px;
  font-weight: 650;
}

.today-quick button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.today-areas {
  margin: 0 0 14px;
}

.today-areas h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.today-areas ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.today-areas button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
}

.today-areas small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Today: Get Set Up ---------- */

.setup {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.setup-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.setup-h h3 {
  margin: 0;
  font-size: 16px;
}

.setup-h span {
  color: var(--muted);
  font-size: 13px;
}

.setup-h .link-btn {
  margin-left: auto;
  font-size: 12px;
}

.setup ul {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.setup li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}

.setup li label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setup li.done .setup-label {
  color: var(--muted);
}

.setup li.done small {
  display: none;
}

.setup li label > span:not(.setup-mark) {
  display: grid;
  gap: 1px;
}

.setup li small {
  color: var(--muted);
  font-size: 12px;
}

/* A row that checks itself: a ring until it is done, then a tick. */
.setup-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.setup-mark.ok {
  border-color: var(--good, #1a7f37);
  background: var(--good, #1a7f37);
}

.setup li input[type='checkbox'] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
}

.setup-foot {
  margin: 8px 0 0;
  font-size: 12px;
}

/* ---------- guided tours ---------- */

/* About → Take A Quick Tour: the same size as every other button. */
#tour-map {
  padding: 8px 14px;
  font-weight: 650;
}

.tour-ring {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(10, 20, 22, 0.42);
  pointer-events: none;
  transition: all 0.25s ease;
}

.tour-note {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  transition: top 0.25s ease, left 0.25s ease;
}

.tour-note h3 {
  margin: 2px 0 6px;
  font-size: 16px;
}

.tour-note p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
}

.tour-step {
  color: var(--muted);
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tour-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-ring,
  .tour-note {
    transition: none;
  }
}

/* ---------- motion: small and purposeful, and none when the device asks for less ---------- */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(6px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .detail:not([hidden]),
  .listpanel:not([hidden]),
  .fltpanel:not([hidden]) {
    animation: card-in 0.22s ease-out;
  }

  dialog.about[open],
  dialog.insights[open] {
    animation: pop-in 0.2s ease-out;
  }

  .tabbar button[aria-current='page'] svg {
    animation: card-in 0.25s ease-out;
  }
}

/* ---------- the sandbox: a frame round the page and a bar on every screen ---------- */

body.in-sandbox::after {
  position: fixed;
  inset: 0;
  z-index: 60;
  border: 4px solid var(--sandbox, #b45309);
  pointer-events: none;
  content: "";
}

.sandbox-bar {
  position: fixed;
  top: 72px;
  left: 50%;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  width: min(720px, calc(100vw - 24px));
  padding: 8px 10px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--sandbox, #b45309) 40%, var(--line));
  border-left: 6px solid var(--sandbox, #b45309);
  border-radius: 12px;
  background: color-mix(in srgb, var(--sandbox, #b45309) 8%, var(--card));
  box-shadow: var(--shadow);
  font-size: 13px;
  transform: translateX(-50%);
}

.sandbox-bar strong {
  color: var(--sandbox, #b45309);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sandbox-bar span {
  flex: 1 1 260px;
  min-width: 0;
}

.sandbox-back {
  padding: 6px 10px;
  border-radius: var(--btn-radius);
  background: var(--sandbox, #b45309);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

body.in-sandbox .nvt-notices {
  top: 132px;
}

.mode-tag.mode-sandbox {
  border-color: var(--sandbox, #b45309);
  background: var(--sandbox, #b45309);
  color: #fff;
}

/* Phones: the Sandbox tag and the frame say it; the city menu has the way back. */
@media (max-width: 720px) {
  .sandbox-bar {
    display: none;
  }
}

/* ---------- the frame (look.js, kit.css): a header, a rail of tools, docked panels ----------
   Everywhere but a map embedded on another site (html.embed), which keeps the bar above. */

html:not(.nl) .nl-only {
  display: none;
}

html.nl {
  --k-rail: 80px;
  --k-panel: 312px;
  --k-card: 400px;
  /* Where the map starts: after the rail, and after the panel beside it when one is open. */
  --kx: var(--k-rail);
  --font: var(--k-font);
}

html.nl[data-kp='layers'],
html.nl[data-kp='filters'] {
  --kx: calc(var(--k-rail) + var(--k-panel));
}

/* One heading style for every panel beside the rail: Layers, Filters and the list. */
.k-panel-head,
html.nl #filters .flt-head,
html.nl #listview .lv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  margin: 0;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--k-line-2);
  font-family: var(--k-font);
}

.k-panel-head h2,
html.nl #filters .flt-head strong,
html.nl #listview .lv-head h2 {
  margin: 0;
  color: var(--k-ink);
  font: 700 15px/1.2 var(--k-font);
  letter-spacing: 0;
  text-transform: none;
}

html.nl #listview .lv-head small {
  color: var(--k-muted);
  font: 500 13px var(--k-font);
}

.k-x,
html.nl #filters .flt-head .close,
html.nl #listview .lv-head .bnd-x {
  position: static;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--btn-radius);
  background: none;
  color: var(--k-muted);
  font: 400 22px/1 var(--k-font);
  cursor: pointer;
}

.k-x:hover,
html.nl #filters .flt-head .close:hover,
html.nl #listview .lv-head .bnd-x:hover {
  background: var(--k-sunk);
  color: var(--k-ink);
}

html.nl .bar {
  display: none;
}

html.nl #k-head {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 9;
}

html.nl .k-brand .brand {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

html.nl .k-brand .brand > div {
  flex: 1;
  min-width: 0;
}

html.nl .k-brand .brand > .cm-logo,
html.nl .k-brand .brand > .brand-logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

html.nl .k-brand .brand h1,
html.nl .k-brand #count {
  margin: 0;
  font-family: var(--k-font);
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

html.nl .k-brand .city-btn {
  color: var(--k-ink);
  font: 700 15px/1.2 var(--k-font);
  letter-spacing: 0;
  text-transform: none;
}

html.nl .k-brand #count {
  color: var(--k-muted);
  font-size: 12px;
  white-space: nowrap;
}

html.nl #k-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}

html.nl #k-search .search input {
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--k-line);
  border-radius: var(--btn-radius);
  background: var(--k-sunk) no-repeat 12px 50% / 16px url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%235f6c72%22 stroke-width=%222%22 stroke-linecap=%22round%22%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%227%22/%3E%3Cpath d=%22m20 20-3.5-3.5%22/%3E%3C/svg%3E');
  font: 14px var(--k-font);
}

html.nl #k-search .search input:focus {
  border-color: var(--k-accent);
  outline: 3px solid var(--k-accent-soft);
  background-color: var(--k-surface);
}

html.nl #k-search .results {
  z-index: 12;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-surface);
  box-shadow: var(--k-shadow);
}

/* Header buttons: Suggest, Share, Edit, Present, and the sign-in and account menus. */
html.nl .k-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--k-line);
  border-radius: var(--btn-radius);
  background: var(--k-surface);
  color: var(--k-ink);
  font: 600 13px var(--k-font);
  white-space: nowrap;
  cursor: pointer;
}

html.nl .k-tool[hidden] {
  display: none;
}

html.nl .k-tool:hover {
  background: var(--k-sunk);
}

html.nl #k-acts .k-tool[aria-pressed='true'] {
  border-color: var(--k-accent);
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

html.nl .k-tool svg,
html.nl .k-rail-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.nl .k-tool svg {
  width: 17px;
  height: 17px;
}

html.nl .k-tool .tool-label {
  display: inline;
  font-size: 13px;
}

html.nl .k-present {
  color: var(--k-accent-ink);
}

html.nl #k-acts .adminbar {
  position: relative;
  inset: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.nl #k-acts .adminbar[hidden] {
  display: none;
}

html.nl #k-acts .adminbar > button {
  height: 36px;
  border: 1px solid var(--k-line);
  font-family: var(--k-font);
}

/* The rail: Layers, then the map's own tools. */
html.nl #k-rail {
  position: fixed;
  top: var(--k-head);
  bottom: 0;
  left: 0;
  z-index: 8;
  width: var(--k-rail);
}

html.nl .k-rail-btn {
  width: 100%;
  height: auto;
  box-shadow: none;
}

html.nl .k-rail-btn .tool-label {
  display: block;
  font-size: 11.5px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

html.nl .k-rail-btn svg {
  width: 21px;
  height: 21px;
}

html.nl .k-rail-btn[aria-pressed='true'],
html.nl .k-rail-btn.on {
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

html.nl .k-rail-btn .count-badge {
  position: absolute;
  top: 4px;
  right: 10px;
}

/* The map sits beside the frame instead of under it. */
html.nl #map {
  top: var(--k-head);
  left: var(--kx);
}

/* Layers: docked beside the rail, opened and closed from the rail's Layers button or its ×. */
html.nl .layers {
  padding: 0;
  top: var(--k-head);
  bottom: 0;
  left: var(--k-rail);
  z-index: 7;
  width: var(--k-panel);
  max-height: none;
  margin: 0;
  overflow-y: auto;
  border: 0;
  border-right: 1px solid var(--k-line);
  border-radius: 0;
  background: var(--k-surface);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.nl:not([data-kp='layers']) .layers {
  display: none;
}

/* Docked, Layers is never folded: its heading has a × instead (a phone keeps the fold). */
html.nl .layers .panel-head {
  display: none;
}

html.nl #layers-body {
  padding: 12px 14px 20px;
}

/* Base map choice, at the top of Layers. */
.bm-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0 2px;
}

.bm {
  display: grid;
  gap: 4px;
  padding: 4px 4px 6px;
  border: 1px solid var(--k-line);
  border-radius: var(--btn-radius);
  background: var(--k-surface);
  color: var(--k-ink-2);
  font: 600 12px var(--k-font);
  cursor: pointer;
}

.bm svg {
  width: 100%;
  height: 34px;
  border-radius: 6px;
}

.bm[aria-checked='true'] {
  border-color: var(--k-accent);
  box-shadow: 0 0 0 2px var(--k-accent-soft);
  color: var(--k-accent-ink);
}

.bm-note {
  margin: 6px 0 2px;
  color: var(--k-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Filters open in the same docked spot as Layers. */
html.nl #filters {
  top: var(--k-head);
  bottom: 0;
  left: var(--k-rail);
  z-index: 7;
  width: var(--k-panel);
  max-height: none;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--k-line);
  border-radius: 0;
  background: var(--k-surface);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.nl #filters-body {
  padding: 12px 16px 20px;
}

/* The list: a wide table over the map, beside the rail, clear of the card and the timeline. */
html.nl #listview {
  top: calc(var(--k-head) + 12px);
  right: 12px;
  bottom: 92px;
  left: calc(var(--kx) + 12px);
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-surface);
  box-shadow: var(--k-shadow);
}

html.nl body:has(#detail:not([hidden])) #listview {
  right: calc(var(--k-card) + 12px);
}

html.nl #listview .lv-tools,
html.nl #listview .lv-note {
  margin-right: 16px;
  margin-left: 16px;
}

html.nl #listview .lv-tools {
  margin-top: 12px;
}

html.nl #listview .lv-tools input[type='search'] {
  height: 36px;
  border: 1px solid var(--k-line);
  border-radius: var(--btn-radius);
  background: var(--k-sunk);
  font: 14px var(--k-font);
}

html.nl #listview .lv-wrap {
  margin: 0 8px 8px;
}

/* The project card: docked on the right. */
html.nl #detail {
  top: var(--k-head);
  right: 0;
  bottom: 0;
  width: var(--k-card);
  max-height: none;
  border: 0;
  border-left: 1px solid var(--k-line);
  border-radius: 0;
  background: var(--k-surface);
  box-shadow: -8px 0 24px -18px rgb(28 42 47 / 40%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Floating over the map: the timeline, edit tools and selection, clear of the docked panels. */
html.nl .timeline,
html.nl .editbar,
html.nl .selbar {
  border: 1px solid var(--k-line);
  background: var(--k-surface);
  box-shadow: var(--k-shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.nl .timeline {
  bottom: 16px;
  left: calc(var(--kx) + 16px);
  border-radius: var(--k-radius);
}

/* The editing bar sits just above the timeline, so it never runs under the card or off screen. */
html.nl .editbar {
  bottom: 84px;
  left: calc(var(--kx) + 16px);
  max-width: calc(100vw - var(--kx) - 32px);
}

html.nl body:has(#detail:not([hidden])) .editbar {
  max-width: calc(100vw - var(--kx) - var(--k-card) - 32px);
}

/* Narrower screens: the header's buttons keep their icons and lose their words. */
html.nl .k-brand #mode-tags {
  flex-wrap: nowrap;
  white-space: nowrap;
}

html.nl #k-brand {
  flex: 0 1 auto;
  max-width: 340px;
}

@media (max-width: 1279px) {
  html.nl .k-tool {
    justify-content: center;
    width: 36px;
    padding: 0;
  }

  html.nl .k-tool > span,
  html.nl .k-tool .tool-label,
  html.nl #k-acts .adminbar > button > span,
  html.nl .k-brand #mode-tags {
    display: none;
  }

  html.nl #k-brand {
    max-width: 240px;
  }
}

html.nl .selbar {
  left: calc(50% + var(--kx) / 2);
}

html.nl body:has(#detail:not([hidden])) .maplibregl-ctrl-top-right,
html.nl body:has(#detail:not([hidden])) .maplibregl-ctrl-bottom-right {
  right: var(--k-card);
}

html.nl dialog.card {
  border: 1px solid var(--k-line);
  border-radius: 16px;
  background: var(--k-surface);
  font-family: var(--k-font);
}

/* Form labels as in the console: quiet Title Case, not small capitals. */
html.nl .login label:not(.check),
html.nl .userform > label:not(.check) {
  color: var(--k-ink-2);
  font: 600 13px var(--k-font);
  letter-spacing: 0;
  text-transform: none;
}

/* Headings in Title Case like every other window, not shouted in capitals. */
html.nl #about h2,
html.nl #news h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

html.nl dialog::backdrop {
  background: rgb(28 42 47 / 28%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ---------- Focus: everything but one project dims ---------- */

.k-focus {
  position: fixed;
  top: calc(var(--k-head) + 12px);
  left: calc(var(--kx) + (100vw - var(--kx) - var(--k-card)) / 2);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 50vw;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: var(--k-ink);
  color: #fff;
  font: 600 13px var(--k-font);
  box-shadow: var(--k-shadow);
  translate: -50% 0;
}

.k-focus[hidden] {
  display: none;
}

.k-focus svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.k-focus span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-focus button {
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 16%);
  color: #fff;
  font: 700 12px var(--k-font);
  cursor: pointer;
}

html.k-focusing .card-acts > .k-focus-btn {
  border-color: var(--k-accent);
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

/* ---------- Present: the map full screen for a meeting ---------- */

html.presenting #k-head,
html.presenting #k-rail,
html.presenting .layers,
html.presenting #filters,
html.presenting #listview,
html.presenting .timeline,
html.presenting .editbar,
html.presenting .selbar,
html.presenting .tabbar,
html.presenting .k-focus,
html.presenting .maplibregl-ctrl-top-right,
html.presenting .maplibregl-ctrl-top-left,
html.presenting #toast {
  display: none !important;
}

html.presenting #map {
  inset: 0;
}

html.presenting #map canvas {
  cursor: none;
}

html.presenting #detail {
  top: 24px;
  right: 24px;
  bottom: auto;
  width: 460px;
  max-height: calc(100vh - 140px);
  border: 1px solid var(--k-line);
  border-radius: 18px;
  box-shadow: var(--k-shadow);
  font-size: 17px;
}

html.presenting #detail h2 {
  font-size: 30px;
  line-height: 1.15;
}

.k-present-ui[hidden] {
  display: none;
}

.kp-title {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 9;
  display: grid;
  gap: 4px;
  padding: 16px 22px;
  border-radius: 16px;
  background: rgb(255 255 255 / 92%);
  color: var(--k-ink);
  font-family: var(--k-font);
  box-shadow: var(--k-shadow);
}

.kp-title strong {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.kp-title span {
  color: var(--k-muted);
  font-size: 15px;
}

.kp-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--k-ink);
  color: #fff;
  font: 600 14px var(--k-font);
  box-shadow: var(--k-shadow);
  translate: -50% 0;
}

.kp-bar button {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font: 700 20px/1 var(--k-font);
  cursor: pointer;
}

.kp-bar button:hover {
  background: rgb(255 255 255 / 24%);
}

.kp-bar .kp-exit {
  font-size: 14px;
}

.kp-n {
  min-width: 150px;
  padding: 0 8px;
  text-align: center;
}

/* A laser pointer that follows the mouse. */
.kp-pointer {
  position: fixed;
  top: -9px;
  left: -9px;
  z-index: 10;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 4px rgb(255 59 48 / 30%), 0 0 22px 6px rgb(255 59 48 / 55%);
  pointer-events: none;
}

body:has(.kp-bar:hover) .kp-pointer,
body:has(#detail:hover) .kp-pointer {
  display: none;
}

/* ---------- the new look on a phone: a compact header, the tab bar, sheets ---------- */

@media (max-width: 720px) {
  html.nl,
  html.nl[data-kp='layers'] {
    --k-head: 104px;
    --kx: 0px;
  }

  html.nl .k-brand .brand .name-long {
    display: none;
  }

  html.nl .k-brand .brand .name-short {
    display: inline;
  }

  html.nl .k-brand #mode-tags {
    display: none;
  }

  html.nl #k-head {
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 10px;
    padding: 8px 12px;
  }

  html.nl #k-brand {
    flex: 1;
    min-width: 0;
  }

  html.nl #k-search {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
  }

  html.nl #k-rail,
  html.nl .k-present,
  html.nl .k-tool .tool-label,
  html.nl .k-tool > span {
    display: none;
  }

  html.nl .k-tool {
    justify-content: center;
    width: 36px;
    padding: 0;
  }

  html.nl #k-acts .adminbar > button > span {
    display: none;
  }

  /* Layers: its own folding card under the header, as before. */
  html.nl .layers,
  html.nl:not([data-kp='layers']) .layers {
    display: block;
    top: calc(var(--k-head) + 8px);
    bottom: auto;
    left: 8px;
    width: min(280px, calc(100vw - 16px));
    max-height: calc(100dvh - var(--k-head) - var(--tabbar) - 120px);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    box-shadow: var(--k-shadow);
  }

  /* Filters or the list cover it anyway; one thing at a time here too. */
  html.nl[data-kp='filters'] .layers,
  html.nl[data-kp='list'] .layers {
    display: none;
  }

  html.nl .layers .panel-head {
    display: flex;
    padding: 10px 12px 10px 16px;
    color: var(--k-ink);
    font: 700 15px var(--k-font);
    letter-spacing: 0;
    text-transform: none;
  }

  html.nl .layers .k-panel-head {
    display: none;
  }

  html.nl #layers-body {
    padding: 0 12px 12px;
  }

  html.nl #filters {
    top: calc(var(--k-head) + 8px);
    bottom: auto;
    left: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - var(--k-head) - var(--tabbar) - 24px);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    translate: none;
  }

  /* On a phone the list is a full sheet down to the tab bar. */
  html.nl #listview {
    top: calc(var(--k-head) + 8px);
    right: 8px;
    bottom: calc(var(--tabbar) + 8px);
    left: 8px;
    z-index: 9;
  }

  html.nl #detail {
    top: auto;
    width: 100%;
    border: 1px solid var(--k-line);
    border-radius: 18px 18px 0 0;
  }

  html.nl body:has(#detail:not([hidden])) .maplibregl-ctrl-top-right,
  html.nl body:has(#detail:not([hidden])) .maplibregl-ctrl-bottom-right {
    right: 0;
  }

  html.nl .timeline {
    bottom: 8px;
    left: 8px;
  }

  html.nl .tabbar {
    border-top-color: var(--k-line);
    background: var(--k-surface);
    font-family: var(--k-font);
  }

  html.nl .tabbar button[aria-current='page'] {
    color: var(--k-accent-ink);
  }

  html.nl .k-focus {
    left: 50%;
    max-width: calc(100vw - 24px);
  }
}

/* ---------- a listing's History (history.js) ---------- */

.hist-dlg {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--ribbon) top / 100% 4px no-repeat, var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.hist {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.hist header,
.hist footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
}

.hist footer {
  justify-content: flex-end;
  padding: 10px 20px 16px;
  border-top: 1px solid var(--line);
}

.hist h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.hist-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hist-x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.hist-body {
  overflow: auto;
  padding: 0 20px 12px;
}

.hist-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hist-list > li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hist-row > div {
  display: grid;
  flex: 1;
  gap: 1px;
}

.hist-row small {
  color: var(--muted);
  font-size: 12px;
}

.hist-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.hist-detail {
  margin: 8px 0 0 20px;
  font-size: 13px;
}

.hist-detail ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.hist-empty {
  margin: 8px 0;
  font-weight: 600;
}

/* Email The Report (Monthly Report). */
.rpt-mail {
  width: min(520px, calc(100vw - 32px));
}

.rpt-mail h3 {
  margin: 0 0 12px;
}

.rpt-mail form > label {
  margin-bottom: 10px;
}

.rpt-mail-preview pre {
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft, rgba(0, 0, 0, 0.04));
  font-size: 12px;
  white-space: pre-wrap;
}

.rpt-mail-err {
  color: var(--bad, #b42318);
  font-size: 13px;
}

/* Today: a one-line reminder with its button (last month's report ready to email). */
.work-nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--card);
  font-size: 14px;
}

/* Data Quality → Suggested Fixes In Bulk: one row per check, with its example and buttons. */
.dq-grow.dq-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  cursor: default;
}

.dq-bulk > span:not(.dq-lvl) {
  display: grid;
  flex: 1 1 220px;
  gap: 2px;
}

.dq-bulk small {
  color: var(--muted);
  font-size: 12px;
}

/* Capital Projects → Dig Once. */
.cap-dig {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--card);
}

.cap-dig h3 {
  margin: 0 0 4px;
}

.cap-dig > ul {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.cap-dig > ul > li > small {
  margin-left: 8px;
  color: var(--muted);
}

.cap-dig ul ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.cap-dig ul ul small {
  color: var(--muted);
}

/* ---------- Fiscal Impact (fiscal.js) ---------- */

.fis-note {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--soft, rgba(0, 0, 0, 0.04));
  color: var(--muted);
  font-size: 13px;
}

.fis-years {
  margin: 16px 0;
}

.fis-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 8px 4px 0;
  border-bottom: 1px solid var(--line);
}

.fis-col {
  display: grid;
  flex: 1;
  grid-template-rows: 1fr auto auto;
  height: 100%;
  text-align: center;
}

.fis-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.fis-bars i {
  width: 18px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.fis-bars i.rev,
.fis-key .rev {
  background: var(--good, #1a7f37);
}

.fis-bars i.cost,
.fis-key .cost {
  background: var(--muted, #8a8f98);
}

.fis-col small {
  color: var(--muted);
  font-size: 11px;
}

.fis-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.fis-key span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.fis-table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.fis-table th,
.fis-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.fis-table .num {
  text-align: right;
}

.fis-top {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.fis-top small {
  display: block;
  color: var(--muted);
}

.fis-set {
  margin: 14px 0;
}

.fis-set > summary {
  font-weight: 650;
  cursor: pointer;
}

/* A long category line (category · type) breaks evenly instead of leaving one word on its own row. */
.eyebrow {
  text-wrap: balance;
}

/* The staff menu's icons: one per item, so the list can be scanned at a glance. */
.menu.pop button:has(> .mi) {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu.pop .mi {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.menu.pop button:hover .mi {
  opacity: 1;
}

.menu.pop button .quick-keys {
  margin-left: auto;
}

/* Data Tools: Bulk Editor, Import and Find Duplicates, folded into one line of the staff menu. */
.menu-sub > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.menu-sub > summary::-webkit-details-marker {
  display: none;
}

.menu-sub > summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 11px;
  opacity: 0.6;
  transition: transform 0.15s;
}

.menu-sub[open] > summary::after {
  transform: rotate(90deg);
}

.menu-sub > summary:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.menu-sub > summary .mi {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.menu-sub[open] > button {
  padding-left: 26px;
}

/* Present is for signed-in city staff: until then it is not on the page at all. */
#present-open[hidden] {
  display: none !important;
}
