:root {
  --ink: #101010;
  --paper: #ffffff;
  --muted: #5f5f5f;
  --line: rgba(16, 16, 16, 0.18);
  --accent: #005c9d;
  --azul: #0e6eae;
  --tile: #fdfaf0;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  font-size: 12px;
  text-transform: lowercase;
}

html.is-camera-open,
body.is-camera-open {
  background: #000;
  color-scheme: dark;
  overscroll-behavior: none;
}

body.is-camera-open::after {
  content: "";
  position: fixed;
  inset: -120px;
  z-index: 1290;
  background: #000;
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  border-bottom: 0;
  background: transparent;
  pointer-events: none;
}

.brand {
  color: var(--ink);
  font-size: 24px;
  font-weight: 300;
  text-decoration: none;
  letter-spacing: 0;
  pointer-events: auto;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 7px;
  pointer-events: auto;
}

.beta-label {
  color: #9a9a9a;
  font-size: 10px;
  font-weight: 300;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  pointer-events: auto;
}

.about-trigger,
.account-trigger {
  border: 0;
  background: transparent;
  color: #8a8a8a;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.map-azulejo-count {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 650;
  color: var(--ink);
  font-size: 12px;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.record-action {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 720;
  transform: translateX(-50%);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
}

.record-action:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: wait;
}

.record-camera-input {
  display: none;
}

.record-onboarding {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: none;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: #fff;
  color: var(--ink);
}

.record-onboarding.is-open {
  display: grid;
}

.record-onboarding-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 20px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.record-onboarding-content {
  display: grid;
  width: min(100%, 520px);
  min-height: 390px;
  grid-template-rows: 1fr auto;
}

.record-onboarding-step {
  align-self: center;
}

.record-onboarding-step[hidden] {
  display: none;
}

.record-onboarding-index {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
}

.record-onboarding h2 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 400;
  line-height: 1.02;
}

.record-onboarding-step > p:not(.record-onboarding-index) {
  max-width: 46ch;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.48;
}

.record-onboarding-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
}

.record-onboarding-actions button {
  min-width: 78px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
}

.record-onboarding-actions button:last-child {
  margin-left: auto;
  background: var(--ink);
  color: #fff;
}

.square-camera {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 18px;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  min-height: -webkit-fill-available;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  background: #000;
}

.square-camera.is-open {
  display: grid;
}

.square-camera-view {
  position: relative;
  width: min(92vmin, 720px);
  height: min(92vmin, 720px);
  overflow: hidden;
  object-fit: cover;
  border: 0;
  background: #000;
}

.square-camera video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.square-camera.is-permission video,
.square-camera.is-permission .square-camera-guide {
  opacity: 0;
}

.square-camera-guide {
  position: absolute;
  left: 9%;
  top: 9%;
  width: 82%;
  height: 82%;
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.square-camera-guide::before {
  content: "";
  position: absolute;
  inset: -7px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.84) 0 5px, transparent 6px) left top / 14px 14px no-repeat,
    radial-gradient(circle, rgba(255, 255, 255, 0.84) 0 5px, transparent 6px) right top / 14px 14px no-repeat,
    radial-gradient(circle, rgba(255, 255, 255, 0.84) 0 5px, transparent 6px) left bottom / 14px 14px no-repeat,
    radial-gradient(circle, rgba(255, 255, 255, 0.84) 0 5px, transparent 6px) right bottom / 14px 14px no-repeat;
}

.square-camera-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  width: min(calc(100vw - 32px), 420px);
}

.square-camera-controls button {
  justify-self: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
}

.square-camera-shutter {
  position: relative;
  width: 72px !important;
  height: 72px !important;
  justify-self: center;
  border: 3px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 50% !important;
}

.square-camera-shutter::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}

.square-camera-shutter span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.square-camera-secondary {
  width: auto;
  min-width: 0;
  padding: 12px 4px;
  text-align: center;
}

.square-camera-permissions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-content: center;
  gap: 20px;
  padding: 24px;
  background: #000;
  color: #fff;
  text-align: left;
}

.square-camera.is-permission .square-camera-permissions {
  display: grid;
}

.square-camera-permissions p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 300;
}

.square-camera-permissions ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.square-camera-permissions li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.25;
}

.square-camera-permissions li::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
}

.square-camera-permissions li.is-granted::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: #fff;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.square-camera-permissions li.is-denied::before {
  border-color: #fff;
  background: #fff;
}

.capture-preview {
  position: fixed;
  inset: 0;
  z-index: 1310;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto auto;
  place-items: center;
  gap: 14px;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom));
  background: #fff;
}

.capture-preview.is-open {
  display: grid;
}

.capture-preview-frame {
  width: min(92vmin, 720px);
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  overflow: hidden;
  background: #fff;
}

.capture-preview canvas {
  width: 100%;
  height: 100%;
}

.capture-crop-controls {
  display: grid;
  gap: 7px;
  width: min(92vmin, 720px);
}

.capture-crop-controls label {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.capture-preview-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 12px;
  width: min(92vmin, 280px);
}

.capture-preview-controls button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
}

#captureRetakeButton {
  border-color: var(--line);
  color: var(--muted);
}

#captureSendButton {
  border-color: var(--azul);
  background: var(--azul);
  color: #fff;
}

.capture-preview-controls button:disabled {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  cursor: wait;
}

.location-permission-sheet {
  position: fixed;
  inset: 0;
  z-index: 1340;
  display: none;
  place-items: center;
  padding: 24px;
  background: #fff;
}

.location-permission-sheet.is-open {
  display: grid;
}

.location-permission-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
}

.location-permission-content {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(520px, 100%);
  color: var(--ink);
  text-align: center;
}

.location-permission-content p {
  margin: 0;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.45;
}

.location-permission-content p + p {
  color: var(--muted);
  font-size: 13px;
}

.location-permission-content a,
.location-permission-content button {
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  text-decoration: none;
  cursor: pointer;
}

.location-permission-content button:disabled {
  color: var(--muted);
  cursor: wait;
}

@supports (height: 100dvh) {
  .square-camera-view {
    width: min(92vw, calc(100dvh - 112px), 720px);
    height: min(92vw, calc(100dvh - 112px), 720px);
  }

  .capture-preview-frame,
  .capture-crop-controls {
    width: min(92vw, calc(100dvh - 196px), 720px);
  }
}

.nav {
  display: none;
  gap: 6px;
}

.nav-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.nav-button.is-active {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.app-shell {
  height: 100%;
  padding-top: 52px;
}

.map-stage {
  position: fixed;
  inset: 52px 0 0 0;
}

#map,
#gridCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#map {
  z-index: 1;
  background: #fff;
}

#gridCanvas {
  z-index: 450;
  pointer-events: none;
}

.leaflet-container {
  font: inherit;
  background: #fff;
}

.leaflet-tile-pane {
  filter: grayscale(1) contrast(1.1) brightness(1.05);
  opacity: 0.18;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-bottom.leaflet-right {
  right: 50% !important;
  transform: translateX(50%);
}

.leaflet-right .leaflet-control-attribution {
  margin-right: 0 !important;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  font-family: "Helvetica Neue", Arial, sans-serif !important;
  font-size: 34px !important;
  font-weight: 300 !important;
  line-height: 30px !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

.leaflet-control-zoom a:hover {
  background: transparent !important;
  color: var(--ink) !important;
}

.map-location-control {
  position: absolute;
  right: 10px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 650;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1769e0;
  cursor: pointer;
}

.map-location-control::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.map-location-control::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 25px;
  background:
    linear-gradient(currentColor, currentColor) center / 1px 25px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 25px 1px no-repeat;
  transform: translate(-50%, -50%);
}

.map-location-control.is-active {
  color: #b7b7b7;
}

.map-location-control:disabled {
  color: #b7b7b7;
  cursor: wait;
}

.map-location-probe {
  position: absolute;
  left: 50%;
  top: 50%;
  display: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b7b7b7;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-location-control.is-locating .map-location-probe {
  display: block;
  animation: gps-search 1.05s linear infinite;
}

@keyframes gps-search {
  from {
    transform: translate(-50%, -50%) rotate(0deg) translateX(12px);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) translateX(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-location-control.is-locating .map-location-probe {
    animation-duration: 2.4s;
  }
}

.coordinates {
  display: none;
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 650;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 11px;
}

.panel {
  display: none;
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 650;
  width: min(292px, calc(100vw - 40px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.panel-view {
  display: none;
}

.panel-view.is-active {
  display: block;
}

h1,
h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
}

p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.system-controls {
  display: none !important;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.control-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

.range-label {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

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

.search-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.search-row input {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.search-row button {
  min-width: 48px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.search-status {
  min-height: 18px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 0;
}

.stats div {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.active-cell {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.active-cell h2 {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 400;
}

.active-cell strong,
.active-cell span {
  display: block;
  overflow-wrap: anywhere;
}

.active-cell strong {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.active-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.active-cell button {
  width: 100%;
  min-height: 32px;
  margin-top: 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.active-cell button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.active-cell textarea {
  display: none;
  width: 100%;
  min-height: 56px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  resize: vertical;
}

.active-cell textarea.is-visible {
  display: block;
}

.fragment-index {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.fragment-index h2 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 400;
}

.archive-filter {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.archive-filter-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 6px;
}

.archive-filter input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-transform: none;
}

.archive-filter button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  cursor: pointer;
}

.archive-filter-status {
  min-height: 16px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.fragment-index-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.fragment-index-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.fragment-index-item.has-duplicate-cell {
  border-color: rgba(178, 31, 31, 0.55);
}

.fragment-index-item img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.fragment-index-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.15;
}

.fragment-index-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.fragment-index-empty {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.32);
  font-size: 12px;
}

dt {
  color: var(--muted);
  font-size: 11px;
}

dd {
  margin: 3px 0 0;
  font-size: 12px;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 82px;
  margin-bottom: 14px;
  border: 1px dashed var(--ink);
  background:
    linear-gradient(45deg, rgba(14, 110, 174, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(14, 110, 174, 0.08) 25%, transparent 25%),
    var(--tile);
  background-size: 22px 22px;
  cursor: pointer;
}

.file-drop.compact {
  min-height: 54px;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

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

figure {
  margin: 0;
}

canvas {
  display: block;
}

.preview-grid canvas {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #fff;
}

figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.crop-status {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.crop-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.32);
}

.crop-controls label {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.field-grid label {
  color: var(--muted);
  font-size: 11px;
}

.field-grid input {
  width: 100%;
  height: 36px;
  margin-top: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.primary-action {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.secondary-action {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.danger-action {
  color: #7c1f1f;
  border-color: rgba(124, 31, 31, 0.58);
}

.primary-action:disabled {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
}

.secondary-action:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.template-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -4px 0 12px;
}

.template-links a {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
  font-size: 12px;
  text-decoration: none;
}

.data-template-links {
  grid-template-columns: 1fr;
  margin-top: 2px;
}

.batch-status {
  min-height: 48px;
  margin: 4px 0 10px;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.batch-status p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.batch-status ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.batch-status li {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.batch-status strong {
  color: var(--ink);
  font-weight: 700;
}

.batch-status .batch-warning strong {
  color: #7c1f1f;
}

pre {
  overflow: auto;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.azulejo-cell {
  image-rendering: auto;
  outline: 1px solid rgba(16, 16, 16, 0.46);
  background: #f1f0eb;
  color: transparent;
  font-size: 0;
  opacity: 1 !important;
}

.azulejo-cell.is-lqip {
  image-rendering: pixelated;
}

.azulejo-cell.is-image-unavailable {
  background: #f1f0eb;
}

#azulejoViewerImage.is-image-unavailable {
  visibility: hidden;
}

.azulejo-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.98);
  cursor: default;
  touch-action: none;
  user-select: none;
}

.azulejo-viewer.is-open {
  display: grid;
}

.azulejo-viewer-visual {
  position: relative;
  width: min(86vmin, 920px);
  height: min(86vmin, 920px);
}

#azulejoViewerImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.azulejo-viewer-visual.is-mosaic #azulejoViewerImage {
  display: none;
}

.azulejo-viewer-mosaic {
  display: none;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.azulejo-viewer-visual.is-mosaic .azulejo-viewer-mosaic {
  display: grid;
}

.azulejo-viewer-mosaic-cell {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.azulejo-viewer-mosaic-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotate(var(--tile-rotation));
  transform-origin: center;
}

.azulejo-viewer-meta {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 12px;
  max-width: min(92vw, 760px);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  touch-action: auto;
  user-select: text;
}

.azulejo-viewer-meta a,
.azulejo-viewer-meta span,
.azulejo-viewer-meta p {
  color: var(--ink);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;
  text-align: center;
}

.azulejo-viewer-meta p {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 0;
  flex-wrap: wrap;
}

.azulejo-viewer-meta a {
  text-decoration: none;
}

.azulejo-viewer-close {
  position: fixed;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.about-sheet,
.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  overflow: auto;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}

.about-sheet.is-open,
.account-sheet.is-open {
  display: block;
}

.about-close,
.account-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.about-text {
  width: min(760px, calc(100vw - 40px));
  margin: 0 auto;
  padding: max(82px, 12vh) 0 80px;
  font-family: Georgia, "Times New Roman", serif;
}

.about-text h1 {
  margin: 0 0 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.02;
  text-transform: lowercase;
}

.about-text p {
  margin: 0 0 24px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 2.1vw, 26px);
  font-weight: 400;
  line-height: 1.38;
}

.about-contributors {
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about-contributors h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.1;
  text-transform: lowercase;
}

.about-contributors p {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

.about-contributors ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-contributors li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.25;
}

.about-contributors li:first-child {
  border-top: 0;
}

.about-contributors strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.about-contributors span {
  color: var(--ink);
  font-size: inherit;
}

.about-contributors .contributor-rank {
  color: var(--muted);
}

.about-contributors .contributor-count {
  justify-self: end;
}

.about-contact {
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about-contact h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.1;
  text-transform: lowercase;
}

.about-contact p {
  margin: 0;
}

.about-contact a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.account-settings {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.account-settings h2 {
  margin: 0 0 24px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  text-transform: lowercase;
}

.account-settings .account-status {
  margin-bottom: 0;
}

.account-content {
  width: min(640px, calc(100vw - 40px));
  margin: 0 auto;
  padding: max(82px, 12vh) 0 80px;
}

.account-content h1 {
  margin: 0 0 34px;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.02;
}

.account-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.account-modes button {
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
  cursor: pointer;
}

.account-modes button.is-active {
  margin-bottom: -1px;
  border-color: var(--ink);
  color: var(--ink);
}

.account-form {
  display: none;
  grid-template-columns: 1fr;
  gap: 18px;
}

.account-form.is-active {
  display: grid;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.account-form input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  text-transform: none;
}

.account-form button,
.account-identity button {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.account-form .account-link-button {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.account-form button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.account-status {
  min-height: 18px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.account-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.account-identity strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 300;
}

.account-identity button {
  min-width: 110px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
}

.account-profile-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 22px;
}

.account-profile-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.account-profile-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.account-profile-form button {
  align-self: end;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.account-profile-form button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.my-contributions {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.my-contributions-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.my-contributions h2 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 300;
  text-transform: lowercase;
}

.my-contributions-view {
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-contributions-view button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #a7a7a3;
  cursor: pointer;
}

.my-contributions-view button[aria-pressed="true"] {
  color: #111;
}

.contribution-view-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

.contribution-view-icon.is-grid {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 100% 100% / 6px 6px no-repeat;
}

.contribution-view-icon.is-list {
  background:
    linear-gradient(currentColor 0 0) 0 1px / 14px 1px no-repeat,
    linear-gradient(currentColor 0 0) 0 6px / 14px 1px no-repeat,
    linear-gradient(currentColor 0 0) 0 11px / 14px 1px no-repeat;
}

.my-contributions > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

.my-contributions ol {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-contributions li {
  aspect-ratio: 1;
  min-width: 0;
}

.my-contributions li button {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: #f3f3f1;
  cursor: pointer;
}

.my-contributions li button:disabled {
  cursor: default;
}

.my-contributions li img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-contributions .contribution-details {
  display: none;
}

.my-contributions li.is-rejected .contribution-details {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 3px;
  padding: 7px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.5) 58%, rgba(255, 255, 255, 0.12));
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.15;
  text-align: left;
}

.my-contributions li.is-rejected .contribution-title,
.my-contributions li.is-rejected .contribution-details time {
  display: none;
}

.my-contributions .contribution-reason {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.my-contributions.is-list-view ol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

.my-contributions.is-list-view li {
  aspect-ratio: auto;
  border-bottom: 1px solid var(--line);
}

.my-contributions.is-list-view li button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  min-height: 78px;
  padding: 10px 0;
  overflow: visible;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.my-contributions.is-list-view li img {
  width: 58px;
  height: 58px;
}

.my-contributions.is-list-view li .contribution-details {
  display: grid;
  position: static;
  align-content: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  min-width: 0;
  padding: 0;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: inherit;
  line-height: inherit;
}

.my-contributions.is-list-view li .contribution-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-contributions.is-list-view li .contribution-details strong {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  font-size: 11px;
  font-weight: 400;
  text-align: right;
}

.my-contributions.is-list-view li .contribution-reason {
  grid-column: 1;
  grid-row: 2;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.3;
}

.my-contributions.is-list-view li .contribution-details time {
  display: block;
  grid-column: 1;
  grid-row: 3;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 700px) {
  .my-contributions ol {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
}

.neighborhood-cut {
  vector-effect: non-scaling-stroke;
}

.cell-highlight {
  vector-effect: non-scaling-stroke;
}

.tile-popup {
  display: grid;
  gap: 6px;
  min-width: 128px;
}

.tile-popup img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.tile-popup strong {
  font-size: 12px;
  font-weight: 400;
}

.tile-popup span {
  color: var(--muted);
  font-size: 11px;
}

.admin-page {
  min-height: 100%;
  overflow: auto;
  background: #fff;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.admin-header .brand {
  font-size: 28px;
}

.admin-header span {
  color: var(--muted);
  font-size: 12px;
}

.admin-shell {
  width: min(1100px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 max(36px, env(safe-area-inset-bottom));
}

.admin-login-shell {
  display: grid;
  gap: 18px;
  max-width: 620px;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 620px;
}

.admin-login label,
.admin-tools {
  color: var(--muted);
  font-size: 11px;
}

.admin-login input {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}

.admin-login button,
.admin-toolbar button,
.admin-card button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.admin-login button {
  align-self: end;
}

.admin-login p {
  grid-column: 1 / -1;
  min-height: 16px;
  margin: 2px 0 0;
  color: #9f1f1f;
  font-size: 11px;
}

.admin-login-divider {
  color: var(--muted);
  font-size: 11px;
}

.admin-account-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-account-setup[hidden] {
  display: none;
}

.admin-account-setup strong,
.admin-account-setup p {
  grid-column: 1 / -1;
}

.admin-account-setup input,
.admin-account-setup select {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 6px;
  border: 1px solid var(--line);
  padding: 0 8px;
  background: var(--paper);
}

.admin-account-setup button {
  align-self: end;
  min-height: 36px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.admin-dashboard {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.admin-dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-dashboard-header h1,
.admin-activity h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.1;
}

.admin-dashboard-header p,
.admin-dashboard-header span,
.admin-stats-summary {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-dashboard-header span {
  text-align: right;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-stat {
  display: grid;
  align-content: space-between;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-stat span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.admin-stat strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.admin-stat.is-primary {
  border-color: var(--ink);
}

.admin-activity {
  margin-top: 22px;
}

.admin-activity h2 {
  margin-bottom: 12px;
  font-size: 14px;
}

.admin-activity-chart {
  display: grid;
  gap: 8px;
}

.admin-activity-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  min-height: 18px;
}

.admin-activity-row time,
.admin-activity-row strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.admin-activity-row strong {
  color: var(--ink);
  text-align: right;
}

.admin-activity-bars {
  position: relative;
  height: 8px;
  background: #f0f0ee;
}

.admin-activity-bars span {
  position: absolute;
  inset: 0 auto 0 0;
}

.admin-activity-submitted {
  background: #c9c9c5;
}

.admin-activity-approved {
  background: var(--azul);
}

.admin-stats-summary {
  margin-top: 16px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .admin-login,
  .admin-account-setup {
    grid-template-columns: 1fr;
  }

  .admin-login p,
  .admin-account-setup strong,
  .admin-account-setup p {
    grid-column: 1;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat {
    min-height: 102px;
    padding: 11px;
  }

  .admin-dashboard-header {
    align-items: start;
  }
}

.admin-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-page {
  --dashboard-pull: 0px;
  min-height: 100dvh;
  margin: 0;
  background: #f8f8f6;
  color: var(--ink);
  font-family: var(--font-sans);
  overscroll-behavior-y: contain;
}

.dashboard-refresh-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -140%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease, border-color 160ms ease;
  pointer-events: none;
}

.dashboard-refresh-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dashboard-refresh-indicator.is-ready {
  border-color: var(--azul);
  color: var(--azul);
}

.dashboard-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 28px);
  transform: translateY(var(--dashboard-pull));
  transition: transform 140ms ease;
}

.dashboard-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-brand,
.dashboard-topbar span,
.dashboard-hero h1,
.dashboard-login h1 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.dashboard-topbar span {
  color: var(--muted);
  font-size: 15px;
}

.dashboard-login,
.dashboard-content {
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 46px);
}

.dashboard-login {
  display: grid;
  align-content: start;
  gap: 18px;
}

.dashboard-login h1,
.dashboard-login p {
  margin: 0;
}

.dashboard-login > p,
.dashboard-login summary,
.dashboard-login label,
.dashboard-login form p,
.dashboard-status,
.dashboard-hero p,
.dashboard-primary-card span,
.dashboard-metrics span,
.dashboard-summary span,
.dashboard-actions a,
.dashboard-actions button {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dashboard-login form {
  display: grid;
  gap: 12px;
}

.dashboard-login label {
  display: grid;
  gap: 7px;
}

.dashboard-login input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  box-sizing: border-box;
}

.dashboard-login button,
.dashboard-hero button,
.dashboard-actions button,
.dashboard-actions a {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
}

.dashboard-login details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.dashboard-login summary {
  cursor: pointer;
}

.dashboard-login details form {
  margin-top: 14px;
}

.dashboard-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.dashboard-hero h1,
.dashboard-hero p,
.dashboard-status {
  margin: 0;
}

.dashboard-hero h1 {
  margin-top: 4px;
  font-size: clamp(42px, 12vw, 68px);
}

.dashboard-hero button {
  flex: 0 0 auto;
  min-height: 38px;
  color: var(--azul);
  border-color: var(--azul);
}

.dashboard-status {
  min-height: 18px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.dashboard-primary-grid,
.dashboard-metrics {
  display: grid;
  gap: 8px;
}

.dashboard-primary-grid {
  grid-template-columns: 1fr;
  margin-bottom: 8px;
}

.dashboard-primary-card,
.dashboard-metrics article,
.dashboard-summary {
  border: 1px solid var(--line);
  background: #fff;
}

.dashboard-primary-card {
  display: grid;
  min-height: 150px;
  align-content: space-between;
  padding: 16px;
}

.dashboard-primary-card span,
.dashboard-metrics span,
.dashboard-summary span {
  text-transform: none;
}

.dashboard-primary-card strong {
  color: var(--azul);
  font-size: clamp(76px, 24vw, 124px);
  font-weight: 300;
  line-height: 0.88;
  font-variant-numeric: tabular-nums;
}

.dashboard-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metrics article {
  display: grid;
  min-height: 96px;
  align-content: space-between;
  padding: 12px;
}

.dashboard-metrics strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dashboard-activity {
  margin-top: 26px;
}

.dashboard-activity h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 300;
}

#dashboardActivityChart {
  display: grid;
  gap: 10px;
}

.dashboard-activity-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.dashboard-activity-row time,
.dashboard-activity-row strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.dashboard-activity-row strong {
  color: var(--ink);
  text-align: right;
}

.dashboard-activity-track {
  position: relative;
  height: 10px;
  background: #ececea;
}

.dashboard-activity-track span {
  position: absolute;
  inset: 0 auto 0 0;
}

.dashboard-activity-submitted {
  background: #c9c9c5;
}

.dashboard-activity-approved {
  background: var(--azul);
}

.dashboard-summary {
  display: grid;
  gap: 0;
  margin-top: 26px;
}

.dashboard-summary p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-summary p:last-child {
  border-bottom: 0;
}

.dashboard-summary strong {
  font-size: 17px;
  font-weight: 300;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
}

.dashboard-actions a,
.dashboard-actions button {
  display: inline-grid;
  place-items: center;
  flex: 1;
  color: var(--ink);
}

@media (min-width: 520px) {
  .dashboard-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .dashboard-brand {
    font-size: 24px;
  }

  .dashboard-topbar span {
    font-size: 13px;
  }

  .dashboard-metrics strong {
    font-size: 30px;
  }
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-filters button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 300;
  cursor: pointer;
}

.admin-filters button.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.admin-filters span {
  margin-left: 4px;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.admin-status {
  min-height: 18px;
  margin-bottom: 12px;
  color: var(--muted);
}

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

.admin-load-more {
  display: block;
  min-width: 140px;
  min-height: 38px;
  margin: 18px auto 0;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.admin-load-more[hidden] {
  display: none;
}

.admin-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 8px;
  background: #fff;
}

.admin-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-card strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.admin-card span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-card .admin-moderation-reason {
  margin: 0;
  padding: 7px;
  border: 1px solid #9f1f1f;
  color: #9f1f1f;
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-card .admin-moderation-reason[hidden] {
  display: none;
}

.admin-card button {
  border-color: #9f1f1f;
  color: #9f1f1f;
}

.admin-card button:first-of-type {
  border-color: var(--ink);
  color: var(--ink);
}

.admin-card button[hidden] {
  display: none;
}

.admin-status-pill {
  justify-self: start;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.admin-status-pill.is-pending {
  border-color: #9f7a1f;
  color: #9f7a1f;
}

.admin-status-pill.is-approved {
  border-color: #27703d;
  color: #27703d;
}

.admin-status-pill.is-rejected {
  border-color: #9f1f1f;
  color: #9f1f1f;
}

.admin-editor {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  grid-template-rows: 58px minmax(0, 1fr) auto 58px;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
}

.admin-editor.is-open {
  display: grid;
}

.admin-editor-header,
.admin-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-editor-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.admin-editor-header div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.admin-editor-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.admin-editor-header strong {
  font-size: 18px;
  font-weight: 300;
}

.admin-editor-header span,
.admin-editor-footer span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-editor button,
.admin-card-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 300;
  cursor: pointer;
}

#adminEditorClose {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  font-size: 28px;
}

#adminEditorPrev,
#adminEditorNext {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  font-size: 32px;
  line-height: 1;
}

#adminEditorPrev:disabled,
#adminEditorNext:disabled {
  color: var(--line);
  cursor: default;
}

#adminEditorSave {
  min-width: 130px;
  background: var(--ink);
  color: #fff;
}

.admin-editor-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) 240px;
  min-height: 0;
}

.admin-editor-source,
.admin-editor-preview,
.admin-editor-adjustments {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.admin-editor-source,
.admin-editor-preview {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 18px;
  overflow: auto;
  background: #f6f6f4;
}

.admin-editor-source canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 172px);
  border: 1px solid var(--line);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.admin-editor-source canvas.is-white-point-mode {
  cursor: copy;
}

.admin-editor-preview canvas {
  display: block;
  width: min(100%, calc(100vh - 172px));
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-editor-source-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.admin-editor-source-actions button.is-active {
  background: var(--ink);
  color: #fff;
}

.admin-editor-adjustments {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  padding: 20px 16px;
  border-right: 0;
}

.admin-editor-adjustments label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  color: var(--ink);
  font-size: 11px;
}

.admin-editor-adjustments output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-editor-adjustments input {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-condition-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.admin-condition-codes legend {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.admin-condition-codes label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
}

.admin-condition-codes input {
  grid-column: auto;
  width: auto;
}

.admin-moderation-dialog {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
}

.admin-moderation-dialog.is-open {
  display: grid;
}

.admin-moderation-dialog form {
  display: grid;
  gap: 16px;
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--ink);
  background: #fff;
}

.admin-moderation-dialog strong {
  font-size: 18px;
  font-weight: 300;
}

.admin-moderation-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.admin-moderation-dialog select,
.admin-moderation-dialog textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.admin-moderation-dialog p {
  min-height: 14px;
  margin: 0;
  color: #9f1f1f;
  font-size: 11px;
}

.admin-moderation-dialog form > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-moderation-dialog button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.admin-moderation-dialog button[type="submit"] {
  background: var(--ink);
  color: #fff;
}

.admin-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.admin-card-actions .admin-reject {
  border-color: #9f7a1f;
  color: #9f7a1f;
}

.admin-card-actions .admin-delete {
  border-color: #9f1f1f;
  color: #9f1f1f;
}

.admin-card-actions button[hidden] {
  display: none;
}

.admin-nearby {
  display: grid;
  gap: 8px;
  min-height: 144px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.admin-nearby > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-nearby > header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.admin-nearby strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
}

.admin-nearby span,
.admin-nearby label {
  color: var(--muted);
  font-size: 10px;
}

.admin-nearby label {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 180px;
}

.admin-nearby label input {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-nearby label output {
  justify-self: end;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.admin-nearby-list {
  display: grid;
  grid-auto-columns: 104px;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-nearby-card {
  display: grid;
  gap: 4px;
  width: 104px;
  min-height: 0 !important;
  padding: 0 0 5px !important;
  overflow: hidden;
  border-color: var(--line) !important;
  text-align: left;
}

.admin-nearby-card img {
  display: block;
  width: 102px;
  height: 76px;
  object-fit: cover;
  background: #f1f0eb;
}

.admin-nearby-card strong,
.admin-nearby-card span {
  padding: 0 6px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nearby-viewer {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 12px;
  padding: 56px 18px 24px;
  background: rgba(255, 255, 255, 0.98);
}

.admin-nearby-viewer.is-open {
  display: grid;
}

.admin-nearby-viewer > button {
  position: fixed;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
}

.admin-nearby-viewer img {
  display: block;
  width: min(82vmin, 900px);
  height: min(82vmin, 900px);
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-nearby-viewer div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.admin-nearby-viewer strong {
  color: var(--ink);
  font-weight: 400;
}

.admin-nearby-viewer a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.admin-nearby-viewer div button,
.admin-nearby-viewer div select {
  padding: 5px 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.admin-nearby-viewer div button:disabled,
.admin-nearby-viewer div select:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

@media (max-width: 980px) {
  .admin-editor {
    overflow: hidden;
    grid-template-rows: 58px minmax(0, 1fr) auto 58px;
  }

  .admin-editor-workspace {
    grid-template-columns: 1fr 1fr;
    overflow-y: auto;
  }

  .admin-editor-adjustments {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .admin-editor {
    grid-template-rows:
      calc(54px + env(safe-area-inset-top))
      minmax(0, 1fr)
      minmax(116px, 23dvh)
      calc(62px + env(safe-area-inset-bottom));
  }

  .admin-editor-header {
    align-items: end;
    min-height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 8px;
  }

  .admin-editor-header div {
    display: grid;
    gap: 2px;
    flex: 1;
  }

  .admin-editor-header strong {
    font-size: 18px;
    line-height: 1;
  }

  .admin-editor-header span {
    max-width: calc(100vw - 84px);
    font-size: 10px;
  }

  #adminEditorClose {
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 30px;
  }

  .admin-editor-nav {
    gap: 0;
    margin-left: 0;
  }

  #adminEditorPrev,
  #adminEditorNext {
    width: 38px;
    height: 44px;
    min-height: 44px;
    font-size: 32px;
  }

  .admin-editor-workspace {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f6f6f4;
  }

  .admin-editor-source,
  .admin-editor-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-editor-source {
    gap: 10px;
    padding-top: 12px;
  }

  .admin-editor-preview {
    justify-items: start;
    align-content: start;
    background: #fff;
  }

  .admin-editor-source canvas,
  .admin-editor-preview canvas {
    max-height: none;
  }

  .admin-editor-source canvas {
    width: min(100%, 58dvh, 560px);
    max-width: 100%;
  }

  .admin-editor-preview canvas {
    width: min(42vw, 156px);
    min-width: 118px;
  }

  .admin-editor-source-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 560px);
    gap: 8px;
  }

  .admin-editor button,
  .admin-card-actions button {
    min-height: 42px;
    font-size: 12px;
  }

  .admin-editor-adjustments {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 12px 18px;
    border-right: 0;
    background: #fff;
  }

  .admin-editor-adjustments label {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 8px;
    font-size: 12px;
  }

  .admin-editor-adjustments input {
    min-height: 28px;
  }

  .admin-condition-codes {
    grid-template-columns: 1fr 1fr;
  }

  .admin-condition-codes input {
    min-height: auto;
  }

  .admin-editor-footer {
    align-items: start;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  }

  .admin-editor-footer span {
    align-self: center;
    max-width: calc(100vw - 170px);
    white-space: normal;
  }

  #adminEditorSave {
    min-width: 144px;
    min-height: 44px;
  }

  .admin-nearby {
    min-height: 0;
    max-height: 23dvh;
    overflow: hidden;
    padding: 8px 12px 10px;
  }

  .admin-nearby > header {
    align-items: center;
    gap: 10px;
  }

  .admin-nearby > header > div {
    display: grid;
    gap: 2px;
  }

  .admin-nearby label {
    min-width: 118px;
    max-width: 38vw;
  }

  .admin-nearby-list {
    grid-auto-columns: 86px;
    gap: 7px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-nearby-card {
    width: 86px;
    min-height: 92px !important;
  }

  .admin-nearby-card img {
    width: 84px;
    height: 58px;
  }

  .admin-nearby-card strong,
  .admin-nearby-card span {
    font-size: 8px;
  }

  .admin-nearby-viewer {
    padding: calc(56px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  }

  .admin-nearby-viewer img {
    width: min(92vw, 74dvh);
    height: min(92vw, 74dvh);
  }

  .admin-nearby-viewer div {
    display: grid;
    justify-items: center;
    gap: 5px;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .admin-editor-preview {
    display: none;
  }

  .admin-editor-source canvas {
    width: min(100%, 45dvh, 520px);
  }

  .admin-nearby strong {
    font-size: 11px;
  }

  .admin-nearby span,
  .admin-nearby label {
    font-size: 9px;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 54px;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .brand {
    max-width: 180px;
    font-size: 24px;
    line-height: 1.05;
  }

  .about-trigger {
    font-size: 24px;
    line-height: 1.05;
  }

  .account-trigger {
    font-size: 24px;
    line-height: 1.05;
  }

  .topbar-actions {
    gap: 10px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .app-shell {
    padding-top: 62px;
  }

  .map-stage {
    inset: 62px 0 0 0;
  }

  .panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 42vh;
    padding: 14px;
  }

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

  .coordinates {
    left: 10px;
    bottom: calc(42vh + 22px);
    max-width: calc(100vw - 20px);
  }
}
