/* ============================================================================
   AI MODE (chat.theme.php)
   Loaded after app.css. Reuses its tokens (--font-sans, --radius*, --shadow-*,
   --accent, --ease) and the AI overview's blue-violet-teal identity so the
   chat reads as the same product as the overview box on the results pages.
   Every rule is scoped under .aic-* so nothing here leaks into other pages.
   ========================================================================== */

:root{
  --aic-grad: linear-gradient(120deg,#4c8dfb,#845ef7 55%,#1abc9c);
  --aic-grad-soft: linear-gradient(135deg, rgba(76,141,251,.14), rgba(132,94,247,.14));
  --aic-ink:#0e1116;
  --aic-text:#1f2937;
  --aic-muted:#5b6472;
  --aic-faint:#8b93a1;
  --aic-line:#e7eaf0;
  --aic-card:#ffffff;
  --aic-violet:#845ef7;
  --aic-violet-ink:#4c3fb3;
  --aic-blue:#0b5ed7;
  --aic-bg:#f7f9fc;
  --aic-header-h:84px;
}

/* --- Page frame ------------------------------------------------------------ */
body.aic-page{
  background-image:
    radial-gradient(900px 420px at 50% -140px, rgba(132,94,247,.11), transparent 70%),
    radial-gradient(700px 360px at 85% 12%, rgba(26,188,156,.07), transparent 70%);
  background-repeat:no-repeat;
}
/* flex-shrink:0 matters: body is a flex column, and an explicit min-height
   replaces the automatic one, so without it this wrapper shrank to one screen
   and the sticky header (and the results column pinned under it) stopped
   sticking once the conversation ran past the first screen. */
.aic-content{ display:flex; flex-direction:column; flex:1 0 auto; min-height:100%; }
.aic-main{ flex:1 1 auto; }
.aic-wrap{
  width:100%; max-width:880px;
  margin:0 auto; padding:0 18px;
}

/* Topics | conversation | results. The Topics column is the search pages'
   own (app.css, components.navigation.css). The conversation column is at
   least one screen tall, so "Latest" can stick to the bottom of it. */
.aic-stage{ padding-left:0; padding-right:0; }
.aic-cols{ margin-left:0; margin-right:0; }
.aic-col-chat{
  display:flex; flex-direction:column;
  min-height:calc(var(--vh, 100vh) - var(--search-header-height, var(--aic-header-h)));
  padding-left:0; padding-right:0; min-width:0;
}
.aic-col-chat > .aic-wrap{ flex:1 1 auto; }

/* --- Hero (empty state) ------------------------------------------------------ */
.aic-hero{ text-align:center; padding:30px 0 26px; }
.aic-hero.is-hidden{ display:none; }
.aic-orb{
  width:66px; height:66px; border-radius:50%;
  background:var(--aic-grad); color:#fff;
  display:grid; place-items:center; margin:0 auto 16px;
  box-shadow:0 14px 34px -10px rgba(132,94,247,.6), 0 0 0 8px rgba(132,94,247,.08);
  animation:aic-float 5.5s ease-in-out infinite;
}
.aic-orb svg{ width:32px; height:32px; }
.aic-kicker{
  font-size:11.5px; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:var(--aic-violet); margin-bottom:6px;
}
.aic-hero-title{
  font-size:clamp(26px, 3.6vw, 38px); font-weight:700; letter-spacing:-.022em;
  line-height:1.15; color:var(--aic-ink); margin:0 0 12px;
}
.aic-hero-intro{
  color:var(--aic-muted); font-size:15.5px; line-height:1.62;
  max-width:62ch; margin:0 auto 28px;
}
.aic-topic-hero{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  margin:-10px 0 24px;
}
.aic-topic-label{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--aic-faint);
}
.aic-topic-label .ico{ width:13px; height:13px; }
.aic-topic-name{ font-weight:650; font-size:15.5px; color:var(--aic-violet-ink); text-decoration:none; }
.aic-topic-name:hover{ text-decoration:underline; }
.aic-topic-desc{ color:var(--aic-muted); font-size:13.5px; max-width:64ch; line-height:1.5; }

.aic-starters{
  display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px;
  text-align:left; margin:0 auto; max-width:760px;
}
.aic-starter{
  display:flex; align-items:center; gap:12px;
  background:var(--aic-card); border:1px solid var(--aic-line); border-radius:14px;
  padding:12px 12px 12px 12px; font:inherit; font-size:14px; line-height:1.4; color:var(--aic-ink);
  text-align:left; cursor:pointer; box-shadow:var(--shadow-1,0 1px 2px rgba(16,24,40,.05));
  transition:box-shadow .18s var(--ease,ease), border-color .18s ease, transform .12s ease;
  animation:aic-rise .5s var(--ease,ease) both;
  animation-delay:calc(var(--i, 0) * 55ms + 80ms);
}
.aic-starter:hover{ border-color:#c9d3e6; box-shadow:var(--shadow-2,0 6px 20px rgba(16,24,40,.09)); transform:translateY(-1px); }
.aic-starter:active{ transform:translateY(0); }
.aic-starter:focus-visible{ outline:3px solid rgba(132,94,247,.35); outline-offset:2px; }
.aic-starter-ico{
  width:34px; height:34px; border-radius:10px; flex:0 0 auto;
  background:var(--aic-grad-soft); color:#5b6cf5;
  display:grid; place-items:center;
}
.aic-starter-ico .ico{ width:17px; height:17px; }
.aic-starter-text{ flex:1 1 auto; min-width:0; }
.aic-starter-go{ color:#a3adba; flex:0 0 auto; }
.aic-starter-go .ico{ width:14px; height:14px; }
.aic-starter:hover .aic-starter-go{ color:var(--aic-violet); }

/* "In the news now": the latest headlines as questions (chat.js). */
.aic-trending{ max-width:760px; margin:22px auto 0; text-align:left; }
.aic-trending[hidden]{ display:none; }
.aic-trending-head{
  display:flex; align-items:center; gap:7px; margin:0 2px 8px;
  font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--aic-faint);
}
.aic-trending-head .ico{ width:14px; height:14px; }
.aic-trending-list{ display:grid; gap:6px; }
.aic-trend{
  display:flex; align-items:center; gap:11px; width:100%;
  background:transparent; border:1px solid transparent; border-radius:12px;
  padding:8px 10px; font:inherit; font-size:14px; line-height:1.4; color:var(--aic-ink);
  text-align:left; cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
  animation:aic-rise .45s var(--ease,ease) both; animation-delay:calc(var(--i, 0) * 50ms + 120ms);
}
.aic-trend:hover{ background:var(--aic-card); border-color:var(--aic-line); }
.aic-trend:focus-visible{ outline:3px solid rgba(132,94,247,.35); outline-offset:2px; }
.aic-trend-n{
  flex:0 0 auto; display:grid; place-items:center; width:24px; height:24px; border-radius:8px;
  background:var(--aic-grad-soft); color:var(--aic-violet-ink); font-size:12px; font-weight:700;
}
.aic-trend-text{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aic-trend-go{ width:13px; height:13px; flex:0 0 auto; color:#a3adba; }
.aic-trend:hover .aic-trend-go{ color:var(--aic-violet); }

.aic-unavailable{ text-align:center; padding:64px 0 32px; color:var(--aic-muted); }
.aic-unavailable .aic-hero-title{ font-size:24px; margin-top:14px; }
.aic-unavailable p{ max-width:60ch; margin:0 auto; }
.aic-unavailable code{ background:rgba(16,24,40,.06); padding:.05em .4em; border-radius:5px; }

/* --- Thread ----------------------------------------------------------------- */
.aic-thread{ display:flex; flex-direction:column; gap:24px; padding:22px 0 10px; }
.aic-thread:empty{ padding:0; }
.aic-thread-end{ height:1px; scroll-margin-bottom:var(--aic-dock-h, 0px); }
.aic-turn{ animation:aic-rise .38s var(--ease,ease) both; scroll-margin-top:calc(var(--search-header-height, var(--aic-header-h)) + 10px); }

.aic-turn-user{ display:flex; justify-content:flex-end; }
/* The last question can be edited and asked again (chat.js marks the last
   turns is-last; nothing is offered while an answer is on its way). */
.aic-user-wrap{ display:flex; flex-direction:column; align-items:flex-end; gap:3px; max-width:82%; min-width:0; }
.aic-edit{
  display:none; align-items:center; gap:5px;
  border:0; background:transparent; border-radius:7px;
  color:var(--aic-faint); font:inherit; font-size:12px; padding:2px 7px; cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
.aic-edit .ico{ width:13px; height:13px; }
.aic-edit:hover{ background:#f3f4f6; color:var(--aic-ink); }
.aic-turn-user.is-last .aic-edit{ display:inline-flex; }
.aic-thread.is-busy .aic-edit, .aic-thread.is-full .aic-edit{ display:none; }
.aic-user-bubble{
  max-width:100%;
  background:linear-gradient(135deg,#e9eefc,#eef2ff);
  color:var(--aic-text); border:1px solid #dfe6fb;
  border-radius:20px 20px 6px 20px; padding:11px 16px;
  font-size:15.5px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

.aic-user-files{
  display:flex; align-items:center; gap:6px; margin-top:6px; max-width:100%;
  font-size:12.5px; color:#5b6472; overflow:hidden;
}
.aic-user-files svg{ width:14px; height:14px; flex:0 0 auto; fill:#845ef7; }
.aic-user-files span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html[data-fs-theme="dark"] .aic-user-files{ color:#9aa7b6; }
html[data-fs-theme="dark"] .aic-user-files svg{ fill:#a98bff; }

.aic-turn-ai{
  position:relative;
  background:var(--aic-card); border:1px solid var(--aic-line); border-radius:18px;
  padding:16px 20px 14px; box-shadow:var(--shadow-1,0 1px 2px rgba(16,24,40,.05));
}
.aic-turn-ai::before{
  content:""; position:absolute; top:-1px; left:22px; right:22px; height:2px;
  background:var(--aic-grad); border-radius:0 0 3px 3px; opacity:.85;
}
.aic-ai-head{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.aic-badge{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--aic-grad); color:#fff;
  font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  padding:4px 10px; border-radius:999px; white-space:nowrap;
}
.aic-badge .ico{ width:12px; height:12px; }
.aic-badge-lg{ font-size:12.5px; padding:6px 14px; }
.aic-badge-lg .ico{ width:15px; height:15px; }
.aic-turn-ai.is-pending .aic-badge{ animation:aic-pulse 1.6s ease-in-out infinite; }
.aic-ai-meta{ margin-left:auto; font-size:12px; color:var(--aic-faint); white-space:nowrap; }

/* answer typography */
.aic-ai-body{ font-size:15.5px; line-height:1.68; color:var(--aic-text); overflow-wrap:break-word; }
.aic-ai-body > :first-child{ margin-top:0; }
.aic-ai-body > :last-child{ margin-bottom:0; }
.aic-ai-body p{ margin:0 0 .75rem; }
.aic-ai-body h3.aic-h{ font-size:17px; font-weight:650; letter-spacing:-.01em; margin:1.05rem 0 .4rem; color:var(--aic-ink); }
.aic-ai-body h4.aic-h{ font-size:15.5px; font-weight:650; margin:.9rem 0 .3rem; color:var(--aic-ink); }
.aic-ai-body ul, .aic-ai-body ol{ margin:.15rem 0 .8rem 1.3rem; padding:0; }
.aic-ai-body li{ margin:.22rem 0; }
.aic-ai-body li > ul, .aic-ai-body li > ol{ margin:.2rem 0 .25rem 1.1rem; }
.aic-ai-body ul{ list-style:disc; }
.aic-ai-body ul ul{ list-style:circle; }
.aic-ai-body strong{ font-weight:650; color:var(--aic-ink); }
.aic-ai-body em{ font-style:italic; }
.aic-ai-body del{ color:var(--aic-faint); }
.aic-ai-body code{
  background:rgba(16,24,40,.06); padding:.08em .4em; border-radius:5px; font-size:.9em;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.aic-ai-body pre.aic-code{
  background:#0f172a; color:#e2e8f0; padding:12px 14px; border-radius:12px;
  overflow:auto; font-size:13px; line-height:1.55; margin:.4rem 0 .9rem;
}
.aic-ai-body pre.aic-code code{ background:transparent; padding:0; color:inherit; font-size:inherit; }
.aic-ai-body blockquote.aic-quote{
  border-left:3px solid var(--aic-violet); margin:.4rem 0 .9rem; padding:2px 0 2px 14px; color:#4b5563;
}
.aic-ai-body blockquote.aic-quote p:last-child{ margin-bottom:0; }
.aic-ai-body .aic-table-wrap{
  overflow-x:auto; margin:.4rem 0 .95rem;
  border:1px solid var(--aic-line); border-radius:12px; background:#fff;
}
.aic-ai-body table.aic-table{ width:100%; border-collapse:collapse; font-size:14px; margin:0; }
.aic-ai-body .aic-table th{
  background:#f5f7fb; text-align:left; font-weight:650; padding:9px 12px;
  border-bottom:1px solid var(--aic-line); white-space:nowrap; color:var(--aic-ink);
}
.aic-ai-body .aic-table td{ padding:8px 12px; border-bottom:1px solid #eef1f5; vertical-align:top; }
.aic-ai-body .aic-table tr:last-child td{ border-bottom:0; }
.aic-ai-body .aic-table tbody tr:nth-child(even) td{ background:#fbfcfe; }
.aic-ai-body hr.aic-hr{ border:0; border-top:1px solid var(--aic-line); margin:.9rem 0; }
.aic-ai-body a.aic-link{
  color:var(--aic-blue); text-decoration:underline;
  text-decoration-color:rgba(11,94,215,.35); text-underline-offset:2px;
  transition:text-decoration-color .15s ease;
}
.aic-ai-body a.aic-link:hover{ text-decoration-color:currentColor; }

/* Code blocks carry a copy button (chat.js wraps them). */
.aic-ai-body .aic-code-wrap{ position:relative; }
.aic-code-copy{
  position:absolute; top:6px; right:6px;
  border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.08); color:#e2e8f0;
  font:inherit; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:6px;
  cursor:pointer; opacity:.85; transition:opacity .15s ease, background .15s ease;
}
.aic-code-copy:hover{ opacity:1; background:rgba(255,255,255,.16); }

/* --- Sources and citations ------------------------------------------------
   An answer built on the site's news cites its articles as numbered chips
   (server HTML: .aic-cites > a.aic-cite) and lists them under the answer
   (chat.js: .aic-sources). A chip and its source light up together. */
.aic-ai-body .aic-cites{ display:inline-flex; gap:3px; margin-left:3px; vertical-align:1px; white-space:nowrap; }
.aic-ai-body a.aic-cite{
  display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#eef1fb; border:1px solid #d9def3; color:var(--aic-violet-ink);
  font-size:11px; font-weight:700; line-height:1; text-decoration:none !important;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.aic-ai-body a.aic-cite:hover, .aic-ai-body a.aic-cite.is-hot,
.aic-ai-body a.aic-cite:focus-visible{ background:var(--aic-violet); border-color:var(--aic-violet); color:#fff; }

.aic-sources{ margin-top:16px; }
.aic-sources-head{
  display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; margin-bottom:8px;
  font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--aic-faint);
}
.aic-sources-head .ico{ width:14px; height:14px; }
.aic-sources-title{ color:var(--aic-muted); }
.aic-sources-note{ font-size:12px; font-weight:600; letter-spacing:.01em; text-transform:none; }
.aic-sources-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.aic-src{
  display:flex; flex-direction:column; gap:5px; min-width:0;
  padding:9px 11px 10px; border-radius:12px;
  background:var(--aic-bg); border:1px solid var(--aic-line); color:var(--aic-text);
  text-decoration:none !important;
  transition:border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.aic-src:hover, .aic-src.is-hot, .aic-src:focus-visible{
  border-color:rgba(132,94,247,.5); background:var(--aic-card);
  box-shadow:0 4px 14px -6px rgba(16,24,40,.2);
}
.aic-src.is-extra{ display:none; }
.aic-sources.is-open .aic-src.is-extra{ display:flex; }
.aic-src-top{ display:flex; align-items:center; gap:6px; min-width:0; font-size:12px; color:var(--aic-muted); }
.aic-src-n{
  flex:0 0 auto; display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#e9edf3; color:var(--aic-muted); font-size:10.5px; font-weight:700;
}
.aic-src.is-cited .aic-src-n{ background:var(--aic-grad); color:#fff; }
.aic-fav{ width:16px; height:16px; border-radius:4px; flex:0 0 auto; }
.aic-src-site{ font-weight:600; color:var(--aic-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.aic-src-ago{ flex:0 0 auto; color:var(--aic-faint); }
.aic-src-ago::before{ content:"\00b7"; margin-right:6px; }
.aic-src-title{
  font-size:13.5px; line-height:1.35; color:var(--aic-ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.aic-sources-more{
  margin-top:8px; border:0; background:transparent; padding:4px 2px;
  font:inherit; font-size:12.5px; font-weight:600; color:var(--aic-violet-ink); cursor:pointer;
}
.aic-sources-more:hover{ text-decoration:underline; }

/* While an answer is being written from its sources: whose articles. */
.aic-reading{ display:flex; flex-wrap:wrap; gap:6px; }
.aic-reading-item{
  display:inline-flex; align-items:center; gap:6px; max-width:190px;
  padding:3px 10px 3px 5px; border-radius:999px;
  background:var(--aic-bg); border:1px solid var(--aic-line); font-size:12px; color:var(--aic-muted);
  animation:aic-rise .35s var(--ease,ease) both;
}
.aic-reading-item span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aic-reading-item:nth-child(2){ animation-delay:.06s; }
.aic-reading-item:nth-child(3){ animation-delay:.12s; }
.aic-reading-item:nth-child(4){ animation-delay:.18s; }
.aic-reading-item:nth-child(5){ animation-delay:.24s; }
.aic-reading-item:nth-child(6){ animation-delay:.3s; }

/* --- Links that open in the results column -----------------------------------
   A News search linked in an answer shows its results in the column beside
   the chat instead of leaving the page. The column icon says so before the
   click; the link stays marked while the column shows its search. */
.aic-panel-ico{ width:.9em !important; height:.9em !important; margin-left:4px; vertical-align:-.08em; opacity:.6; flex:0 0 auto; }
.aic-ai-body a.aic-panel-link.is-shown{
  background:rgba(132,94,247,.12); border-radius:4px;
  box-shadow:0 0 0 2px rgba(132,94,247,.12); text-decoration-color:currentColor;
}
.aic-chip.aic-panel-link.is-shown, .aic-action.aic-panel-link.is-shown{ box-shadow:0 0 0 2px rgba(132,94,247,.5); }
.aic-panel-link.is-shown .aic-panel-ico{ opacity:1; color:var(--aic-violet); }

/* The note at a link whose search went to the column. */
.aic-tip{
  position:absolute; z-index:1080; max-width:260px;
  padding:7px 11px; border-radius:9px; background:#1f2533; color:#fff;
  font-size:12.5px; line-height:1.35; box-shadow:0 10px 26px -8px rgba(0,0,0,.45);
  opacity:0; transform:translateY(-4px); transition:opacity .18s ease, transform .18s ease; pointer-events:none;
}
.aic-tip.is-on{ opacity:1; transform:none; }

/* streaming + thinking */
.aic-stream{ white-space:pre-wrap; }
.aic-stream-md > :last-child{ display:inline; }
.aic-stream-md .aic-stream-row{ font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; color:var(--aic-muted); white-space:pre-wrap; }
.aic-stream-md a.aic-link{ color:var(--aic-blue); text-decoration:underline; text-decoration-color:rgba(11,94,215,.35); }
.aic-cursor{
  display:inline-block; width:8px; height:1.05em; margin-left:2px; vertical-align:-2px;
  background:var(--aic-grad); border-radius:2px; animation:aic-blink 1s steps(2) infinite;
}
.aic-thinking{ display:flex; flex-direction:column; gap:11px; padding:2px 0 4px; }
.aic-thinking-label{
  display:inline-flex; align-items:center; gap:8px;
  font-size:13px; font-weight:600; color:var(--aic-violet);
}
.aic-dots{ display:inline-flex; gap:3px; }
.aic-dots i{
  width:5px; height:5px; border-radius:50%; background:var(--aic-violet); opacity:.35;
  animation:aic-dot 1.2s ease-in-out infinite;
}
.aic-dots i:nth-child(2){ animation-delay:.15s; }
.aic-dots i:nth-child(3){ animation-delay:.3s; }
.aic-shimmer{
  height:12px; border-radius:6px;
  background:linear-gradient(90deg,#eef1f6 25%,#e3e9f1 45%,#eef1f6 65%);
  background-size:200% 100%; animation:aic-shimmer 1.2s linear infinite;
}

/* chips under an answer */
.aic-links, .aic-suggest{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.aic-chips-label{
  width:100%; font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--aic-faint); margin-bottom:-2px;
}
.aic-chip{
  display:inline-flex; align-items:center; gap:7px;
  padding:6px 12px 6px 10px; border-radius:999px;
  background:#eef3f9; border:1px solid #dde6f0; color:var(--aic-blue);
  font:inherit; font-size:13px; line-height:1.3; text-decoration:none !important; cursor:pointer;
  max-width:100%; transition:background .15s ease, border-color .15s ease, transform .08s ease;
}
.aic-chip .ico{ width:14px; height:14px; flex:0 0 auto; }
.aic-chip span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aic-chip:hover{ background:#e2ebf5; }
.aic-chip:active{ transform:translateY(1px); }
.aic-chip-news{ background:#fff5e8; border-color:#fbe1bd; color:#b45309; }
.aic-chip-news:hover{ background:#ffedd5; }
.aic-chip-shopping{ background:#ecfdf5; border-color:#c7f0dd; color:#047857; }
.aic-chip-shopping:hover{ background:#d9f7ea; }
.aic-chip-topic{ background:#f3f0ff; border-color:#ddd5fb; color:var(--aic-violet-ink); }
.aic-chip-topic:hover{ background:#ebe5ff; }
.aic-suggest .aic-chip{ background:#fff; border-color:#d9d2fb; color:var(--aic-violet-ink); }
.aic-suggest .aic-chip:hover{ background:#f6f3ff; border-color:#c4b8f7; }
.aic-chip-finance{ background:#eefaf6; border-color:#cdeee2; color:#0f766e; }
.aic-chip-finance:hover{ background:#ddf5ec; }
/* "Not in these sources?": a search that answers again (chat.js searchNextNode). */
.aic-more{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-top:14px; padding:10px 12px;
  border:1px dashed #f2cf9c; border-radius:12px; background:#fffaf2; }
.aic-more-label{ font-size:13px; font-weight:600; color:var(--aic-text); }
.aic-more .aic-chip span{ white-space:normal; }

/* actions row */
.aic-actions{
  display:flex; flex-wrap:wrap; gap:2px; margin-top:12px; padding-top:9px;
  border-top:1px dashed #e5e9f0;
}
.aic-action{
  display:inline-flex; align-items:center; gap:6px;
  background:transparent; border:0; border-radius:8px;
  color:#6b7280; font:inherit; font-size:12.5px; padding:5px 9px; cursor:pointer;
  text-decoration:none !important; transition:background .15s ease, color .15s ease;
}
.aic-action .ico{ width:14px; height:14px; }
.aic-action:hover{ background:#f3f4f6; color:var(--aic-ink); }
.aic-action.is-done{ color:#047857; }
.aic-action.aic-listen.is-on{ background:var(--aic-grad-soft); color:var(--aic-violet-ink); }
/* Regenerate and Continue belong to the latest answer only, and wait while
   another answer is on its way or the chat is full. */
.aic-regen, .aic-continue{ display:none !important; }
.aic-turn-ai.is-last .aic-regen, .aic-turn-ai.is-last .aic-continue{ display:inline-flex !important; }
.aic-thread.is-busy .aic-regen, .aic-thread.is-full .aic-regen,
.aic-thread.is-busy .aic-continue, .aic-thread.is-full .aic-continue{ display:none !important; }

/* error + stopped states */
.aic-turn-ai.is-error{ border-color:#f3c7c7; background:#fff8f8; }
.aic-turn-ai.is-error::before{ background:#dc3545; }
.aic-error-text{ color:#9f1239; font-size:14.5px; margin:0 0 4px; }
.aic-stopped{ font-size:12.5px; color:var(--aic-faint); margin-top:8px; font-style:italic; }
.aic-continue{
  align-items:center; gap:5px; margin-left:4px; vertical-align:middle;
  border:1px solid var(--aic-line); background:var(--aic-card); color:var(--aic-violet-ink);
  border-radius:999px; font:inherit; font-size:12px; font-weight:600; font-style:normal;
  padding:2px 10px 2px 8px; cursor:pointer;
}
.aic-continue .ico{ width:12px; height:12px; }
.aic-continue:hover{ background:var(--aic-grad-soft); }

/* --- The box ---------------------------------------------------------------- */
/* While the conversation is empty the box sits at the top of the column,
   over the intro and starter prompts. From the first question on chat.js
   moves it below the conversation (.is-bottom), docked to the bottom of the
   screen as chat boxes are, the fade hiding the thread scrolling under it;
   its menus then open upwards. It is the search box's card (app.css
   #searchgroup) and bar (searchbox.css, form[data-fs-sbx]).
   Here only what the chat adds: its textarea (not .search-input, whose
   ui.js handling would fold a message onto one line), the editing and topic
   rows above the words, and the message count, Stop and Send in the bar. */
.aic-dock{ position:relative; z-index:30; padding:16px 0 0; }
.aic-dock.is-bottom{
  position:sticky; bottom:0; z-index:20;
  padding:14px 0 12px; margin-top:auto;
  background:linear-gradient(180deg, rgba(247,249,252,0) 0%, rgba(247,249,252,.94) 26%, var(--aic-bg) 60%);
}
.aic-dock .aic-wrap{ position:relative; }
/* Docked at the bottom, the menus open above the card: the bar stops being
   their box, so the card (#searchgroup, position:relative) is. */
.aic-dock.is-bottom .fs-sbx-bar{ position:static; }
.aic-dock.is-bottom .fs-sbx-menu{ top:auto; bottom:calc(100% + 10px); }
.aic-composer{ display:flex; }
/* The column, not the screen, sets the room the bar has: when it is narrow,
   New chat, Save and Results are their icons (titles keep the words). */
.aic-dock{ container-type:inline-size; }
@container (max-width: 860px){
  .aic-sbx-chat > span:not(.aic-to-results-n){ display:none; }
  .aic-composer .aic-meter-word{ display:none; }
}
.aic-composer.is-disabled #searchgroup{ opacity:.7; }
#searchgroup:focus-within{ border-color:var(--aic-violet); box-shadow:0 0 0 4px rgba(132,94,247,.2), 0 12px 32px -10px rgba(9,14,22,.35); }
#searchgroup .aic-input{ flex:1 1 100%; width:100%; min-height:38px; max-height:132px; padding:.45rem .2rem .3rem; font-size:15.5px; }
.aic-composer .aic-editing,
.aic-composer .aic-topic-row{ flex:1 1 100%; order:-2; min-width:0; }
.aic-composer .aic-topic-row{ margin:4px 0 0; }
.aic-composer .aic-editing{ margin:4px 0 0; }
.aic-composer .aic-meter{ margin:0 6px 0 4px; white-space:nowrap; }
.aic-composer .fs-sbx-send.aic-send:disabled{ background:#e3e7ee; color:#a3adba; box-shadow:none; cursor:default; transform:none; }
.aic-composer .fs-sbx-send.aic-stop{ background:#0f172a; color:#fff; box-shadow:none; }
.aic-to-results-n{
  min-width:18px; padding:0 6px; border-radius:999px;
  background:var(--aic-violet); color:#fff; font-size:11px; font-weight:700; line-height:18px; text-align:center;
}

/* Editing the last question: what sending will do, and the way out. */
.aic-editing{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:0 0 6px; padding:5px 6px 5px 11px; border-radius:10px;
  background:var(--aic-grad-soft); color:var(--aic-violet-ink); font-size:12.5px; font-weight:600;
}
.aic-editing[hidden]{ display:none; }
.aic-editing-cancel{
  border:0; background:transparent; color:inherit; font:inherit; font-size:12.5px;
  text-decoration:underline; padding:2px 6px; cursor:pointer; flex:0 0 auto;
}

/* "Latest": back to the end of the conversation when it is out of view.
   Centred with margins, not a transform: the entrance animation ends on
   transform:none and would undo one. */
.aic-jump{
  position:absolute; bottom:calc(100% + 8px); left:0; right:0; margin:0 auto; width:max-content; z-index:2;
  display:flex; align-items:center; gap:6px;
  padding:6px 13px 6px 10px; border-radius:999px;
  border:1px solid var(--aic-line); background:var(--aic-card); color:var(--aic-text);
  font:inherit; font-size:12.5px; font-weight:600; cursor:pointer;
  box-shadow:0 6px 18px -6px rgba(16,24,40,.32);
  animation:aic-rise .25s var(--ease,ease) both;
}
.aic-jump[hidden]{ display:none; }
.aic-jump .ico{ width:14px; height:14px; }
.aic-jump:hover{ color:var(--aic-ink); border-color:#c9d3e6; }

/* Short confirmations (link copied, chat saved). */
.aic-toast{
  position:fixed; left:50%; bottom:calc(var(--aic-dock-h, 120px) + 16px); z-index:1080;
  transform:translate(-50%, 8px); max-width:min(92vw, 440px);
  padding:9px 15px; border-radius:10px; background:#1f2533; color:#fff;
  font-size:13px; line-height:1.4; text-align:center;
  box-shadow:0 12px 28px -10px rgba(0,0,0,.45);
  opacity:0; transition:opacity .2s ease, transform .2s ease; pointer-events:none;
}
.aic-toast.is-on{ opacity:1; transform:translate(-50%, 0); }
.aic-input{
  display:block; width:100%; border:0; outline:0; resize:none; background:transparent;
  font:inherit; font-size:16px; line-height:1.5; color:var(--aic-ink);
  padding:6px 4px 4px; min-height:32px; max-height:220px; overflow-y:auto;
}
.aic-input::placeholder{ color:#93a0af; }
.aic-input:disabled{ color:#93a0af; }
.aic-meter{ display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--aic-faint); margin-right:6px; }
.aic-meter-track{ width:58px; height:5px; border-radius:3px; background:#e9edf3; overflow:hidden; }
.aic-meter-fill{ display:block; height:100%; width:0; background:var(--aic-grad); transition:width .35s var(--ease,ease); }
.aic-meter.is-warn .aic-meter-fill{ background:#f59e0b; }
.aic-meter.is-full .aic-meter-fill{ background:#dc3545; }
.aic-meter.is-full .aic-meter-text{ color:#dc3545; font-weight:600; }
.aic-send, .aic-stop{
  width:40px; height:40px; border-radius:50%; border:0; flex:0 0 auto;
  display:grid; place-items:center; cursor:pointer;
  transition:transform .15s var(--ease,ease), box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.aic-send{ background:var(--aic-grad); color:#fff; box-shadow:0 4px 12px rgba(132,94,247,.38); }
.aic-send svg{ width:20px; height:20px; }
.aic-send:hover:not(:disabled){ transform:scale(1.07); box-shadow:0 6px 16px rgba(132,94,247,.5); }
.aic-send:active:not(:disabled){ transform:scale(.94); }
.aic-send:disabled{ background:#e3e7ee; color:#a3adba; box-shadow:none; cursor:default; }
.aic-stop{ background:#0f172a; color:#fff; }
.aic-stop:hover{ transform:scale(1.07); }
.aic-stop-square{ width:12px; height:12px; border-radius:2px; background:#fff; }
.aic-topic-row{ margin:0 0 6px; }
.aic-topic-chip{
  display:inline-flex; align-items:center; gap:6px; max-width:100%;
  background:var(--aic-grad-soft); color:var(--aic-violet-ink);
  border-radius:999px; padding:4px 6px 4px 10px; font-size:12.5px; font-weight:600;
}
.aic-topic-chip .ico{ width:13px; height:13px; flex:0 0 auto; }
.aic-topic-chip-text{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aic-topic-clear{
  width:18px; height:18px; border:0; border-radius:50%; flex:0 0 auto;
  background:rgba(0,0,0,.07); color:inherit; font-size:15px; line-height:1; padding:0; cursor:pointer;
}
.aic-topic-clear:hover{ background:rgba(0,0,0,.14); }
.aic-disclaimer{ font-size:11.5px; color:var(--aic-faint); text-align:center; margin:9px 0 0; line-height:1.45; }
.aic-disclaimer a{ color:inherit; text-decoration:underline; }

/* notices (consent gate, message limit) */
.aic-notice{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 16px;
  background:linear-gradient(#fff,#fff) padding-box, var(--aic-grad) border-box;
  border:1px solid transparent; border-radius:16px; padding:13px 16px; margin:0 0 10px;
  box-shadow:var(--shadow-1,0 1px 2px rgba(16,24,40,.05));
  animation:aic-rise .3s var(--ease,ease) both;
}
.aic-notice-body{ display:grid; gap:2px; font-size:13.5px; color:#374151; line-height:1.45; flex:1 1 320px; min-width:0; }
.aic-notice-body strong{ color:var(--aic-ink); font-weight:650; }
.aic-notice-body a{ color:var(--aic-blue); }
.aic-notice-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.aic-notice .btn-primary{ border-radius:999px; }
.aic-notice .btn-sm{ border-radius:999px; }

/* --- Results column ------------------------------------------------------------
   The cards inside are the News page's own .result-card (app.css); this only
   frames them: a header naming what is shown, the searches the conversation
   produced, loading and error states, and links out to the full verticals. */
.aic-col-results{ padding:0 14px 22px; min-width:0; }
.aic-results{ position:relative; }
.aic-results-head{ margin-top:12px; }
.aic-results-all::after{ content:"\2197"; margin-left:4px; font-weight:700; }

/* A link in an answer just sent its search here: the column flashes (a bar
   at its edge and a tint) and the search's name lights up, so the change is
   seen even when the column was already showing results. */
.aic-col-results.is-flash{ animation:aic-col-flash 1.5s ease; }
.aic-col-results.is-flash .aic-results-context strong{ animation:aic-mark 1.5s ease; border-radius:3px; }

/* "Ask AI" on every card in the column (chat.js). */
.aic-rs-ask{
  display:inline-flex; align-items:center; gap:5px;
  border:1px solid rgba(132,94,247,.35); background:#f6f3ff; color:var(--aic-violet-ink);
  border-radius:999px; padding:3px 11px 3px 8px;
  font:inherit; font-size:12.5px; font-weight:600; line-height:1.4; cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
}
.aic-rs-ask .ico{ width:13px; height:13px; }
.aic-rs-ask:hover{ background:#ede7ff; border-color:rgba(132,94,247,.6); }
.aic-results-back{
  display:none; align-items:center; gap:5px;
  font-size:12px; font-weight:600; color:var(--aic-violet-ink); text-decoration:none !important;
}
.aic-results-back .ico{ width:13px; height:13px; }
.aic-results-back:hover{ text-decoration:underline !important; }
.aic-results-context{
  margin:8px 2px 10px; font-size:13.5px; line-height:1.45; color:var(--aic-muted);
  overflow-wrap:anywhere;
}
.aic-results-context strong{ color:var(--aic-ink); font-weight:650; }
.aic-results-context .aic-rs-topic{ color:var(--aic-violet-ink); font-weight:600; }

/* The searches this chat has produced: the question, then the answer's own
   recommendations. The one on screen is filled. */
.aic-results-searches{ display:flex; flex-wrap:wrap; gap:6px; margin:0 2px 12px; }
.aic-rs-chip{
  display:inline-flex; align-items:center; gap:6px; max-width:100%;
  padding:4px 11px 4px 9px; border-radius:999px;
  background:var(--aic-card); border:1px solid var(--aic-line); color:var(--aic-text);
  font:inherit; font-size:12.5px; line-height:1.35; cursor:pointer;
  transition:background .15s ease, border-color .15s ease, color .15s ease;
}
.aic-rs-chip .ico{ width:13px; height:13px; flex:0 0 auto; opacity:.8; }
.aic-rs-chip span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aic-rs-chip:hover{ border-color:#c9d3e6; color:var(--aic-ink); }
.aic-rs-chip.is-active{
  background:var(--aic-grad-soft); border-color:rgba(132,94,247,.4);
  color:var(--aic-violet-ink); font-weight:600;
}
.aic-rs-chip:focus-visible{ outline:3px solid rgba(132,94,247,.35); outline-offset:2px; }

/* Loading: a thin gradient bar while a search runs; the previous cards stay
   readable underneath, dimmed, until the new ones replace them. */
.aic-results-bar{
  height:2px; margin:0 2px 8px; border-radius:2px; overflow:hidden;
  background:transparent; position:relative;
}
.aic-results[aria-busy="true"] .aic-results-bar::after{
  content:""; position:absolute; inset:0 auto 0 0; width:40%;
  background:var(--aic-grad); border-radius:2px;
  animation:aic-bar 1.1s ease-in-out infinite;
}
.aic-results-body{ transition:opacity .2s ease; }
.aic-results.is-refreshing .aic-results-body{ opacity:.45; }
.aic-results-body > .result-card:first-child{ margin-top:0; }
.aic-rs-skel{
  display:grid; gap:9px; margin:0 0 12px; padding:16px 16px 18px;
  background:var(--aic-card); border:1px solid var(--aic-line); border-radius:14px;
}
.aic-rs-skel span{
  display:block; height:11px; border-radius:6px;
  background:linear-gradient(90deg,#eef1f6 25%,#e3e9f1 45%,#eef1f6 65%);
  background-size:200% 100%; animation:aic-shimmer 1.2s linear infinite;
}
.aic-rs-skel span:nth-child(1){ width:84%; height:14px; }
.aic-rs-skel span:nth-child(2){ width:100%; }
.aic-rs-skel span:nth-child(3){ width:62%; }
.aic-results-note, .aic-results-status{
  font-size:13.5px; line-height:1.5; color:var(--aic-muted);
}
.aic-results-status{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 12px;
  margin:0 0 12px; padding:11px 14px;
  background:var(--aic-card); border:1px dashed var(--aic-line); border-radius:12px;
}
.aic-results-status.is-error{ border-style:solid; border-color:#f3c7c7; }
.aic-results-status button{
  border:1px solid var(--aic-line); background:transparent; border-radius:999px;
  font:inherit; font-size:12.5px; font-weight:600; color:var(--aic-violet-ink);
  padding:4px 12px; cursor:pointer;
}
.aic-results-status button:hover{ background:var(--aic-grad-soft); }

.aic-results-foot{
  display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px;
  margin:6px 2px 0; padding-top:12px; border-top:1px solid var(--aic-line);
  font-size:12.5px; color:var(--aic-faint);
}
.aic-results-foot-label{ margin-right:2px; overflow-wrap:anywhere; }
.aic-rs-mode{
  display:inline-flex; align-items:center; padding:3px 11px; border-radius:999px;
  background:#eef3f9; border:1px solid #dde6f0; color:var(--aic-blue);
  font-weight:600; text-decoration:none !important;
}
.aic-rs-mode:hover{ background:#e2ebf5; }

/* "Results" in the composer bar: the way down to the column while it sits
   below the conversation. The count is how many cards it holds. */
.aic-to-results{ text-decoration:none !important; }
.aic-to-results-n{
  min-width:18px; padding:0 5px; border-radius:999px;
  background:var(--aic-grad-soft); color:var(--aic-violet-ink);
  font-size:11px; font-weight:700; line-height:18px; text-align:center;
}

/* Side by side (1200px up, where the search pages put their two result
   columns side by side): the results column stays in view while the
   conversation scrolls, and scrolls on its own. */
@media (min-width:1200px){
  .aic-col-results{
    position:sticky; top:var(--search-header-height, var(--aic-header-h));
    align-self:flex-start;
    max-height:calc(var(--vh, 100vh) - var(--search-header-height, var(--aic-header-h)));
    overflow-y:auto; overscroll-behavior:contain;
    border-left:1px solid var(--aic-line);
    padding:0 16px 22px 18px;
    scrollbar-width:thin; scrollbar-color:rgba(91,100,114,.35) transparent;
  }
  .aic-col-results::-webkit-scrollbar{ width:6px; }
  .aic-col-results::-webkit-scrollbar-thumb{ background:rgba(91,100,114,.35); border-radius:3px; }
  .aic-to-results{ display:none !important; }
}

/* Stacked (under 1200px): results follow the conversation. */
@media (max-width:1199.98px){
  .aic-col-results{
    border-top:1px solid var(--aic-line);
    scroll-margin-top:var(--search-header-height, var(--aic-header-h));
  }
  .aic-results-back{ display:inline-flex; margin-left:auto; }
  .aic-results-back + .results-jump{ margin-left:10px; }
}

/* --- Responsive ------------------------------------------------------------- */
@media (max-width:767.98px){
  :root{ --aic-header-h:74px; }
  .aic-wrap{ padding:0 12px; }
  .aic-hero{ padding:34px 0 18px; }
  .aic-hero-intro{ font-size:14.5px; margin-bottom:22px; }
  .aic-starters{ grid-template-columns:1fr; gap:8px; }
  .aic-starter{ padding:11px 12px; font-size:13.5px; }
  .aic-user-wrap{ max-width:92%; }
  .aic-user-bubble{ font-size:15px; }
  .aic-sources-grid{ grid-template-columns:1fr; }
  .aic-turn-ai{ padding:14px 14px 12px; border-radius:16px; }
  .aic-ai-body{ font-size:15px; }
  .aic-thread{ gap:18px; padding-top:16px; }
  #searchgroup .aic-input{ font-size:16px; }
  .aic-sbx-chat > span{ display:none; }
  .aic-sbx-chat > .aic-to-results-n{ display:inline-block; }
  .aic-sbx-chat > .aic-to-results-n[hidden]{ display:none; }
  .aic-composer .aic-meter-word{ display:none; }
  .aic-meter-track{ width:44px; }
  .aic-disclaimer{ font-size:11px; }
  .aic-ai-meta{ display:none; }
  .aic-col-results{ padding:0 12px 20px; }
}

/* --- Motion ------------------------------------------------------------------ */
@keyframes aic-rise{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
@keyframes aic-float{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-4px); } }
@keyframes aic-blink{ to{ opacity:0; } }
@keyframes aic-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }
@keyframes aic-dot{ 0%,80%,100%{ opacity:.35; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }
@keyframes aic-shimmer{ to{ background-position:-200% 0; } }
@keyframes aic-bar{ from{ transform:translateX(-100%); } to{ transform:translateX(250%); } }
@keyframes aic-col-flash{
  0%{ box-shadow:inset 0 0 0 0 rgba(132,94,247,0); background-color:transparent; }
  18%{ box-shadow:inset 4px 0 0 0 rgba(132,94,247,.9); background-color:rgba(132,94,247,.09); }
  100%{ box-shadow:inset 0 0 0 0 rgba(132,94,247,0); background-color:transparent; }
}
@keyframes aic-mark{ 0%, 100%{ background-color:transparent; } 20%{ background-color:rgba(132,94,247,.24); } }
/* Reduced motion keeps the column's colour flash (it moves nothing) and
   drops the movement. */
@media (prefers-reduced-motion: reduce){
  .aic-orb, .aic-starter, .aic-turn, .aic-notice, .aic-cursor, .aic-dots i, .aic-shimmer, .aic-turn-ai.is-pending .aic-badge,
  .aic-rs-skel span, .aic-results[aria-busy="true"] .aic-results-bar::after,
  .aic-reading-item, .aic-jump, .aic-trend{ animation:none !important; }
  .aic-composer:focus-within{ transform:none; }
  .aic-tip, .aic-toast{ transition:none; }
}
@media print{
  .aic-actions, .aic-suggest, #search-header, .fs-footer, .custom-sidebar-menu, .aic-col-results,
  .aic-edit, .aic-code-copy, .aic-sources-more, .aic-continue, .aic-tip, .aic-toast, .aic-panel-ico{ display:none !important; }
  .aic-turn-ai{ box-shadow:none; }
  .aic-src.is-extra{ display:flex !important; }
}

/* ============================================================================
   THEME MODES — AI Mode in dark
   ============================================================================
   The three colour modes are described in section 14 of app.css. Light and
   hybrid both want this page exactly as it is above (the chat surface has
   always been light on both), so only dark has anything to say here.

   Nearly all of it is a token swap: the palette at the top of this file is
   already the single source of these colours, so re-declaring it under
   html[data-fs-theme="dark"] repaints the hero, the turns, the chips and the
   composer at once. The handful of rules below it are the places that took a
   literal instead of a token.
   ============================================================================ */

html[data-fs-theme="dark"]{
  --aic-grad-soft: linear-gradient(135deg, rgba(76,141,251,.22), rgba(132,94,247,.22));
  --aic-ink:#dde5ef;
  --aic-text:#c6d0dc;
  --aic-muted:#9aa7b6;
  --aic-faint:#7c8b9d;
  --aic-line:#232e3b;
  --aic-card:#161d26;
  --aic-violet:#a98bff;
  --aic-violet-ink:#cbbcff;
  --aic-blue:#79b8ff;
  --aic-bg:#10151c;
}

/* The page's own wash: the violet/teal glows need to read on ink, not paper. */
html[data-fs-theme="dark"] body.aic-page{
  background-image:
    radial-gradient(900px 420px at 50% -140px, rgba(132,94,247,.16), transparent 70%),
    radial-gradient(700px 360px at 85% 12%, rgba(26,188,156,.09), transparent 70%);
}

/* Turns */
html[data-fs-theme="dark"] .aic-user-bubble{
  background:linear-gradient(135deg,#1d2440,#232a4b);
  border-color:#2e3560;
}
html[data-fs-theme="dark"] .aic-ai-body blockquote{ color:var(--aic-muted); }
html[data-fs-theme="dark"] .aic-ai-body table{ background:var(--aic-card); }
html[data-fs-theme="dark"] .aic-turn-ai.is-error{ border-color:#5a2b2b; background:#241a1c; }
html[data-fs-theme="dark"] .aic-error-text{ color:#ff9db1; }
html[data-fs-theme="dark"] .aic-starter-go{ color:#a3b4ff; }

/* Chips */
html[data-fs-theme="dark"] .aic-chip{
  background:var(--aic-card); border-color:var(--aic-line); color:var(--aic-blue);
}
html[data-fs-theme="dark"] .aic-chip-news{ background:#2a2213; border-color:#4a3a1c; color:#e0a75b; }
html[data-fs-theme="dark"] .aic-chip-finance{ background:#10261f; border-color:#1d4436; color:#5fd3b1; }
html[data-fs-theme="dark"] .aic-more{ background:#1c1810; border-color:#4a3a1c; }
html[data-fs-theme="dark"] .aic-chip-topic,
html[data-fs-theme="dark"] .aic-suggest .aic-chip{
  background:#211c3a; border-color:#362d5e; color:var(--aic-violet-ink);
}

/* Actions */
html[data-fs-theme="dark"] .aic-action:hover{ background:#1e2733; color:var(--aic-ink); }

/* The box: the search box's dark card (app.css); the chat's own pieces. The
   bottom dock's fade has to end in the page colour, or it paints a pale band
   across the bottom of a dark page. */
html[data-fs-theme="dark"] .aic-dock.is-bottom{
  background:linear-gradient(180deg, rgba(16,21,28,0) 0%, rgba(16,21,28,.94) 26%, var(--aic-bg) 60%);
}
html[data-fs-theme="dark"] .aic-composer .fs-sbx-send.aic-send:disabled{ background:#232e3b; color:#5f6d7e; }
html[data-fs-theme="dark"] .aic-meter-track{ background:#2c3949; }
html[data-fs-theme="dark"] .aic-stop,
html[data-fs-theme="dark"] .aic-composer .fs-sbx-send.aic-stop{ background:#e2e8f0; color:#0f172a; }
html[data-fs-theme="dark"] .aic-stop-square{ background:#0f172a; }

/* Notices keep their gradient border; only the panel behind it changes. */
html[data-fs-theme="dark"] .aic-notice{
  background:linear-gradient(var(--aic-card),var(--aic-card)) padding-box, var(--aic-grad) border-box;
}
html[data-fs-theme="dark"] .aic-notice-body{ color:var(--aic-text); }

/* Results column: the chips and panels run on the tokens above; these are
   the literals. */
html[data-fs-theme="dark"] .aic-rs-chip:hover{ border-color:#34414f; }
html[data-fs-theme="dark"] .aic-rs-skel span{
  background:linear-gradient(90deg,#1c2430 25%,#243040 45%,#1c2430 65%);
  background-size:200% 100%;
}
html[data-fs-theme="dark"] .aic-results-status.is-error{ border-color:#5a2b2b; }
html[data-fs-theme="dark"] .aic-rs-mode{ background:var(--aic-card); border-color:var(--aic-line); color:var(--aic-blue); }
html[data-fs-theme="dark"] .aic-rs-mode:hover{ background:#1e2733; }
html[data-fs-theme="dark"] .aic-col-results{ scrollbar-color:rgba(154,167,182,.3) transparent; }
html[data-fs-theme="dark"] .aic-rs-ask{ background:#211c3a; border-color:#362d5e; }
html[data-fs-theme="dark"] .aic-rs-ask:hover{ background:#2a2350; border-color:#4a3f80; }

/* Sources, citations and the answer controls: the literals. */
html[data-fs-theme="dark"] .aic-ai-body a.aic-cite{ background:#232a44; border-color:#34406a; }
html[data-fs-theme="dark"] .aic-ai-body a.aic-cite:hover,
html[data-fs-theme="dark"] .aic-ai-body a.aic-cite.is-hot{ background:var(--aic-violet); border-color:var(--aic-violet); color:#10151c; }
html[data-fs-theme="dark"] .aic-src-n{ background:#1e2733; }
html[data-fs-theme="dark"] .aic-src:hover,
html[data-fs-theme="dark"] .aic-src.is-hot{ box-shadow:0 4px 14px -6px rgba(0,0,0,.6); }
html[data-fs-theme="dark"] .aic-edit:hover{ background:#1e2733; }
html[data-fs-theme="dark"] .aic-jump{ box-shadow:0 6px 18px -6px rgba(0,0,0,.7); }
html[data-fs-theme="dark"] .aic-jump:hover{ border-color:#34414f; }
/* The note and the toast are dark on the light page; on the dark page they
   need an edge to stand off it. */
html[data-fs-theme="dark"] .aic-tip,
html[data-fs-theme="dark"] .aic-toast{ background:#2a3242; border:1px solid #3a4558; }
