/* Plain Words: the selected minimalist workshop direction. Type carries the interface:
   one serif, three colors, line icons beside words, and a single filled writing band.
   The base stylesheet and the theme presets are kept; presets recolor these tokens. */
:root {
  color-scheme: light;
  --sans: "Newsreader", "Iowan Old Style", Georgia, serif;
  --display: var(--sans);
  --display-alt: var(--sans);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --base3: #f4f1ea;
  --base2: #e9e3d6;
  --base1: #5b5852;
  --base0: #5b5852;
  --base00: #1a1a18;
  --base01: #1a1a18;
  --ink: #1a1a18;
  --subtle: #5b5852;
  /* Text tiers, loudest first: --ink, --text-2, --muted, --faint. Each keeps AA
     contrast on --bg and --panel; the theme presets set their own values. */
  --text-2: #363533;
  --muted: #4e4d4a;
  --faint: #656460;
  --line: #c9c3b6;
  --bg: #f4f1ea;
  --panel: #e9e3d6;
  --accent: #1a1a18;
  --accent-contrast: #f4f1ea;
  --cyan: var(--accent);
  --teal: var(--accent);
  --teal-soft: var(--panel);
  --blue: var(--accent);
  --green: var(--accent);
  --red: #9c3a2e;
  --message-assistant-accent: var(--accent);
  --message-bg: var(--bg);
  --message-assistant-bg: var(--bg);
  --message-system-bg: var(--bg);
  --message-system-border: var(--line);
  --message-user-border: var(--line);
  --chat-log-bg: var(--bg);
  --header-gradient-start: var(--bg);
  --header-gradient-end: var(--bg);
  --composer-bg: var(--bg);
  --textarea-bg: var(--panel);
  --textarea-border: var(--ink);
  --content-code-bg: var(--panel);
  --content-pre-bg: var(--panel);
  --content-pre-border: var(--line);
  --settings-panel-bg: var(--bg);
  --footer-bg: var(--bg);
  --focus-glow: transparent;
  --settings-focus-outline: var(--ink);
  --textarea-focus-outline: var(--ink);
  --send-loading-base: var(--accent);
  --send-loading-stripe: color-mix(in srgb, var(--accent-contrast) 22%, transparent);
  --surface-accent-soft: var(--panel);
  --surface-accent-soft-strong: var(--panel);
  --surface-border-soft: var(--line);
  --info-bg-start: var(--bg);
  --info-bg-mid: var(--bg);
  --info-bg-end: var(--bg);
  --info-bg-overlay: transparent;
  --info-title: var(--ink);
  --info-heading: var(--ink);
  --info-text: var(--ink);
  --info-list: var(--ink);
  --info-marker: var(--line);
  --info-border: var(--line);
  --column: 45rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --base3: #151513;
    --base2: #23221e;
    --base1: #a8a397;
    --base0: #a8a397;
    --base00: #ece8df;
    --base01: #ece8df;
    --ink: #ece8df;
    --subtle: #a8a397;
    --text-2: #c8c5bd;
    --muted: #a8a69f;
    --faint: #8c8a84;
    --line: #45423b;
    --bg: #151513;
    --panel: #23221e;
    --accent: #ece8df;
    --accent-contrast: #151513;
    --red: #f0a597;
  }
}

:root[data-theme="kanagawa"],
:root[data-theme="courtyard"],
:root[data-theme="grayscale"] { color-scheme: light; }
:root[data-theme="gruvbox-dark"] { color-scheme: dark; }

/* Keep preset palettes independent of the default surfaces. */
:root[data-theme] {
  --surface-accent-soft: color-mix(in srgb, var(--accent) 10%, var(--bg));
  --surface-accent-soft-strong: color-mix(in srgb, var(--accent) 17%, var(--bg));
  --surface-border-soft: var(--line);
}

body, body.welcome-active { overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); }
button, a, summary, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
button { font-family: var(--sans); font-weight: 400; letter-spacing: 0; box-shadow: none; }
button:hover, button:active { transform: none; box-shadow: none; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 300;
  padding: .6rem 1rem;
  color: var(--accent-contrast);
  background: var(--accent);
}
.skip-link:focus { top: 1rem; }

/* Words are the controls; an icon leads, and the underline stays on the word. */
.word-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--subtle);
  transition: color 150ms ease;
}
.word-button,
.chat-header .word-button,
.clear-cache-button {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  width: auto;
  height: auto;
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 400 1.05rem/1.3 var(--sans);
  transform: none;
  cursor: pointer;
}
.word-button > span,
.clear-cache-button > span {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.word-button:hover, .chat-header .word-button:hover, .clear-cache-button:hover,
.chat-header .word-button[aria-expanded="true"] {
  color: var(--ink);
  background: none;
  border: 0;
  transform: none;
}
.word-button:hover > span, .clear-cache-button:hover > span,
.chat-header .word-button[aria-expanded="true"] > span { text-decoration-color: var(--ink); }
.word-button:hover .word-icon, .clear-cache-button:hover .word-icon { color: var(--ink); }
.chat-header .word-button svg { width: 1em; height: 1em; }
.chat-header .word-button { color: var(--muted); }
.chat-header .word-icon { color: var(--faint); }

/* Shell */
.page-layout, body.welcome-active .page-layout {
  display: block;
  height: 100dvh;
  min-height: 0;
}
.chat-shell, body.welcome-active .chat-shell {
  --chat-side-padding: max(2rem, calc((100% - var(--column)) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  animation: none;
}

/* Header: bear, italic wordmark, three icon controls */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 0;
  padding: 1rem var(--chat-side-padding);
  border: 0;
  background: var(--bg);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; max-width: none; min-width: 0; }
.brand-logo-link { display: flex; flex: none; }
.brand-logo { width: 28px; height: 28px !important; max-height: none; object-fit: contain; }
.brand-text { display: flex; align-items: center; min-height: 44px; gap: 0; text-decoration: none; color: var(--ink); }
.chat-header h1 { margin: 0; font: italic 500 1.25rem/1.2 var(--sans); letter-spacing: -.01em; color: var(--text-2); }
.brand-title-separator, .brand-title-site, .header-lead { display: none; }
.header-actions { display: flex; align-items: center; gap: .25rem; }
.chat-header .header-actions .word-button { min-width: 44px; justify-content: center; }
.chat-header .header-actions .word-icon { width: 1.35rem; height: 1.35rem; }

/* Settings: a full page, like About */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: block;
  width: auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  overflow: auto;
  animation: none;
}
.settings-page {
  max-width: calc(var(--column) + 4rem);
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
}
.settings-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0 1rem;
  background: var(--bg);
}
.settings-head h2 { margin: 0; font: 400 clamp(2rem, 5vw, 3rem)/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.settings-panel .settings-option + .settings-option { margin-top: 0; }
.settings-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1.25rem;
  padding: .9rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font: 400 1.35rem/1.4 var(--sans);
}
.settings-option input { width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--ink); }
.settings-option:has(input[type="checkbox"]) { justify-content: flex-start; gap: .9rem; }
.settings-control select {
  appearance: none;
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}
.settings-control select option { background: var(--bg); color: var(--ink); }
.settings-action { justify-content: flex-start; gap: 1.75rem; }
.clear-cache-button { font-size: 1.2rem; }
.persona-toggle-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--subtle);
  box-shadow: none;
}
.persona-toggle-button svg { width: 1.1rem; height: 1.1rem; }
.persona-toggle-button[aria-pressed="true"], .persona-toggle-button:hover { color: var(--ink); background: none; }

/* Conversation column */
.chat-log, body.welcome-active .chat-log {
  display: grid;
  align-content: start;
  gap: 2rem;
  min-height: 0;
  padding: 2rem var(--chat-side-padding) 2.5rem;
  overflow: auto;
  background: var(--bg);
  scrollbar-color: var(--line) transparent;
  scroll-padding-top: 1.75rem;
}
.chat-log::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); }
.chat-log::-webkit-scrollbar-track { background: var(--bg); }

/* Welcome: a headline, then the writing band, then starters as plain lines */
.welcome-panel { display: block; width: 100%; margin: 0; padding: 4vh 0 1rem; }
.welcome-copy { display: grid; gap: 0; max-width: none; margin: 0; animation: none; }
.welcome-eyebrow { margin: 0 0 1.25rem; font: italic 400 1.05rem/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--subtle); }
.welcome-panel h2 { margin: 0; font: 400 clamp(2.25rem, 6vw, 4.25rem)/1.04 var(--sans); letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.welcome-description { max-width: 30em; margin: 1.75rem 0 0; font-size: 1.3rem; line-height: 1.55; color: var(--subtle); }
.welcome-composer-slot { margin: 2.75rem 0 3.25rem; }
.welcome-starters { display: grid; gap: .5rem; }
.welcome-control-label { margin: 0; font: 400 1rem/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--subtle); }
.starter-card-grid { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 0; }
.starter-card {
  display: inline-flex;
  align-items: baseline;
  gap: .45em;
  width: auto;
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 400 1.4rem/1.35 var(--sans);
  text-align: left;
  animation: none;
}
.starter-card:hover { background: none; border: 0; transform: none; }
.starter-card-question {
  display: inline;
  overflow: visible;
  margin: 0;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.starter-card:hover .starter-card-question { text-decoration-color: var(--ink); }
.starter-card-meta {
  flex: none;
  align-self: center;
  width: .85rem;
  height: .85rem;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0;
  color: var(--subtle);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14m-5-5 5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14m-5-5 5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 150ms ease, color 150ms ease;
}
.starter-card:hover .starter-card-meta { color: var(--ink); transform: translateX(3px); }
.starter-card-meta::after { content: none; }
.welcome-trust { margin: 2.5rem 0 0; font: italic 400 1rem/1.5 var(--sans); color: var(--subtle); }
.welcome-notice { padding: 1rem 0; border-top: 1px solid var(--line); background: none; border-radius: 0; }
.welcome-notice-title { margin: 0; font-size: 1.2rem; color: var(--ink); }
.welcome-notice-copy { margin: .25rem 0 0; color: var(--subtle); }

/* Messages: no cards or bubbles. The question is a quotation; the answer is the page. */
.message {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.25rem;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.message.assistant, .message.user { background: transparent; border: 0; padding: 0; }
.message.assistant::before, .message.assistant.assistant-with-sources-shelf::after, .message.user::before { content: none; }
.message-label, .assistant-byline, .question-copy-status:not(.is-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.message.user .content { font-style: italic; color: var(--text-2); white-space: pre-wrap; }
.message.user .content::before { content: "\201C"; }
.message.user .content::after { content: "\201D"; }
.question-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  column-gap: .5rem;
}
.question-row .content { min-height: 44px; padding-top: .375rem; }
.question-row .question-copy-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.message.user:hover .question-copy-button,
.message.user:focus-within .question-copy-button,
.question-row .question-copy-button.is-copied {
  opacity: 1;
  pointer-events: auto;
}
.question-copy-status.is-error { grid-column: 2; font-size: .95rem; color: var(--red); }
@media (hover: none) {
  .question-row .question-copy-button { opacity: 1; pointer-events: auto; }
}
.message.assistant .content > :first-child { margin-top: 0; }
.message.assistant .content > p:first-child { font-size: 1.4rem; line-height: 1.5; }
.content h1 { margin: 2rem 0 1rem; font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.06; font-weight: 500; letter-spacing: -.03em; text-wrap: balance; }
.content h2 { margin: 1.9rem 0 .7rem; font-size: 1.75rem; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; }
.content h3 { margin: 1.5rem 0 .5rem; font-size: 1.4rem; line-height: 1.3; font-weight: 500; font-style: italic; }
.content h4, .content h5, .content h6 { font-size: 1.2rem; line-height: 1.4; font-weight: 500; }
.content p { margin: 0 0 1rem; }
.content ol, .content ul { margin: 1.2rem 0; padding-left: 1.6rem; }
.content li { margin: .6rem 0; padding-left: .3rem; }
.content li::marker { color: var(--muted); font-variant-numeric: oldstyle-nums; }
.content li > p { margin: .4rem 0; }
.content li > :first-child { margin-top: 0; }
.content strong { font-weight: 500; color: var(--ink); }
.content a, .message.system .content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.content a:hover { text-decoration-color: var(--ink); }
.content code { font-family: var(--mono); font-size: .85em; }
.content pre { border-radius: 0; font-size: .9rem; }
.content blockquote { margin: 1.5rem 0; padding: 0 0 0 1.1rem; background: none; border-left: 1px solid var(--line); color: var(--text-2); font-style: italic; }
.content th { font-weight: 500; }
.content blockquote p:last-child { margin-bottom: 0; }
.meta { margin-top: .75rem; font-size: .95rem; color: var(--muted); }
.message.system { padding: .75rem 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; font-size: 1.05rem; font-style: italic; color: var(--muted); }
.message.system.search-expansion-status-message, .message.system.routing-system-message { padding: 0; border: 0; font-size: 1rem; }

/* Steps open one at a time (answer-steps.js) */
.answer-steps-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--line);
}
.answer-steps-count { font-size: .95rem; color: var(--muted); }
.answer-steps-all {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  background: none;
  color: var(--faint);
  font: 500 .95rem/1.3 var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}
.answer-steps-all::before {
  content: "";
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.answer-steps-all[aria-expanded="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 4 5 5 5-5M7 20l5-5 5 5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 4 5 5 5-5M7 20l5-5 5 5'/%3E%3C/svg%3E");
}
.answer-steps-all:hover { color: var(--ink); text-decoration-color: var(--ink); }
.content ol.answer-steps { margin: 0 0 1.5rem; padding: 0; list-style: none; counter-reset: answer-step; }
.content li.answer-step { margin: 0; padding: 0; border-bottom: 1px solid var(--line); counter-increment: answer-step; }
.answer-step-toggle {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 1.75rem;
  align-items: baseline;
  width: 100%;
  min-height: 4rem;
  padding: .9rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.answer-step-toggle::before { content: counter(answer-step); font-size: 1.25rem; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.answer-step-title { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.answer-step-toggle:hover .answer-step-title { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 6px; }
.answer-step-sign { font-size: 1.6rem; line-height: 1; text-align: right; color: var(--faint); }
.answer-step-body { padding: 0 1.75rem 1.4rem 2.5rem; color: var(--ink); }
.answer-step-body > :last-child { margin-bottom: 0; }

/* Answer actions: icon controls */
.answer-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 .25rem;
  margin-top: 1.5rem;
  padding: 0;
  border: 0;
  color: var(--faint);
}
.answer-feedback-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--faint);
  font: 500 .95rem/1.3 var(--sans);
}
.feedback-button:hover:not(:disabled) { background: none; color: var(--ink); }
.feedback-button.is-selected { background: none; color: var(--text-2); }
.feedback-icon { display: inline-flex; width: 1.25rem; height: 1.25rem; color: var(--faint); }
.feedback-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.feedback-button:hover:not(:disabled) .feedback-icon, .feedback-button.is-selected .feedback-icon { color: currentColor; }
.feedback-button.is-selected .feedback-icon svg { fill: currentColor; }
.answer-feedback-status { flex-basis: 100%; font-size: .95rem; font-style: italic; color: var(--muted); }
.answer-feedback-status:empty { display: none; }
.answer-feedback-status.is-error { color: var(--red); }

/* Sources: one underlined line that opens the list */
.message.system.sources-message {
  width: 100%;
  max-width: 100%;
  margin: -1rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-style: normal;
  color: var(--text-2);
}
.sources-disclosure { border: 0; }
.sources-summary {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 44px;
  padding: .35rem 0;
  cursor: pointer;
  list-style: none;
  font-size: 1.1rem;
}
.sources-summary::-webkit-details-marker { display: none; }
.sources-symbol { display: inline-flex; color: var(--faint); }
.sources-symbol svg { width: 1em; height: 1em; stroke-width: 1.4; }
.sources-title {
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}
.sources-summary:hover .sources-title { text-decoration-color: var(--ink); }
.sources-count { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); }
.sources-count::before { content: "("; }
.sources-count::after { content: ")"; }
.sources-description { display: none; }
.sources-summary::after { content: "+"; width: auto; height: auto; margin-left: .25rem; border: 0; transform: none; color: var(--faint); }
.sources-disclosure[open] > .sources-summary::after { content: "\2212"; transform: none; }
.sources-disclosure .sources-grid { display: grid; gap: 0; padding: .25rem 0 0; }
.sources-disclosure .source-card {
  display: grid;
  justify-items: start;
  gap: 0;
  max-width: 100%;
  min-height: 44px;
  padding: .45rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-decoration: none;
  color: var(--ink);
}
.sources-disclosure .source-card-title {
  display: inline;
  overflow-wrap: anywhere;
  font: 400 1.1rem/1.4 var(--sans);
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.sources-disclosure .source-card-title::after {
  content: "";
  display: inline-block;
  margin-left: .35em;
  vertical-align: -.05em;
  width: .8em;
  height: .8em;
  background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 17 7M10 7h7v7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 17 7M10 7h7v7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sources-disclosure .source-card:hover .source-card-title { color: var(--ink); text-decoration-color: var(--ink); }
.sources-disclosure .source-card:hover .source-card-title::after { background: var(--ink); }
.sources-disclosure .source-card-badges { display: block; max-width: 100%; }
.sources-disclosure .source-card-badge { padding: 0; border: 0; background: none; font: 400 .9rem/1.4 var(--sans); color: var(--muted); white-space: normal; overflow-wrap: anywhere; }

/* Composer: the one filled area on the page, a writing band with a heavy ink rule */
.composer {
  display: block;
  position: relative;
  padding: 1rem var(--chat-side-padding) .6rem;
  border: 0;
  background: var(--bg);
  z-index: 5;
}
.welcome-composer-slot .composer { padding: 0; }
.composer-shell {
  display: block;
  min-height: 0;
  padding: 1rem 1.25rem .5rem;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: inset 0 -2px 0 var(--ink);
  transition: box-shadow 150ms ease;
}
.composer-shell:focus-within { border: 0; box-shadow: inset 0 -4px 0 var(--ink); }
.composer-label { display: block; font: italic 400 1rem/1.4 var(--sans); color: var(--faint); }
.composer.is-docked .composer-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#queryInput {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 220px;
  margin: 0;
  padding: .25rem 0 .6rem;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  resize: none;
  color: var(--ink);
  font: 400 clamp(1.875rem, 4.4vw, 2.75rem)/1.2 var(--sans);
  letter-spacing: -.02em;
}
#queryInput:focus { outline: none; box-shadow: none; }
#queryInput::placeholder { color: var(--faint); opacity: 1; font-style: italic; }
.composer.is-docked #queryInput { font-size: 1.35rem; }
.composer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1.25rem;
  padding-bottom: .4rem;
  font-size: .95rem;
  color: var(--muted);
}
.composer-context { display: inline-flex; align-items: center; gap: .4rem; }
.composer-context-label { font: inherit; letter-spacing: 0; text-transform: none; color: var(--muted); }
.composer-context-picker { position: relative; }
button.composer-context-pill {
  min-height: 44px;
  padding: .35rem 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}
button.composer-context-pill:hover, button.composer-context-pill[aria-expanded="true"] { background: none; text-decoration-color: var(--ink); }
.composer-site-menu {
  min-width: min(18rem, calc(100vw - 2rem));
  padding: .25rem 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  animation: none;
}
button.composer-site-option {
  min-height: 44px;
  padding: .5rem 1rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font: 400 1.1rem/1.3 var(--sans);
}
button.composer-site-option:hover { background: var(--panel); color: var(--ink); }
button.composer-site-option.is-active { background: var(--panel); color: var(--text-2); }
.composer-site-option-state { font-style: italic; color: var(--muted); }
.actions { margin: 0; padding: 0; }
#sendButton {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 44px;
  padding: .5rem 1.25rem;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
  font: 400 1.2rem/1.2 var(--sans);
}
#sendButton:hover:not(:disabled), #sendButton:active:not(:disabled) { background: var(--accent); color: var(--accent-contrast); filter: none; transform: none; }
#sendButton:disabled:not([data-loading="true"]) { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
#sendButton[data-loading="true"] { background: var(--accent); color: var(--accent-contrast); }
#sendButton[data-loading="true"]::before { border-radius: 0; }
#sendButton .send-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: nowrap; }
.send-icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease; }
#sendButton:hover:not(:disabled) .send-icon { transform: translateX(3px); }

/* Footer: the disclaimer, then copyright and contact */
.chat-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  padding: .25rem var(--chat-side-padding) .9rem;
  border: 0;
  background: var(--bg);
}
.chat-footer p, .chat-footer .footer-disclaimer { margin: 0; font-size: .8rem; font-weight: 400; line-height: 1.5; color: var(--faint); text-align: left; }
.chat-footer .footer-disclaimer { flex-basis: 100%; order: -1; }
.chat-footer .footer-inquiries { min-width: 0; text-align: left; }
.chat-footer a {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  min-height: 44px;
  color: var(--faint);
  text-decoration: none;
}
.chat-footer a:hover, :root[data-theme] .chat-footer a:hover { color: var(--ink); }
.chat-footer a span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.chat-footer a:hover span { text-decoration-color: var(--ink); }

/* About: a full page of plain text */
.info-backdrop, .info-backdrop.is-open { display: none; }
.info {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  width: auto;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  overflow: auto;
  transform: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}
/* Visible from the first frame, so the inline drawer script can focus Close. */
.info.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms ease, visibility 0s; }
.info-drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--column) + 4rem);
  margin: 0 auto;
  padding: 1.5rem 2rem 1rem;
  border: 0;
  background: var(--bg);
}
.info h2 { margin: 0; font: 400 clamp(2rem, 5vw, 3rem)/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.info-drawer-close, .info-drawer-close:hover { width: auto; height: auto; border: 0; border-radius: 0; background: none; color: var(--ink); }
.info-drawer-close svg { width: 1em; height: 1em; }
.info-accordion { max-width: calc(var(--column) + 4rem); margin: 0 auto; padding: 0 2rem 4rem; overflow: visible; }
.info-accordion-item { border: 0; border-top: 1px solid var(--line); background: none; box-shadow: none; }
.info-accordion-item::before { content: none; }
.info-accordion-summary { min-height: 3.5rem; padding: .75rem 0; }
.info-accordion-summary h3 { margin: 0; font: italic 400 1.5rem/1.3 var(--sans); color: var(--ink); }
.info-accordion-summary::after { content: "+"; font: 400 1.6rem/1 var(--sans); color: var(--subtle); transform: none; }
.info-accordion-item[open] > .info-accordion-summary::after { content: "\2212"; transform: none; }
.info-accordion-content { display: grid; gap: .75rem; padding: 0 0 1.5rem; border: 0; margin: 0; font-size: 1.2rem; line-height: 1.6; color: var(--ink); }
.info p, .info dd, .info dt, .info li { font-size: 1.2rem; line-height: 1.6; color: var(--ink); }
.info dd { color: var(--subtle); }
.info li::marker { color: var(--subtle); }

@media (max-width: 700px) {
  .chat-shell, body.welcome-active .chat-shell { --chat-side-padding: 1rem; }
  .chat-header { padding-block: .75rem; }
  .word-button, .chat-header .word-button { font-size: 1rem; }
  .settings-page, .info-drawer-header, .info-accordion { padding-left: 1rem; padding-right: 1rem; }
  .chat-log, body.welcome-active .chat-log { padding-top: 1rem; padding-bottom: 1.5rem; gap: 1.6rem; }
  .welcome-panel { padding-top: .5rem; }
  .welcome-description { font-size: 1.2rem; }
  .welcome-composer-slot { margin: 2rem 0 2.5rem; }
  .starter-card { font-size: 1.2rem; }
  .message { font-size: 1.15rem; }
  .message.assistant .content > p:first-child { font-size: 1.2rem; }
  .answer-step-toggle { grid-template-columns: 1.9rem minmax(0, 1fr) 1.5rem; }
  .answer-step-body { padding: 0 0 1.25rem 1.9rem; }
  .composer { padding: .6rem 1rem .4rem; }
  .composer-shell { padding: .85rem .9rem .4rem; }
  #queryInput { font-size: 1.75rem; }
  .composer.is-docked #queryInput { font-size: 1.2rem; }
  .settings-option { font-size: 1.2rem; }
  .chat-footer { padding: 0 1rem calc(.6rem + env(safe-area-inset-bottom)); }
  .chat-footer p, .chat-footer .footer-disclaimer { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
