:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --paper-light: #fffcf6;
  --sand: #e8dfcf;
  --sand-deep: #d7c8b1;
  --ink: #302b24;
  --muted: #675c4d;
  --copper: #97532e;
  --copper-hover: #773e20;
  --copper-soft: #ead9c9;
  --line: #d9d0c1;
  --error: #a23428;
  --shadow-composer: 0 14px 38px -20px #6e4d2a55;
  --shadow-note: 0 18px 44px -24px #5a3e2650;
  --display: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
button,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-underline-offset: 0.25em;
}
a,
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button,
a,
textarea {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--copper);
}
::selection {
  background: var(--copper-soft);
  color: var(--ink);
}
textarea {
  caret-color: var(--copper);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--sand-deep) transparent;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
.screen-reader,
.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  width: auto;
  height: auto;
  clip-path: none;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: 10;
  top: 12px;
  left: 12px;
}
.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}
.profile {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
  padding: 38px 30px 28px;
  display: flex;
  flex-direction: column;
  background: var(--sand);
}
.brand {
  display: inline-flex;
  width: 96px;
  min-height: 44px;
  align-items: center;
}
.brand img {
  width: 100%;
  height: auto;
  display: block;
}
.profile-intro {
  margin-top: clamp(36px, 7vh, 84px);
}
.name-mark {
  font: 500 52px/1 var(--display);
  letter-spacing: -0.04em;
  margin-bottom: 22px;
}
.name-mark span {
  color: var(--copper);
}
.profile h2 {
  margin: 0 0 10px;
  font: 500 22px/1.25 var(--display);
  letter-spacing: -0.03em;
}
.profile-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.profile-work {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid #cbbda8;
}
.profile-work p {
  margin: 0;
  font-size: 14px;
}
.profile-work ul {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.profile-work li {
  padding: 5px 0;
}
.profile-links {
  margin-top: 26px;
  display: grid;
  gap: 4px;
}
.profile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  font-size: 12px;
  text-decoration: none;
}
.profile-links a svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms var(--ease);
}
.profile-links a:hover {
  color: var(--copper);
}
.profile-links a:hover svg {
  transform: translate(2px, -1px);
}
.profile-note {
  margin-top: auto;
  padding-top: 30px;
  font-size: 12px;
  color: var(--muted);
}
.note-line {
  display: block;
  width: 30px;
  height: 1px;
  background: var(--copper);
}
.profile-note p {
  margin: 12px 0 0;
}
.conversation {
  min-width: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 102px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.twin-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.twin-identity p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.twin-symbol {
  display: flex;
  align-items: center;
  color: var(--copper);
}
.twin-symbol svg {
  width: 34px;
  height: 28px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.icon-button:hover {
  background: var(--copper-soft);
  border-color: var(--sand-deep);
}
.icon-button:disabled {
  opacity: 0.55;
}
.profile-toggle {
  display: none;
}
.new-conversation {
  background: transparent;
  border: 0;
  padding: 9px 0 9px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 12px;
}
.new-conversation:hover {
  color: var(--copper);
}
.new-conversation svg {
  width: 18px;
  height: 18px;
}
.workspace {
  width: min(100% - 112px, 760px);
  flex: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 20px;
}
.welcome {
  position: relative;
  padding: 0 4px;
  isolation: isolate;
}
.welcome-copy {
  position: relative;
  z-index: 1;
}
h1 {
  margin: 0;
  font: 400 clamp(40px, 4.1vw, 62px) / 1.07 var(--display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}
h1 span {
  color: var(--copper);
}
.welcome-copy > p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  margin: 24px 0 0;
}
.orbit {
  position: absolute;
  top: -36px;
  right: -10px;
  width: 300px;
  height: 240px;
  z-index: 0;
  opacity: 0.62;
  mask-image: linear-gradient(to right, transparent, black 35%);
  pointer-events: none;
}
.orbit canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.question-list {
  display: grid;
  gap: 0;
  margin: 32px 0 30px;
  max-width: 540px;
}
.question-list button {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 15px 0;
  min-height: 52px;
  font-size: 14px;
  transition:
    color 200ms var(--ease),
    padding 240ms var(--ease);
}
.question-list button:first-child {
  border-top: 1px solid var(--line);
}
.question-list button:hover {
  color: var(--copper);
  padding-left: 8px;
}
.question-list button svg {
  color: var(--copper);
  width: 18px;
  height: 18px;
}
.question-list button:disabled {
  opacity: 0.5;
}
.composer-area {
  position: relative;
  z-index: 2;
  margin-top: 4px;
}
.composer {
  padding: 18px 18px 12px 22px;
  background: var(--paper-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-composer);
  transition: box-shadow 200ms var(--ease);
}
.composer:focus-within {
  outline: 1px solid var(--copper);
  outline-offset: 0;
}
.composer textarea {
  width: 100%;
  min-height: 34px;
  max-height: 160px;
  resize: none;
  background: transparent;
  border: 0;
  padding: 0;
  display: block;
  font-size: 16px;
  line-height: 1.65;
  outline: none;
  overflow-y: auto;
}
.composer textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}
.composer-hint {
  font-size: 12px;
  color: var(--muted);
}
.send-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--copper);
  color: var(--paper-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 160ms,
    transform 200ms var(--ease);
}
.send-button:hover:not(:disabled) {
  background: var(--copper-hover);
  transform: translateY(-2px);
}
.send-button:disabled {
  background: var(--sand);
  color: var(--muted);
}
.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.disclaimer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0 0;
}
.disclaimer a:hover {
  color: var(--ink);
}
.conversation-footer {
  margin: 0 40px;
  padding: 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.conversation-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}
.conversation-footer a:hover {
  color: var(--copper);
}
.conversation-footer svg {
  width: 14px;
  height: 14px;
}
.noscript {
  font-size: 14px;
}
/* The thread takes over the workspace. Reading stays bounded to a text measure. */
.in-conversation .workspace {
  justify-content: flex-start;
  padding-top: 20px;
}
.thread {
  padding: 0 4px 32px;
  outline-offset: 8px;
}
.message {
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}
.message-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.message-label svg {
  width: 20px;
  height: 14px;
  color: var(--copper);
}
.message-content {
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  max-width: 70ch;
}
.message.user {
  margin-left: auto;
  max-width: 88%;
}
.message.user .message-content {
  border-radius: 12px 12px 3px 12px;
  background: var(--sand);
  padding: 14px 20px;
}
.message.user .message-label {
  justify-content: flex-end;
}
.message.bot {
  padding: 4px 0 0;
}
.message.bot .message-content {
  padding: 0;
}
.message.pending .message-content {
  color: var(--muted);
  font-size: 14px;
}
.pending-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 0 3px 2px 0;
  background: var(--copper);
  animation: breathe 1.4s ease-in-out infinite alternate;
}
.error-note {
  background: var(--copper-soft);
  padding: 16px 20px;
  border-radius: 12px;
}
.error-note p {
  margin: 0;
  font-size: 14px;
}
.error-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.retry {
  border: 0;
  background: var(--ink);
  color: var(--paper-light);
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 12px;
}
.error-actions a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
}
.answer-next {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.answer-contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  color: var(--copper);
  font-size: 13px;
  margin-top: 12px;
}
.answer-contact svg {
  width: 16px;
  height: 16px;
}
.reset-notice {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 20px;
}
@keyframes breathe {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}
.motion-reduced *,
.motion-reduced *::before,
.motion-reduced *::after {
  animation: none !important;
  transition: none !important;
}
@media (min-width: 1600px) {
  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .profile {
    padding-left: 40px;
    padding-right: 40px;
  }
}
@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .profile {
    padding: 30px 24px;
  }
  .topbar {
    padding: 0 28px;
    gap: 12px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .twin-identity p {
    display: none;
  }
  .workspace {
    width: calc(100% - 64px);
  }
  .conversation-footer {
    margin: 0 28px;
  }
  .orbit {
    width: 220px;
    right: -20px;
    opacity: 0.4;
  }
}
@media (max-width: 850px) {
  .app-shell {
    display: block;
  }
  .profile {
    display: none;
    position: static;
    height: auto;
    padding: 28px;
  }
  .profile.is-open {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
  }
  .profile .brand {
    display: none;
  }
  .profile-intro {
    margin-top: 0;
  }
  .profile-work {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .profile-links {
    margin-top: 0;
    grid-column: 1/-1;
  }
  .profile-note {
    display: none;
  }
  .conversation {
    min-height: 100svh;
  }
  .profile-toggle {
    display: inline-flex;
  }
  .topbar {
    height: 88px;
    padding: 0 24px;
  }
  .new-conversation span {
    display: none;
  }
  .new-conversation {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
  }
  .new-conversation svg {
    width: 20px;
    height: 20px;
  }
  .workspace {
    width: min(100% - 64px, 700px);
    padding-top: 36px;
  }
  h1 {
    font-size: 52px;
  }
  .conversation-footer {
    margin: 0 24px;
  }
  .orbit {
    right: 0;
    width: 250px;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 78px;
    padding: 0 18px;
    gap: 10px;
  }
  .twin-identity {
    gap: 8px;
  }
  .twin-identity > div > span {
    display: block;
    max-width: 122px;
    font-size: 12px;
    line-height: 1.35;
  }
  .twin-symbol svg {
    width: 26px;
  }
  .topbar-actions {
    gap: 6px;
  }
  .new-conversation,
  .profile-toggle {
    width: 44px;
    min-height: 44px;
    border: 0;
  }
  .workspace {
    width: calc(100% - 40px);
    padding-top: 30px;
    padding-bottom: 24px;
  }
  .welcome {
    padding: 0;
  }
  h1 {
    font-size: clamp(36px, 9.5vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.035em;
  }
  .welcome-copy > p {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.75;
    max-width: 36ch;
  }
  .desktop-break {
    display: none;
  }
  .orbit {
    width: 190px;
    height: 165px;
    right: -14px;
    top: -24px;
    opacity: 0.25;
    mask-image: linear-gradient(to right, transparent, black 65%);
  }
  .question-list {
    margin: 28px 0 24px;
  }
  .question-list button {
    font-size: 13px;
    min-height: 54px;
    gap: 12px;
  }
  .composer {
    padding: 16px 14px 12px 18px;
  }
  .composer-hint {
    font-size: 12px;
  }
  .composer textarea {
    font-size: 16px;
  }
  .composer-meta {
    font-size: 12px;
    line-height: 1.5;
  }
  .disclaimer {
    font-size: 12px;
    margin-top: 18px;
  }
  .conversation-footer {
    margin: 0 20px;
    padding-bottom: 16px;
  }
  .profile.is-open {
    display: block;
    padding: 24px;
  }
  .profile-intro {
    margin-bottom: 24px;
  }
  .profile-links {
    margin-top: 18px;
  }
  .name-mark {
    display: none;
  }
  .message.user {
    max-width: 94%;
  }
  .message-content {
    font-size: 15px;
  }
  .message.user .message-content {
    padding: 12px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 360px) {
  .twin-identity > div > span {
    max-width: 100px;
    font-size: 11px;
  }
  .twin-symbol svg {
    width: 20px;
  }
  .topbar {
    padding-inline: 14px;
  }
}
/* In a conversation, the messages scroll while writing stays within reach. */
.in-conversation .conversation {
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.in-conversation .topbar,
.in-conversation .conversation-footer {
  flex-shrink: 0;
}
.in-conversation .workspace {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 8px;
  overflow: hidden;
}
.in-conversation .thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 18px;
  scroll-padding: 18px 0;
}
.in-conversation .composer-area {
  flex-shrink: 0;
  padding-top: 12px;
}
@media (max-width: 850px) {
  .in-conversation .profile.is-open {
    flex-shrink: 0;
    max-height: 40dvh;
    overflow-y: auto;
  }
}
@media (max-width: 600px) {
  .in-conversation .conversation-footer {
    padding-block: 2px 8px;
  }
  .in-conversation .disclaimer {
    margin-top: 12px;
  }
}

.profile > * {
  flex-shrink: 0;
}

.answer-notice {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}
.answer-sources {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.answer-sources summary {
  min-height: 44px;
  display: list-item;
  width: fit-content;
  cursor: pointer;
  padding-top: 10px;
}
.answer-sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.answer-sources a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* The embedded conversation is the same app, fitted to a reserved iframe. */
.is-embedded .app-shell {
  display: block;
}
.is-embedded .conversation {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.is-embedded .topbar {
  height: 64px;
  min-height: 64px;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.is-embedded .twin-identity {
  font-size: 12px;
}
.is-embedded .twin-identity p {
  display: none;
}
.is-embedded .twin-symbol svg {
  width: 28px;
}
.is-embedded .new-conversation {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}
.is-embedded .new-conversation span {
  display: none;
}
.is-embedded .workspace {
  width: calc(100% - 48px);
  padding: 28px 0 20px;
  min-height: 0;
  overflow-y: auto;
  justify-content: center;
}
.is-embedded h1 {
  font-size: clamp(28px, 5.5vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.is-embedded .welcome-copy > p {
  margin-top: 16px;
  font-size: 14px;
}
.is-embedded .question-list {
  margin-block: 24px;
  max-width: none;
}
.is-embedded .question-list button {
  font-size: 14px;
  min-height: 48px;
  padding-block: 12px;
}
.is-embedded .orbit {
  width: 190px;
  height: 150px;
  top: -16px;
  right: -4px;
  opacity: 0.45;
}
.is-embedded .composer {
  padding: 16px 16px 10px;
}
.is-embedded .composer-bottom {
  padding-top: 8px;
}
.is-embedded .composer-meta {
  margin-top: 8px;
  font-size: 12px;
}
.is-embedded .disclaimer {
  margin-top: 12px;
  font-size: 12px;
}
.is-embedded .message-content {
  font-size: 15px;
  line-height: 1.75;
}
.is-embedded.in-conversation .workspace {
  padding-top: 0;
  overflow: hidden;
}
.is-embedded.in-conversation .thread {
  padding-top: 20px;
}
@media (max-width: 400px) {
  .is-embedded .topbar {
    padding-inline: 16px;
  }
  .is-embedded .workspace {
    width: calc(100% - 32px);
  }
  .is-embedded .composer-meta > span:first-child {
    max-width: 20ch;
  }
}
@media (max-height: 560px) {
  .is-embedded .workspace {
    justify-content: flex-start;
  }
}

.is-embedded .message-label { font-size: 12px; }

/* Native language choice stays available without resetting the conversation. */
.language-select {
  min-width: 56px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.language-select:hover { background: var(--copper-soft); }
@media (max-width: 600px) {
  .topbar-actions { gap: 2px; }
  .twin-identity > div > span { max-width: 108px; }
}

@media (max-width: 360px) {
  .twin-identity > div > span { max-width: 80px; }
}
