/* ================= TOKENS ================= */
:root {
    --text: #0f172a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #fff;
    --accent: #ff1e00;
    --accent-ink: #fff;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --fs-base: 14px;
    --fs-sm: 13px;
    --poster-h: 150px;
    --page-max: 1280px;
    --side-pad: 16px;
    --gutter-bg: #F1F5F9;
    --center-bg: #ffffff;
    --control-h: 42px;
    --fr-info-bg: #f3f4f6;
    --fr-info-border: #d1d5db;
    --fr-info-ink: #374151;
    --fr-tip-bg: #2f3135;
    --fr-tip-ink: #ffffff;
    --fr-tip-border: #111315;
    --panel-pad: 24px;
}

/* ========= PAGE BACKGROUND / WRAP WIDTHS ========= */
html,
body {
    height: 100%
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
    font-size: var(--fs-base);
    --side: max((100vw - var(--page-max))/2, 0px);
    background: linear-gradient(90deg, var(--gutter-bg) 0, var(--gutter-bg) var(--side), var(--center-bg) var(--side), var(--center-bg) calc(100% - var(--side)), var(--gutter-bg) calc(100% - var(--side)), var(--gutter-bg) 100%)
}

/* ========= BASICS ========= */
* {
    box-sizing: border-box
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea,
label {
    font-family: inherit
}

/* ========= HEADER / FOOTER / PANEL (unified inner width) ========= */
.site-header {
    background: transparent;
    position: static;
    border: 0;
    margin: 0;
    padding: 0
}

.header-inner,
.page-panel,
.footer-inner {
    width: min(var(--page-max), calc(100% - (var(--side-pad)*2)));
    margin-inline: auto
}

.header-inner {
    background: #fff;
    padding: 12px var(--panel-pad) 8px;
    border-bottom: 0;
    border-radius: 0
}

.page-panel {
    background: #fff;
    border-radius: 0;
    padding: var(--panel-pad);
    box-shadow: 0 2px 12px rgba(16, 24, 40, .06);
    margin: 0
}

.site-footer {
    background: transparent;
    margin: 0;
    padding: 0;
    border: 0
}

.footer-inner {
    background: #fff;
    padding: 12px var(--panel-pad) 8px;
    border: 0
}

.legalcopy {
    background: #fff;
    margin: 6px auto 16px;
    max-width: min(var(--page-max), calc(100% - (var(--side-pad)*2)));
    padding: 8px var(--panel-pad) 16px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 2px 12px rgba(16, 24, 40, .06);
    text-align: center;
    color: #6b7177;
    font-size: 12px;
    line-height: 1.45
}

/* ========= BRAND / TAGLINE ========= */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: -.01em;
    font-size: clamp(18px, 2.2vw, 22px)
}

.brand-link .fr-logo {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 1000;
    font-size: 24px
}

.tagline {
    order: 3;
    flex-basis: 100%;
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    color: #0f172a;
    font-weight: 700
}

/* ========= BUTTONS / PILLS ========= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 700;
    cursor: pointer
}

.btn--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink)
}

.btn--accent:hover {
    filter: brightness(.96)
}

.btn--ghost {
    background: #fff;
    color: var(--muted)
}

.btn--ghost:hover {
    background: #fafafa
}

.pagination .btn {
    padding: .45rem .7rem;
    font-size: var(--fs-sm);
    border-radius: 8px
}

.pill-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.pill-toggle input {
    display: none
}

.pill-toggle span {
    height: var(--control-h);
    display: inline-flex;
    align-items: center;
    padding: 0 .75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--fs-sm);
    cursor: pointer;
    background: #eef2ff;
    color: var(--text)
}

.pill-toggle input:checked+span {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent)
}

/* ========= TOP BAR: CATEGORY / SCOPE / SEARCH ========= */
.blocks-row {
    display: grid;
    grid-template-columns: max-content max-content 1fr;
    gap: 12px;
    align-items: center
}

.group-card {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    border-radius: 14px;
    padding: 0;
    box-shadow: none
}

.search-card {
    flex: 1 1 640px;
    min-width: 420px;
    max-width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center
}

.search-card .search-input {
    width: 100%;
    height: var(--control-h);
    line-height: var(--control-h);
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--fs-base);
    outline: none;
    background: #fff
}

@media (max-width:640px) {
    .blocks-row {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .group-card.sel1,
    .group-card.scope-card.sel2,
    .search-card {
        flex: 1 1 100%
    }

    .sel1 .pill-toggle,
    .sel2 .pill-toggle {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 8px
    }

    .pill-toggle label span {
        font-size: 14px
    }

    .search-card .search-wrap {
        width: 100%
    }
}

/* ========= SEARCH SUGGEST ========= */
.sg-wrap {
    position: relative;
    width: 100%
}

.sg-portal {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60
}

.sg-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: 4px;
    margin: 0;
    list-style: none
}

.sg-item {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left
}

.sg-item:hover {
    background: #f7f7f9
}

.sg-title {
    font-weight: 700
}

.sg-meta {
    color: var(--muted);
    font-size: 12px
}

.sg-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #475569
}

input[list]::-webkit-calendar-picker-indicator {
    display: none !important
}

input[type="search"]::-webkit-search-cancel-button {
    display: none
}

/* ========= FILTERS GRID + DROPDOWNS ========= */
.filters-card {
    padding: 14px
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end
}

.ms-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px 2px;
    position: relative;
    display: inline-flex;
    align-items: center
}

.actions-row {
    grid-column: 1/-1;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 2px
}

@media (max-width:1280px) {
    .filters-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }
}

@media (max-width:768px) {
    .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

.dropdown-filter {
    position: relative
}

.df-trigger {
    width: 100%;
    text-align: left;
    padding: .45rem .6rem;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    background: #fff;
    line-height: 1.1;
    font-weight: 600
}

.df-trigger .df-count {
    font-weight: 700;
    opacity: .8
}

.df-panel {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    margin-top: .4rem;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: .5rem;
    display: none
}

.df-panel.open {
    display: block
}

.df-search {
    width: 100%;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: .35rem .55rem;
    margin-bottom: .35rem
}

.df-list {
    max-height: 180px;
    overflow: auto;
    border: 1px solid #f0f1f4;
    border-radius: 8px;
    padding: .25rem
}

.df-item {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .2rem .3rem;
    border-radius: 6px
}

.df-item:hover {
    background: #f7f7f9
}

.df-actions {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .4rem
}

.df-actions .df-btn {
    border: 1px solid #e4e6eb;
    background: #fff;
    padding: .35rem .55rem;
    border-radius: 8px;
    cursor: pointer
}

@media (max-width:768px) {
    .df-panel {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: 12%
    }
}

/* ========= ACTIVE FILTER SHADING (neutral grey) ========= */
.dropdown-filter.is-active .df-trigger {
    background: var(--fr-info-bg);
    border: 1px solid var(--fr-info-border);
    box-shadow: 0 0 0 1px var(--fr-info-border) inset;
    color: var(--fr-info-ink)
}

.df-trigger .df-count:empty {
    display: none
}

/* ========= INFO TOOLTIP (click-to-open; grey + italic) ========= */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--fr-info-border);
    background: var(--fr-info-bg);
    color: var(--fr-info-ink);
    font: 700 11px/1 system-ui, Arial, sans-serif;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset
}

.info-tip:focus-visible {
    outline: 2px solid rgba(59, 130, 246, .35);
    outline-offset: 2px
}

.info-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fr-tip-bg);
    color: var(--fr-tip-ink);
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    border: 1px solid var(--fr-tip-border);
    width: max-content;
    max-width: 320px;
    z-index: 1000;
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
    font-style: italic
}

.info-tip[aria-expanded="true"]+.info-bubble {
    display: block
}

.info-bubble::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--fr-tip-bg)
}

.ms {
    overflow: visible
}

/* ========= GRID RESULTS ========= */
#results.grid,
#results.grid>ul {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: start
}

@media (max-width:1280px) {
    #results.grid {
        grid-template-columns: repeat(4, 1fr) !important
    }
}

@media (max-width:900px) {
    #results.grid {
        grid-template-columns: repeat(3, 1fr) !important
    }
}

@media (max-width:640px) {
    #results.grid {
        grid-template-columns: repeat(2, 1fr) !important
    }
}

.title-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%
}

.poster,
.poster-wrap {
    width: 100%;
    height: var(--poster-h);
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #f3f4f6
}

.poster img,
.poster-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block
}

.title-card .meta {
    padding: 6px 8px;
    font-size: 11.5px
}

.title-name {
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.title-rank {
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--muted)
}

.muted {
    color: var(--muted)
}

.card-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center
}

/* ========= LIST RESULTS ========= */
#results.list {
    margin-top: 8px
}

.list-wrap {
    width: 100%;
    overflow-x: auto
}

.fr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
    color: #475569
}

.fr-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    font-size: 12px;
    color: #64748b;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap
}

.fr-table tbody td {
    padding: 12px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--border);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere
}

.fr-table .col-title {
    width: 240px
}

.fr-table .col-genre,
.fr-table .col-country,
.fr-table .col-lang,
.fr-table .col-dir,
.fr-table .col-wr {
    width: 160px
}

.fr-table .col-plot {
    width: auto;
    min-width: 200px
}

.fr-table thead .col-actions,
.fr-table tbody .col-actions {
    display: none
}

.list-title {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 6px 10px;
    min-height: 66px
}

.list-title .poster {
    width: 44px;
    height: 66px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    grid-row: 1/span 2
}

.title-top {
    align-self: start;
    min-width: 0
}

.row-actions {
    align-self: end;
    display: inline-flex;
    gap: 6px;
    white-space: nowrap
}

@media (max-width:900px) {
    .fr-table .col-plot {
        display: none
    }

    .fr-table .col-dir,
    .fr-table .col-wr {
        width: 18%
    }
}

/* ========= ACTION BUTTONS (WL/SL + STARS) ========= */
.fr-btn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 0;
    position: relative
}

.fr-btn .icon {
    display: none
}

.btn-shortlist::before,
.btn-watchlist::before {
    content: "";
    width: 14px;
    height: 14px;
    display: block;
    background-color: #94a3b8;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 5h2v14h-2zM5 11h14v2H5z'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 5h2v14h-2zM5 11h14v2H5z'/></svg>") center/contain no-repeat
}

.btn-watchlist::before {
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>") center/contain no-repeat
}

.btn-watchlist[aria-pressed="true"],
.btn-shortlist[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent)
}

.btn-watchlist[aria-pressed="true"]::before,
.btn-shortlist[aria-pressed="true"]::before {
    background-color: #fff
}

.fr-actions .stars {
    display: inline-flex;
    gap: 4px
}

.fr-actions .star {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #d1d5db;
    transition: transform .08s ease, color .08s ease
}

.fr-actions .star.is-on {
    color: #f59e0b
}

.fr-actions .star:hover {
    transform: translateY(-2px);
    color: #f59e0b
}

.rating-row {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.star-clear {
    appearance: none;
    background: none;
    border: 0;
    padding: 2px 4px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer
}

.star-clear:hover {
    color: #374151
}

/* ========= RESULTS HEADER / VIEW TOGGLE / PAGINATION ========= */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 8px
}

.view-toggle {
    display: flex;
    gap: 8px
}

.view-toggle .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .38rem .7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--muted);
    background: #fff;
    cursor: pointer
}

.view-toggle .chip:hover {
    background: #fafafa
}

.view-toggle .chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink)
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 16px 0 28px
}

.pagination .btn {
    height: auto;
    padding: .35rem .55rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: #475569
}

.pagination .btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

.pagination .btn.disabled {
    opacity: .5;
    pointer-events: none
}

.pagination .gap {
    padding: 0 .3rem;
    color: #94a3b8
}

/* ========= POSTER FALLBACK ========= */
.poster-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: none
}

.poster-img.is-fallback {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05)
}

/* ========= AUTH THEME (scoped so it won’t override site) ========= */
.auth-body {
    --bg: #0b0b0c;
    --auth-card: #111216;
    --auth-text: #e7e7ea;
    --auth-muted: #a2a2ad;
    --auth-primary: #e23f3f;
    --auth-primary-600: #c73939;
    --auth-ring: #2a2b32;
    --auth-border: #23242b
}

@media (prefers-color-scheme:light) {
    .auth-body {
        --bg: #f7f7fb;
        --auth-card: #ffffff;
        --auth-text: #18181b;
        --auth-muted: #5a5a66;
        --auth-primary: #e23f3f;
        --auth-primary-600: #c73939;
        --auth-ring: #e6e6ef;
        --auth-border: #e9e9f0
    }
}

body.auth-body {
    margin: 0;
    font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--auth-text);
    background: radial-gradient(1200px 1200px at 30% -10%, #1b1c22, transparent 60%), var(--bg)
}

.auth-wrap {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    padding: 28px 28px 22px
}

.auth-head {
    margin-bottom: 16px
}

.auth-title {
    margin: 0 0 6px 0;
    font-size: 22px;
    letter-spacing: .2px
}

.auth-sub {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px
}

.btn {
    will-change: transform;
    transition: transform .06s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease
}

.btn:active {
    transform: translateY(1px)
}

.btn-primary {
    color: #fff;
    background: var(--auth-primary);
    box-shadow: 0 6px 18px rgba(226, 63, 63, .28)
}

.btn-primary:hover {
    background: var(--auth-primary-600)
}

.btn-ghost {
    color: var(--auth-text);
    background: transparent;
    border-color: var(--auth-border)
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .04)
}

.auth-messages {
    list-style: none;
    padding: 0;
    margin: 16px auto 0;
    max-width: 480px;
    color: var(--auth-muted);
    font-size: 14px
}

.auth-messages .msg.success {
    color: #19b86a
}

.auth-messages .msg.error {
    color: #ff6767
}

/* ===== FR HOTFIX PACK (append at end of home.css) ===================== */
/* 1) Center the page shell (header/body/footer use the same inner width) */
:root {
    --page-max: 1280px;
    --side-pad: 16px;
    --panel-pad: 24px;
}

.header-inner,
.page-panel,
.footer-inner {
    width: min(var(--page-max), calc(100% - (var(--side-pad)*2))) !important;
    margin-inline: auto !important;
}

.page-panel {
    padding: var(--panel-pad) !important;
    margin: 0 auto !important;
}

.wrap {
    padding: 0 !important;
}

/* avoid double padding */
/* 2) Bring back the nice wrapper around the filters */
form.filters {
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    background: #fff !important;
    padding: 12px 16px 16px !important;
}

/* keep top toolbar tidy on one row (pills • pills • flexible search) */
.page-panel .blocks-row {
    display: grid !important;
    grid-template-columns: max-content max-content 1fr !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 8px 0 12px !important;
}

.page-panel .blocks-row>.group-card {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.search-card {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.search-card .search-input {
    height: var(--control-h);
    line-height: var(--control-h);
    width: 100% !important;
}

/* let popovers show over the filter card */
.filters-card,
.group-card {
    overflow: visible !important;
}

/* 3) WL / SL small round buttons — center the glyphs perfectly */
.fr-btn {
    display: inline-grid !important;
    place-items: center !important;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
}

.fr-btn::before {
    margin: auto !important;
}

/* mask icon centers */
.btn-watchlist[aria-pressed="true"],
.btn-shortlist[aria-pressed="true"] {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.btn-watchlist[aria-pressed="true"]::before,
.btn-shortlist[aria-pressed="true"]::before {
    background-color: #fff !important;
}

/* 4) Click-to-open tooltips (neutral grey + italic copy) */
:root {
    --fr-info-bg: #f3f4f6;
    --fr-info-border: #d1d5db;
    --fr-info-ink: #374151;
    --fr-tip-bg: #2f3135;
    --fr-tip-ink: #fff;
    --fr-tip-border: #111315;
}

.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--fr-info-border);
    background: var(--fr-info-bg);
    color: var(--fr-info-ink);
    font: 700 11px/1 system-ui, Arial, sans-serif;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset;
}

.info-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fr-tip-bg);
    color: var(--fr-tip-ink);
    border: 1px solid var(--fr-tip-border);
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    width: max-content;
    max-width: 320px;
    z-index: 1000;
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
    font-style: italic;
}

.info-bubble::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--fr-tip-bg);
}

.info-tip[aria-expanded="true"]+.info-bubble {
    display: block !important;
}

/* 5) Shade any filter with an active selection (neutral grey) */
.dropdown-filter.is-active .df-trigger {
    background: var(--fr-info-bg) !important;
    border: 1px solid var(--fr-info-border) !important;
    box-shadow: 0 0 0 1px var(--fr-info-border) inset !important;
    color: var(--fr-info-ink) !important;
}

.df-trigger .df-count:empty {
    display: none;
}

/* 6) Header nav spacing / separator (email • Dashboard • Logout) */
.site-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.site-nav a+a::before {
    content: "·";
    margin: 0 .6rem;
    color: #9aa3ac;
}

/* 7) List/Table view — sane spacing & wrapping */
.list-wrap {
    width: 100%;
    overflow-x: auto;
}

.fr-table {
    width: 100%;
    table-layout: fixed;
}

.fr-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 8px 10px;
    font-size: 12px;
    color: #64748b;
    border-bottom: 1px solid var(--border);
}

.fr-table tbody td {
    padding: 10px;
    vertical-align: top;
    border-top: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.fr-table .col-title {
    width: 240px;
}

.fr-table .col-plot {
    width: 20%;
    min-width: 200px;
}

@media (max-width:900px) {
    .fr-table .col-plot {
        display: none;
    }
}

/* 8) Mobile: make the top three cards stack cleanly */
@media (max-width:640px) {
    .page-panel .blocks-row {
        grid-template-columns: 1fr !important;
    }

    .group-card.sel1,
    .group-card.sel2,
    .search-card {
        width: 100% !important;
    }

    .sel1 .pill-toggle,
    .sel2 .pill-toggle {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 8px;
    }
}

/* === LIST TABLE: column sizing & wrapping (9 columns) === */
.list-wrap {
    width: 100%;
    overflow-x: auto;
}

.fr-table {
    width: 100%;
    table-layout: fixed;
}

.fr-table th,
.fr-table td {
    padding: 10px;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Named classes (preferred) */
@media (min-width:1100px) {
    .fr-table .col-title {
        width: 260px;
    }

    /* already good */
    .fr-table .col-category {
        width: 96px;
        min-width: 96px;
    }

    .fr-table .col-genre {
        width: 160px;
        min-width: 140px;
    }

    .fr-table .col-country {
        width: 120px;
    }

    .fr-table .col-lang {
        width: 140px;
    }

    .fr-table .col-dir {
        width: 180px;
    }

    .fr-table .col-wr {
        width: 180px;
    }

    .fr-table .col-plot {
        width: 28%;
        min-width: 260px;
    }

    /* make Plot roomy */
    .fr-table .col-cast {
        width: 200px;
    }
}

/* Fallback if your template doesn’t use those classes (nth-column map) */
@media (min-width:1100px) {

    .fr-table thead th:nth-child(1),
    .fr-table tbody td:nth-child(1) {
        width: 260px;
    }

    /* Title */
    .fr-table thead th:nth-child(2),
    .fr-table tbody td:nth-child(2) {
        width: 96px;
    }

    /* Category */
    .fr-table thead th:nth-child(3),
    .fr-table tbody td:nth-child(3) {
        width: 96px;
    }

    /* Runtime */
    .fr-table thead th:nth-child(4),
    .fr-table tbody td:nth-child(4) {
        width: 160px;
    }

    /* Genre */
    .fr-table thead th:nth-child(5),
    .fr-table tbody td:nth-child(5) {
        width: 120px;
    }

    /* Country */
    .fr-table thead th:nth-child(6),
    .fr-table tbody td:nth-child(6) {
        width: 140px;
    }

    /* Language */
    .fr-table thead th:nth-child(7),
    .fr-table tbody td:nth-child(7) {
        width: 180px;
    }

    /* Directors */
    .fr-table thead th:nth-child(8),
    .fr-table tbody td:nth-child(8) {
        width: 180px;
    }

    /* Writers */
    .fr-table thead th:nth-child(9),
    .fr-table tbody td:nth-child(9) {
        width: 200px;
    }

    /* Cast */
    .fr-table thead th:nth-child(10),
    .fr-table tbody td:nth-child(10) {
        width: 28%;
        min-width: 260px;
    }

    /* Plot */
}

/* Keep Plot on-screen on phones */
@media (max-width:900px) {

    .fr-table .col-plot,
    .fr-table thead th:nth-child(8),
    .fr-table tbody td:nth-child(8) {
        display: none;
    }
}

/* Tagline tooltip: anchor & show above the table */
.header-inner {
    position: relative;
    overflow: visible !important;
}

.tagline {
    position: relative;
}

.tagline .info-bubble {
    left: auto;
    right: 0;
    transform: none;
    /* pin bubble to the right end of the tagline row */
    z-index: 1000;
}

/* ===== LIST VIEW: 9 columns with % widths (sum = 100) ===== */
.list-wrap {
    width: 100%;
    overflow-x: auto;
}

.fr-table {
    width: 100%;
    table-layout: fixed;
}

/* required so % widths stick */
.fr-table th,
.fr-table td {
    padding: 10px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* --- Pick the mapping you prefer (you can keep both) --- */
/* A) If your TH/TDs have these classes */
@media (min-width: 900px) {
    .fr-table .col-title {
        width: 20% !important;
    }

    .fr-table .col-category {
        width: 6% !important;
    }

    .fr-table .col-genre {
        width: 10% !important;
    }

    .fr-table .col-country {
        width: 10% !important;
    }

    .fr-table .col-lang {
        width: 10% !important;
    }

    .fr-table .col-dir {
        width: 10% !important;
    }

    .fr-table .col-wr {
        width: 10% !important;
    }

    .fr-table .col-plot {
        width: 14% !important;
    }

    /* make Plot roomier */
    .fr-table .col-cast {
        width: 10% !important;
    }
}

/* B) Fallback: target by column order (Title..Cast) */
@media (min-width: 900px) {

    .fr-table thead th:nth-child(1),
    .fr-table tbody td:nth-child(1) {
        width: 20% !important;
    }

    /* Title */
    .fr-table thead th:nth-child(2),
    .fr-table tbody td:nth-child(2) {
        width: 6% !important;
    }

    /* Category */
    .fr-table thead th:nth-child(3),
    .fr-table tbody td:nth-child(3) {
        width: 6% !important;
    }

    /* Category */
    .fr-table thead th:nth-child(4),
    .fr-table tbody td:nth-child(4) {
        width: 10% !important;
    }

    /* Genre */
    .fr-table thead th:nth-child(5),
    .fr-table tbody td:nth-child(5) {
        width: 10% !important;
    }

    /* Country */
    .fr-table thead th:nth-child(6),
    .fr-table tbody td:nth-child(6) {
        width: 10% !important;
    }

    /* Language */
    .fr-table thead th:nth-child(7),
    .fr-table tbody td:nth-child(7) {
        width: 10% !important;
    }

    /* Directors */
    .fr-table thead th:nth-child(8),
    .fr-table tbody td:nth-child(8) {
        width: 10% !important;
    }

    /* Writers */
    .fr-table thead th:nth-child(9),
    .fr-table tbody td:nth-child(9) {
        width: 10% !important;
    }

    /* Cast */
    .fr-table thead th:nth-child(10),
    .fr-table tbody td:nth-child(10) {
        width: 14% !important;
    }

    /* Plot */
}

/* Mobile: hide Plot on narrow screens to avoid overflow (optional) */
@media (max-width: 800px) {

    .fr-table .col-plot,
    .fr-table thead th:nth-child(10),
    .fr-table tbody td:nth-child(10) {
        display: none;
    }
}

/* Keep title cell’s inner grid from forcing weird widths */
.list-title {
    grid-template-columns: 44px minmax(0, 1fr);
}

.list-title .title-top {
    min-width: 0;
}

/* CENTER the circular + / ✓ buttons everywhere (grid & list) */
.fr-btn,
.wl,
.btn-watchlist,
.btn-shortlist {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    padding: 0;
    vertical-align: middle;
    line-height: 22px;
    /* <- exact match kills sub-pixel drift */
}

/* If your templates render a text glyph inside, center it */
.fr-btn .icon,
.wl .icon {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    margin: 0;
    transform: none;
}

/* Mask icons so centering is always pixel-perfect (works even with no .icon text) */
.fr-btn::before,
.btn-watchlist::before,
.btn-shortlist::before {
    content: "";
    width: 14px;
    height: 14px;
    display: block;
    background-color: #94a3b8;
    -webkit-mask: url("data:image/svg+xml;utf8,\ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 5h2v14h-2zM5 11h14v2H5z'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,\ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 5h2v14h-2zM5 11h14v2H5z'/></svg>") center/contain no-repeat;
}

/* Watchlist as ✓ */
.btn-watchlist::before {
    -webkit-mask: url("data:image/svg+xml;utf8,\ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,\ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>") center/contain no-repeat;
}

/* Active state: red pill, white icon */
.btn-watchlist[aria-pressed="true"],
.btn-shortlist[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-watchlist[aria-pressed="true"]::before,
.btn-shortlist[aria-pressed="true"]::before {
    background-color: #fff;
}

/* ===== LIST → CARDS ON MOBILE ===== */
@media (max-width: 768px) {
    .fr-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .fr-table thead {
        display: none;
    }

    /* hide table header */
    .fr-table tbody,
    .fr-table tr,
    .fr-table td {
        display: block;
        width: 100%;
    }

    .fr-table tr {
        margin: 12px 0;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff;
    }

    /* Title cell stays first, keep its small grid (poster | text) */
    .fr-table td:nth-child(1) {
        padding: 0 0 8px 0;
        border: 0;
    }

    /* All other cells become label:value rows */
    .fr-table td {
        padding: 6px 0;
        border: 0;
        display: flex;
        gap: 8px;
        align-items: flex-start;
    }

    .fr-table td::before {
        flex: 0 0 90px;
        min-width: 90px;
        content: attr(data-label);
        /* use data-label if present */
        color: #6b7280;
        font-size: 12px;
        font-weight: 600;
    }

    /* If data-labels aren’t in the HTML yet, provide fallback labels by position */
    .fr-table td:nth-child(2)::before {
        content: "Category";
    }

    .fr-table td:nth-child(3)::before {
        content: "Runtime";
    }

    .fr-table td:nth-child(4)::before {
        content: "Genre";
    }

    .fr-table td:nth-child(5)::before {
        content: "Country";
    }

    .fr-table td:nth-child(6)::before {
        content: "Language";
    }

    .fr-table td:nth-child(7)::before {
        content: "Directors";
    }

    .fr-table td:nth-child(8)::before {
        content: "Writers";
    }

    .fr-table td:nth-child(9)::before {
        content: "Cast";
    }

    .fr-table td:nth-child(10)::before {
        content: "Plot";
    }

    /* Make long Plot friendlier on phones */
    .fr-table td:nth-child(10) {
        overflow: hidden;
    }

    .fr-table td:nth-child(10)>* {
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Keep the action buttons from drifting */
    .row-actions {
        margin-top: 6px;
    }

    .row-actions .fr-btn,
    .row-actions .btn-watchlist,
    .row-actions .btn-shortlist {
        vertical-align: middle;
    }
}

/* === WL/SL buttons: use ONLY the inner glyph, never the ::before mask === */
.btn-watchlist::before,
.btn-shortlist::before,
.fr-btn::before,
.wl::before {
    content: none !important;
    background: none !important;
    -webkit-mask: none !important;
    mask: none !important;
}

/* Size + perfect centering (grid & list) */
.fr-btn,
.wl,
.btn-watchlist,
.btn-shortlist {
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    vertical-align: middle;
    line-height: 22px;
}

/* The text glyph inside (✓ or +) */
.fr-btn .icon,
.wl .icon,
.btn-watchlist .icon,
.btn-shortlist .icon {
    font-size: 14px;
    line-height: 1;
    color: #94a3b8;
    margin: 0;
}

/* Active state (pressed): red pill + white glyph */
.btn-watchlist[aria-pressed="true"],
.btn-shortlist[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-watchlist[aria-pressed="true"] .icon,
.btn-shortlist[aria-pressed="true"] .icon {
    color: #fff;
}

/* Optional: small hover feedback */
.fr-btn:hover,
.btn-watchlist:hover,
.btn-shortlist:hover {
    background: #f8fafc;
}

/* ==== LIST VIEW: fixed column percentages + horizontal scroller ==== */
.list-wrap {
    overflow-x: auto;
}

.fr-table {
    table-layout: fixed;
    /* predictable column sizing */
    min-width: 1100px;
    /* stop ultra-narrow columns (mobile) */
}

/* sane wrapping: don't break every letter */
.fr-table th,
.fr-table td {
    white-space: normal;
    /* allow words to wrap */
    overflow-wrap: break-word;
    /* break long words only if needed */
    word-break: normal;
    hyphens: auto;
}

/* 9 columns by percentage (sum = 100) */
/* 1 Title 18% */
.fr-table thead th:nth-child(1),
.fr-table tbody td:nth-child(1) {
    width: 18%;
}

/* 2 Category 8% */
.fr-table thead th:nth-child(2),
.fr-table tbody td:nth-child(2) {
    width: 8%;
}

/* 3 Genre 12% */
.fr-table thead th:nth-child(3),
.fr-table tbody td:nth-child(3) {
    width: 12%;
}

/* 4 Country 8% */
.fr-table thead th:nth-child(4),
.fr-table tbody td:nth-child(4) {
    width: 8%;
}

/* 5 Language 10% */
.fr-table thead th:nth-child(5),
.fr-table tbody td:nth-child(5) {
    width: 10%;
}

/* 6 Directors 12% */
.fr-table thead th:nth-child(6),
.fr-table tbody td:nth-child(6) {
    width: 12%;
}

/* 7 Writers 12% */
.fr-table thead th:nth-child(7),
.fr-table tbody td:nth-child(7) {
    width: 12%;
}

/* 8 Plot 14% (more space) */
.fr-table thead th:nth-child(8),
.fr-table tbody td:nth-child(8) {
    width: 14%;
}

/* 9 Cast 6% */
.fr-table thead th:nth-child(9),
.fr-table tbody td:nth-child(9) {
    width: 6%;
}

/* Mobile: let the filter UI stack freely (11–12 rows is fine) */
@media (max-width: 640px) {
    .blocks-row {
        display: block;
    }

    .group-card,
    .search-card {
        width: 100%;
        margin: 8px 0;
    }

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

/* ==== WL / SL BUTTONS: single centered glyph, no duplicates ==== */
/* Use the inline glyph only; kill any pseudo-icons left from earlier tweaks */
.fr-btn::before {
    content: none !important;
}

.fr-btn {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    font-size: 0;
    /* hide stray text nodes */
}

.fr-btn .icon {
    display: block;
    font-size: 14px;
    line-height: 1;
    color: #94a3b8;
    /* ✓ or + */
}

.btn-watchlist[aria-pressed="true"],
.btn-shortlist[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-watchlist[aria-pressed="true"] .icon,
.btn-shortlist[aria-pressed="true"] .icon {
    color: #fff;
}

/* Make the small action cluster align nicely in both views */
.card-actions .fr-btn {
    align-self: center;
}

/* ==== TAGLINE TOOLTIP: ensure it opens above header ==== */
.header-inner {
    position: relative;
    overflow: visible;
}

.tagline {
    position: relative;
}

.info-bubble {
    z-index: 9999;
}

/* ===== DASHBOARD LAYOUT ===== */
.fr-dash {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* 2 cols on medium, 1 col on small */
@media (max-width:1200px) {
    .fr-dash {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Each box */
.fr-dcard {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* The scrolling list inside a card */
.fr-dlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow: auto;
}

/* One row in a list */
.fr-drow {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fr-drow .poster {
    width: 32px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex: 0 0 auto;
}

.fr-drow .title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* If you prefer 2-line wrap instead of ellipsis: white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; */
}

.fr-drow .meta {
    color: #6b7280;
    font-size: 12px;
}

/* Stars sit on the right neatly */
.fr-drow .stars {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 3px;
}

/* ===== Fallback if you can't add .fr-dash/.fr-dcard classes ===== */
.page-panel .dashboard,
.account-dashboard,
.my-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width:1200px) {

    .page-panel .dashboard,
    .account-dashboard,
    .my-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:768px) {

    .page-panel .dashboard,
    .account-dashboard,
    .my-dashboard {
        grid-template-columns: 1fr;
    }
}

/* Try to normalize rows inside those cards */
.page-panel .dashboard .card,
.account-dashboard .card,
.my-dashboard .card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.page-panel .dashboard .card .list,
.account-dashboard .card .list,
.my-dashboard .card .list {
    max-height: 60vh;
    overflow: auto;
}

.page-panel .dashboard .card .list * {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* ===== TOKENS ===== */
:root {
    --auth-bg: #f7f7fb;
    --auth-card: #fff;
    --auth-ink: #18181b;
    --auth-muted: #5a5a66;
    --auth-border: #e9e9f0;
    --auth-ring: #e6e6ef;
    --auth-accent: var(--accent, #ff1e00);
    --auth-accent-600: #e11b00;
    --auth-success: #19b86a;
    --auth-error: #ff6767;
    --auth-info: #2563eb
}

@media(prefers-color-scheme:dark) {
    :root {
        --auth-bg: #0b0b0c;
        --auth-card: #111216;
        --auth-ink: #e7e7ea;
        --auth-muted: #a2a2ad;
        --auth-border: #23242b;
        --auth-ring: #2a2b32;
        --auth-accent: var(--accent, #ff3b21);
        --auth-accent-600: #de2f15
    }
}

/* ===== LAYOUT ===== */
body.auth-body {
    margin: 0;
    font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--auth-ink);
    background: radial-gradient(1200px 1200px at 30% -10%, rgba(0, 0, 0, .12), transparent 60%), var(--auth-bg)
}

.auth-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px
}

.auth-card {
    width: min(560px, 100%);
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    padding: 28px 28px 22px
}

.auth-head {
    margin: 0 0 16px
}

.auth-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .2px
}

.auth-sub {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px
}

.auth-bodytext {
    margin: 6px 0 0;
    color: var(--auth-muted);
    font-size: 14px
}

/* Optional two-column (art panel) */
.auth-split {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    border-radius: 16px;
    overflow: hidden
}

.auth-split .auth-card {
    border: 0;
    border-radius: 0;
    padding: 28px
}

.auth-illustration {
    background: linear-gradient(145deg, rgba(255, 30, 0, .10), rgba(255, 30, 0, .02));
    display: grid;
    place-items: center;
    padding: 24px
}

.auth-illustration .art {
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .18)
}

@media(max-width:900px) {
    .auth-split {
        display: block
    }
}

/* ===== FORM ===== */
.auth-form {
    display: grid;
    gap: 12px;
    margin-top: 12px
}

.auth-form .field {
    display: grid;
    gap: 6px
}

.auth-form label {
    font-size: 12px;
    color: var(--auth-muted)
}

.auth-form .row {
    display: flex;
    gap: 10px
}

.auth-form .row .field {
    flex: 1
}

.auth-input,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"],
.auth-form input[type="number"],
.auth-form select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: transparent;
    color: var(--auth-ink);
    outline: 0;
    transition: border-color .15s, box-shadow .15s
}

.auth-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: transparent;
    color: var(--auth-ink);
    outline: 0
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 20%, transparent)
}

.auth-form .helptext {
    margin-top: 4px;
    font-size: 12px;
    color: var(--auth-muted)
}

.auth-form .checkbox {
    display: flex;
    align-items: center;
    gap: 8px
}

.auth-form .checkbox input {
    width: 16px;
    height: 16px;
    border-radius: 4px
}

.auth-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px
}

/* ===== BUTTONS ===== */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
    will-change: transform
}

.btn:active {
    transform: translateY(1px)
}

.btn-primary {
    color: #fff;
    background: var(--auth-accent);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--auth-accent) 28%, transparent)
}

.btn-primary:hover {
    background: var(--auth-accent-600)
}

.btn-ghost {
    color: var(--auth-ink);
    background: transparent;
    border-color: var(--auth-border)
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, .04)
}

.btn-link {
    background: transparent;
    border: 0;
    color: var(--auth-info);
    padding: 0
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    background: #111;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .02em
}

.btn-wide {
    min-width: 160px
}

/* ===== DIVIDERS & META ===== */
.auth-hr {
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 16px 0
}

.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--auth-muted)
}

.auth-meta a {
    color: var(--auth-info);
    text-decoration: none
}

.auth-meta a:hover {
    text-decoration: underline
}

/* ===== MESSAGES / ERRORS ===== */
ul.errorlist {
    margin: 6px 0 0;
    padding: 0 0 0 18px;
    color: var(--auth-error);
    font-size: 13px
}

.auth-messages {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    font-size: 14px
}

.auth-messages .msg {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    background: rgba(0, 0, 0, .02)
}

.auth-messages .success {
    border-color: color-mix(in srgb, var(--auth-success) 30%, transparent);
    background: color-mix(in srgb, var(--auth-success) 10%, transparent);
    color: var(--auth-ink)
}

.auth-messages .error {
    border-color: color-mix(in srgb, var(--auth-error) 35%, transparent);
    background: color-mix(in srgb, var(--auth-error) 12%, transparent);
    color: var(--auth-ink)
}

.auth-messages .info {
    border-color: color-mix(in srgb, var(--auth-info) 30%, transparent);
    background: color-mix(in srgb, var(--auth-info) 10%, transparent);
    color: var(--auth-ink)
}

/* ===== OTP / CODE INPUT ===== */
.otp-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 8px
}

.otp-input {
    height: 56px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: transparent;
    color: var(--auth-ink);
    outline: 0
}

.otp-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 20%, transparent)
}

@media(max-width:420px) {
    .otp-row {
        grid-template-columns: repeat(6, 44px);
        justify-content: center
    }
}

.resend-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    font-size: 14px;
    color: var(--auth-muted)
}

.resend-row .count {
    font-variant-numeric: tabular-nums
}

/* ===== VERIFY / SUCCESS / LOGOUT ===== */
.verify-wrap {
    display: grid;
    gap: 8px;
    place-items: center;
    text-align: center;
    margin-top: 6px
}

.verify-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--auth-success) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--auth-success) 30%, transparent);
    color: var(--auth-success);
    font-weight: 800
}

.verify-title {
    margin: 6px 0 0;
    font-size: 18px;
    font-weight: 800
}

.verify-sub {
    margin: 2px 0 0;
    color: var(--auth-muted);
    font-size: 14px
}

.logout-card,
.success-card {
    padding: 18px;
    border: 1px dashed var(--auth-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, .02);
    margin-top: 12px
}

/* ===== PROVIDERS ROW (optional SSO) ===== */
.providers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px
}

.provider-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-card);
    color: var(--auth-ink);
    text-decoration: none;
    font-weight: 700
}

.provider-btn:hover {
    background: rgba(0, 0, 0, .04)
}

/* ===== LINKS UNDER FORMS ===== */
.auth-foot {
    margin-top: 14px;
    font-size: 14px;
    color: var(--auth-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between
}

.auth-foot a {
    color: var(--auth-info);
    text-decoration: none
}

.auth-foot a:hover {
    text-decoration: underline
}

/* ===== ACCESSIBILITY / MISC ===== */
.auth-form input::placeholder {
    color: color-mix(in srgb, var(--auth-muted) 70%, transparent)
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:focus {
    box-shadow: 0 0 0 44px var(--auth-card) inset;
    border-color: var(--auth-accent)
}

kbd {
    font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, .04)
}

/* ---------- 1) Extra space between title and the stars line ---------- */
/* Grid cards */
.title-card .title-name {
    display: block;
    margin-bottom: 6px;
    /* space below the title */
}

.title-card .meta .stars,
.title-card .meta .star-row,
.title-card .meta .rating-row {
    margin-top: 4px;
    /* space above the stars row */
}

/* List view title cell, just in case */
.list-title .tn-title,
.list-title .lt-name {
    display: block;
    margin-bottom: 6px;
}

.list-title .stars,
.list-title .star-row {
    margin-top: 4px;
}

/* Small breathing room inside the card body */
.title-card .meta {
    padding: 8px 10px 10px;
}

/* ---------- 2) Light grey shade for all title tiles (grid cards) ---------- */
:root {
    --tile-bg: #f7f8fb;
    /* subtle grey */
    --tile-border: #e6e8ee;
}

.title-card {
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* Optional: a tiny lift on hover (feel free to remove if you prefer flat) */
#results.grid .title-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

/* === Stars: gold only when selected, not on hover === */
/* Base look */
.stars .star,
.fr-actions .star {
    color: #cbd5e1;
    /* neutral grey */
    transition: transform .08s ease;
    /* keep the little nudge if you like */
}

/* Tiny hover nudge only (no color change) */
.stars .star:hover,
.fr-actions .star:hover {
    transform: translateY(-2px);
    color: inherit !important;
}

/* Selected / filled state (from server/template) */
.stars .star.is-on,
.stars .star.filled,
.fr-actions .star.is-on,
.fr-actions .star.filled,
.star.is-on,
.star.filled {
    color: #f59e0b !important;
    /* gold ONLY when selected */
}

/* Optional: no hover color in read-only rows (if any) */
.stars[data-readonly="true"] .star {
    pointer-events: none;
}

/* Optional: keep outline visible for keyboard users */
.stars .star:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
}

/* ======================== STARS: no hover preview ======================== */
/* Base neutral */
.stars .star,
.fr-actions .star {
    color: #cbd5e1;
}

/* Kill every hover-driven color change */
.stars .star:hover,
.stars .star:hover~.star,
.stars:hover .star,
.fr-actions .star:hover,
.fr-actions .star:hover~.star,
.fr-actions:hover .star {
    color: #cbd5e1 !important;
    /* stay grey on hover */
}

/* Selected / server-confirmed states only */
.stars .star.is-on,
.stars .star.filled,
.fr-actions .star.is-on,
.fr-actions .star.filled,
.star.is-on,
.star.filled {
    color: #f59e0b !important;
    /* gold only when actually selected */
}

/* Optional: tiny hover movement without color change */
.stars .star:hover,
.fr-actions .star:hover {
    transform: translateY(-2px);
}

/* ===== Rating row layout ===== */
.rating-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* === Clear link: no underline, closer to stars, italic, muted === */
.rating-clear {
    margin-left: 4px;
    font-style: italic;
    text-decoration: none;
    color: #6b7280;
    font-size: 12.5px;
}

.rating-clear:hover {
    color: #374151;
    text-decoration: none;
}

/* reuse your info-tip bubble next to Clear (small size) */
.rating-guide-tip.info-tip {
    width: 16px;
    height: 16px;
    font-size: 10px;
    margin-left: 2px;
    line-height: 1;
}

/* Ensure no hover color fill on stars (click only) */
.stars .star,
.fr-actions .star {
    color: #cbd5e1;
}

.stars .star:hover,
.stars .star:hover~.star,
.stars:hover .star,
.fr-actions .star:hover,
.fr-actions .star:hover~.star,
.fr-actions:hover .star {
    color: #cbd5e1 !important;
}

.stars .star.is-on,
.stars .star.filled,
.fr-actions .star.is-on,
.fr-actions .star.filled {
    color: #f59e0b !important;
}

.stars .star:hover,
.fr-actions .star:hover {
    transform: translateY(-2px);
    /* keep the nice micro-motion */
}

/* === Micro-contrast: clearer text/borders/focus === */
:root {
    --muted: #475569;
    /* was #6b7280 — better on white */
    --border: #d5dae1;
    /* was #e5e7eb — slightly darker */
}

/* visible keyboard focus everywhere */
:where(a, button, input, select, textarea, .chip, .df-trigger, .fr-btn):focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
    outline-offset: 2px;
}

/* === Info tip: more readable, touch-friendly === */
:root {
    /* slightly deeper slate so white text has strong contrast */
    --fr-tip-bg: #1f2937;
    /* slate-800 */
    --fr-tip-ink: #f8fafc;
    /* near-white */
    --fr-tip-border: #0b1220;
    /* very dark edge */
}

/* the little "i" button: 20px helps touch & visual weight */
.info-tip {
    width: 20px;
    height: 20px;
    font-size: 12px;
    border-color: #cbd5e1;
    /* clearer ring */
    background: #eef2f7;
    /* faint grey, matches filters */
    color: #334155;
}

/* bubble: normal text (not italic), larger line-height */
.info-bubble {
    font-style: normal;
    /* was italic */
    font-size: 13px;
    /* was 12px */
    line-height: 1.45;
    /* was ~1.35 */
    padding: 10px 12px;
    /* a bit more breathing room */
    border-radius: 10px;
    box-shadow: 0 10px 26px color:#d9d9d9;
    /* stronger separation */
    max-width: 360px;
    /* OK for 2–3 sentences */
}

/* optional: emphasise short headings inside the tip */
.info-bubble em,
.info-bubble strong {
    color: #2c2c2c;
    font-weight: 500;
    font-style: normal;
}

/* Inputs feel crisper against white */
.df-trigger {
    border-color: var(--border);
    color: var(--text);
}

/* Active filter shading remains subtle but clear */
.dropdown-filter.is-active .df-trigger {
    background: #eef2f7;
    border-color: #cdd5df;
    box-shadow: 0 0 0 1px #cdd5df inset;
    color: #1f2937;
}

/* tooltip mechanics for the rating guide */
.rating-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.info-tip {
    width: 20px;
    height: 20px;
    line-height: 18px;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--card, #fff);
    color: #334155;
    cursor: pointer;
}

.info-bubble {
    position: absolute;
    left: 0;
    /* show below the button; adjust if you want it on the right */
    top: calc(100% + 8px);
    display: none;
    /* hidden by default */
    max-width: 280px;
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--card, #fff);
    color: #111827;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    z-index: 50;
}

/* when the button is toggled open, show the bubble */
.info-tip[aria-expanded="true"]+.info-bubble {
    display: block;
}

/* small style touch for the labels */
.info-bubble em {
    font-style: normal;
    font-weight: 600;
}

/* ================= TOKENS ================= */
:root {
    --text: #0f172a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #fff;
    --accent: #ff1e00;
    --accent-ink: #fff;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --fs-base: 14px;
    --fs-sm: 13px;
    --page-max: 1280px;
    --side-pad: 16px;
    --panel-pad: 24px;
    --gutter-bg: #F1F5F9;
    --center-bg: #ffffff;
    --control-h: 42px;
    --poster-h: 150px;
    /* tips */
    --fr-info-bg: #f3f4f6;
    --fr-info-border: #d1d5db;
    --fr-info-ink: #374151;
    --fr-tip-bg: #1f2937;
    --fr-tip-ink: #f8fafc;
    --fr-tip-border: #0b1220;
    /* tiles */
    --tile-bg: #f7f8fb;
    --tile-border: #e6e8ee;
}

/* ===== PAGE WRAP ===== */
html,
body {
    height: 100%
}

body {
    margin: 0;
    color: var(--text);
    font: var(--fs-base)/1.5 "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
    --side: max((100vw - var(--page-max))/2, 0px);
    background: linear-gradient(90deg, var(--gutter-bg) 0, var(--gutter-bg) var(--side), var(--center-bg) var(--side), var(--center-bg) calc(100% - var(--side)), var(--gutter-bg) calc(100% - var(--side)), var(--gutter-bg) 100%);
}

/* ===== BASICS ===== */
* {
    box-sizing: border-box
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea,
label {
    font-family: inherit
}

/* ===== PANEL WIDTH (header/footer/container share same inner width) ===== */
.header-inner,
.page-panel,
.footer-inner {
    width: min(var(--page-max), calc(100% - (var(--side-pad)*2)));
    margin-inline: auto;
}

.page-panel {
    background: #fff;
    border-radius: 0;
    padding: var(--panel-pad);
    box-shadow: 0 2px 12px rgba(16, 24, 40, .06)
}

/* ===== BUTTONS / CHIPS ===== */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .06s ease, background .2s, border-color .2s
}

.btn:active {
    transform: translateY(1px)
}

.btn--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink)
}

.btn--accent:hover {
    filter: brightness(.96)
}

.btn--ghost {
    color: var(--muted);
    background: #fff
}

.btn--ghost:hover {
    background: #fafafa
}

.btn.btn-small {
    height: 32px;
    padding: 0 10px;
    border-radius: 10px
}

/* ================================================================ FILTERS CARD — ONE visible outer wrapper; three invisible rows ================================================================ */
form.filters {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px 16px 14px;
}

/* outer stack just gives vertical rhythm between the rows */
.filters-stack {
    display: grid;
    gap: 12px
}

/* ---------- Row 1: Category • Scope • Where • Search ---------- */
.filters-row--top {
    display: grid;
    grid-template-columns: max-content max-content max-content 1fr;
    gap: 12px;
    align-items: center;
}

.tile {
    min-width: 0
}

/* keep inline widgets from blowing up */
.tile--stretch {
    align-self: stretch
}

/* search */
.search-wrap {
    position: relative
}

.search-input {
    width: 100%;
    height: var(--control-h);
    line-height: var(--control-h);
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    outline: 0;
}

/* ---------- Row 2: the 11 filters grid ---------- */
.filters-row--mid {
    display: grid;
    gap: 12px;
    align-items: end;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width:1280px) {
    .filters-row--mid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width:768px) {
    .filters-row--mid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Row 3: Apply/Reset left • GRID/LIST right ---------- */
.filters-row--actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.apply-hint {
    color: var(--muted);
    font-size: 12.5px
}

.actions-right {
    display: inline-flex;
    gap: 8px
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .38rem .7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 800;
    font-size: 12.5px;
    color: #64748b;
    background: #fff;
}

.seg-btn:hover {
    background: #fafafa
}

.seg-btn.is-active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent)
}

/* ================================================================ DROPDOWN FILTERS (multi & single) — clean, compact ================================================================ */
.dropdown-filter {
    position: relative
}

.df-trigger {
    width: 100%;
    text-align: left;
    padding: .48rem .6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .35rem;
    min-height: var(--control-h);
}

.df-trigger .df-count {
    opacity: .75
}

.df-trigger.has-value .df-label {
    display: none
}

.df-trigger.has-value .df-value {
    display: inline
}

/* panel (your JS moves it to a fixed portal; still looks fine in-place) */
.df-panel {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: .4rem;
    display: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: .5rem;
    z-index: 40;
}

.df-panel.open {
    display: block
}

.df-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .38rem .55rem;
    margin-bottom: .4rem
}

.df-list {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #f0f1f4;
    border-radius: 8px;
    padding: .25rem
}

.df-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .22rem .3rem;
    border-radius: 6px
}

.df-item:hover {
    background: #f7f7f9
}

.df-actions {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .45rem
}

.df-actions .df-btn {
    border: 1px solid var(--border);
    background: #fff;
    padding: .38rem .6rem;
    border-radius: 8px;
    cursor: pointer
}

.year-range-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .15rem 0 .4rem
}

.year-range-row input {
    width: 100%;
    height: 32px;
    padding: 0 .5rem;
    border-radius: 8px;
    border: 1px solid var(--border)
}

/* active shading for any filter with selections */
.dropdown-filter.is-active .df-trigger {
    background: #eef2f7;
    border-color: #cdd5df;
    box-shadow: 0 0 0 1px #cdd5df inset;
    color: #1f2937;
}

/* ================================================================ INFO TIP (click-to-open bubble) ================================================================ */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    margin-left: 6px;
    border: 1px solid var(--fr-info-border);
    background: var(--fr-info-bg);
    color: #334155;
    font: 700 12px/1 system-ui, Arial, sans-serif;
    cursor: pointer;
    vertical-align: middle;
}

.info-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fr-tip-bg);
    color: var(--fr-tip-ink);
    border: 1px solid var(--fr-tip-border);
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    max-width: 360px;
    z-index: 1000;
}

.info-bubble::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--fr-tip-bg)
}

.info-tip[aria-expanded="true"]+.info-bubble {
    display: block
}

/* ================================================================ RESULTS HEADER / TOGGLE / PAGINATION ================================================================ */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 8px
}

.view-toggle {
    display: flex;
    gap: 8px
}

/* ================================================================ GRID RESULTS (cards) ================================================================ */
#results.grid,
#results.grid>ul {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: start;
}

@media (max-width:1280px) {
    #results.grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width:900px) {
    #results.grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width:640px) {
    #results.grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.title-card {
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.poster,
.poster-wrap {
    width: 100%;
    height: var(--poster-h);
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #f3f4f6
}

.poster img,
.poster-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block
}

#results.grid .title-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08)
}

.title-card .meta {
    padding: 8px 10px 10px;
    font-size: 11.5px
}

.title-name {
    font-weight: 700;
    font-size: 12.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.title-rank {
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--muted)
}

.card-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center
}

/* ================================================================ LIST RESULTS (table) — matching _title_list.html ================================================================ */
#results.list {
    margin-top: 8px
}

.list-wrap {
    width: 100%;
    overflow-x: auto
}

.fr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
    color: #475569
}

.fr-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    font-size: 12px;
    color: #64748b;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.fr-table tbody td {
    padding: 10px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.fr-table .col-title {
    width: 240px
}

.fr-table .col-genre,
.fr-table .col-country,
.fr-table .col-lang,
.fr-table .col-dir,
.fr-table .col-wr {
    width: 160px
}

.fr-table .col-plot {
    width: auto;
    min-width: 200px
}

/* wider, % map (desktop) */
@media (min-width:900px) {
    .fr-table .col-title {
        width: 20% !important
    }

    .fr-table .col-cat {
        width: 6% !important
    }

    .fr-table .col-runtime {
        width: 8% !important
    }

    .fr-table .col-genre {
        width: 8% !important
    }

    .fr-table .col-country {
        width: 8% !important
    }

    .fr-table .col-lang {
        width: 8% !important
    }

    .fr-table .col-dir {
        width: 9% !important
    }

    .fr-table .col-wr {
        width: 9% !important
    }

    .fr-table .col-cast {
        width: 9% !important
    }

    .fr-table .col-plot {
        width: 15% !important
    }
}

/* condensed list title cell */
.list-title {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 6px 10px;
    min-height: 66px
}

.list-title .poster {
    width: 44px;
    height: 66px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    grid-row: 1/span 2
}

.title-top {
    align-self: start;
    min-width: 0
}

.row-actions {
    align-self: end;
    display: inline-flex;
    gap: 6px;
    white-space: nowrap
}

/* mobile -> cards */
@media (max-width:768px) {
    .fr-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0
    }

    .fr-table thead {
        display: none
    }

    .fr-table tbody {
        display: block;
        width: 100%
    }

    .fr-table tr {
        display: block;
        width: 100%;
        margin: 12px 0;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff
    }

    .fr-table td {
        display: flex;
        width: 100%;
        padding: 6px 0;
        border: 0;
        gap: 8px;
        align-items: flex-start
    }

    .fr-table td:nth-child(1) {
        padding: 0 0 8px 0
    }

    .fr-table td::before {
        flex: 0 0 90px;
        min-width: 90px;
        content: attr(data-label);
        color: #6b7280;
        font-size: 12px;
        font-weight: 600
    }

    .fr-table td:nth-child(2)::before {
        content: "Category"
    }

    .fr-table td:nth-child(3)::before {
        content: "Category"
    }

    .fr-table td:nth-child(4)::before {
        content: "Genre"
    }

    .fr-table td:nth-child(5)::before {
        content: "Country"
    }

    .fr-table td:nth-child(6)::before {
        content: "Language"
    }

    .fr-table td:nth-child(7)::before {
        content: "Directors"
    }

    .fr-table td:nth-child(8)::before {
        content: "Writers"
    }

    .fr-table td:nth-child(9)::before {
        content: "Plot"
    }

    .fr-table td:nth-child(10)::before {
        content: "Cast"
    }
}

/* ================================================================ ACTION BUTTONS (watchlist/shortlist) + STARS ================================================================ */
.fr-btn,
.btn-watchlist,
.btn-shortlist {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    padding: 0;
    line-height: 22px;
    vertical-align: middle;
}

.fr-btn .icon,
.btn-watchlist .icon,
.btn-shortlist .icon {
    font-size: 14px;
    line-height: 1;
    color: #94a3b8;
    margin: 0
}

.btn-watchlist.is-on,
.btn-shortlist.is-on {
    background: var(--accent);
    border-color: var(--accent)
}

.btn-watchlist.is-on .icon,
.btn-shortlist.is-on .icon {
    color: #fff
}

/* stars (no hover color fill; gold only when selected) */
.stars {
    display: inline-flex;
    gap: 4px
}

.star {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #cbd5e1;
    transition: transform .08s ease
}

.star:hover {
    transform: translateY(-2px)
}

.star.is-on {
    color: #f59e0b
}

.rating-row {
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.star-clear {
    appearance: none;
    background: none;
    border: 0;
    padding: 2px 4px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer
}

.star-clear:hover {
    color: #374151
}

/* ================================================================ ACCESSIBILITY ================================================================ */
:where(a, button, input, select, textarea, .seg-btn, .df-trigger, .fr-btn):focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
    outline-offset: 2px;
}

/* ================================================================ SMALL REFINEMENTS ================================================================ */
.result-meta {
    color: #475569
}

#results.grid .title-name {
    margin-bottom: 6px
}

#results.grid .meta .stars,
#results.grid .meta .rating-row {
    margin-top: 4px
}

/* Generic helper */
[hidden] {
    display: none !important;
}

/* Card details toggle */
.title-card .details {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: #334155;
    font-size: 12.5px;
    line-height: 1.45;
}

.title-card.is-open .details {
    display: block;
}

.title-card .details .detail-row+.detail-row {
    margin-top: 6px;
}

/* ---------- Row 1: Category · Scope · Where · Search ---------- */
.filters-row--top {
    display: grid;
    gap: 12px;
    align-items: center;
    /* same unit width as row 2/3 */
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* grid span helpers for the Search tile */
.tile--span2 {
    grid-column: span 2;
}

.tile--span3 {
    grid-column: span 3;
}

/* match row-2 breakpoints so units stay consistent */
@media (max-width:1280px) {
    .filters-row--top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filters-row--top .tile--span3 {
        grid-column: span 2;
    }

    /* search spans 2 at this width */
}

@media (max-width:768px) {
    .filters-row--top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-row--top .tile--span3 {
        grid-column: span 2;
    }

    /* search full width on mobile */
}

/* ▼ Add chevron to every dropdown filter trigger (Search is unaffected) */
.dropdown-filter .df-trigger {
    position: relative;
    padding-right: 28px;
    /* room for the arrow */
}

/* default chevron (pointing down) */
.dropdown-filter .df-trigger::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    /* ▼ */
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: .6;
    pointer-events: none;
}

/* hover/focus: slightly stronger */
.dropdown-filter .df-trigger:hover::after,
.dropdown-filter .df-trigger:focus-visible::after {
    opacity: .9;
}

/* open state — rotate chevron up (covers both aria + class approaches) */
.dropdown-filter .df-trigger[aria-expanded="true"]::after,
.dropdown-filter.is-open .df-trigger::after {
    transform: translateY(-50%) rotate(-135deg);
    /* ▲ */
}

/* allow [hidden] toggling used by filters and details */
[hidden] {
    display: none !important;
}

/* a little breathing room above the "More" link under cards */
.title-card .meta-bottom .more {
    padding-top: 6px;
}

.search-wrap {
    position: relative;
    overflow: visible;
}

#df-portal .df-panel {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

#df-portal .df-panel .df-actions {
    position: sticky;
    bottom: 0;
    top: auto;
    background: var(--card, #fff);
    box-shadow: 0 -6px 12px rgba(0, 0, 0, .06);
}

/* Selected/active filter tiles look grey */
.dropdown-filter.is-set .df-trigger,
.dropdown-filter .df-trigger.has-value {
    background: var(--fr-info-bg, #f3f4f6);
    border-color: var(--fr-info-border, #d1d5db);
    color: var(--text, #111);
}

/* Make the count/text stand out slightly */
.dropdown-filter.is-set .df-trigger .df-count,
.dropdown-filter .df-trigger.has-value .df-value {
    opacity: .95;
}

/* Optional: inside the panel, show chosen rows subtly */
.df-item input:checked+span {
    background: #f6f7f9;
    border-radius: 6px;
    padding: 1px 6px;
}

/* Selected/active tile appearance */
.dropdown-filter.is-set .df-trigger,
.dropdown-filter .df-trigger.has-value {
    background: var(--fr-info-bg, #f3f4f6);
    border-color: var(--fr-info-border, #d1d5db);
}

/* Portal panel look + sticky footer that doesn't stick to top of page */
#df-portal .df-panel {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

#df-portal .df-panel .df-actions {
    position: sticky;
    bottom: 0;
    top: auto;
    background: var(--card, #fff);
    box-shadow: 0 -6px 12px rgba(0, 0, 0, .06);
}

.df-item input:checked+span {
    background: #f6f7f9;
    border-radius: 6px;
    padding: 1px 6px;
}

.title-imdb-link .tn-title+.tn-title {
    margin-left: .25em;
}

/* The line with #rank, Title, (Year) */
.title-top {
    display: flex;
    align-items: baseline;
    /* keeps numbers/text aligned nicely */
    column-gap: .4rem;
    /* space between # and title */
    row-gap: .15rem;
    flex-wrap: wrap;
    /* allow wrapping as a group */
}

/* Let the anchor shrink and wrap on the same row as the rank */
.title-top .title-imdb-link {
    min-width: 0;
    /* critical so long titles wrap instead of pushing to a new flex line */
    overflow-wrap: anywhere;
    /* wrap long words safely */
}

/* Space between Title and (Year) even if the template space gets lost */
.title-imdb-link .tn-title+.tn-title,
.tn-title+.tn-year {
    margin-left: .3ch;
}

/* FR LIST — bulletproof mobile card (<1000px) */
/* ===== FR LIST – overflow-proof mobile card (<1000px) ===== */
@media (max-width:1000px) {

    /* Box-sizing everywhere to avoid width creep from paddings */
    .fr-table,
    .fr-table * {
        box-sizing: border-box;
    }

    /* The row is the card, and it may never exceed the viewport */
    .fr-table {
        max-width: 100%;
        overflow-x: hidden;
    }

    .fr-table tr {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .fr-table tr.is-mobile>td.fr-mobile-cell {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 12px;
        border: 0 !important;
        background: transparent;
    }

    /* Header: use flex and let the right column shrink properly */
    .fr-m-head {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        width: 100%;
    }

    .fr-m-media {
        flex: 0 0 140px;
        max-width: 140px;
    }

    .fr-m-media .poster {
        width: 140px;
    }

    .fr-m-media .poster img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 12px;
    }

    /* RIGHT column must be allowed to shrink, wrap, and never overflow */
    .fr-m-body {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }

    .fr-m-body,
    .fr-m-body * {
        word-break: normal !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        /* break long titles safely */
        min-width: 0;
    }

    /* Title line */
    .fr-m-title {
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .fr-m-title .tn-title {
        font-size: 15px;
    }

    .fr-m-title a {
        display: inline;
        max-width: 100%;
    }

    /* Actions line – allow wrapping and prevent single items from pushing width */
    .fr-m-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        max-width: 100%;
    }

    .fr-m-actions>* {
        min-width: 0;
    }

    .fr-m-actions .stars {
        display: flex;
        gap: 2px;
        white-space: nowrap;
    }

    .fr-m-actions .star {
        font-size: 18px;
        line-height: 1;
    }

    .fr-m-actions .star-clear {
        white-space: nowrap;
    }

    /* Tooltip bubble shouldn't push layout horizontally */
    .fr-table .info-bubble {
        max-width: min(320px, 90vw);
        left: auto;
        right: 0;
        white-space: normal;
    }

    /* Details stack below, values can wrap but never overflow */
    .fr-m-meta {
        margin-top: 10px;
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 6px;
        font-size: 13px;
        line-height: 1.45;
        max-width: 100%;
    }

    .fr-m-meta dd {
        margin: 0;
        min-width: 0;
    }

    .fr-m-plot {
        margin-top: 8px;
        color: var(--muted);
        line-height: 1.45;
        max-width: 100%;
    }
}

/* ========================= LIST (mobile hard-fix) ========================= */
@media (max-width:1000px) {

    /* 1) Kill the desktop min-width + scroller */
    .fr-table {
        min-width: 0 !important;
        width: 100% !important;
    }

    .list-wrap {
        overflow-x: visible !important;
    }

    /* 2) Cancel desktop column widths so cells can shrink */
    .fr-table thead th,
    .fr-table tbody td,
    .fr-table .col-title,
    .fr-table .col-cat,
    .fr-table .col-runtime,
    .fr-table .col-genre,
    .fr-table .col-country,
    .fr-table .col-lang,
    .fr-table .col-dir,
    .fr-table .col-wr,
    .fr-table .col-cast,
    .fr-table .col-plot {
        width: auto !important;
        min-width: 0 !important;
    }

    /* 3) If your older “labels” mobile CSS is present, keep it OFF for the new cards */
    .fr-table tr.is-mobile td {
        display: block !important;
    }

    .fr-table tr.is-mobile td::before {
        content: none !important;
    }

    /* 4) Make the poster | body header never overflow */
    .fr-m-head {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        width: 100%;
    }

    .fr-m-media {
        flex: 0 0 140px;
        max-width: 140px;
    }

    .fr-m-media .poster {
        width: 140px;
    }

    .fr-m-media .poster img {
        width: 100%;
        height: auto;
        border-radius: 12px;
        display: block;
    }

    .fr-m-body {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }

    .fr-m-body,
    .fr-m-body * {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        /* long titles wrap instead of pushing off-screen */
        min-width: 0;
    }

    /* Title + actions */
    .fr-m-title {
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .fr-m-title a {
        max-width: 100%;
        display: inline;
    }

    .fr-m-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        max-width: 100%;
    }

    .fr-m-actions>* {
        min-width: 0;
    }
}

/* ===== LIST - mobile polish: tighter title + one-line actions ===== */
@media (max-width:900px) {

    /* Smaller title on mobile */
    .fr-table .col-title .title-top,
    .fr-m-title {
        font-size: 12px !important;
        line-height: 1.28 !important;
        margin-bottom: 2px !important;
    }

    .fr-table .col-title .title-top .tn-title,
    .fr-m-title .tn-title {
        font-size: 12px !important;
        font-weight: 700 !important;
    }

    .fr-table .col-title .tn-year,
    .fr-m-title .tn-year {
        font-size: 12px !important;
        color: var(--muted) !important;
    }

    /* Actions row: [✓] [+] ★★★★★ Clear (i) — all on one line */
    .fr-table .col-title .fr-actions,
    .fr-m-actions {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        /* keep it in one line */
        max-width: 100% !important;
    }

    /* keep the two round buttons tight on the left */
    .fr-table .col-title .fr-actions .fr-btn,
    .fr-m-actions .fr-btn {
        flex: 0 0 auto !important;
    }

    /* stars + clear behave as one compact cluster */
    .fr-table .col-title .rating-row,
    .fr-m-actions .rating-row {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    .fr-table .col-title .stars,
    .fr-m-actions .stars {
        display: inline-flex !important;
        gap: 3px !important;
        white-space: nowrap !important;
    }

    /* NEVER break “Clear” across lines */
    .fr-table .col-title .star-clear,
    .fr-m-actions .star-clear {
        margin-left: 6px !important;
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    /* tiny nudge for the (i) bubble */
    .fr-table .col-title .rating-guide-tip,
    .fr-m-actions .rating-guide-tip {
        margin-left: 2px !important;
        flex: 0 0 auto !important;
    }
}

/* ===== LIST (mobile) — poster left, title + actions inline to the right ===== */
@media (max-width:1000px) {

    /* kill the “label column” on the first cell (it steals width) */
    .fr-table td:nth-child(1)::before {
        content: none !important;
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
    }

    /* make the title cell a 3-col grid: [poster | title | actions] */
    .fr-table .col-title .list-title {
        display: grid !important;
        grid-template-columns: 140px minmax(0, 1fr) auto !important;
        /* poster | title | actions */
        grid-auto-rows: auto;
        column-gap: 12px;
        row-gap: 6px;
        align-items: center;
    }

    .fr-table .col-title .poster {
        width: 140px !important;
        height: auto !important;
        aspect-ratio: 2/3;
        border-radius: 12px;
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    /* title (smaller on mobile) */
    .fr-table .col-title .title-top {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        display: flex;
        align-items: baseline;
        gap: .4rem;
        flex-wrap: wrap;
        font-size: 14px !important;
        line-height: 1.28 !important;
        margin: 0 !important;
    }

    .fr-table .col-title .title-top .tn-title {
        font-size: 14px !important;
        font-weight: 800;
    }

    .fr-table .col-title .title-top .tn-year {
        font-size: 13px !important;
        color: var(--muted);
    }

    /* actions live INLINE to the right of the title */
    .fr-table .col-title .fr-actions {
        grid-column: 3;
        grid-row: 1;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
    }

    .fr-table .col-title .fr-actions .fr-btn {
        flex: 0 0 auto;
    }

    /* stars + Clear kept compact; never break “Clear” */
    .fr-table .col-title .rating-row {
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .fr-table .col-title .stars {
        display: inline-flex;
        gap: 3px;
        white-space: nowrap;
    }

    .fr-table .col-title .star-clear {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    /* details below look normal */
    .fr-table tr {
        overflow: hidden;
    }

    /* no horizontal bleed */
}

/* ===== LIST (mobile) — poster left, title + actions inline to the right ===== */
@media (max-width:1000px) {

    /* kill the “label column” on the first cell (it steals width) */
    .fr-table td:nth-child(1)::before {
        content: none !important;
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
    }

    /* make the title cell a 3-col grid: [poster | title | actions] */
    .fr-table .col-title .list-title {
        display: grid !important;
        grid-template-columns: 140px minmax(0, 1fr) auto !important;
        /* poster | title | actions */
        grid-auto-rows: auto;
        column-gap: 12px;
        row-gap: 6px;
        align-items: center;
    }

    .fr-table .col-title .poster {
        width: 140px !important;
        height: auto !important;
        aspect-ratio: 2/3;
        border-radius: 12px;
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    /* title (smaller on mobile) */
    .fr-table .col-title .title-top {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        display: flex;
        align-items: baseline;
        gap: .4rem;
        flex-wrap: wrap;
        font-size: 14px !important;
        line-height: 1.28 !important;
        margin: 0 !important;
    }

    .fr-table .col-title .title-top .tn-title {
        font-size: 14px !important;
        font-weight: 800;
    }

    .fr-table .col-title .title-top .tn-year {
        font-size: 13px !important;
        color: var(--muted);
    }

    /* actions live INLINE to the right of the title */
    .fr-table .col-title .fr-actions {
        grid-column: 3;
        grid-row: 1;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
    }

    .fr-table .col-title .fr-actions .fr-btn {
        flex: 0 0 auto;
    }

    /* stars + Clear kept compact; never break “Clear” */
    .fr-table .col-title .rating-row {
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .fr-table .col-title .stars {
        display: inline-flex;
        gap: 3px;
        white-space: nowrap;
    }

    .fr-table .col-title .star-clear {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    /* details below look normal */
    .fr-table tr {
        overflow: hidden;
    }

    /* no horizontal bleed */
}

/* Only one rating bubble (we render via portal) */
.rating-guide-tip+.info-bubble {
    display: none !important;
}

/* Wrap text and size safely on all screens */
max-width: min(420px, calc(100vw - 24px)) !important;
white-space: normal;
overflow-wrap: anywhere;
word-break: normal;
box-sizing: border-box;
}

/* Brand lockup: 2/3 name, 1/3 powered-by, aligned to logo box */
.brand-link{
  display:flex; align-items:stretch; gap:10px;
}
.brand-link .fr-logo{
  flex:0 0 40px; width:40px; height:40px;
  display:grid; place-items:center;
  border-radius:8px; background:var(--accent); color:#fff;
  font-weight:1000; font-size:22px;
}

/* Text block matches logo height; rows scale 2:1 */
.brand-text{
  display:grid; grid-template-rows:2fr 1fr;
  height:40px; line-height:1;
}
.brand-name{
  align-self:start;
  font-weight:800; letter-spacing:-.01em;
  font-size:clamp(18px, 2.2vw, 22px);
  white-space:nowrap;
}
.brand-powered{
  align-self:end;
  font-style:italic; font-size:12px; color:#6b7177;
}
.brand-powered strong{ font-weight:800; }

/* small-screen nudge */
@media (max-width:480px){
  .brand-name{ font-size:18px; }
  .brand-powered{ font-size:11px; }
}


.brand-link{ display:flex; align-items:stretch; gap:10px; }
.brand-link a{ color:inherit; text-decoration:none; }

.brand-text{ display:grid; grid-template-rows:2fr 1fr; height:40px; line-height:1; }
.brand-name{ align-self:start; font-weight:800; letter-spacing:-.01em; }
.brand-powered{ align-self:end; font-style:italic; font-size:12px; color:#6b7177; }
.brand-powered strong{ font-weight:800; }


.brand-link{ display:flex; align-items:stretch; gap:10px; }
.brand-link a{ color:inherit; text-decoration:none; }

/* 2/3 (name) + 1/3 (powered) */
.brand-text{
  display:grid;
  grid-template-rows: 2fr 1fr;
  height:40px;          /* same as logo box */
  line-height:1;
}

/* Center the NAME within its 2/3 row */
.brand-name{
  align-self:center;     /* <-- was start */
  font-weight:800;
  letter-spacing:-.01em;
  font-size:clamp(18px, 2.2vw, 22px);
  white-space:nowrap;
}

/* Keep “Powered by …” hugging the bottom */
.brand-powered{
  align-self:end;
  font-style:italic;
  font-size:12px;
  color:#6b7177;
}
.brand-powered strong{ font-weight:800; }

/* Optional: tiny tweak on very small screens */
@media (max-width:480px){
  .brand-name{ font-size:18px; }
  .brand-powered{ font-size:11px; }
}


/* Your dl already uses a 2-col grid (labels/values). Make these span both. */
.fr-m-meta .fr-m-rowfull { grid-column: 1 / -1; }
.fr-m-titleline, .fr-m-ratingline { margin: 2px 0 4px; display: flex; align-items: center; gap: 8px; }


.site-nav .cta-lists{
  display:inline-flex;align-items:center;gap:8px;
  height:32px;padding:0 12px;border:1px solid var(--border);
  border-radius:999px;background:#fff;font-weight:800;
}
.site-nav .cta-lists:hover{ background:#fafafa; }




.fr-related { margin: 24px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.fr-related__h { margin: 0 0 10px; font-size: 16px; }
.fr-related__ul { 
  list-style: none; padding: 0; margin: 0; 
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px;
}
.fr-related__ul a { color: #2563eb; }
.fr-related__ul a:hover { text-decoration: underline; }

.related-lists { margin: 28px 0 8px; }
.related-lists h2 { font-size: 18px; margin: 0 0 10px; }
.link-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; list-style: none; padding: 0; margin: 0;
}
.link-grid a {
  display: block; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; font-weight: 700;
}
.link-grid a:hover { background: #fafafa; }


/* ===== Header nav: keep everything on one tidy row ===== */
.site-nav{
  margin-left:auto;               /* push to the right side of header */
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}

/* Left CTA (lists) keeps existing button look */
.site-nav .cta-lists{ height:32px; padding:0 12px; border-radius:999px; }

/* Right auth block */
.site-nav .auth-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}

/* Pills */
.auth-pill{
  display:inline-flex; align-items:center; height:32px; padding:0 12px;
  border:1px solid var(--border); border-radius:999px; font-weight:800; background:#fff;
}
.auth-pill--primary{ background:var(--accent); border-color:var(--accent); color:#fff; }

/* Google button (compact in header) */
.auth-google{ height:32px; padding:0 12px; border-radius:10px; font-weight:800; }

/* Remove dot separators that were injected earlier */
.site-nav a+a::before{ content:none !important; }

/* Small screens: allow wrap without odd breaks */
@media (max-width:640px){
  .site-nav{ width:100%; justify-content:flex-start; }
  .site-nav .auth-row{ gap:8px; }
  .auth-google{ flex:1 1 auto; }
}

/* ===== Ribbon under footer ===== */
.site-ribbon{
  width:100%;
  background:#fff;
  border-top:1px solid var(--border);
  box-shadow: 0 -1px 2px rgba(0,0,0,.03) inset;
}
.site-ribbon .ribbon-inner{
  width:min(var(--page-max), calc(100% - (var(--side-pad)*2)));
  margin-inline:auto;
  padding:10px var(--panel-pad);
  font-size:16px; color:#475569; text-align:center;
}
.site-ribbon .ribbon-link{ color:#2563eb; text-decoration:underline; }
.site-ribbon .ribbon-link:hover{ text-decoration:none; }

/* Selected filters chips */
.actions-left { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.active-filters {
  flex-basis: 100%;        /* forces chips to a new line under the hint */
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  margin-top:4px;
}
.active-filters:empty { display:none; }

.filter-chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:2px 10px; border:1px solid var(--border);
  background:#fff; border-radius:999px; font-size:12.5px; line-height:1.8;
}
.filter-chip .chip-group { color:#64748b; font-weight:700; }
.filter-chip .chip-text  { color:#111827; }
.filter-chip .chip-x {
  appearance:none; border:0; background:transparent; cursor:pointer;
  font-size:16px; line-height:1; padding:0 0 0 2px; color:#475569;
}
.filter-chip .chip-x:hover { color:#0f172a; }
