@font-face {
  font-family: "Onest";
  src: url("fonts/onest.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* UZEX's colours: logo green #008346, band navy #023f87, their tape #131927 is the dark ground */
  --green: #008346;
  --green-press: #006b39;
  --blue: #023f87;
  --series: #0a4fa6;  /* data marks: the band's navy at the nearest step that passes the palette check */
  --up: #008346;
  --down: #c1271f;

  --ground: #ffffff;
  --side: #f4f6f9;
  --raised: #f4f6f9;
  --hover: #e9edf3;
  --bubble: #e8eef6;
  --line: #e4e8ee;
  --line-strong: #cdd5df;
  --text: #131927;
  --muted: #566274;
  --fig: #023f87;
  --on-action: #ffffff;
  --scrim: rgb(10 15 25 / .42);
  --floating: 0 6px 24px rgb(19 25 39 / .09), 0 1px 3px rgb(19 25 39 / .06);

  --font: "Onest", system-ui, sans-serif;
  --col: 760px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  --green: #1fb36b;
  --green-press: #199a5b;
  --blue: #6ea8ff;
  --series: #5a93ee;
  --up: #3fce86;
  --down: #ff7a73;

  --ground: #131927;
  --side: #0f1420;
  --raised: #1b2332;
  --hover: #242e40;
  --bubble: #223047;
  --line: #262f40;
  --line-strong: #39455a;
  --text: #eef2f8;
  --muted: #a4afc0;
  --fig: #8fbcff;
  --on-action: #06130c;
  --scrim: rgb(0 0 0 / .55);
  --floating: 0 6px 24px rgb(0 0 0 / .4), 0 1px 3px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ground);
  overscroll-behavior: none;
}

body {
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
  transition: background-color 140ms, color 140ms, transform 140ms;
}

.icon-button:hover { background: var(--hover); color: var(--text); }
.icon-button:active { transform: scale(.92); }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--hover);
}

.seg button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 140ms, color 140ms;
}

.seg button[aria-pressed="true"] { background: var(--ground); color: var(--text); font-weight: 600; }

/* The shell */
.shell {
  position: relative;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: var(--app-h, 100dvh);
  overflow: hidden;
}

.panel-open .shell { grid-template-columns: 272px minmax(0, 1fr) 420px; }
.scrim { display: none; }

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px 12px;
  background: var(--side);
}

.side-top { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side-mark { width: 24px; height: auto; }
.side-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 140ms;
}

.new-chat:hover { background: var(--hover); }

.history { flex: 1; min-height: 0; margin-top: 10px; overflow-y: auto; }
.history-label { padding: 12px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.history-empty { padding: 10px; color: var(--muted); font-size: 13px; line-height: 18px; }

.history-row {
  display: flex;
  align-items: center;
  border-radius: 10px;
  transition: background-color 120ms;
}

.history-row:hover, .history-row.on { background: var(--hover); }

.history-open {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0 4px 0 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.history-row .icon-button { width: 30px; height: 30px; opacity: 0; }
.history-row:hover .icon-button, .history-row .icon-button:focus-visible { opacity: 1; }
.history-row .icon { width: 16px; height: 16px; }

.side-foot { display: grid; gap: 8px; padding-top: 10px; }
.note { min-height: 47px; padding: 2px 6px 0; color: var(--muted); font-size: 11.5px; line-height: 15px; }

/* The chat */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ground);
}

.top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 6px 12px;
}

.top-title {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.only-narrow { display: none; }

.scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.talking .field { display: none; }

/* Empty screen */
.hello {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  max-width: 820px;
  margin-inline: auto;
  padding: 3vh 24px 24px;
  text-align: center;
}

/* The mark opens from its own band: the line draws across, UZ rises out of it, EX drops out of it.
   Then only light runs along the band, so the letters always stay readable */
.hello-mark { width: 46px; height: auto; animation: mark-land 620ms var(--ease) both; }
.mark-band { transform-box: fill-box; transform-origin: left; animation: grow-right 380ms var(--ease) 80ms both; }
.mark-uz { --dy: 24px; animation: mark-open 460ms var(--ease) 220ms both; }
.mark-ex { --dy: -24px; animation: mark-open 460ms var(--ease) 280ms both; }
/* Three sweeps with real gaps: an SVG part animates on the main thread, and a running animation restyles the page every frame even while it holds still */
.hello-mark .mark-glint { animation: mark-glint 1.2s ease-in-out 1.4s, mark-glint 1.2s ease-in-out 7.4s, mark-glint 1.2s ease-in-out 13.4s; }
@keyframes mark-land { from { transform: scale(1.3); } }
@keyframes mark-open { from { transform: translateY(var(--dy)); } }
@keyframes mark-glint { to { transform: translateX(68px); } }

.greet {
  margin-top: 18px;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.coverage { min-height: 23px; margin-top: 10px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.home { width: 100%; margin-top: 20px; }
.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 22px;
  text-align: left;
}

/* The example: a prompt is typed, the page draws what the agent answered to it.
   The rows hold the tallest prompt and reply, or the page below jumps at every change of example */
.demo { display: grid; grid-template-rows: auto minmax(70px, auto) minmax(0, 1fr) auto; min-width: 0; min-height: 401px; padding: 14px; border-radius: 20px; background: var(--raised); }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.demo-title { color: var(--muted); font-size: 13px; font-weight: 500; }
.demo-dots { display: flex; gap: 2px; }
.demo-dots button { position: relative; width: 22px; height: 22px; }
.demo-dots button::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--line-strong); transition: background-color 160ms, transform 160ms; }
.demo-dots button[aria-pressed="true"]::after { background: var(--green); transform: scale(1.25); }
.demo-prompt { justify-self: end; align-self: start; max-width: 92%; min-height: 40px; margin-top: 10px; padding: 8px 14px; border-radius: 18px; background: var(--bubble); font-size: 14.5px; line-height: 22px; overflow-wrap: anywhere; }
.demo-prompt.typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--text); animation: caret 900ms steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.demo-stage { min-height: 0; margin-top: 10px; overflow: hidden; }
.demo-stage .think-line { font-size: 14px; }
.demo-stage .viz { margin: 0; padding: 0; border: 0; background: none; animation: rise 300ms var(--ease) both; }
.demo-stage .hero { font-size: 20px; line-height: 26px; }
.demo-stage .viz-body { margin-top: 8px; }
.demo-stage .chart { min-height: 138px; }
.demo-stage .rank { gap: 8px; }
.demo-stage .tbl-scroll { max-height: none; overflow: hidden; font-size: 13px; }
.demo-stage .tbl-scroll th { background: none; }
.demo-stage .grid { stroke: var(--line-strong); opacity: .6; }
.demo-stage .end, .demo-stage .hover-dot { stroke: var(--raised); }
.demo-ask { justify-self: start; min-height: 36px; margin-top: 10px; padding: 0 14px; border-radius: 999px; background: var(--text); color: var(--ground); font-size: 13.5px; font-weight: 600; transition: transform 140ms, opacity 140ms; }
.demo-ask:hover { opacity: .85; }
.demo-ask:active { transform: scale(.97); }

.starters { min-width: 0; }
.start { color: var(--muted); font-size: 13px; font-weight: 500; }
.suggest { display: grid; gap: 6px; margin-top: 8px; }

.suggestion {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border-radius: 12px;
  background: var(--raised);
  font-size: 13.5px;
  line-height: 18px;
  text-align: left;
  transition: background-color 140ms, transform 140ms;
}

.suggestion:hover { background: var(--hover); }
.suggestion:active { transform: scale(.985); }

.quotes-note { align-self: flex-start; min-height: 20px; margin-top: 22px; color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; }

.quotes {
  display: flex;
  gap: 8px;
  min-height: 104px;
  width: calc(100% + 48px);
  margin: 8px -24px 0;
  padding: 0 24px 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 24px;
  scrollbar-width: none;
}

.quotes::-webkit-scrollbar { display: none; }

.quote {
  flex: none;
  display: grid;
  gap: 2px;
  width: 168px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--raised);
  text-align: left;
  scroll-snap-align: start;
  transition: background-color 140ms, transform 140ms;
}

.quote:hover { background: var(--hover); }
.quote:active { transform: scale(.98); }
.quote-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.quote-name { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.quote-price { font-size: 17px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.delta { flex: none; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta[data-dir="up"] { color: var(--up); }
.delta[data-dir="down"] { color: var(--down); }
.delta[data-dir="flat"] { color: var(--muted); font-weight: 400; }

.spark { display: block; width: 100%; height: 26px; margin-top: 4px; overflow: visible; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark[data-dir="up"] path { stroke: var(--up); }
.spark[data-dir="down"] path { stroke: var(--down); }

/* The conversation */
.thread { max-width: var(--col); margin-inline: auto; padding: 8px 24px 28px; }

.turn { display: flex; flex-direction: column; gap: 18px; padding-top: 14px; }
.turn:last-child { min-height: calc(var(--scroll-h, 100vh) - 40px); }

.user { display: flex; flex-direction: column; align-items: flex-end; animation: rise 260ms var(--ease) both; }

.bubble {
  max-width: min(86%, 620px);
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--bubble);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.user-tools { display: flex; gap: 2px; min-height: 32px; margin-top: 2px; opacity: 0; transition: opacity 140ms; }
.user:hover .user-tools, .user-tools:focus-within { opacity: 1; }
.user-tools .icon-button { width: 30px; height: 30px; }
.user-tools .icon { width: 16px; height: 16px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-left: -4px;
  padding: 2px 8px 2px 4px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 140ms, color 140ms;
}

button.status:hover { background: var(--raised); color: var(--text); }
.status .icon { width: 14px; height: 14px; }
.status-mark { width: 15px; height: auto; }

.answer[data-outcome="twins"] .status { color: #8a5a00; }
[data-theme="dark"] .answer[data-outcome="twins"] .status { color: #ffc266; }
.answer[data-outcome="unavailable"] .status { color: var(--down); }

.lead {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.more { margin-top: 12px; color: var(--muted); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.more .fig { color: inherit; font-weight: 600; }
.fig { color: var(--fig); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rest { opacity: 0; transform: translateY(8px); }
.rest.shown { opacity: 1; transform: none; transition: opacity 280ms var(--ease), transform 280ms var(--ease); }

/* Pictures of the data: blue carries data, green stays for actions */
.viz {
  margin-top: 14px;
  padding: 16px 16px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--ground);
}

.viz-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.viz-head { display: grid; gap: 1px; min-width: 0; }
.hero { font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: 13px; line-height: 18px; }
.viz-top + .viz-body { margin-top: 12px; }
.viz-foot { display: flex; align-items: center; gap: 12px; min-height: 34px; margin-top: 10px; }
.viz-foot .views { margin-left: auto; }

.views { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--raised); }

.views button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  transition: background-color 140ms, color 140ms;
}

.views button:hover { color: var(--text); }
.views button[aria-pressed="true"] { background: var(--hover); color: var(--text); }
.views .icon { width: 17px; height: 17px; }

.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.switch i {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 160ms;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms var(--ease);
}

.switch input:checked + i { background: var(--series); }
.switch input:checked + i::after { transform: translateX(12px); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }

.chart { position: relative; min-height: 214px; touch-action: pan-y; cursor: crosshair; outline-offset: 4px; border-radius: 8px; }
.chart svg { display: block; overflow: visible; }
.grid { stroke: var(--line); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cap { fill: var(--text); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.line { fill: none; stroke: var(--series); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.fade-top { stop-color: var(--series); stop-opacity: .16; }
.fade-end { stop-color: var(--series); stop-opacity: 0; }
.end { fill: var(--series); stroke: var(--ground); stroke-width: 2; }
.cross { stroke: var(--line-strong); stroke-width: 1; }
.hover-dot { fill: var(--series); stroke: var(--ground); stroke-width: 2; }
.bar { fill: var(--series); transition: opacity 120ms; }
.picking .bar { opacity: .35; }
.picking .bar.on { opacity: 1; }

.enter .line { stroke-dasharray: 1; animation: draw 900ms var(--ease) both; }
.enter .area, .enter .end { animation: appear 500ms 420ms ease-out both; }
.enter .bar { transform-box: fill-box; transform-origin: bottom; animation: grow-up 520ms var(--ease) both; }
.enter .cap { animation: appear 400ms 300ms ease-out both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } }
@keyframes grow-up { from { transform: scaleY(0); } }

.tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ground);
  box-shadow: var(--floating);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 100ms;
}

.tip.on { opacity: 1; }
.tip strong { font-size: 14px; line-height: 18px; font-weight: 650; }
.tip span { color: var(--muted); font-size: 12px; line-height: 16px; }

.rank { display: grid; gap: 14px; }
.rank-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-bar { display: block; height: 8px; margin-top: 6px; border-radius: 0 4px 4px 0; background: var(--series); transform-origin: left; animation: grow-right 620ms var(--ease) both; }
@keyframes grow-right { from { transform: scaleX(0); } }

.figure { display: grid; gap: 2px; }
.figure .rank { margin-top: 12px; }
.meter { height: 8px; margin-top: 12px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--series); transform-origin: left; animation: grow-right 620ms var(--ease) both; }

.tbl-scroll { max-height: 320px; overflow: auto; font-size: 14px; animation: rise 240ms var(--ease) both; }
.tbl-scroll table { width: 100%; border-collapse: collapse; }
.tbl-scroll th { position: sticky; top: 0; padding: 4px 0 8px; background: var(--ground); color: var(--muted); font-size: 12.5px; font-weight: 400; text-align: left; }
.tbl-scroll td { padding: 8px 0; border-top: 1px solid var(--line); }
.tbl-scroll tbody tr:hover td { background: var(--raised); }
.tbl-scroll td:first-child { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-scroll .num { padding-left: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.source {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: background-color 140ms, color 140ms;
}

.source:hover { background: var(--hover); color: var(--text); }

.actions { display: flex; align-items: center; gap: 2px; margin-top: 8px; margin-left: -8px; }
.actions .icon { width: 18px; height: 18px; }

.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 140ms, color 140ms;
}

.action:hover { background: var(--hover); color: var(--text); }

.next { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 140ms, transform 140ms;
}

.chip:hover { background: var(--raised); }
.chip:active { transform: scale(.97); }

/* Waiting: one POST and no stream, so only elapsed time is known and only that is shown */
.thinking { animation: rise 240ms var(--ease) both; }
.think-line { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.think-word { font-weight: 500; color: var(--muted); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.think-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Quarter turns, each landing softly; two colours, or a turn of four equal squares would not show */
.think-squares { flex: none; display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 2px; width: 16px; height: 16px; animation: think-turn 1.6s var(--ease) infinite; }
.think-squares i { border-radius: 2px; background: var(--green); }
.think-squares i:nth-child(n + 3) { background: var(--blue); }
@keyframes think-turn { 25% { transform: rotate(90deg); } 50% { transform: rotate(180deg); } 75% { transform: rotate(270deg); } 100% { transform: rotate(360deg); } }

.think-fact { margin-top: 6px; min-height: 22px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.think-fact.swap { animation: rise 320ms var(--ease) both; }

/* The composer */
.dock {
  position: relative;
  flex: none;
  max-width: var(--col);
  width: 100%;
  margin-inline: auto;
  padding: 4px 24px calc(14px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.dock:empty, .dock:has(> .to-end:only-child) { padding-block: 0; }

.composer {
  view-transition-name: composer;
  padding: 12px 10px 10px 18px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: var(--ground);
  box-shadow: var(--floating);
  text-align: left;
  transition: border-color 140ms;
}

.composer:focus-within { border-color: var(--line-strong); }

.composer textarea {
  display: block;
  width: 100%;
  max-height: 168px;
  padding: 0 8px 0 0;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  font-size: 16px;
  line-height: 24px;
}

.composer textarea::placeholder { color: var(--muted); opacity: 1; }

.composer-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 4px; }
.hint { flex: 1; min-width: 0; padding-bottom: 8px; color: var(--muted); font-size: 12.5px; line-height: 16px; }

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-action);
  transition: background-color 140ms, transform 140ms, opacity 140ms;
}

.send:hover { background: var(--green-press); }
.send:active { transform: scale(.92); }
.send:disabled { background: var(--hover); color: var(--muted); cursor: default; transform: none; }
.send.stopping { background: var(--text); color: var(--ground); }
.send.stopping .icon { fill: currentColor; stroke-width: 0; width: 16px; height: 16px; }

.to-end {
  position: absolute;
  left: 50%;
  top: -42px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--muted);
  box-shadow: var(--floating);
}

/* The evidence: a side panel on a wide screen, a sheet on a phone */
.panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--ground);
}

.panel-open .panel { display: flex; animation: panel-in 260ms var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateX(16px); } }

.panel-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 12px 6px 20px; }
.panel-top h2 { font-size: 15px; font-weight: 600; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px 24px; }

/* The steps of the count, as an agent's trace */
.steps { position: relative; display: grid; gap: 14px; padding-left: 20px; }
.steps::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--line); }
.steps li { position: relative; display: grid; gap: 2px; }
.steps li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ground); background: var(--green); }
.step-term { color: var(--muted); font-size: 12.5px; line-height: 16px; }
.step-value { font-size: 14.5px; line-height: 21px; overflow-wrap: anywhere; }

.deals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.deal { padding: 2px 10px; border-radius: 999px; background: var(--raised); font-size: 13px; font-variant-numeric: tabular-nums; }

.code { position: relative; margin-top: 18px; }
.code summary { min-height: 32px; font-size: 14px; font-weight: 500; cursor: pointer; }
.code-bar { display: flex; justify-content: flex-end; margin-bottom: 2px; }

.code pre {
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: 12px;
  background: var(--raised);
  font: 12px/1.55 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

::view-transition-group(composer) { animation-duration: 420ms; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rest { opacity: 1; transform: none; }
}

/* Narrow: Telegram, phones, tablets */
@media (max-width: 999px) {
  .shell, .panel-open .shell { grid-template-columns: minmax(0, 1fr); }
  .only-narrow { display: inline-grid; }

  .scrim {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms;
  }

  .side-open .scrim, .panel-open .scrim { opacity: 1; pointer-events: auto; }

  .side {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 6;
    width: min(320px, 86vw);
    padding-top: calc(14px + var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)));
    padding-bottom: calc(12px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    transform: translateX(-102%);
    transition: transform 260ms var(--ease);
  }

  .side-open .side { transform: none; }
  .history-row .icon-button { opacity: 1; }

  .panel {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 6;
    max-height: 86%;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: var(--floating);
    padding-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  }

  .panel-open .panel { animation: sheet-in 300ms var(--ease) both; }

  .top { min-height: 48px; padding: 4px 6px; }
  .top-title { text-align: center; }
  .thread { padding-inline: 16px; }
  .dock { padding-inline: 10px; padding-bottom: calc(10px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
  .composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 24px; }
  .composer textarea { flex: 1; min-width: 0; padding: 7px 0; }
  .composer-row { display: contents; }
  .hint { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }

  .hello { padding: 3vh 16px 12px; }
  .hello-mark { width: 38px; }
  .greet { margin-top: 12px; }
  .home { display: none; }
  .showcase { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
  .demo { grid-template-rows: auto minmax(92px, auto) minmax(0, 1fr) auto; min-height: 423px; }

  .suggest {
    display: flex;
    gap: 8px;
    width: calc(100% + 32px);
    margin: 8px -16px 0;
    padding: 0 16px 2px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  .suggest::-webkit-scrollbar { display: none; }
  .suggest li { flex: none; width: 216px; scroll-snap-align: start; }
  .suggestion { height: 100%; min-height: 62px; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 20px; }
  .quotes { width: calc(100% + 32px); margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .quotes-note { margin-top: 18px; }
  .quote { width: 152px; }
  .user-tools { display: none; }
  .turn:last-child .user-tools { display: flex; opacity: 1; }
}

@keyframes sheet-in { from { transform: translateY(100%); } }

.how { position: absolute; inset: 52px 0 0; z-index: 5; width: 100%; height: calc(100% - 52px); border: 0; background: var(--ground); }
.how[hidden] { display: none; }
