/* ============================================================
   Cinerd — tema escuro
   ============================================================ */
:root {
    /* Acento */
    --primary: #f01b2d;
    --accent-soft: rgba(240, 27, 45, 0.12);
    --accent-border: rgba(240, 27, 45, 0.38);

    /* Superfícies / texto */
    --dark: #09090b;
    --light: #f7f7f8;
    --gray: #a1a1aa;
    --card-bg: #141416;
    --card-hover: #1b1b1f;
    --input-bg: #1b1b1f;
    --input-border: rgba(255, 255, 255, 0.11);
    --border-strong: rgba(255, 255, 255, 0.19);
    --dropdown-bg: #18181b;
    --dropdown-hover: #25252a;

    /* Forma */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.5);

    /* Escala tipográfica / ritmo / movimento (adicionados no redesign) */
    --primary-hover: #ff3d4d;
    --card-border: rgba(255, 255, 255, 0.07);
    --ring: 0 0 0 3px rgba(229, 9, 20, 0.32);
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.22);
    --sh-2: 0 8px 24px rgba(0, 0, 0, 0.4);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur: 0.18s;
    --maxw: 1200px;
    --fs-xs: 0.72rem;
    --fs-sm: 0.85rem;
    --fs-md: 0.95rem;
    --fs-lg: 1.12rem;
    --fs-xl: 1.4rem;
    --touch-target: 44px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { overflow-x: hidden; }
button { touch-action: manipulation; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 3000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--light);
    color: var(--dark);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(calc(-100% - 16px));
    transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

::selection { background: rgba(229, 9, 20, 0.32); color: #fff; }

:where(button, a, input, select, textarea):focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    background: var(--dark);
    background-image:
        radial-gradient(1100px 500px at 50% -10%, rgba(229, 9, 20, 0.10), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(74, 144, 226, 0.05), transparent 55%);
    background-repeat: no-repeat;
    color: var(--light);
    min-height: 100vh;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ==============================
   CABEÇALHO + MARCA
   ============================== */
.header {
    text-align: center;
    margin-bottom: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.brand a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: linear-gradient(100deg, #ffffff 24%, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-mark {
    -webkit-text-fill-color: initial;
    font-size: 0.86em;
    filter: drop-shadow(0 4px 10px rgba(229, 9, 20, 0.35));
}

.tagline {
    font-size: var(--fs-lg);
    color: var(--gray);
    max-width: 540px;
    margin: 0 auto;
}

/* ==============================
   NAVEGAÇÃO (Buscar + grupos)
   ============================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 28px;
    padding: 12px 8px;
    background: rgba(13, 13, 15, 0.78);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--input-border);
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
        background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-item:hover { color: var(--light); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.03); }
.nav-item:active { transform: translateY(1px); }
.nav-ic { font-size: 1rem; line-height: 1; }

.nav-primary.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(229, 9, 20, 0.32);
}
.nav-trigger.is-active {
    background: var(--accent-soft);
    border-color: var(--primary);
    color: #fff;
}
.nav-caret { font-size: 0.7rem; color: var(--gray); transition: transform var(--dur) var(--ease); }
.nav-trigger[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-trigger.is-active .nav-caret { color: inherit; }

.nav-group { position: relative; }

.nav-menu {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    min-width: 264px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 950;
    animation: navpop 0.16s var(--ease);
}
.nav-menu[hidden] { display: none; }
.nav-menu.flip { left: auto; right: 0; }

@keyframes navpop {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.nav-sub {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 10px 11px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--light);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}
.nav-sub:hover { background: var(--dropdown-hover); }
.nav-sub > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 600;
    font-size: var(--fs-sm);
    line-height: 1.3;
}
.nav-sub small { color: var(--gray); font-weight: 500; font-size: var(--fs-xs); }
.nav-sub.is-active { background: var(--accent-soft); }
.nav-sub.is-active > span { color: #fff; }

.nav-help {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--input-border);
    background: transparent;
    color: var(--gray);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-help:hover { color: #fff; border-color: var(--primary); background: var(--accent-soft); }

.nav-item.locked { opacity: 0.6; }
.nav-item.locked::after { content: " 🔒"; font-size: 0.8em; }
.nav-sub.locked { opacity: 0.6; }
.nav-sub.locked::after { content: "🔒"; font-size: 0.8em; margin-left: auto; align-self: center; }

@media (max-width: 560px) {
    .nav { gap: 6px; padding: 10px 6px; }
    .nav-item { padding: 8px 13px; }
    .nav-group { position: static; }
    .nav-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: auto;
        min-width: 0;
        padding: 8px;
    }
    .nav-menu::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: -1;
    }
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .25s ease; }

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* ==============================
   PAINEL DE CONTROLES
   ============================== */
.form-section {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 120px),
        var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: 1px solid var(--card-border);
    box-shadow: var(--sh-1);
}

.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.people-row { margin-top: 12px; }

/* ==============================
   CAMPOS
   ============================== */
.text-input,
.mini-input,
.filters select {
    background: var(--input-bg);
    color: var(--light);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.text-input {
    flex: 1;
    min-width: 240px;
    padding: 13px 15px;
}

.text-input::placeholder { color: #92929b; }

.text-input:focus,
.mini-input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray);
}

.filters select,
.mini-input {
    padding: 9px 11px;
}

.mini-input { width: 120px; }

.file-input {
    flex: 1;
    min-width: 240px;
    padding: 12px 14px;
    background: var(--input-bg);
    color: var(--gray);
    border: 1px dashed var(--input-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

/* ==============================
   BOTÕES
   ============================== */
.btn-primary {
    padding: 13px 24px;
    background: linear-gradient(180deg, var(--primary-hover), var(--primary));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.3);
    transition: filter var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(229, 9, 20, 0.42); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
    background: var(--input-bg);
    color: #5b5b63;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

.search-row .btn-primary { align-self: stretch; }

.btn-secondary {
    display: block;
    margin: 0 auto 18px;
    padding: 9px 20px;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    transition: color .18s ease, border-color .18s ease;
}

.btn-secondary:hover { color: var(--light); border-color: var(--border-strong); }

/* ==============================
   AUTOCOMPLETE
   ============================== */
.autocomplete-wrap { position: relative; flex: 1; min-width: 240px; }
.autocomplete-wrap > .text-input { width: 100%; }

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--input-border);
    font-size: 0.92rem;
    transition: background .15s ease;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--dropdown-hover); }
.autocomplete-item small { color: var(--gray); font-size: 0.76rem; white-space: nowrap; }

/* ==============================
   TEXTOS AUXILIARES
   ============================== */
.hint {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.92rem;
}
.hint code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--light);
    font-size: 0.86em;
}

.status {
    text-align: center;
    color: var(--gray);
    margin: 18px 0;
    min-height: 1.2em;
    font-size: 0.9rem;
}

/* ==============================
   GRADE DE FILMES
   ============================== */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
    padding: 8px 0;
}

.movie-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--sh-1);
    transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
/* Grades longas (ex.: 100 essenciais): não pinta o que está fora da tela. */
.movies-grid > .movie-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-border);
    box-shadow: var(--sh-2), 0 0 0 1px var(--accent-border);
}

.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #222226, #131316);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s var(--ease);
}
.movie-card:hover .poster-wrap img { transform: scale(1.045); }
.poster-fallback {
    display: none;
    padding: 16px;
    text-align: center;
    color: var(--gray);
    font-weight: 600;
    font-size: 0.9rem;
}
.poster-wrap.no-poster .poster-fallback { display: block; }

.movie-title {
    padding: 14px 16px 2px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--light);
    line-height: 1.3;
}

.movie-rating {
    padding: 4px 16px 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e9c46a;
}
.rating-src {
    margin-left: 5px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--gray);
    vertical-align: middle;
}
.rating-critic {
    margin-left: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #d68a3c;
    vertical-align: middle;
}

.movie-overview {
    padding: 8px 16px 16px;
    font-size: 0.84rem;
    color: var(--gray);
    line-height: 1.5;
    max-height: 96px;
    overflow: hidden;
}

/* ==============================
   "POR QUÊ" / EXPLICAÇÃO DO RANKING
   ============================== */
.movie-why { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 16px 0; }
.movie-why .chip {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.72rem;
    color: #f3c2c4;
}

.explain {
    padding: 12px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.explain-rel { display: flex; align-items: center; gap: 8px; }
.explain-rel-track {
    flex: 1;
    height: 6px;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
}
.explain-rel-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5a623, var(--primary));
    border-radius: 4px;
}
.explain-rel-fill.conf-high { background: linear-gradient(90deg, #2e7d32, #43d35a); }
.explain-rel-fill.conf-mid  { background: linear-gradient(90deg, #b8860b, #f5a623); }
.explain-rel-fill.conf-low  { background: linear-gradient(90deg, #7a2520, #c0392b); }
.explain-rel-num {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
}

.sig-bar {
    display: flex;
    height: 6px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--input-bg);
}
.sig-bar .seg { height: 100%; }
.seg.sig-tema { background: #4a90e2; }
.seg.sig-sinopse { background: #50c878; }
.seg.sig-termos { background: #b06ee6; }
.seg.sig-nome { background: #f5a623; }
.sig-legend { font-size: 0.7rem; color: var(--gray); line-height: 1.3; }

.explain-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--gray);
    border: 1px solid var(--input-border);
    white-space: nowrap;
}
.chip-kw { border-color: #4a90e2; color: #aacdf5; }
.chip-title { border-color: #b06ee6; color: #d9bdf3; }
.chip-person { border-color: var(--accent-border); color: #f5b5b8; font-weight: 600; }

/* ==============================
   CARD DE PERFIL DE GOSTO
   ============================== */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 6px 0 22px;
}
.profile-head {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 12px;
}
.profile-head small { display: block; font-weight: 500; color: var(--gray); font-size: 0.8rem; margin-top: 3px; }
.profile-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 7px 0; }
.profile-label {
    min-width: 78px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-row .chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 0.82rem;
    color: #e8e8e8;
}
.profile-row .chip-interest {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: #f3c2c4;
    font-weight: 600;
}

/* ==============================
   SELEÇÃO VISUAL DE FAVORITOS
   ============================== */
.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 14px;
    margin: 6px 0 16px;
}
.pick-card { cursor: pointer; }
.pick-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #131316;
    border: 1.5px solid transparent;
    transition: border-color .15s ease, transform .15s ease;
}
.pick-card:hover .pick-poster { transform: translateY(-3px); border-color: var(--border-strong); }
.pick-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-check {
    position: absolute; top: 6px; right: 6px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: none; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.pick-card.selected .pick-poster { border-color: var(--primary); }
.pick-card.selected .pick-poster::after {
    content: ''; position: absolute; inset: 0; background: rgba(229, 9, 20, .2);
}
.pick-card.selected .pick-check { display: flex; }
.pick-similar {
    position: absolute; left: 6px; right: 6px; bottom: 6px;
    background: rgba(13, 13, 15, 0.86);
    border: 1px solid var(--accent-border);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    font-size: 0.7rem; font-weight: 600;
    cursor: pointer;
    opacity: 0; transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, background .15s ease;
    z-index: 2;
}
.pick-card:hover .pick-similar { opacity: 1; transform: translateY(0); }
.pick-similar:hover { background: var(--primary); border-color: var(--primary); }
/* Sem hover (toque): botão sempre visível, discreto. */
@media (hover: none) {
    .pick-similar { opacity: 1; transform: none; }
}
.pick-title {
    font-size: 0.74rem; color: var(--gray); margin-top: 6px;
    line-height: 1.2; text-align: center;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.picked-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.picked-chip {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px; padding: 4px 11px; font-size: 0.82rem;
    color: #f3c2c4; cursor: pointer; user-select: none;
    transition: background .15s ease;
}
.picked-chip:hover { background: rgba(229, 9, 20, 0.22); }
.picked-chip b { color: #fff; margin-left: 3px; }

/* ==============================
   RESPONSIVO
   ============================== */
@media (max-width: 768px) {
    .container { padding: 36px 16px 60px; }
    .header h1 { font-size: 2.1rem; }
    .form-section { padding: 18px; }
    .search-row .btn-primary { width: 100%; }
    .movies-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
    .mini-input { width: 100%; }
}

@media (max-width: 480px) {
    .header h1 { font-size: 1.8rem; }
    .movies-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pick-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}

/* ==============================
   PARECIDOS — botão no card + modal
   ============================== */
.card-actions { padding: 10px 16px 16px; }
.btn-similar {
    width: 100%;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: #f3c2c4;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-similar:hover {
    background: rgba(229, 9, 20, 0.2);
    border-color: var(--primary);
    color: #fff;
}

.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    overflow-y: auto;
}
.modal {
    position: relative;
    width: 100%;
    max-width: 1040px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px 28px 32px;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease;
}
.modal-close:hover { color: var(--light); }
.modal-head { margin-bottom: 8px; padding-right: 32px; }
.modal-head h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 4px;
}

@media (max-width: 480px) {
    .modal { padding: 22px 16px 26px; }
    .modal-overlay { padding: 2vh 10px; }
}

/* ==============================
   STREAMING — barra, chips e logos no card
   ============================== */
.streaming-bar {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 22px;
}
.streaming-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.streaming-summary {
    background: transparent;
    border: none;
    color: var(--light);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.streaming-count {
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.streaming-caret { color: var(--gray); font-size: 0.8rem; }
.streaming-only {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gray);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.streaming-only input { accent-color: var(--primary); cursor: pointer; }

.streaming-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.stream-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    padding: 5px 12px 5px 6px;
    color: var(--gray);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.stream-chip img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; display: block; }
.stream-chip:hover { color: var(--light); border-color: var(--border-strong); }
.stream-chip.on {
    background: var(--accent-soft);
    border-color: var(--primary);
    color: #fff;
}

/* Faixa de logos dentro do card de resultado */
.stream-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 0;
}
.stream-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    opacity: 0.45;
    filter: grayscale(0.6);
    transition: opacity .15s ease, filter .15s ease;
}
.stream-logo.mine {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 2px var(--primary);
}
.stream-name {
    font-size: 0.7rem;
    color: var(--gray);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 2px 6px;
}
.stream-name.mine { color: #fff; border-color: var(--primary); }

/* ==============================
   FICHA DO FILME (modal)
   ============================== */
.movie-card .poster-wrap,
.movie-card .movie-title { cursor: pointer; }

.movie-sheet { padding: 0 0 32px; overflow-x: hidden; }
.movie-sheet .modal-close {
    z-index: 5;
    background: rgba(13, 13, 15, 0.6);
    border-radius: 50%;
    width: 34px;
    height: 34px;
}
.sheet-loading { padding: 48px 28px; }

.sheet-hero {
    height: 250px;
    background-size: cover;
    background-position: center 20%;
    -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
    mask-image: linear-gradient(to bottom, #000 35%, transparent);
}
.sheet-main {
    display: flex;
    gap: 24px;
    padding: 28px 28px 0;
    align-items: flex-end;
}
.sheet-main.has-hero { margin-top: -150px; padding-top: 0; }
.sheet-poster {
    width: 168px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.sheet-info { flex: 1; min-width: 0; position: relative; z-index: 2; }
/* Sobre o backdrop, o texto precisa de sombra para manter a leitura. */
.sheet-main.has-hero .sheet-info { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }
.sheet-info h2 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.sheet-year { color: var(--gray); font-weight: 500; }
.sheet-orig { color: var(--gray); font-size: 0.88rem; margin-top: 2px; }
.sheet-tagline { color: var(--gray); font-style: italic; margin-top: 6px; }
.sheet-meta { color: #e9c46a; font-weight: 600; font-size: 0.9rem; margin-top: 10px; }
.sheet-genres { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.sheet-director,
.sheet-collection { margin-top: 10px; font-size: 0.92rem; color: var(--light); }
.sheet-actions { margin-top: 14px; }
.sheet-actions .btn-similar { width: auto; padding: 8px 18px; }

.sheet-section { padding: 24px 28px 0; }
.sheet-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
    margin-bottom: 10px;
}
.sheet-section h3 small {
    color: var(--gray);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}
.sheet-overview { color: var(--light); line-height: 1.65; font-size: 0.95rem; }
.sheet-empty { color: var(--gray); font-size: 0.9rem; }

.sheet-prov-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 8px 0;
    flex-wrap: wrap;
}
.sheet-prov-label { min-width: 185px; font-size: 0.8rem; font-weight: 600; color: var(--gray); }
.sheet-prov-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-provider {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    padding: 4px 12px 4px 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--light);
}
.sheet-provider img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; display: block; }
.sheet-provider.mine { border-color: var(--primary); background: var(--accent-soft); }
.sheet-source {
    display: inline-block;
    margin-top: 10px;
    color: var(--gray);
    font-size: 0.74rem;
    text-decoration: none;
}
.sheet-source:hover { color: var(--light); text-decoration: underline; }

.cast-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.cast-card { width: 96px; flex-shrink: 0; }
.cast-card img,
.cast-photo-fallback {
    width: 96px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    display: block;
}
.cast-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1.6rem;
    font-weight: 700;
}
.cast-name { font-size: 0.78rem; font-weight: 600; margin-top: 6px; line-height: 1.25; }
.cast-role { font-size: 0.72rem; color: var(--gray); line-height: 1.25; }

/* Botão "Ficha" nos cards de seleção visual (acima do "Parecidos") */
.pick-info {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 40px;
    background: rgba(13, 13, 15, 0.86);
    border: 1px solid var(--border-strong);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, background .15s ease;
    z-index: 2;
}
.pick-card:hover .pick-info { opacity: 1; transform: translateY(0); }
.pick-info:hover { background: var(--dropdown-hover); }
@media (hover: none) {
    .pick-info { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    .sheet-hero { height: 190px; }
    .sheet-main { flex-direction: column; align-items: flex-start; gap: 14px; }
    .sheet-main.has-hero { margin-top: -130px; }
    .sheet-poster { width: 128px; }
    .sheet-prov-label { min-width: 0; width: 100%; }
    .movie-sheet { padding-bottom: 26px; }
    .sheet-main, .sheet-section { padding-left: 16px; padding-right: 16px; }
}

/* ==============================
   MINHA AVALIAÇÃO (estrelas + ❤ + resenha) e DIÁRIO
   ============================== */
.stars {
    position: relative;
    display: inline-block;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.stars .stars-bg {
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    letter-spacing: 2px;
}
.stars .stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    overflow: hidden;
    color: #f5c518;
    white-space: nowrap;
    letter-spacing: 2px;
    pointer-events: none;
}
.stars-small { font-size: 1rem; cursor: default; }

.rate-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rate-value {
    min-width: 34px;
    font-weight: 700;
    color: #f5c518;
    font-size: 1.05rem;
}
.rate-heart {
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--gray);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.rate-heart:hover { color: #ff5c74; border-color: #ff5c74; }
.rate-heart.on {
    color: #ff5c74;
    border-color: #ff5c74;
    background: rgba(255, 92, 116, 0.12);
}
.rate-date-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 0.85rem;
}
.rate-date { color-scheme: dark; width: 150px; }
.rate-review {
    width: 100%;
    margin-top: 12px;
    background: var(--input-bg);
    color: var(--light);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
    min-height: 70px;
}
.rate-review::placeholder { color: #92929b; }
.rate-review:focus {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.rate-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.rate-actions .btn-primary { padding: 10px 18px; font-size: 0.88rem; }
.rate-actions .btn-secondary { margin: 0; }
.rate-status { color: var(--gray); font-size: 0.85rem; }

.watched-controls { align-items: center; justify-content: space-between; }
.watched-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--gray); font-size: 0.85rem; }
.watched-sort select {
    padding: 9px 11px;
    background: var(--input-bg);
    color: var(--light);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 8px 0 24px;
}
.diary-card {
    display: flex;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}
.diary-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.diary-poster {
    width: 72px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: #131316;
}
.diary-body { min-width: 0; }
.diary-title { font-weight: 600; line-height: 1.25; }
.diary-stars { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.diary-heart { color: #ff5c74; font-size: 0.95rem; }
.diary-norating { color: var(--gray); font-size: 0.78rem; }
.diary-date { color: var(--gray); font-size: 0.78rem; margin-top: 4px; }
.diary-review {
    color: var(--gray);
    font-size: 0.84rem;
    font-style: italic;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 480px) {
    .diary-grid { grid-template-columns: 1fr; }
}

/* ==============================
   LISTAS (ordem de assistir)
   ============================== */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 8px 0 24px;
}
.list-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}
.list-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.list-collage {
    display: flex;
    flex-shrink: 0;
    width: 96px;
    height: 66px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--input-bg);
    align-items: center;
    justify-content: center;
}
.list-collage img {
    width: 25%;
    flex: 1;
    height: 100%;
    object-fit: cover;
    display: block;
}
.list-collage-empty { font-size: 1.5rem; opacity: 0.5; }
.list-card-body { min-width: 0; padding-right: 22px; }
.list-card-name {
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.list-card-meta { color: var(--gray); font-size: 0.78rem; margin-top: 4px; }
.list-del {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease;
}
.list-del:hover { color: var(--primary); }

.list-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.list-head h2 { font-size: 1.3rem; font-weight: 700; }
.list-head .btn-secondary { margin: 0; }

.list-items { display: flex; flex-direction: column; gap: 8px; padding-bottom: 30px; }
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px 8px 10px;
    cursor: grab;
    transition: border-color .15s ease, opacity .15s ease;
}
.list-item:hover { border-color: var(--border-strong); }
.list-item.dragging { opacity: 0.45; border-color: var(--primary); cursor: grabbing; }
.list-pos {
    min-width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}
.list-item-poster {
    width: 38px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #131316;
    cursor: pointer;
}
.list-item-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.94rem;
    line-height: 1.3;
    cursor: pointer;
}
.list-item-title:hover { color: #fff; text-decoration: underline; }
.list-item-actions { display: flex; align-items: center; gap: 4px; }
.list-move,
.list-item-del {
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--gray);
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.list-move:hover { color: var(--light); border-color: var(--border-strong); }
.list-item-del { font-size: 1.05rem; }
.list-item-del:hover { color: var(--primary); border-color: var(--primary); }

/* ==============================
   VERSÕES DO FILME (cortes + melhor versão)
   ============================== */
.version-card {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.version-card.best {
    border-color: rgba(245, 197, 24, 0.55);
    background: rgba(245, 197, 24, 0.06);
}
.version-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.version-name { font-weight: 600; font-size: 0.95rem; }
.version-runtime { color: var(--gray); font-size: 0.8rem; }
.version-best {
    color: #f5c518;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid rgba(245, 197, 24, 0.55);
    border-radius: 999px;
    padding: 2px 9px;
}
.version-actions { margin-left: auto; display: flex; gap: 4px; }
.v-edit, .v-del {
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--gray);
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.v-edit:hover { color: var(--light); border-color: var(--border-strong); }
.v-del:hover { color: var(--primary); border-color: var(--primary); }
.version-notes {
    color: var(--gray);
    font-size: 0.86rem;
    line-height: 1.5;
    margin-top: 7px;
}
.version-form { margin-top: 10px; }
.version-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.version-form-row .text-input { flex: 1; }
.version-form-row .mini-input { width: 90px; }
.version-form .rate-review { min-height: 52px; }
.v-best-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #f5c518;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.v-best-label input { accent-color: #f5c518; cursor: pointer; }
.version-add { display: inline-block; margin: 10px 0 0; }
.v-cancel { margin: 0; }

/* ==============================
   ESSENCIAIS (gêneros / estilos / diretores)
   ============================== */
.explore-mode { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.explore-mode-btn {
    padding: 8px 18px;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.explore-mode-btn:hover { color: var(--light); border-color: var(--border-strong); }
.explore-mode-btn.active {
    background: var(--accent-soft);
    border-color: var(--primary);
    color: #fff;
}
.explore-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.explore-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 999px;
    padding: 6px 13px;
    color: var(--light);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.explore-chip small { color: var(--gray); font-size: 0.72rem; font-weight: 500; }
.explore-chip:hover { border-color: var(--border-strong); }
.explore-chip.on { background: var(--accent-soft); border-color: var(--primary); }
.explore-director-wrap { margin-top: 12px; }
.explore-actions { text-align: center; margin-top: 4px; }
.explore-actions .btn-secondary { display: inline-block; margin: 0; }

.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(13, 13, 15, 0.85);
    border: 1px solid var(--accent-border);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

/* Selo de "está no cânone" (Sight & Sound + clássicos), no canto oposto ao rank. */
.canon-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(13, 13, 15, 0.85);
    border: 1px solid var(--accent-border);
    font-size: 0.8rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 999px;
    cursor: help;
}

.sheet-list-wrap { position: relative; display: inline-block; }
.sheet-list-menu {
    display: none;
    min-width: 240px;
    max-height: 240px;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
}

/* ── Rodapé: atribuição TMDB (obrigatória p/ uso da API) + créditos de dados ── */
.site-footer {
    margin-top: 48px;
    padding: 24px 4px 12px;
    border-top: 1px solid var(--input-border);
    color: var(--gray);
    font-size: 0.82rem;
    line-height: 1.5;
}
.site-footer p { margin: 6px 0; }
.site-footer a { color: var(--gray); text-decoration: underline; }
.site-footer a:hover { color: var(--light); }
.tmdb-attribution { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tmdb-logo { height: 20px; width: auto; display: block; border-radius: 4px; }

/* ─────────────────────────  Autenticação  ───────────────────────── */
.auth-bar { position: absolute; top: 14px; right: 4px; display: flex; align-items: center;
    gap: 10px; font-size: 0.82rem; color: var(--gray); }
.header { position: relative; }
.auth-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-link { background: none; border: 1px solid var(--input-border); color: var(--gray);
    padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 0.8rem; }
.auth-link:hover { color: var(--light); border-color: var(--border-strong); }
.auth-toast { background: var(--accent-soft); border: 1px solid var(--accent-border);
    color: var(--light); padding: 4px 10px; border-radius: 999px; }
.tab-btn.locked { opacity: 0.55; }
.tab-btn.locked::after { content: " 🔒"; font-size: 0.85em; }

.auth-modal { max-width: 380px; }
.auth-modal h2 { margin: 0 0 14px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.auth-tabs button { flex: 1; background: var(--input-bg); border: 1px solid var(--input-border);
    color: var(--gray); padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; }
.auth-tabs button.active { color: var(--light); border-color: var(--accent-border); background: var(--accent-soft); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input { background: var(--input-bg); border: 1px solid var(--input-border);
    color: var(--light); padding: 10px 12px; border-radius: 8px; font-size: 0.95rem; }
.auth-form button[type="submit"] { background: var(--primary); border: none; color: #fff;
    padding: 11px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.auth-form button[type="submit"]:hover { filter: brightness(1.08); }
.auth-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; color: var(--gray); line-height: 1.4; }
.auth-consent input { width: auto; margin-top: 2px; padding: 0; flex: none; accent-color: var(--primary); }
.auth-consent a { color: var(--primary-hover); }
.auth-msg { margin-top: 12px; font-size: 0.85rem; min-height: 1.2em; }
.auth-msg.err { color: #f5b5b8; }
.auth-msg.ok { color: #9fe0b0; }

/* ============================================================
   REDESIGN — skeleton loaders, tour (coach-marks), acabamentos
   ============================================================ */

/* --- Skeleton / shimmer --------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #1a1a1e;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: shimmer 1.25s var(--ease) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .skeleton::after { animation: none; }
}

.skel-card { pointer-events: none; }
.skel-card .poster-wrap { border-radius: 0; }
.skel-line {
    height: 12px;
    margin: 12px 16px 0;
    border-radius: 6px;
}
.skel-line:last-child { margin-bottom: 18px; }

/* --- Acabamentos gerais ------------------------------------------ */
.status { min-height: 1.4em; }
.hint { max-width: 68ch; }

/* Barra de rolagem discreta (WebKit) */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

@media (max-width: 768px) {
    .container { padding: 24px 14px 64px; }
    .header { margin-bottom: 16px; }
    .nav { margin-bottom: 22px; }
}

/* ============================================================
   Aba Engenharia — vitrine do motor de recuperação
   ============================================================ */
#tab-engenharia h2 { font-size: var(--fs-xl); margin-bottom: 8px; }
#tab-engenharia h3 {
    font-size: var(--fs-lg); margin-bottom: 6px;
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
#tab-engenharia h4 { font-size: var(--fs-md); margin-bottom: 4px; color: var(--light); }
.eng-prov { font-size: var(--fs-xs); color: var(--gray); font-weight: 400; }
.eng-prov em { color: var(--primary-hover); font-style: normal; }
.eng-reload {
    font: inherit; font-size: var(--fs-xs); color: var(--gray);
    background: none; border: 1px solid var(--input-border); border-radius: 999px;
    padding: 2px 10px; cursor: pointer;
}
.eng-reload:hover { color: var(--light); border-color: var(--border-strong); }
.eng-take { margin-top: 10px; color: var(--light); }

.eng-scroll { overflow-x: auto; margin-top: 10px; border-radius: var(--radius-sm); }
.eng-table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); min-width: 520px; }
.eng-table th, .eng-table td {
    text-align: right; padding: 9px 14px; border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
.eng-table th:first-child, .eng-table td:first-child { text-align: left; white-space: normal; }
.eng-table thead th {
    color: var(--gray); font-weight: 600; font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: 0.04em; border-bottom-color: var(--border-strong);
}
.eng-table tbody tr:hover { background: var(--card-hover); }
.eng-table tr.eng-hot { background: var(--accent-soft); }
.eng-table tr.eng-hot td { border-bottom-color: var(--accent-border); }
.eng-table tr.eng-hot td strong { color: var(--primary-hover); }
.eng-table tr.eng-dim td { color: var(--gray); }
.eng-table td.eng-empty { text-align: left; white-space: normal; color: var(--gray); }
.eng-tag {
    font-size: var(--fs-xs); background: var(--accent-soft); color: var(--primary-hover);
    border: 1px solid var(--accent-border); border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}

.eng-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.eng-fact {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--input-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); padding: 8px 12px; min-width: 140px;
}
.eng-fact span { font-size: var(--fs-xs); color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; }
.eng-fact strong { font-size: var(--fs-sm); color: var(--light); }

.eng-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.eng-card {
    background: var(--input-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); padding: 14px 16px;
}
.eng-card p { font-size: var(--fs-sm); color: var(--gray); line-height: 1.5; }

.eng-links #engLinks { font-size: var(--fs-sm); line-height: 2; }
.eng-links a { color: var(--primary-hover); }

.eng-link { color: var(--primary-hover); white-space: nowrap; font-weight: 600; }

/* diagrama do pipeline (SVG inline, tema escuro) */
.eng-diagram { margin-top: 14px; }
.eng-svg { width: 100%; max-width: 760px; height: auto; }
.eng-svg-stroke { stroke: var(--border-strong); }
.eng-svg-fill { fill: var(--border-strong); }
.eng-svg-node rect { fill: var(--input-bg); stroke: var(--card-border); stroke-width: 1; }
.eng-svg-node text { fill: var(--light); font-size: 12px; text-anchor: middle; }
.eng-svg-node text.eng-svg-sub { fill: var(--gray); font-size: 10px; }
.eng-svg-node rect.eng-svg-hot { fill: var(--accent-soft); stroke: var(--accent-border); }
.eng-svg-ghost { fill: none; }
.eng-svg-ghost path { fill: none; stroke: var(--input-border); }
.eng-svg-ghost rect { fill: none; stroke: var(--input-border); stroke-dasharray: 4 3; }
.eng-svg-ghost text { fill: var(--gray); font-size: 10px; text-anchor: middle; }

/* ============================================================
   UX RESPONSIVA — alvos de toque, foco, modais e telas estreitas
   Contrato e decisões: docs/UX_NIELSEN.md
   ============================================================ */

/* Os controles principais seguem o alvo mínimo de 44 × 44 px (WCAG 2.2). */
.nav-item,
.nav-sub,
.nav-help,
.btn-primary,
.btn-secondary,
.btn-similar,
.streaming-summary,
.stream-chip,
.explore-mode-btn,
.explore-chip,
.auth-link,
.auth-tabs button,
.auth-form button[type="submit"],
.eng-reload,
.list-del,
.list-move,
.list-item-del,
.v-edit,
.v-del,
.version-add {
    min-height: var(--touch-target);
}

.nav-help,
.modal-close,
.rate-heart,
.list-del,
.list-move,
.list-item-del,
.v-edit,
.v-del {
    min-width: var(--touch-target);
}

.text-input,
.mini-input,
.filters select,
.file-input,
.auth-form input,
.watched-sort select {
    min-height: 48px;
}

.field-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--gray);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.field-label input { width: 100%; }

/* Cartões acionáveis continuam com aparência editorial e ganham semântica real. */
button.poster-wrap,
button.movie-title {
    width: 100%;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
button.poster-wrap { padding: 0; }
button.movie-title { display: block; background: transparent; }
button.poster-wrap:focus-visible,
button.movie-title:focus-visible { box-shadow: inset var(--ring); }

.picked-chip {
    min-height: var(--touch-target);
    font: inherit;
}

.auth-consent input { min-height: 0; }

button.autocomplete-item {
    width: 100%;
    background: transparent;
    color: var(--light);
    border: 0;
    border-bottom: 1px solid var(--input-border);
    font-family: inherit;
    text-align: left;
}

/* O fechar permanece disponível durante a rolagem do conteúdo do modal. */
.modal-overlay {
    overscroll-behavior: contain;
    padding-top: max(5vh, env(safe-area-inset-top));
    padding-bottom: max(5vh, env(safe-area-inset-bottom));
}
.modal {
    max-height: 90dvh;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.modal-close {
    position: sticky;
    top: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    margin: -10px -10px -34px auto;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: rgba(13, 13, 15, 0.9);
    color: var(--light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.movie-sheet .modal-close {
    width: var(--touch-target);
    height: var(--touch-target);
    margin: 12px 12px -56px auto;
}
.modal-head,
.auth-modal > h2 { padding-right: 50px; }

.movie-overview {
    max-height: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

@media (hover: none) {
    .movie-card:hover,
    .diary-card:hover,
    .list-card:hover,
    .pick-card:hover .pick-poster {
        transform: none;
    }
}

@media (max-width: 768px) {
    body { min-height: 100dvh; }
    .container {
        width: 100%;
        padding:
            max(20px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(56px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
    }

    .header { display: flex; flex-direction: column; align-items: center; }
    .auth-bar {
        position: static;
        order: -1;
        width: 100%;
        min-height: var(--touch-target);
        justify-content: flex-end;
        margin: -6px 0 8px;
    }
    .auth-email { max-width: min(48vw, 220px); }
    .tagline { font-size: 1rem; line-height: 1.45; }

    /* Uma faixa horizontal preserva o conteúdo e evita 2–3 linhas sobrepostas. */
    .nav {
        top: env(safe-area-inset-top);
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
        margin-right: calc(-1 * max(14px, env(safe-area-inset-right)));
        margin-left: calc(-1 * max(14px, env(safe-area-inset-left)));
        padding: 8px max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
        background: rgba(13, 13, 15, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        scroll-snap-type: x proximity;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-item,
    .nav-group,
    .nav-help { flex: 0 0 auto; scroll-snap-align: start; }
    .nav-item { padding: 9px 14px; }
    .nav-menu {
        max-height: min(70dvh, 480px);
        overflow-y: auto;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        border-radius: var(--radius-lg);
    }
    .nav-menu.nav-menu-mobile {
        position: fixed;
        z-index: 1200;
        isolation: isolate;
        top: auto;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        width: auto;
        min-width: 0;
        background: var(--dropdown-bg);
        box-shadow: var(--shadow-lg);
    }
    .nav-menu.nav-menu-mobile::before { background: rgba(0, 0, 0, 0.68); }
    .nav-sub { padding: 12px; }

    .form-section { margin-bottom: 22px; padding: 18px 16px; }
    .search-row { flex-direction: column; }
    .search-row > *,
    .autocomplete-wrap,
    .text-input,
    .file-input { width: 100%; min-width: 0; }
    .search-row .btn-primary { width: 100%; }
.filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .filters label,
    .filters select,
    .filters .mini-input { width: 100%; min-width: 0; }

    /* 16 px evita o zoom automático do Safari ao focar um campo. */
    .text-input,
    .mini-input,
    .filters select,
    .file-input,
    .auth-form input,
    .rate-review,
    .watched-sort select { font-size: 16px; }

    .movies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .movie-title { padding: 12px 12px 2px; font-size: 0.94rem; }
    .movie-rating { padding-right: 12px; padding-left: 12px; }
    .movie-overview { padding: 7px 12px 14px; }
    .movie-why,
    .explain,
    .stream-row { padding-right: 12px; padding-left: 12px; }
    .card-actions { padding: 10px 12px 14px; }
    .btn-similar { padding: 9px 10px; }

    .modal-overlay {
        align-items: flex-end;
        padding: max(8px, env(safe-area-inset-top)) 0 0;
        background: rgba(0, 0, 0, 0.78);
    }
    .modal {
        max-width: none;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        padding: 22px 16px max(26px, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .movie-sheet { padding-bottom: max(26px, env(safe-area-inset-bottom)); }
    .sheet-hero { height: 176px; }
    .sheet-main { gap: 12px; }
    .sheet-main.has-hero { margin-top: -78px; }
    .sheet-poster { width: 112px; }
    .sheet-info h2 { font-size: 1.35rem; }
    .sheet-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
    .sheet-actions .btn-similar,
    .sheet-list-wrap { width: 100%; }
    .sheet-list-wrap > .btn-similar { width: 100%; }
    .sheet-list-menu { right: 0; min-width: 0; }
    .sheet-section { padding-top: 22px; }
    .rate-actions > .btn-primary,
    .rate-actions > .btn-secondary { flex: 1 1 180px; margin: 0; }

    .lists-grid,
    .diary-grid { grid-template-columns: 1fr; }
    .list-card { min-height: 92px; }
    .list-item { gap: 8px; padding-right: 8px; }
    .list-item-actions { gap: 6px; }
    .version-actions { width: 100%; margin-left: 0; justify-content: flex-end; }

}
.filters + .hint { margin-top: 16px; }

@media (max-width: 380px) {
    .filters { grid-template-columns: 1fr; }
    .movie-title { font-size: 0.88rem; }
    .movie-overview { -webkit-line-clamp: 2; }
    .list-collage { width: 76px; }
    .list-pos { min-width: 24px; }
}

/* ============================================================
   VISUAL V2 — direção cinematográfica, hierarquia e descoberta
   ============================================================ */

body {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--dark);
    background-image:
        radial-gradient(900px 420px at 12% -8%, rgba(240, 27, 45, 0.16), transparent 62%),
        radial-gradient(700px 400px at 92% 4%, rgba(109, 79, 255, 0.08), transparent 62%);
}

.container { padding-top: 28px; }

.header {
    position: relative;
    text-align: left;
    margin-bottom: 26px;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1;
}
.brand a {
    gap: 10px;
    background: linear-gradient(115deg, #fff 40%, #ff8791 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(240, 27, 45, 0.3);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(240, 27, 45, 0.2), rgba(240, 27, 45, 0.04));
    box-shadow: 0 10px 30px rgba(240, 27, 45, 0.16);
}
.tagline {
    max-width: 620px;
    margin: 12px 0 0 56px;
    color: #b7b7c0;
    font-size: 0.98rem;
}
.auth-bar {
    position: static;
    order: initial;
    min-height: var(--touch-target);
    justify-content: flex-end;
}
.auth-link {
    padding: 8px 15px;
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.035);
    color: #d4d4d8;
    font-weight: 650;
}
.auth-link:hover { background: rgba(255, 255, 255, 0.07); }

.nav {
    top: 10px;
    justify-content: flex-start;
    margin-bottom: 30px;
    padding: 7px;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    background: rgba(16, 16, 19, 0.78);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}
.nav-item {
    min-height: 42px;
    padding: 8px 14px;
    border-color: transparent;
    color: #adadb7;
}
.nav-item:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.055);
}
.nav-primary.is-active {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 8px 24px rgba(240, 27, 45, 0.27);
}
.nav-trigger.is-active {
    border-color: transparent;
    background: rgba(240, 27, 45, 0.12);
    color: #fff;
}
.nav-help {
    margin-left: auto;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.045);
}
.nav-menu {
    padding: 8px;
    border-color: var(--border-strong);
    background: rgba(24, 24, 27, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.nav-sub { padding: 12px; }
.nav-sub:hover { background: rgba(255, 255, 255, 0.065); }

.form-section {
    border-color: var(--card-border);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 46%), var(--card-bg);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.search-hero {
    position: relative;
    isolation: isolate;
    overflow: visible;
    padding: clamp(24px, 4.5vw, 52px);
    border-radius: 28px;
    background:
        radial-gradient(620px 280px at 100% 0%, rgba(240, 27, 45, 0.12), transparent 70%),
        linear-gradient(145deg, #18181c, #111114 68%);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}
.search-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.025), transparent 35%);
}
.search-intro { max-width: 720px; }
.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: #ff7a85;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.search-intro h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 5.6vw, 3.6rem);
    font-weight: 820;
    letter-spacing: -0.045em;
    line-height: 1.02;
}
.search-intro p {
    max-width: 620px;
    margin-top: 12px;
    color: #b5b5be;
    font-size: clamp(0.96rem, 2vw, 1.08rem);
}
.search-main-row {
    align-items: stretch;
    margin-top: 28px;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 17px;
    background: rgba(5, 5, 7, 0.55);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 16px 38px rgba(0, 0, 0, 0.2);
}
.search-main-row .text-input {
    min-height: 56px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
}
.search-main-row .text-input:focus { box-shadow: none; }
.search-main-row:focus-within {
    border-color: var(--accent-border);
    box-shadow: var(--ring), inset 0 1px rgba(255, 255, 255, 0.025), 0 16px 38px rgba(0, 0, 0, 0.2);
}
.search-main-row .btn-primary {
    min-width: 132px;
    min-height: 56px;
    border-radius: 12px;
}

.text-input,
.mini-input,
.filters select,
.file-input,
.watched-sort select,
.auth-form input,
.rate-review {
    border-color: var(--input-border);
    background: #1b1b1f;
}
.text-input:hover,
.mini-input:hover,
.filters select:hover,
.file-input:hover { border-color: var(--border-strong); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 10px 28px rgba(240, 27, 45, 0.24);
}
.btn-secondary { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.025); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

.status {
    text-align: left;
    color: #b4b4bd;
    font-weight: 550;
}
.status:empty { min-height: 0; margin: 0; }

.movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 20px;
}
.movie-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border-color: var(--card-border);
    border-radius: 18px;
    background: #141416;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
}
.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(240, 27, 45, 0.18);
}
.poster-wrap { background: linear-gradient(145deg, #222228, #101012); }
.movie-title {
    padding: 14px 14px 2px;
    font-size: 0.96rem;
    font-weight: 720;
    letter-spacing: -0.01em;
}
.movie-rating { padding-right: 14px; padding-left: 14px; }
.movie-overview {
    padding-right: 14px;
    padding-left: 14px;
    -webkit-line-clamp: 2;
}
.movie-why,
.explain,
.stream-row { padding-right: 14px; padding-left: 14px; }
.card-actions { margin-top: auto; padding: 10px 14px 14px; }
.btn-similar {
    border-color: rgba(240, 27, 45, 0.27);
    background: rgba(240, 27, 45, 0.08);
    color: #ffc2c7;
}
.rank-badge,
.canon-badge { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.streaming-bar {
    border-color: var(--card-border);
    border-radius: 16px;
    background: rgba(20, 20, 22, 0.72);
}

.modal {
    border-color: var(--border-strong);
    border-radius: 24px;
    background: #141416;
}
.movie-sheet { border-radius: 24px; }
.sheet-hero { height: 300px; }
.sheet-main.has-hero { margin-top: -170px; }
.sheet-info h2 { font-size: clamp(1.65rem, 4vw, 2.4rem); letter-spacing: -0.035em; }
.sheet-section h3 { color: #ff6572; }
.sheet-rating {
    margin: 24px 28px 0;
    padding: 20px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
}

.auth-modal { border-radius: 22px; }
.auth-modal h2 { font-size: 1.55rem; letter-spacing: -0.025em; }
.auth-tabs { padding: 4px; border-radius: 12px; background: #0e0e11; }
.auth-tabs button { border-color: transparent; }

.site-footer {
    color: #85858f;
    border-top-color: var(--card-border);
}

@media (max-width: 768px) {
    .container { padding-top: max(18px, env(safe-area-inset-top)); }
    .header { display: block; margin-bottom: 20px; }
    .header-top { align-items: flex-start; }
    .brand { font-size: 2rem; }
    .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
    .tagline { max-width: 290px; margin: 10px 0 0; font-size: 0.9rem; }
    .auth-bar { width: auto; margin: 0; }
    .auth-link { padding: 7px 12px; font-size: 0.76rem; }

    .nav {
        top: env(safe-area-inset-top);
        margin-bottom: 22px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        background: rgba(9, 9, 11, 0.94);
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    }
    .nav-help { margin-left: 0; }

    .search-hero { padding: 24px 16px 18px; border-radius: 22px; }
    .search-intro h2 { font-size: clamp(2.2rem, 12vw, 3.2rem); }
    .search-intro p { font-size: 0.94rem; }
    .search-main-row {
        gap: 6px;
        margin-top: 22px;
        padding: 5px;
    }
    .search-main-row .text-input { min-height: 52px; }
    .search-main-row .btn-primary { min-width: 0; min-height: 50px; }

    .movies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .movie-card { border-radius: 15px; }
    .movie-title { padding: 12px 12px 2px; font-size: 0.9rem; }
    .movie-overview { -webkit-line-clamp: 2; }

    .modal,
    .movie-sheet { border-radius: 22px 22px 0 0; }
    .sheet-rating { margin: 22px 16px 0; padding: 16px; }
    .sheet-main.has-hero { margin-top: -78px; }
}

@media (max-width: 380px) {
    .header-top { gap: 10px; }
    .brand { font-size: 1.8rem; }
    .brand-mark { width: 36px; height: 36px; }
    .auth-link { max-width: 126px; padding: 6px 10px; line-height: 1.25; }
    .search-hero { padding-right: 14px; padding-left: 14px; }
    .search-intro h2 { font-size: 2.25rem; }
}

/* ============================================================
   UX V3 — auditoria completa dos fluxos e componentes adaptáveis
   ============================================================ */

.results-anchor {
    scroll-margin-top: 96px;
    outline: none;
}

.panel-heading {
    max-width: 720px;
    margin: 8px 0 22px;
}
.panel-heading h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
}
.panel-heading p {
    margin-top: 10px;
    color: #a9a9b3;
    line-height: 1.55;
}

.search-refine-trigger {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--light);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search-refine-trigger:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.045);
}
.refine-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: #ff8791;
    font-size: 1.1rem;
}
.refine-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.refine-copy strong { font-size: 0.9rem; }
.refine-copy small {
    overflow: hidden;
    color: #8d8d97;
    font-size: 0.76rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.refine-count {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}
.refine-count[hidden] { display: none; }
.refine-arrow { color: var(--gray); font-size: 1.5rem; line-height: 1; }

.preference-modal {
    width: min(720px, calc(100vw - 28px));
    max-width: 720px;
    padding: 28px;
}
.preference-head p {
    max-width: 56ch;
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}
.filter-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}
.filter-dialog-grid .field-wide { grid-column: 1 / -1; }
.filter-dialog-grid .field-label,
.filter-dialog-grid .text-input,
.filter-dialog-grid .mini-input,
.filter-dialog-grid select { width: 100%; min-width: 0; }
.filter-dialog-grid select {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--light);
    font: inherit;
}
.filter-help { margin: 18px 0 0; }
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}
.dialog-actions .btn-primary,
.dialog-actions .btn-secondary { min-width: 148px; margin: 0; }

.streaming-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border-color: var(--card-border);
    border-radius: 18px;
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.035), rgba(240, 27, 45, 0.035)), #121215;
}
.streaming-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.streaming-copy .eyebrow { margin: 0; }
.streaming-copy strong { color: #f0f0f2; font-size: 0.96rem; }
.streaming-copy small {
    overflow: hidden;
    color: #8f8f99;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.streaming-actions { display: flex; align-items: center; gap: 14px; }
.streaming-summary {
    min-height: 44px;
    padding: 8px 12px 8px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}
.streaming-only { min-height: 44px; }
.streaming-only input {
    width: 20px;
    height: 20px;
    flex: none;
}
.streaming-only input:disabled + span { opacity: 0.5; }
.streaming-modal { max-width: 640px; }
.streaming-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 22px;
}
.stream-chip {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 8px 12px 8px 8px;
}
.stream-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.footer-action {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--gray);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.footer-action:hover { color: var(--light); }

.guide-modal {
    width: min(560px, calc(100vw - 28px));
    max-width: 560px;
    min-height: 480px;
    padding: 28px;
    overflow: hidden;
}
.guide-progress {
    position: relative;
    height: 4px;
    margin: -4px 52px 28px 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}
.guide-progress::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--guide-progress, 14.28%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #ff7180);
    transition: width 0.2s var(--ease);
}
.guide-visual {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 24px;
    border: 1px solid rgba(240, 27, 45, 0.24);
    border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 45%), var(--accent-soft);
    box-shadow: 0 18px 44px rgba(240, 27, 45, 0.12);
    font-size: 2rem;
}
.guide-modal h2 {
    margin: 0;
    padding-right: 48px;
    color: #fff;
    font-size: clamp(1.7rem, 5vw, 2.2rem);
    letter-spacing: -0.035em;
    line-height: 1.08;
}
.guide-modal > p { margin-top: 12px; color: #aaaab4; line-height: 1.55; }
.guide-points { display: grid; gap: 9px; margin: 20px 0 0; list-style: none; }
.guide-points li { position: relative; padding-left: 24px; color: #dedee3; font-size: 0.9rem; }
.guide-points li::before { content: "✓"; position: absolute; left: 0; color: #ff7180; font-weight: 800; }
.guide-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--card-border);
}
.guide-actions > div { display: flex; gap: 8px; }
.guide-actions .btn-primary,
.guide-actions .btn-secondary { min-width: 104px; margin: 0; }
.guide-count { color: var(--gray); font-size: 0.78rem; font-weight: 700; }

.explore-mode {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: #101013;
}
.explore-mode-btn { width: 100%; border: 0; border-radius: 10px; }
.explore-mode-btn.active { box-shadow: 0 6px 18px rgba(240, 27, 45, 0.14); }

.file-picker {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 58px;
    flex: 1;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    overflow: hidden;
    border: 1px dashed var(--border-strong);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
    color: #dedee3;
    cursor: pointer;
}
.file-picker:hover,
.file-picker:focus-within { border-color: var(--accent-border); background: var(--accent-soft); }
.file-picker-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ff7884;
    font-size: 1.15rem;
    font-weight: 800;
}
.file-picker > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.file-picker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker small { color: var(--gray); font-size: 0.72rem; }
.file-picker.has-file { border-style: solid; border-color: rgba(127, 220, 164, 0.35); }
.file-picker .file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .container { padding-bottom: 44px; }
    .results-anchor { scroll-margin-top: 18px; }

    .nav {
        position: fixed;
        z-index: 900;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        margin: 0;
        padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        overflow: visible;
        border: 0;
        border-top: 1px solid var(--border-strong);
        border-radius: 0;
        background: rgba(12, 12, 15, 0.97);
        box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.38);
    }
    .nav-group { min-width: 0; }
    .nav-item,
    .nav-group > .nav-item {
        width: 100%;
        min-width: 0;
        min-height: 54px;
        justify-content: center;
        gap: 5px;
        padding: 7px 5px;
        border: 0;
        border-radius: 12px;
        font-size: 0.73rem;
    }
    .nav-primary.is-active,
    .nav-trigger.is-active { background: var(--accent-soft); color: #fff; box-shadow: none; }
    .nav-menu.nav-menu-mobile {
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(76px + env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        max-height: calc(100dvh - 104px - env(safe-area-inset-bottom));
        border-radius: 18px;
    }

    .panel-heading { margin-top: 0; }
    .panel-heading h2 { font-size: 2rem; }
    .panel-heading p { font-size: 0.92rem; }

    .streaming-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 15px;
    }
    .streaming-copy small { display: none; }
    .streaming-actions { justify-content: flex-end; gap: 10px; }
    .streaming-bar.has-selection .streaming-actions { grid-column: 1 / -1; justify-content: space-between; }
    .streaming-only { max-width: 190px; line-height: 1.25; }

    .preference-modal,
    .guide-modal {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        padding: 22px 16px max(22px, env(safe-area-inset-bottom));
    }
    .filter-dialog-grid { grid-template-columns: 1fr; gap: 13px; }
    .dialog-actions {
        position: sticky;
        bottom: calc(-1 * max(22px, env(safe-area-inset-bottom)));
        z-index: 2;
        margin-right: -16px;
        margin-left: -16px;
        padding: 14px 16px max(14px, env(safe-area-inset-bottom));
        background: rgba(20, 20, 22, 0.98);
    }
    .dialog-actions .btn-primary,
    .dialog-actions .btn-secondary { min-width: 0; flex: 1; }
    .streaming-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .guide-modal { min-height: min(590px, calc(100dvh - 8px)); }
    .guide-progress { margin-top: 0; }
    .guide-visual { width: 64px; height: 64px; margin-bottom: 20px; border-radius: 20px; }
    .guide-actions { margin-top: auto; }
}

@media (max-width: 380px) {
    .nav-item,
    .nav-group > .nav-item { font-size: 0.68rem; }
    .nav-ic { font-size: 0.9rem; }
    .streaming-bar.has-selection .streaming-actions { align-items: stretch; flex-direction: column; }
    .streaming-only { max-width: none; }
    .streaming-summary { justify-content: center; }
    .streaming-chips { grid-template-columns: 1fr; }
    .guide-actions { align-items: stretch; flex-direction: column; }
    .guide-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 340px) {
    .header-top { flex-wrap: wrap; }
    .auth-bar.has-user { width: 100%; justify-content: flex-start; }
    .auth-bar.has-user .auth-email { max-width: 160px; }
}
