/* Shared CS Cloud colors, with one set of semantic tokens for both themes. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f5f7fa, #171b22);
  --surface: light-dark(#fff, #202630);
  --text: light-dark(#202631, #edf1f7);
  --muted: light-dark(#606b79, #abb6c6);
  --accent: light-dark(#0864c5, #8ebeff);
  --border: light-dark(#dfe5ec, #3c4756);
  --hover: light-dark(#eaf2fc, #28394f);
  --danger: light-dark(#b42318, #ffaaa2);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
textarea {
  font: inherit;
}
button,
a,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
a {
  color: var(--accent);
}
.hidden {
  display: none !important;
}
.topbar {
  height: 98px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 720;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.brand img {
  object-fit: contain;
}
.company {
  display: block;
  font-size: 8px;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 600;
}
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.quiet,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 13px;
}
.quiet:hover,
.icon-button:hover {
  background: var(--hover);
  color: var(--accent);
}
.icon-button {
  font-size: 22px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
}
main {
  flex: 1;
  width: min(100% - 40px, 790px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 45px 0 16px;
}
.welcome {
  text-align: center;
  margin-bottom: 35px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-bottom: 23px;
}
h1 {
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 580;
  letter-spacing: -2px;
  line-height: 1.12;
  margin: 0;
}
.subtitle {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin: 22px 0 0;
}
.subtle {
  color: var(--muted);
  font-size: 12px;
}
.composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 20px 14px;
  box-shadow: 0 8px 28px #132e4d07;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}
textarea {
  border: 0;
  resize: none;
  outline: none !important;
  width: 100%;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 68px;
  max-height: 180px;
}
textarea::placeholder {
  color: var(--muted);
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.send {
  border: 0;
  background: light-dark(#0864c5, #8ebeff);
  color: light-dark(#fff, #172c47);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.send:hover:not(:disabled) {
  filter: brightness(1.1);
}
.suggestions {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 19px;
  flex-wrap: wrap;
}
.suggestions button {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  padding: 10px 12px;
  text-align: left;
}
.suggestions button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--hover);
}
.notice {
  color: var(--danger);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  margin: 20px 0 0;
}
footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 10px 5% 14px;
  color: var(--muted);
  font-size: 11px;
}
.version {
  opacity: 0.65;
  margin-left: 5px;
}
.conversation {
  margin: 0 0 26px;
}
.message {
  margin: 0 0 30px;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.message.user {
  margin-left: auto;
  padding: 15px 20px;
  border-radius: 15px 15px 3px 15px;
  background: var(--hover);
  max-width: 90%;
  white-space: pre-wrap;
}
.message.assistant {
  padding: 4px 2px;
  scroll-margin-top: 24px;
}
.message-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  font-weight: 750;
  color: var(--accent);
  margin-bottom: 10px;
}
.answer p:first-child {
  margin-top: 0;
}
.answer p:last-child {
  margin-bottom: 0;
}
.answer h1,
.answer h2,
.answer h3 {
  font-size: 19px;
  letter-spacing: -0.3px;
  line-height: 1.4;
  margin: 22px 0 10px;
}
.answer pre {
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: 10px;
}
.answer code {
  font-size: 13px;
}
.answer table {
  border-collapse: collapse;
  display: block;
  overflow: auto;
}
.answer td,
.answer th {
  border: 1px solid var(--border);
  padding: 8px 12px;
}
.answer blockquote {
  border-left: 3px solid var(--border);
  margin-left: 0;
  padding-left: 18px;
  color: var(--muted);
}
.pending {
  width: fit-content;
  max-width: 100%;
  color: transparent;
  background-color: var(--muted);
  background-image: linear-gradient(
    100deg,
    transparent,
    var(--text),
    transparent
  );
  background-repeat: no-repeat;
  background-size: 45% 100%;
  background-position: -100% center;
  background-clip: text;
  -webkit-background-clip: text;
  animation: activity-sweep 2s linear infinite;
}
/* Once a chat starts, the viewport belongs to three rows: header, messages, composer.
   Only messages overflow, so reading a long answer never moves the input or page chrome. */
body.chatting {
  height: 100dvh;
  overflow: hidden;
}
.chatting .topbar {
  height: 76px;
  flex: 0 0 76px;
}
.chatting main {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  justify-content: flex-start;
}
.chatting .conversation {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 24px max(20px, calc((100% - 1000px) / 2)) 8px;
  overflow-y: auto;
  /* Explicit answer positioning owns the scroll offset while streamed activity becomes a full answer. */
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.chatting .composer-area {
  flex: 0 0 auto;
  width: min(calc(100% - 40px), 1000px);
  margin: 0 auto;
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
  background: var(--bg);
}
.chatting footer {
  display: none;
}
.chatting .notice {
  flex: 0 0 auto;
  margin: 0 20px 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes activity-sweep {
  from {
    background-position: -100% center;
  }
  to {
    background-position: 200% center;
  }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .pending {
    animation: none;
    background: none;
    color: var(--muted);
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 80px;
    padding: 0 20px;
  }
  .brand {
    font-size: 18px;
  }
  .quiet {
    padding: 10px 7px;
    font-size: 12px;
  }
  .top-actions {
    gap: 0;
  }
  main {
    padding-top: 40px;
    width: calc(100% - 32px);
  }
  .subtitle {
    font-size: 14px;
  }
  .suggestions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .suggestions button {
    text-align: center;
    font-size: 12px;
  }
  footer {
    padding: 10px 20px 14px;
    font-size: 10px;
  }
  .composer {
    padding: 16px;
  }
  .company {
    font-size: 7px;
  }
  .message {
    font-size: 14px;
  }
}
