/* ─── KNOWLEDGE IMPERIUM · ELEGANT EDITION (Don 2026-05-06 Phase 4) ─── */

:root {
  /* Palette: deeper, calmer */
  --bg: #06080c;
  --bg-1: #0a0d13;
  --bg-2: #0f131c;
  --panel: rgba(15, 19, 28, 0.65);
  --panel-soft: rgba(15, 19, 28, 0.4);
  --border: rgba(212, 175, 55, 0.18);
  --border-soft: rgba(212, 175, 55, 0.08);
  --border-hover: rgba(212, 175, 55, 0.4);
  --gold: #d4af37;
  --gold-soft: #b08a18;
  --gold-glow: rgba(212, 175, 55, 0.5);
  --text: #ece8df;
  --text-strong: #f5f0e3;
  --text-dim: #94a0b0;
  --text-muted: #6c7785;
  --green: #6dc78a;
  --red: #d97a7a;
  --blue: #79afca;
  --purple: #b095d2;

  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-sm: 0 4px 14px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1200px 800px at 50% -200px, rgba(212,175,55,0.06), transparent 70%),
    linear-gradient(180deg, #050608 0%, #07090d 50%, #0a0c12 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ─── LOGIN GATE ─── */
.login-gate {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,175,55,0.08), transparent 60%),
    var(--bg);
  display: grid;
  place-items: center;
  z-index: 9999;
}
.login-card {
  background: rgba(10,13,19,0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 56px 48px;
  width: min(440px, 92vw);
  text-align: center;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
}
.login-emblem {
  font-size: 56px;
  margin-bottom: 12px;
  color: var(--gold);
  filter: drop-shadow(0 0 32px var(--gold-glow));
}
.login-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 6px;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.login-sub {
  margin: 0 0 32px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-pwd {
  width: 100%;
  padding: 14px 18px;
  background: rgba(6,8,12,0.6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#login-pwd:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.12);
}
#login-form button {
  padding: 14px 22px;
  background: var(--gold);
  color: #0a0c12;
  border: none;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
#login-form button:hover {
  background: #e8c14a;
  transform: translateY(-1px);
}
.error {
  color: var(--red);
  margin: 8px 0 0;
  font-size: 13px;
}
.login-hint {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── DASHBOARD ─── */
.dashboard {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ─── HERO ─── */
.hero {
  text-align: center;
  padding: 80px 0 48px;
  position: relative;
}
.hero-emblem {
  font-size: 42px;
  color: var(--gold);
  filter: drop-shadow(0 0 28px var(--gold-glow));
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 54px);
  letter-spacing: 0.01em;
  margin: 0 0 12px;
  color: var(--gold);
  line-height: 1.1;
}
.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-dim);
  margin: 0 0 36px;
  font-weight: 400;
}

/* CHAT-CONTAINER (Don 2026-05-06 Phase 5-fix: ersetzt einfache Search-Form) */
.chat-container {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}
.chat-window {
  background: rgba(6,8,12,0.7);
  border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) var(--r-md) var(--r-md);
  padding: 24px;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
  scroll-behavior: smooth;
}
.chat-window::-webkit-scrollbar { width: 6px; }
.chat-window::-webkit-scrollbar-track { background: transparent; }
.chat-window::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: chatFadeIn 0.3s ease-out;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message.chat-user { align-self: flex-end; align-items: flex-end; }
.chat-message.chat-bot { align-self: flex-start; align-items: flex-start; }
.chat-message.chat-system {
  align-self: center;
  align-items: center;
  max-width: 100%;
}

.chat-bubble {
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-user .chat-bubble {
  background: var(--gold);
  color: #0a0c12;
  border-bottom-right-radius: 6px;
  font-weight: 500;
}
.chat-bot .chat-bubble {
  background: rgba(15,19,28,0.95);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 6px;
}
.chat-system .chat-bubble {
  background: rgba(212,175,55,0.06);
  color: var(--text-dim);
  border: 1px dashed var(--border-soft);
  font-style: italic;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
}
.chat-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin: 4px 8px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chat-bot .chat-meta { color: var(--gold); font-weight: 600; }

.chat-bubble.loading {
  position: relative;
}
.chat-bubble.loading::after {
  content: "...";
  display: inline-block;
  width: 18px;
  animation: dotPulse 1.2s infinite;
}
@keyframes dotPulse {
  0%, 33% { content: "."; }
  34%, 66% { content: ".."; }
  67%, 100% { content: "..."; }
}

.chat-bubble a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Chat input form */
.chat-input-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: rgba(6,8,12,0.7);
  border: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) var(--r-xl) var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-form:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.10);
}
#chat-input {
  flex: 1;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text-strong);
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
}
#chat-input::placeholder { color: var(--text-muted); font-style: italic; }
.chat-send-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--gold);
  color: #0a0c12;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.chat-send-btn:hover { background: #e8c14a; transform: scale(1.05); }
.chat-send-btn svg { width: 22px; height: 22px; }
.chat-hint {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ─── STAT STRIP (compact, single line) ─── */
.stat-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 28px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  margin: 32px auto 56px;
  max-width: 920px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 140px;
  padding: 8px 16px;
  text-align: center;
}
.stat-num {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.02em;
}
.stat-lbl {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-soft);
}

/* ─── SECTIONS ─── */
.section {
  margin: 0 0 56px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.section-sub {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* ─── TRENDING CLOUD ─── */
.trending-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
}
.trend-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.trend-tag:hover {
  background: rgba(212,175,55,0.10);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}
.trend-tag-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.trend-tag.size-xl { font-size: 16px; padding: 10px 18px; font-weight: 600; }
.trend-tag.size-lg { font-size: 15px; padding: 9px 16px; }
.trend-tag.size-md { font-size: 13px; }
.trend-tag.size-sm { font-size: 12px; padding: 6px 12px; }
.trend-tag.trend-active {
  background: rgba(212,175,55,0.20);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.trend-clear {
  font-size: 14px;
  color: var(--gold);
  margin-left: 6px;
}
.active-topic-badge {
  background: rgba(212,175,55,0.10);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.active-topic-badge strong { color: var(--gold); }
.active-topic-badge .topic-clear {
  margin-left: auto;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  border-bottom: 1px dotted var(--border);
}
.active-topic-badge .topic-clear:hover { color: var(--red); border-bottom-color: var(--red); }

/* ─── CATEGORY TABS ─── */
.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.cat-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-tab:hover {
  color: var(--text-strong);
  background: rgba(212,175,55,0.05);
}
.cat-tab.active {
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  font-weight: 600;
}

/* ─── HEADLINES GRID (single column, generous) ─── */
.headlines-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.headline-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  padding: 18px 14px;
  transition: background 0.15s, padding-left 0.15s, border-color 0.15s;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: baseline;
}
.headline-card:hover {
  background: rgba(212,175,55,0.03);
  padding-left: 20px;
  border-bottom-color: var(--border-hover);
}
.headline-card:last-child { border-bottom-color: transparent; }
.headline-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.4;
  grid-column: 1 / 2;
}
.headline-card:hover .headline-title { color: var(--gold); }
.headline-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.headline-feed {
  color: var(--gold-soft);
  font-weight: 500;
}
.headline-cat {
  background: rgba(212,175,55,0.08);
  color: var(--gold-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.headline-bodyflag {
  font-family: var(--mono);
  font-size: 11px;
}
.headline-bodyflag.full { color: var(--green); }
.headline-bodyflag.thin { color: var(--text-muted); }
.headline-arrow {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  color: var(--text-muted);
  font-size: 22px;
  align-self: center;
  transition: transform 0.15s, color 0.15s;
}
.headline-card:hover .headline-arrow {
  transform: translateX(3px);
  color: var(--gold);
}

/* ─── X-WALL (Phase 5: curated tweets via Nitter) ─── */
.x-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.x-post-card {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  padding: 16px 18px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.x-post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.55);
}
.x-post-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}
.x-post-handle {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.x-post-source {
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
}
.x-post-date {
  font-family: var(--mono);
  margin-left: auto;
  color: var(--text-muted);
}
.x-post-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  word-wrap: break-word;
}
.x-post-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  border-bottom: 1px dotted var(--border);
  align-self: flex-start;
  padding-bottom: 1px;
  font-weight: 500;
}
.x-post-link:hover {
  color: #e8c14a;
  border-bottom-style: solid;
}

/* ─── COLLAPSIBLE META SECTION ─── */
.meta-details {
  background: var(--panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.meta-details[open] { border-color: var(--border); }
.meta-summary {
  padding: 16px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  user-select: none;
  list-style: none;
  transition: background 0.15s;
}
.meta-summary::-webkit-details-marker { display: none; }
.meta-summary:hover { background: rgba(212,175,55,0.04); }
.meta-arrow {
  margin-left: auto;
  color: var(--gold);
  transition: transform 0.2s;
  font-size: 18px;
}
.meta-details[open] .meta-arrow { transform: rotate(90deg); }
.meta-content {
  padding: 8px 22px 24px;
  border-top: 1px solid var(--border-soft);
}
.meta-h3 {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--gold);
  margin: 24px 0 14px;
  font-weight: 500;
}

/* ─── HEALTH GRID (compact) ─── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.health-card {
  background: rgba(6,8,12,0.5);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-card.ok .health-dot { background: var(--green); box-shadow: 0 0 8px rgba(109,199,138,0.4); }
.health-card.fail .health-dot { background: var(--red); }
.health-card.unknown .health-dot { background: var(--text-muted); }
.health-name {
  font-weight: 500;
  color: var(--text);
}
.health-info {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── DISTRIBUTION (icon row) ─── */
.distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.dist-card {
  background: rgba(6,8,12,0.5);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px 8px;
  text-align: center;
}
.dist-icon { font-size: 22px; margin-bottom: 2px; }
.dist-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.dist-count {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
}

/* ─── FOOTER ─── */
.dash-footer {
  margin-top: 80px;
  text-align: center;
  padding: 32px 0 20px;
  border-top: 1px solid var(--border-soft);
}
.footer-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.seal-line { width: 80px; height: 1px; background: var(--border-soft); }
.seal-mark { font-size: 22px; color: var(--gold); opacity: 0.7; }
.footer-text {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
}
.footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--panel-soft);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.logout-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.logout-btn:hover { color: var(--red); border-color: var(--red); }

/* ─── ARTICLE DETAIL MODAL ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3,4,6,0.85);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.modal-shell {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: min(800px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 56px 48px 40px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover {
  color: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}
.modal-header {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  align-items: center;
}
.modal-feed {
  color: var(--gold);
  font-weight: 600;
}
.modal-cat {
  background: rgba(212,175,55,0.10);
  color: var(--gold-soft);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-sep { color: var(--text-muted); }
.modal-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-strong);
  line-height: 1.25;
}
.modal-url-link {
  display: inline-block;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 24px;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
  padding-bottom: 1px;
}
.modal-url-link:hover {
  color: #e8c14a;
  border-bottom-style: solid;
}
.modal-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  font-family: var(--sans);
}
.modal-body p { margin: 0 0 14px; }
.modal-body strong { color: var(--gold); }
.modal-body em { color: var(--text-dim); }
.modal-body ul, .modal-body ol { padding-left: 24px; margin: 0 0 14px; }
.modal-body li { margin-bottom: 4px; }
.modal-body a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--border); }
.modal-body a:hover { border-bottom-style: solid; }
.modal-body h1, .modal-body h2, .modal-body h3 {
  font-family: var(--serif);
  color: var(--gold);
  margin: 24px 0 10px;
}
.modal-body-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px;
}

/* ─── X APP FAB (Floating Action Button, always visible) ─── */
.x-app-fab {
  position: fixed;
  top: 22px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px 11px 14px;
  background: #000;
  color: #fff;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(255,255,255,0.0);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  z-index: 5000;
  backdrop-filter: blur(10px);
}
.x-app-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.x-app-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.4);
}
.x-fab-label {
  font-family: var(--mono);
}
@media (max-width: 600px) {
  .x-app-fab {
    top: 14px;
    right: 14px;
    padding: 9px 12px 9px 10px;
    font-size: 12px;
  }
  .x-app-fab svg { width: 16px; height: 16px; }
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(212,175,55,0.95);
  color: #0a0c12;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 9000;
  animation: toastIn 0.3s;
  letter-spacing: 0.02em;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── REVEAL ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── MOBILE ─── */
@media (max-width: 700px) {
  .dashboard { padding: 0 16px 60px; }
  .hero { padding: 56px 0 32px; }
  .hero-search {
    flex-direction: column;
    padding: 8px;
    border-radius: var(--r-lg);
  }
  .btn-primary { width: 100%; justify-content: center; }
  .stat-strip {
    flex-direction: column;
    gap: 14px;
    padding: 18px 24px;
  }
  .stat-divider { display: none; }
  .modal { padding: 12px; }
  .modal-shell { padding: 48px 24px 32px; max-height: 92vh; }
  .modal-title { font-size: 22px; }
  .headline-card {
    grid-template-columns: 1fr;
    padding: 14px 8px;
  }
  .headline-arrow { display: none; }
}

/* ─── SMOOTH SCROLL ─── */
html { scroll-behavior: smooth; }

::selection {
  background: rgba(212,175,55,0.3);
  color: var(--text-strong);
}

/* Custom scrollbar in modals */
.modal-shell::-webkit-scrollbar {
  width: 8px;
}
.modal-shell::-webkit-scrollbar-track {
  background: transparent;
}
.modal-shell::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 4px;
}
.modal-shell::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}
