:root {
  /* the lion's voice, in the brown of its ears */
  --lion: #6e4a2a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-size: 16px; line-height: 1.5; }
body { min-height: 100dvh; display: flex; flex-direction: column; }

header { position: sticky; top: 0; background: var(--background); padding: 0 0 6px; z-index: 1; }
.meter { height: 3px; background: var(--muted); }
.meter-fill { height: 100%; width: 0; background: var(--foreground); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.meter-label { height: auto; min-height: 32px; margin-inline: 8px; border: 0; padding: 4px 8px; color: var(--muted-foreground); text-decoration: underline dotted; text-underline-offset: 3px; touch-action: manipulation; }
#meter-help { position: fixed; inset: 3.5rem 12px auto; margin: 0 auto; width: min(24rem, calc(100% - 32px)); max-height: calc(100dvh - 5rem); overflow: auto; padding: 16px; color: var(--popover-foreground, var(--foreground)); background: var(--popover, var(--background)); border: 1px solid var(--border); box-shadow: 3px 3px 0 var(--foreground); }
#meter-help h2 { margin: 0; font-size: 1.1rem; }
#meter-help p { margin: .75em 0; }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; }

.lion { margin: 0 auto 12px; width: 160px; transition: width .4s; }
.lion svg { width: 100%; height: auto; display: block; }
.lids { transform-origin: center; transform: scaleY(0); animation: blink 9s infinite; }
@keyframes blink { 0%, 96%, 100% { transform: scaleY(0); } 97.5%, 98.5% { transform: scaleY(1); } }

.stream { list-style: none; margin: 0 0 16px; padding: 0; }
.stream li { margin: 0 0 14px; white-space: pre-wrap; }
.stream .you { text-align: right; }
.stream .eliza { text-align: right; font-style: italic; }
.stream .eliza::before { content: 'Eliza, for you — '; font-family: var(--font-mono); font-size: 12px; font-style: normal; color: var(--muted-foreground); display: block; }
.stream .lion { color: var(--lion); width: auto; margin: 0 0 14px; }
.stream .thinking { color: var(--muted-foreground); }
.stream .thinking::after { content: '…'; animation: dots 1.4s steps(3, end) infinite; }
@keyframes dots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; } }

form { display: flex; flex-direction: column; gap: 8px; }
textarea { font: inherit; color: inherit; background: var(--background); border: 1px solid var(--input); border-radius: 0; padding: 10px 12px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--ring); }
.row { display: flex; justify-content: space-between; gap: 8px; }
#options { position: relative; }
#options summary { list-style: none; cursor: pointer; padding: 2px 9px; touch-action: manipulation; }
#options summary::-webkit-details-marker { display:none; }
#options label { position:absolute; top:100%; left:0; z-index:2; display:flex; align-items:center; gap:8px; white-space:nowrap; padding:8px; background:var(--background); border:1px solid var(--border); box-shadow:3px 3px 0 var(--foreground); cursor:pointer; }
button { font: 500 .875rem var(--font-sans); height: 2rem; color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 0; padding: 0 .625rem; cursor: pointer; }
button:hover { background: var(--muted); }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--ring) 50%, transparent); }
button#send { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
button#send:hover { background: color-mix(in srgb, var(--primary) 80%, transparent); }
button:disabled { opacity: .5; cursor: default; }

.share { font-size: 13px; color: var(--muted-foreground); text-align: center; margin: 20px 0 0; }
.share a { color: var(--link); }

footer { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); text-align: center; padding: 12px 16px 20px; }

@media (min-width: 600px) {
  .lion { width: 220px; }
}
@media (max-width: 599px) {
  header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
  .meter { flex: 1; }
  .meter-label { margin: 0; white-space: nowrap; }
  .lion { width: 96px; }
}
