/* ── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0F231D;
  --surface:    #173129;
  --surface2:   #1F3D34;
  --border:     #2A4038;
  --text:       #F1F8F4;
  --text-muted: #B7CFC3;
  --accent:     #6EE7B7;
  --accent-dim: #1A3D2E;
  --love:       #ff6b6b;
  --like:       #51cf66;
  --meh:        #fcc419;
  --dislike:    #ff8787;
  --watchlist:  #c084fc;
  --watchlist-dim: #4a1d96;
  --error-bg:   rgba(255,107,107,.10);
  --error-border: rgba(255,107,107,.28);
  --radius:     14px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Screen base ─────────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  padding: 24px 16px;
  max-width: 640px;
  margin: 0 auto;
}
.screen.active { display: flex; flex-direction: column; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active  { transform: scale(.97); }
.btn-primary   { background: var(--accent); color: #0E1E18; width: 100%; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); width: 100%; }
.btn:hover     { opacity: .88; }
.btn:disabled  { opacity: .4; cursor: default; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  width: 100%;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-text-muted {
  background: none; border: none;
  color: var(--text-muted); font-size: 13px;
  cursor: pointer; padding: 8px 4px;
  text-align: center; width: 100%;
  transition: color .15s;
}
.btn-text-muted:hover { color: var(--text); }

/* ── Auth modal ──────────────────────────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-modal[hidden] { display: none; }
.auth-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}
.auth-modal-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
}
.auth-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none;
  color: var(--text-muted); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: color .15s;
}
.auth-modal-close:hover { color: var(--text); }
.auth-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 10px 0;
  background: none; border: none;
  color: var(--text-muted); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: color .15s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form[hidden] { display: none; }
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.auth-form input {
  padding: 11px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-error {
  background: var(--error-bg); border: 1px solid var(--error-border);
  border-radius: 8px; padding: 9px 12px;
  color: var(--love); font-size: 13px; line-height: 1.4;
}
.auth-success {
  background: rgba(110,231,183,.10);
  border: 1px solid rgba(110,231,183,.28);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.4;
}
.auth-link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-link-btn:hover { text-decoration: underline; }
.auth-form-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.reset-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.reset-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
}
.reset-card h1 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.reset-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.reset-card .auth-form {
  gap: 14px;
}
.reset-card-footer {
  margin-top: 16px;
  text-align: center;
}

/* ── Skeleton shimmer ────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skel {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.skel-card {
  display: flex; flex-direction: row; align-items: stretch;
  overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 120px; margin-bottom: 14px;
}
.skel-poster {
  width: 100px; min-width: 100px; height: auto;
  border-radius: 0; align-self: stretch;
  min-height: 120px;
}
.skel-body {
  flex: 1; padding: 14px 14px;
  display: flex; flex-direction: column; justify-content: center;
}
.skel-line { display: block; height: 12px; border-radius: 4px; }

.skel-rec-card { min-height: 90px; }
.skel-rec-poster {
  width: 60px; height: 90px;
  border-radius: 8px; flex-shrink: 0;
}
.skel-rec-info { flex: 1; padding: 14px 0 14px 14px; }

/* ── Welcome ─────────────────────────────────────────────────────────── */
/* ── Landing page ────────────────────────────────────────────────────── */
#screen-welcome {
  background: var(--bg);
  justify-content: flex-start; align-items: stretch;
  text-align: center; gap: 0; padding: 0;
}

.lp-poster-strip {
  position: relative; width: 100%; height: 130px;
  display: flex; overflow: hidden; flex-shrink: 0;
  background: var(--surface);
}
.lp-poster-strip::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15,35,29,.15) 0%, rgba(15,35,29,.92) 100%);
  pointer-events: none;
}
.lp-poster {
  flex: 0 0 auto; width: 90px; height: 130px;
  object-fit: cover; filter: brightness(.6) saturate(.7);
}

.lp-content {
  padding: 18px 24px 24px;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px; flex: 1;
}

.lp-headlines { display: flex; flex-direction: column; gap: 8px; }
.lp-h1 {
  font-size: clamp(28px, 7.5vw, 44px); font-weight: 900;
  line-height: 1.1; letter-spacing: -.5px; color: var(--text);
}
.lp-h2 {
  font-size: clamp(17px, 4.2vw, 24px); font-weight: 500;
  line-height: 1.3; color: var(--text-muted);
}
.lp-sub {
  font-size: clamp(13px, 3.5vw, 16px); color: var(--text-muted);
  line-height: 1.6; max-width: 340px;
}
.lp-cta-wrap {
  display: flex; flex-direction: column;
  gap: 8px; width: 100%; max-width: 380px;
}
.lp-calibration-note {
  color: var(--text-muted);
  font-size: clamp(12px, 3.1vw, 14px);
  line-height: 1.45;
}
.lp-btn {
  width: 100%; height: 52px;
  font-size: clamp(16px, 4vw, 20px); font-weight: 700; border-radius: 12px;
}
#screen-welcome .lp-btn {
  background: #6EE7B7;
  color: #0E1E18;
}
#screen-welcome .lp-btn:hover { opacity: .92; }
.lp-flow-preview {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 380px;
  text-align: left;
  padding: 2px 0;
}
.lp-flow-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 6px 4px;
  color: var(--text-muted);
  font-size: clamp(14px, 3.5vw, 15px);
  line-height: 1.35;
}
.lp-flow-step + .lp-flow-step::before {
  content: '';
  position: absolute;
  left: 13px;
  top: -6px;
  width: 1px;
  height: 12px;
  background: rgba(110,231,183,.25);
}
.lp-flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: rgba(110,231,183,.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.lp-secondary-feature {
  width: 100%;
  max-width: 380px;
}
.lp-secondary-feature > p {
  color: var(--text);
  font-size: clamp(14px, 3.5vw, 15px);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  margin-bottom: 4px;
}
.lp-flow-preview--secondary {
  padding-top: 0;
}
.lp-flow-preview--secondary .lp-flow-step {
  color: var(--text-muted);
}

.lp-login-line {
  font-size: clamp(12px, 3vw, 14px);
  color: var(--text-muted);
  line-height: 1.4;
}
.lp-login-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.lp-login-link:hover { text-decoration: underline; }
.lp-save-note {
  color: var(--text-muted);
}

/* Extra-short screens (landscape mobile, small phones) */
@media (max-height: 580px) {
  .lp-poster-strip { height: 80px; }
  .lp-poster { height: 80px; }
  .lp-content { gap: 10px; padding: 14px 24px 16px; }
}

/* ── SEO static pages ──────────────────────────────────────────────────── */
body.seo-page {
  background: var(--bg);
  color: var(--text);
}
.seo-page .seo-wrap {
  min-height: 100vh;
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 18px 48px;
}
.seo-page .seo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.seo-page h1 {
  font-size: 34px;
  line-height: 1.2;
  margin-bottom: 14px;
}
.seo-page h2 {
  font-size: 21px;
  margin: 20px 0 10px;
}
.seo-page p {
  color: var(--text-muted);
  margin: 10px 0;
}
.seo-page ul {
  margin: 10px 0 8px 22px;
  color: var(--text-muted);
}
.seo-page li + li { margin-top: 6px; }
.seo-page .seo-nav {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.seo-page .seo-nav a { color: var(--accent); text-decoration: none; }
.seo-page .seo-nav a:hover { text-decoration: underline; }
.seo-page .seo-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(110,231,183,.08);
}
.seo-page .seo-note p,
.seo-page .seo-note ul {
  margin: 8px 0 0;
}
.seo-page .seo-note li {
  margin-top: 4px;
}
.seo-page .seo-meta {
  color: var(--text);
  font-size: 14px;
}
.seo-page .seo-section-lead {
  color: var(--text);
}
.seo-page .seo-list-tight li + li {
  margin-top: 4px;
}
.seo-page .seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 16px;
}
.seo-page .seo-actions .btn {
  width: auto;
  min-width: 220px;
}
.seo-page .seo-copy-block {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15,35,29,.5);
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
}
.seo-page .seo-copy-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Progress ────────────────────────────────────────────────────────── */
.progress-wrap {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.progress-bar {
  flex: 1; height: 4px;
  background: var(--surface2); border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  transition: width .3s ease; width: 0%;
}
.progress-label { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.onboarding-hint {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: -8px 0 12px;
}

/* ── Movie card ──────────────────────────────────────────────────────── */
.movie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: row; align-items: stretch;
  margin-bottom: 14px;
  transition: opacity .15s;
}
.movie-card.loading { opacity: .5; pointer-events: none; }
.movie-poster {
  position: relative; width: 100px; min-width: 100px;
  background: var(--surface2); overflow: hidden; flex-shrink: 0;
}
.movie-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--border);
}
.movie-body {
  flex: 1; padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 5px; overflow: hidden;
}
.movie-title    { font-size: 17px; font-weight: 700; line-height: 1.25; }
.movie-meta     { display: flex; flex-wrap: wrap; gap: 4px; color: var(--text-muted); font-size: 12px; }
.movie-meta span::after            { content: "·"; margin-left: 4px; }
.movie-meta span:last-child::after { content: ""; }
.movie-rating   { font-size: 12px; color: var(--meh); }
.movie-synopsis {
  color: var(--text-muted); font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 2px;
}
.stage-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: .01em; text-transform: none;
  background: var(--accent-dim); color: var(--accent);
  padding: 3px 9px; border-radius: 20px; margin-bottom: 6px;
}

/* ── Reaction buttons ────────────────────────────────────────────────── */
.reactions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px;
}
.reactions .react-btn:last-child:nth-child(odd) { grid-column: span 2; }
.react-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 8px; min-height: 48px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.react-btn:active  { transform: scale(.97); }
.react-btn:hover   { background: var(--surface2); }
.react-btn:disabled { opacity: .4; cursor: default; transform: none; }
.react-btn.react-btn--ghost { color: var(--text-muted); font-weight: 400; }
.react-btn[data-action="love"]    { color: var(--love); }
.react-btn[data-action="like"]    { color: var(--like); }
.react-btn[data-action="meh"]     { color: var(--meh); }
.react-btn[data-action="dislike"] { color: var(--dislike); }

/* ── Loading ─────────────────────────────────────────────────────────── */
#screen-loading { justify-content: center; align-items: center; gap: 16px; text-align: center; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--surface2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: var(--text); font-weight: 600; }
.loading-sub  { color: var(--text-muted); font-size: 13px; }

/* ── Error banner (inline, non-fatal) ────────────────────────────────── */
.error-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--error-bg); border: 1px solid var(--error-border);
  border-radius: 10px; padding: 12px 14px;
  color: var(--love); font-size: 13px; line-height: 1.4;
}
.error-banner[hidden] { display: none; }
.error-banner-btn {
  background: none; border: 1px solid var(--error-border);
  border-radius: 8px; padding: 5px 12px;
  color: var(--love); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.error-banner-btn:hover { background: rgba(255,107,107,.12); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; padding: 32px 16px;
}
.empty-state[hidden] { display: none; }
.empty-icon { font-size: 40px; margin-bottom: 4px; }
.empty-state > p     { color: var(--text); font-weight: 600; }
.empty-sub           { color: var(--text-muted); font-size: 13px; }

/* ── Rec idle (auth user, before first load) ─────────────────────────── */
.rec-idle {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px; padding: 48px 16px;
}
.rec-idle[hidden] { display: none; }
.rec-idle-icon  { font-size: 48px; margin-bottom: 4px; }
.rec-idle-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.rec-idle-sub   { font-size: 14px; color: var(--text-muted); margin: 0; }
.rec-idle-hint  { font-size: 12px; color: var(--text-muted); opacity: 0.6; margin: 4px 0 0; }

/* ── Recommendations ─────────────────────────────────────────────────── */
#screen-recommendations { gap: 16px; }
#screen-recommendations h1 { font-size: 22px; font-weight: 700; }
.rec-list { display: flex; flex-direction: column; gap: 14px; }
#btn-more-recs[hidden] { display: none !important; }

.rec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.rec-card-header { display: flex; gap: 14px; padding: 14px; }
.rec-poster-thumb {
  width: 60px; height: 90px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  color: var(--border); font-size: 26px;
}
.rec-poster-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rec-title  { font-size: 15px; font-weight: 700; line-height: 1.3; }
.rec-meta   { font-size: 12px; color: var(--text-muted); }
.rec-rating { font-size: 12px; color: var(--meh); }
.rec-synopsis {
  padding: 0 14px 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.rec-explanation {
  padding: 10px 14px 12px; font-size: 13px; color: var(--text-muted); line-height: 1.6;
  border-top: 1px solid var(--border);
}
.rec-explanation--loading {
  font-style: italic;
  color: var(--text-muted);
  opacity: .85;
}
.rec-reactions {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0;
}
.rec-react-btn {
  flex: 1; min-width: 44px; padding: 9px 5px; min-height: 40px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s; text-align: center; white-space: nowrap;
}
.rec-react-btn:hover   { background: var(--surface); }
.rec-react-btn.active  { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.rec-react-btn:disabled { opacity: .4; cursor: default; }

.rec-secondary-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px 14px;
  flex-wrap: nowrap;
}
.rec-react-btn--secondary,
.rec-watchlist-btn {
  flex: 0 1 220px;
  min-width: 0;
  padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; text-align: center;
}
.rec-react-btn--secondary {
  background: var(--surface2);
}
.rec-react-btn--secondary:hover {
  background: var(--surface);
}
.rec-watchlist-btn:hover { background: var(--surface); border-color: var(--border); }
.rec-watchlist-btn.active {
  border-style: solid; border-color: var(--watchlist);
  color: var(--watchlist); background: rgba(192,132,252,.08);
}

@media (max-width: 767px) {
  .rec-secondary-actions {
    gap: 8px;
    width: min(100%, 460px);
    margin: 0 auto;
  }
  .rec-react-btn--secondary,
  .rec-watchlist-btn {
    flex: 1 1 0;
    font-size: 12px;
    padding: 10px 8px;
  }
}

/* ── App nav bar ─────────────────────────────────────────────────────── */
.app-nav { display: none; }
.app-nav.visible {
  display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.app-nav-inner {
  display: flex; align-items: stretch;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px; font-weight: 500;
  transition: color .15s;
  white-space: nowrap;
}
.nav-btn:hover, .nav-btn.active { color: var(--accent); }
.nav-btn--recs { color: var(--accent); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; }

.nav-account-dropdown {
  position: absolute; bottom: calc(100% + 4px); right: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  min-width: 180px; z-index: 10;
  box-shadow: var(--shadow);
}
.nav-account-dropdown[hidden] { display: none; }
.nav-dropdown-group + .nav-dropdown-group {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.nav-dropdown-title {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.nav-dropdown-title--link {
  display: inline-block;
  text-decoration: none;
}
.nav-dropdown-title--link:hover { color: var(--accent); }
.nav-dropdown-link {
  display: block; padding: 8px 0; color: var(--text);
  text-decoration: none; font-size: 14px; transition: color .15s;
}
.nav-dropdown-link:hover { color: var(--accent); }

@media (min-width: 768px) {
  .app-nav.visible {
    top: 0; bottom: auto;
    border-top: none; border-bottom: 1px solid var(--border);
    flex-direction: row; align-items: center; justify-content: center;
    padding: 0 24px; height: 58px;
    padding-bottom: 0;
  }
  .app-nav-inner {
    flex: 1; max-width: 1100px; height: 100%;
    display: flex; align-items: stretch;
  }
  .nav-btn {
    flex-direction: row; gap: 7px; padding: 0 18px;
    font-size: 14px; flex: 0 0 auto;
  }
  .nav-label { font-size: 14px; }
  .nav-icon { font-size: 17px; }
  .nav-account-dropdown {
    top: calc(100% + 10px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 260px;
  }
  body.nav-visible { padding-top: 58px; }
}

/* Mobile: push content above tab bar */
@media (max-width: 767px) {
  body.nav-visible {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  body.nav-visible #screen-recommendations {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0));
  }
}

/* ── Info sidebar ────────────────────────────────────────────────────── */
.rec-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: none;
}
.rec-sidebar h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.rec-sidebar p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.rec-sidebar p:last-child { margin-bottom: 0; }
.rec-sidebar ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rec-sidebar li {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
  padding-left: 18px; position: relative;
}
.rec-sidebar li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.sidebar-divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── Rec mode modal ──────────────────────────────────────────────────── */
.rec-mode-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end;
}
.rec-mode-modal[hidden] { display: none; }
.rec-mode-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.rec-mode-box {
  position: relative; z-index: 1;
  width: 100%; background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px;
  max-height: 80vh; overflow-y: auto;
}
.rec-mode-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.rmode-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.rmode-step-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.rmode-choices { display: flex; flex-direction: column; gap: 10px; }
.rmode-choice {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, background .15s;
}
.rmode-choice:hover { border-color: var(--accent); background: var(--accent-dim); }
.rmode-choice-icon { font-size: 28px; flex-shrink: 0; }
.rmode-choice-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.rmode-choice-sub   { font-size: 13px; color: var(--text-muted); }
.rmode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.rmode-list { display: flex; flex-direction: column; gap: 8px; }
.rmode-two  { display: flex; gap: 10px; }
.rmode-two .rmode-opt { flex: 1; }
.rmode-opt {
  padding: 13px 10px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, background .15s; text-align: center; width: 100%;
}
.rmode-opt:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

@media (min-width: 600px) {
  .rec-mode-modal { align-items: center; }
  .rec-mode-box { border-radius: var(--radius); max-width: 440px; max-height: 70vh; margin: 0 auto; }
}

/* ── Profile modal footer ─────────────────────────────────────────────── */
.profile-modal-footer {
  flex-shrink: 0; padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
}
.profile-modal-footer[hidden] { display: none; }

/* ── Profile tab: TG section ─────────────────────────────────────────── */
.ptab-tg-section { margin-top: 4px; }
.profile-account-section {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.profile-account-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.profile-account-email {
  font-size: 13px; color: var(--text-muted);
  word-break: break-word;
}
.profile-account-logout {
  min-width: 120px; font-size: 13px;
}

/* ── Profile tab: history panel ─────────────────────────────────────── */
.stat-cell--clickable { cursor: pointer; transition: background .15s, border-color .15s; }
.stat-cell--clickable:hover { background: var(--surface); border: 1px solid var(--accent); }
.ptab-history-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.ptab-history-back {
  background: none; border: none; color: var(--accent); font-size: 14px;
  cursor: pointer; padding: 4px 0; white-space: nowrap; flex-shrink: 0;
}
.ptab-history-title { font-size: 15px; font-weight: 700; }
.ptab-history-rerate {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px;
}
.ptab-history-btn {
  font-size: 12px; padding: 4px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.ptab-history-btn:hover  { background: var(--surface); color: var(--text); }
.ptab-history-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.ptab-history-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ptab-history-item:last-child { border-bottom: none; }
.ptab-history-info { flex: 1; min-width: 0; }
.ptab-history-movie { font-size: 14px; font-weight: 600; }
.ptab-history-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ptab-history-list { }
.ptab-history-btn.error { border-color: var(--love); color: var(--love); }
.ptab-history-btn.success { border-color: var(--like); color: var(--like); background: rgba(81,207,102,.12); }

/* ── Onboarding inline account panel ────────────────────────────────── */
.onboarding-account-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
  width: 100%; box-sizing: border-box;
}
.onboarding-account-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}


/* ── Fatal error screen ──────────────────────────────────────────────── */
#screen-error {
  justify-content: center; align-items: center;
  text-align: center; gap: 14px;
}
.error-icon { font-size: 48px; }
#error-message { color: var(--text-muted); max-width: 300px; line-height: 1.5; }


/* ════════════════════════════════════════════════════════════════════════
   DESKTOP  ≥ 768px
   ════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  #screen-onboarding { max-width: 900px; justify-content: flex-start; }

  .movie-poster    { width: 220px; min-width: 220px; }
  .skel-poster     { width: 220px; min-width: 220px; }
  .movie-body      { padding: 20px 22px; }
  .movie-title     { font-size: 20px; }
  .movie-meta      { font-size: 13px; }
  .movie-synopsis  { -webkit-line-clamp: 6; font-size: 13px; }

  .reactions { grid-template-columns: repeat(5, 1fr); }
  .reactions .react-btn:last-child:nth-child(odd) { grid-column: span 1; }

  #screen-recommendations.active {
    display: grid; max-width: 1100px;
    grid-template-columns: 1fr 300px;
    grid-template-areas:
      "title   sidebar"
      "loading sidebar"
      "banner  sidebar"
      "skel    sidebar"
      "list    sidebar"
      "empty   sidebar"
      "more    .      ";
    column-gap: 28px; align-items: start; min-height: 100vh;
  }
  #screen-recommendations h1  { grid-area: title; }
  #rec-loading                 { grid-area: loading; }
  #rec-error-banner            { grid-area: banner; }
  #rec-list-skeleton           { grid-area: skel; }
  .rec-list                    { grid-area: list; }
  #rec-empty                   { grid-area: empty; }
  #rec-actions                 { grid-area: more; }
  .rec-sidebar                 { grid-area: sidebar; display: block; position: sticky; top: 82px; }
}

/* ── Profile modal ───────────────────────────────────────────────────── */
.profile-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end;
}
.profile-modal[hidden] { display: none; }
.profile-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.65);
}
.profile-modal-box {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.profile-modal-header {
  flex-shrink: 0; padding: 16px 16px 0; position: relative;
}
.profile-modal-body {
  flex: 1; overflow-y: auto; padding: 0 16px 8px;
}
@media (min-width: 600px) {
  .profile-modal { align-items: center; justify-content: center; }
  .profile-modal-box {
    border-radius: var(--radius);
    max-width: 520px; max-height: 76vh;
  }
}
.profile-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.profile-tabs {
  display: flex; gap: 4px; margin-bottom: 16px; margin-top: 4px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.profile-tab {
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; padding: 8px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ptab { flex: 1; }
.ptab[hidden] { display: none; }
.ptab-loading { color: var(--text-muted); font-size: 14px; padding: 24px 0; text-align: center; }
.ptab-empty   { color: var(--text-muted); font-size: 14px; padding: 24px 0; text-align: center; }

/* Profile content */
.profile-notice {
  background: var(--surface2); border-radius: 10px;
  padding: 14px 16px; font-size: 14px; color: var(--text-muted);
}
.profile-notice--warn {
  background: #2a2200; color: #c8a84b;
}
.profile-notice--warn a { color: #e8c46b; }
.profile-section-title {
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; margin-top: 16px;
}
.profile-section-title:first-child { margin-top: 4px; }

/* Taste bars */
.taste-bars { display: flex; flex-direction: column; gap: 8px; }
.taste-bar-row {
  display: grid; grid-template-columns: 100px 1fr 36px;
  align-items: center; gap: 10px;
}
.taste-bar-label { font-size: 13px; color: var(--text-muted); }
.taste-bar-track {
  height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden;
}
.taste-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width .3s;
}
.taste-bar-value { font-size: 12px; color: var(--text-muted); text-align: right; }
.taste-bar-row--inactive { grid-template-columns: 100px 1fr; opacity: 0.45; }
.taste-bar-inactive-text { font-size: 11px; color: var(--text-muted); font-style: italic; align-self: center; }
.taste-footnote { font-size: 11px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* Stats grid */
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stat-cell {
  background: var(--surface2); border-radius: 10px;
  padding: 10px 8px; text-align: center;
}
.stat-cell-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-cell-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Watchlist / rate list */
.ptab-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ptab-card {
  background: var(--surface2); border-radius: 10px;
  display: flex; gap: 10px; align-items: flex-start; padding: 10px;
}
.ptab-card-poster {
  width: 44px; height: 64px; border-radius: 6px;
  background: var(--surface); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-muted);
}
.ptab-card-poster img { width: 100%; height: 100%; object-fit: cover; }
.ptab-card-body { flex: 1; min-width: 0; }
.ptab-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptab-card-meta  { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.ptab-card-synopsis {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ptab-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ptab-card-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.ptab-card-btn:hover { background: var(--surface); color: var(--text); }
.ptab-card-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.ptab-card-btn.error { border-color: var(--love); color: var(--love); }
.ptab-card-btn--remove:hover { border-color: var(--love); color: var(--love); }
.ptab-card-btn--love  { border-color: var(--love);   color: var(--love);   }
.ptab-card-btn--like  { border-color: var(--like);   color: var(--like);   }
.ptab-card-btn--meh   { border-color: var(--meh);    color: var(--meh);    }
.ptab-card-btn--dislike { border-color: #888; color: #888; }

/* Rate search */
.ptab-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}
.ptab-rate-search-input {
  width: 100%; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  padding: 9px 12px; margin-bottom: 8px; outline: none;
}
.ptab-rate-search-input:focus { border-color: var(--accent); }
.ptab-rate-deep-link {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.18);
}
.ptab-rate-deep-link a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.ptab-rate-deep-link a:hover {
  color: var(--accent);
}

/* Deep rating */
.deep-rate-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(110, 231, 183, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.10), transparent 26%),
    var(--bg);
}
.deep-rate-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}
.deep-rate-hero {
  margin-bottom: 18px;
}
.deep-rate-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}
.deep-rate-back:hover {
  color: var(--text);
}
.deep-rate-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9ae6b4;
  margin-bottom: 8px;
}
.deep-rate-hero h1 {
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 10px;
}
.deep-rate-subtitle {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 760px;
}
.deep-rate-status {
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
}
.deep-rate-panel,
.deep-rate-card {
  background: rgba(19, 31, 26, 0.92);
  border: 1px solid rgba(110, 231, 183, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.deep-rate-panel {
  padding: 24px;
  margin-bottom: 16px;
}
.deep-rate-loader-text {
  color: var(--text-muted);
}
.deep-rate-card {
  padding: 22px;
  margin-bottom: 16px;
}
.deep-rate-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.deep-rate-progress {
  font-size: 14px;
  color: #9ae6b4;
  font-weight: 700;
}
.deep-rate-hint,
.deep-rate-item-meta,
.deep-rate-item-genres,
.deep-rate-item-lead,
.deep-rate-item-synopsis {
  color: var(--text-muted);
  font-size: 13px;
}
.deep-rate-hint {
  margin-top: 12px;
}
.deep-rate-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.deep-rate-item {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(110, 231, 183, 0.08);
}
.deep-rate-item-title {
  font-size: 19px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.deep-rate-item-genres {
  margin-top: 4px;
}
.deep-rate-item-lead {
  margin-top: 6px;
}
.deep-rate-item-synopsis {
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deep-rate-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.deep-rate-actions--list {
  margin-top: 12px;
}
.deep-rate-action {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.deep-rate-action:hover {
  transform: translateY(-1px);
}
.deep-rate-action--love { border-color: rgba(244, 63, 94, 0.42); }
.deep-rate-action--like { border-color: rgba(74, 222, 128, 0.42); }
.deep-rate-action--meh { border-color: rgba(250, 204, 21, 0.42); }
.deep-rate-action--dislike { border-color: rgba(148, 163, 184, 0.35); }
.deep-rate-action--skip {
  border-color: rgba(110, 231, 183, 0.24);
  color: var(--text-muted);
}
.deep-rate-action--wide {
  grid-column: 3 / span 2;
}
.deep-rate-footer {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
@media (max-width: 820px) {
  .deep-rate-shell {
    width: min(100%, calc(100% - 20px));
    padding: 18px 0 40px;
  }
  .deep-rate-hero h1 { font-size: 28px; }
  .deep-rate-subtitle { font-size: 14px; }
  .deep-rate-card { padding: 16px; }
  .deep-rate-item { padding: 12px; }
  .deep-rate-item-title { font-size: 18px; }
  .deep-rate-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .deep-rate-action--wide {
    grid-column: 1 / -1;
  }
}

/* ── S1 → S2 transition overlay ─────────────────────────────────────── */
.s2-transition {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  animation: fadeIn .3s ease;
}
.s2-transition[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.s2-transition-box {
  text-align: center; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.s2-transition-icon { font-size: 52px; }
.s2-transition-box h2 { font-size: 22px; font-weight: 700; }
.s2-transition-box p  { color: var(--text-muted); line-height: 1.6; }
.s2-transition-progress {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 4px; overflow: hidden; margin-top: 8px;
}
.s2-transition-fill {
  height: 100%; width: 0; background: var(--accent);
  border-radius: 4px;
  transition: width 2.2s ease;
}

/* ── Rec inline loading state ────────────────────────────────────────── */
.rec-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 48px 0; text-align: center;
}
.rec-loading[hidden] { display: none; }
.rec-loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rec-loading-text { font-size: 16px; font-weight: 600; }
.rec-loading-sub  { font-size: 13px; color: var(--text-muted); }

.rec-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.rec-actions[hidden] { display: none; }
.rec-actions-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.rec-actions-btn {
  width: 100%;
}
.compare-invite-result-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-compare-invite-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.45;
}
.rec-compare-invite-hint[hidden] { display: none; }
@media (min-width: 640px) {
  .rec-actions-row {
    grid-template-columns: 1fr 1fr;
  }
  .compare-invite-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .compare-copy-btn {
    width: auto;
    white-space: nowrap;
  }
}

/* ── Compare invite (inside profile tab) ─────────────────────────────── */
.profile-compare-section { margin-top: 18px; }
.compare-invite-result {
  display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
}
.compare-invite-link {
  display: block; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: 12px; min-width: 0;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.compare-invite-link:hover { text-decoration: underline; }
.compare-copy-btn { width: 100%; font-size: 13px; padding: 8px 12px; }
.compare-invite-msg { font-size: 12px; margin-top: 6px; color: var(--text-muted); }
.compare-invite-msg.ok  { color: #6fcb6f; }
.compare-invite-msg.err { color: var(--love); }
.compare-invite-result[hidden] { display: none; }
.compare-invite-msg[hidden]    { display: none; }
.profile-compare-section[hidden] { display: none; }

/* ── Compare result modal ─────────────────────────────────────────────── */
.compare-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
}
.compare-modal-overlay[hidden] { display: none; }
.compare-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
}
.compare-modal-box {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 520px;
  max-height: 85vh; display: flex; flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}
.compare-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.compare-modal-title { font-size: 16px; font-weight: 700; }
.compare-modal-body  { flex: 1; overflow-y: auto; padding: 16px 20px 20px; }
.compare-match-block { text-align: center; padding: 12px 0 20px; }
.compare-match-pct   { font-size: 52px; font-weight: 800; color: var(--accent); line-height: 1; }
.compare-match-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.compare-section       { margin-bottom: 16px; }
.compare-section-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.compare-film-list     { display: flex; flex-direction: column; gap: 4px; }
.compare-film-row      { font-size: 13px; color: var(--text-muted); }
.compare-film-row strong { color: var(--text); font-weight: 600; }
.compare-registration-hint {
  font-size: 12px;
  color: #c8a84b;
  background: #2a2200;
  border: 1px solid rgba(232, 196, 107, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}
.compare-registration-link {
  color: #e8c46b;
  font-weight: 600;
  text-decoration: underline;
}
.compare-registration-link:hover { color: #f2d993; }
.compare-together-btn { margin-top: 8px; font-size: 14px; }
.compare-refresh-btn  { margin-top: 8px; font-size: 13px; }

@media (min-width: 600px) {
  .compare-modal-box {
    border-radius: 16px;
    margin-bottom: 40px;
    max-height: 80vh;
  }
}

@media (max-width: 767px) {
  .screen.active {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
  body.nav-visible .screen.active {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}
