/* F&H Command - Dashboard Layout */

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(26, 21, 71, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-accent);
  padding: var(--space-5) var(--space-6);
}

.app-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: relative; /* anchor for absolute-positioned page title */
}

.page-title-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  white-space: nowrap;
  /* Maximum width = viewport minus brand block (~360px) and actions (~200px) plus padding */
  max-width: calc(100vw - 720px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-main {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-2xl);
  color: var(--accent-lavender);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  text-shadow: 0 0 24px rgba(184, 164, 232, 0.25);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  color: var(--text-primary);
}

.brand-tagline {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
}

.page-title-center {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--accent-lavender);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.session-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
}

/* ===== MAIN LAYOUT ===== */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.section-title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary-purple);
}

.section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.section-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ===== KPI TILE GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.kpi-tile {
  padding: var(--space-5) var(--space-4);
  border-left: 4px solid var(--primary-purple);
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  line-height: 1;
}

.kpi-delta {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.kpi-delta-positive { color: var(--success); }
.kpi-delta-negative { color: var(--danger); }

/* ===== HERO MRR METER (revenue section top) ===== */
.mrr-meter {
  padding: var(--space-8);
  text-align: center;
}

.mrr-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary-purple);
  margin-bottom: var(--space-3);
}

.mrr-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-hero);
  color: var(--text-primary);
  line-height: 1;
}

.mrr-target {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.mrr-progress {
  margin-top: var(--space-5);
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.mrr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-purple), var(--accent-lavender));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ===== EMPTY-STATE PLACEHOLDERS (Session 1 - sections show "Coming next session") ===== */
.placeholder {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-lg);
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(107, 79, 187, 0.15);
  border-radius: var(--radius-full);
  color: var(--primary-purple);
  font-size: 24px;
}

.placeholder-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.placeholder-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
}

/* ===== FOOTER ===== */
.app-footer {
  border-top: 1px solid var(--border-accent);
  padding: var(--space-6);
  margin-top: var(--space-12);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Simplified footer mark — see app-footer-mark below */
.app-footer-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ===== AUTH PAGE ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-lg);
}

.auth-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.pin-input-group {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-6);
}

.pin-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-family: var(--font-display);
  font-style: italic;
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.pin-input:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(107, 79, 187, 0.25);
  outline: none;
}

.pin-input.filled {
  border-color: var(--primary-purple);
}

.auth-error {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  min-height: 20px;
}

.auth-fallback {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
}

.auth-fallback button {
  color: var(--accent-lavender);
  text-decoration: underline;
  font-size: var(--text-sm);
}

.auth-fallback button:hover {
  color: var(--text-primary);
}

.biometric-prompt {
  padding: var(--space-8) var(--space-4);
}

.biometric-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  background: rgba(107, 79, 187, 0.15);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-purple);
  font-size: 40px;
}

.biometric-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

/* ===== BRIEFINGS SECTION ===== */
.briefings-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.briefings-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.category-chip:hover:not(.active) {
  border-color: var(--accent-lavender);
  color: var(--text-secondary);
  background: rgba(184, 164, 232, 0.06);
}

.category-chip.active {
  background: rgba(184, 164, 232, 0.12);
  border-color: var(--accent-lavender);
  color: var(--accent-lavender);
  box-shadow:
    0 0 0 1px var(--accent-lavender),
    0 0 16px rgba(184, 164, 232, 0.35),
    inset 0 0 12px rgba(184, 164, 232, 0.08);
}

.category-chip.active:hover {
  background: rgba(184, 164, 232, 0.18);
  box-shadow:
    0 0 0 1px var(--accent-lavender),
    0 0 20px rgba(184, 164, 232, 0.45),
    inset 0 0 12px rgba(184, 164, 232, 0.12);
}

.category-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.category-chip:hover:not(.active) .category-chip-dot {
  background: var(--text-secondary);
}

.category-chip.active .category-chip-dot {
  background: var(--accent-lavender);
  box-shadow: 0 0 8px var(--accent-lavender);
}

.briefings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.briefings-last-generated {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.briefings-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.briefing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.briefing-card:hover {
  border-color: var(--border-strong);
}

.briefing-card.starred {
  border-left: 4px solid var(--primary-purple);
}

.briefing-card-header {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-accent);
}

.briefing-card-header-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.briefing-card-timestamp {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.briefing-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.briefing-card-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(107, 79, 187, 0.15);
  color: var(--accent-lavender);
}

.briefing-card-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.icon-btn.active {
  color: var(--accent-lavender);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.briefing-card-body {
  padding: var(--space-5);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text-primary);
  max-height: 240px;
  overflow: hidden;
  position: relative;
  transition: max-height var(--transition-slow);
}

.briefing-card-body.expanded {
  max-height: none;
}

.briefing-card-body:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg-elevated));
  pointer-events: none;
}

.briefing-expand {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-card);
  border: none;
  border-top: 1px solid var(--border-accent);
  color: var(--accent-lavender);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.briefing-expand:hover {
  background: var(--bg-card-hover);
}

/* Markdown rendering inside briefing-card-body */
.briefing-card-body h1,
.briefing-card-body h2 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary-purple);
  margin: var(--space-5) 0 var(--space-2);
  line-height: var(--leading-tight);
}

.briefing-card-body h1:first-child,
.briefing-card-body h2:first-child,
.briefing-card-body h3:first-child {
  margin-top: 0;
}

.briefing-card-body h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin: var(--space-4) 0 var(--space-2);
  line-height: var(--leading-tight);
  font-weight: 400;
}

.briefing-card-body h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-3) 0 var(--space-2);
}

.briefing-card-body p {
  margin: var(--space-3) 0;
  color: var(--text-primary);
}

.briefing-card-body ul,
.briefing-card-body ol {
  margin: var(--space-3) 0;
  padding-left: var(--space-6);
}

.briefing-card-body li {
  margin: var(--space-2) 0;
}

.briefing-card-body a {
  color: var(--accent-lavender);
  text-decoration: underline;
  text-decoration-color: rgba(184, 164, 232, 0.4);
  text-underline-offset: 2px;
}

.briefing-card-body a:hover {
  text-decoration-color: var(--accent-lavender);
}

.briefing-card-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--accent-lavender);
}

.briefing-card-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.briefing-card-body em {
  font-style: italic;
  color: var(--text-secondary);
}

.briefing-card-body blockquote {
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--primary-purple);
  color: var(--text-secondary);
  font-style: italic;
}

.briefing-card-body hr {
  border: none;
  border-top: 1px solid var(--border-accent);
  margin: var(--space-5) 0;
}

.briefing-sources {
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border-top: 1px solid var(--border-accent);
  font-size: var(--text-xs);
}

.briefing-sources-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  cursor: pointer;
  padding: 0;
}

.briefing-sources-toggle:hover {
  color: var(--text-primary);
}

.briefing-sources-list {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.briefing-source-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.briefing-source-item a {
  color: var(--accent-lavender);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.briefing-source-item a:hover {
  text-decoration: underline;
}

/* Generation status banner (shown during in-flight briefing generation) */
.briefing-generating {
  background: var(--bg-elevated);
  border: 1px solid var(--primary-purple);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 79, 187, 0.2); }
  50% { box-shadow: 0 0 24px 4px rgba(107, 79, 187, 0.25); }
}

.briefing-generating-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.briefing-generating-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--text-primary);
}

.briefing-generating-step {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Pending briefing card (background generation in flight).
   Wraps the .briefing-generating banner so it sits in the feed in the same
   position as the eventual completed card. */
.briefing-pending-card {
  margin-bottom: var(--space-4);
}

.briefing-pending-card .briefing-generating {
  margin-bottom: 0;
}

/* Failed briefing card. Reuses .briefing-card-* sub-styles but with a
   danger-tinted border to make the failure obvious. */
.briefing-failed-card {
  background: var(--bg-elevated);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  opacity: 0.92;
}

.briefing-failed-card .briefing-card-header {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-accent);
}

.briefing-failed-card .briefing-card-header-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.briefing-failed-card .briefing-card-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.briefing-failed-card .briefing-card-body {
  padding: var(--space-4) var(--space-5);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ===== END BRIEFINGS ===== */

/* RESPONSIVE - hide centered title whenever overlap is realistic */
@media (max-width: 1399px) {
  .page-title-main {
    font-size: var(--text-xl);
  }
  .brand-tagline {
    display: none;
  }
}

@media (max-width: 1199px) {
  /* Hide centered title - no realistic space for it here */
  .page-title-center {
    display: none;
  }
  /* Restore tagline when title is hidden */
  .brand-tagline {
    display: block;
  }
}

@media (max-width: 1023px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  /* ===== HEADER ===== */
  .app-header {
    padding: var(--space-3) var(--space-4);
  }
  .app-header-inner {
    gap: var(--space-2);
  }
  .brand {
    gap: var(--space-2);
    min-width: 0;
    flex: 1;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .brand-name {
    font-size: var(--text-sm);
  }
  .brand-tagline {
    display: none;
  }
  .page-title-center {
    display: none;
  }
  .header-actions {
    gap: var(--space-2);
    flex-shrink: 0;
  }
  .session-indicator {
    font-size: 10px;
  }
  /* On phone, Sign Out button compresses to small ghost button */
  #logout-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  /* ===== MAIN LAYOUT ===== */
  .app-main {
    padding: var(--space-4) var(--space-4);
    gap: var(--space-6);
  }
  .section {
    gap: var(--space-3);
  }
  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3);
  }
  .section-title-group {
    gap: 2px;
  }
  .section-title {
    font-size: var(--text-xl);
  }
  .section-eyebrow {
    font-size: 10px;
  }
  .section-actions {
    width: 100%;
  }

  /* ===== KPI / REVENUE ===== */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .kpi-tile {
    padding: var(--space-4) var(--space-4);
  }
  .mrr-meter {
    padding: var(--space-6) var(--space-4);
  }
  .mrr-value {
    font-size: var(--text-3xl);
  }
  .mrr-target {
    font-size: var(--text-xs);
  }

  /* ===== CARDS ===== */
  .card {
    padding: var(--space-4);
  }

  /* ===== BRIEFINGS - CONTROLS ===== */
  .briefings-controls {
    gap: var(--space-3);
  }
  .briefings-categories {
    gap: var(--space-2);
  }
  .category-chip {
    padding: var(--space-2) var(--space-3);
    font-size: 10px;
  }
  .briefings-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  #generate-briefing-btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-4);
    font-size: var(--text-base);
  }
  .briefings-last-generated {
    text-align: center;
  }

  /* ===== BRIEFINGS - CARDS ===== */
  .briefing-card-header {
    padding: var(--space-3) var(--space-4);
    flex-wrap: wrap;
  }
  .briefing-card-timestamp {
    font-size: var(--text-base);
  }
  .briefing-card-categories {
    gap: 4px;
  }
  .briefing-card-cat {
    font-size: 9px;
    padding: 1px 6px;
  }
  .briefing-card-actions {
    gap: 2px;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .icon-btn svg {
    width: 20px;
    height: 20px;
  }
  .briefing-card-body {
    padding: var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.65;
    max-height: 200px;
  }
  .briefing-card-body h1,
  .briefing-card-body h2 {
    font-size: 10px;
    margin: var(--space-4) 0 var(--space-2);
  }
  .briefing-card-body h3 {
    font-size: var(--text-base);
    margin: var(--space-3) 0 var(--space-2);
  }
  .briefing-card-body p {
    margin: var(--space-2) 0;
  }
  .briefing-card-body ul,
  .briefing-card-body ol {
    padding-left: var(--space-5);
  }
  .briefing-sources {
    padding: var(--space-3) var(--space-4);
  }
  .briefing-source-item {
    font-size: 11px;
  }
  .briefing-generating {
    padding: var(--space-4);
    gap: var(--space-3);
  }

  /* ===== AUTH PAGE ===== */
  .auth-card {
    padding: var(--space-6) var(--space-4);
  }
  .auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-4);
  }
  .auth-title {
    font-size: var(--text-xl);
  }
  .pin-input-group {
    gap: var(--space-1);
  }
  .pin-input {
    width: 44px;
    height: 52px;
    font-size: var(--text-lg);
  }

  /* ===== PLACEHOLDERS ===== */
  .placeholder {
    padding: var(--space-8) var(--space-4);
  }
  .placeholder-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .placeholder-title {
    font-size: var(--text-base);
  }
  .placeholder-desc {
    font-size: var(--text-xs);
  }

  /* ===== EMPTY STATES ===== */
  .empty-state {
    padding: var(--space-8) var(--space-4);
  }

  /* ===== FOOTER ===== */
  .app-footer {
    padding: var(--space-4);
    margin-top: var(--space-8);
  }

  /* ===== MODALS (for Sessions 2/4) ===== */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .modal-header {
    padding: var(--space-4);
  }
  .modal-body {
    padding: var(--space-4);
  }
  .modal-footer {
    padding: var(--space-3) var(--space-4);
  }

  /* ===== TOASTS - bottom centered on mobile ===== */
  .toast-container {
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

/* Extra narrow phones (< 360px) */
@media (max-width: 359px) {
  .app-header-inner {
    gap: var(--space-1);
  }
  .brand-name {
    font-size: var(--text-xs);
  }
  .session-indicator {
    display: none;
  }
  .pin-input {
    width: 38px;
    height: 48px;
  }
}

/* ===================================================================== */
/* SESSION 2 - REVENUE + ENGAGEMENTS                                     */
/* ===================================================================== */

/* ----- Common: section actions row ----- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
}
.section-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ===== ENGAGEMENTS: filters ===== */
.engagement-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md, 8px);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-base);
}
.filter-chip:hover {
  border-color: var(--primary-purple);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--bg-card);
  border-color: var(--accent-lavender);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--accent-lavender);
}
.filter-chip-count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  background: var(--bg-base);
  border-radius: 10px;
  font-size: 10px;
  text-align: center;
  line-height: 18px;
  color: var(--text-primary);
}
.filter-chip.active .filter-chip-count {
  background: var(--accent-lavender);
  color: var(--bg-base);
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-toggle input { accent-color: var(--primary-purple); }

/* ===== STAGE PILLS ===== */
.stage-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-accent);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
}
.stage-pill.stage-lead        { color: #B8A4E8; border-color: #4F3D8E; background: rgba(107, 79, 187, 0.12); }
.stage-pill.stage-qualified   { color: #93C5FD; border-color: #2C4970; background: rgba(59, 130, 246, 0.12); }
.stage-pill.stage-proposal    { color: #FBBF24; border-color: #715620; background: rgba(251, 191, 36, 0.12); }
.stage-pill.stage-negotiating { color: #F59E0B; border-color: #6E4A12; background: rgba(245, 158, 11, 0.16); }
.stage-pill.stage-won         { color: #4ADE80; border-color: #226039; background: rgba(74, 222, 128, 0.16); }
.stage-pill.stage-lost        { color: #F87171; border-color: #6E2D2D; background: rgba(248, 113, 113, 0.12); }

/* ===== ENGAGEMENTS: table (desktop) ===== */
.engagement-table {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}
.engagement-table table {
  width: 100%;
  border-collapse: collapse;
}
.engagement-table thead {
  background: var(--bg-card);
}
.engagement-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-accent);
}
.engagement-table th.num, .engagement-table td.num {
  text-align: right;
}
.engagement-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-base);
  border-bottom: 1px solid var(--border-accent);
}
.engagement-table tbody tr:last-child { border-bottom: none; }
.engagement-table tbody tr:hover { background: var(--bg-card); }
.engagement-table tbody tr.paused { opacity: 0.55; }
.engagement-table td {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  vertical-align: top;
}
.engagement-client {
  font-weight: 600;
  margin-bottom: 2px;
}
.engagement-contact {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.paused-tag {
  display: inline-block;
  padding: 0 6px;
  margin-left: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.row-actions { width: 60px; text-align: right; }

.next-action {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-xs);
}
.next-action-date {
  font-weight: 600;
  color: var(--text-primary);
}
.next-action-text {
  color: var(--text-secondary);
}
.next-action.overdue .next-action-date {
  color: var(--danger);
}

/* ===== ENGAGEMENTS: cards (mobile) — hidden on desktop ===== */
.engagement-cards { display: none; }
.engagement-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  cursor: pointer;
}
.engagement-card.paused { opacity: 0.55; }
.engagement-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.engagement-card-client {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
}
.engagement-card-contact {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.engagement-card-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.engagement-card-values .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.engagement-card-next {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.engagement-card-actions {
  display: flex;
  justify-content: flex-end;
}

/* ===== MODAL (shared for engagement + revenue line forms) ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 46, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-5);
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  margin: var(--space-5) auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease-out;
}
body.modal-open { overflow: hidden; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-accent);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin: 0;
}
.modal-body {
  padding: var(--space-5);
}
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-accent);
}
.modal-footer-right {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ===== FORM GRID (used inside modals) ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row.span-2 { grid-column: 1 / -1; }
.form-row.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.form-row.checkbox-row input { accent-color: var(--primary-purple); }
.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.required { color: var(--danger); }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
  background: var(--bg-base);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-family: var(--font-body, inherit);
  font-size: var(--text-sm);
  transition: border-color var(--transition-base);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(107, 79, 187, 0.18);
}
.form-row textarea {
  resize: vertical;
  font-family: var(--font-body, inherit);
}

/* ===== TRANSITION PANEL (inside engagement modal) ===== */
.transition-panel {
  margin: 0 0 var(--space-5) 0;
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md, 8px);
}
.transition-panel-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.transition-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.transition-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.transition-btn:hover { border-color: var(--accent-lavender); }
.transition-btn.stage-won  { border-color: #4ADE80; color: #4ADE80; }
.transition-btn.stage-lost { border-color: #F87171; color: #F87171; }

/* Danger-variant button (modal delete) */
.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger-ghost:hover {
  background: rgba(248, 113, 113, 0.08);
}

/* ===== REVENUE: meter (expanded version) ===== */
.mrr-meter-wrap { margin-bottom: var(--space-4); }
.mrr-meter-skeleton {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.mrr-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.mrr-delta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mrr-delta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.mrr-delta-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 600;
}
.mrr-delta.positive .mrr-delta-value { color: var(--success); }
.mrr-delta.negative .mrr-delta-value { color: var(--danger); }
.mrr-delta.neutral  .mrr-delta-value { color: var(--text-secondary); }
.mrr-progress {
  position: relative;
  height: 10px;
  background: var(--bg-base);
  border-radius: 5px;
  overflow: hidden;
}
.mrr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-purple), var(--accent-lavender));
  border-radius: 5px;
  transition: width 0.6s ease-out;
}
.mrr-progress-label {
  position: absolute;
  right: var(--space-2);
  top: -22px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== REVENUE: composition tiles ===== */
.composition-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.composition-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.composition-tile-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.composition-tile-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.composition-tile-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ===== REVENUE: trend chart ===== */
.trend-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.trend-header { margin-bottom: var(--space-3); }
.trend-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin: 0;
}
.trend-chart {
  width: 100%;
  overflow-x: auto;
}
.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.trend-bar {
  fill: var(--primary-purple);
  transition: fill var(--transition-base);
}
.trend-bar:hover { fill: var(--accent-lavender); }
.trend-bar.current { fill: var(--accent-lavender); }
.trend-bar-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-body, sans-serif);
}
.trend-y-label {
  fill: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-body, sans-serif);
}
.trend-gridline {
  stroke: var(--border-accent);
  stroke-width: 1;
  stroke-dasharray: 2, 4;
}
.trend-target-line {
  stroke: var(--accent-lavender);
  stroke-width: 1.5;
  stroke-dasharray: 6, 4;
}
.trend-target-label {
  fill: var(--accent-lavender);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body, sans-serif);
}

/* ===== REVENUE: lines table ===== */
.revenue-lines-section {
  margin-top: var(--space-5);
}
.revenue-lines-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.revenue-lines-list { margin-top: var(--space-2); }
.revenue-lines-table {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-collapse: collapse;
}
.revenue-lines-table thead { background: var(--bg-card); }
.revenue-lines-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-accent);
}
.revenue-lines-table th.num { text-align: right; }
.revenue-lines-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--border-accent);
  transition: background var(--transition-base);
}
.revenue-lines-table tbody tr:last-child { border-bottom: none; }
.revenue-lines-table tbody tr:hover { background: var(--bg-card); }
.revenue-lines-table tbody tr.inactive { opacity: 0.55; }
.revenue-lines-table td {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  vertical-align: middle;
}
.revenue-lines-table td.num { text-align: right; }
.category-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.date-range {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ===== RESPONSIVE: switch table -> cards on small screens ===== */
@media (max-width: 768px) {
  .engagement-table { display: none; }
  .engagement-cards { display: block; }

  .composition-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-row.span-2 { grid-column: 1; }

  .mrr-meter-top {
    flex-direction: column;
    align-items: stretch;
  }
  .mrr-delta { text-align: left; }

  .revenue-lines-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .revenue-lines-table thead { display: none; }
  .revenue-lines-table, .revenue-lines-table tbody,
  .revenue-lines-table tr, .revenue-lines-table td {
    display: block;
    width: 100%;
  }
  .revenue-lines-table tr {
    padding: var(--space-3) var(--space-4);
  }
  .revenue-lines-table td {
    padding: 4px 0;
    border-bottom: none;
  }
  .revenue-lines-table td.num { text-align: left; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== END SESSION 2 ===== */

.section-loading {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ===================================================================== */
/* BRIEFINGS — pinned / recent / archive sections                        */
/* ===================================================================== */

.briefings-section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-accent);
}
.briefings-section-header:first-child { margin-top: var(--space-2); }
.briefings-section-label {
  font-family: var(--font-display, serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
}
.briefings-section-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Pinned briefings get a subtle purple left-edge accent to differentiate
   them from Recent. Reuses the existing .briefing-card.starred treatment. */
/* (No new rule needed — .briefing-card.starred already has border-left from
   the original briefings CSS.) */

/* ===== ARCHIVE ===== */
.briefings-archive {
  margin-top: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.briefings-archive-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: inherit;
  text-align: left;
  transition: background var(--transition-base);
}
.briefings-archive-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.briefings-archive-chevron {
  display: inline-flex;
  width: 20px;
  justify-content: center;
  color: var(--accent-lavender);
  font-size: var(--text-md);
}

.briefings-archive.expanded .briefings-archive-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-accent);
}

.briefings-archive-row {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-accent);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  transition: background var(--transition-base);
}
.briefings-archive-row:last-child { border-bottom: none; }
.briefings-archive-row:hover { background: var(--bg-card); }

.briefings-archive-stamp {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-xs);
}
.briefings-archive-day {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lavender);
}
.briefings-archive-date {
  color: var(--text-primary);
  font-weight: 600;
}
.briefings-archive-time {
  color: var(--text-secondary);
}
.briefings-archive-cats {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.briefings-archive-purge {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-accent);
  background: var(--bg-card);
  display: flex;
  justify-content: flex-end;
}
.btn-purge-armed {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: white;
  animation: pulseDanger 1.2s ease-in-out infinite;
}
@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
}

/* ===== ARCHIVED-BRIEFING READ-ONLY MODAL ===== */
/* Wider modal so the briefing content has room */
.modal.modal-wide {
  max-width: 880px;
}
.modal-header-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}
.modal-header-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.modal-footer-sources {
  flex-direction: column;
  align-items: stretch;
  border-top: 1px solid var(--border-accent);
}
.briefing-sources-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ===== MOBILE TWEAKS FOR ARCHIVE ===== */
@media (max-width: 600px) {
  .briefings-archive-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .briefings-archive-cats {
    white-space: normal;
  }
  .briefings-archive-stamp {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
  }
}
