:root {
  --ink: #251d1a;
  --muted: #6a5e59;
  --line: #ece5e1;
  --warm: #fff7f2;
  --accent: #ad351e;
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
h1, p { margin: 0; }

.site-header { border-bottom: 1px solid #f3eeeb; }
.header-inner {
  max-width: 1190px;
  margin: auto;
  padding: 15px clamp(14px, 4vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand { display: flex; gap: 9px; align-items: center; text-decoration: none; font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand img { flex: none; }
.reset {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 14px;
  white-space: nowrap;
}
.reset:hover { background: var(--warm); }
.reset span { color: var(--accent); }
main { width: min(100% - 32px, 700px); margin: auto; padding-bottom: 25px; }

.welcome { text-align: center; padding: clamp(26px, 5vh, 53px) 0 23px; }
.mascot-stage {
  position: relative;
  isolation: isolate;
  width: 218px;
  height: 208px;
  margin: 0 auto 13px;
}
.mascot-stage::before {
  content: "";
  position: absolute;
  inset: 13px 10px 2px;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 52%, #ffebda 1%, #fff6ef 61%, transparent 73%);
}
.hero-mascot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 11px #8f4b2d14);
  animation: arrive .48s ease-out both;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.welcome h1 {
  font: 600 clamp(38px, 6.6vw, 65px)/1.04 Fraunces, Georgia, serif;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.welcome em { color: var(--accent); font-style: normal; }
.welcome p { color: var(--muted); margin: 10px 0 0; }
.composer {
  background: #fff;
  border: 1px solid #e9e0da;
  border-radius: 19px;
  padding: 12px;
  box-shadow: 0 9px 35px #4b2c1c0c;
}
.composer:focus-within { border-color: #c47c67; }
.composer textarea {
  display: block;
  resize: vertical;
  width: 100%;
  min-height: 57px;
  max-height: 180px;
  padding: 5px 5px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.45;
}
.composer textarea:focus { outline: none; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.composer-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 14px;
  font-weight: 700;
}
.search-toggle { border: 1px solid transparent; background: #f6f4f2; color: #574943; }
.search-toggle[aria-pressed=true] { background: #eaf4e8; border-color: #c9dfc5; color: #335934; }
.send { min-width: 72px; border: 1px solid var(--accent); background: var(--accent); color: white; }
.send:hover { background: #8d2c18; }
.prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 13px 0 0; }
.prompts button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.prompts button:hover { background: var(--warm); border-color: #e6b5a6; }
.prompt-icon { font-weight: 700; }
.coral { color: #ad351e; }
.gold { color: #906018; }
.green { color: #416c41; }
.chat-foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 12px; }

.has-chat .welcome {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  padding: 15px 0 13px;
}
.has-chat .welcome p, .has-chat .prompts { display: none; }
.has-chat .welcome h1 { font-size: clamp(22px, 4vw, 31px); text-align: left; }
.has-chat .mascot-stage { flex: none; height: 56px; width: 56px; margin: 0; }
.has-chat .mascot-stage::before { inset: 0; }
.has-chat #messages { padding-right: 5px; max-height: min(56vh, 570px); overflow: auto; scrollbar-width: thin; }
.bubble {
  padding: 11px 14px;
  border-radius: 15px;
  width: fit-content;
  max-width: 93%;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.bubble.user { margin-left: auto; background: #fff1ea; white-space: pre-wrap; }
.bubble.assistant { background: #f8f7f6; }
.bubble h3 { font-size: 15px; margin: .6em 0 .3em; }
.bubble p + p { margin-top: 9px; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 22px; }
.bubble li + li { margin-top: 4px; }
.bubble.assistant:has(.loading) {
  padding: 3px 11px 3px 3px;
  background: #fff8f3;
}
.loading { display: flex; align-items: center; gap: 8px; color: #744a3e; font-size: 14px; }
.thinking-portrait {
  position: relative;
  flex: none;
  width: 54px;
  height: 53px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff0e4;
}
.thinking-portrait img {
  display: block;
  height: 81px;
  width: 81px;
  max-width: none;
  margin-left: -13px;
  padding-top: 3px;
  object-fit: contain;
  transform-origin: 50% 60%;
  animation: consider 3s ease-in-out infinite;
}
@keyframes consider {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-2px); }
}
.thought-dots { display: flex; flex: none; gap: 3px; padding-left: 1px; }
.thought-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c34b34;
  opacity: .44;
  animation: ponder 1.45s ease-in-out infinite;
}
.thought-dots i:nth-child(2) { animation-delay: .15s; }
.thought-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ponder {
  0%, 65%, 100% { transform: translateY(0); opacity: .44; }
  34% { transform: translateY(-3px); opacity: 1; }
}
.sources { display: grid; gap: 5px; margin-top: 10px; }
.sources h3 { font-size: 13px; }
.sources a { color: #783b27; text-underline-offset: 3px; font-size: 14px; }
.notice { color: var(--muted); font-size: 13px; margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 540px) {
  main { width: calc(100% - 26px); }
  .header-inner { padding-block: 11px; }
  .brand { font-size: 13px; }
  .reset { font-size: 13px; }
  .welcome { padding: 25px 0 18px; }
  .mascot-stage { width: 175px; height: 161px; margin-bottom: 8px; }
  .welcome p { margin-top: 8px; font-size: 14px; }
  .prompts { gap: 4px; }
  .prompts button { padding: 6px 8px; font-size: 12px; }
  .composer { padding: 9px; }
  .bubble { max-width: 96%; padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot, .thinking-portrait img, .thought-dots i { animation: none; }
}
