:root {
  color-scheme: dark;

  --canvas: #090a0c;
  --canvas-soft: #101216;
  --surface: rgba(27, 29, 34, .82);
  --surface-solid: #191b20;
  --surface-raised: #24272d;
  --surface-hover: #2b2e35;
  --track: #34373f;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #f5f5f7;
  --text-secondary: #a8a9b0;
  --text-tertiary: #70727a;
  --accent: #0a84ff;
  --accent-bright: #64d2ff;
  --success: #32d26f;
  --warning: #ff9f0a;
  --danger: #ff453a;

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --page-gap: clamp(16px, 2vw, 28px);
  --shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(10, 132, 255, .13), transparent 64%),
    radial-gradient(760px 460px at 102% 12%, rgba(232, 33, 39, .07), transparent 64%),
    linear-gradient(180deg, var(--canvas-soft) 0%, var(--canvas) 56%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="slider"] {
  -webkit-user-select: none;
  user-select: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
  opacity: .8;
}

.ambient-primary {
  top: -260px;
  left: -180px;
  width: 560px;
  height: 560px;
  background: rgba(10, 132, 255, .05);
}

.ambient-secondary {
  top: 20%;
  right: -320px;
  width: 580px;
  height: 580px;
  background: rgba(232, 33, 39, .035);
}

.shell {
  width: min(1380px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(var(--page-gap), env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(var(--page-gap), env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--page-gap);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.secure-chip {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 590;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.secure-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.surface {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(135%);
  -webkit-backdrop-filter: blur(30px) saturate(135%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Pairing */

.pairing-view {
  min-height: min(680px, calc(100vh - 142px));
  min-height: min(680px, calc(100dvh - 142px));
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
}

.pair-copy,
.pair-device {
  padding: clamp(34px, 5vw, 72px);
}

.pair-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  border-right: 1px solid var(--border);
}

.pair-copy h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(39px, 4.7vw, 68px);
  font-weight: 650;
  line-height: .98;
  letter-spacing: -.055em;
}

.intro {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--text-secondary);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
}

.steps {
  display: grid;
  gap: 14px;
}

.step {
  max-width: 48ch;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 13px;
}

.step > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.step p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.step strong {
  color: var(--text);
  font-weight: 620;
}

.pair-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 590;
}

.reset-pairing {
  min-height: 38px;
  padding: 0 14px;
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 640;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.reset-pairing:hover {
  border-color: var(--text-tertiary);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--text-tertiary);
  box-shadow: 0 0 0 4px rgba(112, 114, 122, .1);
}

.dot[data-state="live"] {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(50, 210, 111, .12);
}

.dot[data-state="wait"] {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255, 159, 10, .11);
  animation: breathe 2.2s ease-in-out infinite;
}

.dot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 69, 58, .12);
}

.pair-device {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 3vw, 38px);
  background:
    radial-gradient(480px 330px at 50% 38%, rgba(10, 132, 255, .075), transparent 72%);
}

.qr-frame {
  width: clamp(220px, 28vw, 310px);
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.qr-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.relay-form {
  width: min(100%, 570px);
  display: grid;
  gap: 14px;
}

.field-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.field-heading label {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.field-heading p,
.field-hint {
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.4;
}

.relay-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input-wrap {
  min-width: 0;
  height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .2);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.input-wrap:focus-within {
  border-color: rgba(10, 132, 255, .72);
  background: rgba(0, 0, 0, .27);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .13);
}

.input-wrap svg {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.input-wrap input::placeholder {
  color: var(--text-tertiary);
}

.connect-button {
  min-height: 58px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  appearance: none;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--canvas);
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
}

.connect-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connect-button:hover {
  opacity: .88;
}

.connect-button:active {
  transform: scale(.975);
}

/* Playback dashboard */

.play-view {
  width: 100%;
  min-width: 0;
}

.dashboard {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: var(--page-gap);
  align-items: stretch;
}

.player-panel,
.library-panel {
  min-width: 0;
  min-height: min(710px, calc(100vh - 142px));
  min-height: min(710px, calc(100dvh - 142px));
}

.player-panel {
  padding: clamp(28px, 3.6vw, 50px);
  display: flex;
  flex-direction: column;
}

.player-heading {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.player-heading > div:first-child {
  min-width: 0;
}

.now {
  max-width: 16ch;
  min-height: 1.05em;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(34px, 4.5vw, 64px);
  font-weight: 610;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now[data-idle="true"] {
  color: var(--text-secondary);
}

.media-state {
  min-height: 35px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

.media-wave {
  height: 15px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.media-wave i {
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent-bright);
  animation: wave .9s ease-in-out infinite alternate;
}

.media-wave i:nth-child(2) {
  height: 13px;
  animation-delay: -.25s;
}

.media-wave i:nth-child(3) {
  height: 9px;
  animation-delay: -.5s;
}

.media-state[data-playing="false"] .media-wave {
  opacity: .45;
}

.media-state[data-playing="false"] .media-wave i {
  height: 3px;
  animation: none;
}

.timeline {
  width: 100%;
  min-width: 0;
  margin-top: clamp(36px, 6vh, 76px);
}

.scrub {
  position: relative;
  min-width: 0;
  padding: 17px 0;
  cursor: pointer;
  touch-action: none;
}

.bar {
  --value: 0%;
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--track);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  border-radius: inherit;
  background: var(--accent);
}

.bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--value);
  width: 18px;
  height: 18px;
  border: 3px solid var(--text);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .34);
  transform: translate(-50%, -50%);
  transition: width .16s ease, height .16s ease;
}

.scrub:hover .bar::after,
.bar:focus-visible::after {
  width: 22px;
  height: 22px;
}

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.transport {
  width: 100%;
  min-width: 0;
  margin-top: clamp(30px, 5vh, 62px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.control-button {
  min-width: 0;
  min-height: clamp(94px, 11vw, 118px);
  padding: 14px 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 12px;
  font-weight: 630;
  cursor: pointer;
  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;
}

.control-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.control-button:active {
  transform: scale(.975);
}

.control-button .glyph {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
}

.control-button svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-button svg .filled {
  fill: currentColor;
  stroke: none;
}

.control-button svg text {
  fill: currentColor;
  stroke: none;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 7px;
  font-weight: 750;
  text-anchor: middle;
}

.control-primary,
.control-primary:hover {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 34px rgba(10, 132, 255, .25);
}

.control-primary[data-active="true"] {
  background: #0878e5;
}

.play-glyph .icon-pause {
  display: none;
}

.play-glyph[data-icon="pause"] .icon-play {
  display: none;
}

.play-glyph[data-icon="pause"] .icon-pause {
  display: block;
}

.device-controls {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: clamp(36px, 5vh, 60px);
  display: grid;
  gap: 10px;
}

.device-slider-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 620;
}

.device-slider-heading output {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.device-slider[data-disabled="true"] {
  opacity: .38;
  pointer-events: none;
}

.device-slider-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 14px;
}

.device-slider-control .scrub {
  padding: 14px 0;
}

.device-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-icon .filled {
  fill: var(--text-secondary);
  stroke: none;
}

.volume-low {
  width: 19px;
  justify-self: end;
}

.brightness-low {
  width: 18px;
  justify-self: end;
}

.device-lock {
  width: 100%;
  min-height: 58px;
  margin-top: 4px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.device-lock:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, .06);
}

.device-lock:active {
  transform: scale(.985);
}

.device-lock[data-active="true"] {
  border-color: rgba(255, 159, 10, .45);
  background: rgba(255, 159, 10, .11);
}

.device-lock-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.device-lock[data-active="true"] .device-lock-icon {
  background: var(--warning);
  color: #171719;
}

.device-lock-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-lock-icon .icon-locked,
.device-lock[data-active="true"] .icon-unlocked {
  display: none;
}

.device-lock[data-active="true"] .icon-locked {
  display: block;
}

.device-lock-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.device-lock-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-lock-copy small {
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 530;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-lock-state {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.device-lock[data-active="true"] .device-lock-state {
  color: var(--warning);
}

/* Library */

.library-panel {
  min-width: 0;
  padding: clamp(24px, 3vw, 38px) 0 20px;
  display: flex;
  flex-direction: column;
}

.library-heading {
  min-height: 62px;
  padding: 0 clamp(22px, 3vw, 34px) 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.library-heading > div {
  min-width: 0;
  flex: 1;
}

.library-heading .eyebrow {
  margin-bottom: 5px;
}

.library-heading h2 {
  max-width: 25ch;
  margin: 0;
  overflow: hidden;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-raised);
  cursor: pointer;
}

.up:hover {
  background: var(--surface-hover);
}

.up svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-toggle {
  min-height: 42px;
  padding: 0 12px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease,
              transform .16s ease;
}

.camera-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.camera-toggle:active {
  transform: scale(.975);
}

.camera-toggle[data-active="true"] {
  border-color: rgba(255, 69, 58, .42);
  background: rgba(255, 69, 58, .13);
  color: #ff6961;
}

.camera-toggle-icon,
.camera-toggle-icon svg {
  width: 19px;
  height: 19px;
}

.camera-toggle-icon {
  display: grid;
  place-items: center;
}

.camera-toggle svg,
.camera-placeholder svg,
.camera-privacy svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-viewer {
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background:
    radial-gradient(420px 280px at 50% 38%, rgba(10, 132, 255, .09), transparent 72%);
}

.camera-viewer[hidden] {
  display: none;
}

.camera-frame {
  position: relative;
  min-height: 300px;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #050608;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .42);
}

.camera-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050608;
}

.camera-frame img[hidden] {
  display: none;
}

.camera-placeholder {
  max-width: 30ch;
  padding: 28px;
  display: grid;
  place-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-align: center;
}

.camera-placeholder[hidden] {
  display: none;
}

.camera-placeholder-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
}

.camera-placeholder-icon svg {
  width: 26px;
  height: 26px;
}

.camera-viewer[data-state="starting"] .camera-placeholder-icon {
  color: var(--accent-bright);
  animation: breathe 1.6s ease-in-out infinite;
}

.camera-viewer[data-state="denied"] .camera-placeholder-icon,
.camera-viewer[data-state="unavailable"] .camera-placeholder-icon,
.camera-viewer[data-state="failed"] .camera-placeholder-icon {
  color: var(--danger);
}

.camera-placeholder strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.camera-placeholder small {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
}

.camera-live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(9, 10, 12, .72);
  color: #fff;
  font-size: 10px;
  font-weight: 740;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.camera-live-badge[hidden] {
  display: none;
}

.camera-live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 69, 58, .14);
  animation: breathe 1.7s ease-in-out infinite;
}

.camera-privacy {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.camera-privacy svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.items {
  min-height: 0;
  margin: 0;
  padding: 10px clamp(12px, 1.7vw, 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-color: var(--surface-hover) transparent;
  scrollbar-width: thin;
}

.items li + li {
  border-top: 1px solid var(--border);
}

.item {
  width: 100%;
  min-height: 74px;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  appearance: none;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.item:hover {
  background: rgba(255, 255, 255, .055);
}

.item:active {
  transform: scale(.99);
}

.item .kind {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.item .kind svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item .kind svg .filled {
  fill: currentColor;
  stroke: none;
}

.item .name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 590;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item .meta {
  color: var(--text-tertiary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item[data-kind="folder"]::after {
  content: "›";
  margin-left: -5px;
  color: var(--text-tertiary);
  font-size: 22px;
  font-weight: 300;
}

.item[data-kind="folder"] {
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
}

.item[data-playing="true"] .name,
.item[data-playing="true"] .kind,
.item[data-playing="true"] .meta {
  color: var(--accent-bright);
}

.item[data-playing="true"] .kind {
  background: rgba(10, 132, 255, .16);
}

.empty {
  min-height: 260px;
  padding: 36px 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
}

.empty::before {
  content: "▶";
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 18px;
}

/* Focus, motion and system modes */

button:focus-visible,
[role="slider"]:focus-visible {
  outline: 3px solid rgba(10, 132, 255, .72);
  outline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

@keyframes breathe {
  50% {
    opacity: .45;
  }
}

@keyframes wave {
  from {
    transform: scaleY(.55);
  }
  to {
    transform: scaleY(1);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --canvas: #ececf1;
    --canvas-soft: #f7f7fa;
    --surface: rgba(255, 255, 255, .82);
    --surface-solid: #fff;
    --surface-raised: #f0f0f4;
    --surface-hover: #e7e7ec;
    --track: #d7d7dd;
    --border: rgba(0, 0, 0, .08);
    --border-strong: rgba(0, 0, 0, .14);
    --text: #151518;
    --text-secondary: #606169;
    --text-tertiary: #898a92;
    --shadow: 0 26px 70px rgba(38, 39, 44, .12);
  }

  body {
    background:
      radial-gradient(900px 520px at 8% -12%, rgba(10, 132, 255, .10), transparent 64%),
      radial-gradient(760px 460px at 102% 12%, rgba(232, 33, 39, .05), transparent 64%),
      linear-gradient(180deg, var(--canvas-soft) 0%, var(--canvas) 62%);
  }

  .secure-chip,
  .status-pill,
  .media-state {
    background: rgba(255, 255, 255, .62);
  }

  .input-wrap {
    background: rgba(255, 255, 255, .68);
  }

  .input-wrap:focus-within {
    background: #fff;
  }

  .connect-button {
    background: #171719;
    color: #fff;
  }

  .item:hover {
    background: rgba(0, 0, 0, .035);
  }
}

@media (max-width: 1020px) {
  .pairing-view {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr);
  }

  .pair-copy,
  .pair-device {
    padding: clamp(28px, 4vw, 46px);
  }

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

  .player-panel,
  .library-panel {
    min-height: 0;
  }

  .library-panel {
    max-height: 620px;
  }

  .camera-frame {
    min-height: 380px;
  }

  .items {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .shell {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .secure-chip span {
    display: none;
  }

  .secure-chip {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .pairing-view {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .pair-copy {
    gap: 30px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .pair-copy h1 {
    font-size: clamp(40px, 11.5vw, 58px);
  }

  .pair-device {
    min-height: 360px;
  }

  .relay-entry {
    grid-template-columns: 1fr;
  }

  .connect-button {
    width: 100%;
  }

  .player-panel {
    padding: 26px 20px;
  }

  .media-state {
    display: none;
  }

  .now {
    font-size: clamp(34px, 10vw, 48px);
  }

  .timeline {
    margin-top: 34px;
  }

  .transport {
    margin-top: 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-button {
    min-height: 102px;
  }

  .device-controls {
    padding-top: 36px;
  }

  .library-heading {
    padding-left: 20px;
    padding-right: 20px;
  }

  .camera-frame {
    min-height: min(420px, 75vw);
  }

}

@media (max-width: 430px) {
  :root {
    --radius-xl: 24px;
    --page-gap: 12px;
  }

  .device-lock {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .device-lock-state {
    display: none;
  }

  .camera-toggle {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .camera-toggle > span:last-child {
    display: none;
  }

  .pair-copy,
  .pair-device {
    padding: 28px 20px;
  }

  .intro {
    font-size: 15px;
  }

  .qr-frame {
    width: min(100%, 270px);
  }

  .item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .item[data-kind="folder"] {
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
  }

  .item .kind {
    width: 36px;
    height: 36px;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --border: rgba(255, 255, 255, .25);
    --border-strong: rgba(255, 255, 255, .42);
    --text-secondary: #c4c5ca;
    --text-tertiary: #a0a1a8;
  }
}
