:root {
  --bg: #fdfaf4;
  --surface: #ffffff;
  --surface-strong: #f6f8fb;
  --text: #10263a;
  --muted: #435b75;
  --accent: #17344d;
  --accent-soft: #e6eff8;
  --brand-red: #ad2828;
  --metric-good: #2e9c62;
  --metric-ok: #d2a33a;
  --metric-bad: #ad2828;
  --metric-track: #d5dee8;
  --danger: #b53a3a;
  --chip: #e4ebf3;
  --line: rgba(14, 39, 64, 0.12);
  --card-radius: 14px;
  --panel-radius: 16px;
  --shadow-soft: 0 16px 36px rgba(9, 24, 42, 0.18);
  --shadow-card: 0 10px 22px rgba(11, 29, 53, 0.12);
  --page-gutter: clamp(18px, 3.2vw, 72px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Public Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.app-booting {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

.app-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  background: #ffffff;
}

.app-boot-spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 3px solid #d3dbe6;
  border-top-color: #6d7f93;
  animation: app-boot-spin 0.85s linear infinite;
}

.app-boot-message {
  display: none !important;
}

body.app-booting .app-boot-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.app-booting .site-header,
body.app-booting main,
body.app-booting .site-footer {
  visibility: hidden;
}

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

@media (prefers-reduced-motion: reduce) {
  .app-boot-spinner {
    animation: none;
    border-top-color: #d3dbe6;
  }
}

a {
  color: inherit;
}

.container {
  width: min(1240px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(9px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.home-page:not(.member-home) .site-header {
  position: absolute;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.home-page:not(.member-home) .brand,
.home-page:not(.member-home) .main-nav a {
  color: #f7fbff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.46);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Newsreader", serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}

.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.hero-premium {
  padding: 0;
}

.hero-media {
  min-height: 100vh;
  position: relative;
  background-image:
    linear-gradient(130deg, rgba(2, 14, 30, 0.2), rgba(2, 14, 30, 0.45)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=2400&q=80");
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(to top, rgba(3, 13, 25, 0.6), rgba(3, 13, 25, 0.32) 36%, rgba(3, 13, 25, 0.2)),
    radial-gradient(circle at 26% 30%, rgba(255, 255, 255, 0.14), transparent 45%);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 22px;
  width: min(1240px, 92vw);
  margin: 0 auto;
  padding: clamp(92px, 12vh, 142px) 0;
}

.hero-copy-wrap {
  width: min(860px, 100%);
  display: grid;
  gap: 16px;
  color: #f7fbff;
  text-shadow: 0 5px 16px rgba(0, 0, 0, 0.45);
}

.hero-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(241, 248, 255, 0.95);
}

.hero-premium h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(2rem, 4vw, 3.95rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.hero-premium p {
  margin: 0;
  max-width: 760px;
  font-size: 1.12rem;
  line-height: 1.5;
  color: #e7f1fa;
}

.hero-benefits {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.hero-benefits li {
  font-size: 1.02rem;
  line-height: 1.45;
  color: #f6fbff;
}

.hero-avatars {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2px;
}

.hero-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  margin-left: -8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1) 52%),
    linear-gradient(145deg, #3e6e95, #24415c);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.hero-avatar:first-child {
  margin-left: 0;
}

.hero-toolbar {
  margin-top: 0;
  position: relative;
  z-index: 10;
  padding-top: 14px;
  padding-bottom: 10px;
}

.hero-toolbar.container {
  width: 100%;
  padding-inline: var(--page-gutter);
}

.member-home .hero-premium {
  display: none;
}

.member-home .hero-toolbar {
  margin-top: 0;
  padding-top: 14px;
  padding-bottom: 10px;
}

.member-home .grid-container {
  padding-top: 4px;
}

.hero-auth-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(16, 38, 58, 0.16);
  border-radius: 15px;
  padding: 16px 16px 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 14px 32px rgba(7, 20, 35, 0.28);
}

.hero-auth-panel h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 1.9rem;
  line-height: 1.04;
  color: #10263a;
}

.hero-panel-media {
  width: 100%;
  height: 132px;
  border-radius: 12px;
  border: 1px solid rgba(19, 50, 77, 0.2);
  background:
    linear-gradient(to top, rgba(12, 37, 57, 0.3), rgba(12, 37, 57, 0.2)),
    url("https://images.unsplash.com/photo-1534447677768-be436bb09401?auto=format&fit=crop&w=900&q=80");
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}

.hero-panel-play {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: rgba(255, 255, 255, 0.86);
  color: #1f5378;
  padding-left: 5px;
}

.hero-auth-panel p {
  font-size: 0.95rem;
  color: #435b75;
}

.hero-auth-panel small {
  color: #60758b;
  font-size: 0.78rem;
}

.hero-auth-form {
  display: grid;
  gap: 8px;
}

.hero-auth-form input {
  border: 1px solid #c9d8e6;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  background: #fff;
}

.hero-auth-form button {
  border: 1px solid transparent;
  background: #ad2828;
  color: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(173, 40, 40, 0.35);
  transition:
    background-color 170ms ease,
    color 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease,
    transform 170ms ease;
}

.hero-auth-form button:hover {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
  box-shadow: 0 10px 22px rgba(173, 40, 40, 0.24);
  transform: translateY(-1px);
}

.hero-auth-panel.is-hidden {
  display: none;
}

.filter-control input:focus,
.filter-control select:focus,
.modal-form input:focus {
  outline: 2px solid rgba(37, 85, 126, 0.52);
  outline-offset: 1px;
}

.listing-toolbar {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 18px;
  gap: 10px;
}

.toolbar-primary,
.toolbar-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.toolbar-primary {
  flex: 1 1 600px;
}

.toolbar-secondary {
  justify-content: flex-end;
  margin-left: auto;
}

.logo-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.logo-menu-trigger {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 2px 0;
  cursor: pointer;
  border-radius: 12px;
  transition: background 160ms ease;
}

.logo-menu-trigger:focus-visible {
  outline: 2px solid rgba(173, 40, 40, 0.42);
  outline-offset: 3px;
}

.logo-mark {
  width: 58px;
  height: 58px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transition: transform 170ms ease, filter 170ms ease;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.toolbar-caret {
  font-size: 1.05rem;
  color: #55708b;
  font-weight: 700;
  transition: color 170ms ease, transform 170ms ease, opacity 170ms ease;
}

.logo-menu-trigger:hover .logo-mark,
.logo-menu-trigger:focus-visible .logo-mark {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 6px 10px rgba(7, 20, 35, 0.18));
}

.logo-menu-trigger:hover .toolbar-caret,
.logo-menu-trigger:focus-visible .toolbar-caret {
  color: var(--brand-red);
  transform: translateY(1px) scale(1.08);
  opacity: 0.95;
}

.logo-menu-trigger[aria-expanded="true"] .toolbar-caret {
  color: var(--brand-red);
  transform: rotate(180deg);
}

.logo-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #d9e4ef;
  border-radius: 14px;
  box-shadow: 0 18px 32px rgba(7, 20, 35, 0.18);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 30;
}

.logo-menu button {
  border: none;
  background: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  text-align: left;
  font-family: "Public Sans", sans-serif;
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.25;
  color: #1f2630;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.logo-menu button:hover {
  background: #f1f4f8;
  color: #0f1721;
}

.toolbar-button,
.sort-control select,
.sort-direction-toggle,
.toolbar-join-cta {
  min-height: 40px;
  border-radius: 12px;
  font-family: "Public Sans", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.toolbar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #c45d5d;
  background: #fff;
  color: #ad2828;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.toolbar-button:hover {
  border-color: #ad2828;
  background: #f7eeee;
}

.filter-toggle-close,
.compare-label-active {
  display: none;
}

body.filters-open .filter-toggle {
  background: #f7eeee;
}

body.filters-open .filter-toggle-open,
body.compare-mode .compare-label-default {
  display: none;
}

body.filters-open .filter-toggle-close,
body.compare-mode .compare-label-active {
  display: inline;
}

.search-shell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  min-width: min(100%, 250px);
  flex: 0 1 270px;
  padding: 0 8px 0 14px;
  border: 1px solid #b8c0c8;
  border-radius: 999px;
  background: rgba(247, 247, 247, 0.98);
  transition: border-color 150ms ease, background 150ms ease;
}

.search-shell:hover:not(:focus-within) {
  background: rgba(192, 198, 205, 0.34);
}

.search-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0;
  font-size: 1.03rem;
  font-weight: 500;
  color: #616161;
  background: transparent;
}

.search-shell input::placeholder {
  color: #676767;
}

.search-shell:focus-within {
  border-color: var(--brand-red);
  background: #ffffff;
}

.search-shell input:focus,
.search-shell input:focus-visible {
  outline: none;
}

.search-plus {
  width: 30px;
  height: 30px;
  border: 1px solid var(--brand-red);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-red);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.search-plus:hover,
.search-plus:focus-visible {
  background: #f7eeee;
  color: var(--brand-red);
  border-color: var(--brand-red);
}

.search-plus:focus-visible {
  outline: none;
}

.toolbar-join-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  background: #ad2828;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(173, 40, 40, 0.24);
  transition:
    background-color 170ms ease,
    color 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease,
    transform 170ms ease;
}

.toolbar-join-cta:hover {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
  box-shadow: 0 10px 22px rgba(173, 40, 40, 0.22);
  transform: translateY(-1px);
}

.sort-control {
  display: inline-flex;
  align-items: center;
  min-width: min(100%, 330px);
  border: 1px solid #d7e1eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 150ms ease;
}

.sort-control select {
  flex: 1;
  min-width: 0;
  border: none;
  background: #fff;
  padding: 0 16px;
  color: #22384d;
  font-family: "Public Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  appearance: none;
  transition: background 150ms ease;
}

.sort-control select option {
  font-family: "Public Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sort-control select:hover {
  background: rgba(192, 198, 205, 0.3);
}

.sort-control select:focus-visible {
  outline: none;
  background: rgba(192, 198, 205, 0.3);
}

.sort-direction-toggle {
  border: none;
  border-left: 1px solid #d7e1eb;
  border-radius: 0;
  width: 36px;
  height: 40px;
  background: #fff;
  color: #111111;
  display: grid;
  place-items: center;
  padding: 0;
}

.sort-direction-toggle:hover {
  background: rgba(192, 198, 205, 0.3);
  border-left-color: #c9d2dc;
}

.sort-direction-toggle:focus-visible {
  outline: none;
  background: rgba(192, 198, 205, 0.3);
  border-left-color: #c9d2dc;
}

.sort-direction-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.sort-direction-toggle.is-asc .sort-direction-icon {
  transform: rotate(180deg);
}

.teaser-filters {
  display: none;
}

.filter-chip {
  min-height: 38px;
  border: 1px solid #d7e1eb;
  border-radius: 10px;
  background: #fff;
  color: #29465f;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: #c45d5d;
  background: #f6ecec;
  color: #ad2828;
}

.grid-container {
  width: 100%;
  max-width: none;
  padding-inline: var(--page-gutter);
}

.listing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.listing-results {
  min-width: 0;
}

.grid-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 16px;
}

.grid-meta p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 92px;
}

.city-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
  transform: translateY(0) scale(1);
  transition: transform 180ms ease, box-shadow 220ms ease;
}

.city-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 30px rgba(11, 29, 53, 0.2);
}

.city-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.08) 45%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.02) 28%);
}

.save-city-btn {
  position: absolute;
  z-index: 4;
  top: 11px;
  right: 11px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease, background 160ms ease;
}

.save-city-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: transparent;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 160ms ease, stroke 160ms ease;
}

.save-city-label {
  display: none;
}

.city-card:hover .save-city-btn,
.compare-city-panel:hover .save-city-btn,
.compare-city-panel:focus-within .save-city-btn {
  opacity: 1;
  transform: translateY(0);
}

.city-card .save-city-btn.is-saved,
.compare-city-panel .save-city-btn.is-saved {
  opacity: 0;
  transform: translateY(-2px);
}

.city-card:hover .save-city-btn.is-saved,
.compare-city-panel:hover .save-city-btn.is-saved,
.city-card:focus-within .save-city-btn.is-saved,
.compare-city-panel:focus-within .save-city-btn.is-saved {
  opacity: 1;
  transform: translateY(0);
}

.save-city-btn:hover:not(.is-saved),
.save-city-btn:focus-visible:not(.is-saved) {
  color: #ff6363;
}

.save-city-btn:hover:not(.is-saved) svg,
.save-city-btn:focus-visible:not(.is-saved) svg {
  fill: currentColor;
}

.save-city-btn.is-saved {
  color: #ff4f4f;
}

.save-city-btn.is-saved svg {
  fill: currentColor;
}

.save-city-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
  outline: 2px solid rgba(255, 99, 99, 0.65);
  outline-offset: 2px;
}

.save-city-btn.is-popping {
  animation: favorite-pop 300ms cubic-bezier(0.2, 0.85, 0.3, 1.35);
}

@keyframes favorite-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(0) scale(0.78);
  }
  72% {
    transform: translateY(0) scale(1.16);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.card-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: white;
  padding: 12px 12px 11px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.card-front {
  opacity: 1;
  transform: scale(1);
  transition: opacity 180ms ease, transform 180ms ease;
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

.card-top,
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rank-wrap {
  display: flex;
  align-items: flex-start;
}

.price-top {
  margin: 0;
  font-size: clamp(1.25rem, 1.55vw, 1.95rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-align: right;
  white-space: nowrap;
}

.rank {
  font-size: clamp(1.1rem, 1.25vw, 1.4rem);
  font-weight: 800;
  line-height: 1;
}

.card-center {
  text-align: center;
  align-self: center;
  margin-top: 10px;
}

.city-name {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.42rem, 1.5vw, 1.76rem);
  line-height: 1.03;
  font-weight: 800;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.city-location {
  margin: 5px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-strip {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 700;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.metric-left {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: nowrap;
  color: #ffffff;
  font-weight: 800;
}

.metric-health,
.metric-safe {
  line-height: 1.05;
}

.metric-temp {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 800;
}

.card-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 12px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 200ms ease;
  background:
    linear-gradient(to top, rgba(4, 10, 17, 0.95), rgba(4, 10, 17, 0.54) 64%, rgba(4, 10, 17, 0.72)),
    radial-gradient(circle at 20% 6%, rgba(255, 255, 255, 0.12), transparent 42%);
}

.city-card:hover .card-hover,
.card-link:focus-visible .card-hover {
  opacity: 1;
}

.city-card:hover .card-front,
.card-link:focus-visible .card-front {
  opacity: 0;
  transform: scale(0.985);
}

.hover-city {
  margin: 2px 0 0;
  font-family: "Newsreader", serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
}

.hover-location {
  margin: 4px 0 12px;
  font-size: 0.92rem;
  color: #e1e8f2;
  font-weight: 600;
}

.hover-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  justify-content: center;
  flex: 1;
}

.hover-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: center;
  gap: 9px;
}

.hover-label {
  font-size: 0.92rem;
  color: #f2f7fd;
  font-weight: 700;
}

.hover-track {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(213, 222, 232, 0.42);
  overflow: hidden;
  position: relative;
}

.hover-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--metric-good);
  transition: width 260ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
}

.hover-fill::after {
  content: attr(data-value);
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(7, 18, 31, 0.28);
}

.hover-fill.tone-good {
  background: var(--metric-good);
}

.hover-fill.tone-ok {
  background: var(--metric-ok);
}

.hover-fill.tone-bad {
  background: var(--metric-bad);
}

.hover-fill.tone-na {
  background: rgba(120, 138, 158, 0.5);
}

.hover-score {
  display: none;
}

.filter-drawer {
  position: fixed;
  top: 86px;
  left: 12px;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  height: calc(100vh - 98px);
  opacity: 0;
  pointer-events: none;
  align-self: start;
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(7, 20, 35, 0.22);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: opacity 180ms ease, transform 180ms ease;
  transform: translateX(-108%);
}

.filter-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.filter-drawer header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.filter-drawer h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 1.65rem;
}

.filter-section-kicker {
  margin: 0 0 2px;
  color: #7d8c9a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-drawer header button {
  border: 1px solid #c45d5d;
  background: #fff;
  color: #ad2828;
  border-radius: 14px;
  padding: 0 16px;
  min-height: 42px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-caption {
  margin: -2px 0 0;
  color: #55708b;
  font-size: 0.88rem;
}

#filter-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 2px;
}

.filter-section {
  display: grid;
  gap: 12px;
}

.filter-section h3 {
  margin: 0;
  color: #10263a;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-chip-grid .filter-chip {
  width: 100%;
  justify-content: center;
}

.mobile-show-results {
  display: none;
}

.compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 52;
  background: #ad2828;
  color: #fff;
  text-align: center;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 28px rgba(173, 40, 40, 0.26);
}

.compare-bar p {
  margin: 0;
  font-weight: 800;
}

.paywall-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 53;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 72px calc(16px + env(safe-area-inset-bottom)) 22px;
  background: rgba(237, 79, 79, 0.86);
  color: #fff;
  box-shadow: 0 -14px 30px rgba(173, 40, 40, 0.26);
  backdrop-filter: blur(3px);
}

.paywall-cta-bar p {
  margin: 0;
  font-size: clamp(0.92rem, 1.7vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.paywall-cta-action {
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: #b32626;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(21, 30, 43, 0.2);
  transition:
    background-color 170ms ease,
    color 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease,
    transform 170ms ease;
}

.paywall-cta-action:hover {
  background: #ad2828;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(173, 40, 40, 0.3);
  transform: translateY(-1px);
}

.paywall-cta-close {
  position: absolute;
  top: 8px;
  right: 14px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

body.has-paywall-cta .card-grid {
  padding-bottom: 148px;
}

body.has-paywall-cta .city-detail {
  padding-bottom: 132px;
}

.compare-selected {
  outline: 6px solid #ff4f4f;
  outline-offset: -6px;
  box-shadow: 0 18px 34px rgba(173, 40, 40, 0.32);
}

.compare-selected .save-city-btn:not(.is-saved) {
  color: #fff;
}

.compare-modal-card,
.route-modal-card {
  width: min(1180px, 100%);
  background: var(--bg);
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(8, 20, 34, 0.32);
  padding: 24px;
  position: relative;
  display: grid;
  gap: 18px;
}

.compare-modal-card h2,
.route-modal-card h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.8rem, 2.9vw, 2.4rem);
}

.route-modal-hero {
  border-radius: 16px;
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-image: linear-gradient(rgba(7, 18, 31, 0.2), rgba(7, 18, 31, 0.64));
}

#city-route-modal .route-modal-card {
  padding: 0;
  gap: 0;
  overflow-x: hidden;
}

#city-route-modal .route-modal-hero {
  border-radius: 0;
  min-height: 218px;
  position: relative;
}

#city-route-modal .route-modal-tabs {
  padding: 10px 18px 12px;
  border-bottom: 1px solid #dde5ee;
  background: #fff;
}

#city-route-modal .route-modal-tabs a,
#city-route-modal .route-modal-tabs button {
  border: 1px solid #c9d7e5;
  border-radius: 10px;
  padding: 7px 11px;
  color: #355371;
  background: #fff;
  font-size: 0.86rem;
}

#city-route-modal .route-modal-tabs a.is-active,
#city-route-modal .route-modal-tabs button.is-active {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
}

#city-route-modal .route-modal-tabs a:hover:not(.is-active),
#city-route-modal .route-modal-tabs button:hover:not(.is-active) {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
}

#city-route-modal .route-modal-tabs a:active:not(.is-active),
#city-route-modal .route-modal-tabs button:active:not(.is-active) {
  color: #ad2828;
  border-color: #ad2828;
}

#city-route-modal .route-modal-body {
  padding: 12px 18px 18px;
}

#city-route-modal .modal-close {
  z-index: 3;
  top: 12px;
  right: 12px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 5px rgba(7, 18, 31, 0.5);
}

.route-modal-hero-copy p,
.route-modal-hero-copy h2 {
  margin: 0;
}

.route-modal-hero-copy p {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.95;
}

.route-modal-hero-copy h2 {
  margin-top: 5px;
  color: #fff;
  font-size: clamp(2rem, 3vw, 3rem);
}

.route-modal-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.route-modal-tabs a,
.route-modal-tabs button {
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: #2f4358;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.route-modal-tabs a.is-active,
.route-modal-tabs button.is-active {
  color: #ad2828;
  border-bottom-color: #ad2828;
}

.route-modal-tabs a:hover:not(.is-active),
.route-modal-tabs button:hover:not(.is-active) {
  color: #ad2828;
  border-bottom-color: #ad2828;
}

.route-modal-tabs a:active:not(.is-active),
.route-modal-tabs button:active:not(.is-active) {
  color: #ad2828;
  border-bottom-color: #ad2828;
}

.route-modal-body {
  min-height: 260px;
}

.route-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.route-metric-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 8px;
}

.route-metric-card h3 {
  margin: 0;
  color: #51667e;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.route-metric-card p {
  margin: 0;
  color: #0f263a;
  font-size: 1.02rem;
  font-weight: 700;
}

.route-metric-note {
  margin: 0;
  color: #4b627a;
  font-size: 0.83rem;
}

.route-modal-skeleton {
  display: grid;
  gap: 10px;
}

.route-modal-skeleton span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf2f7 0%, #dfe8f1 50%, #edf2f7 100%);
  background-size: 240% 100%;
  animation: route-skeleton 1.2s ease infinite;
}

.route-modal-skeleton span:nth-child(1) {
  width: 92%;
}

.route-modal-skeleton span:nth-child(2) {
  width: 78%;
}

.route-modal-skeleton span:nth-child(3) {
  width: 86%;
}

.route-modal-shared {
  display: grid;
  gap: 12px;
}

.route-modal-hero-open-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(2px);
  color: #fff;
  border-radius: 12px;
  padding: 7px 13px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.route-modal-hero-open-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 16px rgba(7, 18, 31, 0.18);
}

.route-modal-hero-open-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.route-modal-shared .detail-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.route-modal-shared .detail-template-columns {
  margin-top: 0;
}

.compare-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-city-panel {
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}

.compare-city-header {
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background-size: cover;
  background-position: center;
  color: #fff;
}

.compare-city-header p,
.compare-city-header h3 {
  margin: 0;
}

.compare-city-header p {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.94;
}

.compare-city-header h3 {
  font-family: "Newsreader", serif;
  font-size: 2rem;
  line-height: 1;
  margin-top: 6px;
}

.compare-city-metrics {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.compare-city-row {
  display: grid;
  grid-template-columns: minmax(128px, 40%) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.compare-city-label {
  color: #334c64;
  font-weight: 700;
  font-size: 0.92rem;
}

.compare-city-track {
  height: 28px;
  border-radius: 999px;
  background: var(--metric-track);
  overflow: hidden;
  position: relative;
}

.compare-city-track-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 999px;
  background: var(--metric-good);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.compare-city-track-fill.tone-ok {
  background: var(--metric-ok);
}

.compare-city-track-fill.tone-bad {
  background: var(--metric-bad);
}

.compare-city-track-fill.tone-na {
  background: rgba(122, 139, 158, 0.55);
}

.compare-city-track-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(7, 18, 31, 0.25);
  padding: 0 8px;
}

.compare-city-track-empty-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5f738b;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 23, 39, 0.56);
  z-index: 55;
}

.is-hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(7, 18, 31, 0.64);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.compare-route-card {
  max-height: min(90vh, 920px);
  overflow: auto;
}

.route-modal-card {
  max-height: min(90vh, 920px);
  overflow-y: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

body.city-page-transitioning #city-route-modal .route-modal-card {
  opacity: 0;
  transform: translateY(8px) scale(0.995);
}

.compare-route-grid {
  overflow-x: hidden;
  padding-bottom: 2px;
}

.modal-card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(16, 38, 58, 0.16);
  border-radius: 15px;
  box-shadow: 0 14px 32px rgba(7, 20, 35, 0.28);
  padding: 22px;
  position: relative;
  display: grid;
  gap: 14px;
}

@keyframes route-skeleton {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  background: transparent;
  font-size: 1.45rem;
  color: #435b75;
  cursor: pointer;
}

.modal-card h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.7rem, 3.1vw, 2.15rem);
  line-height: 1.05;
  color: #10263a;
}

.modal-card p {
  margin: 0;
  color: #435b75;
}

.notice {
  min-height: 18px;
  font-size: 0.88rem;
  color: #60758b;
  font-weight: 600;
}

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

.modal-form {
  display: grid;
  gap: 8px;
}

.modal-form label {
  color: #10263a;
  font-size: 0.9rem;
  font-weight: 700;
}

.modal-form input {
  border: 1px solid #c9d8e6;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  background: #fff;
}

.modal-form button,
.primary-action,
.ghost-action,
#detail-lock-action,
.filter-toggle,
.compare-toggle,
#reset-filters {
  font: inherit;
}

.modal-form button,
.primary-action,
#detail-lock-action {
  border: 1px solid transparent;
  background: #ad2828;
  color: #fff;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(173, 40, 40, 0.35);
  transition:
    background-color 170ms ease,
    color 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease,
    transform 170ms ease;
}

.modal-form button:hover,
.primary-action:hover,
#detail-lock-action:hover {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
  box-shadow: 0 10px 22px rgba(173, 40, 40, 0.24);
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid #cad5e0;
  background: #fff;
  color: #29435b;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-action {
  border: 1px solid #bdd0e3;
  background: #fff;
  color: #1f4667;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.text-action {
  border: none;
  background: transparent;
  padding: 0;
  color: #2f5578;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer p {
  margin: 0;
  padding: 16px 0 26px;
  font-size: 0.9rem;
  color: var(--muted);
}

.city-detail {
  padding: 28px 0 54px;
  position: relative;
}

.back-link {
  text-decoration: none;
  color: #2e4764;
  font-weight: 700;
}

.city-detail h1 {
  margin: 14px 0 2px;
  font-family: "Newsreader", serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

#detail-location {
  margin: 0 0 14px;
  color: #4b5e75;
  font-weight: 600;
}

.detail-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-section-nav a {
  text-decoration: none;
  border: 1px solid #c9d7e5;
  border-radius: 10px;
  padding: 7px 11px;
  color: #355371;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.detail-section-nav a.is-active {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
}

.detail-section-nav a:hover:not(.is-active) {
  background: #fff;
  color: #ad2828;
  border-color: #ad2828;
}

.detail-section-nav a:active:not(.is-active) {
  color: #ad2828;
  border-color: #ad2828;
}

.detail-section-intro {
  margin: 0 0 16px;
  color: #506984;
}

.detail-section-context {
  margin: 0 0 14px;
  background: #fff;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.detail-section-context-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-section-context h2 {
  margin: 0;
  font-size: 1.1rem;
  font-family: "Public Sans", sans-serif;
}

.detail-section-updated {
  margin: 0;
  color: #6a8198;
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-section-summary,
.detail-section-takeaway {
  margin: 0;
  color: #415b74;
}

.detail-section-takeaway {
  font-weight: 700;
  color: #2d4762;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  transition: filter 180ms ease;
}

.detail-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.detail-card h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #52657d;
}

.detail-card p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-template-columns {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  transition: filter 180ms ease;
}

.detail-rows-block {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.detail-rows-heading-wrap {
  display: flex;
  align-items: baseline;
}

.detail-rows-heading {
  margin: 0;
  font-size: 0.88rem;
  color: #52657d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-rows-grid .route-metric-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.detail-ledger-shell {
  margin-top: 0;
}

.detail-ledger-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: min(68vh, 620px);
  overflow-y: auto;
  padding-right: 4px;
}

.detail-ledger-column {
  display: grid;
  gap: 0;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.detail-ledger-row {
  display: grid;
  grid-template-columns: minmax(142px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4ecf4;
}

.detail-ledger-row:last-child {
  border-bottom: none;
}

.detail-ledger-label {
  color: #334f68;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.detail-ledger-track {
  height: 28px;
  border-radius: 999px;
  background: var(--metric-track);
  overflow: hidden;
  position: relative;
}

.detail-ledger-track-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 999px;
  background: var(--metric-good);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.detail-ledger-track-fill.tone-ok {
  background: var(--metric-ok);
}

.detail-ledger-track-fill.tone-bad {
  background: var(--metric-bad);
}

.detail-ledger-track-fill.tone-na {
  background: rgba(122, 139, 158, 0.52);
}

.detail-ledger-track-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(7, 18, 31, 0.25);
  padding: 0 10px;
}

.detail-ledger-track-empty-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5f738b;
  font-size: 0.88rem;
  font-weight: 700;
}

.detail-source-link.is-placeholder {
  text-decoration: none;
  cursor: default;
}

.detail-template-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid #d8e3ef;
}

.detail-template-card h2 {
  margin: 0 0 10px;
  color: #334d66;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-points-list,
.detail-sources-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.detail-points-list li,
.detail-sources-list li {
  border: 1px solid #e1e9f2;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.detail-point-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.detail-point-label {
  color: #38516a;
  font-weight: 700;
  font-size: 0.9rem;
}

.detail-point-value {
  color: #10263a;
  font-weight: 800;
}

.detail-point-note,
.detail-source-note {
  margin: 0;
  color: #55708b;
  font-size: 0.84rem;
}

.detail-source-link {
  color: #1f4e77;
  font-weight: 700;
  text-decoration: none;
}

.detail-source-meta {
  margin: 4px 0 0;
  color: #6b8198;
  font-size: 0.81rem;
}

.detail-lock {
  margin-top: 16px;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.detail-lock[hidden] {
  display: none !important;
}

.detail-lock h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 1.55rem;
}

.detail-lock p {
  margin: 0;
  color: #4f6984;
}

#city-detail-root.is-locked .detail-grid {
  filter: blur(5px);
  pointer-events: none;
}

#city-detail-root.is-locked .detail-section-context,
#city-detail-root.is-locked .detail-template-columns,
#city-detail-root.is-locked .detail-ledger-shell {
  filter: blur(5px);
  pointer-events: none;
}

body.city-page {
  background: var(--bg);
}

.city-page .site-header {
  display: none;
}

.city-page .city-detail {
  padding: 0 0 54px;
}

.city-detail-shell {
  position: relative;
}

.city-hero {
  position: relative;
}

.city-hero-media {
  min-height: 430px;
  background:
    linear-gradient(130deg, rgba(2, 14, 30, 0.2), rgba(2, 14, 30, 0.45)),
    url("https://images.unsplash.com/photo-1492571350019-22de08371fd3?auto=format&fit=crop&w=2400&q=80");
  background-size: cover;
  background-position: center;
}

.city-hero-overlay {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 26px var(--page-gutter) 34px;
  position: relative;
  background:
    linear-gradient(to top, rgba(3, 13, 25, 0.62), rgba(3, 13, 25, 0.28) 36%, rgba(3, 13, 25, 0.16)),
    radial-gradient(circle at 26% 30%, rgba(255, 255, 255, 0.14), transparent 45%);
}

.city-hero-topbar {
  position: absolute;
  top: 18px;
  left: var(--page-gutter);
  right: var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.city-hero-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.city-hero-logo-menu .logo-menu-trigger {
  gap: 8px;
}

.city-hero-logo-menu .logo-mark {
  width: 76px;
  height: 76px;
}

.city-page .city-hero-topbar .toolbar-caret {
  color: #f2f6fb;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.42);
}

.city-page .city-hero-topbar .logo-menu {
  top: calc(100% + 8px);
}

.city-hero-search {
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(330px, 58vw);
}

.city-hero-search-shell {
  width: 100%;
  min-width: 0;
}

.city-hero-search-submit {
  flex: 0 0 auto;
}

.city-hero-favorite-btn {
  position: static;
  top: auto;
  right: auto;
  width: auto;
  min-width: 102px;
  min-height: 50px;
  height: auto;
  padding: 0 14px;
  border-radius: 13px;
  border: 1.5px solid transparent;
  background: var(--brand-red);
  color: #fff;
  opacity: 1;
  transform: none;
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 10px 20px rgba(8, 14, 22, 0.2);
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 160ms ease;
}

.city-hero-favorite-btn.save-city-btn svg {
  display: none;
}

.city-hero-favorite-btn .save-city-label {
  display: inline;
  font-family: "Public Sans", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.city-hero-favorite-btn.is-saved {
  color: #fff;
  background: var(--brand-red);
  border-color: transparent;
}

.city-hero-favorite-btn:hover:not(.is-saved),
.city-hero-favorite-btn:focus-visible:not(.is-saved),
.city-hero-favorite-btn.is-saved:hover,
.city-hero-favorite-btn.is-saved:focus-visible {
  color: var(--brand-red);
  background: transparent;
  border-color: var(--brand-red);
  box-shadow: none;
  transform: none;
}

.city-hero-favorite-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.66);
  outline-offset: 3px;
}

.city-hero-favorite-btn[aria-busy="true"] {
  opacity: 0.74;
  cursor: wait;
}

.city-hero-heading {
  text-align: center;
  color: #fff;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.city-hero-heading #detail-name {
  margin: 0;
  font-family: "Public Sans", sans-serif;
  font-size: clamp(2.35rem, 5.1vw, 4.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: #fff;
}

.city-hero-heading #detail-location {
  margin: 8px 0 0;
  color: #e8eef5;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.city-detail-tabs-shell {
  background: #fff;
  border-bottom: 1px solid #d9e3ee;
  box-shadow: 0 6px 18px rgba(11, 29, 53, 0.08);
}

.city-detail-tabs-inner {
  padding: 10px 0 12px;
  display: grid;
  gap: 10px;
}

.city-page .back-link {
  text-decoration: none;
  color: #355371;
  font-size: 0.9rem;
  font-weight: 700;
  width: fit-content;
}

.city-page .detail-section-nav.city-detail-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  margin: 0;
  padding-bottom: 2px;
}

.city-page .detail-section-nav.city-detail-tabs a {
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.city-detail-content {
  padding-top: 18px;
}

.profile-page {
  min-height: 100vh;
}

.profile-shell {
  min-height: 100vh;
  padding: 20px var(--page-gutter) 60px;
}

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

.profile-topbar .logo-menu-wrap {
  flex: 0 0 auto;
}

.profile-topbar .profile-topbar-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-topbar-link {
  color: #355371;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-card {
  width: min(760px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d9e3ee;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(11, 29, 53, 0.12);
  padding: clamp(18px, 3.6vw, 30px);
  display: grid;
  gap: 14px;
}

.profile-card h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.9rem, 3.8vw, 2.35rem);
  line-height: 1.04;
}

.profile-card p {
  margin: 0;
  color: #435b75;
}

.profile-status {
  min-height: 18px;
  font-size: 0.9rem;
  color: #355371;
  font-weight: 600;
}

.profile-status.is-error {
  color: var(--danger);
}

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

.profile-field {
  display: grid;
  gap: 6px;
}

.profile-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #10263a;
}

.profile-field small {
  color: #60758b;
}

.profile-field input,
.profile-field textarea {
  border: 1px solid #c9d8e6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.98rem;
  font-family: "Public Sans", sans-serif;
  color: #10263a;
  background: #fff;
}

.profile-field textarea {
  min-height: 108px;
  resize: vertical;
}

.profile-field input[readonly],
.profile-field textarea[readonly] {
  background: #f5f8fc;
  color: #45586f;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-primary-action {
  border: 1px solid transparent;
  background: var(--brand-red);
  color: #fff;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 16px;
  font-family: "Public Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(173, 40, 40, 0.28);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.profile-primary-action:hover,
.profile-primary-action:focus-visible {
  background: #fff;
  color: var(--brand-red);
  border-color: var(--brand-red);
  box-shadow: 0 10px 22px rgba(173, 40, 40, 0.2);
}

.profile-public-url {
  font-size: 0.9rem;
  font-weight: 700;
  color: #29465f;
}

.profile-public-url a {
  color: var(--brand-red);
  text-decoration: none;
}

.profile-public-url a:hover,
.profile-public-url a:focus-visible {
  text-decoration: underline;
}

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

@media (max-width: 1280px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1220px) {
  .toolbar-primary {
    flex: 1 1 100%;
  }

  .toolbar-secondary {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 1060px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-content {
    grid-template-columns: 1fr;
    padding-bottom: 42px;
  }

  .hero-auth-panel {
    width: min(500px, 86vw);
    margin-inline: auto;
    padding: 14px 14px 12px;
    gap: 8px;
  }

  .hero-panel-media {
    height: 112px;
  }

  .hero-auth-panel h2 {
    font-size: 1.58rem;
  }

  .hero-auth-panel p {
    font-size: 0.9rem;
  }

  .hero-auth-form input,
  .hero-auth-form button {
    padding: 9px 11px;
  }

  .sort-control {
    min-width: 280px;
  }
}

@media (max-width: 820px) {
  .city-hero-overlay {
    padding-top: 78px;
    min-height: 390px;
  }

  .city-hero-media {
    min-height: 390px;
  }

  .city-hero-logo-menu .logo-mark {
    width: 64px;
    height: 64px;
  }

  .city-hero-search {
    max-width: min(280px, 56vw);
  }

  .city-hero-favorite-btn {
    min-width: 98px;
    min-height: 46px;
    padding: 0 12px;
  }

  .city-hero-favorite-btn .save-city-label {
    font-size: 0.98rem;
  }

  .city-hero-heading #detail-location {
    font-size: 1rem;
  }

  .header-row {
    flex-wrap: wrap;
    align-items: center;
  }

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

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

  .listing-layout,
  body.filters-open .listing-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(380px, 100vw);
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 22px 22px 0;
    border-left: none;
    box-shadow: 16px 0 32px rgba(7, 20, 35, 0.18);
    transform: translateX(-102%);
    opacity: 1;
  }

  .filter-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-show-results {
    position: sticky;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 14px 14px 0 0;
    background: #ad2828;
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    margin-top: auto;
    box-shadow: 0 -10px 22px rgba(173, 40, 40, 0.2);
  }
}

@media (max-width: 760px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .city-card {
    max-width: none;
  }

  .card-hover {
    display: none;
  }

  .hero-media,
  .hero-overlay {
    min-height: 94vh;
  }

  .hero-content {
    padding-top: 104px;
  }

  .hero-toolbar {
    margin-top: 0;
  }

  .hero-auth-panel h2 {
    font-size: 1.5rem;
  }

  .listing-toolbar {
    gap: 10px;
    padding: 10px;
  }

  .toolbar-primary,
  .toolbar-secondary {
    flex-wrap: wrap;
    gap: 10px;
  }

  .toolbar-button,
  .sort-control,
  .search-shell {
    min-width: 0;
  }

  .search-shell {
    flex: 1 1 200px;
  }

  .toolbar-join-cta {
    display: none;
  }

  .compare-route-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 2px;
  }

  .compare-route-tabs a,
  .compare-route-tabs button {
    padding: 7px 8px;
    font-size: 0.85rem;
  }

  .compare-route-card {
    width: min(100vw, 100%);
    height: min(96vh, 96vh);
    border-radius: 0;
    padding: 14px;
  }

  .route-modal-card {
    width: min(100vw, 100%);
    height: min(96vh, 96vh);
    border-radius: 0;
    padding: 14px;
    gap: 12px;
    overflow: auto;
  }

  .route-modal-hero {
    min-height: 140px;
    padding: 12px;
  }

  #city-route-modal .route-modal-card {
    padding: 0;
    gap: 0;
  }

  #city-route-modal .route-modal-tabs {
    padding: 8px 14px 10px;
  }

  #city-route-modal .route-modal-body {
    padding: 10px 14px 14px;
  }

  .route-modal-hero-open-btn {
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .route-modal-hero-copy h2 {
    font-size: 2rem;
  }

  .route-metric-grid {
    grid-template-columns: 1fr;
  }

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

  .compare-city-header {
    min-height: 124px;
    padding: 10px;
  }

  .compare-city-header p {
    font-size: 0.74rem;
  }

  .compare-city-header h3 {
    font-size: clamp(1.3rem, 6.2vw, 1.85rem);
    margin-top: 4px;
  }

  .compare-city-metrics {
    padding: 10px;
    gap: 8px;
  }

  .compare-city-row {
    grid-template-columns: minmax(112px, 40%) minmax(0, 1fr);
    gap: 8px;
  }

  .compare-city-label {
    font-size: 0.84rem;
    line-height: 1.2;
  }

  .compare-city-track {
    height: 24px;
  }

  .compare-city-track-text,
  .compare-city-track-empty-text {
    font-size: 0.76rem;
  }

  .paywall-cta-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 56px calc(14px + env(safe-area-inset-bottom)) 14px;
  }

  .paywall-cta-bar p {
    width: 100%;
    font-size: 0.95rem;
  }

  .paywall-cta-action {
    width: 100%;
    max-width: 220px;
    justify-content: center;
    display: inline-flex;
  }
}

@media (max-width: 520px) {
  .city-hero-topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .city-hero-topbar-left {
    width: 100%;
  }

  .city-hero-logo-menu .logo-mark {
    width: 56px;
    height: 56px;
  }

  .city-hero-search {
    flex: 1 1 auto;
  }

  .city-hero-search-shell {
    width: 100%;
  }

  .city-hero-favorite-btn {
    margin-left: auto;
    min-height: 44px;
    min-width: 94px;
    padding: 0 12px;
  }

  .city-hero-favorite-btn .save-city-label {
    font-size: 0.94rem;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

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

  .hero-premium h1 {
    font-size: clamp(1.9rem, 9vw, 2.35rem);
  }

  .grid-container {
    padding-inline: 12px;
  }

  .toolbar-primary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .toolbar-secondary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .logo-menu {
    min-width: 220px;
  }

  .filter-chip-grid {
    grid-template-columns: 1fr 1fr;
  }

  .paywall-cta-bar {
    padding-right: 44px;
  }

  .paywall-cta-action {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .detail-ledger-columns {
    grid-template-columns: 1fr;
    max-height: min(62vh, 560px);
  }

  .detail-ledger-row {
    padding: 10px;
    grid-template-columns: minmax(118px, 40%) minmax(0, 1fr);
  }

  .detail-ledger-label {
    font-size: 0.82rem;
  }

  .detail-ledger-track {
    height: 24px;
  }

  .detail-ledger-track-text,
  .detail-ledger-track-empty-text {
    font-size: 0.78rem;
  }
}

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

  .toolbar-primary,
  .toolbar-secondary {
    grid-template-columns: 1fr;
  }

  .search-shell,
  .sort-control,
  .toolbar-button,
  .toolbar-join-cta {
    width: 100%;
  }

  .logo-menu-wrap {
    justify-self: start;
  }
}
