/* CivMetryx, by nVisionTeK LLC: the finishing layer.
 *
 * Loaded after style.css and kit.css. It does not change what anything is or where it goes:
 * it makes the same screens feel finished. One set of shadows, one easing for every move,
 * quiet scrollbars, figures that line up, loading that shows the shape of what is coming, a
 * welcome for a map with nothing on it yet, and clean printing.
 */

:root {
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.16s;
  --elev-1: 0 1px 2px rgb(40 30 10 / 6%), 0 1px 3px rgb(40 30 10 / 5%);
  --elev-2: 0 2px 4px -1px rgb(40 30 10 / 7%), 0 10px 24px -8px rgb(40 30 10 / 14%);
  --elev-3: 0 6px 12px -4px rgb(40 30 10 / 9%), 0 28px 56px -14px rgb(40 30 10 / 28%);
}

html {
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Figures line up in tiles, tables and charts. */
.viz-num,
.cap-kpi b,
.rpt-kpi b,
.num,
td.num,
th.num,
.fis-table td,
.count,
.n {
  font-variant-numeric: tabular-nums;
}

/* ---------- movement ---------- */

button,
.card-acts > a,
.chip,
.row,
.tile,
.viz-tile {
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

button:active:not(:disabled) {
  transform: translateY(0.5px);
}

button.primary {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), var(--elev-1);
}

button.primary:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), var(--elev-2);
}

.card-acts > button:not(.follow-btn):hover,
.card-acts > a:hover {
  box-shadow: var(--elev-1);
}

dialog {
  box-shadow: var(--elev-3);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- quiet scrollbars ---------- */

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 38%, transparent) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 58%, transparent) padding-box;
}

/* ---------- loading shows the shape of what is coming ----------
 * Every "Loading…" line in the Admin Center and the tools becomes a few shimmering lines. The
 * words stay in the page for screen readers; only their color is taken away. */

.loading[role='status'] {
  position: relative;
  min-height: 92px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 10px;
  color: transparent !important;
  background:
    linear-gradient(var(--field), var(--field)) 0 0 / 58% 14px no-repeat,
    linear-gradient(var(--field), var(--field)) 0 28px / 92% 14px no-repeat,
    linear-gradient(var(--field), var(--field)) 0 56px / 76% 14px no-repeat;
  user-select: none;
}

.loading[role='status']::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, color-mix(in srgb, var(--card) 80%, transparent) 50%, transparent 75%);
  content: '';
  animation: skel-sweep 1.3s linear infinite;
  transform: translateX(-100%);
}

@keyframes skel-sweep {
  to {
    transform: translateX(100%);
  }
}

/* ---------- a map with nothing on it yet ---------- */

.empty-city {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 90px 16px 16px;
  pointer-events: none;
}

.empty-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 420px;
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: var(--elev-3);
  text-align: center;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: empty-rise 0.5s var(--ease);
}

.empty-card h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.empty-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--accent);
}

.empty-ico svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.empty-acts button {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font-weight: 650;
}

.empty-acts button.primary {
  border-color: var(--accent);
}

@keyframes empty-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---------- printing ---------- */

@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  table,
  .card,
  .rpt-kpi,
  .cap-kpi,
  .viz-tile {
    break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  /* Print This Card: only the project card, full width, no map. */
  body.print-card > *:not(#detail):not(script):not(style) {
    display: none !important;
  }

  body.print-card #detail {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body.print-card #detail .card-acts,
  body.print-card #detail .det-quick,
  body.print-card #detail .actions,
  body.print-card #detail #detail-close,
  body.print-card #detail [data-q],
  body.print-card #detail button {
    display: none !important;
  }
}

/* With the side panel docked, the welcome centers on the map that is left, not on the whole window. */
@media (min-width: 900px) {
  html[data-kp] .empty-city {
    padding-left: 440px;
  }
}

/* On a phone the editing bar and timeline take the bottom of the map: the welcome keeps clear of them. */
@media (max-width: 720px) {
  .empty-city {
    padding-bottom: 200px;
  }
}

/* On a phone the editing bar's status wraps to a second line instead of being cut to "All changes are …". */
@media (max-width: 720px) {
  .edit-head #edit-status {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.2;
  }
}

/* Editing on a phone: the zoom and About buttons ride above the editing bar instead of under it. */
@media (max-width: 720px) {
  body.editing .maplibregl-ctrl-bottom-right {
    margin-bottom: 84px;
    transition: margin-bottom var(--dur) var(--ease);
  }
}

/* After Hide This List: a quiet way back, at the top of Today. */
.setup-restore {
  margin: 0 0 8px;
  text-align: right;
}

.setup-restore .link-btn {
  font-size: 12px;
}

/* ---------- security: sign-in code, two-step set-up, Settings → Security ---------- */

.login-code {
  display: grid;
  gap: 6px;
}

.login-code-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

#login-code {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
  text-align: center;
}

#login-use-recovery {
  justify-self: start;
  font-size: 12.5px;
}

/* ---------- forgot password (forgot.js) ---------- */

.acc-warn {
  margin: 10px 0 4px;
  padding: 9px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, #d97706 12%, transparent);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.fp-link {
  display: block;
  margin: 8px 0 0 auto;
  font-size: 12.5px;
}

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

.forgot .fp-lede,
.forgot .fp-sent {
  margin: 0 0 6px;
  line-height: 1.5;
}

.forgot .fp-sent {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #1663d6) 9%, transparent);
  font-size: 13.5px;
}

.forgot .fp-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.forgot .fp-alt {
  margin: 8px 0 0;
  text-align: center;
}

.forgot .fp-alt .link-btn {
  font-size: 13px;
}

.forgot .fp-code {
  font-size: 20px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.forgot .login-code {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.forgot .login-code input {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
  text-align: center;
}

.forgot .login-code .link-btn {
  justify-self: start;
  font-size: 12.5px;
}

.ts-dlg {
  width: min(480px, calc(100vw - 32px));
}

.ts-form h2 {
  margin: 2px 0 8px;
}

.ts-form > p {
  line-height: 1.5;
}

.ts-required {
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 600;
}

.ts-steps {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  padding-left: 20px;
  line-height: 1.45;
}

.ts-steps small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.ts-qr {
  display: grid;
  place-items: center;
  width: 184px;
  height: 184px;
  margin: 10px 0 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ts-key {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.ts-code {
  display: block;
  width: 11ch;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  text-align: center;
}

.ts-err {
  color: var(--bad, #b42318);
  font-weight: 600;
}

.ts-code-list {
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  columns: 2;
  user-select: all;
}

.ts-status {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ts-status p {
  margin: 0;
}

.ts-status .dq-acts {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

.ts-badge {
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ts-status.on .ts-badge {
  background: var(--good, #1a7f37);
  color: #fff;
}

.sec-block {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.sec-block:last-child {
  border-bottom: 0;
}

.sec-block h3 {
  margin: 0 0 6px;
}

/* Save ends the settings; who is signed in where follows below it, set apart. */
.sec-save-row {
  justify-content: flex-end;
  margin: 4px 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sec-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--field);
  font-size: 13px;
}

.sec-note.warn {
  background: color-mix(in srgb, var(--warn, #b54708) 12%, var(--card));
}

.sec-err {
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bad, #b42318) 10%, var(--card));
  color: var(--bad, #b42318);
  font-weight: 600;
}

.sec-table-wrap {
  overflow-x: auto;
}

.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sec-table th,
.sec-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sec-table td small {
  display: block;
  color: var(--muted);
}

.sec-table tr.off {
  opacity: 0.6;
}

.sec-acts {
  white-space: nowrap;
  text-align: right !important;
}

/* Phones: a person's buttons stack, so the table fits without scrolling sideways. */
@media (max-width: 520px) {
  .sec-acts {
    white-space: normal;
  }

  .sec-acts button {
    display: block;
    margin: 0 0 4px auto;
    white-space: normal;
  }
}

.sec-acts button {
  margin-left: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 600;
}

.sec-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--field);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sec-tag.good {
  background: color-mix(in srgb, var(--good, #1a7f37) 14%, var(--card));
  color: var(--good, #1a7f37);
}

.sec-tag.warn {
  background: color-mix(in srgb, var(--warn, #b54708) 14%, var(--card));
  color: var(--warn, #b54708);
}

.sec-tag.bad {
  background: color-mix(in srgb, var(--bad, #b42318) 12%, var(--card));
  color: var(--bad, #b42318);
}

.sec-fails {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.sec-fails li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0 10px;
}

.sec-fails li > span:not(.sec-when),
.sec-fails li small {
  grid-column: 2;
}

.sec-fails small,
.sec-when {
  color: var(--muted);
}

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

  .sec-fails li > * {
    grid-column: 1 !important;
  }
}

/* Sign-in: Remember Me keeps the username or email on this device. */
.login .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font: 500 13px var(--k-font, inherit);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
}

.login .remember input {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

/* Backup & Restore: the automatic backups. */
.bk-facts {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.bk-facts > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}

.bk-facts dt {
  font-weight: 700;
}

.bk-facts dd {
  margin: 0;
}

.bk-warn {
  color: #b3261e;
  font-weight: 700;
}

.bk-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 14px;
}

.bk-table th,
.bk-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.bk-table th {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 560px) {
  .bk-facts > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ---------- CivMetryx AI: Ask CivMetryx and Ask The Map (ai.js) ---------- */
.ai-panel {
  position: fixed;
  top: 76px;
  right: 12px;
  bottom: 12px;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.ai-panel[hidden] {
  display: none;
}
.ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 6px 16px;
}
.ai-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
}
.ai-head .close {
  position: static;
  width: 32px;
  height: 32px;
  font-size: 20px;
  border-radius: 6px;
}
.ai-label {
  margin: 0 16px 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 12px;
  border-top: 1px solid var(--line);
  overscroll-behavior: contain;
}
.ai-empty p {
  color: var(--muted);
  line-height: 1.5;
}
.ai-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-starters .chip {
  text-align: left;
  white-space: normal;
  min-height: 32px;
}
.ai-msg {
  margin-top: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ai-msg p {
  margin: 0 0 8px;
}
.ai-msg ul {
  margin: 0 0 8px;
  padding-left: 20px;
}
/* Drafting with AI: the reply box under a tip, the announcement editor's button, and the
   listing description's button. */
.ai-draft-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  display: grid;
  gap: 8px;
}
.ai-draft-box textarea {
  min-height: 150px;
}
.ann-ai {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 4px 0 2px;
}
.ann-ai small {
  color: var(--muted);
}
.ai-desc-btn {
  justify-self: start;
  margin-top: 6px;
  font-size: 13px;
}
/* A chart of a grouped answer, drawn from the tool's numbers. */
.ai-chart {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ai-chart figcaption {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.ai-chart .viz-bars {
  font-size: 13px;
}
/* Follow-up questions under an answer. */
.ai-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
}
.ai-next > span {
  font-size: 12px;
  color: var(--muted);
  margin-right: 2px;
}
/* Questions are sentences: never capitalized like labels. */
.ai-next .chip,
.ai-starters .chip {
  text-align: left;
  white-space: normal;
  text-transform: none;
}
/* Tables in an answer: scroll sideways inside the bubble rather than widen the panel. */
.ai-table {
  overflow-x: auto;
  margin: 0 0 10px;
}
.ai-table table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}
.ai-table th,
.ai-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
}
.ai-table th {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.ai-table td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ai-you .ai-text {
  margin-left: 15%;
  padding: 8px 12px;
  background: var(--field);
  border-radius: 10px 10px 2px 10px;
}
.ai-you .ai-text p:last-child {
  margin: 0;
}
.ai-failed .ai-text {
  color: #b42318;
}
:root[data-theme='dark'] .ai-failed .ai-text {
  color: #ff8a80;
}
.ai-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.ai-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.ai-caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: ai-blink 1s steps(2) infinite;
}
@keyframes ai-blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-caret {
    animation: none;
  }
}
.ai-cite {
  display: inline;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ai-rate {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}
.ai-rate button {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.ai-form {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.ai-form textarea {
  width: 100%;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}
.ai-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .ai-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(78vh, 640px);
    border-radius: 14px 14px 0 0;
  }
}
@media print {
  .ai-panel,
  #ai-open {
    display: none !important;
  }
}

/* A drafted report summary (reports.js) */
.rpt-ai {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--card);
}
.rpt-ai-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.rpt-ai-head strong {
  margin-right: auto;
}
.rpt-ai-text p {
  margin: 0 0 8px;
  line-height: 1.55;
}
.rpt-ai-wait,
.rpt-ai-label {
  color: var(--muted);
  font-size: 0.85rem;
}
.rpt-ai-label {
  margin: 4px 0 0;
}
.rpt-ai-error {
  color: #b42318;
}
@media print {
  .rpt-ai {
    display: none;
  }
}

/* Admin Center → Settings → AI (ai-admin.js) */
.ai-meter {
  height: 10px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 5px;
  background: var(--field);
}
.ai-meter i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--accent);
}
.ai-warn {
  color: #b42318;
}
:root[data-theme='dark'] .ai-warn {
  color: #ff8a80;
}
.ai-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.ai-tables table,
.ai-read-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ai-tables th,
.ai-tables td,
.ai-read-list th,
.ai-read-list td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.ai-tables .n,
.ai-read-list .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ai-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  font-weight: 600;
}
.ai-field {
  display: grid;
  gap: 4px;
  margin: 6px 0;
  font-size: 0.9rem;
}
.ai-field input {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}
.ai-fb {
  margin: 6px 0 0;
  padding-left: 18px;
}
.ai-fb li {
  margin-bottom: 6px;
}
.ai-fb small {
  display: block;
  color: var(--muted);
}
.ai-read {
  grid-column: 1 / -1;
}
.ai-read-list {
  max-height: 480px;
  margin-top: 10px;
  overflow: auto;
}
.ai-read-list q {
  color: var(--muted);
  font-style: italic;
}
.ai-dec {
  white-space: nowrap;
}
.ai-dec button + button {
  margin-left: 4px;
}

/* With Ask open beside the map, the "Showing N projects" bar centers on what is left of the map. */
@media (min-width: 641px) {
  html.ai-on .only-bar {
    left: calc((100vw - min(420px, 100vw - 24px) - 12px) / 2);
    max-width: calc(100vw - min(420px, 100vw - 24px) - 36px);
  }
}

/* Keyboard hints mean nothing on a touch screen. */
@media (hover: none) and (pointer: coarse) {
  button > kbd,
  .kb-hint {
    display: none;
  }
}

/* The map key on a phone: a Key button beside the folded Layers bar, opening the colors and
   status styles. On wider screens the Layers panel is the key. */
.map-key {
  display: none;
}
@media (max-width: 760px) {
  .map-key {
    display: block;
    position: fixed;
    top: 112px;
    right: 8px;
    z-index: 7;
    max-width: calc(100vw - 16px);
    padding: 0;
    border-radius: 12px;
  }
  html.ai-on .map-key,
  body.editing .map-key {
    display: none;
  }
  .map-key-btn {
    min-height: 44px;
    padding: 0 16px;
    font-weight: 600;
    background: none;
    border: 0;
  }
  .map-key-body {
    padding: 0 12px 10px;
    min-width: 200px;
  }
  .map-key-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .map-key-body .row {
    padding: 3px 0;
    font-size: 14px;
  }
  .map-key-body .row:hover {
    background: none;
  }
  .map-key-head {
    margin: 8px 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* Admin Center on a phone: one menu of every page (with Search beside it) instead of a row of
   page buttons and Settings chips that run off the edge of the screen. */
#adm-pick {
  display: none;
}
@media (max-width: 720px) {
  #adm-pick {
    display: block;
    flex: 1;
    min-width: 0;
  }
  #adm-pick select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    font: inherit;
    font-weight: 600;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel, #fff);
    color: var(--ink);
  }
  #adm #adm-tabs,
  #adm-body .chips.adm-phone-only {
    display: none !important;
  }
  #adm .adm-side {
    align-items: center;
    gap: 8px;
    overflow: visible;
  }
}

/* Capital and Economic Development before anything is added: no tiles of dashes. */
.cap-kpis.is-empty {
  display: none;
}

/* The first-visit summary over the map, in the same place and style as the "Showing…" bar. */
.map-summary {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 6px 6px 6px 14px;
  transform: translateX(-50%);
  font-size: 13px;
  white-space: nowrap;
}
.map-summary .ms-open {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}
.map-summary .ms-x {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
}
html.ai-on .map-summary,
body.editing .map-summary {
  display: none;
}
@media (max-width: 760px) {
  .map-summary {
    top: auto;
    bottom: 150px;
  }
  .map-summary .ms-more {
    display: none;
  }
}

/* The timeline on a phone: folded to one small button until it is wanted. On wider screens the
   fold buttons do not show and the timeline is always open. */
.tl-fold,
.tl-shut {
  display: none;
}
@media (max-width: 760px) {
  .timeline.folded {
    width: auto;
    padding: 4px;
  }
  .timeline.folded > :not(.tl-fold) {
    display: none !important;
  }
  .timeline.folded .tl-fold {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    font-weight: 600;
    font-size: 14px;
  }
  .timeline:not(.folded) .tl-shut {
    display: block;
    flex: none;
    width: 32px;
    height: 32px;
    color: var(--muted);
  }
  .map-summary {
    bottom: 128px;
  }
}

/* The Admin Center is a full page, edge to edge, rather than a window floating over the map.
   Each page has its own address (#admin/…), so Back and links work like any other page. */
#adm.adm {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  inset: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#adm.adm::backdrop {
  background: var(--bg, #f6f4ef);
}
#adm .adm-main {
  max-width: 100%;
}
@media (min-width: 1500px) {
  /* On a very wide screen the page itself stays a comfortable width. */
  #adm #adm-body {
    max-width: 1180px;
  }
}

/* Fields people type in look editable: white with a clear border, not the tinted fill that read as
   disabled. The map's own search box in the header keeps its pill look. */
:root {
  --input: #ffffff;
  --input-line: #8f8672;
}
:root[data-theme='dark'] {
  --input: #23262e;
  --input-line: #737887;
}
:is(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit']), select, textarea):not(#search) {
  background-color: var(--input);
  border: 1px solid var(--input-line);
}
:is(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit']), select, textarea):not(#search):focus-visible {
  border-color: var(--brand);
}
:is(input, select, textarea):disabled {
  background-color: var(--field);
}

/* "How This Works": a ? beside the page title, opening a panel at the top of the page. */
.adm-title .adm-help-btn {
  flex: none;
  width: 26px;
  height: 26px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.adm-title .adm-help-btn[aria-expanded='true'],
.adm-title .adm-help-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.adm-help-panel {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--card);
}
.adm-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.adm-help-x {
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-size: 18px;
}
.adm-help-panel p {
  margin: 0;
}

/* The city's name in a phone header uses the room there is (about 150px on a 375px phone),
   so names like "Example City" or "Round Rock" are not cut short. */
@media (max-width: 480px) {
  .brand h1 {
    max-width: max(92px, calc(100vw - 225px));
  }
}
