/* Apple-inspired design tokens, layered on top of Bootstrap defaults. */
:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.72);
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: #d2d2d7;
  --color-accent: #0071e3;
  --color-accent-rgb: 0, 113, 227;
  --color-accent-contrast: #ffffff;
  --color-danger: #ff3b30;

  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --transition-fast: 150ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-glass: rgba(28, 28, 30, 0.72);
    --color-text: #f5f5f7;
    --color-text-secondary: #98989d;
    --color-border: #38383a;
    --color-accent: #0a84ff;
    --color-accent-rgb: 10, 132, 255;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Frosted-glass surface used for chrome that floats over the map. */
.glass {
  background: var(--color-surface-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--color-border);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--color-surface);
  }
}

/* --- Buttons & form controls (applied app-wide, not per-page) ------ */

.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: opacity var(--transition-fast), background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-accent);
  border-color: var(--color-accent);
  opacity: 0.9;
}

.btn-primary:disabled {
  background: var(--color-accent);
  border-color: var(--color-accent);
  opacity: 0.6;
}

.btn-outline-primary {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

.btn-link {
  color: var(--color-accent);
  text-decoration: none;
}

.btn-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.btn-danger,
.btn-outline-danger {
  border-radius: var(--radius-md);
}

.modal-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.form-control {
  border-radius: var(--radius-md);
  border-color: var(--color-border);
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.15);
}

/* --- Auth pages --------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.auth-card .form-control {
  padding: 10px 14px;
}

.auth-card .btn-primary {
  padding: 10px 16px;
}

.auth-error {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* --- Content pages (privacy/terms) -- wider than .auth-card, meant for
   reading prose rather than a form ------------------------------------ */

.content-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 24px;
}

.content-card {
  width: 100%;
  max-width: 680px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
}

.content-card h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.content-card .content-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.content-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 8px;
}

.content-card p,
.content-card li {
  color: var(--color-text);
  line-height: 1.6;
}

.content-card ul {
  padding-left: 20px;
}

.content-back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.auth-switch {
  margin: 24px 0 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* --- Site footer (welcome/login/register/privacy/terms) ------------ */

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.site-footer-tagline {
  margin: 0 0 4px;
}

.site-footer-links {
  margin: 0;
}

.site-footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* --- Map page ------------------------------------------------------ */

.map-shell {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

.map-chrome {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.map-toolbar-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.map-toolbar-account {
  margin-left: auto;
}

.map-toolbar-account #account-menu-toggle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}

.passkeys-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--color-text-secondary);
}

.passkeys-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.passkeys-list li:last-child {
  border-bottom: none;
}

#add-pin-button,
#import-takeout-button,
#share-button {
  border-radius: var(--radius-md);
  font-weight: 500;
}

.map-toolbar .dropdown-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
}

.map-toolbar .dropdown-item {
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--color-text);
  font-size: 0.9rem;
  padding: 8px 10px;
}

.map-toolbar .dropdown-item:hover,
.map-toolbar .dropdown-item:focus {
  background: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-accent);
}

.map-filters {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.category-chip:hover {
  border-color: var(--color-accent);
}

.category-chip.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

.viewport-search-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pin-search-wrap {
  position: relative;
}

.pin-search-wrap .input-group {
  width: 220px;
  max-width: 100%;
}

.place-search-wrap {
  position: relative;
}

.place-search-wrap .input-group {
  width: 660px;
  max-width: 100%;
}

.place-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 2000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
}

.place-search-results li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--color-text);
}

.place-search-results li:hover {
  background: var(--color-bg);
}

.place-search-results li.text-secondary {
  cursor: default;
  color: var(--color-text-secondary);
}

.place-result-info {
  flex: 1;
  min-width: 0;
}

.place-result-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-result-address {
  display: block;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-result-add {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  color: var(--color-accent);
  font-size: 0.75rem;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.place-result-add:hover {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

#search-area-button {
  border-radius: var(--radius-md);
  font-weight: 500;
  white-space: nowrap;
}

.map-empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  color: var(--color-text-secondary);
}

/* Bottom-left, deliberately -- zoom controls + Leaflet's own attribution
   already occupy the bottom-right corner. */
.map-legal-link {
  position: absolute;
  left: 8px;
  bottom: 4px;
  z-index: 1000;
  margin: 0;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  background: var(--color-surface-glass);
  padding: 2px 6px;
  border-radius: var(--radius-md);
}

.map-legal-link a {
  color: inherit;
  text-decoration: none;
}

.map-legal-link a:hover {
  text-decoration: underline;
}

/* --- Locate me control + "you are here" marker ---------------------- */

.locate-me-control {
  background: var(--color-surface);
}

.locate-me-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text);
  background: var(--color-surface);
  text-decoration: none;
}

.locate-me-button:hover {
  color: var(--color-accent);
}

.user-location-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.locate-me-error {
  position: absolute;
  right: 12px;
  bottom: 130px;
  z-index: 1000;
  max-width: 240px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 0;
}

/* --- Pin popup (overrides Leaflet's default popup chrome) ---------- */

.leaflet-popup-content-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.leaflet-popup-content {
  margin: 16px;
}

.leaflet-popup-tip {
  background: var(--color-surface);
}

.pin-popup-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.pin-popup-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.pin-popup-description {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.pin-popup-visited {
  color: #34a853;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 8px;
}

.pin-popup-link {
  font-size: 0.85rem;
  font-weight: 500;
  display: block;
}

.pin-popup-edit {
  padding: 8px 0 0;
  font-size: 0.85rem;
}

.search-result-popup {
  min-width: 160px;
}

.search-result-popup-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.nearby-place-popup {
  min-width: 160px;
}

.nearby-place-popup-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.nearby-place-popup-category {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  margin: 0 0 10px;
}

/* --- Modals (add/edit pin, delete confirmation) --------------------- */

.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background-color: var(--color-surface);
  color: var(--color-text);
}

.modal-header,
.modal-footer {
  border-color: var(--color-border);
}

/* Bootstrap's .btn-close icon is a fixed dark SVG (not theme-aware) --
   without this it disappears against the dark modal background above. */
@media (prefers-color-scheme: dark) {
  .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
  }
}

.upload-help {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.upload-summary {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.upload-summary-failed {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.upload-progress {
  margin-bottom: 16px;
}

.upload-progress .progress {
  height: 6px;
  border-radius: var(--radius-sm, 6px);
  background: var(--color-bg);
}

.upload-progress .progress-bar {
  background: var(--color-accent);
  transition: width 0.3s ease-in-out;
}

#upload-progress-text {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.pin-location-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.pin-location-results li {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
}

.pin-location-results li:last-child {
  border-bottom: none;
}

.pin-location-results li:hover {
  background: var(--color-bg);
}

.pin-location-selected {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.unresolved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.unresolved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.unresolved-item:last-child {
  border-bottom: none;
}

.unresolved-item-name {
  font-weight: 500;
}

.unresolved-item-category {
  display: block;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.unresolved-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Bootstrap's .text-secondary reads as too faint for text the user needs
   to actually read here (cooldown hint, empty/loading status) rather than
   a de-emphasized caption -- use full-contrast text color in this dialog
   instead. Bootstrap ships .text-secondary with !important, so this needs
   it too or the override silently loses. */
#recommend-modal .text-secondary {
  color: var(--color-text) !important;
}

#recommend-location-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
}

#recommend-location-results li {
  padding: 8px 12px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--color-text);
}

#recommend-location-results li:hover {
  background: var(--color-bg);
}

#recommend-location-results li.text-secondary {
  cursor: default;
}

#recommend-location-selected {
  font-size: 0.875rem;
}

.recommend-categories .form-check {
  margin-bottom: 8px;
}

.recommend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 65vh;
  overflow-y: auto;
}

.recommend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.recommend-item:last-child {
  border-bottom: none;
}

.recommend-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.recommend-info {
  flex: 1;
  min-width: 0;
}

.recommend-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.recommend-name {
  font-weight: 500;
}

.recommend-rating {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.recommend-location {
  margin: 2px 0;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.recommend-rationale {
  margin: 4px 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.recommend-maps-link {
  font-size: 0.85rem;
}

.recommend-add-btn {
  flex-shrink: 0;
}

.recommend-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Recipes page ----------------------------------------------------- */

.recipes-countries-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipes-country-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.recipes-country-row:last-child {
  border-bottom: none;
}

.recipes-country-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recipes-country-name {
  font-weight: 600;
}

.recipes-country-count {
  font-size: 0.85rem;
}

.recipes-country-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.recipes-cards-list {
  margin-top: 12px;
}

.recipe-thumb {
  cursor: pointer;
}

.recipe-image-modal-img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* --- Welcome page ----------------------------------------------------
   A third page archetype alongside the auth cards and the full-viewport
   map: a longer-form, section-based landing page. Reuses the app's
   existing tokens throughout -- no new palette. */

.welcome-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.welcome-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.welcome-nav-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.welcome-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Hero: a real, framed (non-interactive) Leaflet map is the
   signature element here -- the product itself, not an illustration
   of it. */

.welcome-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 80px;
}

.welcome-display {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 20px;
}

.welcome-hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 46ch;
}

.welcome-hero-map {
  height: 380px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  /* The map itself has drag/zoom/etc. disabled (see welcome.js) -- this
     just prevents any residual pointer affordance from suggesting
     otherwise. */
  pointer-events: none;
}

.welcome-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.welcome-section {
  padding: 56px 0;
  border-top: 1px solid var(--color-border);
}

/* --- How it works: a route -- literally a line connecting waypoints,
   which is the one place a numbered sequence is earned here (a real
   3-step process), not decoration. */

.welcome-route {
  list-style: none;
  margin: 0;
  padding: 0;
}

.welcome-route li {
  position: relative;
  display: flex;
  gap: 20px;
  padding-bottom: 40px;
}

.welcome-route li:last-child {
  padding-bottom: 0;
}

.welcome-route-marker {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(var(--color-accent-rgb), 0.15);
}

.welcome-route li:not(:last-child) .welcome-route-marker::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  bottom: 0;
  width: 2px;
  border-left: 2px dotted var(--color-border);
}

.welcome-route h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.welcome-route p {
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.welcome-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.welcome-feature-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.welcome-feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.welcome-feature-card p {
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

.welcome-values-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.welcome-values-list li {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.welcome-values-list strong {
  color: var(--color-text);
  display: block;
  margin-bottom: 2px;
}

.welcome-screenshot-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: block;
}

.welcome-cta {
  text-align: center;
}

.welcome-cta h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.welcome-page .site-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 32px;
}

@media (max-width: 760px) {
  .welcome-hero {
    grid-template-columns: 1fr;
    padding: 32px 0 48px;
  }

  .welcome-hero-map {
    height: 260px;
    order: -1;
  }
}

/* --- Analysis page --------------------------------------------------- */

.analysis-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.analysis-header-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.analysis-empty-state {
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--color-text-secondary);
}

.analysis-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.analysis-card h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
}

.analysis-cluster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.analysis-cluster-table th,
.analysis-cluster-table td {
  text-align: left;
  padding: 8px 4px;
  border-bottom: 1px solid var(--color-border);
}

.analysis-cluster-table th {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.analysis-clickable-row {
  cursor: pointer;
}

.analysis-clickable-row:hover {
  background: var(--color-surface);
}

#word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}

.word-cloud-term {
  color: var(--color-accent);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.word-cloud-term:hover {
  text-decoration: underline;
}

/* --- Country chart chunks (analysis.js renderCountryChart) ------------ */

#country-chart-container canvas {
  margin-bottom: 8px;
}

#country-chart-container canvas:not(:first-child) {
  margin-top: 24px;
}

.analysis-chart-legend {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.85rem;
}

.analysis-chart-legend a {
  text-decoration: none;
}

.analysis-chart-legend a:hover {
  text-decoration: underline;
}

.analysis-chart-legend-count {
  color: var(--color-text-secondary);
}
