/* Imagine Byte assistant demo. System fonts only; themes are CSS variables. */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ib-ink: #101B2B;
  --ib-ivory: #FAF9F6;
  --ib-cyan: #00C7DC;
  --wrap: 1200px;
  --gutter: 24px;
  --error-bg: #FCEFEC;
  --error-text: #8A2B1E;
  --error-line: #F0C8C0;
}

/* ------------------------------------------------------------------ themes */

.theme-ib {
  --bg: var(--ib-ivory);
  --text: var(--ib-ink);
  --muted: #4A5567;
  --line: #E3E0D7;
  --surface: #FFFFFF;
  --focus: #007C8C;
}

.theme-northline {
  --bg: #F5F2EC;
  --text: #13233A;
  --muted: #586374;
  --line: #E0D9CD;
  --surface: #FFFFFF;
  --surface-2: #F7F5F0;
  --surface-text: #13233A;
  --surface-muted: #5A6577;
  --surface-line: #E6E0D6;
  --surface-line-strong: #D3CBBE;
  --input-bg: #FFFFFF;
  --brand: #13233A;
  --brand-text: #FFFFFF;
  --brand-muted: #AEB9C8;
  --accent: #E8762B;
  --accent-strong: #B4530F;
  --accent-soft: #FCEADB;
  --on-accent: #13233A;
  --btn-bg: #13233A;
  --btn-text: #FFFFFF;
  --user-bg: #13233A;
  --user-text: #FFFFFF;
  --highlight: #FFF2E4;
  --notice-bg: #FFFFFF;
  --notice-text: #3D4A5C;
  --focus: #B4530F;
  --surface-focus: #B4530F;
  --header-focus: #F39A5E;
  --doc-bg: #FFFFFF;
  --doc-text: #13233A;
  --doc-muted: #5A6577;
  --doc-line: #E6E0D6;
  --doc-card: #FBFAF7;
  --doc-pad: 40px 44px 44px;
}

.theme-academy {
  color-scheme: dark;
  --bg: #15171A;
  --text: #ECEBE6;
  --muted: #A3AAA4;
  --line: #2C3034;
  --surface: #F4F3EE;
  --surface-2: #EAE8E1;
  --surface-text: #1B1E21;
  --surface-muted: #59615B;
  --surface-line: #DCD9CF;
  --surface-line-strong: #CBC7BB;
  --input-bg: #FBFAF7;
  --brand: #0E1012;
  --brand-text: #ECEBE6;
  --brand-muted: #A0A8A1;
  --accent: #7FAF8A;
  --accent-strong: #3E6B4A;
  --accent-soft: #DCE9DE;
  --on-accent: #0E1012;
  --btn-bg: #3E6B4A;
  --btn-text: #FFFFFF;
  --user-bg: #23282C;
  --user-text: #F4F3EE;
  --highlight: #E2EDE3;
  --notice-bg: #1C1F23;
  --notice-text: #C9CEC9;
  --focus: #8FC39C;
  --surface-focus: #3E6B4A;
  --header-focus: #8FC39C;
  --doc-bg: #F4F3EE;
  --doc-text: #1B1E21;
  --doc-muted: #59615B;
  --doc-line: #DCD9CF;
  --doc-card: #FBFAF7;
  --doc-pad: 40px 44px 44px;
}

.theme-neutral {
  --bg: #F6F5F2;
  --text: #1E2630;
  --muted: #5B6470;
  --line: #E2DFD8;
  --surface: #FFFFFF;
  --surface-2: #F6F5F2;
  --surface-text: #1E2630;
  --surface-muted: #5B6470;
  --surface-line: #E5E2DB;
  --surface-line-strong: #D2CEC5;
  --input-bg: #FFFFFF;
  --brand: #1E2630;
  --brand-text: #FFFFFF;
  --brand-muted: #B3BAC3;
  --accent: #C98A2E;
  --accent-strong: #8F5A12;
  --accent-soft: #F7EBD8;
  --on-accent: #1E2630;
  --btn-bg: #1E2630;
  --btn-text: #FFFFFF;
  --user-bg: #1E2630;
  --user-text: #FFFFFF;
  --highlight: #FBF1E2;
  --notice-bg: #FFFFFF;
  --notice-text: #3F4752;
  --focus: #8F5A12;
  --surface-focus: #8F5A12;
  --header-focus: #E2A853;
  --doc-bg: #FFFFFF;
  --doc-text: #1E2630;
  --doc-muted: #5B6470;
  --doc-line: #E5E2DB;
  --doc-card: #FAF9F7;
  --doc-pad: 40px 44px 44px;
}

/* -------------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

svg {
  flex: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.nowrap {
  white-space: nowrap;
}

.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: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ib-ink);
  color: var(--ib-ivory);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
  outline: 2px solid var(--ib-cyan);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent, var(--ib-cyan));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--ib-cyan);
  color: var(--ib-ink);
}

.btn--primary:hover {
  background: #2BD3E4;
}

.btn--ghost {
  border-color: rgba(250, 249, 246, 0.35);
  color: inherit;
}

.btn--ghost:hover {
  border-color: rgba(250, 249, 246, 0.8);
}

.btn--brand {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--brand:hover {
  filter: brightness(1.06);
}

/* ------------------------------------------------- Imagine Byte demo bar */

.ib-bar {
  --focus: var(--ib-cyan);
  background: var(--ib-ink);
  color: var(--ib-ivory);
  font-size: clamp(11.5px, 3.3vw, 13px);
  line-height: 1;
}

.ib-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: 36px;
  margin-inline: auto;
}

.ib-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.ib-bar__mark {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--ib-cyan);
}

.ib-bar__brand:hover {
  color: #FFFFFF;
}

.ib-bar__cta {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(0, 199, 220, 0.55);
}

.ib-bar__cta:hover {
  border-bottom-color: var(--ib-cyan);
}

.ib-bar__cta .arrow {
  color: var(--ib-cyan);
}

/* ------------------------------------------------------------- landing */

.ib-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.ib-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.ib-logo__mark {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--ib-ink);
}

.ib-logo__mark::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--ib-cyan);
}

.ib-nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.ib-nav a {
  color: var(--muted);
  text-decoration: none;
}

.ib-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.hero {
  padding: 56px 0 44px;
}

.hero__title {
  max-width: 900px;
  margin: 0 0 18px;
  font-size: clamp(36px, 5.4vw, 64px);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -0.032em;
}

.hero__lede {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  color: var(--muted);
}

.hero--404 {
  min-height: 60vh;
  padding-top: 96px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero .btn--ghost {
  border-color: var(--line);
  background: var(--surface);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 72px;
}

.demo-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.demo-card:hover {
  border-color: #CBC6B9;
  box-shadow: 0 16px 36px -24px rgba(16, 27, 43, 0.45);
  transform: translateY(-2px);
}

.demo-card__preview {
  min-height: 268px;
  padding: 22px 24px 26px;
}

.demo-card--northline .demo-card__preview {
  background: #13233A;
  color: #FFFFFF;
  box-shadow: inset 0 -3px 0 #E8762B;
}

.demo-card--academy .demo-card__preview {
  background: #16181B;
  color: #ECEBE6;
  box-shadow: inset 0 -3px 0 #7FAF8A;
}

.mini-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 13px;
}

.mini-brand__name {
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mini-brand__sub {
  opacity: 0.68;
  letter-spacing: 0.03em;
}

.demo-card--academy .mini-brand__name {
  font-size: 15px;
  letter-spacing: -0.005em;
  text-transform: none;
}

.demo-card--academy .mini-brand__sub {
  color: #7FAF8A;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 1;
}

.mini-chat {
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.mini-q {
  justify-self: end;
  max-width: 82%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 12px 12px 4px 12px;
  background: rgba(255, 255, 255, 0.12);
}

.mini-a {
  max-width: 94%;
  padding: 12px 14px;
  border-radius: 12px 12px 12px 4px;
  background: #FFFFFF;
  color: #13233A;
}

.demo-card--academy .mini-a {
  background: #F4F3EE;
  color: #1B1E21;
}

.mini-a p {
  margin: 0;
}

.mini-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: #FCEADB;
  color: #8A3D08;
  font: 700 11px/1 var(--mono);
  vertical-align: 1px;
}

.demo-card--academy .mini-cite {
  background: #DCE9DE;
  color: #2F5A3B;
}

.mini-a .mini-src {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(19, 35, 58, 0.1);
  font-size: 12.5px;
  color: #5A6577;
}

.mini-src .mini-cite {
  margin-left: 0;
}

.demo-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px 24px;
}

.demo-card__kicker {
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-card__title {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.018em;
}

.demo-card__text {
  margin: 0 0 12px;
  color: var(--muted);
}

.demo-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-weight: 650;
}

.demo-card__cta .arrow {
  transition: transform 0.2s;
}

.demo-card:hover .demo-card__cta .arrow {
  transform: translateX(3px);
}

.how {
  padding: 44px 0 56px;
  border-top: 1px solid var(--line);
}

.how__title {
  margin: 0 0 26px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.how__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how__list li {
  counter-increment: how;
}

.how__list li::before {
  content: counter(how, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font: 600 13px/1 var(--mono);
  color: #007C8C;
}

.how__list h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.how__list p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 64px;
  padding: 34px 36px;
  border-radius: 14px;
  background: var(--ib-ink);
  color: var(--ib-ivory);
}

.cta-band {
  --focus: var(--ib-cyan);
}

.cta-band h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.015em;
}

.cta-band p {
  margin: 0;
  color: #BAC3CF;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ib-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.ib-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.ib-footer p {
  margin: 0;
}

/* ------------------------------------------------------ tenant header */

.t-header {
  --focus: var(--header-focus);
  background: var(--brand);
  color: var(--brand-text);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.theme-academy .t-header {
  box-shadow: inset 0 -1px 0 var(--line);
}

.t-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark__name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.wordmark__sub {
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--brand-muted);
}

.theme-academy .wordmark__name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.012em;
  text-transform: none;
}

.theme-academy .wordmark__sub {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.t-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-nav__link {
  padding: 8px 10px;
  font-size: 14.5px;
  color: var(--brand-muted);
  text-decoration: none;
}

.t-nav__link:hover {
  color: var(--brand-text);
}

.t-nav__link[aria-current="page"] {
  color: var(--brand-text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.t-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.t-nav__cta:hover {
  filter: brightness(1.07);
}

/* ------------------------------------------------- assistant page */

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-block: 32px 48px;
}

.intro {
  position: sticky;
  top: 24px;
  padding-top: 6px;
}

.intro__title {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.3vw, 40px);
  line-height: 1.07;
  letter-spacing: -0.028em;
}

.intro__lede {
  margin: 0 0 22px;
  font-size: 16.5px;
  color: var(--muted);
}

.notice {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--notice-bg);
  font-size: 14.5px;
  line-height: 1.5;
}

.notice__title {
  margin: 0 0 2px;
  font-weight: 700;
}

.notice__text {
  margin: 0;
  color: var(--notice-text);
}

.sources {
  border-block: 1px solid var(--line);
}

.sources summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.sources summary::-webkit-details-marker {
  display: none;
}

.sources summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 4px 0 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.sources[open] summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.sources__count {
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.sources__list {
  display: grid;
  gap: 1px;
  max-height: 360px;
  margin: 0;
  padding: 0 0 14px;
  overflow: auto;
  list-style: none;
}

.sources__list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sources__list a {
  display: flex;
  flex: 1;
  gap: 10px;
  padding: 6px 2px;
  font-size: 14.5px;
  color: var(--text);
  text-decoration: none;
}

.sources__list a:hover .sources__title {
  text-decoration: underline;
}

.sources__num,
.sources__meta {
  font: 500 12.5px/1.9 var(--mono);
  color: var(--muted);
}

.sources__num {
  min-width: 1.6em;
}

.intro__fine {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------- chat */

.chat {
  --focus: var(--surface-focus);
  display: flex;
  flex-direction: column;
  height: clamp(560px, calc(100vh - 168px), 860px);
  height: clamp(560px, calc(100dvh - 168px), 860px);
  overflow: hidden;
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--surface-text);
  box-shadow: 0 22px 44px -32px rgba(10, 18, 30, 0.45);
}

.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--surface-line);
}

.chat__id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-text);
  box-shadow: inset 0 -3px 0 var(--accent);
  font-size: 15px;
  font-weight: 800;
}

.chat__id-text {
  min-width: 0;
}

.chat__title {
  margin: 0;
  overflow: hidden;
  font-size: 15.5px;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat__status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--surface-muted);
}

.chat__status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3D8F55;
}

.chat__tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.chat__mode {
  padding: 4px 9px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--surface-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chat__reset {
  padding: 6px 12px;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  background: transparent;
  color: var(--surface-text);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chat__reset:hover {
  border-color: var(--surface-line-strong);
  background: var(--surface-2);
}

.chat__log {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  padding: 24px 22px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.msg {
  max-width: min(700px, 92%);
}

.msg p {
  margin: 0 0 10px;
}

.msg p:last-child {
  margin-bottom: 0;
}

.msg--user {
  align-self: flex-end;
}

.msg--user .msg__body {
  padding: 10px 15px;
  border-radius: 14px 14px 4px 14px;
  background: var(--user-bg);
  color: var(--user-text);
  font-size: 15.5px;
  overflow-wrap: anywhere;
}

.msg--bot {
  align-self: flex-start;
}

.msg--bot .msg__body {
  padding: 13px 16px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-2);
  font-size: 15.5px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.msg__body ul,
.msg__body ol {
  margin: 6px 0 10px;
  padding-left: 20px;
}

.msg__body li {
  margin: 3px 0;
}

.msg__body li::marker {
  color: var(--accent-strong);
}

.msg__body blockquote {
  margin: 4px 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
}

.msg__body blockquote:last-child {
  margin-bottom: 0;
}

.msg--preview .msg__body > p:first-child {
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--surface-muted);
}

.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 700 11.5px/1 var(--mono);
  text-decoration: none;
  vertical-align: 2px;
}

.cite + .cite {
  margin-left: 3px;
}

.cite:hover {
  border-color: var(--accent-strong);
}

.msg__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--surface-muted);
}

.dots {
  display: inline-flex;
  gap: 4px;
}

.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: ib-pulse 1.2s infinite ease-in-out;
}

.dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ib-pulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  40% {
    opacity: 0.9;
    transform: translateY(-2px);
  }
}

.msg__note {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--surface-muted);
}

.msg--error .msg__body {
  border: 1px solid var(--error-line);
  background: var(--error-bg);
  color: var(--error-text);
}

.msg__sources {
  margin-top: 10px;
}

.msg__sources-title {
  margin: 0 0 6px 2px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--surface-muted);
}

.src-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.src {
  display: flex;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--surface-text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.src:hover {
  border-color: var(--accent-strong);
}

.src__n {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 700 12px/22px var(--mono);
  text-align: center;
}

.src__main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.src__title {
  font-size: 14.5px;
  font-weight: 650;
}

.src__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-strong);
}

.src__snippet {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--surface-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.msg__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.msg__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--surface-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.msg__action:hover {
  border-color: var(--surface-line);
  color: var(--surface-text);
}

.msg__action--retry {
  border-color: var(--surface-line-strong);
  color: var(--surface-text);
}

.msg__tag {
  padding: 3px 9px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
}

.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  padding: 7px 13px;
  border: 1px solid var(--surface-line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--surface-text);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

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

.chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.composer {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--surface-line);
  background: var(--surface);
}

.composer__box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--surface-line-strong);
  border-radius: 12px;
  background: var(--input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer__box:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 168px;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--surface-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
}

.composer textarea:focus-visible {
  outline: none;
}

.composer textarea::placeholder {
  color: var(--surface-muted);
  opacity: 0.85;
}

.composer__send {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}

.composer__send:disabled {
  opacity: 0.35;
  cursor: default;
}

.composer__send.is-stop {
  background: var(--surface-text);
}

.composer__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--surface-muted);
}

.composer__count {
  font-family: var(--mono);
  font-size: 12px;
}

.composer__count.is-near {
  color: var(--accent-strong);
  font-weight: 700;
}

/* ------------------------------------------------------ tenant footer */

.t-footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.t-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.t-footer p {
  margin: 0;
}

.t-footer__disclaimer {
  max-width: 70ch;
}

.t-footer a {
  color: var(--text);
}

/* ---------------------------------------------- help and lesson pages */

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
  align-items: start;
  padding-block: 32px 64px;
}

.doc {
  --focus: var(--surface-focus);
  min-width: 0;
  padding: var(--doc-pad);
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: var(--doc-bg);
  color: var(--doc-text);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--doc-muted);
}

.crumbs a {
  color: inherit;
}

.doc__title {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.026em;
}

.doc__lede {
  max-width: 62ch;
  margin: 0 0 26px;
  font-size: 18px;
  color: var(--doc-muted);
}

.doc__source {
  margin: 28px 0 0;
  font-size: 13.5px;
  color: var(--doc-muted);
  overflow-wrap: anywhere;
}

.prose h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.016em;
}

.prose p,
.prose ul,
.prose ol {
  max-width: 68ch;
  margin: 0 0 12px;
}

.prose li {
  margin: 4px 0;
}

.prose li::marker {
  color: var(--accent-strong);
}

.passage {
  position: relative;
  margin: 0 -18px 8px;
  padding: 14px 18px;
  border-radius: 10px;
  scroll-margin-top: 96px;
  transition: background-color 0.5s;
}

.passage > :last-child {
  margin-bottom: 0;
}

.passage:target {
  background: var(--highlight);
  box-shadow: inset 3px 0 0 var(--accent);
}

.passage:target::before {
  content: "Cited passage";
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.lesson__kicker {
  margin: 0 0 8px;
  font: 500 13px/1.4 var(--mono);
  color: var(--doc-muted);
}

.video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin: 10px 0 24px;
  overflow: hidden;
  border: 1px solid #24282C;
  border-radius: 12px;
  background: #0E1012;
  color: #ECEBE6;
}

.video::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #2A2E32;
}

.video__inner {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.video__play {
  margin-bottom: 6px;
  color: var(--accent);
}

.video__title {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 650;
  letter-spacing: -0.012em;
}

.video__meta {
  margin: 0;
  font: 500 13px/1.4 var(--mono);
  color: #9BA39C;
}

.video__note {
  position: absolute;
  bottom: 12px;
  left: 14px;
  margin: 0;
  font-size: 12px;
  color: #7E8680;
}

.chapters {
  margin: 0 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 10px;
}

.chapters__title,
.transcript__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.chapters ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapters a {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 14.5px;
  color: var(--doc-text);
  text-decoration: none;
}

.chapters a:hover span:last-child {
  text-decoration: underline;
}

.chapters .ts {
  min-width: 3.2em;
  font: 500 13px/1.6 var(--mono);
  color: var(--accent-strong);
}

.chapter {
  margin: 4px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.line {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr);
  gap: 12px;
  max-width: 76ch;
  margin: 0 0 12px;
  scroll-margin-top: 120px;
}

.line .ts {
  padding-top: 2px;
  font: 500 13px/1.6 var(--mono);
  color: var(--accent-strong);
  text-decoration: none;
}

.line .ts:hover {
  text-decoration: underline;
}

.line:target {
  margin-inline: -12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--highlight);
  box-shadow: inset 3px 0 0 var(--accent);
}

.line:target .ts {
  font-weight: 700;
}

.line:target .line__text::before {
  content: "Cited passage";
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--doc-line);
}

.pager__link {
  display: grid;
  gap: 2px;
  max-width: 48%;
  font-weight: 650;
  color: var(--doc-text);
  text-decoration: none;
}

.pager__link:hover span:last-child {
  text-decoration: underline;
}

.pager__link--next {
  margin-left: auto;
  text-align: right;
}

.pager__dir {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.doc-aside {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 24px;
}

.ask-card {
  --focus: var(--header-focus);
  padding: 18px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-text);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.theme-academy .ask-card {
  border: 1px solid var(--line);
}

.ask-card__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.ask-card__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--brand-muted);
}

.toc {
  font-size: 14px;
}

.toc__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  gap: 10px;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

.toc a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 650;
}

.outline__num,
.outline__meta {
  font: 500 12.5px/1.7 var(--mono);
}

.outline__num {
  min-width: 1.5em;
}

.outline__title {
  flex: 1;
}

.card-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-list__link {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--doc-line);
  border-radius: 10px;
  background: var(--doc-card);
  color: var(--doc-text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.card-list__link:hover {
  border-color: var(--accent-strong);
}

.card-list__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.card-list__num,
.card-list__meta {
  font: 500 13px/1.5 var(--mono);
  color: var(--accent-strong);
}

.card-list__meta {
  margin-left: auto;
  color: var(--doc-muted);
}

.card-list__title {
  font-weight: 650;
}

.card-list__text {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  color: var(--doc-muted);
}

/* -------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .assistant-layout {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 28px;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
  }
}

@media (max-width: 880px) {
  .assistant-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-block: 22px 32px;
  }

  .intro {
    position: static;
  }

  .intro__title {
    font-size: 30px;
  }

  .intro__lede {
    margin-bottom: 16px;
  }

  .notice {
    margin-bottom: 14px;
  }

  .chat {
    height: clamp(500px, 80vh, 760px);
    height: clamp(500px, 80svh, 760px);
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .doc-aside {
    position: static;
  }

  .demo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .how__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 24px;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  .theme-northline,
  .theme-academy,
  .theme-neutral {
    --doc-pad: 24px 18px 28px;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .ib-header__inner {
    height: 60px;
  }

  .ib-nav {
    gap: 14px;
    font-size: 14px;
  }

  .ib-nav a:last-child {
    display: none;
  }

  .demo-card__preview {
    min-height: 0;
    padding: 18px 18px 22px;
  }

  .demo-card__body {
    padding: 18px 18px 20px;
  }

  .t-header__inner {
    min-height: 56px;
  }

  .t-nav__link--assistant,
  .theme-northline .wordmark__sub,
  .theme-neutral .wordmark__sub {
    display: none;
  }

  .t-nav__cta {
    margin-left: 4px;
  }

  .assistant-layout {
    padding-block: 18px 24px;
  }

  .intro__title {
    font-size: 27px;
  }

  .intro__lede {
    font-size: 15.5px;
  }

  .chat {
    border-radius: 12px;
  }

  .chat__head {
    padding: 12px 14px;
  }

  .chat__title {
    white-space: normal;
    font-size: 15px;
    line-height: 1.3;
  }

  .chat__status {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .chat__reset {
    padding: 5px 10px;
    font-size: 13px;
  }

  .chat__log {
    gap: 16px;
    padding: 18px 12px 12px;
  }

  .msg {
    max-width: 100%;
  }

  .msg--user {
    max-width: 88%;
  }

  .msg--bot .msg__body {
    padding: 12px 14px;
    font-size: 15px;
  }

  .composer {
    padding: 10px 10px 12px;
  }

  #chat-hint {
    display: none;
  }

  .passage {
    margin-inline: -12px;
    padding: 12px;
  }

  .chapters ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .line {
    grid-template-columns: 3.4em minmax(0, 1fr);
    gap: 8px;
  }

  .pager {
    flex-direction: column;
  }

  .pager__link {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .chat__mode {
    display: none;
  }
}

@media (max-width: 420px) {
  .t-nav__cta-label {
    display: none;
  }

  .t-nav__cta {
    padding: 9px;
  }

  .chat__avatar {
    display: none;
  }
}

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

  .dots i {
    animation: none;
    opacity: 0.6;
  }

  .demo-card:hover {
    transform: none;
  }
}
