:root {
  color-scheme: light;
  font-family: "Anuphan", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --primary-50: #f0f9f8;
  --primary-100: #d9efed;
  --primary-200: #b4dfda;
  --primary-300: #83c8c1;
  --primary-400: #4caaa3;
  --primary-500: #278b86;
  --primary-600: #1d716e;
  --primary-700: #185b59;
  --primary-800: #164948;
  --primary-900: #133d3c;
  --cyan: #16c6d4;
  --cyan-soft: #dff7f7;
  --background: #f7faf9;
  --surface: #ffffff;
  --surface-soft: #eff5f3;
  --border: #dce7e4;
  --border-strong: #c6d5d1;
  --text: #18302e;
  --text-secondary: #576e6a;
  --text-muted: #7a8d89;
  --success: #287b58;
  --warning: #9a671f;
  --error: #b54444;
  --scrollbar-thumb: rgba(39, 139, 134, 0.34);
  --scrollbar-thumb-hover: rgba(29, 113, 110, 0.58);
  --app-topbar-height: calc(72px + env(safe-area-inset-top, 0px));
  --shadow-sm: 0 8px 26px rgba(19, 61, 60, 0.07);
  --shadow-md: 0 18px 60px rgba(19, 61, 60, 0.12);
  --shadow-modal: 0 28px 90px rgba(10, 35, 32, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 0;
  color: var(--text);
  background: var(--background);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
summary,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--primary-800);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(22, 198, 212, 0.45);
  outline-offset: 3px;
}

.boot-view {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100svh;
  gap: 14px;
  padding: 24px;
  color: var(--text-secondary);
  background:
    radial-gradient(circle at 20% 20%, rgba(22, 198, 212, 0.12), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(39, 139, 134, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f4faf8 50%, #edf6f4 100%);
}

.boot-view img {
  width: clamp(86px, 9vw, 108px);
  height: auto;
  object-fit: contain;
  overflow: visible;
  background: transparent;
}

.boot-progress {
  position: relative;
  width: 116px;
  height: 3px;
  overflow: hidden;
  background: var(--primary-100);
  border-radius: 999px;
}

.boot-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: var(--primary-500);
  border-radius: inherit;
  animation: boot-progress 1.1s ease-in-out infinite;
}

.boot-view p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, transform 160ms ease, box-shadow 180ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  color: white;
  background: var(--primary-700);
  border-color: var(--primary-700);
  box-shadow: 0 7px 18px rgba(24, 91, 89, 0.16);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.button-secondary {
  color: var(--primary-800);
  background: var(--surface);
  border-color: var(--border-strong);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  color: var(--primary-700);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.button-danger {
  color: white;
  background: var(--error);
  border-color: var(--error);
}

.button-danger:hover:not(:disabled) {
  background: #963737;
  border-color: #963737;
}

.button-quiet {
  color: var(--primary-800);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.is-loading .button-label,
.is-loading .send-label,
.is-loading > svg {
  display: none;
}

.is-loading .spinner {
  display: block;
}

/* Public landing */

.landing-view {
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  background: var(--background);
}

.landing-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(22, 198, 212, 0.12), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(39, 139, 134, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f4faf8 50%, #edf6f4 100%);
}

.landing-nav {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 22px clamp(24px, 5vw, 80px) 16px;
}

.landing-brand,
.topbar-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.landing-brand img,
.topbar-brand img,
.landing-footer img {
  height: auto;
  object-fit: contain;
  overflow: visible;
  background: transparent;
}

.landing-brand img {
  width: 48px;
}

.landing-footer img {
  width: 38px;
}

.landing-brand span {
  font-size: 18px;
  font-weight: 700;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.landing-links a {
  color: var(--primary-800);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 180ms ease;
}

.landing-links a:hover {
  opacity: 0.68;
}

.landing-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
  min-height: 0;
  width: min(100% - 32px, 960px);
  margin: 0 auto;
  padding: 8px 0 12px;
  text-align: center;
}

.hero-logo {
  width: clamp(110px, 10vw, 155px);
  height: auto;
  margin-bottom: clamp(6px, 1.5vh, 14px);
  object-fit: contain;
  overflow: visible;
  background: transparent;
}

.product-label,
.eyebrow {
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 600;
}

.product-label {
  margin: 0 0 clamp(8px, 1.5vh, 16px);
  padding: 6px 12px;
  background: rgba(217, 239, 237, 0.75);
  border: 1px solid rgba(180, 223, 218, 0.8);
  border-radius: 9px;
}

.hero-content h1 {
  max-width: 900px;
  margin-bottom: clamp(10px, 2vh, 20px);
  color: var(--primary-900);
  font-size: clamp(38px, 5.5vw, 66px);
  font-weight: 700;
  line-height: 1.12;
}

.hero-content h1 span {
  display: block;
}

.hero-description {
  max-width: 660px;
  margin-bottom: clamp(14px, 2.8vh, 28px);
  color: var(--text-secondary);
  font-size: clamp(17px, 1.7vw, 20px);
  font-weight: 400;
  line-height: 1.75;
}

.mobile-copy {
  display: none;
}

.landing-composer {
  width: min(100%, 720px);
  min-height: 0;
  padding: clamp(14px, 2vh, 20px) 22px 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 34px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.landing-composer:focus-within {
  border-color: var(--primary-300);
  box-shadow: 0 18px 60px rgba(19, 61, 60, 0.13),
    0 0 0 4px rgba(22, 198, 212, 0.12);
}

.landing-composer textarea {
  display: block;
  width: 100%;
  min-height: clamp(68px, 10vh, 96px);
  max-height: 140px;
  padding: 4px 8px 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  font-size: clamp(17px, 1.6vw, 19px);
  font-weight: 400;
  line-height: 1.7;
}

.landing-composer textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.88;
}

.landing-composer-toolbar,
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-attachment,
.composer-tools {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.landing-attachment > span {
  color: var(--text-muted);
  font-size: 13px;
}

.round-tool-button,
.icon-button,
.modal-close,
.password-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--primary-800);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease, transform 160ms ease;
}

.round-tool-button {
  border-radius: 50%;
}

.round-tool-button:hover,
.icon-button:hover,
.modal-close:hover,
.password-toggle:hover {
  color: var(--primary-700);
  background: var(--primary-100);
  border-color: var(--primary-200);
}

.round-tool-button:active,
.icon-button:active,
.modal-close:active,
.password-toggle:active {
  transform: scale(0.96);
}

.round-tool-button svg,
.icon-button svg,
.modal-close svg,
.password-toggle svg {
  width: 21px;
  height: 21px;
}

.landing-send-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  gap: 9px;
  padding: 0 23px;
  color: white;
  background: var(--primary-700);
  border: 1px solid var(--primary-700);
  border-radius: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms ease, transform 160ms ease,
    box-shadow 180ms ease;
}

.landing-send-button:hover,
.send-button:hover:not(:disabled) {
  background: var(--primary-600);
  box-shadow: 0 7px 18px rgba(24, 91, 89, 0.18);
}

.landing-send-button:active,
.send-button:active:not(:disabled) {
  transform: scale(0.98);
}

.landing-send-button svg,
.send-button svg {
  width: 19px;
  height: 19px;
}

.landing-composer-message {
  min-height: 20px;
  margin: 6px 8px -5px;
  color: var(--error);
  font-size: 13px;
}

.hero-login-note {
  margin: clamp(8px, 1.5vh, 14px) 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.landing-section {
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding: 104px 0;
  scroll-margin-top: 24px;
}

.section-intro {
  max-width: 680px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-intro .eyebrow {
  margin-bottom: 8px;
}

.section-intro h2 {
  margin-bottom: 12px;
  color: var(--primary-900);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.25;
}

.section-intro > p:last-child {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 17px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.capability-card {
  min-width: 0;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.capability-card svg {
  width: 28px;
  height: 28px;
  margin-bottom: 20px;
  color: var(--primary-600);
}

.capability-card h3,
.steps-list h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
}

.capability-card p,
.steps-list p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.how-section {
  width: 100%;
  padding-right: max(20px, calc((100% - 1180px) / 2));
  padding-left: max(20px, calc((100% - 1180px) / 2));
  background: var(--surface-soft);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.steps-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 28px;
}

.steps-list li:not(:last-child)::after {
  position: absolute;
  top: 31px;
  right: -2px;
  width: 30px;
  height: 1px;
  content: "";
  background: var(--primary-200);
}

.steps-list li > span {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--primary-800);
  background: var(--primary-100);
  border: 1px solid var(--primary-200);
  border-radius: 50%;
  font-weight: 700;
}

.faq-section {
  max-width: 860px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.faq-list summary {
  position: relative;
  min-height: 60px;
  padding: 17px 54px 17px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq-list summary::after {
  position: absolute;
  top: 50%;
  right: 22px;
  color: var(--primary-700);
  content: "+";
  font-size: 24px;
  font-weight: 400;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: -2px 54px 18px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 38px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* Login modal */

.login-modal {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  padding: 16px;
  place-items: center;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 31, 30, 0.45);
  backdrop-filter: blur(5px);
  animation: modal-fade 180ms ease both;
}

.login-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: calc(100svh - 32px);
  padding: 32px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-modal);
  animation: modal-in 200ms ease both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border-color: transparent;
}

.login-dialog-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 48px 22px 0;
}

.login-dialog-brand img {
  width: 58px;
  height: auto;
  object-fit: contain;
  overflow: visible;
  background: transparent;
}

.login-dialog-brand div {
  display: grid;
}

.login-dialog-brand span {
  font-size: 19px;
  font-weight: 700;
}

.login-dialog-brand small {
  color: var(--text-muted);
  font-size: 12px;
}

.login-dialog h2 {
  margin-bottom: 7px;
  font-size: 27px;
  line-height: 1.3;
}

.login-dialog > p:not(.form-message) {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 15px;
}

.stack-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span:first-child,
.switch-field strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px rgba(39, 139, 134, 0.12);
}

.field input[readonly],
.field select:disabled {
  color: var(--text-muted);
  background: var(--surface-soft);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  border-color: transparent;
}

.eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 3px;
}

.form-message,
.inline-message,
.composer-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.form-message.is-error,
.inline-message.is-error,
.composer-message.is-error {
  color: var(--error);
}

.form-message.is-status,
.inline-message.is-status,
.composer-message.is-status {
  color: var(--primary-700);
}

body.modal-open,
body.history-drawer-open {
  overflow: hidden;
}

/*
 * Only purpose-built regions scroll. Keeping this list explicit prevents a
 * second browser/page scrollbar from appearing around the workspace.
 */
:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
) {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
)::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
)::-webkit-scrollbar-track {
  margin-block: 8px;
  background: transparent;
}

:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
)::-webkit-scrollbar-thumb {
  min-height: 44px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
}

:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
)::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

:where(
  .landing-composer textarea,
  .login-dialog,
  .history-list,
  .conversation-scroll,
  .composer textarea,
  .users-view,
  .user-editor,
  .users-list
)::-webkit-scrollbar-button {
  -webkit-appearance: none;
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

*::-webkit-scrollbar-button:single-button {
  -webkit-appearance: none;
  display: none;
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  max-width: 0;
  max-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  border: 0;
}

/* Authenticated workspace */

.app-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background: var(--background);
}

.topbar {
  position: relative;
  flex: 0 0 auto;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  min-height: var(--app-topbar-height);
  padding: calc(10px + env(safe-area-inset-top, 0px))
    clamp(20px, 3vw, 42px) 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar-brand img {
  width: 44px;
}

.topbar-brand div,
.account-summary div {
  display: grid;
  line-height: 1.3;
}

.topbar-brand strong {
  font-size: 17px;
}

.topbar-brand span,
.account-summary span,
.account-summary div span {
  color: var(--text-muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 7px;
  padding: 0 14px;
  color: var(--text-secondary);
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.nav-button svg {
  width: 18px;
  height: 18px;
}

.nav-button:hover {
  color: var(--primary-800);
}

.nav-button.is-active {
  color: var(--primary-800);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(19, 61, 60, 0.08);
}

.account-menu {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white !important;
  background: var(--primary-700);
  border-radius: 50%;
  font-size: 14px !important;
  font-weight: 700;
}

.logout-button {
  min-height: 40px;
  padding: 0 13px;
}

.app-main {
  flex: 1;
  min-height: 0;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 20px;
  overflow: hidden;
}

.chat-view {
  height: 100%;
  min-height: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: grid-template-columns 220ms ease;
}

.workspace-grid.is-history-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.history-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 280px;
  height: 100%;
  max-height: none;
  padding: 22px 14px 16px;
  overflow: hidden;
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 160ms ease, transform 220ms ease;
}

.workspace-grid.is-history-collapsed .history-panel {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-100%);
}

.history-backdrop {
  display: none;
}

.panel-heading,
.editor-header,
.routing-heading-row,
.selected-files-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  padding: 0 6px 14px;
}

.panel-actions,
.conversation-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-close-button {
  width: 40px;
  height: 40px;
}

.eyebrow {
  margin-bottom: 3px;
}

.panel-heading h2,
.routing-heading-row h2,
.editor-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.history-empty {
  margin: 26px 10px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.history-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  list-style: none;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  min-height: 66px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.history-item:hover,
.history-item:focus-within,
.history-item.is-active {
  background: var(--surface);
  border-color: var(--border);
}

.history-item.is-active {
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.history-item.is-active .history-open strong {
  color: var(--primary-800);
}

.history-open {
  display: grid;
  min-width: 0;
  padding: 10px 4px 10px 12px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.history-open strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-open > span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
}

.history-status {
  overflow: hidden;
  color: var(--primary-700);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-status[data-status="failed"],
.history-status[data-status="cancelled"] {
  color: var(--error);
}

.history-actions {
  position: relative;
  z-index: 2;
}

.history-menu-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border-radius: 9px;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.history-menu-button:hover,
.history-menu-button[aria-expanded="true"] {
  color: var(--primary-800);
  background: var(--primary-100);
}

.history-menu {
  position: absolute;
  z-index: 20;
  top: 39px;
  right: 0;
  width: max-content;
  min-width: 154px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.history-menu-delete {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  color: var(--error);
  background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.history-menu-delete:hover {
  background: #fff2f2;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--primary-600);
}

.privacy-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  background: var(--surface);
}

.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(20px, 3vw, 40px) 18px;
  border-bottom: 1px solid var(--border);
}

.conversation-header h1 {
  margin: 0;
  font-size: clamp(21px, 2.3vw, 30px);
  line-height: 1.3;
}

.history-toggle-button {
  flex: 0 0 auto;
}

.routing-panel {
  margin: 16px clamp(20px, 3vw, 40px) 0;
  padding: 20px;
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 15px;
}

.routing-heading-row {
  align-items: flex-start;
  margin-bottom: 16px;
}

.routing-help,
.fieldset-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.routing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.service-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.service-status-list li {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
}

.service-status-list li > span:last-child {
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--warning);
  border-radius: 50%;
}

.status-dot.is-ready {
  background: var(--success);
}

.status-dot.is-error {
  background: var(--error);
}

.routing-panel .inline-message {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.conversation-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  -webkit-overflow-scrolling: touch;
}

.conversation {
  flex: 1 0 auto;
  min-height: 0;
  padding: 26px clamp(20px, 4vw, 64px);
}

.conversation-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 560px);
  min-height: 120px;
  gap: 14px;
  margin: clamp(28px, 9vh, 96px) auto 24px;
  padding: 24px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.conversation-notice.is-error {
  flex-direction: column;
  color: var(--error);
  background: #fff5f5;
  border-color: #f1d6d6;
}

.conversation-notice p {
  margin: 0;
}

.welcome-card {
  display: flex;
  max-width: 760px;
  gap: 18px;
  margin: clamp(28px, 8vh, 90px) auto 24px;
  padding: 28px;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 18px;
}

.welcome-card h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.welcome-card p {
  color: var(--text-secondary);
}

.assistant-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  color: white;
  background: var(--primary-700);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}

.assistant-avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 11px;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-list button {
  min-height: 40px;
  padding: 0 13px;
  color: var(--primary-800);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.suggestion-list button:hover {
  background: var(--primary-100);
  border-color: var(--primary-200);
}

.job-exchange {
  max-width: 880px;
  margin: 0 auto 34px;
}

.message {
  display: flex;
  gap: 14px;
}

.message-user {
  align-items: flex-start;
  justify-content: flex-end;
  width: 100%;
  margin: 0 0 24px auto;
}

.user-message-bubble {
  display: grid;
  width: min(calc(82% - 52px), 680px);
  padding: 15px 18px;
  background: var(--primary-700);
  border-radius: 16px 16px 4px;
}

.message-user .message-label {
  color: rgba(255, 255, 255, 0.74);
}

.message-label {
  font-size: 12px;
  font-weight: 600;
}

.message-text {
  margin: 3px 0 0;
  color: white;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.message-files li {
  padding: 4px 8px;
  color: var(--primary-900);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 7px;
  font-size: 12px;
}

.message-upload-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 9px;
  margin-top: 11px;
}

.artifact-image-card {
  display: grid;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.artifact-image-card.is-compact {
  color: var(--primary-900);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
}

.artifact-image {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: var(--surface-soft);
}

.artifact-image-card.is-compact .artifact-image {
  max-height: 260px;
}

.artifact-image.is-loading {
  min-height: 150px;
  background:
    linear-gradient(
      100deg,
      var(--surface-soft) 30%,
      var(--primary-50) 50%,
      var(--surface-soft) 70%
    );
  background-size: 240% 100%;
  animation: artifact-image-loading 1.25s ease-in-out infinite;
}

.artifact-image.is-error {
  display: none;
}

.artifact-image-fallback {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 16px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  font-size: 13px;
  text-align: center;
}

.artifact-image-card figcaption {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: var(--text-secondary);
  font-size: 12px;
}

.artifact-image-card figcaption > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-image-card figcaption small {
  flex: 0 0 auto;
}

.artifact-image-card figcaption .artifact-download-button {
  margin-left: auto;
}

.response-artifacts {
  margin-top: 18px;
}

.response-artifacts h3 {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.response-artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}

.artifact-file-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.artifact-file-card > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.artifact-file-card strong,
.artifact-file-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-file-card small {
  color: var(--text-secondary);
}

.artifact-download-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  color: var(--primary-800);
  background: var(--surface);
  border: 1px solid var(--primary-200);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.artifact-download-button:hover:not(:disabled) {
  background: var(--primary-50);
}

.artifact-download-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@keyframes artifact-image-loading {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.message-assistant {
  align-items: flex-start;
}

.message-profile-avatar {
  flex: 0 0 auto;
}

.user-profile-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: var(--primary-700);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.assistant-profile-logo {
  width: 42px;
  height: auto;
  object-fit: contain;
  overflow: visible;
  background: transparent;
}

.assistant-body {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.assistant-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.assistant-message-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.answer-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  gap: 6px;
  padding: 0 10px;
  color: var(--primary-700);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease,
    border-color 160ms ease, transform 160ms ease;
}

.answer-copy-button:hover:not(:disabled) {
  color: var(--primary-800);
  background: var(--primary-100);
  border-color: var(--primary-200);
}

.answer-copy-button:active:not(:disabled) {
  transform: scale(0.97);
}

.answer-copy-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.copy-button-icon {
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}

.job-status {
  color: var(--text-muted);
  font-size: 12px;
}

.job-status[data-status="succeeded"] {
  color: var(--success);
}

.job-status[data-status="failed"],
.job-status[data-status="cancelled"] {
  color: var(--error);
}

.job-progress {
  width: 100%;
  height: 3px;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 4px;
}

.job-progress > span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary-500);
  transition: width 300ms ease;
}

.job-progress.is-active > span {
  min-width: 32px;
  overflow: hidden;
}

.job-progress.is-active > span::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.75),
    transparent
  );
  transform: translateX(-100%);
  animation: progress-shimmer 1.35s ease-in-out infinite;
}

.job-progress.is-complete > span {
  background: var(--success);
}

.job-progress.is-error > span {
  background: var(--error);
}

.job-route {
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.answer-text {
  color: var(--text);
  line-height: 1.78;
  white-space: normal;
  overflow-wrap: break-word;
}

.answer-content {
  display: grid;
  min-width: 0;
  gap: 16px;
}

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

.answer-paragraph {
  margin: 0;
  overflow-wrap: anywhere;
}

.answer-heading {
  margin: 10px 0 0;
  color: var(--primary-900);
  font-size: 18px;
  line-height: 1.45;
}

h4.answer-heading {
  font-size: 16px;
}

.answer-heading-level-3,
.answer-heading-level-4,
.answer-heading-level-5,
.answer-heading-level-6 {
  font-size: 15px;
}

.answer-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 24px;
}

.answer-list li {
  padding-left: 3px;
  overflow-wrap: anywhere;
}

.answer-list .answer-list {
  margin-top: 7px;
}

.answer-task-item {
  list-style: none;
}

.answer-task-item > input {
  width: 15px;
  height: 15px;
  margin: 0 8px 0 -22px;
  vertical-align: -2px;
  accent-color: var(--primary-700);
}

.answer-quote {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px 15px;
  color: var(--text-secondary);
  background: var(--primary-50);
  border-left: 3px solid var(--primary-300);
  border-radius: 0 10px 10px 0;
}

.answer-content hr {
  width: 100%;
  margin: 3px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.answer-inline-code {
  padding: 2px 5px;
  color: var(--primary-900);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 5px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  white-space: break-spaces;
}

.answer-inline-script {
  font-size: 0.72em;
  line-height: 0;
}

.answer-link {
  color: var(--primary-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary-500) 52%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.answer-link:hover {
  color: var(--primary-900);
  text-decoration-color: currentColor;
}

.answer-math {
  max-width: 100%;
  color: var(--primary-950);
  font-family: "Cambria Math", "STIX Two Math", "DejaVu Serif", serif;
  font-variant-numeric: lining-nums;
  line-height: 1.4;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.answer-math-inline {
  display: inline-flex;
  align-items: center;
  overflow: visible;
  vertical-align: middle;
}

.answer-math-block {
  display: block;
  width: 100%;
  padding: 9px 4px 11px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  text-align: center;
  scrollbar-width: thin;
}

.answer-math-fallback {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
  white-space: pre;
}

.answer-math-scripts {
  display: inline-grid;
  grid-template-rows: auto auto;
  grid-template-columns: max-content;
  align-items: center;
  justify-items: start;
  margin-inline: 0.02em 0.08em;
  line-height: 1;
}

.answer-math-scripts.is-paired {
  vertical-align: 0.48em;
}

.answer-math-scripts.is-sup-only {
  display: inline-flex;
  vertical-align: 0.48em;
}

.answer-math-scripts.is-sub-only {
  display: inline-flex;
  vertical-align: -0.24em;
}

.answer-math-sup,
.answer-math-sub {
  position: static;
  display: block;
  font-size: 0.72em;
  line-height: 1;
}

.answer-math-sup {
  grid-row: 1;
}

.answer-math-sub {
  grid-row: 2;
}

.answer-math-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: stretch;
  justify-items: stretch;
  margin: 0 0.18em;
  padding-block: 0.12em;
  text-align: center;
  line-height: 1.15;
  vertical-align: middle;
}

.answer-math-numerator {
  min-width: 1.1em;
  padding: 0.08em 0.24em 0.16em;
  border-bottom: 1px solid currentColor;
}

.answer-math-denominator {
  min-width: 1.1em;
  padding: 0.16em 0.24em 0.08em;
}

.answer-math-root {
  display: inline-flex;
  align-items: flex-start;
}

.answer-math-root-degree {
  margin-right: -0.08em;
  font-size: 0.55em;
  transform: translateY(-0.2em);
}

.answer-math-radical {
  font-size: 1.15em;
  line-height: 1.2;
}

.answer-math-radicand {
  padding: 0 0.12em;
  border-top: 1px solid currentColor;
}

.answer-math-matrix {
  display: inline-flex;
  align-items: stretch;
  margin: 0 0.18em;
  padding-block: 0.12em;
  vertical-align: middle;
}

.answer-math-matrix-grid {
  display: inline-grid;
  grid-template-columns: repeat(var(--answer-math-columns), max-content);
  align-items: center;
  align-content: center;
  gap: 0.42em 0.82em;
  padding: 0.24em 0.34em;
}

.answer-math-matrix-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
  min-height: 1.3em;
  padding-block: 0.04em;
  line-height: 1.2;
  text-align: center;
}

.answer-math-matrix-delimiter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  font-size: 1.65em;
  font-weight: 300;
  line-height: 1;
}

.answer-math-matrix-bmatrix > .answer-math-matrix-delimiter,
.answer-math-matrix-pmatrix > .answer-math-matrix-delimiter,
.answer-math-matrix-vmatrix > .answer-math-matrix-delimiter,
.answer-math-matrix-Vmatrix > .answer-math-matrix-delimiter {
  width: 0.36rem;
  border-color: currentColor;
  font-size: 0;
}

.answer-math-matrix-bmatrix > .answer-math-matrix-delimiter {
  border-block: 1.5px solid currentColor;
}

.answer-math-matrix-bmatrix > .answer-math-matrix-delimiter:first-child {
  border-inline-start: 1.5px solid currentColor;
}

.answer-math-matrix-bmatrix > .answer-math-matrix-delimiter:last-child {
  border-inline-end: 1.5px solid currentColor;
}

.answer-math-matrix-pmatrix > .answer-math-matrix-delimiter:first-child {
  border-inline-start: 1.5px solid currentColor;
  border-radius: 50% 0 0 50%;
}

.answer-math-matrix-pmatrix > .answer-math-matrix-delimiter:last-child {
  border-inline-end: 1.5px solid currentColor;
  border-radius: 0 50% 50% 0;
}

.answer-math-matrix-vmatrix > .answer-math-matrix-delimiter {
  width: 0.16rem;
}

.answer-math-matrix-vmatrix > .answer-math-matrix-delimiter:first-child {
  border-inline-start: 1.5px solid currentColor;
}

.answer-math-matrix-vmatrix > .answer-math-matrix-delimiter:last-child {
  border-inline-end: 1.5px solid currentColor;
}

.answer-math-matrix-Vmatrix > .answer-math-matrix-delimiter {
  width: 0.24rem;
}

.answer-math-matrix-Vmatrix > .answer-math-matrix-delimiter:first-child {
  border-inline-start: 3px double currentColor;
}

.answer-math-matrix-Vmatrix > .answer-math-matrix-delimiter:last-child {
  border-inline-end: 3px double currentColor;
}

.answer-math-matrix-cases > .answer-math-matrix-delimiter {
  display: grid;
  grid-template-rows: auto minmax(0.14em, 1fr) auto minmax(0.14em, 1fr) auto;
  align-items: stretch;
  width: 0.72em;
  overflow: hidden;
  font-size: 1.12em;
  line-height: 0.55;
}

.answer-math-cases-piece {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0.55em;
}

.answer-math-cases-piece.is-extension {
  position: relative;
  min-height: 0;
}

.answer-math-cases-piece.is-extension::before {
  position: absolute;
  inset-block: -0.16em;
  inset-inline-start: 50%;
  border-inline-start: 1.25px solid currentColor;
  content: "";
}

.answer-math-operator {
  margin: 0 0.08em;
  font-family: inherit;
  font-style: normal;
}

.answer-math-overset,
.answer-math-underset {
  display: inline-grid;
  grid-template-rows: auto auto;
  justify-items: center;
  margin: 0 0.08em;
  vertical-align: middle;
}

.answer-math-stack-annotation {
  position: static;
  font-size: 0.66em;
  line-height: 1;
}

.answer-math-stack-base {
  line-height: 1.1;
}

.answer-math-mathbf,
.answer-math-boldsymbol {
  font-weight: 700;
}

.answer-math-mathit {
  font-style: italic;
}

.answer-math-mathcal {
  font-family: cursive;
}

.answer-math-mathtt,
.answer-math-texttt {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.answer-math-overline {
  border-top: 1px solid currentColor;
}

.answer-math-underline {
  border-bottom: 1px solid currentColor;
}

.answer-math-boxed {
  display: inline-block;
  margin: 0.08em 0.12em;
  padding: 0.28em 0.42em;
  border: 1px solid currentColor;
  line-height: 1.2;
  vertical-align: middle;
}

.answer-math-vec::after,
.answer-math-hat::after,
.answer-math-bar::after {
  display: inline-block;
  margin-left: -0.65em;
  transform: translateY(-0.62em);
}

.answer-math-vec::after {
  content: "→";
}

.answer-math-hat::after {
  content: "^";
}

.answer-math-bar::after {
  content: "¯";
}

.answer-code-block {
  min-width: 0;
  overflow: hidden;
  color: #e9f8f5;
  background: #102725;
  border: 1px solid #24413e;
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(16, 39, 37, 0.1);
}

.answer-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  gap: 12px;
  padding: 5px 8px 5px 14px;
  color: #b9d8d3;
  background: #183431;
  border-bottom: 1px solid #2a4945;
}

.answer-code-language {
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-copy-button {
  min-height: 30px;
  color: #d8eeea;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.13);
}

.code-copy-button:hover:not(:disabled) {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.answer-code-scroll,
.answer-table-scroll {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  -webkit-overflow-scrolling: touch;
}

.answer-code-scroll::-webkit-scrollbar,
.answer-table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.answer-code-scroll::-webkit-scrollbar-track,
.answer-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.answer-code-scroll::-webkit-scrollbar-thumb,
.answer-table-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.answer-code-scroll pre {
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 17px 18px 19px;
}

.answer-code-scroll code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}

.answer-table-scroll {
  border: 1px solid var(--border);
  border-radius: 11px;
}

.answer-table-scroll table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
}

.answer-table-scroll th,
.answer-table-scroll td {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.answer-table-scroll th {
  color: var(--primary-900);
  background: var(--primary-50);
  font-weight: 700;
}

.answer-table-scroll tr:last-child td {
  border-bottom: 0;
}

.answer-table-scroll :is(th, td):last-child {
  border-right: 0;
}

.answer-plain-fallback {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.answer-render-notice {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 12px;
  font-weight: 700;
}

.answer-text.is-waiting {
  color: var(--text-muted);
  white-space: pre-wrap;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text-secondary);
}

.loading-state p {
  margin: 0;
}

.loading-dots {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  background: var(--primary-500);
  border-radius: 50%;
  animation: thinking-dot 1.15s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.loading-dots span:nth-child(3) {
  animation-delay: 280ms;
}

.queue-position {
  width: max-content;
  margin: 9px 0 0;
  padding: 5px 9px;
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.answer-text.is-error {
  padding: 12px 14px;
  color: var(--error);
  background: #fff5f5;
  border: 1px solid #f1d6d6;
  border-radius: 10px;
  white-space: pre-wrap;
}

.clipboard-helper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.composer {
  flex: 0 0 auto;
  margin: 0 clamp(20px, 4vw, 64px) 22px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  box-shadow: 0 12px 38px rgba(19, 61, 60, 0.09);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.composer:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 12px 38px rgba(19, 61, 60, 0.09),
    0 0 0 4px rgba(39, 139, 134, 0.1);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 74px;
  max-height: 180px;
  padding: 4px 6px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  font-size: 17px;
  line-height: 1.7;
}

.composer textarea::placeholder {
  color: var(--text-muted);
}

.file-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 7px;
  padding: 0 12px;
  color: var(--primary-800);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.file-button:hover {
  background: var(--primary-100);
  border-color: var(--primary-200);
}

.file-button svg {
  width: 18px;
  height: 18px;
}

.prompt-count {
  color: var(--text-muted);
  font-size: 12px;
}

.send-button {
  min-height: 46px;
  padding: 0 19px;
}

.send-button:disabled {
  color: #b6c4c1;
  background: var(--surface-soft);
  border-color: var(--border);
  cursor: not-allowed;
}

.composer-message {
  min-height: 0;
  margin: 7px 5px 0;
}

.selected-files {
  margin-bottom: 10px;
  padding: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.selected-files-heading strong {
  font-size: 13px;
}

.selected-files ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.selected-files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.selected-files li > span {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.selected-files li strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-files li small {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.text-button,
.file-remove {
  color: var(--primary-700);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.file-remove {
  color: var(--error);
}

/* Administrator */

.users-view {
  height: 100%;
  min-height: 0;
  width: min(100%, 1400px);
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 4px 24px;
}

.section-header h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.3;
}

.section-header > div > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
}

.user-management-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: calc(100svh - 205px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.users-panel {
  min-width: 0;
  padding: 22px 14px;
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
}

.users-panel .inline-message {
  margin: 2px 8px 10px;
  color: var(--text-muted);
}

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

.users-list button {
  display: grid;
  width: 100%;
  min-height: 88px;
  gap: 4px;
  padding: 12px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.users-list button:hover,
.users-list button.is-selected {
  background: var(--surface);
  border-color: var(--border);
}

.users-list button.is-selected {
  box-shadow: inset 3px 0 var(--primary-500);
}

.user-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.role-badge,
.account-state {
  width: max-content;
  padding: 2px 7px;
  color: var(--primary-700);
  background: var(--primary-100);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.is-admin {
  color: #72501c;
  background: #fff2d7;
}

.user-assignment {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-state.is-enabled {
  color: var(--success);
  background: #e9f6ef;
}

.account-state.is-disabled {
  color: var(--error);
  background: #fff1f1;
}

.user-editor {
  min-width: 0;
  padding: clamp(22px, 4vw, 44px);
  overflow-y: auto;
}

.editor-placeholder {
  display: grid;
  min-height: 420px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.editor-placeholder h2 {
  margin: 18px 0 5px;
}

.editor-placeholder p {
  max-width: 430px;
  color: var(--text-secondary);
}

.user-form {
  display: grid;
  gap: 22px;
}

.editor-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.form-section {
  min-width: 0;
  margin: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.form-section legend {
  padding: 0 8px;
  color: var(--primary-800);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.switch-field {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 9px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.switch-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-600);
}

.switch-field span {
  display: grid;
}

.switch-field small {
  color: var(--text-muted);
}

.routing-fieldset .fieldset-description {
  margin: -3px 0 16px;
}

.fallback-field {
  margin-top: 16px;
}

.editor-message {
  margin: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.form-actions .button-danger {
  margin-right: auto;
}

.install-offer {
  position: fixed;
  z-index: 850;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  width: min(520px, calc(100% - 40px));
  gap: 18px;
  padding: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.install-offer-copy {
  flex: 1;
  min-width: 0;
}

.install-offer-copy strong {
  color: var(--primary-900);
  font-size: 16px;
}

.install-offer-copy p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.install-offer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.install-app-button {
  min-height: 42px;
  padding: 0 15px;
  font-size: 13px;
}

.install-dismiss-button {
  width: 40px;
  height: 40px;
}

.toast-region {
  position: fixed;
  z-index: 950;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100% - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: white;
  background: var(--primary-800);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
}

.toast.is-error {
  background: var(--error);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes boot-progress {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(340%);
  }
}

@keyframes progress-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes thinking-dot {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (max-width: 1100px) {
  .landing-links {
    gap: 20px;
  }

  .capability-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr auto 1fr;
  }

  .account-summary div,
  .topbar-brand span {
    display: none;
  }

  .routing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
    padding-right: 24px;
    padding-left: 24px;
  }

  .landing-links {
    display: none;
  }

  .landing-actions {
    grid-column: 2;
  }

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

  .workspace-grid.is-history-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .history-panel {
    width: 230px;
  }

  .user-management-grid {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --app-topbar-height: calc(66px + env(safe-area-inset-top, 0px));
  }

  :where(
    .landing-composer textarea,
    .login-dialog,
    .history-list,
    .conversation-scroll,
    .composer textarea,
    .users-view,
    .user-editor,
    .users-list
  )::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  :where(.history-list, .conversation-scroll) {
    scrollbar-gutter: auto;
  }

  :where(
    .landing-composer textarea,
    .login-dialog,
    .history-list,
    .conversation-scroll,
    .composer textarea,
    .users-view,
    .user-editor,
    .users-list
  )::-webkit-scrollbar-thumb {
    border-width: 2px;
  }

  .landing-hero {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .landing-nav {
    padding: 18px 20px 12px;
  }

  .landing-brand img {
    width: 41px;
  }

  .landing-brand span {
    font-size: 16px;
  }

  .landing-start {
    display: none;
  }

  .landing-actions .button {
    min-height: 44px;
    padding: 0 12px;
  }

  .hero-content {
    padding: 4px 0 8px;
  }

  .product-label {
    margin-bottom: clamp(6px, 1.2vh, 12px);
    font-size: 13px;
  }

  .hero-content h1 {
    margin-bottom: clamp(8px, 1.5vh, 14px);
    font-size: clamp(36px, 10vw, 48px);
  }

  .hero-description {
    margin-bottom: clamp(10px, 2vh, 20px);
  }

  .desktop-copy {
    display: none;
  }

  .mobile-copy {
    display: inline;
  }

  .landing-composer {
    width: calc(100vw - 32px);
    min-height: 0;
    padding: 14px 17px 12px;
    border-radius: 28px;
  }

  .landing-composer textarea {
    min-height: clamp(70px, 10vh, 90px);
    padding-right: 4px;
    padding-left: 4px;
  }

  .landing-composer-toolbar {
    gap: 9px;
  }

  .landing-attachment > span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .landing-send-button {
    width: 50px;
    padding: 0;
  }

  .landing-send-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .landing-section {
    width: min(100% - 32px, 680px);
    padding: 76px 0;
  }

  .capability-grid,
  .steps-list {
    grid-template-columns: 1fr;
  }

  .capability-card {
    padding: 22px 20px;
  }

  .how-section {
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
  }

  .steps-list {
    gap: 8px;
  }

  .steps-list li {
    padding: 10px 8px;
  }

  .steps-list li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -6px;
    left: 28px;
    width: 1px;
    height: 18px;
  }

  .login-dialog {
    padding: 24px;
  }

  .login-dialog-brand {
    margin-bottom: 18px;
  }

  .login-dialog h2 {
    font-size: 24px;
  }

  .app-main {
    padding: 0;
  }

  .install-offer {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    width: auto;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .install-offer-actions {
    align-items: flex-start;
  }

  .install-app-button {
    min-height: 40px;
    padding: 0 12px;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    min-height: var(--app-topbar-height);
    padding: calc(8px + env(safe-area-inset-top, 0px))
      max(14px, env(safe-area-inset-right, 0px)) 8px
      max(14px, env(safe-area-inset-left, 0px));
  }

  .topbar-brand img {
    width: 42px;
  }

  .topbar-brand strong {
    display: none;
  }

  .main-nav {
    justify-self: center;
  }

  .nav-button {
    min-height: 38px;
    padding: 0 10px;
  }

  .nav-button svg {
    display: none;
  }

  .account-summary {
    display: none;
  }

  .logout-button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }

  .workspace-grid {
    position: relative;
    display: block;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .history-panel {
    position: fixed;
    z-index: 120;
    top: var(--app-topbar-height);
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    height: auto;
    max-height: none;
    padding: 18px 14px max(16px, env(safe-area-inset-bottom));
    background: var(--surface-soft);
    border: 0;
    border-right: 1px solid var(--border);
    box-shadow: 18px 0 48px rgba(9, 31, 30, 0.16);
  }

  .history-backdrop {
    position: fixed;
    z-index: 110;
    inset: var(--app-topbar-height) 0 0;
    display: block;
    padding: 0;
    background: rgba(9, 31, 30, 0.34);
    cursor: pointer;
    opacity: 1;
    transition: opacity 200ms ease;
  }

  .workspace-grid.is-history-collapsed .history-backdrop {
    pointer-events: none;
    opacity: 0;
  }

  .history-panel .panel-heading {
    padding-bottom: 14px;
  }

  .history-panel .panel-heading h2 {
    font-size: 20px;
  }

  .history-empty {
    margin: 26px 10px;
    text-align: center;
  }

  .history-list {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .history-item {
    flex: 0 0 auto;
  }

  .new-chat-button {
    position: static;
  }

  .conversation-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding-top: 0;
  }

  .conversation-header {
    padding: 13px max(14px, env(safe-area-inset-right, 0px)) 13px
      max(14px, env(safe-area-inset-left, 0px));
  }

  .conversation-header .eyebrow {
    display: none;
  }

  .conversation-header h1 {
    overflow: hidden;
    font-size: clamp(17px, 4.8vw, 20px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .conversation-header .button {
    min-height: 40px;
    padding: 0 11px;
    font-size: 12px;
  }

  .routing-panel {
    margin: 12px 16px 0;
  }

  .routing-heading-row {
    display: block;
  }

  .routing-help {
    margin-top: 6px;
  }

  .conversation {
    padding: 18px 16px;
  }

  .welcome-card {
    margin-top: 16px;
    padding: 20px;
  }

  .welcome-card .assistant-avatar {
    display: none;
  }

  .message-user {
    width: 100%;
    gap: 9px;
  }

  .user-message-bubble {
    width: min(calc(88% - 43px), 680px);
  }

  .message-assistant {
    gap: 9px;
  }

  .user-profile-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .assistant-profile-logo {
    width: 34px;
  }

  .answer-code-scroll pre {
    padding: 14px 15px 16px;
  }

  .answer-code-scroll code {
    font-size: 12.5px;
  }

  .composer {
    margin: 0 max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
  }

  .composer-tools {
    gap: 6px;
  }

  .prompt-count {
    display: none;
  }

  .send-button {
    width: 46px;
    padding: 0;
  }

  .send-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .section-header {
    align-items: stretch;
    padding: 22px 16px;
  }

  .section-header .button {
    flex: 0 0 auto;
  }

  .user-management-grid {
    display: block;
    min-height: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .users-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .users-list {
    display: flex;
    overflow-x: auto;
  }

  .users-list li {
    flex: 0 0 250px;
  }

  .user-editor {
    padding: 20px 16px;
  }

  .editor-placeholder {
    min-height: 300px;
  }
}

@media (max-width: 420px) {
  .landing-brand span {
    display: none;
  }

  .landing-attachment > span {
    display: none;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .login-dialog {
    padding: 22px 20px;
  }

  .login-dialog-brand img {
    width: 52px;
  }

  .welcome-card {
    padding: 18px;
  }

  .suggestion-list {
    display: grid;
  }

  .file-button span {
    display: none;
  }

  .copy-answer-button .copy-button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .copy-answer-button {
    width: 34px;
    padding: 0;
  }

  .section-header {
    display: grid;
  }

  .section-header .button {
    width: 100%;
  }
}

@media (max-height: 700px) {
  .hero-content {
    padding-top: 4px;
  }

  .product-label {
    margin-bottom: 10px;
  }

  .hero-content h1 {
    margin-bottom: 12px;
  }

  .hero-description {
    margin-bottom: 18px;
  }
}

@media (max-height: 700px) and (min-width: 600px) and (orientation: landscape) {
  .landing-nav {
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .landing-brand img {
    width: 42px;
  }

  .landing-actions .button {
    min-height: 42px;
  }

  .hero-content {
    display: grid;
    grid-template-areas:
      "logo composer"
      "label composer"
      "heading composer"
      "description composer";
    grid-template-columns: minmax(0, 0.9fr) minmax(350px, 1.1fr);
    align-content: center;
    align-items: center;
    column-gap: clamp(22px, 4vw, 56px);
    width: min(100% - 48px, 1160px);
    padding: 0 0 10px;
    text-align: left;
  }

  .hero-content > :where(.hero-logo) {
    grid-area: logo;
    justify-self: center;
    margin-bottom: 4px;
  }

  .product-label {
    grid-area: label;
    justify-self: center;
    margin-bottom: 6px;
  }

  .hero-content h1 {
    grid-area: heading;
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 43px);
    text-align: center;
  }

  .hero-description {
    grid-area: description;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
  }

  .landing-composer {
    grid-area: composer;
    align-self: center;
    width: 100%;
  }

  .landing-composer textarea {
    min-height: clamp(60px, 17vh, 78px);
  }

  .hero-login-note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .boot-progress span {
    width: 100%;
    animation: none !important;
    opacity: 0.55;
  }
}
