/* ============================================================
   腹地笔记 — Mobile PWA Stylesheet
   Dark-mode-first, Google Maps-style layout
   ============================================================ */

/* ----------------------------------------------------------
   1. Theme Custom Properties
   ---------------------------------------------------------- */

/* RFC-0004 task#7 step 2b — app adopts the CANONICAL 8-theme palette from
   tokens.css (single source = ej colors; packages/core/src/tokens/themes.css).
   app no longer defines its own (divergent) per-theme palette. This :root only
   (a) bridges app's variable names to the canonical ones, and (b) holds the
   app-only layout constants. Per-theme colors (--surface/--ink/--accent/--glass/
   --globe-bg/…) all resolve from tokens.css for the active [data-theme]. */
:root {
  /* name bridges — canonical defines the right-hand side per [data-theme] */
  --bg:            var(--bg-base);
  --shadow:        var(--shadow-md);
  --danger:        var(--danger-name);

  /* app-only constants (theme-independent: layout + the heart/like color) */
  --heart:         #FF6B6B;
  --radius:        14px;
  --radius-sm:     8px;
  --radius-full:   9999px;
  --nav-height:    56px;
  --search-height: 48px;
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --safe-left:     env(safe-area-inset-left, 0px);
  --safe-right:    env(safe-area-inset-right, 0px);
}


/* ----------------------------------------------------------
   2. Base / Reset
   ---------------------------------------------------------- */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
  font-family:
    "Noto Serif SC", "PingFang SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Hide scrollbars globally on mobile */
::-webkit-scrollbar { display: none; }
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="checkbox"] { -webkit-appearance: checkbox; appearance: checkbox; width: auto; height: auto; }

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


/* ----------------------------------------------------------
   3. Map Layer
   ---------------------------------------------------------- */

.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #e8eaed; /* placeholder while tiles load */
}

.map-container canvas,
.map-container .mapboxgl-canvas,
.map-container .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* ── Globe 3D ── */
.globe-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--globe-bg, #0a0a2e);
}
.globe-pin {
  /* Outer: globe.gl writes transform here for lat/lng positioning.
     NO transition: transform — it would lag every drag frame. */
  width: 28px;
  height: 28px;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  z-index: 10;
}
.globe-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  /* RFC-0011: match ej globe emoji (.gm-flag 21px). HTML pin is the live path
     (window.THREE undefined → WebGL sprites never run); was 18px, looked small. */
  font-size: 21px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.3), 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.15s;
  pointer-events: none;
}
.globe-pin:active span {
  transform: scale(1.3);
}
/* globe.gl HTML elements need pointer-events */
.globe-container .scene-container { pointer-events: auto; }

/* ── SpaceChef 🛸 — docked + gentle float (RFC-0011, ported from ej).
   Replaced the old orbit-ring station + food-list popup; the 🛸 now opens
   the space_station profile (see globe.js / app.js). ── */
@keyframes iss-settle {
  0% { transform: scale(0.35); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes iss-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.sparkle-docked {
  position: absolute; top: 130px; right: 22%; z-index: 99;
  font-size: 18px; line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
  pointer-events: none;
}
.sparkle-iss {
  position: absolute; top: 130px; right: 22%; z-index: 99;
  font-size: 18px; line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
  animation: iss-settle 0.6s ease-out, iss-float 3s ease-in-out 0.6s infinite;
  pointer-events: auto; cursor: pointer;
}

/* ----------------------------------------------------------
   4. Search Bar
   ---------------------------------------------------------- */

.search-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 12px) 8px calc(var(--safe-left) + 12px);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}


.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: var(--search-height);
  padding: 0 44px 0 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-size: 15px;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}




.search-clear {
  position: absolute;
  right: 4px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  color: var(--muted);
  display: none;
}

.search-input:not(:placeholder-shown) + .search-clear {
  display: inline-flex;
}


/* ----------------------------------------------------------
   5. Bottom Sheet
   ---------------------------------------------------------- */

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom, 0px));
  top: 48px;
  z-index: 50;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* States: translateY pushes the sheet down, 0 = fully open */
.bottom-sheet.peek, .bottom-sheet.bottom-sheet--peek {
  transform: translateY(calc(100% - 90px));
}

.bottom-sheet.half, .bottom-sheet.bottom-sheet--half {
  transform: translateY(50%);
}

.bottom-sheet.full, .bottom-sheet.bottom-sheet--full {
  transform: translateY(0);
}

.bottom-sheet.dragging, .bottom-sheet.bottom-sheet--dragging {
  transition: none;
}

.bottom-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
  flex-shrink: 0;
}

.bottom-sheet-handle::after {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.5;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 12px;
  flex-shrink: 0;
}

.bottom-sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.bottom-sheet-count {
  font-size: 13px;
  color: var(--muted);
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}


/* ----------------------------------------------------------
   6. Bottom Navigation
   ---------------------------------------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  /* RFC-0004: real frosted glass (matches ej). Was opaque --surface, so the
     blur did nothing. Translucent --v-glass-panel + blur frosts the content
     scrolling underneath; upward shadow lifts the bar off the page. Opaque
     fallback covers the pre-load window of the async visionos-space.css. */
  background: var(--v-glass-panel, var(--surface));
  border-top: 1px solid var(--v-glass-border, transparent);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--nav-height);
  min-height: var(--nav-height);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: color 0.15s;
  position: relative;
}

.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.15s;
}

.nav-item.active {
  color: var(--ink);
}

.nav-item.active .nav-icon {
  transform: scale(1.05);
}

.nav-item .nav-label {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* ── Add button (centre FAB) ── */
@keyframes nav-add-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}

.bottom-nav-tab--add {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: var(--nav-height);
  padding-bottom: 11px;
  overflow: visible;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-add-label {
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

.nav-add-fab {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 12px rgba(0,0,0,0.14),
    0 0 0 2.5px var(--surface),
    0 0 0 3.5px var(--accent);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.nav-add-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: nav-add-ring 2.4s ease-out infinite;
  z-index: -1;
  pointer-events: none;
}

.bottom-nav-tab--add:active .nav-add-fab {
  transform: scale(0.93);
  box-shadow: 0 2px 10px rgba(0,0,0,0.14), 0 0 0 3px var(--surface), 0 0 0 4px var(--accent);
}

.nav-add-plus {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

.nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ----------------------------------------------------------
   7. Food List Items
   ---------------------------------------------------------- */

.food-list {
  display: flex;
  flex-direction: column;
}

.food-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
  min-height: 64px;
}

.food-item:active {
  background: var(--accent-subtle);
}

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









.food-item-likes.liked .heart-icon {
  fill: var(--heart);
}


/* ----------------------------------------------------------
   8. Detail Panel
   ---------------------------------------------------------- */

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--surface, #FFFFFF);
  transform: translateX(0);
  animation: detail-slide-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes detail-slide-in {
  from { transform: translateX(100%); opacity: 0.6; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Detail Top Bar ── */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #eee);
  flex-shrink: 0;
  min-height: 48px;
  z-index: 10;
  position: relative;
}
.detail-topbar .detail-back {
  font-size: 28px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  z-index: 1;
}
.detail-topbar-title {
  position: absolute;
  left: 56px; right: 56px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.detail-topbar-actions {
  display: flex; align-items: center; gap: 2px;
  z-index: 1;
}
.detail-lang-btn {
  background: none; border: none;
  color: var(--ink, #1a1a1a); opacity: 0.55;
  cursor: pointer; padding: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  min-width: 36px; min-height: 36px;
}
.detail-lang-btn:active { opacity: 0.8; }

/* ── Scrollable Body ── */
.detail-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--safe-bottom) + 70px);
  word-break: break-word;
}

/* ── Image Carousel ── */
.detail-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.detail-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.detail-carousel-slide {
  min-width: 100%; width: 100%; height: 100%;
  position: relative; flex-shrink: 0; overflow: hidden;
}
.detail-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.3s;
  -webkit-user-drag: none;
  user-select: none;
}
.detail-carousel-img.loaded { opacity: 1; }
.detail-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.detail-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}
.detail-dot--active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}

/* ── Collect / collection picker bottom sheet ── */
/* .collect-sheet-overlay → u-overlay shortcut (RFC-0004) */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.collect-sheet {
  width: 100%; max-height: 72vh;
  background: var(--bg, #fff); border-radius: 16px 16px 0 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  animation: slideUp 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.collect-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  font-size: 13px; font-weight: 600; color: var(--muted, #999);
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  position: sticky; top: 0; background: var(--bg, #fff); z-index: 1;
}
.collect-sheet-close {
  border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--muted, #aaa); cursor: pointer; padding: 0 2px;
}
.collect-sheet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; cursor: pointer;
  transition: background 0.1s;
}
.collect-sheet-row:active { background: var(--surface-alt, rgba(0,0,0,0.04)); }
.collect-sheet-row-icon { color: var(--muted, #bbb); flex-shrink: 0; }
.collect-sheet-row--active .collect-sheet-row-icon { color: var(--accent); }
.collect-sheet-row-name { flex: 1; font-size: 15px; color: var(--ink, #1a1a1a); }
.collect-sheet-row--active .collect-sheet-row-name { font-weight: 600; }
.collect-sheet-row-check { color: var(--accent); flex-shrink: 0; }
.collect-sheet-row--add .collect-sheet-row-icon { color: var(--accent); }
.collect-sheet-row--add .collect-sheet-row-name { color: var(--accent); font-weight: 500; }
.collect-sheet-new-input-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
}
.collect-sheet-new-input {
  flex: 1; height: 38px; border-radius: 10px;
  border: 1.5px solid var(--border, rgba(0,0,0,0.12));
  padding: 0 12px; font-size: 14px;
  background: var(--surface-alt, rgba(0,0,0,0.04));
  color: var(--ink, #1a1a1a); outline: none;
}
.collect-sheet-new-input:focus { border-color: var(--accent); }
.collect-sheet-new-confirm {
  height: 38px; padding: 0 16px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 500;
  cursor: pointer; flex-shrink: 0;
}
.collect-sheet-new-confirm:disabled { opacity: 0.5; cursor: default; }

/* ── Lightbox ── */
/* .lightbox-overlay → u-overlay shortcut in detail.js (RFC-0004); keyframes below */
@keyframes lightbox-fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain; user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: #fff;
  font-size: 32px; cursor: pointer; padding: 8px;
  line-height: 1; z-index: 1;
}
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  font-size: 36px; cursor: pointer; padding: 8px 14px;
  border-radius: 50%; line-height: 1; backdrop-filter: blur(4px);
}
.lightbox-arrow--left { left: 12px; }
.lightbox-arrow--right { right: 12px; }
.lightbox-counter {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%); color: rgba(255,255,255,0.7);
  font-size: 14px; letter-spacing: 0.1em;
}

/* ── Name + Emoji Row ── */
.detail-name-row {
  padding: 20px 20px 10px;
}
.detail-name-col {
  display: flex;
  flex-direction: column;
}
.detail-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-emoji-inline {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.detail-name {
  font-size: calc(26px * var(--font-scale, 1));
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  word-break: break-word;
  overflow-wrap: break-word;
}
.detail-subname {
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 400;
  color: var(--muted, #999);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ── Meta (location + category) ── */
.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 20px 16px;
  flex-wrap: wrap;
}
.detail-location {
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--soft, #666);
}
.detail-category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* From-collection link (RFC-0015) — tap a curated 图文 back to its 老饕合集 */
.detail-from-collection {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 20px 14px;
  min-height: 32px;
  padding: 5px 12px;
  font-size: calc(12px * var(--font-scale, 1));
  line-height: 1.2;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  cursor: pointer;
}
.detail-from-collection:active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.detail-from-collection-label { color: var(--soft, #666); }
.detail-from-collection-name  { font-weight: 600; }
.detail-from-collection-arrow { flex: none; opacity: 0.7; }

/* ── Tags ── */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}
.detail-tag {
  font-size: 12px;
  color: var(--accent, #34C759);
  background: var(--accent-subtle, rgba(52,199,89,0.08));
  padding: 4px 10px;
  border-radius: 12px;
}

/* ── Messages panel (XHS-style) ── */
.messages-panel {
  padding: 16px;
  padding-bottom: calc(var(--nav-height, 56px) + var(--safe-bottom, 0px) + 20px);
}
/* 3 category buttons */
.msg-categories {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
/* .msg-cat-btn → migrated to u-card shortcut in messages.js (RFC-0004) */
.msg-cat-icon {
  position: relative;
  color: var(--ink, #1a1a1a);
}
.msg-cat-badge {
  position: absolute; top: -6px; right: -10px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--danger, #FF3B30);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.msg-cat-label {
  font-size: 12px; font-weight: 600;
  color: var(--soft, #666);
}
/* Category detail view */
.msg-cat-header {
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.msg-back-btn {
  background: none; border: none;
  padding: 4px; cursor: pointer;
  color: var(--ink, #1a1a1a);
  display: flex;
}
.msg-cat-title {
  font-size: 17px; font-weight: 700;
  color: var(--ink, #1a1a1a);
}
.msg-empty {
  text-align: center; padding: 40px 20px;
  font-size: 13px; color: var(--muted, #999);
}
/* Notification items */
.msg-notif-item {
  display: flex; align-items: flex-start;
  gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border, #f0f0f0);
  cursor: pointer;
}
.msg-notif-item:active { opacity: 0.7; }
.msg-notif-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.msg-notif-avatar-ph {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--accent); background: rgba(52, 199, 89, 0.1);
  flex-shrink: 0;
}
.msg-notif-body { flex: 1; min-width: 0; }
.msg-notif-text {
  font-size: 14px; color: var(--ink, #1a1a1a);
  line-height: 1.5;
}
.msg-notif-time {
  font-size: 11px; color: var(--muted, #999);
  margin-top: 2px;
}
.msg-trip-accept-btn {
  margin-top: 6px; padding: 5px 14px; border: none; border-radius: 8px;
  background: var(--accent, #34C759); color: #fff; font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.msg-trip-actions { margin-top: 6px; display: flex; gap: 6px; }
/* Updates section */
.msg-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
/* .msg-update-card → migrated to u-card shortcut in messages.js (RFC-0004) */
.msg-update-header {
  display: flex; align-items: center;
  padding: 14px 16px;
  cursor: pointer; gap: 10px;
}
.msg-update-info { flex: 1; min-width: 0; }
.msg-update-title {
  font-size: 15px; font-weight: 700;
  color: var(--ink, #1a1a1a);
  margin-bottom: 3px;
}
.msg-update-summary {
  font-size: 13px; color: var(--soft, #666);
  line-height: 1.4;
}
.msg-update-date {
  font-size: 11px; color: var(--muted, #999);
  white-space: nowrap;
}
.msg-update-arrow {
  font-size: 12px; color: var(--muted, #999);
  transition: transform 0.2s;
}
.msg-update-arrow.open { transform: rotate(180deg); }
.msg-update-body {
  padding: 0 16px 16px;
  font-size: 13px; color: var(--soft, #666);
  line-height: 1.8;
  white-space: pre-line;
  border-top: 1px solid var(--border, #eee);
  padding-top: 14px;
}

/* ── Nav badge (red dot) ── */
.bottom-nav-tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--nav-height);
  min-height: var(--nav-height);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}
.bottom-nav-tab--active { color: var(--ink); }
.bottom-nav-label {
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
}
.bottom-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.nav-badge-dot {
  position: absolute;
  top: 4px; right: 50%;
  margin-right: -14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger, #FF3B30);
}

/* ── Favorites action buttons (sort + map) ── */
.profile-fav-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 6px;
}
.profile-fav-action-btn {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary, #666);
  background: var(--glass-light, rgba(0,0,0,0.03));
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 20px; cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.profile-fav-action-btn:active { background: var(--glass-heavy, rgba(0,0,0,0.06)); }
.profile-fav-action-btn.active {
  color: var(--accent, #34C759);
  background: rgba(52, 199, 89, 0.08);
  border-color: rgba(52, 199, 89, 0.2);
}
.profile-fav-action-btn--danger { color: #FF3B30; border-color: rgba(255,59,48,0.3); }
.profile-fav-action-btn--danger:active { background: rgba(255,59,48,0.06); }

/* ── Favorites inner sub-tab bar (收藏夹 | 合集) ── */
.profile-fav-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  margin-bottom: 2px;
}
.profile-fav-subtab {
  padding: 10px 16px 9px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary, #888);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

/* ── XHS-style board list ── */
.profile-fav-boards { padding: 8px 0; }
.profile-fav-board {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.profile-fav-board:active { background: var(--glass-light, rgba(0,0,0,0.03)); }
.profile-fav-board-info { flex: 1; min-width: 0; }
.profile-fav-board-name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.profile-fav-board-count { font-size: 12px; color: var(--muted); }
.profile-fav-board-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  width: 132px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden;
}
.profile-fav-board-thumb {
  aspect-ratio: 1;
  background: var(--glass-light, rgba(0,0,0,0.04));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 14px;
}
.profile-fav-board-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Folder detail header ── */
.profile-fav-folder-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 6px;
}
.profile-fav-back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--glass-light, rgba(0,0,0,0.04));
  color: var(--ink); cursor: pointer; flex-shrink: 0;
}
.profile-fav-back-btn:active { background: var(--glass-heavy, rgba(0,0,0,0.08)); }
.profile-fav-folder-title { font-size: 16px; font-weight: 600; color: var(--ink); }

/* ── Collection name input (create / rename inline) ── */
.collection-name-input {
  flex: 1; min-width: 0;
  padding: 5px 8px;
  border: none; border-bottom: 1.5px solid var(--accent);
  background: transparent; color: var(--ink);
  font-size: 15px; outline: none;
  font-family: inherit;
}
.profile-col-name-confirm {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: var(--accent); color: #fff;
  cursor: pointer;
}

/* ── Inline rename / delete icon buttons (right of collection title) ── */
.profile-col-name-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border: none; background: transparent;
  color: var(--muted, #aaa); border-radius: 6px;
  cursor: pointer; padding: 0;
  transition: color 0.15s, background 0.15s;
}
.profile-col-name-icon-btn:hover { color: var(--ink, #1a1a1a); background: var(--surface-alt, rgba(0,0,0,0.06)); }
.profile-col-name-icon-btn--danger { color: var(--danger, #e53e3e); }
.profile-col-name-icon-btn--danger:hover { color: var(--danger, #e53e3e); background: rgba(229,62,62,0.08); }
.profile-col-name-icon-btn--confirm {
  font-size: 11px; font-weight: 600; width: auto; padding: 3px 8px;
  background: var(--danger, #e53e3e); color: #fff; border-radius: 6px;
}
.profile-col-name-icon-btn--confirm:hover { background: #c0392b; color: #fff; }


/* ── Create board row ── */
.profile-fav-board--create {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.profile-fav-board-create-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px dashed var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--muted); line-height: 1;
}

/* ── Want badge on profile food cards ── */
.profile-post-thumb {
  position: relative;
}
.profile-post-flag {
  position: absolute;
  top: 6px; left: 6px;
  font-size: 10px; font-weight: 700;
  color: #fff;
  background: rgba(255, 69, 58, 0.85);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

/* ── Draft card in profile ── */
.profile-post-card--draft {
  border: 2px dashed var(--border, #e0dcd4);
  background: var(--surface, #f9f7f4);
}
.profile-draft-folder {
  background: var(--surface-alt, #f0ece6) !important;
  font-size: 32px !important;
}
.profile-draft-badge {
  background: var(--accent, #c47f5a) !important;
  color: #fff !important;
}

/* ── Draft list panel ── */
/* .draft-list-overlay → u-overlay shortcut (RFC-0004) */
.draft-list-panel {
  width: 100%; max-height: 70vh;
  background: var(--bg, #fff);
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding-bottom: calc(var(--safe-bottom, 0px) + 16px);
}
.draft-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px; font-size: 17px; font-weight: 700;
  color: var(--ink, #1a1a1a);
  border-bottom: 1px solid var(--border, #eee);
}
.draft-list-close {
  background: none; border: none; font-size: 18px;
  color: var(--muted, #999); cursor: pointer; padding: 4px 8px;
}
.draft-list-body { padding: 8px 0; }
.draft-list-item {
  display: flex; align-items: center; padding: 12px 20px;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.draft-list-item-info {
  display: flex; align-items: center; flex: 1; cursor: pointer; gap: 12px;
}
.draft-list-item-emoji { font-size: 28px; flex-shrink: 0; }
.draft-list-item-text { flex: 1; min-width: 0; }
.draft-list-item-name {
  font-size: 15px; font-weight: 600; color: var(--ink, #1a1a1a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.draft-list-item-meta { font-size: 12px; color: var(--muted, #999); margin-top: 2px; }
.draft-list-item-del {
  background: none; border: none; font-size: 16px; cursor: pointer;
  padding: 6px; opacity: 0.5;
}
.draft-list-item-del:active { opacity: 1; }
.draft-list-empty {
  text-align: center; padding: 40px 20px;
  font-size: 14px; color: var(--muted, #999);
}

/* ── Draft button in modal footer ── */
.mbtn-draft { color: var(--accent, #c47f5a) !important; }

/* ── Admin button in profile ── */
.profile-admin-btn {
  display: inline-flex; align-items: center;
  padding: 8px 16px; margin-top: 12px;
  font-size: 13px; font-weight: 600;
  color: var(--accent, #34C759);
  background: none; border: 1px solid var(--accent, #34C759);
  border-radius: 20px; cursor: pointer;
  font-family: inherit;
}
.profile-admin-btn:active { opacity: 0.7; }

/* ── Admin Panel ── */
.admin-panel {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg, #fff);
  display: flex; flex-direction: column;
}
.admin-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #eee);
}
.admin-title { font-size: 17px; font-weight: 700; flex: 1; }
.admin-count {
  font-size: 13px; font-weight: 600;
  color: var(--danger, #FF3B30);
}
.admin-body {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.admin-loading, .admin-empty {
  padding: 40px 20px; text-align: center;
}
.admin-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #eee);
}
.admin-item-name {
  font-size: 15px; font-weight: 600;
  color: var(--ink, #1a1a1a);
  margin-bottom: 4px;
}
.admin-item-meta {
  font-size: 12px; color: var(--muted, #999);
}
.admin-flag-count {
  color: var(--danger, #FF3B30);
  font-weight: 600;
}
.admin-item-actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.admin-action {
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px; background: var(--surface, #fff);
  cursor: pointer; font-family: inherit;
}
.admin-action--view { color: var(--accent, #34C759); border-color: var(--accent); }
.admin-action--dismiss { color: var(--muted, #999); }
.admin-action--hide { color: #FF9500; border-color: #FF9500; }
.admin-action--delete { color: var(--danger, #FF3B30); border-color: var(--danger); }

/* ── More menu & Report ── */
.detail-more-wrap {
  position: relative;
}
.detail-more-btn {
  background: none; border: none;
  padding: 8px; cursor: pointer;
  color: var(--muted, #999);
  display: flex; align-items: center;
}
.detail-more-dropdown {
  position: absolute; top: 100%; right: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #eee);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 120px;
  z-index: 320;
  overflow: hidden;
}
.detail-more-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 16px;
  font-size: 14px; color: var(--ink, #1a1a1a);
  background: none; border: none;
  text-align: left; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.detail-more-item:active { background: var(--hover, #f5f5f5); }
.detail-more-item--danger { color: var(--danger-name, rgba(220,60,60,0.9)); }
/* .report-overlay → u-overlay shortcut in detail.js (RFC-0004) */
.report-modal {
  background: var(--surface, #fff);
  border-radius: 16px;
  padding: 24px;
  max-width: 340px; width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.report-title {
  font-size: 17px; font-weight: 700;
  color: var(--ink, #1a1a1a);
  margin-bottom: 16px;
}
.report-options {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 20px;
}
.report-option {
  padding: 12px 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1a);
  font-size: 14px; cursor: pointer;
  text-align: left; font-family: inherit;
  transition: border-color 0.15s;
}
.report-option--active {
  border-color: var(--accent, #34C759);
  background: rgba(52, 199, 89, 0.06);
}
.report-actions {
  display: flex; gap: 10px;
}
.report-actions .mbtn-cancel { flex: 1; }
.report-actions .mbtn-primary { flex: 1; }

/* ── Share language picker ── */
.report-modal--sm { max-width: 260px; padding: 18px; }
.report-title--sm { font-size: 13px; margin-bottom: 12px; text-align: center; }
/* ── Share language wheel ── */
.lang-wheel {
  position: relative;
  height: 220px;
  overflow: hidden;
  margin: 4px 0 12px;
}
.lang-wheel-scroll {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  padding: 88px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.lang-wheel-scroll::-webkit-scrollbar { display: none; }
.lang-wheel-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center;
  font-size: 15px; color: var(--muted, #aaa);
  cursor: pointer;
  transition: color 0.15s, font-size 0.15s, font-weight 0.15s;
}
.lang-wheel-item--active {
  font-size: 20px; font-weight: 600;
  color: var(--ink, #1a1a1a);
}
.lang-wheel-indicator {
  position: absolute;
  top: 88px; left: 24px; right: 24px; height: 44px;
  border-top: 1px solid var(--border, rgba(0,0,0,0.1));
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.1));
  pointer-events: none;
}
.lang-wheel-fade {
  position: absolute; left: 0; right: 0; height: 88px;
  pointer-events: none;
}
.lang-wheel-fade--top    { top: 0;    background: linear-gradient(to bottom, var(--surface,#fff), transparent); }
.lang-wheel-fade--bottom { bottom: 0; background: linear-gradient(to top,   var(--surface,#fff), transparent); }

/* ── Show original link ── */
.show-orig-link {
  display: inline-block; margin-left: 6px;
  font-size: 11px; color: var(--muted, #999);
  cursor: pointer; text-decoration: underline dotted;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.show-orig-link:hover { color: var(--accent, #c4956a); }
.show-orig-link--block {
  display: block; margin: 6px 0 0; text-align: right;
}

/* ── Language picker sheet ── */
.lang-picker-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 4px 0 16px;
}
.lang-picker-option {
  padding: 12px 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.lang-picker-option:hover { border-color: #c4956a; }
.lang-picker-option--active {
  border-color: var(--accent, #c4956a);
  background: var(--accent-light, rgba(196,149,106,0.08));
}
.lang-picker-check { color: var(--accent, #c4956a); font-weight: 700; }

/* ── Trip share/edit/delete buttons ── */
.trip-detail-share, .trip-detail-edit, .trip-detail-delete {
  background: none; border: none;
  padding: 6px 8px; cursor: pointer;
  color: var(--muted, #999);
  display: flex; align-items: center;
}
.trip-detail-share:active, .trip-detail-edit:active, .trip-detail-delete:active { opacity: 0.5; }
.trip-detail-share { color: var(--accent, #34C759); }
.trip-detail-delete { color: var(--danger, #FF3B30); }

/* Trip stop management buttons */
.trip-stop-actions {
  display: flex; gap: 2px; flex-shrink: 0;
}
.trip-stop-btn {
  width: 28px; height: 28px;
  border: none; border-radius: 6px;
  background: var(--hover, #f5f5f5);
  color: var(--muted, #999);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.trip-stop-btn:active { opacity: 0.5; }
.trip-stop-remove { color: var(--danger, #FF3B30); }

/* ── RouteBar (floating above bottom nav) ── */
.route-bar {
  position: fixed;
  bottom: calc(var(--nav-height, 56px) + var(--safe-bottom, 0px) + 4px);
  left: 8px; right: 8px;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
  animation: routeBarSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes routeBarSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.route-bar-modes {
  display: flex; gap: 2px;
}
.route-bar-mode {
  padding: 6px;
  border: none; background: none;
  border-radius: 8px;
  color: var(--muted, #999);
  cursor: pointer;
  display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.route-bar-mode.active {
  color: var(--accent, #34C759);
  background: rgba(52, 199, 89, 0.1);
}
.route-bar-info {
  flex: 1;
  display: flex; align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}
.route-bar-count {
  font-size: 13px; font-weight: 700;
  color: var(--ink, #1a1a1a);
  white-space: nowrap;
}
.route-bar-stats {
  font-size: 13px; font-weight: 600;
  color: var(--accent, #34C759);
  white-space: nowrap;
  transition: opacity 0.2s;
}
.route-bar-stats.calculating {
  opacity: 0.4;
}
.route-bar-actions {
  display: flex; gap: 4px;
}
.route-bar-add {
  padding: 6px;
  border: none; background: none;
  color: var(--accent);
  cursor: pointer;
  display: flex; align-items: center;
  border-radius: 6px;
}
.route-bar-add:active { opacity: 0.5; }
.route-bar-expand, .route-bar-clear {
  padding: 6px;
  border: none; background: none;
  border-radius: 8px;
  color: var(--muted, #999);
  cursor: pointer;
  display: flex; align-items: center;
}
.route-bar-expand:active, .route-bar-clear:active { opacity: 0.5; }


/* Route view bar (minimized, replaces bottom nav during route viewing) */
.route-view-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 190;
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--surface, #fff);
  border-top: 1px solid var(--border, #e5e5e5);
  display: flex; align-items: center; justify-content: space-between;
  animation: routeBarSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.route-view-bar-info {
  display: flex; align-items: center; flex: 1; cursor: pointer;
  color: var(--ink, #1a1a1a); font-size: 14px; font-weight: 600;
}
.route-view-bar-text { font-size: 13px; font-weight: 500; }
.route-view-bar-actions { display: flex; gap: 8px; align-items: center; }
.route-view-bar-btn {
  background: none; border: none; color: var(--ink, #666); cursor: pointer;
  padding: 6px; border-radius: 8px;
}
.route-view-bar-btn:active { background: rgba(0,0,0,0.06); }

/* ── Navigation bar (food zoom + directions) ── */
.nav-food-bar {
  position: fixed;
  bottom: calc(var(--nav-height, 56px) + var(--safe-bottom, 0px) + 4px);
  left: 8px; right: 8px;
  z-index: 190;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
  animation: routeBarSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.nav-food-info {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.nav-food-emoji { font-size: 24px; flex-shrink: 0; }
.nav-food-text { min-width: 0; }
.nav-food-name {
  font-size: 15px; font-weight: 600;
  color: var(--ink, #1a1a1a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-food-loc {
  font-size: 12px; color: var(--muted, #999);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-food-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.nav-food-btn {
  border: none; cursor: pointer; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.nav-food-btn--dir {
  background: var(--accent, #c4956a); color: #fff;
  padding: 8px 14px;
}
.nav-food-btn--dir:active { opacity: 0.85; }
.nav-food-btn--close {
  background: none; color: var(--muted, #999);
  padding: 8px; font-size: 16px;
}

/* Route sheet (bottom sheet overlay) */
/* .route-sheet-overlay → u-overlay shortcut in app.js (RFC-0004) */
.route-sheet {
  width: 100%;
  max-height: 70vh;
  background: var(--bg, #fff);
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding-bottom: calc(var(--safe-bottom, 0px) + 16px);
}

/* ── Want marker on map ── */
.map-marker--want span {
  opacity: 0.85;
  font-size: 20px;
}

/* ── Want→Loved upgrade banner ── */
.detail-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: none;
  border-bottom: 1px solid var(--border, #eee);
}
.detail-upgrade-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #999);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.detail-upgrade-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  background: none;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.detail-upgrade-btn:active { opacity: 0.6; }

/* ── Geo context tags (river/railway) ── */
.detail-geo-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.detail-geo-tag:active { opacity: 0.7; }
.detail-geo-tag--river {
  background: rgba(74, 144, 217, 0.12);
  color: #4A90D9;
}
.detail-geo-tag--railway {
  background: rgba(196, 168, 130, 0.15);
  color: #8B7355;
}

/* ── Collapsible Sections ── */
.detail-section {
  border-top: 1px solid var(--border, #eee);
}
.detail-section-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background: none; border: none;
  font-size: calc(12px * var(--font-scale, 1)); font-weight: 500;
  color: var(--ink, #1a1a1a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}
.detail-section-toggle::before {
  content: '\2013';
  color: var(--muted, #999);
  margin-right: 8px;
  font-weight: 400;
  flex-shrink: 0;
}
.detail-section-toggle > span:first-of-type {
  flex: 1;
  text-align: left;
}
.detail-section-arrow {
  font-size: 12px;
  color: var(--muted, #999);
  margin-left: auto;
}
.detail-section-body {
  padding: 0 20px 20px 34px;
}
.detail-section-text {
  font-size: calc(14px * var(--font-scale, 1));
  font-weight: 300;
  color: var(--soft, #666);
  line-height: 1.9;
  white-space: pre-line;
  margin: 0;
}
.detail-translating {
  opacity: 0.4;
}

/* ── Restaurants ── */
.detail-restaurant {
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.detail-restaurant:last-child { border-bottom: none; }
.detail-restaurant-name {
  font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; color: var(--ink);
}
.detail-restaurant-addr {
  font-size: calc(12px * var(--font-scale, 1)); color: var(--muted); margin-top: 2px;
}
.detail-restaurant-note {
  font-size: calc(13px * var(--font-scale, 1)); color: var(--soft); margin-top: 4px;
}
.detail-restaurant-link {
  font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 4px; display: inline-block;
}

/* ── Comments ── */
.detail-comments {
  padding: 16px;
  border-top: 8px solid var(--surface-alt, #f5f5f5);
}

/* ── Comment section header with sort tabs ── */
.detail-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.detail-comments-title {
  font-size: 15px; font-weight: 700;
  color: var(--ink, #1a1a1a);
}
.detail-comments-empty {
  color: var(--muted); font-size: 13px; font-style: italic;
  padding: 4px 0 8px;
}
.detail-comments-count {
  font-weight: 400; color: var(--muted);
}
.detail-comments-sort {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border-radius: 16px;
  padding: 2px;
  gap: 0;
}
.detail-comments-sort-tab {
  background: none; border: none;
  font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  padding: 4px 10px; border-radius: 14px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.detail-comments-sort-tab--active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Comment item (Soul layout: avatar left, body column right) ── */
.detail-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0; /* RFC-0008: tighter vertical rhythm (was 12px) */
  border-bottom: 1px solid var(--border, #eee);
}
.detail-comment:last-child { border-bottom: none; }

.detail-comment-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover; cursor: pointer;
  flex-shrink: 0;
}
.detail-comment-avatar-placeholder {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent, #34C759);
  background: var(--surface);
  color: var(--accent, #34C759);
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

/* Body column (right of avatar) */
.detail-comment-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px; /* RFC-0008: was 3px */
}
.detail-comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.detail-comment-user {
  font-size: 13px; font-weight: 600;
  color: var(--ink); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-comment-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.detail-comment-time {
  font-size: 11px; color: var(--muted);
}
.detail-comment-text {
  font-size: calc(14px * var(--font-scale, 1)); color: var(--soft);
  line-height: 1.45; /* RFC-0008: tighter leading (was 1.6) */
}

/* Comment image */
.comment-img {
  max-width: 60%; max-height: 200px; object-fit: cover;
  border-radius: 10px; margin-top: 5px; cursor: zoom-in; display: block; /* RFC-0008: was 7px */
}

/* Meta row: reply left, like right */
.detail-comment-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px; /* RFC-0008: was 4px */
}
.detail-comment-reply-btn {
  background: none; border: none;
  color: var(--muted); font-size: 12px; font-weight: 500;
  padding: 0; cursor: pointer;
}
.detail-comment-reply-btn:active { opacity: 0.6; }
.detail-comment-like-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--muted); font-size: 12px; line-height: 1;
  flex-shrink: 0;
}
.detail-comment-like-btn--active { color: #FF3B30; }
.detail-comment-like-btn:active { opacity: 0.7; }

.detail-comment-delete {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--muted); padding: 0;
  line-height: 1; opacity: 0.4;
}
.detail-comment-delete:hover { opacity: 1; color: #FF3B30; }
.detail-comment-flag {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 0;
  line-height: 1; opacity: 0.35;
}
.detail-comment-flag:hover { opacity: 0.8; }

/* ── View / hide replies toggle ── */
/* RFC-0007: lives inside .detail-comment-body now (already right of the avatar),
   so no left indent — was 48px when it sat as a flex sibling of the body. */
.detail-comment-replies-toggle-wrap {
  margin: 4px 0 0 0;
}
.detail-comment-view-replies {
  background: none; border: none;
  color: var(--muted); font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 6px;
}
.detail-comment-view-replies-line {
  display: inline-block; width: 20px; height: 1px;
  background: var(--border, #ddd); flex-shrink: 0;
}
.detail-comment-view-replies-arrow { font-size: 9px; }

/* ── Threaded replies container ── */
/* RFC-0007: inside .detail-comment-body now → no 48px left indent; the left
   border + padding still give replies their threaded inset under the parent. */
.detail-comment-replies {
  margin: 6px 0 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--border, #eee);
}
.detail-comment--reply {
  padding: 6px 0; /* RFC-0008: was 8px */
  border-bottom: none;
}
.detail-comment--reply:last-child { border-bottom: none; }
.detail-comment-avatar--sm {
  width: 26px !important; height: 26px !important;
}
.detail-comment-avatar-placeholder--sm {
  width: 26px !important; height: 26px !important;
  font-size: 11px !important;
}

/* ── @mention highlight ── */
.detail-comment-mention {
  color: var(--accent, #34C759);
  font-weight: 500;
}

/* ── Reply bar above input (shown when replying) ── */
.detail-reply-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px 6px;
  background: var(--surface-alt, #f5f5f5);
  border-bottom: 1px solid var(--border, #eee);
  font-size: 12px; color: var(--muted);
}
.detail-reply-bar-text { flex: 1; min-width: 0; }
.detail-reply-bar-cancel {
  background: none; border: none;
  color: var(--muted); font-size: 17px; font-weight: 300;
  cursor: pointer; padding: 0 2px; line-height: 1;
  flex-shrink: 0;
}

/* ── Recommended Foods ── */
.detail-recommend {
  padding: 16px 0 80px;
  border-top: 8px solid var(--surface-alt, #f5f5f5);
}
.detail-recommend-title {
  font-size: 15px; font-weight: 700;
  color: var(--ink, #1a1a1a);
  padding: 0 16px 12px;
}
.detail-recommend-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 16px 4px 16px;
  /* Without this, `scroll-snap-type: x mandatory` snaps the first card flush
     to the scrollport's edge — eating the 16px left padding, so the cards end
     up flush-left while the title/body text stay indented 16px (the "app has
     no indent" bug; the web版 avoids it because its inset comes from the
     parent .detail-body padding, OUTSIDE the snap scrollport). scroll-padding
     offsets the snap position so the first card rests at the 16px inset and
     lines up with the title and body. Logical (inline) for RTL languages. */
  scroll-padding-inline: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.detail-recommend-scroll::-webkit-scrollbar { display: none; }
.detail-recommend-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--bg, #fff);
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border, #eee);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.15s;
}
.detail-recommend-card:active { transform: scale(0.96); }
.detail-recommend-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-alt, #f9f9f9);
}
.detail-recommend-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.detail-recommend-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.detail-recommend-emoji-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--surface-alt, #f9f9f9);
}
.detail-recommend-info {
  padding: 8px 10px 10px;
}
.detail-recommend-name {
  font-size: 13px; font-weight: 600;
  color: var(--accent, #E8A838);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.detail-recommend-tags {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 5px;
}
.detail-recommend-tag {
  font-size: 10px;
  color: var(--accent, #34C759);
  background: var(--accent-subtle, rgba(52,199,89,0.1));
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ── Bottom Action Bar ── */
/* ── Reply bar (fixed, above action bar) ── */
.detail-reply-bar-fixed {
  position: fixed;
  bottom: calc(52px + var(--safe-bottom, 0px));
  left: 0; right: 0;
  z-index: 311;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--soft);
}
.detail-reply-bar-fixed .detail-reply-bar-text { flex: 1; min-width: 0; }
.detail-reply-bar-fixed .detail-reply-bar-cancel {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--muted); padding: 0 2px;
}

/* ── Bottom action bar (Soul style: pill + icons) ── */
.detail-action-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 310;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  background: var(--surface);
  border-top: 1px solid var(--border, #eee);
}

/* Comment input pill */
.detail-comment-pill {
  flex: 1; min-width: 0;
  /* flex-end so the attach/send buttons stay bottom-aligned as the textarea grows */
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--surface-alt);
  border-radius: 18px;
  padding: 6px 12px;
  cursor: text;
}
/* RFC-0007: auto-growing multi-line textarea (was a single-line <input>). */
.detail-comment-pill-input {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  color: var(--ink); font-size: 14px;
  outline: none; font-family: inherit;
  display: block;
  resize: none;
  line-height: 1.4;
  min-height: 22px;   /* ~one line */
  max-height: 120px;  /* then scroll internally */
  overflow-y: auto;
  padding: 5px 0;
}
.detail-comment-pill-placeholder {
  flex: 1; font-size: 14px; color: var(--muted);
  pointer-events: none;
}
.detail-comment-pill-send {
  background: var(--accent); color: #fff;
  border: none; border-radius: 14px;
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; cursor: pointer;
  font-family: inherit; flex-shrink: 0;
  transition: opacity 0.15s;
}
.detail-comment-pill-send:disabled { opacity: 0.4; }

/* ── RFC-0008: compact pill trigger (one-line draft preview / placeholder) ── */
.detail-comment-pill-trigger {
  flex: 1; min-width: 0;
  font-size: 14px; color: var(--ink); line-height: 22px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none;
}
.detail-comment-pill-trigger--ph { color: var(--muted); }

/* ── RFC-0008: expanded composer (floats above the iOS keyboard) ── */
.comment-composer-backdrop {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.32);
  animation: composerFade 0.2s ease;
}
@keyframes composerFade { from { opacity: 0; } to { opacity: 1; } }
.comment-composer {
  position: fixed; left: 0; right: 0; /* bottom set inline = keyboard inset */
  z-index: 801;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border, #eee);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 28px rgba(0,0,0,0.18);
  padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
  max-height: 70vh;
  animation: composerSlide 0.22s cubic-bezier(0.33, 1, 0.68, 1);
}
@keyframes composerSlide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.comment-composer-reply {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--soft); margin-bottom: 8px;
}
.comment-composer-reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-composer-reply-x {
  background: none; border: none; color: var(--muted);
  font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; flex-shrink: 0;
}
.comment-composer-input {
  width: 100%; box-sizing: border-box;
  border: none; background: transparent; outline: none;
  resize: none; font-family: inherit;
  font-size: calc(15px * var(--font-scale, 1)); line-height: 1.5; color: var(--ink);
  min-height: 120px; max-height: 45vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.comment-composer-img {
  position: relative; width: 96px; height: 96px; margin-top: 8px;
  border-radius: 10px; overflow: hidden; flex-shrink: 0;
}
.comment-composer-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comment-composer-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.comment-composer-attach {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--muted); display: inline-flex; min-width: 40px; min-height: 40px;
  align-items: center; justify-content: center;
}
.comment-composer-attach:active { color: var(--ink); }
.comment-composer-send {
  background: var(--accent); color: #fff;
  border: none; border-radius: 18px;
  font-size: 14px; font-weight: 600;
  padding: 9px 22px; cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.comment-composer-send:disabled { opacity: 0.4; }

/* Comment image attach button + preview chip (in pill) */
.detail-comment-attach {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--muted); flex-shrink: 0;
}
.detail-comment-attach:active { opacity: 0.6; }
.detail-comment-img-chip { position: relative; flex-shrink: 0; }
.detail-comment-img-chip img {
  width: 34px; height: 34px; object-fit: cover; border-radius: 7px; display: block;
}
.detail-comment-img-chip-x {
  position: absolute; top: -5px; right: -5px;
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}

/* Action icon buttons (right side) */
.detail-action-icons {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.detail-action-icon {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none;
  color: var(--soft, #666); cursor: pointer;
  padding: 4px 8px; font-family: inherit;
  font-size: 11px; line-height: 1.2;
  transition: color 0.15s;
}
.detail-action-icon--active { color: var(--accent); }
.detail-action-icon:active { opacity: 0.7; }


/* ── Old detail-header kept for compat ── */
.detail-header {
  position: sticky;
  top: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--glass-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  min-height: calc(var(--safe-top) + 48px);
}

.detail-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink);
}

.detail-back:active {
  background: var(--accent-subtle);
}



.detail-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(60px + var(--safe-bottom) + 16px);
}

/* Image carousel */
.detail-images {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: transparent;
  overflow: hidden;
}




.detail-images-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s, width 0.2s;
}

.detail-images-dots .dot.active {
  width: 18px;
  border-radius: 3px;
  background: #fff;
}

.detail-section {
  padding: 16px;
}

.detail-section + .detail-section {
  border-top: 1px solid var(--border);
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.detail-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.detail-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--soft);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

/* Interaction bar */
/* ── Detail Author ── */
.detail-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
}
.detail-author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.detail-author-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
  color: var(--accent, #34C759);
  background: #fff;
  border: 1.5px solid var(--accent, #34C759);
  flex-shrink: 0;
  box-sizing: border-box;
}
.detail-author > div {
  min-width: 0;
  overflow: hidden;
}
.detail-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
}
.detail-author-date {
  font-size: 12px;
  color: var(--muted, #999);
  display: block;
  margin-top: 2px;
}

.detail-interact {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 310;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px calc(var(--safe-bottom) + 8px);
  background: var(--glass-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}

.detail-interact button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--soft);
  transition: background 0.15s, color 0.15s;
}

.detail-interact button:active {
  background: var(--accent-subtle);
}

.detail-interact button.liked {
  color: var(--heart);
}

.detail-interact .interact-comment {
  flex: 1;
  height: 40px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
}


/* ----------------------------------------------------------
   9. Profile Panel
   ---------------------------------------------------------- */

.profile-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  opacity: 0.6;
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.profile-panel.open {
  transform: translateX(0);
  opacity: 1;
}

/* ── Bluesky-style profile header ── */
.profile-header {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.profile-banner {
  width: 100%; height: 150px;
  background: linear-gradient(135deg, var(--accent-subtle, #e8f5e9) 0%, var(--surface-alt, #f0f0f0) 100%);
  position: relative; overflow: hidden;
}
.profile-banner-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-banner-edit {
  position: absolute; bottom: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}

.profile-header-body { padding: 0 12px 16px; }

.profile-header-top {
  display: flex; justify-content: space-between; align-items: flex-end;
}

.profile-panel--blocked .profile-header,
.profile-panel--blocked .xhs-scroll { opacity: 0.4; }
.profile-panel--blocked .profile-actions { opacity: 1; }

.profile-avatar-wrap {
  width: 80px; height: 80px; border-radius: 50%;
  margin-top: -36px; flex-shrink: 0;
  overflow: hidden; position: relative; z-index: 1;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 3px solid var(--surface, #fff);
  background: var(--surface, #fff);
}
.profile-avatar-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.profile-avatar-placeholder {
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  color: var(--accent, #34C759);
  background: #fff !important;
  border: 2px solid var(--accent, #34C759);
  box-sizing: border-box;
}

.profile-username {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-top: 8px;
}

.profile-bio {
  font-size: 13px; color: var(--muted);
  margin-top: 6px; line-height: 1.5;
  white-space: pre-wrap;
}
.profile-bio-edit { margin-top: 6px; }
.profile-bio-ta {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--border, #ddd);
  background: var(--input-bg, var(--bg, #fff));
  color: var(--text, #333);
  font-size: 13px; line-height: 1.5;
  font-family: inherit;
  resize: vertical; min-height: 60px;
  outline: none; transition: border-color 0.2s;
}
.profile-bio-ta:focus { border-color: var(--accent, #34C759); }
.profile-bio-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 8px;
}
.profile-btn-cancel, .profile-btn-save {
  padding: 6px 16px; border-radius: 8px;
  font-size: 13px; font-family: inherit;
  cursor: pointer; border: none;
}
.profile-btn-cancel {
  background: var(--card-bg, #f5f5f5);
  color: var(--muted, #999);
}
.profile-btn-save {
  background: var(--accent, #34C759);
  color: #fff; font-weight: 600;
}
.profile-btn-save:disabled { opacity: 0.5; }
.profile-bio-placeholder {
  display: inline-block;
  padding: 6px 12px; border-radius: 8px;
  border: 1px dashed var(--border, #ddd);
  color: var(--muted, #aaa);
  font-size: 12px;
}

.profile-actions {
  display: flex; gap: 8px; align-items: center;
  padding-top: 8px;
}

/* Icon buttons (block eye, map) */
.profile-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border, #ddd);
  background: transparent; cursor: pointer;
  color: var(--muted, #888); transition: all 0.15s;
  flex-shrink: 0;
}
.profile-icon-btn:active { background: var(--surface-alt, #f5f5f5); }
.profile-icon-btn.active { border-color: var(--accent, #34C759); color: var(--accent, #34C759); }
.profile-icon-btn.active svg { stroke: var(--accent, #34C759); }

/* Wrapper so the more-dropdown can position relative to the ... button */
.profile-more-wrap { position: relative; display: inline-block; }

/* Follow / Following pill */
.profile-follow-btn {
  padding: 3px 12px; border-radius: 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--accent, #34C759);
  color: #fff; background: var(--accent, #34C759);
  font-family: inherit; transition: all 0.2s;
}
.profile-follow-btn.following {
  background: transparent; color: var(--accent, #34C759);
}

/* ── Blocked panel ── */
.blocked-panel { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; }
.blocked-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.blocked-row-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-alt, #eee); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--accent); overflow: hidden; flex-shrink: 0; }
.blocked-row-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.blocked-row-info { flex: 1; min-width: 0; }
.blocked-row-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.blocked-row-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.blocked-row-action { padding: 5px 14px; border-radius: 14px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); color: var(--muted); background: transparent; font-family: inherit; flex-shrink: 0; }
.blocked-row-action:active { background: var(--surface-alt, #f5f5f5); }
.blocked-row-action--danger { border-color: rgba(200,80,80,0.3); color: rgba(200,80,80,0.8); }
.blocked-empty { text-align: center; padding: 48px 16px; color: var(--muted); font-size: 13px; }

.profile-stats {
  display: flex; gap: 14px;
  margin-top: 6px; font-size: 13px; color: var(--muted);
}
.profile-stat strong { font-weight: 700; color: var(--ink); }

.profile-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
}







/* ----------------------------------------------------------
   9b. Profile Tab Bar + Trips + Route Planning
   ---------------------------------------------------------- */
.profile-tab-bar {
  display: flex; border-bottom: 1px solid var(--border, #e5e5e5); margin: 0 16px;
}
.profile-tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  font-size: 12px; font-weight: 500; color: var(--muted, #999);
  cursor: pointer; position: relative; font-family: var(--font-body, inherit);
}
.profile-tab--active { color: var(--ink, #1a1a1a); font-weight: 600; }
.profile-tab--active::after {
  content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%;
  height: 2px; background: var(--accent, #34C759); border-radius: 1px;
}

/* Trip Cards */
.profile-trips-section { padding: 4px; }
.profile-trips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.trip-card {
  background: var(--surface, #fff); border-radius: 16px; overflow: hidden;
  position: relative; cursor: pointer; border: 1px solid var(--border, #e5e5e5);
}
.trip-card-cover { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-alt, #f0f0f0); }
.trip-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.trip-card-cover-empty {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 32px; opacity: 0.4; color: var(--muted, #999);
}
.trip-card-info { padding: 8px 10px; }
.trip-card-name {
  font-size: 13px; font-weight: 600; color: var(--ink, #1a1a1a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip-card-meta { font-size: 11px; color: var(--muted, #999); display: flex; gap: 6px; margin-top: 2px; }
.trip-card-visibility { font-size: 10px; color: var(--accent, #34C759); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.trip-card-delete {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.5);
  color: #fff; border: none; border-radius: 50%; width: 24px; height: 24px;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Route Panel (bottom sheet on mobile) */
.route-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 350;
  background: var(--bg, #fff); border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  max-height: 55vh; overflow-y: auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 70px);
  animation: slideUp .3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.route-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border, #e5e5e5);
}
.route-title {
  font-size: 14px; font-weight: 600; color: var(--ink, #1a1a1a); flex: 1;
}
.route-mode-toggle { display: flex; gap: 2px; }
.route-mode-btn {
  border: none; background: transparent; font-size: 16px; padding: 4px 6px;
  border-radius: 6px; cursor: pointer; opacity: 0.4; transition: opacity .15s, background .15s;
  color: var(--ink, #1a1a1a);
}
.route-mode-btn.active { opacity: 1; background: var(--accent-subtle, rgba(0,0,0,0.06)); color: var(--accent, #34C759); }
.route-close-btn {
  border: none; background: transparent; font-size: 14px; color: var(--muted, #999);
  cursor: pointer; padding: 4px 6px;
}
/* Route start/end inputs */
.route-endpoints { padding: 10px 14px; border-bottom: 1px solid var(--border, #e5e5e5); }
.route-endpoint-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.route-endpoint-row:last-child { margin-bottom: 0; }
.route-endpoint-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--accent, #34C759);
}
.route-endpoint-start { background: var(--accent, #34C759); }
.route-endpoint-end { background: transparent; }
.route-location-input { flex: 1; position: relative; display: flex; align-items: center; gap: 4px; }
.route-myloc-btn {
  border: none; background: var(--accent-subtle, rgba(0,0,0,0.05)); color: var(--accent, #34C759);
  border-radius: 6px; padding: 5px; cursor: pointer; display: flex; flex-shrink: 0;
}
.route-loc-field {
  flex: 1; border: 1px solid var(--border, #e5e5e5); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; background: var(--surface, #fff);
  color: var(--ink, #1a1a1a); outline: none; min-width: 0;
}
.route-loc-field:focus { border-color: var(--accent, #34C759); }
.route-loc-clear {
  border: none; background: transparent; color: var(--muted, #999); cursor: pointer;
  font-size: 11px; padding: 2px 4px; flex-shrink: 0;
}
.route-loc-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 160px; overflow-y: auto; margin-top: 2px;
}
.route-loc-suggest-item {
  padding: 8px 10px; font-size: 12px; color: var(--ink, #1a1a1a); cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.route-loc-suggest-item:active { background: rgba(0,0,0,0.04); }

.route-stops { padding: 8px 0; }
.route-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--muted, #999); }
.route-stop-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
}
.route-stop-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent, #34C759); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.route-stop-name { flex: 1; min-width: 0; }
.route-stop-main {
  font-size: 13px; color: var(--ink, #1a1a1a); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.route-stop-sub { font-size: 10px; color: var(--muted, #999); margin-top: 1px; }
.route-stop-actions { display: flex; gap: 2px; flex-shrink: 0; }
.route-stop-btn {
  border: none; background: transparent; font-size: 12px; color: var(--muted, #999);
  cursor: pointer; padding: 2px 5px; border-radius: 4px;
}
.route-stop-remove:active { color: #E53E3E; }
.route-summary {
  padding: 8px 0; border-top: 1px solid var(--border, #e5e5e5);
  display: flex; gap: 16px; font-size: 12px; color: var(--muted, #999);
}
.route-summary strong { color: var(--ink, #1a1a1a); }
.route-actions {
  padding: 8px 0; border-top: 1px solid var(--border, #e5e5e5);
  display: flex; gap: 8px;
}
.route-action-btn {
  flex: 1; border: none; padding: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.route-optimize-btn { background: var(--accent, #34C759); color: #fff; }
.route-nav-btn { background: var(--accent-subtle, rgba(0,0,0,0.05)); color: var(--accent, #34C759); border: 1.5px solid var(--accent, #34C759); }
.route-nav-btn:disabled { opacity: 0.4; }
.route-save-btn { background: var(--accent-subtle, rgba(0,0,0,0.05)); color: var(--accent, #34C759); }
.route-clear-btn { background: rgba(0,0,0,0.05); color: var(--muted, #999); }

/* Route map markers */
.route-marker {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent, #34C759); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* SVG Icons */
.svg-icon { color: inherit; display: inline-flex; }
.svg-icon svg { display: block; }

/* Trip Save Modal */
/* .trip-save-overlay → u-overlay shortcut in route.js (RFC-0004) */
.trip-save-sheet {
  background: var(--bg, #fff); border-radius: 20px 20px 0 0;
  width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.trip-save-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.trip-save-title { font-size: 16px; font-weight: 600; color: var(--ink, #1a1a1a); }
.trip-save-field { margin-bottom: 14px; }
.trip-save-label {
  font-size: 11px; font-weight: 600; color: var(--muted, #999);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em;
}
.trip-save-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border, #e5e5e5); background: var(--surface, #fff);
  color: var(--ink, #1a1a1a); font-size: 14px;
}
.trip-save-input:focus { outline: none; border-color: var(--accent, #34C759); }
.trip-save-textarea { resize: vertical; min-height: 60px; }
.trip-cover-upload {
  width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden;
  border: 1px dashed var(--border, #e5e5e5); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt, #f5f5f5);
}
.trip-cover-preview { width: 100%; height: 100%; object-fit: cover; }
.trip-cover-placeholder { font-size: 14px; color: var(--muted, #999); }
.food-visibility-group { display: flex; gap: 6px; margin-top: 6px; }
.food-visibility-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border, #e5e5e5); background: var(--surface, #fff);
  color: var(--ink, #1a1a1a); font-size: 12px; cursor: pointer; text-align: left;
  font-family: inherit; transition: all 0.15s;
}
.food-visibility-btn.active {
  border-color: var(--accent, #34C759); background: var(--accent-subtle, rgba(0,0,0,0.04));
  color: var(--accent, #34C759); font-weight: 600;
}
.trip-visibility-group { display: flex; gap: 6px; }
.trip-visibility-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border, #e5e5e5); background: var(--surface, #fff);
  color: var(--ink, #1a1a1a); font-size: 12px; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: flex-start; gap: 4px;
}
.trip-visibility-btn.active {
  border-color: var(--accent, #34C759); background: var(--accent-subtle, rgba(0,0,0,0.04));
  color: var(--accent, #34C759); font-weight: 600;
}
.trip-mode-display { font-size: 13px; color: var(--ink, #1a1a1a); padding: 8px 0; display: flex; align-items: center; gap: 4px; }
.trip-stop-note-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.trip-stop-note-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent, #34C759); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 4px;
}
.trip-stop-note-info { flex: 1; min-width: 0; }
.trip-stop-note-name { font-size: 13px; color: var(--ink, #1a1a1a); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-stop-note-input {
  width: 100%; box-sizing: border-box; padding: 6px 10px; margin-top: 4px;
  border: 1px solid var(--border, #e5e5e5); border-radius: 8px; font-size: 12px;
  background: var(--surface, #fff); color: var(--ink, #1a1a1a);
}
.trip-stop-note-input:focus { outline: none; border-color: var(--accent, #34C759); }
.trip-save-submit {
  width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: var(--accent, #34C759); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 8px;
}
.trip-save-submit:disabled { opacity: 0.4; }

/* Trip Detail View */
.trip-detail-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 450;
  height: 60vh; max-height: 600px;
  background: var(--bg, #fff); display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.trip-detail-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.trip-detail-cover { width: 100%; max-height: 200px; object-fit: cover; }
.trip-detail-map { display: none; }
.trip-detail-info { padding: 16px; }
.trip-detail-name { font-size: 18px; font-weight: 700; color: var(--ink, #1a1a1a); }
.trip-detail-meta {
  font-size: 12px; color: var(--muted, #999); margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.trip-visibility-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-subtle, rgba(0,0,0,0.04)); color: var(--accent, #34C759);
  display: flex; align-items: center; gap: 3px;
}
.trip-detail-desc { font-size: 14px; color: var(--ink, #1a1a1a); line-height: 1.6; margin-top: 12px; white-space: pre-wrap; }
.trip-detail-stops { padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 72px); }

/* Bottom action bar */
.trip-detail-bottombar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-evenly; align-items: center;
  padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--bg, #fff);
  border-top: 1px solid var(--border, #e5e5e5);
  z-index: 2;
}
.trip-bottom-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 6px 20px;
  color: var(--muted, #999); transition: color .15s;
}
.trip-bottom-btn:active { opacity: 0.5; }
.trip-bottom-share { color: var(--accent, #34C759); }
.trip-bottom-edit { color: var(--ink, #1a1a1a); }
.trip-bottom-delete { color: var(--danger, #FF3B30); }
.trip-bottom-label { font-size: 11px; font-weight: 500; }

/* Trip sharing */
.trip-share-section { padding: 0 16px 24px; }
.trip-collaborators { margin-bottom: 12px; }
.trip-collab-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border, #e5e5e5); font-size: 13px; color: var(--ink, #1a1a1a);
}
.trip-collab-name { font-weight: 500; }
.trip-collab-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-subtle, rgba(0,0,0,0.04)); color: var(--accent, #34C759);
}
.trip-collab-badge--from { background: rgba(59,130,246,0.1); color: #3B82F6; }
.trip-invite-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.trip-invite-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.trip-invite-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border, #e5e5e5); border-radius: 10px;
  font-size: 13px; background: var(--surface, #fff); color: var(--ink, #1a1a1a); font-family: inherit;
  box-sizing: border-box;
}
.trip-invite-input:focus { outline: none; border-color: var(--accent, #34C759); }
.trip-invite-input--ok   { border-color: var(--accent, #34C759) !important; }
.trip-invite-input--error { border-color: #FF3B30 !important; }
.trip-invite-hint { font-size: 11px; padding-left: 2px; }
.trip-invite-hint--checking { color: var(--muted, #999); }
.trip-invite-hint--ok  { color: var(--accent, #34C759); }
.trip-invite-hint--err { color: #FF3B30; }
.trip-invite-btn {
  padding: 8px 16px; border: none; border-radius: 10px; flex-shrink: 0;
  background: var(--accent, #34C759); color: #fff; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.trip-invite-btn:disabled { opacity: 0.4; cursor: default; }
.trip-share-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.trip-share-req-btn, .trip-copy-btn {
  width: 100%; padding: 10px; border: 1px solid var(--border, #e5e5e5); border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; background: var(--surface, #fff); color: var(--ink, #1a1a1a);
}
.trip-share-req-btn--sent, .trip-share-req-btn:disabled { opacity: 0.55; cursor: default; }
.trip-collab-remove {
  background: none; border: none; color: var(--muted, #999); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.trip-collab-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border, #e5e5e5); font-size: 13px; }
.trip-collab-name { font-weight: 500; flex: 1; }
.trip-collab-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--accent-subtle, rgba(52,199,89,0.1)); color: var(--accent, #34C759); }
.trip-collab-badge--from { background: rgba(59,130,246,0.1); color: #3B82F6; }
.trip-pending-requests { margin-top: 12px; }
.route-marker--place { background: #f59e0b; }

.trip-detail-stops-head {
  font-size: 13px; font-weight: 600; color: var(--muted, #999);
  padding: 12px 0 8px; text-transform: uppercase; letter-spacing: 0.06em;
}
.trip-detail-stop {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border, #e5e5e5); cursor: pointer;
}
.trip-detail-stop-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent, #34C759); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-top: 2px;
}
.trip-detail-stop-body { flex: 1; min-width: 0; }
.trip-detail-stop-name { font-size: 14px; font-weight: 500; color: var(--ink, #1a1a1a); }
.trip-detail-stop-loc { font-size: 11px; color: var(--muted, #999); margin-top: 2px; }
.trip-detail-stop-note { font-size: 12px; color: var(--muted, #999); margin-top: 4px; font-style: italic; }
.trip-detail-delete {
  border: none; background: none; color: #E53E3E; font-size: 12px; cursor: pointer; padding: 4px 8px;
}

/* Dark theme overrides */
[data-theme="luxe"] .route-panel,
[data-theme="eastern"] .route-panel,
[data-theme="homebound"] .route-panel { background: var(--bg); }
[data-theme="luxe"] .route-mode-btn,
[data-theme="eastern"] .route-mode-btn,
[data-theme="homebound"] .route-mode-btn { color: var(--ink); }
[data-theme="luxe"] .route-mode-btn.active,
[data-theme="eastern"] .route-mode-btn.active,
[data-theme="homebound"] .route-mode-btn.active { color: var(--accent); }
[data-theme="luxe"] .trip-save-sheet,
[data-theme="eastern"] .trip-save-sheet,
[data-theme="homebound"] .trip-save-sheet { background: var(--bg); }
[data-theme="luxe"] .trip-card,
[data-theme="eastern"] .trip-card,
[data-theme="homebound"] .trip-card { background: var(--surface-alt); }
[data-theme="luxe"] .trip-detail-panel,
[data-theme="eastern"] .trip-detail-panel,
[data-theme="homebound"] .trip-detail-panel { background: var(--bg); }

/* ── Fusion (朝露) — deep navy header + editorial polish ── */
[data-theme="fusion"] .top-header {
  background: #FFFFFF;
  box-shadow: 0 1px 0 rgba(13,27,42,0.06);
}
[data-theme="fusion"] .top-header,
[data-theme="fusion"] .top-header-tab { color: #8899AA; }
[data-theme="fusion"] .top-header-tab--active { color: #0D1B2A; }
[data-theme="fusion"] .top-header-tab--active::after { background: #C4501A; }
[data-theme="fusion"] .top-header-avatar { border-color: #E8E4DE; }
[data-theme="fusion"] .app-root[data-tab="map"] .top-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="fusion"] .bottom-nav {
  background: #FFFFFF;
  box-shadow: 0 -1px 0 rgba(13,27,42,0.06);
}
[data-theme="fusion"] .bottom-nav-tab--active { color: #0D1B2A; }
[data-theme="fusion"] .nav-add-fab {
  background: #C4501A;
  box-shadow: 0 3px 12px rgba(196,80,26,0.25), 0 0 0 2.5px #fff, 0 0 0 3.5px #C4501A;
}
[data-theme="fusion"] .nav-add-ring { background: #C4501A; }
[data-theme="fusion"] .detail-category-tag {
  background: rgba(196,80,26,0.08);
  color: #C4501A;
  border: 1px solid rgba(196,80,26,0.15);
}
[data-theme="fusion"] .fi:focus,
[data-theme="fusion"] .fta:focus {
  border-color: #C4501A;
  box-shadow: 0 0 0 3px rgba(196,80,26,0.1);
}

/* ----------------------------------------------------------
   10. Modal (Add/Edit)
   ---------------------------------------------------------- */

.modal-content {
  width: 100%;
  max-height: calc(100vh - var(--safe-top) - 40px);
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.modal-handle::after {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.5;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 12px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.modal-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  color: var(--muted);
}

.modal-close:active {
  background: var(--accent-subtle);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
}

.modal-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-form {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}













.form-emoji-option.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* Emoji Picker (full) */
.emoji-picker {
  background: var(--card-bg, #fff); border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12); overflow: hidden;
  margin-top: 8px;
}
.emoji-picker-search { display: flex; align-items: center; padding: 8px 10px; gap: 6px; }
.emoji-picker-input { flex: 1; font-size: 13px !important; }
.emoji-picker-close {
  background: none; border: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 6px;
}
.emoji-picker-tabs {
  display: flex; border-bottom: 1px solid var(--border, #eee); padding: 0 6px; overflow-x: auto;
}
.emoji-picker-tab {
  flex: 1; padding: 6px 4px; font-size: 11px; font-weight: 600;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.emoji-picker-tab.active {
  color: var(--accent, #34C759); border-bottom-color: var(--accent, #34C759);
}
.emoji-picker-body {
  max-height: 220px; overflow-y: auto; padding: 6px;
}
.emoji-picker-group { margin-bottom: 6px; }
.emoji-picker-group-label {
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 4px 2px;
}
.emoji-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px;
}
.emoji-picker-btn {
  width: 36px; height: 36px; font-size: 22px; border: none; background: none;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.emoji-picker-btn:hover { background: rgba(0,0,0,0.06); }
.emoji-picker-empty {
  text-align: center; padding: 24px; font-size: 12px; color: var(--muted);
}


/* ----------------------------------------------------------
   11. Curated Panel
   ---------------------------------------------------------- */

.curated-panel {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: var(--bg, #F5F5F5);
  transform: translateX(0);
  animation: detail-slide-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.curated-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--glass-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.curated-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}



/* .curated-folder-card → migrated to u-card shortcut in curated.js (RFC-0004) */

.curated-folder-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

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

.curated-folder-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.curated-folder-count {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.curated-folder-arrow {
  color: var(--muted);
  flex-shrink: 0;
}

/* RFC-0004: removed DEAD .curated-collection-* grid-card family (grid/cover/name/info/author/card) — unused leftover; live collection card is the list-row variant below, now migrated to u-card. */

/* ── Curated Navbar ── */
.curated-navbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: inherit;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}
.curated-back {
  font-size: 14px;
  color: var(--accent);
  min-width: auto;
  min-height: auto;
  padding: 6px 0;
}
.curated-navbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.curated-close-btn {
  min-width: auto;
  min-height: auto;
}

/* ── Curated Scroll Body ── */
.curated-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0 calc(var(--safe-bottom) + 24px);
}

/* ── Curated Folders View ── */
.curated-folders {
  padding: 0 16px;
}
.curated-hero {
  padding: 28px 4px 24px;
}
.curated-hero-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.curated-hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.curated-folder-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Curated Collections List ── */
.curated-collections {
  padding: 16px;
}
/* .curated-collection-card → migrated to u-card shortcut in curated.js (RFC-0004) */
.curated-collection-info {
  padding: 0;
}
.curated-collection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.curated-collection-author {
  font-size: 13px;
  color: var(--accent);
  margin-top: 4px;
}
.curated-collection-desc {
  font-size: 12px;
  color: var(--soft);
  margin-top: 6px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.curated-collection-count {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.curated-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Curated Author Detail Header ── */
.curated-author-header {
  padding: 28px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.curated-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
}
.curated-author-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.curated-author-work {
  font-size: 13px;
  color: var(--accent);
  margin-top: 4px;
}
.curated-author-bio {
  font-size: 12px;
  color: var(--soft);
  margin-top: 8px;
  line-height: 1.7;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.curated-author-stats {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* ── Curated Category Groups ── */
.curated-category-group {
  padding: 0 16px;
}
.curated-category-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.curated-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.curated-category-count {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* ── Curated Food Cards (two-column book catalog) ── */
.curated-foods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-bottom: 4px;
}
.curated-food-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.curated-food-card:active {
  background: var(--surface-alt);
}
.curated-food-card:nth-child(odd) {
  border-right: 1px solid var(--border);
}
.curated-food-emoji {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.curated-food-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  padding: 6px 8px 2px;
}
.curated-food-zhname {
  font-size: 11px;
  color: var(--muted);
  padding: 0 8px 6px;
}


/* ----------------------------------------------------------
   12. Toast Notification
   ---------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 500;
  padding: 10px 20px;
  background: var(--glass-heavy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast--center {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: normal;
  text-align: center;
  max-width: 80vw;
  padding: 16px 24px;
  border-radius: 14px;
}


/* ----------------------------------------------------------
   13. Welcome Modal
   ---------------------------------------------------------- */

/* ── Welcome Screen ── */
/* .welcome-overlay → u-overlay shortcut (RFC-0004) */

.welcome-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface, #1A1A1A);
  border: 1px solid var(--border, #2A2A2A);
  border-radius: 24px;
  padding: 40px 28px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  text-align: center;
}

.welcome-logo-wrap {
  margin-bottom: 20px;
}
.welcome-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: inline-block;
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink, #E8E4DC);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.welcome-subtitle {
  font-size: 13px;
  color: var(--muted, #888);
  line-height: 1.6;
  margin-bottom: 28px;
  letter-spacing: 0.01em;
  white-space: pre-line;
}

.welcome-lang-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.welcome-lang-btn {
  padding: 6px 16px;
  border-radius: 20px;
  background: transparent;
  color: var(--muted, #888);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border, #333);
  cursor: pointer;
  transition: all 0.2s;
  min-height: auto;
  min-width: auto;
}
.welcome-lang-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Mode heading (shown after username check) ── */
.welcome-mode-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #E8E4DC);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.welcome-mode-hint {
  font-size: 13px;
  color: var(--muted, #888);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Form ── */
.welcome-form {
  width: 100%;
}
.welcome-field {
  margin-bottom: 14px;
}
.welcome-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding-left: 2px;
}

.welcome-input-wrap {
  position: relative;
}
.welcome-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border, #333);
  border-radius: 12px;
  background: var(--surface-alt, #111);
  color: var(--ink, #E8E4DC);
  font-size: 16px;
  font-weight: 400;
  padding: 0 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  -webkit-appearance: none;
}
.welcome-input:focus {
  border-color: var(--accent, #C9A86C);
  box-shadow: 0 0 0 3px rgba(201, 168, 108, 0.15);
  background: var(--surface, #1A1A1A);
}
.welcome-input::placeholder { color: var(--muted, #666); }
.welcome-input:disabled {
  opacity: 0.5;
}
.welcome-input--locked {
  background: var(--surface-alt, #111);
  color: var(--soft, #888);
}
.welcome-input--code {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
  font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
}
.welcome-input--code::placeholder {
  letter-spacing: 0.3em;
  font-weight: 400;
  color: var(--muted, #666);
}

.welcome-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--accent, #C9A86C);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  margin-top: 4px;
}
.welcome-btn:disabled { opacity: 0.25; }
.welcome-btn:active:not(:disabled) {
  opacity: 0.85;
  transform: scale(0.98);
}

.welcome-pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--accent, #C9A86C);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.welcome-forgot {
  font-size: 12px;
  color: var(--accent, #C9A86C);
  text-align: right;
  margin: -8px 0 4px;
  cursor: pointer;
  font-weight: 500;
  padding-right: 2px;
}
.welcome-error {
  font-size: 13px;
  color: #FF3B30;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.4;
  padding: 0 4px;
}
.welcome-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 4px; color: var(--muted, #999); font-size: 12px;
}
.welcome-divider::before, .welcome-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #e0e0e0);
}
.welcome-google-btn {
  margin-top: 12px; min-height: 44px; width: 100%;
}
.welcome-guest-link {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted, #999);
  text-align: center;
  cursor: pointer;
  transition: color .15s;
}
.welcome-guest-link:active { color: var(--ink, #333); }
.welcome-back-link {
  margin-top: 14px;
  font-size: 14px;
  color: var(--accent, #C9A86C);
  text-align: center;
  cursor: pointer;
  font-weight: 500;
}
.welcome-dismiss {
  margin-top: 12px;
  color: #999;
  font-size: 13px;
}
.welcome-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-alt, #f5f5f5);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}
.welcome-auth-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #999);
  cursor: pointer;
  transition: all 0.15s;
}
.welcome-auth-tab.active {
  background: var(--card-bg, #fff);
  color: var(--text, #1a1a1a);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}


/* ----------------------------------------------------------
   14. Loading States
   ---------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-alt) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* RFC: cover skeleton while a cover image/video is loading (FoodCoverImage adds
   .cover-loading until onLoad/onLoadedData; the fixed aspect box reserves space,
   so the shimmer→image swap causes no layout shift). */
.cover-loading {
  background-image: linear-gradient(90deg,
    var(--surface-alt, #eee) 25%, var(--surface, #f5f5f5) 50%, var(--surface-alt, #eee) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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


/* Skeleton loading screen */
.skeleton-screen { position: fixed; inset: 0; z-index: 9999; background: var(--bg, #fff); display: flex; flex-direction: column; }
.skeleton-search { height: 44px; margin: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0; border-radius: 22px; background: var(--surface-alt, #eee); }
.skeleton-map { flex: 1; margin: 12px 16px; border-radius: 12px; background: var(--surface-alt, #eee); }
.skeleton-sheet { height: 240px; border-radius: 16px 16px 0 0; background: var(--surface, #f5f5f5); padding: 16px; }
.skeleton-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.skeleton-circle { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-alt, #eee); flex-shrink: 0; }
.skeleton-line { height: 12px; border-radius: 6px; background: var(--surface-alt, #eee); }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

.skeleton-search, .skeleton-map, .skeleton-circle, .skeleton-line {
  background: linear-gradient(90deg, var(--surface-alt, #eee) 25%, var(--surface, #f5f5f5) 50%, var(--surface-alt, #eee) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Detail image lazy-load fade-in */
.detail-carousel-img { opacity: 0; transition: opacity 0.3s; }
.detail-carousel-img.loaded { opacity: 1; }


/* ----------------------------------------------------------
   15. Utility Classes
   ---------------------------------------------------------- */

.glass {
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* Animations */
.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0.6; }
  to   { transform: translateX(0); opacity: 1; }
}


@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ── Settings screen ──────────────────────────────────────────────────── */
.settings-screen {
  /* RFC-0004: translucent glass (same recipe as .tab-content) so the static
     earth sphere shows through — consistent with the discover/messages tabs.
     Opaque --bg fallback first for engines without color-mix/backdrop-filter. */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.settings-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider, rgba(0,0,0,0.08));
  background: transparent; /* RFC-0004: show the .settings-screen glass */
  flex-shrink: 0;
}
.settings-header-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.settings-back-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px 8px 4px 0; color: var(--accent);
  display: flex; align-items: center; flex-shrink: 0;
}
.settings-nav {
  width: 72px; flex-shrink: 0; overflow-y: auto;
  border-right: 1px solid var(--divider, rgba(0,0,0,0.08));
  padding: 12px 0;
  background: transparent; /* RFC-0004: show the .settings-screen glass */
}
.settings-nav-item {
  padding: 10px 4px; font-size: 11px; line-height: 1.3;
  color: var(--muted); cursor: pointer; text-align: center;
  border-left: 2.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  word-break: break-all;
}
.settings-nav-item.active {
  color: var(--accent); border-left-color: var(--accent);
  font-weight: 600;
  background: rgba(0,0,0,0.03);
}
[data-theme="forest"] .settings-nav-item.active { background: rgba(52,199,89,0.06); }
[data-theme="luxe"] .settings-nav-item.active { background: rgba(255,255,255,0.05); }
.settings-content {
  flex: 1; overflow-y: auto; padding: 0 12px 48px;
  -webkit-overflow-scrolling: touch;
}
.settings-section-title {
  margin-top: 22px; margin-bottom: 8px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-left: 2px;
}
/* RFC-0007 follow-up: read-only build version + time footer. */
.settings-version {
  margin-top: 22px;
  text-align: center;
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.02em; opacity: 0.75;
}
.settings-card {
  background: var(--surface-alt, var(--surface, #f5f5f5));
  background: color-mix(in srgb, var(--surface-alt, var(--surface, #f5f5f5)) 78%, transparent);
  border-radius: 12px; overflow: hidden;
}
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: default;
}
.settings-row--border { border-bottom: 1px solid var(--divider, rgba(0,0,0,0.06)); }
.settings-row--tappable { cursor: pointer; }
.settings-row--tappable:active { opacity: 0.6; }
.settings-row-label { font-size: 0.875rem; color: var(--text); }
.settings-row-label--danger { color: #e53935; }
.settings-row-value { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.settings-row-muted { font-size: 0.8rem; color: var(--muted); }
.settings-row-arrow { color: var(--muted); font-size: 1rem; margin-left: 4px; }
.settings-row-trailing { display: flex; align-items: center; gap: 4px; }
.settings-row-btn-accent {
  background: none; border: none; cursor: pointer;
  font-size: 0.8rem; color: var(--accent); padding: 0;
}

.slide-up {
  animation: slideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0); opacity: 1; }
}

.slide-down {
  animation: slideDown 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideDown {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.fade-out {
  animation: fadeOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

/* Visibility */
.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* Text */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--muted); }
.text-soft   { color: var(--soft); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Flex helpers */
.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-1     { flex: 1; }
.gap-4      { gap: 4px; }
.gap-8      { gap: 8px; }
.gap-12     { gap: 12px; }
.gap-16     { gap: 16px; }

/* Spacing */
.p-16  { padding: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
  border: none;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}




/* Chip / pill */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--soft);
  white-space: nowrap;
}

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

/* FAB (floating action button) */
.fab {
  position: fixed;
  z-index: 150;
  right: 16px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s;
}

.fab:active {
  transform: scale(0.92);
}

/* Check-in FAB */
.checkin-fab {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  border-radius: 28px;
  padding: 0 18px 0 14px;
  font-size: 14px;
  font-weight: 600;
  animation: fab-float 2.4s ease-in-out infinite;
}
.checkin-fab-label {
  font-size: 13px;
  letter-spacing: 0.02em;
}
@keyframes fab-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.checkin-fab:active { animation: none; transform: scale(0.92); }

/* Check-in FAB tooltip */
.checkin-fab-tip {
  position: fixed;
  z-index: 149;
  right: 16px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 78px);
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  line-height: 1.35;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-width: 180px;
  animation: fab-tip-in 0.3s ease-out;
  pointer-events: none;
}
.checkin-fab-tip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: rotate(45deg);
}
@keyframes fab-tip-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Check-in modal */
.checkin-modal { max-height: 85vh; }
.checkin-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}
.checkin-loc-found {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-secondary);
  border-radius: 12px;
}
.checkin-loc-icon { flex-shrink: 0; margin-top: 1px; }
.checkin-loc-label { font-size: 14px; color: var(--ink); line-height: 1.4; }
.checkin-loc-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.checkin-photo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 28px 16px;
  margin-top: 12px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-secondary);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.checkin-photo-btn:active { border-color: var(--accent); }
.checkin-thumb-wrap { position: relative; display: inline-block; }
/* RFC-0020 — photo whose R2 upload failed on the last save: red frame + a small
   "upload failed" tag along the bottom. Shared across the check-in sheet, quick-add
   strip, and the full add/edit photo grid. e.g. a 随手记 photo that timed out on
   weak network shows outlined red with 「该图片上传失败」. */
.quick-add-thumb-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.checkin-thumb-wrap--failed .quick-add-thumb,
.modal-photo-item--failed { outline: 2px solid var(--danger, #ff3b30); outline-offset: -2px; }
.thumb-upload-failed {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 59, 48, 0.92);
  color: #fff;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  padding: 2px 3px;
  pointer-events: none;
}
.checkin-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger, #ff3b30);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  cursor: pointer;
}
.checkin-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border-radius: 8px;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
}
.checkin-back:active { background: var(--surface-secondary); }

/* Map markers */
.map-marker {
  /* Outer: MapLibre writes transform here for lat/lng positioning.
     NO visual styles, NO transition: transform — it would lag every drag frame. */
  width: 32px;
  height: 32px;
  cursor: pointer;
  user-select: none;
}
.map-marker span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25), 0 0 0 1.5px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  pointer-events: none;
}
.map-marker:active span {
  transform: scale(1.2);
}
.map-marker--selected span {
  box-shadow: 0 0 0 2.5px var(--accent), 0 2px 8px rgba(0,0,0,0.3);
  transform: scale(1.15);
}

/* Rating stars */
.rating {
  display: flex;
  gap: 4px;
}

.rating-star {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.rating-star.filled {
  color: #FFC107;
}

/* Category filter chips (horizontal scroll) */
.category-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.category-chips::after {
  content: "";
  min-width: 16px;
  flex-shrink: 0;
}


/* ----------------------------------------------------------
   16. Media Queries
   ---------------------------------------------------------- */

/* Large phones / small tablets */
@media (min-width: 428px) {
  .modal-content {
    max-width: 428px;
    margin: 0 auto;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .welcome-card {
    max-width: 380px;
  }
}

/* Tablets and up — layout shifts */
@media (min-width: 768px) {
  .bottom-sheet {
    max-width: 400px;
    left: 16px;
    right: auto;
    border-radius: var(--radius);
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    height: auto;
    max-height: calc(100vh - 120px);
  }

  .bottom-sheet.peek {
    transform: translateY(calc(100% - 200px));
  }

  .detail-panel,
  .profile-panel,
  .curated-panel {
    /* Full screen on all sizes — this is a mobile PWA */
    max-width: none;
    left: 0;
    right: 0;
  }

  .modal-content {
    max-width: 480px;
    border-radius: var(--radius);
    margin: auto;
  }
}

/* Landscape orientation — reduce bottom sheet peek */
@media (orientation: landscape) and (max-height: 500px) {
  .bottom-sheet.peek {
    transform: translateY(calc(100% - 60px - var(--nav-height) - var(--safe-bottom)));
  }

  .bottom-sheet.half {
    transform: translateY(30vh);
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .bottom-sheet { transition: none; }
  .detail-panel { transition: none; }
  .profile-panel { transition: none; }
  .curated-panel { transition: none; }
  .modal-content { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   VisionOS Spatial Computing Overrides
   Translucent floating cards above the map — astronaut POV
   Variables defined in ../visionos-space.css
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Background Transparency & Frosted Glass ─────────────────────────── */
.search-bar {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--v-glass-border);
  box-shadow: var(--v-glass-shadow);
  border-radius: 0 0 16px 16px;
  transform: translateZ(0);
}

.bottom-sheet {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--v-glass-shadow);
}

/* Preserve bottom-sheet state transforms with GPU compositing */
.bottom-sheet.peek, .bottom-sheet.bottom-sheet--peek {
  transform: translateY(calc(100% - 90px)) translateZ(0);
}
.bottom-sheet.half, .bottom-sheet.bottom-sheet--half {
  transform: translateY(50%) translateZ(0);
}
.bottom-sheet.full, .bottom-sheet.bottom-sheet--full {
  transform: translateY(0) translateZ(0);
}

/* bottom-nav transparency handled by [data-tab="map"] rules only */

/* detail-panel and curated-panel are full-screen overlays — keep opaque */

.detail-header {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--v-glass-border);
}

.detail-interact {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--v-glass-border);
}

.profile-panel {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--v-glass-border);
  box-shadow: var(--v-glass-shadow);
  border-radius: 0;
}

.modal-content {
  background: var(--v-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--v-glass-border);
  box-shadow: var(--v-glass-shadow);
  border-radius: 16px 16px 0 0;
}

/* ── 2. Text Legibility ─────────────────────────────────────────────────── */
.search-bar, .bottom-sheet, .bottom-nav, .detail-panel,
.detail-header, .detail-interact, .profile-panel, .modal-content {
  color: var(--v-ink);
}

.bottom-sheet-title, .detail-header-title, .detail-title,
.food-item-name, .profile-name, .profile-stat-value,
.modal-title, .detail-back {
  color: var(--v-ink);
}

.bottom-sheet-count, .detail-subtitle, .detail-description,
.food-item-meta, .food-item-category, .food-item-location,
.food-item-likes, .profile-bio, .profile-stat-label,
.nav-item, .form-label, .modal-tab,
.detail-interact button, .search-clear, .modal-close {
  color: var(--v-soft);
}

.nav-item.active { color: var(--v-ink); }

/* ── 3. Interactive States — Spatial Depth ──────────────────────────────── */
.food-item:active, .nav-item:active, .detail-back:active,
.modal-close:active, .detail-interact button:active,
.search-bar-actions button:active {
  background: var(--v-hover);
}

.modal-tab.active {
  color: var(--v-ink);
  border-bottom-color: var(--v-ink);
}

/* ── 4. Form & Sub-element Overrides ────────────────────────────────────── */
.search-input {
  background: var(--v-input-bg);
  border-color: var(--v-input-border);
  color: var(--v-ink);
}
.search-input::placeholder { color: var(--v-placeholder); }


.detail-interact .interact-comment {
  background: var(--v-input-bg);
  border-color: var(--v-input-border);
  color: var(--v-soft);
}

.food-item                      { border-bottom-color: var(--v-item-border); }
.detail-section + .detail-section { border-top-color: var(--v-item-border); }
.profile-header                 { border-bottom-color: var(--v-item-border); }
.modal-tabs                     { border-bottom-color: var(--v-item-border); }

.bottom-sheet-handle::after,
.modal-handle::after { background: var(--v-handle); }


.detail-tag {
  background: var(--v-tag-bg);
  color: var(--v-tag-text);
}


/* ----------------------------------------------------------
   Dynamic viewport height
   ---------------------------------------------------------- */

@supports (height: 100dvh) {
  html, body, .app-root { height: 100dvh; }
}


/* ----------------------------------------------------------
   Touch feedback on interactive elements
   ---------------------------------------------------------- */

.food-item:active { transform: scale(0.98); transition: transform 0.1s; }
.bottom-nav-tab:active { transform: scale(0.92); }
.mbtn-primary:active, .mbtn-secondary:active { transform: scale(0.97); }


/* ----------------------------------------------------------
   Detail panel backdrop overlay
   ---------------------------------------------------------- */

.detail-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 149;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.detail-backdrop.visible {
  opacity: 1; pointer-events: auto;
}

/* ----------------------------------------------------------
   PWA Install Banner
   ---------------------------------------------------------- */

.install-banner {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 12px);
  left: 16px; right: 16px;
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 190;
  animation: slideUpBanner 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  border: 1px solid var(--border);
}
.install-banner h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.install-banner p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.install-banner-actions { display: flex; gap: 8px; justify-content: flex-end; }
.install-banner .install-icon { width: 44px; height: 44px; border-radius: 12px; margin-right: 12px; }

@keyframes slideUpBanner {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================
   NEW: Top Header (XHS-style)
   ========================================================== */

.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: calc(var(--safe-top) + 4px) calc(var(--safe-right) + 12px) 4px calc(var(--safe-left) + 12px);
  /* RFC-0004: real frosted glass on the header across all tabs (matches ej).
     Was opaque --surface (only the map tab attempted translucency, and even
     that used the opaque --glass). Translucent theme-aware --v-glass-panel +
     blur frosts the content behind; opaque fallback covers the pre-load window
     of the async visionos-space.css. */
  background: var(--v-glass-panel, var(--surface));
  border-bottom: 1px solid var(--v-glass-border, transparent);
  box-shadow: 0 1px 16px rgba(0,0,0,0.06);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  transition: background 0.2s;
}
/* Map tab: drop the shadow so the glass sits cleanly over the globe (the base
   rule above already provides the translucent --v-glass-panel + blur). */
.app-root[data-tab="map"] .top-header {
  background: var(--v-glass-panel, rgba(255, 255, 255, 0.7));
  box-shadow: none;
}
.app-root[data-tab="map"] .bottom-nav {
  background: var(--v-glass-panel, rgba(255, 255, 255, 0.7));
  box-shadow: none;
}
/* (RFC-0004 step 3) base .tab-content is now glass over the globe; the old
   opaque non-map override is removed so the frozen globe shows through. */

.top-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}

/* .top-header-icon → migrated to UnoCSS utilities in search.js (RFC-0004) */

.top-header-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.top-header-tab {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.top-header-tab--active {
  color: var(--ink);
  font-weight: 600;
}
.top-header-tab--active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  border-radius: 1px;
  background: var(--ink);
}

.top-header-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.top-header-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.top-header-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.top-header-avatar-placeholder {
  display: flex;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: var(--surface, #fff);
  color: var(--accent, #34C759);
  font-size: 14px; font-weight: 600;
  border-radius: 50%;
  border: 1.5px solid var(--accent, #34C759);
  box-sizing: border-box;
}

/* ── Map/Globe Toggle Dropdown ── */
.top-header-map-toggle {
  flex: 1;
  display: flex;
  justify-content: center;
}
.top-header-map-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.top-header-map-arrow {
  font-size: 12px;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: inline-block;
}
.top-header-map-arrow.open {
  transform: rotate(180deg);
}
.map-mode-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 600;
  overflow: hidden;
  min-width: 130px;
  animation: menuFadeIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.map-mode-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  transition: background 0.15s;
}
.map-mode-option:active {
  background: var(--surface-alt, #f5f5f5);
}
.map-mode-option.active {
  color: var(--accent, #34C759);
  font-weight: 600;
}
.map-mode-option + .map-mode-option {
  border-top: 1px solid var(--border, #eee);
}

/* Map filter clear button */
.map-filter-clear-btn {
  background: var(--accent, #34C759);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  margin-right: 8px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.map-filter-clear-btn:active { opacity: 0.7; }


/* ── Avatar Dropdown Menu ── */
.avatar-menu-wrap {
  position: relative;
}
.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 600;
  overflow: hidden;
  animation: menuFadeIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
[data-theme="eastern"] .avatar-menu { background: #4A3424; border-color: #6B5040; }
[data-theme="luxe"] .avatar-menu { background: #0A0A0A; border-color: #222; }
[data-theme="homebound"] .avatar-menu { background: #223248; border-color: #2E4058; }
@keyframes menuFadeIn { from { opacity: 0; transform: translateY(-8px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.avatar-menu-page {
  padding: 6px 0;
}
.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  transition: background 0.1s;
}
.avatar-menu-item:active {
  background: var(--surface-alt, #f5f5f5);
}
.avatar-menu-back {
  color: var(--accent, #34C759);
  font-weight: 500;
}
.avatar-menu-arrow {
  color: var(--muted, #999);
  font-size: 16px;
}
.avatar-menu-check {
  color: var(--accent, #34C759);
  font-weight: 700;
}
.avatar-menu-divider {
  height: 1px;
  background: var(--border, #eee);
  margin: 4px 12px;
}

/* ── Theme picker grid (matches ej web version) ── */
.avatar-menu-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px 14px 12px;
}
.avatar-menu-theme-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.avatar-menu-theme-item:active {
  background: var(--surface-alt, #f5f5f5);
}
.avatar-menu-theme-item.active {
  background: var(--accent-subtle, rgba(0,0,0,0.04));
}
.avatar-menu-theme-swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}
.avatar-menu-theme-item.active .avatar-menu-theme-swatch {
  box-shadow: 0 0 0 2px rgba(52,199,89,0.2);
}
.avatar-menu-theme-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent, #34C759);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.avatar-menu-theme-label {
  font-size: 10px;
  color: var(--ink, #1a1a1a);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.avatar-menu-theme-item.active .avatar-menu-theme-label {
  color: var(--accent, #34C759);
  font-weight: 600;
}

/* Search expanded */
.top-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}

/* ==========================================================
   NEW: Tab Content Area
   ========================================================== */

.tab-content {
  position: fixed;
  top: calc(var(--safe-top) + 52px);
  left: 0; right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* RFC-0004 app-glass step 3: translucent glass over the frozen 3D globe.
     Same glass as the header (--v-glass-panel, ~70%) so the globe shows through consistently.
     Opaque --bg fallback first for no color-mix / backdrop-filter. */
  background: var(--bg, #F5F5F5);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 10;
}
.tab-content--profile {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  z-index: 50;
}
/* When profile is in a tab, skip slide animation */
.tab-content--profile .profile-panel {
  position: relative !important;
  transform: none !important;
  opacity: 1 !important;
  background: transparent !important; /* RFC-0004 step3: show glass+globe in the tab */
  inset: unset !important;
  z-index: auto !important;
  height: 100% !important;
  overflow-y: auto !important;
}

/* ==========================================================
   NEW: Food Feed (XHS waterfall)
   ========================================================== */

.feed-wrapper {
  min-height: 100%;
  /* RFC-0004 step3: transparent so the tab-content glass + globe show through
     (the feed CARDS stay opaque, so content is still legible). */
  background: transparent;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Pull to refresh ── */
.pull-refresh-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--muted, #999);
  font-size: 18px;
}
.pull-refresh-spinner {
  transition: transform 0.1s linear;
}
.pull-refresh-spinner.spinning {
  animation: pullSpin 0.6s linear infinite;
}
@keyframes pullSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.feed-container {
  display: flex;
  gap: 4px;
  padding: 4px;
}
.feed-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: none;
  transition: transform 0.12s;
  min-width: 0;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.feed-card:active { transform: scale(0.96); }
.feed-card--route-selected { outline: 2.5px solid var(--accent); outline-offset: -2px; }

/* ── Route multi-select: checkbox on feed card ── */
.feed-card-route-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: background 0.12s, border-color 0.12s;
}
.feed-card-route-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Route multi-select toolbar (top of discover tab) ── */
.route-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.route-select-cancel {
  background: none; border: none;
  font-size: 14px; color: var(--muted);
  cursor: pointer; padding: 4px 0;
  font-family: inherit;
}
.route-select-count {
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.route-select-confirm {
  background: var(--accent); color: #fff;
  border: none; border-radius: 16px;
  font-size: 13px; font-weight: 600;
  padding: 6px 14px; cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.route-select-confirm.disabled { opacity: 0.4; cursor: default; }

.feed-card-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--surface-alt);
  position: relative;
}
.feed-card-shimmer {
  background: linear-gradient(90deg, var(--surface-alt, #eee) 25%, var(--surface, #f5f5f5) 50%, var(--surface-alt, #eee) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.feed-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.feed-card-emoji {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}

/* ── Text cover (RFC-0003 菜单流 文字封面) — shared across surfaces ──────────
   Shown when a 图文 has no image/video. Name-forward on a category-color block
   (tint set inline from CATEGORIES[cat].color); NO big emoji. Uses theme vars
   so it stays legible across all 8 themes. */
.food-cover { position: relative; }
.food-cover--text {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 16px 14px;
}
/* Feed variant matches the image card's 3/4 portrait so the menu-stream is tidy. */
.food-cover--text.food-cover--feed { aspect-ratio: 3 / 4; }
/* Curated grid cell (1/1) & profile post card (3/4) already provide the cover
   box; the text cover just fills it. */
.food-cover--text.food-cover--curated,
.food-cover--text.food-cover--profile { position: absolute; inset: 0; width: 100%; height: 100%; }
.food-cover--curated .food-cover-name { font-size: calc(15px * var(--font-scale, 1)); }
.food-cover--curated .food-cover-type,
.food-cover--profile .food-cover-type { font-size: 10px; }
/* Tiny thumbs (season 72px, diary 48px) → bare category color block, no text. */
.food-cover--block { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Default cover <img> when a surface doesn't supply its own image class. */
.food-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.food-cover-name {
  font-size: calc(18px * var(--font-scale, 1));
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.food-cover-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.food-cover-type-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
/* type:'want' corner chip — ≤14px, not a big glyph (OQ-1). */
.food-cover-flag {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.feed-card-info {
  padding: 10px 12px 12px;
  background: var(--surface);
  color: var(--ink);
}
.feed-card-name {
  font-size: calc(15px * var(--font-scale, 1));
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-card-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.feed-card-loc {
  font-size: 11px;
  color: var(--soft);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-card-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.feed-card-author-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.feed-card-author-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.feed-card-author-avatar-placeholder {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--accent, #34C759);
  background: #fff !important;
  border: 1px solid var(--accent, #34C759);
  flex-shrink: 0;
  font-weight: 600;
  box-sizing: border-box;
}
.feed-card-author-name {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-card-heart {
  font-size: 12px;
  color: var(--accent);
}
.feed-card-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.feed-card-like-count {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.feed-card-like-count--active {
  color: var(--accent);
}

/* ── Rating star badge (overlay on card images) ── */
.rating-star-badge {
  position: absolute;
  bottom: 7px;
  left: 7px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  pointer-events: none;
  z-index: 3;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}
.rating-stars-icon svg {
  filter: drop-shadow(0 0 2.5px rgba(245, 197, 24, 0.6));
}

/* ── Rating step in add/edit modal ── */
.rating-step-summary {
  text-align: center;
  padding: 18px 16px 14px;
  background: var(--surface-alt, #f5f5f5);
  border-radius: 14px;
}
.rating-step-stars {
  font-size: 22px;
  letter-spacing: 3px;
  min-height: 30px;
}
.rating-step-avg {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  line-height: 1.1;
  margin-top: 2px;
}
.rating-step-avg--unset {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted, #999);
}
.rating-step-avg-label {
  font-size: 11px;
  color: var(--muted, #999);
  margin-top: 4px;
}
.rating-dim-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface-alt, #f5f5f5);
  border-radius: 12px;
}
.rating-dim-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.rating-dim-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
}
.rating-dim-desc {
  font-size: 10px;
  color: var(--muted, #999);
  margin-top: 2px;
}
.rating-dim-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent, #34C759);
  min-width: 34px;
  text-align: right;
  line-height: 1;
  padding-top: 1px;
}
.rating-dim-val.unset {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #999);
}
.rating-dim-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border, #ddd);
  outline: none;
  cursor: pointer;
  margin: 4px 0 0;
}
.rating-dim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #34C759);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  border: 2px solid #fff;
}
.rating-dim-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #34C759);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ── Rating section in detail panel ── */
.detail-rating {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border, #e8e8e8);
  margin-bottom: 14px;
}
.detail-rating--unrated {
  padding: 8px 16px 14px;
}
.detail-rating-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.detail-rating-stars {
  font-size: 18px;
  letter-spacing: 2px;
}
.detail-rating-avg {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  line-height: 1;
}
.detail-rating-label {
  font-size: 12px;
  color: var(--muted, #999);
}
.detail-rating-dim {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-rating-dim:last-child { margin-bottom: 0; }
.detail-rating-dim-name {
  font-size: 11px;
  color: var(--muted, #999);
  width: 64px;
  flex-shrink: 0;
  line-height: 1.3;
}
.detail-rating-dim-bar {
  flex: 1;
  height: 4px;
  background: var(--border, #e0e0e0);
  border-radius: 2px;
  overflow: hidden;
}
.detail-rating-dim-fill {
  height: 100%;
  background: var(--accent, #34C759);
  border-radius: 2px;
  transition: width 0.35s ease;
}
.detail-rating-dim-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  min-width: 28px;
  text-align: right;
}

/* ── Suggested users (UberEats-style) ── */
.feed-suggested {
  padding: 16px 8px;
  background: var(--surface);
  margin: 8px 0;
  border-radius: var(--radius);
}
.feed-suggested-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 8px 12px;
}
.feed-suggested-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-suggested-scroll::-webkit-scrollbar { display: none; }
.feed-suggested-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-auto-flow: column;
  grid-auto-columns: 80px;
  gap: 12px 16px;
  padding: 0 8px;
}
.feed-suggested-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.feed-suggested-user:active { opacity: 0.7; }
.feed-suggested-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-alt, #f0f0f0);
  border: 2px solid var(--border, rgba(0,0,0,0.06));
}
.feed-suggested-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.feed-suggested-avatar-letter {
  width: 100%; height: 100%;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  color: var(--accent, #34C759);
  background: #fff !important;
  border: 2px solid var(--accent, #34C759);
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--accent);
}
.feed-suggested-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-suggested-count {
  font-size: 10px;
  color: var(--muted);
}

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
}
.feed-empty-icon { font-size: 48px; margin-bottom: 12px; }
.feed-empty-text { font-size: 14px; }

/* ==========================================================
   NEW: Curated Banner (in discover tab)
   ========================================================== */

/* ==========================================================
   NEW: Nearby Permission Prompt
   ========================================================== */

/* .nearby-overlay → u-overlay shortcut (RFC-0004) */
.nearby-prompt {
  background: var(--surface, #fff);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.nearby-prompt-icon { font-size: 36px; margin-bottom: 12px; }
.nearby-prompt h3 { font-size: 17px; color: var(--ink); margin: 0 0 8px; }
.nearby-prompt p { font-size: 13px; color: var(--soft); margin: 0 0 20px; }
.nearby-prompt-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.nearby-prompt-btns button { flex: 1; padding: 10px 8px; font-size: 13px; border-radius: var(--radius); }

/* ==========================================================
   Profile — XHS-style grid
   ========================================================== */

.profile-posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
}

/* ── Diary hero: lightweight stats card above the posts grid ── */
.profile-diary-hero {
  margin: 6px 8px 10px;
  padding: 14px 16px;
  background: var(--surface-alt, #f5f3ee);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.profile-diary-hero-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.profile-diary-hero-cell--right {
  padding-left: 14px;
  border-left: 1px solid var(--border, rgba(0,0,0,0.08));
}
.profile-diary-hero-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-diary-hero-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
  min-width: 0;
}
.profile-diary-hero-big {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.profile-diary-hero-suffix {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
/* Right cell — top-of-month dish tile (entire cell is clickable) */
.profile-diary-hero-cell--clickable {
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-diary-hero-cell--clickable:active { transform: scale(0.98); opacity: 0.9; }
.profile-diary-top {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.profile-diary-top-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: var(--surface, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.profile-diary-top-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.profile-diary-top-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.profile-diary-top-dish {
  font-family: "Noto Serif SC", "Playfair Display", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.profile-diary-top-stars {
  display: inline-flex;
  align-items: center;
}
.profile-diary-hero-sub {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.profile-diary-hero-sub-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-diary-hero-sub-num {
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 13px;
  color: var(--ink);
}
.profile-diary-hero-sub-stars {
  display: inline-flex;
  align-items: center;
}

/* ── Curated check-in / 跟着大师打卡 progress ── */

/* Inline pill in collection cards: "✓ 12 / 97" */
.curated-progress-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(52, 199, 89, 0.14);
  color: #2a8c44;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
[data-theme="luxe"] .curated-progress-pill { color: #6fd587; }

/* Full progress block in author/collection header (label + count + bar) */
.curated-progress-block {
  margin-top: 14px;
  text-align: left;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.curated-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.curated-progress-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.curated-progress-count {
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.curated-progress-bar {
  height: 4px;
  background: var(--border, rgba(0,0,0,0.08));
  border-radius: 999px;
  overflow: hidden;
}
.curated-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(52, 199, 89, 0.55), rgba(52, 199, 89, 0.95));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}
[data-theme="luxe"] .curated-progress-bar-fill {
  background: linear-gradient(90deg, rgba(111, 213, 135, 0.55), rgba(111, 213, 135, 0.95));
}

/* Check-in toggle button — bottom-right corner of each food card cover.
   Size is 44×44 from the global `button { min-width:44px; min-height:44px }`
   tap-target rule; we don't fight it. SVG inside stays 14×14 for a soft look. */
.curated-checkin-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.curated-checkin-btn:active { transform: scale(0.88); }
.curated-checkin-btn--on {
  background: rgb(52, 199, 89);
  border-color: rgb(52, 199, 89);
  color: #fff;
}
[data-theme="luxe"] .curated-checkin-btn {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.55);
}
[data-theme="luxe"] .curated-checkin-btn--on {
  background: rgb(111, 213, 135);
  border-color: rgb(111, 213, 135);
  color: #000;
}

/* Tried food cards get a subtle green ring + slightly muted cover so they read as "done" */
.curated-food-card--tried .curated-food-cover {
  outline: 2px solid rgba(52, 199, 89, 0.55);
  outline-offset: -2px;
}
.curated-food-card--tried .curated-food-cover-img,
.curated-food-card--tried .curated-food-emoji {
  filter: saturate(0.85) brightness(0.96);
}
[data-theme="luxe"] .curated-food-card--tried .curated-food-cover {
  outline-color: rgba(111, 213, 135, 0.55);
}

/* ── Search overlay: full-screen, big input + history + curated authors + hot tags ── */
.search-overlay {
  position: fixed;
  top: 0; left: 0;
  /* Match the global font-scale transform applied to #root. Search renders
     via ReactDOM.createPortal to <body>, so it escapes #root's transform —
     without this it appears at native (1.0×) size while the rest of the
     app is scaled, causing overflow on the right when fontSize ≠ 16. */
  width:  calc(100% / var(--font-scale, 1));
  height: calc(100% / var(--font-scale, 1));
  transform: scale(var(--font-scale, 1));
  transform-origin: top left;
  z-index: 800;
  background: var(--bg, #fff);
  display: flex;
  flex-direction: column;
  animation: searchOverlayIn 0.22s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}
/* Keyframes must include the scale or they override .search-overlay's
   `transform: scale(var(--font-scale))` (CSS transform is one property). */
@keyframes searchOverlayIn {
  from { opacity: 0; transform: scale(var(--font-scale, 1)) translateY(6px); }
  to   { opacity: 1; transform: scale(var(--font-scale, 1)) translateY(0); }
}
.search-overlay-header {
  display: flex; align-items: center; gap: 12px;
  /* Defensive: lets flex children participate in shrinking. Without this,
     an iOS-cached older CSS combined with the input's intrinsic size
     (size=20 chars) was making the input-wrap refuse to shrink, pushing
     the right edge of the search box past the screen. */
  min-width: 0;
  /* Belt: cap the header at the overlay's own width so no child overflow
     can ever push it past the viewport, even if --font-scale gets a bad
     value from a stale cache. */
  max-width: 100%;
  box-sizing: border-box;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 16px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  background: var(--bg, #fff);
}
.search-overlay-back {
  background: transparent; border: none; padding: 6px;
  border-radius: 50%; color: var(--ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent; flex-shrink: 0;
  min-width: 40px; min-height: 40px;
  transition: background 0.12s;
}
.search-overlay-back:active { background: var(--surface-alt); }
.search-overlay-input-wrap {
  flex: 1 1 0; position: relative;
  /* Critical: the input inside has size=20 by default. Without min-width: 0
     here, the flex layout treats the input's intrinsic size as a minimum
     and the wrap refuses to shrink below ~240px — on a 375px iPhone with
     the back arrow + gaps, that's enough to overflow the right edge. */
  min-width: 0;
  display: flex; align-items: center;
  background: var(--surface-alt, #f5f3ee);
  border-radius: 16px;
  height: 54px;
  padding: 0 14px 0 44px;
  box-sizing: border-box;
  border: 1.5px solid var(--border, rgba(0,0,0,0.06));
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-overlay-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--report-accent, #D4A23B) 75%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--report-accent, #D4A23B) 14%, transparent);
}
.search-overlay-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
  transition: color 0.18s;
}
.search-overlay-input-wrap:focus-within .search-overlay-icon {
  color: var(--report-accent, #D4A23B);
}
.search-overlay-input {
  flex: 1; height: 100%;
  background: transparent; border: none; outline: none;
  font-family: "Noto Serif SC", "Playfair Display", serif;
  font-size: 16px; color: var(--ink);
  min-width: 0;
}
.search-overlay-input::placeholder {
  color: var(--muted);
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-style: italic;
  font-size: 17px;
}
.search-overlay-clear {
  background: rgba(0,0,0,0.10); border: none;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 11px; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  min-width: 24px; min-height: 24px;
  transition: background 0.12s, transform 0.12s;
}
.search-overlay-clear:active { transform: scale(0.88); }
[data-theme="luxe"] .search-overlay-clear { background: rgba(255,255,255,0.18); color: #fff; }
.search-overlay-body {
  flex: 1;
  overflow-y: auto;
  /* Defensive: even if a child miscalculates width (e.g. font-scale edge
     cases), the body never lets the page overflow horizontally. */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px 64px;
  box-sizing: border-box;
}
/* Search-results 2-col waterfall — wrapper just unwinds the body's side
   padding so cards can stretch edge-to-edge like the real discover feed.
   Inside, .feed-container brings back its own 4px padding. */
.search-results-feed {
  margin: -22px -18px 0;
}
/* When a 图文 section header sits above the waterfall (username search results),
   drop the -22px pull-up so the feed sits below the header instead of over it. */
.search-results-feed--headed {
  margin-top: 10px;
}
.search-results-feed .feed-wrapper { padding-bottom: 48px; }

/* Section: increased breathing room + ornamental head */
.search-section { margin-bottom: 28px; }
.search-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.search-section-title {
  display: inline-flex;
  align-items: center;
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 15px; font-weight: 600;
  color: var(--ink); letter-spacing: 0.1em;
  line-height: 1;
}
.search-section-title::before {
  content: '';
  display: inline-block;
  width: 2.5px;
  height: 13px;
  background: var(--report-accent, #D4A23B);
  margin-right: 10px;
  border-radius: 1.5px;
  flex-shrink: 0;
}
.search-section-clear {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; min-width: 32px; min-height: 32px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.search-section-clear:active { background: var(--surface-alt); color: var(--ink); }

/* ── People (username search results, RFC-0006) ──────────────────────────
   Horizontal-scroll row of user cards above the food waterfall. Matches the
   XHS-style serif aesthetic of the rest of the overlay. */
.search-posts-head { margin-top: 4px; }
.search-user-row {
  display: flex; gap: 11px; overflow-x: auto;
  padding: 2px 2px 4px; margin-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.search-user-card {
  flex: 0 0 auto; width: 96px; box-sizing: border-box;
  padding: 14px 8px 12px; border-radius: 18px;
  background: var(--surface); box-shadow: 0 1px 5px rgba(0,0,0,0.07);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; cursor: pointer;
  transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.search-user-card:active { transform: scale(0.96); }
.search-user-avatar,
.search-user-avatar-ph {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
}
.search-user-avatar { object-fit: cover; }
.search-user-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 21px; font-weight: 700;
  font-family: "Noto Serif SC", serif;
}
.search-user-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-user-stat {
  font-size: 9.5px; color: var(--muted);
  font-family: "Cormorant Garamond", "Playfair Display", serif; font-style: italic;
}

/* Chips — more breathing, refined edges */
.search-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.search-chip {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border, rgba(0,0,0,0.10));
  background: transparent; color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.14s, transform 0.12s, border-color 0.14s;
  font-family: "Noto Serif SC", "Playfair Display", serif;
  letter-spacing: 0.01em;
}
.search-chip:active { transform: scale(0.96); }
.search-chip--history {
  background: var(--surface-alt, #f5f3ee);
  border-color: transparent;
}
.search-chip--tag {
  background: color-mix(in srgb, var(--report-accent-warm, #C8483A) 9%, transparent);
  color: var(--report-accent-warm, #C8483A);
  border-color: color-mix(in srgb, var(--report-accent-warm, #C8483A) 26%, transparent);
  font-weight: 600;
}
[data-theme="luxe"] .search-chip--tag { color: #e58375; }



.search-empty {
  text-align: center; padding: 56px 20px;
  color: var(--muted);
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 15px; font-style: italic;
  letter-spacing: 0.04em;
}

/* ── 合集广场: public toggle on user collection + 大家的合集 strip in feed ── */

/* "Public" state on the existing profile-fav-action-btn — green tint */
.profile-fav-action-btn--public {
  background: rgba(52, 199, 89, 0.14);
  color: #2a8c44;
  border-color: rgba(52, 199, 89, 0.45);
}
[data-theme="luxe"] .profile-fav-action-btn--public { color: #6fd587; }

/* Feed — horizontal strip of public collections, above the waterfall */
.feed-public-cols {
  padding: 12px 12px 8px;
  margin-bottom: 4px;
}
.feed-public-cols-title {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.08em;
  padding-left: 4px;
  margin-bottom: 10px;
}
.feed-public-cols-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-public-cols-scroll::-webkit-scrollbar { display: none; }
.feed-public-cols-row {
  display: flex;
  gap: 10px;
  padding: 2px 4px 4px;
}
.feed-public-col-item {
  flex-shrink: 0;
  width: 120px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}
.feed-public-col-item:active { transform: scale(0.96); }
.feed-public-col-cover {
  width: 120px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-alt, #f5f3ee);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-public-col-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.feed-public-col-emoji {
  font-size: 38px;
  line-height: 1;
  opacity: 0.6;
}
.feed-public-col-name {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-public-col-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Seasonality: 时令 chip group in modal + 本月时令 strip in feed ── */

/* Modal — multi-select season chips after Category */
.fl-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}
.season-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.season-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border, rgba(0,0,0,0.12));
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  font-family: "Noto Serif SC", "Playfair Display", serif;
}
.season-chip:active { transform: scale(0.95); }
/* Season-colored when active — each season gets its own tint */
.season-chip--active.season-chip--spring     { background: rgba(166, 210, 103, 0.22); color: #5a8b2e; border-color: rgba(166, 210, 103, 0.55); } /* 嫩绿 */
.season-chip--active.season-chip--summer     { background: rgba(63, 125, 58, 0.20);   color: #235c23; border-color: rgba(63, 125, 58, 0.55); }   /* 森林浓绿 */
.season-chip--active.season-chip--autumn     { background: rgba(240, 162, 76, 0.22);  color: #b35e18; border-color: rgba(240, 162, 76, 0.55); }  /* 暖橙 */
.season-chip--active.season-chip--winter     { background: rgba(120, 205, 235, 0.20); color: #1683b8; border-color: rgba(120, 205, 235, 0.55); } /* 冰山蓝 */
.season-chip--active.season-chip--year-round { background: var(--surface-alt); color: var(--ink); border-color: var(--border); }
[data-theme="luxe"] .season-chip--active.season-chip--spring { color: #c6e88f; }
[data-theme="luxe"] .season-chip--active.season-chip--summer { color: #86cf80; }
[data-theme="luxe"] .season-chip--active.season-chip--autumn { color: #f3b06a; }
[data-theme="luxe"] .season-chip--active.season-chip--winter { color: #8fdcf2; }

/* ── Discover top tile grid (Soul-style block layout) ────────────────────
   2 side-by-side tiles at the top of the discover feed: 古今中外的老饕 +
   时令. Each tile is a chunky CTA block — gradient bg, large title, art
   on the right, single tap target. Replaces the old slim curated banner
   and the old horizontal seasonal scroll. */
/* Grid — match the feed waterfall's 4px padding + 4px gutter so tile
   edges align flush with the cards below. */
.discover-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px 4px 8px;
}
.discover-tiles--single { grid-template-columns: 1fr; }
.discover-tile {
  position: relative;
  min-height: 132px;
  border-radius: 16px;
  padding: 14px 14px 12px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.discover-tile:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.discover-tile-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.discover-tile-eyebrow {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.78;
  white-space: nowrap;
  /* Leave room for the arrow chip at top-right */
  padding-right: 28px;
}
.discover-tile-title {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  margin-top: 2px;
  word-break: keep-all;
}
.discover-tile-sub {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.82;
  padding-top: 4px;
  line-height: 1.35;
  word-break: keep-all;
}
.discover-tile-arrow {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--ink, #2a1f17);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding-bottom: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Curated tile — warm cinnabar/gold (editorial palette) ── */
.discover-tile--curated {
  background:
    radial-gradient(120% 100% at 110% -10%, rgba(255,220,170,0.55) 0%, rgba(255,220,170,0) 55%),
    linear-gradient(135deg, #C04E2C 0%, #A8401F 55%, #7A2F18 100%);
  color: #FFF6E6;
}
.discover-tile--curated .discover-tile-eyebrow { color: #FFD89C; opacity: 1; }
.discover-tile--curated .discover-tile-sub { color: rgba(255,246,230,0.82); }
/* Emoji row sits below the text, flush to the bottom of the tile */
.discover-tile-art--curated {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.discover-tile-art-emoji {
  position: static;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
  font-size: 26px;
  display: inline-block;
}
.discover-tile-art-emoji--a { transform: rotate(-8deg); }
.discover-tile-art-emoji--b { transform: rotate(6deg);  opacity: 0.95; }
.discover-tile-art-emoji--c { transform: rotate(-4deg); opacity: 0.95; }

/* ── Season tile — gradient tinted by current season ── */
.discover-tile--season { color: #FFF8EE; }
.discover-tile--season .discover-tile-sub { color: rgba(255,248,238,0.82); }
.discover-tile--season-spring {
  background:
    radial-gradient(110% 90% at 110% -10%, rgba(255,255,210,0.5) 0%, rgba(255,255,210,0) 55%),
    linear-gradient(135deg, #A6D267 0%, #7CB342 60%, #588B2E 100%); /* 嫩绿 — fresh tender shoot green */
}
.discover-tile--season-spring .discover-tile-eyebrow { color: #F4FFCB; opacity: 1; }
.discover-tile--season-summer {
  background:
    radial-gradient(110% 90% at 110% -10%, rgba(200,240,180,0.45) 0%, rgba(200,240,180,0) 55%),
    linear-gradient(135deg, #3F7D3A 0%, #235C23 60%, #103B15 100%); /* 森林浓绿 — deep rich forest green */
}
.discover-tile--season-summer .discover-tile-eyebrow { color: #CDEFC0; opacity: 1; }
.discover-tile--season-autumn {
  background:
    radial-gradient(110% 90% at 110% -10%, rgba(255,225,180,0.5) 0%, rgba(255,225,180,0) 55%),
    linear-gradient(135deg, #F0A24C 0%, #D2722A 60%, #A24E14 100%); /* 暖橙 — warm autumn orange */
}
.discover-tile--season-autumn .discover-tile-eyebrow { color: #FFE2B0; opacity: 1; }
.discover-tile--season-winter {
  background:
    radial-gradient(110% 90% at 110% -10%, rgba(225,245,255,0.55) 0%, rgba(225,245,255,0) 55%),
    linear-gradient(135deg, #7FD3EC 0%, #3FA5DA 60%, #1E76BE 100%); /* 冰山蓝 — pure glacial blue, no grey */
}
.discover-tile--season-winter .discover-tile-eyebrow { color: #DAF4FF; opacity: 1; }
.discover-tile--season-year-round {
  background: linear-gradient(135deg, #6B5B47 0%, #3A2E24 100%);
}
.discover-tile--season-year-round .discover-tile-eyebrow { color: #E8DBC4; opacity: 1; }

/* ── Season list panel — opens from the 时令 discover tile ──────────────
   Full-screen overlay; header with season label/count + vertical list of
   in-season foods (cover + name + stars). Header gradient matches the
   tile's season palette so the panel feels like an extension of the tile.
*/
/* .season-panel-overlay → u-overlay shortcut (RFC-0004) */
@keyframes seasonPanelIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.season-panel-header {
  position: relative;
  padding: 56px 20px 18px;
  color: #FFF8EE;
  overflow: hidden;
  flex-shrink: 0;
}
.season-panel--spring .season-panel-header {
  background:
    radial-gradient(120% 90% at 110% -10%, rgba(255,255,210,0.45) 0%, rgba(255,255,210,0) 55%),
    linear-gradient(135deg, #A6D267 0%, #7CB342 60%, #588B2E 100%); /* 嫩绿 */
}
.season-panel--summer .season-panel-header {
  background:
    radial-gradient(120% 90% at 110% -10%, rgba(200,240,180,0.42) 0%, rgba(200,240,180,0) 55%),
    linear-gradient(135deg, #3F7D3A 0%, #235C23 60%, #103B15 100%); /* 森林浓绿 */
}
.season-panel--autumn .season-panel-header {
  background:
    radial-gradient(120% 90% at 110% -10%, rgba(255,225,180,0.45) 0%, rgba(255,225,180,0) 55%),
    linear-gradient(135deg, #F0A24C 0%, #D2722A 60%, #A24E14 100%); /* 暖橙 */
}
.season-panel--winter .season-panel-header {
  background:
    radial-gradient(120% 90% at 110% -10%, rgba(225,245,255,0.5) 0%, rgba(225,245,255,0) 55%),
    linear-gradient(135deg, #7FD3EC 0%, #3FA5DA 60%, #1E76BE 100%); /* 冰山蓝 */
}
.season-panel--default .season-panel-header {
  background: linear-gradient(135deg, #6B5B47 0%, #3A2E24 100%);
}
.season-panel-close {
  position: absolute;
  top: 14px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.18);
  color: #FFF8EE;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.season-panel-close:active { transform: scale(0.92); background: rgba(0, 0, 0, 0.28); }
.season-panel-eyebrow {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.78;
  margin-bottom: 4px;
}
.season-panel-title {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.season-panel-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.82;
  margin-top: 6px;
}

.season-panel-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface, #FBF6EE);
  padding: 4px 0 32px;
}
.season-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.season-row:last-child { border-bottom: none; }
.season-row:active { background: rgba(0, 0, 0, 0.04); }
.season-row-cover {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-alt, #F0E8D8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.season-row-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.season-row-emoji {
  font-size: 34px;
  line-height: 1;
}
.season-row-play {
  /* Top-right corner play indicator — same as feed cards */
  width: 22px;
  height: 22px;
  top: 4px;
  right: 4px;
}
.season-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.season-row-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #2A1F17);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.season-row-subname {
  font-size: 12px;
  color: var(--muted, #8A7A66);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.season-row-stars {
  margin-top: 2px;
}
.season-row-arrow {
  flex-shrink: 0;
  color: var(--muted, #B0A28C);
  opacity: 0.6;
}

/* Collage row sits below the text, flush to the bottom of the tile.
   Three small cover thumbnails in a horizontal row — each individually
   tappable to open that food. */
.discover-tile-collage {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 6px;
  /* Container ignores clicks; pics opt back in */
  pointer-events: none;
}
.discover-tile-collage-pic {
  position: static;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.22), 0 0 0 1.5px rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.discover-tile-collage-pic img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.discover-tile-collage-emoji {
  font-size: 22px;
  line-height: 1;
}
/* Subtle row rotation for personality (not stacked anymore) */
.discover-tile-collage-pic--0 { transform: rotate(-3deg); }
.discover-tile-collage-pic--1 { transform: rotate(2deg);  }
.discover-tile-collage-pic--2 { transform: rotate(-2deg); }
.discover-tile-collage-pic--0:active { transform: rotate(-3deg) scale(0.9); box-shadow: 0 4px 12px rgba(0,0,0,0.32), 0 0 0 1.5px rgba(255,255,255,0.32); }
.discover-tile-collage-pic--1:active { transform: rotate(2deg)  scale(0.9); box-shadow: 0 4px 12px rgba(0,0,0,0.32), 0 0 0 1.5px rgba(255,255,255,0.32); }
.discover-tile-collage-pic--2:active { transform: rotate(-2deg) scale(0.9); box-shadow: 0 4px 12px rgba(0,0,0,0.32), 0 0 0 1.5px rgba(255,255,255,0.32); }

/* ── Year in Food report (full-screen poster, opens from diary hero left cell) ── */
/* .year-report-overlay → u-overlay shortcut (RFC-0004) */
@keyframes yearReportFadeIn { from { opacity: 0; } to { opacity: 1; } }
.year-report-close {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1A1A1A;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 710;
  border: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  min-width: 36px; min-height: 36px;
}

.year-report-card {
  /* Year-report has its own palette: gilded gold + cinnabar (典籍封面感),
     decoupled from the everyday --accent so it reads as a "year ceremony" */
  --report-accent: #D4A23B;
  --report-accent-warm: #C8483A;

  width: 100%;
  max-width: 420px;
  background: var(--surface, #fff);
  background-image:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--report-accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface, #fff) 0%, var(--surface-alt, #f5f3ee) 100%);
  border-radius: 22px;
  padding: 32px 24px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  color: var(--ink);
  text-align: center;
  font-family: "Noto Serif SC", "Playfair Display", serif;
  animation: yearReportSlide 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}
@keyframes yearReportSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.year-report-year {
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.year-report-title {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.year-report-identity {
  margin-top: 22px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.year-report-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface, #fff);
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}
.year-report-avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 28px; font-weight: 600;
}
.year-report-name {
  font-size: 18px; font-weight: 600; color: var(--ink);
}
.year-report-personality {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink);
  background: color-mix(in srgb, var(--report-accent) 18%, transparent);
  padding: 4px 12px;
  border-radius: 999px;
}
.year-report-personality-emoji { font-size: 14px; }
.year-report-tagline {
  font-size: 12px; color: var(--report-accent-warm);
  font-style: italic; max-width: 280px; line-height: 1.5;
}

.year-report-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--report-accent) 35%, var(--border, rgba(0,0,0,0.18))) 30%, color-mix(in srgb, var(--report-accent) 35%, var(--border, rgba(0,0,0,0.18))) 70%, transparent);
  margin: 24px auto;
  width: 82%;
}

.year-report-block {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.year-report-big {
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 76px; font-weight: 600; line-height: 1;
  letter-spacing: -0.02em; color: var(--ink);
}
.year-report-big-sub {
  font-size: 13px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.year-report-big-extra {
  margin-top: 6px; font-size: 11px; color: var(--muted); font-style: italic;
}

.year-report-section-label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}

.year-report-radar {
  width: 100%; max-width: 240px; height: auto;
  margin: 0 auto; color: var(--ink); display: block;
}

.year-report-list {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 280px; margin: 0 auto;
}
.year-report-row {
  display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.year-report-row-icon { font-size: 16px; width: 20px; text-align: center; }
.year-report-row-name { flex: 1; text-align: left; color: var(--ink); }
.year-report-row-val {
  font-family: "Cormorant Garamond", serif;
  font-size: 14px; font-weight: 600;
  color: var(--muted); letter-spacing: 0.04em;
}

.year-report-best {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; max-width: 320px; margin: 0 auto;
}
.year-report-best-emoji { font-size: 28px; flex-shrink: 0; }
.year-report-best-info { text-align: left; min-width: 0; }
.year-report-best-name {
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3;
}
.year-report-best-stars { margin-top: 4px; display: flex; }

.year-report-footprint {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; max-width: 320px; margin: 0 auto;
}
.year-report-fp-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.year-report-fp-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1;
}
.year-report-fp-label {
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
}

.year-report-brand {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-top: 4px;
}
.year-report-brand-name {
  font-family: "Noto Serif SC", "Playfair Display", serif;
  font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 0.06em;
}
.year-report-brand-sub {
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 11px; font-style: italic; color: var(--muted); letter-spacing: 0.14em;
}
.year-report-brand-url {
  margin-top: 4px; font-size: 10px; color: var(--muted); letter-spacing: 0.12em;
}

.year-report-hint {
  margin-top: 18px; text-align: center;
  font-size: 11px; color: var(--muted); letter-spacing: 0.08em;
}

/* ── Revisit signal: eater's decision, separate from 5-dim rating ── */

/* In modal — chip group after rating sliders */
.revisit-block {
  margin: 22px 0 8px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border, rgba(0,0,0,0.08));
}
.revisit-question {
  font-family: "Noto Serif SC", "Playfair Display", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.revisit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.revisit-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border, rgba(0,0,0,0.12));
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.revisit-chip:active { transform: scale(0.96); }
.revisit-chip--active.revisit-chip--will  { background: rgba(52, 199, 89, 0.14); color: #2a8c44; border-color: rgba(52, 199, 89, 0.45); }
.revisit-chip--active.revisit-chip--maybe { background: var(--surface-alt); color: var(--ink); border-color: var(--border); }
.revisit-chip--active.revisit-chip--once  { background: rgba(140, 120, 90, 0.12); color: #7a5e3a; border-color: rgba(140, 120, 90, 0.35); }
.revisit-chip--active.revisit-chip--no    { background: rgba(220, 80, 70, 0.10); color: #b14a3e; border-color: rgba(220, 80, 70, 0.35); }
[data-theme="luxe"] .revisit-chip--active.revisit-chip--will  { color: #6fd587; }
[data-theme="luxe"] .revisit-chip--active.revisit-chip--once  { color: #d3b07a; }
[data-theme="luxe"] .revisit-chip--active.revisit-chip--no    { color: #e58375; }

/* In detail panel — small read-only chip */
.detail-revisit-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.detail-revisit-chip--will  { background: rgba(52, 199, 89, 0.14); color: #2a8c44; border-color: rgba(52, 199, 89, 0.30); }
.detail-revisit-chip--maybe { background: var(--surface-alt); color: var(--ink); border-color: var(--border); }
.detail-revisit-chip--once  { background: rgba(140, 120, 90, 0.12); color: #7a5e3a; border-color: rgba(140, 120, 90, 0.30); }
.detail-revisit-chip--no    { background: rgba(220, 80, 70, 0.10); color: #b14a3e; border-color: rgba(220, 80, 70, 0.30); }
[data-theme="luxe"] .detail-revisit-chip--will  { color: #6fd587; }
[data-theme="luxe"] .detail-revisit-chip--once  { color: #d3b07a; }
[data-theme="luxe"] .detail-revisit-chip--no    { color: #e58375; }

/* In profile favorites view — board variant with small ✓ in name */
.profile-fav-board-tick {
  color: rgb(52, 199, 89);
  font-weight: 700;
  margin-right: 2px;
}
[data-theme="luxe"] .profile-fav-board-tick { color: #6fd587; }

/* ── Soft month divider in the posts grid (full-width row) ── */
.profile-month-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 8px 8px;
  color: var(--muted);
  font-family: "Cormorant Garamond", "Playfair Display", "Noto Serif SC", serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.profile-month-divider::before,
.profile-month-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(0,0,0,0.08));
  max-width: 60px;
}

/* .profile-post-card → migrated to utilities in profile.js (RFC-0004); .profile-post-card--draft modifier kept */

.profile-post-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--surface-alt, #f5f5f5);
  position: relative;
}
.profile-post-thumb img,
.profile-post-thumb video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.profile-post-thumb-empty {
  position: absolute; inset: 0;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 36px;
}

.profile-post-info {
  padding: 7px 9px 9px;
}
.profile-post-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-post-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-post-source {
  font-size: 10px;
  color: var(--accent, #34C759);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-posts-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* aaooee: add 图文 to a curated author */
.profile-add-curated-btn {
  display: block;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 11px 16px;
  border: 1px dashed var(--accent, #34C759);
  border-radius: 12px;
  background: none;
  color: var(--accent, #34C759);
  font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.profile-add-curated-btn:active { opacity: 0.6; }
.profile-add-col-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 16px 100px;
}
.profile-add-col-item {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--border, rgba(0,0,0,0.1));
  border-radius: 12px;
  background: var(--surface, #f5f5f5);
  color: var(--ink, #1a1a1a);
  font-size: 14px; font-family: inherit; cursor: pointer;
}
.profile-add-col-item:active { border-color: var(--accent, #34C759); }

/* Profile collections */
.profile-collections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
/* .profile-collection-card → migrated to utilities in profile.js (RFC-0004) */
.collection-cover {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface-alt, #f0f0f0);
}
.collection-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.collection-cover-empty {
  width: 100%; height: 100%;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 28px;
}
.collection-cover-icon {
  width: 100%; height: 100%;
  display: flex;
  align-items: center; justify-content: center;
  background: var(--surface-alt, #f8f8f8);
}
.collection-info {
  padding: 6px 8px;
}
.collection-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.collection-count {
  font-size: 11px;
  color: var(--muted);
}
/* ── Collection card in-place actions ── */
.col-active { border-color: var(--accent, #34C759) !important; }

/* ── Content picker modal ── */
/* .content-picker-overlay → u-overlay shortcut (RFC-0004) */
/* Shared overlay modal — still used by the add-to-collection picker (addColPicker).
   The 「管理内容」 manage panel no longer uses this; it renders inline (see
   .content-picker-inline below, RFC-0018). */
.content-picker-modal {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg, #fff);
  border-radius: 16px 16px 0 0;
  margin-top: 40px;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.32,0.72,0,1);
}
/* RFC-0018: inline manage panel — expands in-flow right under the collection's
   「管理内容」 button (not an overlay/sheet). Height is capped with internal scroll so
   the rest of the page stays reachable below it. */
.content-picker-inline {
  margin: 4px 0 12px;
  border: 1px solid var(--border, rgba(0,0,0,0.1));
  border-radius: 12px;
  background: var(--bg, #fff);
  overflow: hidden;
  animation: fadeIn 0.18s ease;
}
.content-picker-inline .content-picker-grid {
  flex: none;            /* not a flex child here */
  max-height: 52vh;      /* internal scroll past ~4 rows; page continues below */
  padding-bottom: 12px;  /* the overlay needed 100px for its floating button; inline doesn't */
}
.content-picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  flex-shrink: 0;
}
.content-picker-close {
  background: none; border: none; font-size: 18px;
  color: var(--muted, #999); cursor: pointer; padding: 4px 8px;
  font-family: inherit;
}
.content-picker-title {
  font-size: 14px; font-weight: 600; color: var(--ink, #1a1a1a);
  flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.content-picker-done {
  background: var(--accent, #34C759); color: #fff;
  border: none; border-radius: 16px; padding: 6px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.content-picker-search {
  padding: 8px 16px; flex-shrink: 0;
}
.content-picker-search-input {
  width: 100%; box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--border, rgba(0,0,0,0.1));
  border-radius: 20px; font-size: 13px;
  background: var(--surface, #f5f5f5); color: var(--ink, #1a1a1a);
  outline: none; font-family: inherit;
}
.content-picker-search-input:focus { border-color: var(--accent, #34C759); }
.content-picker-grid {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(3, 1fr);
  /* RFC-0018: pin rows to content height. Now that the sheet has a definite height
     (62dvh), the default `auto` rows stretch to fill it and collapse each cell into a
     thin bar; max-content keeps every cell square (thumb) + name and lets the list
     scroll. */
  grid-auto-rows: max-content;
  gap: 8px; padding: 8px 16px 100px;
}
.content-picker-item {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; transition: border-color 0.15s;
  background: var(--surface, #f5f5f5);
}
.content-picker-item.selected { border-color: var(--accent, #34C759); }
.content-picker-thumb {
  /* RFC-0018: square via the padding-top hack instead of `aspect-ratio:1`. Some older
     iOS WebKit don't apply aspect-ratio in this grid context and collapse the thumb
     into a thin horizontal bar; padding-top:100% is square on every engine. Children
     fill the box via absolute positioning. */
  position: relative; width: 100%; padding-top: 100%;
  background: var(--border, #eee); overflow: hidden;
}
.content-picker-thumb > img,
.content-picker-thumb > .content-picker-empty {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
}
.content-picker-thumb > img { object-fit: cover; }
.content-picker-empty {
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.content-picker-check {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 700;
  transition: background 0.15s;
}
.content-picker-check.on {
  background: var(--accent, #34C759); border-color: var(--accent, #34C759);
}
.content-picker-name {
  font-size: 11px; padding: 4px 6px; color: var(--ink, #1a1a1a);
  line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ==========================================================
   Profile Settings
   ========================================================== */
.profile-settings {
  margin: 24px 0 16px;
  padding: 0 16px;
}
.profile-settings-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.profile-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.profile-settings-item:active { opacity: 0.6; }
.profile-settings-item--col { flex-direction: column; align-items: stretch; }
.profile-settings-arrow { color: var(--muted); font-size: 18px; }
.profile-settings-value { color: var(--accent); font-size: 14px; }
.profile-legal-links {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 0 8px; font-size: 12px;
}
.profile-legal-links a { color: var(--muted, #999); text-decoration: none; }
.profile-legal-links a:hover { color: var(--accent); }
.profile-legal-dot { color: var(--muted, #ccc); font-size: 10px; }

/* ── Location Permission Panel ──────────────────────────────────────────── */
/* .loc-perm-overlay → u-overlay shortcut (RFC-0004) */
.loc-perm-sheet {
  width: 100%; background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(var(--safe-bottom, 0px) + 28px);
  max-height: 80vh; overflow-y: auto;
}
.loc-perm-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.loc-perm-title { font-size: 17px; font-weight: 700; color: var(--ink, #1a1a1a); }
.loc-perm-close {
  background: none; border: none; font-size: 20px;
  color: var(--muted, #999); cursor: pointer; padding: 4px;
}
.loc-perm-status { margin-bottom: 16px; }
.loc-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
}
.loc-status--ok      { background: rgba(52,199,89,0.1);  color: #22a84a; }
.loc-status--err     { background: rgba(255,59,48,0.1);  color: #d63030; }
.loc-status--warn    { background: rgba(255,159,10,0.1); color: #c97a00; }
.loc-status--checking { background: var(--surface-alt, #f5f5f5); color: var(--muted, #999); }
.loc-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: currentColor;
}
.loc-status-coords {
  margin-left: auto; font-size: 11px; font-weight: 400; opacity: 0.7;
}
.loc-perm-test-btn {
  width: 100%; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--border, #e0e0e0);
  background: none; font-size: 14px; font-weight: 600;
  color: var(--accent, #34C759); cursor: pointer;
  margin-bottom: 20px;
}
.loc-perm-guide { border-top: 1px solid var(--border, #e0e0e0); padding-top: 18px; }
.loc-guide-title {
  font-size: 13px; font-weight: 700; color: var(--muted, #999);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}
.loc-guide-block { margin-bottom: 18px; }
.loc-guide-browser {
  font-size: 13px; font-weight: 700; color: var(--ink, #1a1a1a);
  margin-bottom: 8px;
}
.loc-guide-steps {
  margin: 0; padding-left: 20px;
  font-size: 13px; color: var(--ink, #333); line-height: 1.9;
}
.loc-guide-steps li { padding-left: 4px; }
.loc-guide-block--note { background: rgba(255,159,10,0.07); border-radius: 10px; padding: 12px 14px; }
.loc-guide-note-text { margin: 4px 0 0; font-size: 12px; color: var(--ink, #333); line-height: 1.7; }

/* ==========================================================
   Theme Picker Bottom Sheet
   ========================================================== */
/* .theme-picker-overlay → u-overlay shortcut (RFC-0004) */
.theme-picker-sheet {
  width: 100%;
  max-height: 50vh;
  background: var(--bg, #fff);
  border-radius: 20px 20px 0 0;
  animation: modalSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding: 0 0 calc(var(--safe-bottom, 0px) + 16px);
  animation: sheetSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.theme-picker-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.theme-picker-handle::after {
  content: "";
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--muted, #ccc);
  opacity: 0.4;
}
.theme-picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.theme-picker-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--muted);
}
.theme-picker-close:active { background: rgba(0,0,0,0.06); }

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 20px 8px;
}
.theme-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.theme-picker-item:active { opacity: 0.7; }
.theme-picker-item--active .theme-picker-swatch {
  border: 2px solid var(--accent, #34C759);
}
.theme-picker-swatch {
  width: 56px; height: 56px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}
.theme-picker-label {
  font-size: 10px;
  color: var(--soft, #888);
  text-align: center;
  line-height: 1.2;
}
.theme-picker-check {
  position: absolute;
  top: -4px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent, #34C759);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center; justify-content: center;
}

/* ── Font Size Picker ───────────────────────────────────────────────────── */
.font-size-picker {
  display: flex;
  gap: 10px;
  padding: 4px 20px 12px;
}
.font-size-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 14px;
  border-radius: 14px;
  border: 2px solid var(--border, #e0e0e0);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}
.font-size-option--active {
  border-color: var(--accent, #34C759);
  background: rgba(52,199,89,0.05);
}
.font-size-option:active { opacity: 0.7; }
.font-size-preview {
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  line-height: 1;
}
.font-size-label {
  font-size: 11px;
  color: var(--muted, #888);
}
.font-size-check {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent, #34C759);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center; justify-content: center;
}
.font-size-note {
  font-size: 11px;
  color: var(--muted, #999);
  text-align: center;
  margin: 0 20px 4px;
}

/* ----------------------------------------------------------
   13. Mobile Add/Edit Modal
   ---------------------------------------------------------- */

/* .mobile-modal-overlay → u-overlay shortcut in modal.js (RFC-0004); keyframes below */
@keyframes modalBgFadeIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-modal {
  width: 100%;
  max-height: 92vh;
  background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes modalSlideUp { from { transform: translateY(100%); opacity: 0.5; } to { transform: translateY(0); opacity: 1; } }

.mobile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top, 0px) + 16px) 20px 12px;
  border-bottom: 1px solid var(--border, #eee);
  flex-shrink: 0;
}
.mobile-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
}
.mobile-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted, #999);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Step indicator */
.mobile-modal-steps {
  display: flex;
  gap: 4px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border, #eee);
  flex-shrink: 0;
  overflow-x: auto;
}
.mobile-modal-step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted, #999);
  background: var(--surface-alt, #f5f5f5);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.mobile-modal-step-dot.active {
  background: var(--accent, #34C759);
  color: #fff;
}
.mobile-modal-step-dot.done {
  background: var(--accent-subtle, #e8f5e9);
  color: var(--accent, #34C759);
}
.mobile-modal-step-icon {
  font-size: 14px;
}
.mobile-modal-step-label {
  font-weight: 500;
}

/* Step content area */
.mobile-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  padding-bottom: calc(var(--safe-bottom, 0px) + 80px);
}

.modal-step {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Form groups */
.fg {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fl {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  letter-spacing: 0.01em;
}
.fi {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1a);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.fi:focus {
  border-color: var(--accent, #34C759);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}
.fi-error {
  border-color: var(--danger, #FF3B30) !important;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.08) !important;
}
.fi-error-hint {
  font-size: 12px;
  color: var(--danger, #FF3B30);
  margin-top: 0;
  padding-left: 2px;
}
.fl-error {
  color: var(--danger, #FF3B30);
}
.fta {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1a);
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, min-height 0.3s ease;
  min-height: 48px;
  max-height: 48px;
  overflow: hidden;
}
.fta:focus {
  border-color: var(--accent, #34C759);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
  min-height: min(calc(100vw - 48px), 50vh);
  max-height: none;
  overflow: auto;
}

/* Emoji row */
.modal-emoji-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-emoji-preview {
  font-size: 32px;
  line-height: 1;
}

/* Buttons */
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
  transition: opacity 0.12s;
}
.btn:active { opacity: 0.7; }
.btn-accent {
  background: var(--accent, #34C759);
  color: #fff;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Location search */
.modal-loc-row {
  display: flex;
  gap: 8px;
}
.modal-loc-row .fi {
  flex: 1;
}
.modal-loc-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border, #eee);
  border-radius: 10px;
  margin-top: 4px;
}
.modal-loc-result {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #eee);
  transition: background 0.1s;
}
.modal-loc-result:active {
  background: var(--surface-alt, #f5f5f5);
}
.modal-loc-result:last-child { border-bottom: none; }
.modal-loc-result-name {
  font-size: 13px;
  color: var(--ink, #1a1a1a);
  line-height: 1.4;
}
.modal-loc-result-coords {
  font-size: 11px;
  color: var(--muted, #999);
  margin-top: 2px;
}
.modal-loc-selected {
  font-size: 13px;
  color: var(--accent, #34C759);
  padding: 8px 0;
}

/* Photo actions */
.modal-photo-actions {
  display: flex;
  gap: 8px;
}
.modal-photo-btn {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  border-radius: 12px;
  text-align: center;
}
.modal-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.modal-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
}
.modal-photo-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-photo-reorder {
  position: absolute; bottom: 4px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px;
}
.modal-photo-move {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}

/* Bottom buttons */
.mobile-modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px calc(var(--safe-bottom, 0px) + 12px);
  border-top: 1px solid var(--border, #eee);
  background: var(--surface, #fff);
  flex-shrink: 0;
}
.mbtn-cancel {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  font-family: inherit;
}
.mbtn-primary {
  flex: 2;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--accent, #34C759);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.mbtn-primary:disabled {
  opacity: 0.5;
}

/* ── QuickAdd modal ─────────────────────────────────────────────────── */
.quick-add-pick {
  width: 100%;
  background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(var(--safe-bottom, 0px) + 24px);
  position: fixed; bottom: 0; left: 0; right: 0;
}
.quick-add-processing {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface, #fff);
  z-index: 10001;
}
.quick-add-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border, #e0e0e0);
  border-top-color: var(--accent, #34C759);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.quick-add-modal .mobile-modal-body { padding: 12px 20px 0; }
.quick-add-images {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 8px; -webkit-overflow-scrolling: touch;
}
.quick-add-thumb {
  width: 80px; height: 80px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
}
.quick-add-img-add {
  width: 80px; height: 80px; border-radius: 10px; flex-shrink: 0;
  border: 2px dashed var(--border, #ddd); background: none;
  font-size: 24px; color: var(--muted, #999); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.quick-add-name {
  font-size: 17px !important; font-weight: 600;
  border: none !important; border-bottom: 1.5px solid var(--border, #e0e0e0) !important;
  border-radius: 0 !important; padding: 10px 0 !important;
  background: transparent !important;
}
.quick-add-name:focus { border-bottom-color: var(--accent, #34C759) !important; }
.quick-add-places {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.quick-add-place-chip {
  padding: 5px 12px; border-radius: 16px; font-size: 13px;
  border: 1.5px solid var(--border, #e0e0e0);
  background: var(--surface, #fff); color: var(--ink);
  cursor: pointer; font-family: inherit;
}
.quick-add-place-chip.active {
  background: var(--accent, #34C759); color: #fff;
  border-color: var(--accent, #34C759);
}
.quick-add-type-row {
  display: flex; gap: 8px; margin: 8px 0 4px;
}
.quick-add-type-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border, #e0e0e0);
  background: var(--surface, #fff); color: var(--ink);
  font-family: inherit; transition: all 0.15s;
}
.quick-add-type-btn.active {
  background: var(--accent, #34C759); color: #fff;
  border-color: var(--accent, #34C759);
}

/* ── Want/Loved picker panel ──────────────────────────────────────────── */
.add-pick-panel {
  width: 100%;
  background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(var(--safe-bottom, 0px) + 24px);
  position: relative;
}
.add-pick-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  text-align: center;
  margin-bottom: 20px;
}
.add-pick-close {
  position: absolute;
  top: 24px; right: 20px;
  background: none; border: none;
  font-size: 20px; color: var(--muted, #999);
  cursor: pointer;
}
.add-pick-options {
  display: flex;
  gap: 12px;
}
.add-pick-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border, #e0e0e0);
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.add-pick-btn:active {
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
  border-color: var(--accent, #34C759);
}
.add-pick-icon {
  font-size: 32px;
  line-height: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-pick-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
}
.add-pick-desc {
  font-size: 12px;
  color: var(--muted, #999);
  text-align: center;
  line-height: 1.4;
}

.want-toggle {
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--border, #ddd);
  position: relative;
  transition: background 0.2s;
}
.want-toggle::after {
  content: '';
  width: 22px; height: 22px;
  border-radius: 11px;
  background: #fff;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ── River popup (Pinterest-style card) ─────────────────────────────────── */
.river-popup .maplibregl-popup-content {
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.river-popup .maplibregl-popup-close-button {
  font-size: 16px; color: #bbb; padding: 6px 10px; right: 2px; top: 2px;
}
.river-popup .maplibregl-popup-close-button:hover { color: #666; background: none; }
.river-popup .maplibregl-popup-tip { border-top-color: #fff; }
.railway-popup .maplibregl-popup-content {
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  padding: 0; overflow: hidden; border: 1px solid rgba(0,0,0,0.06);
}
.railway-popup .maplibregl-popup-close-button {
  font-size: 16px; color: #bbb; padding: 6px 10px; right: 2px; top: 2px;
}
.railway-popup .maplibregl-popup-close-button:hover { color: #666; background: none; }
.railway-popup .maplibregl-popup-tip { border-top-color: #fff; }

/* ── Tutorial ───────────────────────────────────────────────────────────── */
.tutorial-overlay { position: fixed; inset: 0; z-index: 9998; }
@keyframes tutorialFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tutorial-btn {
  border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; border-radius: 20px;
  padding: 7px 16px; transition: opacity 0.15s;
}
.tutorial-btn:active { opacity: 0.7; }
.tutorial-btn-skip { background: none; color: #999; }
.tutorial-btn-next { background: var(--accent, #34C759); color: #fff; }

/* ── Guest login prompt ────────────────────────────────────────────────── */
.login-prompt {
  background: var(--glass-heavy, rgba(255,255,255,0.92));
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 20px;
  width: 340px; max-width: 90vw;
  padding: 32px 28px 28px;
  text-align: center;
  position: relative;
  animation: popIn .18s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.03);
}
.login-prompt-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--muted, #999); padding: 4px;
  border-radius: 8px; transition: background .15s;
}
.login-prompt-close:hover { background: var(--glass-light, rgba(0,0,0,0.04)); }
.login-prompt-icon { margin-bottom: 14px; }
.login-prompt-title {
  font-size: 17px; font-weight: 600;
  letter-spacing: 0.04em; margin-bottom: 6px;
  color: var(--ink, #1a1a1a);
}
.login-prompt-desc {
  font-size: 13px; color: var(--muted, #999);
  line-height: 1.5; margin-bottom: 22px;
}
.login-prompt-actions { display: flex; gap: 10px; }
.login-prompt-btn {
  flex: 1; padding: 10px 0; border-radius: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border, rgba(0,0,0,0.08)); transition: all .15s;
}
.login-prompt-btn--primary {
  background: var(--accent, #34C759); color: #fff; border-color: var(--accent, #34C759);
}
.login-prompt-btn--primary:hover { filter: brightness(1.08); }













/* ── Footprint Module ─────────────────────────────────────────────────── */
.fp-section { padding: 0 16px 16px; }
.fp-section-title { font-size: 13px; font-weight: 600; color: var(--ink, #1a1a1a); margin: 16px 0 10px; letter-spacing: 0.02em; }

/* Stats bar */
.fp-stats { display: flex; gap: 4px; padding: 12px 0; }
.fp-stat { flex: 1; text-align: center; padding: 12px 4px; background: var(--surface-alt, var(--surface, #f8f8f8)); border-radius: var(--radius-sm, 10px); }
.fp-stat-num { font-size: 22px; font-weight: 700; color: var(--accent, #34C759); line-height: 1.2; }
.fp-stat-label { font-size: 11px; color: var(--muted, #999); margin-top: 2px; }

/* Mini map */
.fp-map-section { margin: 4px 0; }
.fp-map { height: 200px; border-radius: var(--radius, 14px); overflow: hidden; background: var(--surface-alt, #f0f0f0); }
.fp-map .maplibregl-canvas { border-radius: var(--radius, 14px); }
.fp-map-link {
  display: block; width: 100%; margin-top: 8px; padding: 8px; border: none;
  background: none; color: var(--accent, #34C759); font-size: 13px; font-weight: 500;
  text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.fp-map-link:active { opacity: 0.7; }
.fp-map-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 160px; background: var(--surface-alt, var(--surface, #f8f8f8));
  border-radius: var(--radius, 14px); text-align: center;
}
.fp-map-empty-icon { font-size: 36px; opacity: 0.4; margin-bottom: 8px; }
.fp-map-empty-text { font-size: 13px; color: var(--muted, #999); padding: 0 24px; line-height: 1.5; }

/* Collapsible header (reusable) */
.fp-collapsible-header {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 0; border: none; background: none; cursor: pointer;
  color: var(--ink, #1a1a1a); -webkit-tap-highlight-color: transparent;
}
.fp-collapse-arrow { font-size: 16px; color: var(--muted, #999); transition: transform 0.2s; display: inline-block; transform: rotate(0deg); }
.fp-collapse-arrow--open { transform: rotate(90deg); }

/* Radar chart */
.fp-radar-section { margin: 4px 0; }
.fp-radar-section .fp-radar-svg { display: block; margin: 0 auto; }
.fp-radar-info {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--muted, #999); border: 1.5px solid var(--border, #e0e0e0);
  flex-shrink: 0;
}
.fp-radar-svg { width: 200px; height: 200px; margin: 0 auto; display: block; }
.fp-radar-empty { font-size: 13px; color: var(--muted, #999); padding: 32px 16px; text-align: center; }
/* ── Radar dimension legend cards ── */
.fp-radar-dims { display: flex; gap: 8px; padding: 8px 0 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fp-radar-dims::-webkit-scrollbar { display: none; }
.fp-radar-dim { flex: 0 0 auto; width: 108px; background: var(--surface-alt, rgba(0,0,0,0.04)); border-radius: 10px; padding: 10px 10px 8px; }
.fp-radar-dim-name { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: 0.05em; margin-bottom: 8px; text-transform: uppercase; }
.fp-radar-dim-subs { display: flex; flex-direction: column; gap: 5px; }
.fp-radar-sub { display: flex; align-items: center; gap: 5px; }
.fp-radar-sub-label { font-size: 10px; color: var(--soft); width: 28px; flex-shrink: 0; font-weight: 500; }
.fp-radar-sub-track { flex: 1; height: 4px; background: var(--border, rgba(0,0,0,0.08)); border-radius: 2px; overflow: hidden; }
.fp-radar-sub-fill { height: 100%; background: var(--accent); border-radius: 2px; opacity: 0.65; min-width: 2px; transition: width 0.4s ease; }

/* Annual review */
.fp-annual { margin: 4px 0 8px; background: var(--surface-alt, var(--surface, #f8f8f8)); border-radius: var(--radius, 14px); overflow: hidden; }

/* Skeleton loading */
.fp-skeleton { padding: 12px 0; }
.fp-skeleton-stats { display: flex; gap: 4px; margin-bottom: 12px; }
.fp-skeleton-stat { flex: 1; height: 60px; border-radius: var(--radius-sm, 10px); }
.fp-skeleton-map { height: 200px; border-radius: var(--radius, 14px); margin-bottom: 12px; }
.fp-skeleton-radar { height: 200px; border-radius: var(--radius, 14px); }
.fp-skeleton-stat, .fp-skeleton-map, .fp-skeleton-radar {
  background: linear-gradient(90deg, var(--surface-alt, #eee) 25%, var(--surface, #f5f5f5) 50%, var(--surface-alt, #eee) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Restaurant Sheet ──────────────────────────────────────────────────── */
/* .restaurant-sheet-overlay → u-overlay shortcut (RFC-0004) */
.restaurant-sheet {
  width: 100%; max-width: 500px; max-height: 70vh;
  background: var(--surface, #fff); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.restaurant-sheet-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  flex-shrink: 0;
}
.restaurant-sheet-title { font-size: 16px; font-weight: 600; color: var(--ink, #1a1a1a); }
.restaurant-sheet-count { font-size: 12px; color: var(--muted, #999); }
.restaurant-sheet-close {
  margin-left: auto; background: none; border: none; font-size: 16px;
  color: var(--muted, #999); cursor: pointer; padding: 4px 8px;
}
.restaurant-sheet-list { overflow-y: auto; padding: 8px 12px 20px; }
.restaurant-sheet-card {
  display: flex; gap: 12px; padding: 10px 8px;
  border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.restaurant-sheet-card:active { background: var(--hover, rgba(0,0,0,0.03)); }
.restaurant-sheet-card-img {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
}
.restaurant-sheet-card-img img { width: 100%; height: 100%; object-fit: cover; }
.restaurant-sheet-card-emoji {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: var(--accent-subtle, rgba(0,0,0,0.03));
}
.restaurant-sheet-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.restaurant-sheet-card-name {
  font-size: 14px; font-weight: 600; color: var(--ink, #1a1a1a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.restaurant-sheet-card-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 12px; color: var(--muted, #999);
}
.restaurant-sheet-card-avatar {
  width: 18px; height: 18px; border-radius: 50%; object-fit: cover;
}
.restaurant-sheet-card-avatar-placeholder {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
  background: var(--accent, #34C759);
}
.restaurant-sheet-card-tags { color: var(--accent, #34C759); font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Synced from ej/ — Record Gourmand, Edit Collection, Cover Video, Badge
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Multiple video URL rows ─── */
.video-url-row { display: flex; align-items: center; margin-bottom: 6px; }
.video-url-row .fi { flex: 1; min-width: 0; }
/* Per-row preview: YouTube thumbnail image, or a platform badge for others */
.video-url-thumb {
  flex-shrink: 0; width: 44px; height: 28px; margin-right: 8px; border-radius: 4px;
  object-fit: cover; background: #000;
  display: inline-flex; align-items: center; justify-content: center;
}
.video-link-badge { font-size: 10px; font-weight: 700; color: #fff; letter-spacing: .2px; }
.video-link-badge-bilibili { background: #fb7299; }
.video-link-badge-vimeo { background: #1ab7ea; }
.video-link-badge-youtube { background: #ff0000; }
.video-link-badge-other { background: #555; font-size: 12px; }
/* ↑/↓ reorder buttons (shown only when >1 video link) */
.video-move-btn {
  flex-shrink: 0; margin-left: 6px; width: 26px; height: 26px;
  border: 1px solid var(--border, #ccc); border-radius: 6px;
  background: none; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer;
}
.video-move-btn:disabled { opacity: .35; cursor: default; }
.video-move-btn:not(:disabled):hover { color: var(--accent); border-color: var(--accent); }

/* ── Cover-video toggle in add/edit modal ─── */
.cover-video-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-alt);
  transition: border-color .15s, background .15s;
  margin-top: -6px;
  user-select: none;
}
.cover-video-toggle.active {
  border-color: var(--accent);
  background: var(--accent-subtle, rgba(26,58,40,0.06));
}
.cover-video-toggle-label {
  font-size: 13px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.01em;
}
.cover-video-toggle-label.active { color: var(--accent); }
.cover-video-toggle-hint {
  font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4;
}
/* iOS-style toggle pill */
.toggle-switch {
  width: 38px; height: 22px; border-radius: 11px;
  background: var(--border); position: relative; flex-shrink: 0;
  transition: background .2s;
}
.toggle-switch::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.22);
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch.on::after { transform: translateX(16px); }

/* ── Cover-video carousel slide ─── */
.xhs-carousel-video-thumb {
  width: 100%; height: 100%; position: relative; cursor: pointer;
  background: #000; overflow: hidden;
}
.xhs-carousel-video-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.xhs-carousel-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.xhs-carousel-video-frame { width: 100%; height: 100%; }
.xhs-carousel-video-frame iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.xhs-dot-video {
  width: 10px !important; height: 10px !important;
  border-radius: 3px !important;
  background: rgba(255,80,80,0.8) !important;
  opacity: 1 !important;
}
.xhs-dot-video.active { background: #ff3030 !important; }

/* ── Record Gourmand CTA button ─── */
.curated-record-cta {
  margin: 20px 0 8px;
  padding: 14px 20px;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-subtle, rgba(26,58,40,0.03));
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: background .15s;
}
.curated-record-cta-icon { flex-shrink: 0; color: var(--accent); }
.curated-record-cta:hover { background: var(--accent-subtle, rgba(26,58,40,0.07)); }
.curated-record-cta-text {
  font-size: 13px; font-weight: 500; color: var(--accent);
  letter-spacing: 0.04em;
}
.curated-record-cta-hint {
  font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.03em;
}
.curated-record-cta-arrow { font-size: 18px; color: var(--accent); font-weight: 200; }

/* ── Record / Edit Gourmand bottom-sheet ─── */
/* .record-gourmand-overlay → u-overlay shortcut (RFC-0004) */
.record-gourmand-sheet {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px;
  padding: 24px 24px 40px;
  box-shadow: var(--shadow-md);
  animation: slideUp .22s ease;
}
[data-theme="luxe"] .record-gourmand-sheet,
[data-theme="eastern"] .record-gourmand-sheet,
[data-theme="homebound"] .record-gourmand-sheet {
  background: rgba(0,0,0,0.75);
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.record-gourmand-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 0 auto 20px;
}
.record-gourmand-title {
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin-bottom: 18px; letter-spacing: 0.04em;
}
.record-gourmand-type-row { display: flex; gap: 8px; margin-bottom: 18px; }
.record-gourmand-type-btn {
  flex: 1; padding: 9px 4px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt); cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-align: center; transition: all .15s; letter-spacing: 0.04em;
}
.record-gourmand-type-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle, rgba(26,58,40,0.07));
}
.record-gourmand-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.record-gourmand-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--ink); font-size: 14px;
  outline: none; margin-bottom: 20px;
  font-family: inherit; transition: border-color .15s;
}
.record-gourmand-input:focus { border-color: var(--accent); }
.record-gourmand-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-md);
}
.record-gourmand-result-item {
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.record-gourmand-result-item:last-child { border-bottom: none; }
.record-gourmand-result-item:hover { background: var(--accent-subtle); }
.record-gourmand-result-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.record-gourmand-result-hint {
  font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.record-gourmand-preview {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px; padding: 12px;
  background: var(--surface-alt); border-radius: 10px; border: 1px solid var(--border);
}
.record-gourmand-preview-thumb {
  width: 52px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.record-gourmand-preview-body { flex: 1; min-width: 0; }
.record-gourmand-preview-year {
  font-size: 10px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.record-gourmand-preview-desc {
  font-size: 11px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
@keyframes spin { to { transform: rotate(360deg); } }
.record-gourmand-submit {
  width: 100%; padding: 13px; border-radius: 10px;
  border: none; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  letter-spacing: 0.06em; transition: opacity .15s;
}
.record-gourmand-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.record-gourmand-textarea { resize: vertical; min-height: 76px; line-height: 1.55; }

/* ── Owner action buttons (add / pick from own posts) ─── */
.curated-owner-actions {
  display: flex; gap: 8px; margin: 12px 16px 0; flex-wrap: wrap;
}
.curated-owner-btn {
  flex: 1; min-width: 120px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px;
  border: 1.5px dashed var(--accent); color: var(--accent);
  background: var(--accent-subtle); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.curated-owner-btn--pick { border-style: solid; opacity: 0.85; }
.curated-owner-btn--danger { border-color: #D44; color: #D44; background: rgba(204,68,68,0.06); }
.curated-owner-btn--danger:active { background: rgba(204,68,68,0.14); }
.curated-owner-btn:active { background: var(--accent-hover); }

/* ── Artwork-style header (user-created collections) ── */
.curated-artwork-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.curated-artwork-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.curated-artwork-year {
  font-size: 13px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}
.curated-artwork-desc {
  font-size: 12px;
  color: var(--soft);
  margin-top: 10px;
  line-height: 1.7;
}
.curated-artwork-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
}
.curated-artwork-editor {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  text-align: right;
  flex-shrink: 0;
}
.curated-artwork-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* ── Unified collection detail header (replaces artwork + author headers) ── */
.curated-unified-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.curated-unified-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 0 14px;
  display: inline-block;
}
.curated-unified-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--border);
}
.curated-unified-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface-alt);
  border: 2px solid var(--accent);
  box-sizing: border-box;
}
.curated-unified-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  cursor: pointer;
  z-index: 2;
}
.curated-unified-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.curated-unified-subtitle {
  font-size: 13px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}
.curated-unified-desc {
  font-size: 12px;
  color: var(--soft);
  margin-top: 10px;
  line-height: 1.7;
}
.curated-unified-stats {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* ── Gourmand badge (「ta记录的老饕」top-left of card cover) ── */
.gourmand-badge {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-size: 9px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.04em; pointer-events: none;
  white-space: nowrap;
}

/* ── Curated food card cover (image or emoji) ── */
.curated-food-cover {
  position: relative; width: 100%; aspect-ratio: 1/1;
  border-radius: 8px 8px 0 0; overflow: hidden;
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
}
.curated-food-cover-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* When only emoji is shown inside .curated-food-cover the existing
   .curated-food-emoji sizing still applies — no change needed */

/* ── Remove food from folder button ── */
.curated-food-remove {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff;
  border: none; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.curated-food-card:hover .curated-food-remove,
.curated-food-card:active .curated-food-remove { opacity: 1; }

/* ── Own-food picker list ── */
.curated-picker-list { display: flex; flex-direction: column; gap: 0; }
.curated-picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.curated-picker-item:last-child { border-bottom: none; }
.curated-picker-item:active { background: var(--accent-subtle); }
.curated-picker-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}
.curated-picker-emoji {
  width: 48px; height: 48px; border-radius: 8px;
  background: var(--surface-alt); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.curated-picker-info { flex: 1; min-width: 0; }
.curated-picker-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.curated-picker-tags { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Edit button on user-created collection cards ─── */
.curated-edit-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.curated-edit-btn:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-subtle, rgba(26,58,40,0.06));
}

/* ── "ta记录的老饕" badge on profile post cards ─── */
.profile-post-curated-badge {
  position: absolute; top: 0; left: 0;
  background: rgba(0,0,0,0.42);
  color: #fff; font-size: 9px; font-weight: 500;
  padding: 3px 7px 3px 6px;
  border-radius: 0 0 6px 0;
  letter-spacing: 0.03em; line-height: 1.5;
  max-width: 75%; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Citation management panel (modal step 3) ──────────────────── */
.cite-list {
  margin-bottom: 8px;
}
.cite-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--surface-alt, #f5f5f5); border-radius: 10px;
}
.cite-item-info {
  display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0;
  font-size: 13px;
}
.cite-item-name {
  font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cite-item-loc {
  font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0;
}
.cite-item-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.cite-move-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.cite-move-btn:hover { color: var(--accent); border-color: var(--accent); }
.cite-remove-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: none; background: none;
  color: var(--muted); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.cite-remove-btn:hover { color: var(--danger, #e53e3e); }
.cite-search-row {
  margin-top: 4px;
}
.cite-results {
  margin-top: 4px; border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
  background: var(--surface);
}
.cite-result-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.cite-result-item:last-child { border-bottom: none; }
.cite-result-item:hover { background: var(--surface-alt, #f5f5f5); }
.cite-result-body { flex: 1; min-width: 0; }
.cite-result-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cite-result-loc {
  font-size: 11px; color: var(--muted); margin-top: 1px;
}
/* avn 模式 citation rendering in modal cite picker (search results + chosen list) */
.cite-result-citation,
.cite-item-citation {
  font-size: 12.5px; line-height: 1.45; color: var(--ink);
  word-break: break-word;
}
.cite-item-citation { font-size: 12px; }
.cite-result-citation strong,
.cite-item-citation strong { font-weight: 600; }
.cite-result-citation em,
.cite-item-citation em { font-style: italic; color: var(--muted); }

/* ── References (灵感来自) section in detail panel ─────────────────── */
.detail-cite-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; cursor: pointer;
  border-bottom: 1px solid var(--border, #eee);
  transition: opacity .15s;
}
.detail-cite-item:last-child { border-bottom: none; }
.detail-cite-item:active { opacity: 0.6; }
.detail-cite-emoji {
  font-size: 22px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.detail-cite-thumb-wrap {
  position: relative; width: 40px; height: 40px; flex-shrink: 0;
}
.detail-cite-thumb {
  width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover; display: block;
  background: var(--surface-alt, #f9f9f9);
}
.detail-cite-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
/* Top-right play button overlay on post covers (feed / profile / curated) */
.cover-play-btn {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}
.detail-cite-info {
  flex: 1; min-width: 0;
}
.detail-cite-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-cite-loc {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-cite-citation {
  font-size: 13px; line-height: 1.5; color: var(--text);
  word-break: break-word;
}
.detail-cite-arrow {
  color: var(--muted); flex-shrink: 0;
}


/* RFC-0004 step3: static earth-SPHERE backdrop on content tabs (寻味/消息/我的).
   The live globe.gl only renders earth as the active Map view; behind content it
   blanks to black. So content tabs get a CSS earth sphere (texture + sphere
   shading + atmosphere glow); the frosted glass over it gives the "glass over
   globe" look. The live 3D globe still owns the Map tab. */
.app-root[data-tab]:not([data-tab="map"])::after {
  content: '';
  position: fixed;
  left: 50%; top: 70%;
  width: 150vw; height: 150vw;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(150,195,255,0.28) 0%, rgba(150,195,255,0) 55%),
    url('../vendor/earth-blue-marble.jpg') center center / cover no-repeat;
  box-shadow: inset -50px -45px 110px 16px rgba(0,0,0,0.66), 0 0 70px 16px rgba(70,130,230,0.28);
  z-index: 0;
  pointer-events: none;
}
.app-root[data-tab]:not([data-tab="map"]) .globe-container,
.app-root[data-tab]:not([data-tab="map"]) .map-container { visibility: hidden; }
