/* ── Morning Brief — daily premium popup + archive viewer ───────────────────── */

.mb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.mb-overlay.open {
  display: flex;
  animation: mb-fade-in 0.28s ease;
}

@keyframes mb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mb-modal {
  width: 100%;
  max-width: 640px;
  max-height: min(82vh, 760px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mb-rise-in 0.32s cubic-bezier(0.34,1.2,0.64,1);
}

@keyframes mb-rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.mb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.mb-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mb-brand-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
}

.mb-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.mb-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Hero */
.mb-hero {
  padding: 1.4rem 1.5rem 1.1rem;
  background: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mb-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.25;
}

.mb-hero-date {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Body */
.mb-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.mb-body::-webkit-scrollbar { width: 5px; }
.mb-body::-webkit-scrollbar-track { background: transparent; }
.mb-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.mb-loading {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Markdown content */
.mb-body h2 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 1.5rem 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.mb-body h2:first-child { margin-top: 0; }
.mb-body h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.1rem 0 0.4rem;
}
.mb-body p { margin: 0 0 0.7rem; font-size: 0.85rem; line-height: 1.65; color: var(--text-secondary); }
.mb-body ul, .mb-body ol { margin: 0 0 0.7rem; padding-left: 1.2rem; }
.mb-body li { margin: 0.25rem 0; font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); }
.mb-body strong { color: var(--text-primary); font-weight: 700; }
.mb-body em { font-style: italic; }
.mb-body a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.mb-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.mb-body code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.78rem;
  background: var(--bg-tertiary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text-primary);
}

/* Empty state — no brief yet today */
.mb-empty-state {
  min-height: 100%;
  padding: 2.5rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mb-empty-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.mb-generate-btn {
  background: #000000;
  border: none;
  border-radius: 2px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.mb-generate-btn:hover { background: #000000; opacity: 0.85; }
.mb-generate-btn:disabled { opacity: 0.65; cursor: default; }

.mb-countdown {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Welcome banner — first brief after upgrading to Premium */
.mb-welcome-banner {
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Watchlist empty prompt */
.mb-watchlist-empty {
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Inline email opt-in prompt */
.mb-email-prompt {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.5rem;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.mb-email-prompt.mb-email-prompt-fadeout { opacity: 0; }

.mb-email-prompt-text { flex: 1; min-width: 0; }

.mb-email-prompt-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.mb-email-prompt-sub {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mb-email-prompt-btn {
  background: #000000;
  border: none;
  border-radius: 2px;
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.mb-email-prompt-btn:hover { background: #000000; opacity: 0.85; }
.mb-email-prompt-btn:disabled { opacity: 0.65; cursor: default; }

.mb-email-prompt-confirm {
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--positive);
}

@media (max-width: 640px) {
  .mb-email-prompt { flex-wrap: wrap; padding: 0.85rem 1.1rem; }
  .mb-email-prompt-btn { flex: 1 0 100%; text-align: center; }
}

/* Footer */
.mb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.mb-archive-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.mb-archive-link:hover { color: var(--navy); }

.mb-gotit-btn {
  background: #000000;
  border: none;
  border-radius: 2px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.62rem 1.6rem;
  cursor: pointer;
  transition: background 0.15s;
}

.mb-gotit-btn:hover { background: #000000; opacity: 0.85; }

/* Pin toggle — Week Ahead brief only. Outlined, not filled, so it doesn't
   compete with the primary black "Got it" action. */
.mb-pin-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.mb-pin-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.mb-pin-btn.pinned { border-color: #000000; color: #000000; font-weight: 700; }

/* Archive list — used inside Account Settings */
.mb-list-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1rem 0;
}

.mb-list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}

.mb-list-row:hover { background: var(--bg-tertiary); }
.mb-list-row:last-child { border-bottom: none; }

.mb-list-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.mb-list-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.mb-list-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mb-list-pin {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0 0.1rem;
  line-height: 1;
  transition: color 0.15s;
}
.mb-list-pin:hover { color: var(--text-primary); }
.mb-list-pin.pinned { color: #000000; }

.mb-list-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.1rem 0.35rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 768px) {
  .mb-overlay { padding: 0; }
  .mb-modal {
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .mb-hero-title { font-size: 1.15rem; }
  .mb-footer { flex-wrap: wrap; }
  .mb-gotit-btn { flex: 1; text-align: center; }
}
