/*
  Jay Maas - student feedback portal.
  Dark, calm, mobile-first. Brand: black, off-white, Jay Maas red (#d43b3b).
  No inline styles anywhere (strict CSP): every visual lives in this file.
*/

:root {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --card: #151517;
  --card-2: #1c1c1f;
  --card-3: #232327;
  --line: #262629;
  --line-2: #34343a;
  --ink: #f4f2ee;
  --ink-2: #d2cfc9;
  --dim: #9c9993;
  --faint: #6d6b66;
  --red: #d43b3b;
  --red-hi: #e24a4a;
  --red-lo: #b93030;
  --red-ink: #ff7b71;
  --red-wash: rgba(212, 59, 59, 0.13);
  --green: #5aa876;
  --amber: #d9a441;
  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 16px;
  --tap: 46px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
/* Inline SVG icons default to text size; components below size their own. */
svg { width: 1.1em; height: 1.1em; flex: none; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: var(--ink-2); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(212, 59, 59, 0.45); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--ink); color: var(--bg); border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ top bar */

.coach-banner {
  position: relative; z-index: 40;
  padding: 9px var(--gutter);
  padding-top: max(9px, env(safe-area-inset-top));
  background: repeating-linear-gradient(135deg, #3a2a0e 0 12px, #33250c 12px 24px);
  color: #f1d49a; font-size: 13px; font-weight: 600; text-align: center;
  letter-spacing: 0.01em;
}
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  max-width: 1440px; margin: 0 auto;
}
.coach-banner + .topbar { padding-top: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  min-height: var(--tap); color: var(--ink);
}
/* A red "rec" light rather than a red tile with a play triangle - that shape
   reads as YouTube, which is exactly what this page replaces. */
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(212, 59, 59, 0.18), 0 0 14px rgba(212, 59, 59, 0.55);
}
.brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.brand-sub {
  color: var(--dim); font-size: 14px; font-weight: 500;
  padding-left: 10px; border-left: 1px solid var(--line-2);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 12px; border-radius: 999px;
  color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none;
}
.topbar-link:hover { background: var(--card); color: var(--ink); }
.topbar-link svg { width: 16px; height: 16px; }

main {
  max-width: 1440px; margin: 0 auto;
  padding: 4px var(--gutter) 48px;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 650; font-size: 15px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hi); }
.btn-red:active { background: var(--red-lo); }
.btn-light { background: var(--ink); color: #111; }
.btn-light:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--dim); color: var(--ink); }
.btn-quiet { background: var(--card-2); color: var(--ink); }
.btn-quiet:hover { background: var(--card-3); }
.btn-block { display: flex; width: 100%; min-height: 52px; font-size: 16px; }
.linklike {
  background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2);
  min-height: 32px;
}
.linklike:hover { color: var(--ink); text-decoration-color: var(--ink-2); }

/* ------------------------------------------------------------------ forms */

label, .label {
  display: block; margin: 0 0 8px; color: var(--dim);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
input[type="email"], input[type="text"], input.code, textarea {
  width: 100%; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 12px;
  /* 17px keeps iOS from zooming the page when the field is focused. */
  font-size: 17px; padding: 14px 15px; min-height: 52px;
  transition: border-color 0.15s, background-color 0.15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: none; border-color: var(--dim); background: #0d0d0f; }
input.code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 26px; letter-spacing: 0.4em; text-align: center; padding-left: calc(15px + 0.4em);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.form-error {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--red-wash); border: 1px solid rgba(212, 59, 59, 0.35);
  color: #ffc1bb; font-size: 14px;
}
.form-note { margin: 10px 0 0; color: var(--dim); font-size: 14px; }

/* ------------------------------------------------------------------ cards / states */

.center-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(16px, 7vh, 72px) 0 24px;
}
.card {
  width: 100%; max-width: 460px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px 24px; box-shadow: var(--shadow);
}
.card h1 {
  font-family: var(--font-display); font-size: 26px; line-height: 1.18;
  letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 750;
}
.card .lede { margin: 0 0 24px; color: var(--ink-2); font-size: 16px; }
.card form + form { margin-top: 0; }
.card .btn-block { margin-top: 14px; }
.card .fine {
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 14px;
}
.card .row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.card .row-actions .btn { flex: 1 1 auto; }
.sent {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 20px; padding: 14px; border-radius: 12px;
  background: var(--card-2); color: var(--ink-2); font-size: 15px;
}
.sent svg { width: 22px; height: 22px; flex: none; color: var(--green); margin-top: 1px; }
.icon-badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--card-2); margin-bottom: 18px; color: var(--ink-2);
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge.red { background: var(--red-wash); color: var(--red-ink); }
.icon-badge.amber { background: rgba(217, 164, 65, 0.14); color: var(--amber); }
.icon-badge.green { background: rgba(90, 168, 118, 0.14); color: var(--green); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
.loading-line { display: flex; align-items: center; gap: 12px; color: var(--dim); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ watch page */

.watch-grid { display: block; }
/* Phone: the player stays pinned at the top while the notes and thread scroll
   under it, so a timestamp tap is always visible. A sticky element only sticks
   within its parent, so the player column's own box is dissolved (display:
   contents) to let the player stick across the whole page. */
@media (max-width: 959px) {
  .col-player { display: contents; }
}
.player-wrap {
  position: sticky; top: 0; z-index: 30;
  margin: 0 calc(-1 * var(--gutter));
  background: #000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.player-box { position: relative; background: #000; }
.player-box video {
  display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh;
  background: #000; object-fit: contain;
}
.player-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 20px;
  text-align: center; background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.player-overlay p { margin: 0; max-width: 34ch; color: var(--ink); font-weight: 600; }
.player-overlay .sub { color: var(--dim); font-weight: 400; font-size: 14px; }

.player-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0 0;
}
.speed {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.speed button {
  min-width: 52px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--dim); font-weight: 650; font-size: 14px;
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.speed button:hover { color: var(--ink); }
.speed button[aria-pressed="true"] { background: var(--ink); color: #111; }
.speed-label { color: var(--faint); font-size: 13px; }

.resume {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.resume .btn-red { flex: 1 1 auto; }
.resume .btn svg { width: 16px; height: 16px; }

.intro { padding: 20px 0 4px; }
.video-title {
  margin: 0; font-family: var(--font-display); font-weight: 750;
  font-size: clamp(23px, 6vw, 30px); line-height: 1.16; letter-spacing: -0.022em;
  overflow-wrap: anywhere;
}
.video-meta {
  margin: 8px 0 0; color: var(--dim); font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.video-meta .dot { padding: 0 6px; color: var(--faint); }

.personal {
  margin: 18px 0 4px; padding: 16px 16px 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, #1a1616, #161515);
  border: 1px solid #2d2323; border-left: 3px solid var(--red);
}
.personal-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  color: var(--red-ink); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.personal-label svg { width: 14px; height: 14px; }
.personal-body { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

.sec-h {
  display: flex; align-items: baseline; gap: 8px;
  margin: 30px 0 12px; font-size: 13px; font-weight: 700; color: var(--dim);
  letter-spacing: 0.09em; text-transform: uppercase;
}
.sec-h .count { color: var(--faint); font-weight: 600; }

.notes-list { list-style: none; margin: 0; padding: 0; counter-reset: note; }
.notes-list li {
  counter-increment: note; position: relative;
  padding: 13px 0 13px 42px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere;
}
.notes-list li:first-child { border-top: 0; }
.notes-list li::before {
  content: counter(note); position: absolute; left: 0; top: 12px;
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.empty-note { color: var(--dim); font-size: 15px; margin: 0; }

.ts {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: 1px;
  margin: 0 2px; padding: 2px 8px 2px 6px; min-height: 26px;
  border: 0; border-radius: 999px; background: var(--red-wash); color: var(--red-ink);
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; line-height: 1.2;
}
.ts:hover { background: rgba(212, 59, 59, 0.22); color: #ff9b93; }
.ts svg { width: 10px; height: 10px; }

/* thread */
.thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
}
.msg.coach .msg-avatar { background: var(--red); color: #fff; }
.msg.student .msg-avatar { background: var(--card-3); color: var(--ink-2); }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.msg-who { font-weight: 700; font-size: 14.5px; }
.msg-when { color: var(--faint); font-size: 13px; }
.msg-bubble {
  padding: 11px 14px; border-radius: 4px 14px 14px 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5;
}
.msg.coach .msg-bubble { background: #1b1515; border-color: #342424; color: var(--ink); }
.msg-bubble .ts:first-child { margin-left: 0; }
.msg.pending .msg-bubble { opacity: 0.6; }
.thread-empty { margin: 0; color: var(--dim); font-size: 15px; }

/* ask bar + sheet */
.ask-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 10px var(--gutter);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(10, 10, 11, 0), rgba(10, 10, 11, 0.92) 30%);
}
.ask-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; border: 0; border-radius: 16px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(212, 59, 59, 0.28), 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: background-color 0.15s, transform 0.08s;
}
.ask-btn:hover { background: var(--red-hi); }
.ask-btn:active { transform: scale(0.99); }
.ask-btn svg { width: 20px; height: 20px; }
.ask-time { font-variant-numeric: tabular-nums; opacity: 0.85; font-weight: 600; }
.ask-bar.off .ask-btn { background: var(--card-2); color: var(--dim); box-shadow: none; cursor: default; }
body.page-watch main { padding-bottom: 120px; }

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); animation: fade 0.18s ease-out; }
.sheet-panel {
  position: relative; width: 100%; max-width: 640px;
  background: var(--card); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding: 10px 18px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom));
  animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-h { margin: 0 0 10px; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.pin { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pin-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: var(--red-wash); color: var(--red-ink); font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pin-chip.general { background: var(--card-2); color: var(--ink-2); }
.pin-chip svg { width: 14px; height: 14px; }
.sheet-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sheet-foot .char-count { color: var(--faint); font-size: 13px; margin-right: auto; font-variant-numeric: tabular-nums; }
.sheet-foot .form-error { flex-basis: 100%; order: -1; margin: 0 0 4px; }
.sheet-hint { margin: 10px 0 0; color: var(--faint); font-size: 13px; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.watch-foot {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 14px;
}
.watch-foot p { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.watch-foot svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.watch-foot .foot-eye { flex-wrap: nowrap; align-items: flex-start; }
.watch-foot .foot-eye svg { margin-top: 2px; }
.watch-foot a { color: var(--dim); }

/* loading skeleton */
.skeleton-player {
  margin: 0 calc(-1 * var(--gutter)); aspect-ratio: 16 / 9; background: #050506;
  display: grid; place-items: center;
}
.skeleton-line { height: 18px; border-radius: 8px; background: var(--card-2); margin-top: 18px; }
.skeleton-line.w70 { width: 70%; height: 26px; margin-top: 22px; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w80 { width: 80%; }
.shimmer { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ------------------------------------------------------------------ library */

.lib-head { padding: 12px 0 18px; }
.lib-head h1 {
  margin: 0; font-family: var(--font-display); font-weight: 780;
  font-size: clamp(28px, 7.4vw, 40px); line-height: 1.1; letter-spacing: -0.025em;
}
.lib-head h1 .accent { color: var(--red); }
.lib-head p { margin: 8px 0 0; color: var(--dim); }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lib-item a, .lib-item .card-link {
  display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 10px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.lib-item a:hover { border-color: var(--line-2); background: #18181a; }
.lib-item a:active { transform: scale(0.995); }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #2a1a1a, #121213 70%);
}
/* The placeholder sits underneath; the poster covers it, and library.js hides a
   poster that fails to load (e.g. its signed URL expired on a long-open page). */
.thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb .ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.5);
}
.thumb .ph svg { width: 26px; height: 26px; }
.thumb .dur {
  position: absolute; right: 6px; bottom: 8px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.thumb progress {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none; border: 0; display: block;
  background: rgba(255, 255, 255, 0.18); color: var(--red);
}
.thumb progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.18); }
.thumb progress::-webkit-progress-value { background: var(--red); }
.thumb progress::-moz-progress-bar { background: var(--red); }
.lib-text { min-width: 0; padding: 2px 4px 2px 0; }
.lib-title {
  margin: 0; font-weight: 700; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.lib-meta { margin: 5px 0 0; color: var(--dim); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 750; letter-spacing: 0.02em; line-height: 1.4;
}
.badge svg { width: 12px; height: 12px; }
.badge.new { background: var(--red); color: #fff; }
.badge.replied { background: var(--ink); color: #111; }
.badge.done { background: rgba(90, 168, 118, 0.14); color: #8fd3a6; }
.badge.progress { background: var(--card-2); color: var(--ink-2); }

.see-all {
  margin-top: 22px; padding: 18px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
}
.see-all h2 { margin: 0 0 4px; font-size: 17px; font-weight: 720; }
.see-all p { margin: 0 0 14px; color: var(--dim); font-size: 15px; }
.see-all .code-box { margin-top: 14px; }

.empty-state, .fail-state {
  margin-top: 8px; padding: 28px 20px; border-radius: 18px; text-align: center;
  background: var(--card); border: 1px dashed var(--line-2);
}
.fail-state { border-style: solid; border-color: rgba(212, 59, 59, 0.35); background: #171213; }
.empty-state .icon-badge, .fail-state .icon-badge { margin: 0 auto 14px; }
.empty-state h2, .fail-state h2 { margin: 0 0 6px; font-size: 18px; }
.empty-state p, .fail-state p { margin: 0 auto; color: var(--dim); max-width: 44ch; }
.fail-state .btn { margin-top: 16px; }

.lib-foot {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
}
.lib-foot a { color: var(--dim); }

/* ------------------------------------------------------------------ prose (privacy) */

.prose { max-width: 680px; padding: 16px 0 40px; }
.prose h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: -0.02em; line-height: 1.15; margin: 8px 0 8px; }
.prose h2 { font-size: 18px; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose .updated { color: var(--faint); font-size: 14px; }

/* ------------------------------------------------------------------ view-as banner */

/* Jason previewing a student's page: pinned to the top of every page, so a
   screenshot or a glance can never be mistaken for the student's own view. */
.coach-banner.viewas {
  position: sticky; top: 0; z-index: 70;
  height: calc(var(--banner-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  line-height: var(--banner-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, #4a3410, #5a3f12 50%, #4a3410);
  color: #ffe3a8; font-size: 13.5px; font-weight: 700;
  border-bottom: 1px solid rgba(255, 210, 120, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
:root { --banner-h: 38px; }
/* The watch page's player sticks to the top on phones: under the banner, not behind it. */
body.is-viewas .player-wrap { top: calc(var(--banner-h) + env(safe-area-inset-top)); }

/* ------------------------------------------------------------------ home: tabs */

/* Phones: an app-style bottom tab bar (thumb reach, always visible). The same
   element becomes pills in the top bar from 960 px up. */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 6px max(4px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
           max(4px, env(safe-area-inset-left));
  background: rgba(12, 12, 13, 0.94);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; padding: 7px 1px 4px; border-radius: 12px;
  color: var(--faint); text-decoration: none;
  font-size: 10px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2;
  transition: color 0.15s, background-color 0.15s;
}
.tab svg { width: 21px; height: 21px; }
/* Six labels share a phone's width: the longest one has a short form for the
   bottom bar, and this is the backstop if a future label outgrows its column. */
.tab-label { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lab-narrow { display: none; }
@media (max-width: 959px) {
  .lab-wide { display: none; }
  .lab-narrow { display: inline; }
}
/* 360 and 375 px phones give each of the six columns ~9 px less than a 390 px
   one: a notch smaller keeps "Worksheets" whole there too. Below 340 px (a 2016
   phone) the ellipsis above is the backstop. */
@media (max-width: 389px) { .tab { font-size: 9.5px; } }
.tab:hover { color: var(--ink-2); }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { color: var(--red-ink); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -7px; left: 28%; right: 28%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--red);
  box-shadow: 0 0 12px rgba(212, 59, 59, 0.6);
}
.tab-dot {
  position: absolute; top: 5px; left: calc(50% + 7px); width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #0c0c0d;
}
body.page-home main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.home-head { padding: 8px 0 20px; }
.hello { margin: 0 0 4px; color: var(--dim); font-size: 15px; font-weight: 600; }
.home-title {
  margin: 0; font-family: var(--font-display); font-weight: 780;
  font-size: clamp(28px, 7.4vw, 40px); line-height: 1.1; letter-spacing: -0.025em;
}
.home-title .accent { color: var(--red); }
.home-sub { margin: 8px 0 0; color: var(--dim); max-width: 60ch; }
.panel { min-height: 40vh; }
/* Inside one worksheet / course / folder the tab's big header steps aside: the
   back link and the item's own title say where you are. */
body.is-drill .home-head { display: none; }
body.is-drill .panel { padding-top: 10px; }
.home-foot { margin-top: 40px; }

.group-h {
  margin: 28px 0 12px; font-size: 13px; font-weight: 700; color: var(--dim);
  letter-spacing: 0.09em; text-transform: uppercase;
}
.panel > .group-h:first-child { margin-top: 4px; }

/* Imported YouTube feedback: no thumbnail from YouTube (that would contact Google
   on every visit to the home), a designed tile instead. */
.thumb.yt { background: radial-gradient(130% 100% at 22% 12%, #3b1717 0%, #1c1011 48%, #101011 100%); }
.thumb.yt .ph { color: #fff; }
.yt-play {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(212, 59, 59, 0.94); box-shadow: 0 8px 26px rgba(212, 59, 59, 0.38);
}
.yt-play svg { width: 19px; height: 19px; margin-left: 3px; }
/* Phone thumbnails are small: a smaller circle, lifted clear of the "YouTube" chip. */
@media (max-width: 719px) {
  .thumb.yt .ph { padding-bottom: 16px; }
  .yt-play { width: 34px; height: 34px; }
  .yt-play svg { width: 15px; height: 15px; margin-left: 2px; }
}
.lib-item .is-static { opacity: 0.8; }

/* ------------------------------------------------------------------ home: rows */

/* One row shape for submissions, worksheets and library items. */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 860px; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px; border-radius: 16px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
a.row:hover { border-color: var(--line-2); background: #18181a; }
a.row:active { transform: scale(0.995); }
.row-tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink-2);
}
.row-tile svg { width: 21px; height: 21px; }
.row-tile.red { background: var(--red-wash); color: var(--red-ink); }
.row-tile.green { background: rgba(90, 168, 118, 0.14); color: #8fd3a6; }
.row-tile.amber { background: rgba(217, 164, 65, 0.14); color: var(--amber); }
.row-tile.muted { color: var(--faint); }
.row-main { min-width: 0; }
.row-title {
  margin: 1px 0 0; font-size: 16px; font-weight: 700; line-height: 1.3;
  letter-spacing: -0.01em; overflow-wrap: anywhere;
}
.row-meta { margin: 4px 0 0; color: var(--dim); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.row-note {
  margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.row-note.clamp {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row .badges { margin-top: 8px; }
.row-chevron { align-self: center; color: var(--faint); display: grid; }
.row-chevron svg { width: 18px; height: 18px; }
a.row:hover .row-chevron { color: var(--ink-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.chip svg { width: 14px; height: 14px; }
.chip.go { background: var(--card-3); color: var(--ink); transition: background-color 0.15s, color 0.15s; }
a.row:hover .chip.go { background: var(--ink); color: #111; }
.chip.expired { background: rgba(217, 164, 65, 0.12); color: #e7c079; }
.chip.muted { background: var(--card-2); color: var(--faint); }
.badge.todo { background: rgba(217, 164, 65, 0.14); color: #e7c079; }
.badge.muted { background: var(--card-2); color: var(--faint); }

/* ------------------------------------------------------------------ home: messages */

/* Read-only history: a card per message / journal note / comment thread, with
   the same avatar-and-bubble shapes the watch page's thread uses, so the two
   read as one product. Jay's cards lean red, the student's stay neutral. */
/* minmax(0, 1fr): the "On: <title>" row keeps its title on one line, and a long
   one must shorten with an ellipsis rather than hold the whole column open and
   push the page sideways on a phone. */
.stream {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 860px;
  grid-template-columns: minmax(0, 1fr);
}
.stream-card {
  padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.stream-card.coach { background: #171416; border-color: #2c2427; }
.stream-head { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.stream-card .msg-avatar { margin-top: 2px; }
.stream-card.coach .msg-avatar { background: var(--red); color: #fff; }
.stream-card.student .msg-avatar { background: var(--card-3); color: var(--ink-2); }
.stream-who { min-width: 0; }
.stream-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0; }
.stream-title {
  margin: 2px 0 0; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere;
}
.badge.kind {
  background: var(--card-2); color: var(--dim); white-space: nowrap; padding: 2px 8px;
  font-size: 11px; letter-spacing: 0.02em;
}
.stream-card.coach .badge.kind { background: rgba(212, 59, 59, 0.12); color: #e79a94; }
.stream-body {
  margin: 10px 0 0; color: var(--ink-2); line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.stream-body.clamped {
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
}
.show-more { margin-top: 6px; font-size: 14px; font-weight: 650; }
.stream-about {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 9px 10px;
  border-radius: 12px; background: var(--card-2); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.stream-about span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-about .row-chevron { margin-left: auto; overflow: visible; }
.stream-about svg { width: 16px; height: 16px; color: var(--dim); }
a.stream-about:hover { background: var(--card-3); color: var(--ink); }
.stream-about.is-gone { color: var(--faint); background: transparent; padding-left: 0; }
.stream-thread { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.stream-thread-h {
  margin: 0 0 10px; color: var(--faint); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.stream-replies {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px;
}
.btn.older { margin-top: 16px; }
.inline-link { color: var(--red-ink); text-decoration-color: rgba(255, 123, 113, 0.5); }
.inline-link:hover { text-decoration-color: var(--red-ink); }

.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px;
  margin: -6px 0 10px -8px; padding: 0 12px 0 4px; border-radius: 10px;
  color: var(--ink-2); font-weight: 650; font-size: 15px; text-decoration: none;
}
.back-link:hover { background: var(--card); color: var(--ink); }
.back-link svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ home: detail views */

.detail { max-width: 860px; }
.detail-title {
  margin: 0; font-family: var(--font-display); font-weight: 750;
  font-size: clamp(22px, 5.6vw, 28px); line-height: 1.2; letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin: 8px 0 0; color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums;
}
.qa-list { list-style: none; counter-reset: qa; margin: 26px 0 0; padding: 0; display: grid; gap: 22px; }
.qa { counter-increment: qa; position: relative; padding-left: 42px; }
.qa::before {
  content: counter(qa); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qa-q {
  margin: 3px 0 10px; color: var(--ink); font-weight: 650; font-size: 16px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.qa-a {
  padding: 12px 14px; border-radius: 4px 14px 14px 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.qa-a.none { background: transparent; border-style: dashed; color: var(--faint); font-style: italic; }

/* courses */
.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.course-card {
  display: block; height: 100%; padding: 16px; border-radius: 18px; color: var(--ink);
  text-decoration: none; background: var(--card); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
a.course-card:hover { border-color: var(--line-2); background: #18181a; }
a.course-card:active { transform: scale(0.995); }
.course-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.course-top .row-meta:empty { display: none; }
.course-status { margin-top: 14px; }
.course-bar {
  display: block; width: 100%; height: 6px; margin-top: 12px; border: 0; border-radius: 999px;
  -webkit-appearance: none; appearance: none; background: var(--card-3); color: var(--red);
  overflow: hidden;
}
.course-bar::-webkit-progress-bar { background: var(--card-3); border-radius: 999px; }
.course-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--red-lo), var(--red-hi)); border-radius: 999px;
}
.course-bar::-moz-progress-bar { background: var(--red); border-radius: 999px; }
.course-foot { margin: 10px 0 0; color: var(--dim); font-size: 13.5px; }
.detail .course-bar { max-width: 520px; }
.day { margin-top: 26px; }
.day-h {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: 13px; font-weight: 700; color: var(--dim); letter-spacing: 0.09em; text-transform: uppercase;
}
.day-time { color: var(--faint); font-weight: 600; letter-spacing: 0.04em; text-transform: none; font-size: 13px; }
.day-h .badge { letter-spacing: 0.02em; text-transform: none; }
.day-items {
  list-style: none; margin: 0 0 0 5px; padding: 0 0 0 16px; display: grid; gap: 8px;
  border-left: 2px solid var(--line);
}
.ditem {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 14px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s;
}
a.ditem:hover { border-color: var(--line-2); background: #18181a; }
.ditem-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink-2);
}
.ditem-icon svg { width: 17px; height: 17px; }
a.ditem .ditem-icon { background: var(--red-wash); color: var(--red-ink); }
.ditem-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ditem-title { font-weight: 650; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.ditem-body { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Not the note's text but a line about the text NOT being here, so it must never read
   as something Jay wrote to this student. */
.ditem-body.withheld { color: var(--faint); font-style: italic; }
.ditem.message { align-items: start; background: #1b1515; border-color: #342424; }
.ditem.message .ditem-icon { background: var(--red); color: #fff; }
.course-end { display: flex; align-items: center; gap: 8px; margin: 24px 0 0; color: var(--dim); font-size: 14.5px; }
.course-end svg { width: 16px; height: 16px; color: var(--faint); }
.empty-note.spaced { margin-top: 18px; }

/* library */
.folder-grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.folder {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 126px; padding: 14px;
  border-radius: 16px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.folder:hover { border-color: var(--line-2); background: #18181a; }
.folder:active { transform: scale(0.99); }
.folder-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink-2); margin-bottom: 8px;
}
.folder-icon svg { width: 20px; height: 20px; }
.folder.shared .folder-icon { background: var(--red-wash); color: var(--red-ink); }
.folder-name {
  font-weight: 700; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.folder-count { margin-top: auto; padding-top: 4px; color: var(--dim); font-size: 13px; }
.folder-title { margin-bottom: 16px; }

/* loading skeletons (same shapes as what they stand in for) */
.sk-rows { display: grid; gap: 10px; max-width: 860px; }
.sk-row { height: 78px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.sk-grid { display: grid; gap: 10px; }
.sk-card { height: 98px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ imported item page */

.page-item .player-wrap { position: relative; top: auto; }
.embed-box iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.open-card {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 18px;
  background: linear-gradient(180deg, #18181b, #131315); border: 1px solid var(--line);
}
.open-tile {
  flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--red-wash); color: var(--red-ink);
}
.open-tile svg { width: 26px; height: 26px; }
.open-main { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.open-host {
  margin: 0; color: var(--dim); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.open-state { margin: 0; color: var(--ink-2); font-weight: 600; }
.open-state.expired { color: #e7c079; }
.eyebrow {
  margin: 0 0 8px; color: var(--red-ink); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.item-notes {
  margin: 0; padding: 16px 16px 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, #1a1616, #161515);
  border: 1px solid #2d2323; border-left: 3px solid var(--red);
  color: var(--ink); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.watch-foot a { color: var(--dim); }

/* ------------------------------------------------------------------ desktop / tablet */

@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .lib-list { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
  .lib-item a, .lib-item .card-link {
    display: block; height: 100%; padding: 0; overflow: hidden; border-radius: 18px;
  }
  .lib-item .thumb { border-radius: 0; }
  .lib-item .lib-text { padding: 14px 16px 16px; }
  .lib-title { font-size: 17px; -webkit-line-clamp: 2; }
  .card { padding: 36px 34px 30px; }
  .course-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .sk-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
  .sk-card { height: 252px; border-radius: 18px; }
  .row { padding: 16px 18px; }
  .stream-card { padding: 18px 20px; }
  .stream-head { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .stream-title { font-size: 17px; }
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 22px; border-bottom: 1px solid var(--line-2); padding-bottom: 20px; }
  .sheet-grip { display: none; }
}

@media (min-width: 960px) {
  .watch-grid {
    display: grid; grid-template-columns: minmax(0, 68fr) minmax(330px, 32fr);
    gap: 36px; align-items: start; padding-top: 8px;
  }
  .player-wrap { position: static; margin: 0; border-radius: 16px; overflow: hidden; }
  .skeleton-player { margin: 0; border-radius: 16px; }
  .player-box video { max-height: 78vh; }
  .col-side { min-width: 0; }
  .col-side .sec-h:first-child, .col-side > section:first-child .sec-h { margin-top: 4px; }
  .ask-bar { position: static; padding: 0; margin: 0 0 16px; background: none; }
  .ask-btn { min-height: 50px; box-shadow: none; }
  body.page-watch main { padding-bottom: 48px; }

  /* The home's tab bar moves into the top bar, which then stays put while a
     long feedback grid scrolls under it. */
  body.page-home .topbar {
    position: sticky; top: 0; z-index: 40; max-width: none;
    padding-left: max(28px, calc((100% - 1440px) / 2 + 28px));
    padding-right: max(28px, calc((100% - 1440px) / 2 + 28px));
    background: rgba(10, 10, 11, 0.86);
    -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid rgba(38, 38, 41, 0.7);
  }
  body.page-home.is-viewas .topbar { top: calc(var(--banner-h) + env(safe-area-inset-top)); }
  .tabs {
    position: static; display: flex; gap: 2px; padding: 4px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tab {
    flex-direction: row; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px;
    color: var(--dim); font-size: 14px;
  }
  .tab svg { width: 17px; height: 17px; }
  .tab:hover { color: var(--ink); background: var(--card-2); }
  .tab[aria-current="page"] { background: var(--ink); color: #111; }
  .tab[aria-current="page"] svg { color: var(--red); }
  .tab[aria-current="page"]::before { display: none; }
  .tab-dot { position: static; margin-left: -2px; box-shadow: none; }
  body.page-home main { padding-top: 22px; padding-bottom: 56px; }
  .home-head { padding-bottom: 26px; }
  .page-item .player-wrap { border-radius: 16px; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
