/* Alive Jam home prototype, round 3 (round 2 tokens). Tokens from the build spec, section 2.
   Color only ever means music: the chrome is black and starlight, and every color on
   screen comes from a note (js/chords.js). */

:root {
  --space: #05070D;
  --deep: #0A1A2E;
  --panel: #10131C;
  --starlight: #F1EDE4;
  --dust: #8E8B95;
  --line: rgba(241, 237, 228, .12);
  /* Jam's colors (docs/jam/design/colors.md, Nick, 2026-11-20 and 21). Gold: home, your star, primary buttons, the
     I chord and the Alive star. Riff: his pick (#2D00F4, never behind words) and his words, lines and tints
     (--riff-light). Growth, listening and attention, the last always with its icon and words. */
  --gold: #F6AD3B;
  --riff: #2D00F4;
  --riff-light: #829EFF;
  --growth: #9EDA97;
  --listening: #76D7F4;
  --attention: #EB603A;
  --quiet: #C9BCA5;

  --glass: color-mix(in srgb, var(--panel) 86%, transparent);
  --blur: blur(18px);
  --hair-hi: color-mix(in srgb, var(--starlight) 30%, transparent);
  --lift: color-mix(in srgb, var(--starlight) 6%, transparent);
  --r-card: 14px;
  --r-pill: 999px;

  /* Riff's voice is a serif; everything you tap is Geist. Newsreader is a stand-in until
     the serif is picked on the round 2 board (one line to swap). */
  --serif: "Newsreader", "Noto Music", ui-serif, Georgia, serif;
  --ui: "Geist", "Noto Music", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", "Noto Music", ui-monospace, monospace;

  --gutter: 24px;
  --pill: 640px;
  --col: 846px; /* Menu + pill + Talk to Riff + What can I do? */
  --ease-out: cubic-bezier(.22, .7, .2, 1);
  --t: 140ms;
  --rise: 450ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--space);
  color: var(--starlight);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
output {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .5;
}

:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate var(--t) ease, transform 200ms var(--ease-out);
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.note {
  margin: 10px 0 0;
  color: var(--dust);
  font-size: 13px;
  line-height: 1.45;
}

.note:empty {
  display: none;
}

/* ---------- One hover and press language for every button, card, chip and drawer row ---------- */

:is(.card-row, .chip, .cchip, .starter, .door, .room-go, .menu-btn, .close-btn, .round, .play, .drawer-row, .send, .show-ui, .switch) {
  transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease, scale var(--t) ease;
}

.card,
.drawer {
  transition: border-color var(--t) ease;
}

@media (hover: hover) {
  :is(.chip, .starter, .door, .menu-btn, .close-btn, .round, .play, .show-ui):hover:not(:disabled, .is-soon) {
    border-color: var(--hair-hi);
    background-image: linear-gradient(var(--lift), var(--lift));
    color: var(--starlight);
  }

  :is(.card-row, .drawer-row, .room-go):hover:not(.is-soon) {
    background-color: var(--lift);
  }

  .card:has(.card-row:hover),
  .drawer:has(.drawer-row:hover) {
    border-color: var(--hair-hi);
  }

  .cchip:hover {
    border-color: var(--c);
    background-image: linear-gradient(var(--lift), var(--lift));
  }

  .send:hover {
    background-color: #fff;
  }

  :is(.card-row, .chip, .starter, .door, .menu-btn, .close-btn, .round, .play, .drawer-row, .send, .show-ui):hover:not(:disabled, .is-soon) .ic {
    translate: 0 -1px;
  }
}

:is(.card-row, .chip, .cchip, .starter, .door, .room-go, .menu-btn, .close-btn, .round, .play, .drawer-row, .send, .show-ui, .switch):active:not(:disabled, .is-soon) {
  scale: .98;
}

/* ---------- Layers: backdrop, visualizer, bottom scrim ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--space);
}

.backdrop[data-backdrop="gradient"] {
  background: linear-gradient(180deg, var(--space), var(--deep));
}

.bd-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bd-stars[hidden] {
  display: none;
}

.viz {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  transition: filter var(--rise) var(--ease-out), opacity 250ms ease;
}

body[data-state="riff"] .viz {
  filter: brightness(.55);
}

/* The live Earth (Nick's side): over the visualizer while it's Earth in orbit, cross-fading
   with it when the journey dives to the surface or the visualizer changes. */
.viz-live {
  opacity: 0;
  pointer-events: none;
  transition: filter var(--rise) var(--ease-out), opacity 700ms ease;
}

.viz-live.on {
  opacity: 1;
  pointer-events: auto;
}

.viz.off {
  opacity: 0;
  transition: filter var(--rise) var(--ease-out), opacity 700ms ease;
}

.scrim {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--space) 85%, transparent), transparent);
}

/* ---------- Wordmark ---------- */

.wordmark {
  position: fixed;
  top: 33px;
  left: var(--gutter);
  z-index: 15;
  width: calc(30px * 4727 / 1103);
  height: 30px;
  margin: 0;
  transform-origin: 0 0;
}
/* The mark is drawn on a pseudo-element so the link's focus ring isn't masked away. */
.wordmark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--starlight);
  -webkit-mask: url(img/sway.svg) center / contain no-repeat;
  mask: url(img/sway.svg) center / contain no-repeat;
  pointer-events: none;
}
/* The wordmark reloads the page; the Home button goes home without one. */
.wordmark-link { display: block; width: 100%; height: 100%; border-radius: 6px; }
.wordmark-link:focus-visible { outline: 2px solid var(--starlight); outline-offset: 6px; }

/* ---------- Settings stack (vizz.fm style) ---------- */

.stack {
  position: fixed;
  top: 24px;
  right: var(--gutter);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 332px;
  max-height: calc(100dvh - 24px - 96px);
}

.card {
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.card-h {
  margin: 0;
  font: inherit;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px 0 14px;
  border-radius: inherit;
  text-align: left;
}

.card-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.card-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--dust);
  font-size: 13px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ic-chev,
.card-row .pm {
  width: 16px;
  height: 16px;
  color: var(--dust);
}

.card-row[aria-expanded="true"] .ic-chev {
  transform: rotate(90deg);
}

.card-body {
  padding: 2px 14px 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--dust);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--starlight) 55%, transparent);
  background-color: color-mix(in srgb, var(--starlight) 8%, transparent);
  color: var(--starlight);
}

.chip-icon {
  padding-left: 9px;
  color: var(--starlight);
}

.chip-icon .ic {
  width: 16px;
  height: 16px;
}

.chip-file:focus-within {
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.file-row[hidden] {
  display: none;
}

.file-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--dust);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Customize: a slim slider panel under the stack, vizz style. Label, slider, value. */
.panel {
  flex: 0 1 auto;
  min-height: 0;
  padding: 8px 12px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.panel[hidden] {
  display: none;
}

.srow {
  display: grid;
  grid-template-columns: 100px 1fr 76px;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.srow label,
.srow-label {
  color: var(--dust);
  font-size: 12.5px;
  white-space: nowrap;
}

.srow output {
  color: var(--starlight);
  font-size: 12px;
  text-align: right;
}

.srow-chips {
  margin: 2px 0 4px;
}

.srow-chips .chips {
  grid-column: 2 / 4;
  gap: 4px;
}

.srow-wide .chips {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.srow-chips .chip {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.srow-toggle .switch {
  grid-column: 3;
  justify-self: end;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: transparent;
}

.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dust);
  transition: translate var(--t) ease, background-color var(--t) ease;
}

.switch[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--starlight) 55%, transparent);
  background-color: color-mix(in srgb, var(--starlight) 8%, transparent);
}

.switch[aria-checked="true"] .knob {
  background: var(--starlight);
  translate: 14px 0;
}

@media (hover: hover) {
  .switch:hover {
    border-color: var(--hair-hi);
    background-image: linear-gradient(var(--lift), var(--lift));
  }
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.panel-actions .chip {
  color: var(--starlight);
}

.saved {
  color: var(--dust);
  font-size: 12.5px;
}

.range {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--starlight) 22%, transparent);
}

.range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--starlight);
  -webkit-appearance: none;
  appearance: none;
  transition: scale var(--t) ease;
}

.range:hover::-webkit-slider-thumb {
  scale: 1.15;
}

.range::-moz-range-track {
  height: 2px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--starlight) 22%, transparent);
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--starlight);
}

/* Collapsed to icons when Riff is up or the screen is narrow; opens back into full rows. */
.stack.is-compact {
  top: 26px;
  flex-direction: row;
  gap: 6px;
  width: auto;
}

.stack.is-compact .card {
  border-radius: var(--r-pill);
}

.stack.is-compact .card-row {
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}

.stack.is-compact .card-label,
.stack.is-compact .card-value,
.stack.is-compact .ic-chev,
.stack.is-compact .card-row .pm {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stack.is-floating {
  width: min(332px, calc(100vw - 2 * var(--gutter)));
}

/* ---------- Stage: Riff, the conversation and the drawers ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 110px var(--gutter) 150px;
  pointer-events: none;
}

.stage > * {
  pointer-events: auto;
}

.riff {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(var(--col), 100%);
}

.opener {
  width: fit-content;
  max-width: 680px;
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -.005em;
  text-align: center;
  text-wrap: balance;
  position: relative;
  isolation: isolate;
}

/* A soft, quiet scrim, so the opener still reads when the planet glows behind it (Nick, N3).
   No edge you can see: space at the middle, fading out well past the words. */
.opener::before {
  content: "";
  position: absolute;
  inset: -36px -72px;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--space) 62%, transparent), color-mix(in srgb, var(--space) 30%, transparent) 60%, transparent);
  pointer-events: none;
}

.bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.menu-btn,
.close-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font-size: 14px;
  font-weight: 500;
}

/* Holds its place on the home screen so the pill stays centered under Riff. */
body[data-state="home"] .menu-btn {
  visibility: hidden;
}

body[data-state="home"] .home-btn {
  display: none;
}

.ask {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field {
  display: flex;
  align-items: center;
  width: var(--pill);
  max-width: 100%;
  height: 64px;
  padding: 0 8px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color var(--t) ease;
}

.field:hover {
  border-color: var(--hair-hi);
}

.field:has(input:focus-visible) {
  border-color: color-mix(in srgb, var(--starlight) 40%, transparent);
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: 17px;
  text-overflow: ellipsis;
}

.field input::placeholder {
  color: var(--dust);
  opacity: 1;
}

.ibtn {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
}

/* Riff's voice: a quiet speaker inside the ask pill, off by default (js/riffvoice.js). */
.voice-btn {
  width: 40px;
  height: 40px;
  margin-right: 4px;
  color: var(--dust);
  transition: background-color var(--t) ease, color var(--t) ease;
}

.voice-btn[aria-pressed="true"] {
  color: var(--starlight);
}

@media (hover: hover) {
  .voice-btn:hover {
    background-color: var(--lift);
    color: var(--starlight);
  }
}

.send {
  width: 48px;
  height: 48px;
  background-color: var(--starlight);
  color: var(--space);
}

.round {
  border: 1px solid var(--line);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.round[aria-pressed="true"],
.round[aria-expanded="true"] {
  border-color: var(--starlight);
  background-color: var(--starlight);
  color: var(--space);
}

.starter .ic {
  width: 16px;
  height: 16px;
  color: var(--dust);
}

.bar-note {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: min(var(--pill), 100%);
  margin: 0;
  text-align: center;
  transform: translateX(-50%);
}

/* ---------- The doors: Listen, Learn and Create, one quiet row under Riff (js/rooms.js) ---------- */

.doors {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

/* The bar's note sits where the doors are, so they step down while it shows. */
.riff:has(.bar-note:not(:empty)) .doors {
  margin-top: 56px;
}

.door {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: color-mix(in srgb, var(--starlight) 74%, transparent);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* 36px to see, 44px to hit. */
.door::after {
  content: "";
  position: absolute;
  inset: -5px 0;
}

.door .ic {
  width: 16px;
  height: 16px;
}

.doors .door[aria-expanded="true"] {
  border-color: var(--starlight);
  color: var(--starlight);
}

.gl-note {
  margin-top: 56px;
  text-align: center;
}

body[data-state="riff"] .gl-note {
  display: none;
}

/* The band is already playing, silently, when you land: one quiet line until the first tap. */
.sound-note {
  margin-top: 18px;
  color: color-mix(in srgb, var(--starlight) 74%, transparent);
  text-align: center;
  text-shadow: 0 0 3px var(--space), 0 0 10px var(--space), 0 0 18px var(--space);
}

body[data-state="riff"] .sound-note {
  display: none;
}

.convo,
.drawers {
  display: none;
}

/* State 2: Riff rises */
body[data-state="riff"] .stage {
  justify-content: flex-start;
  padding: 16px var(--gutter) var(--gutter);
}

body[data-state="riff"] .opener {
  display: none;
}

body[data-state="riff"] .convo {
  display: block;
  flex: 0 1 auto;
  width: min(var(--pill), 100%);
  min-height: 96px;
  max-height: 40dvh;
  margin-top: 12px;
  padding: 18px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

body[data-state="riff"] .convo.is-rising {
  overflow: visible;
}

body[data-state="riff"] .drawers {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  width: min(var(--col), 100%);
  margin-top: auto;
  padding-top: 16px;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 60ch;
  margin: 0;
}

.msg-riff {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
}

.msg-riff b {
  font-weight: 500;
}

/* While the real Riff thinks: three dots breathing in turn. */
.msg-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
}

.msg-thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dust);
  animation: thinking 1.2s ease-in-out infinite;
}

.msg-thinking span:nth-child(2) {
  animation-delay: .16s;
}

.msg-thinking span:nth-child(3) {
  animation-delay: .32s;
}

@keyframes thinking {
  0%,
  100% {
    opacity: .25;
  }

  40% {
    opacity: 1;
  }
}

.msg-you {
  align-self: flex-end;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--lift);
  font-size: 15px;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}

.msg-actions .chip {
  min-height: 36px;
  font-size: 14px;
}

/* Riff's menu, inside his reply: each room's name over its top items (js/rooms.js). */
.msg-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-menu-groups {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--ui);
}

.msg-menu-h {
  margin: 0 0 8px;
  color: var(--starlight);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.msg-menu .chip {
  min-height: 36px;
  font-size: 14px;
}

.msg-menu .text-btn {
  margin: -6px 0 -10px -12px;
}

/* A quiet text button: More, Fewer, See everything. */
.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--dust);
  font-size: 14px;
  font-weight: 500;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--t) ease, text-decoration-color var(--t) ease;
}

@media (hover: hover) {
  .text-btn:hover {
    color: var(--starlight);
    text-decoration-color: currentColor;
  }
}

.word {
  opacity: 0;
  animation: word-in 240ms var(--ease-out) forwards;
}

@keyframes word-in {
  to {
    opacity: 1;
  }
}

.drawer {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.drawer-h {
  margin: 0;
  font: inherit;
}

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 0 16px 0 20px;
  border-radius: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.pm {
  color: var(--dust);
}

.pm-v {
  transition: opacity 200ms var(--ease-out);
}

:is(.drawer-row, .card-row)[aria-expanded="true"] .pm-v {
  opacity: 0;
}

.drawer-body {
  padding: 0 20px 16px;
}

.drawer-body[hidden] {
  display: none;
}

.drawer-chords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.prog {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The row of chords: the song builder's card (js/chordcard.js, songbuilder.css .cc), each wide enough for its name
   and its number. The one the band is on wears the card's ring (.cc.is-now). */
.prog li {
  width: 72px;
}

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bpm {
  color: var(--dust);
}

.lyric {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  font-size: 17px;
}

.lyric::placeholder {
  color: var(--dust);
  opacity: 1;
}

.parts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.part {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 14px;
  font-weight: 500;
}

.part-wave {
  flex: 1;
  min-width: 0;
  height: 20px;
  fill: none;
  stroke: var(--dust);
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* ---------- Moon: the player (N23), dark since 2026-11-17 ----------
   The drawers were a light instrument (warm white floating in the night sky) until Nick tried the
   dark song builder beside them: "Yes, we need to update the new drawers to make it dark". Now every
   drawer, and every layer and sheet a drawer opens (drill.css), is starlight on the panel colour, as
   the song builder is. The --moon- names stay, because every drawer's styles are written with them;
   their values are dark. Text on the body is at least 4.5:1: --moon-ink 15.9:1 and --moon-mtext 7.5:1
   on --panel. The --sb- tokens are the song builder's own names for the same look (songbuilder.css),
   set here so its chord card (.cc) reads the same in every drawer. */

.drawers,
.drill {
  --sb-bg: var(--panel);
  --sb-card: #0A0C13;
  --sb-box: #171A23;
  --sb-ink: var(--starlight);
  --sb-ink2: #C9C5CE;
  --sb-mute: #A6A3AC;
  --sb-line: rgba(241, 237, 228, .12);
  --sb-line2: rgba(241, 237, 228, .3);
}

.drawers {
  --moon-body: var(--panel);
  --moon-body-hi: #171A23;
  --moon-body-lo: var(--panel);
  --moon-grain: none;
  --moon-ink: var(--starlight);
  --moon-mtext: #A6A3AC;
  --moon-line: rgba(241, 237, 228, .12);
  --moon-bevel-hi: rgba(255, 255, 255, .06);
  --moon-raised: #222632;
  --moon-raised-lo: #1A1D27;
  --moon-raised-edge: #05070D;
  --moon-raised-hl: rgba(255, 255, 255, .1);
  --moon-raised-rim: rgba(241, 237, 228, .16);
  --moon-key-hi: #F1EDE4;
  --moon-key-lo: #DAD6CF;
  --moon-key-edge: #8E8B95;
  --moon-key-ink: #05070D;
  --moon-key-rim: rgba(241, 237, 228, .4);
  --moon-trk-off: #05070D;
  --moon-trk-off-ink: #A6A3AC;
  --moon-thumb: repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .14) 0 .8px, rgba(0, 0, 0, .045) .8px 2px), conic-gradient(#E8E7E4, #FFFFFF 9%, #BDBBB6 21%, #8E8C87 31%, #D0CEC9 44%, #FDFDFC 56%, #B5B3AE 69%, #8C8A85 80%, #D6D4CF 92%, #E8E7E4);
  --moon-dev-shadow: none;
  /* A Band player that's on lights in the home chord's color (gold, step 1 in both palettes). CSS can't read
     the playing chord's color from the Chords drawer, and the switches stay calm this way. */
  --moon-lit: #F6AD3B;
}

.drawers .drawer {
  border-color: var(--moon-line);
  border-radius: 18px;
  background: var(--moon-body);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--moon-dev-shadow);
  color: var(--moon-ink);
}

.drawers :focus-visible {
  outline-color: var(--moon-ink);
}

/* The row fills the drawer, so its ring sits inside, on the body. */
.drawers .drawer-row:focus-visible {
  outline-offset: -4px;
}

.drawers .pm,
.drawers .bpm {
  color: var(--moon-mtext);
}

@media (hover: hover) {
  .drawers .drawer-row:hover {
    background-color: color-mix(in srgb, var(--moon-ink) 5%, transparent);
  }
}

/* Play: Moon's dark key. */
.drawers .transport .js-band-toggle {
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-color: transparent;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 3px 0 var(--moon-key-edge), 0 9px 14px -6px rgba(0, 0, 0, .5), 0 0 0 1px var(--moon-key-rim);
  color: var(--moon-key-ink);
}

@media (hover: hover) {
  .drawers .transport .js-band-toggle:hover {
    filter: brightness(1.08);
  }
}

/* The Band: each player's name, then Moon's slide switch with on or off printed in its track. */
.drawers #dr-band .chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 24px;
}

.drawers .chip[data-part] {
  position: relative;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 0 0 2px;
  border-color: transparent;
  background: none;
  color: var(--moon-ink);
  font-size: 15px;
}

.drawers .chip[data-part]::after {
  content: "off";
  content: "off" / "";
  flex: none;
  width: 58px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--moon-trk-off);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), 0 1px 0 var(--moon-bevel-hi);
  color: var(--moon-trk-off-ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: .02em;
  text-align: right;
}

.drawers .chip[data-part]::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 35px;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--moon-thumb);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: translate 200ms var(--ease-out);
}

.drawers .chip[data-part][aria-pressed="true"]::after {
  content: "on";
  content: "on" / "";
  padding-left: 9px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--moon-lit) 74%, #000), var(--moon-lit));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35), 0 1px 0 var(--moon-bevel-hi);
  color: var(--moon-lit-ink, #15130F);
  text-align: left;
}

.drawers .chip[data-part][aria-pressed="true"]::before {
  translate: 32px 0;
}

/* Words and Song on the drawer's body. */
.drawers .lyric {
  border-bottom-color: var(--moon-raised-edge);
  color: var(--moon-ink);
}

.drawers .lyric::placeholder {
  color: var(--moon-mtext);
}

.drawers .part {
  border-color: var(--moon-line);
}

.drawers .part-wave {
  stroke: var(--moon-mtext);
}

/* ---------- Bottom: the starter marquee, Play, and the corner buttons ---------- */

.bottom {
  position: fixed;
  right: calc(var(--gutter) + 110px);
  bottom: var(--gutter);
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: opacity 300ms var(--ease-out);
}

body[data-state="riff"] .bottom {
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
}

/* The starters sit still and scroll by hand (Nick, N2: a moving strip is hard to read and to tap).
   The home options replace this row with a few fixed starters. */
.marquee {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 4%, black 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 4%, black 94%, transparent);
}

.marquee::-webkit-scrollbar {
  display: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 4px 16px;
  list-style: none;
}

.marquee-track li {
  margin-right: 8px;
  scroll-snap-align: start;
}

/* Typing to Riff on the home (Nick, 2026-11-14). At rest the starter row waits; tap into the box and it sits just
   under it (js/main.js moves it into .compose-row), and the doors step aside while you type. */
body[data-state="home"]:not(.is-composing) .bottom .marquee {
  visibility: hidden;
}

/* As wide as the box: .riff centres its children, and without a set width the track's max-content width would
   push the row off screen. */
.compose-row {
  width: min(var(--pill), 100%);
  min-width: 0;
  margin-top: 12px;
}

.compose-row:empty {
  display: none;
}

.riff:has(.bar-note:not(:empty)) .compose-row {
  margin-top: 52px;
}

body.is-composing .doors {
  display: none;
}

/* On a phone the keyboard needs the room: the play bar and the corner wait too. */
@media (max-width: 760px) {
  body.is-composing :is(.tbar, .corner, .bottom) {
    visibility: hidden;
  }
}

/* Starters that promise something not built yet: shown, greyed, not tappable (Nick, N2). */
.starter.is-soon {
  color: var(--dust);
  cursor: default;
}

.soon-tag {
  margin-left: 2px;
  color: var(--dust);
  font-size: 12px;
}

.starter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  font-size: 14px;
  white-space: nowrap;
}

.play {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font-size: 15px;
  font-weight: 600;
}

.corner {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 12;
  display: flex;
  gap: 6px;
}

.corner-btn {
  width: 48px;
  height: 48px;
}

.corner-btn[hidden] {
  display: none;
}

.show-ui {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font-size: 14px;
  font-weight: 500;
}

.show-ui[hidden] {
  display: none;
}

:is(.wordmark, .stack, .stage, .bottom, .corner, .scrim) {
  transition: opacity 300ms var(--ease-out), visibility 0s;
}

/* Hide UI (round 4): the settings stack and the corner buttons fade; "Show UI" brings them back.
   Riff, the Menu and the Chords drawer stay (js/hideui.js closes the other drawers). */
body.ui-hidden :is(.stack, .corner) {
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
}

/* ---------- Full screen: the display state (js/fullscreen.js) ---------- */

/* Every piece of chrome fades. What's left is the visual, and what the display menu turns on. */
body.is-display :is(.wordmark, .stack, .stage, .bottom, .corner, .scrim) {
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
}

body.is-display .viz {
  filter: none;
}

body.is-display.fs-no-viz .viz {
  opacity: 0;
}

body.is-display:not(.fs-menu-on) {
  cursor: none;
}

.fs-show,
.fs-menu {
  display: none;
}

body.is-display .fs-show {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter) max(var(--gutter), env(safe-area-inset-bottom));
  pointer-events: none;
}

.fs-lyric {
  max-width: 32ch;
  margin: 0;
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 3px var(--space), 0 0 10px var(--space), 0 0 18px var(--space);
}

.fs-lyric[hidden],
.fs-chords[hidden] {
  display: none;
}

.fs-chords {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 32px;
  max-width: 100%;
  padding: 16px 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.fs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fs-next {
  opacity: .5;
}

/* A chord takes its root's color, as in the Chords drawer; the one playing is filled. */
.fs-name {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--c, var(--starlight)) 60%, transparent);
  border-radius: var(--r-pill);
  color: color-mix(in oklab, var(--c, var(--starlight)) 70%, var(--starlight));
  font-size: 18px;
  font-weight: 600;
  transition: background-color var(--t) ease, color var(--t) ease;
}

.fs-now.is-lit .fs-name {
  border-color: var(--c);
  background-color: var(--c);
  color: var(--on, var(--space));
}

.fs-dias {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.fs-dia {
  width: clamp(80px, 10vw, 160px);
  margin: 0;
  text-align: center;
}

.fs-dia[data-inst="kb"] {
  width: clamp(260px, 26vw, 420px);
}

.fs-next .fs-dia {
  width: clamp(56px, 6.5vw, 104px);
}

.fs-next .fs-dia[data-inst="kb"] {
  width: clamp(170px, 15vw, 240px);
}

/* On a phone the piano you're on gets the room, and the next one stays small beside it. */
@media (max-width: 700px) {
  .fs-dia[data-inst="kb"] {
    width: min(58vw, 300px);
  }

  .fs-next .fs-dia[data-inst="kb"] {
    width: min(30vw, 130px);
  }
}

.fs-dia .cd-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--starlight);
}

.cd-svg .basef {
  font-family: var(--mono);
}

.fs-dia figcaption {
  margin-top: 4px;
  color: var(--dust);
  font-size: 12px;
}

/* The display menu: shows on a mouse move or a tap, fades after about 2.5 seconds idle. */
body.is-display .fs-menu {
  position: fixed;
  top: 24px;
  right: var(--gutter);
  z-index: 40;
  display: block;
  width: 248px;
  padding: 8px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
}

body.is-display.fs-menu-on .fs-menu {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms var(--ease-out), visibility 0s;
}

.fs-menu .srow {
  grid-template-columns: 1fr auto;
  min-height: 36px;
}

.fs-menu .srow[hidden] {
  display: none;
}

.fs-menu .srow-toggle .switch {
  grid-column: 2;
}

.fs-exit {
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  color: var(--starlight);
}

/* ---------- A room: the sheet a door opens (js/rooms.js) ---------- */

/* Phones: a bottom sheet over the screen, with the visual playing on behind it. */
.room {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  max-height: 72dvh;
  padding-bottom: env(safe-area-inset-bottom);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.room[hidden] {
  display: none;
}

.room-grab {
  flex: none;
  align-self: center;
  width: 36px;
  height: 4px;
  margin-top: 8px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--starlight) 22%, transparent);
}

.room-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 12px 0 20px;
}

.room-h {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.room-line {
  flex: none;
  margin: 0 20px;
  color: var(--dust);
  font-size: 14px;
}

.room-body {
  min-height: 0;
  padding: 10px 8px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.room-go {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
}

.room-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.room-sub {
  color: var(--dust);
  font-size: 13.5px;
  line-height: 1.4;
}

/* The "i": a 24px hairline circle in a 44px hit area. */
.room-i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
}

.room-i span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  transition: border-color var(--t) ease, color var(--t) ease;
}

.room-i[aria-expanded="true"] span {
  border-color: color-mix(in srgb, var(--starlight) 55%, transparent);
  color: var(--starlight);
}

@media (hover: hover) {
  .room-i:hover span {
    border-color: var(--hair-hi);
    color: var(--starlight);
  }
}

.room-info {
  grid-column: 1 / -1;
  max-width: 52ch;
  margin: 0;
  padding: 0 12px 10px;
  color: color-mix(in srgb, var(--starlight) 74%, transparent);
  font-size: 13.5px;
  line-height: 1.45;
}

.room-info[hidden] {
  display: none;
}

.room-more {
  margin: 4px 0 2px;
}

.room-list[hidden] {
  display: none;
}

/* Wide screens: a panel that drops from under the doors (js/rooms.js sets --room-top). */
@media (min-width: 900px) {

  .room {
    top: var(--room-top, 120px);
    bottom: auto;
    width: min(560px, 92vw);
    max-height: calc(100dvh - var(--room-top, 120px) - 24px);
    margin: 0 auto;
    padding-bottom: 0;
    border-bottom: 1px solid var(--line);
    border-radius: var(--r-card);
  }

  .room-grab {
    display: none;
  }

  .room-head {
    padding-top: 12px;
  }
}

/* ---------- Menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter);
  background: color-mix(in srgb, var(--space) 94%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.menu[hidden] {
  display: none;
}

.close-btn {
  align-self: flex-end;
}

/* The three rooms. Open lists can run past the screen, so this scrolls; the auto margins center it
   when it fits and let it start at the top when it doesn't. */
.menu-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 16px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-nav > ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(var(--pill), 100%);
  margin: auto;
  padding: 0;
  list-style: none;
}

.menu-h {
  margin: 0;
  font: inherit;
}

.menu-room {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
  color: var(--starlight);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: text-decoration-color var(--t) ease;
}

.menu-room .pm {
  width: 24px;
  height: 24px;
}

.menu-room[aria-expanded="true"] .pm-v {
  opacity: 0;
}

@media (hover: hover) {
  .menu-room:hover {
    text-decoration-color: currentColor;
  }
}

/* Rows line up with the room's name, as in a room's sheet. */
.menu-nav .room-list {
  margin: 4px 0 20px -12px;
}

/* ---------- Responsive ---------- */

/* Riff's bar drops under the wordmark row once it no longer fits beside it. */
@media (max-width: 1379px) {
  body[data-state="riff"] .stage {
    padding-top: 84px;
  }
}

/* The drawers would run under the corner buttons: leave them a row. */
@media (max-width: 1140px) {
  body[data-state="riff"] .stage {
    padding-bottom: calc(var(--gutter) + 60px);
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
  }

  .wordmark {
    top: 23px;
  }

  .stack {
    max-height: calc(100dvh - 16px - 80px);
  }

  .stack.is-compact {
    top: 16px;
  }

  .stack.is-compact .card-row {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .stage {
    padding: 90px var(--gutter) 120px;
  }

  body[data-state="riff"] .stage {
    padding-top: 70px;
  }

  .opener {
    margin-bottom: 22px;
    font-size: 28px;
  }

  .menu-room {
    font-size: 44px;
  }
}

/* On phones the whole form becomes the pill, with Talk and the "?" inside it. */
@media (max-width: 640px) {
  .bar {
    gap: 6px;
  }

  body[data-state="home"] .menu-btn {
    display: none;
  }

  .menu-btn {
    justify-content: center;
    width: 44px;
    padding: 0;
  }

  .menu-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .ask {
    flex: 1;
    gap: 0;
    height: 56px;
    padding: 0 5px 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--glass);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
  }

  .ask:has(input:focus-visible) {
    outline: 2px solid var(--starlight);
    outline-offset: 3px;
  }

  .field {
    display: contents;
  }

  .field input {
    order: 0;
    font-size: 16px;
  }

  .field input::placeholder {
    font-size: 15px;
  }

  /* (Riff's voice was here too, until it moved to the chat's header on 18 November: journey.css.) */
  #talk {
    order: 1;
  }

  #helpBtn {
    order: 2;
  }

  .send {
    order: 3;
    width: 42px;
    height: 42px;
    margin-left: 2px;
  }

  .voice-btn {
    width: 34px;
    height: 34px;
    margin-right: 0;
  }

  .ask .round {
    width: 34px;
    height: 34px;
    border: 0;
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .convo {
    padding: 14px 16px;
  }

  .drawer-body {
    padding: 0 16px 14px;
  }

  .parts {
    grid-template-columns: 1fr;
  }

  .bottom {
    right: calc(var(--gutter) + 94px);
    gap: 10px;
  }

  .corner-btn {
    width: 42px;
    height: 42px;
  }

  .play {
    height: 42px;
    padding: 0 16px 0 12px;
  }

  .srow {
    grid-template-columns: 92px 1fr 70px;
  }

  .fs-menu .srow {
    grid-template-columns: 1fr auto;
  }

  body.is-display .fs-menu {
    top: 16px;
  }

  .fs-chords {
    gap: 18px;
    padding: 12px 14px 14px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .word {
    opacity: 1;
    animation: none;
  }

  .msg-thinking span {
    opacity: .6;
    animation: none;
  }

  .ic,
  .pm-v,
  .switch .knob,
  .drawers .chip[data-part]::before {
    transition: none;
  }

  :is(.card-row, .chip, .cchip, .starter, .door, .room-go, .menu-btn, .close-btn, .round, .play, .drawer-row, .send, .show-ui, .switch):active:not(:disabled) {
    scale: none;
  }
}

/* Riff's pick badge (js/alivemark.js pickBadge): the small pick, then "Riff's pick", on a soft violet pill. */
.rp-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 5px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--riff-light) 18%, transparent);
  color: #AFC0FF;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}

.rp-badge .rp {
  display: block;
  flex: none;
  width: auto;
  height: 15px;
}
