:root {
  --ink: #0b2f3f;
  --muted: #667985;
  --teal: #006a70;
  --teal-dark: #004f59;
  --gold: #f5b642;
  --line: #dfe7e9;
  --paper: #ffffff;
  --mist: #f4f8f7;
  --soft-blue: #e8f6f8;
  --soft-gold: #fff1d2;
  --shadow: 0 18px 44px rgba(15, 48, 60, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 230, 184, 0.42), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(184, 229, 235, 0.72), transparent 25rem),
    linear-gradient(180deg, #fff 0%, #f7fbfa 100%);
}

html:has(.postcard-detail-page),
body:has(.postcard-detail-page) {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 330px) auto;
  align-items: center;
  gap: 28px;
  padding: 22px clamp(22px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(223, 231, 233, 0.7);
  backdrop-filter: blur(18px);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(180px, 18vw, 258px);
  height: auto;
  object-fit: contain;
}

.brand-logo-mark {
  display: none;
}

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: 36px;
}

.desktop-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0d3344;
  font-weight: 800;
}

.desktop-nav .icon {
  color: var(--teal);
}

.header-search,
.search-box {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f8;
}

.header-search input,
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 14px 18px;
  color: var(--ink);
}

.header-search button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: 5px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}

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

.header-auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.solid-button,
.gold-button,
.primary-button,
.outline-button,
.light-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid #9fb0b8;
  background: #fff;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 230px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #fff;
  font-weight: 900;
}

.member-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-nav-button {
  gap: 8px;
  padding-inline: 16px;
}

.upload-nav-button .icon {
  width: 20px;
  height: 20px;
}

.solid-button,
.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #007a80, #005b63);
  box-shadow: 0 12px 24px rgba(0, 106, 112, 0.22);
}

.gold-button {
  width: max-content;
  color: #fff;
  background: linear-gradient(135deg, #f5bd52, #eaa52e);
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
}

.app {
  min-height: calc(100vh - 100px);
}

.home-shell {
  width: min(1200px, calc(100% - 44px));
  margin: 0 auto;
  padding: 0 0 26px;
}

.home-shell.search-mode #popular,
.home-shell.search-mode #latest,
.home-shell.search-mode .feature-strip {
  display: none;
}

.home-shell.country-mode {
  padding-top: 4px;
}

.home-shell.country-mode .explore-section {
  padding-top: 10px;
}

#popular,
#latest,
#search,
.feature-strip {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: #fff;
}

.hero > img {
  width: 100%;
  aspect-ratio: 1280 / 500;
  height: auto;
  object-fit: cover;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.hero-dots .active {
  width: 24px;
  border-radius: 999px;
  background: var(--teal);
}

.api-note {
  margin: 14px 0 0;
  padding: 10px 14px;
  color: var(--teal-dark);
  border: 1px solid #cfe1e2;
  border-radius: 10px;
  background: #eef8f8;
  font-size: 14px;
}

.skeleton-box,
.skeleton-card,
.skeleton-image,
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: #edf3f3;
}

.skeleton-box::after,
.skeleton-card::after,
.skeleton-image::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
  animation: skeleton-shimmer 1.35s infinite;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.is-loading .hero.skeleton-box {
  aspect-ratio: 1280 / 500;
  min-height: 260px;
}

.skeleton-card {
  min-height: 182px;
}

.skeleton-postcard {
  pointer-events: none;
}

.skeleton-postcard .skeleton-image {
  width: 100%;
  height: clamp(160px, 16vw, 230px);
}

.skeleton-line {
  display: block;
  width: 72%;
  height: 14px;
  margin: 8px 0;
  border-radius: 999px;
}

.skeleton-line.wide {
  width: 88%;
  height: 18px;
}

.skeleton-line.short {
  width: 44%;
}

.section-block {
  padding: 34px 0 0;
}

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

.section-heading h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.section-heading h2 small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.section-heading .explore-title {
  font-size: 24px;
}

.section-heading h2 span,
.section-heading h2 .icon {
  color: var(--teal);
}

.section-heading p {
  margin: 4px 0 0 40px;
  color: var(--muted);
  font-size: 14px;
}

.section-heading a,
.link-button {
  color: var(--teal-dark);
  font-weight: 800;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.link-button.active {
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--teal);
}

.postcard-row {
  display: grid;
  gap: 20px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  overflow: visible;
  padding: 2px 0 12px;
}

.home-shell.country-mode .country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  overflow: visible;
  padding: 2px 0 10px;
  scroll-snap-type: none;
}

.home-shell.country-mode .country-card {
  flex: initial;
  scroll-snap-align: none;
}

.postcard-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.postcard-row.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.country-card,
.postcard-card,
.search-panel,
.feature-strip,
.auth-card,
.notice,
.success-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 48, 60, 0.07);
}

.country-card {
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.country-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(15, 48, 60, 0.12);
}

.country-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 106, 112, 0.14), 0 16px 30px rgba(15, 48, 60, 0.12);
}

.country-card img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
}

.postcard-card div {
  padding: 14px 16px;
}

.country-card div {
  padding: 10px 12px 11px;
}

.country-card h3,
.postcard-card h3 {
  margin: 0;
  font-size: 18px;
}

.country-card h3 {
  font-size: 16px;
}

.country-card small,
.postcard-card p {
  color: var(--muted);
}

.country-card p {
  margin: 5px 0 0;
  font-size: 13px;
}

.postcard-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.postcard-card img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1.35;
  height: auto;
  object-fit: cover;
}

.postcard-image-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.postcard-card h3 a {
  color: inherit;
  text-decoration: none;
}

.postcard-card h3 a:hover,
.postcard-card h3 a:focus-visible {
  color: var(--teal-dark);
}

.postcard-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: #2a4552;
  font-size: 14px;
}

.favorite-button {
  border: 0;
  padding: 0;
  color: #2a4552;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.favorite-button.active {
  color: #d95b43;
}

.favorite-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #2a4552;
  font-weight: 800;
  white-space: nowrap;
}

.favorite-count .icon {
  width: 17px;
  height: 17px;
  color: var(--teal-dark);
}

.favorite-icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid rgba(0, 106, 112, 0.2);
  border-radius: 50%;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.catalog-panel .favorite-icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(15, 48, 60, 0.14);
  backdrop-filter: blur(8px);
}

.home-shell.catalog-only-mode {
  padding-top: 18px;
}

.favorite-icon-button.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.favorite-icon-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.rank,
.new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  min-width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--gold);
  font-weight: 900;
}

.new-badge {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  background: var(--teal);
}

.search-panel {
  display: grid;
  grid-template-columns: 250px 1fr 270px;
  gap: 26px;
  align-items: center;
  margin-top: 28px;
  padding: 28px 34px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.95), rgba(232, 246, 248, 0.9)),
    radial-gradient(circle at 88% 30%, rgba(245, 182, 66, 0.2), transparent 12rem);
}

.search-title {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-title span {
  color: var(--teal);
  font-size: 40px;
}

.search-title h2 {
  margin: 0;
}

.search-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.search-box {
  background: #fff;
}

.search-box .solid-button {
  margin-right: 6px;
  min-height: 46px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span,
.tags button {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e7f2f2;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

  .search-results {
    scroll-margin-top: 120px;
  }

  .result-card {
    grid-template-columns: 82px 1fr auto;
  }

  .result-card img {
    width: 82px;
    height: 72px;
  }

.result-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.result-card img {
  width: 96px;
  height: 78px;
  border-radius: 10px;
  object-fit: cover;
}

.result-image-link {
  display: block;
  width: 96px;
  height: 78px;
}

.result-card h3,
.result-card p {
  margin: 0;
}

.result-card h3 a {
  color: inherit;
  text-decoration: none;
}

.result-card h3 a:hover,
.result-card h3 a:focus-visible {
  color: var(--teal);
}

.result-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.catalog-panel {
  scroll-margin-top: 120px;
}

.catalog-lightbox {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.catalog-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 30, 40, 0.46);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.catalog-modal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  width: min(1280px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  min-width: 0;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.catalog-lightbox .catalog-modal {
  margin-top: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 90px rgba(15, 48, 60, 0.26);
}

.catalog-sidebar {
  min-width: 0;
  padding: 8px 0 0;
  border-right: 1px solid var(--line);
}

.catalog-sidebar-heading {
  display: grid;
  gap: 6px;
  padding: 0 18px 18px 0;
  border-bottom: 1px solid var(--line);
}

.catalog-sidebar-heading strong {
  color: var(--teal-dark);
  font-size: 20px;
}

.catalog-sidebar-heading span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.catalog-city-list {
  display: grid;
  gap: 10px;
  max-height: 610px;
  overflow-y: auto;
  padding: 18px 18px 0 0;
}

.catalog-city-list button {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.catalog-city-list button.active {
  border-color: #cfe3e5;
  background: #eaf5f5;
}

.catalog-city-list img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.catalog-city-list span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.catalog-city-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-city-list small {
  color: var(--muted);
}

.catalog-main {
  min-width: 0;
  overflow: hidden;
}

.catalog-lightbox .catalog-main {
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 4px;
}

.catalog-lightbox .catalog-city-list {
  max-height: calc(100vh - 190px);
}

.catalog-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.catalog-place {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.catalog-place img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
}

.catalog-place h2,
.catalog-place p {
  margin: 0;
}

.catalog-place h2 {
  overflow-wrap: anywhere;
  font-size: 30px;
}

.catalog-place p {
  margin-top: 6px;
  color: var(--muted);
}

.catalog-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
}

.catalog-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
}

.mobile-catalog-close {
  display: none;
}

.catalog-modal-tools {
  display: grid;
  grid-template-columns: minmax(240px, 480px) auto auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
  margin: 20px 0 24px;
}

.catalog-count {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.catalog-search {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.catalog-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  background: transparent;
}

.catalog-search button {
  width: 48px;
  height: 48px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}

.catalog-tools {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.city-tabs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 4px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.home-shell.country-mode .city-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  overflow: visible;
  padding: 2px 0 10px;
  scroll-snap-type: none;
}

.city-rail {
  margin-top: 10px;
  padding: 18px 20px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 48, 60, 0.07);
}

.city-rail p {
  margin: 0;
  color: var(--muted);
}

.city-rail-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.city-rail-title strong {
  font-size: 20px;
}

.city-rail-title span {
  color: var(--muted);
  font-size: 14px;
}

.city-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.city-tabs button.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.city-tabs span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e7f2f2;
  font-size: 12px;
}

.city-tabs button.active span {
  color: var(--teal-dark);
  background: #fff;
}

.city-card {
  flex: 0 0 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-shell.country-mode .city-card {
  flex: initial;
  scroll-snap-align: none;
}

.city-card:hover,
.city-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 48, 60, 0.12);
}

.city-card:focus-visible {
  outline: 3px solid rgba(0, 106, 112, 0.2);
  outline-offset: 2px;
}

.city-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 106, 112, 0.14);
}

.city-card img {
  width: 100%;
  aspect-ratio: 1.42;
  object-fit: cover;
}

.city-card div {
  padding: 12px 14px 14px;
}

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

.city-card h3 {
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.catalog-modal .catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-modal .postcard-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.catalog-modal .postcard-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(160px, 16vw, 230px);
  aspect-ratio: auto;
  background: #f3f7f7;
  object-fit: cover;
}

.catalog-modal .postcard-card h3,
.catalog-modal .postcard-card p,
.catalog-modal .postcard-card footer {
  overflow-wrap: anywhere;
}

.postcard-card .postcard-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.postcard-card .postcard-title-row h3 {
  min-width: 0;
  line-height: 1.35;
}

.postcard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.postcard-number {
  display: inline-block;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.postcard-details {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
}

.postcard-detail-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: #31515b;
  background: #f3f7f7;
  font-size: 13px;
}

.postcard-detail-row span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.postcard-detail-row strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-coordinate-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 106, 112, 0.24);
  border-radius: 50%;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
}

.copy-coordinate-button .icon {
  width: 16px;
  height: 16px;
}

.copy-coordinate-button:hover,
.copy-coordinate-button:focus-visible {
  border-color: var(--teal);
  outline: 0;
}

.coordinate-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(0, 106, 112, 0.24);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.coordinate-login-button:hover,
.coordinate-login-button:focus-visible {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 8px 18px rgba(0, 106, 112, 0.12);
}

.postcard-detail-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  height: calc(100dvh - 128px);
  min-height: 0;
  padding: 14px 0 16px;
  overflow: hidden;
}

.postcard-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.detail-actions.detail-toolbar-actions {
  display: none;
  margin-top: 0;
  padding-top: 0;
}

.postcard-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 20px;
  align-items: stretch;
  height: calc(100% - 42px);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(15, 48, 60, 0.1);
  overflow: hidden;
}

.postcard-detail-media {
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(225, 190, 112, 0.22), transparent 30%),
    linear-gradient(135deg, #eff8f7, #f8f2e2);
}

.postcard-detail-image-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.postcard-detail-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.postcard-detail-content {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: clamp(14px, 2vw, 24px);
  overflow: hidden;
}

.detail-kicker {
  margin-bottom: 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.postcard-detail-content h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.detail-badges,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-badges span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #2d4d58;
  background: #eef7f7;
  font-size: 12px;
  font-weight: 900;
}

.detail-tags {
  margin: 10px 0;
}

.detail-tags button {
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  color: #334e5a;
  background: #f1f5f5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.detail-facts {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.detail-facts div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: #f7fafa;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-facts dd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.detail-actions {
  margin-top: auto;
  padding-top: 10px;
}

.detail-actions .solid-button,
.detail-actions .outline-button {
  min-height: 36px;
  margin-top: 0;
  padding: 0 14px;
  font-size: 13px;
}

.detail-actions .detail-favorite-button {
  flex: 0 0 auto;
  width: auto;
  border: 1px solid var(--teal);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #fff;
  box-shadow: none;
  padding: 0 14px;
}

.detail-favorite-button.active {
  color: var(--teal-dark);
  border-color: var(--teal);
  background: #fff;
}

.detail-related {
  margin-top: 34px;
}

.postcard-detail-empty,
.postcard-detail-loading {
  min-height: 420px;
  align-items: center;
  padding: 28px;
}

.detail-image-skeleton {
  width: 100%;
  min-height: 420px;
  border-radius: 0;
}

.detail-copy-skeleton {
  display: grid;
  gap: 14px;
  padding: 28px;
}

.skeleton-line {
  height: 24px;
  border-radius: 999px;
}

.postcard-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
}

.postcard-image-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 25, 31, 0.72);
}

.postcard-image-lightbox figure {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
}

.postcard-image-lightbox img {
  max-width: 95vw;
  max-height: 82vh;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.postcard-image-lightbox figcaption {
  margin-top: 12px;
  color: #fff;
  font-weight: 900;
}

.postcard-image-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-prompt-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 25, 31, 0.58);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.login-prompt-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(0, 99, 112, 0.14);
  border-radius: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(229, 207, 121, 0.22), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #effafa 100%);
  box-shadow: 0 28px 80px rgba(7, 30, 40, 0.28);
}

.login-prompt-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.login-prompt-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(0, 121, 135, 0.1);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.login-prompt-card h2 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
}

.login-prompt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.login-prompt-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-prompt-google,
.login-prompt-later,
.login-prompt-secondary a {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
}

.login-prompt-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(0, 99, 112, 0.18);
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 14px 34px rgba(7, 30, 40, 0.12);
}

.login-prompt-google .google-logo {
  width: 22px;
  height: 22px;
}

.login-prompt-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-prompt-secondary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--teal);
}

.login-prompt-later {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.postcard-tags span {
  padding: 5px 9px;
  border-radius: 8px;
  color: #334e5a;
  background: #eef3f4;
  font-size: 12px;
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.pagination button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal-dark);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 320px;
  gap: 0;
  margin: 22px 0 0;
  overflow: hidden;
}

.feature-strip article {
  padding: 28px;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.feature-strip article span {
  color: var(--teal);
  font-size: 36px;
}

.feature-strip h3,
.feature-strip p {
  margin: 8px 0 0;
}

.feature-strip p {
  color: var(--muted);
  line-height: 1.7;
}

.feature-strip aside {
  display: grid;
  align-content: center;
  padding: 28px;
  color: #fff;
  background: linear-gradient(135deg, #007681, #004f59);
}

.light-button {
  width: max-content;
  margin-top: 16px;
  color: var(--teal-dark);
  background: #fff;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 28px;
  align-items: center;
  margin-top: 22px;
  padding: 28px 42px;
  color: #fff;
  border-radius: 0;
  background: linear-gradient(135deg, #006a70, #004f59);
}

.site-footer .footer-logo {
  width: 200px;
  max-width: 100%;
}

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

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.mobile-menu {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(88vw, 360px);
  padding: 24px;
  background: #fff;
  box-shadow: -22px 0 50px rgba(15, 48, 60, 0.18);
  transform: translateX(105%);
  transition: transform 0.2s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

.menu-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 32px;
}

.mobile-menu nav {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.mobile-menu nav a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.mobile-menu nav .icon {
  color: var(--teal);
}

.mobile-auth-actions {
  display: grid;
  gap: 0;
}

.mobile-logout {
  width: 100%;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--teal-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.bottom-nav {
  display: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 560px);
  gap: 60px;
  width: min(1180px, calc(100% - 44px));
  margin: 52px auto 44px;
  align-items: center;
}

.welcome {
  min-height: 480px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.welcome .sparkle {
  color: var(--gold);
  font-size: 34px;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 60px);
  letter-spacing: 0;
}

.welcome p {
  margin: 0;
  max-width: 500px;
  color: #304b58;
  font-size: 22px;
  line-height: 1.9;
}

.auth-stack {
  display: grid;
  gap: 18px;
}

.auth-card {
  padding: 38px clamp(26px, 5vw, 56px);
}

.auth-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 6px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-card h2 {
  margin: 24px 0 8px;
  text-align: center;
  font-size: 34px;
}

.subtitle,
.switch-line {
  margin: 0 0 24px;
  color: #405a66;
  text-align: center;
}

.subtitle a,
.text-link {
  color: var(--teal);
  font-weight: 800;
}

.back-link {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-weight: 800;
}

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

.field {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid #cad5d9;
  border-radius: 16px;
  background: #fff;
}

.field-icon {
  width: 23px;
  height: 23px;
  color: var(--teal-dark);
}

.field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.upload-card {
  width: min(100%, 720px);
  justify-self: end;
}

.upload-form {
  gap: 16px;
}

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

.segmented-field {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 6px;
  border: 1px solid #cad5d9;
  border-radius: 18px;
  background: #f7faf9;
}

.segmented-field legend {
  grid-column: 1 / -1;
  padding: 0 8px;
  color: #405a66;
  font-weight: 800;
}

.segmented-field label {
  position: relative;
  min-width: 0;
}

.segmented-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented-field span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #31535d;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segmented-field input:checked + span {
  color: var(--teal-dark);
  border-color: rgba(0, 106, 112, 0.28);
  background: #e8f6f8;
  box-shadow: 0 6px 14px rgba(0, 106, 112, 0.08);
}

.segmented-field input:focus-visible + span {
  outline: 3px solid rgba(0, 106, 112, 0.22);
  outline-offset: 2px;
}

.file-field {
  position: relative;
  min-height: 76px;
  cursor: pointer;
}

.file-field span {
  color: #405a66;
  font-weight: 800;
}

.file-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-note {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 106, 112, 0.18);
  border-radius: 16px;
  background: #f6fbfa;
}

.upload-note strong {
  color: var(--teal-dark);
}

.upload-note p {
  margin: 6px 0 0;
  color: #405a66;
  line-height: 1.7;
}

.upload-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 30, 40, 0.42);
  backdrop-filter: blur(8px);
}

.upload-result-dialog {
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  padding: 30px;
  border: 1px solid rgba(0, 106, 112, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(15, 48, 60, 0.25);
  text-align: center;
}

.upload-result-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(0, 106, 112, 0.2);
  border-radius: 50%;
  color: var(--teal-dark);
  background: #e8f6f8;
  font-size: 38px;
  font-weight: 900;
}

.upload-result-dialog h3 {
  margin: 0 0 6px;
  font-size: 28px;
}

.upload-result-dialog p {
  margin: 0;
  color: #405a66;
  line-height: 1.7;
}

.upload-result-dialog dl {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: #f7faf9;
  text-align: left;
}

.upload-result-dialog dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.upload-result-dialog dt {
  color: var(--muted);
  font-weight: 800;
}

.upload-result-dialog dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

.toggle-password {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  color: #263f4a;
  background: transparent;
  cursor: pointer;
}

.toggle-password .icon {
  width: 20px;
  height: 20px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 4px 0 10px;
}

.check {
  color: #314b56;
}

.check input {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  font-size: 18px;
}

.status {
  min-height: 22px;
  margin: 0;
  text-align: center;
  color: var(--teal);
}

.status.error {
  color: #b3261e;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.social-auth-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-auth-circle {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #cfd9dc;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 48, 60, 0.06);
}

.google-auth-circle:hover,
.google-auth-circle:focus-visible {
  border-color: var(--teal);
  outline: 0;
}

.google-logo {
  width: 28px;
  height: 28px;
}

.notice {
  display: flex;
  gap: 18px;
  padding: 22px 28px;
}

.notice span {
  color: var(--teal);
  font-size: 30px;
}

.notice h3,
.notice ul {
  margin: 0;
}

.notice ul {
  padding-left: 20px;
  color: #405a66;
  line-height: 1.7;
}

.success-card {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 34px;
}

.success-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 78px;
  height: 78px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #09898f, #006168);
  font-size: 46px;
}

.success-mark.warning-mark {
  color: #6d8791;
  border: 1px solid rgba(0, 106, 112, 0.14);
  background: #eef7f7;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.42);
}

.outline-button {
  margin-top: 16px;
  border: 1px solid var(--teal);
  color: var(--teal-dark);
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  padding: 12px 18px;
  color: #fff;
  border-radius: 999px;
  background: rgba(0, 79, 89, 0.94);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.search-modal-open {
  overflow: hidden;
}

.catalog-modal-open {
  overflow: hidden;
}

.search-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.search-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.search-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 30, 40, 0.48);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.search-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 32px;
  border: 1px solid rgba(223, 231, 233, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 80px rgba(15, 48, 60, 0.24);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.18s ease;
}

.search-lightbox.open .search-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.search-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.search-lightbox-dialog strong {
  display: block;
  color: var(--teal-dark);
  font-size: 28px;
}

.search-lightbox-dialog p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.search-lightbox-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-lightbox-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  padding: 0 20px;
  color: var(--ink);
  background: #f6f8f8;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
  }

  .ghost-button,
  .header-actions .solid-button {
    display: none;
  }

  .desktop-nav {
    display: flex;
    justify-content: flex-start;
    gap: 18px;
  }

  .desktop-nav a {
    width: 44px;
    height: 44px;
    justify-content: center;
    gap: 0;
    border-radius: 50%;
    font-size: 0;
  }

  .desktop-nav .icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  .desktop-nav a:hover,
  .desktop-nav a:focus-visible {
    background: #eef7f7;
  }

  .header-search {
    display: flex;
    justify-self: end;
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-color: transparent;
    background: transparent;
    transition: width 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .header-search input {
    display: none;
  }

  .header-search button {
    width: 48px;
    height: 48px;
    margin: 0;
    background: #f6f8f8;
  }

  .menu-toggle {
    display: grid;
  }

  .postcard-row,
  .postcard-row.compact,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .postcard-detail-content {
    padding: 24px;
  }

  .catalog-modal {
    grid-template-columns: 1fr;
  }

  .catalog-lightbox .catalog-modal {
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .catalog-lightbox .catalog-main {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .catalog-modal-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .catalog-summary {
    justify-content: space-between;
    white-space: normal;
  }

  .catalog-modal-tools {
    grid-template-columns: 1fr;
  }

  .catalog-search {
    width: 100%;
  }

  .catalog-tools {
    justify-content: flex-start;
  }

  .catalog-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .catalog-sidebar-heading {
    padding-right: 0;
  }

  .catalog-city-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px 0 18px;
    scroll-snap-type: x proximity;
  }

  .catalog-city-list button {
    flex: 0 0 170px;
    scroll-snap-align: start;
  }

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

  .catalog-modal .postcard-card img {
    height: clamp(170px, 28vw, 240px);
    object-fit: contain;
  }

  .search-panel,
  .result-list,
  .feature-strip,
  .site-footer,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .site-footer .footer-brand {
    display: none;
  }

  .feature-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

}

@media (min-width: 681px) and (max-width: 1050px) {
  .postcard-detail-page {
    width: min(100% - 24px, 860px);
    height: calc(100dvh - 104px);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .postcard-detail-shell {
    grid-template-rows: minmax(0, 58%) minmax(0, 42%);
    gap: 0;
    height: calc(100% - 40px);
  }

  .postcard-detail-content {
    padding: 14px 18px;
  }

  .postcard-detail-content h1 {
    font-size: clamp(24px, 3.6vw, 32px);
  }

  .detail-tags {
    margin: 8px 0;
  }

  .detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .detail-facts div {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 6px 8px;
  }

  .detail-actions {
    padding-top: 8px;
  }

  .detail-actions.detail-toolbar-actions {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    padding-top: 0;
  }

  .detail-inline-actions {
    display: none;
  }

  .detail-toolbar-actions .solid-button,
  .detail-toolbar-actions .outline-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .detail-back-link {
    min-height: 34px;
  }

  .catalog-lightbox {
    align-items: start;
    overflow: hidden;
    padding: 16px;
  }

  .catalog-lightbox .catalog-modal {
    width: 100%;
    max-height: calc(100dvh - 32px);
    margin-left: 0;
    margin-right: 0;
    padding: 18px;
    border-radius: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-catalog-close {
    position: fixed;
    right: 22px;
    top: calc(22px + env(safe-area-inset-top));
    z-index: 4;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(0, 79, 89, 0.18);
    border-radius: 50%;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 48, 60, 0.2);
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  .mobile-catalog-close span {
    display: block;
    margin-top: -3px;
    font-size: 34px;
    line-height: 1;
  }

  .catalog-lightbox .catalog-main {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .catalog-modal-header {
    display: none;
  }

  .catalog-modal-tools {
    grid-template-columns: 1fr auto;
    margin-top: 0;
  }

  .catalog-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .catalog-count {
    justify-self: end;
    font-size: 14px;
  }

  .catalog-modal .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }

  .catalog-lightbox .postcard-card {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .catalog-modal .postcard-card img {
    width: 100%;
    max-width: 100%;
    height: clamp(180px, 32vw, 270px);
    aspect-ratio: auto;
    object-fit: contain;
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: 76px;
  }

  body:has(.postcard-detail-page) {
    padding-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  html:has(.postcard-detail-page) {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .postcard-detail-page {
    width: min(100% - 18px, 640px);
    height: auto;
    min-height: calc(100dvh - 152px);
    padding-top: 10px;
    padding-bottom: 10px;
    overflow: visible;
  }

  .postcard-detail-shell {
    grid-template-rows: auto auto;
    gap: 0;
    height: auto;
    min-height: 0;
    border-radius: 18px;
    overflow: visible;
  }

  .postcard-detail-media {
    height: clamp(260px, 46dvh, 420px);
    min-height: 0;
  }

  .postcard-detail-image-button {
    height: 100%;
  }

  .postcard-detail-image-button img {
    max-height: none;
  }

  .postcard-detail-content {
    padding: 10px 12px;
    overflow: visible;
  }

  .postcard-detail-content h1 {
    margin-bottom: 6px;
    font-size: clamp(20px, 6vw, 26px);
  }

  .detail-kicker {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .detail-badges,
  .detail-actions {
    gap: 8px;
  }

  .detail-badges span {
    padding: 4px 8px;
    font-size: 11px;
  }

  .detail-tags {
    margin: 6px 0;
    max-height: 28px;
    overflow: hidden;
  }

  .detail-facts {
    gap: 4px;
    margin-top: 6px;
  }

  .detail-facts div {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 5px 8px;
  }

  .detail-facts dt {
    font-size: 12px;
  }

  .detail-facts dd {
    font-size: 13px;
  }

  .detail-actions .solid-button,
  .detail-actions .outline-button {
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    justify-content: center;
  }

  .detail-actions {
    margin-top: 8px;
    padding-top: 6px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .postcard-detail-toolbar {
    align-items: center;
    gap: 8px;
  }

  .detail-actions.detail-toolbar-actions {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .detail-inline-actions {
    display: none;
  }

  .detail-toolbar-actions .solid-button,
  .detail-toolbar-actions .outline-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
    white-space: nowrap;
  }

  .detail-back-link {
    min-height: 32px;
  }

  .postcard-image-lightbox {
    padding: 12px;
  }

  .postcard-image-lightbox img {
    max-height: 78vh;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 18px 20px;
  }

  .desktop-nav {
    display: none;
  }

  .brand-logo-wide {
    width: 164px;
  }

  .site-header .brand-logo-wide {
    display: block;
    width: 164px;
  }

  .site-header .brand-logo-mark {
    display: none;
  }

  body.is-signed-in .site-header .brand-logo-wide {
    display: none;
  }

  body.is-signed-in .site-header .brand-logo-mark {
    display: block;
    width: 52px;
    height: 52px;
  }

  .mobile-logo {
    width: 180px;
    height: auto;
  }

  .home-shell,
  .auth-layout {
    width: min(100% - 28px, 430px);
  }

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

  .upload-card {
    width: 100%;
  }

  .upload-result-overlay {
    padding: 18px;
  }

  .upload-result-dialog {
    padding: 24px 20px;
  }

  .upload-result-dialog dl div {
    grid-template-columns: 74px minmax(0, 1fr);
  }

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

  .hero {
    border-radius: 18px;
  }

  .hero > img {
    aspect-ratio: 1280 / 500;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .postcard-row,
  .postcard-row.compact {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .country-card,
  .postcard-card {
    scroll-snap-align: start;
  }

  .country-card {
    flex-basis: 168px;
  }

  .postcard-row .postcard-card {
    flex-basis: 220px;
  }

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

  .catalog-modal {
    margin-left: -2px;
    margin-right: -2px;
    padding: 16px;
    border-radius: 14px;
  }

  .catalog-lightbox {
    padding: 12px;
    align-items: start;
    overflow: hidden;
  }

  .catalog-lightbox .catalog-modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    margin-left: 0;
    margin-right: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-catalog-close {
    position: fixed;
    right: 18px;
    top: calc(18px + env(safe-area-inset-top));
    z-index: 4;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(0, 79, 89, 0.18);
    border-radius: 50%;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 48, 60, 0.2);
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  .mobile-catalog-close span {
    display: block;
    margin-top: -3px;
    font-size: 34px;
    line-height: 1;
  }

  .catalog-lightbox .catalog-main {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .catalog-modal-header {
    display: none;
  }

  .catalog-modal-tools {
    grid-template-columns: 1fr auto;
    margin-top: 0;
  }

  .catalog-search {
    grid-column: 1 / -1;
  }

  .catalog-count {
    justify-self: end;
    font-size: 14px;
  }

  .catalog-place img {
    width: 64px;
    height: 64px;
  }

  .catalog-place h2 {
    font-size: 24px;
  }

  .catalog-modal .catalog-grid {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .catalog-lightbox .postcard-card {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .catalog-modal .postcard-card img {
    width: 100%;
    max-width: 100%;
    height: clamp(180px, 54vw, 260px);
    aspect-ratio: auto;
    object-fit: contain;
  }

  .postcard-details {
    gap: 7px;
  }

  .postcard-detail-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

  .postcard-detail-row strong {
    white-space: normal;
  }

  .copy-coordinate-button {
    width: 34px;
    height: 34px;
  }

  .search-lightbox {
    padding: 16px;
  }

  .search-lightbox-dialog {
    padding: 26px 18px 20px;
    border-radius: 14px;
  }

  .search-lightbox-dialog strong {
    font-size: 24px;
  }

  .search-lightbox-form {
    grid-template-columns: 1fr;
  }

  .search-lightbox-form input {
    min-height: 48px;
  }

  .search-panel {
    gap: 16px;
    padding: 22px;
  }

  .search-box {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .search-title span {
    font-size: 32px;
  }

  .feature-strip article,
  .feature-strip aside {
    padding: 22px;
  }

  .site-footer {
    margin-left: -14px;
    margin-right: -14px;
    padding: 26px 20px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px 8px 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
  }

  .bottom-nav a {
    display: grid;
    place-items: center;
    gap: 3px;
    color: #425d69;
  }

  .bottom-nav .icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .bottom-nav span {
    font-size: 11px;
    font-weight: 700;
  }

  .auth-layout {
    margin-top: 18px;
  }

  .welcome {
    display: none;
  }

  .auth-card {
    padding: 30px 22px;
  }

  .auth-card h2 {
    font-size: 30px;
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
