/* Assistents ALIA: quiet neutrals, one blue accent, the model's work in plain view. Colours are HSL triplets used as hsl(var(--x)). */

:root {
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --background: 40 14% 98%;
  --foreground: 225 15% 11%;
  --card: 0 0% 100%;
  --card-foreground: 225 15% 11%;
  --muted: 40 9% 94.5%;
  --muted-foreground: 225 7% 38%;
  --border: 40 7% 88%;
  --ring: 217 72% 48%;
  --primary: 225 15% 11%;
  --primary-foreground: 0 0% 100%;
  --accent: 217 72% 45%;
  --accent-soft: 217 80% 96%;
  --ok: 152 60% 28%;
  --ok-soft: 145 45% 93%;
  --warn: 25 85% 36%;
  --warn-soft: 30 90% 94%;
  --danger: 0 70% 45%;
  --mark: 48 100% 86%;
  --shadow: 225 20% 20%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 225 10% 8%;
    --foreground: 220 10% 94%;
    --card: 225 9% 11.5%;
    --card-foreground: 220 10% 94%;
    --muted: 225 8% 16%;
    --muted-foreground: 220 6% 66%;
    --border: 225 7% 21%;
    --ring: 217 85% 65%;
    --primary: 220 10% 94%;
    --primary-foreground: 225 15% 9%;
    --accent: 217 85% 68%;
    --accent-soft: 217 40% 18%;
    --ok: 145 50% 62%;
    --ok-soft: 150 35% 15%;
    --warn: 30 85% 64%;
    --warn-soft: 28 45% 15%;
    --danger: 0 75% 64%;
    --mark: 45 55% 24%;
    --shadow: 0 0% 0%;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --background: 225 10% 8%;
  --foreground: 220 10% 94%;
  --card: 225 9% 11.5%;
  --card-foreground: 220 10% 94%;
  --muted: 225 8% 16%;
  --muted-foreground: 220 6% 66%;
  --border: 225 7% 21%;
  --ring: 217 85% 65%;
  --primary: 220 10% 94%;
  --primary-foreground: 225 15% 9%;
  --accent: 217 85% 68%;
  --accent-soft: 217 40% 18%;
  --ok: 145 50% 62%;
  --ok-soft: 150 35% 15%;
  --warn: 30 85% 64%;
  --warn-soft: 28 45% 15%;
  --danger: 0 75% 64%;
  --mark: 45 55% 24%;
  --shadow: 0 0% 0%;
  color-scheme: dark;
}

/* Shorthands for the boards: whole colours that follow the theme */
:root {
  --canvas: hsl(var(--background)); --surface: hsl(var(--card)); --line: hsl(var(--border));
  --ink: hsl(var(--foreground)); --soft: hsl(var(--muted-foreground));
  --lift: 0 1px 2px hsl(var(--shadow) / .05), 0 8px 24px -12px hsl(var(--shadow) / .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font-family: var(--font-sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
::selection { background: hsl(var(--accent) / .22); }
a { color: hsl(var(--accent)); text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
* { scrollbar-width: thin; scrollbar-color: hsl(var(--border)) transparent; }

/* ----- Top bar ----- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 20px; flex-shrink: 0; }
.topbar__home { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 0; border-radius: 999px;
  background: none; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.topbar__home:hover { background: hsl(var(--muted)); }
.topbar__actions { display: flex; align-items: center; gap: 2px; }
.icon-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 999px;
  background: none; color: hsl(var(--muted-foreground)); font-size: 0.86rem; font-weight: 500; cursor: pointer; }
.icon-button:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

/* No scroll anchoring: app.js decides when to follow. Anchoring shifted the view when a step opened, and that shift looked like the reader going back to the bottom. */
main { flex: 1; overflow-y: auto; overflow-anchor: none; }
.column { width: min(820px, 100% - 32px); margin: 0 auto; padding: 24px 0 32px; }

/* ----- Landing and assistant header ----- */
.uc-ui { width: 100%; display: flex; flex-direction: column; gap: 24px; padding: 8px 0 4px; animation: fade-in .25s ease both; }
.uc-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 4px; }
.uc-intro__kicker { font-size: 0.95rem; font-weight: 600; color: hsl(var(--muted-foreground)); }
.uc-intro h1 { margin: 0; font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.uc-intro p { margin: 0; max-width: 60ch; font-size: 1rem; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.uc-intro .uc-intro__kicker { font-size: 0.95rem; }
.uc-grid__label { margin: 0 2px -14px; font-size: 0.86rem; font-weight: 650; color: hsl(var(--muted-foreground)); }
/* Low cards: icon and name on one row, the description in two lines at most. Two columns on a phone. */
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; width: 100%; }
@media (max-width: 520px) { .uc-grid { grid-template-columns: 1fr 1fr; } }
.uc-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 16px; text-align: left;
  border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); color: hsl(var(--card-foreground));
  line-height: 1.4; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.uc-card:disabled { cursor: not-allowed; opacity: 0.6; }
.uc-card__unavailable { font-size: 0.78rem; font-weight: 600; color: hsl(var(--danger)); }
.uc-card:not(:disabled):hover { border-color: hsl(var(--foreground) / 0.3); box-shadow: var(--lift); }
.uc-card__top { display: flex; align-items: center; gap: 10px; }
.uc-card__icon { width: 28px; height: 28px; flex: none; border-radius: 9px; }
.uc-card__arrow { flex: none; margin-left: auto; color: hsl(var(--muted-foreground)); opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
.uc-card:not(:disabled):hover .uc-card__arrow { opacity: 1; transform: none; }
.uc-card__name { min-width: 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.uc-card__description { font-size: 0.86rem; color: hsl(var(--muted-foreground));
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.uc-card__sources { margin-top: auto; font-size: 0.76rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
/* Phone: the icon above the name, so a long name keeps the card's width */
@media (max-width: 520px) { .uc-card { padding: 9px 12px; } .uc-card__top { flex-direction: column; align-items: flex-start; gap: 8px; } .uc-card__arrow { display: none; } }

.uc-head { display: flex; align-items: center; gap: 14px; }
.uc-head__icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; }
.uc-head__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.uc-head__name { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.uc-head__description { font-size: 0.9rem; color: hsl(var(--muted-foreground)); }
.uc-back { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid hsl(var(--border));
  border-radius: 999px; background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: color .15s ease, border-color .15s ease; }
.uc-back:hover { color: hsl(var(--foreground)); border-color: hsl(var(--foreground) / 0.35); }
.uc-section, .uc-ui-label { font-size: 0.82rem; font-weight: 600; color: hsl(var(--muted-foreground)); }
.uc-suggestions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: -14px; }
.uc-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; text-align: left;
  border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); line-height: 1.4; cursor: pointer;
  transition: border-color .15s ease; }
.uc-suggestion:hover { border-color: hsl(var(--foreground) / 0.3); }
.uc-suggestion__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uc-suggestion__label { font-size: 0.9rem; font-weight: 600; }
.uc-suggestion__message { font-size: 0.82rem; color: hsl(var(--muted-foreground));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uc-suggestion svg { flex-shrink: 0; color: hsl(var(--muted-foreground)); }
@media (max-width: 640px) {
  .uc-head { flex-wrap: wrap; }
  .uc-head__text { flex-basis: calc(100% - 58px); }
  .uc-intro h1 { font-size: 1.9rem; }
}

/* ----- Conversation: the question, the steps the model took, then the answer as plain text ----- */
.messages { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.message--user { align-self: flex-end; max-width: 82%; padding: 10px 15px; border-radius: 18px 18px 4px 18px;
  background: hsl(var(--muted)); color: hsl(var(--foreground)); white-space: pre-wrap; overflow-wrap: anywhere; }
.turn { display: flex; gap: 12px; align-items: flex-start; }
.turn__avatar { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; margin-top: 2px; }
.turn__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.bubble { max-width: 100%; padding: 1px 0; font-size: 1rem; line-height: 1.65; }
/* Typing: three dots until the first thing arrives */
.turn__body:empty::before { content: "•••"; padding: 2px 0; color: hsl(var(--muted-foreground)); letter-spacing: 3px; font-size: 1.1rem;
  animation: pulse 1.2s ease-in-out infinite; }

/* The model's steps: one quiet line ("✓ 2 consultes"); open it for the steps, and each step for its exact input and output */
.activity { font-size: 0.84rem; color: hsl(var(--muted-foreground)); }
.activity summary { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; user-select: none; }
.activity summary::-webkit-details-marker { display: none; }
.activity summary:hover { color: hsl(var(--foreground)); }
.activity > summary::before { content: "✓"; color: hsl(var(--ok)); font-size: 0.8rem; }
.activity > summary::after { content: ""; width: 5px; height: 5px; margin-left: 1px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg); transition: transform .15s ease; }
.activity[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.activity.step--running > summary::before, .activity__list .step--running > summary::before { content: ""; width: 9px; height: 9px; border-radius: 999px;
  border: 1.5px solid hsl(var(--border)); border-top-color: hsl(var(--foreground)); animation: spin .8s linear infinite; }
.activity__list { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 2px 3px; }
.activity__list > .step > summary { padding: 2px 0; }
.activity__list > .step > summary::before { content: "✓"; color: hsl(var(--muted-foreground)); font-size: 0.74rem; }
.activity__list > .step--reasoning > summary::before { content: "·"; }
.step__body { padding: 2px 0 8px 16px; }
.step__body strong { display: block; margin-top: 6px; font-size: 0.76rem; font-weight: 600; color: hsl(var(--foreground)); }
.step__body pre, .markdown pre { margin: 4px 0 0; padding: 10px 12px; max-height: 280px; overflow: auto; border-radius: 8px;
  background: hsl(var(--card)); color: hsl(var(--foreground)); font-family: var(--font-mono); font-size: 0.76rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.step__reasoning { max-height: 220px; overflow-y: auto; white-space: pre-wrap; }

.notice { padding: 9px 14px; border-radius: 10px; background: hsl(var(--muted)); font-size: 0.9rem; }
.visual { align-self: stretch; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); padding: 6px; overflow: hidden; }
.visual__plot { width: 100%; height: 380px; }

.markdown { overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol { margin: 0 0 12px; }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown li + li { margin-top: 3px; }
.markdown h1, .markdown h2, .markdown h3 { margin: 18px 0 8px; font-size: 1.05rem; font-weight: 650; line-height: 1.3; }
.markdown strong { font-weight: 650; }
.markdown code { font-family: var(--font-mono); font-size: 0.85em; padding: 1px 5px; border-radius: 5px; background: hsl(var(--muted)); }
.markdown pre code { padding: 0; background: none; }
.markdown blockquote { margin: 0 0 12px; padding: 8px 14px; border-radius: 8px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.markdown th, .markdown td { padding: 7px 12px; border-bottom: 1px solid hsl(var(--border)); text-align: left; }
.markdown th { font-weight: 600; border-bottom-color: hsl(var(--foreground) / .25); }

.uc-followups { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 40px; }
.uc-followup { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px; border: 1px solid hsl(var(--border)); border-radius: 999px;
  background: hsl(var(--card)); font-size: 0.86rem; font-weight: 500; line-height: 1.3; cursor: pointer; transition: border-color .15s ease; }
.uc-followup:hover { border-color: hsl(var(--foreground) / 0.35); }

/* ----- Composer ----- */
.composer { flex-shrink: 0; width: min(820px, 100% - 32px); margin: 0 auto; padding: 0 0 12px; }
.composer[hidden] { display: none; }
.composer__box { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 18px; border: 1px solid hsl(var(--border));
  border-radius: 18px; background: hsl(var(--card)); box-shadow: var(--lift); transition: border-color .15s ease; }
.composer__box:focus-within { border-color: hsl(var(--accent) / .6); }
.composer textarea { flex: 1; min-height: 42px; max-height: 200px; padding: 10px 0; border: 0; outline: 0; resize: none;
  background: none; color: inherit; font: inherit; font-size: 1rem; }
.composer textarea::placeholder { color: hsl(var(--muted-foreground)); }
.composer button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: hsl(var(--primary));
  color: hsl(var(--primary-foreground)); font-weight: 600; cursor: pointer; }
.composer button:disabled { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); cursor: default; }
.composer .composer__mic { display: grid; place-items: center; width: 42px; padding: 0; background: none; color: inherit; border: 1px solid hsl(var(--border)); }
.composer .composer__mic[hidden] { display: none; }
.composer .composer__switch { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; background: none; color: hsl(var(--muted-foreground));
  font-size: 0.86rem; font-weight: 600; }
.composer .composer__switch[hidden] { display: none; }
.composer__switch[aria-checked="true"] { color: hsl(var(--foreground)); }
.composer__track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: hsl(var(--border)); transition: background .15s ease; }
.composer__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s ease; }
.composer__switch[aria-checked="true"] .composer__track { background: hsl(var(--primary)); }
.composer__switch[aria-checked="true"] .composer__thumb { transform: translateX(14px); }
.composer .composer__mic:hover { background: hsl(var(--muted)); }
.composer .composer__mic[aria-pressed="true"] { background: hsl(var(--primary)); border-color: transparent; color: hsl(var(--primary-foreground)); }
.composer__note--voice { font-size: 0.86rem; font-weight: 600; color: hsl(var(--foreground)); }
.composer .composer__mic.composer__mic--on { background: hsl(var(--danger)); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 calc(3px + var(--level, 0) * 16px) hsl(var(--danger) / 0.25); transition: box-shadow 0.1s linear; }
/* Voice mode listens all the time: the ring follows the room, red while a message is recorded; muted is greyed and slashed. */
.composer #mic { box-shadow: 0 0 0 calc(var(--level, 0) * 10px) hsl(var(--foreground) / 0.12); transition: box-shadow 0.1s linear; }
.composer #mic.composer__mic--on { box-shadow: 0 0 0 calc(3px + var(--level, 0) * 16px) hsl(var(--danger) / 0.25); }
.composer #mic .mic-slash { display: none; }
.composer #mic.composer__mic--muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); box-shadow: none; }
.composer #mic.composer__mic--muted .mic-slash { display: inline; }
.composer__note { margin-top: 7px; text-align: center; font-size: 0.78rem; color: hsl(var(--muted-foreground)); }

/* ----- Dialogs ----- */
dialog { padding: 16px; border: 0; background: none; color: inherit; max-width: 100vw; }
dialog::backdrop { background: hsl(225 20% 8% / 0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.uc-confirm__card, .about__card, .settings__card { width: min(440px, 100vw - 32px); display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 24px;
  border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); color: hsl(var(--card-foreground));
  box-shadow: 0 24px 64px hsl(var(--shadow) / 0.25); }
.about__card { width: min(640px, 100vw - 32px); max-height: calc(100vh - 64px); overflow-y: auto; }
.uc-confirm__title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; }
.uc-confirm__rows { display: flex; flex-direction: column; margin: 0; }
.uc-confirm__row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); }
.uc-confirm__row:last-child { border-bottom: 0; }
.uc-confirm__row dt { color: hsl(var(--muted-foreground)); font-size: 0.88rem; }
.uc-confirm__row dd { margin: 0; font-size: 0.92rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.uc-confirm__note { font-size: 0.82rem; color: hsl(var(--muted-foreground)); }
.uc-confirm__note:empty { display: none; }
.uc-confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }
.uc-confirm__button { min-height: 40px; padding: 0 18px; border-radius: 10px; font-size: 0.92rem; font-weight: 600; line-height: 1.2; cursor: pointer; }
.uc-confirm__button--cancel { border: 1px solid hsl(var(--border)); background: transparent; }
.uc-confirm__button--cancel:hover { background: hsl(var(--muted)); }
.uc-confirm__button--confirm { border: 1px solid hsl(var(--primary)); background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

/* ----- Model status pill ----- */
.model-pill { --dot: hsl(var(--muted-foreground)); position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid hsl(var(--border)); border-radius: 999px;
  background: hsl(var(--card) / 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--lift); font-size: 13px; font-weight: 500; white-space: nowrap; }
.model-pill[data-state="on"] { --dot: hsl(var(--ok)); }
.model-pill[data-state="init"] { --dot: hsl(var(--warn)); }
.model-pill[data-state="off"], .model-pill[data-state="error"] { --dot: hsl(var(--danger)); }
.model-pill button { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 0;
  border-radius: 999px; background: none; cursor: pointer; }
.model-pill__status:hover { background: hsl(var(--muted)); }
.model-pill__dot { position: relative; width: 8px; height: 8px; border-radius: 999px; background: var(--dot); }
.model-pill[data-state="init"] .model-pill__dot::after { content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: var(--dot); animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite; }
.model-pill__action { background: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)); font-weight: 600; }
.model-pill__action:disabled { opacity: 0.5; cursor: progress; }
.model-pill[data-state="on"] .model-pill__action, .model-pill[data-state="init"] .model-pill__action { display: none; }
@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .topbar__home span { display: none; }
  .model-pill { left: 56px; transform: none; top: 14px; }
  .model-pill__label, .model-pill__action span { display: none; }
  .model-pill button { padding: 0 9px; }
  .uc-followups { padding-left: 0; }
  .uc-followup, .uc-back { min-height: 40px; }
}

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ----- Settings panel ----- */
.settings__card { width: min(620px, 100vw - 32px); max-height: calc(100vh - 64px); overflow-y: auto; }
.settings__head { display: flex; flex-direction: column; gap: 4px; }
.settings__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 20px; }
.settings__field { display: flex; flex-direction: column; gap: 6px; }
.settings__label { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.settings__value { font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); }
.settings__field input[type=range] { width: 100%; accent-color: hsl(var(--accent)); }
.settings__hint { font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.settings__switch { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.settings__switch input { accent-color: hsl(var(--accent)); }
.settings__prompt { display: flex; flex-direction: column; gap: 6px; }
.settings__prompt textarea { width: 100%; resize: vertical; min-height: 180px; padding: 10px 12px; border: 1px solid hsl(var(--border));
  border-radius: 10px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: 0.8rem/1.45 var(--font-mono); }
.settings__prompt textarea:disabled { opacity: 0.6; }


/* ----- Boards (Hotel, Dades Obertes): beside the chat on wide screens, filled in from the tool results only.
   Two panels side by side, the board and the assistant, on the page's own ground. One screen, no page scroll. ----- */
.board { display: none; }
@media (min-width: 1000px) {
  body.has-panel { display: grid; grid-template-columns: minmax(0, 7fr) minmax(380px, 4fr); grid-template-rows: 60px minmax(0, 1fr) auto;
    grid-template-areas: "top top" "board chat" "board composer"; column-gap: 24px; padding: 0 24px 20px; overflow: hidden; }
  /* The chat's sources: the conversation first, its pages on the right. */
  body.has-panel.has-sources { grid-template-columns: minmax(0, 7fr) minmax(340px, 4fr); grid-template-areas: "top top" "chat board" "composer board"; }
  body.has-panel .topbar { grid-area: top; padding: 0; }
  body.has-panel .board { grid-area: board; position: relative; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
    overflow: hidden; } /* no frame of its own: its cards sit on the page's ground */
  body.has-panel .b-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; padding: 16px 0 0; }

  /* The assistant's panel: chat and composer read as one */
  body.has-panel main { grid-area: chat; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0;
    box-shadow: var(--lift); clip-path: inset(-40px -40px 0 -40px); }
  body.has-panel .composer { grid-area: composer; width: auto; margin: 0; padding: 8px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 16px 16px; box-shadow: var(--lift); clip-path: inset(0 -40px -40px -40px); }
  body.has-panel .composer__box { padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--canvas); box-shadow: none; }
  body.has-panel .composer textarea { min-height: 40px; padding: 9px 0; font-size: 0.95rem; }
  body.has-panel .composer button { min-height: 40px; border-radius: 10px; }
  body.has-panel .composer .composer__mic { width: 40px; }
  body.has-panel .composer__note { font-size: 0.75rem; }
  body.has-panel .column { width: 100%; padding: 0 18px 20px; }
  body.has-panel .uc-ui { position: sticky; top: 0; z-index: 2; gap: 12px; padding: 0; margin: 0 -18px; width: auto; animation: none; background: var(--surface); }
  body.has-panel .uc-head { gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
  body.has-panel .uc-head__icon { width: 34px; height: 34px; border-radius: 9px; }
  body.has-panel .uc-head__name { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
  body.has-panel .uc-head__description { display: none; }
  body.has-panel .uc-back { padding: 6px 11px; font-size: 0.78rem; }
  body.has-panel .uc-section { padding: 2px 18px 0; font-size: 0.8rem; }
  body.has-panel .uc-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 0; padding: 0 18px 14px; }
  body.has-panel .uc-suggestion { padding: 6px 12px; border-radius: 999px; }
  body.has-panel .uc-suggestion__label { font-size: 0.84rem; font-weight: 500; }
  body.has-panel .uc-suggestion__message, body.has-panel .uc-suggestion svg { display: none; }
  body.has-panel .messages { margin-top: 18px; gap: 14px; }
  body.has-panel .turn { gap: 10px; }
  body.has-panel .turn__avatar { width: 24px; height: 24px; border-radius: 7px; }
  body.has-panel .bubble { font-size: 0.95rem; line-height: 1.6; }
  body.has-panel .message--user { font-size: 0.95rem; padding: 9px 14px; }
  body.has-panel .activity { font-size: 0.83rem; }
  body.has-panel .uc-followups { padding-left: 34px; }
}
.b-live { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--soft); }
.b-live::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 999px; background: hsl(var(--ok)); }
.b-live--busy::before { width: 8px; height: 8px; background: none; border: 2px solid var(--line); border-top-color: hsl(var(--accent)); animation: spin .8s linear infinite; }
body:not(.has-panel) .b-live { display: none; }

/* Head of a board: what it is, and the steps of a booking */
.b-head > div { min-width: 0; overflow: hidden; }
.b-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px 0; }
.b-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.b-head p { margin: 1px 0 0; font-size: 0.8rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-steps { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; counter-reset: step; font-size: 0.82rem; font-weight: 500; color: var(--soft); }
.b-steps li { counter-increment: step; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.b-steps li::before { content: counter(step); width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 0.7rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--soft); }
.b-steps li:not(:last-child)::after { content: ""; width: clamp(8px, 1.6vw, 22px); height: 1px; margin: 0 8px; background: var(--line); }
.b-steps .is-done { color: var(--ink); }
.b-steps .is-done::before { content: "✓"; background: hsl(var(--ok-soft)); border-color: hsl(var(--ok) / .4); color: hsl(var(--ok)); }
.b-steps .is-next { color: var(--ink); font-weight: 600; }
.b-steps .is-next::before { border-color: hsl(var(--accent)); color: hsl(var(--accent)); }

/* The stay: photo of the valley, dates, guests, rooms, total and the booking's state */
.stay { display: grid; grid-template-columns: minmax(220px, 36%) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stay__photo { position: relative; margin: 0; min-height: 100%; }
.stay__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.stay__photo figcaption { position: absolute; left: 10px; bottom: 8px; font-size: 0.75rem; }
.stay__photo figcaption a { color: rgb(255 255 255 / .9); text-decoration: none; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.stay__body { container-type: inline-size; padding: 18px 22px; display: grid; gap: 14px; min-width: 0; }
.stay__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stay__top h3 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.stay__top p { margin: 1px 0 0; font-size: 0.84rem; color: var(--soft); }
.status { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: hsl(var(--muted)); color: var(--ink); }
.status--draft { background: none; border: 1px solid var(--line); color: var(--soft); }
.status--ok { background: hsl(var(--ok-soft)); color: hsl(var(--ok)); }
.stay .status--ok { font-size: 0.86rem; padding: 4px 12px; }
.status--off { background: hsl(var(--warn-soft)); color: hsl(var(--warn)); }
.stay__dates { display: grid; grid-template-columns: 1fr 1fr; border-radius: 10px; background: hsl(var(--muted) / .7); }
.stay__dates > div { padding: 9px 14px; display: grid; gap: 1px; min-width: 0; }
.stay__dates > div + div { border-left: 1px solid hsl(var(--foreground) / .08); }
.stay__dates span, .stay__facts dt, .stay__total span { font-size: 0.76rem; font-weight: 500; color: var(--soft); }
.stay__dates b { font-size: 1rem; font-weight: 650; }
.stay__state { display: grid; justify-items: end; gap: 3px; }
.stay__state span:not(.status) { font-size: 0.84rem; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stay__foot { display: flex; align-items: flex-end; gap: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.stay__facts { flex: 1; min-width: 0; margin: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0 24px; }
.stay__facts > div { min-width: 0; }
.stay__facts dd { margin: 0; font-size: 0.98rem; }
.stay__facts dd b { font-weight: 650; display: block; }
.stay__total { display: grid; text-align: right; }
.stay__total b { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.stay__total b.is-empty { font-size: 1rem; }
.stay__qr { flex: none; width: 50px; height: 50px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.stay__qr svg { width: 100%; height: 100%; display: block; }
@container (max-width: 420px) { .stay__qr { display: none; } } /* narrow card: the rooms keep the room, the code is only decorative */
.stay b.is-empty { font-weight: 400; color: var(--soft); }
.is-new { border-radius: 8px; animation: is-new 1.6s ease-out; }
@keyframes is-new { 0%, 35% { background: hsl(var(--mark)); } 100% { background: transparent; } }

/* Short screens (laptops): tighter, so the room photos keep their room */
@media (min-width: 1000px) and (max-height: 820px) {
  body.has-panel .b-body { gap: 12px; padding-top: 12px; grid-template-rows: auto minmax(0, 1fr); }
  .stay__body { padding: 14px 18px; gap: 10px; }
  .stay__dates > div { padding: 6px 12px; }
  .stay__foot { padding-top: 10px; }
  body.has-panel .journey { display: none; } /* the least needed: the room photos keep their size */
}

/* Rooms */
.b-rooms { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
.b-sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.b-sectionhead h3, .journey h3 { margin: 0; font-size: 0.95rem; font-weight: 650; }
.b-sectionhead span { font-size: 0.82rem; color: var(--soft); }
.rooms { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.room { container-type: inline-size; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.room__photo { position: relative; min-height: 0; background: hsl(var(--muted)); transition: opacity .3s; }
.room__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: #fff; color: #161a22; font-size: 0.74rem; font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.badge--mine { background: hsl(217 72% 45%); color: #fff; }
.room__body { padding: 10px 12px 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.room__body > div:first-child { min-width: 0; }
.room__body h4 { margin: 0; font-size: 0.94rem; font-weight: 650; white-space: nowrap; }
.room__body p { margin: 0; font-size: 0.78rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room__price { display: grid; text-align: right; white-space: nowrap; }
.room__price b { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.room__price span { font-size: 0.76rem; color: var(--soft); }
.room__price .is-short { color: hsl(var(--warn)); font-size: 0.84rem; }
.room.is-mine, .room.is-spot { border-color: hsl(var(--accent)); box-shadow: 0 0 0 1px hsl(var(--accent)); }
.room.is-dim .room__photo { opacity: .45; } /* only the photo: names and prices keep their contrast */
@container (max-width: 210px) { /* narrow cards: the price goes under the name */
  .room__body { flex-direction: column; align-items: flex-start; gap: 4px; }
  .room__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; text-align: left; }
}

/* The way there, in one line */
.journey { container-type: inline-size; display: flex; align-items: center; gap: 20px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.journey h3 { flex: none; }
.journey__line { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 0.84rem; font-weight: 500; min-width: 0; }
.journey__line li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.journey__line li:not(.journey__leg)::before { content: ""; width: 8px; height: 8px; border-radius: 999px; border: 2px solid var(--ink); }
.journey__line li:last-child::before { background: var(--ink); }
.journey__leg { flex: 1; min-width: 0; justify-content: center; gap: 8px; color: var(--soft); font-size: 0.76rem; font-weight: 400; }
.journey__leg::before, .journey__leg::after { content: ""; flex: 1; min-width: 12px; border-top: 1.5px dashed var(--soft); }
.journey__leg--rack::before, .journey__leg--rack::after { border-top: 2px solid var(--ink); }
@container (max-width: 700px) { .journey__leg { font-size: 0; gap: 0; } } /* narrow: the legs keep their lines (dashed train, solid rack railway), not their names */

/* Photos shown by the assistant in the chat (show_room_photos), and the viewer */
.gallery { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gallery__photo { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; background: hsl(var(--muted)); }
.gallery__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__photo span { position: absolute; left: 6px; bottom: 6px; padding: 1px 8px; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font-size: 0.75rem; font-weight: 600; }
.gallery__credits { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.gallery__credits summary { cursor: pointer; }
.gallery__credits a { display: block; color: inherit; }
.photo-view { padding: 0; max-width: min(1000px, 92vw); border-radius: 12px; overflow: hidden; cursor: zoom-out; }
.photo-view img { display: block; width: 100%; max-height: 80vh; object-fit: contain; background: #000; }
.photo-view__caption { padding: 10px 14px; background: hsl(var(--card)); font-size: 0.86rem; }

/* Pop-up over the board when the assistant shows something (room photos, hotel info) */
.b-pop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: hsl(var(--background) / .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s ease both; }
.b-pop__card { position: relative; width: min(760px, 100%); max-height: 100%; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -30px hsl(var(--shadow) / .45); animation: pop-in .25s ease-out both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.b-pop__card h3 { margin: 0; padding-right: 40px; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.b-pop__lead { margin: 0; color: var(--soft); }
.b-pop__close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 999px; background: hsl(var(--muted)); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.b-pop__close:hover { background: var(--line); }
.b-pop__photos { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.b-pop__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.b-pop__photos--many { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.b-pop__photos figure { margin: 0; display: grid; gap: 4px; }
.b-pop__photos figcaption { font-size: 0.86rem; font-weight: 600; }
.b-pop__credits { margin: 0; font-size: 0.78rem; color: var(--soft); }
.b-pop__credits a { color: inherit; }
.b-pop__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.b-pop__chips li { padding: 6px 14px; border-radius: 999px; background: hsl(var(--muted)); font-size: 0.92rem; }
.b-pop__items { margin: 0; display: grid; gap: 12px; }
.b-pop__items dt { font-size: 0.8rem; color: var(--soft); }
.b-pop__items dd { margin: 0; font-size: 1rem; font-weight: 500; }

/* Narrow screens: no board, a short note for each change, under the top bar so it never covers the chat's last line */
.toasts { position: fixed; right: 16px; top: 64px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 0.86rem; font-weight: 500;
  box-shadow: 0 8px 24px -10px rgb(0 0 0 / .35); animation: toast-in .25s ease-out; transition: opacity .4s, transform .4s; }
.toast--out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ----- Dades Obertes: a first page with the portal by topic, then the charts, queries and datasets the
   assistant uses, newest first; each part appears when it has something ----- */
.d-body { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 22px; padding: 18px 2px; }
.d-body [hidden] { display: none; }
.d-body section, .d-home { display: flex; flex-direction: column; gap: 10px; animation: fade-in .3s ease-out; }
.d-hero { display: flex; align-items: baseline; gap: 14px; padding: 6px 2px 0; }
.d-hero small { font-size: 1.2rem; font-weight: 600; letter-spacing: 0; color: var(--soft); }
.d-hero b { font-size: 3.2rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.d-hero span { max-width: 34ch; font-size: 0.96rem; color: var(--soft); }
.d-lead { margin: 0 0 8px; max-width: 60ch; font-size: 0.92rem; color: var(--soft); }
.d-topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.d-topics button { position: relative; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; overflow: hidden; }
.d-topics button:hover { border-color: hsl(var(--foreground) / .35); }
.d-topics i { position: absolute; inset: 0 auto 0 0; background: hsl(var(--accent-soft)); transition: width .6s ease-out; }
.d-topics span, .d-topics b { position: relative; }
.d-topics b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--soft); }
.d-topics span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-visuals { display: flex; flex-direction: column; gap: 10px; }
.d-visual { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.d-visual__plot { width: 100%; height: 340px; }
.d-sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.d-set { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.d-set > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.d-set b { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-set span:not(.status) { font-size: 0.78rem; color: var(--soft); }
.d-set a { flex: none; font-size: 0.8rem; }
.d-set--found b { color: var(--soft); }
.d-queries { display: flex; flex-direction: column; gap: 10px; }
.d-query { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.d-query header { display: flex; flex-direction: column; gap: 2px; }
.d-query header b { font-size: 0.88rem; font-weight: 600; }
.d-query header span { font-size: 0.78rem; color: var(--soft); overflow-wrap: anywhere; }
.d-filters { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.d-filters li { padding: 2px 9px; border-radius: 999px; background: hsl(var(--muted)); font-size: 0.76rem; color: var(--ink); }
.d-figure { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.d-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.d-table table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.d-table th, .d-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.d-table th { position: sticky; top: 0; background: hsl(var(--muted)); font-weight: 600; }
.d-table tr:last-child td { border-bottom: 0; }
.d-empty, .d-more { margin: 0; font-size: 0.82rem; color: var(--soft); }

/* ----- Live board: one card per tool result, newest on top ----- */
.l-cards { display: flex; flex-direction: column; gap: 10px; }
.l-skeleton { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.l-skeleton i { height: 40px; border-radius: 10px; background: hsl(var(--muted)); animation: pulse 1.4s ease-in-out infinite; }
.l-skeleton i:first-child { grid-column: 1 / -1; width: 45%; height: 64px; margin-bottom: 18px; }
.l-card { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.l-card header { display: flex; flex-direction: column; gap: 1px; }
.l-card header b { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.l-card header span { font-size: 0.8rem; color: var(--soft); }
.l-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 20px; margin: 0; }
.l-figures dt { font-size: 0.76rem; font-weight: 500; color: var(--soft); }
.l-figures dd { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.l-figures small { font-size: 0.78rem; font-weight: 500; color: var(--soft); letter-spacing: 0; }
.l-text { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 0.88rem; line-height: 1.55; }
.l-card > a { align-self: flex-start; font-size: 0.84rem; }
.l-bar { position: relative; min-width: 120px; }
.l-bar i { position: absolute; inset: 4px auto 4px 0; border-radius: 3px; background: hsl(var(--accent) / .16); transition: width .5s ease-out; }
.l-bar span { position: relative; padding-left: 6px; }

/* ----- The chat's sources: the web pages beside it, and the [n] that cite them in an answer ----- */
.s-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.s-item { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.s-item.is-read { border-color: hsl(var(--primary) / .45); }
.s-item > div { min-width: 0; }
.s-n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: hsl(var(--muted)); font-size: 0.75rem; font-weight: 700; }
.s-item a { color: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.s-item a:hover { text-decoration: underline; }
.s-site { display: block; margin-top: 1px; font-size: 0.76rem; color: var(--soft); }
.s-item p { margin: 4px 0 0; font-size: 0.82rem; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cite { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; padding: 0 3px; margin: 0 1px; border-radius: 5px;
  background: hsl(var(--muted)); color: inherit; font-size: 0.72em; font-weight: 700; text-decoration: none; vertical-align: 0.15em; }
.cite:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
