:root {
  --ink: #0e2845;
  --muted: #5b6b85;
  --canvas: #f2f7fc;
  --paper: #ffffff;
  --municipal: #0c5aad;
  --municipal-dark: #083c7c;
  --signal: #4aa3f0;
  --warning: #e97330;
  --danger: #c73d4d;
  --line: #d6e2f0;
  --shadow: 0 18px 50px rgb(12 90 173 / 16%);
  --topbar-height: calc(5rem + env(safe-area-inset-top));
  --nav-height: 5.2rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(12 90 173 / 28%);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  letter-spacing: -0.03em;
}

.logo-mark {
  height: 2.45rem;
  width: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.compact-brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.eyebrow,
.step-label {
  margin-bottom: 0.65rem;
  color: var(--municipal);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow.warning {
  color: #a63d08;
}

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

.muted.compact {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
}

.wide-copy {
  max-width: 42rem;
  margin-inline: auto;
}

.card {
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 1.35rem;
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
}

.field {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid #cedbd3;
  border-radius: 1rem;
  background: #fff;
  padding: 0.8rem 1rem;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field:focus {
  border-color: var(--municipal);
  box-shadow: 0 0 0 4px rgb(12 90 173 / 10%);
  outline: none;
}

textarea.field {
  min-height: 8.5rem;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: -0.25rem;
  font-size: 0.9rem;
  font-weight: 760;
}

.button-primary,
.button-secondary,
.button-danger,
.icon-button,
.map-action {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 1rem;
  padding: 0.75rem 1.15rem;
  font-weight: 780;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.button-primary {
  background: var(--municipal-dark);
  color: white;
  box-shadow: 0 10px 26px rgb(8 60 124 / 30%);
}

.button-secondary,
.icon-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.button-danger {
  background: #fff0f1;
  color: #9f2433;
}

.button-primary:hover,
.button-secondary:hover,
.button-danger:hover,
.icon-button:hover,
.map-action:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.button-primary:disabled,
.button-secondary:disabled,
.button-danger:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.48;
  transform: none;
}

.button-primary.full {
  width: 100%;
}

.button-primary.small,
.button-secondary.small {
  min-height: 2.5rem;
  border-radius: 0.8rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

.button-link {
  border: 0;
  background: transparent;
  color: var(--municipal);
  font-weight: 750;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-message {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 650;
}

.form-message[data-success="true"] {
  color: var(--municipal);
}

.auth-layout {
  display: grid;
  min-height: 100dvh;
  background: var(--municipal-dark);
}

.auth-hero {
  position: relative;
  display: flex;
  min-height: 42vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: max(2rem, env(safe-area-inset-top)) 1.4rem 3rem;
  color: white;
  isolation: isolate;
}

.auth-hero::before {
  position: absolute;
  z-index: -2;
  inset: -20%;
  background:
    radial-gradient(circle at 70% 24%, rgb(74 163 240 / 30%), transparent 23rem),
    radial-gradient(circle at 10% 90%, rgb(12 90 173 / 42%), transparent 22rem);
  content: "";
}

.auth-hero .auth-brand {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  left: 1.4rem;
}

.auth-hero .eyebrow {
  color: var(--signal);
}

.auth-hero h1 {
  max-width: 12ch;
  color: white;
}

.hero-copy {
  max-width: 36rem;
  margin: 0;
  color: rgb(255 255 255 / 72%);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
}

.hero-grid {
  position: absolute;
  z-index: -1;
  right: -7rem;
  bottom: -8rem;
  width: 23rem;
  height: 23rem;
  transform: rotate(25deg);
}

.hero-grid span {
  position: absolute;
  border: 1px solid rgb(74 163 240 / 25%);
  border-radius: 38% 62% 49% 51%;
  inset: calc(var(--i, 0) * 2.3rem);
}

.hero-grid span:nth-child(2) { --i: 1; }
.hero-grid span:nth-child(3) { --i: 2; }
.hero-grid span:nth-child(4) { --i: 3; }

.auth-card-wrap {
  display: grid;
  align-items: center;
  padding: 1.4rem;
  background:
    radial-gradient(circle at 90% 10%, rgb(74 163 240 / 18%), transparent 18rem),
    var(--canvas);
}

.auth-card {
  width: min(100%, 29rem);
  margin-inline: auto;
  padding: clamp(1.4rem, 5vw, 2.25rem);
}

.auth-card .field {
  margin: 0.35rem 0 1rem;
}

.otp-field {
  font-size: 1.45rem;
  font-weight: 820;
  letter-spacing: 0.32em;
  text-align: center;
}

.center-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(2rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 10% 5%, rgb(74 163 240 / 24%), transparent 25rem),
    linear-gradient(155deg, #f5f9fe, #dceaf9);
}

.identity-panel {
  width: min(100%, 44rem);
  text-align: center;
}

.identity-panel > .compact-brand {
  margin-bottom: 2.5rem;
}

.identity-panel .form-stack,
.identity-result {
  margin-top: 1.3rem;
  padding: 1.35rem;
  text-align: left;
}

.identity-result dl {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.4rem;
}

.identity-result dl div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.identity-result dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-result dd {
  margin: 0.2rem 0 0;
  font-weight: 750;
}

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(14 40 69 / 8%);
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.7rem;
  background: rgb(250 252 255 / 91%);
  box-shadow: 0 8px 30px rgb(12 90 173 / 7%);
  backdrop-filter: blur(20px) saturate(150%);
}

.icon-button {
  min-height: 2.5rem;
  border-radius: 0.8rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.84rem;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.user-menu-toggle:hover {
  border-color: var(--line);
  background: rgb(12 90 173 / 5%);
}

.user-menu-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: rgb(12 90 173 / 8%);
}

.user-avatar {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--municipal), var(--municipal-dark));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.user-menu-caret {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  transition: transform 150ms ease;
}

.user-menu-toggle[aria-expanded="true"] .user-menu-caret {
  transform: rotate(180deg);
}

.user-menu-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.6rem);
  right: 0;
  display: grid;
  width: 15.5rem;
  gap: 0.15rem;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 1.1rem;
  background: rgb(255 255 255 / 97%);
  padding: 0.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
}

.user-menu-identity {
  display: grid;
  gap: 0.1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.6rem 0.7rem;
  margin-bottom: 0.2rem;
}

.user-menu-identity strong {
  font-size: 0.95rem;
}

.user-menu-identity span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  padding: 0.65rem 0.6rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.user-menu-item svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.user-menu-item:hover {
  background: rgb(12 90 173 / 7%);
}

.user-menu-danger {
  color: #9f2433;
}

.user-menu-danger svg {
  color: #9f2433;
}

.user-menu-danger:hover {
  background: #fff0f1;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: 0.75rem;
  display: grid;
  height: calc(var(--nav-height) - 0.6rem);
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 1.6rem;
  background: linear-gradient(180deg, rgb(10 66 130 / 96%), rgb(5 38 84 / 96%));
  box-shadow: 0 18px 45px rgb(5 28 25 / 32%);
  color: rgb(255 255 255 / 70%);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: 0.08rem;
  border-radius: 1.2rem;
  font-size: 0.7rem;
  font-weight: 760;
  color: rgb(255 255 255 / 66%);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.bottom-nav a:active {
  transform: scale(0.93);
}

.bottom-nav .nav-emoji {
  font-size: 1.35rem;
  line-height: 1;
  filter: saturate(1.15);
}

.bottom-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 13%);
}

.bottom-nav a[aria-current="page"] .nav-emoji {
  transform: translateY(-1px);
}

.bottom-nav .nav-map[aria-current="page"] {
  color: #7cc0ff;
}

.bottom-nav .nav-claims[aria-current="page"] {
  color: #57e6a0;
}

.bottom-nav .new-action {
  align-content: center;
  gap: 0.12rem;
}

.bottom-nav .new-action b {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  margin-top: -1.7rem;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 88%);
  border-radius: 999px;
  background: linear-gradient(145deg, #ffb63b, #ff7a1a);
  box-shadow: 0 10px 24px rgb(255 122 26 / 48%);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.bottom-nav .new-action b:active {
  transform: scale(1.1);
}

.app-page {
  min-height: 100dvh;
  padding: calc(var(--topbar-height) + 2.5rem) 1rem calc(var(--nav-height) + 2.7rem);
  background:
    radial-gradient(circle at 8% 4%, rgb(74 163 240 / 18%), transparent 27rem),
    linear-gradient(160deg, #f8faf5 0%, #edf4ee 100%);
}

.page-container {
  width: min(100%, 74rem);
  margin-inline: auto;
}

.page-container.narrow {
  width: min(100%, 46rem);
}

.back-link {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  padding: 0.6rem 1.1rem;
  color: var(--municipal);
  font-size: 0.92rem;
  font-weight: 780;
  text-decoration: none;
  box-shadow: 0 4px 14px rgb(12 90 173 / 10%);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.back-link svg {
  width: 1.2rem;
  height: 1.2rem;
}

.back-link:hover {
  background: #f2f7fc;
  box-shadow: 0 6px 18px rgb(12 90 173 / 16%);
  transform: translateY(-1px);
}

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
}

.page-heading > p:last-child,
.page-heading > div > p:last-child {
  max-width: 43rem;
  color: var(--muted);
  line-height: 1.55;
}

.page-heading.split {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.claim-form {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.field-help {
  margin-top: -0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.category-picker {
  display: grid;
  gap: 0.6rem;
}

.category-list {
  display: grid;
  gap: 0.35rem;
  max-height: 17rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.5rem;
  background: #fff;
}

.category-group {
  margin: 0.35rem 0.25rem 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.category-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  padding: 0.55rem 0.65rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.category-item:hover {
  background: #f2f7fc;
}

.category-item.selected {
  border-color: var(--municipal);
  background: rgb(12 90 173 / 8%);
}

.category-item-icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  border-radius: 0.45rem;
  padding: 0.22rem;
  background: var(--item-color, var(--municipal));
  color: #fff;
}

.category-item-text {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
}

.category-item-text strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-item-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-empty {
  margin: 0.35rem 0.25rem;
  font-size: 0.85rem;
}

.location-box {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  border: 1px solid #cfe1d8;
  border-radius: 1rem;
  padding: 0.9rem;
  background: #f3faf5;
}

.location-box p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-dot {
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
  margin-top: 0.25rem;
  border: 3px solid white;
  border-radius: 50%;
  background: #d29922;
  box-shadow: 0 0 0 3px rgb(210 153 34 / 20%);
}

.location-box[data-ready="true"] .status-dot {
  background: #16a36a;
  box-shadow: 0 0 0 3px rgb(22 163 106 / 18%);
}

.location-map-wrap {
  position: relative;
  display: grid;
  gap: 0.4rem;
}

.location-map {
  height: 15rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.use-gps-btn {
  position: absolute;
  z-index: 3;
  top: 0.6rem;
  left: 0.6rem;
  min-height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.45rem 0.8rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 12px rgb(8 31 29 / 16%);
  color: var(--municipal);
  font-size: 0.8rem;
  font-weight: 780;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.use-gps-btn:hover {
  background: #fff;
}

.map-toggle-btn {
  position: absolute;
  z-index: 4;
  top: 0.6rem;
  right: 0.6rem;
  min-height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.45rem 0.8rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 12px rgb(8 31 29 / 16%);
  color: var(--municipal);
  font-size: 0.8rem;
  font-weight: 780;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.map-toggle-btn.minimize {
  border-color: transparent;
  background: rgb(8 60 124 / 92%);
  color: #fff;
}

.location-map-wrap.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: block;
  width: 100vw;
  height: 100dvh;
  gap: 0;
  background: #f4f7f9;
}

.location-map-wrap.is-expanded .location-map {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.location-map-wrap.is-expanded > p {
  display: none;
}

.location-map-wrap.is-expanded .map-toggle-btn.minimize {
  top: max(0.9rem, env(safe-area-inset-top));
  right: max(0.9rem, env(safe-area-inset-right));
}

body.map-locked {
  overflow: hidden;
}

.outside-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgb(220 38 38 / 35%);
  border-radius: 0.9rem;
  padding: 0.65rem 0.8rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 720;
}

.outside-warning[hidden] {
  display: none;
}

.claim-location-pin-wrap {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
}

.claim-location-pin {
  position: relative;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color, var(--municipal));
  box-shadow: 0 3px 9px rgb(8 31 29 / 35%);
  color: #fff;
  transform: rotate(-45deg);
}

.claim-location-pin-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  transform: rotate(45deg);
  pointer-events: none;
}

.file-field {
  padding: 0.72rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.photo-source-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.photo-source-btn {
  min-height: 3rem;
  font-size: 0.85rem;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.photo-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 0.8rem;
}

.photo-figure img {
  display: block;
  width: 100%;
  height: 5.5rem;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgb(15 23 42 / 78%);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.photo-remove:hover {
  background: var(--danger);
}

.photo-preview figure {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 0.85rem;
  background: #e6ece8;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duplicate-panel,
.success-panel {
  margin-top: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.duplicate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 0.8rem 0;
}

.duplicate-item a {
  color: var(--municipal);
  font-weight: 750;
}

.claim-list {
  display: grid;
  gap: 0.9rem;
}

.claim-card,
.empty-state {
  padding: 1.15rem;
}

.claim-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Prioridad y estado apilados a la derecha del título. En pantallas
   angostas quedaban uno al lado del otro y empujaban el título a dos
   líneas. */
.claim-card-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.claim-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.claim-card p {
  margin: 0.65rem 0;
  color: #40514f;
  line-height: 1.5;
}

.claim-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  background: #e8f5ed;
  color: #11633d;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.failed {
  background: #fff0f1;
  color: #9f2433;
}

.status-pill.pending {
  background: #fff7df;
  color: #8b5a00;
}

.status-pill-success {
  background: #e8f5ed;
  color: #11633d;
}

.status-pill-danger {
  background: #fff0f1;
  color: #9f2433;
}

.status-pill-info {
  background: #e7f1fc;
  color: #0c5aad;
}

.status-pill-pending {
  background: #fff7df;
  color: #8b5a00;
}

.skeleton-card {
  height: 9rem;
  border-radius: 1.2rem;
  background: linear-gradient(90deg, #e4ebe5 25%, #f6f8f5 50%, #e4ebe5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.map-page {
  position: fixed;
  inset: var(--topbar-height) 0 0;
}

.full-map {
  position: absolute;
  inset: 0;
}

.map-filter-fab {
  position: absolute;
  z-index: 5;
  top: 1rem;
  left: 1rem;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 6px 18px rgb(8 31 29 / 18%);
  color: var(--municipal);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.map-filter-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgb(8 31 29 / 24%);
}

.map-filter-fab svg {
  width: 1.4rem;
  height: 1.4rem;
}

.map-filter-fab[hidden] {
  display: none;
}

.map-overlay {
  position: absolute;
  z-index: 6;
  top: 1rem;
  left: 1rem;
  /* 26rem y no 20: cada fila de estados (rótulo + dos chips) tiene que entrar
     en un renglón. Con 20rem "Cerrados / Finalizados / Desestimados" quebraba
     y el panel se leía como cuatro filas sueltas. En pantallas angostas manda
     el viewport y los chips vuelven a envolver, que ahí es lo correcto. */
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.9rem 2.3rem 0.9rem 1rem;
  /* Tope de alto + scroll propio: con los filtros avanzados desplegados el
     panel supera el viewport y se cortaba, sin forma de llegar a los chips de
     abajo. El 100% es la altura de .map-page (viewport menos topbar); se
     descuentan el 1rem del top y el espacio de la barra de navegación
     inferior, que en el teléfono flota encima del mapa. */
  max-height: calc(100% - 2.2rem - var(--nav-height) - env(safe-area-inset-bottom));
  overflow-y: auto;
  /* Que el scroll muera en el panel: sin esto, al llegar al fondo el gesto
     sigue en el mapa de atrás y lo mueve. */
  overscroll-behavior: contain;
  /* La barra nativa es gruesa y cuadrada, y dibujada al borde pisa las
     esquinas redondeadas de la tarjeta: parece estar fuera del panel. La
     versión fina con vía transparente (la misma del detalle del reclamo)
     flota sobre el padding derecho, lejos de la curva. */
  scrollbar-color: rgb(12 90 173 / 48%) transparent;
  scrollbar-width: thin;
}

.map-overlay[hidden] {
  display: none;
}

/* Fija (sticky + float) y no absoluta: con el panel ahora desplazable, una
   cruz absoluta se iría con el contenido y cerrar exigiría volver arriba.
   Los márgenes negativos la meten en la franja de padding (2.3rem a la
   derecha), donde no tapa contenido; el sticky la mantiene a la vista. */
.map-overlay-close {
  position: sticky;
  top: 0;
  z-index: 12;
  float: right;
  margin: -0.3rem -1.7rem 0 0.5rem;
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgb(8 31 29 / 6%);
  color: var(--ink-soft);
  cursor: pointer;
}

.map-overlay-close svg {
  width: 1rem;
  height: 1rem;
}

.map-overlay-close:hover {
  background: rgb(8 31 29 / 12%);
}

.locate-button {
  margin-top: 0.75rem;
}

.locate-fab {
  position: absolute;
  z-index: 5;
  right: 1rem;
  bottom: calc(var(--nav-height) + 1.2rem + env(safe-area-inset-bottom));
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 6px 18px rgb(8 31 29 / 18%);
  color: var(--municipal);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.locate-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgb(8 31 29 / 24%);
}

.locate-fab svg {
  width: 1.5rem;
  height: 1.5rem;
}

.locate-fab.locating svg {
  animation: locate-pulse 1.1s ease-in-out infinite;
}

.heat-legend {
  position: absolute;
  z-index: 5;
  left: 1rem;
  bottom: calc(var(--nav-height) + 1.2rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0.8rem;
  width: 12.25rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 6px 18px rgb(8 31 29 / 18%);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  color: var(--ink-soft);
  transition: opacity 160ms ease;
}

.heat-legend[hidden] {
  display: none;
}

.heat-legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.heat-legend-bar {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(40, 114, 200, 0.88) 0%,
    rgba(44, 137, 214, 0.92) 16%,
    rgba(52, 173, 193, 0.92) 30%,
    rgba(91, 191, 137, 0.94) 46%,
    rgba(181, 205, 80, 0.95) 62%,
    rgba(242, 195, 63, 0.97) 76%,
    rgba(239, 126, 48, 0.98) 88%,
    rgba(218, 45, 45, 0.98) 100%
  );
  transition: opacity 160ms ease, filter 160ms ease;
}

.heat-legend.heat-off .heat-legend-bar {
  filter: grayscale(1);
  opacity: 0.35;
}

.heat-legend-title {
  font-weight: 760;
  font-size: 0.78rem;
  color: var(--ink);
}

.heat-legend-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -0.15rem;
  font-size: 0.64rem;
  font-weight: 680;
  color: var(--ink-soft);
}

.heat-toggle {
  position: relative;
  display: inline-block;
  width: 2.1rem;
  height: 1.15rem;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--municipal);
  cursor: pointer;
  transition: background 160ms ease;
}

.heat-toggle::after {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: #fff;
  content: "";
  transform: translateX(0.95rem);
  transition: transform 160ms ease;
}

.heat-toggle.is-off {
  background: #c7d2da;
}

.heat-toggle.is-off::after {
  transform: translateX(0);
}

@keyframes locate-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.popup-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.popup-action {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.42rem 0.6rem;
  background: rgb(255 255 255 / 92%);
  color: var(--municipal);
  font-size: 0.78rem;
  font-weight: 780;
  cursor: pointer;
}

.popup-action:hover {
  background: #fff;
}

.claim-search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.claim-search-input {
  min-height: 2.5rem;
  font-size: 0.85rem;
}

.claim-search-submit {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0 0.85rem;
}

.claim-search-submit svg {
  width: 1.1rem;
  height: 1.1rem;
}

#claim-search-message {
  margin-top: 0.35rem;
}

#claim-search-message:empty {
  display: none;
}

.map-filters {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.map-filter-category-combo {
  position: relative;
}

.map-filter-category-input {
  min-height: 2.4rem;
  font-size: 0.85rem;
}

.map-filter-category-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.2rem;
  max-height: 13rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.4rem;
  background: #fff;
  box-shadow: var(--shadow);
  /* Barra fina flotando sobre el padding: la nativa pisaba el redondeo de la
     lista y se veía fuera del recuadro. */
  scrollbar-color: rgb(12 90 173 / 48%) transparent;
  scrollbar-width: thin;
}

/* Fallback WebKit (Safari < 18.2, WebView viejos): los navegadores que ya
   entienden scrollbar-width ignoran estas reglas, así que no se pisan. Es la
   misma barra del detalle del reclamo: puro CSS, cero costo de rendimiento. */
.map-overlay::-webkit-scrollbar,
.map-filter-category-list::-webkit-scrollbar {
  width: 0.6rem;
}

.map-overlay::-webkit-scrollbar-track,
.map-filter-category-list::-webkit-scrollbar-track {
  background: transparent;
}

.map-overlay::-webkit-scrollbar-thumb,
.map-filter-category-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(12 90 173 / 48%);
  background-clip: padding-box;
}

.map-overlay::-webkit-scrollbar-thumb:hover,
.map-filter-category-list::-webkit-scrollbar-thumb:hover {
  background: rgb(12 90 173 / 68%);
  background-clip: padding-box;
}

.map-filter-category-list[hidden] {
  display: none;
}

.map-filter-category-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  border-radius: 0.65rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}

/* El nombre se estira para ocupar el hueco entre la casilla y el contador. Sin
   esto, space-between reparte el espacio libre alrededor del texto y el nombre
   queda flotando a media distancia, como si estuviera centrado. */
.map-filter-category-name {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.map-filter-category-count {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Las subcategorías sin reclamos siguen siendo elegibles, pero se atenúan para
   que la vista se apoye en las que tienen datos. */
.map-filter-category-option.is-empty .map-filter-category-name {
  color: var(--muted);
}

.map-filter-category-option:hover {
  background: #f2f7fc;
}

.map-filter-category-option.selected {
  background: rgb(12 90 173 / 8%);
  color: var(--municipal);
  font-weight: 700;
}

/* Casilla de selección múltiple. Dibujada en CSS para no depender de un input
   real, que traería su propio manejo de foco y clics dentro del desplegable. */
.map-filter-category-option.is-multi {
  align-items: center;
}

.map-filter-category-box {
  position: relative;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 0.3rem;
  background: var(--paper);
}

.map-filter-category-option.selected .map-filter-category-box {
  border-color: var(--municipal);
  background: var(--municipal);
}

/* Tilde dibujado con dos lados de un borde, rotado. */
.map-filter-category-option.selected .map-filter-category-box::after {
  position: absolute;
  top: 0.08rem;
  left: 0.28rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

/* Acciones masivas al tope de la lista: se distinguen de las subcategorías
   porque no son un dato sino una acción sobre el conjunto. */
.map-filter-category-option.is-bulk {
  justify-content: flex-start;
  color: var(--municipal);
  font-weight: 700;
}

.map-filter-category-option.is-bulk + .map-filter-category-option:not(.is-bulk) {
  margin-top: 0.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}

.map-category-chips-summary {
  align-self: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 640;
}

/* Fichas con las subcategorías elegidas, debajo del buscador. */
.map-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.map-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgb(12 90 173 / 25%);
  border-radius: 999px;
  background: rgb(12 90 173 / 8%);
  color: var(--municipal);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 640;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.map-category-chip > span:first-child {
  overflow: hidden;
  max-width: 14rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-category-chip:hover {
  border-color: var(--municipal);
  background: rgb(12 90 173 / 14%);
}

.map-category-chip-x {
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
}

.map-category-chip.is-clear {
  border-color: var(--line);
  background: var(--canvas);
  color: var(--muted);
}

.map-filter-category-option.selected .map-filter-category-count {
  color: var(--municipal);
}

.map-status-action {
  padding: 0;
  font-size: inherit;
  vertical-align: baseline;
}

.map-filter-category-empty {
  margin: 0.3rem 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-filter-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Panel del rango personalizado. Va debajo de los botones de período porque es
   el mismo filtro: se despliega solo cuando se lo pide. */
/* Un campo por fila. El panel deja unos 16,7rem útiles y un input date pide
   cerca de 9rem (texto "dd/mm/aaaa" + icono del calendario + padding), así que
   en dos columnas se desbordan y se superponen. A lo ancho completo entran
   holgados y quedan idénticos entre sí. */
.map-filter-range {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.map-filter-range-field {
  display: grid;
  align-items: center;
  gap: 0.5rem;
  grid-template-columns: 3rem minmax(0, 1fr);
  color: var(--muted);
  font-size: 0.74rem;
}

/* La etiqueta va al costado y no encima: ocupa el ancho que sobra al lado del
   campo, y así las dos filas suman menos alto que apiladas. */
.map-filter-range-field > span {
  text-align: right;
}

.map-filter-range-field .field {
  width: 100%;
  min-height: 2.35rem;
  border-radius: 0.7rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

.map-filter-range-clear {
  justify-self: end;
  font-size: 0.76rem;
}

/* Separa el grupo de estado del de fechas: pegados se leen como una sola fila
   de opciones y no se entiende que son dos filtros independientes. */
.map-filter-status {
  margin-top: 0.1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

/* Los cerrados van en su propio bloque, detrás de una divisoria. Sin esa
   separación los seis chips se leen como una sola lista y no queda claro que
   Ingresados / En proceso son únicamente los abiertos.

   Sin margin-top: el gap de la grilla .map-filters ya pone 0.5rem sobre la
   línea, y sumarle margen dejaba un renglón en blanco entre abiertos y
   cerrados. El padding de abajo se recorta por lo mismo. */
.map-filter-closed {
  border-top: 1px solid var(--line);
  padding-top: 0.4rem;
}

/* "Abiertos" y "Cerrados" encabezan su fila y accionan al par completo. Van
   en mayúsculas chicas, como los rótulos del panel, y con un margen extra que
   los despega de sus miembros: se tienen que leer como la cabecera de la
   fila, no como un estado más. */
.map-filter-status-group {
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.4rem;
}

/* Los cerrados ya no llevan el punto de color al frente: con los dos grupos
   rotulados (ABIERTOS / CERRADOS) la separación quedó dicha por la estructura,
   y el punto los hacía ver distintos de los abiertos sin agregar información.
   El aviso "solo se pueden consultar" sigue cumpliendo ese rol. */

/* La fila de fechas entra en un solo renglón: cinco chips justos en las 26rem
   del panel, así que se prohíbe el quiebre y se recortan gap y padding. Solo
   acá: las demás filas de chips conservan el espaciado normal. */
.map-filter-dates {
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.map-filter-dates .map-filter-chip {
  padding: 0.32rem 0.55rem;
  white-space: nowrap;
}

/* En el teléfono la fila de cerrados ("CERRADOS Finalizados Desestimados")
   no entra con los tamaños de escritorio y quebraba en dos renglones. Se
   prohíbe el quiebre SOLO en las filas de estado y se achican chips y
   separaciones hasta que la fila completa entre en ~296px de contenido
   (panel de 360px de viewport menos márgenes y padding). Las filas de
   período no cambian: ahí envolver es correcto. */
@media (max-width: 480px) {
  .map-filter-status,
  .map-filter-closed .map-filter-days {
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .map-filter-status .map-filter-chip,
  .map-filter-closed .map-filter-chip {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .map-filter-status .map-filter-status-group,
  .map-filter-closed .map-filter-status-group {
    font-size: 0.62rem;
    margin-right: 0.2rem;
  }

  /* Los cinco chips de fecha no entran en ~296px ni compactados: acá el
     quiebre vuelve a permitirse, porque la alternativa es desbordar el panel. */
  .map-filter-dates {
    flex-wrap: wrap;
  }
}

/* Botón que pliega y despliega los filtros avanzados. Ocupa el ancho completo
   y lleva flecha, para que se lea como un acordeón y no como un chip más. El
   rótulo suma "· N activos" cuando algo de adentro está filtrando: nada debe
   trabajar invisible con la sección cerrada. */
.map-filter-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.5rem 0.7rem;
  background: rgb(255 255 255 / 90%);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.1rem;
}

.map-filter-advanced-caret {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.map-filter-advanced-toggle.is-open .map-filter-advanced-caret {
  transform: rotate(180deg);
}

/* La sección desplegada hereda el gap del panel de filtros repitiendo su
   grilla: así los bloques de adentro respiran igual que los de afuera. */
.map-filter-advanced {
  display: grid;
  gap: 0.5rem;
}

/* Rótulo de los grupos de chips de la sección avanzada (PRIORIDAD, PLAZO).
   Mismo tratamiento tipográfico que los encabezados ABIERTOS/CERRADOS, pero
   como texto y no como botón: no acciona nada. */
.map-filter-group-label {
  align-self: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.4rem;
}

/* Aviso de solo consulta. Aparece únicamente con un filtro cerrado activo, ya
   dentro del bloque de cerrados, así que alcanza con separarlo de los chips. */
.map-filter-hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.map-filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  background: rgb(255 255 255 / 90%);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  cursor: pointer;
}

.map-filter-chip.active {
  border-color: transparent;
  background: var(--municipal);
  color: #fff;
}

.map-filter-my-departments {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.34rem 0.7rem 0.34rem 0.9rem;
  background: rgb(255 255 255 / 90%);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  cursor: pointer;
  min-height: 2.1rem;
}

.map-filter-my-departments:disabled {
  opacity: 0.6;
  cursor: wait;
}

.map-filter-my-departments-track {
  flex: 0 0 auto;
  width: 2rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #c9d2e0;
  position: relative;
  transition: background 140ms ease;
}

.map-filter-my-departments-track::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 0.14rem;
  width: 0.87rem;
  height: 0.87rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(5 28 25 / 25%);
  transition: transform 140ms ease;
}

.map-filter-my-departments.is-active {
  border-color: transparent;
  background: var(--municipal);
  color: #fff;
}

.map-filter-my-departments.is-active .map-filter-my-departments-track {
  background: rgb(255 255 255 / 35%);
}

.map-filter-my-departments.is-active .map-filter-my-departments-track::after {
  transform: translateX(0.85rem);
}

/* El diálogo se centra en la ventana. El padding del overlay es el margen
   mínimo que el panel nunca puede invadir, e incluye las áreas seguras del
   dispositivo (notch arriba, barra de gestos abajo). */
.claim-detail-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    max(clamp(0.75rem, 4vh, 2.25rem), env(safe-area-inset-top))
    clamp(0.75rem, 4vw, 1.5rem)
    max(clamp(0.75rem, 4vh, 2.25rem), env(safe-area-inset-bottom));
  background: rgb(5 28 25 / 48%);
  backdrop-filter: blur(4px);
}

/* max-height: 100% se resuelve contra el área ya descontado el padding del
   overlay, así el panel se adapta solo a cualquier alto de pantalla sin
   depender de unidades de viewport, que en móvil cambian al aparecer y
   desaparecer las barras del navegador. */
.claim-detail-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  width: min(100%, 27rem);
  max-height: 100%;
  flex-direction: column;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 1.4rem;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 24px 60px rgb(5 28 25 / 35%);
}

.claim-detail-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem;
  scrollbar-color: rgb(12 90 173 / 48%) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

/* Pie fijo con las acciones. Queda siempre visible, sin importar cuánto mida
   la descripción del reclamo. */
.claim-detail-footer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 0.85rem 1.1rem max(0.85rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 97%);
}

.claim-detail-footer:empty {
  display: none;
}

/* Pantalla baja (celular en horizontal): el margen vertical se reduce al
   mínimo para no comerse el poco alto disponible, y el pie se compacta. */
@media (max-height: 30rem) {
  .claim-detail-overlay {
    padding-block:
      max(0.5rem, env(safe-area-inset-top))
      max(0.5rem, env(safe-area-inset-bottom));
  }

  .claim-detail-scroll {
    padding: 0.85rem;
  }

  .claim-detail-footer {
    padding: 0.6rem 0.85rem max(0.6rem, env(safe-area-inset-bottom));
  }
}

.claim-detail-scroll::-webkit-scrollbar {
  width: 0.6rem;
}

.claim-detail-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.claim-detail-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(12 90 173 / 48%);
  background-clip: padding-box;
}

.claim-detail-scroll::-webkit-scrollbar-thumb:hover {
  background: rgb(12 90 173 / 68%);
  background-clip: padding-box;
}

/* Estado de carga / error del detalle. Alto mínimo propio: sin esto el panel
   se encoge al tamaño del texto, queda pegado abajo (el overlay alinea al
   final) y la X se superpone al mensaje. */
.detail-loading {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.4rem 1rem;
  text-align: center;
}

.detail-loading-spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 2.5px solid color-mix(in srgb, var(--municipal) 22%, transparent);
  border-radius: 50%;
  border-top-color: var(--municipal);
  animation: detail-spin 0.7s linear infinite;
}

.detail-loading-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.detail-loading.is-error .detail-loading-text {
  color: var(--danger);
}

@keyframes detail-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-loading-spinner {
    animation-duration: 2.4s;
  }
}

.claim-detail-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgb(8 31 29 / 8%);
  box-shadow: 0 2px 8px rgb(5 28 25 / 12%);
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
}

.claim-detail-close svg {
  width: 1.15rem;
  height: 1.15rem;
}

.claim-detail-close:hover {
  background: rgb(8 31 29 / 14%);
}

.claim-detail-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-right: 2.4rem;
}

.claim-detail-color {
  display: grid;
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 1rem;
  background: var(--marker-color, var(--municipal));
  color: #fff;
}

.claim-detail-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.claim-detail-header-text {
  min-width: 0;
  flex: 1 1 auto;
}

.claim-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.claim-detail-title {
  margin: 0;
  font-size: 1.3rem;
}

.claim-detail-category {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.claim-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.claim-detail-tag {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.claim-detail-section {
  margin-top: 0.9rem;
}

.claim-detail-section-label {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.claim-detail-description {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-line;
}

/* Pantalla completa de gestión. Cubre todo el viewport en cualquier tamaño:
   el operario necesita ver fotos, mapa e historial mientras decide. */
.manage-screen {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}

body.has-manage-screen {
  overflow: hidden;
}

.manage-screen-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(0.9rem, env(safe-area-inset-top)) 1rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.manage-screen-logo {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
}

.manage-screen-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.manage-screen-heading .eyebrow {
  flex: 1 0 100%;
  margin: 0;
}

.manage-screen-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.manage-screen-state {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.manage-screen-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
}

.manage-screen-close svg {
  width: 1.15rem;
  height: 1.15rem;
}

.manage-screen-close:hover {
  border-color: var(--municipal);
  color: var(--municipal);
}

.manage-screen-scroll {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
}

/* Crece con el área que scrollea (flex: 1) para que el estado de carga pueda
   centrarse contra el alto real disponible. align-content: start evita que,
   con contenido normal, las tarjetas se estiren para llenar ese alto. */
.manage-screen-grid {
  display: grid;
  width: 100%;
  max-width: 68rem;
  flex: 1 1 auto;
  align-content: start;
  gap: 1rem;
  margin: 0 auto;
}

/* Mientras carga, el mensaje es el único contenido: ocupa las dos columnas y
   todo el alto libre, para quedar centrado en la pantalla y no arrinconado en
   la primera celda. Se mide contra el contenedor y no con un calc() de valores
   fijos, que se desajustaría al cambiar el encabezado. */
.manage-screen-grid:has(> .detail-loading) {
  align-content: stretch;
}

.manage-screen-grid > .detail-loading {
  grid-column: 1 / -1;
}

.manage-screen-main,
.manage-screen-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

/* Tarjeta con encabezado, al estilo del Portal. */
.manage-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
}

.manage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.manage-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 780;
  color: var(--ink);
}

.manage-card-badge {
  flex: 0 0 auto;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  background: #eef2f7;
  color: #475569;
}

.manage-card-badge.is-info {
  background: #e0edff;
  color: #0c4a9e;
}

.manage-card-badge.is-pending {
  background: #e0edff;
  color: #0c4a9e;
}

.manage-card-badge.is-success {
  background: #dcfce7;
  color: #15803d;
}

.manage-card-badge.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.manage-card-body {
  padding: 0.9rem 1rem;
}

/* Etiqueta azul + valor, como en el Portal. */
.manage-kv {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
  font-size: 0.84rem;
}

.manage-kv dt {
  color: var(--municipal);
  font-weight: 700;
}

.manage-kv dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.manage-description {
  margin: 0;
  color: var(--municipal);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-line;
}

.manage-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

/* Botones de acción con color e icono. */
.manage-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 9rem;
  min-height: 46px;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.manage-action-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.manage-action.is-success {
  background: #15803d;
}

.manage-action.is-success:hover {
  background: #126b34;
}

.manage-action.is-danger {
  background: #b91c1c;
}

.manage-action.is-danger:hover {
  background: #9f1717;
}

.manage-action.is-warning {
  background: #d97706;
}

.manage-action.is-warning:hover {
  background: #b96305;
}

.manage-action:disabled {
  opacity: 0.65;
  cursor: default;
}

/* Acción bloqueada por una limitación externa: se ve, pero apagada. */
.manage-action.is-blocked {
  background: #eef2f7;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.manage-blocked-note {
  flex: 1 1 100%;
  margin: 0.1rem 0 0;
  color: #9a3412;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Respuestas e historial. */
.manage-answers {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manage-answer {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.manage-answer-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.manage-answer-date {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
}

/* Reusa .claim-timeline de "Ver detalles"; acá solo se ajusta el margen
   superior, que en la tarjeta de gestión no hace falta. */
.manage-timeline {
  margin-top: 0.2rem;
}

/* Título + insignia de origen en la misma línea, con la insignia bajando de
   renglón si el título es largo. */
.timeline-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timeline-badge {
  padding: 0.06rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-badge.is-municipal {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.timeline-badge.is-gestion {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.timeline-badge.is-contacto {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

/* El punto toma el color de su origen, para seguir el hilo de un vistazo. */
.claim-timeline-step.is-gestion .claim-timeline-dot {
  background: #7c3aed;
}

.claim-timeline-step.is-contacto .claim-timeline-dot {
  background: #059669;
}

.timeline-actor {
  color: var(--muted);
  font-size: 0.78rem;
}

/* --- Semáforo de prioridad ---------------------------------------------
   La prioridad la asigna el sistema municipal (BAJA/MEDIA/ALTA). El color
   nunca va solo: al lado siempre está la palabra, porque cerca del 8% de los
   varones no distingue rojo de verde y el dato quedaría invisible. */

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem 0.16rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.5;
  white-space: nowrap;
}

.priority-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.priority-badge.is-baja {
  border-color: rgb(4 120 87 / 35%);
  background: rgb(4 120 87 / 8%);
  color: #047857;
}

.priority-badge.is-baja .priority-dot {
  background: #059669;
}

.priority-badge.is-media {
  border-color: rgb(180 83 9 / 35%);
  background: rgb(180 83 9 / 8%);
  color: #b45309;
}

.priority-badge.is-media .priority-dot {
  background: #d97706;
}

.priority-badge.is-alta {
  border-color: rgb(190 18 60 / 40%);
  background: rgb(190 18 60 / 9%);
  color: #be123c;
}

.priority-badge.is-alta .priority-dot {
  background: #e11d48;
}

/* Prioridad alta: el punto late para que salte a la vista en una lista de
   reclamos. Se respeta la preferencia de movimiento reducido del sistema. */
@media (prefers-reduced-motion: no-preference) {
  .priority-badge.is-alta .priority-dot {
    animation: priority-pulse 1.8s ease-in-out infinite;
  }
}

@keyframes priority-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(225 29 72 / 45%); }
  50% { box-shadow: 0 0 0 0.28rem rgb(225 29 72 / 0%); }
}

/* Fila de prioridad en la tarjeta de gestión. */
.manage-priority-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.manage-priority-label {
  color: var(--municipal);
  font-size: 0.78rem;
  font-weight: 750;
}

/* Destino de un giro o de una recategorización. Va destacado porque es el
   dato que se busca al abrir el historial de un reclamo derivado. */
.timeline-target {
  display: block;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Cambio de estado. Se muestra junto a la observación, no en su lugar. */
.timeline-transition {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* --- Log de operaciones (panel de administración) ----------------------- */

.oplog-summary {
  display: grid;
  gap: 0.4rem;
  margin: 0.9rem 0;
}

.oplog-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.oplog-counter {
  display: grid;
  min-width: 6.5rem;
  flex: 1 1 auto;
  gap: 0.1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}

.oplog-counter.is-ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.oplog-counter.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.oplog-counter-value {
  font-size: 1.35rem;
  line-height: 1.1;
}

.oplog-counter-label {
  color: var(--muted);
  font-size: 0.76rem;
}

.oplog-error-code,
.oplog-last-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.oplog-last-error {
  color: var(--danger);
}

/* Los campos de fecha del log no necesitan el alto de un campo de formulario
   principal: al lado de la casilla "Solo errores" quedaban desproporcionados. */
.oplog-field .field {
  min-height: 2.6rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
}

/* El botón cierra la tarjeta: sin separación quedaba pegado a los filtros. */
.oplog-download {
  margin-top: 0.2rem;
}

.oplog-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.oplog-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.oplog-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-size: 0.85rem;
}

.manage-screen-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
}

.manage-screen-gallery .claim-detail-photo {
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--canvas);
  cursor: pointer;
}

.manage-screen-gallery .claim-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tablet y desktop: dos columnas, con la gestión fija a la vista. */
@media (min-width: 48rem) {
  /* Con más pantalla el diálogo puede ser más ancho y alto: menos scroll para
     leer la misma descripción. */
  .claim-detail-panel {
    width: min(100%, 30rem);
    max-height: min(100%, 46rem);
  }

  .manage-screen-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(19rem, 1fr);
    align-items: start;
  }

  /* Mientras carga hay una sola celda que debe ocupar todo: el align-items de
     arriba la pegaría al borde superior. */
  .manage-screen-grid:has(> .detail-loading) {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .manage-screen-side {
    position: sticky;
    top: 0;
  }

  .manage-screen-header {
    padding-inline: 1.5rem;
  }

  .manage-screen-scroll {
    padding-inline: 1.5rem;
  }
}

/* Vista de operario: datos del vecino, ubicación e historial. */
.claim-neighbour {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0;
  font-size: 0.88rem;
}

.claim-neighbour dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.claim-neighbour dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.claim-contact-buttons {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.claim-contact-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.claim-contact-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.claim-contact-button:hover {
  background: #e2e8f0;
}

/* WhatsApp es la vía principal de contacto: va en verde sólido. */
.claim-contact-button.is-whatsapp {
  background: #16a34a;
  color: #fff;
}

.claim-contact-button.is-whatsapp:hover {
  background: #12894b;
}

.claim-contact-button.is-phone .claim-contact-icon {
  color: #b91c1c;
}

.claim-contact-button.is-mail .claim-contact-icon {
  color: #7c3aed;
}

.claim-contact-button.is-map {
  margin-top: 0.6rem;
}

/* Mini-log de contactos: mismos tonos que el Portal (ámbar sin contacto,
   verde cuando ya hubo comunicación con el vecino). */
.contact-log {
  margin-top: 0.75rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.45;
}

.contact-log strong {
  display: block;
  color: #0f172a;
}

.contact-log.is-empty {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.contact-log.is-empty strong {
  color: #9a3412;
}

.contact-log.is-done {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.contact-log.is-done strong {
  color: #047857;
}

.contact-log-note {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.contact-log-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.contact-log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.contact-log-badge {
  flex: 0 0 auto;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid currentColor;
  font-size: 0.7rem;
  font-weight: 760;
  line-height: 1.5;
}

.contact-log-badge.is-whatsapp {
  color: #14713c;
}

.contact-log-badge.is-telefono {
  color: #0c5aad;
}

.contact-log-badge.is-email {
  color: #7c3aed;
}

.contact-log-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-log-who {
  font-weight: 640;
  overflow-wrap: anywhere;
}

.contact-log-when {
  opacity: 0.85;
  font-size: 0.76rem;
}

.claim-detail-address-text {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.claim-map-frame {
  display: block;
  /* Separado de las coordenadas de arriba: pegado al texto se leía como parte
     de la lista en vez de como un bloque propio. */
  margin-top: 0.9rem;
  width: 100%;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* Gestión municipal: solo la ven los operarios con permiso sobre el reclamo. */
/* Compartir y Gestionar son un mismo bloque de acciones al pie del detalle:
   van pegados y sin línea divisoria entre ellos. */
.claim-manage {
  margin-top: 0.5rem;
}

.claim-manage-entry {
  width: 100%;
  min-height: 46px;
}

.claim-manage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.claim-manage-back {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.claim-manage-option {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 640;
  cursor: pointer;
}

.claim-manage-option:hover {
  border-color: var(--municipal);
  color: var(--municipal);
}

.claim-manage-option.is-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.claim-manage-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.claim-manage-confirm {
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.claim-manage-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.claim-manage-field-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.claim-manage-field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.claim-manage-select,
.claim-manage-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.claim-manage-textarea {
  resize: vertical;
  line-height: 1.45;
}

.claim-manage-select:focus,
.claim-manage-textarea:focus {
  border-color: var(--municipal);
  outline: 2px solid color-mix(in srgb, var(--municipal) 35%, transparent);
  outline-offset: 1px;
}

.claim-manage-feedback {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.claim-manage-feedback.is-error {
  color: var(--danger);
}

.claim-manage-actions {
  display: flex;
  gap: 0.5rem;
}

.claim-manage-actions > * {
  flex: 1 1 0;
  min-height: 44px;
}

.claim-manage-submit.is-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.claim-detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.claim-detail-photo {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0;
  background: #eef2f6;
  cursor: pointer;
}

.claim-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-lightbox-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgb(8 20 30 / 60%);
}

.photo-lightbox-card {
  position: relative;
  display: inline-flex;
  min-width: 12rem;
  max-width: min(34rem, 92vw);
  max-height: min(34rem, 85vh);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo-lightbox-image-wrap {
  display: flex;
  max-width: inherit;
  max-height: inherit;
}

.photo-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(34rem, 92vw);
  max-height: min(34rem, 85vh);
  object-fit: contain;
}

.photo-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgb(8 20 30 / 55%);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.photo-lightbox-close:hover {
  background: rgb(8 20 30 / 75%);
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgb(8 20 30 / 45%);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.photo-lightbox-nav:hover {
  background: rgb(8 20 30 / 70%);
}

.photo-lightbox-prev {
  left: 0.5rem;
}

.photo-lightbox-next {
  right: 0.5rem;
}

.photo-lightbox-counter {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgb(8 20 30 / 55%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.claim-detail-response {
  margin-top: 0.9rem;
  border: 1px solid rgb(12 90 173 / 18%);
  border-radius: 0.9rem;
  background: rgb(12 90 173 / 5%);
  padding: 0.75rem 0.9rem;
}

.claim-detail-response-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-line;
}

.claim-detail-meta {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.claim-detail-address {
  color: var(--municipal);
  font-weight: 720;
}

.claim-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0 0 0 1.1rem;
  list-style: none;
}

.claim-timeline::before {
  position: absolute;
  top: 0.4rem;
  bottom: 0.6rem;
  left: 0.3rem;
  width: 2px;
  border-radius: 2px;
  background: rgb(8 31 29 / 12%);
  content: "";
}

.claim-timeline-step {
  position: relative;
  display: flex;
  gap: 0.7rem;
  padding: 0.45rem 0;
}

.claim-timeline-dot {
  position: absolute;
  top: 0.95rem;
  left: -1.1rem;
  width: 0.8rem;
  height: 0.8rem;
  border: 2.5px solid #fff;
  border-radius: 999px;
  background: rgb(8 31 29 / 30%);
  box-shadow: 0 0 0 2px rgb(8 31 29 / 10%);
}

.claim-timeline-step.current .claim-timeline-dot {
  background: #16a36a;
  box-shadow: 0 0 0 4px rgb(22 163 106 / 18%);
}

.claim-timeline-step > div {
  display: grid;
  gap: 0.1rem;
}

.claim-timeline-detail {
  color: var(--municipal);
  font-size: 0.85rem;
  font-weight: 760;
}

.claim-timeline-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.claim-detail-share {
  width: 100%;
}

.claim-detail-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--municipal);
  font-size: inherit;
  font-weight: 760;
  cursor: pointer;
  text-decoration: underline;
}

.offline-queue {
  margin: 0 0 0.9rem;
  border: 1px solid rgb(217 119 6 / 40%);
  border-radius: 0.9rem;
  padding: 0.65rem 0.8rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 720;
}

.offline-queue[hidden] {
  display: none;
}

.claim-marker-wrap {
  position: relative;
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.claim-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color, var(--municipal));
  box-shadow: 0 3px 9px rgb(8 31 29 / 35%);
  color: #fff;
  cursor: pointer;
  transform: rotate(-45deg);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.claim-marker::after {
  position: absolute;
  inset: 2.5px;
  border: 1.5px solid rgb(255 255 255 / 55%);
  border-radius: inherit;
  content: "";
}

.claim-marker:hover {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: 0 5px 14px rgb(8 31 29 / 42%);
}

.claim-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  display: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--marker-color, var(--municipal));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.claim-marker-wrap.is-highlighted .claim-marker-pulse {
  display: block;
  animation: claim-marker-pulse 1.6s ease-out infinite;
}

.claim-marker-wrap.is-highlighted .claim-marker {
  animation: claim-marker-bounce 1.6s ease-in-out infinite;
  box-shadow: 0 4px 16px rgb(8 31 29 / 45%);
}

@keyframes claim-marker-pulse {
  0% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.6);
  }
}

@keyframes claim-marker-bounce {
  0%,
  100% {
    transform: rotate(-45deg) translateY(0) scale(1);
  }

  30% {
    transform: rotate(-45deg) translateY(-6px) scale(1.12);
  }

  50% {
    transform: rotate(-45deg) translateY(0) scale(1);
  }
}

.claim-marker-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  transform: rotate(45deg);
  pointer-events: none;
}

.user-location-marker {
  width: 1.15rem;
  height: 1.15rem;
  border: 3px solid white;
  border-radius: 999px;
  background: #087fef;
  box-shadow: 0 0 0 8px rgb(8 127 239 / 18%), 0 5px 14px rgb(0 41 78 / 28%);
}

.user-presence-marker {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #16a36a;
  box-shadow: 0 0 0 5px rgb(22 163 106 / 18%), 0 3px 8px rgb(8 31 29 / 28%);
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.portal-summary {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin-bottom: 1rem;
}

.portal-summary-card {
  padding: 0.9rem 1rem;
}

.portal-summary-card p {
  margin-bottom: 0.2rem;
}

.portal-summary-card strong {
  font-size: 1.5rem;
}

.portal-summary-card.success strong {
  color: #16a36a;
}

.portal-summary-card.warning strong {
  color: #b45f06;
}

.portal-links-section {
  padding: 1rem;
  margin-bottom: 1rem;
}

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

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.portal-table th,
.portal-table td {
  padding: 0.55rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.portal-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-map-card,
.admin-users,
.admin-oplog,
.admin-access {
  padding: 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.admin-map {
  height: min(55dvh, 33rem);
  overflow: hidden;
  border-radius: 1rem;
}

.presence-marker {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--municipal-dark);
  box-shadow: 0 7px 18px rgb(8 31 29 / 25%);
  color: var(--signal);
  font-size: 0.7rem;
  font-weight: 850;
}

.inline-form {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr auto;
  margin: 1rem 0;
}

.user-result {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.user-result strong,
.user-result span {
  display: block;
}

.user-result span {
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.user-edit-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  grid-template-columns: 1fr 1fr 1.6fr auto;
}

.user-edit-form .field.small {
  min-height: 2.5rem;
  border-radius: 0.8rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}

.user-edit-form .button-primary.small {
  min-height: 2.5rem;
}

.reauth-dialog {
  width: min(92vw, 28rem);
  border: 0;
  border-radius: 1.3rem;
  padding: 1.4rem;
  box-shadow: 0 25px 80px rgb(5 28 25 / 38%);
}

.reauth-dialog::backdrop {
  background: rgb(5 20 19 / 62%);
  backdrop-filter: blur(5px);
}

.toast {
  position: fixed;
  z-index: 100;
  top: calc(var(--topbar-height) + 0.8rem);
  right: 1rem;
  max-width: min(24rem, calc(100vw - 2rem));
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--municipal-dark);
  box-shadow: 0 12px 35px rgb(5 28 25 / 32%);
  color: white;
  font-size: 0.88rem;
  font-weight: 650;
}

.install-app {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  min-height: 2.75rem;
  border-radius: 999px;
  background: var(--signal);
  box-shadow: 0 12px 35px rgb(5 28 25 / 24%);
  color: var(--municipal-dark);
}

.app-body .install-app {
  bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgb(16 32 31 / 9%);
  border-radius: 0.85rem !important;
  box-shadow: 0 8px 24px rgb(12 90 173 / 14%) !important;
}

.maplibregl-popup-content {
  max-width: 17rem;
  border-radius: 1rem !important;
  padding: 1rem !important;
  padding-top: 2.2rem !important;
  box-shadow: var(--shadow) !important;
}

.maplibregl-popup-close-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgb(8 31 29 / 8%);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.maplibregl-popup-close-button:hover {
  background: rgb(8 31 29 / 14%);
}

.popup-title {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.popup-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (min-width: 760px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(25rem, 0.85fr);
  }

  .auth-hero {
    min-height: 100dvh;
    padding: 6rem clamp(2rem, 6vw, 6.5rem);
  }

  .auth-hero .auth-brand {
    top: 2rem;
    left: clamp(2rem, 6vw, 6.5rem);
  }

  .auth-card-wrap {
    min-height: 100dvh;
    padding: 2.5rem;
  }

  .topbar {
    padding-inline: 2rem;
  }

  .app-page {
    padding-right: 2rem;
    padding-left: 7.2rem;
  }

  .page-heading.split {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

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

  .app-body .install-app {
    bottom: 1rem;
  }

  .bottom-nav {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 1rem;
    width: 5.2rem;
    height: 17rem;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
    transform: translateY(-50%);
  }

  .bottom-nav .new-action b {
    margin-top: 0;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.2rem;
  }

  .map-page {
    padding-left: 0;
  }

  .map-filter-fab {
    left: 1rem;
    z-index: 45;
  }

  .map-overlay {
    left: 7.2rem;
    z-index: 45;
    /* En escritorio la barra de navegación es un riel al costado izquierdo,
       no una franja abajo: no hay que descontarle alto al panel. */
    max-height: calc(100% - 2rem);
  }

  .admin-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 0.7fr);
  }
}

@media (min-width: 1080px) {
  .claim-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

/* ==========================================================================
   Puerta de ubicación: bloquea el sistema hasta que se active el GPS.
   z-index 500 para quedar sobre todo lo demás (el máximo previo era 200).
   ========================================================================== */

.location-gate {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 2rem);
  padding-bottom: calc(clamp(1rem, 5vw, 2rem) + env(safe-area-inset-bottom));
  background: rgb(9 26 40 / 82%);
  backdrop-filter: blur(6px);
}

.location-gate[hidden] {
  display: none;
}

/* Sin scroll detrás: la puerta no se puede esquivar desplazando la página. */
body.has-location-gate {
  overflow: hidden;
}

.location-gate-panel {
  width: min(26rem, 100%);
  border-radius: 1.35rem;
  padding: 1.6rem 1.4rem;
  background: var(--paper);
  box-shadow: 0 24px 60px rgb(9 26 40 / 35%);
  text-align: center;
}

.location-gate-icon {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--municipal);
}

.location-gate-panel h2 {
  margin: 0.5rem 0 0.4rem;
  font-size: 1.25rem;
}

.location-gate-panel p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.location-gate-panel .button-primary {
  width: 100%;
}

.location-gate-message {
  margin: 0.8rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 1.2rem;
}

/* Panel de cumplimiento: quién está en línea sin compartir ubicación. */
.presence-gaps {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.presence-gap-row {
  display: grid;
  align-items: center;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.5rem 0.7rem;
  background: var(--canvas);
}

.presence-gap-name {
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 620;
}

.presence-gap-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.presence-gap-tag {
  flex: none;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
}

.presence-gap-tag.is-denied {
  background: #fef2f2;
  color: var(--danger);
}

.presence-gap-tag.is-neutral {
  background: rgb(12 90 173 / 8%);
  color: var(--municipal);
}

/* ==========================================================================
   Menú de compartir. Propio y no nativo: en Windows navigator.share() abre el
   selector del sistema, que solo lista apps registradas (Outlook, Teams) y no
   ofrece WhatsApp ni copiar. z-index 210: sobre el lightbox (200), debajo de la
   puerta de ubicación (500), que debe bloquear todo.
   ========================================================================== */

.share-sheet-overlay {
  position: fixed;
  z-index: 210;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
  background: rgb(8 20 30 / 60%);
}

.share-sheet-card {
  width: min(24rem, 100%);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--paper);
  box-shadow: 0 20px 50px rgb(9 26 40 / 30%);
}

.share-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.share-sheet-title {
  font-size: 1rem;
}

.share-sheet-close {
  border: 0;
  border-radius: 999px;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  background: var(--canvas);
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.share-sheet-close:hover {
  color: var(--ink);
}

/* Vista previa del mensaje: se respeta el salto de línea del texto armado y se
   acota la altura para que las descripciones largas no empujen los botones. */
/* Pasos de instalación manual: vive en la misma hoja que compartir. Números
   destacados y renglones aireados, porque se lee con el teléfono en la mano
   mientras se busca cada botón. */
.install-steps {
  margin: 0.8rem 0 0.4rem;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.install-steps li::marker {
  color: var(--municipal);
  font-weight: 800;
}

.share-sheet-preview {
  margin: 0.7rem 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  max-height: 11rem;
  overflow-y: auto;
  background: var(--canvas);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.share-sheet-options {
  display: grid;
  gap: 0.5rem;
}

.share-sheet-option {
  display: block;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.65rem 0.8rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 620;
  font-size: 0.88rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.share-sheet-option:hover {
  border-color: var(--municipal);
  background: rgb(12 90 173 / 6%);
}

.share-sheet-option.is-whatsapp {
  border-color: transparent;
  background: #25d366;
  color: #05391b;
}

/* Lista blanca de acceso, en el panel de administración. */
.access-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.access-grid {
  display: grid;
  gap: 0.75rem 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  /* Cada campo ocupa toda la altura de su celda: sin esto, el que lleva
     leyenda de ayuda estira la fila y los vecinos quedan desalineados. */
  align-items: start;
}

.access-field {
  display: grid;
  gap: 0.3rem;
  /* La etiqueta arriba y el campo abajo, con el campo siempre pegado al tope
     de la celda: así todos los recuadros arrancan a la misma altura. */
  grid-template-rows: auto auto 1fr;
  font-size: 0.8rem;
  font-weight: 620;
  color: var(--muted);
}

/* El campo de texto no debe crecer para rellenar la celda: con grid-template
   -rows el input se estiraba y "Área" quedaba más alto que el resto. */
.access-field .field {
  align-self: start;
}

.access-hint {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}

/* El botón no va a todo el ancho: es una acción puntual, no la acción
   principal de la página. */
.access-submit {
  justify-self: start;
  min-width: 12rem;
}

/* Buscador propio: el .inline-form general mete margen vertical grande y
   acá queda pegado al título de la lista. */
.access-search {
  margin: 0.2rem 0 0.9rem;
}

.access-list {
  display: grid;
  gap: 0.6rem;
}

.access-row {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
}

/* Quien perdió el acceso sigue en la lista, apagado: se conserva el rastro
   de que lo tuvo y quién se lo dio. */
.access-row.is-off {
  opacity: 0.62;
}

.access-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.access-row-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.access-row-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

.access-badge {
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.access-badge.is-off {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.access-badge.is-portal {
  background: color-mix(in srgb, var(--municipal) 12%, transparent);
  color: var(--municipal-dark);
}

.access-badge.is-ok {
  background: color-mix(in srgb, var(--signal) 16%, transparent);
  color: var(--municipal-dark);
}

.button-secondary.is-danger {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
}

/* Aviso previo a contactar al vecino. Reusa la caja del menú de compartir:
   mismo peso visual, y el operario ya la reconoce. */
/* Canal y destino: dato de apoyo, no la frase principal. El margen inferior
   repone la separación con los botones que antes daba la nota larga. */
.contact-consent-text {
  margin: 0.35rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* El botón de aceptar lleva el color municipal y no el verde de WhatsApp:
   el mismo aviso se usa para teléfono y correo. */
.share-sheet-option.is-accept {
  border-color: transparent;
  background: var(--municipal);
  color: #fff;
}

.share-sheet-option.is-accept:hover {
  background: var(--municipal-dark);
}

.share-sheet-option.is-whatsapp:hover {
  background: #1fbe5a;
}
