/* legal-gate.css — Terms/DPA acceptance modal.
   Premium, minimal, editorial. Theme-aware (reads --bg-color/--text-color/--border-color).
   The scrim blocks the app; mandatory steps cannot be dismissed. */

.lg-scrim {
  position: fixed;
  inset: 0;
  z-index: 6000;                 /* above app chrome, below nothing else */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px 24px;
  background: rgba(10, 10, 12, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.lg-scrim.is-open { opacity: 1; }

.lg-modal {
  --lg-fg: var(--text-color, #111);
  --lg-bg: var(--bg-color, #fff);
  --lg-line: var(--border-color, rgba(0, 0, 0, 0.10));
  --lg-muted: color-mix(in srgb, var(--lg-fg) 52%, transparent);
  --lg-faint: color-mix(in srgb, var(--lg-fg) 8%, transparent);
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  background: var(--lg-bg);
  color: var(--lg-fg);
  border: 1px solid var(--lg-line);
  border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, max-width 0.4s ease;
}
.lg-scrim.is-open .lg-modal { transform: none; opacity: 1; }
.lg-modal.is-wide { max-width: 920px; }        /* when plain-English column is shown */
/* Compact: a short question with no document body (the onboarding "Stay in the loop?" prompt), so
   the head and foot hairlines would meet; drop them and keep the card narrow. */
.lg-modal.is-compact { max-width: 400px; }
.lg-modal.is-compact .lg-head { border-bottom: 0; padding-bottom: 8px; }
.lg-modal.is-compact .lg-foot { border-top: 0; }
/* Onboarding roster picker ("Start with one of your artists"): rows of round picture + name. */
.lg-modal.is-roster { max-width: 440px; }
.lg-roster { display: flex; flex-direction: column; gap: 2px; padding: 4px 18px 0; }
.lg-roster:empty { display: none; }
.lg-roster-item { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 12px; background: transparent; color: var(--lg-fg); text-align: left; cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease; }
.lg-roster-item:hover, .lg-roster-item:focus-visible { background: var(--lg-faint); outline: none; }
.lg-roster-item img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.lg-roster-text { min-width: 0; display: flex; flex-direction: column; }
.lg-roster-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-roster-meta { font-size: 12.5px; color: var(--lg-muted); }
.lg-roster.is-busy .lg-roster-item:not(.is-picked) { opacity: 0.35; pointer-events: none; }
.lg-roster-item.is-picked { background: var(--lg-faint); }

/* ── header ──────────────────────────────────────────────────────────── */
.lg-head {
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--lg-line);
  flex-shrink: 0;
}
.lg-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.lg-meta { font-size: 12px; color: var(--lg-muted); margin: 6px 0 0; }
.lg-intro { font-size: 14px; line-height: 1.5; color: var(--lg-muted); margin: 12px 0 0; }

/* step dots (Terms → DPA) — sit above the title */
.lg-steps { display: flex; gap: 6px; margin: 0 0 14px; }
.lg-step-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lg-faint); transition: background 0.3s; }
.lg-step-dot.is-active { background: var(--lg-fg); }
.lg-step-dot.is-done { background: color-mix(in srgb, var(--lg-fg) 40%, transparent); }

/* plain-English switch, right side of the header */
.lg-plain-toggle {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lg-muted);
  cursor: pointer;
  user-select: none;
}
.lg-switch {
  position: relative; width: 34px; height: 20px; border-radius: 999px;
  background: var(--lg-faint); border: 1px solid var(--lg-line); transition: background 0.25s;
  flex-shrink: 0;
}
.lg-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--lg-fg); opacity: 0.6; transition: transform 0.25s, opacity 0.25s;
}
.lg-plain-toggle.is-on .lg-switch { background: color-mix(in srgb, var(--lg-fg) 20%, transparent); }
.lg-plain-toggle.is-on .lg-switch::after { transform: translateX(14px); opacity: 1; }

/* ── document body ───────────────────────────────────────────────────── */
.lg-doc {
  position: relative;
  overflow-y: auto;
  padding: 22px 30px 26px;
  flex: 1 1 auto;
  scroll-behavior: smooth;
  outline: none;                 /* focused on open for keyboard scrolling; no browser (blue) ring */
}
.lg-section { padding: 16px 0; border-bottom: 1px solid var(--lg-faint); }
.lg-section:last-child { border-bottom: none; }
.lg-section-heading { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 10px; }
.lg-subheading { font-size: 13.5px; font-weight: 600; margin: 16px 0 6px; color: var(--lg-fg); }
.lg-legal .lg-subheading:first-child { margin-top: 0; }

.lg-cols { display: block; }
.lg-legal { font-size: 13.5px; line-height: 1.65; color: color-mix(in srgb, var(--lg-fg) 82%, transparent); }
.lg-legal p { margin: 0 0 10px; }
.lg-legal p:last-child { margin-bottom: 0; }
.lg-legal ul { margin: 6px 0; padding-left: 20px; }

/* Plain-English column — hidden until the toggle is on. Its heading mirrors the legal
   heading (same size/weight) but muted, so it reads as a companion title, not a label. */
.lg-plain-heading {
  display: none;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 10px;
  color: var(--lg-muted);
}
.lg-plain {
  display: none;
  font-size: 13px;
  line-height: 1.6;
  color: var(--lg-muted);
}

/* plain-English ON: two columns on wide screens, stacked+tinted on narrow.
   One shared grid places [legal heading | plain heading] on row 1 and the two
   bodies on row 2, so headings align and each body starts on the same line. */
@media (min-width: 720px) {
  .lg-modal.is-plain .lg-plain-heading,
  .lg-modal.is-plain .lg-plain { display: block; }
  .lg-modal.is-plain .lg-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
    row-gap: 0;
    align-items: start;
  }
  .lg-modal.is-plain .lg-plain-heading,
  .lg-modal.is-plain .lg-plain {
    padding-left: 22px; border-left: 1px solid var(--lg-line);
  }
}
@media (max-width: 719.98px) {
  /* Narrow: plain heading + body stack under the legal text as one tinted block. The DOM order is
     [legal heading, plain heading, legal body, plain body] (for the wide grid), so reorder here. */
  .lg-modal.is-plain .lg-cols { display: flex; flex-direction: column; }
  .lg-modal.is-plain .lg-section-heading { order: 1; }
  .lg-modal.is-plain .lg-legal { order: 2; }
  .lg-modal.is-plain .lg-plain-heading { order: 3; }
  .lg-modal.is-plain .lg-plain { order: 4; }
  .lg-modal.is-plain .lg-plain-heading,
  .lg-modal.is-plain .lg-plain { display: block; }
  .lg-modal.is-plain .lg-plain-heading {
    margin: 12px 0 0; padding: 12px 14px 0;
    background: var(--lg-faint); border-radius: 10px 10px 0 0;
  }
  .lg-modal.is-plain .lg-plain {
    margin: 0 0 0; padding: 4px 14px 12px; border-radius: 0 0 10px 10px;
    background: var(--lg-faint);
  }
}


/* ── footer / actions ────────────────────────────────────────────────── */
.lg-foot {
  padding: 16px 30px 20px;
  border-top: 1px solid var(--lg-line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.lg-read-hint {
  font-size: 12px; color: var(--lg-muted); display: inline-flex; align-items: center; gap: 7px;
  transition: opacity 0.3s;
}
.lg-read-hint.is-hidden { opacity: 0; pointer-events: none; }
.lg-foot-spacer { flex: 1 1 auto; }
/* Roster search: a 44px round button that grows into a field (big rosters). */
.lg-search { display: inline-flex; align-items: center; height: 44px; width: 44px; border: 1px solid var(--lg-line); border-radius: 999px; overflow: hidden;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s; }
.lg-search[hidden] { display: none; }
.lg-search.is-open { width: min(280px, 60vw); }
.lg-search-btn { flex: none; width: 42px; height: 42px; border: 0; background: transparent; color: var(--lg-fg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.lg-search-btn:hover { background: var(--lg-faint); }
.lg-search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--lg-fg); font: inherit; font-size: 13.5px; padding: 0 16px 0 0; outline: none; opacity: 0; transition: opacity 0.18s; }
.lg-search.is-open .lg-search-input { opacity: 1; }
.lg-search-input::placeholder { color: var(--lg-muted); }
.lg-search-input::-webkit-search-cancel-button { display: none; }
.lg-roster-item[hidden] { display: none; }

.lg-btn {
  appearance: none; border: 1px solid var(--lg-line); background: transparent; color: var(--lg-fg);
  font-size: 13.5px; font-weight: 600; padding: 11px 20px; border-radius: 999px; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, opacity 0.18s, transform 0.08s;
  white-space: nowrap;
}
.lg-btn:hover { background: var(--lg-faint); }
.lg-btn:active { transform: scale(0.98); }
.lg-btn-ghost { border-color: transparent; color: var(--lg-muted); padding-left: 8px; padding-right: 8px; }
.lg-btn-ghost:hover { color: var(--lg-fg); background: transparent; }
.lg-btn-primary {
  background: var(--lg-fg); color: var(--lg-bg); border-color: var(--lg-fg); font-weight: 700;
}
.lg-btn-primary:hover { background: color-mix(in srgb, var(--lg-fg) 88%, var(--lg-bg)); }
.lg-btn-primary[disabled] {
  opacity: 0.32; cursor: not-allowed; pointer-events: none;
}
.lg-btn .spin { display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: lg-spin 0.6s linear infinite;
  vertical-align: -2px; margin-right: 7px; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

/* Welcome modal (releases-page.js): "Check your inbox" over "Stay in the loop?". */
.lg-resend { margin: 10px 0 0 -8px; }
.lg-loop { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--lg-faint); }
.lg-loop.is-only { margin-top: 0; padding-top: 0; border-top: 0; }
.lg-loop .lg-section-heading { margin: 0; }
.lg-loop .lg-intro { margin-top: 6px; }
.lg-intro strong { color: var(--lg-fg); font-weight: 600; }
.lg-email-note { font-size: 11.5px; color: var(--lg-muted); width: 100%; margin: -2px 0 0; }

@media (max-width: 560px) {
  .lg-head { padding: 22px 20px 16px; }
  .lg-doc { padding: 18px 20px 22px; }
  .lg-foot { padding: 14px 20px 18px; }
  .lg-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-scrim, .lg-modal, .lg-doc { transition: none; }
  .lg-btn .spin { animation-duration: 1.2s; }
}

/* Library mode (account menu → Legal & agreements): a quiet row of tabs above the title, and the
   acceptance record in the footer. Plain text tabs; the current one in full ink with a solid underline. */
.lg-tabs { display: flex; gap: 20px; margin: -6px 0 18px; overflow-x: auto; scrollbar-width: none; }
.lg-tabs::-webkit-scrollbar { display: none; }
.lg-tab { appearance: none; border: 0; background: none; padding: 6px 0; font-size: 13.5px; font-weight: 600;
  color: var(--lg-muted); cursor: pointer; box-shadow: inset 0 -2px 0 transparent; white-space: nowrap; }
.lg-tab:hover { color: var(--lg-fg); }
.lg-tab.is-active { color: var(--lg-fg); box-shadow: inset 0 -2px 0 var(--lg-fg); }
.lg-tab:focus-visible { outline: 2px solid var(--lg-fg); outline-offset: 2px; border-radius: 4px; }
.lg-record { font-size: 12.5px; color: var(--lg-muted); }
