/* The homepage's second screen, "Keep asking until it fits" (home-ask.js; the block is written by
   scripts/home_examples.py): Starling's own chat beside the one page it rewrites, as /agent shows them on a wide screen
   (the paper the main column, the chat on the ground beside it) and on a phone (the paper above, the chat under it).
   The chat's parts copy Starling's page exactly (docs/design-system/starling.md: the bubble, the folded work line, the
   answer, the change card, the box with Starling perched on it; values from apps/app/chat/starling.css and
   StarlingComposer.tsx), since that page's styles cannot load here. The page changes the way the product's approved
   scenes show a rewrite: the wash follows the bars, notes become the app's flock, and new ink lands in Starling blue. */
.home .ak-in {
  --ak-live: var(--ai-mark);
  --ak-live-text: #1d57be;
  --ak-ground: #f0f0f2;
  --ak-glass: color-mix(in srgb, var(--ak-ground), #f6f6f8 72%);
  --ak-object: #fafafb;
  --ak-fill: rgba(15, 14, 18, 0.05);
  --ak-fill-strong: rgba(15, 14, 18, 0.09);
  --ak-text-2: #5d5c61;
  --ak-text-3: #707076;
  --ak-object-shadow: 0 1px 2px rgba(15, 14, 18, 0.03), 0 4px 14px rgba(15, 14, 18, 0.04);
  --ak-glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 14, 18, 0.05), 0 8px 24px rgba(15, 14, 18, 0.08);
  --ak-sheet-shadow: 0 1px 2px rgba(15, 14, 18, 0.04), 0 10px 30px rgba(15, 14, 18, 0.07);
  --ak-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ak-settle: linear(
    0,
    0.081,
    0.23,
    0.381,
    0.514,
    0.623,
    0.709,
    0.776,
    0.828,
    0.868,
    0.899,
    0.923,
    0.941,
    0.955,
    0.965,
    0.973,
    0.98,
    0.988,
    0.993,
    0.996,
    1
  );
  --ak-spring: linear(
    0,
    0.048,
    0.169,
    0.332,
    0.513,
    0.69,
    0.85,
    0.981,
    1.081,
    1.147,
    1.183,
    1.194,
    1.185,
    1.161,
    1.129,
    1.094,
    1.06,
    1.029,
    1.003,
    0.984,
    0.971,
    0.964,
    0.962,
    0.964,
    0.969,
    0.975,
    0.982,
    0.988,
    0.994,
    0.999,
    1.003,
    1.006,
    1.007,
    1.006,
    1.004,
    1.002,
    1
  );
  --ak-text: 15px;
  display: grid;
  gap: clamp(12px, 2.2svh, 20px);
}

/* ── The stage: the ground, the paper on it and the chat beside it ───────────────────────────────────────────────── */
.home .hm-keep-asking {
  padding-block: 16px;
}

.ak {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 400px);
  gap: 12px;
  padding: 12px;
  border-radius: 28px;
  background: var(--ak-ground);
}
.ak-sheet {
  contain: layout paint;
  display: grid;
  align-content: center;
  align-self: center;
  min-width: 0;
  margin: 0;
  padding: 16px clamp(16px, 2vw, 28px) 20px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--ak-sheet-shadow);
}
.ak-head {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-bottom: 6px;
  text-align: center;
}
.ak-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}
.ak-by {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
}
.ak-score {
  position: relative;
  display: grid;
  width: min(100%, calc(var(--ak-aspect, 1) * (100svh - 344px)));
  justify-self: center;
  pointer-events: none;
  --ak-u: 20;
}
.ak-state {
  display: none;
  grid-area: 1 / 1;
  visibility: hidden;
}
.ak-state:is(.is-on, .is-was, .is-now) {
  display: block;
  visibility: visible;
}
.ak-state .engraved {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--ink);
}
/* A measure of the page being left is drawn by the page that replaces it once Starling has been over it. */
.ak-state.is-was .measure.is-over,
.ak-state.is-now .measure:not(.is-over),
.ak-state.is-was .system.is-over > :is(path, .grpSym),
.ak-state.is-now .system:not(.is-over) > :is(path, .grpSym) {
  display: none;
  visibility: hidden;
}

/* Changed notation settles in blue, while structural lines and retained notes keep their ink. */
.ak-state .ak-new {
  color: var(--ak-live);
}
.ak-state.is-now .is-over .ak-new:not(.chord-diagram) {
  animation: ak-arrive 0.3s var(--ak-ease) both;
}
@keyframes ak-arrive {
  from {
    opacity: 0;
    translate: 0 calc(var(--ak-u) * -5px);
  }
}
.ak-state.is-now .is-over [data-from] {
  animation: ak-glide 0.32s var(--ak-settle) both;
}
@keyframes ak-glide {
  from {
    translate: var(--ak-from-x, 0px) var(--ak-from-y, 0px);
  }
}
.ak-state :is(.ak-new, [data-from]) {
  transform-box: view-box;
}

/* The existing piano diagram keeps its own fills and its outer hairline. */
.ak-state .chord-diagram :is(rect, path, circle):not([stroke]) {
  stroke: none;
}
.ak-state .chord-diagram rect[stroke] {
  stroke: var(--ink-soft);
}
.ak-state.is-now .is-over .chord-diagram {
  animation: ak-diagram 0.28s var(--ak-ease) both;
}
@keyframes ak-diagram {
  from {
    opacity: 0;
  }
}

/* Reuse the flock's notehead cels in a clipped layer so they stay with the sheet. */
.ak-flights {
  contain: strict;
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}
.ak-flights > span {
  position: absolute;
  inset: 0 auto auto 0;
}
.ak-flights canvas {
  display: block;
  width: 24px;
  height: auto;
}
.ak-flights canvas + canvas {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* Starling's wash over the bar it works on (the workspace's presence wash, the upgrade dialog's Pro scene). */
.ak-wash {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transform-origin: top left;
  background: color-mix(in srgb, var(--ak-live) 9%, transparent);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.14s var(--ak-ease),
    opacity 0.2s;
}
.ak-wash.is-on {
  opacity: 1;
}
/* ── The chat ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.ak-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 456px;
  font-size: var(--ak-text);
  color: var(--ink);
}
.ak-window {
  contain: layout paint;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: clip;
}
.ak-thread {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 16px;
  margin: auto 0 0;
  padding: 8px 8px 14px;
  list-style: none;
}
.ak-turn {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
#keep-asking:not(.is-live) .ak-turn:not([data-step="files"]),
.ak-turn:is(.is-hidden, .is-cropped) {
  display: none;
}
.ak-turn.is-new {
  animation: ak-enter 0.28s var(--ak-ease) both;
}
@keyframes ak-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.ak-you {
  align-items: flex-end;
  gap: 6px;
}
.ak-bubble {
  max-width: 82%;
  margin: 0;
  padding: 10px 15px;
  border-radius: 20px 20px 6px 20px;
  background: var(--ak-object);
  box-shadow: var(--ak-object-shadow);
  font-size: var(--ak-text);
  line-height: 1.5;
  overflow-wrap: break-word;
}
/* A file the person sent with the message (the chat's file chip). */
.ak-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 12px;
  background: var(--ak-object);
  box-shadow: var(--ak-object-shadow);
}
.ak-file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--ak-fill);
  color: var(--ak-text-2);
}
.ak-file-icon .icon {
  width: 18px;
  height: 18px;
}
.ak-file-text {
  display: grid;
}
.ak-file-text b {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.ak-file-text small {
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--ak-text-3);
}
/* The work, folded into one quiet line: its mark, what it did, the chevron that would open it. */
.ak-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0 0 -6px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ak-text-2);
}
.ak-trail svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ak-answer {
  margin: 0;
  font-size: var(--ak-text);
  line-height: 1.62;
  text-wrap: pretty;
}
/* Words arriving ink in, a word at a time from a 6px blur, as Starling's answers do (UI defaults 4). */
.ak-turn.is-new .ak-word {
  display: inline-block;
  white-space: pre-wrap;
  animation: ak-ink-word 0.12s var(--ak-delay, 0ms) ease-out both;
}
@keyframes ak-ink-word {
  from {
    opacity: 0;
    filter: blur(6px);
  }
}
/* The change card without its picture: the change named over its facts. */
.ak-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  box-sizing: border-box;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  background: var(--ak-object);
  box-shadow: var(--ak-object-shadow);
  font-size: 14px;
  line-height: 1.4;
}
.ak-version[hidden] {
  display: none;
}
.ak-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ak-live) 12%, transparent);
  color: var(--ak-live-text);
}
.ak-card-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ak-card-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ak-card-text strong {
  font-weight: 600;
}
.ak-card-text span {
  font-size: 12px;
  color: var(--ak-text-2);
}
/* The score row carries the notation icon on the same surface as its title. */
.ak-tile-note {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
}
.ak-tile-note .icon {
  width: 20px;
  height: 20px;
}
.ak-version .ak-card-text strong {
  font-size: 15px;
  font-weight: 500;
}
.ak-version .ak-card-text span {
  font-size: 13px;
}
/* The workspace's download shapes, as a static result in the example conversation. */
.ak-files {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--ak-object);
  list-style: none;
}
.ak-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--ak-text-2);
  font-size: 12px;
  line-height: 1.3;
}
.ak-tile .icon {
  width: 20px;
  height: 20px;
}
.ak-tile strong {
  font-weight: 500;
}
.ak-turn.is-new .ak-tile {
  animation: ak-enter 0.26s var(--ak-ease) both;
}

/* ── The box, with Starling perched on it ──────────────────────────────────────────────────────────────────────── */
.ak-foot {
  position: relative;
  flex: none;
}
.ak-dock {
  position: relative;
  z-index: 1;
  width: calc(100% - 48px);
  margin: 0 auto -7px;
}
/* Idle Starling perches on the box rim. When work starts, an opaque tray lifts behind the status line. */
.ak-tray {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding-bottom: 7px;
  overflow: visible;
}
.ak-tray::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px 16px 0 0;
  background: var(--lg-object, var(--ak-object));
  box-shadow: var(--lg-object-shadow, var(--ak-object-shadow));
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.18s var(--ease),
    transform 0.32s var(--ease-settle);
}
.ak-chat.is-working .ak-tray::before {
  opacity: 1;
  transform: translateY(0);
}
.ak-tray::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  background: var(--ak-ground);
  opacity: 0;
  transition: opacity 0.24s var(--ak-ease);
}
.ak-chat.is-working .ak-tray::after {
  opacity: 1;
}
.ak-stage {
  position: relative;
  flex: none;
  width: 66px;
  height: 52px;
  margin-left: 4px;
  overflow: visible;
}
.ak-bird {
  --sl-size: 42px;
  --sl-box: var(--sl-size);
  --sl-cel-h: 1.2979;
  --sl-cel-w: 1.0966;
  --sl-cel-x: -0.1277;
  --sl-cel-y: -0.1571;
  position: absolute;
  left: 11px;
  bottom: 2px;
  width: var(--sl-size);
  height: var(--sl-size);
}
.ak-bird:is([data-state="reading"], [data-state="writing"]) {
  --sl-size: 56px;
  left: 6px;
  bottom: 0;
}
.ak-bird img,
.ak-bird .sl-cel {
  position: absolute;
  left: calc(var(--sl-box) * var(--sl-cel-x));
  top: calc(var(--sl-box) * var(--sl-cel-y));
  width: calc(var(--sl-box) * var(--sl-cel-w));
  height: calc(var(--sl-box) * var(--sl-cel-h));
  max-width: none;
  pointer-events: none;
  user-select: none;
}
.ak-live {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ak-live);
}
.ak-clock {
  flex: none;
  padding-right: 16px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(15, 14, 18, 0.56);
  font-variant-numeric: tabular-nums;
}
.ak-live,
.ak-clock {
  position: relative;
  opacity: 0;
  transition: opacity 0.2s;
}
.ak-chat.is-working :is(.ak-live, .ak-clock) {
  opacity: 1;
  transition-delay: 0.16s;
}
.ak-box {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  box-sizing: border-box;
  margin: 0;
  padding: 15px 15px 15px 19px;
  border-radius: 26px;
  background: var(--ak-glass);
  box-shadow: var(--ak-glass-shadow);
  caret-color: var(--ak-live);
  transition: box-shadow 0.15s var(--ak-ease);
}
.ak-box:hover {
  box-shadow:
    0 0 0 1px var(--hair-strong),
    var(--ak-glass-shadow);
}
.ak-box:focus-within {
  box-shadow: var(--lg-focus);
}
.ak-box.is-dragging {
  box-shadow:
    0 0 0 2px var(--accent),
    var(--ak-glass-shadow);
}
.ak-words {
  position: relative;
  min-height: 48px;
  margin: 2px 0 0;
  padding: 5px 0;
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: break-word;
}
.ak-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  max-height: 140px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  resize: none;
  field-sizing: content;
}
.ak-input:focus {
  outline: none;
  box-shadow: none;
}
.ak-input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.ak-box.is-typing .ak-input::placeholder {
  color: transparent;
}
.ak-typed {
  position: absolute;
  inset: 5px 0 auto 0;
  color: var(--ink);
  pointer-events: none;
}
.ak-typed:empty,
.ak-box.is-taken .ak-typed {
  display: none;
}
/* The caret, in Starling's blue as the box draws it. */
.ak-typed:not(:empty)::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--ak-live);
}
.ak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ak-attach,
.ak-send {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ak-fill);
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.15s var(--ak-ease),
    color 0.15s var(--ak-ease),
    transform 0.5s var(--ak-spring);
}
.ak-attach::before,
.ak-send::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
}
.ak-attach {
  margin-left: -4px;
}
@media (max-width: 759.98px), (pointer: coarse) {
  .ak-attach,
  .ak-send {
    width: 44px;
    height: 44px;
  }
}
.ak-attach:hover {
  background: var(--ak-fill-strong);
}
.ak-attach:active {
  transform: scale(0.92);
}
.ak-attach:focus-visible,
.ak-send:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}
.ak-attach svg,
.ak-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The box's send lights up solid ink when the visitor interacts, hovers, or sends, and shows Stop while the demo works. */
.ak-send {
  background: var(--ak-fill-strong);
}
.ak-send:hover,
.ak-box:focus-within .ak-send,
.ak-box:has(.ak-input:not(:placeholder-shown)) .ak-send,
.ak-box:has(.ak-typed:not(:empty)) .ak-send,
.ak-box.is-sending .ak-send,
.ak-chat.is-working .ak-send,
.ak-send.is-pressed {
  background: var(--ink);
  color: var(--paper);
}
.ak-send.is-pressed,
.ak-send:active {
  transform: scale(0.9);
  transition-duration: 0.08s;
}
.ak-send .ak-stop {
  display: none;
  fill: currentColor;
  stroke: none;
}
.ak-chat.is-working .ak-send .ak-stop {
  display: block;
}
.ak-chat.is-working .ak-send .ak-up {
  display: none;
}
.ak-status {
  margin-top: 6px;
}

/* ── The requests, each a press that plays it ──────────────────────────────────────────────────────────────────── */
/* The design system's segmented switch: a round track, the request on show on paper with an inset ring. */
.ak-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-self: center;
  width: min(100%, 520px);
  padding: 0;
  border-radius: 999px;
  background: var(--ak-fill);
}
.ak-steps button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ak-text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s var(--ak-ease);
}
.ak-steps button span {
  white-space: nowrap;
}
.ak-steps .icon {
  flex: none;
  width: 18px;
  height: 18px;
}
.ak-steps button:hover {
  color: var(--ink);
}
.ak-steps button[aria-current="step"] {
  background: var(--white);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(15, 14, 18, 0.1),
    0 1px 2px rgba(15, 14, 18, 0.06);
}
.ak-steps button:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}
.ak-steps button:active {
  transform: scale(0.97);
}

/* ── Phones: the paper above, the chat under it, all in one window ─────────────────────────────────────────────── */
@media (max-width: 899.98px) {
  .home .ak-in {
    --ak-text: 15px;
    gap: 12px;
  }
  .home .hm-keep-asking {
    padding-block: 12px 16px;
  }
  .ak {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-inline: calc(8px - var(--gutter));
    padding: 8px;
    border-radius: 24px;
  }
  .ak-sheet {
    padding: 8px 10px 10px;
    border-radius: 18px;
  }
  .ak-title {
    font-size: 17px;
  }
  .ak-by {
    font-size: 11px;
  }
  .ak-score {
    width: min(100%, calc(var(--ak-aspect, 1) * 215px));
  }
  .ak-chat {
    min-height: 0;
    height: clamp(252px, 100svh - 492px, 352px);
  }
  :root:lang(zh-Hans) .home .ak-chat {
    height: clamp(252px, 100svh - 543px, 301px);
  }
  .ak-thread {
    gap: 8px;
    padding: 2px 4px 6px;
  }
  .ak-turn {
    gap: 6px;
  }
  .ak-bubble {
    padding: 8px 13px;
  }
  .ak-trail {
    min-height: 22px;
    margin-bottom: -2px;
  }
  .ak-answer {
    line-height: 1.5;
  }
  .ak-card {
    min-height: 48px;
    padding: 6px 10px;
  }
  .ak-card-icon {
    width: 32px;
    height: 32px;
  }
  .ak-dock {
    width: calc(100% - 32px);
    margin: 0 auto -6px;
  }
  .ak-tray {
    height: 46px;
    padding-bottom: 6px;
  }
  .ak-tray::after {
    height: 6px;
  }
  .ak-stage {
    width: 56px;
    height: 46px;
  }
  .ak-bird {
    --sl-size: 38px;
    left: 9px;
  }
  .ak-box {
    min-height: 0;
    gap: 6px;
    padding: 10px 10px 10px 16px;
  }
  .ak-words {
    min-height: 24px;
    margin: 0;
    padding: 0;
  }
  .ak-input {
    min-height: 24px;
  }
  .ak-typed {
    inset: 0 0 auto 0;
  }
  .ak-steps {
    width: 100%;
  }
  .ak-steps button {
    flex-direction: column;
    gap: 2px;
    height: 44px;
    padding: 0 2px;
    font-size: 12px;
  }
  .ak-steps .icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 759.98px) {
  .home .hm-keep-asking {
    padding-bottom: var(--space-5);
  }
  :root:lang(zh-Hant) .home .ak-chat {
    height: clamp(252px, 100svh - 480px, 340px);
  }
}

@media (max-width: 759.98px) and (max-height: 816px) {
  :root:lang(zh-Hans) .home .hm-keep-asking {
    --ak-compact-chat: 240px;
    /* Heading, caption, score surround, scene gaps and the 44px request switch. */
    --ak-surround: 166px;
    --ak-score-room: calc(100svh - var(--nav-h, 72px) - var(--space-5) - var(--ak-compact-chat) - var(--ak-surround));
    padding-top: var(--space-2);
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-in {
    gap: var(--space-2);
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak {
    gap: 6px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-sheet {
    padding-block: 6px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-score {
    width: min(100%, calc(var(--ak-aspect, 1) * clamp(156px, var(--ak-score-room), 215px)));
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-chat {
    height: var(--ak-compact-chat);
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-thread {
    gap: 4px;
    padding-bottom: 4px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-turn {
    gap: 4px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-bubble {
    padding-block: 6px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-trail {
    min-height: 20px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-card {
    min-height: 44px;
    padding-block: 4px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking :is(.ak-tray, .ak-stage) {
    height: 40px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-bird {
    --sl-size: 34px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-bird:is([data-state="reading"], [data-state="writing"]) {
    --sl-size: 46px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 10px;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-row {
    display: contents;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-attach {
    grid-area: 1 / 1;
    margin-left: 0;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-words {
    grid-area: 1 / 2;
  }
  :root:lang(zh-Hans) .home .hm-keep-asking .ak-send {
    grid-area: 1 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ak-state *,
  .ak-turn,
  .ak-thread,
  .ak-dock,
  .ak-tray::before,
  .ak-tray::after,
  .ak-word {
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .ak-box:focus-within,
  .ak :is(button, a):focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

.ak-actions {
  display: contents;
}

/* With Safari's bars open on a short phone, give the chat the room below the score. */
@media (max-width: 759.98px) and (max-height: 640px) and (orientation: portrait) {
  .home [data-home-story] > #keep-asking {
    --ak-short-foot: max(16px, env(safe-area-inset-bottom));
    padding-block: 4px var(--ak-short-foot);
    align-content: stretch;
  }
  .home [data-home-story] > #keep-asking .ak-in {
    --ak-text: 14px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 6px;
  }
  .home [data-home-story] > #keep-asking .hm-h2 {
    font-size: 26px;
    line-height: 1.15;
  }
  .home [data-home-story] > #keep-asking .ak {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    padding: 6px;
  }
  .home [data-home-story] > #keep-asking .ak-sheet {
    padding-block: 4px;
  }
  .home [data-home-story] > #keep-asking .ak-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: 2px;
  }
  .home [data-home-story] > #keep-asking .ak-score {
    width: min(100%, calc(var(--ak-aspect, 1) * clamp(138px, 100svh - 399px, 156px)));
  }
  .home [data-home-story] > #keep-asking .ak-chat {
    height: auto;
    min-height: 0;
  }
  .home [data-home-story] > #keep-asking :is(.ak-thread, .ak-turn) {
    gap: 3px;
  }
  .home [data-home-story] > #keep-asking .ak-thread {
    padding-bottom: 3px;
  }
  .home [data-home-story] > #keep-asking .ak-bubble {
    padding-block: 4px;
    line-height: 1.35;
  }
  .home [data-home-story] > #keep-asking .ak-trail {
    min-height: 16px;
    font-size: 12px;
    line-height: 1.3;
  }
  .home [data-home-story] > #keep-asking .ak-answer {
    line-height: 1.35;
  }
  .home [data-home-story] > #keep-asking .ak-card {
    min-height: 36px;
    padding-block: 3px;
    line-height: 1.2;
  }
  .home [data-home-story] > #keep-asking :is(.ak-tile-note, .ak-card-icon, .ak-file-icon) {
    width: 28px;
    height: 28px;
  }
  .home [data-home-story] > #keep-asking .ak-files {
    padding-block: 4px;
  }
  .home [data-home-story] > #keep-asking .ak-tile {
    gap: 2px;
  }
  .home [data-home-story] > #keep-asking .ak-tile .icon {
    width: 16px;
    height: 16px;
  }
  .home [data-home-story] > #keep-asking :is(.ak-tray, .ak-stage) {
    height: 33px;
  }
  .home [data-home-story] > #keep-asking .ak-stage {
    width: 46px;
  }
  .home [data-home-story] > #keep-asking .ak-bird {
    --sl-size: 28px;
    bottom: -1px;
  }
  .home [data-home-story] > #keep-asking .ak-bird:is([data-state="reading"], [data-state="writing"]) {
    --sl-size: 34px;
  }
  .home [data-home-story] > #keep-asking .ak-box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
  }
  .home [data-home-story] > #keep-asking .ak-row {
    display: contents;
  }
  .home [data-home-story] > #keep-asking .ak-attach {
    grid-area: 1 / 1;
    margin-left: 0;
  }
  .home [data-home-story] > #keep-asking .ak-words {
    grid-area: 1 / 2;
    font-size: 14px;
    line-height: 18px;
  }
  .home [data-home-story] > #keep-asking .ak-send {
    grid-area: 1 / 3;
  }
  .home [data-home-story] > #keep-asking .ak-steps button {
    gap: 2px;
    height: 44px;
    padding-inline: 0;
  }
  .home [data-home-story] > #keep-asking .ak-steps button span {
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
}
