/* ============================================
   SHARED.CSS — Panel System Layout
   Claudette wedding platform
   Phase 1: Left panel + right panel shell + banners
   ============================================ */

/* ---- DESIGN TOKENS ---- */
:root {
  /* Palette */
  --bg:              #F8F6F2;
  --bg-warm:         #F2EDE6;
  --surface:         #FEFCF9;
  --surface-tint:    #FAF7F2;
  --text-primary:    #1C2720;
  --text-secondary:  #4A5E52;
  --text-muted:      #8A9E92;
  --green:           #3B5C48;
  --green-mid:       #5C8A6E;
  --green-light:     #E4EDE8;
  --green-subtle:    #F0F5F2;
  --green-bg:        #EDF3EE;
  --green-border:    #C8DACA;
  --bronze:          #B8854A;
  --bronze-light:    #F5EAD8;
  --bronze-warm:     #EDD9BC;
  --border:          #CFC7B8;
  --border-light:    #E4DDD2;
  --success-bg:      #E6EDEA;
  --success-text:    #3B5C48;
  --gold:            #D4AA6A;
  --red:             #C0392B;
  --text:            var(--text-primary);

  /* New: sage (left panel active state) */
  --sage:            #6B8F71;
  --sage-light:      #E0EBE2;
  --sage-dark:       #2D5016;
  --sage-bg-light:   #EDF3EE;

  /* Layout zones */
  --left-panel-w: 260px;
  --left-panel-w-collapsed: 49px;
  --left-panel-w-help: 320px;
  --left-panel-mobile-w: 280px;
  --right-panel-inset: 8px;
  --panel-header-h: 48px;

  /* Panel shell */
  --panel-radius: 16px;
  --panel-bg: var(--surface-tint);
  --panel-border: var(--border);

  /* Animation */
  --panel-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --panel-duration: 0.3s;
  --fade-duration: 0.15s;

  /* Z-index stack */
  --z-left-panel: 90;
  --z-left-scrim: 85;
  --z-right-panel: 80;
  --z-fab: 75;
  --z-mode-switcher: 65;
  --z-banner: 50;
  --z-card-overlay: 40;
  --z-settings-popup: 95;

  /* FAB styling */
  --fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --fab-radius: 8px;
  --fab-size: 36px;
  --chatbot-fab-radius: 24px;

  /* Mode switcher */
  --switcher-h: 32px;
  --switcher-radius: 16px;
  --switcher-segment-px: 16px;

  /* Settings popup */

  /* Typography */
  --font-display:    'Cormorant Garamond', serif;
  --font-body:       'Jost', sans-serif;
}


/* ---- LEFT PANEL ---- */
.left-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--left-panel-w);
  background: var(--bg);
  border-right: 1px solid rgba(170,160,140,0.4);
  outline: 1px solid rgba(255,255,255,0.6);
  outline-offset: -2px;
  box-shadow:
    3px 0 8px rgba(0,0,0,0.06),
    1px 0 3px rgba(0,0,0,0.04),
    inset -1px 0 0 rgba(255,255,255,0.45);
  z-index: var(--z-left-panel);
  display: flex;
  flex-direction: column;
  transition: width var(--panel-duration) var(--panel-ease);
  overflow: visible;
}

.left-panel.collapsed {
  width: var(--left-panel-w-collapsed);
  cursor: pointer;
}

/* Left panel help mode */
.left-panel.help-mode {
  width: var(--left-panel-w-help);
  cursor: default;
}
.left-panel.help-mode .lp-brand,
.left-panel.help-mode .lp-nav,
.left-panel.help-mode .lp-footer { display: none; }

.lp-help-header {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  height: 52px;
  box-sizing: border-box;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(180,170,155,0.3);
}
.left-panel.help-mode .lp-help-header { display: flex; }

.lp-help-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}
.lp-help-back:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.lp-help-back svg { width: 17px; height: 17px; }

.lp-help-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.lp-help-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.lp-help-body {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
}
.left-panel.help-mode .lp-help-body { display: block; }

/* Brand header */
.lp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  height: 52px;
  box-sizing: border-box;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(180,170,155,0.3);
}
.collapsed .lp-brand {
  justify-content: center;
  padding: 12px 0;
  height: 52px;
  gap: 0;
}

.lp-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}
.lp-toggle:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.lp-toggle svg { width: 17px; height: 17px; }

.lp-brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  flex: 1;
  transition: opacity var(--fade-duration) ease;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.collapsed .lp-brand-text { opacity: 0; pointer-events: none; flex: 0; width: 0; }

/* Collapsed: center all icons */
.collapsed .lp-nav-item { justify-content: center; padding: 0; margin: 2px 4px; gap: 0; }
.collapsed .lp-nav-group-header { justify-content: center; padding: 0; margin: 2px 4px; width: calc(100% - 8px); gap: 0; }
.collapsed .lp-gear { justify-content: center; padding: 0; margin: 0 4px; width: calc(100% - 8px); gap: 0; }

/* Nav items */
.lp-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

/* Normalize box-sizing for nav items (pages have inconsistent global resets) */
.lp-nav-item, .lp-nav-group-header, .lp-nav-sub-item, .sd-nav-item { box-sizing: border-box; }

.lp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 6px;
  padding: 0 12px;
  height: 40px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

/* ---- Nav group (expandable parent) ---- */
.lp-nav-group { margin: 2px 0; }
.lp-nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 6px;
  padding: 0 12px;
  height: 40px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  width: calc(100% - 12px);
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.lp-nav-group-header:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.lp-nav-group-header.active { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.lp-nav-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.lp-nav-group-icon svg { width: 17px; height: 17px; }
.lp-nav-group-label {
  flex: 1;
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}
.collapsed .lp-nav-group-label { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }
.lp-nav-group-chevron {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}
.collapsed .lp-nav-group-chevron { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }
.lp-nav-group-chevron svg { width: 16px; height: 16px; }
.lp-nav-group.expanded .lp-nav-group-chevron { transform: rotate(90deg); }
.lp-nav-group-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.lp-nav-group.expanded .lp-nav-group-children { max-height: 200px; }
.lp-nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 6px;
  padding: 0 12px 0 46px;
  height: 36px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.lp-nav-sub-item:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.lp-nav-sub-item.active {
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.25);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 1px 2px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.02);
  color: var(--text-primary);
}
.lp-nav-sub-item.completed .lp-nav-sub-label { text-decoration: line-through; text-decoration-thickness: 0.8px; text-decoration-color: var(--text-muted); color: var(--text-muted); }
.lp-nav-sub-item.completed .lp-nav-status { font-size: 0.88rem; }
.lp-nav-sub-label { }
.collapsed .lp-nav-sub-item { display: none; }
.collapsed .lp-nav-group-children { max-height: 0; }
.lp-nav-item:hover {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.03);
  color: var(--text-primary);
}
.lp-nav-item.active {
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border-color: rgba(180,170,155,0.25);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 1px 2px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.02);
  color: var(--text-primary);
}

.lp-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.lp-nav-icon svg { width: 17px; height: 17px; }

.lp-nav-label {
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}
.collapsed .lp-nav-label { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }

/* Status indicators */
.lp-nav-status {
  font-size: 0.58rem;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}
.lp-nav-status-check { color: var(--green-mid); }
.lp-nav-status-dot { color: var(--sage); font-size: 0.7rem; }
.lp-nav-status-dim { color: var(--text-muted); font-size: 0.58rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.lp-nav-disabled { opacity: 0.45; cursor: default; pointer-events: none; }

/* Collapsed: status becomes small overlay dot */
.collapsed .lp-nav-status {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.5rem;
}

/* Gear footer */
.lp-footer {
  padding: 4px 4px 6px;
  flex-shrink: 0;
  position: relative;
  border-top: 1px solid rgba(180,170,155,0.3);
}

.lp-gear {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px;
  padding: 0 12px;
  height: 40px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  width: calc(100% - 8px);
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.lp-gear:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.lp-gear svg { width: 17px; height: 17px; flex-shrink: 0; }

.lp-gear-label {
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}
.collapsed .lp-gear-label { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }


/* ---- SETTINGS DRAWER (inside left panel on settings page) ---- */
/* Flex item at bottom of panel — nav items remain visible above */
.settings-drawer {
  flex-shrink: 0;
  background: var(--bg);
  border-top: 1px solid rgba(180,170,155,0.3);
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--panel-ease);
}
.settings-drawer.open {
  max-height: 400px;
}
.settings-drawer.closing {
  max-height: 0;
}
.settings-drawer.open ~ .lp-footer { display: none; }

.sd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}
.sd-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.sd-back:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.sd-back svg { width: 17px; height: 17px; }
.sd-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.sd-nav {
  padding: 2px 0 8px;
}
.sd-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 6px;
  padding: 0 12px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  width: calc(100% - 12px);
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sd-nav-item, .sd-nav-item:visited { text-decoration: none; }
.sd-nav-item:hover { background: var(--green-subtle); color: var(--text-primary); }
.sd-nav-item.active {
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 50%, #FAF9F6 100%);
  color: var(--green);
  font-weight: 500;
  border: 1px solid rgba(180,170,155,0.25);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 1px 2px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.02);
}
.sd-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.sd-nav-item.active svg { opacity: 1; }

/* Settings page: gear active, collapse toggle visible */
.settings-page .lp-gear {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
  font-weight: 500;
}
/* Expanded drawer header: title left, chevron right */
.sd-gear-icon { display: none; }
.sd-back { margin-left: auto; }
/* Collapsed settings drawer: icons only */
.collapsed .settings-drawer .sd-title { display: none; }
.collapsed .settings-drawer .sd-header { justify-content: center; padding: 4px 4px 2px; gap: 2px; flex-direction: column; align-items: center; border-bottom: none; }
.collapsed .settings-drawer .sd-gear-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--text-primary);
}
.collapsed .settings-drawer .sd-gear-icon svg { width: 17px; height: 17px; }
.collapsed .settings-drawer .sd-back { margin-left: 0; width: 24px; height: 20px; }
.collapsed .settings-drawer .sd-back svg { width: 14px; height: 14px; }
.collapsed .settings-drawer .sd-nav-item { justify-content: center; padding: 0; margin: 2px 4px; gap: 0; width: calc(100% - 8px); }
.collapsed .settings-drawer .sd-nav-item span { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }

.sd-logout { padding: 8px 6px; border-top: 1px solid rgba(180,170,155,0.15); margin-top: 4px; }
.sd-logout-btn { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; cursor: pointer; font-family: 'Jost', sans-serif; font-size: 0.82rem; color: var(--text-muted); padding: 8px 12px; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.sd-logout-btn:hover { color: var(--text-secondary); background: rgba(0,0,0,0.04); }
.collapsed .settings-drawer .sd-logout-btn span { opacity: 0; pointer-events: none; flex: 0; width: 0; min-width: 0; overflow: hidden; }

/* ---- SETTINGS POPUP ---- */

/* ---- SHARED ICON BUTTONS (used by dashboard task cards) ---- */
.sp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1px solid var(--border-light); border-radius: 6px;
  background: var(--surface-tint);
  color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0; padding: 0;
}
.sp-icon-btn svg { width: 14px; height: 14px; }
.sp-icon-btn:hover {
  background: var(--green-light); color: var(--green);
  border-color: var(--green-border);
}
.sp-icon-btn-submit { color: var(--green); }
.sp-icon-btn-submit:hover { background: var(--green); color: #fff; }

/* ---- GROUP FLYOUT (collapsed panel) ---- */
.lp-group-flyout {
  position: fixed;
  left: var(--left-panel-w-collapsed);
  min-width: 180px;
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 1px rgba(0,0,0,0.03);
  z-index: var(--z-settings-popup);
  padding: 6px 4px;
  transform: scale(0.95) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.lp-group-flyout.open {
  transform: scale(1) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.lp-group-flyout.closing {
  transform: scale(0.95) translateX(-4px);
  opacity: 0;
  pointer-events: none;
}
.lp-flyout-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 14px 6px;
}
.lp-group-flyout .lp-nav-sub-item {
  padding-left: 14px;
  margin: 1px 4px;
}
.lp-group-flyout .lp-nav-group-children {
  max-height: none;
  overflow: visible;
}


/* ---- RIGHT PANEL SHELL ---- */
.right-panel {
  position: fixed;
  top: var(--right-panel-inset);
  right: var(--right-panel-inset);
  bottom: var(--right-panel-inset);
  width: 0;
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  border-radius: var(--panel-radius);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.12),
    0 2px 6px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.03);
  z-index: var(--z-right-panel);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transition: width var(--panel-duration) var(--panel-ease);
}
.right-panel.open {
  display: flex;
}

.rp-header {
  height: var(--panel-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(180,170,155,0.2);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--fade-duration) ease var(--panel-duration);
}
.right-panel.visible .rp-header { opacity: 1; }

.rp-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.rp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.rp-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }

/* Hide close button in chat panel — exit FAB is sole close */
.right-panel.chat-panel .rp-close { display: none; }

/* Bookmark memory-save button */
.claudette-memory-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  position: relative;
}
.right-panel.chat-panel .claudette-memory-btn { display: flex; }
.claudette-memory-btn:hover { color: var(--text-secondary); }
.claudette-memory-btn.saved svg { fill: var(--bronze); stroke: var(--bronze); }
.claudette-memory-btn.saving { pointer-events: none; }
.claudette-memory-btn.saving svg.mem-saving {
  animation: memBreathe 1.2s ease-in-out infinite;
}
@keyframes memBreathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}
.claudette-memory-btn.pulse {
  animation: memoryPulse 0.6s ease;
}
@keyframes memoryPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
/* Completion — pin snap + glow burst */
.claudette-memory-btn.mem-complete svg.mem-icon {
  fill: var(--bronze); stroke: var(--bronze);
  animation: memSnap 0.3s ease-out;
}
@keyframes memSnap {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.claudette-memory-btn .mem-glow {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
}
.claudette-memory-btn .mem-glow svg {
  width: 18px; height: 18px;
  fill: rgba(184,133,74,0.6); stroke: none;
  filter: blur(6px); transform: scale(1.4);
}
.claudette-memory-btn.mem-complete .mem-glow {
  animation: memGlowBurst 0.6s ease-out forwards;
}
@keyframes memGlowBurst {
  0% { opacity: 0; transform: scale(1); }
  20% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* Memory log modal */
.memory-log-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.memory-log-backdrop.visible { opacity: 1; pointer-events: auto; }
.memory-log-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  max-height: 75vh;
  background: var(--bg-warm, #FAF8F5);
  border: 1px solid rgba(180,170,155,0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.memory-log-backdrop.visible .memory-log-modal { opacity: 1; pointer-events: auto; }
.memory-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(180,170,155,0.2);
  flex-shrink: 0;
}
.memory-log-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.memory-log-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; padding: 2px 6px;
  border-radius: 4px;
}
.memory-log-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.memory-log-filters {
  display: flex; gap: 8px; padding: 10px 18px;
  border-bottom: 1px solid rgba(180,170,155,0.12);
  flex-shrink: 0;
}
.memory-log-filters select {
  font-family: var(--font-body); font-size: 0.72rem;
  padding: 3px 8px; border: 1px solid var(--border-light);
  border-radius: 4px; background: var(--surface-tint);
  color: var(--text-secondary); outline: none; cursor: pointer;
}
.memory-log-body {
  flex: 1; overflow-y: auto; padding: 12px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.memory-log-entry {
  background: var(--surface-tint, #F5F3EF);
  border: 1px solid var(--border-light, #E5E0D8);
  border-radius: 6px;
  padding: 8px 10px;
}
.memory-log-entry-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.memory-log-entry-meta {
  display: flex; align-items: center; gap: 8px;
}
.memory-log-date {
  font-size: 0.68rem; color: var(--text-muted);
}
.memory-log-role {
  font-size: 0.62rem; font-weight: 500; padding: 1px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.06em;
}
.memory-log-role.role-couple { background: #E8F0EA; color: #3B5C48; }
.memory-log-role.role-ghost { background: #EDE8F0; color: #6B5C8A; }
.memory-log-role.role-admin { background: #F0EBE4; color: #8B7355; }
.memory-log-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.72rem; padding: 0 3px;
}
.memory-log-delete:hover { color: #B85C5C; }
.memory-log-text {
  font-size: 0.74rem; color: var(--text-secondary);
  white-space: pre-wrap; line-height: 1.5;
}
.memory-log-empty {
  text-align: center; padding: 24px;
  font-size: 0.78rem; color: var(--text-muted); font-style: italic;
}

.rp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--fade-duration) ease var(--panel-duration);
}
.right-panel.visible .rp-body { opacity: 1; }


/* ---- CHATBOT FAB ---- */
.chatbot-fab {
  position: fixed;
  bottom: calc(28px + var(--fab-lift, 0px)); /* --fab-lift: a page's fixed footer (the surveys) */
  right: 28px;
  z-index: var(--z-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  /* Glass plate — matches settings popup */
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  border-radius: 50%;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.12),
    0 2px 6px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: box-shadow 0.25s;
  user-select: none;
}
.chatbot-fab:hover {
  box-shadow:
    0 6px 24px rgba(0,0,0,0.16),
    0 2px 8px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.03);
}
.chatbot-fab svg { width: 20px; height: 20px; flex-shrink: 0; color: #6B8F71; }
.chatbot-fab-close {
  font-size: 1rem;
  line-height: 1;
  color: #3B5C48;
}

/* ---- CHAT PANEL — frame overrides ---- */
/* Floats above FAB, grows with content, caps at 50vh */
.right-panel.chat-panel {
  top: auto;
  bottom: calc(88px + var(--fab-lift, 0px));
  right: 28px;
  background: #FEFCFA;
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  border-radius: 16px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.12),
    0 2px 6px rgba(0,0,0,0.08);
  max-height: calc(100vh - 104px - var(--fab-lift, 0px));
  /* Grow-from-FAB: start scaled down + invisible */
  transform: scale(0.3);
  opacity: 0;
  transform-origin: bottom right;
  transition: transform 0.3s var(--panel-ease), opacity 0.2s ease;
}
.right-panel.chat-panel.visible {
  transform: scale(1);
  opacity: 1;
}
.right-panel.chat-panel .rp-header {
  border-bottom: 1px solid rgba(180,170,155,0.2);
  opacity: 1;
  transition: none;
}
.right-panel.chat-panel .rp-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* ---- CHAT PANEL CONTENT ---- */

/* Recessed message area */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F9F7F3;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.04),
    inset 0 1px 2px rgba(0,0,0,0.02);
}

/* Greeting — text only, no icon */
.chat-greeting {
  text-align: center;
  padding: 8px 0 12px;
}
.chat-greeting-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  font-weight: 300;
  color: #6B6B5E;
  line-height: 1.5;
}

/* Message rows */
.msg-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-row.claudette { align-items: flex-start; }
.msg-row.user { align-items: flex-end; }

.msg-sender {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #AAA89E;
  padding: 0 4px;
}

/* Claudette bubble — glass plate (lighter variant) */
.msg-bubble.claudette {
  max-width: 85%;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 1px 2px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.03);
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: #3A3A32;
  line-height: 1.5;
}

/* User bubble — sage fill */
.msg-bubble.user {
  max-width: 85%;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(180deg, #6B8F71 0%, #5E8266 100%);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.1),
    0 1px 2px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.12);
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: #FEFCF9;
  line-height: 1.5;
}

/* Timestamp — hidden until hover */
.msg-time {
  font-family: var(--font-body);
  font-size: 0.58rem;
  color: #B0B8B2;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.msg-row:hover .msg-time { opacity: 1; }
.msg-row.user .msg-time { text-align: right; }

/* Message action buttons */
/* msg-actions removed — copy is now click-on-bubble + toast */
.msg-retry-btn {
  background: none;
  border: 1px solid rgba(180,170,155,0.3);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: #6B6B60;
  margin-top: 4px;
  transition: background 0.15s ease;
}
.msg-retry-btn:hover {
  background: rgba(0,0,0,0.04);
}


/* Typing indicator */
.typing {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  flex-direction: column;
}
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(180deg, #FEFCFA 0%, #FFFFFF 35%, #FAF9F6 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 1px 2px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.03);
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8A9E92;
  opacity: 0.5;
  animation: typePulse 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typePulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 0.8; transform: translateY(-3px); }
}

/* Input area — carved track wrapper with ghost send */
.chat-input-area {
  flex-shrink: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(180,170,155,0.2);
}
.chat-input-wrap {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, #EAE6E0 0%, #F0ECE6 40%, #F4F1EC 100%);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.12),
    inset 0 1px 2px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.5);
  padding: 10px 48px 10px 42px;
}
.chat-input {
  width: 100%;
  min-height: 22px;
  max-height: 150px;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: #3A3A32;
  outline: none;
  resize: none;
  line-height: 1.4;
  overflow-y: auto;
}
.chat-input::placeholder {
  color: #9A8E80;
  font-style: italic;
}
.chat-send {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(180,170,155,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A9E92;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}
.chat-input-wrap.has-text .chat-send { opacity: 1; }
.chat-input-wrap.has-image .chat-send { opacity: 1; }

/* Image upload button */
.chat-upload {
  position: absolute;
  bottom: 10px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9A8E80;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.15s;
  padding: 0;
}
.chat-upload:hover { opacity: 1; color: var(--text-secondary); }
.chat-upload:disabled { opacity: 0.3; cursor: default; }
.chat-upload svg { width: 16px; height: 16px; }

/* Image preview strip */
.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(180,170,155,0.15);
}
.chat-image-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(180,170,155,0.3);
}
.chat-image-preview .remove-image {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1;
}
.chat-image-preview .remove-image:hover { background: rgba(0,0,0,0.1); color: var(--text-primary); }

/* Image in user message bubble */
.msg-image {
  max-width: 200px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
}
.msg-image-caption {
  margin-top: 4px;
}

/* Reference image thumbnails ({{img:ID}} tokens) */
.ref-img-thumb {
  display: inline-block;
  max-width: 180px;
  max-height: 140px;
  border-radius: 6px;
  cursor: pointer;
  margin: 4px 2px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ref-img-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Reference image lightbox */
.ref-img-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: refImgFadeIn 0.15s ease;
}
@keyframes refImgFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ref-img-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  cursor: default;
}
.ref-img-overlay .ref-img-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.chat-send:hover {
  background: rgba(107,143,113,0.08);
  border-color: rgba(107,143,113,0.3);
  color: #6B8F71;
}
.chat-send svg { width: 16px; height: 16px; }


/* ---- BANNERS ---- */
.shared-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: var(--z-banner);
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
}

.banner-demo {
  background: var(--bronze);
  color: #fff;
}
.banner-ghost {
  background: rgba(35,35,40,0.45);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.banner-couple-preview {
  background: var(--bronze);
  color: #fff;
}

.banner-label {
  background: rgba(255,255,255,0.18);
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.banner-ghost .banner-label { background: rgba(255,255,255,0.13); }

.banner-text { opacity: 0.9; }
.banner-ghost .banner-text { opacity: 0.78; }

.banner-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.12) 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 14px 4px 10px;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.70rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    inset 0 1.5px 3px rgba(0,0,0,0.2),
    inset 0 0.5px 1px rgba(0,0,0,0.1),
    0 1px 0 rgba(255,255,255,0.12);
  transition: background 0.15s;
}
.banner-exit:hover {
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.18) 100%);
}
.banner-exit svg {
  width: 12px;
  height: 12px;
  opacity: 0.85;
}


/* ---- MODE SWITCHER (dashboard, admin only) ---- */
.mode-switcher {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #EAE6E0 0%, #F0ECE6 40%, #F4F1EC 100%);
  border-radius: 16px;
  padding: 2.5px;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.12),
    inset 0 1px 2px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.5);
  user-select: none;
}
.mode-switcher-track {
  position: relative;
  display: flex;
  align-items: center;
}
.mode-switcher-glow {
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(33.333% + 4px);
  height: calc(100% + 4px);
  border-radius: 18px;
  background: radial-gradient(ellipse at center, rgba(107,143,113,0.22) 0%, transparent 70%);
  transition: transform 0.3s var(--panel-ease), background 0.3s;
  z-index: 0;
  pointer-events: none;
}
.mode-switcher-glow[data-pos="1"] {
  transform: translateX(calc(100% - 4px));
  background: radial-gradient(ellipse at center, rgba(184,133,74,0.28) 0%, transparent 70%);
}
.mode-switcher-glow[data-pos="2"] {
  transform: translateX(calc(200% - 8px));
}
.mode-switcher-thumb {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 33.333%;
  height: 100%;
  border-radius: 13px;
  background: linear-gradient(180deg, #F5F0E8 0%, #FAF7F2 35%, #F0EBE2 100%);
  border: 1px solid rgba(180,170,155,0.3);
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
  box-shadow:
    0 3px 10px rgba(0,0,0,0.15),
    0 1px 3px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.04);
  transition: transform 0.3s var(--panel-ease);
  z-index: 1;
}
.mode-switcher-thumb[data-pos="1"] { transform: translateX(100%); }
.mode-switcher-thumb[data-pos="2"] { transform: translateX(200%); }
.mode-switcher-segment {
  position: relative;
  z-index: 2;
  padding: 5px 16px;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: #9A8E80;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.25s;
  white-space: nowrap;
}
.mode-switcher-segment.active { color: var(--green); font-weight: 600; }
.mode-switcher-segment[data-mode="demo"].active { color: #9A6B2F; }


/* ---- HAMBURGER FAB (mobile only) ---- */
.hamburger-fab {
  display: none; /* shown via media query */
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-fab);
  width: var(--fab-size);
  height: var(--fab-size);
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--fab-radius);
  box-shadow: var(--fab-shadow);
  cursor: pointer;
  padding: 0;
}
.hamburger-fab svg { width: 20px; height: 20px; color: var(--text-secondary); }

/* Left panel scrim (mobile) */
.lp-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-left-scrim);
  opacity: 0;
  transition: opacity var(--panel-duration) ease;
}
.lp-scrim.visible { opacity: 1; }


/* ---- SPLASH / LOADING STATE ---- */
#loadingState {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  transition: opacity 0.4s ease;
}
.returning #loadingState { display: none !important; }
.loading-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.6rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-align: center;
  padding: 0 20px;
}
@media (max-width: 560px) {
  .loading-names { font-size: 2.2rem; }
}
@media (max-width: 374px) {
  .loading-names { font-size: 1.8rem; }
}


/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-error {
  background: var(--red);
  color: #fff;
}
.toast-success {
  background: var(--green);
  color: #fff;
}
.toast-info {
  background: var(--text-primary);
  color: #fff;
}
.toast-confirm {
  background: var(--text-primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.toast-confirm-btn {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.toast-confirm-btn:hover { opacity: 0.85; }
.toast-confirm-yes {
  background: #fff;
  color: var(--text-primary);
}
.toast-confirm-no {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
}

/* ---- ACTIVATION TOAST ---- */
.activation-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.activation-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.activation-toast-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--text-primary, #3C3228);
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  padding: 12px 16px 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  white-space: nowrap;
}
.activation-toast-msg {
  line-height: 1.4;
}
.activation-toast-cta {
  background: var(--green, #5B8C5A);
  color: #fff;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.activation-toast-cta:hover {
  background: #4a7a49;
}
.activation-toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.activation-toast-close:hover {
  color: #fff;
}
@media (max-width: 480px) {
  .activation-toast {
    left: 12px;
    right: 12px;
    transform: translateX(0) translateY(20px);
    bottom: 80px; /* above mobile FABs */
  }
  .activation-toast.visible {
    transform: translateX(0) translateY(0);
  }
  .activation-toast-inner {
    flex-wrap: wrap;
    white-space: normal;
    gap: 10px;
  }
  .activation-toast-msg {
    flex: 1 1 100%;
  }
  .activation-toast-cta {
    flex: 1;
  }
}

/* ---- CONFIRM OVERLAY ---- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.confirm-overlay.visible { opacity: 1; }
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 20px 24px;
  max-width: 300px;
  width: 90%;
  text-align: center;
}
.confirm-msg {
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.confirm-actions button {
  padding: 7px 18px;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.confirm-yes {
  background: var(--red);
  color: #fff;
}
.confirm-yes:hover { background: #922B21; }
.confirm-no {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.confirm-no:hover { background: rgba(0,0,0,0.04); }


/* ---- RESPONSIVE: MOBILE (<768px) ---- */
@media (max-width: 767px) {
  /* Hamburger clearance — !important ensures page-level .content-wrap shorthand can't override */
  .content-wrap { padding-top: 56px !important; }

  /* Hide mode switcher on mobile */
  .mode-switcher { display: none !important; }

  /* Hide desktop left panel, show hamburger */
  .left-panel {
    transform: translateX(-100%);
    width: var(--left-panel-mobile-w);
    transition: transform var(--panel-duration) var(--panel-ease);
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    overflow: hidden;
  }
  .left-panel.collapsed { width: var(--left-panel-mobile-w); } /* always expanded on mobile */
  .left-panel.help-mode { width: 100%; } /* help goes fullscreen on mobile */
  .left-panel.mobile-open { transform: translateX(0); }
  .left-panel .lp-toggle { display: none; } /* no collapse toggle on mobile */

  /* Always show labels on mobile */
  .left-panel.collapsed .lp-brand-text,
  .left-panel.collapsed .lp-nav-label,
  .left-panel.collapsed .lp-gear-label {
    opacity: 1;
    pointer-events: auto;
  }
  .left-panel.collapsed .lp-nav-status {
    position: static;
    font-size: 0.58rem;
  }

  .hamburger-fab { display: flex; }
  .lp-scrim { display: block; pointer-events: none; }
  .lp-scrim.visible { pointer-events: auto; }

  /* Right panel: full width on mobile */
  .right-panel {
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    border: none;
  }
  .right-panel.open { width: 100% !important; }

  /* Chat panel: reset floating to full-screen on mobile */
  .right-panel.chat-panel {
    top: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    border: none;
  }
  /* Mobile chat panel: proper app-bar treatment */
  .right-panel.chat-panel .rp-header {
    height: 52px;
    padding: 0 12px;
  }
  .right-panel.chat-panel .rp-close {
    display: flex;
    order: -1;
    width: 36px;
    height: 36px;
    margin-right: 4px;
  }
  /* Replace × with back chevron on mobile */
  .right-panel.chat-panel .rp-close svg { display: none; }
  .right-panel.chat-panel .rp-close::before {
    content: '\2039';
    font-size: 28px;
    line-height: 1;
    margin-top: -2px;
    color: var(--text-secondary);
  }
  .right-panel.chat-panel .rp-title {
    flex: 1;
    text-align: center;
    margin-right: 32px; /* balance against close button width */
  }

  /* Chatbot FAB position adjustment */
  .chatbot-fab { bottom: calc(16px + var(--fab-lift, 0px)); right: 16px; }

  /* Settings popup: full width inside drawer */
  /* Mobile settings: replace drawer content */
  /* Prevent iOS auto-zoom on input focus */
  input, select, textarea { font-size: 16px !important; }
}


/* ---- CONTENT ZONE ---- */
/* Main content shifts right to accommodate left panel */
.panel-content {
  margin-left: 0;
  min-height: 100vh;
}


/* ---- BODY SETUP ---- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  margin: 0;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(59,92,72,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184,133,74,0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(59,92,72,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }


/* ============================================================
   PRINT STYLESHEET (CR6 — shared across timeline, processional,
   rehearsal, photographer-brief). Hides chrome so any of these
   pages produces a clean PDF via Ctrl/Cmd+P.

   Selectors are intentionally broad: anything that's UI scaffold
   (left panel, top bar, chat panel/FAB, action buttons,
   drag affordances, sticky now-indicator, filter pills, edit
   pencils) gets hidden. Page content (cards, blocks, text) is
   given `break-inside: avoid` for clean pagination.
   ============================================================ */
@media print {
  /* Backgrounds and decorations */
  body { background: white !important; }
  body::before { display: none !important; }

  /* Layout chrome */
  .lp-left-panel, .lp-toggle, .lp-fab,
  .topbar, .right-panel, .chat-panel, .chat-fab, .chatbot-fab,
  .settings-fab, .settings-drawer,
  .shared-banner, .group-flyout {
    display: none !important;
  }

  /* Content area expands to full width */
  .panel-content, .content-wrap {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Action / filter / edit affordances */
  .action-bar, .filter-pills, .add-block-btn, .now-indicator,
  .drag-handle, .edit-affordance, .copy-btn,
  button.print-hide, .print-hide {
    display: none !important;
  }

  /* Glass plate cards print as plain-bordered cards */
  .glass-plate, .glass-plate-light, .brief-card, .notes-card,
  .timeline-block, .shot-phase, .timeline-meta-card {
    background: white !important;
    box-shadow: none !important;
    outline: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Links print without underline; text uses primary color */
  a { color: var(--text-primary) !important; text-decoration: none !important; }

  /* Pending blocks: keep dashed border so reader knows it's open */
  .timeline-block.pending {
    border: 1px dashed #b88649 !important;
  }
}
