:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-2: #e9efe9;
  --surface-3: #dce6df;
  --text: #17201b;
  --muted: #5c6a61;
  --border: #cfd9d1;
  --accent: #0c8f74;
  --accent-strong: #066d59;
  --accent-soft: #d9f2eb;
  --coral: #d95f4d;
  --amber: #d08a12;
  --violet: #7864d8;
  --blue: #3676d9;
  --shadow: 0 18px 45px rgba(23, 32, 27, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101412;
  --surface: #181d1a;
  --surface-2: #202820;
  --surface-3: #2b352d;
  --text: #eef5ef;
  --muted: #a5b3aa;
  --border: #354136;
  --accent: #35c7a8;
  --accent-strong: #7be0cb;
  --accent-soft: #123f37;
  --coral: #ff826f;
  --amber: #f1b94b;
  --violet: #a596ff;
  --blue: #80aef6;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34rem),
    linear-gradient(180deg, var(--surface-2), var(--bg) 22rem);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

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

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

button {
  color: inherit;
}

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

img,
svg {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: calc(68px + var(--safe-top));
  padding: var(--safe-top) clamp(16px, 4vw, 40px) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
}

.brand-mark .paw-toe,
.brand-mark .paw-pad {
  fill: currentColor;
}

.brand-mark .paw-cross {
  fill: var(--accent);
}

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

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.theme-toggle,
.icon-button,
.account-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.account-button {
  grid-auto-flow: column;
  gap: 8px;
  width: auto;
  min-width: 44px;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.language-switch {
  display: inline-flex;
  align-items: center;
}

.language-switch select {
  min-width: 74px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

.theme-toggle svg,
.icon-button svg,
.account-button svg,
.quick-icon svg,
.search-field svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.content-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-band {
  padding: clamp(34px, 7vw, 72px) 0 clamp(18px, 4vw, 34px);
}

.hero-band .content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(20px, 5vw, 54px);
  align-items: end;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 8px 0 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rescue-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-action {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 32, 27, 0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.quick-action span:last-child {
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.15;
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.explorer,
.country-view,
.shelter-profile {
  padding: 28px 0;
}

.section-heading,
.directory-head,
.map-toolbar,
.profile-top,
.modal-head,
.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.directory-head h2,
.modal-head h2,
.country-title h2,
.profile-copy h2,
.filter-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.section-meta,
.toolbar-label,
.card-meta,
.animal-meta,
.result-count,
.form-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.explorer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.map-surface,
.country-directory,
.country-map-panel,
.shelter-list-panel,
.profile-media,
.profile-info,
.animal-board,
.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.map-surface {
  overflow: hidden;
}

.map-toolbar {
  min-height: 70px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.map-toolbar strong {
  display: block;
  font-size: 1.1rem;
}

.text-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.europe-map-wrap {
  position: relative;
  min-height: 520px;
  padding: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 12%, transparent), transparent 36%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent 42%),
    var(--surface-2);
}

.leaflet-map {
  width: 100%;
  background: var(--surface-2);
}

.europe-map {
  width: 100%;
  height: min(66vh, 560px);
  min-height: 420px;
}

.leaflet-container {
  z-index: 0;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
}

.leaflet-container a {
  color: var(--accent-strong);
}

.leaflet-control-container .leaflet-control {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(23, 32, 27, 0.12);
}

.leaflet-bar a,
.leaflet-bar a:hover {
  width: 34px;
  height: 34px;
  border-bottom-color: var(--border);
  background: var(--surface);
  color: var(--text);
  line-height: 34px;
}

.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
  font-size: 0.72rem;
}

[data-theme="dark"] .leaflet-tile-pane {
  filter: brightness(0.72) contrast(1.06) saturate(0.78);
}

.country-shape {
  cursor: pointer;
  outline: none;
  transition: fill-opacity 160ms ease, stroke-width 160ms ease;
}

.country-shape:focus {
  outline: none;
}

.leaflet-tooltip {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(23, 32, 27, 0.14);
  color: var(--text);
  font-weight: 800;
}

.shelter-map-marker {
  display: grid;
  place-items: center;
  background: transparent;
}

.shelter-pin-core {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px 999px 999px 2px;
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(23, 32, 27, 0.28);
  transform: rotate(-45deg);
}

.shelter-pin-core i {
  width: 13px;
  height: 13px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: transparent;
  transform: rotate(45deg);
}

.shelter-map-marker.is-selected .shelter-pin-core {
  background: var(--accent);
  transform: rotate(-45deg) scale(1.14);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
}

.leaflet-popup-content-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-popup {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.map-popup strong {
  font-size: 0.98rem;
}

.map-popup span {
  color: var(--muted);
  font-weight: 700;
}

.map-popup button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
  cursor: pointer;
}

.map-fallback {
  display: grid;
  place-items: center;
  min-height: inherit;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.country-path {
  fill: color-mix(in srgb, var(--surface) 84%, var(--accent) 16%);
  stroke: var(--bg);
  stroke-width: 3;
  cursor: pointer;
  transition: fill 160ms ease, transform 160ms ease, filter 160ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.country-path:hover,
.country-path:focus-visible {
  fill: color-mix(in srgb, var(--accent) 42%, var(--surface));
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.18));
  outline: none;
  transform: translateY(-2px);
}

.country-path.is-selected {
  fill: var(--accent);
}

.country-path.is-empty {
  fill: color-mix(in srgb, var(--surface-3) 78%, var(--muted));
}

.map-label {
  pointer-events: none;
  fill: var(--text);
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--surface) 86%, transparent);
  stroke-width: 4px;
  text-anchor: middle;
}

.map-label.is-selected {
  fill: #ffffff;
  stroke: color-mix(in srgb, var(--accent-strong) 70%, transparent);
}

.map-legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: middle;
}

.legend-dot.has-shelters {
  background: var(--accent);
}

.legend-dot.no-shelters {
  background: var(--surface-3);
  border: 1px solid var(--muted);
}

.country-directory {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
}

.directory-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.directory-head span {
  color: var(--muted);
  font-weight: 800;
}

.search-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 14px 16px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.country-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 520px;
  padding: 0 16px 16px;
  overflow: auto;
}

.country-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.country-row:hover,
.country-row:focus-visible,
.country-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  background: var(--accent-soft);
  outline: none;
}

.country-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-row small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.country-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 18px;
}

.country-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.country-title p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.country-map-panel {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 40%),
    linear-gradient(300deg, color-mix(in srgb, var(--coral) 10%, transparent), transparent 44%),
    var(--surface-2);
}

.country-map {
  position: relative;
  min-height: 520px;
  isolation: isolate;
}

.country-silhouette {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  color: color-mix(in srgb, var(--surface) 70%, var(--accent) 10%);
  opacity: 0.95;
  z-index: 0;
}

.country-silhouette path {
  fill: currentColor;
  stroke: color-mix(in srgb, var(--accent) 30%, var(--border));
  stroke-width: 1.2;
}

.map-pin {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.map-pin svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-pin.is-selected,
.map-pin:hover,
.map-pin:focus-visible {
  background: var(--accent);
  outline: none;
  transform: translateY(-2px);
}

.shelter-list-panel {
  overflow: hidden;
}

.shelter-list-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.shelter-list {
  display: grid;
  gap: 10px;
  max-height: 478px;
  padding: 16px;
  overflow: auto;
}

.country-shelters-panel {
  margin-top: 18px;
}

.country-shelter-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
}

.shelter-card,
.animal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.shelter-card {
  display: grid;
  gap: 0;
  text-align: left;
}

.shelter-button {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 104px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.shelter-button:hover,
.shelter-button:focus-visible,
.shelter-card.is-selected .shelter-button {
  background: var(--accent-soft);
  outline: none;
}

.thumb {
  position: relative;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.thumb img,
.media-card img,
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelter-button h3 {
  margin: 1px 0 5px;
  font-size: 1rem;
  line-height: 1.2;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
  font-weight: 900;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.profile-media,
.profile-info,
.animal-board {
  overflow: hidden;
}

.profile-photo {
  height: 340px;
  background: var(--surface-2);
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.media-card {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: #ffffff;
}

.media-card::after {
  position: absolute;
  inset: auto 0 0;
  padding: 26px 8px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
  content: attr(data-label);
  font-weight: 900;
  text-align: left;
}

.media-card.video::before {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  content: "";
  transform: translate(-50%, -50%);
}

.media-card.video span {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #ffffff;
  transform: translate(-35%, -50%);
}

.profile-info {
  padding: 18px;
}

.profile-copy p {
  color: var(--muted);
}

.profile-actions,
.rating-actions,
.filter-grid,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.rating-button,
.select-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

.secondary-button,
.rating-button,
.select-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.rating-button.is-active,
.select-button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.contact-lines {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.contact-lines p {
  margin: 0;
}

.animal-board {
  margin-top: 18px;
  padding: 18px;
}

.filter-grid {
  margin-top: 14px;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.filter-grid input,
.filter-grid select,
.contact-form input,
.contact-form textarea,
.account-form input,
.account-form select,
.account-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

.filter-grid input:focus,
.filter-grid select:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.account-form input:focus,
.account-form select:focus,
.account-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.animal-card {
  display: grid;
  grid-template-rows: 150px minmax(0, 1fr);
}

.animal-visual {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.animal-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}

.species-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
}

.urgency {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  gap: 3px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.5);
}

.urgency i {
  display: block;
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.urgency i.is-on {
  background: var(--coral);
}

.animal-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.animal-body h3 {
  margin: 0;
  font-size: 1.1rem;
}

.animal-body p {
  margin: 0;
  color: var(--muted);
}

.animal-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fact {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.selection-dock {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 16px));
  bottom: max(16px, var(--safe-bottom));
  z-index: 25;
  width: min(380px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.selection-dock header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 900;
}

.selection-dock ul {
  display: grid;
  gap: 8px;
  max-height: 170px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  list-style: none;
}

.selection-dock li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
}

.modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
}

.modal-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.contact-form textarea {
  min-height: 132px;
  resize: vertical;
}

.account-modal {
  width: min(880px, 100%);
}

.account-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.account-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-section h3,
.review-card h4 {
  margin: 0;
  line-height: 1.2;
}

.account-section p,
.review-card p {
  margin: 0;
  color: var(--muted);
}

.account-section pre {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}

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

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-form label,
.segmented-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.account-form textarea {
  min-height: 116px;
  resize: vertical;
}

.account-tabs,
.oauth-row,
.section-row,
.review-actions,
.account-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.account-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.account-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.segmented-field {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segmented-field legend {
  padding: 0 6px;
}

.segmented-field label,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input,
.segmented-field input {
  width: auto;
  min-height: auto;
}

.account-summary {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-pill.is-approved,
.status-pill.approved {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pill.is-pending,
.status-pill.pending,
.status-pill.changes_requested {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--border));
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
  color: var(--amber);
}

.status-pill.rejected {
  border-color: color-mix(in srgb, var(--coral) 55%, var(--border));
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.review-actions {
  align-items: end;
}

.review-actions label {
  flex: 1 1 220px;
}

.form-actions {
  justify-content: flex-end;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

@media (max-width: 1020px) {
  .hero-band .content-shell,
  .explorer-grid,
  .country-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .country-directory {
    min-height: auto;
  }

  .country-list {
    max-height: 320px;
  }

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

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

  .account-form-grid,
  .account-summary {
    grid-template-columns: 1fr;
  }
}

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

  .language-switch select {
    min-width: 66px;
    padding: 0 8px;
  }

  .account-button span {
    display: none;
  }

  .topnav {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(2.2rem, 13vw, 3.6rem);
  }

  .rescue-actions {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .country-title,
  .profile-top,
  .filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .europe-map-wrap,
  .country-map,
  .country-map-panel {
    min-height: 390px;
  }

  .europe-map {
    height: 390px;
    min-height: 390px;
  }

  .map-legend {
    left: 12px;
    right: 12px;
    justify-content: center;
  }

  .country-list {
    max-height: 290px;
  }

  .profile-photo {
    height: 260px;
  }

  .media-strip,
  .country-shelter-list,
  .animal-grid,
  .animal-facts {
    grid-template-columns: 1fr;
  }

  .filter-grid label {
    min-width: 100%;
  }

  .segmented-field {
    grid-template-columns: 1fr;
  }

  .selection-dock {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@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;
  }
}
