/* Queen TTS. The look is a port of openai.fm (github.com/openai/openai-fm, MIT License, Copyright 2025
   OpenAI; vendor/LICENSE-openai-fm.txt): hardware-style keys with layered shadows and an LED that lights
   when selected, recessed "screens", a frosted footer with the play key. Native CSS, no build step. */

:root {
  --background: #ececec;
  --foreground: #222;
  --primary: #ff4a00;
  --screen: #f3f3f3;
  --page-max-width: 1300px;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --shadow-textarea: rgba(0, 0, 0, 0.15) 0px 1px 2px 0px inset, rgba(0, 0, 0, 0.08) 1px -2px 2px 0px inset;
  --dim: rgb(34 34 34 / 0.7);
  --faint: rgb(34 34 34 / 0.45);
}

* { box-sizing: border-box; }
html { font-size: 14px; line-height: 130%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 640px) {
  body { background-image: linear-gradient(to bottom right, #f8f8f8, var(--background) 20%); background-repeat: no-repeat; }
}
::selection { background: rgb(255 74 0 / 0.2); }
svg { display: block; flex-shrink: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.page { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 20px 128px; }
@media (min-width: 768px) { .page { padding-bottom: 96px; } }

/* ---------------------------------------------------------------- header */
.hdr {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 12px;
  width: 100%; max-width: var(--page-max-width); margin: 0 auto 48px;
}
.hdr-logo { grid-column: span 2; order: 1; margin-bottom: 32px; position: relative; top: 0.0875rem; }
/* the Queen TTS wordmark: crown mark + "Queen" + the TTS keycap (an orange key, as in the promo video) */
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 27px; height: 24px; }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: -0.045em; }
.brand-cap { font-weight: 700; font-size: 12px; line-height: 1; letter-spacing: 0.02em; color: #fff; background: var(--primary);
  padding: 4px 6px 3px; border-radius: 5px;
  box-shadow: inset 0.5px 0.5px 1px #ffffffd4, inset -0.5px -0.5px 1px #0000003b, 1px 1px 2px -0.5px #00000042, -0.5px -0.5px #952b0087; }
.hdr-text { grid-column: span 12; order: 3; text-wrap: balance; }
.hdr-text .dim { color: var(--dim); margin: 0 0 12px; max-width: 70ch; }
.hdr-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.link { color: inherit; text-decoration: none; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s; }
.link:hover { color: var(--dim); }
.link svg { width: 0.93rem; height: 0.93rem; }
.status { text-transform: uppercase; color: var(--faint); }
.status[data-state="ok"]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: 1px; }
.hdr-switch { grid-column: span 10; order: 2; display: flex; justify-content: flex-end; align-items: flex-start; gap: 10px; }
.sw-label { text-transform: uppercase; color: var(--dim); position: relative; top: 4px; }
@media (min-width: 768px) {
  .hdr { margin-bottom: 32px; }
  .hdr-logo { margin-bottom: 0; }
  .hdr-text { grid-column: span 7; order: 2; }
  .hdr-switch { grid-column: span 3; order: 3; }
}
@media (min-width: 1280px) { .hdr-text { grid-column: span 6; } .hdr-switch { grid-column: span 4; } }
.hdr-switch .vidkey { flex: none; flex-wrap: nowrap; gap: 6px; padding: 6px 11px; margin-right: 8px; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.hdr-switch .vidkey svg { width: 11px; height: 11px; }

/* switch (openai.fm Switcher) */
.track {
  position: relative; width: 42px; height: 25px; border-radius: 100px; border: 0; padding: 0; cursor: pointer;
  box-shadow: inset 0 1px 2px #00000026, 0 1px 0 0 #ffffff40; background: rgba(0, 0, 0, 0.08);
  transition: background-color 0.25s ease; user-select: none;
}
.track[aria-checked="true"] { background: var(--primary); }
.thumb {
  display: block; width: 21px; height: 21px; border-radius: 100%;
  transform: translateX(2px); transition: transform 0.25s ease; will-change: transform; background: #f4f4f4;
  box-shadow: inset 1px 1px 1px #fff, inset -1px -1px 0px #0000001a, 0.444584px 0.444584px 0.628737px -0.75px #00000042,
    1.21072px 1.21072px 1.71222px -1.5px #0000003f, 2.6583px 2.6583px 3.75941px -2.25px #0000003b,
    5.90083px 5.90083px 8.34503px -3px #00000031, 10px 10px 21.2132px -3.75px #0000000e;
}
.track[aria-checked="true"] .thumb { transform: translateX(19px); }

/* ---------------------------------------------------------------- blocks */
.board { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: var(--page-max-width); margin: 0 auto; }
.block { display: flex; flex: 1; flex-direction: column; flex-shrink: 0; margin-bottom: 40px; min-width: 0; }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: -1px; position: relative; min-width: 0; }
.block-title { text-transform: uppercase; padding: 4px 0; color: var(--dim); white-space: nowrap; }
.rule { flex: 1; height: 1px; background: rgb(34 34 34 / 0.08); min-width: 16px; }
.block-meta { text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.block-body { display: flex; flex: 1; flex-direction: column; padding-top: 12px; }
.stack { gap: 12px; }
.row { display: flex; flex-direction: column; column-gap: 12px; }
@media (min-width: 768px) { .row { flex-direction: row; } }
.settings .block { flex: 1; }
.settings .block.wide { flex: 2.6; }
.note { margin: 10px 0 0; color: var(--faint); font-size: 12px; line-height: 1.45; }
.note:empty { display: none; }

/* ---------------------------------------------------------------- keys (openai.fm Button) */
.key {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; flex: 1;
  border: 0; border-radius: var(--radius-md); padding: 12px; background: #f4f4f4; text-align: left;
  box-shadow: rgb(255, 255, 255) 1px 1px 1px 0px inset, rgba(0, 0, 0, 0.15) -1px -1px 1px 0px inset,
    rgba(0, 0, 0, 0.26) 0.444584px 0.444584px 0.628737px -1px, rgba(0, 0, 0, 0.247) 1.21072px 1.21072px 1.71222px -1.5px,
    rgba(0, 0, 0, 0.23) 2.6583px 2.6583px 3.75941px -2.25px, rgba(0, 0, 0, 0.192) 5.90083px 5.90083px 8.34503px -3px,
    rgba(0, 0, 0, 0.056) 10px 10px 21.2132px -3.75px, -0.5px -0.5px 0 0 rgb(0 0 0 / 5%);
  transition: box-shadow 0.3s ease, opacity 0.2s ease; cursor: pointer; user-select: none; position: relative;
}
.key:focus-visible { outline: 2px solid rgb(255 74 0 / 0.55); outline-offset: 2px; }
.key:active, .key[data-selected] {
  box-shadow: inset 0.5px 0.5px 1px #fff, inset -0.5px -0.5px 1px #00000026, 0.222px 0.222px 0.314px -0.5px #0003,
    0.605px 0.605px 0.856px -1px #0000002e, 1.329px 1.329px 1.88px -1.5px #00000040, 2.95px 2.95px 4.172px -2px #0000001a,
    2.5px 2.5px 3px -2.5px #00000026, -0.5px -0.5px 0 0 rgb(0 0 0 / 10%);
}
.key:disabled { cursor: not-allowed; opacity: 0.4; }
.key-primary {
  color: #fff; background: var(--primary);
  box-shadow: inset 1px 1px 1px #ffffffd4, inset -1px -1px 1px #0000003b, 0.444584px 0.444584px 0.628737px -1px #00000042,
    1.21072px 1.21072px 1.71222px -1.5px #0000003f, 2.6583px 2.6583px 3.75941px -2.25px #0000003b,
    5.90083px 5.90083px 8.34503px -3px #00000031, 10px 10px 21.2132px -3.75px #0000003b, -0.5px -0.5px #952b0087;
}
.key-primary:active, .key-primary[data-selected] {
  box-shadow: inset 0.5px 0.5px 1px #fff, inset -0.5px -0.5px 1px #0000005b, 0.222px 0.222px 0.314px -1px #0003,
    0.605px 0.605px 0.856px -1px #0000002e, 1.329px 1.329px 1.88px -1.5px #00000040, 2.95px 2.95px 4.172px -2px #0000001a,
    2.5px 2.5px 3px -2.5px #00000026, -0.5px -0.5px #00000022;
}
.key-secondary {
  color: #fff; background: #222;
  box-shadow: inset 1px 1px 1px #ffffffb3, inset -1px -1px 1px #0000003b, 0.444584px 0.444584px 0.628737px -0.75px #00000042,
    1.21072px 1.21072px 1.71222px -1.5px #0000003f, 2.6583px 2.6583px 3.75941px -2.25px #0000003b,
    5.90083px 5.90083px 8.34503px -3px #00000031, 14px 14px 21.2132px -3.75px #00000033, -0.5px -0.5px #000000af;
}
.key-secondary:active, .key-secondary[data-selected] {
  box-shadow: inset 0.5px 0.5px 1px #ffffffb3, inset -0.5px -0.5px 1px #0000005b, 0.222px 0.222px 0.314px -1px #0003,
    0.605px 0.605px 0.856px -1px #0000002e, 1.329px 1.329px 1.88px -1.5px #00000040, 2.95px 2.95px 4.172px -2px #0000001a,
    4px 4px 3px -2.5px #00000026, -0.5px -0.5px #000000ac;
}
.key-tertiary {
  color: #fff; background: #6a6a6a;
  box-shadow: inset 1px 1px 1px #ffffffba, inset -1px -1px 1px #0000003b, 0.444584px 0.444584px 0.628737px -1px #00000042,
    1.21072px 1.21072px 1.71222px -1.5px #0000003f, 2.6583px 2.6583px 3.75941px -2.25px #0000003b,
    5.90083px 5.90083px 8.34503px -3px #0000004f, 12px 12px 21.2132px -3.75px #0000001a, -0.5px -0.5px #0000006b;
}
.key-tertiary:active, .key-tertiary[data-selected] {
  box-shadow: inset 0.5px 0.5px 1px #ffffffba, inset -0.5px -0.5px 1px #0000005b, 0.222px 0.222px 0.314px -1px #0003,
    0.605px 0.605px 0.856px -1px #0000002e, 1.329px 1.329px 1.88px -1.5px #00000040, 2.95px 2.95px 4.172px -2px #0000001a,
    4px 4px 3px -2.5px #00000026, -0.5px -0.5px #0000007b;
}
.key-neutral {
  color: #fff; background: #aaa;
  box-shadow: inset 1px 1px 1px #ffffffc2, inset -1px -1px 1px #0000003b, 0.444584px 0.444584px 0.628737px -1px #00000042,
    1.21072px 1.21072px 1.71222px -1.5px #0000003f, 2.6583px 2.6583px 3.75941px -2.25px #0000003b,
    5.90083px 5.90083px 8.34503px -3px #00000031, 10px 10px 21.2132px -3.75px #0000000e, -0.5px -0.5px #00000012;
}
.key-neutral:active {
  box-shadow: inset 0.5px 0.5px 1px #fff, inset -0.5px -0.5px 1px #0000005b, 0.222px 0.222px 0.314px -1px #0003,
    0.605px 0.605px 0.856px -1px #0000002e, 1.329px 1.329px 1.88px -1.5px #00000040, 2.95px 2.95px 4.172px -2px #0000001a,
    2.5px 2.5px 3px -2.5px #00000026, -0.5px -0.5px #00000022;
}
.led {
  display: block; width: 7px; height: 7px; border-radius: 100%; background-color: rgba(0, 0, 0, 0.1);
  box-shadow: inset 1px 1px 2px #0000001c, 0 1px 0 0px #ffffff30; transition: background-color 0.15s ease;
}
.key[data-selected] .led { background: var(--primary); }
.ico { width: 36px; height: 36px; }

/* tiles: name top-left, LED bottom-left, a small tag bottom-right */
.tile {
  flex-direction: column; align-items: flex-start; justify-content: space-between; flex-wrap: nowrap;
  min-height: 60px; max-height: 100px; aspect-ratio: 4 / 3; width: 100%;
}
.tile .name { overflow-wrap: anywhere; padding-right: 4px; line-height: 1.25; }
.tile .led { position: absolute; left: 0.93rem; bottom: 0.93rem; }
.tile .tag { position: absolute; right: 12px; bottom: 9px; font-size: 11px; color: var(--faint); }
@media (min-width: 640px) { .tile { aspect-ratio: 2 / 1; } }
@media (min-width: 1024px) { .tile { aspect-ratio: 2.5 / 1; } }

/* voices */
.voices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .voices { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) { .voices { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .voices { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .voices { grid-template-columns: repeat(12, minmax(0, 1fr)); } .voices .tile { aspect-ratio: 1 / 1; } }

/* presets (openai.fm "vibes") */
.presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.shuffle { min-height: 60px; max-height: 100px; aspect-ratio: 4 / 3; width: 100%; }
@media (min-width: 640px) { .shuffle { aspect-ratio: 2 / 1; } }
@media (min-width: 1024px) { .shuffle { aspect-ratio: 2.5 / 1; } }

/* emotion / instruction presets: the same keys, grouped by tabs */
.vibes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 480px) { .vibes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .vibes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vibes .tile { animation: ln-in 0.3s ease both; }
.script textarea.ins { min-height: 150px; }

/* settings keys */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skey { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; min-height: 60px; text-transform: uppercase; }
.skey .led { position: absolute; left: 0.93rem; bottom: 0.93rem; }
.langkeys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 480px) { .langkeys { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) { .langkeys { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.lkey { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; min-height: 60px; padding: 10px 12px; min-width: 0; }
.lkey .lk { font-weight: 700; }
.lkey .lname { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; }
.lkey .led { position: absolute; right: 10px; top: 12px; }

/* ---------------------------------------------------------------- screens */
.screen {
  width: 100%; background: var(--screen); border-radius: var(--radius-lg); box-shadow: var(--shadow-textarea);
  padding: 16px; border: 0; color: var(--foreground);
}
.script { position: relative; }
.script textarea {
  flex: 1; min-height: 220px; height: 100%; resize: none; outline: none; font: inherit; font-size: 16px; line-height: 1.5;
}
.script textarea::placeholder { color: var(--faint); opacity: 1; }
@media (min-width: 768px) { .script textarea { font-size: 14px; } }
.count { position: absolute; bottom: 12px; right: 16px; opacity: 0.3; }
.reset {
  position: absolute; bottom: 12px; left: 16px; border: 0; padding: 0; background: none; cursor: pointer;
  text-transform: uppercase; transition: color 0.2s;
}
.reset:hover { color: var(--dim); }
.readout { flex: 1; min-height: 140px; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.ln { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 8px; align-items: baseline; animation: ln-in 0.35s ease both; }
.ln .lc { font-weight: 700; }
.ln .lt { overflow-wrap: anywhere; }
.ln .la { color: var(--faint); text-transform: uppercase; font-size: 11px; margin-left: 6px; }
.ln.bad .lc, .ln.bad .la { color: var(--primary); }
.empty { color: var(--faint); margin: 0; }
@keyframes ln-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.result { min-height: 96px; display: flex; flex-direction: column; gap: 6px; }
.seg { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: 8px 14px; align-items: baseline; animation: ln-in 0.35s ease both; }
.seg .lc { font-weight: 700; }
.seg .lt { overflow-wrap: anywhere; }
.seg .lv { color: var(--faint); font-size: 12px; text-align: right; }
@media (max-width: 640px) { .seg { grid-template-columns: 2.6em minmax(0, 1fr); } .seg .lv { grid-column: 2; text-align: left; } }
.err { color: var(--primary); margin: 0; }

/* API view */
.tabs { display: flex; }
.tabs button {
  margin-left: 16px; padding: 4px 0; border: 0; background: none; cursor: pointer; color: var(--faint); transition: color 0.2s;
}
.tabs button:hover { color: var(--dim); }
.tabs button[aria-selected="true"] { color: var(--foreground); }
.code { min-height: 320px; margin: 0; font: inherit; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- footer */
.footer {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 20; border-top: 1px solid transparent;
  background: #ececec70; backdrop-filter: blur(2rem); -webkit-backdrop-filter: blur(2rem);
  font-size: 1.125rem; transition: border 0.2s ease; padding: 12px 24px;
}
body[data-scrollable="true"] .footer { border-top: 1px solid #fff; }
.footer-in { position: relative; width: 100%; max-width: var(--page-max-width); margin: auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .footer-in { grid-template-columns: repeat(4, minmax(0, 1fr)); } .span2 { grid-column: span 2; } }
.footer .lbl { text-transform: uppercase; display: none; padding-right: 12px; }
@media (min-width: 768px) { .footer .lbl { display: inline; } }

/* play key waveform (openai.fm PlayingWaveform) */
.bars { width: 36px; height: 16px; position: relative; left: 4px; }
.bars i {
  position: absolute; top: 50%; transform: translateY(-50%); width: 2px; height: 20%; background: #fff; border-radius: 2px;
  transition: height 0.15s ease;
}
.bars i:nth-child(1) { left: 0; } .bars i:nth-child(2) { left: 6px; } .bars i:nth-child(3) { left: 12px; }
.bars i:nth-child(4) { left: 18px; } .bars i:nth-child(5) { left: 24px; }
.bars[data-loading="true"] i { animation: wave 1.2s cubic-bezier(0.37, 0, 0.63, 1) infinite; height: 96%; }
.bars[data-loading="true"] i:nth-child(2) { animation-delay: 0.15s; } .bars[data-loading="true"] i:nth-child(3) { animation-delay: 0.3s; }
.bars[data-loading="true"] i:nth-child(4) { animation-delay: 0.45s; } .bars[data-loading="true"] i:nth-child(5) { animation-delay: 0.6s; }
@keyframes wave { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* ---------------------------------------------------------------- video theater */
.theater {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgb(236 236 236 / 0.74); backdrop-filter: blur(1.5rem); -webkit-backdrop-filter: blur(1.5rem);
  animation: th-fade 0.25s ease both;
}
.theater-in { width: min(100%, 1100px, calc((100dvh - 150px) * 16 / 9)); animation: th-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.theater .block-head { margin-bottom: 12px; }
.theater-x { flex: none; width: 32px; height: 32px; padding: 0; }
.theater-x svg { width: 13px; height: 13px; }
.theater-screen { padding: 8px; }
.theater-screen video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-md); background: #111; }
body[data-theater] { overflow: hidden; }
@keyframes th-fade { from { opacity: 0; } }
@keyframes th-rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } }

/* ---------------------------------------------------------------- one-screen layout (user 2026-10-05)
   Two columns at full width: left = how it is read (voices, emotion, accent, speed), right = what is read
   (text, examples, the analysed spans). From 900px wide the page is exactly the window (100dvh): header,
   the two columns, the footer as the last row; only the voice list, the emotion keys and the analysis
   screen scroll, inside their own boxes. Narrower: one column, the page scrolls, the footer stays fixed. */
.board.app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: none; }
.board.app .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; }
.board.app .block { flex: none; margin-bottom: 0; }
.board.app .block-body { padding-top: 10px; }
.scroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* room for the keys' outer shadows inside a scrolling box */
.voices.scroll, .vibes.scroll { padding: 3px 12px 14px 3px; margin: -3px -12px -14px -3px; }

.board.app .voices { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; align-content: start; }
/* a scrolling box fades its bottom edge while there is more below (app.js watchScroll) */
.scroll[data-more="true"] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
@media (max-width: 899px) { .board.app .voices.scroll { max-height: 290px; } }
.board.app .voices .tile { aspect-ratio: auto; height: 50px; min-height: 50px; max-height: none; padding: 8px 11px; }
.board.app .voices .tile .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.board.app .voices .tile .name.long { font-size: 11px; letter-spacing: -0.01em; }
.board.app .voices .tile .led { left: 11px; bottom: 9px; }
.board.app .voices .tile .tag { right: 9px; bottom: 6px; font-size: 10px; }

.pv-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pv-label { text-transform: uppercase; color: var(--dim); font-size: 12px; white-space: nowrap; }
.board.app .langkeys { flex: 1; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.board.app .lkey { min-height: 34px; padding: 6px 2px; align-items: center; justify-content: center; }
.board.app .lkey .lk { font-size: 12px; }
.board.app .lkey .lname { display: none; }
.board.app .lkey .led { top: 4px; right: 4px; width: 5px; height: 5px; }
.pv-note { margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-meta { color: var(--dim); text-transform: uppercase; }

.board.app .vibes { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; align-content: start; max-height: 112px; }
.board.app .vibes .tile { aspect-ratio: auto; height: auto; min-height: 44px; max-height: none; padding: 7px 10px 19px; }
.board.app .vibes .tile .name { font-size: 12.5px; line-height: 1.2; }
.board.app .vibes .tile .tag { display: none; }
.board.app .vibes .tile .led { left: 10px; bottom: 8px; }
.ins-field { position: relative; margin-top: 12px; }
textarea.ins { display: block; height: 62px; resize: none; outline: none; font: inherit; font-size: 13px; line-height: 1.4;
  padding: 10px 96px 10px 12px; }
textarea.ins::placeholder { color: var(--faint); opacity: 1; }
.ins-field .ins-meta { position: absolute; top: 9px; right: 12px; font-size: 11px; text-transform: uppercase; color: var(--dim); }
.ins-field .count { bottom: 8px; right: 12px; font-size: 11px; }
#ins-row .note { margin-top: 8px; }

.board.app .settings .block { flex: 1 1 0; }
.board.app .skey { min-height: 46px; padding: 9px 12px; }
.board.app .settings .note { margin-top: 6px; }

.board.app .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) and (max-width: 899px) { .board.app .presets { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.board.app .presets .tile, .board.app .presets .shuffle { aspect-ratio: auto; height: 58px; min-height: 58px; max-height: none; padding: 9px 11px; }
.board.app .presets .tile .name { font-size: 13px; }
.board.app .presets .tile .tag { font-size: 10px; right: 9px; bottom: 6px; }
.board.app .presets .tile .led { left: 11px; bottom: 9px; }
.board.app .presets .shuffle .ico { width: 30px; height: 30px; }
.board.app .script textarea { min-height: 120px; }
.board.app .readout { min-height: 120px; }
.readout .seg .lv { white-space: nowrap; }

@media (min-width: 900px) {
  body { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .page { flex: 1; min-height: 0; padding: 14px 24px 12px; }
  .hdr { max-width: none; margin: 0 0 14px; }
  .board.app { flex: 1; min-height: 0; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; }
  .board.app .block.grow { flex: 1 1 0; min-height: 0; }
  .board.app .block.grow-text { flex: 1.25 1 0; min-height: 0; }
  .board.app .block.grow > .block-body, .board.app .block.grow-text > .block-body { min-height: 0; }
  .board.app .voices.scroll, .board.app .readout.scroll { flex: 1 1 0; min-height: 0; }
  .board.app .script textarea, .board.app .readout { min-height: 0; }
  #devboard { flex: 1; min-height: 0; overflow: auto; max-width: none; }
  #devboard .code { min-height: 0; }
  .footer { position: static; flex: none; padding: 10px 24px; }
  .footer-in { max-width: none; }
  .footer .key { padding: 8px 12px; }
  .footer .ico { width: 30px; height: 30px; }
}
/* short windows: the header loses its blurb, the emotion keys show two rows */
@media (min-width: 900px) and (max-height: 820px) {
  .hdr-text .dim { display: none; }
  .hdr { margin-bottom: 10px; }
  .board.app .col { gap: 12px; }
  .board.app .vibes { max-height: 100px; }
  #ins-row .note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
