/* ============================================================
   transmissions — base design system
   App shell, glass, buttons, chips, inputs, sheets, toasts,
   skeletons, empty states, member cards, masonry, motion.
   Reads tokens.css. Views layer their own css on top of this.
   ============================================================ */

/* ---------------------------------------------------------- */
/* 1 · Reset + base                                            */
/* ---------------------------------------------------------- */

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

html {
  height: 100%;
  background: var(--world);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background: var(--world);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

::selection {
  background: var(--accent-45);
  color: var(--fg);
}

/* scroll lock while a sheet is open */
html.sheet-lock,
html.sheet-lock body {
  overflow: hidden;
}

/* ---------------------------------------------------------- */
/* 2 · Typography roles                                        */
/* ---------------------------------------------------------- */

.t-display-xl {
  font-size: var(--fs-display-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: 0.92;
}

.t-display {
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 0.98;
}

.t-headline {
  font-size: var(--fs-headline);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.t-subhead {
  font-size: var(--fs-subhead);
  font-weight: 600;
  letter-spacing: var(--tracking-head);
  line-height: 1.05;
}

.t-title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: var(--tracking-title);
  line-height: 1.1;
}

.t-lede {
  font-size: var(--fs-lede);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.62;
  color: var(--fg-muted);
}

.t-small {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--fg-dim);
}

/* the machine voice: the only uppercase in the app */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-dim);
}

.micro {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* the lavender word: one per headline, one weight step up */
.accent {
  color: var(--accent);
  font-weight: 700;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* TX serial eyebrow */
.serial {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label-wide);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
}

.serial b {
  font-weight: 600;
  color: var(--accent-70);
}

/* ---------------------------------------------------------- */
/* 3 · The world layer                                         */
/* ---------------------------------------------------------- */

#world {
  position: fixed;
  inset: 0;
  z-index: var(--z-world);
  background: var(--world);
  pointer-events: none;
  overflow: hidden;
}

/* faint ambient light so the frame is never dead,
   even before the fx layers mount */
#world::before {
  content: '';
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(38% 30% at 28% 18%, rgba(196, 181, 253, 0.05), transparent 70%),
    radial-gradient(44% 36% at 76% 82%, rgba(196, 181, 253, 0.035), transparent 70%);
  animation: world-drift 46s var(--ease-glide) infinite alternate;
}

#world::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 50% 0%,
    rgba(196, 181, 253, 0.04),
    transparent 55%
  );
}

@keyframes world-drift {
  from {
    transform: translate3d(-2.5%, -1.5%, 0) scale(1);
  }
  to {
    transform: translate3d(2.5%, 2%, 0) scale(1.06);
  }
}

/* ---------------------------------------------------------- */
/* 4 · Top bar                                                 */
/* ---------------------------------------------------------- */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-chrome);
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) calc(var(--s-4) + var(--safe-right)) 0
    calc(var(--s-4) + var(--safe-left));
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: linear-gradient(rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.55) 70%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur-soft));
  backdrop-filter: blur(var(--glass-blur-soft));
}

.top-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: var(--tap-min);
  border-radius: var(--r-m);
  color: var(--accent);
  transition: color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.top-mark svg {
  width: 17px;
  height: 24px;
  filter: drop-shadow(0 0 10px rgba(196, 181, 253, 0.4));
  animation: mark-breathe 5.2s ease-in-out infinite;
}

.top-mark:hover {
  color: var(--accent-strong);
}

.top-mark:active {
  transform: scale(0.92);
}

@keyframes mark-breathe {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.top-wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: var(--tracking-title);
  line-height: 1;
  color: var(--fg);
  padding: 10px 2px;
  transition: color var(--t-fast) var(--ease-out);
}

.top-wordmark:hover {
  color: var(--accent);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.top-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--r-m);
  color: var(--fg-muted);
  transition: color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.top-icon svg {
  width: 21px;
  height: 21px;
}

.top-icon:hover {
  color: var(--fg);
  background: rgba(245, 245, 247, 0.06);
}

.top-icon:active {
  transform: scale(0.9);
}

#top-mute .icon-muted {
  display: none;
}

#top-mute.is-muted .icon-sound {
  display: none;
}

#top-mute.is-muted .icon-muted {
  display: block;
}

#top-mute.is-muted {
  color: var(--fg-faint);
}

/* unread badge on the signal bell */
.badge {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 0 10px rgba(196, 181, 253, 0.5);
  animation: badge-in 0.35s var(--ease-glide) backwards;
}

.badge[hidden] {
  display: none;
}

@keyframes badge-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* your card, as a chip */
.top-chip {
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--r-m);
  color: var(--accent);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.top-chip svg {
  width: 26px;
  height: 19px;
  filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.35));
}

.top-chip:hover {
  background: var(--accent-06);
}

.top-chip:active {
  transform: scale(0.9);
}

/* ---------------------------------------------------------- */
/* 5 · Stage                                                   */
/* ---------------------------------------------------------- */

main#stage {
  position: relative;
  z-index: var(--z-stage);
  min-height: 100dvh;
  padding: calc(var(--topbar-h) + var(--safe-top) + var(--s-4))
    calc(var(--stage-pad-x) + var(--safe-right))
    calc(var(--dock-h) + var(--dock-gap) + var(--safe-bottom) + var(--s-7))
    calc(var(--stage-pad-x) + var(--safe-left));
}

#stage > .view {
  width: 100%;
  max-width: var(--stage-max);
  margin-inline: auto;
}

/* ---------------------------------------------------------- */
/* 6 · Bottom dock                                             */
/* ---------------------------------------------------------- */

#dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-dock);
  display: flex;
  justify-content: center;
  padding: 0 calc(var(--s-4) + var(--safe-left)) calc(var(--dock-gap) + var(--safe-bottom))
    calc(var(--s-4) + var(--safe-right));
  pointer-events: none;
}

.dock-pill {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  width: 100%;
  max-width: 430px;
  height: var(--dock-h);
  padding: 0 var(--s-2);
  border-radius: var(--r-pill);
  background: var(--pane);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
}

.dock-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  border-radius: var(--r-l);
  color: var(--fg-dim);
  transition: color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.dock-slot svg {
  width: 22px;
  height: 22px;
  transition: transform var(--t-med) var(--ease-glide);
}

.dock-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
  transform: translateX(0.12em); /* optically recenters tracked text */
}

.dock-slot:hover {
  color: var(--fg);
}

.dock-slot:hover svg {
  transform: translateY(-1px);
}

.dock-slot:active {
  transform: scale(0.92);
}

.dock-slot.is-active {
  color: var(--accent);
}

.dock-slot.is-active svg {
  filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.45));
}

/* the transmit star: raised, star-shaped, alive */
.dock-slot-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-transmit {
  position: relative;
  width: 62px;
  height: 78px;
  margin-top: -26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-l);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast) var(--ease-out);
}

.dock-transmit::before {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-28), transparent 62%);
  filter: blur(8px);
  animation: transmit-breathe 3.8s ease-in-out infinite;
  pointer-events: none;
}

.dock-star {
  position: relative;
  width: 46px;
  height: 66px;
  color: var(--accent);
  filter: drop-shadow(0 2px 14px rgba(196, 181, 253, 0.55))
    drop-shadow(0 10px 26px rgba(0, 0, 0, 0.6));
  transition: transform var(--t-med) var(--ease-glide),
    filter var(--t-med) var(--ease-out);
}

.dock-transmit:hover .dock-star {
  transform: scale(1.06) rotate(4deg);
  filter: drop-shadow(0 2px 18px rgba(196, 181, 253, 0.75))
    drop-shadow(0 10px 26px rgba(0, 0, 0, 0.6));
}

.dock-transmit:active {
  transform: scale(0.9);
}

@keyframes transmit-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* ---------------------------------------------------------- */
/* 7 · Glass panes                                             */
/* ---------------------------------------------------------- */

.pane {
  background: var(--pane);
  border: var(--glass-border);
  border-radius: var(--r-xl);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow-soft);
}

.pane-soft {
  background: var(--pane-soft);
  border: var(--glass-border);
  border-radius: var(--r-l);
  -webkit-backdrop-filter: blur(var(--glass-blur-soft));
  backdrop-filter: blur(var(--glass-blur-soft));
}

.pane-hard {
  background: var(--pane-hard);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--glass-shadow);
}

/* a slow light sweep along a pane's top hairline; ambience, not chrome */
.pane-lit {
  position: relative;
  overflow: hidden;
}

.pane-lit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-45) 45%,
    var(--accent-70) 50%,
    var(--accent-45) 55%,
    transparent
  );
  background-size: 300% 100%;
  animation: pane-sweep 9s linear infinite;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes pane-sweep {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -150% 0;
  }
}

/* ---------------------------------------------------------- */
/* 8 · Buttons                                                 */
/* ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap-min);
  padding: 11px 22px;
  border-radius: var(--r-m);
  background: rgba(245, 245, 247, 0.06);
  border: 1px solid rgba(245, 245, 247, 0.12);
  color: var(--fg);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}

.btn:hover {
  background: rgba(245, 245, 247, 0.1);
  border-color: rgba(245, 245, 247, 0.22);
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: var(--glow-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--glow-accent-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-muted);
}

.btn-ghost:hover {
  background: rgba(245, 245, 247, 0.06);
  border-color: transparent;
  color: var(--fg);
}

.btn-outline-accent {
  background: var(--accent-06);
  border-color: var(--accent-45);
  color: var(--accent);
}

.btn-outline-accent:hover {
  background: var(--accent-10);
  border-color: var(--accent-70);
}

/* casting call live states only */
.btn-live {
  background: var(--live-14);
  border-color: var(--live-45);
  color: var(--live);
}

.btn-sm {
  min-height: 34px;
  padding: 7px 14px;
  font-size: var(--fs-small);
  border-radius: 11px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 30px;
  font-size: var(--fs-lede);
  border-radius: var(--r-l);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--fg-dim) var(--fg-dim) transparent transparent;
  animation: spin 0.7s linear infinite;
}

.btn-primary.is-loading::after {
  border-color: var(--accent-ink) var(--accent-ink) transparent transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* bare icon button */
.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--r-m);
  color: var(--fg-muted);
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  color: var(--fg);
  background: rgba(245, 245, 247, 0.07);
}

.icon-btn:active {
  transform: scale(0.88);
}

/* ---------------------------------------------------------- */
/* 9 · Chips + tier chips                                      */
/* ---------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(245, 245, 247, 0.06);
  border: 1px solid var(--hairline);
  color: var(--fg-muted);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}

a.chip:hover,
button.chip:hover {
  background: rgba(245, 245, 247, 0.1);
  border-color: var(--hairline-strong);
  color: var(--fg);
}

a.chip:active,
button.chip:active {
  transform: scale(0.95);
}

.chip.is-active {
  background: var(--accent-16);
  border-color: var(--accent-45);
  color: var(--accent);
}

/* tier chips: DAY PLAYER → AUTEUR, escalating light */
.tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--fg-dim);
  background: rgba(245, 245, 247, 0.04);
  white-space: nowrap;
}

.tier[data-tier='CREW'] {
  color: var(--fg-muted);
  border-color: var(--hairline-strong);
}

.tier[data-tier='TALENT'] {
  color: var(--accent);
  border-color: var(--accent-28);
  background: var(--accent-06);
}

.tier[data-tier='MARQUEE'] {
  color: var(--accent);
  border-color: var(--accent-45);
  background: var(--accent-10);
  box-shadow: 0 0 14px rgba(196, 181, 253, 0.18);
}

.tier[data-tier='AUTEUR'] {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 16px rgba(196, 181, 253, 0.4);
}

/* founding cast marker: the star mark before the tier text
   (verified STAR_PATH, skills/canvas-animation) */
.tier.is-founding::before {
  content: '';
  width: 7px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 574 820'%3E%3Cpath d='M 286.78 817.00 C 286.43 815.62 285.64 809.77 285.03 804.00 C 284.41 798.23 283.02 787.88 281.94 781.00 C 257.48 625.91 181.59 499.93 77.49 441.62 C 58.18 430.81 38.15 422.85 15.68 417.05 L 0.85 413.23 L 8.68 411.49 C 71.55 397.50 132.34 356.17 179.71 295.21 C 234.12 225.18 271.62 129.84 284.03 30.00 C 286.91 6.83 287.16 5.90 288.20 15.00 C 295.97 83.69 313.21 147.04 339.75 204.50 C 381.25 294.34 444.85 362.72 517.05 395.12 C 530.02 400.94 553.59 408.94 565.47 411.55 L 573.44 413.30 L 560.47 416.55 C 524.66 425.52 494.02 440.37 462.50 464.00 C 381.36 524.86 321.43 630.64 296.55 756.90 C 293.62 771.76 288.90 803.44 287.73 816.00 C 287.44 819.16 287.35 819.25 286.78 817.00 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 574 820'%3E%3Cpath d='M 286.78 817.00 C 286.43 815.62 285.64 809.77 285.03 804.00 C 284.41 798.23 283.02 787.88 281.94 781.00 C 257.48 625.91 181.59 499.93 77.49 441.62 C 58.18 430.81 38.15 422.85 15.68 417.05 L 0.85 413.23 L 8.68 411.49 C 71.55 397.50 132.34 356.17 179.71 295.21 C 234.12 225.18 271.62 129.84 284.03 30.00 C 286.91 6.83 287.16 5.90 288.20 15.00 C 295.97 83.69 313.21 147.04 339.75 204.50 C 381.25 294.34 444.85 362.72 517.05 395.12 C 530.02 400.94 553.59 408.94 565.47 411.55 L 573.44 413.30 L 560.47 416.55 C 524.66 425.52 494.02 440.37 462.50 464.00 C 381.36 524.86 321.43 630.64 296.55 756.90 C 293.62 771.76 288.90 803.44 287.73 816.00 C 287.44 819.16 287.35 819.25 286.78 817.00 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ON AIR presence dot: lavender, never red */
.onair-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 10px rgba(196, 181, 253, 0.7);
  animation: onair-breathe 2.6s ease-in-out infinite;
}

@keyframes onair-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* the one red light in the app: casting call live, live events */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--live);
  box-shadow: 0 0 12px var(--live-45);
  animation: onair-breathe 1.4s ease-in-out infinite;
}

/* ---------------------------------------------------------- */
/* 10 · Inputs                                                 */
/* ---------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.field-label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-dim);
}

.input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 16px;
  border-radius: var(--r-m);
  background: rgba(245, 245, 247, 0.05);
  border: 1px solid rgba(245, 245, 247, 0.12);
  color: var(--fg);
  font-size: 16px; /* stops iOS zoom-on-focus */
  line-height: 1.4;
  caret-color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--fg-faint);
}

.input:hover {
  border-color: rgba(245, 245, 247, 0.2);
}

.input:focus {
  outline: none;
  border-color: var(--accent-70);
  background: rgba(245, 245, 247, 0.07);
  box-shadow: 0 0 0 3px var(--accent-16);
}

/* accent-marked error state (red stays ON AIR only) */
.input.is-invalid {
  border-color: var(--accent-70);
}

textarea.input {
  min-height: 96px;
  resize: none;
  line-height: 1.55;
}

.field-hint {
  font-size: var(--fs-small);
  color: var(--fg-faint);
}

/* mono inputs (codes, handles) */
.input-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

/* range slider (control room texture, etc.) */
input[type='range'].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--tap-min);
  background: transparent;
  cursor: pointer;
}

input[type='range'].slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(245, 245, 247, 0.14);
}

input[type='range'].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #08080c;
  box-shadow: 0 0 12px rgba(196, 181, 253, 0.5);
  transition: transform var(--t-fast) var(--ease-out);
}

input[type='range'].slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

input[type='range'].slider::-moz-range-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(245, 245, 247, 0.14);
}

input[type='range'].slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #08080c;
  box-shadow: 0 0 12px rgba(196, 181, 253, 0.5);
}

/* ---------------------------------------------------------- */
/* 11 · Bottom sheets                                          */
/* ---------------------------------------------------------- */

#sheet-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  pointer-events: none;
}

.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: auto;
  transition: opacity var(--t-med) var(--ease-glide);
}

.sheet-scrim.is-open {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  width: 100%;
  max-width: 560px;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-3) var(--s-5) calc(var(--s-6) + var(--safe-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--pane);
  border: var(--glass-border);
  border-bottom: 0;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  transform: translateY(104%);
  transition: transform 0.46s var(--ease-glide);
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet:focus {
  outline: none;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto var(--s-4);
  border-radius: var(--r-pill);
  background: rgba(245, 245, 247, 0.18);
}

.sheet-title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: var(--tracking-title);
  line-height: 1.1;
  margin-bottom: var(--s-4);
}

/* confirm sheet internals (ui.confirm) */
.confirm-body {
  padding: var(--s-2) 0 var(--s-5);
  color: var(--fg-muted);
  font-size: var(--fs-lede);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: var(--s-3);
}

.confirm-actions .btn {
  flex: 1;
}

/* ---------------------------------------------------------- */
/* 12 · Toasts                                                 */
/* ---------------------------------------------------------- */

#toast-root {
  position: fixed;
  left: var(--s-4);
  right: var(--s-4);
  bottom: calc(var(--dock-h) + var(--dock-gap) + var(--safe-bottom) + var(--s-4));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, 100%);
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--pane-hard);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--glass-shadow-soft);
  color: var(--fg);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.35;
  animation: toast-in 0.42s var(--ease-glide) backwards;
}

.toast.is-leaving {
  animation: toast-out 0.3s var(--ease-out) forwards;
}

.toast::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
}

.toast-ok::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(196, 181, 253, 0.6);
}

.toast-warn::before {
  background: var(--fg);
  box-shadow: 0 0 8px rgba(245, 245, 247, 0.5);
}

.toast-warn {
  border-color: rgba(245, 245, 247, 0.28);
}

.toast-live::before {
  background: var(--live);
  box-shadow: 0 0 10px var(--live-45);
  animation: onair-breathe 1.2s ease-in-out infinite;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  60% {
    transform: translateY(-2px) scale(1.01);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

/* ---------------------------------------------------------- */
/* 13 · Skeleton loaders                                       */
/* ---------------------------------------------------------- */

.skel {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-m);
  background: rgba(245, 245, 247, 0.045);
}

.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(196, 181, 253, 0.06) 46%,
    rgba(245, 245, 247, 0.08) 50%,
    rgba(196, 181, 253, 0.06) 54%,
    transparent 70%
  );
  background-size: 220% 100%;
  animation: skel-sweep 1.7s var(--ease-out) infinite;
}

@keyframes skel-sweep {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -90% 0;
  }
}

.skel-line {
  height: 13px;
  border-radius: 7px;
}

.skel-line + .skel-line {
  margin-top: 9px;
}

.skel-line.w-60 {
  width: 60%;
}

.skel-line.w-40 {
  width: 40%;
}

.skel-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
}

.skel-card {
  border-radius: var(--r-l);
  min-height: 120px;
}

.skel-tile {
  border-radius: var(--r-l);
  aspect-ratio: 4 / 5;
}

/* ---------------------------------------------------------- */
/* 14 · Empty states (in-world, never grey boxes)              */
/* ---------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-9) var(--s-6);
}

.empty-star {
  width: 26px;
  height: 38px;
  color: var(--accent-45);
  filter: drop-shadow(0 0 12px rgba(196, 181, 253, 0.25));
  animation: mark-breathe 4.4s ease-in-out infinite;
}

.empty-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.empty-title {
  font-size: var(--fs-lede);
  font-weight: 600;
  letter-spacing: var(--tracking-title);
  color: var(--fg-muted);
  max-width: 34ch;
}

.empty-sub {
  font-size: var(--fs-small);
  color: var(--fg-dim);
  max-width: 40ch;
}

/* ---------------------------------------------------------- */
/* 15 · Avatars + mini member cards                            */
/* ---------------------------------------------------------- */

.avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #17171f, #0c0c11);
  border: 1px solid var(--hairline);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar svg {
  width: 34%;
  height: 48%;
  color: var(--accent-45);
}

.mini-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3);
  border-radius: var(--r-l);
  background: var(--pane-soft);
  border: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur-soft));
  backdrop-filter: blur(var(--glass-blur-soft));
  text-align: left;
  transition: background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), transform var(--t-med) var(--ease-glide),
    box-shadow var(--t-med) var(--ease-out);
}

a.mini-card:hover,
button.mini-card:hover {
  background: rgba(26, 26, 34, 0.78);
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

a.mini-card:active,
button.mini-card:active {
  transform: scale(0.97);
}

.mini-card-body {
  flex: 1;
  min-width: 0;
}

.mini-name {
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: var(--tracking-title);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-handle {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-card .tier {
  flex: none;
}

/* ---------------------------------------------------------- */
/* 16 · Masonry (ui.grid lays children into these columns)     */
/* ---------------------------------------------------------- */

.masonry {
  display: flex;
  align-items: flex-start;
  gap: var(--masonry-gap, 12px);
}

.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--masonry-gap, 12px);
}

/* ---------------------------------------------------------- */
/* 17 · Marquee ticker helper                                  */
/* ---------------------------------------------------------- */

.marquee {
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: inline-flex;
  gap: var(--s-8);
  padding-right: var(--s-8);
  animation: marquee 20s linear infinite;
  will-change: transform;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------------------- */
/* 18 · Holo foil shimmer (card foil + prop finishes ONLY)     */
/* ---------------------------------------------------------- */

.holo-foil {
  position: relative;
  overflow: hidden;
}

.holo-foil::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 18%,
    var(--holo-a) 34%,
    var(--holo-b) 46%,
    var(--holo-c) 58%,
    transparent 74%
  );
  background-size: 260% 260%;
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: holo-sweep 6.5s linear infinite;
  pointer-events: none;
}

@keyframes holo-sweep {
  from {
    background-position: 130% 130%;
  }
  to {
    background-position: -60% -60%;
  }
}

/* ---------------------------------------------------------- */
/* 19 · Motion primitives                                      */
/* ---------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rise {
  animation: rise 0.5s var(--ease-glide) backwards;
}

@keyframes press-pop {
  0% {
    transform: scale(0.96);
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(196, 181, 253, 0.25);
  }
  50% {
    box-shadow: 0 0 26px rgba(196, 181, 253, 0.5);
  }
}

.breathe {
  animation: mark-breathe 4.6s ease-in-out infinite;
}

/* ---------------------------------------------------------- */
/* 20 · Scrollbars                                             */
/* ---------------------------------------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 245, 247, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 245, 247, 0.14);
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 245, 247, 0.26);
}

/* ---------------------------------------------------------- */
/* 21 · Focus                                                  */
/* ---------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-70);
  outline-offset: 2px;
}

.input:focus-visible {
  outline: none; /* the input carries its own focus ring */
}

/* ---------------------------------------------------------- */
/* 22 · Utility                                                */
/* ---------------------------------------------------------- */

[hidden] {
  display: none !important;
}

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

.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.spacer {
  flex: 1;
}

.divider {
  height: 1px;
  background: var(--hairline);
  border: 0;
  margin: var(--s-4) 0;
}

/* ---------------------------------------------------------- */
/* 23 · Desktop refinements                                    */
/* ---------------------------------------------------------- */

@media (min-width: 720px) {
  :root {
    --stage-pad-x: 32px;
    --dock-gap: 20px;
  }

  #topbar {
    padding-inline: calc(var(--s-6) + var(--safe-left)) calc(var(--s-6) + var(--safe-right));
  }

  .dock-pill {
    max-width: 460px;
  }

  .dock-label {
    font-size: 9px;
  }
}

/* ---------------------------------------------------------- */
/* 24 · Reduced motion + hidden tab: full stop                 */
/* ---------------------------------------------------------- */

/* motion.js stamps .is-hidden on <html> when the tab is hidden */
html.is-hidden *,
html.is-hidden *::before,
html.is-hidden *::after {
  animation-play-state: paused !important;
}

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

  .marquee-track {
    animation: none;
    transform: none;
  }

  .holo-foil::after {
    animation: none;
    background-position: 50% 50%;
  }
}
