:root {
  color-scheme: dark;
  --bg: #000;
  --surface: rgba(18, 19, 23, 0.86);
  --surface-strong: rgba(12, 13, 16, 0.96);
  --text: #f7f7f8;
  --muted: #9b9da5;
  --soft: #c9cad0;
  --border: rgba(255, 255, 255, 0.1);
  --max: 920px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--bg);
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }
body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::before {
  content: '';
  position: fixed;
  z-index: 0;
  left: -18vw;
  right: -18vw;
  bottom: -18vh;
  height: min(72vh, 760px);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 72%, rgba(55, 210, 197, .13), transparent 39%),
    radial-gradient(ellipse at 47% 86%, rgba(82, 123, 255, .12), transparent 42%),
    radial-gradient(ellipse at 77% 70%, rgba(183, 88, 244, .13), transparent 39%),
    radial-gradient(ellipse at 60% 100%, rgba(255, 185, 82, .07), transparent 35%);
  opacity: 0;
  transform: translate3d(0, 8%, 0) scale(.98);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
body:has(.send-button:disabled)::before {
  opacity: .9;
  transform: translate3d(0, 0, 0) scale(1);
  animation: responseAmbient 5.6s ease-in-out infinite alternate;
}
body::-webkit-scrollbar { display: none; }
button, textarea, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: white;
  color: black;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ask-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100% - 32px, var(--max));
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}
.ask-intro {
  flex: 0 0 auto;
  padding: 0 20px 30px;
  text-align: center;
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
}
.ask-intro h1 {
  margin: 0;
  color: #f5f5f7;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 520;
}

.conversation {
  display: none;
  width: 100%;
}
body.has-conversation .ask-shell {
  justify-content: flex-start;
  padding-top: max(26px, env(safe-area-inset-top));
  padding-bottom: 0;
}
body.has-conversation .ask-intro { display: none; }
body.has-conversation .conversation {
  display: block;
  flex: 1 0 auto;
  min-height: 0;
}
.messages { display: grid; gap: 28px; padding: 0 0 24px; }
.message {
  display: grid;
  gap: 9px;
  opacity: 0;
  transform: translateY(10px);
  animation: messageIn 420ms cubic-bezier(.2,.8,.2,1) forwards;
}
.message-user { justify-items: end; }
.message-label { color: #777a84; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.message-user .message-body {
  max-width: min(78%, 660px);
  padding: 13px 17px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px 20px 6px 20px;
  background: rgba(255,255,255,.075);
  color: #f4f4f6;
  line-height: 1.55;
  white-space: pre-wrap;
}
.message-assistant {
  position: relative;
  padding: 1px 0 3px 52px;
}
.message-assistant::before {
  content: 'JD';
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  color: #d8dae0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
}
.message-assistant .message-body {
  max-width: 790px;
  color: #dedfe4;
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: 1.72;
  letter-spacing: -0.008em;
  overflow-wrap: anywhere;
}
.message-body > *:first-child { margin-top: 0 !important; }
.message-body > *:last-child { margin-bottom: 0 !important; }
.message-body p { margin: 0 0 14px; }
.message-body h2,
.message-body h3,
.message-body h4 {
  margin: 26px 0 10px;
  color: #f6f6f8;
  line-height: 1.28;
  letter-spacing: -0.025em;
  font-weight: 650;
}
.message-body h2 { font-size: 1.22em; }
.message-body h3 { font-size: 1.1em; }
.message-body h4 { font-size: 1em; }
.message-body strong { color: #f7f7f9; font-weight: 680; }
.message-body em { color: #e8e8ec; }
.message-body ul,
.message-body ol {
  margin: 10px 0 16px;
  padding-left: 1.45em;
}
.message-body li { margin: 6px 0; padding-left: .15em; }
.message-body li::marker { color: #9ea2ad; }
.message-body blockquote {
  margin: 16px 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid rgba(255,255,255,.22);
  color: #bfc1c8;
}
.message-body hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: rgba(255,255,255,.1);
}
.message-body a {
  color: #bcd3ff;
  text-decoration: underline;
  text-decoration-color: rgba(188,211,255,.38);
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.message-body a:hover { color: #e2ebff; text-decoration-color: currentColor; }
.message-body :not(pre) > code {
  padding: .14em .38em;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(255,255,255,.065);
  color: #f0f1f4;
  font: .88em/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.message-body pre {
  margin: 16px 0;
  padding: 15px 17px;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 13px;
  background: #101116;
  color: #eceef2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.message-body pre code {
  display: block;
  min-width: max-content;
  white-space: pre;
  font: 12.5px/1.62 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.message-table-wrap {
  width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
}
.message-body table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: .9em;
  line-height: 1.5;
}
.message-body th,
.message-body td {
  padding: 10px 12px;
  border-right: 1px solid rgba(255,255,255,.07);
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-align: left;
  vertical-align: top;
}
.message-body th:last-child,
.message-body td:last-child { border-right: 0; }
.message-body tbody tr:last-child td { border-bottom: 0; }
.message-body th { background: rgba(255,255,255,.045); color: #f4f4f6; font-weight: 650; }
.message-meta { color: #6f727b; font-size: 11px; }
.message-error .message-body { color: #ffb4ae; }

.thinking-dots { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; }
.thinking-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9fa2ac; animation: dotPulse 1.15s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .14s; }
.thinking-dots i:nth-child(3) { animation-delay: .28s; }

.composer-region {
  position: relative;
  z-index: 10;
  width: 100%;
  flex: 0 0 auto;
  padding: 0;
}
body.has-conversation .composer-region {
  position: sticky;
  bottom: 0;
  padding: 18px 0 max(18px, env(safe-area-inset-bottom));
  background: transparent;
}
body.has-conversation .composer-region::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -74px -18vw -24px;
  pointer-events: none;
  background: radial-gradient(ellipse 76% 74% at 50% 100%, rgba(0,0,0,.99) 0 43%, rgba(0,0,0,.84) 57%, rgba(0,0,0,.46) 69%, rgba(0,0,0,0) 84%);
}
.suggestions { display: none; }

.composer-glow {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 1px;
  border-radius: 27px;
  background: conic-gradient(from var(--glow-angle, 0deg), rgba(58,216,201,.94), rgba(87,132,255,.95), rgba(184,91,244,.92), rgba(255,187,87,.78), rgba(70,214,196,.9), rgba(92,122,255,.86), rgba(58,216,201,.94));
  box-shadow: 0 16px 44px rgba(0,0,0,.52), 0 0 0 1px rgba(255,255,255,.018);
  animation: glowOrbit 6.8s linear infinite;
  transition: box-shadow 600ms ease;
}
.composer-glow::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -15px;
  border-radius: 40px;
  pointer-events: none;
  background:
    radial-gradient(80% 105% at 12% 54%, rgba(51,216,199,.16), transparent 50%),
    radial-gradient(76% 105% at 48% 20%, rgba(91,131,255,.13), transparent 52%),
    radial-gradient(82% 110% at 88% 52%, rgba(188,89,244,.16), transparent 50%),
    radial-gradient(70% 90% at 62% 100%, rgba(255,186,85,.09), transparent 52%);
  opacity: .54;
  transform: scale(.985);
  transition: opacity 650ms ease, transform 750ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
body:has(.send-button:disabled) .composer-glow {
  box-shadow: 0 18px 52px rgba(0,0,0,.56), 0 0 44px rgba(108,124,255,.10);
}
body:has(.send-button:disabled) .composer-glow::before {
  opacity: 1;
  transform: scale(1.018);
  animation: composerBreath 2.8s ease-in-out infinite alternate;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 66px;
  padding: 9px 9px 9px 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18,19,23,.985), rgba(9,10,13,.99));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), inset 0 -1px 0 rgba(0,0,0,.4);
}
.composer textarea {
  width: 100%;
  max-height: 170px;
  min-height: 46px;
  padding: 12px 0 9px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f2f2f4;
  caret-color: #8fdcd6;
  font-size: 17px;
  line-height: 1.4;
}
.composer textarea::placeholder { color: #747780; }
.send-button {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  border: 0;
  border-radius: 17px;
  background: #f2f3f5;
  color: #111318;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(0,0,0,.28);
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}
.send-button:hover:not(:disabled) { transform: translateY(-1px) scale(1.02); background: white; }
.send-button:active:not(:disabled) { transform: scale(.97); }
.send-button:disabled { opacity: .38; cursor: not-allowed; }
.send-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.noscript { max-width: 600px; margin: 100px auto; padding: 20px; color: white; text-align: center; }

@property --glow-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes glowOrbit { to { --glow-angle: 360deg; } }
@keyframes responseAmbient {
  from { transform: translate3d(-1.2%, 1%, 0) scale(.995); opacity: .74; }
  to { transform: translate3d(1.2%, -1.4%, 0) scale(1.025); opacity: 1; }
}
@keyframes composerBreath {
  from { transform: scale(.992); opacity: .68; }
  to { transform: scale(1.022); opacity: 1; }
}
@keyframes messageIn { to { opacity: 1; transform: translateY(0); } }
@keyframes dotPulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 680px) {
  .ask-shell {
    width: min(100% - 24px, var(--max));
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .ask-intro { padding: 0 8px 24px; }
  .ask-intro h1 { font-size: 22px; }
  body.has-conversation .ask-shell { padding-top: max(18px, env(safe-area-inset-top)); }
  body.has-conversation .composer-region {
    padding-top: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  body.has-conversation .composer-region::before { inset: -64px -28vw -22px; }
  .composer { min-height: 61px; padding-left: 16px; border-radius: 23px; }
  .composer-glow { border-radius: 24px; }
  .composer-glow::before { inset: -13px; border-radius: 36px; }
  .composer textarea { min-height: 42px; font-size: 16px; }
  .send-button { width: 43px; height: 43px; flex-basis: 43px; border-radius: 15px; }
  .message-user .message-body { max-width: 88%; }
  .message-assistant { padding-left: 44px; }
  .message-assistant::before { width: 31px; height: 31px; }
  .message-body pre { padding: 13px 14px; border-radius: 11px; }
  .message-body pre code { font-size: 11.5px; }
  .message-table-wrap { margin-right: -4px; }
  .messages { gap: 24px; }
}

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