/* ==========================================================================
   🔖 BOOKMARKS & TAB MANAGER HUB DESIGN SYSTEM
   WCAG 2.2 AAA Compliant | Day & Night Theme Engine | Animata Micro-Interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Variables (Day & Night)
   -------------------------------------------------------------------------- */
:root {
  /* Canonical Design.md Tokens (NextGen-Premium-Architecture v1.0.0) */
  --canvas-dark: #08090D;
  --surface-glass: rgba(255, 255, 255, 0.05);
  --stroke-translucent: rgba(255, 255, 255, 0.08);
  --text-heading: #FFFFFF;
  --text-body: rgba(255, 255, 255, 0.75);

  /* Spacing Scale (Design.md) */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;

  /* Default: Dark / Night Theme */
  --bm-bg: var(--canvas-dark);
  --bm-bg-subtle: #0f1422;
  --bm-surface: var(--surface-glass);
  --bm-surface-hover: rgba(255, 255, 255, 0.09);
  --bm-surface-glass: var(--surface-glass);
  --bm-border: var(--stroke-translucent);
  --bm-border-hover: rgba(255, 255, 255, 0.16);

  /* Typography */
  --bm-text: var(--text-heading);
  --bm-text-secondary: var(--text-body);
  --bm-text-muted: #94a3b8;
  --bm-text-faint: #64748b;

  /* Accents */
  --bm-accent: #6366f1;
  --bm-accent-hover: #4f46e5;
  --bm-accent-glow: #38bdf8;
  --bm-accent-glow-subtle: rgba(56, 189, 248, 0.15);

  /* Shadows for elevation */
  --bm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --bm-shadow-md: 0 10px 30px -4px rgba(0, 0, 0, 0.55);
  --bm-shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.7);

  /* Image outline token (better-ui pure black/white oklch) */
  --bm-image-outline: oklch(1 0 0 / 0.12);

  /* Radii tokens (anti-bloat smooth: 8px) */
  --radius-smooth: 8px;
  --bm-radius-btn: 6px;
  --bm-radius-inner: 4px;
  --bm-radius-card: var(--radius-smooth);
  --bm-radius-modal: 10px;

  /* Nav dimensions */
  --bm-nav-height: 70px;
}

/* Day / Light Mode locked to Cosmic Canvas Dark #08090D per Design.md & AGENTS.md */
[data-theme="light"] {
  --bm-bg: var(--canvas-dark);
  --bm-bg-subtle: #0d111a;
  --bm-surface: var(--surface-glass);
  --bm-surface-hover: rgba(255, 255, 255, 0.08);
  --bm-surface-glass: rgba(18, 24, 38, 0.75);
  --bm-border: var(--stroke-translucent);
  --bm-border-hover: rgba(255, 255, 255, 0.18);

  --bm-text: var(--text-heading);
  --bm-text-secondary: rgba(255, 255, 255, 0.75);
  --bm-text-muted: rgba(255, 255, 255, 0.5);
  --bm-text-faint: rgba(255, 255, 255, 0.35);

  --bm-accent: #6366f1;
  --bm-accent-hover: #4f46e5;
  --bm-accent-glow: #38bdf8;
  --bm-accent-glow-subtle: rgba(56, 189, 248, 0.12);

  --bm-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --bm-shadow-md: 0 12px 32px -4px rgba(0, 0, 0, 0.55);
  --bm-shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.7);

  --bm-image-outline: oklch(1 0 0 / 0.12);
}

/* Theme switch suppression to prevent smeared colors (better-ui recipe) */
.disable-transitions,
.disable-transitions * {
  transition: none !important;
}

/* Base Body Application */
body.bookmarks-body {
  background-color: var(--bm-bg);
  color: var(--bm-text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Top Navigation Bar (with Back Navigation)
   -------------------------------------------------------------------------- */
.bm-navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--bm-nav-height);
  background: var(--bm-surface-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--bm-border);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-navbar.is-scrolled {
  box-shadow: var(--bm-shadow-md);
  border-bottom-color: var(--bm-border-hover);
}

.bm-nav-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.bm-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Back Button */
.bm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--bm-radius-btn);
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  color: var(--bm-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-back-btn:hover {
  background: var(--bm-surface-hover);
  border-color: var(--bm-accent-glow);
  color: var(--bm-accent-glow);
}

.bm-back-btn:not(:disabled):active {
  transform: scale(0.96);
}

/* Brand Logo */
.bm-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--bm-text);
}

.bm-brand-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--bm-radius-btn, 6px);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid var(--bm-border);
}

.bm-brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bm-brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--bm-accent-glow-subtle);
  color: var(--bm-accent-glow);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Search Bar */
.bm-nav-center {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.bm-search-wrap {
  position: relative;
  width: 100%;
}

.bm-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bm-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.bm-search-input {
  width: 100%;
  height: 42px;
  padding: 0 4.2rem 0 2.75rem;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: 9999px;
  color: var(--bm-text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.bm-search-kbd {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bm-bg-subtle);
  border: 1px solid var(--bm-border);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--bm-text-muted);
  pointer-events: none;
}

/* Right Action Buttons */
.bm-nav-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.bm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: var(--bm-radius-btn);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-decoration: none;
}

.bm-btn:not(:disabled):active {
  transform: scale(0.96);
}

.bm-btn-primary {
  background: linear-gradient(135deg, var(--bm-accent), #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.bm-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.bm-btn-secondary:hover {
  background: var(--bm-surface-hover);
  border-color: var(--bm-border-hover);
}

.bm-btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--bm-radius-btn);
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  color: var(--bm-text);
}

.bm-btn-icon-only:hover {
  background: var(--bm-surface-hover);
  border-color: var(--bm-accent-glow);
  color: var(--bm-accent-glow);
}

/* --------------------------------------------------------------------------
   3. Main Content Layout
   -------------------------------------------------------------------------- */
.bm-main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

/* Breadcrumbs Bar */
.bm-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bm-border);
}

.bm-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--bm-text-muted);
}

.bm-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--bm-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-breadcrumb-item:hover {
  color: var(--bm-accent-glow);
}

.bm-breadcrumb-item.is-current {
  color: var(--bm-text);
  font-weight: 600;
  cursor: default;
}

.bm-breadcrumb-sep {
  color: var(--bm-text-faint);
  font-size: 0.8rem;
}

.bm-view-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Folder Chips Section */
.bm-folders-section {
  margin-bottom: 1.5rem;
}

.bm-folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.bm-folders-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bm-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bm-folders-scroll {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.bm-folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  color: var(--bm-text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-folder-chip:hover {
  background: var(--bm-surface-hover);
  border-color: var(--bm-border-hover);
  color: var(--bm-text);
}

.bm-folder-chip:not(:disabled):active {
  transform: scale(0.96);
}

.bm-folder-chip.is-active {
  background: var(--bm-accent-glow-subtle);
  border-color: var(--bm-accent-glow);
  color: var(--bm-accent-glow);
  box-shadow: 0 0 14px var(--bm-accent-glow-subtle);
}

.bm-folder-badge {
  background: var(--bm-bg-subtle);
  border: 1px solid var(--bm-border);
  color: var(--bm-text-muted);
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.bm-folder-chip.is-active .bm-folder-badge {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--bm-accent-glow);
}

/* --------------------------------------------------------------------------
   4. Links Grid & Card Layout
   -------------------------------------------------------------------------- */
.bm-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.bm-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Staggered entrance animation (better-ui recipe) */
@keyframes bmCardEntrance {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.bm-link-card {
  position: relative;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: bmCardEntrance 220ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@media (hover: hover) {
  .bm-link-card:hover {
    transform: translateY(-4px);
    background: var(--bm-surface-hover);
    border-color: var(--bm-border-hover);
    box-shadow: var(--bm-shadow-md);
  }
}

.bm-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

/* Favicon with pure black/white outline (better-ui rule) */
.bm-favicon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--bm-radius-inner, 4px);
  background: var(--bm-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  outline: 1px solid var(--bm-image-outline);
  outline-offset: -1px;
  overflow: hidden;
}

.bm-favicon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.bm-favicon-fallback {
  font-size: 1.25rem;
}

.bm-card-details {
  flex: 1;
  min-width: 0;
}

.bm-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.bm-card-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--bm-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.bm-pin-badge {
  color: #f59e0b;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.bm-card-domain {
  font-size: 0.8rem;
  color: var(--bm-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-card-desc {
  font-size: 0.85rem;
  color: var(--bm-text-secondary);
  line-height: 1.45;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Tags & Metadata */
.bm-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.bm-tag-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: var(--bm-bg-subtle);
  border: 1px solid var(--bm-border);
  color: var(--bm-text-muted);
}

/* Card Bottom Action Bar */
.bm-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bm-border);
  font-size: 0.8rem;
}

.bm-card-folder-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--bm-text-muted);
  font-size: 0.78rem;
}

.bm-card-btn-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bm-icon-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--bm-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-icon-action-btn:hover {
  background: var(--bm-bg-subtle);
  border-color: var(--bm-border);
  color: var(--bm-text);
}

.bm-icon-action-btn:not(:disabled):active {
  transform: scale(0.96);
}

.bm-icon-action-btn.is-delete:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

/* --------------------------------------------------------------------------
   5. Modals & Dialogs (with overscroll-behavior: contain)
   -------------------------------------------------------------------------- */
.bm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bm-modal-dialog {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-modal);
  box-shadow: var(--bm-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain; /* better-ui requirement */
}

.bm-modal-backdrop.is-open .bm-modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.bm-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bm-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bm-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.bm-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--bm-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.bm-form-group {
  margin-bottom: 1.2rem;
}

.bm-form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--bm-text-secondary);
}

.bm-form-control {
  width: 100%;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: var(--bm-radius-btn);
  background: var(--bm-bg-subtle);
  border: 1px solid var(--bm-border);
  color: var(--bm-text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-form-control:focus {
  border-color: var(--bm-accent-glow);
  box-shadow: 0 0 0 3px var(--bm-accent-glow-subtle);
}

textarea.bm-form-control {
  height: auto;
  min-height: 80px;
  padding: 0.75rem 0.9rem;
  resize: vertical;
}

/* Tab Manager Import Dropzone */
.bm-dropzone {
  border: 2px dashed var(--bm-border);
  border-radius: var(--bm-radius-card);
  padding: 2.25rem 1.5rem;
  text-align: center;
  background: var(--bm-bg-subtle);
  cursor: pointer;
  transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 1.25rem;
}

.bm-dropzone:hover,
.bm-dropzone.is-dragover {
  border-color: var(--bm-accent-glow);
  background: var(--bm-accent-glow-subtle);
}

.bm-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.bm-dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.bm-dropzone-hint {
  font-size: 0.82rem;
  color: var(--bm-text-muted);
}

/* Session Picker in Import Modal */
.bm-session-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-inner);
  background: var(--bm-bg-subtle);
  padding: 0.5rem;
  margin-top: 0.75rem;
  overscroll-behavior: contain;
}

.bm-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: background-color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-session-item:hover {
  background: var(--bm-surface);
}

.bm-session-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.bm-session-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. Toast Notifications
   -------------------------------------------------------------------------- */
.bm-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.bm-toast-item {
  pointer-events: auto;
  background: var(--bm-surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bm-border);
  box-shadow: var(--bm-shadow-md);
  border-radius: var(--bm-radius-btn);
  padding: 0.75rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bm-text);
  animation: bmToastIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --------------------------------------------------------------------------
   7. Reduced Motion Fallback (better-ui requirement)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bm-link-card,
  .bm-modal-dialog,
  .bm-toast-item {
    animation: none !important;
    transform: none !important;
  }
}
