@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-hover: #F5F5F5;
  --border: #E5E5E5;
  --border-soft: #EFEFEF;
  --text: #1A1A18;
  --text-muted: #888;
  --text-light: #bbb;
  --accent: #1A6B3C;
  --accent-hover: #155730;
  --accent-soft: #e8f4ed;
  --sidebar-bg: #F0F0F0;
  --ad-bg: #F8F8F5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font-serif: 'Inter', -apple-system, sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: var(--font-sans); border: none; background: none; }
input { font-family: var(--font-sans); }

/* ─── App Shell ─────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Left Sidebar ──────────────────────────────────────────────────────── */
#left-sidebar {
  width: 222px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width 0.25s ease;
}

body.sidebar-collapsed #left-sidebar {
  width: 40px;
}
body.sidebar-collapsed .sidebar-body,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .sidebar-ad-slot,
body.sidebar-collapsed .logo {
  display: none;
}
body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 14px 8px;
}
body.sidebar-collapsed .ad-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar-header {
  padding: 14px 14px 12px;
  border-bottom: 1px dashed var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ad-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ad-collapse-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.ad-collapse-btn svg {
  transition: transform 0.2s ease;
}

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

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--text);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark span {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.3px;
}

.logo-img {
  width: auto;
  display: block;
  max-width: 155px;
  filter: opacity(0.5);
}

/* sidebar body / sections */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-body::-webkit-scrollbar { width: 3px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section {
  padding: 0 14px 12px;
  border-bottom: 1px dashed var(--border);
}

.sidebar-section-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 0 2px;
}

.sidebar-empty-state {
  font-size: 12.5px;
  color: var(--text-light);
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.sidebar-recents {
  padding: 10px 14px 0;
}
.sidebar-recents-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

/* sidebar footer */
.sidebar-footer {
  flex-shrink: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  transition: all 0.12s;
  text-align: left;
}
.sidebar-settings-btn:hover { background: var(--border-soft); color: var(--text); }
.sidebar-settings-btn svg { opacity: 0.6; flex-shrink: 0; }

.recent-item {
  padding: 5px 8px;
  padding-left: 0;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.recent-item:hover { background: var(--border-soft); color: var(--text); }

.sidebar-ad-slot {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.ad-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-light);
  margin-bottom: 5px;
}

/* Live ad slots render as a transparent, unstyled box so the InMobi SDK's
 * iframe is the only visible element. The dashed IAB-size preview (the old
 * "200 × 200 / Display Ad" box) is only shown when ?mock=true is present
 * — see body.ad-mock rules below. */
.ad-placeholder {
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 11px;
  overflow: hidden;
}

/* ─── Mock / preview mode (body.ad-mock, toggled when ?mock=true) ───────
 * Restores the dashed IAB-size preview box and injects the dimension
 * label via ::before / ::after so we never put any text INSIDE an
 * ad-slot-N div (which would otherwise render above the SDK iframe). */
body.ad-mock .ad-placeholder {
  border: 1px dashed #C8C8C0;
  background: #E8E8E3;
}
body.ad-mock .ad-placeholder.sidebar-200x200::before {
  content: "200 × 200";
  display: block;
}
body.ad-mock .ad-placeholder.sidebar-200x200::after {
  content: "Display Ad";
  display: block;
  margin-top: 3px;
}
body.ad-mock .ad-placeholder.sticky-160::before {
  content: "160 × 600";
  display: block;
}
body.ad-mock .ad-placeholder.leaderboard-728::before {
  content: "728 × 90 — Leaderboard Ad";
  display: block;
}
body.ad-mock .ad-placeholder.banner-320::before {
  content: "320 × 50 — Banner Ad";
  display: block;
}
body.ad-mock .ad-placeholder.native-mid::before {
  content: "Native Ad — 320 × 80";
  display: block;
}

/* ─── Ad placeholder sizes ──────────────────────────────────────────────
 * Every size class pins BOTH a minimum width and height equal to the IAB
 * spec. This guarantees that parent padding / narrow containers can never
 * squeeze an ad below its creative dimensions (e.g. a 728×90 leaderboard
 * being rendered at 716×90). Box-sizing is content-box so borders do not
 * eat into the declared size.
 */
.ad-placeholder.sidebar-200x200 {
  box-sizing: content-box;
  width: 200px;
  min-width: 200px;
  height: 200px;
  min-height: 200px;
}

.ad-placeholder.leaderboard-728 {
  box-sizing: content-box;
  width: 728px;
  min-width: 728px;
  max-width: 728px;
  height: 90px;
  min-height: 90px;
  margin: 0 auto;
}

.ad-placeholder.banner-320 {
  box-sizing: content-box;
  width: 320px;
  min-width: 320px;
  height: 50px;
  min-height: 50px;
  margin: 0 auto;
}

.ad-placeholder.native-mid {
  width: 100%;
  padding: 12px;
  min-height: 64px;
  flex-direction: row;
  gap: 10px;
  justify-content: flex-start;
}

.ad-placeholder span { font-size: 10px; color: var(--text-light); }

/* ─── Main Area ─────────────────────────────────────────────────────────── */
#main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* top-bar removed */
#top-bar { display: none; }
#top-bar-title { display: none; }

/* ─── Content Area ──────────────────────────────────────────────────────── */
#content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#content::-webkit-scrollbar { display: none; }

/* ─── Custom Scrollbar ──────────────────────────────────────────────────── */
#custom-scrollbar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  z-index: 20;
  pointer-events: none;
}
#custom-scrollbar-thumb {
  position: absolute;
  right: 0;
  width: 5px;
  min-height: 30px;
  background: var(--border);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ─── Welcome State ─────────────────────────────────────────────────────── */
#welcome-state {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 48px 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.stories-section { margin-bottom: 44px; }

.stories-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.stories-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.stories-track::-webkit-scrollbar { display: none; }

.story-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.story-thumb {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.story-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  pointer-events: none;
}

.story-item:hover .story-thumb {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.story-title {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  max-width: 66px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welcome-heading {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 32px;
  white-space: nowrap;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  font-weight: 300;
}

.query-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}

.query-pill {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  font-weight: 400;
  transition: all 0.15s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.query-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ─── Conversation View ─────────────────────────────────────────────────── */
#conversation-view {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 0px 140px;
}

/* User Message */
.user-message {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.user-bubble {
  background: var(--text);
  color: #fff;
  padding: 11px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 420px;
  font-weight: 400;
}

/* Sponsored Brand Card */
.sponsored-brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.sponsored-brand-card:hover { box-shadow: var(--shadow-md); }

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.brand-info { flex: 1; min-width: 0; }

.brand-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.sponsored-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.2px;
}

.brand-tagline {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.brand-cta-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.12s;
  white-space: nowrap;
}

.brand-cta-btn:hover { background: var(--accent-hover); }

/* Mid-content sponsored card */
.mid-sponsor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.mid-sponsor-card .brand-cta-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.mid-sponsor-card .brand-cta-btn:hover {
  background: var(--accent-soft);
}

/* Sources Bar */
.sources-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.sources-count-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid #c5dfd0;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.source-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.source-pill:hover { border-color: var(--accent); color: var(--accent); }

.source-pill-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Article Content */
.article-content { margin-top: 4px; }

.article-section {
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.article-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.article-section h2 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 7px;
  line-height: 1.3;
}

.article-section h3 {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.article-section p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 300;
}

.article-section p strong {
  font-weight: 600;
  color: var(--text);
}

sup.citation {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.1s;
  vertical-align: super;
  line-height: 1;
}

sup.citation:hover { background: var(--accent-soft); }

/* Article Table */
.article-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.article-table th {
  background: var(--sidebar-bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.article-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-weight: 300;
  line-height: 1.4;
}

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

.article-table tr:hover td { background: var(--bg); }

/* ─── Article Reader ────────────────────────────────────────────────────── */
#article-reader {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 32px 120px;
}

/* Ad units inside #article-reader break out of the 32px horizontal padding
 * so leaderboards (728×90) and other creatives get the full 780px parent
 * width to center in. Without this, padding would squeeze 728→716. */
#article-reader .ad-unit,
#article-reader .inline-leaderboard {
  margin-left: -32px;
  margin-right: -32px;
}

.article-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 20px;
  transition: all 0.12s;
}

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

.article-reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.article-reader-domain {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.article-reader-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin-bottom: 20px;
}

.article-reader-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  font-weight: 300;
}

.article-reader-body h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}

.article-reader-body p {
  margin-bottom: 12px;
}

.article-reader-ad {
  margin-top: 32px;
  padding: 16px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-reader-ad .ad-label {
  margin-bottom: 5px;
}

/* ─── Read Article Button ────────────────────────────────────────────────── */
.source-read-btn {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  font-weight: 500 !important;
}

.source-read-btn:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

/* ─── Keyword Links ─────────────────────────────────────────────────────── */
.keyword-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.12s;
}

.keyword-link:hover {
  background: var(--accent-soft);
}

/* ─── Keyword Sidebar ────────────────────────────────────────────────────── */
.kw-affiliate-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.kw-affiliate-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.kw-affiliate-body { flex: 1; min-width: 0; }

.kw-affiliate-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.kw-affiliate-cat {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 4px;
}

.kw-affiliate-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 5px;
}

.kw-sources-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ─── Inline Leaderboard Ad ─────────────────────────────────────────────── */
.inline-leaderboard {
  margin: 20px 0;
  padding: 16px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* AFS Ad Unit */
.afs-unit {
  margin: 22px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 0 80px;
}

.afs-label {
  font-size: 10.5px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.afs-ads { display: flex; flex-direction: column; gap: 10px; }

.afs-ad-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.12s;
}

.afs-ad-item:hover { box-shadow: var(--shadow-sm); }

.afs-ad-title { font-size: 14px; color: #1a0dab; font-weight: 400; margin-bottom: 2px; }
.afs-ad-domain { font-size: 11.5px; color: #006621; margin-bottom: 3px; }
.afs-ad-desc { font-size: 12.5px; color: #545454; line-height: 1.4; font-weight: 300; }

/* Affiliate Carousel */
.affiliate-section { margin: 24px 0; }

.affiliate-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.affiliate-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.affiliate-track::-webkit-scrollbar { display: none; }

.affiliate-card {
  flex-shrink: 0;
  width: 148px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.affiliate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.affiliate-card-img {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.5px;
}

.affiliate-card-body { padding: 10px 10px 12px; }

.affiliate-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.affiliate-name { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.affiliate-category { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; font-weight: 300; }
.affiliate-price { font-size: 12px; font-weight: 600; color: var(--accent); }


.sources-count-action {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* Follow-Up Questions */
.followups-section { margin: 4px 0 24px; }

.followups-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.followup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.followup-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
}

.followup-card:hover .followup-text { color: var(--accent); }
.followup-card:hover .followup-arrow { color: var(--accent); }

.followup-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.4;
  transition: color 0.12s;
}

.followup-arrow {
  color: var(--text-light);
  flex-shrink: 0;
  margin-left: 12px;
  transition: color 0.12s;
}

/* Generating indicator */
.generating-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 300;
}

.gen-dots { display: flex; gap: 4px; }

.gen-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.4s ease-in-out infinite;
}

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

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ─── Input Bar ─────────────────────────────────────────────────────────── */
#input-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 32px 12px;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.input-bar-inner {
  max-width: 718px;
  margin: 0 auto;
  pointer-events: all;
  margin-bottom: 8px;
}

/* Card-style input */
.input-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-card:focus-within {
  border-color: #ccc;
  box-shadow: var(--shadow-lg);
}

#main-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: 300;
}

#main-input::placeholder { color: var(--text-light); }


.model-pill {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.12s;
}
.model-pill:hover { border-color: var(--text-muted); }

.input-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.input-icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  transition: all 0.12s;
}
.input-icon-btn:hover { background: var(--border-soft); color: var(--text-muted); }

.input-submit {
  width: 30px;
  height: 30px;
  background: var(--text);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: all 0.15s;
}
.input-submit:hover { background: #333; transform: scale(1.04); }
.input-submit svg { color: #fff; }


.input-footer {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  padding: 6px 0 0;
  line-height: 1.8;
  pointer-events: all;
}

.input-footer a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.12s;
}
.input-footer a:hover { color: var(--accent); }

/* ─── Sources Sidebar ───────────────────────────────────────────────────── */
#sources-sidebar {
  width: 0;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid transparent;
  overflow: hidden;
  transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1), border-color 350ms;
  display: flex;
  flex-direction: column;
}

#sources-sidebar.open {
  width: 340px;
  border-left-color: var(--border);
}

.sources-sidebar-inner {
  width: 340px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sources-header-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.sources-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.12s;
}

.sources-close-btn:hover { background: var(--bg); color: var(--text); }

.sources-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.sources-body::-webkit-scrollbar { width: 3px; }
.sources-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.source-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  margin-bottom: 8px;
  transition: box-shadow 0.12s;
  cursor: pointer;
}

.source-card:hover { box-shadow: var(--shadow-md); }

.source-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.source-domain-badge {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.source-domain-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.source-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
}

.source-snippet {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 300;
}

.source-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.source-action-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.12s;
}

.source-action-btn:hover { border-color: var(--accent); color: var(--accent); }

.sources-ad-slot { margin: 10px 0; }

/* ─── Story Modal ───────────────────────────────────────────────────────── */
.story-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.story-modal.open { opacity: 1; pointer-events: all; }

.story-modal-inner {
  width: 380px;
  height: 680px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  transform: scale(0.94);
  transition: transform 0.25s ease;
}

.story-modal.open .story-modal-inner { transform: scale(1); }

.story-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 2;
  transition: background 0.12s;
}

.story-modal-close:hover { background: rgba(0,0,0,0.65); }

.story-modal-pub { font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.story-modal-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: #fff; line-height: 1.25; margin-bottom: 12px; }
.story-modal-body { font-size: 13.5px; color: rgba(255,255,255,0.8); line-height: 1.6; font-weight: 300; }

/* ─── Related Searches ──────────────────────────────────────────────────── */
.related-searches {
  margin: 24px 0 8px;
}

.rs-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rs-chips { display: flex; flex-direction: column; gap: 2px; }

.rs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}

.rs-item:hover { background: var(--surface-hover); }

.rs-chevron { color: var(--text-muted); flex-shrink: 0; }

/* ─── Post-article elements animation ──────────────────────────────────── */
.post-article {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.post-article.visible { opacity: 1; transform: translateY(0); }

/* ─── Fade-in animation for initial elements ────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─── Remove Ads Button ─────────────────────────────────────────────────── */
.remove-ads-btn {
  display: block;
  margin-top: 6px;
  margin-left: auto;
  margin-right: auto;
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.6;
  transition: opacity 0.12s, color 0.12s;
  padding: 2px 0;
  text-align: center;
}
.remove-ads-btn:hover { opacity: 1; color: var(--accent); }

/* ─── Display Ad Interstitial Modal ─────────────────────────────────────── */
.rewarded-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rewarded-modal.hidden { display: none; }

.rewarded-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.rewarded-modal-box {
  position: relative;
  width: 660px;
  max-width: 92vw;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,0.35);
}

/* ── Banner creative ── */
.rad-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 40px 32px;
  background: linear-gradient(135deg, #c8f5ed 0%, #7de8d8 50%, #3ecfbf 100%);
  min-height: 176px;
  gap: 32px;
}

.rad-banner-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rad-headline {
  font-size: 30px;
  font-weight: 800;
  color: #0a2a26;
  line-height: 1.15;
  letter-spacing: -0.5px;
  font-family: sans-serif;
}

.rad-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #0a2a26;
}

.rad-brand-name { font-family: sans-serif; }

.rad-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: #0a2a26;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: opacity 0.15s;
  font-family: sans-serif;
}
.rad-cta-btn:hover { opacity: 0.82; }

.rad-banner-right { flex-shrink: 0; }

.rad-notif-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  min-width: 200px;
  position: relative;
}

.rad-notif-time {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 11px;
  color: #aaa;
}

.rad-notif-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.rad-notif-icon { font-size: 22px; }

.rad-notif-label {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── Controls bar below banner ── */
.rewarded-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
}

.rewarded-ad-pill {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.rewarded-ad-note {
  font-size: 12px;
  color: #888;
  flex: 1;
}

.rewarded-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rewarded-timer {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: right;
}

.rewarded-close-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 100px;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.rewarded-close-btn:hover { background: #e4e4e4; }

/* ─── Ads Removed State ──────────────────────────────────────────────────── */
body.ads-removed .ad-unit,
body.ads-removed .inline-leaderboard,
body.ads-removed .article-reader-ad,
body.ads-removed .sources-ad-slot,
body.ads-removed #sidebar-ad-slot,
body.ads-removed #sb-top-ad,
body.ads-removed #sb-bottom-ad,
body.ads-removed .sticky-ad,
body.ads-removed .shop-unit {
  display: none !important;
}

/* ─── Ads Removed Toast ──────────────────────────────────────────────────── */
.ads-removed-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.ads-removed-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #left-sidebar { display: none; }
  #sources-sidebar { display: none; }
  #welcome-state, #conversation-view { padding-left: 16px; padding-right: 16px; }
  #input-bar-container { padding-left: 16px; padding-right: 16px; }
  .welcome-heading { font-size: 26px; }
  #top-bar { padding: 0 16px; }
  .affiliate-card { width: 136px; }
  .afs-unit { overflow: hidden; }
}

/* ─── Main Content Row ───────────────────────────────────────────────────── */
#main-content-row {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* ─── Side Columns (20% each) ───────────────────────────────────────────── */
.side-col {
  flex: 0 0 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  height: calc(100vh - 48px);
  position: relative;
  z-index: 5;
  overflow: hidden;
  transition: flex-basis 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.side-col-left { padding-right: 40px; }
.side-col-right { padding-left: 40px; }


/* ─── Sticky Side Ads ───────────────────────────────────────────────────── */
.sticky-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ad-placeholder.sticky-160 {
  box-sizing: content-box;
  width: 160px;
  min-width: 160px;
  height: 600px;
  min-height: 600px;
  max-height: 600px;
  max-width: 160px;
}

@media (max-width: 1200px) {
  .side-col { display: none; }
}

/* ─── Settings Modal ────────────────────────────────────────────────────── */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-modal.hidden { display: none; }

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
}

.settings-box {
  position: relative;
  display: flex;
  width: 640px;
  max-width: 94vw;
  height: 500px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-sans);
}

.settings-sidebar {
  width: 176px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px dashed var(--border);
  padding: 20px 0 14px;
  display: flex;
  flex-direction: column;
}

.settings-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 0 16px 14px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.settings-nav-item:hover { background: var(--border-soft); color: var(--text); }
.settings-nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; }

.settings-content {
  flex: 1;
  padding: 24px 24px 20px;
  position: relative;
  overflow-y: auto;
  background: var(--surface);
}

.settings-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.settings-close-btn:hover { background: var(--surface-hover); color: var(--text); }

.settings-panel { display: block; }
.settings-panel.hidden { display: none; }

.settings-panel-header {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.settings-panel-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.55;
}

.settings-remove-ads-btn {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.12s;
}
.settings-remove-ads-btn:hover { background: var(--accent-hover); }

.settings-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.settings-usage-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.settings-usage-value { font-size: 12.5px; color: var(--text-muted); }

.settings-usage-bar {
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 12px;
}
.settings-usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
}

/* ─── Settings: LLM Feed Tab ────────────────────────────────────────────── */
.iface-cards { display: flex; flex-direction: column; gap: 6px; }

.iface-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.iface-card:hover { border-color: #bbb; box-shadow: var(--shadow-sm); }

.iface-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.iface-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.iface-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.iface-card-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

.iface-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.iface-url {
  font-size: 10.5px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #555;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  white-space: nowrap;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.iface-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: opacity 0.12s;
}
.iface-launch-btn:hover { opacity: 0.82; }

/* ─── Settings: Partners Tab ────────────────────────────────────────────── */
.partner-builder { display: flex; flex-direction: column; gap: 16px; }

.partner-selects { display: flex; gap: 10px; }

.partner-select-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.partner-select-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.partner-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.partner-select:focus { border-color: var(--text); }

.partner-url-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.partner-url-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.partner-url-box {
  flex: 1;
  font-size: 11.5px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #555;
  font-weight: 500;
  word-break: break-all;
  letter-spacing: -0.01em;
}

/* ─── Utility ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Skeleton Loader ───────────────────────────────────────────────────── */
.skeleton-view {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 32px 60px;
}

.skeleton {
  background: linear-gradient(90deg, #EAEAE5 25%, #DDDDD8 50%, #EAEAE5 75%);
  background-size: 300% 100%;
  animation: shimmer 1.6s infinite ease-in-out;
  border-radius: 4px;
  display: block;
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.sk-user-row { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.sk-bubble { width: 220px; height: 40px; border-radius: 16px 16px 4px 16px; }

.sk-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
}
.sk-icon { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; }
.sk-card-lines { flex: 1; }
.sk-btn { width: 90px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0; }

.sk-sources-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sk-sources-badge { height: 30px; border-radius: 100px; width: 140px; flex-shrink: 0; }
.sk-source-pill { height: 30px; border-radius: 100px; width: 90px; flex-shrink: 0; }
.sk-inline-ad { height: 90px; border-radius: var(--radius); width: 100%; margin-bottom: 24px; }
.sk-article { margin-bottom: 24px; }
.sk-h2 { height: 22px; width: 72%; border-radius: 4px; }
.sk-line { height: 14px; border-radius: 4px; }

.sk-afs {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 0;
  margin: 8px 0 24px;
}
.sk-afs-item { height: 52px; border-radius: var(--radius-sm); width: 100%; }


/* ─── AFS visit link ────────────────────────────────────────────────────── */
.afs-ad-item { cursor: pointer; }
.afs-visit-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* ─── Related Searches ──────────────────────────────────────────────────── */
.related-searches {
  margin: 20px 0;
}

.rs-header {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rs-chips { display: block; }

.rs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.1s;
  background: none;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
}

.rs-item:first-child { border-top: 1px solid var(--border-soft); }
.rs-item:hover { background: var(--bg); }

.rs-text {
  font-size: 14px;
  font-weight: 700;
  color: #1a0dab;
  line-height: 1.45;
  flex: 1;
  padding-right: 12px;
}

.rs-chevron { color: #1a0dab; flex-shrink: 0; }

/* ─── Shop Unit (Display Ads) ───────────────────────────────────────────── */
.shop-unit {
  margin: 20px 0;
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shop-header-left {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.shop-sponsored {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.shop-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  font-family: var(--font-sans);
}

.shop-menu-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
  transition: background 0.12s;
}
.shop-menu-btn:hover { background: var(--bg); }

.shop-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.shop-track::-webkit-scrollbar { display: none; }

.shop-card {
  flex-shrink: 0;
  width: 158px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.15s;
  overflow: hidden;
}

.shop-card:hover { box-shadow: var(--shadow-md); }

.shop-img {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F5F3;
  border-bottom: 1px solid var(--border-soft);
}

.shop-img-letter {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  opacity: 0.18;
  color: var(--text);
}

.shop-body { padding: 10px 10px 12px; }

.shop-name {
  font-size: 13px;
  font-weight: 400;
  color: #1a0dab;
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.shop-store {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ─── Intent Chips Bar ──────────────────────────────────────────────────── */
#intent-chips-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 16px 6px;
  pointer-events: all;
  max-width: 716px;
  margin: 0 auto;
  width: 100%;
}

#intent-chips-bar::-webkit-scrollbar { display: none; }

#intent-chips-bar.chips-updating {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
#intent-chips-bar.chips-updated {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s;
}

.chips-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  white-space: nowrap;
}

.intent-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid #000;
  border-radius: 100px;
  font-size: 12.5px;
  color: #fff;
  background: #000;
  font-weight: 500;
  transition: all 0.12s;
  white-space: nowrap;
}

.intent-chip:hover {
  border-color: #333;
  background: #333;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

/* ─── Sources Sidebar Fixed Ad Slots ────────────────────────────────────── */
.sources-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sb-fixed-ad {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.sb-fixed-ad-bottom {
  border-bottom: none;
  border-top: 1px solid var(--border);
}

/* ─── Ad Sidebar Content ────────────────────────────────────────────────── */
.ad-sb-content { padding: 4px 2px; }

.ad-sb-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #1a0dab;
  line-height: 1.4;
  margin-bottom: 4px;
}

.ad-sb-domain {
  font-size: 12px;
  color: #006621;
  margin-bottom: 8px;
}

.ad-sb-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  font-weight: 300;
}

.ad-sb-more-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 16px 0 10px;
}

.ad-sb-result {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.ad-sb-result:last-child { border-bottom: none; }

.ad-sb-result-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #1a0dab;
  margin-bottom: 2px;
  line-height: 1.35;
}

.ad-sb-result-url {
  font-size: 11.5px;
  color: #006621;
  margin-bottom: 4px;
}

.ad-sb-result-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 300;
}

/* ─── Conversation blocks ───────────────────────────────────────────────── */
.conversation-block { scroll-margin-top: 48px; }

.conversation-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0 28px;
}

/* ─── Sidebar back button ────────────────────────────────────────────────── */
.sb-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 4px 0 16px;
  cursor: pointer;
  transition: color 0.12s;
}
.sb-back-btn:hover { color: var(--accent); }

/* ─── Source header row inside sidebar ───────────────────────────────────── */
.sb-source-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}

/* ─── Article cards in source sidebar ────────────────────────────────────── */
.sb-article-card {
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.sb-article-card:last-child { border-bottom: none; }
.sb-article-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  padding-right: 20px;
}
.sb-article-card-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.sb-article-card .source-card-chevron {
  position: absolute;
  top: 14px;
  right: 0;
  color: var(--text-light);
}

.source-read-btn-full {
  width: 100%;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.source-read-btn-full:hover { background: var(--accent-hover); }

.source-card { cursor: pointer; }
.source-card-chevron { margin-left: auto; color: var(--text-muted); flex-shrink: 0; }

/* ─── Source card highlighted state ────────────────────────────────────── */
.source-card-highlighted {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

/* ─── v1.1 prose polish (appended) ──────────────────────────────────────── */
/* Fallback styling for un-rewritten <div class="section-block"> paragraphs */
.article-section .section-block {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 300;
}

/* Article lists — legacy CSS didn't style these */
.article-section ul,
.article-section ol {
  margin: 6px 0 12px 20px;
  padding-left: 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 300;
}

.article-section ul { list-style: disc; }
.article-section ol { list-style: decimal; }

.article-section li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.article-section li::marker {
  color: var(--accent, #0f5e3e);
}

.article-section li strong {
  font-weight: 600;
  color: var(--text);
}

/* Slightly tighter space between consecutive paragraphs */
.article-section p + p { margin-top: 6px; }

/* Ensure table body cells inherit Inter */
.article-table th,
.article-table td {
  font-family: var(--font-sans);
}

/* Alternating row tint for legibility */
.article-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--sidebar-bg) 40%, transparent);
}

/* First column (usually Feature / Label) — subtle emphasis */
.article-table tbody td:first-child { font-weight: 500; }

/* ─── v1.2 sources sidebar: Explore Now CTA ────────────────────────────── */
.source-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #0f5e3e);
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.source-card-cta svg {
  transition: transform 0.15s ease;
}
.source-card:hover .source-card-cta {
  color: var(--accent, #0f5e3e);
}
.source-card:hover .source-card-cta svg {
  transform: translateX(2px);
}
/* Uniform snippet clamp for visual rhythm — complements the 50-word JS clamp */
.source-card .source-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
}
