:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-raised: #ffffff;
  --sidebar: #f7f7f8;
  --sidebar-hover: rgba(0, 0, 0, 0.055);
  --sidebar-active: rgba(0, 0, 0, 0.08);
  --text: #2f2f2f;
  --text-soft: #676767;
  --text-faint: #8e8e8e;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.07), 0 2px 7px rgba(0, 0, 0, 0.04);
  --shadow-heavy: 0 24px 70px rgba(0, 0, 0, 0.15), 0 7px 22px rgba(0, 0, 0, 0.07);
  --accent: #10a37f;
  --accent-strong: #087f63;
  --accent-soft: rgba(16, 163, 127, 0.1);
  --accent-border: rgba(16, 163, 127, 0.26);
  --green: #10a37f;
  --green-soft: rgba(16, 163, 127, 0.11);
  --yellow: #10a37f;
  --orange: #087f63;
  --user-bubble: #f4f4f4;
  --code: #2f2f2f;
  --sidebar-width: 280px;
  --topbar-height: 64px;
  --content-width: 880px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #212121;
  --bg-soft: #2a2a2a;
  --panel: rgba(33, 33, 33, 0.9);
  --panel-solid: #2f2f2f;
  --panel-raised: #353535;
  --sidebar: #171717;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: rgba(255, 255, 255, 0.11);
  --text: #ececec;
  --text-soft: #b4b4b4;
  --text-faint: #8f8f8f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.28), 0 2px 10px rgba(0, 0, 0, 0.18);
  --shadow-heavy: 0 35px 90px rgba(0, 0, 0, 0.55), 0 8px 28px rgba(0, 0, 0, 0.3);
  --accent: #19c59b;
  --accent-strong: #5ee0bd;
  --accent-soft: rgba(25, 197, 155, 0.13);
  --accent-border: rgba(25, 197, 155, 0.3);
  --green: #19c59b;
  --green-soft: rgba(25, 197, 155, 0.12);
  --yellow: #19c59b;
  --orange: #5ee0bd;
  --user-bubble: #303030;
  --code: #ececec;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 12px;
}

.sidebar-top {
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 14px;
  padding: 8px;
}

.brand:hover {
  background: var(--sidebar-hover);
}

.brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 13px;
  object-fit: cover;
  object-position: 50% 28%;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 18, 0.08), 0 5px 14px rgba(16, 163, 127, 0.18);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 11px;
}

.brand strong,
.profile-row strong,
.popover-heading strong {
  display: block;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.25;
}

.brand small,
.profile-row small,
.popover-heading small {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.new-chat-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin: 13px 0 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(20, 20, 18, 0.04);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.new-chat-button svg {
  width: 17px;
  height: 17px;
}

.new-chat-button:hover {
  border-color: var(--border-strong);
  box-shadow: 0 5px 12px rgba(20, 20, 18, 0.07);
  transform: translateY(-1px);
}

.conversation-nav {
  overflow-y: auto;
  padding: 1px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.nav-label {
  margin: 12px 10px 7px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 24px;
}

.conversation-nav button,
.conversation-nav a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  padding: 9px 10px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 130ms ease, color 130ms ease;
}

.conversation-nav button:hover,
.conversation-nav a:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.tiny-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 9px;
  color: var(--text-soft);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.profile-row {
  display: grid;
  grid-template-columns: 40px 1fr 34px;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  padding: 7px;
}

.profile-row:hover {
  background: var(--sidebar-hover);
}

.profile-row img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 28%;
  background: var(--panel-solid);
}

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--text-soft);
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--sidebar-hover);
  color: var(--text);
}

.main-panel {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 45;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent), color-mix(in srgb, var(--bg) 82%, transparent));
  padding: 0 22px;
  backdrop-filter: blur(18px);
}

.model-picker {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 6px 9px;
  cursor: pointer;
  text-align: left;
}

.model-picker:hover {
  background: var(--sidebar-hover);
}

.model-picker > span {
  grid-column: 1;
  grid-row: 1;
  font-size: 14px;
  font-weight: 740;
  line-height: 1.2;
}

.model-picker > small {
  grid-column: 1;
  grid-row: 2;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.2;
}

.model-picker svg {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 16px;
  height: 16px;
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-button,
.primary-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.ghost-button {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
}

.primary-button {
  border: 1px solid color-mix(in srgb, var(--text) 78%, transparent);
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(20, 20, 18, 0.12);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.ghost-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-solid);
}

.primary-button:hover {
  box-shadow: 0 8px 20px rgba(20, 20, 18, 0.18);
}

.primary-button svg {
  width: 14px;
  height: 14px;
}

.mobile-menu-button {
  display: none;
}

.model-popover {
  position: fixed;
  z-index: 90;
  top: 58px;
  left: calc(var(--sidebar-width) + 22px);
  width: min(370px, calc(100vw - var(--sidebar-width) - 44px));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-solid);
  padding: 16px;
  box-shadow: var(--shadow-heavy);
}

.popover-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-popover > p {
  margin: 13px 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.popover-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 13px;
}

.popover-grid span {
  color: var(--text-faint);
}

.popover-grid strong {
  font-weight: 680;
}

.conversation {
  width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  padding: 40px 24px 210px;
  outline: none;
}

.hero {
  width: min(760px, 100%);
  margin: clamp(28px, 8vh, 86px) auto 0;
  text-align: center;
}

.hero-orb {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
  background: var(--panel-solid);
  box-shadow:
    0 18px 44px rgba(16, 163, 127, 0.2),
    inset 0 0 0 1px rgba(24, 24, 20, 0.08);
  transform: rotate(-3deg);
  animation: orb-float 5.5s ease-in-out infinite;
}

.hero-orb::before {
  position: absolute;
  inset: -10px;
  border: 1px solid var(--accent-border);
  border-radius: 31px;
  content: "";
  opacity: 0.52;
  transform: rotate(7deg);
}

.hero-orb img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: 50% 28%;
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 790;
  letter-spacing: -0.058em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 620px;
  margin: 20px auto 0;
  color: var(--text-soft);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 38px;
  text-align: left;
}

.starter-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  gap: 11px;
  align-items: start;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  padding: 16px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 2px rgba(20, 20, 18, 0.03);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.starter-card::after {
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.starter-card:hover {
  border-color: var(--accent-border);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.starter-card:hover::after {
  opacity: 1;
}

.starter-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-border);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 15px;
}

.starter-card strong {
  display: block;
  font-size: 15px;
  font-weight: 730;
  line-height: 1.35;
}

.starter-card small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.starter-arrow {
  color: var(--text-faint);
  font-size: 14px;
  transition: color 180ms ease, transform 180ms ease;
}

.starter-card:hover .starter-arrow {
  color: var(--accent-strong);
  transform: translate(2px, -2px);
}

.message-list {
  width: 100%;
}

.message {
  width: 100%;
}

.message-inner {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
}

.user-message {
  padding: 24px 0 14px;
}

.user-message .message-inner {
  display: flex;
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(78%, 680px);
  border: 1px solid var(--border);
  border-radius: 22px 22px 6px 22px;
  background: var(--user-bubble);
  padding: 12px 16px;
}

.message-bubble p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.assistant-message {
  padding: 14px 0 22px;
}

.assistant-message .message-inner {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
}

.assistant-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 11px;
  background: var(--panel-solid);
  object-fit: cover;
  object-position: 50% 28%;
  box-shadow: 0 5px 14px rgba(16, 163, 127, 0.16);
}

.assistant-content {
  min-width: 0;
}

.assistant-label {
  margin: 4px 0 12px;
  font-size: 14px;
  font-weight: 760;
}

.assistant-answer {
  color: var(--text);
}

.answer-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.answer-title {
  max-width: 760px;
  margin: 0 0 15px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.answer-paragraph {
  max-width: 790px;
  margin: 0 0 15px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.72;
}

.answer-paragraph:last-child {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 22px 0;
}

.stat-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel-solid);
  padding: 14px;
}

.stat-value {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 2.2vw, 23px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.45;
}

.answer-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.answer-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-solid);
  padding: 16px;
}

.answer-card-link {
  transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.answer-card-link:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.answer-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.answer-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 740;
  line-height: 1.35;
}

.answer-card-arrow {
  color: var(--text-faint);
  font-size: 13px;
}

.answer-card p {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.answer-card small {
  display: block;
  margin-top: 12px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
}

.answer-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.answer-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-solid);
  padding: 15px;
}

.answer-group h3 {
  margin: 0 0 11px;
  font-size: 15px;
  font-weight: 740;
}

.answer-callout {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  margin: 21px 0;
  border: 1px solid var(--accent-border);
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--panel-solid) 75%, transparent));
  padding: 15px;
}

.callout-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.answer-callout strong {
  display: block;
  margin: 1px 0 5px;
  font-size: 14px;
  font-weight: 760;
}

.answer-callout p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0;
}

.tag-list.compact {
  gap: 5px;
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-solid);
  padding: 5px 10px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.2;
}

.tag-list.compact .tag {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 12px;
}

.answer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.answer-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-solid);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.answer-link:hover {
  border-color: var(--border-strong);
  box-shadow: 0 5px 12px rgba(20, 20, 18, 0.07);
  transform: translateY(-1px);
}

.answer-link.primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.follow-up-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.follow-up-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.25;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.follow-up-chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.message-actions {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.assistant-message:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
}

.message-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 5px 7px;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 12px;
}

.message-actions button:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.message-actions svg {
  width: 13px;
  height: 13px;
}

.typing-dots {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing-bounce 1.15s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.42; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.message-enter {
  opacity: 0;
  transform: translateY(8px);
}

.message-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
}

.composer-wrap {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width);
  padding: 34px 20px 14px;
  background: linear-gradient(to bottom, transparent, var(--bg) 28%, var(--bg) 100%);
  pointer-events: none;
}

.composer-shell {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 23px;
  background: var(--panel);
  padding: 10px 10px 8px 14px;
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(22px);
  pointer-events: auto;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer-shell:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 28px 70px rgba(24, 24, 20, 0.16), 0 0 0 3px var(--accent-soft);
}

.composer-shell textarea {
  display: block;
  width: 100%;
  min-height: 31px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 3px 5px 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.composer-shell textarea::placeholder {
  color: var(--text-faint);
}

.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tool-chip {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  padding: 4px 9px;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 650;
}

.tool-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.send-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: var(--text);
  cursor: pointer;
  color: var(--bg);
  transition: transform 140ms ease, opacity 140ms ease;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.send-button:disabled {
  cursor: default;
  opacity: 0.22;
}

.send-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.composer-note {
  width: min(var(--content-width), 100%);
  margin: 7px auto 0;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
  pointer-events: auto;
}

.mobile-scrim {
  display: none;
}

.noscript-message {
  position: fixed;
  z-index: 300;
  inset: auto 20px 20px calc(var(--sidebar-width) + 20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
  padding: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.noscript-message a {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* CV page */

body.cv-page {
  background: var(--bg);
}

.cv-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  padding: 10px 24px;
  backdrop-filter: blur(18px);
}

.cv-topbar-left,
.cv-topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
}

.back-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.back-link svg {
  width: 15px;
  height: 15px;
}

.cv-document {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: min(1120px, calc(100% - 40px));
  margin: 34px auto 80px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.cv-aside {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 32px 26px;
}

.cv-avatar {
  width: 84px;
  height: 84px;
  border: 2px solid var(--panel-solid);
  border-radius: 26px;
  object-fit: cover;
  object-position: 50% 28%;
  box-shadow: 0 8px 22px rgba(20, 20, 18, 0.14);
}

.cv-aside h1 {
  margin: 20px 0 4px;
  font-size: 27px;
  font-weight: 790;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.cv-aside .cv-role {
  margin: 0;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
}

.cv-contact-list,
.cv-link-list {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
}

.cv-contact-list a,
.cv-contact-list span,
.cv-link-list a {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cv-contact-list a:hover,
.cv-link-list a:hover {
  color: var(--accent-strong);
}

.cv-aside-section {
  margin-top: 31px;
}

.cv-aside-section h2,
.cv-main-section > h2 {
  margin: 0 0 13px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv-skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-skill-cloud span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-solid);
  padding: 5px 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.cv-main {
  padding: 38px 42px 48px;
}

.cv-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.cv-main-section {
  margin-top: 34px;
}

.cv-entry {
  position: relative;
  padding-left: 20px;
}

.cv-entry + .cv-entry {
  margin-top: 29px;
}

.cv-entry::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
  content: "";
}

.cv-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.cv-entry h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cv-entry-company {
  margin: 3px 0 0;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 690;
}

.cv-entry-date {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.cv-entry-subtitle {
  margin: 16px 0 7px;
  font-size: 14px;
  font-weight: 730;
}

.cv-entry ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.cv-entry li {
  margin: 7px 0;
  padding-left: 2px;
  font-size: 14px;
  line-height: 1.65;
}

.cv-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cv-project {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 14px;
}

.cv-project h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 740;
}

.cv-project p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.cv-project small {
  display: block;
  margin-top: 10px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
}

.cv-education-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding: 13px 0;
}

.cv-education-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cv-education-row strong {
  display: block;
  font-size: 14px;
}

.cv-education-row span {
  color: var(--text-soft);
  font-size: 13px;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 260px;
  }

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

  .cv-document {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .cv-aside {
    padding: 28px 21px;
  }

  .cv-main {
    padding: 34px 30px 44px;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: 284px;
  }

  .sidebar {
    transform: translateX(-104%);
    box-shadow: var(--shadow-heavy);
    transition: transform 220ms cubic-bezier(.22, .8, .2, 1);
  }

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

  .mobile-scrim {
    position: fixed;
    z-index: 55;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  .sidebar-open .mobile-scrim {
    visibility: visible;
    opacity: 1;
  }

  .main-panel {
    margin-left: 0;
  }

  .topbar {
    height: 58px;
    padding: 0 12px;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .topbar > .mobile-menu-button {
    margin-right: 4px;
  }

  .model-picker {
    margin-right: auto;
  }

  .model-picker > small {
    display: none;
  }

  .model-picker > span {
    grid-row: 1 / 3;
  }

  .ghost-button {
    display: none;
  }

  .primary-button {
    min-height: 34px;
    padding: 6px 10px;
  }

  .model-popover {
    top: 54px;
    left: 12px;
    width: min(370px, calc(100vw - 24px));
  }

  .conversation {
    min-height: calc(100vh - 58px);
    padding: 28px 14px 190px;
  }

  .hero {
    margin-top: 34px;
  }

  .hero-orb {
    width: 66px;
    height: 66px;
    margin-bottom: 21px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .hero-copy {
    font-size: 17px;
  }

  .starter-grid {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .starter-card {
    min-height: 90px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .assistant-message .message-inner {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 11px;
  }

  .assistant-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .answer-title {
    font-size: 24px;
  }

  .stat-grid,
  .answer-card-grid,
  .answer-groups {
    grid-template-columns: 1fr;
  }

  .composer-wrap {
    left: 0;
    padding: 30px 10px 9px;
  }

  .composer-shell {
    border-radius: 20px;
  }

  .tool-chip:nth-child(3) {
    display: none;
  }

  .composer-note {
    display: none;
  }

  .noscript-message {
    left: 20px;
  }

  .cv-topbar {
    padding: 9px 12px;
  }

  .cv-topbar-actions .ghost-button {
    display: none;
  }

  .cv-document {
    display: block;
    width: min(100% - 20px, 700px);
    margin: 14px auto 50px;
    border-radius: 18px;
  }

  .cv-aside {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .cv-main {
    padding: 30px 22px 40px;
  }

  .cv-project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .topbar-actions .primary-button {
    gap: 6px;
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar-actions .primary-button svg {
    width: 14px;
    height: 14px;
  }

  .answer-links {
    align-items: stretch;
    flex-direction: column;
  }

  .answer-link {
    width: 100%;
  }

  .stat-card {
    padding: 12px;
  }

  .follow-up-row {
    align-items: stretch;
    flex-direction: column;
  }

  .follow-up-chip {
    width: 100%;
    text-align: left;
  }

  .cv-entry-header,
  .cv-education-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

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

@media print {
  :root,
  html[data-theme="dark"] {
    --bg: #ffffff;
    --bg-soft: #f4f4f1;
    --panel-solid: #ffffff;
    --text: #181816;
    --text-soft: #4f4f4b;
    --text-faint: #777772;
    --border: rgba(0, 0, 0, 0.14);
    --accent: #10a37f;
    --accent-strong: #087f63;
    --accent-soft: rgba(16, 163, 127, 0.08);
  }

  body.cv-page {
    background: #fff;
    font-size: 10pt;
  }

  .cv-topbar {
    display: none;
  }

  .cv-document {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-aside {
    padding: 20px;
  }

  .cv-main {
    padding: 22px 26px;
  }

  .cv-entry,
  .cv-project,
  .cv-main-section {
    break-inside: avoid;
  }

  .cv-project-grid {
    gap: 8px;
  }
}
