/* ==========================================================================
   PajamaStay — Editorial Warm Hospitality Design System
   ========================================================================== */

:root {
  --bg-canvas: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-warm: #F3ECE2;
  --bg-warm-hover: #EAE0D2;
  --bg-sage-soft: #EBF1EE;
  --bg-terra-soft: #FBECE6;

  --text-primary: #1E1B18;
  --text-secondary: #5C554D;
  --text-muted: #8A8178;

  --accent: #C85A32;
  --accent-hover: #AD4621;
  --accent-sage: #3F6354;
  --accent-sage-hover: #315043;
  --accent-gold: #C88A2B;

  --border: #E7DFD3;
  --border-strong: #D6CBB9;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-xs: 0 2px 6px rgba(30, 27, 24, 0.04);
  --shadow-sm: 0 6px 20px rgba(30, 27, 24, 0.06);
  --shadow-md: 0 14px 36px rgba(30, 27, 24, 0.09);
  --shadow-lg: 0 24px 56px rgba(30, 27, 24, 0.16);

  --font-display: 'Fraunces', 'Noto Sans KR', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

  --container-max: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Buttons & Reusable Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(200, 90, 50, 0.22);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 22px rgba(200, 90, 50, 0.3);
}

.btn-sage {
  background: var(--accent-sage);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(63, 99, 84, 0.2);
}

.btn-sage:hover {
  background: var(--accent-sage-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-warm);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.86rem;
}

.full-width {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn.muted {
  color: var(--text-muted);
  font-weight: 500;
}

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

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 223, 211, 0.85);
}

.site-header .container {
  max-width: 1400px;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-icon {
  display: block;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--bg-warm);
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dynamic compact states applied automatically when header space tightens */
.site-header.nav-compact .header-inner {
  gap: 12px;
}

.site-header.nav-compact .main-nav {
  gap: 6px;
}

.site-header.nav-compact .nav-label {
  display: none;
}

.site-header.nav-compact .nav-icon {
  width: 18px;
  height: 18px;
}

.site-header.nav-compact .nav-link {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  color: var(--text-primary);
}

.site-header.nav-compact .nav-link:hover,
.site-header.nav-compact .nav-link:focus-visible {
  background: var(--bg-warm);
  border-color: var(--border-strong);
}

.site-header.nav-compact .nav-link::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1E1B18;
  color: #FAF7F2;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 80;
}

.site-header.nav-compact .nav-link:hover::after,
.site-header.nav-compact .nav-link:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-header.auth-compact .header-inner {
  gap: 8px;
}

.site-header.auth-compact .main-nav {
  gap: 3px;
}

.site-header.auth-compact .header-actions {
  gap: 7px;
}

.site-header.auth-compact .user-pill-handle {
  display: none;
}

.site-header.auth-compact .user-pill-btn {
  padding: 4px 8px 4px 4px;
  gap: 4px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-warm);
  border-color: var(--border-strong);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-canvas);
}

.badge-count.accent {
  background: var(--accent);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  cursor: pointer;
  gap: 2px;
}

.lang-pill {
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 52px 0 64px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-terra-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.1vw, 3.35rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  word-break: keep-all;
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 1.04rem;
  color: var(--text-secondary);
  max-width: 560px;
  word-break: keep-all;
}

/* Dual-Role Hero Search */
.hero-search-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.role-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--bg-canvas);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.role-tab {
  border: none;
  background: transparent;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease);
}

.role-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.role-tab[data-hero-mode="guests"].active {
  color: var(--accent-sage);
}

.hero-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px 8px 16px;
}

.search-field {
  display: flex;
  flex-direction: column;
  min-width: 112px;
}

.search-field-grow {
  flex: 1;
  min-width: 140px;
}

.search-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.search-field select,
.search-field input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 2px 0;
  outline: none;
  width: 100%;
}

.search-divider {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.search-submit {
  flex-shrink: 0;
  padding: 12px 20px;
}

.hero-metrics {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-item strong {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-item span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.metric-sep {
  width: 1px;
  height: 28px;
  background: var(--border-strong);
}

/* Hero Visual Photo Frame */
.hero-visual {
  position: relative;
}

.hero-photo-frame {
  position: relative;
  border-radius: 28px;
  overflow: visible;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--bg-surface);
}

.floating-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(231, 223, 211, 0.9);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  max-width: 280px;
}

.floating-badge strong {
  display: block;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--text-primary);
}

.floating-badge span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-top {
  top: 20px;
  left: -24px;
}

.badge-bottom {
  bottom: 20px;
  right: -18px;
}

.badge-icon.verified {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-sage-soft);
  color: var(--accent-sage);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-stack {
  display: flex;
  flex-shrink: 0;
}

.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  margin-left: -8px;
}

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

/* ==========================================================================
   Marketplace Directory
   ========================================================================== */
.marketplace-section {
  padding: 56px 0 84px;
}

.marketplace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.mode-switcher {
  display: inline-flex;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px;
  gap: 4px;
  flex-wrap: wrap;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease);
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.mode-btn[data-mode="guests"].active {
  color: var(--accent-sage);
}

.pill-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-warm);
  color: var(--text-secondary);
}

.mode-btn.active .pill-count {
  background: var(--bg-terra-soft);
  color: var(--accent);
}

.mode-btn[data-mode="guests"].active .pill-count {
  background: var(--bg-sage-soft);
  color: var(--accent-sage);
}

/* Filter Toolbar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid transparent;
  background: var(--bg-canvas);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  background: var(--bg-warm);
  color: var(--text-primary);
}

.chip.active {
  background: var(--text-primary);
  color: #FFFFFF;
}

.chip.outline {
  background: transparent;
  border-color: var(--border-strong);
}

.chip.outline.active {
  background: var(--bg-terra-soft);
  border-color: var(--accent);
  color: var(--accent);
}

#guestPurposeChips .chip.outline.active {
  background: var(--bg-sage-soft);
  border-color: var(--accent-sage);
  color: var(--accent-sage);
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.sort-select {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.active-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Host Listing Card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), border-color 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-warm);
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-location-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(30, 27, 24, 0.72);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}

.save-heart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.save-heart-btn:hover {
  transform: scale(1.08);
  background: #FFFFFF;
}

.save-heart-btn.saved {
  color: var(--accent);
}

.save-heart-btn.saved svg {
  fill: var(--accent);
}

.verified-ribbon {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-sage);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.host-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rating-badge {
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rating-star {
  color: var(--accent-gold);
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text-primary);
  cursor: pointer;
  word-break: keep-all;
}

.card-title:hover {
  color: var(--accent);
}

.card-desc {
  margin: 0 0 14px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-canvas);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tag.warm {
  background: var(--bg-terra-soft);
  border-color: transparent;
  color: var(--accent);
}

.tag.sage {
  background: var(--bg-sage-soft);
  border-color: transparent;
  color: var(--accent-sage);
}

.card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-block strong {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.price-block span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Guest Profile Card (Host-facing) */
.guest-card {
  position: relative;
  border-top: 4px solid var(--accent-sage);
}

.guest-card-top {
  padding: 20px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guest-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guest-avatar {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.08rem;
  color: #FFFFFF;
  flex-shrink: 0;
  position: relative;
}

.guest-flag-badge {
  position: absolute;
  bottom: -4px;
  right: -5px;
  font-size: 0.95rem;
  line-height: 1;
  background: #FFFFFF;
  border-radius: 50%;
  padding: 2px;
  box-shadow: var(--shadow-xs);
}

.guest-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.guest-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guest-save-btn {
  position: static;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
}

.guest-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-canvas);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.guest-meta-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.guest-meta-grid strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--text-secondary);
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   How It Works Section
   ========================================================================== */
.how-section {
  padding: 80px 0;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-center-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 42px;
}

.segmented-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-top: 20px;
  gap: 4px;
}

.segmented-pill.full-width {
  display: flex;
  width: 100%;
}

.segmented-pill.full-width .seg-btn {
  flex: 1;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-btn.active {
  background: var(--text-primary);
  color: #FFFFFF;
}

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

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-xs);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-terra-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.step-card.host-mode .step-num {
  background: var(--bg-sage-soft);
  color: var(--accent-sage);
}

.step-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Trust & Stories Section
   ========================================================================== */
.trust-section {
  padding: 84px 0 92px;
}

.trust-layout {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 44px;
  align-items: start;
}

.trust-desc {
  margin: 16px 0 28px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  word-break: keep-all;
}

.trust-cta-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.trust-cta-box strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.trust-cta-box p {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.cta-box-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.trust-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.trust-icon {
  font-size: 1.55rem;
  margin-bottom: 12px;
}

.trust-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.trust-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Stories */
.stories-block {
  margin-top: 68px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.stories-heading {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0 0 24px;
}

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

.story-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.story-quote {
  margin: 0;
  font-size: 0.91rem;
  color: var(--text-primary);
  line-height: 1.65;
}

.story-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.story-author strong {
  display: block;
  color: var(--text-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #1E1B18;
  color: #D9D2C8;
  padding: 42px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand .brand-text {
  color: #FAF7F2;
}

.footer-brand p {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: #A79F94;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.82rem;
  color: #8A8178;
}

/* ==========================================================================
   Modals & Slide-Over Drawer
   ========================================================================== */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 27, 24, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

.modal-card {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: popUp 0.24s var(--ease);
}

.modal-md {
  max-width: 620px;
}

.modal-lg {
  max-width: 860px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background-color 0.2s ease;
}

.modal-close.static {
  position: static;
}

.modal-close:hover {
  background: var(--bg-warm);
}

/* Detail Modal Content */
.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.detail-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.detail-heading {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.28;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  display: grid;
  gap: 6px;
}

.match-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: sticky;
  top: 0;
}

.match-box h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.match-box-sub {
  margin: 0 0 16px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Forms */
.modal-header-block {
  margin-bottom: 20px;
  padding-right: 36px;
}

.modal-header-block h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.modal-header-block p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--bg-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.14);
}

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

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--bg-canvas);
}

.photo-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.photo-option {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.photo-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.photo-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 90, 50, 0.24);
}

/* Inbox Drawer */
.drawer-panel {
  width: 100%;
  max-width: 780px;
  height: 100vh;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideLeft 0.26s var(--ease);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.drawer-header p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.inbox-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.thread-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-canvas);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.thread-item:hover {
  border-color: var(--border-strong);
}

.thread-item.active {
  border-color: var(--accent);
  background: var(--bg-terra-soft);
}

.thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.thread-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.status-pill.pending {
  background: #FFF3D6;
  color: #9A6600;
}

.status-pill.matched {
  background: var(--bg-sage-soft);
  color: var(--accent-sage);
}

.thread-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
}

.chat-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.chat-head span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FDFBF8;
}

.msg-bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.msg-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-warm);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.msg-time {
  display: block;
  font-size: 0.68rem;
  opacity: 0.72;
  margin-top: 4px;
}

.chat-form {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
}

.chat-form input:focus {
  border-color: var(--accent);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1E1B18;
  color: #FAF7F2;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: popUp 0.25s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-photo {
    aspect-ratio: 16 / 10;
  }

  .badge-top {
    left: 16px;
  }

  .badge-bottom {
    right: 16px;
  }

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

  .trust-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    gap: 8px;
  }

  .brand-text {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .hero {
    padding: 32px 0 48px;
  }

  .hero-search-form {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .search-divider {
    width: 100%;
    height: 1px;
  }

  .cards-grid,
  .steps-grid,
  .stories-grid,
  .trust-cards,
  .detail-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .inbox-body {
    grid-template-columns: 1fr;
    grid-template-rows: 170px 1fr;
  }

  .thread-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .photo-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .floating-badge {
    display: none;
  }
}

@media (max-width: 540px) {
  .main-nav {
    display: none;
  }

  .brand-text {
    display: inline;
  }
}

/* ==========================================================================
   Personal Handle Badges, Memory Showcase & Dedicated Profile Pages
   ========================================================================== */
.handle-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-terra-soft);
  border: 1px solid rgba(200, 90, 50, 0.22);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
  margin-bottom: 10px;
  width: fit-content;
}

.handle-link-pill:hover {
  background: #F6DDD3;
  transform: translateY(-1px);
}

.handle-link-pill.sage {
  color: var(--accent-sage);
  background: var(--bg-sage-soft);
  border-color: rgba(63, 99, 84, 0.22);
}

.handle-link-pill.sage:hover {
  background: #DCE8E2;
}

.handle-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
}

.handle-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.14);
}

.handle-prefix {
  padding: 10px 10px 10px 12px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.handle-input-wrap input {
  border: none !important;
  box-shadow: none !important;
  flex: 1;
}

/* Memory Showcase Section on Home */
.memory-showcase-section {
  padding: 76px 0;
  background: linear-gradient(180deg, var(--bg-canvas) 0%, #F5EFE6 100%);
  border-top: 1px solid var(--border);
}

.showcase-head {
  max-width: 720px;
  margin-bottom: 34px;
}

.showcase-sub {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  word-break: keep-all;
}

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

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
  display: flex;
  flex-direction: column;
}

.showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.showcase-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.url-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.url-dot.sage {
  background: var(--accent-sage);
}

.url-text {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  margin-right: auto;
}

.url-text strong {
  color: var(--text-primary);
}

.showcase-preview-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: var(--bg-surface);
}

.showcase-preview-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.showcase-card-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.showcase-card-body h3 {
  margin: 0;
  font-size: 1.12rem;
}

.showcase-card-body p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

/* Dedicated Personal Memory Page View */
.profile-page {
  padding-bottom: 88px;
  min-height: calc(100vh - var(--header-h));
}

.profile-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-bottom: 30px;
}

.profile-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.canonical-url-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-url-btn {
  border: none;
  background: var(--bg-warm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.copy-url-btn:hover {
  background: var(--bg-warm-hover);
}

.quick-profile-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Profile Hero Banner */
.profile-banner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.profile-cover {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #3F6354 0%, #C85A32 100%);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.86);
}

.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 27, 24, 0.08) 0%, rgba(30, 27, 24, 0.56) 100%);
}

.profile-hero-body {
  padding: 0 28px 26px;
  position: relative;
}

.profile-hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  margin-bottom: 18px;
}

.profile-avatar-block {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  margin-top: -58px;
  position: relative;
  z-index: 2;
  border-radius: 26px;
  border: 4px solid var(--bg-surface);
  box-shadow: var(--shadow-md);
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  background: var(--accent);
}

.profile-title-wrap h1 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1.2;
}

.profile-handle-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-cta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-bio-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 24px;
  align-items: start;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.profile-bio-text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.profile-stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}

.profile-stats-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
}

.profile-stats-box span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Profile Sub-Tabs */
.profile-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Memory Album Cards Grid */
.memories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.memory-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.memory-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.memory-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #1E1B18;
  overflow: hidden;
  cursor: pointer;
}

.memory-media img,
.memory-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease);
}

.memory-card:hover .memory-media img {
  transform: scale(1.04);
}

.media-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(30, 27, 24, 0.78);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.video-play-circle {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding-left: 3px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.memory-card:hover .video-play-circle {
  transform: scale(1.08);
  background: #FFFFFF;
}

.memory-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.memory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.memory-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.38;
}

.memory-title:hover {
  color: var(--accent);
}

.memory-caption {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.companion-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  width: fit-content;
  margin-bottom: 12px;
  transition: all 0.18s ease;
}

.companion-tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-terra-soft);
}

.memory-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.like-btn {
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.like-btn.liked {
  background: var(--bg-terra-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Guestbook Section */
.guestbook-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.guestbook-form-card,
.guestbook-note-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guestbook-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.guestbook-note-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Upload Dropzone */
.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--accent);
  background: var(--bg-terra-soft);
}

.upload-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 1.65rem;
}

.upload-dropzone strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.upload-dropzone span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-preview {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1E1B18;
  max-height: 220px;
}

.upload-preview img,
.upload-preview video {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

/* Lightbox Modal & Interactive Video Reel Player */
.modal-xl {
  max-width: 960px;
}

.lightbox-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: start;
}

.lightbox-stage {
  background: #161412;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.lightbox-stage img,
.lightbox-stage video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Simulated Memory Video Reel Player (for pre-seeded demo video clips) */
.reel-player {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
}

.reel-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.55s ease, transform 6s ease-out;
  transform: scale(1);
}

.reel-player.playing .reel-frame {
  transform: scale(1.08);
}

.reel-subtitle-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 58px;
  text-align: center;
  pointer-events: none;
}

.reel-subtitle-pill {
  display: inline-block;
  background: rgba(18, 16, 14, 0.76);
  backdrop-filter: blur(6px);
  color: #FAF7F2;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
}

.reel-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.84) 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
}

.reel-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reel-progress-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.reel-progress-fill {
  height: 100%;
  width: 0%;
  background: #FFFFFF;
  transition: width 0.25s linear;
}

.reel-time {
  font-size: 0.74rem;
  font-family: ui-monospace, monospace;
  opacity: 0.9;
}

.lightbox-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
}

.lightbox-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.comment-item {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.84rem;
}

.comment-item strong {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-right: 6px;
}

.comment-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-item p {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .memories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-bio-row,
  .lightbox-grid,
  .guestbook-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .showcase-grid,
  .memories-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero-body {
    padding: 0 18px 20px;
  }
}

/* ==========================================================================
   Header Auth Login Button, Logged-in User Menu & Login Modal
   ========================================================================== */
.auth-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.auth-login-btn {
  padding: 8px 14px;
}

.user-menu-wrap {
  position: relative;
}

.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: background-color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.user-pill-btn:hover {
  background: var(--bg-warm);
  border-color: var(--accent);
}

.user-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-pill-avatar.guest {
  background: var(--accent-sage);
}

.user-pill-handle {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill-caret {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 90;
  animation: popUp 0.18s var(--ease);
}

.user-dropdown-head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.user-dropdown-head strong {
  display: block;
  font-size: 0.94rem;
  margin-top: 6px;
  color: var(--text-primary);
}

.user-dropdown-head span:last-child {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background: var(--bg-warm);
}

.dropdown-item.danger {
  color: #B4382A;
}

.dropdown-item.danger:hover {
  background: #FCEAE8;
}

.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Login Modal */
.modal-sm {
  max-width: 480px;
}

.quick-login-block {
  margin-bottom: 16px;
}

.quick-login-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quick-login-list {
  display: grid;
  gap: 8px;
}

.quick-account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
}

.quick-account-btn:hover {
  border-color: var(--accent);
  background: var(--bg-terra-soft);
  transform: translateY(-1px);
}

.quick-account-btn.guest:hover {
  border-color: var(--accent-sage);
  background: var(--bg-sage-soft);
}

.quick-acc-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quick-acc-name {
  font-weight: 700;
  font-size: 0.88rem;
  display: block;
  color: var(--text-primary);
}

.quick-acc-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.login-or-divider {
  position: relative;
  text-align: center;
  margin: 16px 0;
}

.login-or-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.login-or-divider span {
  position: relative;
  background: var(--bg-surface);
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.login-footer-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.my-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #1E1B18;
  color: #FAF7F2;
  margin-left: 6px;
}

@media (max-width: 960px) {
  .header-inner {
    gap: 8px;
  }
  .main-nav {
    gap: 3px;
  }
  .header-actions {
    gap: 7px;
  }
  .user-pill-handle {
    display: none;
  }
  .user-pill-btn {
    padding: 4px 8px 4px 4px;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .auth-login-btn span {
    display: none;
  }
  .auth-login-btn {
    padding: 9px;
    width: 38px;
    height: 38px;
  }
}
