:root {
  color-scheme: dark;
  --green: #45b653;
  --muted: #72a279;
  --border: #285830;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: #000;
  color: var(--green);
}
* { box-sizing: border-box; }
html { min-height: 100%; overflow-y: scroll; scroll-padding-block: 64px 100px; }
body { margin: 0; min-height: 100%; }
button, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.terminal {
  position: relative;
  width: min(800px, 100%);
  /* Stable with browser bars expanded; content can always grow naturally. */
  min-height: 100svh;
  margin: auto;
  padding: max(20px, env(safe-area-inset-top)) clamp(20px, 5vw, 48px) max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.header { display: none; }
.identity { display: flex; align-items: center; gap: 18px; }
h1 { font-size: 16px; letter-spacing: .14em; font-weight: 600; margin: 0; }
.demo-label { font-size: 14px; color: var(--muted); }
.quiet-button { border: 1px solid transparent; background: transparent; color: var(--muted); min-height: 44px; padding: 8px 10px; font-size: 14px; }
.quiet-button:hover { color: var(--green); border-color: var(--border); }
.stage { position: relative; flex: 1 0 auto; min-height: 0; }
.stage:has(.art-wrap:not([hidden])) { min-height: 180px; }
.art-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.robot {
  display: block;
  height: clamp(72px, calc(100svh - 420px), 340px);
  max-width: 48vw;
  width: auto;
  overflow: visible;
  opacity: 0;
}
.answer { width: 100%; padding: 12px 0 20px; }
#output { position: relative; margin: 0; font-size: clamp(18px, 2.5vw, 24px); line-height: 1.5; font-weight: 400; letter-spacing: -.02em; overflow-wrap: anywhere; }
.block { position: absolute; width: .52em; height: 1em; background: #baff93; opacity: 0; pointer-events: none; }
.block.blinking { animation: blink 1s step-end infinite; }
.chat-controls { flex: none; width: 100%; }
.choices { visibility: hidden; opacity: 0; transition: opacity .22s; margin: 0 0 12px; font-size: 16px; line-height: 1.45; }
.choices ul { display: grid; gap: 12px; margin: 0; padding-left: 1.25em; }
.choice-button, .choice-link { color: var(--green); font: inherit; text-align: left; }
.choice-button { border: 0; background: transparent; padding: 8px 0; min-height: 44px; text-decoration: underline; text-underline-offset: .2em; }
.choice-link { text-decoration: underline; text-underline-offset: .2em; }
.choice-button:hover, .choice-link:hover { color: #83d18c; }
.questions { margin: 26px 0 0; color: var(--muted); font-size: .82em; }
.booking-link { margin: 22px 0 0; font-size: clamp(16px, 2vw, 20px); }
.booking-link a { color: var(--green); text-underline-offset: .2em; }
.composer { position: relative; flex: none; width: 100%; z-index: 2; opacity: 0; visibility: hidden; background: #000; padding-block: 8px max(8px, env(safe-area-inset-bottom)); }
.composer.is-visible { visibility: visible; }
.choices.is-visible { visibility: visible; opacity: 1; }
.handoff { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; visibility: hidden; }
label { display: block; margin-bottom: 12px; font-size: 14px; }
.input-row { display: flex; align-items: flex-end; gap: 8px; min-height: 54px; border: 1px solid var(--border); border-radius: 16px; padding: 8px 8px 8px 16px; background: #020603; transition: border-color .15s; }
.input-row:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px #45b65320; }
.prompt-mark { display: none; }
textarea { resize: none; overflow-y: auto; line-height: 1.5; flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--green); caret-color: var(--green); font-size: 16px; padding: 9px 0; outline: none; }
textarea::placeholder { color: var(--muted); opacity: .8; }
.send-button { border: 1px solid var(--green); background: #0b2410; color: var(--green); padding: 10px 12px; min-height: 44px; font-size: 16px; }
.send-button:disabled { opacity: .4; cursor: default; }
.send-button:not(:disabled):hover { background: #14351b; }
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.prompt-button { border: 1px solid var(--border); background: transparent; color: var(--green); padding: 10px 12px; min-height: 44px; font-size: 14px; }
.prompt-button:hover { border-color: var(--green); background: #071109; }
#input-help { color: var(--muted); font-size: 14px; }
button:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.choice-link:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript { padding: 20px; text-align: center; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 600px) {
  .identity { flex-direction: column; align-items: flex-start; gap: 5px; }
  .demo-label { font-size: 13px; }
  .terminal { gap: 16px; }
  #input-help { display: none; }
  .input-row { padding-left: 12px; gap: 8px; }
  .send-button { padding-inline: 12px; }
  .send-button span { display: none; }
}
@media (max-height: 520px) {
  .terminal { padding-top: 8px; padding-bottom: 10px; gap: 8px; }
  .demo-label { display: none; }
  label { margin-bottom: 6px; }
  .composer-bottom { margin-top: 6px; }
  .input-row { min-height: 50px; }
  .robot { height: max(60px, calc(100svh - 300px)); max-height: 160px; }
  #output { font-size: 18px; }
  .answer { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep the fixed contact link clear of content, including short screens. */
.terminal { padding-top: calc(56px + env(safe-area-inset-top)); }
@media (max-width: 600px) { .terminal { padding-inline: 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 12px; } }

/* Keep a real root-scroll range after the last control on touch devices.
   This lets the composer clear browser chrome even when viewport metrics lag.
   Outside .terminal so it does not shift the normal opening composition. */
@media (any-pointer: coarse), (max-width: 600px) {
  body::after { content: ""; display: block; height: calc(96px + env(safe-area-inset-bottom)); }
}
