* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Mobile-first: touch-friendly, prevent zoom on input focus (iOS) */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(14, 165, 233, 0.2);
}

/* Remove 300ms tap delay on mobile */
button, a, [role="button"], select, input, .btn {
  touch-action: manipulation;
}

:root {
  --bg: #0f0f12;
  --bg-elevated: #18181c;
  --bg-card: #1e1e24;
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.9);
  --accent: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.12);
  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.15);
  --warning: #eab308;
  --error: #ef4444;
  --error-dim: rgba(239, 68, 68, 0.15);
  --radius: 0;
  --radius-sm: 0;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  justify-self: center;
}

.logo-video {
  height: 48px;
  width: auto;
  display: block;
  opacity: 0.9;
}

.logo img {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.9;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-ask {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  background: #ffffff;
  color: #0f0f12;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.btn-ask:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.88);
}

.header input[type="text"] {
  font-family: inherit;
  font-size: 16px; /* Prevents iOS zoom on focus */
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  width: 140px;
  transition: border-color 0.15s;
}

.header input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.header input[type="text"]::placeholder {
  color: var(--text-muted);
}

.header select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  min-height: 44px; /* Touch target */
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: #0284c7;
  border-color: #0284c7;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header-dropdown {
  position: relative;
}

.header-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 160px;
  padding: 0.25rem;
}

.header-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.header-dropdown-item:hover {
  background: var(--bg-elevated);
}

.header-dropdown-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header-dropdown-item.refresh-btn {
  color: var(--error);
}

.header-dropdown-item.refresh-btn:hover {
  background: var(--error-dim);
}

/* Main */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}


/* Insights page notice */
.insights-page-header .insights-page-notice {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Insights single box with tabs */
.insights-single-box {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.insights-single-box .activity-tabs-wrap {
  margin-top: 0;
}

.insights-single-box .activity-tabs {
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.insights-single-box .activity-tab-panels {
  padding: 0;
}

.insights-single-box .activity-tab-panel {
  padding: 2rem;
}

.insight-tab-panel-content {
  max-width: 100%;
}

.insights-tabs-row .insight-tab {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.insights-tabs-row .insight-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.insights-tabs-row .insight-tab.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.insights-tabs-row .insight-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.clusters-view-toggle .clusters-view-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.clusters-view-toggle .clusters-view-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.clusters-view-toggle .clusters-view-btn.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.clusters-view-toggle .clusters-view-btn.active,
.taxonomy-sort-btn.active,
.leverage-view-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.insight-panel-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
}

.insights-single-box .leverage-theme-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.insights-single-box .ai-insights-sections {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Insight hero */
.insight-hero {
  background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(14, 165, 233, 0.05) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.insight-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(255, 255, 255, 0.18);
}

.insight-hero h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.baseline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.baseline-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.baseline-card.highlight {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

.baseline-card.highlight {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.baseline-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.baseline-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Sections */
.metrics-section,
.charts-section,
.tweets-section {
  margin-bottom: 2.5rem;
}

.metrics-section h2,
.charts-section h2,
.tweets-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

/* Activity tabs (Media activity / AI insights) */
.activity-tabs-wrap {
  margin-top: 2rem;
}

.activity-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.activity-tab {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.activity-tab:hover {
  color: var(--text);
}

.activity-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.activity-tab-panels {
  position: relative;
}

.activity-tab-panel {
  display: none;
  padding-top: 1.5rem;
}

.activity-tab-panel.active {
  display: block;
}

.ai-insights-section {
  margin-top: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
}

.ai-insights-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-insights-panel-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

.ai-insights-content {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

.ai-insights-placeholder {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  font-size: 1.05rem;
}

.ai-insights-summary {
  margin: 0 0 1.5rem 0;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--accent);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.5;
}

.ai-insights-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ai-insights-section-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}

.ai-insights-section-block.section-block--positive {
  border-left: 3px solid var(--success);
  background: rgba(34, 197, 94, 0.06);
}

.ai-insights-section-block.section-block--negative {
  border-left: 3px solid rgba(239, 68, 68, 0.8);
  background: rgba(239, 68, 68, 0.05);
}

.ai-insights-section-block.section-block--accent {
  border-left: 3px solid var(--accent);
  background: rgba(14, 165, 233, 0.06);
}

.ai-insights-section-block.section-block--accent {
  background: rgba(255, 255, 255, 0.05);
}

.ai-insights-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.section-block--positive .ai-insights-section-title { color: var(--success); border-bottom-color: rgba(34, 197, 94, 0.3); }
.section-block--negative .ai-insights-section-title { color: #f87171; border-bottom-color: rgba(239, 68, 68, 0.3); }
.section-block--accent .ai-insights-section-title { border-bottom-color: rgba(14, 165, 233, 0.3); }

.ai-insights-list {
  margin: 0;
  padding-left: 1.25rem;
}

.ai-insights-list li {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.insight-num {
  font-weight: 700;
  color: var(--text);
}

.ai-insights-error {
  color: var(--error);
  margin: 0;
  font-size: 1.05rem;
}

/* Single-column layout for narrow viewports */
@media (max-width: 640px) {
  .ai-insights-sections {
    grid-template-columns: 1fr;
  }
}

/* Analytics header (X-style) */
.analytics-header {
  margin-bottom: 2rem;
}

.account-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.account-overview-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.account-overview-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.last-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.time-range-filters {
  display: flex;
  gap: 0.25rem;
}

.time-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.time-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.time-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Custom range picker */
.custom-range-anchor {
  position: relative;
}

.custom-range-trigger {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
}

.custom-range-trigger.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.custom-range-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 1rem;
  min-width: 280px;
}

.custom-range-popover-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.custom-range-input {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  width: 100%;
  cursor: pointer;
}

.custom-range-input:focus {
  outline: none;
  border-color: var(--accent);
}

.custom-range-input::placeholder {
  color: var(--text-muted);
}

.custom-range-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.custom-range-actions .btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.custom-range-actions .btn-primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}

/* Flatpickr calendar - match site dark aesthetic */
.flatpickr-calendar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
.flatpickr-calendar.arrowTop:before { border-bottom-color: var(--border) !important; }
.flatpickr-calendar.arrowTop:after { border-bottom-color: var(--bg-card) !important; }
.flatpickr-calendar.arrowBottom:before { border-top-color: var(--border) !important; }
.flatpickr-calendar.arrowBottom:after { border-top-color: var(--bg-card) !important; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: var(--text) !important;
  fill: var(--text) !important;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--accent) !important;
}
span.flatpickr-weekday {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
}
.dayContainer + .dayContainer {
  box-shadow: -1px 0 0 var(--border) !important;
}
.flatpickr-day {
  color: var(--text) !important;
}
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
}
.flatpickr-day.today {
  border-color: var(--accent) !important;
}
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
  box-shadow: -10px 0 0 var(--accent) !important;
}
.flatpickr-day.inRange {
  box-shadow: -5px 0 0 var(--bg-elevated), 5px 0 0 var(--bg-elevated) !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-muted) !important;
  opacity: 0.5;
}
.flatpickr-day.week.selected {
  box-shadow: -5px 0 0 var(--accent), 5px 0 0 var(--accent) !important;
}
.flatpickr-calendar.hasTime .flatpickr-time {
  border-top-color: var(--border) !important;
}
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  color: var(--text) !important;
}
.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover {
  background: var(--bg-elevated) !important;
}
.flatpickr-weekwrapper .flatpickr-weeks {
  box-shadow: 1px 0 0 var(--border) !important;
}

/* Chart hero */
.chart-section {
  margin-bottom: 2rem;
}

.chart-card-hero {
  padding: 1.5rem;
}

.chart-container-hero {
  height: 280px;
  cursor: pointer;
}

.chart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-metric-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

/* KPI grid (8 cards) */
.kpi-grid-section {
  margin-bottom: 2.5rem;
}

.kpi-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.kpi-change {
  font-size: 0.8rem;
  font-weight: 500;
}

.kpi-change.up {
  color: var(--success);
}

.kpi-change.down {
  color: #f87171;
}

.kpi-change.muted {
  color: var(--text-muted);
}

.kpi-math {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.3;
}

.group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

/* Baseline reference */
.baseline-reference {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
}

.baseline-reference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

/* Caption patterns */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.pattern-grid-days {
  grid-template-columns: repeat(7, 1fr);
}

@media (max-width: 600px) {
  .pattern-grid-days {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pattern-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pattern-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.pattern-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pattern-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pattern-delta {
  font-size: 0.75rem;
  font-weight: 500;
}

.pattern-delta.up {
  color: var(--success);
}

.pattern-delta.down {
  color: #f87171;
}

.pattern-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.pattern-row:last-child {
  border-bottom: none;
}

.pattern-row .pattern-label {
  min-width: 80px;
}

/* AI caption brain */
.ai-caption-brain {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(14, 165, 233, 0.02) 100%);
  border-color: rgba(14, 165, 233, 0.25);
}

.ai-caption-brain {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(255, 255, 255, 0.16);
}

.ai-executive-summary {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.ai-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ai-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ai-block-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ai-block ul {
  margin: 0;
  padding-left: 1.25rem;
}

.ai-block li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.ai-non-obvious {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

.ai-non-obvious .ai-block-label {
  color: var(--warning);
}

.baseline-ref-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.baseline-ref-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.baseline-ref-value {
  font-size: 1rem;
  font-weight: 600;
}

/* Intelligence Layer */
.intelligence-layer {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.intelligence-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.intel-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.intel-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intel-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.intel-value.momentum-up { color: var(--success); }
.intel-value.momentum-down { color: #f87171; }
.intel-value.momentum-flat { color: var(--text-muted); }
.intel-value.volatility-high { color: var(--warning); }
.intel-value.volatility-medium { color: var(--accent); }
.intel-value.volatility-low { color: var(--success); }

/* Overview cards */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-group .overview-grid {
  margin-bottom: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.info-btn:hover,
.info-btn:focus {
  color: var(--accent);
  background: var(--accent-dim);
  outline: none;
}

.info-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 280px;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: normal;
  word-wrap: break-word;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
}

.info-btn:hover::after,
.info-btn:focus::after {
  opacity: 1;
  visibility: visible;
}

.intel-label .info-btn {
  margin-left: 0.2rem;
  vertical-align: middle;
}

.why-btn {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  margin-left: 0.5rem;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  transition: color 0.15s, background 0.15s;
}

.why-btn:hover:not(:disabled),
.why-btn:focus:not(:disabled) {
  color: var(--accent);
  background: var(--accent-dim);
  outline: none;
}

.theme-title-link,
.why-popover-link,
.leverage-example-link {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.theme-title-link:hover,
.why-popover-link:hover,
.leverage-example-link:hover {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.why-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.theme-cell-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.theme-title-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(14, 165, 233, 0.4);
  cursor: pointer;
  text-align: left;
}

.theme-title-link:hover {
  text-decoration: underline;
  border-bottom-color: var(--accent);
}

.card-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: inherit;
}

.card-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.card-baseline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.card.card-above .card-baseline { color: var(--success); }
.card.card-below .card-baseline { color: #f87171; }

/* Charts */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.chart-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.02em;
}

.insight-time-section .best-time-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.insight-time-section .best-time-row .baseline-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: none;
  font-weight: 500;
}

.insight-time-section .best-time-row .baseline-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.insight-time-chart-label {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.chart-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.chart-container {
  position: relative;
  height: 220px;
}

.engagement-distribution {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.distribution-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.distribution-style {
  font-weight: 600;
  color: var(--accent);
}

/* Leverage matrix / Content Leverage */
.leverage-action {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}
.leverage-arrow {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.leverage-arrow--up {
  color: #22c55e;
}
.leverage-arrow--down {
  color: #f87171;
}
.leverage-arrow--dash {
  color: rgba(255, 255, 255, 0.5);
}
.leverage-arrow--opt {
  color: #3b82f6;
}
.leverage-arrow--exp {
  color: #eab308;
}
.leverage-action--positive {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.leverage-action--negative {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}
.leverage-action--accent {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent);
}
.leverage-action--neutral {
  background: rgba(251, 191, 36, 0.2);
  color: #f59e0b;
}

.leverage-exec-summary .leverage-exec-intro {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: var(--text);
}
.leverage-exec-summary .leverage-exec-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.leverage-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.taxonomy-performance-section .taxonomy-header {
  margin-bottom: 1.25rem;
}
.taxonomy-performance-section .taxonomy-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.75rem 0;
  line-height: 1.2;
}
.taxonomy-performance-section .taxonomy-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 42rem;
}
.taxonomy-performance-section .taxonomy-legend {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
}

.taxonomy-accuracy-badge {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.taxonomy-accuracy-badge .accuracy-score {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.85rem;
}

.leverage-chart-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}
.cluster-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.cluster-quality-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.cluster-quality-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.cluster-quality-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .cluster-quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.leverage-charts-box {
  margin-top: 0;
}
.leverage-charts-box .leverage-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.leverage-view-tab {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.leverage-view-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.leverage-view-tab.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.taxonomy-sort-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.taxonomy-sort-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.taxonomy-sort-btn.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.leverage-view-panel {
  display: none;
}
.leverage-view-panel.active {
  display: block;
}

.heatmap-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.95rem;
}
.heatmap-table th,
.heatmap-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 6px;
  min-width: 70px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.heatmap-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.heatmap-theme {
  text-align: left !important;
  font-weight: 600;
  min-width: 160px;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text) !important;
}
.heatmap-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1;
  position: relative;
}
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.heatmap-legend-bar {
  height: 12px;
  border-radius: 4px;
  flex: 1;
  max-width: 200px;
}

.leverage-theme-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.leverage-theme-card--compact {
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.leverage-theme-card:last-child {
  margin-bottom: 0;
}

.leverage-theme-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.leverage-theme-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.leverage-theme-stats {
  margin: 0 0 0.75rem 0;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.leverage-theme-stats li {
  margin-bottom: 0.25rem;
}

.leverage-why {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}
.leverage-action-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.leverage-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.leverage-summary-list tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.taxonomy-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.taxonomy-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.leverage-example-link {
  color: var(--accent);
  text-decoration: none;
}

.leverage-theme-card--clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.leverage-theme-card--clickable:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(14, 165, 233, 0.3);
}
.leverage-theme-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Why analysis popup modal */
.why-analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.why-analysis-modal--open {
  pointer-events: auto;
  opacity: 1;
}
.why-analysis-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.why-analysis-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.why-analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.why-analysis-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.why-analysis-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.why-analysis-close:hover {
  color: var(--text);
}
.why-analysis-content {
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.why-analysis-content p {
  margin: 0 0 0.75rem;
}
.why-analysis-content p:last-child {
  margin-bottom: 0;
}
.why-analysis-error {
  color: var(--error);
}
.why-popover-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(14, 165, 233, 0.4);
  word-break: break-word;
}
.why-popover-link:hover {
  text-decoration: underline;
}

/* Theme tweets modal */
.theme-tweets-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.theme-tweets-modal--open {
  pointer-events: auto;
  opacity: 1;
}
.theme-tweets-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.theme-tweets-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 960px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.theme-tweets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.theme-tweets-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.theme-tweets-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.theme-tweets-close:hover {
  color: var(--text);
}
.theme-tweets-topics {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.theme-tweets-filter {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.theme-tweets-filter .tweets-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-tweets-filter .tweets-filter label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.theme-tweets-list {
  overflow-y: auto;
  padding: 1rem;
  max-height: 60vh;
}
.theme-tweets-list .tweets-table-wrap {
  overflow-x: auto;
}
.theme-tweet-item {
  display: block;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: background 0.15s, border-color 0.15s;
}
.theme-tweet-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}
.theme-tweet-item--no-link {
  cursor: default;
}
.theme-tweet-item--no-link:hover {
  border-color: var(--border);
}
.leverage-example-link:hover {
  text-decoration: underline;
}

.leverage-overall-text {
  margin: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

.leverage-details summary {
  padding: 0.5rem 0;
}

/* Tweets section */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tweets-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tweets-filter label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tweets-filter select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.filter-toggle-btn {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.filter-toggle-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.sort-order-btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  min-height: 44px;
  min-width: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.sort-order-btn.arrow-up {
  color: var(--success);
}

.sort-order-btn.arrow-up:hover {
  background: var(--success-dim);
}

.sort-order-btn.arrow-down {
  color: var(--error);
}

.sort-order-btn.arrow-down:hover {
  background: var(--error-dim);
}

/* Tweets table */
.tweets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tweets-table th,
.tweets-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tweets-table th {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  background: var(--bg-elevated);
}

.tweets-table tr:last-child td {
  border-bottom: none;
}

.tweets-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tweet-row {
  cursor: pointer;
}

.tweet-author-cell {
  vertical-align: middle;
}

.author-select {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  min-width: 5.5rem;
}

.author-select option {
  background: var(--bg-card);
  color: var(--text);
}

.author-select.author-max {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(14, 165, 233, 0.5);
  color: #38bdf8;
}

.author-select.author-jon {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

.author-select.author-brandon {
  background: rgba(251, 146, 60, 0.2);
  border-color: rgba(251, 146, 60, 0.5);
  color: #fb923c;
}

.tweet-num {
  width: 2rem;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.th-why {
  width: 1%;
  white-space: nowrap;
}

.header-control-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.tweet-why-cell {
  vertical-align: middle;
}

.tweet-why-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.tweet-why-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.25);
  border-color: var(--accent);
}

.tweet-why-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.tweet-explain-row {
  background: rgba(14, 165, 233, 0.06);
}

.tweet-explain-row td {
  border-top: none;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  vertical-align: top;
}

.tweet-explain-loading {
  color: var(--text-muted);
  font-style: italic;
}

.tweet-explain-content {
  font-size: 0.95rem;
  line-height: 1.6;
}

.tweet-explain-text {
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.tweet-explain-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tweet-explain-factor {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent);
  border-radius: var(--radius-sm);
}

.tweet-explain-close {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.tweet-explain-close:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.tweet-explain-error {
  color: var(--error);
  font-size: 0.9rem;
}

.load-more-wrap {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.load-more-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  min-height: 44px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.load-more-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.tweet-text {
  max-width: 380px;
  white-space: pre-wrap;
  word-break: break-word;
}

.tweet-link {
  color: var(--text);
  text-decoration: none;
}

.tweet-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tweet-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.tweet-badge.above {
  background: var(--success-dim);
  color: var(--success);
}

.tweet-badge.below {
  background: var(--error-dim);
  color: #f87171;
}

/* Loading / empty */
.loading, .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 0.25rem;
}

.empty-hint {
  font-size: 0.85rem;
  opacity: 0.8;
}

.error-state {
  padding: 1.25rem;
  background: var(--error-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  color: #fca5a5;
  margin-bottom: 2rem;
}

/* Insights page */
.ai-insights {
  background: var(--accent-dim);
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 2rem !important;
}

.ai-insights .insight-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  line-height: 1.6;
}

.ai-insights .insight-item:last-child {
  border-bottom: none;
}

.ai-insights .insight-label {
  font-size: 0.95rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ai-insights .insight-item ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.ai-insights .insight-item ul li {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.ai-no-key {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
}

/* Day detail view */
.day-detail-header {
  margin-bottom: 2rem;
}

.back-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}

.back-btn:hover {
  color: var(--text);
}

.day-detail-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.day-detail-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.day-stats-section {
  margin-bottom: 2rem;
}

.day-stats-section .kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.empty-cell {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* ========== MOBILE OPTIMIZATIONS ========== */

/* Tweets table: horizontal scroll on small screens */
.tweets-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem;
}

@media (max-width: 768px) {
  .tweets-table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .tweets-table {
    min-width: 520px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .header-nav {
    order: 1;
    justify-self: center;
  }

  .logo {
    order: 2;
  }

  .logo-video {
    height: 40px;
  }

  .logo img {
    height: 32px;
  }

  .header-controls {
    order: 3;
    justify-self: center;
    gap: 0.5rem;
  }

  .header select,
  .chart-metric-select,
  .tweets-filter select,
  #tweetRank {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .main {
    padding: 1.25rem 1rem;
  }

  .insight-hero {
    padding: 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
  }

  .insight-hero h2 {
    font-size: 1.25rem;
  }

  .hero-sub {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .baseline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .baseline-card {
    padding: 1rem;
  }

  .baseline-value {
    font-size: 1.4rem;
  }

  .account-overview-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .account-overview-title {
    font-size: 1.4rem;
  }

  .time-range-filters {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .time-btn,
  .custom-range-trigger {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .charts-section {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .chart-card {
    padding: 1.25rem;
  }

  .chart-container-hero {
    height: 220px;
  }

  .chart-container {
    height: 180px;
  }

  .chart-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .activity-tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .ai-insights-section {
    padding: 1.25rem;
  }

  .ai-insights-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

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

  .tweets-filter {
    flex-wrap: wrap;
  }

  .tweet-text {
    max-width: 100%;
    min-width: 0;
  }

  .chat-panel {
    width: 100%;
    max-width: 100%;
  }

  .chat-form {
    padding: 0.75rem 1rem;
  }

  .chat-input {
    font-size: 16px; /* Prevents iOS zoom */
  }

  /* Safe area for notched devices */
  .header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .main {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0.6rem 0.75rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
  }

  .logo-video {
    height: 36px;
  }

  .logo img {
    height: 28px;
  }

  /* Hide video on very small screens, show img only to save space */
  .logo .logo-video {
    display: none;
  }

  .main {
    padding: 1rem 0.75rem;
  }

  .insight-hero {
    padding: 1.25rem 1rem;
  }

  .baseline-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .chart-container-hero {
    height: 200px;
  }

  .chart-container {
    height: 160px;
  }

  .activity-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .activity-tabs::-webkit-scrollbar {
    display: none;
  }

  .activity-tab {
    flex-shrink: 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
  }

  .custom-range-popover {
    min-width: 100%;
    left: 0;
    right: 0;
  }

  .tweets-table {
    min-width: 480px;
    font-size: 0.85rem;
  }

  .tweets-table th,
  .tweets-table td {
    padding: 0.5rem 0.65rem;
  }

  .tweet-why-btn {
    min-height: 36px;
    padding: 0.3rem 0.5rem;
  }
}

/* Landscape mobile: reduce vertical space */
@media (max-height: 500px) and (orientation: landscape) {
  .insight-hero {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
  }

  .chart-container-hero {
    height: 180px;
  }

  .chart-container {
    height: 150px;
  }
}

/* Chat panel (RAG Ask) */
.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chat-backdrop[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
}

.chat-panel[aria-hidden="false"] {
  transform: translateX(0);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
}

.chat-refresh-btn:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.chat-close-btn:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  max-width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-dim);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  white-space: pre-wrap;
}

.chat-msg .chat-link {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px solid rgba(14, 165, 233, 0.4);
}

.chat-msg .chat-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

.chat-msg.bot.loading {
  color: var(--text-muted);
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  border-radius: 4px;
  font-family: inherit;
}

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

.chat-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.chat-send-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.chat-send-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-mention-menu {
  position: absolute;
  left: 1.25rem;
  right: 6.5rem;
  bottom: calc(100% - 0.75rem);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 0.25rem;
}

.chat-mention-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-mention-option:hover,
.chat-mention-option--active {
  background: var(--bg);
}

.chat-mention-handle {
  font-weight: 700;
}

.chat-mention-name {
  color: var(--text-muted);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hint {
  margin: 0;
  padding: 0.5rem 1rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.chat-hint-secondary {
  padding-top: 0;
  margin-top: -0.75rem;
}

/* Guests page */
.guests-header {
  margin-bottom: 1.5rem;
}

.guests-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.guests-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.guests-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.guests-filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guests-sort-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.guests-search-wrap {
  flex: 1;
  min-width: 200px;
}

.guests-search-input {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
}

.guests-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.guests-table-wrap {
  overflow-x: auto;
}

.guests-table {
  width: 100%;
  border-collapse: collapse;
}

.guests-table th,
.guests-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.guests-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.guests-table tr.guest-row {
  cursor: pointer;
}

.guests-table tr.guest-row:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.guest-handle {
  color: var(--accent);
  text-decoration: none;
}

.guest-handle:hover {
  text-decoration: underline;
}

.guest-tweets-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
}

/* Week Summary — placeholder page */
.week-summary-page .week-summary-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.week-summary-placeholder-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.week-summary-placeholder-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guest-recap-block-hero {
  margin-bottom: 2rem;
}

.guest-recap-block-hero .guest-recap-dropzone {
  min-height: 220px;
}

.guest-recap-block-hero .guest-recap-dropzone-inner {
  min-height: 200px;
}

.guest-recap-block-hero .guest-recap-image {
  max-height: 360px;
}

.brief-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.brief-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.brief-edit-toggle:hover {
  color: var(--text);
}

.brief-edit-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
}

[data-editable].brief-editing {
  outline: 1px solid rgba(14, 165, 233, 0.4);
  outline-offset: 2px;
  border-radius: 2px;
}

[data-editable].brief-editing:focus {
  outline-color: var(--accent);
}

.guest-recap-block {
  margin-bottom: 1rem;
}

.guest-recap-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.guest-recap-dropzone {
  position: relative;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 8px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.guest-recap-dropzone:hover,
.guest-recap-dropzone-dragover {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.05);
}

.guest-recap-dropzone-inner {
  width: 100%;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.guest-recap-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guest-recap-hint-hidden {
  display: none;
}

.guest-recap-image {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 4px;
}

.guest-recap-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Styled brief report */
.brief-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
  letter-spacing: -0.02em;
}

.brief-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.5rem;
  font-weight: 500;
}

.brief-section {
  margin-top: 1.5rem;
}

.brief-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.brief-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.brief-list li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brief-list li:last-child {
  border-bottom: none;
}

.brief-list li::before {
  content: "•";
  color: var(--accent);
  margin-right: 0.5rem;
}

.brief-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85em;
  margin-left: 0.25rem;
}

.brief-link:hover {
  text-decoration: underline;
}

.brief-list-companies li strong {
  color: var(--text);
}

.brief-quote {
  padding: 0.75rem 0;
}

.brief-blockquote {
  margin: 0 0 0.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-style: italic;
  font-size: 0.95rem;
}

.brief-quote-attrib {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.brief-implication {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  font-style: italic;
}

.brief-empty {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.brief-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.brief-trend-radar {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* Deals & Moves — tweet cards (X-style) */
.brief-list-moves .brief-move-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brief-list-moves .brief-move-item:last-child {
  border-bottom: none;
}

.brief-move-line {
  margin-bottom: 0.5rem;
}

.brief-tweet-card {
  display: block;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.brief-tweet-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.brief-tweet-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.brief-tweet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.brief-tweet-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.brief-tweet-handle {
  font-weight: 600;
  color: var(--text);
}

.brief-tweet-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.brief-tweet-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.brief-tweet-engagement {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.brief-tweet-engagement span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
