:root {
  --mono: "Source Code Pro", monospace;
  --sans: "Manrope", "Noto Sans JP", "Source Sans 3", sans-serif;
  --display: "Manrope", "Sora", sans-serif;
  --display-alt: "Sora", "Manrope", sans-serif;

  --base3:  #ffffff;
  --base2:  #f1f5f9;
  --base1:  #64748b;
  --base0:  #475569;
  --base00: #1e293b;
  --base01: #0f172a;
  --yellow:  #b45309;
  --orange:  #c2410c;
  --red:     #b91c1c;
  --magenta: #9d174d;
  --violet:  #6d28d9;
  --blue:    #1d4ed8;
  --cyan:    #0f766e;
  --green:   #15803d;

  --ink:    var(--base01);
  --subtle: var(--base0);
  --line:   #e2e8f0;
  --bg:     var(--base3);
  --panel:  #f8fafc;
  --teal:   var(--cyan);
  --teal-soft: #e0f2fe;
  --user:   #eff6ff;

  --accent:                   var(--cyan);
  --accent-contrast:          #ffffff;
  --message-assistant-accent: var(--cyan);
  --focus-glow:               rgba(15, 118, 110, 0.16);

  /* Decorative variables — zeroed out for clean minimal look */
  --grain-opacity:             0;
  --body-grain-opacity:        0;
  --ruled-line-color:          transparent;
  --pinstripe-color:           transparent;
  --pinstripe-highlight:       transparent;
  --stitch-color:              transparent;
  --inner-glow:                transparent;
  --vignette-opacity:          0;
  --emboss-shadow:             transparent;
  --emboss-highlight:          transparent;
  --header-rule-color:         transparent;
  --footer-engrave-color:      transparent;
  --footer-engrave-highlight:  transparent;
  --ledger-line-color:         transparent;
  --pointer-color:             var(--message-assistant-accent);

  --shell-shadow:              rgba(15, 23, 42, 0.08);
  --header-gradient-start:     #ffffff;
  --header-gradient-end:       #ffffff;
  --header-title-shadow:       transparent;
  --chat-log-bg:               #f8fafc;
  --message-bg:                #ffffff;
  --message-assistant-bg:      #f8fafc;
  --message-user-border:       #2563eb;
  --message-system-bg:         #fff7ed;
  --message-system-border:     #ea580c;
  --content-pre-border:        #e2e8f0;
  --content-pre-bg:            #f8fafc;
  --content-code-bg:           #f1f5f9;
  --composer-bg:               #f8fafc;
  --textarea-border:           #cbd5e1;
  --textarea-bg:               #ffffff;
  --textarea-focus-outline:    rgba(15, 118, 110, 0.25);
  --button-shadow:             rgba(15, 118, 110, 0.28);
  --send-loading-base:         var(--teal);
  --send-loading-stripe:       rgba(0, 0, 0, 0.15);
  --settings-focus-outline:    rgba(15, 118, 110, 0.3);
  --settings-panel-bg:         #ffffff;
  --settings-panel-shadow:     rgba(15, 23, 42, 0.12);
  --footer-bg:                 #f1f5f9;
  --disclaimer-color:          rgba(15, 23, 42, 0.56);
  --disclaimer-color-mobile:   rgba(15, 23, 42, 0.5);

  --info-border:               rgba(226, 232, 240, 0.18);
  --info-bg-overlay:           rgba(30, 64, 175, 0.18);
  --info-bg-start:             #1e293b;
  --info-bg-mid:               #1a2539;
  --info-bg-end:               #151e30;
  --info-shadow:               rgba(0, 0, 0, 0.55);
  --info-sheen:                rgba(255, 255, 255, 0.04);
  --info-title:                #f0f9ff;
  --info-heading:              #e0f2fe;
  --info-text:                 #bae6fd;
  --info-list:                 #e0f2fe;
  --info-marker:               #7dd3fc;

  --surface-accent-soft:        color-mix(in srgb, var(--accent) 10%, var(--message-bg) 90%);
  --surface-accent-soft-strong: color-mix(in srgb, var(--accent) 16%, var(--message-bg) 84%);
  --surface-raised-bg:          color-mix(in srgb, var(--message-bg) 88%, var(--panel) 12%);
  --surface-raised-alt-bg:      color-mix(in srgb, var(--panel) 84%, var(--message-bg) 16%);
  --surface-border-soft:        color-mix(in srgb, var(--line) 72%, transparent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.page-layout {
  width: 100%;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes settings-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes typing-dot-bounce {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 0.9;
    transform: translateY(-2px);
  }
}

@keyframes send-button-loading {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes welcome-item-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.chat-shell {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: var(--panel);
  box-shadow: none;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  position: relative;
  z-index: 1;
  animation: shell-in 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-shell > * {
  position: relative;
  z-index: 1;
}

.chat-header {
  --header-toggle-size: 2.35rem;
  --header-toggle-gap: 0.5rem;
  padding: 1.25rem var(--chat-side-padding) 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.68rem;
  position: relative;
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 0.06rem;
}

a.brand-text,
a.brand-text:visited,
a.brand-text:hover,
a.brand-text:active {
  color: inherit;
  text-decoration: none;
  border: 0;
}

.brand-logo-link,
.brand-logo-link:visited,
.brand-logo-link:hover,
.brand-logo-link:active {
  color: inherit;
  text-decoration: none;
  border: 0;
  display: block;
  flex: 0 0 auto;
}

.brand-logo {
  width: auto;
  height: 56px;
  align-self: center;
  flex: 0 0 auto;
  display: block;
  /* border-radius: 999px; */
  object-fit: cover;
  background: transparent;
  /* box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 0 0 3px var(--emboss-shadow),
    0 2px 6px rgba(0, 0, 0, 0.08); */
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.brand-logo-link:hover .brand-logo {
  /* box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 3px var(--emboss-shadow),
    0 4px 12px rgba(0, 0, 0, 0.12); */
  transform: scale(1.03);
}

.header-kicker {
  margin: 0;
  color: var(--subtle);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.header-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--header-rule-color), transparent 82%);
}

.chat-header h1 {
  margin: 0.3rem 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.65rem, 2.6vw, 2.4rem);
  letter-spacing: 0.01em;
  font-weight: 800;
  line-height: 1.04;
  color: var(--base00);
}

.brand-title-main {
  color: inherit;
}

.brand-title-separator {
  color: inherit;
  opacity: 0.72;
  margin: 0 0.24rem;
  font-weight: 600;
}

.brand-title-site {
  color: inherit;
  opacity: 0.68;
  font-weight: 600;
}

.header-lead {
  margin: 0.02rem 0 0;
  color: var(--base01);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.32;
}

.welcome-panel {
  display: grid;
  width: min(100%, var(--chat-column-max-width));
  max-width: 100%;
  gap: 1.5rem;
  padding: 0;
  margin: 0 auto 0 0;
  background: none;
  border: 0;
  border-radius: 0;
  position: relative;
  overflow: visible;
  box-shadow: none;
}

.welcome-panel::after {
  content: none;
}

.welcome-panel > * {
  position: relative;
  z-index: 1;
}

.welcome-copy {
  display: grid;
  gap: 0.72rem;
  max-width: 42rem;
  margin-top: 0.82rem;
  animation: welcome-item-in 400ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.welcome-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.welcome-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 1.9vw, 2.05rem);
  line-height: 1.08;
  color: var(--base00);
}

.welcome-description {
  margin: 0;
  max-width: 40rem;
  color: var(--base0);
  font-size: 0.92rem;
  line-height: 1.48;
}

.welcome-highlights {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0.85rem 0;
  animation: welcome-item-in 400ms cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
  border-top: 1px solid color-mix(in srgb, var(--surface-border-soft) 82%, var(--accent) 18%);
  border-bottom: 1px solid color-mix(in srgb, var(--surface-border-soft) 88%, transparent);
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      color-mix(in srgb, var(--surface-accent-soft) 42%, transparent) 14%,
      color-mix(in srgb, var(--surface-accent-soft) 28%, transparent) 50%,
      transparent 100%
    );
}

.welcome-highlight-card {
  display: grid;
  flex: 1 1 0;
  gap: 0.28rem;
  padding: 0 1rem;
  align-content: start;
}

.welcome-highlight-card + .welcome-highlight-card {
  border-left: 1px solid var(--surface-border-soft);
}

.welcome-highlight-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--base00);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.welcome-highlight-label::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 72%, white 28%);
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--accent) 12%, transparent);
  flex: 0 0 auto;
}

.welcome-highlight-copy {
  margin: 0;
  color: var(--base0);
  font-size: 0.79rem;
  line-height: 1.42;
}

.welcome-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.75rem;
  margin-top: 0.38rem;
  align-items: start;
  animation: welcome-item-in 400ms cubic-bezier(0.22, 1, 0.36, 1) 280ms both;
}

.welcome-control-block {
  display: grid;
  gap: 0.82rem;
  padding: 0.35rem 0 0.3rem;
  align-content: start;
}

.welcome-control-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: visible;
}

.welcome-control-label {
  margin: 0;
  display: block;
  color: var(--base00);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-block: 0.08rem;
  overflow: visible;
}

.starter-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.44rem;
  align-content: start;
}

.starter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.58rem;
  width: 100%;
  min-height: 0;
  padding: 0.58rem 0.66rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.32;
  text-align: left;
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  animation: welcome-item-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.starter-card:nth-child(1) { animation-delay: 320ms; }
.starter-card:nth-child(2) { animation-delay: 380ms; }
.starter-card:nth-child(3) { animation-delay: 440ms; }
.starter-card:nth-child(4) { animation-delay: 500ms; }

.starter-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line) 66%);
}

.starter-card-question {
  margin: 0;
  font-weight: 700;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.starter-card-meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.24rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line) 72%);
  align-self: start;
}

.welcome-notice {
  display: grid;
  gap: 0.35rem;
  padding: 0.88rem 0.92rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--red) 20%, var(--line));
  background: #fff7ed;
}

.welcome-notice-title,
.welcome-notice-copy {
  margin: 0;
}

.welcome-notice-title {
  color: var(--base00);
  font-size: 0.84rem;
  font-weight: 800;
}

.welcome-notice-copy {
  color: var(--base0);
  font-size: 0.84rem;
  line-height: 1.45;
}

.settings-toggle {
  position: absolute;
  top: 0.96rem;
  right: var(--chat-side-padding);
  display: grid;
  place-items: center;
  line-height: 0;
  width: var(--header-toggle-size);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
  height: var(--header-toggle-size);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--bg);
  color: var(--base00);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.settings-toggle:hover {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: rotate(359deg);
}

.settings-toggle:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 1px;
}

.settings-toggle svg {
  display: block;
  width: 1.28rem;
  height: 1.28rem;
}

.info-toggle {
  position: absolute;
  top: 0.96rem;
  right: calc(var(--chat-side-padding) + var(--header-toggle-size) + var(--header-toggle-gap));
  display: grid;
  place-items: center;
  line-height: 0;
  width: var(--header-toggle-size);
  height: var(--header-toggle-size);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--bg);
  color: var(--base00);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.info-toggle:hover {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: rotate(359deg);
}

.info-toggle[aria-expanded="true"] {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--bg));
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
}

.info-toggle:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 1px;
}

.info-toggle svg {
  display: block;
  width: 1.28rem;
  height: 1.28rem;
}

/* ── Info backdrop ───────────────────────────────────────────────────────── */

.info-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 340ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.info-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.settings-panel {
  position: absolute;
  top: calc(0.84rem + 2.35rem + 0.12rem + 5px);
  right: 0.9rem;
  min-width: 16rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
  background: var(--settings-panel-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 4px 12px -4px rgba(0, 0, 0, 0.08),
    0 20px 36px -18px var(--settings-panel-shadow);
  z-index: 20;
  display: grid;
  gap: 0.64rem;
  animation: settings-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top right;
}

.settings-panel[hidden] {
  display: none;
}

.settings-option[hidden] {
  display: none !important;
}

.settings-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--base01);
  font-size: 0.78rem;
  font-weight: 600;
}

.settings-panel .settings-option + .settings-option {
  margin-top: 0.12rem;
}

.settings-option input {
  margin: 0.18rem 0 0;
  accent-color: var(--blue);
}

.settings-control {
  display: grid;
  gap: 0.4rem;
}

.settings-control span {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.66rem;
}

.settings-control select {
  width: 100%;
  border: 1px solid var(--textarea-border);
  border-radius: 10px;
  padding: 0.42rem 0.52rem;
  font: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  background: var(--textarea-bg);
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.settings-control select:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 1px;
  border-color: var(--cyan);
}

.settings-action {
  padding-top: 0.25rem;
  justify-content: space-between;
  align-items: center;
}

.persona-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem;
  border: none;
  border-radius: 0.3rem;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.persona-toggle-button svg {
  width: 1.1em;
  height: 1.1em;
}

.persona-toggle-button:hover {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.persona-toggle-button.is-active {
  color: var(--blue);
}

.persona-toggle-button:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 1px;
}

.clear-cache-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: 6px;
  padding: 0.32rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.clear-cache-button:hover {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

.clear-cache-button:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 1px;
}

.clear-cache-icon {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

.chat-log {
  overflow: auto;
  min-height: 0;
  padding: 1.05rem var(--chat-side-padding) 1.2rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  background: var(--chat-log-bg);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.chat-log::-webkit-scrollbar {
  width: 10px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 200ms ease;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
  background-clip: content-box;
}

.chat-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 999px;
  margin: 4px 0;
}

.message {
  max-width: min(84%, 52rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1.05rem;
  font-size: 0.97rem;
  background: var(--message-bg);
  line-height: 1.52;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px -4px rgba(0, 0, 0, 0.08);
  animation: message-in 280ms cubic-bezier(0.22, 1, 0.36, 1);
  transition: box-shadow 200ms ease;
  position: relative;
}

.message.assistant {
  background: var(--message-assistant-bg);
  border-left: 4px solid var(--message-assistant-accent);
  padding-left: calc(1.05rem - 3px);
}

.message.assistant.assistant-with-sources-shelf {
  z-index: 2;
}

.message.assistant::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--pointer-color);
  clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
}

.message.assistant.assistant-with-sources-shelf::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: -0.72rem;
  height: 0.72rem;
  pointer-events: none;
  background: radial-gradient(78% 100% at 50% 0%, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0) 72%);
  filter: blur(2.6px);
  opacity: 0.55;
}

.message.user {
  margin-left: auto;
  background: var(--user);
  border-color: var(--message-user-border);
  border-right: 4px solid var(--message-user-border);
  padding-right: calc(1.05rem - 3px);
}

.message.user::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--message-user-border);
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
}

.message.system {
  background: var(--message-system-bg);
  border-color: var(--message-system-border);
  border-left: 4px solid var(--message-system-border);
  padding-left: calc(1.05rem - 3px);
}

.message.system.search-expansion-status-message {
  width: 100%;
  max-width: 100%;
  margin: 0.15rem 0 0.25rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--subtle);
  font-size: 0.86rem;
  line-height: 1.2;
}

.message.system.search-expansion-status-message .content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.message.system.search-expansion-status-message .content::before,
.message.system.search-expansion-status-message .content::after {
  content: "";
  flex: 1 1 0;
  min-width: 1.4rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.message.system.sources-message {
  width: min(84%, 50rem);
  max-width: min(84%, 50rem);
  margin-left: calc((min(84%, 52rem) - min(84%, 50rem)) / 2);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top-width: 0;
  padding-top: 0.82rem;
  z-index: 1;
  box-shadow:
    0 2px 8px -6px rgba(0, 0, 0, 0.06),
    0 8px 20px -16px rgba(0, 0, 0, 0.1);
}

.message.assistant + .message.system.sources-message {
  margin-top: -1rem;
}

.message.assistant + .message.system.routing-system-message + .message.system.sources-message {
  margin-top: -1rem;
}

.message.system.sources-message .content h3 {
  margin-top: 0;
}

.message.system.sources-message .content {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.sources-header {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0.16rem;
  margin-bottom: 0.85rem;
}

.sources-header p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.8rem;
}

.sources-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0.72rem;
}

.source-card {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0.14rem;
  padding: 0 0 0.72rem;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 22%, transparent);
  background: none;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.source-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.source-card:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

.source-card:focus-visible {
  outline: 2px solid var(--textarea-focus-outline);
  outline-offset: 2px;
  border-radius: 6px;
}

.source-card-badges {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.source-card-badge {
  display: block;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  border: 0;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card-title {
  color: var(--base00);
  font-family: var(--display-alt);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.28;
  min-width: 0;
}

.source-card:hover .source-card-title {
  color: var(--accent);
}

.message.system.typing-indicator .content {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.typing-dot {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.25;
  animation: typing-dot-bounce 1.05s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.18s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.36s;
}

.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 0.88em;
  background: var(--message-assistant-accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  border-radius: 1px;
  opacity: 0.75;
  animation: cursor-blink 650ms steps(2, start) infinite;
}

.meta {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.14rem 0.44rem;
  border-radius: 999px;
  background: var(--base2);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.015em;
  line-height: 1.3;
}

body.hide-routing-meta .meta.routing-meta {
  display: none;
}

body.hide-routing-meta .message.system.routing-system-message {
  display: none;
}

.answer-feedback {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.answer-feedback-label {
  margin-right: 0.18rem;
  color: var(--subtle);
  font-size: 0.72rem;
  line-height: 1.2;
}

.feedback-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--base00);
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.feedback-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.feedback-button:focus-visible {
  outline: 2px solid var(--textarea-focus-outline);
  outline-offset: 1px;
}

.feedback-button.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--base01);
}

.feedback-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.feedback-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.feedback-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
  fill: currentColor;
}

.answer-feedback-status {
  font-size: 0.72rem;
  color: var(--subtle);
  line-height: 1.2;
}

.answer-feedback-status.is-error {
  color: var(--red);
}

.content p {
  margin: 0 0 0.5rem 0;
}

.content p:last-child {
  margin-bottom: 0;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  margin: 0.3rem 0 0.52rem;
  line-height: 1.24;
  color: var(--base00);
}

.content h1 {
  font-size: 1.03rem;
}

.content h2 {
  font-size: 0.99rem;
}

.content h3 {
  font-size: 0.95rem;
}

.content ul,
.content ol {
  margin: 0.24rem 0 0.6rem 1.22rem;
  padding: 0;
}

.content li {
  margin: 0.2rem 0;
}

.content pre {
  margin: 0.45rem 0;
  padding: 0.64rem 0.72rem;
  border: 1px solid var(--content-pre-border);
  border-radius: 12px;
  background: var(--content-pre-bg);
  overflow: auto;
  box-shadow: none;
}

.content code {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 0.08rem 0.3rem;
  border-radius: 5px;
  background: var(--content-code-bg);
  border: 1px solid var(--line);
  box-shadow: none;
}

.content pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 160ms ease, color 160ms ease;
}

.content a:hover {
  text-decoration-color: currentColor;
}

.content .source-domain {
  font-size: 0.8em;
  color: var(--subtle);
}

.composer {
  border-top: 1px solid var(--line);
  padding: 1rem var(--chat-side-padding) 1.05rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.86rem;
  background: var(--composer-bg);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.composer-shell {
  display: grid;
  gap: 0.72rem;
  min-height: 96px;
  padding: 0.9rem 1rem 0.92rem;
  border: 1px solid var(--textarea-border);
  border-radius: 20px;
  background: var(--textarea-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.composer-shell:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--focus-glow);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.composer-context {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.composer-context-picker {
  position: relative;
  z-index: 4;
}

.composer-context-label {
  color: var(--subtle);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.composer-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.25rem 0.58rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent);
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 700;
}

button.composer-context-pill-button {
  position: relative;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

button.composer-context-pill-button:hover {
  transform: none;
  box-shadow: none;
  background: var(--surface-accent-soft);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line) 64%);
  color: var(--accent);
}

button.composer-context-pill-button:active {
  transform: none;
}

button.composer-context-pill-button[aria-expanded="true"] {
  background: var(--surface-accent-soft);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line) 58%);
  color: var(--accent);
}

.composer-context-pill-icon {
  width: 0.84rem;
  height: 0.84rem;
  flex: 0 0 auto;
  opacity: 0.86;
  transition: transform 160ms ease;
}

button.composer-context-pill-button[aria-expanded="true"] .composer-context-pill-icon {
  transform: rotate(180deg);
}

.composer-site-menu {
  position: absolute;
  bottom: calc(100% + 0.48rem);
  left: 0;
  min-width: min(18rem, calc(100vw - (2 * var(--chat-side-padding))));
  padding: 0.36rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--settings-panel-bg);
  box-shadow:
    0 4px 16px -4px rgba(0, 0, 0, 0.1),
    0 18px 28px -22px rgba(0, 0, 0, 0.16);
  display: grid;
  gap: 0.2rem;
  z-index: 12;
  animation: settings-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom left;
}

.composer-site-menu[hidden] {
  display: none;
}

button.composer-site-option {
  width: 100%;
  justify-content: space-between;
  padding: 0.54rem 0.62rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-shadow: none;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.25;
}

button.composer-site-option:hover {
  transform: none;
  box-shadow: none;
  background: var(--surface-accent-soft);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--surface-border-soft) 80%);
  color: var(--accent);
}

button.composer-site-option:active {
  transform: none;
}

button.composer-site-option.is-active {
  background: var(--surface-accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--surface-border-soft) 72%);
  color: var(--accent);
}

.composer-site-option-label {
  min-width: 0;
}

.composer-site-option-state {
  flex: 0 0 auto;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 84px;
  max-height: 220px;
  border: none;
  border-radius: 0;
  padding: 0;
  font: inherit;
  line-height: 1.44;
  color: var(--ink);
  background: transparent;
  resize: none;
  box-shadow: none;
  transition: none;
}

textarea:focus {
  outline: none;
  box-shadow: none;
}

textarea::placeholder {
  color: var(--subtle);
  opacity: 0.82;
}

.actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0;
  align-self: end;
  justify-self: end;
  padding-bottom: 0.16rem;
}

.composer-hint {
  margin: 0;
  color: var(--subtle);
  font-size: 0.75rem;
  line-height: 1.2;
}

button {
  border: 0;
  background: linear-gradient(130deg, var(--teal) 0%, var(--blue) 100%);
  color: var(--base3);
  border-radius: 999px;
  padding: 0.62rem 1.14rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 12px 24px -10px var(--button-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -12px var(--button-shadow);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 2px solid var(--settings-focus-outline);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

#sendButton {
  position: relative;
  align-self: flex-end;
  min-height: 2.95rem;
  min-width: 0;
  padding: 0.32rem 0.48rem 0.32rem 0.34rem;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 86%, white 14%) 0%,
      color-mix(in srgb, var(--accent) 62%, var(--ink) 38%) 100%
    );
  border-radius: 999px;
  justify-content: flex-start;
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, filter 180ms ease;
  text-shadow: none;
  color: var(--accent-contrast);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line) 66%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 24px -18px var(--button-shadow);
}

#sendButton:disabled:not([data-loading="true"]) {
  background:
    linear-gradient(
      180deg,
      var(--surface-raised-bg) 0%,
      var(--surface-raised-alt-bg) 100%
    );
  color: var(--subtle);
  border-color: var(--surface-border-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 18px -22px rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
  opacity: 1;
}

#sendButton:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 16px 28px -18px var(--button-shadow);
  filter: brightness(1.03);
}

#sendButton:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 8px 16px -16px var(--button-shadow);
  filter: brightness(0.96);
}

#sendButton > * {
  position: relative;
  z-index: 1;
}

#sendButton[data-loading="true"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 84%, white 16%) 0%,
      color-mix(in srgb, var(--accent) 66%, var(--ink) 34%) 100%
    );
  opacity: 1;
  cursor: wait;
}

#sendButton[data-loading="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    60deg,
    transparent,
    transparent 12px,
    var(--send-loading-stripe) 12px,
    var(--send-loading-stripe) 24px
  );
  background-size: 200% 100%;
  animation: send-button-loading 1s linear infinite;
  z-index: 0;
}

.send-icon {
  width: 0.86rem;
  height: 0.86rem;
  display: inline-block;
  flex: 0 0 auto;
}

.send-icon-badge {
  display: grid;
  place-items: center;
  width: 2.08rem;
  height: 2.08rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.send-label {
  display: inline-flex;
  align-items: center;
  padding-right: 0.16rem;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#sendButton:disabled:not([data-loading="true"]) .send-icon-badge {
  background: var(--surface-accent-soft);
  border-color: color-mix(in srgb, var(--line) 74%, var(--surface-border-soft) 26%);
  color: var(--accent);
  box-shadow: none;
}

.chat-footer {
  border-top: 1px solid var(--line);
  padding: 0.56rem 0.9rem 0.62rem;
  background: var(--footer-bg);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem 1rem;
}

.chat-footer p {
  margin: 0;
  color: var(--base00);
  font-size: 0.76rem;
}

.chat-footer .footer-copy {
  text-align: left;
  white-space: nowrap;
}

.chat-footer .footer-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--base1);
  line-height: 1.3;
}

.chat-footer .footer-inquiries {
  text-align: right;
  white-space: nowrap;
}

.chat-footer a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* .site-disclaimer removed — text moved into .chat-footer .footer-disclaimer */

.info {
  position: fixed;
  top: 0;
  right: 0;
  width: clamp(300px, 38vw, 500px);
  height: 100dvh;
  border: none;
  border-left: 1px solid var(--info-border);
  border-radius: 0;
  padding: 0;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--info-bg-overlay) 0%, transparent 48%),
    linear-gradient(165deg, var(--info-bg-start) 0%, var(--info-bg-mid) 58%, var(--info-bg-end) 100%);
  box-shadow: -8px 0 48px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 100dvh;
  overflow: hidden;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.info.is-open {
  transform: translateX(0);
}

.info-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(1.1rem, 1.9vw, 1.45rem) clamp(1rem, 1.9vw, 1.35rem) 0.65rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--info-border);
}

.info-drawer-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--info-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--info-text);
  cursor: pointer;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  margin-top: 0.1rem;
}

.info-drawer-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--info-title);
  border-color: rgba(255, 255, 255, 0.2);
  transform: none;
  box-shadow: none;
}

.info-drawer-close:focus-visible {
  outline: 2px solid rgba(224, 236, 255, 0.4);
  outline-offset: 1px;
}

.info-drawer-close svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.info h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--info-title);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.info-accordion {
  width: 100%;
  display: block;
  flex: 1;
  overflow-y: auto;
  padding: 0 clamp(1rem, 1.9vw, 1.35rem) clamp(1.2rem, 2vw, 1.6rem);
}

.info-accordion::-webkit-scrollbar {
  width: 6px;
}

.info-accordion::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  transition: background 200ms ease;
}

.info-accordion::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

.info-accordion::-webkit-scrollbar-track {
  background: transparent;
}

.info-accordion-item {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--info-border);
  border-radius: 0;
  background: transparent;
  position: relative;
}

.info-accordion-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
}

.info-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.74rem 0;
}

.info-accordion-summary::-webkit-details-marker {
  display: none;
}

.info-accordion-summary::after {
  content: "\203A";
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--info-heading);
  opacity: 0.9;
  transform: rotate(90deg);
  transform-origin: center;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.info-accordion-item[open] > .info-accordion-summary::after {
  transform: rotate(270deg);
}

.info-accordion-summary h3 {
  margin: 0;
}

.info-accordion-content {
  display: grid;
  gap: 0.56rem;
  padding: 0 0 0.9rem 0.7rem;
  border-left: 2px solid var(--info-marker);
  margin-left: 0.05rem;
}

.info h3 {
  margin: 0.12rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--info-heading);
}

.info dt {
  font-weight: 600;
  color: var(--info-heading);
}
.info dd {
  padding-bottom: 10px;
}

.info p, .info dd, .info dt {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.68;
  color: var(--info-text);
}

.info ul, .info ol {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.32rem;
}

.info li {
  font-size: 0.87rem;
  color: var(--info-list);
  line-height: 1.6;
}

.info li::marker {
  color: var(--info-marker);
}

.message.system .content a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  padding-bottom: 10px;
  transition: border-color 160ms ease, color 160ms ease;
}

.message.system .content a:hover {
  border-bottom-color: var(--blue);
  color: var(--cyan);
}

.site-picker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-self: start;
}

.site-picker-pills-welcome {
  margin-top: 0;
}

.site-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid var(--surface-border-soft);
  font-size: 0.78rem;
  font-family: var(--sans);
  line-height: 1.5;
  cursor: pointer;
  background: var(--surface-raised-bg);
  color: var(--ink);
  box-shadow: none;
  text-shadow: none;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.site-pill:active {
  transform: scale(0.95);
}

.site-pill:hover {
  background: var(--surface-accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.site-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

@media (max-width: 980px) {
  .welcome-controls {
    grid-template-columns: 1fr;
  }

  .welcome-highlights {
    flex-direction: column;
    gap: 0.72rem;
    padding: 0.75rem 0;
    background:
      linear-gradient(
        180deg,
        color-mix(in srgb, var(--surface-accent-soft) 34%, transparent) 0%,
        transparent 100%
      );
  }

  .welcome-highlight-card {
    padding: 0;
  }

  .welcome-highlight-card + .welcome-highlight-card {
    border-left: none;
    padding-top: 0.72rem;
    border-top: 1px solid var(--surface-border-soft);
  }

  .starter-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .info {
    width: min(90vw, 420px);
  }

  .message {
    max-width: 90%;
  }

  .message.system.sources-message {
    width: 84%;
    max-width: 84%;
    margin-left: 3%;
  }
}

@media (max-width: 700px) {
  body {
    overflow: hidden;
  }

  body.welcome-active {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page-layout {
    height: 100dvh;
  }

  body.welcome-active .page-layout {
    height: auto;
    min-height: 100dvh;
  }

  .chat-shell {
    overflow: hidden;
  }

  body.welcome-active .chat-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    grid-template-rows: auto auto auto auto;
  }

  .chat-header {
    --header-toggle-size: 1.78rem;
    --header-toggle-gap: 0.46rem;
    padding: 0.56rem var(--chat-side-padding) 0.6rem;
    gap: 0.34rem;
  }

  .brand {
    gap: 0.62rem;
  }

  .brand-text {
    gap: 0;
  }

  .chat-header h1 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.08;
  }

  .header-kicker,
  .header-lead {
    display: none;
  }

  .welcome-panel {
    gap: 0.82rem;
    padding: 0;
  }

  .welcome-control-block {
    gap: 0.72rem;
    padding: 0.7rem 0 0.4rem;
  }

  .welcome-panel h2 {
    font-size: 1.22rem;
    line-height: 1.08;
  }

  .welcome-description,
  .welcome-highlight-copy,
  .welcome-notice-copy {
    font-size: 0.82rem;
  }

  .starter-card-grid,
  .welcome-controls {
    grid-template-columns: 1fr;
  }

  .welcome-control-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.48rem;
    overflow: visible;
  }

  .welcome-control-label {
    font-size: 0.78rem;
    line-height: 1.38;
    padding-block: 0.14rem;
  }

  .chat-log {
    padding: 0.84rem var(--chat-side-padding) 0.95rem;
  }

  body.welcome-active .chat-log {
    min-height: auto;
    overflow: visible;
  }

  .composer {
    padding: 0.72rem var(--chat-side-padding) 0.82rem;
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .composer-shell {
    gap: 0.62rem;
    padding: 0.78rem 0.82rem 0.8rem;
  }

  .composer-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.38rem;
  }

  .composer-site-menu {
    min-width: min(16rem, calc(100vw - (2 * var(--chat-side-padding))));
  }

  .actions {
    justify-content: flex-end;
    width: 100%;
  }

  .composer-hint {
    font-size: 0.7rem;
  }

  .message {
    max-width: 95%;
    border-radius: 16px;
  }

  .message.system.sources-message {
    width: 88%;
    max-width: 88%;
    margin-left: 3.5%;
  }

  .sources-grid {
    gap: 0.54rem;
  }

  .source-card {
    padding: 0 0 0.58rem;
  }

  #sendButton {
    min-height: 2.78rem;
  }

  .chat-footer {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    grid-template-columns: 1fr 1fr;
    gap: 0.18rem 0.5rem;
  }

  .chat-footer .footer-disclaimer {
    grid-column: 1 / -1;
    order: -1;
    text-align: left;
  }

  .chat-footer .footer-copy {
    text-align: left;
  }

  .chat-footer .footer-inquiries {
    text-align: right;
  }

  .info {
    width: 100vw;
  }

  .info-accordion-summary {
    padding: 0.68rem 0;
  }

  .info-accordion-content {
    padding: 0 0 0.78rem 0.7rem;
    gap: 0.48rem;
  }

  .info p,
  .info li {
    font-size: 0.84rem;
  }

  .settings-panel {
    right: 0.64rem;
    min-width: 14.8rem;
  }

  .info-toggle {
    right: calc(var(--chat-side-padding) + var(--header-toggle-size) + var(--header-toggle-gap));
    top: 0.34rem;
    width: var(--header-toggle-size);
    height: var(--header-toggle-size);
  }

  .settings-toggle {
    top: 0.34rem;
    right: var(--chat-side-padding);
    width: var(--header-toggle-size);
    height: var(--header-toggle-size);
  }

  .info-toggle svg,
  .settings-toggle svg {
    width: 0.92rem;
    height: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .typing-dot {
    opacity: 0.5;
    transform: none;
  }

  .welcome-copy,
  .welcome-highlights,
  .welcome-controls,
  .starter-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .streaming-cursor {
    animation: none !important;
    opacity: 0.7;
  }
}

/* ── Below-the-fold informational sections ─────────────────────────────── */

.page-sections {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.3rem);
  position: relative;
  z-index: 1;
}

.page-section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.3rem, 2.2vw, 1.8rem);
  box-shadow: none;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.section-why  { border-top-color: var(--blue); }
.section-diff { border-top-color: var(--cyan); }
.section-tech { border-top-color: var(--green); }

.section-eyebrow {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle);
}

.section-why  .section-eyebrow { color: var(--blue); }
.section-diff .section-eyebrow { color: var(--cyan); }
.section-tech .section-eyebrow { color: var(--green); }

.section-heading {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--base0);
}

.section-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--subtle);
}

.section-steps {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.44rem;
}

.section-steps li {
  font-size: 0.88rem;
  line-height: 1.54;
  color: var(--subtle);
}

.section-steps li::marker {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 980px) {
  .page-sections {
    grid-template-columns: 1fr;
  }

  .page-section {
    border-radius: 14px;
  }
}

@media (max-width: 700px) {
  .page-sections {
    padding: 0 0.45rem;
    gap: 0.75rem;
  }
}
