:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: #fff; color: #202124; }
body.source-modal-open, body.contact-modal-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #697c9e; outline-offset: 3px; }
main { width: min(calc(100% - 32px), 820px); height: 100dvh; min-height: 380px; margin: auto; display: flex; flex-direction: column; }
.conversation { display: none; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #cbd1da transparent; }
main.started .conversation { display: block; }
.helix-track { position: relative; padding: 50px 8px 26px; min-height: 100%; isolation: isolate; }
.helix-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: -1; }
main.started .helix-ink { transform-origin: center; animation: helix-gentle-wave 20s ease-in-out infinite; }
@keyframes helix-gentle-wave {
  0%, 100% { transform: translate3d(-1.5px, 0, 0) skewX(-.15deg); }
  50% { transform: translate3d(1.5px, 0, 0) skewX(.15deg); }
}
.helix-pair { position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 180px; padding: 12px 0 48px; opacity: var(--depth-opacity, 1); transform: scale(var(--depth-scale, 1)); transform-origin: center; transition: opacity .24s ease, transform .32s ease; }
.helix-pair:nth-of-type(odd) .turn.user { align-self: flex-end; }
.helix-pair:nth-of-type(odd) .turn.assistant { align-self: flex-start; }
.helix-pair:nth-of-type(even) .turn.user { align-self: flex-start; }
.helix-pair:nth-of-type(even) .turn.assistant { align-self: flex-end; }
.turn { width: fit-content; max-width: min(74%, 560px); padding: 12px 18px; border: 1px solid #e4e7eb; border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 8px 26px rgba(31,43,63,.045); font-size: 1.01rem; line-height: 1.56; overflow-wrap: anywhere; white-space: pre-wrap; }
.turn.user { color: #273448; background: #f1f4f8; border-color: #e9edf3; }
.turn.assistant { color: #202124; }
.turn.pending { color: #6e7888; }
.turn.assistant.typing .turn-text::after { content: '▍'; display: inline-block; margin-left: 2px; color: #7288a7; animation: typing-caret .8s steps(1, end) infinite; }
.turn.assistant.has-source { max-width: min(88%, 680px); }
.turn-sources { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #e3e8ef; }
.turn-source-card { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 6px 9px; border: 1px solid #d7e0ea; border-radius: 11px; background: #f7f9fc; color: #334b69; cursor: pointer; text-align: left; font-size: .77rem; line-height: 1.25; }
.turn-source-card:hover { background: #eaf1f9; border-color: #b8c9de; }
.turn-source-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #e7edf5; color: #38577a; font-size: .66rem; font-weight: 750; }
.turn-source-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-source-cue { flex: none; color: #61758f; font-size: .7rem; }
.context-panel { display: none; }
.context-panel-head, .source-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 47px; padding: 8px 12px; border-bottom: 1px solid #e3e8ef; color: #344154; font-size: .84rem; font-weight: 700; }
.context-panel-head button, .source-modal-head button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #52637a; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.context-panel-head button:hover, .source-modal-head button:hover { background: #edf1f6; }
.context-tabs { display: flex; gap: 5px; padding: 8px; border-bottom: 1px solid #e3e8ef; overflow-x: auto; }
.context-tab { flex: none; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #dbe2ec; border-radius: 8px; padding: 6px 9px; background: #fff; color: #52637a; cursor: pointer; font-size: .74rem; }
.context-tab[aria-pressed="true"] { background: #eaf1f9; border-color: #a9bfd9; color: #284e78; }
.context-viewer, .source-modal-viewer { flex: 1; min-height: 0; overflow: auto; }
.source-viewer-content { display: flex; flex-direction: column; gap: 9px; min-height: 100%; padding: 10px; }
.source-viewer-content iframe, .source-viewer-content img, .source-viewer-content video { width: 100%; min-height: 0; flex: 1; border: 0; border-radius: 8px; background: #f4f6f9; object-fit: contain; }
.source-viewer-content .source-pdf-page { object-position: center top; }
.source-viewer-content .source-pdf-page.zoomed { flex: none; width: 225%; height: auto; max-height: none; object-fit: unset; }
.source-pdf-controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex: none; color: #52637a; font-size: .78rem; }
.source-pdf-controls button { border: 1px solid #d8e1ec; border-radius: 8px; padding: 5px 9px; background: #fff; color: #365676; cursor: pointer; font-size: .74rem; }
.source-pdf-controls button:disabled { opacity: .45; cursor: default; }
.source-viewer-content audio { width: 100%; }
.source-viewer-content a { align-self: flex-start; color: #315a85; font-size: .78rem; font-weight: 650; text-decoration: none; }
.source-viewer-content a:hover { text-decoration: underline; }
.source-viewer-content p { margin: 6px 0; color: #647084; font-size: .87rem; }
.source-modal { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(17, 25, 38, .68); }
.source-modal[hidden] { display: none; }
.source-modal-box { display: flex; flex-direction: column; width: min(100%, 1120px); height: min(90dvh, 920px); min-height: 280px; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 24px 90px rgba(8, 18, 35, .25); }
.source-modal-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-open { display: block; margin-top: 12px; padding: 9px 13px; border: 1px solid #c8d4e2; border-radius: 12px; background: #f5f8fc; color: #2a4c73; cursor: pointer; font-size: .86rem; font-weight: 650; }
.agent-open:hover { background: #eaf1f9; }
.agent-showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; white-space: normal; }
.agent-showcase-card { min-width: 0; padding: 10px 11px; border: 1px solid #c8d4e2; border-radius: 12px; background: #f7f9fc; color: #2a405d; text-align: left; cursor: pointer; }
.agent-showcase-card:hover { background: #eaf1f9; border-color: #a8bad0; }
.agent-showcase-card strong, .agent-showcase-card span { display: block; overflow-wrap: anywhere; }
.agent-showcase-card strong { margin-bottom: 3px; font-size: .82rem; }
.agent-showcase-card span { color: #53657c; font-size: .73rem; line-height: 1.3; }
.contact-action { display: block; margin-top: 12px; padding: 9px 13px; border: 1px solid #c8d4e2; border-radius: 12px; background: #f5f8fc; color: #2a4c73; cursor: pointer; font-size: .86rem; font-weight: 650; }
.contact-action:hover { background: #eaf1f9; }
.contact-modal { position: fixed; z-index: 140; inset: 0; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(17,25,38,.6); }
.contact-modal[hidden] { display: none; }
.contact-modal-box { width: min(100%, 560px); max-height: min(92dvh, 800px); overflow: auto; border: 1px solid #e1e6ed; border-radius: 20px; background: #fff; box-shadow: 0 24px 90px rgba(8,18,35,.25); }
.contact-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 10px; }
.contact-modal-head h2 { margin: 0; color: #303c4d; font-size: 1.35rem; font-weight: 650; letter-spacing: -.025em; }
.contact-modal-head button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f1f4f8; color: #4f5c6e; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.contact-modal-body { padding: 0 22px 20px; }
.contact-modal-body > p:first-child { margin: 0 0 18px; color: #5c6777; line-height: 1.45; font-size: .93rem; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 14px; width: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.contact-form[hidden] { display: none; }
.contact-form:focus-within { border: 0; box-shadow: none; }
.contact-form label { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: #344154; font-size: .83rem; font-weight: 650; }
.contact-form label span { color: #7a8492; font-weight: 400; }
.contact-form input, .contact-form input[type="text"], .contact-form textarea { display: block; flex: none; width: 100%; min-width: 0; height: auto; min-height: 40px; padding: 9px 11px; border: 1px solid #d7dee8; border-radius: 10px; outline: 0; background: #fff; color: #202124; font-size: .92rem; line-height: 1.35; white-space: normal; }
.contact-form textarea { min-height: 108px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: #697c9e; box-shadow: 0 0 0 3px rgba(105,124,158,.14); }
.contact-form-wide { grid-column: 1 / -1; }
.contact-submit { grid-column: 1 / -1; width: 100%; min-height: 43px; border: 0; border-radius: 11px; background: #273448; color: #fff; cursor: pointer; font-weight: 650; }
.contact-submit:hover:not(:disabled) { background: #3f526e; }
.contact-submit:disabled { opacity: .55; cursor: default; }
.contact-status { min-height: 20px; margin: 12px 0 0; color: #314c71; font-size: .86rem; }
.contact-status.error { color: #a2262b; }
.contact-email { margin: 12px 0 0; color: #667182; font-size: .84rem; }
.contact-email a { color: #315a85; }
.portal-transition { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: var(--portal-color, #273448); color: #fff; opacity: 0; visibility: hidden; transform: scale(.94); transition: opacity .42s ease, transform .42s ease, visibility .42s; pointer-events: none; }
.portal-transition.visible { opacity: 1; visibility: visible; transform: scale(1); pointer-events: auto; }
.portal-transition span { max-width: min(90vw, 760px); text-align: center; font-size: clamp(2rem, 7vw, 4.8rem); font-weight: 600; letter-spacing: -.045em; }
@keyframes typing-caret { 50% { opacity: 0; } }
.turn-label { display: block; margin-bottom: 4px; color: #798596; font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.turn.user .turn-label { color: #5d6b7e; }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0 76px; transition: padding .35s ease, flex .35s ease; }
h1 {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 34px;
  text-align: center;
  font-size: clamp(2.7rem, 6vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -.06em;
  line-height: 1.25;
  padding: .18em .2em;
  filter: drop-shadow(0 7px 10px rgba(36, 45, 57, .16));
}
h1 .brand-lystro { color: #303945; font-weight: 700; }
h1 .brand-labs { color: #69727e; font-weight: 600; }
.brand-orbit { position: relative; display: inline-block; width: .68em; height: .72em; margin-inline: .075em .045em; vertical-align: -.055em; }
.brand-orbit-letter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brand-orbit-ring { position: absolute; inset: 0; animation: brand-orbit-spin 24s linear infinite; }
.brand-orbit-dot { position: absolute; top: 50%; left: 50%; width: .092em; height: .092em; margin: -.046em 0 0 -.046em; border-radius: 50%; background: currentColor; transform: rotate(calc(var(--i) * 36deg)) translateY(-.285em); }
.brand-orbit-dot:nth-child(2n) { opacity: .58; }
.brand-orbit-dot:nth-child(3n) { width: .075em; height: .075em; margin: -.0375em 0 0 -.0375em; }
@keyframes brand-orbit-spin { to { transform: rotate(1turn); } }
form { display: flex; align-items: flex-end; gap: 12px; width: 100%; border: 1px solid #dedfe2; border-radius: 24px; padding: 9px 10px 9px 21px; background: #fff; box-shadow: 0 8px 32px rgba(25,28,35,.045); transition: border-color .18s, box-shadow .18s; }
form:focus-within { border-color: #b7b9c0; box-shadow: 0 10px 34px rgba(25,28,35,.075); }
input[type="text"] { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; border-radius: 0; outline: 0; font-size: 1.04rem; line-height: 40px; color: #202124; background: transparent; white-space: nowrap; appearance: none; }
input[type="text"]::placeholder { color: #777b83; opacity: 1; }
.send-button { width: 40px; height: 40px; border: 0; border-radius: 14px; background: #23252a; color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; transition: background .18s, transform .18s; }
.send-button:hover:not(:disabled) { background: #404248; transform: translateY(-1px); }
.send-button:disabled { opacity: .38; cursor: default; }
.send-button svg { width: 19px; height: 19px; }
.chat-disclaimer { display: none; margin: 8px 4px 0; color: #737982; font-size: .75rem; line-height: 1.35; text-align: center; }
.status { min-height: 24px; margin: 11px 4px 0; font-size: .82rem; color: #777b83; text-align: center; }
.status:empty { visibility: hidden; }
main.started .stage { flex: none; padding: 10px 0 max(20px, env(safe-area-inset-bottom)); }
main.started .chat-disclaimer { display: block; }
main.started h1 { display: none; }
@media (min-width: 960px) and (min-aspect-ratio: 6/5) {
  body.has-context { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 38vw); gap: 16px; padding: 0 18px; }
  body.has-context main { width: min(100%, 820px); }
  body.has-context .context-panel.has-content { display: flex; flex-direction: column; min-width: 0; height: calc(100dvh - 32px); margin: 16px 0; overflow: hidden; border: 1px solid #e2e7ee; border-radius: 16px; background: #fff; box-shadow: 0 9px 34px rgba(29, 40, 55, .06); }
}
@media (max-width: 620px) {
  main { width: min(calc(100% - 24px), 820px); }
  h1 { font-size: clamp(2rem, 9vw, 2.7rem); }
  form { border-radius: 21px; padding-left: 15px; }
  input[type="text"] { font-size: 1rem; }
  .helix-track { padding: 28px 3px 12px; }
  .helix-pair { min-height: 150px; gap: 9px; padding-bottom: 34px; }
  .turn { max-width: 86%; padding: 10px 13px; font-size: .96rem; }
  .turn.assistant:has(.agent-showcase) { max-width: 95%; }
  .agent-showcase { grid-template-columns: 1fr; }
  .contact-modal-head { padding: 16px 16px 9px; }
  .contact-modal-body { padding: 0 16px 18px; }
  .contact-form { grid-template-columns: 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .helix-pair { transform: none !important; opacity: 1 !important; }
  .turn.assistant.typing .turn-text::after { animation: none !important; }
  .brand-orbit-ring { animation: none !important; }
  .helix-ink { animation: none !important; transform: none !important; }
}

.chat-theme-action { display: block; margin-top: 12px; padding: 9px 13px; border: 1px solid #c8d4e2; border-radius: 12px; background: #f5f8fc; color: #2a4c73; cursor: pointer; font-size: .86rem; font-weight: 650; }
.chat-theme-action:hover { background: #eaf1f9; }
html[data-theme="dark"] { color-scheme: dark; --card: #222c39; --text: #e7ebf1; --muted: #a9b5c5; --border: #465365; --accent-soft: #354358; --primary: #a8c4eb; }
html[data-theme="dark"] body { background: #151b24; color: #e7ebf1; }
html[data-theme="dark"] h1 .brand-lystro { color: #f2f5f9; }
html[data-theme="dark"] h1 .brand-labs { color: #aab5c2; }
html[data-theme="dark"] .conversation { scrollbar-color: #536174 transparent; }
html[data-theme="dark"] .turn { background: #222c39; border-color: #3a4859; color: #e7ebf1; box-shadow: 0 8px 26px rgba(0,0,0,.16); }
html[data-theme="dark"] .turn.user { background: #303c4b; border-color: #445366; color: #f3f6fa; }
html[data-theme="dark"] .turn.pending, html[data-theme="dark"] .turn-label, html[data-theme="dark"] .turn.user .turn-label { color: #aebacc; }
html[data-theme="dark"] form:not(.contact-form) { background: #222c39; border-color: #49586a; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
html[data-theme="dark"] form:not(.contact-form):focus-within { border-color: #91a8c6; }
html[data-theme="dark"] input[type="text"] { color: #f1f4f8; }
html[data-theme="dark"] input[type="text"]::placeholder { color: #aab5c2; }
html[data-theme="dark"] .send-button { background: #a8c4eb; color: #172231; }
html[data-theme="dark"] .send-button:hover:not(:disabled) { background: #c2d8f5; }
html[data-theme="dark"] .chat-disclaimer, html[data-theme="dark"] .status { color: #aab5c2; }
html[data-theme="dark"] .chat-theme-action, html[data-theme="dark"] .agent-open, html[data-theme="dark"] .contact-action,
html[data-theme="dark"] .turn-source-card, html[data-theme="dark"] .context-tab, html[data-theme="dark"] .source-pdf-controls button {
  background: #2e3b4c; color: #dceaff; border-color: #52647a;
}
html[data-theme="dark"] .chat-theme-action:hover, html[data-theme="dark"] .agent-open:hover, html[data-theme="dark"] .contact-action:hover,
html[data-theme="dark"] .turn-source-card:hover, html[data-theme="dark"] .context-tab[aria-pressed="true"] { background: #3c5068; }
html[data-theme="dark"] .agent-showcase-card { background: #2e3b4c; color: #e7f0ff; border-color: #52647a; }
html[data-theme="dark"] .agent-showcase-card:hover { background: #3c5068; }
html[data-theme="dark"] .agent-showcase-card span { color: #b8c6d7; }
html[data-theme="dark"] .turn-sources, html[data-theme="dark"] .context-panel-head, html[data-theme="dark"] .source-modal-head,
html[data-theme="dark"] .context-tabs { border-color: #465365; }
html[data-theme="dark"] .turn-source-icon { background: #42546b; color: #e7f0ff; }
html[data-theme="dark"] .turn-source-cue, html[data-theme="dark"] .source-pdf-controls { color: #b8c6d7; }
html[data-theme="dark"] .context-panel.has-content, html[data-theme="dark"] .source-modal-box, html[data-theme="dark"] .contact-modal-box { background: #222c39; border-color: #465365; color: #e7ebf1; }
html[data-theme="dark"] .context-panel-head, html[data-theme="dark"] .source-modal-head, html[data-theme="dark"] .contact-modal-head h2,
html[data-theme="dark"] .contact-form label { color: #e7ebf1; }
html[data-theme="dark"] .context-panel-head button, html[data-theme="dark"] .source-modal-head button, html[data-theme="dark"] .contact-modal-head button { color: #dceaff; background: #334256; }
html[data-theme="dark"] .source-viewer-content iframe, html[data-theme="dark"] .source-viewer-content img,
html[data-theme="dark"] .source-viewer-content video { background: #151b24; }
html[data-theme="dark"] .source-viewer-content p, html[data-theme="dark"] .contact-modal-body > p:first-child,
html[data-theme="dark"] .contact-email, html[data-theme="dark"] .contact-form label span { color: #afbdcf; }
html[data-theme="dark"] .source-viewer-content a, html[data-theme="dark"] .contact-email a { color: #a8cfff; }
html[data-theme="dark"] .contact-form input, html[data-theme="dark"] .contact-form input[type="text"], html[data-theme="dark"] .contact-form textarea { background: #17212e; color: #f1f4f8; border-color: #52647a; }
html[data-theme="dark"] .contact-submit { background: #a8c4eb; color: #172231; }
html[data-theme="dark"] .contact-status { color: #b8d1f4; }
html[data-theme="dark"] .contact-status.error { color: #ff9c9c; }
