/* ═══════════════════════════════════════════════════════════════
   preview.css — mobile-first styles for board & creator pages
   Served as a static asset from Firebase Hosting (CDN-cached).

   Brand guide: Poppins, path coral #ff3d2e, hoof grey #262626,
   tusk white #ffffff. Headlines lowercase semi-bold,
   headers uppercase semi-bold, body sentence case light.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* DMCA image fallback */
.hidden { display: none !important; }
.img-fallback { object-fit: cover; background: #f0f0f0; }

:root {
  --coral: #ff3d2e;
  --coral-hover: #e8362a;
  --ink: #262626;
  --text-1: #262626;
  --text-2: rgba(38,38,38,0.65);
  --text-3: rgba(38,38,38,0.4);
  --border: rgba(38,38,38,0.08);
  --bg-card: #fff;
  --radius: 12px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; background: #fff; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  color: var(--text-1);
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px; /* space for sticky CTA */
}

a { color: var(--coral); text-decoration: none; }

/* ── Accent bar ── */
.accent-bar { height: 3px; background: var(--coral); flex-shrink: 0; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text-1);
  font-weight: 600; font-size: 0.9375rem;
}
.nav-logo { height: 24px; width: auto; }
.nav-right {
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-link {
  font-size: 0.875rem; font-weight: 400; color: var(--text-1);
  text-decoration: none;
}
.nav-link:hover { color: var(--coral); }
.nav-btn-outline {
  font-size: 0.875rem; font-weight: 400; color: var(--text-1);
  text-decoration: none; padding: 0.35rem 1rem;
  border: 1px solid var(--text-1); border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav-btn-outline:hover {
  background: var(--text-1); color: #fff;
}

/* ── Main ── */
main {
  flex: 1; width: 100%; max-width: 600px;
  margin: 0 auto; padding: 20px 16px 32px;
}

/* ═══════════════════════════════════════════════════════════════
   Board map — full-bleed immersive map behind the sheet
   ═══════════════════════════════════════════════════════════════ */
.board-map {
  height: 50vh;
  min-height: 280px;
  max-height: 440px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 0;
}
/* Apple MapKit JS attribution link */
.board-map [data-apple-maps-attribution] {
  font-size: 9px;
}

/* ═══════════════════════════════════════════════════════════════
   Board sheet — glassmorphic card rising over the map
   ═══════════════════════════════════════════════════════════════ */
main.board-sheet {
  max-width: none;
  margin: -28px 0 0 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
  position: relative;
  z-index: 1;
  min-height: 100vh; /* ensures sheet fully covers the sticky map */
}

/* Drag handle indicator */
main.board-sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 5px;
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  top: 12px;
}

.board-content {
  padding: 24px 16px 32px;
}

/* ── Board page ── */
.board-header { margin-bottom: 16px; }
.board-actions {
  float: right;
  display: flex;
  gap: 2px;
  margin-left: 12px;
}
.board-share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  border-radius: 50%; color: var(--text-3);
  -webkit-tap-highlight-color: transparent;
}
.board-share-btn:hover { background: #f0f0f0; color: var(--text-2); }
.board-title {
  font-size: 1.375rem; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.board-byline {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--text-2);
}
.board-byline .sep { color: var(--text-3); }
.board-desc {
  margin-top: 10px; font-size: 0.875rem;
  color: var(--text-2); line-height: 1.6;
}
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.creator-link { font-weight: 400; }

/* ── Item list — white cards ── */
.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
  transition: box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.item--mappable { cursor: pointer; }
/* Flash highlight + hover — desktop only (see @media min-width: 768px) */

/* Type badge (coral icon + label for non-place items) */
.item-type {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--coral); margin-top: 2px; line-height: 1.3;
}
.item-type svg { width: 14px; height: 14px; flex-shrink: 0; }

.item-body { flex: 1; min-width: 0; }
.item-name {
  display: block; font-weight: 500; font-size: 0.9375rem;
  line-height: 1.3; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-loc {
  display: block; font-size: 0.75rem; color: var(--text-2);
  margin-top: 3px; line-height: 1.3;
}
.item-tip {
  display: block; font-size: 0.8125rem; color: var(--text-2);
  margin-top: 5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Item card additions (new BE fields) ── */
.item-name-local {
  display: block; font-size: 0.8125rem; font-weight: 400;
  color: var(--text-2); line-height: 1.3; margin-top: 1px;
}
.item-attr {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.6875rem; color: var(--text-3);
  margin-top: 6px; line-height: 1.3;
}
.item-attr-icon {
  width: 14px; height: 14px; flex-shrink: 0; border-radius: 2px;
}
.item-attr-link { color: var(--text-3); text-decoration: none; }
.item-attr-link:hover { text-decoration: underline; }
.item-season {
  display: inline-block; font-size: 0.6875rem; color: var(--text-2);
  margin-top: 4px; line-height: 1.3;
}
.item-date { color: var(--coral); }
/* Booking text link (iOS-style) */
.item-booking {
  display: block; margin-top: 6px;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--coral); text-decoration: none;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
.item-booking:active { opacity: 0.7; }
/* Location line as directions link */
.item-loc--link {
  text-decoration: none; cursor: pointer;
}
.item-loc--link:hover { color: var(--text-1); }

/* ── Expanded item card ── */
.item--expanded {
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  animation: item-expand 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
@keyframes item-expand {
  from {
    opacity: 0.8;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* Collapsing animation class */
.item--collapsing {
  animation: item-collapse 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
@keyframes item-collapse {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.8;
    transform: scale(0.97);
  }
}
.item--expanded .item-body {
  padding: 12px 14px 14px;
}
/* Hide inline booking link in expanded mode (shown as hero button instead) */
.item--expanded .item-body .item-booking {
  display: none;
}
.item--expanded .item-tip {
  -webkit-line-clamp: unset;
}
/* Hero image fade-in */
.item-hero-img {
  animation: hero-fade-in 0.4s ease-out;
}
@keyframes hero-fade-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

/* Hero image with overlays */
.item-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #1a1a1a;
}
.item-hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Attribution overlay — just above title in bottom gradient */
.item-hero-attr {
  display: inline-flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem; font-weight: 400;
  text-decoration: none;
  line-height: 1.3;
}
.item-hero-attr:hover { color: #fff; }
.item-hero-attr-icon {
  width: 14px; height: 14px;
  border-radius: 2px;
}
.item-hero-attr-arrow {
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 1px;
  opacity: 0.7;
}

/* Title + directions — bottom of image */
.item-hero-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 48px 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start;
}
.item-hero-name {
  display: block;
  font-weight: 600; font-size: 1.125rem;
  color: #fff;
  line-height: 1.3;
}
/* Action buttons row (directions + book) */
.item-hero-actions {
  display: flex; gap: 10px;
  margin-top: 12px;
}
/* Glassmorphic action button — icon on top, label below */
.item-hero-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  min-width: calc(50% - 5px); flex: 1;
  box-sizing: border-box;
  padding: 8px 20px 7px;
  background: rgba(255,255,255,0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  color: #fff;
  font-size: 0.8rem; font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.item-hero-action:hover { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.35); }
.item-hero-action:active { background: rgba(255,255,255,0.35); transform: scale(0.97); }
.item-hero-action-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

/* Top-left button group */
.item-hero-top-actions {
  position: absolute;
  top: 12px; left: 12px;
  display: flex; gap: 8px;
  z-index: 3;
}
/* Bookmark / share / more buttons — top of expanded card */
.item-hero-share,
.item-hero-bookmark,
.item-hero-more {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.item-hero-share:hover,
.item-hero-bookmark:hover,
.item-hero-more:hover { background: rgba(255,255,255,0.3); }
.item-hero-share:active,
.item-hero-bookmark:active,
.item-hero-more:active { transform: scale(0.93); }

/* ── Sheet inline CTA (board pages with map) ── */
.sheet-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 16px 0 8px;
  background: #f8f8fa;
  border-radius: 16px;
}
.sheet-cta-icon { width: 40px; height: 40px; border-radius: 10px; }
.sheet-cta-text { flex: 1; min-width: 0; }
.sheet-cta-title { display: block; font-weight: 500; font-size: 0.875rem; line-height: 1.3; }
.sheet-cta-desc { display: block; font-size: 0.75rem; color: var(--text-3); line-height: 1.3; }

/* Board pages with sheet don't need body padding for floating CTA */
body:has(.board-sheet) { padding-bottom: 0; }

/* Smart banner inside sheet matches sheet corners */
.board-sheet > .smart-banner {
  border-radius: 28px 28px 0 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  top: auto;
}

/* ── Maps preference picker ── */
.maps-picker-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.maps-picker-card {
  position: relative;
  background: #fff; border-radius: 16px;
  padding: 24px; width: 260px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  text-align: center;
}
.maps-picker-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: #f0f0f0; border-radius: 50%;
  cursor: pointer; color: var(--text-2);
}
.maps-picker-close:hover { background: #e5e5e5; }
.maps-picker-title {
  font-size: 0.9375rem; font-weight: 600;
  margin-bottom: 16px; color: var(--text-1);
}
.maps-picker-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--text-1); transition: background 0.12s;
}
.maps-picker-btn:hover { background: #f5f5f5; }
.maps-picker-btn:active { background: #eee; }
.maps-picker-icon { width: 16px; height: 16px; }
.maps-picker-hint {
  font-size: 0.6875rem; color: var(--text-3);
  margin-top: 8px; line-height: 1.4;
}

.item-img {
  width: 96px; height: 96px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0; background: #f5f5f5;
}
.item-img-wrap {
  width: 96px; height: 96px; border-radius: 12px;
  flex-shrink: 0; background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border);
}

.item--more {
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  background: transparent;
  box-shadow: none;
}
.more-link {
  font-size: 0.8125rem; font-weight: 500; color: var(--coral);
  text-decoration: none;
}
.more-link:active { opacity: 0.7; }

/* ── Creator profile (iOS-style layout) ── */
.profile { margin-bottom: 20px; }
.profile-actions {
  float: right;
  display: flex;
  gap: 2px;
}
.profile-handle {
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  margin-bottom: 16px; color: var(--text-1);
}
.profile-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 10px;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.profile-stats {
  display: flex; gap: 24px;
}
.profile-stat-item { text-align: center; }
.profile-stat-num {
  display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.2;
}
.profile-stat-label {
  display: block; font-size: 0.75rem; color: var(--text-2); line-height: 1.3;
}
.profile-name {
  font-size: 0.9375rem; font-weight: 600; line-height: 1.25;
  margin-bottom: 2px;
}
.profile-bio {
  font-size: 0.875rem; color: var(--text-2);
  line-height: 1.5;
}

/* ── Board cards (2-col grid with 3-image collage) ── */
.bcard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.bcard {
  display: block;
  text-decoration: none; color: var(--text-1);
  -webkit-tap-highlight-color: transparent;
}
.bcard:active { opacity: 0.85; }

/* 3-image collage cover */
.bcard-collage {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f5f5f5;
}
.bcard-collage-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  min-height: 0;
}
.bcard-collage-main { grid-row: 1 / -1; }
.bcard-collage--single { grid-template-columns: 1fr; }
.bcard-collage--single .bcard-collage-main { grid-column: 1 / -1; }
.bcard-collage--empty {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  background: #f5f5f5;
}

.bcard-title {
  display: block; font-weight: 500; font-size: 0.875rem;
  line-height: 1.3; margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bcard-count { display: block; font-size: 0.75rem; color: var(--text-3); margin-top: 1px; }

.empty-state {
  text-align: center; padding: 32px 16px;
  font-size: 0.875rem; color: var(--text-3);
}

/* ── 404 ── */
.empty-page { text-align: center; padding: 64px 16px; }
.empty-icon { color: var(--text-3); margin-bottom: 16px; }
.empty-page h1 {
  font-size: 1.25rem; font-weight: 600; margin-bottom: 6px;
}
.empty-page p {
  font-size: 0.875rem; color: var(--text-2);
  max-width: 280px; margin: 0 auto;
}

/* ── Sticky CTA bar ── */
.cta-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.cta-inner {
  max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cta-text { display: flex; flex-direction: column; }
.cta-app-name { font-weight: 600; font-size: 0.8125rem; line-height: 1.2; }
.cta-app-desc { font-size: 0.6875rem; color: var(--text-3); line-height: 1.2; }
.btn {
  display: inline-block; padding: 10px 20px;
  border-radius: 10px; font-family: inherit;
  font-size: 0.8125rem; font-weight: 600;
  text-decoration: none; text-align: center; white-space: nowrap;
  transition: background 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--coral { background: var(--coral); color: white; }

/* Extend CTA bar below viewport for Chrome bottom-bar collapse */
.cta-bar::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -100px;
  height: 100px;
  background: #fff;
}

/* ── Custom smart banner (matches Safari native look) ── */
.smart-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8f8f8;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
}
.smart-banner-icon {
  width: 32px; height: 32px; border-radius: 8px;
}
.smart-banner-text { flex: 1; min-width: 0; }
.smart-banner-title {
  font-weight: 500; font-size: 0.8125rem; line-height: 1.2;
  display: block;
}
.smart-banner-desc {
  font-size: 0.6875rem; color: var(--text-3); line-height: 1.2;
  display: block;
}
.smart-banner-open {
  display: inline-block;
  background: #007AFF; border: none;
  padding: 6px 16px; border-radius: 999px;
  color: #fff; font-weight: 600; font-size: 0.8125rem;
  font-family: inherit; cursor: pointer;
  text-transform: uppercase; text-decoration: none;
  white-space: nowrap;
}

/* ── Share toast ── */
.share-toast {
  position: fixed;
  bottom: 90px;
  left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500;
  z-index: 200;
  animation: toast-fade 2s ease forwards;
}
@keyframes toast-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Footer ── */
footer {
  text-align: center; padding: 16px;
  font-size: 0.6875rem; color: var(--text-3);
}
footer a { color: var(--text-3); }

/* ── Board layout wrapper ── */
.board-layout {
  display: contents; /* transparent on mobile — children flow normally */
}

/* ── Mobile: hide accent bar + footer + directions ── */
@media (max-width: 767px) {
  .accent-bar, footer { display: none; }
  .board-map { top: 0; }
  .item--mappable { cursor: default; }
  /* Hide nav on creator profile — handle is the primary header */
  body:has(.profile) nav { display: none; }
}

/* ── Tablet+ ── */
@media (min-width: 540px) {
  main { padding: 28px 24px 40px; }
  .board-content { padding: 28px 24px 40px; }
  .board-title { font-size: 1.625rem; }
  .board-map { min-height: 320px; max-height: 460px; }
  .item-img, .item-img-wrap { width: 110px; height: 110px; }
  .nav-logo { height: 28px; }
  nav { padding: 12px 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   Desktop sidebar — Apple Maps-style two-level panel
   ═══════════════════════════════════════════════════════════════ */

/* ── Sidebar brand (top of L1) ── */
.sidebar-brand {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-brand-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text-1);
  font-weight: 600; font-size: 0.9375rem;
  min-width: 0;
}
.sidebar-brand-logo { height: 24px; width: auto; flex-shrink: 0; }
.sidebar-brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toggle button */
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none;
  background: transparent; cursor: pointer;
  border-radius: 8px; color: var(--text-2); flex-shrink: 0;
  transition: background 0.12s;
}
.sidebar-toggle:hover { background: #f0f0f0; }

/* ── Sidebar bottom (pinned at bottom of L1) ── */
.sidebar-bottom {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-bottom .sidebar-qr-btn {
  margin: 0;
  flex: 1;
}
.sidebar-settings-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: none; border: none; border-radius: 50%;
  cursor: pointer; color: var(--text-3);
  transition: color 0.12s, background 0.12s;
}
.sidebar-settings-btn:hover { color: var(--text-2); background: #f0f0f0; }

/* Settings popover menu */
.settings-menu {
  z-index: 100;
  background: #fff; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 4px; min-width: 180px;
}
.settings-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px;
  border: none; background: none; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-size: 0.8125rem; font-weight: 500; color: var(--text-1);
  transition: background 0.1s; text-align: left;
}
.settings-menu-item:hover { background: #f5f5f5; }
.settings-menu-item svg { flex-shrink: 0; color: var(--text-2); }
.settings-menu-value {
  margin-left: auto;
  font-size: 0.75rem; font-weight: 400; color: var(--text-3);
}

/* ── Sidebar Level 1: creator header + board cards ── */
.sidebar-creator {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 12px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.sidebar-creator-info {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
}
.sidebar-creator-name {
  font-weight: 600; font-size: 0.9375rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-creator-handle {
  font-size: 0.75rem; color: var(--text-2); text-decoration: none;
}
.sidebar-creator-handle:hover { color: var(--coral); }

/* QR / Get the app button */
.sidebar-qr-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 0 16px 12px; padding: 8px 12px;
  background: #f5f5f5; border: none; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-size: 0.8125rem; font-weight: 500; color: var(--text-1);
  transition: background 0.12s; width: calc(100% - 32px);
}
.sidebar-qr-btn:hover { background: #ebebeb; }
.sidebar-qr-btn svg { flex-shrink: 0; color: var(--coral); }

/* Boards heading in L1 — fixed height so expanded text / collapsed HR occupy same space */
.sidebar-boards-heading {
  height: 28px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-boards-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 0 16px;
}

/* Board cards in sidebar */
.sidebar-boards { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-bcard {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer;
  font-family: inherit; text-align: left; width: 100%;
  transition: background 0.12s;
}
.sidebar-bcard:hover { background: #f5f5f5; }
.sidebar-bcard--active { background: rgba(255, 61, 46, 0.06); }
.sidebar-bcard-img {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; background: #f5f5f5;
}
.sidebar-bcard-img--empty { border: 1px dashed var(--border); }
.sidebar-bcard-body { flex: 1; min-width: 0; }
.sidebar-bcard-title {
  display: block; font-weight: 500; font-size: 0.875rem;
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text-1);
}
.sidebar-bcard-count { display: block; font-size: 0.6875rem; color: var(--text-3); }

/* ── Sidebar Level 2: places header ── */
.sidebar-l2-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 14px 8px;
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 2;
}
.sidebar-close {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none;
  background: #f0f0f0; cursor: pointer;
  border-radius: 50%; color: var(--text-2); flex-shrink: 0;
  transition: background 0.12s;
}
.sidebar-close:hover { background: #e5e5e5; }
.sidebar-l2-title {
  flex: 1; font-size: 1.25rem; font-weight: 600;
  line-height: 1.3; margin: 0;
  /* allow wrapping for long titles */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading / error states */
.sidebar-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 0;
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--coral);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sidebar-error {
  text-align: center; padding: 32px 16px;
  font-size: 0.875rem; color: var(--text-3);
}

/* ── QR code modal ── */
.qr-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.qr-card {
  background: #fff; border-radius: 20px;
  padding: 32px; width: 280px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  text-align: center; position: relative;
}
.qr-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.qr-close:hover { background: #f0f0f0; }
.qr-logo { margin-bottom: 16px; }
.qr-logo-img { height: 32px; width: auto; }
.qr-code { margin: 0 auto 16px; width: 180px; height: 180px; }
.qr-code svg { width: 100%; height: 100%; }
.qr-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-1); margin-bottom: 4px;
}
.qr-desc { font-size: 0.8125rem; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════
   Report content — button + modal
   ═══════════════════════════════════════════════════════════════ */

.item { position: relative; }

/* Board ellipsis menu (mobile board header) */
.board-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  border-radius: 50%; color: var(--text-3);
  -webkit-tap-highlight-color: transparent;
}
.board-menu-btn:hover { background: #f0f0f0; color: var(--text-2); }

/* Ellipsis menu button in sidebar L2 header */
.sidebar-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none;
  background: transparent; cursor: pointer;
  border-radius: 50%; color: var(--text-3); flex-shrink: 0;
}
.sidebar-menu-btn:hover { background: #f0f0f0; color: var(--text-2); }

/* Context menu popover */
.context-menu {
  position: fixed; z-index: 100;
  background: #fff; border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 4px; min-width: 160px;
}
.context-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  border: none; background: transparent; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-size: 0.875rem; color: var(--text-1);
  transition: background 0.1s;
}
.context-menu-item:hover { background: #f5f5f5; }
.context-menu-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Report modal overlay */
.report-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.report-card {
  background: #fff; border-radius: 16px;
  width: 340px; max-width: 92vw; max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.report-header {
  display: flex; align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff;
  border-radius: 16px 16px 0 0; z-index: 1;
}
.report-heading {
  flex: 1; text-align: center;
  font-weight: 600; font-size: 0.9375rem;
}
.report-back, .report-close-x {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none;
  background: transparent; cursor: pointer;
  color: var(--text-1); border-radius: 50%;
}
.report-back:hover, .report-close-x:hover { background: #f0f0f0; }

/* Step 1: reason list */
.report-prompt {
  font-size: 0.8125rem; color: var(--text-2);
  padding: 12px 16px 8px;
}
.report-reason {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 16px;
  border: none; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer;
  font-family: inherit; font-size: 0.9375rem;
  color: var(--text-1); text-align: left;
  transition: background 0.1s;
}
.report-reason:last-child { border-bottom: none; }
.report-reason:hover { background: #f8f8f8; }
.report-reason svg { color: var(--text-3); flex-shrink: 0; }

/* Step 2: details + submit */
.report-reason-label {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-2); padding: 12px 16px 0;
}
.report-details {
  display: block; width: calc(100% - 32px);
  margin: 8px 16px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.875rem;
  resize: none; outline: none; background: #f5f5f5;
}
.report-details:focus { border-color: rgba(0,0,0,0.15); background: #fff; }
.report-submit {
  display: block; width: calc(100% - 32px);
  margin: 12px 16px 16px; padding: 12px;
  border: none; border-radius: 10px;
  background: var(--coral); color: #fff;
  font-family: inherit; font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.12s;
}
.report-submit:disabled { opacity: 0.6; cursor: default; }
.report-submit:hover:not(:disabled) { opacity: 0.9; }

/* Step 3: confirmation */
.report-done-icon { text-align: center; padding-top: 24px; }
.report-done-title {
  text-align: center; font-size: 1.0625rem; font-weight: 600;
  padding: 12px 16px 4px;
}
.report-done-desc {
  text-align: center; font-size: 0.8125rem; color: var(--text-2);
  padding: 0 24px 16px; line-height: 1.5;
}
.report-done-btn {
  display: block; width: calc(100% - 32px);
  margin: 0 16px 16px; padding: 12px;
  border: none; border-radius: 10px;
  background: var(--coral); color: #fff;
  font-family: inherit; font-size: 0.9375rem; font-weight: 600;
  cursor: pointer;
}
.report-done-btn:hover { opacity: 0.9; }

/* IP redirect step (legacy — kept for fallback) */
.report-ip-icon { text-align: center; padding-top: 24px; }
.report-email-btn {
  display: block; text-align: center;
  margin: 0 16px 12px; padding: 12px;
  border-radius: 10px; background: #f5f5f5;
  color: var(--coral); font-weight: 500;
  font-size: 0.9375rem; text-decoration: none;
}
.report-email-btn:hover { background: #ebebeb; }

/* ── DMCA copyright form ── */
.report-card--wide { width: 480px; max-width: 94vw; }
.report-overlay--dmca { align-items: flex-end; }
@media (min-width: 540px) {
  .report-overlay--dmca { align-items: center; }
}

/* Step indicator dots */
.dmca-steps {
  display: flex; justify-content: center;
  gap: 6px; padding: 8px 16px 4px;
}
.dmca-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background 0.2s;
}
.dmca-dot--active { background: var(--coral); }

/* Radio buttons (owner type) */
.dmca-radio {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 0.9375rem;
  color: var(--text-1); transition: background 0.1s;
}
.dmca-radio:last-of-type { border-bottom: none; }
.dmca-radio:hover { background: #f8f8f8; }
.dmca-radio input[type="radio"] {
  accent-color: var(--coral); width: 18px; height: 18px; flex-shrink: 0;
}

/* Form fields */
.dmca-fields { padding: 8px 16px 16px; }
.dmca-field { margin-bottom: 12px; }
.dmca-field:last-child { margin-bottom: 0; }
.dmca-label {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-2); margin-bottom: 4px;
}
.dmca-label--req::after { content: ' *'; color: var(--coral); }
.dmca-input, .dmca-textarea, .dmca-select {
  display: block; width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.875rem;
  outline: none; background: #f5f5f5;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.dmca-input:focus, .dmca-textarea:focus, .dmca-select:focus {
  border-color: rgba(0,0,0,0.15); background: #fff;
}
.dmca-textarea { resize: none; }
.dmca-select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

/* Content preview card (Step D) */
.dmca-content-preview {
  display: flex; gap: 12px; padding: 12px;
  margin: 8px 16px; background: #f8f8f8;
  border-radius: 12px; align-items: center;
}
.dmca-content-preview img {
  width: 56px; height: 56px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}
.dmca-content-info { flex: 1; min-width: 0; }
.dmca-content-type {
  display: inline-block; font-size: 0.6875rem;
  font-weight: 600; text-transform: uppercase;
  color: var(--coral); letter-spacing: 0.04em; margin-bottom: 2px;
}
.dmca-content-name {
  display: block; font-size: 0.875rem; font-weight: 500;
  color: var(--text-1); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* Sworn statement checkboxes */
.dmca-checkbox {
  display: flex; gap: 10px; padding: 10px 16px;
  font-size: 0.8125rem; color: var(--text-2);
  line-height: 1.45; align-items: flex-start;
}
.dmca-checkbox input[type="checkbox"] {
  accent-color: var(--coral); width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 2px;
}

/* Next button */
.dmca-next {
  display: block; width: calc(100% - 32px);
  margin: 4px 16px 16px; padding: 12px;
  border: none; border-radius: 10px;
  background: var(--coral); color: #fff;
  font-family: inherit; font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.12s;
}
.dmca-next:disabled { opacity: 0.6; cursor: default; }
.dmca-next:hover:not(:disabled) { opacity: 0.9; }

/* Company field (agent only) — hidden by default */
.dmca-company-field { display: none; }
.dmca-company-field--show { display: block; }

/* Mobile: bottom-sheet for DMCA form */
@media (max-width: 539px) {
  .report-card--wide {
    width: 100%; max-width: 100vw;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }
}

/* ── Desktop: Apple Maps-style overlay layout ── */
@media (min-width: 768px) {
  /* Desktop board page: full-viewport, no nav */
  body.desktop-board {
    padding-bottom: 0;
    overflow: hidden;
  }

  /* Map is the foundational layer — fills entire viewport */
  .board-layout {
    display: block;
    position: relative;
    height: 100vh;
    overflow: hidden;
  }

  .board-layout .board-map {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    max-height: none;
    min-height: 0;
  }

  /* Push MapKit attribution to right corner (sidebar overlays left) */
  .board-layout .board-map [data-apple-maps-attribution] {
    text-align: right;
    padding-right: 8px;
  }

  .board-layout .board-content {
    padding-bottom: 32px;
  }

  /* ── Sidebar container: overlays map on the left ── */
  .sidebar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: row;
    pointer-events: none;
  }
  .sidebar > * {
    pointer-events: auto;
  }

  /* L1: narrow fixed panel */
  .sidebar-l1 {
    width: 220px;
    min-width: 220px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: #fff;
    overflow: hidden;
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar-creator { flex-shrink: 0; }

  /* Boards section: scrollable middle */
  .sidebar-boards {
    flex: 1;
    overflow-y: auto;
  }

  /* ── Collapsed L1 state ── */
  .sidebar--collapsed .sidebar-l1 {
    width: 72px;
    min-width: 72px;
  }
  /* Hide brand link in collapsed; toggle stays visible as expand control */
  .sidebar--collapsed .sidebar-brand-link {
    display: none;
  }
  .sidebar--collapsed .sidebar-brand {
    justify-content: center;
    padding: 12px 8px;
  }
  .sidebar--collapsed .sidebar-creator-info,
  .sidebar--collapsed .sidebar-bcard-body,
  .sidebar--collapsed .sidebar-bottom span {
    display: none;
  }
  .sidebar--collapsed .sidebar-creator {
    justify-content: center;
    padding: 12px 8px;
    position: relative;
  }
  /* Pathhog badge beside avatar in collapsed state */
  .sidebar-creator-badge { display: none; }
  .sidebar--collapsed .sidebar-creator-badge {
    display: block;
    position: absolute;
    bottom: 6px; right: 10px;
    width: 16px; height: 16px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0,0,0,0.15);
  }
  .sidebar--collapsed .sidebar-bcard {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    text-align: center;
  }
  .sidebar--collapsed .sidebar-bcard-img {
    width: 48px; height: 48px; border-radius: 12px;
  }
  .sidebar--collapsed .sidebar-bcard-title {
    font-size: 0.625rem;
    line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
  }
  .sidebar--collapsed .sidebar-bcard-count { display: none; }
  .sidebar--collapsed .sidebar-boards-label { display: none; }
  .sidebar--collapsed .sidebar-boards-heading {
    justify-content: center;
    padding: 0 12px;
  }
  .sidebar--collapsed .sidebar-boards-heading::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--border);
  }
  .sidebar--collapsed .sidebar-boards {
    padding: 0 4px 8px;
    gap: 0;
  }
  .sidebar--collapsed .sidebar-bottom {
    padding: 8px;
  }
  .sidebar--collapsed .sidebar-qr-btn {
    justify-content: center;
    padding: 8px;
  }
  .sidebar--collapsed .sidebar-settings-btn {
    display: none;
  }

  /* L2: expandable panel with slide animation */
  .sidebar-l2 {
    width: 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar--l2-open .sidebar-l2 {
    width: 380px;
    min-width: 380px;
  }

  /* Inner wrapper keeps content width stable during slide */
  .sidebar-l2-inner {
    width: 380px;
    min-width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .sidebar-l2-inner .board-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 14px 16px;
  }

  /* L2 header: bigger title, bigger close button */
  .sidebar-l2-title {
    font-size: 1.5rem;
  }
  .sidebar-close {
    width: 34px; height: 34px;
  }
  .sidebar-close svg { width: 18px; height: 18px; }

  /* L2 images: proportional, not oversized */
  .sidebar-l2 .item-img,
  .sidebar-l2 .item-img-wrap { width: 80px; height: 80px; border-radius: 10px; }

  /* ── Search/filter toolbar in L2 ── */
  .sidebar-l2-toolbar {
    display: flex;
    gap: 8px;
    padding: 0 14px 10px;
    flex-shrink: 0;
  }
  .l2-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8125rem;
    outline: none;
    background: #f5f5f5;
    transition: border-color 0.15s, background 0.15s;
  }
  .l2-search:focus {
    border-color: rgba(0,0,0,0.15);
    background: #fff;
  }
  .l2-search::placeholder { color: var(--text-3); }
  .l2-filter {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8125rem;
    background: #f5f5f5;
    color: var(--text-1);
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
  }
  .l2-filter:focus { border-color: rgba(0,0,0,0.15); }

  .l2-count {
    padding: 0 14px 8px;
    font-size: 0.75rem;
    color: var(--text-3);
  }

  /* Card hover + flash highlight — desktop only */
  .item--mappable:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.06);
  }
  .item--flash {
    animation: card-flash 1.5s ease;
  }
  @keyframes card-flash {
    0%, 100% { box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03); }
    15%, 50% { box-shadow: 0 0 0 2px var(--coral), 0 2px 12px rgba(255,61,46,0.2); }
  }

  /* Hide CTA bar + footer on desktop */
  .cta-bar, footer { display: none; }
  body { padding-bottom: 0; }

}
