/* ==========================================================================
   lettuce.radio — social surfaces
   Explore · profiles · artist pages · Song DNA · widget menu · editors

   Consumes the shell's existing tokens (--ink, --mute, --surface, --paper,
   --line, --accent, --accent-2) so light/dark theming keeps working. Any
   token declared here is a *new* one the shell does not already own.
   ========================================================================== */

:root {
  --rs-radius: 14px;
  --rs-radius-lg: 20px;
  --rs-gap: 18px;
  --rs-shadow: 0 18px 48px rgba(0, 0, 0, .38);
  --rs-shadow-sm: 0 6px 20px rgba(0, 0, 0, .22);
  --rs-ease: cubic-bezier(.2, .7, .3, 1);
  --rs-card: color-mix(in srgb, var(--surface) 88%, transparent);
}

/* ── shared primitives ─────────────────────────────────────────────── */

.rs-section { margin: 0 0 40px; }
.rs-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 0 0 14px;
}
.rs-section-head h2 {
  margin: 0; font-size: clamp(19px, 2.2vw, 25px); font-weight: 800;
  letter-spacing: -.02em; color: var(--ink);
}
.rs-section-head p { margin: 4px 0 0; font-size: 13px; color: var(--mute); }
.rs-more {
  background: none; border: 0; color: var(--mute); font: inherit; font-size: 12px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; padding: 6px 2px; border-radius: 8px;
}
.rs-more:hover { color: var(--ink); }

.rs-shelf {
  display: grid; gap: var(--rs-gap);
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.rs-shelf.is-video { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rs-shelf.is-people { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Horizontal scroll rails on touch/mobile beat a squashed grid. */
.rs-rail {
  display: grid; gap: 14px; grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: none;
}
.rs-rail::-webkit-scrollbar { display: none; }
.rs-rail > * { scroll-snap-align: start; }

.rs-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--rs-radius);
  background: var(--rs-card); border: 1px solid transparent;
  text-align: left; cursor: pointer; color: inherit;
  transition: background .18s var(--rs-ease), transform .18s var(--rs-ease), border-color .18s;
}
.rs-card:hover, .rs-card:focus-visible {
  background: color-mix(in srgb, var(--surface) 100%, var(--ink) 6%);
  border-color: var(--line); outline: none; transform: translateY(-2px);
}
.rs-card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.rs-art {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent-2) 30%, transparent));
}
.rs-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-art.is-wide { aspect-ratio: 16 / 9; }
.rs-art.is-round { border-radius: 50%; }

.rs-title {
  margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink);
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.rs-sub {
  margin: 0; font-size: 12.5px; color: var(--mute); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Floating play affordance — appears on hover, always visible on touch. */
.rs-play {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: var(--rs-shadow-sm);
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .18s var(--rs-ease), transform .18s var(--rs-ease);
}
.rs-card:hover .rs-play, .rs-card:focus-within .rs-play { opacity: 1; transform: none; }
.rs-play:hover { transform: scale(1.06); }
@media (hover: none) { .rs-play { opacity: 1; transform: none; } }

.rs-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent);
}
.rs-badge.is-verified { background: color-mix(in srgb, #1d9bf0 20%, transparent); color: #1d9bf0; }
.rs-badge.is-muted { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--mute); }
.rs-badge svg { width: 13px; height: 13px; }

.rs-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.rs-chips::-webkit-scrollbar { display: none; }
.rs-chip {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--mute);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all .16s var(--rs-ease);
}
.rs-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.rs-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.rs-empty {
  padding: 44px 24px; text-align: center; border-radius: var(--rs-radius-lg);
  border: 1px dashed var(--line); color: var(--mute); font-size: 14px;
}
.rs-empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* Skeletons keep layout stable while real data loads. */
.rs-skel {
  border-radius: var(--rs-radius);
  background: linear-gradient(100deg, color-mix(in srgb, var(--ink) 6%, transparent) 20%, color-mix(in srgb, var(--ink) 12%, transparent) 40%, color-mix(in srgb, var(--ink) 6%, transparent) 60%);
  background-size: 300% 100%; animation: rs-shimmer 1.3s linear infinite;
}
.rs-skel.is-card { aspect-ratio: .78; }
.rs-skel.is-wide { aspect-ratio: 16 / 9; }
@keyframes rs-shimmer { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .rs-skel { animation: none; } }

/* ══ EXPLORE ═══════════════════════════════════════════════════════════ */

.rs-explore-hero {
  position: relative; border-radius: var(--rs-radius-lg); overflow: hidden;
  margin-bottom: 32px; min-height: 300px; display: flex; align-items: flex-end;
  background: #000;
}
.rs-explore-hero video, .rs-explore-hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.rs-explore-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.9) 100%);
}
.rs-hero-body { position: relative; z-index: 1; padding: 32px; color: #fff; max-width: 620px; }
.rs-hero-body h1 {
  margin: 10px 0 8px; font-size: clamp(26px, 4vw, 44px); font-weight: 850;
  letter-spacing: -.03em; line-height: 1.05;
}
.rs-hero-body p { margin: 0 0 18px; font-size: 15px; opacity: .85; line-height: 1.5; }
.rs-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* The hero always sits on a dark scrim, so its buttons ignore the page theme. */
.rs-hero-actions .rs-btn { color: #fff; border-color: rgba(255, 255, 255, .45); }
.rs-hero-actions .rs-btn:hover { border-color: #fff; background: rgba(255, 255, 255, .12); }
.rs-hero-actions .rs-btn.is-primary { background: #fff; border-color: #fff; color: #111; }
.rs-hero-actions .rs-btn.is-primary:hover { background: #fff; }

.rs-video-card .rs-art { aspect-ratio: 16 / 9; }
.rs-video-card .rs-art video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .3s var(--rs-ease);
}
.rs-video-card:hover .rs-art video { opacity: 1; }
.rs-duration {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 5px;
  background: rgba(0,0,0,.78); color: #fff; font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ══ PROFILE / ARTIST PAGE ════════════════════════════════════════════ */

.rs-profile { --rs-accent: var(--accent); }

.rs-banner {
  position: relative; height: clamp(180px, 30vw, 340px); border-radius: var(--rs-radius-lg);
  overflow: hidden; background: linear-gradient(150deg, var(--rs-accent), color-mix(in srgb, var(--rs-accent) 25%, #000));
}
.rs-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--paper-2) 92%, transparent) 100%);
}

.rs-identity {
  position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 22px;
  margin: -74px 0 0; padding: 0 8px 4px;
}
.rs-avatar {
  flex: 0 0 auto; width: clamp(96px, 14vw, 148px); aspect-ratio: 1; border-radius: 50%;
  overflow: hidden; border: 4px solid var(--paper-2); background: var(--surface);
  box-shadow: var(--rs-shadow); display: grid; place-items: center;
  font-size: 42px; font-weight: 800; color: var(--mute);
}
.rs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rs-identity-body { flex: 1 1 auto; min-width: 0; padding-bottom: 8px; }
.rs-kicker {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px;
}
.rs-name {
  margin: 0; font-size: clamp(28px, 5vw, 56px); font-weight: 850;
  letter-spacing: -.035em; line-height: 1; color: var(--ink);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.rs-handle { font-size: 14px; color: var(--mute); margin: 8px 0 0; }
.rs-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 13.5px; color: var(--mute); }
.rs-meta b { color: var(--ink); font-weight: 700; }
.rs-meta-link { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-bottom: 1px solid transparent; }
.rs-meta-link:hover { border-bottom-color: var(--line-strong, var(--line)); }

.rs-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 32px; padding: 0 8px; }
.rs-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .16s var(--rs-ease);
}
.rs-btn:hover { border-color: var(--ink); transform: scale(1.02); }
.rs-btn.is-primary { background: var(--rs-accent); border-color: var(--rs-accent); color: #fff; }
.rs-btn.is-primary:hover { filter: brightness(1.08); }
.rs-btn.is-following { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.rs-btn.is-icon { padding: 11px; border-radius: 50%; }
.rs-btn svg { width: 18px; height: 18px; }

.rs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 28px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.rs-tabs::-webkit-scrollbar { display: none; }
.rs-tab {
  flex: 0 0 auto; padding: 13px 16px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.rs-tab:hover { color: var(--ink); }
.rs-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--rs-accent); }

/* Popular tracks — Spotify-style dense numbered list. */
.rs-tracklist { display: flex; flex-direction: column; }
.rs-track {
  display: grid; grid-template-columns: 26px 44px 1fr auto auto; align-items: center;
  gap: 14px; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  color: inherit; text-align: left; background: none; border: 0; width: 100%;
}
.rs-track:hover, .rs-track:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.rs-track .rs-idx { font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; text-align: right; }
.rs-track .rs-thumb { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; background: var(--surface); }
.rs-track .rs-info { min-width: 0; }
.rs-track .rs-info .t { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-track .rs-info .a { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-track .rs-plays { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.rs-track .rs-dur { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .rs-track { grid-template-columns: 22px 40px 1fr auto; } .rs-track .rs-plays { display: none; } }

/* About card — photo-led, not a wall of text. */
.rs-about {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0;
  border-radius: var(--rs-radius-lg); overflow: hidden; background: var(--rs-card);
  border: 1px solid var(--line);
}
.rs-about.no-photo { grid-template-columns: 1fr; }
.rs-about.no-photo .rs-about-photo { display: none; }
.rs-about-photo { position: relative; min-height: 300px; background: var(--surface); }
.rs-about-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rs-about-body { padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.rs-about-listeners { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.rs-about-listeners small { display: block; font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.rs-about-text { font-size: 14.5px; line-height: 1.65; color: var(--mute); white-space: pre-wrap; }
.rs-about-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-links { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
}
.rs-links a:hover { border-color: var(--ink); }
@media (max-width: 860px) { .rs-about { grid-template-columns: 1fr; } .rs-about-photo { min-height: 220px; } .rs-about-body { padding: 22px; } }

/* Artist picks — editorial, note-annotated. */
.rs-picks { display: grid; gap: var(--rs-gap); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rs-pick { position: relative; }
.rs-pick-note {
  margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--mute);
  font-style: italic; border-left: 2px solid var(--rs-accent); padding-left: 10px;
}
.rs-pick-unpin {
  margin-top: 8px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--mute); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.rs-pick-unpin:hover { color: var(--ink); border-color: var(--ink); }

/* Followers / following list inside the shared modal. */
.rs-follow-list { display: grid; gap: 4px; }
.rs-follow-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 10px; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.rs-follow-row:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.rs-follow-row .rs-avatar { width: 42px; border-width: 0; box-shadow: none; font-size: 17px; }
.rs-follow-who { min-width: 0; display: grid; }
.rs-follow-who .n { font-size: 14px; font-weight: 700; color: var(--ink); }
.rs-follow-who .s { font-size: 12px; color: var(--mute); }

.rs-profile-setup {
  display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--rs-radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rs-accent) 18%, transparent), var(--rs-card));
}
.rs-profile-setup h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.rs-profile-setup p { margin: 0; color: var(--mute); }

/* Photo gallery */
.rs-gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.rs-gallery figure { margin: 0; border-radius: 10px; overflow: hidden; position: relative; aspect-ratio: 1; background: var(--surface); }
.rs-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--rs-ease); }
.rs-gallery figure:hover img { transform: scale(1.05); }
.rs-gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; font-size: 11.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}

/* ══ SONG DNA ═════════════════════════════════════════════════════════ */

.rs-dna { position: relative; border-radius: var(--rs-radius-lg); overflow: hidden; background: var(--rs-card); border: 1px solid var(--line); }
.rs-dna-canvas { display: block; width: 100%; height: clamp(380px, 58vh, 680px); touch-action: none; cursor: grab; }
.rs-dna-canvas:active { cursor: grabbing; }
.rs-dna-legend {
  position: absolute; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--paper-2) 82%, transparent);
  backdrop-filter: blur(12px); border: 1px solid var(--line); max-width: calc(100% - 28px);
}
.rs-dna-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--mute); }
.rs-dna-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rs-dna-tip {
  position: absolute; pointer-events: none; padding: 8px 12px; border-radius: 9px;
  background: var(--ink); color: var(--paper); font-size: 12.5px; font-weight: 600;
  opacity: 0; transform: translate(-50%, -140%); transition: opacity .12s; white-space: nowrap; z-index: 3;
}
.rs-dna-tip.show { opacity: 1; }
.rs-dna-controls { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; }

.rs-credits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rs-credit {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--rs-card); border: 1px solid var(--line); cursor: pointer;
  color: inherit; text-align: left; font: inherit;
}
.rs-credit:hover { border-color: var(--ink); }
.rs-credit .rs-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rs-credit .n { font-size: 14px; font-weight: 700; color: var(--ink); }
.rs-credit .r { font-size: 12px; color: var(--mute); }

/* ══ QUICK MENU (single dot in the player → drawer) ═══════════════════ */

.rs-widget-trigger {
  position: relative; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; border: 1px solid transparent; background: transparent;
  color: var(--mute); cursor: pointer; transition: all .16s var(--rs-ease);
}
.rs-widget-trigger:hover, .rs-widget-trigger[aria-expanded="true"] {
  background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink);
}
.rs-widget-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.rs-trigger-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  transition: transform .18s var(--rs-ease);
}
.rs-widget-trigger:hover .rs-trigger-dot,
.rs-widget-trigger[aria-expanded="true"] .rs-trigger-dot { transform: scale(1.35); }
.rs-widget-trigger .rs-widget-avatar {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}

/* Desktop: a rounded card docked to the right gutter, in the same 8px frame
   as the sidebar and main column. The shell adds matching right padding
   (body.rs-widget-open) so the content shrinks instead of being covered. */
.rs-widget {
  position: fixed; z-index: 90;
  top: 8px; right: 8px; bottom: calc(var(--bar-h-safe, 88px) + 8px);
  width: var(--rs-widget-w, 340px); max-width: calc(100vw - 16px);
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--rs-shadow);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(calc(100% + 16px));
  transition: transform .28s var(--rs-ease), opacity .2s var(--rs-ease);
  opacity: 0;
  visibility: hidden;
}
.rs-widget.open { transform: none; visibility: visible; opacity: 1; }

.rs-widget-grab { display: none; }
.rs-widget-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.rs-widget-head .rs-avatar { width: 44px; border-width: 0; box-shadow: none; font-size: 18px; }
.rs-widget-who { min-width: 0; flex: 1; }
.rs-widget-who .n { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-widget-who .s { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rs-widget-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 10px 8px; }
.rs-widget-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 15px 6px;
  border-radius: 12px; border: 0; background: none; cursor: pointer; color: var(--ink);
  font: inherit; font-size: 11.5px; font-weight: 600; text-align: center; text-decoration: none;
  transition: background .14s var(--rs-ease);
}
.rs-widget-tile:hover, .rs-widget-tile:focus-visible { background: color-mix(in srgb, var(--ink) 9%, transparent); outline: none; }
.rs-widget-tile svg { width: 21px; height: 21px; stroke-width: 1.7; color: var(--mute); }
.rs-widget-tile:hover svg { color: var(--accent); }
.rs-widget-tile[aria-pressed="true"] svg { color: var(--accent); }

.rs-widget-foot { display: flex; padding: 8px; border-top: 1px solid var(--line); gap: 2px; margin-top: auto; }
.rs-widget-foot button, .rs-widget-foot a {
  flex: 1; padding: 11px; border-radius: 10px; border: 0; background: none; cursor: pointer;
  color: var(--mute); font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; text-align: center;
}
.rs-widget-foot button:hover, .rs-widget-foot a:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

.rs-widget-panel-head { display: flex; align-items: center; gap: 10px; min-height: 65px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rs-widget-panel-head h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.rs-widget-panel-body { padding: 18px; }
.rs-widget-panel-actions { display: flex; justify-content: center; gap: 8px; }
.rs-widget-loading { padding: 36px 0; color: var(--mute); text-align: center; }
.rs-widget-wide-link { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.rs-widget-wide-link:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.rs-widget-wide-link svg { width: 16px; height: 16px; }
.rs-widget-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-widget-stat-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.rs-widget-stat-grid strong, .rs-widget-stat-grid span { display: block; }
.rs-widget-stat-grid strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.rs-widget-stat-grid span, .rs-widget-highlight span, .rs-widget-highlight small { color: var(--mute); font-size: 11px; }
.rs-widget-highlight { display: grid; gap: 2px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.rs-widget-highlight strong { font-size: 15px; }
.rs-widget-billing .lr-tier-card { margin: 0; }

.rs-timer { text-align: center; }
.rs-timer > p { margin: 18px 0; color: var(--mute); font-size: 13px; }
.rs-timer-dial { --angle: 59deg; position: relative; display: grid; place-content: center; width: 190px; aspect-ratio: 1; margin: 8px auto; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle at 50% 45%, var(--surface) 0 56%, transparent 57%), conic-gradient(from -135deg, var(--accent) var(--angle), var(--line) 0 270deg, transparent 0); box-shadow: inset 0 0 0 12px var(--paper-2), 0 16px 34px rgba(0,0,0,.18); cursor: ew-resize; }
.rs-timer-dial strong { font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; }
.rs-timer-dial small { margin-top: 5px; color: var(--mute); }
.rs-timer-dial input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.rs-timer-hand { position: absolute; left: calc(50% - 2px); top: 13px; width: 4px; height: 21px; border-radius: 4px; background: var(--accent); transform-origin: 2px 82px; transform: rotate(calc(-135deg + var(--angle))); }

.rs-widget-inline-form { height: 100%; min-height: 0; }
.rs-widget-inline-form .rs-modal-panel { position: static; transform: none; width: 100%; max-height: none; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.rs-widget-inline-form .rs-modal-head { padding: 12px 14px; }
.rs-widget-inline-form .rs-modal-head > div { order: 2; }
.rs-widget-inline-form .rs-modal-head > button { order: 1; }
.rs-widget-inline-form .rs-modal-body { padding: 16px; }
.rs-widget-inline-form .rs-modal-foot { padding: 12px 16px; }

/* Mobile: the same panel becomes a floating slide-up sheet that stops above
   the transport bar, so the player is never sandwiched inside the menu. */
@media (max-width: 640px) {
  .rs-widget {
    top: auto; left: 8px; right: 8px;
    bottom: calc(var(--bar-h-safe, 88px) + 8px);
    width: auto; max-width: none; max-height: 72dvh;
    border: 1px solid var(--line);
    border-radius: 22px;
    transform: translateY(calc(100% + var(--bar-h-safe, 88px) + 16px));
  }
  .rs-widget-grab {
    display: block; width: 38px; height: 4px; border-radius: 99px;
    background: var(--line); margin: 10px auto 2px; flex: 0 0 auto;
  }
  .rs-widget-head { padding-top: 12px; }
  .rs-widget-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ══ MODALS (profile editor · verification) ═══════════════════════════ */

.rs-modal { position: fixed; inset: 0; z-index: 120; display: none; }
.rs-modal.open { display: block; }
.rs-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.rs-modal-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  display: flex; flex-direction: column; border-radius: var(--rs-radius-lg);
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--rs-shadow); overflow: hidden;
}
.rs-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.rs-modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.rs-modal-head p { margin: 3px 0 0; font-size: 13px; color: var(--mute); }
.rs-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.rs-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 40%, transparent); }
@media (max-width: 640px) {
  .rs-modal-panel { inset: auto 0 0 0; top: auto; left: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
}

.rs-field { display: block; margin: 0 0 18px; }
.rs-field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.rs-field > em { display: block; font-size: 12px; font-style: normal; color: var(--mute); margin-bottom: 7px; }
.rs-field input[type="text"], .rs-field input[type="url"], .rs-field input[type="email"],
.rs-field input[type="date"], .rs-field input[type="number"], .rs-field select, .rs-field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.rs-field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.rs-field input:focus, .rs-field select:focus, .rs-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.rs-field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.rs-field-error { display: block; margin-top: 6px; font-size: 12px; color: #ff5d5d; font-weight: 600; }
.rs-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--mute); margin-bottom: 16px; }
.rs-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); }

.rs-image-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.rs-image-upload { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rs-image-upload.is-banner { grid-template-columns: 130px minmax(0, 1fr); }
.rs-image-preview { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--mute); font-size: 12px; font-weight: 700; text-align: center; }
.rs-image-preview.is-round { border-radius: 50%; }
.rs-image-upload.is-banner .rs-image-preview { aspect-ratio: 16 / 7; border-radius: 10px; }
.rs-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-image-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rs-image-controls strong, .rs-image-controls em { flex: 0 0 100%; }
.rs-image-controls strong { color: var(--ink); font-size: 13px; }
.rs-image-controls em { color: var(--mute); font-size: 12px; font-style: normal; }
.rs-link-button { border: 0; background: none; color: var(--mute); padding: 8px 2px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rs-link-button:hover { color: var(--ink); }
.rs-pick-chooser { display: grid; gap: 8px; max-height: 310px; overflow: auto; padding: 2px; }
.rs-pick-choice { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.rs-pick-choice input { order: 3; width: 17px; height: 17px; accent-color: var(--accent); }
.rs-pick-choice-art { width: 42px; height: 42px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--mute); }
.rs-pick-choice-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-pick-choice-art svg { width: 18px; height: 18px; }
.rs-pick-choice b, .rs-pick-choice small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-pick-choice b { font-size: 13.5px; color: var(--ink); }
.rs-pick-choice small { font-size: 12px; color: var(--mute); }

.rs-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.rs-swatch[aria-pressed="true"] { border-color: var(--ink); transform: scale(1.1); }

.rs-note {
  padding: 13px 16px; border-radius: 12px; font-size: 13px; line-height: 1.55;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink);
  margin-bottom: 20px;
}
.rs-note.is-ok { background: color-mix(in srgb, #22c55e 12%, transparent); border-color: color-mix(in srgb, #22c55e 34%, transparent); }
.rs-note.is-warn { background: color-mix(in srgb, #f59e0b 12%, transparent); border-color: color-mix(in srgb, #f59e0b 34%, transparent); }

/* Credit rows in the Studio wizard */
.rs-credit-row { display: grid; grid-template-columns: 1.4fr 1fr .7fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rs-credit-row input, .rs-credit-row select {
  padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; min-width: 0;
}
.rs-credit-row .rs-remove {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: none; color: var(--mute); cursor: pointer; font-size: 17px; line-height: 1;
}
.rs-credit-row .rs-remove:hover { color: #ff5d5d; border-color: #ff5d5d; }
@media (max-width: 640px) { .rs-credit-row { grid-template-columns: 1fr 1fr; } .rs-credit-row .rs-remove { grid-column: 2; justify-self: end; } }

/* ══ MOBILE ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .rs-section { margin-bottom: 30px; }
  .rs-shelf { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .rs-shelf.is-video { grid-template-columns: 1fr; }
  .rs-identity { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: -56px; }
  .rs-actions { margin-bottom: 22px; }
  .rs-explore-hero { min-height: 240px; }
  .rs-hero-body { padding: 22px; }
}
@media (max-width: 520px) {
  .rs-shelf { grid-template-columns: repeat(2, 1fr); }
  .rs-picks { grid-template-columns: repeat(2, 1fr); }
  .rs-btn { padding: 10px 16px; font-size: 13.5px; }
  .rs-actions { gap: 8px; }
}
