:root {
  color-scheme: dark;
  --midnight: #0a1931;
  --bg: #0a1931;
  --white: #fff;
  --cyan: #00f6ff;
  --cyan-dim: rgba(0, 246, 255, 0.08);
  --grey-200: #dce5ef;
  --grey-300: #a0aec0;
  --grey-500: #8897ac;
  --font-head: "Inter", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--white);
  font-family: var(--font-body);
  background: radial-gradient(ellipse at 25% 60%, #102b42 0%, var(--midnight) 60%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
button:disabled { cursor: wait; opacity: 0.6; }
.lab-header {
  min-height: 96px;
  padding: 26px 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lab-brand {
  color: var(--white);
  text-decoration: none;
  font: 800 22px/1 var(--font-head);
  letter-spacing: 0.08em;
}
.lab-brand span { display: block; margin-top: 7px; font-size: 10px; letter-spacing: 0.46em; color: var(--cyan); }
.lab-environment { color: var(--grey-300); font-size: 13px; }
.lab-environment span { color: var(--cyan); margin-right: 7px; }
.lab-main { padding: 90px 6vw 120px; max-width: calc(100% - 410px); }
.lab-eyebrow { color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; }
h1 { margin: 20px 0 24px; font: 800 clamp(36px, 4.4vw, 72px)/1.08 var(--font-head); letter-spacing: -0.055em; }
h1 span { color: var(--cyan); }
.lab-lead { max-width: 520px; margin: 0 0 30px; color: #c0ccda; font-size: 19px; line-height: 1.6; }
.lab-notice { max-width: 520px; border-left: 2px solid var(--cyan); padding: 0 0 0 18px; font-size: 14px; line-height: 1.6; }
.lab-notice strong { color: #e1f8fa; font-size: 13px; }
.lab-notice p { color: var(--grey-300); margin: 8px 0 0; }
.lab-actions { display: flex; align-items: center; gap: 20px; margin-top: 30px; }
.lab-primary { display: flex; align-items: center; gap: 26px; border: 0; border-radius: 8px; padding: 15px 21px; background: var(--cyan); color: var(--midnight); font-weight: 750; }
.lab-primary:hover { background: #70fbff; }
.lab-reset { padding: 10px 0; background: none; border: none; color: var(--grey-300); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.lab-footnote { max-width: 510px; margin-top: 22px; color: var(--grey-500); font-size: 12px; line-height: 1.6; }
.rex__lab-notice { margin: 0; padding: 9px 16px; background: rgba(0, 246, 255, 0.04); color: #c2dce2; font-size: 10px; line-height: 1.5; text-align: center; border-bottom: 1px solid rgba(0, 246, 255, 0.1); }
.rex__lab-controls { padding: 10px 16px 8px; flex-shrink: 0; background: rgba(0, 0, 0, 0.12); }
.rex__mode-switch { display: flex; gap: 4px; padding: 3px; border: 1px solid rgba(0, 246, 255, 0.15); border-radius: 9px; }
.rex__mode { flex: 1; min-width: 0; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--grey-300); font-size: 12px; font-weight: 650; }
.rex__mode[aria-pressed="true"] { background: var(--cyan); color: var(--midnight); }
.rex__mode:hover:not([aria-pressed="true"]) { background: rgba(0, 246, 255, 0.08); color: var(--white); }
.rex__provider-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.rex__provider-status { flex: 1; margin: 0; color: var(--grey-300); font-size: 10px; line-height: 1.5; }
.rex__refresh { flex-shrink: 0; min-height: 30px; padding: 4px 0 4px 6px; background: none; border: 0; color: var(--cyan); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.rex__feedback { flex-shrink: 0; margin: 0; padding: 8px 16px; color: #ffe2b1; background: rgba(255, 185, 90, 0.07); font-size: 11px; line-height: 1.5; }
.rex__lab-notice, .rex__header, .rex__input-area { flex-shrink: 0; }
.rex-msg--plain { white-space: pre-wrap; }
.rex__window { max-height: min(600px, calc(100svh - 135px)); }
.rex__messages { min-height: 140px; max-height: 370px; overscroll-behavior: contain; }
.rex__input { min-width: 0; }
.rex-msg { overflow-wrap: anywhere; }
.rex__close { min-width: 32px; min-height: 32px; }
.rex-opt--back { color: #a9b8ca; }
.rex__avatar--typing .rex__dino-icon { animation: avatarType 0.4s ease-in-out infinite alternate; }
.rex__avatar--greeting .rex__dino-icon { animation: avatarGreet 0.6s var(--ease-out-expo); }
@media (max-width: 900px) {
  .lab-main { max-width: 100%; padding: 48px 7vw 110px; }
  .lab-lead, .lab-notice, .lab-footnote { max-width: 520px; }
  .lab-header { padding: 22px 7vw; }
  h1 { font-size: clamp(34px, 8vw, 64px); }
}
@media (max-width: 480px) {
  .lab-environment { max-width: 110px; font-size: 11px; text-align: right; }
  .lab-actions { gap: 16px; }
  .lab-primary { font-size: 14px; padding: 14px 18px; }
  .rex__window { max-height: calc(100svh - 112px); }
  .rex__messages { min-height: 100px; }
  .rex__input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
