/* Design tokens — Stitch layout, existing coral brand */
:root {  
  overflow-x: hidden;

  --brand: #e85d4c;
  --brand-2: #ff8a65;
  --brand-dim: rgba(232, 93, 76, 0.15);
  --bg: #051424;
  --bg-elevated: #0d1c2d;
  --surface: #122131;
  --surface-high: #1c2b3c;
  --surface-highest: #273647;
  --on-surface: #d4e4fa;
  --on-surface-muted: #9aa8bc;
  --on-surface-variant: #c7c4d7;
  --outline: #464554;
  --outline-soft: rgba(255, 255, 255, 0.08);
  --error: #ffb4ab;
  --success: #3ecf8e;

  --unit: 4px;
  --stack-sm: 8px;
  --stack-md: 16px;
  --stack-lg: 48px;
  --gutter: 24px;
  --tile-gap: 16px;
  --margin-safe: 32px;
  --container-max: 1280px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-glow: 0 8px 32px rgba(232, 93, 76, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  overflow-x: hidden;

  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background: radial-gradient(ellipse at top, #0d1c2d 0%, var(--bg) 55%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--margin-safe);
  padding-right: var(--margin-safe);
}

@media (max-width: 640px) {
  .container { padding-left: var(--stack-md); padding-right: var(--stack-md); }
}

a { color: var(--brand-2); text-decoration: none; }
a:not(.btn):hover { color: var(--brand); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
}
.skip-link:focus {
  left: var(--stack-md); top: var(--stack-md);
  background: #fff; color: #000; padding: var(--stack-sm) var(--stack-md);
}

/* Typography */
.display-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--stack-md);
}

.section-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.body-lg { font-size: 1.125rem; line-height: 1.6; color: var(--on-surface-muted); margin: 0; }
.text-center { text-align: center; }

.meta-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}

/* Header / chrome */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 20, 36, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-soft);
}

.site-chrome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  min-height: 64px;
  padding-top: var(--stack-sm);
  padding-bottom: var(--stack-sm);
  position: relative;
}

.site-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  width: 100%;
  min-height: inherit;
}

.site-header {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.site-logo {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-surface);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.site-nav-panel {
  justify-self: center;
}

.site-nav-primary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: var(--stack-md);
}

.site-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--stack-md);
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  z-index: 2;
}

.nav-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.nav-profile.is-active,
.nav-profile:hover,
.nav-profile:focus-visible {
  border-color: rgba(232, 93, 76, 0.45);
}

.nav-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-profile-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #111;
  font-size: 1rem;
}

.nav-link-logout {
  white-space: nowrap;
}

.nav-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  white-space: nowrap;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover { color: var(--on-surface); }
.nav-link.is-active {
  color: var(--on-surface);
  border-bottom-color: rgba(255, 255, 255, 0.72);
}
.nav-link-muted { opacity: 0.85; }

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  color: var(--on-surface-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-chip i {
  font-size: 0.875rem;
  opacity: 0.9;
}

.nav-chip-avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-chip-label--short {
  display: none;
}

.nav-chip:hover,
.nav-chip:focus-visible {
  color: var(--on-surface);
  border-color: rgba(255, 255, 255, 0.18);
}

.nav-chip.is-active {
  border-color: rgba(232, 93, 76, 0.45);
  background: var(--brand-dim);
  color: var(--on-surface);
}

.nav-chip-menu-only,
.nav-menu-only {
  display: none;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  background: transparent;
  color: var(--on-surface-muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-icon-btn:hover,
.nav-icon-btn:focus-visible {
  color: var(--on-surface);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.nav-install-btn[hidden] {
  display: none !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--stack-sm);
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  z-index: 80;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--on-surface);
  margin: 5px auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-chrome--public .site-nav-primary {
  gap: var(--stack-lg);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .nav-profile--desktop {
    display: none;
  }

  .site-chrome {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 0;
  }

  .site-chrome-row {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .site-brand-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--stack-md);
    width: 100%;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) var(--margin-safe) 0;
    border-bottom: 1px solid var(--outline-soft);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    background: rgba(5, 20, 36, 0.92);
    backdrop-filter: blur(12px);
  }

  .site-logo {
    font-size: 1.125rem;
    line-height: 52px;
  }

  .site-nav-actions {
    display: flex;
    flex-shrink: 0;
    margin-left: 0;
    align-items: center;
    gap: var(--stack-sm);
  }

  .site-nav-actions .nav-profile {
    width: 36px;
    height: 36px;
  }

  .push-status-details li {
    grid-template-columns: 10px 4.5rem 1fr;
  }

  section#search-results-section a.glass-card {
    aspect-ratio: 4/5;
  }
  /* --- App: bottom tab bar --- */
  .site-chrome--app header.site-header {
    display: block;
    position: fixed;
    top: unset;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    z-index: 60;
    background: rgba(5, 20, 36, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--outline-soft);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-chrome--app .site-nav-panel {
    width: 100%;
    height: auto;
    justify-self: stretch;
  }

  .site-chrome--app .site-nav-primary {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    flex-direction: unset;
    align-items: stretch;
    justify-content: stretch;
    gap: var(--stack-md);
    width: 100%;
    height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .site-chrome--app .nav-chip {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 56px;
    padding: 8px 4px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    font-size: 0.625rem;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.2;
  }

  .site-chrome--app .nav-chip i,
  .site-chrome--app .nav-chip-avatar {
    font-size: 1.2rem;
    width: 1.35rem;
    height: 1.35rem;
    opacity: 1;
  }

  .site-chrome--app .nav-chip-label--full {
    display: none;
  }

  .site-chrome--app .nav-chip-label--short {
    display: inline;
  }

  .site-chrome--app .nav-chip.is-active {
    background: var(--brand-dim);
    color: var(--on-surface);
    border: 0;
  }

  .site-chrome--app .nav-chip:hover,
  .site-chrome--app .nav-chip:focus-visible {
    border: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  body:has(.site-chrome--app) {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Public: hamburger fullscreen --- */
  .site-chrome--public .nav-toggle {
    display: block;
  }

  .site-chrome--public header.site-header {
    position: fixed;
    inset: 0;
    transform: none;
    z-index: 70;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #051424;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  body.is-nav-open {
    overflow: hidden;
    height: 100vh;
  }

  body.is-nav-open .site-chrome--public header.site-header {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-chrome--public .site-nav-panel {
    width: 100%;
    height: 100%;
    justify-self: stretch;
  }

  .site-chrome--public .site-nav-primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--stack-md);
    width: 100%;
    height: 100%;
    padding: calc(72px + env(safe-area-inset-top, 0px)) var(--margin-safe) calc(32px + env(safe-area-inset-bottom, 0px));
  }

  .site-chrome--public .nav-link {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--outline-soft);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--outline-soft);
  }

  .site-chrome--public .nav-link.is-active {
    background: var(--brand-dim);
    border-color: rgba(232, 93, 76, 0.45);
    border-bottom-color: rgba(232, 93, 76, 0.45);
  }

  .site-chrome--public .nav-menu-only {
    display: block;
  }

  body:has(.site-chrome--public) {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: 0;
  }
}

/* Main & footer */
main#main {
  min-height: calc(100vh - 149px);
}
.site-main {
  padding-top: var(--stack-lg);
  padding-bottom: calc(var(--stack-lg) * 1.5);
  display: flex;
  flex-direction: column;
  gap: var(--stack-lg);
}

.site-footer {
  border-top: 1px solid var(--outline-soft);
  padding: var(--stack-md) 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-md);
  text-align: center;
}

.footer-copy {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--on-surface-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--stack-md) var(--stack-lg);
}

.footer-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--on-surface);
}

/* Cards */
.glass-card {
  background: linear-gradient(180deg, rgba(28, 43, 60, 0.45) 0%, rgba(18, 33, 49, 0.45) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-lg);
  min-height: 200px;
  /* box-shadow: var(--shadow-glow); */
}

.bento-grid .glass-card {
  min-height: unset;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--stack-sm);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 12px 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #111;
  box-shadow: 0 4px 20px rgba(232, 93, 76, 0.25);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  color: #111;
  box-shadow: 0 6px 24px rgba(232, 93, 76, 0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--on-surface);
  border: 1px solid var(--outline);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--on-surface);
  border-color: var(--on-surface-muted);
  background: rgba(255, 255, 255, 0.04);
}
.btn-danger { background: var(--error); color: #111; }
.btn-danger:hover,
.btn-danger:focus-visible { color: #111; }
.btn-ghost { background: transparent; color: var(--on-surface-muted); border: 1px solid transparent; }
.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--on-surface);
  border-color: var(--outline-soft);
}
.btn-sm { padding: 8px 14px; font-size: 0.7rem; }

/* Shared app-style button loading */
.btn.is-loading,
.watch-mark-btn.is-loading,
.season-watch-toggle.is-loading {
  pointer-events: none;
  cursor: wait;
  transform: none;
}

.btn.is-loading > *,
.watch-mark-btn.is-loading > *,
.season-watch-toggle.is-loading > * {
  visibility: hidden;
}

.btn.is-loading::after,
.watch-mark-btn.is-loading::after,
.season-watch-toggle.is-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  left: 50%;
  top: 50%;
  margin: -0.5rem 0 0 -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: currentColor;
  animation: app-btn-spin 0.7s linear infinite;
}

.btn-primary.is-loading::after,
.btn-danger.is-loading::after {
  border-color: rgba(0, 0, 0, 0.16);
  border-top-color: rgba(0, 0, 0, 0.7);
}

@keyframes app-btn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after,
  .watch-mark-btn.is-loading::after,
  .season-watch-toggle.is-loading::after {
    animation: none;
    border-color: currentColor;
    opacity: 0.55;
  }
}

.action-row, .action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-md);
  margin-top: var(--stack-md);
}

/* Forms */
.stack-form label {
  display: grid;
  gap: var(--stack-sm);
  /* margin-bottom: var(--stack-md); */
  font-size: 0.875rem;
  color: var(--on-surface-muted);
}
.stack-form input,
.stack-form select,
.search-input-wrap input {
  width: 100%;
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
  color: var(--on-surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
}
.stack-form input:focus,
.search-input-wrap input:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--brand);
}

.auth-card { max-width: 440px; margin: auto; padding: var(--gutter); }
.auth-card-wide { max-width: 520px; width: 100%; }
.auth-card-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 var(--stack-sm);
}
.auth-card-lead {
  margin: 0 0 var(--stack-md);
  color: var(--on-surface-muted);
  line-height: 1.6;
}
.form-footer { margin-top: var(--stack-md); color: var(--on-surface-muted); font-size: 0.875rem; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin: clamp(1rem, 3vw, 2rem) 0 var(--stack-lg);
}

.auth-shell-narrow {
  grid-template-columns: 1fr;
  justify-items: center;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.auth-shell-intro {
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
  align-items: flex-start;
  text-align: left;
}

.auth-shell-eyebrow {
  color: var(--brand-2);
  margin: 0;
}

.auth-shell-intro .display-title {
  margin-bottom: 0;
}

.auth-shell-invite {
  display: flex;
  align-items: flex-start;
  gap: var(--stack-md);
  margin: 0;
  width: 100%;
  padding: var(--stack-md) var(--gutter);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(232, 93, 76, 0.14) 0%, rgba(255, 138, 101, 0.06) 100%);
  border: 1px solid rgba(232, 93, 76, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--on-surface);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.auth-shell-invite > i {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(232, 93, 76, 0.18);
  color: var(--brand-2);
  font-size: 1rem;
}

.auth-shell-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--stack-sm);
}

.auth-shell-points li {
  display: flex;
  align-items: center;
  gap: var(--stack-sm);
  color: var(--on-surface-muted);
}

.auth-shell-points i {
  color: var(--brand);
  width: 1.25rem;
  text-align: center;
}

.register-steps {
  display: flex;
  align-items: center;
  gap: var(--stack-sm);
  margin-bottom: var(--stack-md);
}

.register-step {
  display: inline-flex;
  align-items: center;
  gap: var(--stack-sm);
  font-size: 0.875rem;
  color: var(--on-surface-muted);
}

.register-step.is-active {
  color: var(--on-surface);
  font-weight: 600;
}

.register-step.is-done {
  color: var(--brand-2);
}

.register-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.register-step.is-active .register-step-num,
.register-step.is-done .register-step-num {
  background: var(--brand-dim);
  border-color: rgba(232, 93, 76, 0.35);
  color: var(--brand);
}

.register-step-sep {
  flex: 1;
  height: 1px;
  background: var(--outline-soft);
  max-width: 3rem;
}

.register-profile-form .provider-fieldset {
  margin-top: var(--stack-sm);
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-shell-intro {
    align-items: flex-start;
    text-align: left;
  }
}

/* Onboarding modal */
body.onboarding-open {
  overflow: hidden;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--stack-md);
  background: rgba(5, 20, 36, 0.72);
  backdrop-filter: blur(6px);
  animation: onboarding-fade-in 0.25s ease;
}

.onboarding-overlay.is-closing {
  animation: onboarding-fade-out 0.2s ease forwards;
}

.onboarding-dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
}

.onboarding-close {
  position: absolute;
  top: var(--stack-sm);
  right: var(--stack-sm);
}

.onboarding-eyebrow {
  margin: 0;
  color: var(--brand-2);
}

.onboarding-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.25;
  padding-right: 2rem;
}

.onboarding-lead {
  margin: 0;
  color: var(--on-surface-muted);
  line-height: 1.6;
}

.onboarding-highlights {
  display: grid;
  gap: var(--stack-md);
}

.onboarding-highlight {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--stack-md);
  align-items: start;
}

.onboarding-highlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--brand-dim);
  color: var(--brand);
}

.onboarding-highlight-title {
  margin: 0 0 var(--stack-sm);
  font-size: 1rem;
  font-weight: 600;
}

.onboarding-highlight p {
  margin: 0;
  color: var(--on-surface-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.onboarding-highlight p + p {
  margin-top: var(--stack-sm);
}

.onboarding-note {
  font-size: 0.875rem !important;
}

.onboarding-nav-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
  justify-content: center;
}

.onboarding-nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  color: var(--on-surface-muted);
  font-size: 0.8125rem;
}

.onboarding-nav-chip.is-active {
  border-color: rgba(232, 93, 76, 0.4);
  background: var(--brand-dim);
  color: var(--on-surface);
}

.onboarding-cta {
  align-self: stretch;
  margin-top: var(--stack-sm);
}

@keyframes onboarding-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes onboarding-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Invite confirmation */
.invite-card {
  max-width: 520px;
  margin: var(--stack-lg) auto;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
  text-align: center;
}

.invite-eyebrow {
  margin: 0;
  color: var(--brand-2);
}

.invite-title {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.invite-group-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-md);
  padding: var(--stack-md) 0;
}

.invite-group-image {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--outline-soft);
}

.invite-group-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-high);
  color: var(--brand);
  font-size: 2rem;
}

.invite-group-meta {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
}

.invite-members {
  margin: 0;
  width: 100%;
  max-width: 360px;
}

.invite-member-roster {
  list-style: none;
  margin: var(--stack-sm) 0 0;
  padding: 0;
  display: grid;
  gap: var(--stack-sm);
}

.invite-member-item {
  display: flex;
  align-items: center;
  gap: var(--stack-sm);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--outline-soft);
}

.invite-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.invite-member-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-high);
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.invite-member-name {
  flex: 1;
  min-width: 0;
  color: var(--on-surface);
  font-size: 0.9375rem;
}

.invite-member-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
}

.invite-members-label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin-bottom: 4px;
}

.invite-copy {
  margin: 0;
}

.invite-actions {
  justify-content: center;
  margin-top: var(--stack-sm);
}

.invite-guest-hint i {
  color: var(--brand-2);
  margin-top: 2px;
}

/* Group invite panel */
.group-invite-panel {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
}

.group-invite-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--stack-md);
}

.group-invite-head-text {
  flex: 1;
  min-width: 0;
}

.group-invite-dismiss {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

.group-invite-head .section-title {
  margin-bottom: var(--stack-sm);
}

.group-invite-head .hint {
  margin: 0;
}

.group-invite-code-row,
.group-invite-link-row {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
}

.group-invite-link-field {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
  align-items: center;
}

.group-invite-link-input {
  flex: 1 1   ;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-soft);
  background: rgba(0, 0, 0, 0.2);
  color: var(--on-surface-muted);
  font-size: 0.875rem;
}

.group-invite-share {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.group-invite-share .btn i {
  margin-right: 4px;
}

/* Group detail member stack */
.group-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stack-sm) var(--stack-md);
  margin-top: var(--stack-sm);
}

.group-detail-count {
  margin: 0;
}

.group-member-stack-wrap {
  position: relative;
}

.group-member-stack {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.group-member-stack:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
}

.group-member-stack-avatar,
.group-member-stack-fallback,
.group-member-stack-more {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  margin-left: -10px;
  border: 2px solid var(--surface);
  box-sizing: border-box;
}

.group-member-stack-avatar:first-child,
.group-member-stack-fallback:first-child,
.group-member-stack-more:first-child {
  margin-left: 0;
}

.group-member-stack-avatar {
  object-fit: cover;
  display: block;
}

.group-member-stack-fallback,
.group-member-stack-more {
  display: inline-grid;
  place-items: center;
  background: var(--surface-highest);
  color: var(--on-surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.group-member-stack-more {
  background: var(--brand-dim);
  color: var(--brand-2);
}

.group-members-popover {
  position: absolute;
  top: calc(100% + var(--stack-sm));
  left: 0;
  z-index: 40;
  min-width: min(280px, 90vw);
  max-width: 320px;
  padding: var(--stack-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-soft);
  background: var(--surface-high);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.group-members-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-sm);
  margin-bottom: var(--stack-md);
}

.group-members-popover-title {
  margin: 0;
  font-size: 0.95rem;
}

.group-members-popover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
  max-height: 280px;
  overflow-y: auto;
}

.group-members-popover-item {
  display: flex;
  align-items: center;
  gap: var(--stack-sm);
}

.group-members-popover-avatar,
.group-members-popover-fallback {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex-shrink: 0;
  object-fit: cover;
}

.group-members-popover-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-highest);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

.group-members-popover-name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-soft);
  background: rgba(0, 0, 0, 0.2);
  color: var(--on-surface);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
}

textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.contact-switch {
  margin-top: var(--stack-md);
}

.contact-switch a {
  white-space: nowrap;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Landing (guest marketing) */
.page-landing {
  overflow-x: clip;
}

.page-landing .site-main {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(320px, 52vw, 520px);
  display: flex;
  align-items: flex-end;
}

.landing-hero-fullbleed {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.landing-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 93, 76, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255, 138, 101, 0.12) 0%, transparent 50%),
    linear-gradient(145deg, #0a1628 0%, #1a1528 35%, #122131 70%, #051424 100%);
}

.landing-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 20, 36, 0.92) 0%, rgba(5, 20, 36, 0.45) 50%, rgba(5, 20, 36, 0.15) 100%);
  pointer-events: none;
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-md);
}

.landing-eyebrow {
  margin: 0;
  color: var(--brand-2);
}

.landing-hero .display-title {
  margin-bottom: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.landing-lead {
  max-width: 42ch;
}

.landing-hero-actions {
  justify-content: center;
  margin-top: var(--stack-sm);
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}

.landing-feature {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
}

.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--brand-dim);
  color: var(--brand);
  font-size: 1.125rem;
}

.landing-feature p {
  margin: 0;
  color: var(--on-surface-muted);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.landing-steps {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
}

.landing-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--stack-md);
}

.landing-step-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--stack-md);
  align-items: start;
}

.landing-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--brand-dim);
  color: var(--brand);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  font-weight: 600;
}

.landing-step-list p {
  margin: var(--stack-sm) 0 0;
  color: var(--on-surface-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.landing-steps-more {
  margin: 0;
  font-size: 0.9375rem;
}

.landing-steps-more a {
  white-space: nowrap;
}

.landing-cta {
  padding: clamp(1.5rem, 3vw, 2rem) var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-md);
}

.landing-cta .body-lg {
  max-width: 36ch;
}

.landing-cta .action-row {
  justify-content: center;
}

@media (max-width: 720px) {
  .landing-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .landing-hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .landing-hero-actions .btn {
    width: 100%;
  }
}

.alert { padding: var(--stack-md); border-radius: var(--radius-md); margin: 0 0 var(--stack-md); }
.form-card .alert { width: 100%; }
.alert-error { background: rgba(255, 180, 171, 0.12); color: var(--error); border: 1px solid rgba(255, 180, 171, 0.2); }
.alert-success { background: rgba(62, 207, 142, 0.12); color: var(--success); border: 1px solid rgba(62, 207, 142, 0.2); }
.alert-info {
  display: flex;
  align-items: flex-start;
  gap: var(--stack-sm);
  background: rgba(212, 228, 250, 0.08);
  color: var(--on-surface);
  border: 1px solid rgba(212, 228, 250, 0.15);
}
.hint { color: var(--on-surface-muted); font-size: 0.875rem; }

.field > .hint {
  margin: unset; 
  line-height: 1.2ch; 
}

/* Discover / Search hero */
.discover-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: var(--stack-lg);
  min-height: clamp(260px, 42vw, 420px);
  display: flex;
  align-items: flex-end;
}

body {
  overflow-x: clip;
}

.discover-hero-fullbleed {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

/* Homepage layout */
.page-home .site-main {
  padding-top: 0;
  gap: var(--stack-lg);
}

.page-home #home-feed {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4.5vw, 3.25rem);
}

.page-home .content-section {
  gap: var(--stack-md);
}

.page-home .section-head {
  margin-bottom: 0;
}

.page-home .media-slider {
  margin-top: var(--stack-sm);
}

.page-home #search-results-section {
  margin-top: var(--stack-sm);
}

.discover-hero-banner {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1528 0%, #2d1f3d 40%, #1e2838 100%) center / cover no-repeat;
  background-size: cover;
  background-position: center 20%;
  background-position: center center;
  transform: scale(1.03);
  transition: background-image 0.6s ease;
}

.discover-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(12, 10, 18, 0.95) 0%, rgba(12, 10, 18, 0.55) 45%, rgba(12, 10, 18, 0.25) 100%),
    linear-gradient(to right, rgba(12, 10, 18, 0.4) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.discover-hero--search-mode {
  min-height: auto;
  margin-bottom: var(--stack-md);
}

.discover-hero--search-mode .discover-hero-banner {
  opacity: 0;
  visibility: hidden;
}

.discover-hero--search-mode .discover-hero-scrim {
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 93, 76, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255, 138, 101, 0.1) 0%, transparent 50%),
    linear-gradient(145deg, #0a1628 0%, #1a1528 35%, #122131 70%, #051424 100%);
  opacity: 1;
}

.discover-hero--search-mode .discover-hero-content {
  padding-top: clamp(1.25rem, 3vw, 2rem);
  padding-bottom: var(--stack-md);
}

.discover-hero--search-mode .display-title {
  display: none;
}

.page-home.discover-hero--search-mode,
.page-home .discover-hero--search-mode + #search-results-section {
  margin-top: 0;
}

.discover-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gutter);
}

.discover-hero .display-title {
  text-align: center;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  max-width: 16ch;
}

.search-shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.hero-control-surface,
.hero-control-btn {
  background: rgba(5, 20, 36, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  color: #fff;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hero-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--stack-sm);
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-control-btn:hover,
.hero-control-btn:focus-visible {
  background: rgba(5, 20, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
}

.hero-control-btn.is-open,
.hero-control-btn[aria-pressed="true"] {
  background: rgba(5, 20, 36, 0.96);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.hero-control-btn-inline {
  width: 100%;
}

.hero-control-btn-icon {
  min-width: 48px;
  width: 48px;
  padding: 0;
  font-size: 1.05rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
}

.filter-hint {
  margin: 0;
  padding-top: var(--stack-sm);
  border-top: 1px solid var(--outline-soft);
}

.discover-hero .search-input-wrap.hero-control-surface {
  position: relative;
  border-radius: 999px;
  background: rgba(5, 20, 36, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  color: #fff;
}

.discover-hero .search-input-wrap.hero-control-surface:focus-within {
  background: rgba(5, 20, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.38);
  outline: none;
}

.search-input-wrap:not(.hero-control-surface) {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
  transition: box-shadow 0.2s;
}

.search-input-wrap:not(.hero-control-surface):focus-within {
  box-shadow: 0 0 0 1px var(--brand);
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.discover-hero .search-icon {
  color: rgba(255, 255, 255, 0.78);
}

.search-input-wrap input {
  background: transparent;
  border: 0;
  padding: 14px 18px 14px 48px;
  font-size: 1rem;
  min-height: 48px;
  width: 100%;
  color: inherit;
}

.search-input-wrap {
  --search-action-size: 36px;
  --search-action-gap: 2px;
  --search-action-icon: 0.9375rem;
}

.discover-hero .search-input-wrap input {
  color: #fff;
}

.search-input-wrap input[type="search"]::-webkit-search-decoration,
.search-input-wrap input[type="search"]::-webkit-search-cancel-button,
.search-input-wrap input[type="search"]::-webkit-search-results-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input-with-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.search-input-with-actions .search-icon {
  position: static;
  transform: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--search-action-size);
  margin-left: 6px;
  font-size: var(--search-action-icon);
  line-height: 1;
}

.search-input-with-actions input {
  flex: 1;
  min-width: 0;
  padding-left: 8px;
  padding-right: 4px;
}

.discover-hero .search-input-with-actions input {
  color: #fff;
  padding-right: 4px;
}

.search-input-actions {
  position: static;
  transform: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--search-action-gap);
  padding-right: 4px;
  z-index: 1;
}

.search-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--search-action-size);
  height: var(--search-action-size);
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--search-action-icon);
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.search-inline-btn i {
  font-size: 1em;
  line-height: 1;
  pointer-events: none;
}

.search-inline-btn:hover,
.search-inline-btn:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.search-filter-btn.is-open {
  background: rgba(232, 93, 76, 0.25);
  color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(232, 93, 76, 0.35);
}

.discover-hero .search-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.search-input-wrap input:focus { box-shadow: none; outline: none; }
.search-input-wrap input:focus { box-shadow: none; }

.filter-panel {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  background: #061221aa;
}
.filter-group { display: flex; flex-direction: column; gap: var(--stack-md); }
.filter-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
}
.chip-row-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: var(--stack-sm);
  scrollbar-width: thin;
}

.chip-toggle {
  cursor: pointer;
  user-select: none;
}
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle span,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--outline);
  color: var(--on-surface-muted);
  background: var(--surface-high);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chip-toggle input:checked + span {
  border-color: var(--brand);
  color: var(--brand-2);
  background: var(--brand-dim);
}
.chip-brand { border-color: var(--brand); color: var(--brand-2); background: var(--brand-dim); }
/* Content sections */
.content-section { display: flex; flex-direction: column; gap: var(--gutter); }
.section-head { display: flex; flex-direction: column; gap: var(--stack-sm); }
.section-sub { margin: 0; color: var(--on-surface-muted); font-size: 0.875rem; }
.hidden { display: none !important; }

/* Bento grid — Stitch layout */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tile-gap);
  grid-auto-rows: 200px;
}
.bento-grid-compact { grid-auto-rows: 180px; }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
}
@media (max-width: 520px) {
  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
}

.media-tile.bento-hero { grid-column: span 2; grid-row: span 2; }
.media-tile.bento-wide { grid-column: span 2; }

@media (max-width: 900px) {
  .media-tile.bento-hero { grid-column: span 2; grid-row: span 1; }
  .media-tile.bento-wide { grid-column: span 2; }
}
@media (max-width: 520px) {
  .media-tile.bento-hero,
  .media-tile.bento-wide { grid-column: span 1; }
}

.media-rail,
.action-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--tile-gap);
}

#main .groups-rail > span:has(a) {
  gap: 10px;
  grid-template-columns: 1fr;
  display: grid;
}

.media-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s;
}
.media-tile:hover { transform: translateY(-2px); }

.media-tile-bg {
  position: absolute;
  inset: 0;
  background: var(--surface-highest) center / cover no-repeat;
  transition: transform 0.5s ease;
}
.media-tile:hover .media-tile-bg { transform: scale(1.04); }

.media-tile-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 20, 36, 0.92) 0%, rgba(5, 20, 36, 0.35) 55%, rgba(5, 20, 36, 0) 100%);
}

.media-tile-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--stack-md);
  gap: var(--stack-sm);
}

.tile-title {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}
.media-tile .tile-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bento-hero .tile-title { font-size: 1.35rem; }

.chip-icon, .chip-score, .chip-year, .chip-duration, .chip-progress, .chip-watched, .chip-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--outline-soft);
  color: var(--on-surface);
}
.chip-score { color: var(--brand-2); }
.chip-year { text-transform: none; letter-spacing: 0; font-size: 0.6875rem; }
.chip-duration { text-transform: none; letter-spacing: 0; font-size: 0.625rem; }
.chip-progress, .chip-watched { color: var(--success); border-color: rgba(62, 207, 142, 0.25); }
.chip-stat { text-transform: none; letter-spacing: 0; font-size: 0.6875rem; }

.media-tile.is-watched {
  opacity: 0.78;
}

.media-tile.is-watched .media-tile-bg {
  filter: grayscale(0.55) brightness(0.72);
}

.media-tile.is-partial .media-tile-scrim {
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.15) 0%, rgba(8, 14, 22, 0.88) 100%);
}

.tile-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.12);
}

.tile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #5eead4);
  border-radius: 0 2px 2px 0;
  transition: width 0.2s ease;
}

.tile-chips { gap: 6px; }

/* Groups page */
.page-intro {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: var(--gutter);
  align-items: start;
}
.page-intro-accent {
  width: 4px;
  min-height: 100%;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  border-radius: 999px;
}
.page-intro-content { padding: var(--stack-sm) 0; }

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--tile-gap);
}

.group-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.group-card:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 93, 76, 0.35);
}

.group-card-media {
  aspect-ratio: 2 / 3;
  background: var(--surface-highest);
  overflow: hidden;
}
.group-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.group-card:hover .group-card-media img { transform: scale(1.03); }

.group-card-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-2);
}

.group-card-body { padding: var(--stack-md) var(--gutter) var(--gutter); }
.group-card-body h2 {
  margin: 0 0 var(--stack-sm);
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 1.25rem;
}

.empty-state {
  padding: var(--stack-lg);
  text-align: center;
  color: var(--on-surface-muted);
}

/* Group detail & media grid (legacy pages) */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
  align-items: center;
  color: var(--on-surface-muted);
  font-size: 0.875rem;
}
.breadcrumb-sep { opacity: 0.5; }

.group-header,
.card {
  padding: var(--gutter);
}
.group-header-main { display: flex; gap: var(--gutter); align-items: center; }
.group-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--stack-sm); }

.filter-chip {
  appearance: none;
  border: 1px solid var(--outline-soft);
  background: var(--surface-high);
  color: var(--on-surface-muted);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  color: var(--on-surface);
  border-color: var(--outline);
  outline: none;
}

.filter-chip.is-active {
  border-color: var(--brand);
  color: var(--brand-2);
  background: var(--brand-dim);
}

.group-search-bar {
  margin: 0 0 var(--stack-md);
}

.group-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  background: rgba(0, 0, 0, 0.22);
}

.group-search-field i {
  color: var(--on-surface-muted);
}

.group-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  outline: none;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--on-surface-muted);
  border: 1px solid var(--outline-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  text-decoration: none;
}
.filter-chip.is-active {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--brand-2);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--tile-gap);
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s;
}
.media-card:hover { transform: translateY(-2px); }

.media-card-poster {
  aspect-ratio: 2 / 3;
  background: var(--surface-highest);
  position: relative;
}
.media-card-poster img { width: 100%; height: 100%; object-fit: cover; }
.media-card-body { padding: var(--stack-md); }
.media-card-body h2 { margin: 0 0 var(--stack-sm); font-size: 0.95rem; }

.progress-bar {
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--success);
}

/* Detail page */
.detail-hero-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--gutter);
  padding: var(--gutter);
}
.detail-poster { border-radius: var(--radius-lg); width: 180px; }
@media (max-width: 640px) {
  .detail-hero-grid { grid-template-columns: 1fr; }
  .detail-poster { width: 140px; }

}

#main .action-rail > a {
  min-height: unset;
  height: auto;
}

#main .action-rail > a .hint {
  display: none;
}

.watch-item {
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-md);
  padding: var(--stack-md);
  margin-bottom: var(--stack-md);
  background: var(--surface-high);
}
.watch-item.is-complete { border-color: rgba(62, 207, 142, 0.4); }
.watch-item.is-partial { border-color: rgba(232, 93, 76, 0.4); }
.watch-progress {
  height: 6px; background: rgba(0, 0, 0, 0.3);
  border-radius: 999px; overflow: hidden; margin: var(--stack-md) 0;
}
.watch-progress .progress-bar { position: static; height: 100%; border-radius: 999px; }
.episode-head { display: flex; justify-content: space-between; gap: var(--stack-md); }
.episode-actions { display: flex; align-items: center; gap: var(--stack-md); }
.watch-slider { flex: 1; accent-color: var(--brand); }

.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--stack-md) 0;
  border-bottom: 1px solid var(--outline-soft);
}
.inline-form { display: inline; margin: 0; }
.danger-zone { border-color: rgba(255, 180, 171, 0.3); }
.checkbox-row { display: flex !important; align-items: center; gap: var(--stack-sm); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  background: var(--surface-high);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* --- v1.3: Forms, a11y, skeleton, discover, detail --- */
:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.btn:focus-visible, .nav-link:focus-visible, .media-tile:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
}

.form-card {
  padding: var(--gutter);
  max-width: 720px;
  margin: 0 auto;
}

.form-card-full {
  max-width: none;
  width: 100%;
  margin: 0;
}

.stack-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
  margin-bottom: var(--stack-md);
}

.field-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}

.optional { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.75; }

.select-modern, .input-code {
  width: 100%;
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
  color: var(--on-surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
}

.input-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}

.glass-card-inset {
  padding: var(--stack-md);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--outline-soft);
}

/* Media upload */
.media-upload { display: grid; gap: var(--stack-sm); }

.media-upload-surface {
  position: relative;
  border: 2px dashed var(--outline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface-high);
}

.media-upload-surface:hover,
.media-upload-surface:focus-visible,
.media-upload.is-dragover .media-upload-surface {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.media-upload-preview {
  min-height: 200px;
  background: var(--surface-highest) center / cover no-repeat;
  display: grid;
  place-items: center;
}

.media-upload[data-upload-variant="avatar"] .media-upload-preview { min-height: 140px; width: 140px; border-radius: 999px; margin: var(--stack-md) auto; }

.media-upload-empty {
  display: grid;
  gap: var(--stack-sm);
  place-items: center;
  text-align: center;
  padding: var(--gutter);
  color: var(--on-surface-muted);
  font-size: 0.875rem;
}

.media-upload.has-file .media-upload-empty { display: none; }

.media-upload-actions {
  display: flex;
  justify-content: center;
  gap: var(--stack-sm);
  padding: var(--stack-md);
  background: linear-gradient(0deg, rgba(5, 20, 36, 0.85), transparent);
  position: absolute;
  inset: auto 0 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-upload-surface:hover .media-upload-actions,
.media-upload-surface:focus-visible .media-upload-actions,
.media-upload.has-file .media-upload-actions { opacity: 1; }

.media-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: var(--stack-md);
  cursor: pointer;
  user-select: none;
}

.toggle-switch input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-track {
  width: 44px; height: 24px; flex-shrink: 0;
  background: var(--surface-highest);
  border: 1px solid var(--outline);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--on-surface-muted);
  transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--brand-dim);
  border-color: var(--brand);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: var(--brand-2);
}

.toggle-switch input:focus-visible + .toggle-track { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* Segment control (Alle / Filme / Serien) */
.segment-control {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
  border-radius: 999px;
  width: fit-content;
}

.segment-option { position: relative; }

.segment-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.segment-option span {
  display: block;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  transition: background 0.2s, color 0.2s;
}

.segment-option input:checked + span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #111;
  font-weight: 600;
}

.segment-option input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* Provider logo filters */
.provider-logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
}

.provider-logo-toggle { cursor: pointer; }

.provider-logo-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.provider-logo-inner {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--surface-high);
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.provider-logo-inner img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.provider-logo-toggle input:checked + .provider-logo-inner {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-dim);
}

.provider-logo-toggle input:focus-visible + .provider-logo-inner {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.chip-genre {
  cursor: pointer;
  border: 0;
  background: var(--surface-high);
  color: var(--on-surface-muted);
}

.chip-genre.is-active {
  border-color: var(--brand);
  color: var(--brand-2);
  background: var(--brand-dim);
}

.chip-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(232, 93, 76, 0.95), rgba(255, 138, 101, 0.9));
  color: #111;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(232, 93, 76, 0.35);
}

.chip-badge-new-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #111;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: badge-pulse 1.8s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.search-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
  width: 100%;
}

@media (min-width: 560px) {
  .search-toolbar {
    flex-direction: row;
    align-items: stretch;
  }

  .search-input-wrap {
    flex: 1;
    min-width: 0;
  }
}

.search-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
  justify-content: flex-end;
  flex-shrink: 0;
}

.section-head-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
}

/* Skeleton loading */
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-high) 25%, var(--surface-highest) 50%, var(--surface-high) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-tile { pointer-events: none; min-height: 200px; position: relative; overflow: hidden; }
.skeleton-tile .skeleton-media { position: absolute; inset: 0; }
.skeleton-tile .media-tile-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
}
.skeleton-chip-row { height: 20px; width: 60%; }
.skeleton-title { height: 18px; width: 80%; margin-top: var(--stack-sm); }
.skeleton-chip { display: inline-block; width: 72px; height: 28px; margin-right: 8px; }
.skeleton-block { min-height: 200px; border-radius: var(--radius-xl); }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .media-tile:hover { transform: none; }
}

/* Groups as media tiles */
.groups-rail { margin-top: var(--stack-md); }

.group-create-tile,
.group-join-tile {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-high);
  border: 2px dashed var(--outline);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.group-create-tile:hover,
.group-create-tile:focus-visible,
.group-join-tile:hover,
.group-join-tile:focus-visible {
  border-color: var(--brand);
  background: var(--brand-dim);
  transform: translateY(-2px);
}

.group-create-inner {
  text-align: center;
  padding: var(--gutter);
  display: grid;
  gap: var(--stack-sm);
}

.group-create-icon {
  width: 48px; height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-dim);
  color: var(--brand-2);
  font-size: 1.25rem;
}

.group-tile .media-tile-bg:not([style]) {
  background: linear-gradient(135deg, var(--surface-highest), var(--surface-high));
}

/* Detail hero */
.detail-hero, .episode-hero {
  position: relative;
}

.detail-hero {
  overflow: visible;
}

.episode-hero {
  overflow: hidden;
}

.detail-hero::before, .episode-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--detail-backdrop, none) center / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
}

.detail-hero:has(.choice-field.is-open) {
  z-index: 20;
}

.detail-hero-grid, .episode-hero-grid {
  position: relative;
  z-index: 1;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-sm);
  align-items: center;
  margin-bottom: var(--stack-md);
}

.icon-badge, .score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--outline-soft);
  font-size: 0.875rem;
}

.score-badge { color: var(--brand-2); }

.detail-title { margin-bottom: var(--stack-md); }
.detail-back-row { margin-bottom: var(--stack-md); }

.provider-row { margin-top: var(--stack-lg); display: grid; gap: var(--stack-sm); }
.provider-list { display: flex; flex-wrap: wrap; gap: var(--stack-sm); }

.provider-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
}

.provider-pill img { width: 36px; height: 36px; object-fit: contain; border-radius: var(--radius-sm); }

.watchlist-panel { margin-top: var(--stack-lg); padding: var(--stack-md); display: grid; gap: var(--stack-md); overflow: visible; }
.watchlist-actions { display: flex; flex-wrap: wrap; gap: var(--stack-md); align-items: stretch; position: relative; z-index: 2; }
.watchlist-actions .choice-field { flex: 1; min-width: 220px; z-index: 5; }

/* Custom choice field (dropdown) */
.choice-field {
  position: relative;
}

.choice-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  background: linear-gradient(180deg, rgba(28, 43, 60, 0.85) 0%, rgba(18, 33, 49, 0.92) 100%);
  backdrop-filter: blur(8px);
  color: var(--on-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.choice-trigger:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.choice-trigger:focus-visible,
.choice-field.is-open .choice-trigger {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.choice-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.choice-chevron {
  color: var(--on-surface-muted);
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.choice-field.is-open .choice-chevron {
  transform: rotate(180deg);
}

.choice-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: var(--stack-sm);
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-soft);
  background: rgba(28, 43, 60, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.choice-menu[hidden] {
  display: none;
}

.choice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-sm);
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--on-surface);
  transition: background 0.15s;
}

.choice-option:hover,
.choice-option.is-focused {
  background: rgba(255, 255, 255, 0.06);
}

.choice-option.is-selected {
  background: var(--brand-dim);
  box-shadow: inset 0 0 0 1px rgba(232, 93, 76, 0.35);
}

.choice-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-option-badge {
  flex-shrink: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
}

.legal-content {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-lg);
}

.legal-content section {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
}

.legal-content p,
.legal-content ul {
  margin: 0;
  color: var(--on-surface-muted);
  line-height: 1.6;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content li + li {
  margin-top: var(--stack-sm);
}

.guide-content {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-lg);
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gutter);
  align-items: start;
}

.guide-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 74, 0.12);
  color: var(--brand);
  font-size: 1.125rem;
  flex-shrink: 0;
}

.guide-step-body {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
}

.guide-step-body p,
.guide-step-body ul {
  margin: 0;
  color: var(--on-surface-muted);
  line-height: 1.6;
}

.guide-step-body ul {
  padding-left: 1.25rem;
}

.guide-step-body li + li {
  margin-top: var(--stack-sm);
}

.guide-cta {
  margin-top: var(--stack-lg);
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
  align-items: flex-start;
}

.guide-cta p {
  margin: 0;
  color: var(--on-surface-muted);
}

@media (max-width: 540px) {
  .guide-step {
    grid-template-columns: 1fr;
  }

  .guide-step-icon {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }
}

/* Episodes — Guide layout */
.episodes-section { padding: var(--gutter); display: grid; gap: var(--gutter); }

.episode-guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
}

.episode-guide-title {
  margin: 0;
}

.episode-guide-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stack-sm);
}

.season-choice {
  min-width: 180px;
  z-index: 8;
}

.season-choice .choice-trigger {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.season-choice .choice-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.season-choice .choice-option-meta {
  color: var(--on-surface-muted);
  font-size: 0.75rem;
}

.season-watch-toggle.is-complete {
  border-color: var(--brand);
  color: var(--brand-2);
}

.season-panel-host {
  min-height: 120px;
}

.season-loading {
  padding: 4px 0 8px;
}

.episode-guide-list {
  display: grid;
  gap: var(--stack-md);
}

.season-end-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  margin-top: var(--stack-sm);
  padding-top: var(--stack-md);
  border-top: 1px solid rgba(180, 210, 240, 0.1);
}

.season-end-nav-btn {
  flex: 0 1 auto;
  max-width: calc(50% - 8px);
}

.season-end-nav-btn-next {
  margin-left: auto;
}

.season-end-nav-spacer {
  flex: 1;
}

.episode-guide-card {
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.episode-guide-card.is-complete {
  border-color: rgba(178, 162, 240, 0.28);
  background: rgba(178, 162, 240, 0.05);
}

.episode-guide-card.is-partial {
  border-color: rgba(232, 93, 76, 0.22);
}

.episode-guide-layout {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: var(--stack-md);
  padding: var(--stack-md);
}

.episode-guide-media {
  display: block;
  color: inherit;
  text-decoration: none;
}

.episode-guide-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-highest);
}

.episode-guide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.episode-guide-media:hover .episode-guide-thumb img {
  transform: scale(1.03);
}

.episode-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--on-surface-muted);
  font-size: 1.5rem;
}

.episode-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.45);
}

.episode-progress-fill {
  height: 100%;
  background: #b2a2f0;
  border-radius: 0 999px 999px 0;
}

.episode-guide-body {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
  min-width: 0;
}

.episode-guide-header-link {
  color: inherit;
  text-decoration: none;
}

.episode-guide-header-link:hover .episode-guide-heading {
  color: var(--brand-2);
}

.episode-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--stack-md);
}

.episode-guide-heading {
  margin: 0;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.episode-guide-code {
  color: var(--on-surface-muted);
  font-weight: 600;
}

.episode-guide-duration {
  flex-shrink: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  padding-top: 2px;
}

.episode-guide-overview {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--on-surface-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-guide-controls {
  display: flex;
  align-items: center;
  gap: var(--stack-md);
  margin-top: auto;
  padding-top: var(--stack-sm);
  background: transparent;
  padding: unset;
  border: unset;
}

.episode-time-input {
  flex-shrink: 0;
  width: 6.75rem;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--outline);
  background: rgba(5, 20, 36, 0.65);
  color: var(--on-surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  text-align: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.episode-guide-controls.is-watched .episode-time-input {
  border-color: rgba(178, 162, 240, 0.55);
  background: rgba(178, 162, 240, 0.1);
  color: #c9bdf7;
}

.episode-guide-controls.is-partial .episode-time-input {
  border-color: rgba(232, 93, 76, 0.45);
  color: var(--brand-2);
}

.episode-guide-slider {
  flex: 1;
  min-width: 0;
  height: 6px;
  margin: 0;
  accent-color: #b2a2f0;
  cursor: pointer;
  padding: 1rem 0px;
}

.episode-guide-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.episode-guide-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border-radius: 50%;
  background: #b2a2f0;
  border: 2px solid #1a2740;
  box-shadow: 0 0 0 1px rgba(178, 162, 240, 0.35);
}

.episode-guide-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.episode-guide-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #b2a2f0;
  border: 2px solid #1a2740;
}

@media (max-width: 640px) {
  .episode-guide-layout {
    grid-template-columns: 1fr;
  }

  .episode-guide-thumb {
    max-height: 180px;
  }

  .episode-guide-controls {
    gap: var(--stack-sm);
  }

  .episode-time-input {
    width: 5.75rem;
    min-height: 40px;
    font-size: 0.75rem;
  }
}

/* Watch progress / time */
.watch-section {
  padding: var(--gutter);
  gap: var(--stack-md);
  display: flex;
  flex-direction: column;
  min-height: unset;
}

.watch-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--stack-md);
}

.watch-section-actions {
  display: flex;
  align-items: center;
  gap: var(--stack-sm);
  flex-shrink: 0;
}

.watch-mark-btn {
  position: relative;
  overflow: hidden;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: rgba(5, 20, 36, 0.55);
  color: var(--on-surface-muted);
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}

.watch-mark-btn:hover,
.watch-mark-btn:focus-visible {
  border-color: var(--brand);
  color: var(--brand-2);
  background: var(--brand-dim);
}

.watch-mark-btn.is-complete {
  background: rgba(62, 207, 142, 0.15);
  border-color: rgba(62, 207, 142, 0.45);
  color: var(--success);
}

.watch-mark-btn.is-complete:hover,
.watch-mark-btn.is-complete:focus-visible {
  background: rgba(62, 207, 142, 0.22);
  border-color: rgba(62, 207, 142, 0.55);
  color: var(--success);
}

.watch-mark-btn:disabled:not(.is-loading) {
  opacity: 0.55;
  cursor: wait;
}

.watch-mark-btn.is-loading,
.season-watch-toggle.is-loading {
  color: var(--brand);
  border-color: rgba(232, 93, 76, 0.28);
  background: rgba(232, 93, 76, 0.08);
}

.season-watch-toggle {
  position: relative;
  overflow: hidden;
}

.watch-status.is-saved {
  color: var(--success);
}

.watch-section-head .section-title {
  margin: 0;
}

.watch-item-expanded {
  padding: var(--stack-md);
  border-radius: var(--radius-md);
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
}

.watch-panel {
  display: block;
  width: 100%;
  height: fit-content;
  background: transparent;
  padding: unset;
  border: unset;
}

.watch-panel-stack {
  display: flex;
  gap: var(--stack-md);
  width: 100%;
}

.watch-panel-controls {
  display: flex;
  align-items: center;
  gap: var(--stack-md);
  width: 100%;
}

.watch-panel-controls .watch-panel-slider {
  flex: 1;
  min-width: 0;
}

.watch-panel-controls .watch-mark-btn {
  flex-shrink: 0;
}

.watch-panel.is-complete,
.watch-item.is-complete {
  border-color: rgba(178, 162, 240, 0.35);
}

.watch-panel.is-partial,
.watch-item.is-partial {
  border-color: rgba(232, 93, 76, 0.35);
}

.watch-panel-time-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--outline);
  background: rgba(5, 20, 36, 0.55);
  color: var(--on-surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.watch-panel.is-complete .watch-panel-time-input,
.watch-item.is-complete .watch-panel-time-input {
  border-color: rgba(178, 162, 240, 0.55);
  background: rgba(178, 162, 240, 0.08);
  color: #c9bdf7;
}

.watch-panel.is-partial .watch-panel-time-input,
.watch-item.is-partial .watch-panel-time-input {
  border-color: rgba(232, 93, 76, 0.45);
  color: var(--brand-2);
}

.watch-panel-slider {
  width: 100%;
  height: 6px;
  margin: 0;
  accent-color: #b2a2f0;
  cursor: pointer;
}

.watch-panel-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.watch-panel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border-radius: 50%;
  background: #b2a2f0;
  border: 2px solid #1a2740;
  box-shadow: 0 0 0 1px rgba(178, 162, 240, 0.35);
}

.watch-panel-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.watch-panel-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #b2a2f0;
  border: 2px solid #1a2740;
}

.watch-panel-meta {
  display: none;
  align-items: center;
  gap: var(--stack-sm);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
}

.watch-panel-meta .watch-time-current {
  color: var(--brand-2);
  font-weight: 600;
}

.watch-panel-meta-input {
  width: 5.5rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.8125rem;
  text-align: center;
}

.watch-panel-meta .watch-time-total-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--on-surface-muted);
}

.watch-item-head { display: flex; justify-content: space-between; align-items: center; gap: var(--stack-md); margin-bottom: var(--stack-md); }

.watch-time-controls {
  display: grid;
  gap: var(--stack-md);
  margin-top: var(--stack-md);
}

.watch-time-controls-compact {
  margin-top: 0;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.watch-time-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stack-sm);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
}

.watch-time-current { color: var(--brand-2); font-weight: 600; }

.watch-time-input {
  width: 5.5rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  text-align: center;
}

.watch-time-sep, .watch-time-total { color: var(--on-surface-muted); }

/* Episode detail */
.episode-hero-grid {
  display: grid;
  grid-template-columns: minmax(160px, 280px) 1fr;
  gap: var(--gutter);
  padding: var(--gutter);
}

.episode-hero-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.episode-hero-fallback { min-height: 160px; border-radius: var(--radius-lg); }

@media (max-width: 640px) {
  .episode-hero-grid { grid-template-columns: 1fr; }
  .detail-hero-grid { grid-template-columns: 1fr; }
}

/* Cast */
.cast-section { padding: var(--gutter); }
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--gutter);
  margin-top: var(--gutter);
}

.cast-card { display: grid; gap: var(--stack-sm); text-align: center; }
.cast-photo {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-highest);
}

.cast-photo img { width: 100%; height: 100%; object-fit: cover; }

.cast-photo-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--on-surface-muted);
  font-size: 2rem;
}

.cast-info { display: grid; gap: 2px; font-size: 0.875rem; }
.cast-info span { color: var(--on-surface-muted); font-size: 0.8rem; }

/* Settings */
.settings-form { max-width: none; }

.settings-account {
  display: flex;
  flex-direction: column;
  gap: var(--stack-md);
}

.settings-logout {
  align-self: flex-start;
  min-height: 44px;
}

.settings-logout i {
  margin-right: 6px;
}
.settings-profile-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gutter);
  align-items: start;
  margin-bottom: var(--stack-lg);
}

@media (max-width: 640px) {
  .settings-profile-row { grid-template-columns: 1fr; }
}

.provider-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--stack-lg);
}

.provider-search-wrap { margin: var(--stack-md) 0; }

.provider-search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-soft);
  background: var(--surface-high);
  color: var(--on-surface);
}

.provider-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--stack-sm);
}

.provider-toggle { cursor: pointer; }
.provider-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.provider-toggle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-sm);
  padding: var(--stack-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-soft);
  background: var(--surface-high);
  min-height: 100%;
  transition: border-color 0.2s, background 0.2s;
}

.provider-toggle-inner img { width: 40px; height: 40px; object-fit: contain; }
.provider-toggle-name { font-size: 0.75rem; text-align: center; color: var(--on-surface-muted); }

.provider-toggle-check {
  width: 20px; height: 20px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.provider-toggle input:checked + .provider-toggle-inner {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.provider-toggle input:checked + .provider-toggle-inner .provider-toggle-check {
  opacity: 1;
  background: var(--brand);
  color: #111;
  border-color: var(--brand);
}

.provider-toggle input:focus-visible + .provider-toggle-inner {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.provider-toggle-extra.hidden { display: none; }

.join-preview { margin-bottom: var(--stack-lg); }

/* v1.4 */
.genre-chip-row {
  flex-wrap: wrap;
  overflow: visible;
  max-height: none;
}

#recommendation-sections {
  display: flex;
  flex-direction: column;
  gap: var(--stack-lg);
}

.recommendation-section { position: relative; z-index: 0; }

.group-detail-intro { width: 100%; }
.group-detail-head {
  display: flex;
  gap: var(--gutter);
  align-items: center;
  margin-bottom: var(--stack-md);
}

.group-detail-avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
}

.group-detail-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--brand-dim);
  color: var(--brand-2);
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.group-detail-count { width: 100%; }

.group-items-sentinel {
  width: 100%;
  height: 1px;
  margin-top: var(--stack-md);
}

.group-items-sentinel.is-loading::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: var(--stack-lg) auto;
  border-radius: 50%;
  border: 2px solid var(--outline-soft);
  border-top-color: var(--brand-2);
  animation: group-sentinel-spin 0.8s linear infinite;
}

@keyframes group-sentinel-spin {
  to { transform: rotate(360deg); }
}

.invite-code-panel { margin-top: var(--stack-lg); margin-bottom: var(--stack-lg); }

.invite-code-copy {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-sm);
  padding: var(--gutter);
  border: 1px dashed var(--outline);
  border-radius: var(--radius-lg);
  background: var(--surface-high);
  color: var(--on-surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.invite-code-copy:hover,
.invite-code-copy:focus-visible {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.invite-code-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.75rem;
  letter-spacing: 0.2em;
}

.invite-code-hint {
  font-size: 0.75rem;
  color: var(--on-surface-muted);
}

.form-actions-spaced { margin-top: var(--stack-lg); padding-top: var(--stack-md); }

.member-roster {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
  margin-top: var(--gutter);
}

.member-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  padding: var(--stack-md);
  border-radius: var(--radius-md);
  background: var(--surface-high);
  border: 1px solid var(--outline-soft);
}

.member-roster-main {
  display: flex;
  align-items: center;
  gap: var(--stack-md);
  min-width: 0;
}

.member-roster-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.member-roster-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-highest);
  color: var(--brand-2);
  font-weight: 700;
}

.member-roster-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stack-sm);
}

.member-remove-btn {
  min-width: 44px;
  min-height: 44px;
}

.watch-toggle-large {
  min-width: 140px;
  min-height: 44px;
  gap: var(--stack-sm);
  width: 100%;
}

.watch-toggle-large.is-complete,
.episode-row.is-complete .watch-toggle-large {
  background: rgba(62, 207, 142, 0.15);
  border-color: rgba(62, 207, 142, 0.45);
  color: var(--success);
}

.provider-toggle-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--stack-sm);
}

.provider-toggle-inner {
  padding: var(--stack-sm) var(--stack-md);
  min-height: auto;
}

.wl-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: var(--surface-highest);
  color: var(--on-surface);
  border: 1px solid var(--outline-soft);
  border-radius: 999px;
  padding: 12px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  z-index: 200;
  transition: opacity 0.2s, transform 0.2s;
}

.wl-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wl-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
  background: var(--surface-highest);
  color: var(--on-surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-lg);
  padding: var(--stack-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 210;
  transition: opacity 0.2s, transform 0.2s;
}

.wl-notice.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.wl-notice-success {
  border-color: rgba(62, 207, 142, 0.35);
}

.wl-notice-error {
  border-color: rgba(255, 180, 171, 0.35);
}

.wl-notice-text {
  margin: 0 0 var(--stack-sm);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.wl-notice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stack-sm);
}

.wl-notice-close {
  margin-left: auto;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

/* v1.5 home feed */
.media-slider-section { overflow: hidden; }

.slider-controls {
  display: flex;
  gap: var(--stack-sm);
}

.slider-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--outline-soft);
  background: var(--surface-high);
  color: var(--on-surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s;
}

.slider-btn:hover:not(:disabled),
.slider-btn:focus-visible:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.slider-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider-btn:disabled:hover,
.slider-btn:disabled:focus-visible {
  border-color: var(--outline-soft);
  background: var(--surface-high);
}

.media-slider {
  overflow: hidden;
  margin-top: var(--stack-md);
}

.media-slider-track {
  display: flex;
  gap: var(--tile-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: var(--stack-sm) 0;
  cursor: grab;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.media-slider-track.is-dragging,
.media-slider-track.is-free-scroll {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
  scroll-behavior: auto;
}

.media-slider-track.is-dragging a {
  pointer-events: none;
}

.media-slider-track::-webkit-scrollbar { display: none; }

.media-slider-track .media-tile,
.media-slider-track .slider-tile {
  flex: 0 0 min(220px, 70vw);
  scroll-snap-align: start;
  min-height: 280px;
}

.continue-list {
  display: flex;
  flex-direction: column;
  gap: var(--stack-sm);
  margin-top: var(--gutter);
}

.continue-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--stack-md);
  align-items: center;
  padding: var(--stack-md);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}

.continue-item:hover {
  border-color: rgba(232, 93, 76, 0.35);
  transform: translateY(-1px);
}

.continue-thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: var(--surface-highest) center / cover no-repeat;
}

.continue-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.continue-body strong {
  font-family: "Hanken Grotesk", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-arrow {
  color: var(--on-surface-muted);
  padding: var(--stack-sm);
}

.continue-list-compact .continue-item {
  grid-template-columns: 72px 1fr auto;
}

.continue-list-compact .continue-thumb {
  width: 72px;
}

.continue-slider-tile {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  min-height: 200px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--stack-md);
  align-items: center;
  padding: var(--stack-md);
  color: inherit;
  text-decoration: none;
}

.continue-slider-tile .continue-thumb {
  width: 88px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
}

.continue-slider-tile .continue-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.continue-slider-tile .continue-body strong {
  font-family: "Hanken Grotesk", sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-subtitle {
  margin: 0;
  font-size: 0.75rem;
}



body.page-landing .landing-hero-bg {
  height: 100vh;
  top: 0;
  left: 0;
  right: 0;
}

body.page-landing .landing-hero {
  position: unset;
}

main#main:has(section#discover-hero.discover-hero--search-mode) {
  position: relative;
}

section#discover-hero.discover-hero--search-mode {
  position: unset;
}

.discover-hero--search-mode .discover-hero-scrim {
  opacity: 0.4;
  position: absolute;
  left: -50%;
  right: -50%;
  top: 0;
  bottom: 0;
}

/* --- Responsive: phone & tablet --- */
@media (max-width: 900px) {
  :root {
    --stack-lg: 36px;
    --gutter: 20px;
  }
}

@media (max-width: 640px) {
  :root {
    --stack-lg: 28px;
    --gutter: 16px;
    --margin-safe: 16px;
    overflow-x: hidden;
  }

  main#main {
    min-height: calc(100vh - 249px);
  }

  .site-main {
    padding-top: var(--stack-md);
    padding-bottom: var(--stack-lg);
    gap: var(--stack-lg);
  }

  .display-title {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
  }

  .section-title {
    font-size: 1.25rem;
  }

  .body-lg {
    font-size: 1rem;
  }

  /* Page intro & actions */
  .page-intro {
    gap: var(--stack-sm);
  }

  .page-intro-accent {
    width: 3px;
  }

  .action-row,
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-row .btn,
  .action-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .group-detail-intro .action-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .group-detail-intro .action-row .btn {
    width: auto;
    flex: 1 1 auto;
    min-width: min(100%, 140px);
  }

  .wl-notice.is-visible {
    display: flex;
  }
  .wl-notice.is-visible:has(a.btn) {
    flex-direction: column;
  }

  /* Group detail */
  .group-detail-head {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .group-detail-avatar,
  .group-detail-avatar-fallback {
    width: 72px;
    height: 72px;
  }

  .group-members-popover {
    position: fixed;
    left: var(--stack-md);
    right: var(--stack-md);
    top: 50%;
    min-width: 0;
    max-width: none;
    height: fit-content;
    transform: translateY(-50%);
    z-index: 60;
  }

  .group-invite-link-field {
    flex-direction: column;
    align-items: stretch;
  }

  .group-invite-link-field .btn {
    width: 100%;
  }

  /* Discover / home — modern compact search */
  .discover-hero {
    min-height: clamp(200px, 48vw, 320px);
  }

  .discover-hero-content {
    padding: clamp(1rem, 3vw, 1.5rem) var(--stack-md) var(--stack-md);
    gap: var(--stack-md);
  }

  .discover-hero .display-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    max-width: none;
  }

  .search-shell {
    gap: var(--stack-sm);
    max-width: none;
  }

  .search-toolbar {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .discover-hero .search-input-wrap.hero-control-surface {
    border-radius: var(--radius-xl);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(5, 20, 36, 0.82);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  }

  .search-input-wrap {
    --search-action-size: 34px;
    --search-action-gap: 2px;
    --search-action-icon: 0.875rem;
  }

  .discover-hero .search-input-with-actions input {
    min-height: 48px;
    font-size: 16px;
    padding-left: 6px;
    padding-right: 2px;
  }

  .search-input-with-actions .search-icon {
    margin-left: 4px;
  }

  .search-input-actions {
    padding-right: 3px;
  }

  .filter-panel {
    padding: var(--stack-md);
    border-radius: var(--radius-xl);
    margin-top: var(--stack-sm);
  }

  .discover-hero--search-mode {
    min-height: auto;
    margin-bottom: var(--stack-sm);
  }

  .discover-hero--search-mode .discover-hero-content {
    padding-top: var(--stack-md);
    padding-bottom: var(--stack-sm);
  }

  /* Smaller content cards — more tiles visible */
  .page-home .bento-grid,
  .page-home .bento-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 128px;
    gap: 10px;
  }

  .page-home .media-tile.bento-hero,
  .page-home .media-tile.bento-wide {
    grid-column: span 2;
    grid-row: span 1;
  }

  .page-home .media-tile-body {
    padding: 8px 10px;
    gap: 4px;
  }

  .page-home .tile-title {
    font-size: 0.8125rem;
    line-height: 1.25;
  }

  .page-home .tile-chips .chip-icon,
  .page-home .tile-chips .chip-score,
  .page-home .tile-chips .chip-year,
  .page-home .tile-chips .chip-progress,
  .page-home .tile-chips .chip-watched {
    padding: 2px 6px;
    font-size: 0.58rem;
  }

  .page-home #search-results.media-rail,
  .page-home .media-rail {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
  }

  .page-home .media-tile {
    border-radius: var(--radius-lg);
    min-height: 0;
  }

  .page-home .glass-card {
    min-height: 0;
  }

  .segment-control {
    display: flex;
    max-width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .segment-control::-webkit-scrollbar {
    display: none;
  }

  .filter-panel {
    padding: var(--stack-md);
  }

  .section-head-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--stack-sm);
  }

  #home-feed .section-head-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .section-head-row .slider-controls {
    align-self: flex-end;
  }

  /* Sliders — edge-to-edge swipe on home */
  .page-home .media-slider-section .media-slider {
    margin-left: calc(-1 * var(--margin-safe));
    margin-right: calc(-1 * var(--margin-safe));
  }

  .page-home .media-slider-track {
    scroll-padding-inline: var(--margin-safe);
    padding-inline: var(--margin-safe);
    -webkit-overflow-scrolling: touch;
  }

  .media-slider-track .media-tile,
  .media-slider-track .slider-tile {
    flex: 0 0 min(132px, 42vw);
    min-height: 188px;
  }

  .media-rail,
  .action-rail {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr));
    gap: 10px;
  }

  .groups-rail {
    grid-template-columns: 1fr;
  }

  .action-rail {
    grid-template-columns: 1fr 1fr;
  }

  .group-create-tile,
  .group-join-tile {
    min-height: 120px;
  }

  /* Detail page */
  .detail-hero-grid {
    text-align: left;
  }

  .detail-poster {
    width: min(160px, 45vw);
    margin: 0 auto;
    display: block;
  }

  .watchlist-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .watchlist-actions .choice-field {
    min-width: 0;
    width: 100%;
  }

  .watchlist-actions .btn-primary {
    width: 100%;
  }

  .watch-item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--stack-sm);
  }

  .watch-panel-controls .watch-mark-btn {
    display: none;
  }

  .episode-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .breadcrumb {
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--stack-sm);
  }

  /* Forms & settings */
  .form-card {
    padding: var(--stack-md);
  }

  .provider-toggle-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .invite-code-value {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
    word-break: break-all;
  }

  /* Auth / Register mobile */
  .page-register .site-main {
    padding-top: var(--stack-sm);
  }

  .page-register .auth-shell {
    margin: 0;
    gap: var(--stack-lg);
  }

  .page-register .auth-shell-intro {
    gap: var(--stack-sm);
    padding: 0 var(--stack-sm);
  }

  .page-register .auth-shell-intro .display-title {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    margin-bottom: var(--stack-sm);
  }

  .page-register .auth-shell-intro .body-lg {
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .page-register .auth-shell-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--stack-sm);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .page-register .auth-shell-points li {
    display: flex;
    align-items: center;
    gap: var(--stack-sm);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--outline-soft);
    font-size: 0.875rem;
  }

  .page-register .auth-card {
    order: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--stack-md);
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  }

  .page-register .register-steps {
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-high);
    border: 1px solid var(--outline-soft);
    gap: 0;
    margin-bottom: var(--stack-md);
  }

  .page-register .register-step {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
  }

  .page-register .register-step.is-active {
    background: var(--brand-dim);
  }

  .page-register .register-step-sep {
    display: none;
  }

  .page-register .register-step-num {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.7rem;
  }

  .page-register .auth-card-title {
    font-size: 1.25rem;
  }

  .page-register .auth-card-lead {
    font-size: 0.9375rem;
    margin-bottom: var(--stack-md);
  }

  .page-register .stack-form input {
    min-height: 48px;
    font-size: 16px;
  }

  .page-register .provider-toggle-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

  .page-register .provider-toggle-inner img {
    width: 32px;
    height: 32px;
  }

  .stack-form label.provider-toggle {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
  }

  .stack-form label.provider-toggle input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    margin: unset;
    appearance: unset;
    padding: unset;
    border: unset;
  }

  .stack-form label.provider-toggle span.provider-toggle-inner {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  input:not(:checked) + span.provider-toggle-inner > .provider-toggle-check {
    display: none;
  }

  .auth-shell {
    margin-top: var(--stack-md);
  }

  .page-register .auth-shell {
    margin: 0;
  }

  .page-login .auth-card,
  .page-join .form-card {
    padding: var(--stack-md);
  }

  .settings-logout {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .footer-links {
    flex-direction: column;
    gap: var(--stack-sm);
  }

  .wl-notice {
    left: var(--stack-md);
    right: var(--stack-md);
    width: auto;
    transform: translateY(16px);
  }

  .wl-notice.is-visible {
    transform: translateY(0);
  }

  .wl-notice-actions {
    width: 100%;
  }

  .wl-notice-actions .btn-primary {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .btn {
    min-height: 44px;
  }

  .slider-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .chip-row {
    flex-wrap: wrap;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .bento-grid {
    grid-auto-rows: 170px;
  }

  .media-rail,
  .action-rail {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .detail-hero-grid {
    grid-template-columns: 160px 1fr;
  }
}

/* Group randomizer */
body.randomizer-open {
  overflow: hidden;
}

.randomizer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--stack-md);
}

.randomizer-overlay.hidden {
  display: none;
}

.randomizer-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(178, 162, 240, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(232, 93, 76, 0.1), transparent 50%),
    rgba(5, 20, 36, 0.94);
  backdrop-filter: blur(16px);
}

.randomizer-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.randomizer-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: clamp(20px, 4vw, 28px);
  border-radius: calc(var(--radius-xl) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(165deg, rgba(22, 38, 56, 0.98) 0%, rgba(10, 24, 40, 0.99) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 64px rgba(0, 0, 0, 0.5);
}

.randomizer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--stack-md);
  margin-bottom: var(--stack-md);
}

.randomizer-header-text {
  min-width: 0;
}

.randomizer-close {
  flex-shrink: 0;
}

.randomizer-kicker {
  margin: 0 0 6px;
  color: var(--brand-2);
}

.randomizer-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

.randomizer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--stack-md);
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: fit-content;
  max-width: 100%;
}

.randomizer-filters .chip {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 0.875rem;
}

.randomizer-filters .chip.is-active {
  border-color: rgba(232, 93, 76, 0.35);
  color: var(--brand-2);
  background: var(--brand-dim);
  box-shadow: 0 2px 12px rgba(232, 93, 76, 0.15);
}

.randomizer-stage.hidden {
  display: none;
}

.randomizer-stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-md);
}

.randomizer-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.randomizer-viewport::before,
.randomizer-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 2;
  pointer-events: none;
}

.randomizer-viewport::before {
  left: 0;
  background: linear-gradient(90deg, rgba(10, 24, 40, 0.9), transparent);
}

.randomizer-viewport::after {
  right: 0;
  background: linear-gradient(270deg, rgba(10, 24, 40, 0.9), transparent);
}

.randomizer-track {
  display: flex;
  align-items: flex-start;
  will-change: transform;
}

.randomizer-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.randomizer-card-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  background: #122131 center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.randomizer-card-poster-empty {
  display: grid;
  place-items: center;
  color: var(--on-surface-muted);
  font-size: 1.5rem;
  background: linear-gradient(145deg, #1a2d42, #0f1f30);
}

.randomizer-card-title {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--on-surface-muted);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.randomizer-focus-ring {
  pointer-events: none;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  height: calc(100% - 24px);
  border-radius: calc(var(--radius-md) + 2px);
  border: 2px solid rgba(178, 162, 240, 0.55);
  box-shadow:
    0 0 0 4px rgba(178, 162, 240, 0.08),
    0 0 32px rgba(178, 162, 240, 0.2),
    inset 0 0 24px rgba(178, 162, 240, 0.06);
  z-index: 1;
}

.randomizer-spin-btn {
  min-width: 200px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(232, 93, 76, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.randomizer-spin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(232, 93, 76, 0.45);
}

.randomizer-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.randomizer-spin-btn.is-spinning i {
  animation: randomizer-shuffle-spin 0.6s linear infinite;
}

@keyframes randomizer-shuffle-spin {
  to { transform: rotate(360deg); }
}

.randomizer-hint {
  text-align: center;
  margin: 12px 0 0;
  font-size: 0.8125rem;
}

.randomizer-result {
  animation: randomizer-result-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.randomizer-result.hidden {
  display: none;
}

.randomizer-overlay.randomizer-has-result .randomizer-filters {
  display: none;
}

.randomizer-result-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
}

.randomizer-result-backdrop {
  position: absolute;
  inset: -20%;
  background: #122131 center / cover no-repeat;
  filter: blur(28px) saturate(1.2);
  transform: scale(1.1);
}

.randomizer-result-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 20, 36, 0.3) 0%, rgba(5, 20, 36, 0.85) 55%, rgba(5, 20, 36, 0.95) 100%);
}

.randomizer-result-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 5vw, 32px) var(--stack-md) var(--stack-md);
}

.randomizer-result-kicker {
  margin: 0 0 var(--stack-md);
  color: var(--brand-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.randomizer-result-poster-wrap {
  margin-bottom: var(--stack-md);
}

.randomizer-result-poster {
  width: 140px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  background: #122131 center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.randomizer-result-poster-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1a2d42, #0f1f30);
}

.randomizer-result-type {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-surface-muted);
}

.randomizer-result-type--movie {
  color: #ff8a65;
  background: rgba(232, 93, 76, 0.15);
}

.randomizer-result-type--tv {
  color: #b2a2f0;
  background: rgba(178, 162, 240, 0.12);
}

.randomizer-result-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--stack-md);
  letter-spacing: -0.02em;
  max-width: 28ch;
}

.randomizer-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.randomizer-result-actions .btn {
  min-width: 140px;
}

@keyframes randomizer-result-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .randomizer-shell {
    padding: 16px;
    border-radius: var(--radius-xl);
  }

  .randomizer-filters {
    width: 100%;
    justify-content: center;
  }

  .randomizer-spin-btn {
    width: 100%;
    min-width: 0;
  }

  .randomizer-result-actions {
    flex-direction: column;
  }

  .randomizer-result-actions .btn {
    width: 100%;
  }
}

/* Social media export (1080×1080) */
.social-page-intro {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.social-gallery {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.social-gallery-item {
  display: grid;
  gap: var(--stack-md);
}

.social-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-md);
  flex-wrap: wrap;
}

.social-gallery-meta .section-title {
  margin: 0;
}

.social-card-preview {
  width: min(100%, 540px);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-soft);
  box-shadow: var(--shadow-glow);
}

.social-card-preview .social-card {
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(0.5);
  transform-origin: top left;
}

.social-card {
  position: relative;
  width: 1080px;
  height: 1080px;
  overflow: hidden;
  color: var(--on-surface);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
}

.social-card__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 93, 76, 0.24) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255, 138, 101, 0.14) 0%, transparent 50%),
    linear-gradient(145deg, #0a1628 0%, #1a1528 35%, #122131 70%, #051424 100%);
}

.social-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 20, 36, 0.94) 0%, rgba(5, 20, 36, 0.35) 55%, rgba(5, 20, 36, 0.12) 100%);
}

.social-card__glow {
  position: absolute;
  width: 420px;
  height: 420px;
  top: -80px;
  right: -80px;
  border-radius: 50%;
  background: rgba(232, 93, 76, 0.18);
  filter: blur(40px);
}

.social-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 72px;
  gap: 40px;
}

.social-card__brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.social-card__logo {
  font-family: "Hanken Grotesk", Inter, system-ui, sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.social-card__eyebrow {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.social-card__icon {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: rgba(232, 93, 76, 0.14);
  border: 1px solid rgba(232, 93, 76, 0.35);
  color: var(--brand);
  font-size: 52px;
}

.social-card__copy {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.social-card__title {
  margin: 0;
  font-family: "Hanken Grotesk", Inter, system-ui, sans-serif;
  font-size: 72px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

.social-card__text {
  margin: 0;
  max-width: 28ch;
  font-size: 34px;
  line-height: 1.45;
  color: var(--on-surface-muted);
}

.social-card__footer {
  margin-top: auto;
  padding-top: 24px;
  font-size: 28px;
  font-weight: 500;
  color: rgba(212, 228, 250, 0.72);
  letter-spacing: 0.02em;
}

.social-card__mock {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 33, 49, 0.82);
  backdrop-filter: blur(12px);
}

.social-card__mock-search {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  font-size: 28px;
  color: var(--on-surface-muted);
}

.social-card__mock-search i {
  color: var(--brand-2);
}

.social-card__mock-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 120px);
  gap: 16px;
  padding: 24px;
}

.social-card__tile {
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(39, 54, 71, 0.95), rgba(28, 43, 60, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__tile--hero {
  grid-column: span 2;
  grid-row: span 2;
}

.social-card__tile--wide {
  grid-column: span 2;
}

.social-card__icon--hero {
  width: 140px;
  height: 140px;
  font-size: 60px;
}

.social-card__mock-label {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}

.social-card__mock-intro {
  padding: 28px;
  display: grid;
  gap: 18px;
}

.social-card__intro-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__intro-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(232, 93, 76, 0.14);
  color: var(--brand-2);
  font-size: 24px;
}

.social-card__intro-item strong {
  display: block;
  font-size: 28px;
  color: #fff;
  margin-bottom: 6px;
}

.social-card__intro-item span {
  display: block;
  font-size: 24px;
  line-height: 1.4;
  color: var(--on-surface-muted);
}

.social-card__intro-item span.social-card__intro-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--brand-2);
}

.social-card--start span.social-card__logo {
  font-size: 5rem;
  margin: unset;
  line-height: 1.3ch;
  text-indent: 2.7ch;
}

.social-card--cta .social-card__text,
.social-card--providers .social-card__text,
.social-card--randomizer .social-card__text,
.social-card--intro .social-card__text,
.social-card--start .social-card__text {
  max-width: unset !important;
}


.social-card__mock-groups {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.social-card__group-card {
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__group-card--active {
  border-color: rgba(232, 93, 76, 0.35);
  box-shadow: 0 0 0 1px rgba(232, 93, 76, 0.08) inset;
}

.social-card__group-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.social-card__group-avatars {
  display: flex;
}

.social-card__group-avatars span {
  width: 44px;
  height: 44px;
  margin-left: -10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border: 2px solid #122131;
  background: linear-gradient(145deg, #273647, #1c2b3c);
}

.social-card__group-avatars span:first-child {
  margin-left: 0;
}

.social-card__group-more {
  background: rgba(232, 93, 76, 0.22) !important;
  color: var(--brand-2) !important;
  font-size: 14px !important;
}

.social-card__group-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-2);
  background: rgba(232, 93, 76, 0.14);
}

.social-card__group-name {
  display: block;
  font-size: 30px;
  color: #fff;
  margin-bottom: 8px;
}

.social-card__group-meta {
  margin: 0 0 16px;
  font-size: 22px;
  color: var(--on-surface-muted);
}

.social-card__group-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.social-card__group-items span {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(39, 54, 71, 0.95), rgba(28, 43, 60, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 0 36px;
  border-radius: 999px;
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.social-card__mock-progress-list {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.social-card__cw-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__cw-poster {
  border-radius: 14px;
  background: linear-gradient(160deg, #8b2942, #2a1a3d);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 120px;
}

.social-card__cw-poster--alt {
  background: linear-gradient(160deg, #c47a2c, #1a2838);
}

.social-card__cw-body {
  display: grid;
  gap: 10px;
  align-content: center;
}

.social-card__cw-body strong {
  font-size: 26px;
  color: #fff;
}

.social-card__cw-body > span {
  font-size: 20px;
  color: var(--on-surface-muted);
}

.social-card__progress-foot {
  font-size: 20px;
  color: var(--on-surface-muted);
}

.social-card--randomizer .social-card__glow {
  background: rgba(178, 162, 240, 0.22);
}

.social-card__mock-randomizer {
  padding: 28px;
  display: grid;
  gap: 20px;
  background: linear-gradient(165deg, rgba(22, 38, 56, 0.92) 0%, rgba(10, 24, 40, 0.96) 100%);
}

.social-card__randomizer-kicker {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--brand-2);
}

.social-card__randomizer-viewport {
  position: relative;
  overflow: hidden;
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.social-card__randomizer-track {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-card__rand-card {
  width: 140px;
  flex-shrink: 0;
  display: grid;
  gap: 10px;
  opacity: 0.55;
  transform: scale(0.92);
}

.social-card__rand-card span {
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  background: linear-gradient(145deg, #273647, #162636);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-card__rand-card em {
  font-style: normal;
  font-size: 18px;
  text-align: center;
  color: var(--on-surface-muted);
}

.social-card__rand-card--winner {
  opacity: 1;
  transform: scale(1);
}

.social-card__rand-card--winner span {
  border-color: rgba(178, 162, 240, 0.55);
  box-shadow: 0 0 32px rgba(178, 162, 240, 0.18);
  border-width: 3px;
}

.social-card__rand-card--winner em {
  color: #fff;
  font-weight: 600;
}

.social-card__randomizer-ring {
  pointer-events: none;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 156px;
  height: calc(100% - 36px);
  border-radius: 18px;
  border: 3px solid rgba(178, 162, 240, 0.55);
  box-shadow: 0 0 0 4px rgba(178, 162, 240, 0.08), 0 0 32px rgba(178, 162, 240, 0.2);
}

.social-card__randomizer-result {
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(232, 93, 76, 0.12);
  border: 1px solid rgba(232, 93, 76, 0.28);
  display: grid;
  gap: 6px;
}

.social-card__randomizer-result-label {
  font-size: 20px;
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-card__randomizer-result strong {
  font-size: 32px;
  color: #fff;
}

.social-card__randomizer-btn {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 32px;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.social-card__mock-providers {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.social-card__provider-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-card__provider-chips span {
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 24px;
  font-weight: 500;
  color: var(--on-surface-muted);
}

.social-card__provider-chips span.is-active {
  color: var(--brand-2);
  background: rgba(232, 93, 76, 0.14);
  border-color: rgba(232, 93, 76, 0.35);
}

.social-card__provider-feed {
  padding: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__provider-feed-label {
  display: block;
  margin-bottom: 16px;
  font-size: 22px;
  color: var(--on-surface-muted);
}

.social-card__provider-feed-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.social-card__provider-feed-row span {
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(39, 54, 71, 0.95), rgba(28, 43, 60, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-card__mock-cta {
  padding: 32px;
  display: grid;
  gap: 24px;
  justify-items: start;
}

.social-card__cta-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  width: 100%;
}

.social-card__cta-steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 28px;
  color: var(--on-surface);
}

.social-card__cta-steps li span {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-2);
  background: rgba(232, 93, 76, 0.16);
  border: 1px solid rgba(232, 93, 76, 0.28);
}

.social-card__cta-url {
  font-size: 26px;
  color: rgba(212, 228, 250, 0.72);
  letter-spacing: 0.02em;
}

.social-card__progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.social-card__progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.social-card--intro .social-card__text,
.social-card--groups .social-card__text,
.social-card--progress .social-card__text,
.social-card--randomizer .social-card__text,
.social-card--providers .social-card__text,
.social-card--cta .social-card__text {
  max-width: 32ch;
}

.social-card--intro .social-card__title,
.social-card--groups .social-card__title,
.social-card--progress .social-card__title,
.social-card--randomizer .social-card__title,
.social-card--providers .social-card__title {
  font-size: 64px;
}

.social-card--hero .social-card__copy {
  margin-top: 0;
}

.social-card--hero .social-card__text {
  max-width: 34ch;
}

.social-card--cta .social-card__title {
  font-size: 60px;
}

body.page-social-export {
  overflow: hidden;
}

body.page-social-export .site-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
}

body.page-social-export .social-card {
  flex-shrink: 0;
}

@media (max-width: 1120px) {
  body.page-social-export .social-card {
    transform: scale(calc(100vw / 1080));
    transform-origin: center center;
  }
}

/* PWA install prompt sheet */
.pwa-install-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--stack-md);
  padding-bottom: calc(var(--stack-md) + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pwa-install-sheet.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pwa-install-sheet.is-hiding {
  opacity: 0;
}

.pwa-install-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 20, 36, 0.72);
  backdrop-filter: blur(6px);
}

.pwa-install-sheet__card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(22, 38, 56, 0.98), rgba(10, 24, 40, 0.99));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  transform: translateY(16px);
  transition: transform 0.22s ease;
}

.pwa-install-sheet.is-visible .pwa-install-sheet__card {
  transform: translateY(0);
}

.pwa-install-sheet__eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.pwa-install-sheet__title {
  margin: 0 0 10px;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
  color: #fff;
}

.pwa-install-sheet__text {
  margin: 0 0 16px;
  color: var(--on-surface-muted);
  line-height: 1.5;
}

.pwa-install-sheet__steps {
  margin: 0 0 18px;
  padding-left: 1.2rem;
  color: var(--on-surface);
  line-height: 1.55;
}

.pwa-install-sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pwa-install-sheet__actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

@media (min-width: 761px) {
  .pwa-install-sheet {
    align-items: center;
  }
}

/* First-party analytics consent + admin */
.analytics-consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.analytics-consent.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.analytics-consent__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 22, 38, 0.94);
  border: 1px solid rgba(180, 210, 240, 0.16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.analytics-consent__title {
  margin: 0 0 4px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--on-surface);
}

.analytics-consent__text {
  margin: 0;
  max-width: 42rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--on-surface-muted);
}

.analytics-consent__text a {
  color: var(--primary);
}

.analytics-consent__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .analytics-consent {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .analytics-consent__actions {
    width: 100%;
  }

  .analytics-consent__actions .btn {
    flex: 1;
    justify-content: center;
  }
}

.analytics-dash {
  display: grid;
  gap: 20px;
  padding-bottom: 40px;
}

.analytics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.analytics-stat {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 210, 240, 0.1);
}

.analytics-stat__value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--on-surface);
}

.analytics-stat__label {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--on-surface-muted);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.analytics-table-scroll {
  max-height: min(360px, 50vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: var(--radius-md);
  border: 1px solid rgba(180, 210, 240, 0.08);
}

.analytics-table-scroll .analytics-table thead th {
  position: sticky;
  top: 0;
  background: rgba(12, 28, 44, 0.96);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(180, 210, 240, 0.1);
}

.analytics-table th {
  color: var(--on-surface-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-table td.num,
.analytics-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.analytics-panel {
  padding: 18px 20px;
}

.analytics-panel h2 {
  margin: 0 0 14px;
}

.analytics-empty {
  margin: 0;
  color: var(--on-surface-muted);
  font-size: 0.9rem;
}

/* Weekly trending + detail recommendations */
.trending-page {
  display: grid;
  gap: 20px;
  padding-bottom: 40px;
}

.trending-week-label {
  display: block;
  margin-top: 8px;
}

.trending-ranked-section {
  padding: 18px 20px;
}

.trending-ranked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.trending-ranked-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trending-ranked-num {
  flex: 0 0 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: var(--primary);
  text-align: center;
}

.trending-ranked-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(180, 210, 240, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.trending-ranked-link:hover {
  border-color: rgba(180, 210, 240, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.trending-ranked-poster {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.trending-ranked-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.trending-ranked-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--on-surface-muted);
}

.detail-recommendations {
  display: grid;
  gap: 16px;
  margin-top: 8px;
  padding-bottom: 24px;
}

.push-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.push-status-panel {
  margin: 0 0 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 210, 240, 0.12);
}

.push-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.push-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  background: rgba(180, 210, 240, 0.12);
  color: var(--on-surface-muted);
}

.push-status-badge[data-state="ok"] {
  background: rgba(62, 207, 142, 0.16);
  color: var(--success);
}

.push-status-badge[data-state="warn"] {
  background: rgba(255, 196, 86, 0.16);
  color: #ffc456;
}

.push-status-badge[data-state="bad"] {
  background: rgba(255, 180, 171, 0.14);
  color: var(--error);
}

.push-status-badge[data-state="loading"],
.push-status-badge[data-state="neutral"] {
  background: rgba(180, 210, 240, 0.12);
  color: var(--on-surface-muted);
}

.push-status-summary {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  color: var(--on-surface);
  line-height: 1.45;
}

.push-status-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.push-status-details li {
  display: grid;
  grid-template-columns: 10px 7.5rem 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.88rem;
}

.push-status-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: rgba(180, 210, 240, 0.35);
}

.push-status-details li[data-state="ok"] .push-status-dot { background: var(--success); }
.push-status-details li[data-state="warn"] .push-status-dot { background: #ffc456; }
.push-status-details li[data-state="bad"] .push-status-dot { background: var(--error); }

.push-status-label {
  color: var(--on-surface-muted);
}

.push-status-value {
  color: var(--on-surface);
}

.push-status-error {
  margin: 12px 0 0;
}

.push-settings-toggles {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--on-surface);
}

.checkbox-row input {
  margin-top: 3px;
}

.settings-account .settings-analytics {
  margin-bottom: 10px;
}

#push-settings-form.is-disabled .push-settings-actions,
#push-settings-form.is-disabled .push-settings-toggles {
  opacity: 0.5;
  pointer-events: none;
}

.push-prefs-sheet__toggles {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.push-prefs-sheet__hint {
  margin-top: -4px !important;
  font-size: 0.85rem;
  color: var(--on-surface-muted);
}

.consent-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 14px;
  font-size: 0.875rem;
  color: var(--on-surface-muted);
  line-height: 1.45;
}

.consent-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.consent-check a { color: var(--brand-2); }

.alert-info,
.verify-banner {
  border: 1px solid rgba(90, 160, 255, 0.35);
  background: rgba(90, 160, 255, 0.12);
  color: var(--on-surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--stack-md);
}

.verify-banner p { margin: 8px 0; }

.tile-group-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-group-progress {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-surface-muted);
  font-size: 0.6875rem;
  line-height: 1.3;
}

/* Continue-watching group picker */
body.continue-picker-open {
  overflow: hidden;
}

.continue-group-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--stack-md);
  animation: continue-picker-fade-in 0.2s ease;
}

.continue-group-overlay.is-closing {
  animation: continue-picker-fade-out 0.2s ease forwards;
}

@keyframes continue-picker-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes continue-picker-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.continue-group-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(5, 20, 36, 0.72);
  backdrop-filter: blur(8px);
}

.continue-group-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(88vh, 640px);
  overflow: auto;
  border-radius: calc(var(--radius-xl) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 24, 40, 0.98);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45);
  animation: continue-picker-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes continue-picker-rise {
  from { transform: translateY(18px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}

.continue-group-hero {
  position: relative;
  padding: 28px 20px 22px;
  background:
    linear-gradient(180deg, rgba(10, 24, 40, 0.35) 0%, rgba(10, 24, 40, 0.92) 72%, rgba(10, 24, 40, 1) 100%),
    var(--continue-hero, none) center / cover no-repeat,
    linear-gradient(145deg, rgba(22, 48, 68, 0.95), rgba(8, 20, 34, 0.98));
}

.continue-group-hero.has-backdrop {
  min-height: 160px;
}

.continue-group-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.continue-group-kicker {
  margin: 0 0 6px;
  color: var(--brand-2);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.continue-group-title {
  margin: 0 0 8px;
  padding-right: 2.5rem;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  line-height: 1.2;
}

.continue-group-lead {
  margin: 0;
  color: var(--on-surface-muted);
  line-height: 1.45;
}

.continue-group-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.continue-group-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.continue-group-option:hover,
.continue-group-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 93, 76, 0.35);
  outline: none;
}

.continue-group-option:active {
  transform: scale(0.99);
}

.continue-group-option-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.continue-group-option-name {
  font-size: 1rem;
  line-height: 1.25;
}

.continue-group-option-progress {
  color: var(--on-surface-muted);
  font-size: 0.8125rem;
}

.continue-group-option-chevron {
  color: var(--on-surface-muted);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .continue-group-overlay {
    align-items: center;
  }
}

.auth-shell-narrow {
  max-width: 560px;
  margin: 0 auto;
}

.verify-title { margin-bottom: 12px; }
.verify-legal { margin-top: 20px; }

