/**
 * EXPOGEN Layouts — Page Structure Templates
 *
 * All layouts use CSS Custom Properties from tokens.css.
 * Theme change = automatic layout adaptation.
 *
 * Layouts:
 *   1. App Layout (sidebar + content — dashboard, marketplace, tenders, messages)
 *   2. Auth Layout (centered card — login, register, forgot password)
 *   3. Admin Layout (sidebar + top bar — admin panel)
 *   4. Landing Layout (full-width — landing pages)
 *   5. Split Layout (two-pane — chat, settings)
 *
 * @version 1.0.0
 */

/* ================================================================
   1. APP LAYOUT — Sidebar + Header + Content
   Main layout for authenticated users.
   Sidebar collapses on mobile into hamburger.
   ================================================================ */
.layout-app {
  display: flex;
  min-height: 100vh;
}

.layout-app-sidebar {
  width: 195px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow), width var(--transition-slow);
}

/* Collapsed sidebar (icon-only mode) */
.layout-app-sidebar.collapsed {
  width: 68px;
}
.layout-app-sidebar.collapsed .sidebar-link span,
.layout-app-sidebar.collapsed .sidebar-section-title,
.layout-app-sidebar.collapsed .sidebar-logo-text,
.layout-app-sidebar.collapsed .sidebar-user-info,
.layout-app-sidebar.collapsed .sidebar-theme-picker,
.layout-app-sidebar.collapsed .sidebar-logo-full {
  display: none !important;
}
.layout-app-sidebar.collapsed .sidebar-logo-icon.logo-for-dark { display: block !important; }
.layout-app-sidebar.collapsed .sidebar-logo-icon.logo-for-light { display: none !important; }
[data-theme^="light"] .layout-app-sidebar.collapsed .sidebar-logo-icon.logo-for-dark { display: none !important; }
[data-theme^="light"] .layout-app-sidebar.collapsed .sidebar-logo-icon.logo-for-light { display: block !important; }
.layout-app-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 10px;
}
.layout-app-sidebar.collapsed .sidebar-footer-row {
  justify-content: center;
}

/* Sidebar footer: user info + theme toggle */
.sidebar-footer {
  padding: 12px 8px 12px 20px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-user-info {
  min-width: 0;
  flex: 1;
}
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--color-accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-theme-toggle {
  position: relative;
  flex-shrink: 0;
}
.sidebar-theme-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  width: 200px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
}
.sidebar-theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: background-color 0.15s;
}
.sidebar-theme-option:hover {
  background: var(--color-bg-tertiary);
}
.sidebar-theme-swatch {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar-theme-swatch-bg {
  flex: 1;
}
.sidebar-theme-swatch-accent {
  height: 4px;
}

.layout-app-main {
  flex: 1;
  margin-left: 195px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}
.layout-app-sidebar.collapsed ~ .layout-app-main {
  margin-left: 68px;
}

.layout-app-topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Topbar buttons: hamburger (mobile only) + collapse toggle (desktop only) */
.topbar-mobile-btn {
  display: none;
}
.topbar-collapse-btn {
  display: inline-flex;
}
@media (max-width: 1024px) {
  .topbar-mobile-btn {
    display: inline-flex;
  }
  .topbar-collapse-btn {
    display: none;
  }
}

.layout-app-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.layout-app-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* Responsive: sidebar overlay on mobile */
@media (max-width: 1024px) {
  .layout-app-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-xl);
  }
  .layout-app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .layout-app-main {
    margin-left: 0;
  }
  .layout-app-sidebar.collapsed ~ .layout-app-main {
    margin-left: 0;
  }
}

/* Sidebar overlay backdrop (mobile) */
.layout-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
@media (max-width: 1024px) {
  .layout-sidebar-backdrop.visible {
    display: block;
  }
}


/* ================================================================
   2. AUTH LAYOUT — Centered card
   Clean, focused layout for login/register/reset.
   Split design: left = branding, right = form.
   ================================================================ */
.layout-auth {
  min-height: 100vh;
  display: flex;
}

/* Left branding panel */
.layout-auth-brand {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: linear-gradient(135deg, var(--gradient-hero-start), var(--gradient-hero-end));
  position: relative;
  overflow: hidden;
}
.layout-auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}
.layout-auth-brand > * {
  position: relative;
  z-index: 1;
}

/* Right form panel */
.layout-auth-form {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--color-bg-primary);
}

.layout-auth-card {
  width: 100%;
  max-width: 420px;
}

.layout-auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.layout-auth-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

/* Variant: centered (no split) */
.layout-auth-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg-primary);
  position: relative;
}
.layout-auth-centered .layout-auth-card {
  max-width: 440px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
}

/* Variant: glass overlay */
.layout-auth-glass {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--gradient-hero-start), var(--gradient-hero-end));
  position: relative;
}
.layout-auth-glass .layout-auth-card {
  max-width: 440px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glass);
}

@media (max-width: 768px) {
  .layout-auth {
    flex-direction: column;
  }
  .layout-auth-brand {
    width: 100%;
    min-height: 200px;
    padding: 32px;
  }
  .layout-auth-form {
    width: 100%;
    padding: 32px 24px;
  }
}


/* ================================================================
   3. ADMIN LAYOUT — Extended sidebar with sections
   Wider sidebar with grouped navigation sections.
   ================================================================ */
.layout-admin {
  display: flex;
  min-height: 100vh;
}

.layout-admin-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.layout-admin-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.layout-admin-sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.layout-admin-sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.layout-admin-main {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-admin-topbar {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.layout-admin-content {
  flex: 1;
  padding: 24px;
}

/* Admin stats row */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-stat-icon svg {
  width: 22px;
  height: 22px;
}
.admin-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: 1.2;
}
.admin-stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.admin-stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
}
.admin-stat-change.up { color: var(--color-success); }
.admin-stat-change.down { color: var(--color-error); }

@media (max-width: 1024px) {
  .layout-admin-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-xl);
  }
  .layout-admin-sidebar.mobile-open {
    transform: translateX(0);
  }
  .layout-admin-main {
    margin-left: 0;
  }
}


/* ================================================================
   4. LANDING LAYOUT — Full-width, no sidebar
   ================================================================ */
.layout-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout-landing-content {
  flex: 1;
}

/* --- Landing page helpers --- */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrap--wide { max-width: 1400px; }
.page-wrap--narrow { max-width: 720px; }
.section-pad { padding: 80px 0; }
.grid-2col { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 768px) { .grid-2col { grid-template-columns: 1fr 1fr; } }
.grid-4col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) { .grid-4col { grid-template-columns: repeat(4, 1fr); } }
.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-16 { gap: 16px; }
.gap-12 { gap: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mb-48 { margin-bottom: 48px; }
.relative { position: relative; }
.z-1 { z-index: 1; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.cta-section { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; }
.bg-secondary-half { background: var(--color-bg-secondary); }
.pro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pro-card { padding: 20px; }
.pro-emoji { font-size: 1.5rem; margin-bottom: 8px; }
.pro-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text-primary); margin-bottom: 4px; }
.pro-desc { font-size: 0.75rem; color: var(--color-text-muted); line-height: 1.5; }
.heading-xl { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.hero-desc { max-width: 640px; margin-left: auto; margin-right: auto; font-size: 1.125rem; }
.heading-lg { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-box { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--color-bg-tertiary); border: 1px solid var(--color-border); }

/* --- Landing effects --- */
.cursor-pacman {
  width: 28px; height: 28px;
  position: fixed; pointer-events: none; z-index: 9999;
  transition: transform 0.05s linear;
}
.cursor-pacman svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(var(--color-accent-cyan-rgb), 0.5)); }
.cursor-pacman .pacman-body { fill: var(--color-accent-cyan); transform-origin: center; }
.cursor-pacman .pacman-eye { fill: var(--color-bg-primary); }
.cursor-pacman.hover .pacman-body { fill: var(--color-accent-pink); }
.pac-dot {
  width: 5px; height: 5px; background: var(--color-accent-cyan);
  border-radius: 50%; position: fixed; pointer-events: none; z-index: 9998;
  opacity: 0.6; transition: opacity 0.4s ease, transform 0.4s ease;
}
.pac-dot.eaten { opacity: 0; transform: scale(0); }
@media (max-width: 768px) {
  .cursor-pacman, .pac-dot { display: none; }
}
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-accent-cyan), var(--color-accent-pink), var(--color-accent-purple));
  z-index: 9999; transform-origin: left; width: 100%; transform: scaleX(0);
}
.overscroll-wrapper {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: center top;
}
@media (min-width: 769px) {
  .overscroll-wrapper { overflow: clip; }
}
.overscroll-wrapper.stretched-top { transform-origin: center top; }
.overscroll-wrapper.stretched-bottom { transform-origin: center bottom; }
.particles-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden; perspective: 800px;
}
.particle { position: absolute; border-radius: 50%; pointer-events: none; will-change: transform; transition: opacity 0.8s ease; }
.particle--ring { border-radius: 50%; background: transparent; }
.particle--diamond { border-radius: 4px; }
.particle--cross { border-radius: 2px; }
.glow-border { position: relative; }
.glow-border::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  background: linear-gradient(135deg, var(--color-accent-cyan), var(--color-accent-pink));
  z-index: -1; opacity: 0; transition: opacity 0.3s;
}
.glow-border:hover::before { opacity: 1; }

/* --- Landing responsive --- */
@media (max-width: 1024px) {
  .hero-section { padding: 48px 0 40px; }
  .hero-section .heading-xl { font-size: clamp(2rem, 5vw, 3rem); }
  .hero-section .text-body { font-size: 1rem; }
  .hero-section .terminal { max-width: 540px; }
}
@media (max-width: 768px) {
  .section-pad { padding: 40px 0; }
  .page-wrap { padding: 0 16px; }
  .cta-section { padding: 40px 16px; min-height: 40vh; }
  .form-row { grid-template-columns: 1fr; }
  .overscroll-wrapper { padding-bottom: 64px; }
  .hero-section { min-height: auto; padding: 40px 0 0; }
  .hero-section > .page-wrap { padding: 0 10px; }
  .hero-section .mb-24 { margin-bottom: 32px; }
  .hero-section .mb-32 { margin-bottom: 48px; }
  .hero-section .mb-40 { margin-bottom: 64px; }
  .hero-section .mb-48 { margin-bottom: 32px; }
  .hero-section .heading-xl { font-size: 1.55rem; }
  .hero-desc { font-size: 0.8125rem; line-height: 1.5; }
  .hero-section .btn-xl { padding: 11px 18px; font-size: 0.8125rem; border-radius: 12px !important; }
  .hero-section .btn-xl svg { width: 14px; height: 14px; }
  .hero-section .terminal { font-size: 0.7rem; }
  .hero-section .terminal-body { padding: 10px; }
  .hero-badge { font-size: 0.75rem; padding: 6px 14px; }
  .hero-section .show-on-mobile img { height: 80px !important; }
}
@media (max-width: 480px) {
  .hero-section .heading-xl { font-size: 1.75rem; }
  .hero-desc { font-size: 0.8125rem; }
  .hero-section .btn-xl { padding: 10px 16px; font-size: 0.75rem; }
  .hero-section .gap-16 { gap: 10px; }
  .hero-section .terminal { font-size: 0.65rem; }
  .hero-badge { font-size: 0.6875rem; padding: 5px 12px; }
  .hero-section .show-on-mobile img { height: 80px !important; }
}
@media (max-width: 400px) {
  .hero-section .heading-xl { font-size: 1.625rem; }
  .hero-desc { font-size: 0.75rem; }
  .hero-section .btn-xl { width: 100%; justify-content: center; padding: 10px 14px; font-size: 0.75rem; }
  .hero-section .gap-16 { gap: 8px; }
  .hero-section .terminal { font-size: 0.625rem; }
  .hero-badge { font-size: 0.625rem; padding: 4px 10px; }
  .hero-section .show-on-mobile img { height: 72px !important; }
}


/* ================================================================
   5. SPLIT LAYOUT — Two panes (chat, settings)
   Left panel = list/nav, Right panel = detail/content.
   ================================================================ */
.layout-split {
  display: flex;
  height: calc(100vh - 64px); /* minus topbar */
  overflow: hidden;
}

.layout-split-left {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  overflow-y: auto;
}

.layout-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .layout-split {
    flex-direction: column;
    height: auto;
  }
  .layout-split-left {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 50vh;
  }
  .layout-split-right {
    min-height: 50vh;
  }
}


/* ================================================================
   6. GRID HELPERS (content grids)
   ================================================================ */
.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Auto-fit responsive grids */
.grid-auto-fill-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.grid-auto-fill-md {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.grid-auto-fill-lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ================================================================
   7. PAGE CONTAINERS
   ================================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 720px; }
.container-lg { max-width: 1400px; }
.container-xl { max-width: 1600px; }

/* ================================================================
   8. MOBILE RESPONSIVE FOUNDATION
   ================================================================ */

/* Prevent horizontal scroll globally */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Container padding reduction on mobile */
@media (max-width: 767px) {
  .container { padding: 0 16px; }
}

/* App mini footer — compact height (1/3 of landing footer) */
.layout-app .landing-footer { padding: 10px 24px; }
.layout-app .landing-footer-inner { gap: 12px; }

/* App content padding when mobile bottom nav is present */
@media (max-width: 768px) {
  .layout-app-content { padding-bottom: 72px; }
  .layout-app .landing-footer { padding-bottom: calc(10px + 72px); }
}

/* ================================================================
   9. BOTTOM NAV BAR (mobile only)
   @deprecated Use .mobile-bottom-nav from design-system.css instead.
   Kept for backward compatibility. Will be removed in v2.0.
   ================================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(12px);
}
@media (max-width: 767px) {
  .bottom-nav { display: flex; }
}
.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 6px 4px;
  min-height: 48px;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none; background: none;
  font-size: inherit;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active { opacity: 0.7; }
.bottom-nav-item.active { color: var(--color-accent-cyan); }
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-label { font-size: 0.625rem; line-height: 1.2; }

/* More sheet — slide-up overlay */
.more-sheet-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.5);
}
.more-sheet-backdrop.open { display: block; }
.more-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 260;
  background: var(--color-bg-secondary);
  border-top-left-radius: var(--radius-xl, 16px);
  border-top-right-radius: var(--radius-xl, 16px);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 70vh;
  overflow-y: auto;
}
.more-sheet.open { transform: translateY(0); }
.more-sheet-handle {
  width: 40px; height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.more-sheet-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: var(--radius-md, 8px);
  min-height: 44px;
  transition: background 0.15s;
}
.more-sheet-item:active { background: var(--color-bg-tertiary); }
.more-sheet-item svg { width: 20px; height: 20px; color: var(--color-text-muted); flex-shrink: 0; }
.more-sheet-item span { font-size: 0.875rem; }

/* ================================================================
   10. SPA LAYOUT TRANSITIONS
   ================================================================ */
body {
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
body.spa-transition-out {
  opacity: 0;
}
