:root {
  /* Brand palette — see docs/brand.md. Change here, nowhere else. */
  --bg: #0B1020;
  --surface: #111a2f;
  --surface-2: #182340;
  --ink: #ffffff;
  --dim: #b3bccc;
  --faint: #6B7280;
  --line: #22304f;
  --line-lit: #2f4270;
  --accent: #007BFF;
  --accent-deep: #0056E0;
  --accent-top: #00C2FF;
  --accent-soft: rgba(0, 123, 255, 0.16);
  --red: #e5493d;                 /* danger + live indicator only */
  --red-soft: rgba(229, 73, 61, 0.14);
  --green: #5dbb84;
  --green-soft: rgba(93, 187, 132, 0.14);
  --amber: #d9a44e;
  --amber-soft: rgba(217, 164, 78, 0.14);
  --blue: #7ea7d8;
  --blue-soft: rgba(126, 167, 216, 0.14);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--ink);
  background:
    radial-gradient(55% 40% at 88% 10%, rgba(0, 123, 255, 0.20), transparent 62%),
    radial-gradient(45% 35% at 8% 100%, rgba(0, 194, 255, 0.16), transparent 60%),
    linear-gradient(165deg, #0B1020 0%, #0d1531 55%, #0B1020 100%);
  background-attachment: fixed;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--accent-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.4rem 4.5rem; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .2rem 0 1.6rem; }
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none;
}
.dot {
  width: .62rem; height: .62rem; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px rgba(0,123,255,.5);
}
.topbar .grow { flex: 1; }
.search {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: 9px; padding: .45rem .8rem; font: inherit; font-size: .88rem;
  width: 220px; transition: border-color .15s ease, width .2s ease;
}
.search:focus { outline: none; border-color: var(--line-lit); width: 260px; }
.search::placeholder { color: var(--faint); }
.count { color: var(--faint); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
button, .btn {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: .45rem .9rem; font: inherit; font-size: .87rem;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  gap: .4rem; transition: border-color .12s ease, background .12s ease, transform .06s ease;
}
button:hover, .btn:hover { border-color: var(--line-lit); background: #2a2d35; }
button:active, .btn:active { transform: translateY(1px); }
.btn-red {
  background: linear-gradient(180deg, var(--accent-top) -40%, var(--accent) 55%, var(--accent-deep) 130%);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 2px 14px rgba(0,123,255,.35);
}
.btn-red:hover { background: linear-gradient(180deg, var(--accent-top) -20%, var(--accent) 70%); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }

/* ---------- Library grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-2px); border-color: var(--line-lit);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.card .thumb {
  aspect-ratio: 16/9; background: var(--surface-2) center/cover no-repeat;
  display: flex; align-items: flex-start; justify-content: flex-start;
  position: relative; text-decoration: none; padding: .55rem;
}
.card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.35));
  opacity: 0; transition: opacity .15s ease;
}
.card:hover .thumb::after { opacity: 1; }
.card .thumb .dur {
  position: absolute; right: .55rem; bottom: .55rem; z-index: 1;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  color: #fff; font-size: .73rem; font-weight: 500;
  padding: .12rem .45rem; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.card .meta { padding: .75rem .9rem .85rem; display: flex; flex-direction: column; gap: .35rem; }
.card .title {
  font-weight: 600; font-size: .94rem; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .title:hover { color: var(--accent-top); }
.card .sub { color: var(--faint); font-size: .78rem; display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.card .actions {
  display: flex; gap: .35rem; margin-top: .45rem;
  opacity: .55; transition: opacity .15s ease;
}
.card:hover .actions { opacity: 1; }
.card .actions button { padding: .28rem .6rem; font-size: .77rem; border-radius: 7px; }

.pill {
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  padding: .12rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--dim);
}
.pill.public { background: var(--green-soft); color: var(--green); }
.pill.password { background: var(--amber-soft); color: var(--amber); }
.pill.private { background: var(--red-soft); color: var(--red); }
.pill.processing, .pill.uploading { background: var(--blue-soft); color: var(--blue); }
.pill.failed { background: var(--red-soft); color: var(--red); }

.empty { color: var(--faint); text-align: center; padding: 5rem 1rem; }
.empty .dot { display: inline-block; margin-bottom: 1rem; }
.empty p { margin: .25rem 0; }

/* ---------- Watch page ---------- */
body.watchpage { min-height: 100vh; }
.watch { max-width: 1240px; margin: 0 auto; }
.watch .topbar { justify-content: center; padding-bottom: 1.2rem; }

.watchgrid {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.15rem; align-items: start;
}
.watchmain { min-width: 0; }

.sidebar {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column;
  position: sticky; top: 1rem;
  height: calc(100vh - 8rem); min-height: 420px; max-height: 760px;
  overflow: hidden;
}
.tabs {
  display: flex; gap: 3px; padding: 8px; border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1; background: transparent; border: none; color: var(--dim);
  font-size: .86rem; font-weight: 600; padding: .45rem .5rem; border-radius: 8px;
}
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button.active { background: var(--accent); color: #fff; }
.pane {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  padding: .9rem;
}
.pane[hidden] { display: none; }
.reactrow { display: flex; justify-content: center; padding-bottom: .5rem; }

@media (max-width: 940px) {
  .watchgrid { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: none; min-height: 0; }
  .comments { max-height: 340px; }
  .transcript { max-height: 340px; }
}
.player-shell {
  border-radius: 16px; overflow: hidden; background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-height: 72vh; margin: 0 auto;
  aspect-ratio: 16/9;
}
.player { width: 100%; height: 100%; aspect-ratio: 16/9; background: #000; display: block; object-fit: contain; }
.processing-msg { display: flex; align-items: center; justify-content: center; color: var(--faint); }

.infobar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: .95rem 1.15rem; margin-top: 1.15rem;
}
.infobar h1 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 .2rem; }
.infobar .sub { color: var(--faint); font-size: .82rem; display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.infobar .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.watch .desc {
  color: var(--dim); margin-top: .9rem; white-space: pre-wrap; font-size: .92rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: .9rem 1.15rem;
}
.powered { text-align: center; color: var(--faint); font-size: .8rem; margin-top: 2rem; }
.powered.after-grid { display: none; }
.powered span { color: var(--dim); font-weight: 600; }

/* ---------- Watch page panels (analytics / transcript / comments) ---------- */
.panelcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.15rem; margin-top: 1rem;
}
.panelhead { display: flex; align-items: center; gap: .8rem; }
.panelhead h2 { font-size: .95rem; margin: 0; letter-spacing: -.01em; }
.panelhead .btn-ghost { margin-left: auto; padding: .25rem .6rem; font-size: .8rem; }
.panelsub { color: var(--faint); font-size: .82rem; }

.histo {
  display: flex; align-items: flex-end; gap: 1px; height: 64px; margin-top: .9rem;
  background: rgba(255,255,255,.03); border-radius: 8px; padding: 4px; overflow: hidden;
}
.histo span {
  flex: 1; min-height: 2px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent-top), var(--accent));
  opacity: .85;
}

.transcript { flex: 1; min-height: 0; overflow-y: auto; }
.cue {
  display: flex; gap: .7rem; padding: .3rem .5rem; border-radius: 8px;
  font-size: .88rem; color: var(--dim); cursor: pointer; line-height: 1.45;
}
.cue span { color: var(--faint); font-size: .78rem; min-width: 2.6rem; padding-top: .1rem; font-variant-numeric: tabular-nums; }
.cue:hover { background: var(--surface-2); color: var(--ink); }
.cue.active { background: var(--accent-soft); color: var(--ink); }
.cue.active span { color: var(--accent-top); }

/* Reactions bar: every emoji is a button; counts ride along */
.reactbar {
  display: flex; justify-content: space-between; gap: .25rem;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 12px; padding: .35rem;
}
.emoji {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  padding: .4rem .2rem; font-size: 1.1rem; min-height: 0; cursor: pointer;
  transition: background .12s ease, transform .1s ease;
}
.emoji:hover { background: var(--surface-2); border-color: transparent; transform: translateY(-1px); }
.emoji.mine { background: var(--accent-soft); border-color: rgba(0,123,255,.35); }
.emoji .n { font-size: .78rem; font-weight: 600; color: var(--dim); }
.emoji.mine .n { color: var(--accent-top); }

/* Comments */
.comments { flex: 1; min-height: 0; overflow-y: auto; margin-top: .9rem; display: flex; flex-direction: column; gap: .9rem; }
.comment { display: flex; gap: .7rem; align-items: flex-start; }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h, 210) 80% 55%), hsl(calc(var(--h, 210) + 30) 80% 40%));
}
.cmain { flex: 1; min-width: 0; }
.chead { display: flex; align-items: center; gap: .45rem; font-size: .85rem; min-height: 22px; }
.chead b { font-weight: 600; }
.tchip {
  background: var(--accent-soft); color: var(--accent-top); border: none; border-radius: 6px;
  padding: .05rem .4rem; font-size: .74rem; font-weight: 600; cursor: pointer; min-height: 0;
}
.tchip:hover { background: rgba(0,123,255,.28); border: none; }
.cwhen { color: var(--faint); font-size: .76rem; }
.cdel {
  background: none; border: none; color: var(--faint); cursor: pointer; padding: 0 .25rem;
  margin-left: auto; font-size: 1rem; line-height: 1; min-height: 0;
}
.cdel:hover { color: var(--red); background: none; border: none; }
.cbody { color: var(--dim); font-size: .92rem; margin-top: .15rem; white-space: pre-wrap; line-height: 1.45; }
.firstcomment { text-align: center; color: var(--faint); font-size: .88rem; padding: 2rem 0; }
.firstcomment-icon { font-size: 1.6rem; margin-bottom: .3rem; opacity: .7; }

/* Composer */
.composer { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .55rem; }
.composer-row { display: flex; gap: .5rem; }
.composer input[type=text] {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: .55rem .7rem; font: inherit; font-size: .9rem; min-width: 0;
}
.composer input:focus { outline: none; border-color: var(--accent); }
.composer-name { flex: 0 0 34%; }
.composer-body { flex: 1; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.attime {
  display: inline-flex; align-items: center; gap: .4rem; color: var(--dim); font-size: .8rem;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 99px;
  padding: .3rem .7rem .3rem .5rem; cursor: pointer; user-select: none;
}
.attime input { accent-color: var(--accent); margin: 0; }
.attime b { color: var(--ink); font-weight: 600; }
.composer-post { padding: .5rem 1.2rem; }

/* legacy */
.speed-unused {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.speed button {
  border: none; background: transparent; color: var(--dim);
  padding: .3rem .65rem; border-radius: 7px; font-size: .82rem; font-weight: 600;
}
.speed button:hover { background: var(--surface-2); color: var(--ink); }
.speed button.active { background: var(--accent); color: #fff; }

/* ---------- Auth / unlock ---------- */
.authbox {
  max-width: 380px; margin: 16vh auto 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.8rem;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.authbox h1 {
  font-size: 1.1rem; margin: 0 0 1.1rem;
  display: flex; align-items: center; gap: .6rem; letter-spacing: -.01em;
}
.authbox input[type=password], .authbox input[type=text] {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: .6rem .75rem; font: inherit; margin-bottom: .9rem;
  transition: border-color .15s ease;
}
.authbox input:focus { outline: none; border-color: var(--line-lit); }
.authbox button { width: 100%; justify-content: center; padding: .55rem; }
.authbox .err { color: var(--red); font-size: .85rem; margin-bottom: .9rem; }

/* ---------- Dialog / toast ---------- */
dialog {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.4rem; max-width: 440px; width: 92vw;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 .4rem; font-size: 1rem; }
dialog label { display: block; font-size: .82rem; color: var(--dim); margin: .7rem 0 .25rem; }
dialog input[type=text], dialog input[type=password], dialog select, dialog textarea {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: .5rem .65rem; font: inherit; transition: border-color .15s ease;
}
dialog input:focus, dialog select:focus { outline: none; border-color: var(--line-lit); }
dialog .check { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; font-size: .88rem; color: var(--dim); }
dialog .check input { accent-color: var(--accent); }
dialog .row { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; }

.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line-lit); color: var(--ink);
  padding: .6rem 1.1rem; border-radius: 10px; font-size: .88rem; display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* ---------- Touch devices: no hover-only affordances ---------- */
@media (hover: none) {
  .card .actions { opacity: 1; }
  .card:hover { transform: none; }
}

/* ---------- Mobile layout ---------- */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  .wrap {
    padding: .9rem max(.85rem, env(safe-area-inset-right)) 3rem max(.85rem, env(safe-area-inset-left));
  }
  button, .btn { min-height: 42px; }

  /* Library header: wordmark + sign out on the first row, search full width below */
  .topbar { flex-wrap: wrap; gap: .7rem .8rem; padding-bottom: 1rem; align-items: center; }
  .topbar .grow { display: none; }
  .wordmark { height: 24px; }
  .topbar form { margin-left: auto; }
  .search, .search:focus { order: 3; flex-basis: 100%; width: 100%; padding: .65rem .9rem; font-size: 1rem; }
  .count { order: 4; flex-basis: 100%; font-size: .8rem; margin-top: -.3rem; }

  /* Cards */
  .grid { gap: 1rem; }
  .card { border-radius: 16px; }
  .card .meta { padding: .85rem .95rem 1rem; gap: .45rem; }
  .card .title { font-size: 1.02rem; white-space: normal; line-height: 1.3; }
  .card .sub { font-size: .82rem; }
  .card .actions { opacity: 1; gap: .5rem; margin-top: .6rem; }
  .card .actions button { flex: 1; justify-content: center; padding: .55rem .4rem; font-size: .9rem; border-radius: 9px; }

  /* Watch page: everything stacks, controls go full width */
  .watch .topbar { justify-content: center; padding-bottom: .9rem; }
  .player-shell { border-radius: 12px; max-height: none; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
  .infobar { flex-direction: column; align-items: stretch; gap: .8rem; padding: .95rem; margin-top: .9rem; }
  .infobar h1 { font-size: 1.08rem; line-height: 1.3; }
  .infobar .actions { width: 100%; gap: .5rem; }
  .infobar .actions .btn-red, .infobar .actions .btn, .infobar .actions .btn-ghost {
    flex: 1; justify-content: center; padding: .65rem .5rem; font-size: .95rem;
  }
  /* legacy */
.speed-unused { width: 100%; justify-content: space-between; }
  .speed button { flex: 1; justify-content: center; padding: .55rem 0; font-size: .9rem; }
  .watchmain .powered { display: none; }
  .powered.after-grid { display: block; }
  .panelcard { padding: .95rem; }
  .histo { height: 56px; }

  .sidebar { border-radius: 16px; }
  .tabs button { padding: .65rem; font-size: .95rem; }
  .comments, .transcript { max-height: 55vh; }
  .comment { padding-left: .8rem; }
  .cbody { font-size: .95rem; }
  .composer input[type=text] { padding: .7rem .8rem; font-size: 1rem; }
  .composer-row { flex-direction: column; }
  .composer-name { flex: none; width: 100%; }
  .composer-post { padding: .6rem 1.4rem; }
  .emoji { font-size: 1.25rem; padding: .5rem .2rem; }
  .avatar { width: 34px; height: 34px; }
  .cue { font-size: .95rem; padding: .45rem .5rem; }

  /* Auth pages */
  .authbox { margin: 6vh .9rem 0; max-width: none; padding: 1.5rem 1.25rem; border-radius: 18px; }
  .authbox input[type=email], .authbox input[type=password], .authbox input[type=text] {
    font-size: 1rem; padding: .75rem .85rem;
  }
  .authbox button { padding: .75rem; font-size: 1rem; }
  .wordmark-lg { height: 40px; }
  .empty { padding: 3.5rem .5rem; }
  .toast { bottom: max(1.2rem, env(safe-area-inset-bottom)); width: calc(100% - 2rem); text-align: center; }
}

/* ---------- Brand assets ---------- */
.wordmark { height: 26px; width: auto; display: block; }
.wordmark-lg { height: 44px; margin: 0 auto 1.2rem; }
.markicon { height: 20px; width: 20px; vertical-align: -4px; margin-right: .3rem; }
.authsub { color: var(--dim); font-size: .9rem; margin: -.6rem 0 1rem; text-align: center; }
.authbox input[type=email] {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: .6rem .75rem; font: inherit; margin-bottom: .9rem;
}


/* ---------- Custom player ---------- */
.player-shell { position: relative; }
.player { cursor: pointer; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  background: rgba(8, 12, 28, 0.28); transition: opacity .2s ease;
}
.overlay.gone { opacity: 0; pointer-events: none; }
.bigplay {
  width: 84px; height: 84px; border-radius: 50%; border: none; min-height: 0;
  background: rgba(255,255,255,.96); color: #0B1020; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 10px rgba(255,255,255,.12);
  transition: transform .12s ease;
}
.bigplay:hover { transform: scale(1.06); background: #fff; }
.bigplay svg { margin-left: 4px; }
.speedpill {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 0;
  background: rgba(8, 12, 28, 0.82); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 12px;
  padding: .55rem .9rem; font-size: .95rem; font-weight: 600;
}
.speedpill:hover { background: rgba(8, 12, 28, 0.92); border-color: rgba(255,255,255,.28); }
.speedpill svg { opacity: .8; }
.speedpill .pillsep { width: 1px; height: 16px; background: rgba(255,255,255,.2); }
.speedpill s { color: rgba(255,255,255,.5); font-weight: 500; }
#pillTime:empty, #pillTime:empty + .pillsep { display: none; }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .3rem .6rem .45rem;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 20, .85));
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.player-shell.show-controls .controls, .player-shell:not(.playing) .controls { opacity: 1; pointer-events: auto; }
.scrub { position: relative; height: 14px; cursor: pointer; margin: 0 .2rem .2rem; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.22); }
.buffered, .played { position: absolute; left: 0; top: 6px; height: 3px; border-radius: 2px; width: 0; }
.buffered { background: rgba(255,255,255,.35); }
.played { background: linear-gradient(90deg, var(--accent-top), var(--accent)); }
.knob {
  position: absolute; top: 1px; width: 13px; height: 13px; border-radius: 50%; margin-left: -6px;
  background: #fff; box-shadow: 0 0 0 3px rgba(0,123,255,.35); transform: scale(0); transition: transform .12s ease;
}
.scrub:hover .knob, .scrub:active .knob { transform: scale(1); }
.ctlrow { display: flex; align-items: center; gap: .15rem; }
.ctl {
  background: transparent; border: none; color: #fff; padding: .35rem; min-height: 0;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; opacity: .92;
}
.ctl:hover { background: rgba(255,255,255,.14); border: none; opacity: 1; }
.ctl svg[hidden] { display: none; }
.ctltext { font-size: .8rem; font-weight: 700; padding: .35rem .5rem; letter-spacing: .02em; }
.ctl.on { color: var(--accent-top); }
.ctltime { color: rgba(255,255,255,.85); font-size: .8rem; font-variant-numeric: tabular-nums; padding: 0 .4rem; }
.ctlgrow { flex: 1; }
.player-shell:fullscreen { border-radius: 0; border: none; max-height: none; aspect-ratio: auto; width: 100vw; height: 100vh; }
.player-shell:fullscreen .player { width: 100%; height: 100%; aspect-ratio: auto; }

/* ---------- Action buttons ---------- */
.infobar .actions { gap: .5rem; }
.act { gap: .45rem; padding: .5rem .95rem; border-radius: 10px; font-weight: 600; }
.act svg { opacity: .9; flex: none; }
.btn.act { background: rgba(255,255,255,.04); border-color: var(--line-lit); color: var(--ink); }
.btn.act:hover { background: var(--surface-2); border-color: var(--accent); }

@media (max-width: 640px) {
  .bigplay { width: 68px; height: 68px; }
  .bigplay svg { width: 28px; height: 28px; }
  .speedpill { font-size: .88rem; padding: .5rem .8rem; }
  .ctltext { font-size: .78rem; }
  .infobar .actions .act { flex: 1 1 auto; min-width: 45%; justify-content: center; }
  .infobar .actions .btn-red.act { flex-basis: 100%; }
}
