@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --field: oklch(0.22 0.018 250);
  --ink: oklch(0.92 0.014 250);
  --composer-placeholder: oklch(0.58 0.014 250);
  --syntax-field: oklch(0.255 0.028 250);
  --syntax-normal: oklch(0.92 0.014 250);
  --syntax-structural: oklch(0.78 0.055 235);
  --syntax-quiet: oklch(0.58 0.04 235);
  --shader-quiet: oklch(0.44 0.055 225);
  --shader-structural: oklch(0.62 0.075 220);
  --shader-deep: oklch(0.18 0.024 250);
  --shader-core: oklch(0.28 0.045 235);
  --shader-warm-edge: oklch(0.32 0.04 205);
  --shader-cool-edge: oklch(0.25 0.045 265);
  --accent: oklch(0.48 0.13 245);
  --assistant-bubble: oklch(0.28 0.024 250);
  --bubble-radius: 0.9rem;
  --line: 1.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  background: var(--field);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 24rem;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: var(--line);
}

button,
select,
textarea,
input {
  border-radius: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 400;
}

button,
select,
textarea,
input {
  color: var(--ink);
  background: var(--field);
}

button,
.file-button {
  min-height: var(--line);
}

button,
.file-button {
  padding: 0 2ch;
  cursor: pointer;
  text-transform: uppercase;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
.file-button:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 0.25rem;
}

button:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


h1,
h2,
p,
ol,
ul,
dl,
dd,
dt,
pre,
blockquote,
table {
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 400;
}

h1,
h2,
label,
dt {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--field);
  pointer-events: none;
}

.application-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: calc(3 * var(--line)) minmax(0, 1fr) calc(3 * var(--line));
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.top-bar,
.footer-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 3ch;
  color: var(--ink);
  text-transform: uppercase;
}

.top-title {
  letter-spacing: 0.08em;
  text-align: center;
}

.top-slot-right {
  text-align: right;
}

.mobile-menu {
  visibility: hidden;
  pointer-events: none;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 0;
}

.mobile-menu-mark {
  display: grid;
  gap: 0.35rem;
  width: 1.25rem;
}

.mobile-menu-mark span {
  height: 2px;
  background: var(--ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* The open state presents a cross, so the same control reads as the
   close action while the sidebar covers the interface. */
.mobile-menu[aria-expanded="true"] .mobile-menu-mark span:nth-child(1) {
  transform: translateY(calc(0.35rem + 2px)) rotate(45deg);
}

.mobile-menu[aria-expanded="true"] .mobile-menu-mark span:nth-child(2) {
  opacity: 0;
}

.mobile-menu[aria-expanded="true"] .mobile-menu-mark span:nth-child(3) {
  transform: translateY(calc(-0.35rem - 2px)) rotate(-45deg);
}

.mobile-scrim {
  display: none;
}

.mobile-sidebar {
  display: contents;
}

.mobile-account {
  display: none;
}

.application-body {
  display: grid;
  grid-template-columns: minmax(24ch, 29ch) minmax(40ch, 1fr) minmax(24ch, 29ch);
  min-height: 0;
}

.history-region {
  grid-column: 1;
  grid-row: 1;
}

.workspace {
  grid-column: 2;
  grid-row: 1;
}

.control-region {
  grid-column: 3;
  grid-row: 1;
}

.history-region,
.control-region {
  min-width: 0;
  padding: 0 2ch var(--line);
}

.history-region {
  padding-right: 0;
}

.history-region {
  display: flex;
  flex-direction: column;
}

.region-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--line);
}

.region-note {
  margin-top: auto;
  padding-top: calc(2 * var(--line));
}

.conversation-list {
  display: grid;
  padding: var(--line) 0;
  list-style: none;
}


.conversation-link {
  display: block;
  margin: 0 -1ch;
  padding: 0 1ch;
  color: var(--ink);
  background: var(--field);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.conversation-link:hover,
.conversation-link[aria-current="page"] {
  color: var(--field);
  background: var(--ink);
}


.workspace {
  position: relative;
  display: grid;
  grid-template-rows: minmax(12rem, 1fr) auto;
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - 6 * var(--line));
  overflow: hidden;
  background: var(--field);
  border: 1px solid var(--ink);
}

.empty-state {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--line);
  min-height: 100%;
  text-align: center;
}

.empty-state-label {
  color: var(--syntax-quiet);
  letter-spacing: 0.06em;
}

.empty-state-suggestion {
  max-width: 60ch;
  padding: calc(0.5 * var(--line)) 2ch;
  color: var(--ink);
  text-transform: none;
  background: var(--assistant-bubble);
  border: 1px solid var(--syntax-quiet);
  border-radius: var(--bubble-radius);
  cursor: pointer;
}

.empty-state-suggestion:hover,
.empty-state-suggestion:focus-visible {
  border-color: var(--ink);
}

.workspace > .transcript,
.workspace > .composer {
  position: relative;
  z-index: 1;
}


.transcript {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: var(--line) 3ch calc(2 * var(--line));
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}


.turn {
  display: grid;
  min-width: 0;
}

.turn > * + * {
  margin-top: var(--line);
}

.turn + .turn {
  margin-top: calc(2 * var(--line));
}

/* The last turn fills the transcript viewport, so a new user message can
   always pin to the top and the completed re-render keeps that room. */
.turn:last-of-type {
  min-height: 100%;
}


plot-card {
  display: block;
  max-width: 62ch;
  padding: calc(0.5 * var(--line)) 2ch;
  background: var(--assistant-bubble);
  border-radius: var(--bubble-radius);
}

.plot-surface {
  position: relative;
  overflow: hidden;
  background: var(--shader-deep);
}

.plot-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
}

.plot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-line {
  position: absolute;
  background: var(--shader-quiet);
  opacity: 0.35;
}

.plot-grid-vertical,
.plot-axis-vertical {
  top: 0;
  bottom: 0;
  width: 1px;
}

.plot-grid-horizontal,
.plot-axis-horizontal {
  left: 0;
  right: 0;
  height: 1px;
}

.plot-axis-vertical,
.plot-axis-horizontal {
  background: var(--shader-structural);
  opacity: 0.8;
}

.plot-tick {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  color: var(--shader-structural);
}

.plot-tick-x {
  transform: translateX(-50%);
}

.plot-tick-y {
  transform: translateY(-50%);
}

.plot-caption {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.25 * var(--line)) 2ch;
  align-items: baseline;
  margin-top: calc(0.5 * var(--line));
}

.plot-form {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--syntax-quiet);
}

.plot-formula math {
  font-size: 0.95rem;
}

.plot-note {
  margin: calc(0.25 * var(--line)) 0 0;
  font-size: 11px;
  color: var(--syntax-quiet);
}

.plot-refusal {
  margin: 0;
  padding: var(--line) 2ch;
  border: 1px solid var(--syntax-quiet);
  color: var(--syntax-quiet);
}



.plot-surface {
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.plot-surface:active {
  cursor: grabbing;
}

.plot-expand {
  margin-left: auto;
}

plot-card.plot-card-expanded {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  border-radius: 0;
  background: var(--field);
}

.plot-card-expanded .plot-surface {
  flex: 1;
  min-height: 0;
}

.plot-card-expanded .plot-canvas {
  height: 100%;
  aspect-ratio: auto;
}

.script-source {
  max-width: 88ch;
  padding: calc(0.5 * var(--line)) 2ch;
  overflow-x: auto;
  background: var(--syntax-field);
}

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

.plot-page-link {
  display: inline-block;
  margin-top: calc(0.25 * var(--line));
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
}


.playground-workspace {
  display: block;
  overflow: hidden;
}

.playground-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: var(--line) 3ch;
  overflow-y: auto;
}

.playground-form label {
  display: block;
  color: var(--syntax-quiet);
}

.playground-form textarea {
  width: 100%;
  padding: calc(0.25 * var(--line)) 1ch;
  color: var(--ink);
  background: var(--syntax-field);
  border: none;
  resize: vertical;
}

.playground-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: calc(0.5 * var(--line));
}

.playground-row label {
  margin-right: 1ch;
}

.playground-row input {
  width: 24ch;
  margin-right: 2ch;
  padding: 0 1ch;
  color: var(--ink);
  background: var(--syntax-field);
  border: none;
}

.playground-report {
  margin-top: var(--line);
}

#plot-output {
  margin-top: var(--line);
}

#plot-output plot-card {
  max-width: 72ch;
}

.playground-link {
  color: var(--ink);
}

.conversation-controls {
  display: flex;
  align-items: center;
  gap: calc(0.5 * var(--line));
  padding: 0 2ch;
}

.visibility-toggle,
.save-view-button {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 2px 1ch;
}

.footer-language {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.language-select {
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--syntax-quiet);
  padding: 1px 0.5ch;
}

.script-chip {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  border: 1px solid var(--syntax-quiet);
  padding: 2px 1ch;
  margin-bottom: calc(0.25 * var(--line));
}

.script-row input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--syntax-quiet);
  padding: calc(0.25 * var(--line)) 1ch;
  font: inherit;
}

.top-slot {
  display: flex;
  align-items: center;
}

.top-slot .tertiary-button {
  text-decoration: none;
}

.user-message,
.assistant-message {
  position: relative;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.user-message {
  justify-self: end;
  max-width: 62ch;
  padding: calc(0.5 * var(--line)) 2ch;
  color: var(--ink);
  background: var(--accent);
  border-radius: var(--bubble-radius);
  border-bottom-right-radius: 2px;
}

.user-message::after {
  content: "";
  position: absolute;
  right: -0.45rem;
  bottom: 0;
  width: 0.5rem;
  height: 0.7rem;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.assistant-message {
  justify-self: start;
  max-width: 78ch;
  padding: calc(0.5 * var(--line)) 2ch;
  background: var(--assistant-bubble);
  border-radius: var(--bubble-radius);
  border-bottom-left-radius: 2px;
}

.assistant-message::after {
  content: "";
  position: absolute;
  left: -0.45rem;
  bottom: 0;
  width: 0.5rem;
  height: 0.7rem;
  background: var(--assistant-bubble);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.thinking-indicator {
  justify-self: start;
  position: relative;
  display: inline-flex;
  gap: 0.6ch;
  align-items: center;
  min-height: var(--line);
  padding: calc(0.5 * var(--line)) 2ch;
  background: var(--assistant-bubble);
  border-radius: var(--bubble-radius);
  border-bottom-left-radius: 2px;
}

.thinking-indicator::after {
  content: "";
  position: absolute;
  left: -0.45rem;
  bottom: 0;
  width: 0.5rem;
  height: 0.7rem;
  background: var(--assistant-bubble);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.thinking-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--ink);
  border-radius: 50%;
  opacity: 0.3;
  animation: thinking-pulse 1.2s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

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

  30% {
    opacity: 1;
    transform: translateY(-0.2rem);
  }
}

.turn-failure {
  justify-self: start;
  max-width: 78ch;
  padding: calc(0.5 * var(--line)) 2ch;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  border-radius: var(--bubble-radius);
}

.markdown-message {
  display: grid;
}

.markdown-message > *:not(:first-child) {
  margin-top: var(--line);
}

.markdown-message > :is(h1, h2, h3, h4, h5, h6):not(:first-child) {
  margin-top: calc(2 * var(--line));
}

.markdown-message h1,
.markdown-message h2,
.markdown-message h3,
.markdown-message h4,
.markdown-message h5,
.markdown-message h6 {
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.markdown-message ol,
.markdown-message ul {
  display: grid;
  margin: 0;
  padding-left: 4ch;
}

.markdown-message li + li {
  margin-top: var(--line);
}

.markdown-message blockquote {
  padding-left: 2ch;
  border-left: 1px solid currentColor;
}

.markdown-message a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2rem;
}

.markdown-message code {
  font: inherit;
  font-size: inherit;
  overflow-wrap: anywhere;
}

.markdown-message :not(pre) > code {
  padding: 0 0.5ch;
  color: var(--syntax-structural);
  background: var(--syntax-field);
  border-radius: 0.3rem;
}

.user-message :not(pre) > code {
  color: var(--ink);
  background: rgb(0 0 0 / 0.25);
}

/* Mathematical notation intentionally breaks the one-size home-style rule.
   Formula scale communicates mathematical structure, not interface hierarchy. */
.markdown-math-inline {
  padding: 0 0.3ch;
  font-size: 1.2rem;
}

.markdown-math-display {
  max-width: 100%;
  margin: var(--line) 0;
  overflow-x: auto;
  font-size: 1.5rem;
  text-align: center;
}

/* A measured overlong inline formula moves into a block scroller; an
   inline math box cannot break internally. */
.markdown-math-scroller {
  display: block;
  max-width: 100%;
  margin: calc(0.5 * var(--line)) 0;
  overflow-x: auto;
}

.markdown-message pre,
.execution pre {
  min-width: 0;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-message pre {
  padding: var(--line) 2ch;
  border-radius: calc(var(--bubble-radius) / 2);
}

.execution code {
  font: inherit;
  font-size: inherit;
}

.assistant-message pre {
  color: var(--syntax-normal);
  background: var(--shader-deep);
}

.user-message pre,
.user-message code {
  background: rgb(0 0 0 / 0.25);
}


.markdown-message > * {
  min-width: 0;
}
.syntax-structural {
  color: var(--syntax-structural);
}

.syntax-quiet {
  color: var(--syntax-quiet);
}

.user-message .syntax-structural,
.user-message .syntax-quiet {
  color: var(--ink);
}

.markdown-message table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.markdown-message th,
.markdown-message td {
  padding-right: 2ch;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.user-image {
  display: block;
  max-width: 100%;
  max-height: calc(12 * var(--line));
  margin-bottom: calc(0.5 * var(--line));
  border-radius: calc(var(--bubble-radius) / 2);
}

.user-message .user-image:only-child {
  margin-bottom: 0;
}

.execution {
  display: grid;
  justify-self: start;
  width: 100%;
  max-width: 78ch;
}

.execution > * + * {
  margin-top: calc(0.5 * var(--line));
}

.answer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.5 * var(--line)) 2ch;
}

.execution-error {
  padding: calc(0.5 * var(--line)) 2ch;
  color: var(--syntax-normal);
  background: var(--syntax-field);
  border-left: 3px solid var(--ink);
  border-radius: calc(var(--bubble-radius) / 2);
}

.execution-code summary {
  width: fit-content;
  color: var(--syntax-quiet);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.execution-code summary:hover {
  color: var(--ink);
}

.execution-code[open] > summary {
  margin-bottom: calc(0.5 * var(--line));
}

.execution-code pre {
  margin: 0;
  padding: calc(0.5 * var(--line)) 2ch;
  color: var(--syntax-normal);
  background: var(--syntax-field);
  border-radius: calc(var(--bubble-radius) / 2);
}

.execution code {
  font: inherit;
  font-size: inherit;
}

math-output {
  display: inline-grid;
  min-width: 0;
  max-width: 100%;
  padding: calc(0.5 * var(--line)) 2ch;
  color: var(--ink);
  background: var(--syntax-field);
  border-radius: calc(var(--bubble-radius) / 2);
}

.math-output-title {
  margin: 0;
  color: var(--syntax-quiet);
  overflow-wrap: anywhere;
}

.math-output-presentation {
  display: grid;
  min-width: 0;
  justify-items: start;
}

/* Math output intentionally breaks the one-size home-style rule. Formula
   scale communicates mathematical structure, not interface hierarchy. */
.math-output-presentation math {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-family: inherit;
  font-size: 1.4rem;
}

.composer {
  display: flex;
  flex-direction: column;
  padding: var(--line) 1ch;
  color: var(--field);
  background: var(--ink);
}

.attachment-preview:not([hidden]) + .composer-row {
  margin-top: var(--line);
}


.composer .secondary-button {
  color: var(--field);
  background: var(--ink);
  border-color: var(--field);
}

.composer-row {
  display: flex;
  align-items: center;
}

.composer textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-height: calc(8 * var(--line));
  padding: 0;
  resize: none;
  overflow-y: auto;
  color: var(--field);
  background: var(--ink);
  caret-color: var(--field);
  border: 0;
  outline: 0;
}

/* The user requested a lighter placeholder. This local third colour is limited
   to non-value composer guidance so it cannot become application state. */
.composer textarea::placeholder {
  color: var(--composer-placeholder);
  opacity: 1;
}

.composer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  margin-left: 2ch;
  padding: 0;
  color: var(--ink);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.composer-submit svg {
  display: block;
}

.composer-submit[hidden] {
  display: none;
}

#image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.attachment-preview {
  display: grid;
  grid-template-columns: 12ch 1fr;
  align-items: center;
}

.attachment-preview > :nth-child(2) {
  padding-left: 2ch;
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-preview img {
  width: 12ch;
  height: calc(4 * var(--line));
  object-fit: contain;
  color: var(--field);
  background: var(--ink);
}

.primary-button {
  color: var(--field);
  background: var(--ink);
  border: 0;
}

.primary-button:hover,
.primary-button:focus-visible {
  color: var(--field);
  background: var(--ink);
}

.secondary-button {
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--field);
  background: var(--ink);
}

.tertiary-button {
  color: var(--ink);
  background: var(--field);
  border: 0;
}

.tertiary-button:hover,
.tertiary-button:focus-visible {
  color: var(--field);
  background: var(--ink);
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3ch;
  min-height: var(--line);
  margin-right: 1ch;
  padding: 0;
}

.file-button[aria-disabled="true"] {
  cursor: not-allowed;
  text-decoration: line-through;
}

.account-dialog {
  width: min(72ch, calc(100% - 6ch));
  max-height: calc(100dvh - 4 * var(--line));
  padding: calc(2 * var(--line)) 3ch;
  overflow-y: auto;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
}

.account-dialog::backdrop {
  background: var(--field);
}

.account-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(2 * var(--line));
}

.account-form {
  display: grid;
}

/* The grid display of a form beats the user-agent rule for the hidden
   attribute. The claim dialog hides one form at a time. */
.account-form[hidden] {
  display: none;
}

.account-form > * + * {
  margin-top: var(--line);
}

.account-form + .account-form {
  margin-top: calc(3 * var(--line));
}

.account-form h3 {
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-form input {
  width: 100%;
  min-height: calc(2 * var(--line));
  padding: 0 1ch;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
}

.account-form input:focus {
  color: var(--field);
  background: var(--ink);
}

.account-dialog > .region-note {
  margin-top: calc(2 * var(--line));
}

.control-region {
  display: flex;
  flex-direction: column;
}

.control-region > * + * {
  margin-top: var(--line);
}

.control-region h2:not(:first-child) {
  margin-top: calc(2 * var(--line));
}

.control-region select {
  width: 100%;
  padding: calc(0.5 * var(--line)) 1ch;
  border: 1px solid var(--ink);
}

.control-region progress {
  width: 100%;
  height: var(--line);
  appearance: none;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
}

.control-region progress::-webkit-progress-bar {
  background: var(--field);
}

.control-region progress::-webkit-progress-value {
  background: var(--ink);
}

.control-region progress::-moz-progress-bar {
  background: var(--ink);
}

.footer-account {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: start;
}

.footer-account .tertiary-button {
  min-height: var(--line);
  padding: 0;
}

.footer-account > span {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 2ch;
  padding: calc(0.5 * var(--line)) 1ch;
  color: var(--field);
  background: var(--ink);
  transform: translateY(-120%);
}

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


@media (max-width: 52rem) {
  /* 16px keeps iOS Safari from zooming into focused form controls. */
  :root {
    font-size: 16px;
  }

  .mobile-menu {
    visibility: visible;
    pointer-events: auto;
    justify-self: start;
    margin-left: -0.75rem;
  }

  .mobile-scrim[data-open="true"] {
    position: fixed;
    z-index: 3;
    inset: calc(3 * var(--line)) 0 0 0;
    display: block;
    background: rgb(0 0 0 / 0.45);
  }

  .application-shell {
    grid-template-rows: calc(3 * var(--line)) minmax(0, 1fr);
  }

  .footer-bar {
    display: none;
  }

  .application-body {
    display: block;
    min-height: 0;
  }

  .workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    border: 0;
  }

  .mobile-sidebar {
    position: fixed;
    z-index: 4;
    top: calc(3 * var(--line));
    bottom: 0;
    left: 0;
    width: min(34ch, 90vw);
    display: none;
    flex-direction: column;
    overflow-y: auto;
    color: var(--ink);
    background: var(--field);
    border-right: 1px solid var(--ink);
  }

  .mobile-sidebar[data-open="true"] {
    display: flex;
  }

  .history-region,
  .control-region {
    display: flex;
    grid-column: auto;
  }

  .history-region {
    max-height: 45%;
    overflow-y: auto;
  }

  .control-region > * + * {
    margin-top: var(--line);
  }

  .mobile-account {
    display: block;
    margin-top: auto;
    padding: var(--line) 2ch;
  }


  .user-message {
    max-width: 85%;
  }

  .assistant-message,
  .execution,
  .turn-failure {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-mark span {
    transition: none;
  }

  .transcript {
    scroll-behavior: auto;
  }

  .thinking-dot {
    animation: none;
    opacity: 0.7;
  }
}
