/* ─── Heroku Purple Design System (Purple3) ─────────────────────────────── */
:root {
  /* Core Heroku Purple palette */
  --purple-900: #1a0033;
  --purple-800: #280050;
  --purple-700: #380073;
  --purple-600: #430098;   /* Primary brand purple */
  --purple-500: #6762a6;   /* Medium purple */
  --purple-400: #9b93c9;
  --purple-300: #c5bfe8;
  --purple-200: #e8e5f7;
  --purple-100: #f4f2fb;
  --purple-50:  #faf9fe;

  /* Accent & functional */
  --violet:     #7b2fff;
  --lavender:   #a78bfa;
  --sage:       #6b9e7e;
  --warm-white: #fefcf8;
  --slate-900:  #1a1a2e;
  --slate-700:  #2d2d4a;
  --slate-500:  #6b6b8a;
  --slate-300:  #b8b8cc;
  --slate-100:  #f0f0f5;

  /* Semantic */
  --bg:         var(--warm-white);
  --bg-alt:     var(--purple-50);
  --text:       var(--slate-900);
  --text-muted: var(--slate-500);
  --border:     var(--purple-200);
  --brand:      var(--purple-600);
  --brand-hover:#380073;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Sizing */
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 2px 12px rgba(67, 0, 152, 0.08);
  --shadow-lg:  0 8px 40px rgba(67, 0, 152, 0.14);
  --shadow-xl:  0 24px 64px rgba(67, 0, 152, 0.18);
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
h4 { font-size: 1.15rem; }

p { color: var(--slate-700); line-height: 1.75; }

.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }
.text-center { text-align: center; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand);
  color: white;
}
.btn--primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white;
}

.btn--secondary {
  background: var(--purple-100);
  color: var(--brand);
  border: 1px solid var(--purple-300);
}
.btn--secondary:hover {
  background: var(--purple-200);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover {
  background: var(--slate-100);
  color: var(--text);
  text-decoration: none;
}

.btn--lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn--sm { padding: 8px 16px; font-size: 0.85rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-700);
}

.form-input,
.form-textarea,
.form-select {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: white;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(67, 0, 152, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card--elevated {
  box-shadow: var(--shadow-lg);
}

.card--brand {
  background: var(--brand);
  color: white;
  border-color: transparent;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 252, 248, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__logo-mark svg { width: 20px; height: 20px; }

.nav__wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.nav__wordmark span {
  color: var(--brand);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -300px;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(67, 0, 152, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-100);
  color: var(--brand);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
}

.hero__title {
  max-width: 780px;
  margin-bottom: 24px;
}

.hero__title em {
  font-style: italic;
  color: var(--brand);
}

.hero__subtitle {
  font-size: 1.2rem;
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 40px;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__trust {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero__trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero__trust-icon {
  width: 20px;
  height: 20px;
  color: var(--sage);
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }
.section--dark {
  background: var(--slate-900);
  color: white;
}
.section--dark p { color: var(--slate-300); }

.section__eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.section__title { margin-bottom: 16px; }
.section__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ─── Feature Grid ───────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: var(--purple-100);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--brand);
  font-size: 1.4rem;
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.feature-card__desc {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Steps Timeline ─────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  position: relative;
}

.step {
  padding: 32px 24px;
  text-align: center;
  position: relative;
}

.step__num {
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 auto 18px;
}

.step__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; font-family: var(--font-body); }
.step__desc { font-size: 0.9rem; color: var(--text-muted); }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: var(--slate-900);
  color: white;
  padding: 32px 0;
  border-right: none;
}

.sidebar__section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-300);
  padding: 0 24px;
  margin-bottom: 8px;
  margin-top: 24px;
}

.sidebar__section-title:first-child { margin-top: 0; }

.sidebar__plan-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  padding: 0 24px;
  margin-bottom: 6px;
}

.sidebar__progress {
  padding: 0 24px;
  margin-bottom: 24px;
}

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--lavender);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--slate-300);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  color: var(--slate-300);
  font-size: 0.9rem;
}

.sidebar__nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.sidebar__nav-item.active {
  background: rgba(103, 98, 166, 0.2);
  border-left-color: var(--lavender);
  color: white;
}

.sidebar__nav-item.completed .nav-item__icon::after {
  content: '✓';
}

.nav-item__icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-item__badge {
  margin-left: auto;
  background: var(--sage);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 100px;
}

/* ─── Main Content Area ──────────────────────────────────────────────────── */
.main-content {
  overflow-y: auto;
  max-height: calc(100vh - 64px);
}

.content-header {
  padding: 40px 48px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
}

.content-header__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 500;
  margin-bottom: 6px;
}

.content-header__title { margin-bottom: 6px; }
.content-header__desc { color: var(--text-muted); font-size: 0.95rem; }

.content-body { padding: 40px 48px; }

/* ─── Chat Interface ─────────────────────────────────────────────────────── */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px - 160px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message {
  display: flex;
  gap: 14px;
  max-width: 85%;
  animation: msgFadeIn 0.3s ease;
}

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

.message--agent { align-self: flex-start; }
.message--user  { align-self: flex-end; flex-direction: row-reverse; }

.message__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.message--user .message__avatar {
  background: var(--purple-300);
  color: var(--brand);
}

.message__bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.message--agent .message__bubble {
  background: white;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.message--user .message__bubble {
  background: var(--brand);
  color: white;
  border-bottom-right-radius: 4px;
}

.message__bubble p { color: inherit; margin-bottom: 8px; }
.message__bubble p:last-child { margin-bottom: 0; }
.message__bubble strong { font-weight: 600; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--slate-300);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Chat input */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 0 0;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  resize: none;
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 48px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.15s;
  font-family: var(--font-body);
  background: white;
}

.chat-input:focus {
  outline: none;
  border-color: var(--brand);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  background: var(--brand);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--brand-hover);
  transform: scale(1.05);
}

.chat-send-btn svg { width: 20px; height: 20px; }

/* Quick suggestions */
.chat-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.suggestion-chip {
  background: var(--purple-100);
  color: var(--brand);
  border: 1px solid var(--purple-300);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.suggestion-chip:hover { background: var(--purple-200); }

/* Toggle: agent vs form */
.mode-toggle {
  display: flex;
  background: var(--slate-100);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  width: fit-content;
}

.mode-toggle__btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}

.mode-toggle__btn.active {
  background: white;
  color: var(--brand);
  box-shadow: var(--shadow);
}

/* ─── Section Overview Cards ─────────────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 600px) {
  .overview-grid { grid-template-columns: 1fr; }
}

.overview-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  display: block;
  -webkit-tap-highlight-color: rgba(67,0,152,0.1);
  touch-action: manipulation;
}

.overview-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.overview-card.completed {
  border-color: var(--sage);
  background: linear-gradient(135deg, white, #f0f7f3);
}

.overview-card.in-progress {
  border-color: var(--lavender);
}

.overview-card__status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.status--done { background: #d4edda; color: #155724; }
.status--progress { background: var(--purple-100); color: var(--brand); }
.status--todo { background: var(--slate-100); color: var(--text-muted); }

.overview-card__icon { font-size: 1.8rem; margin-bottom: 14px; }
.overview-card__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; font-family: var(--font-body); }
.overview-card__desc { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Packet / Output View ───────────────────────────────────────────────── */
.packet-output {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.packet-output h2 {
  font-size: 1.4rem;
  border-bottom: 2px solid var(--purple-200);
  padding-bottom: 10px;
  margin: 32px 0 16px;
  color: var(--brand);
}

.packet-output h2:first-child { margin-top: 0; }
.packet-output p { margin-bottom: 12px; }
.packet-output ul { padding-left: 24px; margin-bottom: 12px; }
.packet-output li { margin-bottom: 6px; }
.packet-output strong { color: var(--text); }

/* ─── Landing page specific ──────────────────────────────────────────────── */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 0, 51, 0.7);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

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

.auth-modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

.auth-modal__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-modal__title { margin-bottom: 6px; font-size: 1.5rem; }
.auth-modal__subtitle { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 28px; }

/* ─── Generic Modal (used by auth flow in app.js) ────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 0, 51, 0.7);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 48px 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  position: relative;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.modal__close:hover {
  background: #f3f0ff;
  color: var(--brand);
}

.modal__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.modal__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.modal__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--slate-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 360px;
}

.toast--success { border-left: 4px solid var(--sage); }
.toast--error { border-left: 4px solid #e74c3c; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }
  
  .content-body { padding: 24px; }
  .content-header { padding: 24px; }
  
  .hero { padding: 60px 0 40px; }
  .hero__cta { flex-direction: column; align-items: flex-start; }
  
  .auth-modal { padding: 32px 24px; margin: 16px; }
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.italic { font-style: italic; }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(67, 0, 152, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════════
   NEW LAYOUT: Nav links, Hamburger, Mobile Drawer, Section Grid, Page Layout
   ══════════════════════════════════════════════════════════════════════════════ */

/* Nav layout handled in base styles */

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav__link:hover { background: var(--purple-100); color: var(--brand); }
.nav__link.active { background: var(--purple-100); color: var(--brand); font-weight: 500; }

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 16px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: rgba(103,0,152,0.1);
  touch-action: manipulation;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--slate-900);
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--slate-900);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.mobile-drawer.open { right: 0; }

.mobile-drawer__inner { padding: 0 0 40px; }
.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}
.mobile-drawer__title { color: white; font-size: 0.95rem; font-weight: 600; }
.mobile-drawer__close {
  background: none; border: none; color: var(--slate-300);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
}

.drawer__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  color: var(--slate-300);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.drawer__link:hover { background: rgba(255,255,255,0.06); color: white; }
.drawer__link.active { color: var(--lavender); background: rgba(103,98,166,0.15); }
.drawer__signout { color: #f87171; }
.drawer__divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 0; }

.mobile-drawer__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.mobile-drawer__overlay.open { display: block; }

/* Page layout (replaces sidebar+main-content) */
.page-content {
  padding: 0 0 80px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.page-header__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 500;
  margin-bottom: 8px;
}

.page-header__title {
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-header__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--brand); }

/* Section grid (dashboard cards) */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.section-card {
  display: block;
  text-decoration: none;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s;
  color: inherit;
  -webkit-tap-highlight-color: rgba(103,0,152,0.1);
  touch-action: manipulation;
  cursor: pointer;
}

.section-card:hover, .section-card:active {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(67,0,152,0.12);
  transform: translateY(-2px);
}

.section-card--done {
  border-color: var(--sage);
  background: linear-gradient(135deg, white, #f0f7f3);
}

.section-card__icon { font-size: 2rem; margin-bottom: 16px; }
.section-card__label { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.section-card__desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.section-card__status { font-size: 0.82rem; font-weight: 500; color: var(--brand); }
.section-card--done .section-card__status { color: var(--sage); }

/* Output / generate section */
.output-section {
  padding: 32px;
  background: var(--purple-100);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(103,0,152,0.15);
}
.output-section h3 { margin-bottom: 8px; }
.output-section p { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 20px; }
.output-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* Progress bar (non-sidebar version) */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--lavender));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
/* Nav links hide on smaller screens */
@media (max-width: 900px) {
  .nav__links { display: none; }
}

@media (max-width: 768px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .section-card { padding: 22px; }
  .page-header { padding: 24px 0 20px; margin-bottom: 24px; }
  .page-header__title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .nav__inner { padding: 0 16px; }
  .container, .container--narrow { padding: 0 16px; }
}

/* Hide secondary nav items on small mobile */
@media (max-width: 480px) {
  .nav-hide-mobile { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   FAMILY & FRIENDS
   ══════════════════════════════════════════════════════════════════════════════ */

.drawer__section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-300);
  padding: 16px 20px 4px;
  opacity: 0.6;
}

.ff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.ff-count { font-size: 0.88rem; color: var(--text-muted); }

.ff-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.ff-empty__icon { font-size: 3rem; margin-bottom: 16px; }
.ff-empty__title { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.ff-empty__desc { font-size: 0.9rem; max-width: 360px; margin: 0 auto 28px; }

.ff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.ff-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  transition: box-shadow 0.2s;
}
.ff-card:hover { box-shadow: var(--shadow-lg); }

.ff-card__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--lavender));
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ff-card__body { flex: 1; min-width: 0; }
.ff-card__name { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.ff-card__rel { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.ff-card__contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ff-chip {
  font-size: 0.72rem;
  background: var(--slate-100);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 100px;
}
.ff-card__perms { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-badge {
  font-size: 0.68rem; padding: 2px 7px; border-radius: 100px; font-weight: 500;
}
.perm--view { background: #e8f4fd; color: #2980b9; }
.perm--print { background: #fef9e7; color: #d4a017; }
.perm--edit { background: #fdecea; color: #c0392b; }
.perm--add { background: #eafaf1; color: #27ae60; }

.ff-card__edit {
  position: absolute; top: 16px; right: 16px;
  font-size: 0.78rem; color: var(--brand); background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.ff-card__edit:hover { background: var(--purple-100); }

/* FF Modal */
.modal--wide { max-width: 760px; width: calc(100vw - 32px); }

.ff-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  margin: 24px 0;
}

.ff-form-section { }
.ff-form-section--full { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 20px; }

.ff-form-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 16px;
}

.ff-perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.perm-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.perm-toggle:has(input:checked) {
  border-color: var(--brand);
  background: var(--purple-100);
}
.perm-toggle input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); }
.perm-toggle__label { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.perm-toggle__desc { font-size: 0.78rem; color: var(--text-muted); }

.ff-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SAVE & DISTRIBUTE
   ══════════════════════════════════════════════════════════════════════════════ */

.distribute-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.distribute-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow 0.2s;
}
.distribute-card:hover { box-shadow: var(--shadow-lg); }

.distribute-card__icon { font-size: 2.2rem; margin-bottom: 14px; }
.distribute-card__title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.distribute-card__desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.distribute-card__btn { margin-top: auto; }

.cloud-options { display: flex; flex-direction: column; gap: 8px; }
.cloud-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.cloud-btn:hover { border-color: var(--brand); background: var(--purple-100); }
.cloud-btn__icon { font-size: 1.2rem; }
.cloud-btn__status { margin-left: auto; }
.coming-soon { font-size: 0.72rem; background: var(--slate-100); color: var(--text-muted); padding: 2px 8px; border-radius: 100px; }

.notarize-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.notarize-step { display: flex; align-items: center; gap: 12px; font-size: 0.88rem; color: var(--text-muted); }
.notarize-step__num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--purple-100); color: var(--brand);
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.badge-coming-soon {
  font-size: 0.7rem; background: var(--slate-100); color: var(--text-muted);
  padding: 2px 7px; border-radius: 100px; margin-left: 6px; vertical-align: middle;
}

.ff-send-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ff-send-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s;
}
.ff-send-item:has(input:checked) { border-color: var(--brand); background: var(--purple-100); }
.ff-send-item input { accent-color: var(--brand); }
.ff-send-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--lavender));
  color: white; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ff-send-name { font-size: 0.9rem; font-weight: 600; }
.ff-send-contact { font-size: 0.78rem; color: var(--text-muted); }

.distribute-empty {
  font-size: 0.88rem; color: var(--text-muted);
  padding: 16px; background: var(--slate-100);
  border-radius: var(--radius); text-align: center;
}
.link { color: var(--brand); text-decoration: none; font-weight: 500; }

.ff-loading { padding: 40px; text-align: center; color: var(--text-muted); }

@media (max-width: 768px) {
  .distribute-grid { grid-template-columns: 1fr; }
  .ff-grid { grid-template-columns: 1fr; }
  .ff-form-grid { grid-template-columns: 1fr; }
  .ff-perms-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   WORDS FOR THE FUTURE — LEGACY LETTERS
   ══════════════════════════════════════════════════════════════════════════════ */

/* Empty state */
.legacy-empty { text-align: center; padding: 60px 24px 40px; }
.legacy-empty__icon { font-size: 3.5rem; margin-bottom: 16px; }
.legacy-empty__title { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.legacy-empty__desc { color: var(--text-muted); font-size: 0.92rem; max-width: 400px; margin: 0 auto 32px; }

.legacy-prompt-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 600px; margin: 0 auto;
}
.legacy-prompt-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); background: white; cursor: pointer;
  font-size: 0.9rem; font-family: inherit; transition: all 0.15s;
  touch-action: manipulation;
}
.legacy-prompt-card:hover { border-color: var(--brand); background: var(--purple-100); color: var(--brand); }
.legacy-prompt-card__icon { font-size: 1.3rem; }

/* Letter grid */
.legacy-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.legacy-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; position: relative; transition: all 0.2s; cursor: pointer;
}
.legacy-card:hover { box-shadow: var(--shadow-lg); border-color: var(--lavender); }
.legacy-card__occasion-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 3px 10px; border-radius: 100px; margin-bottom: 12px;
  background: var(--purple-100); color: var(--brand);
}
.legacy-card__to { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.legacy-card__title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.legacy-card__preview { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; min-height: 40px; }
.legacy-card__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.legacy-meta-chip { font-size: 0.72rem; background: var(--slate-100); color: var(--text-muted); padding: 2px 8px; border-radius: 100px; }
.legacy-status { font-size: 0.72rem; padding: 2px 8px; border-radius: 100px; margin-left: auto; }
.legacy-status--draft { background: #fef9e7; color: #b7950b; }
.legacy-status--ready { background: #eafaf1; color: #1e8449; }
.legacy-card__edit {
  font-size: 0.82rem; color: var(--brand); background: none; border: none;
  cursor: pointer; padding: 0; font-weight: 600; transition: opacity 0.15s;
}

/* Letter modal */
.modal--letter {
  max-width: 960px; width: calc(100vw - 32px);
  max-height: 92vh; overflow-y: auto; padding: 0;
}
.letter-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 28px 32px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: white; z-index: 2;
}
.letter-modal-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); font-weight: 600; margin-bottom: 4px; }
.letter-modal-title { font-size: 1.4rem; font-weight: 700; margin: 0; }

.letter-modal-body {
  display: grid; grid-template-columns: 340px 1fr; gap: 0;
  min-height: 500px;
}
.letter-col { padding: 24px 28px; }
.letter-col--left { border-right: 1px solid var(--border); background: var(--slate-50); }
.letter-col--right { display: flex; flex-direction: column; }

.letter-section-title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 6px;
}
.letter-section-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

/* Video options */
.video-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.video-option-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: white; cursor: pointer; text-align: left; width: 100%; font-family: inherit;
  transition: all 0.15s; touch-action: manipulation;
}
.video-option-btn:hover { border-color: var(--brand); background: var(--purple-100); }
.video-option-btn__icon { font-size: 1.4rem; flex-shrink: 0; }
.video-option-btn__label { font-size: 0.88rem; font-weight: 600; }
.video-option-btn__sub { font-size: 0.75rem; color: var(--text-muted); }
.video-preview-wrap { margin-top: 10px; border-radius: var(--radius); overflow: hidden; }
.video-preview { width: 100%; max-height: 160px; border-radius: var(--radius); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Reminder rows */
.reminder-row {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 8px;
}
.reminder-row__top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.reminder-row__details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rem-recurring-label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; }
.rem-recurring-label input { accent-color: var(--brand); }
.rem-ff-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.rem-ff-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rem-ff-item {
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 100px;
  cursor: pointer; transition: all 0.15s; background: white;
}
.rem-ff-item:has(input:checked) { border-color: var(--brand); background: var(--purple-100); color: var(--brand); }
.rem-ff-item input { accent-color: var(--brand); }

/* AI bar */
.letter-ai-bar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap;
}
.ai-status {
  font-size: 0.85rem; color: var(--brand); padding: 8px 0;
  display: flex; align-items: center; gap: 8px;
}
.ai-status.hidden { display: none; }

/* Letter body */
.letter-body {
  flex: 1; min-height: 320px; resize: vertical;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem; line-height: 1.7; padding: 16px;
}
.letter-body-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; flex-wrap: wrap; gap: 8px;
}
.letter-char-count { font-size: 0.78rem; color: var(--text-muted); }

/* Preview modal */
.modal--preview { max-width: 600px; width: calc(100vw - 32px); }
.letter-preview-to { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.letter-preview-occasion {
  display: inline-block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  background: var(--purple-100); color: var(--brand); padding: 3px 10px; border-radius: 100px; margin-bottom: 16px;
}
.letter-preview-title { font-size: 1.3rem; margin-bottom: 20px; }
.letter-preview-body {
  font-family: Georgia, serif; font-size: 1rem; line-height: 1.8; color: var(--text);
}
.letter-preview-body p { margin-bottom: 1em; }

@media (max-width: 768px) {
  .letter-modal-body { grid-template-columns: 1fr; }
  .letter-col--left { border-right: none; border-bottom: 1px solid var(--border); }
  .legacy-grid { grid-template-columns: 1fr; }
  .letter-modal-header { padding: 20px; }
  .letter-col { padding: 20px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD — THREE-TIER NAVIGATION REDESIGN
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Nav icon labels ───────────────────────────────────────────────────────── */
.nav__link-icon { margin-right: 5px; font-size: 0.9em; opacity: 0.8; }

/* ── Drawer icon + plan name ───────────────────────────────────────────────── */
.drawer__link-icon { width: 22px; display: inline-block; text-align: center; margin-right: 6px; flex-shrink: 0; }
.drawer__plan-name { font-weight: 700; color: white; font-size: 0.95rem; }
.drawer__plan-sub { font-size: 0.72rem; color: var(--slate-300); margin-top: 2px; }

/* ── Dashboard header ──────────────────────────────────────────────────────── */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 36px 0 28px; gap: 24px;
}
.dash-header__left { flex: 1; }
.dash-header__title { font-size: 1.8rem; font-weight: 700; margin-bottom: 6px; }
.dash-header__sub { color: var(--text-muted); font-size: 0.95rem; }
.dash-header__progress { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.dash-progress-ring { position: relative; width: 56px; height: 56px; }
.dash-progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-progress-ring__pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--brand);
}
.dash-progress-label { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; text-align: center; }

/* ── Section label ─────────────────────────────────────────────────────────── */
.dash-section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 14px;
}

/* ── Primary plan cards (2×2) ──────────────────────────────────────────────── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.plan-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  border-radius: 16px; padding: 24px;
  border: 2px solid transparent;
  transition: all 0.2s; position: relative;
  min-height: 200px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.plan-card:active { transform: translateY(0); }

/* Card colour themes */
.card-purple { background: linear-gradient(135deg, #f3f0ff 0%, #e8e3ff 100%); border-color: #d4cbff; }
.card-purple:hover { border-color: var(--brand); }
.card-sage   { background: linear-gradient(135deg, #f0faf4 0%, #e3f5eb 100%); border-color: #c5e8d0; }
.card-sage:hover   { border-color: #27ae60; }
.card-rose   { background: linear-gradient(135deg, #fff5f5 0%, #fde8e8 100%); border-color: #f5c0c0; }
.card-rose:hover   { border-color: #e74c3c; }
.card-slate  { background: linear-gradient(135deg, #f4f6f9 0%, #eaeef3 100%); border-color: #d0d8e4; }
.card-slate:hover  { border-color: #5d7a9e; }

/* Done state — lavender tint across all card colours */
.plan-card--done.card-purple { background: linear-gradient(135deg, #ede9fe, #ddd5fd); border-color: #a78bfa; }
.plan-card--done.card-sage   { background: linear-gradient(135deg, #ede9fe, #ddd5fd); border-color: #a78bfa; }
.plan-card--done.card-rose   { background: linear-gradient(135deg, #ede9fe, #ddd5fd); border-color: #a78bfa; }
.plan-card--done.card-slate  { background: linear-gradient(135deg, #ede9fe, #ddd5fd); border-color: #a78bfa; }

.plan-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.plan-card__icon { font-size: 2rem; line-height: 1; }

.plan-card__badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 10px; border-radius: 100px;
}
.plan-card__badge--done { background: #e8e0ff; color: #3d0099; }
.plan-card__badge--todo { background: #3d0099; color: #ffffff; }

/* Badge + mini ring stacked */
.plan-card__badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.plan-card__prog-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-card__mini-ring {
  flex-shrink: 0;
}
.plan-card__prog-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Label tints per card colour */
.card-purple .plan-card__prog-label { color: #5b21b6; }
.card-sage   .plan-card__prog-label { color: #166534; }
.card-rose   .plan-card__prog-label { color: #9f1239; }
.card-slate  .plan-card__prog-label { color: #1e3a5f; }

.plan-card__label { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.plan-card__desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

.plan-card__produces {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.07);
  font-size: 0.78rem;
}
.plan-card__produces-label { color: var(--text-muted); }
.plan-card__produces-val { font-weight: 600; color: var(--text); }

.plan-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 0.8rem;
}
.plan-card__time { color: var(--text-muted); }
.plan-card__cta { font-weight: 700; color: var(--brand); }
.plan-card--done .plan-card__cta { color: #3d0099; }

/* ── Segmented progress bar ─────────────────────────────────────────────── */
.seg-progress {
  margin-bottom: 20px;
}

.seg-progress__bar {
  display: flex;
  height: 14px;
  border-radius: 100px;
  overflow: hidden;
  gap: 3px;
  background: transparent;
}

.seg-progress__seg {
  flex: 1;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}
.seg-progress__seg--first { border-radius: 100px 0 0 100px; }
.seg-progress__seg--last  { border-radius: 0 100px 100px 0; }

.seg-progress__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.seg-progress__fill--done {
  opacity: 1;
}

.seg-progress__labels {
  display: flex;
  margin-top: 8px;
  gap: 0;
}

.seg-progress__label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 2px;
}

.seg-progress__label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.seg-progress__label-pct {
  font-weight: 700;
  margin-left: auto;
  padding-right: 4px;
}

/* ── Utility cards row (3-col) ─────────────────────────────────────────────── */
.util-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.util-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  background: white; border: 1.5px solid var(--border);
  border-radius: 14px; padding: 20px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.util-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.09); transform: translateY(-2px); }

.util-card--legacy:hover { border-color: #a78bfa; }
.util-card--ff:hover     { border-color: #60a5fa; }
.util-card--distribute:hover { border-color: #34d399; }

.util-card__icon { font-size: 1.6rem; margin-bottom: 10px; }
.util-card__label { font-size: 0.95rem; font-weight: 700; margin-bottom: 5px; }
.util-card__desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.util-card__cta { margin-top: 14px; font-size: 0.8rem; font-weight: 700; color: var(--brand); }

/* ── Output buttons ────────────────────────────────────────────────────────── */
.output-section { background: white; border: 1.5px solid var(--border); border-radius: 16px; padding: 28px; }
.output-section__label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand); font-weight: 700; margin-bottom: 6px;
}
.output-section__title { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; }

.output-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.output-doc-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border: 1.5px solid var(--border);
  border-radius: 12px; text-decoration: none; color: inherit;
  background: white; transition: all 0.15s; flex: 1; min-width: 200px;
  touch-action: manipulation;
}
.output-doc-btn:hover { border-color: var(--brand); background: var(--purple-100); }
.output-doc-btn--primary { border-color: var(--brand); background: var(--purple-100); }
.output-doc-btn__icon { font-size: 1.8rem; flex-shrink: 0; }
.output-doc-btn__title { font-size: 0.9rem; font-weight: 700; }
.output-doc-btn__sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .util-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .plan-grid { grid-template-columns: 1fr; }
  .util-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .dash-progress-ring { width: 48px; height: 48px; }
  .plan-card { min-height: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Storage / Drive Manager
   ═══════════════════════════════════════════════════════════════════════════ */

.storage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
}
.storage-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.storage-sub   { color: var(--text-muted); font-size: 0.9rem; max-width: 560px; }

.storage-section-label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 14px;
}

.storage-empty {
  text-align: center; padding: 60px 20px;
  background: var(--bg-off); border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
}
.storage-empty__icon  { font-size: 2.5rem; margin-bottom: 12px; }
.storage-empty__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.storage-empty__desc  { color: var(--text-muted); font-size: 0.9rem; }
.storage-hint { color: var(--text-muted); font-size: 0.87rem; padding: 12px 0; }

/* ── Drive Cards Grid ────────────────────────────────────────────────────── */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.drive-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.drive-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.drive-card--active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,40,217,0.1); }

.drive-card__top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.drive-card__icon   { font-size: 1.6rem; display: flex; align-items: center; }
.drive-card__actions { display: flex; gap: 6px; }
.drive-card__action {
  font-size: 0.72rem; padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: white; cursor: pointer;
  transition: background 0.15s;
}
.drive-card__action:hover { background: #f5f3ff; }
.drive-card__label    { font-size: 1rem; font-weight: 700; }
.drive-card__provider { font-size: 0.8rem; color: var(--text-muted); }
.drive-card__assoc    { font-size: 0.75rem; color: var(--brand); margin-top: 2px; }
.drive-card__tested   { font-size: 0.72rem; color: var(--text-muted); }
.drive-card__browse   { margin-top: 10px; font-size: 0.8rem; align-self: flex-start; }

/* ── Provider Selector Grid ──────────────────────────────────────────────── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.provider-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: white; cursor: pointer; transition: all 0.15s;
  font-size: 0.78rem; font-weight: 600; text-align: center;
}
.provider-tile:hover { border-color: var(--brand); background: #faf7ff; }
.provider-tile--active { border-color: var(--brand); background: #f3eeff; box-shadow: 0 0 0 3px rgba(109,40,217,0.15); }
.provider-tile__icon  { font-size: 1.5rem; display: flex; align-items: center; justify-content: center; height: 36px; }
.provider-tile__label { font-size: 0.72rem; line-height: 1.3; }

/* ── File Browser ─────────────────────────────────────────────────────────── */
.file-browser {
  background: white;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  margin-bottom: 32px;
}

.file-browser__header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: #f5f3ff;
  border-bottom: 1px solid var(--border);
}
.file-browser__title { font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.file-browser__search { max-width: 220px; flex: 1; }
.file-browser__close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; font-size: 1rem; color: var(--text-muted);
  padding: 4px 8px; border-radius: 50%;
}
.file-browser__close:hover { background: #ede9fe; color: var(--brand); }
.file-browser__loading { padding: 40px; text-align: center; color: var(--text-muted); }
.file-browser__empty   { padding: 40px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.file-browser__table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }

.files-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.files-th {
  padding: 10px 14px; text-align: left; font-size: 0.72rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); background: #fafafa;
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.files-th--active { color: var(--brand); }
.files-th:hover   { color: var(--brand); cursor: pointer; }
.files-tr:hover   { background: #faf7ff; }
.files-td { padding: 9px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.files-td--name   { max-width: 300px; word-break: break-all; }
.files-fname      { font-weight: 500; }
.files-action     { font-size: 0.78rem; color: var(--brand); font-weight: 600; text-decoration: none; }
.files-action:hover { text-decoration: underline; }

/* ── Storage Modal ─────────────────────────────────────────────────────────── */
.modal--storage { max-width: 560px; width: calc(100vw - 32px); max-height: 90vh; overflow-y: auto; }
.drive-modal__prov { font-size: 1rem; font-weight: 600; margin-bottom: 20px; color: var(--text-muted); }
.drive-modal__footer {
  display: flex; gap: 10px; align-items: center;
  padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--border);
}
.req { color: #e11d48; }

/* ═══════════════════════════════════════════════════════════════════════════
   Execution Packet — Attach Button, Pills, File Picker Modal
   ═══════════════════════════════════════════════════════════════════════════ */

/* Inline field row with attach button */
.packet-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.packet-field-row .form-input,
.packet-field-row .form-select { flex: 1; min-width: 0; }

.btn-attach {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--brand);
  background: white;
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-attach:hover { background: #f3eeff; }

/* Attachment pills */
.attach-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attach-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f3eeff; border: 1px solid #c4b5fd;
  border-radius: 100px; padding: 3px 10px 3px 8px;
  font-size: 0.75rem; max-width: 100%;
}
.attach-pill__name {
  color: var(--brand); font-weight: 600; text-decoration: none;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-pill__name:hover { text-decoration: underline; }
.attach-pill__drive { color: var(--text-muted); font-size: 0.68rem; }
.attach-pill__remove {
  background: none; border: none; cursor: pointer; color: #a78bfa;
  font-size: 1rem; line-height: 1; padding: 0 2px; flex-shrink: 0;
}
.attach-pill__remove:hover { color: #7c3aed; }

/* ── File Picker Modal ─────────────────────────────────────────────────────── */
.modal--file-picker {
  max-width: 680px;
  width: calc(100vw - 32px);
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fp-no-drives {
  text-align: center; padding: 40px 20px;
  background: #faf7ff; border-radius: var(--radius); margin: 16px 0;
}
.fp-no-drives p { color: var(--text-muted); margin-bottom: 16px; }

/* Drive tab bar */
.fp-drive-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.fp-drive-label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); padding-top: 6px; flex-shrink: 0; }
.fp-drive-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fp-drive-tab {
  font-size: 0.78rem; font-weight: 600; padding: 5px 12px;
  border-radius: 100px; border: 1.5px solid var(--border);
  background: white; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.fp-drive-tab:hover { border-color: var(--brand); background: #faf7ff; }
.fp-drive-tab--active { border-color: var(--brand); background: #f3eeff; color: var(--brand); }
.fp-default-badge {
  font-size: 0.62rem; background: var(--brand); color: white;
  padding: 1px 5px; border-radius: 100px; margin-left: 4px; vertical-align: middle;
}
.fp-manage-link {
  font-size: 0.75rem; color: var(--brand); font-weight: 600;
  text-decoration: none; padding: 5px 8px;
}
.fp-manage-link:hover { text-decoration: underline; }

/* Browse area */
.fp-browse-area {
  min-height: 120px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.fp-load-hint {
  display: flex; align-items: center; justify-content: center;
  padding: 32px; background: #fafafa;
}
.fp-empty {
  padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.9rem;
}
.fp-search-row { padding: 10px 12px; border-bottom: 1px solid var(--border); background: #fafafa; }
.fp-search { max-width: 260px; }
.fp-table-wrap { max-height: 260px; overflow-y: auto; }
.files-tr--selectable { cursor: default; }

/* Upload row */
.fp-upload-row {
  background: #fafafa;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.fp-upload-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.fp-upload-actions { display: flex; align-items: center; gap: 10px; }
.fp-upload-btn { cursor: pointer; }
.fp-upload-status { font-size: 0.8rem; color: var(--text-muted); }

/* ── Provider logos (official SVG from cdn.simpleicons.org) ─────────────────── */
.provider-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
/* Smaller in drive tabs inside file picker */
.fp-drive-tab .provider-logo { width: 16px; height: 16px; display: inline; vertical-align: middle; }
/* In provider selection tiles — larger */
.provider-tile .provider-logo { width: 36px; height: 36px; }
/* In the drive card header */
.drive-card__icon .provider-logo { width: 32px; height: 32px; }

/* ── Provider logo brand-colour tinting via CSS filter ──────────────────────
   simple-icons SVGs are black by default. These filters approximate the
   official brand colours using hue-rotate + saturate + brightness combos.   */

/* Amazon S3 — #FF9900 (warm orange) */
img.provider-logo[alt="S3"],
img.provider-logo[alt="Amazon S3"] {
  filter: invert(60%) sepia(90%) saturate(600%) hue-rotate(0deg) brightness(1.1);
}
/* Cloudflare — #F38020 (orange) */
img.provider-logo[alt="R2"],
img.provider-logo[alt="Cloudflare R2"] {
  filter: invert(58%) sepia(80%) saturate(500%) hue-rotate(5deg) brightness(1.05);
}
/* Dropbox — #0061FF (blue) */
img.provider-logo[alt="Dropbox"] {
  filter: invert(20%) sepia(100%) saturate(700%) hue-rotate(210deg) brightness(1.1);
}
/* Google Drive — multicolour; tint to Google blue #4285F4 */
img.provider-logo[alt="Google Drive"] {
  filter: invert(40%) sepia(80%) saturate(400%) hue-rotate(200deg) brightness(1.1);
}
/* Microsoft OneDrive — #0078D4 (blue) */
img.provider-logo[alt="OneDrive"] {
  filter: invert(25%) sepia(90%) saturate(600%) hue-rotate(195deg) brightness(1.1);
}
/* Box — #0061D5 (blue) */
img.provider-logo[alt="Box"] {
  filter: invert(22%) sepia(90%) saturate(600%) hue-rotate(210deg) brightness(1.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PERSONAL MESSAGES HUB — 5-tab layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hub container */
.pm-hub {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.pm-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  padding: 0 2px;
}
.pm-tabs::-webkit-scrollbar { display: none; }

.pm-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  border-radius: 6px 6px 0 0;
}
.pm-tab:hover { color: var(--text, #111); background: rgba(0,0,0,0.03); }
.pm-tab--active {
  color: var(--brand, #6c47ff);
  border-bottom-color: var(--brand, #6c47ff);
  font-weight: 600;
}
.pm-tab__icon { font-size: 1rem; }
.pm-tab__label { }

/* ── Tab body ──────────────────────────────────────────────────────────────── */
.pm-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

/* ── Section wrapper ──────────────────────────────────────────────────────── */
.pm-section { }
.pm-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pm-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0 0 4px;
}
.pm-section__desc {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
  max-width: 540px;
}

/* ── Panel toggle (My / For Me) ───────────────────────────────────────────── */
.pm-panel-toggle {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  margin-bottom: 20px;
}
.pm-ptab {
  padding: 8px 16px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pm-ptab:hover { color: var(--text, #111); }
.pm-ptab--active { color: var(--brand, #6c47ff); border-bottom-color: var(--brand, #6c47ff); font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.pm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--border, #e5e7eb);
  color: var(--text-muted, #6b7280);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
}
.pm-badge--lg {
  min-width: 28px;
  height: 26px;
  font-size: 0.82rem;
  background: var(--brand-light, #ede9fe);
  color: var(--brand, #6c47ff);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.pm-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted, #6b7280);
}
.pm-empty__icon { font-size: 2.5rem; margin-bottom: 12px; }
.pm-empty__title { font-size: 1rem; font-weight: 600; color: var(--text, #111); margin-bottom: 8px; }
.pm-empty p { font-size: 0.85rem; margin: 0 0 16px; }

/* ── Access code box ──────────────────────────────────────────────────────── */
.for-me-section { }
.access-code-box {
  background: linear-gradient(135deg, #ede9fe 0%, #f3eeff 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.access-code-box__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.access-code-box__code {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 800;
  color: #5b21b6;
  letter-spacing: .15em;
  margin-bottom: 10px;
}
.access-code-box__desc {
  font-size: 0.83rem;
  color: #6d28d9;
  margin: 0 0 14px;
}
.access-code-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.access-code-link-input {
  flex: 1;
  background: rgba(255,255,255,0.7);
  border-color: #c4b5fd;
  font-size: 0.8rem;
  color: #5b21b6;
}

/* ── Social link cards ────────────────────────────────────────────────────── */
.social-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-link-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .15s;
}
.social-link-card:hover { border-color: var(--brand, #6c47ff); }
.social-link-card__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.social-link-card__body { flex: 1; min-width: 0; }
.social-link-card__title { font-size: 0.9rem; font-weight: 600; margin-bottom: 3px; }
.social-link-card__meta { font-size: 0.78rem; color: var(--text-muted, #6b7280); margin-bottom: 4px; }
.social-link-card__url {
  font-size: 0.75rem;
  color: var(--brand, #6c47ff);
  text-decoration: none;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.social-link-card__url:hover { text-decoration: underline; }
.social-link-card__actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Platform tiles ───────────────────────────────────────────────────────── */
.platform-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.platform-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-width: 72px;
}
.platform-tile:hover { border-color: var(--brand, #6c47ff); background: #f5f3ff; }
.platform-tile--active {
  border-color: var(--brand, #6c47ff);
  background: #ede9fe;
}
.platform-tile__label { font-size: 0.72rem; font-weight: 500; color: var(--text, #111); white-space: nowrap; }

/* ── Coming soon banner ───────────────────────────────────────────────────── */
.pm-coming-soon-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fefce8;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #92400e;
}
.pm-coming-soon-banner__icon { font-size: 1.4rem; flex-shrink: 0; }
.pm-coming-soon-banner p { margin: 4px 0 0; color: #92400e; }
.pm-coming-soon-banner strong { color: #78350f; }

/* ── Unified inbox list ───────────────────────────────────────────────────── */
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  transition: background .1s;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: #fafafa; }
.inbox-source-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid;
  white-space: nowrap;
  letter-spacing: .03em;
}
.inbox-item__body { flex: 1; min-width: 0; }
.inbox-item__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item__preview {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.inbox-item__date {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}

/* ── Living message video chip ─────────────────────────────────────────────── */
.message-card__video-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(0,0,0,0.07);
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ── Responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pm-tab__label { display: none; }
  .pm-tab { padding: 10px 12px; }
  .pm-tab__icon { font-size: 1.2rem; }
  .access-code-link-row { flex-direction: column; }
  .platform-grid { gap: 6px; }
  .platform-tile { min-width: 60px; padding: 8px 10px; }
}

/* ── LinkedIn Paste Modal ─────────────────────────────────────────────────── */
#li-paste-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.li-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.li-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}
.li-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #eee;
}
.li-modal-logo {
  width: 28px;
  height: 28px;
  filter: invert(27%) sepia(90%) saturate(700%) hue-rotate(185deg);
}
.li-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  flex: 1;
}
.li-modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.li-modal-close:hover { background: #f0f0f0; color: #333; }

.li-modal-steps {
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.li-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.li-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand, #6b4fbb);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.li-step-text {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.5;
}
.li-step-text strong { color: #1a1a2e; }
.li-open-link {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 12px;
  background: #0A66C2;
  color: #fff !important;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.li-open-link:hover { background: #084e96; }
kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.78rem;
  font-family: monospace;
  background: #f3f3f3;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
}

.li-paste-area {
  margin: 4px 20px 0;
  width: calc(100% - 40px);
  height: 140px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #333;
  resize: vertical;
  box-sizing: border-box;
}
.li-paste-area:focus {
  outline: none;
  border-color: var(--brand, #6b4fbb);
  box-shadow: 0 0 0 3px rgba(107,79,187,0.12);
}

.li-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 20px;
}

/* ── LinkedIn PDF Upload Zone ─────────────────────────────────────────────── */
.li-upload-zone {
  margin: 6px 20px 0;
  border: 2px dashed #c8c0e0;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #faf9ff;
}
.li-upload-zone:hover,
.li-upload-zone--hover {
  border-color: var(--brand, #6b4fbb);
  background: #f3efff;
}
.li-upload-zone--selected {
  border-color: #4caf50;
  background: #f0fff0;
}
.li-upload-icon { font-size: 2rem; margin-bottom: 6px; }
.li-upload-label { font-size: 0.9rem; font-weight: 600; color: #333; }
.li-upload-sub { font-size: 0.78rem; color: #888; margin-top: 2px; }
.li-upload-filename {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4caf50;
}
.li-pdf-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #795548;
  line-height: 1.4;
}
.li-paste-fallback {
  margin: 10px 20px 0;
  font-size: 0.83rem;
}
.li-paste-fallback summary {
  cursor: pointer;
  color: #6b4fbb;
  font-weight: 500;
  padding: 6px 0;
}
.li-paste-fallback summary:hover { color: #4a30a0; }
.li-paste-fallback .li-paste-area {
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* ── Contact photo upload ─────────────────────────────────────────────── */
.ff-photo-row {
  display: flex; align-items: center; gap: 16px;
}
.ff-photo-thumb {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
  flex-shrink: 0;
}
.ff-photo-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--slate-100); border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.ff-photo-controls {
  display: flex; flex-direction: column; gap: 6px;
}
.ff-photo-status {
  font-size: 0.82rem; color: var(--text-muted);
}
