/* ============================================================
   RatingTube — Sistema de Design
   Paleta própria em vermelho-alaranjado + dourado apenas para notas. A
   variável histórica --red foi preservada para evitar uma migração ampla.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Cor — modo claro (padrão) */
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --surface: #f3f3f4;
  --surface-hi: #e9e9eb;
  --line: #dcdce0;
  --text: #1a1a1e;
  --muted: #6b6b72;
  --placeholder: #9a9aa2;
  --brand: #db2504;
  --red: #db2504;
  --red-dim: #b81d03;
  --gold: #b8860b;
  --gold-dim: #96700a;
  --danger-bg: rgba(214, 54, 47, 0.08);
  --danger-border: rgba(214, 54, 47, 0.35);
  --danger-text: #b52c26;

  /* Tipografia */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Escala */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.25rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #1c1c1f;
    --bg-soft: #202024;
    --surface: #26262a;
    --surface-hi: #303035;
    --line: #3a3a40;
    --text: #f2f2f3;
    --muted: #9a9aa2;
    --placeholder: #5a5a62;
    --brand: #db2504;
    --red: #ff5a3d;
    --red-dim: #ef3d1e;
    --gold: #e8b84b;
    --gold-dim: #a98333;
    --danger-bg: rgba(226, 72, 63, 0.14);
    --danger-border: rgba(226, 72, 63, 0.4);
    --danger-text: #f0a19b;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1c1c1f;
  --bg-soft: #202024;
  --surface: #26262a;
  --surface-hi: #303035;
  --line: #3a3a40;
  --text: #f2f2f3;
  --muted: #9a9aa2;
  --placeholder: #5a5a62;
  --brand: #db2504;
  --red: #ff5a3d;
  --red-dim: #ef3d1e;
  --gold: #e8b84b;
  --gold-dim: #a98333;
  --danger-bg: rgba(226, 72, 63, 0.14);
  --danger-border: rgba(226, 72, 63, 0.4);
  --danger-text: #f0a19b;
}

:root[data-theme='light'] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--red);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout de autenticação (split screen) ---------- */

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  background: var(--bg-soft);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-top: 3px solid var(--red);
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(219, 37, 4, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(219, 37, 4, 0.06), transparent);
  pointer-events: none;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand);
  position: relative;
  z-index: 1;
}
.wordmark strong {
  color: inherit;
  font-weight: 600;
}

.auth-tagline {
  position: relative;
  z-index: 1;
  max-width: 30ch;
}

.auth-tagline h1 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.12;
  margin-bottom: var(--space-2);
}

.auth-tagline p {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 34ch;
}

.star-field {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  max-width: 22rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card h2 {
  font-size: 1.7rem;
  margin-bottom: var(--space-1);
}

.auth-card .subtitle {
  color: var(--muted);
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
}

/* ---------- Formulário ---------- */

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.field .char-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.25rem;
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='search'],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

select {
  min-height: 44px;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--red-dim);
  background: var(--surface-hi);
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.prefix-input {
  display: flex;
  align-items: stretch;
}
.prefix-input .prefix {
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
}
.prefix-input input {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 3.4rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  place-items: center;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--surface-hi);
  color: var(--text);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle-slash {
  display: none;
}

.password-toggle[aria-pressed='true'] .password-toggle-slash {
  display: block;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  background: var(--red);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-primary:active {
  transform: scale(0.99);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.btn-ghost {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.95rem;
}
.btn-ghost:hover {
  border-color: var(--muted);
}

.switch-line {
  text-align: center;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 0.9rem;
}

.error-banner {
  display: none;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: var(--space-3);
}
.error-banner.visible {
  display: block;
}

/* ---------- Estrela (elemento de assinatura — sempre dourada,
   é o único elemento que carrega o significado de "nota") ---------- */

.star {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  opacity: 0.9;
}

.star .star-outline {
  stroke: var(--line);
}

.star-field .star {
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.35;
}
.star-field .star.lit {
  opacity: 0.85;
}

/* ---------- Página de perfil / navegação ---------- */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 3px solid var(--red);
}

.top-bar .wordmark {
  font-size: 1.75rem;
}

.wordmark-link {
  text-decoration: none;
}
.wordmark-link:hover {
  text-decoration: none;
}

.top-bar .nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.top-utility-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.top-icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  place-items: center;
}

.top-icon-button:hover {
  border-color: var(--muted);
  background: var(--surface-hi);
  text-decoration: none;
}

.top-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.message-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 700 0.65rem/15px var(--font-body);
  text-align: center;
}

.app-modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
  place-items: center;
}

.app-modal {
  position: relative;
  width: min(100%, 520px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 1.5rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.app-modal h2 {
  padding-right: 2.5rem;
  margin-bottom: 0.75rem;
}

.app-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
}

.app-modal-actions {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.app-modal-actions > * {
  flex: 1;
}

.settings-section {
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}

.settings-section h3 {
  margin-bottom: 1rem;
  font: 600 0.82rem/1.3 var(--font-body);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-field > span,
.settings-password-form .field > span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.settings-password-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.first-rating-modal > p:not(.home-eyebrow) {
  color: var(--muted);
}

.friend-invite-modal {
  max-width: 420px;
  text-align: center;
}

.friend-invite-modal h2 {
  padding-inline: 2.5rem;
}

.friend-invite-modal > p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.settings-app-description {
  margin: 0 0 0.85rem;
}

.settings-section #settingsInstallApp {
  width: auto;
}

.settings-install-hint {
  min-height: 1.35em;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pwa-install-prompt {
  position: fixed;
  z-index: 850;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  width: min(420px, calc(100% - 2rem));
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.pwa-install-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.55rem;
  line-height: 1;
}

.pwa-install-copy {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 2rem;
}

.pwa-install-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font: 700 1.35rem/1 var(--font-display);
  place-items: center;
}

.pwa-install-copy h2 {
  margin: 0 0 0.2rem;
  font: 600 1.1rem/1.25 var(--font-display);
}

.pwa-install-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  gap: 0.6rem;
}

.pwa-install-actions button {
  flex: 1;
}

.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-logout {
  width: auto;
  padding: 0.5rem 1rem;
  min-height: 40px;
}

.nav-main-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
}

.nav-main-link:hover {
  border-color: var(--line);
  background: var(--surface);
}

.nav-main-link[aria-current='page'] {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.nav-main-icon {
  display: none;
}

.nav-main-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* ---------- Página inicial pública ---------- */

.home-page {
  background:
    radial-gradient(circle at 14% 5%, rgba(214, 54, 47, 0.08), transparent 28rem),
    var(--bg);
}

.home-page > .top-bar .wordmark {
  font-size: 1.85rem;
}

.home-page .home-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.96rem;
}

.home-page .home-nav-button:hover {
  border-color: var(--muted);
}

.home-page .home-nav-primary {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.home-page .home-nav-primary:hover {
  border-color: var(--red-dim);
  background: var(--red-dim);
  color: #ffffff;
}

.home-main {
  overflow: hidden;
}

.home-hero,
.home-section,
.home-value-section,
.home-final-cta,
.home-footer {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.home-hero {
  padding: 4.5rem 0 5rem;
}

.home-hero-copy {
  max-width: 790px;
}

.home-eyebrow {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.home-hero h1 {
  font-size: clamp(2.55rem, 5vw, 4rem);
  line-height: 1.07;
  max-width: 16ch;
}

.home-lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  line-height: 1.65;
  margin: 1.25rem 0 1.5rem;
  max-width: 60ch;
}

.home-testing-note {
  display: grid;
  gap: 0.25rem;
  max-width: 680px;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
}

.home-testing-note strong {
  font-size: 0.88rem;
}

.home-testing-note span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  max-width: 650px;
}

.home-search input {
  min-width: 0;
  min-height: 50px;
  background: var(--bg);
  box-shadow: 0 12px 30px rgba(20, 20, 24, 0.07);
}

.home-search button {
  width: auto;
  min-width: 118px;
  padding-inline: 1.2rem;
}

.home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 46px;
  padding: 0.72rem 1.15rem;
}

.btn-link:hover {
  text-decoration: none;
}

.home-account-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.8rem 0 0;
}

/* ---------- Home da pessoa autenticada ---------- */

.member-home-page {
  background: var(--bg-soft);
}

.member-home {
  width: min(960px, calc(100% - 2.5rem));
  margin-inline: auto;
  padding: 3.5rem 0 5rem;
}

.member-home-intro {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.member-home-intro h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  margin-bottom: 1.5rem;
}

.member-search {
  max-width: none;
}

.member-trending-link {
  display: inline-flex;
  margin-top: 0.85rem;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
}

.member-feed {
  padding-top: 3rem;
}

.member-feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.member-feed-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.member-feed-heading > p {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: right;
}

.member-feed-skeleton {
  height: 150px;
  margin-bottom: 1rem;
}

.home-onboarding-card {
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--bg);
  text-align: center;
}

.home-onboarding-card .home-eyebrow {
  margin-bottom: 0.5rem;
}

.home-onboarding-card h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin-bottom: 0.7rem;
}

.home-onboarding-card > p:not(.home-eyebrow) {
  max-width: 58ch;
  margin: 0 auto 1.4rem;
  color: var(--muted);
}

.home-onboarding-card .btn-primary {
  width: auto;
  padding-inline: 1.3rem;
}

.home-onboarding-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.home-learning-note,
.home-social-empty {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.home-learning-note span,
.home-social-empty span {
  color: var(--muted);
  font-size: 0.92rem;
}

.home-feed-section {
  margin-top: 2.5rem;
}

.home-feed-section-heading {
  margin-bottom: 1rem;
}

.home-feed-section-heading h3 {
  font-size: 1.45rem;
  margin-bottom: 0.25rem;
}

.home-feed-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.home-rec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-rec-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.home-rec-card:hover {
  border-color: var(--red-dim);
  text-decoration: none;
  transform: translateY(-2px);
}

.home-rec-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface);
}

.home-rec-thumb-empty {
  background: linear-gradient(135deg, var(--surface), var(--surface-hi));
}

.home-rec-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.9rem;
}

.home-rec-source {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-rec-content h3 {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.home-rec-channel {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.home-rec-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.home-rec-rating .star {
  width: 0.9rem;
  height: 0.9rem;
}

.home-rec-rating strong {
  color: var(--text);
  font-size: 0.9rem;
}

.home-rec-reason {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.home-topic-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.home-topic-link {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.home-topic-link:hover {
  border-color: var(--red);
  text-decoration: none;
}

.home-topic-link span {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-topic-link strong {
  overflow: hidden;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.profile-share-cards {
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(219, 37, 4, 0.14), transparent 18rem),
    var(--surface);
}

.profile-share-cards-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-share-cards-heading h3 {
  margin-bottom: 0.25rem;
}

.profile-share-cards-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.profile-share-cards-badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--line));
  border-radius: 999px;
  color: var(--red);
  font: 700 0.72rem var(--font-mono);
}

.profile-share-cards-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.profile-share-cards-actions button {
  min-height: 48px;
}

.share-card-modal {
  width: min(540px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.share-card-preview {
  display: grid;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #09090c;
  place-items: center;
}

.share-card-preview img {
  display: block;
  width: min(100%, 300px);
  max-height: 56dvh;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
}

.share-card-status {
  min-height: 1.35em;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.share-card-modal-actions {
  margin-top: 0;
}

.favorite-channels-editor {
  margin: 0.25rem 0 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.favorite-channels-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.favorite-channels-heading h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.favorite-channels-heading p,
.favorite-channels-disclosure,
.favorite-channels-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.favorite-channels-heading .btn-ghost {
  width: auto;
  flex-shrink: 0;
}

.channel-podium-skeleton {
  width: 100%;
  height: 130px;
}

.channel-podium-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channel-podium-place {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.channel-podium-place-1 { order: 2; }
.channel-podium-place-2 { order: 1; }
.channel-podium-place-3 { order: 3; }

.channel-podium-rank {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 0.45rem;
  place-items: center;
  border: 1px solid var(--red);
  border-radius: 50%;
  background: var(--bg);
  color: var(--red);
  font: 700 0.8rem var(--font-mono);
}

.channel-podium-place strong {
  display: block;
  min-height: 2.65rem;
  max-height: 2.65rem;
  margin-bottom: 0.45rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.channel-podium-place strong.channel-podium-empty {
  color: var(--muted);
  font-weight: 500;
}

.channel-podium-step {
  display: block;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line));
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--red) 16%, var(--surface-hi));
}

.channel-podium-place-1 .channel-podium-step { height: 68px; }
.channel-podium-place-2 .channel-podium-step { height: 48px; }
.channel-podium-place-3 .channel-podium-step { height: 34px; }

.favorite-channels-controls {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.favorite-channel-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.favorite-channel-selects .field {
  min-width: 0;
  margin-bottom: 0.5rem;
}

.favorite-channel-selects select {
  width: 100%;
  min-width: 0;
}

.favorite-channels-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.favorite-channels-actions > * {
  width: auto;
}

.favorite-channels-status {
  margin-top: 0.8rem;
  text-align: center;
}

.favorite-channels-public-card > h3 {
  margin-bottom: 0.35rem;
}

.favorite-channels-public-card .channel-podium {
  margin-top: 1rem;
}

.privacy-setting-group {
  margin: 0.25rem 0 1.25rem;
}

.privacy-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.privacy-setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

.privacy-help-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font: 700 0.95rem var(--font-body);
  cursor: pointer;
}

.privacy-help-button:hover,
.privacy-help-button:focus-visible {
  border-color: var(--red);
  color: var(--red);
}

.privacy-help-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.privacy-help-text {
  margin: 0.6rem 3rem 0 1rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.privacy-setting > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.privacy-setting-control {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-hi);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.privacy-setting-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  content: '';
  transition: background 0.15s ease, transform 0.15s ease;
}

.privacy-setting > input:checked + .privacy-setting-control {
  border-color: var(--red);
  background: rgba(214, 54, 47, 0.16);
}

.privacy-setting > input:checked + .privacy-setting-control::after {
  background: var(--red);
  transform: translateX(18px);
}

.privacy-setting > input:focus-visible + .privacy-setting-control {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.privacy-setting-copy {
  display: grid;
  gap: 0.25rem;
}

.privacy-setting-copy strong {
  color: var(--text);
  font-size: 0.94rem;
}

.privacy-setting-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.private-profile-badge {
  display: inline-flex;
  margin: 0 0.6rem 0.6rem 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.private-ratings-message {
  display: grid;
  gap: 0.3rem;
  padding: var(--space-4);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.private-ratings-message span {
  color: var(--muted);
  font-size: 0.88rem;
}

.home-section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
}

.home-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 3rem;
}

.home-section-heading .home-eyebrow {
  margin-bottom: 0.3rem;
}

.home-section-heading h2,
.home-value-copy h2,
.home-final-cta h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.home-steps li {
  min-height: 235px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.home-step-number {
  display: block;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  margin-bottom: 3.2rem;
}

.home-steps h3 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.home-steps p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.home-value-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: clamp(3rem, 8vw, 8rem);
  padding: 6rem 0;
}

.home-value-copy > p:last-child {
  color: var(--muted);
  line-height: 1.7;
  max-width: 54ch;
}

.home-value-list {
  padding: 0;
  margin: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.home-value-list li {
  display: grid;
  gap: 0.25rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.home-value-list strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}

.home-value-list span {
  color: var(--muted);
  font-size: 0.85rem;
}

.home-final-cta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem;
  border-radius: 18px;
  background: var(--text);
  color: var(--bg);
}

.home-final-cta .home-eyebrow {
  color: var(--gold);
}

.home-final-cta .home-actions {
  flex: 0 0 auto;
}

.home-final-cta .btn-ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--bg);
}

.home-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.home-footer p {
  margin: 0;
}

/* ---------- Em alta nesta semana ---------- */

.trending-page {
  background:
    radial-gradient(circle at 85% 0%, rgba(219, 37, 4, 0.09), transparent 30rem),
    var(--bg-soft);
}

.weekly-trending-page {
  width: min(1120px, calc(100% - 2.5rem));
  max-width: none;
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.weekly-trending-hero {
  max-width: 760px;
  margin-bottom: 2rem;
}

.weekly-trending-hero h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.35rem, 6vw, 4rem);
  line-height: 1.05;
}

.weekly-trending-lead {
  max-width: 58ch;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.weekly-trending-disclosure {
  max-width: 700px;
  margin-bottom: 0.65rem;
}

.weekly-trending-hero > small {
  color: var(--muted);
}

.weekly-trending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.weekly-trending-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 10px 28px rgba(20, 20, 24, 0.05);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.weekly-trending-card:hover {
  border-color: var(--red-dim);
  transform: translateY(-2px);
}

.weekly-trending-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}

.weekly-trending-media img,
.weekly-trending-thumb-empty {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.weekly-trending-thumb-empty {
  background: linear-gradient(135deg, var(--surface), var(--surface-hi));
}

.weekly-trending-position {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  display: grid;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font: 700 0.9rem/1 var(--font-body);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  place-items: center;
}

.weekly-trending-content {
  padding: 1rem;
}

.weekly-trending-content h2 {
  margin: 0 0 0.3rem;
  font: 600 1.03rem/1.35 var(--font-body);
}

.weekly-trending-content h2 a {
  color: var(--text);
}

.weekly-trending-content h2 a:hover {
  color: var(--red);
  text-decoration: none;
}

.weekly-trending-channel {
  overflow: hidden;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-trending-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.weekly-trending-rating .star {
  width: 1rem;
  height: 1rem;
}

.weekly-trending-rating strong {
  color: var(--text);
  font-size: 0.95rem;
}

.weekly-trending-skeleton {
  aspect-ratio: 0.92;
  border-radius: 14px;
}

.weekly-trending-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 0.45rem;
  padding: 2rem;
}

.weekly-trending-empty span {
  color: var(--muted);
}

.weekly-trending-empty .btn-link {
  margin-top: 0.65rem;
}

.noscript-banner {
  position: fixed;
  z-index: 200;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--danger-text);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Busca ---------- */

.search-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: var(--space-4);
}
.search-bar input {
  flex: 1;
}
.search-bar button {
  width: auto;
  padding: 0 1.4rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.video-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.video-card:hover {
  border-color: var(--red-dim);
  text-decoration: none;
  transform: translateY(-2px);
}
.video-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  display: block;
}
.video-card .info {
  display: flex;
  flex-direction: column;
  min-height: 124px;
  padding: 0.8rem 0.9rem;
}
.video-card .title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.video-card .channel {
  font-size: 0.8rem;
  color: var(--muted);
}

.video-card .search-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.45rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.video-card .search-rating strong {
  color: var(--text);
  font-size: 0.82rem;
}

.video-card .search-rating-star {
  display: inline-flex;
}

.video-card .search-rating-star .star {
  width: 0.95rem;
  height: 0.95rem;
}

.video-card .search-rating.is-empty {
  font-style: italic;
}

/* ---------- Página de vídeo ---------- */

.video-frame-wrap {
  aspect-ratio: 16 / 9;
  min-height: 200px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-3);
  border: 1px solid var(--line);
}
.video-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.youtube-video-source,
.search-source-notice {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.7rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.youtube-video-source a,
.search-source-notice a {
  flex: 0 0 auto;
  font-weight: 600;
}

.youtube-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.youtube-source-logo {
  display: block;
  width: 116px;
  height: auto;
}

.youtube-source-label {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.rating-source-disclosure {
  max-width: 64ch;
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.video-unavailable-card h1 {
  margin-bottom: 0.65rem;
}

.video-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.video-meta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
  font-family: var(--font-mono);
  margin-bottom: var(--space-4);
}

.video-description {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 6.5em;
  overflow: hidden;
  position: relative;
}
.video-description.expanded {
  max-height: none;
}
.show-more-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.85rem;
  padding: 0.4rem 0;
  cursor: pointer;
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.rating-summary .score {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold);
  line-height: 1;
}
.rating-summary .count {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Avaliar (estrelas interativas com seleção de metade) ---------- */

.rating-picker {
  margin-bottom: var(--space-3);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.rating-picker-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.interactive-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 248px;
  max-width: 100%;
}

.rating-star-unit {
  position: relative;
  display: block;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
}

.rating-star-art,
.rating-star-art .star {
  display: block;
  width: 100%;
  height: 100%;
}

.rating-half {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 50%;
  min-width: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rating-half-left {
  left: 0;
}

.rating-half-right {
  right: 0;
}

.rating-half:hover {
  background: rgba(184, 134, 11, 0.08);
}

.rating-half:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  background: rgba(214, 54, 47, 0.08);
}

.rate-value {
  display: block;
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.rating-picker-help {
  display: block;
  max-width: 58ch;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.rate-actions {
  display: flex;
  gap: 0.6rem;
}
.rate-actions .btn-primary {
  width: auto;
  padding: 0.65rem 1.3rem;
}
.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem;
}
.btn-danger-ghost:hover {
  background: var(--danger-bg);
}

.btn-danger {
  width: auto;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-text);
  color: #fff;
  padding: 0.72rem 1rem;
  font-weight: 700;
}

.legal-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.legal-consent-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 0.1rem;
  accent-color: var(--red);
}

/* ---------- Lista de reviews ---------- */

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-item {
  display: flex;
  gap: 0.8rem;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-item.review-linked,
.review-item:target {
  padding: 0.85rem;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: rgba(219, 37, 4, 0.06);
  outline: none;
}

.review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  text-decoration: none;
  background: var(--surface-hi);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  overflow: hidden;
}

.review-body {
  flex: 1;
  min-width: 0;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}
.review-author:hover {
  text-decoration: underline;
}

.review-stars .star {
  width: 0.95rem;
  height: 0.95rem;
}

.review-date {
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: auto;
}

.review-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.review-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.55rem;
}

.review-share-button {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: underline;
}

.review-share-button:hover,
.review-share-button:focus-visible {
  color: var(--red-dim);
}

.content-report-button,
.message-report {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: underline;
}

.content-report-button:hover,
.content-report-button:focus-visible,
.message-report:hover,
.message-report:focus-visible {
  color: var(--danger-text);
}

/* ---------- Lista de avaliações no perfil ---------- */

.my-rating-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.my-rating-item {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin: -0.5rem;
  transition: background 0.15s ease;
}
.my-rating-item:hover {
  background: var(--surface-hi);
  text-decoration: none;
}

.my-rating-thumb {
  width: 72px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-soft);
  flex-shrink: 0;
}

.video-metadata-placeholder {
  display: inline-block;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 8px, var(--surface-hi) 8px, var(--surface-hi) 16px);
}

.my-rating-info {
  min-width: 0;
}
.my-rating-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}
.my-rating-stars .star {
  width: 0.85rem;
  height: 0.85rem;
}

.profile-watched-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.profile-watched-summary strong {
  font-size: 1.02rem;
}

.profile-watched-summary span {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.ratings-more-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 44px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: 600 0.88rem var(--font-body);
  cursor: pointer;
}

.ratings-more-button:hover {
  border-color: var(--red);
  color: var(--red);
}

.ratings-more-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.ratings-more-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ratings-more-arrow {
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Botão de amizade (estados) ---------- */

.btn-friend {
  width: auto;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-friend.state-none {
  background: var(--red);
  color: #ffffff;
}
.btn-friend.state-pending {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn-friend.state-friends {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-friend:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Listas de pessoas (pedidos, amigos) ---------- */

.friends-page {
  max-width: 960px;
}

.friends-page-intro {
  max-width: 700px;
  margin-bottom: 2rem;
}

.friends-page-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.friends-page-intro > p:last-child {
  max-width: 62ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.friends-page .card h2 {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

.friends-page .card-description,
.people-discovery-heading p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.people-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.people-suggestion-skeleton {
  height: 230px;
}

.people-suggestion-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.people-suggestion-card.request-sent {
  border-color: var(--red);
}

.people-suggestion-profile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}

.people-suggestion-avatar {
  display: flex;
  grid-row: span 2;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-hi);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.people-suggestion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.people-suggestion-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-suggestion-profile > div > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-match {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(214, 54, 47, 0.3);
  border-radius: 999px;
  background: rgba(214, 54, 47, 0.08);
  color: var(--red-dim);
  font-size: 0.76rem;
  font-weight: 700;
}

.people-match-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.people-suggestion-bio {
  min-height: 2.8rem;
  margin: 0.8rem 0 0.55rem;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.4;
}

.people-suggestion-bio-empty {
  color: var(--muted);
  font-style: italic;
}

.people-suggestion-evidence {
  min-height: 2.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.people-suggestion-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.people-suggestion-actions > * {
  flex: 1;
  min-height: 42px;
}

.people-suggestion-actions .btn-link,
.people-suggestion-actions .btn-primary {
  width: auto;
  padding: 0.6rem 0.75rem;
  font-size: 0.86rem;
}

/* Depois que a pessoa já usa as áreas principais, as explicações de
   onboarding somem e ficam apenas títulos, dados e ações úteis. */
.experienced-member .member-feed-heading > p,
.experienced-member .home-feed-section-heading > p,
.experienced-member .home-rec-reason,
.experienced-member .home-topic-link > span,
.friends-experienced .friends-page-intro > p,
.friends-experienced .people-discovery-heading p,
.friends-experienced .card-description,
.friends-experienced .people-suggestion-bio-empty {
  display: none;
}

.friends-experienced .friends-page-intro {
  margin-bottom: 1.25rem;
}

.people-suggestions-empty {
  grid-column: 1 / -1;
}

.person-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.person-row .avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-hi);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  overflow: hidden;
}

.person-row .person-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-row .person-name:hover {
  text-decoration: underline;
}

.person-row .person-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.person-row .person-actions button {
  width: auto;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.person-row .person-actions .person-message-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.82rem;
}

.person-row .person-actions .person-message-link:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.profile-social-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.profile-message-link {
  width: auto;
  min-height: 42px;
  padding: 0.6rem 1.1rem;
}
.person-row .person-actions button.accept {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

/* ---------- Busca de usuário (amigos.html) ---------- */

.user-search {
  display: flex;
  gap: 0.6rem;
  margin-bottom: var(--space-3);
}
.user-search input {
  flex: 1;
}
.user-search button {
  width: auto;
  padding: 0 1.4rem;
}

/* ---------- Feed ---------- */

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.feed-item {
  display: flex;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.feed-item .avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-hi);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  overflow: hidden;
}

.feed-item .feed-body {
  flex: 1;
  min-width: 0;
}

.feed-item .feed-text {
  font-size: 0.9rem;
  line-height: 1.4;
}
.feed-item .feed-text a {
  font-weight: 600;
}
.feed-item .feed-text .stars-inline .star {
  width: 0.85rem;
  height: 0.85rem;
  vertical-align: -2px;
}

.feed-item .feed-review {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  font-style: italic;
}

.feed-item .feed-date {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.feed-item .feed-thumb {
  width: 100px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface);
  border-radius: 6px;
  flex-shrink: 0;
}

/* ---------- Banner de consentimento de cookies (LGPD) ---------- */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 1rem var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.consent-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 60ch;
}

.consent-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}
.consent-actions button {
  width: auto;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

/* ---------- Espaço de anúncio ---------- */

.ad-slot {
  margin: var(--space-3) 0;
  overflow: hidden;
}
.ad-slot:empty {
  margin: 0; /* sem conteúdo (anúncio não configurado ainda) = sem espaço reservado */
}

/* ---------- Painel administrativo ---------- */

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-section-heading h3 {
  margin: 0;
}

.admin-total {
  min-width: 2.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.admin-period-options {
  display: flex;
  gap: 0.45rem;
  margin: 1rem 0;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.admin-period-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.admin-period-button:hover,
.admin-period-button:focus-visible {
  border-color: var(--red);
  color: var(--text);
}

.admin-period-button.active {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.admin-period-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.admin-activity-note {
  margin: 0.35rem 0 1rem;
}

.admin-leaderboards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-leaderboard {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.admin-leaderboard h4,
.admin-leaderboard p {
  margin: 0;
}

.admin-leaderboard p {
  min-height: 2.5em;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-leaderboard ol {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: admin-rank;
}

.admin-leaderboard li {
  counter-increment: admin-rank;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.admin-activity-user {
  display: grid;
  min-width: 0;
}

.admin-activity-user a {
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-user a::before {
  content: counter(admin-rank) '. ';
  color: var(--muted);
}

.admin-activity-user small,
.admin-activity-user time {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-count {
  display: grid;
  justify-items: end;
}

.admin-activity-count strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.admin-activity-count small {
  color: var(--muted);
  font-size: 0.64rem;
}

.admin-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.admin-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table a {
  color: var(--text);
  text-decoration: none;
}
.admin-table a:hover {
  text-decoration: underline;
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--surface-hi);
  color: var(--muted);
}
.role-badge.role-owner {
  background: var(--red);
  color: #ffffff;
}
.role-badge.role-admin {
  background: var(--gold);
  color: #21170a;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-metric-group + .admin-metric-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.admin-metric-group > h4 {
  margin-bottom: 0.7rem;
}

.admin-metric-group > .hint {
  margin: -0.35rem 0 0.85rem;
}

.admin-metric {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.admin-metric strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
}

.admin-metric span {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-feedback-list {
  display: grid;
  gap: 0.75rem;
}

.admin-feedback-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.admin-feedback-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-feedback-item p {
  margin: 0.55rem 0 0;
  white-space: pre-wrap;
}

/* ---------- Feedback da fase de testes ---------- */

.feedback-page {
  max-width: 620px;
}

.feedback-card h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.feedback-intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.feedback-card textarea {
  min-height: 10rem;
}

.feedback-card .btn-primary {
  width: auto;
}

.feedback-success {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.feedback-success .btn-link {
  width: fit-content;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-3);
}

.profile-header {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  overflow: hidden;
}

.profile-identity .username {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.profile-identity h1 {
  font-size: 1.8rem;
  margin: 0.15rem 0 0.4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: var(--space-3);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-body);
  font-weight: 600;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-hi);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  border-color: var(--danger-border);
  color: var(--danger-text);
}

/* ---------- Mensagens diretas ---------- */

.messages-page {
  height: 100vh;
  overflow: hidden;
}

.messages-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  width: min(1180px, 100%);
  height: calc(100vh - 82px);
  margin: 0 auto;
  border-inline: 1px solid var(--line);
}

.conversations-panel {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.messages-panel-heading,
.chat-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.messages-panel-heading h1 {
  flex: 1;
  font-size: 1.55rem;
}

.messages-refresh,
.chat-back {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.35rem;
}

.messages-skeleton {
  height: 76px;
  margin: 1rem;
  border-radius: var(--radius);
}

.conversation-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-row:hover,
.conversation-row.active {
  background: var(--surface);
}

.message-avatar,
.chat-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-hi);
  object-fit: cover;
  place-items: center;
}

.chat-avatar {
  width: 42px;
  height: 42px;
}

.message-avatar-fallback {
  color: var(--red);
  font-weight: 700;
}

.conversation-copy {
  min-width: 0;
}

.conversation-copy strong,
.conversation-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.conversation-unread {
  min-width: 22px;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.chat-panel,
#activeChat {
  height: 100%;
  min-height: 0;
}

#activeChat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-empty {
  display: grid;
  height: 100%;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
  place-content: center;
}

.chat-empty p {
  margin-bottom: 0;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}

.chat-person:hover {
  text-decoration: none;
}

.chat-person strong,
.chat-person small {
  display: block;
}

.chat-person small {
  color: var(--muted);
}

.chat-back {
  display: none;
}

.message-list {
  display: flex;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  background: var(--bg-soft);
}

.message-bubble {
  position: relative;
  width: fit-content;
  max-width: min(78%, 560px);
  padding: 0.7rem 0.8rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  touch-action: pan-y;
  transform: translateX(var(--message-reply-drag, 0));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.message-bubble::before {
  position: absolute;
  top: 50%;
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-hi);
  color: var(--muted);
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.8);
  transition: opacity 100ms ease, transform 100ms ease, color 100ms ease;
  place-items: center;
}

.message-bubble.received::before {
  right: calc(100% + 0.55rem);
  content: '↩';
}

.message-bubble.sent::before {
  left: calc(100% + 0.55rem);
  content: '↪';
}

.message-bubble.message-reply-dragging {
  transition: none;
}

.message-bubble.message-reply-dragging::before {
  opacity: 0.75;
  transform: translateY(-50%) scale(1);
}

.message-bubble.message-reply-ready::before {
  color: var(--red);
  opacity: 1;
}

.message-bubble.message-highlight {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 35%, transparent);
}

.message-bubble.sent {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}

.message-bubble p {
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-reply-reference {
  display: block;
  width: 100%;
  min-width: min(240px, 58vw);
  overflow: hidden;
  margin: 0 0 0.55rem;
  padding: 0.48rem 0.58rem;
  border: 0;
  border-left: 3px solid var(--red);
  border-radius: 7px;
  background: color-mix(in srgb, var(--red) 7%, var(--bg));
  color: var(--text);
  text-align: left;
}

.message-reply-reference:hover,
.message-reply-reference:focus-visible {
  background: color-mix(in srgb, var(--red) 12%, var(--bg));
}

.message-reply-reference strong,
.message-reply-reference span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply-reference strong {
  color: var(--red);
  font-size: 0.72rem;
}

.message-reply-reference span {
  color: var(--muted);
  font-size: 0.76rem;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.message-bubble time {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
}

.message-delete,
.message-reply-action {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  text-decoration: underline;
}

.message-reply-action:hover,
.message-reply-action:focus-visible {
  color: var(--red);
}

.message-delete:hover,
.message-delete:focus-visible,
.message-report:hover,
.message-report:focus-visible {
  color: var(--danger-text);
}

.message-video-card {
  display: flex;
  width: min(360px, 100%);
  overflow: hidden;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
}

.message-video-card:hover {
  text-decoration: none;
}

.message-video-card img {
  width: 100px;
  height: 56px;
  align-self: center;
  object-fit: contain;
  background: var(--surface);
}

.message-video-card span {
  min-width: 0;
  padding: 0.55rem 0.55rem 0.55rem 0;
}

.message-video-card small,
.message-video-card strong {
  display: block;
}

.message-video-card small {
  color: var(--red);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.message-video-card strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

.message-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.message-compose-reply {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 0.75rem;
  padding: 0.58rem 0.65rem;
  border-left: 3px solid var(--red);
  border-radius: 8px;
  background: var(--surface);
}

.message-compose-reply-copy {
  min-width: 0;
}

.message-compose-reply-copy strong,
.message-compose-reply-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-compose-reply-copy strong {
  color: var(--red);
  font-size: 0.76rem;
}

.message-compose-reply-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.message-compose-reply-cancel {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  place-items: center;
}

.message-compose-reply-cancel:hover,
.message-compose-reply-cancel:focus-visible {
  background: var(--surface-hi);
  color: var(--text);
}

.message-compose textarea {
  min-height: 44px;
  max-height: 130px;
}

.message-compose .btn-primary {
  width: auto;
  min-width: 92px;
}

@media (prefers-reduced-motion: reduce) {
  .message-bubble,
  .message-bubble::before {
    transition: none;
  }
}

.video-social-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 1rem 0;
}

.video-social-actions .btn-ghost {
  width: auto;
}

.share-video-preview {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0 1.25rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.share-video-preview img {
  width: 110px;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  object-fit: contain;
  background: var(--bg);
}

.share-video-preview strong {
  line-height: 1.35;
}

.playlist-choice-list {
  display: grid;
  max-height: min(42vh, 380px);
  overflow-y: auto;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.playlist-choice {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.playlist-choice:hover {
  border-color: var(--muted);
}

.playlist-choice > span:first-child {
  min-width: 0;
}

.playlist-choice strong,
.playlist-choice small {
  display: block;
}

.playlist-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-choice small {
  color: var(--muted);
  font-size: 0.76rem;
}

.playlist-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.playlist-checkmark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid var(--muted);
  border-radius: 4px;
  color: transparent;
  font-size: 0.9rem;
  font-weight: 800;
  place-items: center;
}

.playlist-choice input:checked + .playlist-checkmark {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.playlist-choice input:focus-visible + .playlist-checkmark {
  outline: 3px solid color-mix(in srgb, var(--red) 32%, transparent);
  outline-offset: 2px;
}

/* ---------- Playlists ---------- */

.playlist-page {
  max-width: 860px;
}

.playlist-heading-card {
  margin-bottom: 1.25rem;
  padding: clamp(1.3rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
}

.playlist-heading-card h1 {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.playlist-heading-card .playlist-owner,
.playlist-heading-card > span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

.playlist-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.playlist-card-heading h3 {
  margin: 0;
}

.playlist-card-heading .btn-ghost {
  width: auto;
}

.profile-playlist-form,
.playlist-edit-grid,
.playlist-add-form {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.profile-playlist-form .btn-primary,
.playlist-edit-grid .btn-primary,
.playlist-add-form .btn-primary {
  width: auto;
}

.playlist-add-form input[name='page_url'] {
  width: 100%;
  min-height: 58px;
  padding-inline: 1rem;
  font-size: 1rem;
}

.playlist-public-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.playlist-public-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
}

.profile-playlist-list {
  display: grid;
  gap: 0.6rem;
}

.profile-playlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

.profile-playlist-row:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.profile-playlist-row strong,
.profile-playlist-row small {
  display: block;
}

.profile-playlist-row small,
.profile-playlist-visibility {
  color: var(--muted);
  font-size: 0.78rem;
}

.playlist-owner-tools > .playlist-delete {
  margin-top: 0.5rem;
}

.playlist-video-list {
  display: grid;
  gap: 0.7rem;
}

.playlist-video-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.playlist-video-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.playlist-video-link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
}

.playlist-video-link:hover {
  text-decoration: none;
}

.playlist-video-link img,
.playlist-video-thumb-empty {
  width: 128px;
  aspect-ratio: 16 / 9;
  flex: 0 0 128px;
  border-radius: 8px;
  background: var(--surface-hi);
  object-fit: contain;
}

.playlist-video-link span {
  min-width: 0;
}

.playlist-video-link strong,
.playlist-video-link small {
  display: block;
}

.playlist-video-link strong {
  line-height: 1.35;
}

.playlist-video-link small {
  color: var(--muted);
}

.playlist-remove-video {
  flex: 0 0 auto;
}

.chat-start,
.chat-locked {
  margin: auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.chat-locked {
  margin: 0;
  border-radius: 0;
  background: var(--surface);
}

.people-suggestion-method {
  margin: -0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.legal-modal-links,
.settings-legal-links {
  display: grid;
  gap: 0.45rem;
}

.legal-modal-links {
  margin: 1rem 0 1.25rem;
  padding-left: 1.25rem;
}

.settings-legal-links a {
  padding: 0.35rem 0;
}

.legal-page {
  max-width: 780px;
}

.legal-page > article > h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(2rem, 7vw, 3rem);
}

.legal-updated {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.legal-page .card h2 {
  margin-bottom: 0.65rem;
  font-size: 1.25rem;
}

.legal-page .card p:last-child {
  margin-bottom: 0;
}

.youtube-attribution {
  display: flex;
  max-width: 1100px;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.5rem auto 0;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.youtube-attribution a {
  display: inline-flex;
  flex: 0 0 auto;
}

.youtube-attribution img {
  display: block;
  width: 132px;
  height: auto;
}

.youtube-attribution-dark {
  display: none !important;
}

:root[data-theme='dark'] .youtube-attribution-light {
  display: none !important;
}

:root[data-theme='dark'] .youtube-attribution-dark {
  display: block !important;
}

.admin-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-report-actions > * {
  width: auto;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .youtube-attribution-light {
    display: none !important;
  }

  :root:not([data-theme='light']) .youtube-attribution-dark {
    display: block !important;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    padding: var(--space-4);
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .auth-tagline h1 {
    font-size: 1.8rem;
  }
  .star-field {
    display: none;
  }

  .home-value-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .home-final-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-rec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weekly-trending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --space-4: 1.35rem;
    --space-5: 2rem;
  }

  .top-bar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.9rem 1rem 0.75rem;
  }

  .top-bar .nav-right {
    order: 3;
    width: 100%;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.3rem;
    scrollbar-width: thin;
  }

  .top-bar .nav-authenticated {
    margin-left: 0;
  }

  .top-utility-actions {
    order: 2;
    margin-left: auto;
  }

  .top-bar .wordmark {
    order: 1;
  }

  .app-modal-actions {
    flex-direction: column;
  }

  .profile-share-cards-heading {
    align-items: center;
  }

  .profile-share-cards-actions {
    grid-template-columns: 1fr;
  }

  .share-card-modal {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .share-card-preview img {
    width: min(100%, 260px);
    max-height: 50dvh;
  }

  body.has-mobile-nav .pwa-install-prompt {
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
  }

  .weekly-trending-page {
    width: 100%;
    padding-top: 2.4rem;
  }

  .weekly-trending-grid {
    grid-template-columns: 1fr;
  }

  .youtube-video-source,
  .search-source-notice {
    align-items: flex-start;
    gap: 0.3rem 0.55rem;
  }

  .youtube-attribution {
    align-items: flex-start;
    flex-direction: column;
  }

  .messages-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .messages-shell {
    display: block;
    height: calc(100vh - 76px - 72px);
    border: 0;
  }

  .conversations-panel,
  .chat-panel {
    height: 100%;
    border: 0;
  }

  .chat-panel {
    display: none;
  }

  .chat-is-open .conversations-panel {
    display: none;
  }

  .chat-is-open .chat-panel {
    display: block;
  }

  .chat-back {
    display: block;
  }

  .message-bubble {
    max-width: 88%;
  }

  .nav-link,
  .nav-logout {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.has-mobile-nav {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .top-bar .nav-right.nav-authenticated {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0.35rem;
    overflow: visible;
    padding: 0.45rem max(0.75rem, env(safe-area-inset-right))
      calc(0.45rem + env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  }

  .nav-authenticated .nav-main-link {
    flex-direction: column;
    gap: 0.12rem;
    min-height: 54px;
    padding: 0.4rem 0.5rem;
    border-color: transparent;
    font-size: 0.72rem;
  }

  .nav-authenticated .nav-main-link:hover {
    border-color: transparent;
  }

  .nav-authenticated .nav-main-link[aria-current='page'] {
    border-color: transparent;
    background: var(--danger-bg);
    color: var(--red);
  }

  .nav-authenticated .nav-main-icon {
    display: block;
  }

  .has-mobile-nav .toast {
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .home-page .home-nav-button {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
  }

  .home-hero,
  .home-section,
  .home-value-section,
  .home-final-cta,
  .home-footer {
    width: min(100% - 2rem, 1120px);
  }

  .member-home {
    width: min(100% - 2rem, 960px);
    padding: 2.5rem 0 4rem;
  }

  .member-home-intro {
    padding-bottom: 2rem;
  }

  .member-feed {
    padding-top: 2.5rem;
  }

  .member-feed-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .member-feed-heading > p {
    text-align: left;
  }

  .home-hero {
    padding: 3.25rem 0 4rem;
  }

  .home-hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.5rem);
  }

  .home-section {
    padding: 4rem 0;
  }

  .home-section-heading {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .home-steps {
    grid-template-columns: 1fr;
  }

  .home-steps li {
    min-height: auto;
  }

  .home-step-number {
    margin-bottom: 2rem;
  }

  .home-value-section {
    padding: 4.5rem 0;
  }

  .home-final-cta {
    width: calc(100% - 2rem);
    padding: 2rem;
  }

  .home-final-cta .home-actions {
    width: 100%;
  }

  .home-final-cta .btn-link {
    flex: 1 1 160px;
  }

  .home-footer {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .page {
    padding: 1.6rem 1rem;
  }

  .auth-brand {
    min-height: 190px;
    padding: 1.5rem;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 1.5rem 1rem 2rem;
  }

  .auth-tagline h1 {
    max-width: 18ch;
    font-size: 1.65rem;
  }

  .auth-tagline p {
    margin-bottom: 0;
    font-size: 0.92rem;
  }

  .search-bar,
  .user-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-bar input,
  .user-search input {
    min-width: 0;
  }

  .profile-header {
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .avatar {
    width: 78px;
    height: 78px;
  }

  .card {
    padding: 1.1rem;
  }

  .favorite-channel-selects {
    grid-template-columns: 1fr;
  }

  .people-suggestions {
    grid-template-columns: 1fr;
  }

  .feed-item {
    flex-wrap: wrap;
  }

  .feed-item .feed-thumb {
    width: 92px;
  }

  .review-date {
    width: 100%;
    margin-left: 0;
  }

  .rate-actions {
    flex-wrap: wrap;
  }

  .rate-actions .btn-primary,
  .rate-actions .btn-danger-ghost {
    flex: 1 1 150px;
  }

  .person-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .person-row .person-name {
    padding-top: 0.55rem;
  }

  .person-row .person-actions {
    width: 100%;
    padding-left: 3.4rem;
    flex-wrap: wrap;
  }

  .consent-banner {
    align-items: stretch;
    padding: 0.9rem 1rem;
  }

  .consent-actions {
    width: 100%;
  }

  .consent-actions button {
    flex: 1;
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .home-search {
    grid-template-columns: 1fr;
  }

  .home-search button,
  .home-actions .btn-link {
    width: 100%;
  }

  .home-rec-grid {
    grid-template-columns: 1fr;
  }

  .home-topic-list {
    grid-template-columns: 1fr;
  }

  .home-onboarding-card .btn-primary {
    width: 100%;
  }

  .home-onboarding-actions > * {
    width: 100%;
  }

  .profile-account-actions > * {
    width: 100%;
  }

  .favorite-channels-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .favorite-channels-heading .btn-ghost,
  .favorite-channels-actions > * {
    width: 100%;
  }

  .channel-podium-list {
    gap: 0.35rem;
  }

  .channel-podium-place strong {
    min-height: 3.1rem;
    font-size: 0.78rem;
  }

  .profile-watched-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-watched-summary span {
    text-align: left;
  }

  .admin-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-leaderboards {
    grid-template-columns: 1fr;
  }

  .admin-leaderboard p {
    min-height: 0;
  }

  .feedback-card .btn-primary,
  .feedback-success .btn-link {
    width: 100%;
  }

  .home-final-cta .home-actions {
    align-items: stretch;
  }

  .playlist-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .playlist-card-heading .btn-ghost,
  .profile-playlist-form .btn-primary,
  .playlist-edit-grid .btn-primary,
  .playlist-add-form .btn-primary {
    width: 100%;
  }

  .playlist-video-row {
    align-items: stretch;
    flex-direction: column;
  }

  .playlist-video-link img,
  .playlist-video-thumb-empty {
    width: 104px;
    flex-basis: 104px;
  }

  .search-bar,
  .user-search {
    grid-template-columns: 1fr;
  }

  .search-bar button,
  .user-search button {
    width: 100%;
    min-height: 44px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .feed-item .feed-thumb {
    order: 3;
    width: 100%;
  }

  .profile-header {
    flex-direction: column;
  }

  .people-suggestion-actions {
    flex-direction: column;
  }
}

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

/* ---------- Modo aplicativo / PWA / WebView ---------- */

html[data-app-mode='true'] {
  min-height: 100%;
  background: var(--bg);
  overscroll-behavior-y: none;
}

html[data-app-mode='true'] body {
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

html[data-app-mode='true'] button,
html[data-app-mode='true'] a {
  touch-action: manipulation;
}

html[data-app-mode='true'] .top-bar {
  position: sticky;
  z-index: 95;
  top: 0;
  padding-top: calc(var(--space-3) + env(safe-area-inset-top));
  padding-right: max(var(--space-4), env(safe-area-inset-right));
  padding-left: max(var(--space-4), env(safe-area-inset-left));
  background: var(--bg);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.08);
}

html[data-app-mode='true'] .page {
  min-height: calc(100dvh - 76px);
  padding-right: max(var(--space-3), env(safe-area-inset-right));
  padding-left: max(var(--space-3), env(safe-area-inset-left));
}

html[data-app-mode='true'] .auth-shell,
html[data-app-mode='true'] .messages-page {
  min-height: 100dvh;
}

html[data-app-mode='true'] .app-modal-backdrop {
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
}

html[data-app-mode='true'] .btn-primary,
html[data-app-mode='true'] .btn-ghost {
  min-height: 46px;
}

@media (max-width: 700px) {
  .friend-invite-modal .app-modal-actions {
    flex-direction: row;
  }

  html[data-app-mode='true'] .top-bar {
    padding-top: calc(0.9rem + env(safe-area-inset-top));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-left: max(1rem, env(safe-area-inset-left));
  }

  html[data-app-mode='true'] .messages-shell {
    height: calc(100dvh - 76px - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}
