@font-face {
  font-family: Archivo;
  src: url("./fonts/400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("./fonts/500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("./fonts/600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("./fonts/700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("./fonts/800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --ubx-navy: #04182c;
  --ubx-header: #0a2038;
  --ubx-grid: rgb(89 200 245 / 6%);
}

/* The theme registry owns interface colors, text size and the code font.
   These hooks draw the company masthead and the auth-only grid artwork. */
:where(h1, h2, h3, h4),
.ubx-welcome-heading {
  font-family: var(--theme-display-font-family, Archivo, system-ui, sans-serif);
  letter-spacing: -0.02em;
}

.ubx-welcome-heading {
  font-weight: 700;
}

.ubx-masthead {
  display: flex;
  align-items: center;
  height: 4.5rem;
  margin: 0;
  padding-inline: clamp(1rem, 5vw, 4rem);
  border-bottom: 1px solid #29455d;
  background: var(--ubx-header);
}

.ubx-masthead img {
  width: min(14rem, 75vw);
  height: 3rem;
  object-position: left center;
}

.ubx-auth-main {
  padding: clamp(1rem, 4vw, 3rem) 1rem 4rem;
  background-color: var(--ubx-navy);
  background-image:
    linear-gradient(var(--ubx-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ubx-grid) 1px, transparent 1px),
    radial-gradient(ellipse at 82% 0, rgb(74 96 255 / 22%), transparent 62%);
  background-size: 4rem 4rem, 4rem 4rem, auto;
}

.ubx-auth-card {
  width: min(100%, 28rem);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid rgb(var(--border-medium));
  border-radius: var(--theme-surface-radius, 1rem);
}

.ubx-auth-card.max-w-lg {
  width: min(100%, 32rem);
}

.ubx-theme-picker {
  z-index: 1;
}

.ubx-chat-header {
  container: ubx-masthead / inline-size;
  background: var(--ubx-header);
  border-bottom: 1px solid #29455d;
  color: #fff;
}

/* Color the controls on the navy band. Portaled menus use the normal
   surface palette in both modes. */
@scope (.ubx-chat-header) to ([role="dialog"], [role="menu"], [role="listbox"], [role="tooltip"]) {
  :is(button, a) {
    color: #ecf4ff;
    background-color: #102c46;
    border-color: #45627b;
  }

  :is(button, a):is(:hover, [aria-expanded="true"]) {
    color: #fff;
    background-color: #244760;
  }

  :is(button, a):focus-visible {
    outline: 2px solid #85e3ff;
    outline-offset: 2px;
  }
}

.ubx-chat-wordmark {
  display: none;
  width: 8rem;
  height: 2rem;
  flex: none;
  object-fit: contain;
}

/* Measure the chat pane itself so a sidebar, split chat or zoomed layout
   can give the controls the entire row. */
@container ubx-masthead (min-width: 48rem) {
  .ubx-chat-wordmark {
    display: block;
  }
}

@media (forced-colors: active) {
  .ubx-auth-main {
    background: Canvas;
  }

  .ubx-masthead, .ubx-chat-header, .ubx-auth-card {
    border-color: CanvasText;
  }

  .ubx-masthead img, .ubx-chat-wordmark {
    forced-color-adjust: none;
    background-color: var(--ubx-header);
  }
}

/* Four visible groups below the composer, arranged by the available chat width. */
.oracle-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.65fr);
  gap: .65rem;
  margin-block: .8rem .35rem;
  overflow-y: auto;
  max-height: min(40dvh, 23rem);
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--border-heavy)) transparent;
  text-align: start;
}
.oracle-workspace section {
  min-width: 0;
  padding: .75rem;
  border: 1px solid rgb(var(--border-medium));
  border-top: 2px solid rgb(var(--accent-primary));
  border-radius: .85rem;
  background: rgb(var(--surface-composer));
  color: rgb(var(--text-primary));
}
.oracle-workspace h3 {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .45rem;
  font-size: .92rem;
  font-weight: 700;
}
.oracle-workspace h3 svg { width: 1rem; height: 1rem; flex-shrink: 0; color: rgb(var(--accent-primary)); }
.oracle-workspace :is(button, a) {
  display: inline-block;
  margin: .125rem .25rem .125rem 0;
  padding: .23rem .4rem;
  border-radius: .4rem;
  background: rgb(var(--surface-secondary));
  color: rgb(var(--text-primary));
  text-align: start;
  font-size: .82rem;
}
.oracle-workspace :is(button, a):hover { background: rgb(var(--surface-active)); }
.oracle-workspace [aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgb(var(--accent-primary)); }
.oracle-workspace :disabled { opacity: .55; }
.oracle-route p, .oracle-workspace small { font-size: .76rem; line-height: 1.4; overflow-wrap: anywhere; color: rgb(var(--text-secondary)); }
.oracle-route strong { display: block; font-size: .85rem; margin-top: .25rem; }
@container (max-width: 47rem) {
  .oracle-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; max-height: 27vh; }
  .oracle-workspace section { padding: .55rem; }
}
@media (max-width: 600px) {
  .oracle-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; max-height: 25vh; }
}

.oracle-control-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
.oracle-control-bar button, .oracle-temperature select {
  color: rgb(var(--text-primary));
  background: rgb(var(--surface-secondary));
  border: 1px solid rgb(var(--border-medium));
  border-radius: .45rem;
  padding: .25rem .55rem;
  font: inherit;
  font-size: .8rem;
}
.oracle-control-bar [role="switch"] {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.oracle-control-bar [role="switch"]::before {
  content: '';
  width: 1.55rem;
  height: .9rem;
  border: 1px solid currentColor;
  border-radius: 1rem;
  background: radial-gradient(circle at 27% 50%, currentColor .25rem, transparent .27rem);
}
.oracle-control-bar [aria-checked="true"]::before {
  color: rgb(var(--accent-primary));
  background: radial-gradient(circle at 73% 50%, currentColor .25rem, transparent .27rem);
}
.oracle-temperature { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-block: .4rem; font-size: .8rem; }
.oracle-temperature select { max-width: 100%; }

.oracle-sales-team {
  display: flex;
  align-items: center;
  gap: .875rem;
  max-width: 32rem;
  margin: .65rem auto;
  padding-inline: .75rem;
  text-align: start;
  color: rgb(var(--text-primary));
}
.oracle-sales-emblem {
  flex: none;
  width: clamp(3.75rem, 10cqw, 6rem);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
}
.oracle-sales-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* The supplied artwork includes a transparent margin around the circular seal. */
  transform: scale(1.21);
}
.oracle-sales-emblem:focus-visible {
  outline: 3px solid rgb(var(--accent-primary));
  outline-offset: 3px;
}
.oracle-sales-team h2 { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.oracle-sales-team h2 span { display: block; font-size: .88em; font-weight: 500; }
.oracle-sales-team p {
  margin-top: .4em;
  color: rgb(var(--text-secondary));
  font-size: .85rem;
  line-height: 1.4;
}

/* The chat pane is the size container. Reserve a right rail before centering
   the input, including when an open sidebar narrows the pane. */
@container (min-width: 64rem) {
  [data-composer-band]:has(.oracle-sales-team) { max-width: none; }
  form:has(.oracle-sales-team) {
    --sales-gap: clamp(1rem, 3cqw, 4rem);
    --sales-width: clamp(12rem, 17cqw, 19rem);
    --sales-rail: calc(var(--sales-gap) + var(--sales-width) + 1rem);
    --composer-width: min(56rem, calc(100% - var(--sales-rail) - 1rem));
    max-width: var(--composer-width);
    margin-left: min(calc((100% - var(--composer-width)) / 2), calc(100% - var(--composer-width) - var(--sales-rail)));
    margin-right: auto;
  }
  form.max-w-full:has(.oracle-sales-team) {
    --composer-width: calc(100% - var(--sales-rail) - 1rem);
  }
  .oracle-sales-team {
    position: absolute;
    left: calc(100% + var(--sales-gap));
    top: 0;
    width: var(--sales-width);
    margin: 0;
    padding: 0;
    flex-direction: column;
    gap: clamp(1rem, 2dvh, 1.5rem);
    text-align: center;
  }
  .oracle-sales-emblem { width: min(100%, 32dvh, 17.5rem); }
  .oracle-sales-team h2 { font-size: clamp(1.05rem, 1.3cqw, 1.5rem); }
  .oracle-sales-team p { margin-top: .65rem; font-size: .95rem; text-wrap: balance; }
}
