:root {
    color-scheme: light;
    --bg: #eef4f1;
    --panel: #fbfdfb;
    --ink: #14120f;
    --muted: #5f6c70;
    --line: rgba(15, 23, 42, 0.12);
    --soft: rgba(255, 255, 255, 0.68);
    --accent: #0f172a;
    --accent-2: #0f766e;
    --nope: #b42318;
    --yep: #1d4ed8;
    --gold: #a16207;
    --shadow: 0 28px 90px rgba(15, 23, 42, 0.16);
    --shadow-soft: 0 16px 42px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.24), transparent 30rem),
        radial-gradient(circle at 92% 8%, rgba(244, 114, 182, 0.18), transparent 24rem),
        radial-gradient(circle at 58% 100%, rgba(251, 191, 36, 0.18), transparent 28rem),
        linear-gradient(135deg, #f8fbfa 0%, var(--bg) 58%, #edf2ff 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

button,
textarea {
    font: inherit;
}

svg {
    width: 1em;
    height: 1em;
    stroke-width: 2.25;
}

.app-shell {
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 20px 16px 34px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: #14120f;
    color: #fff7eb;
    box-shadow: 0 10px 28px rgba(20, 18, 15, 0.22);
}

.brand-mark svg {
    width: 20px;
    height: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.top-note {
    border: 1px solid rgba(20, 18, 15, 0.12);
    border-radius: 999px;
    padding: 8px 11px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.hero,
.results-summary,
.empty-state {
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 253, 251, 0.78));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 22px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(15, 118, 110, 0.06) 100%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    gap: 24px;
}

.hero-main {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 0 auto;
}

.eyebrow,
.section-label,
.mini-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow svg {
    width: 15px;
    height: 15px;
}

.hero h1,
.results-summary h1 {
    margin: 0;
    max-width: 13ch;
    font-size: clamp(2.35rem, 10vw, 4.7rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.lede,
.count-line,
.empty-state p,
.sheet-panel p {
    color: var(--muted);
    line-height: 1.55;
}

.lede {
    max-width: 35rem;
    margin: 18px 0 0;
    font-size: 1.06rem;
}

.search-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.chip-search-form {
    gap: 18px;
}

.chip-picker {
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 20px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.chip-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chip-picker h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.1;
}

.input-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    border: 1px solid rgba(180, 35, 24, 0.20);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 34px rgba(45, 34, 20, 0.08);
    padding: 14px;
}

.input-shell > svg {
    width: 22px;
    height: 22px;
    margin-top: 4px;
    color: var(--nope);
}

textarea {
    width: 100%;
    min-height: 138px;
    resize: vertical;
    border: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    font-size: 1.08rem;
    line-height: 1.5;
}

textarea:focus {
    outline: 0;
}

textarea::placeholder {
    color: #a09589;
}

.quick-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-examples button,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(180, 35, 24, 0.18);
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(255, 245, 243, 0.92);
    color: var(--nope);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 850;
}

.selectable-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    border: 1px solid rgba(20, 18, 15, 0.10);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 900;
}

.selectable-chip svg {
    width: 15px;
    height: 15px;
}

.selectable-chip.chip-nope.is-selected {
    border-color: rgba(180, 35, 24, 0.26);
    background: rgba(255, 245, 243, 0.98);
    color: var(--nope);
    box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.12);
}

.selectable-chip.chip-yep.is-selected {
    border-color: rgba(29, 78, 216, 0.22);
    background: #eaf1ff;
    color: var(--yep);
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.10);
}

.selected-strip {
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-size: 0.88rem;
    font-weight: 900;
}

.compact-button {
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 0.84rem;
}

.quick-examples svg {
    width: 15px;
    height: 15px;
}

.chip {
    cursor: default;
}

.chip-yep {
    border-color: rgba(29, 78, 216, 0.15);
    background: #eaf1ff;
    color: var(--yep);
}

.chip-neutral {
    border-color: rgba(20, 18, 15, 0.1);
    background: rgba(255, 255, 255, 0.8);
    color: var(--muted);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.86rem;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 900;
}

.primary-button {
    width: 100%;
    padding: 14px 18px;
    background: var(--accent);
    color: white;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
}

.primary-button:hover {
    background: #000;
}

.secondary-button {
    width: 100%;
    margin-top: 14px;
    padding: 13px 18px;
    background: var(--accent-2);
    color: white;
}

.ghost-button {
    padding: 12px 16px;
    background: rgba(20, 18, 15, 0.06);
    color: var(--ink);
}

.mood-sheet,
.chip-sheet,
.filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
}

.mood-sheet.is-open,
.chip-sheet.is-open,
.filter-sheet.is-open {
    display: block;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 20, 0.48);
}

.sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 720px);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: #fbfdfb;
    box-shadow: 0 -24px 80px rgba(23, 27, 34, 0.28);
    padding: 14px 18px 18px;
}

.sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    margin: 0 auto 16px;
    background: #d4c8b8;
}

.sheet-panel h2 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.sheet-panel p {
    margin: 0 0 14px;
}

.sheet-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.field-label {
    display: block;
    margin: 14px 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chip-sheet-content {
    max-height: min(54vh, 520px);
    overflow: auto;
    margin-top: 14px;
    padding-right: 2px;
}

.chip-group + .chip-group {
    margin-top: 16px;
}

.chip-group h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.edit-chip-form {
    margin-top: 14px;
}

.sample-row {
    margin-top: 10px;
}

.tmdb-attribution {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    border: 1px solid rgba(20, 18, 15, 0.10);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--muted);
}

.tmdb-attribution p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
}

.tmdb-badge {
    flex: 0 0 auto;
    border-radius: 8px;
    padding: 6px 8px;
    background: #0d253f;
    color: #90cea1;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.results-summary,
.empty-state {
    padding: 18px;
}

.filter-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 18px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.62);
}

.filter-summary p {
    margin: 0;
    color: var(--ink);
    line-height: 1.35;
}

.filter-summary .ghost-button {
    width: 100%;
}

.narrowing-meter {
    margin-top: 14px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 18px;
    padding: 13px;
    background: rgba(236, 253, 245, 0.62);
}

.meter-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.meter-copy strong {
    font-size: 1rem;
}

.meter-copy span {
    color: var(--muted);
    font-size: 0.84rem;
}

.meter-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.10);
}

.meter-track span {
    display: block;
    width: 78%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #14b8a6, #f97316);
    animation: narrowIn 900ms ease-out both;
}

.planner-note {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.result-sort {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.result-sort a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 12px;
    padding: 9px 10px;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
}

.result-sort a.is-active {
    border-color: rgba(15, 118, 110, 0.26);
    background: #e9fbf6;
    color: #0f766e;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.result-sort svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.inline-debug-link {
    display: inline-flex;
    margin-left: 6px;
    color: #0f766e;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.debug-disabled {
    margin-top: 14px;
    border: 1px solid rgba(180, 35, 24, 0.16);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 245, 243, 0.86);
    color: var(--nope);
    font-size: 0.86rem;
    font-weight: 800;
}

.debug-disabled code {
    font: 0.82rem/1.2 Consolas, "Liberation Mono", monospace;
}

.debug-panel {
    margin-top: 14px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.debug-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 13px;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 900;
}

.debug-grid {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.debug-grid h2 {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.debug-grid pre {
    max-height: 280px;
    margin: 0;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 12px;
    padding: 10px;
    background: #101820;
    color: #d9fff3;
    font: 0.78rem/1.45 Consolas, "Liberation Mono", monospace;
}

@keyframes narrowIn {
    from {
        width: 10%;
        opacity: 0.45;
    }

    to {
        width: 78%;
        opacity: 1;
    }
}

.summary-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.feedback-panel {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 14px;
    padding: 13px;
    background: #ffffff;
}

.feedback-panel p {
    margin: 0;
    color: var(--ink);
    font-weight: 900;
}

.feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-actions .ghost-button {
    min-height: 40px;
}

.feedback-actions .ghost-button.is-selected {
    background: #e9fbf6;
    color: #0f766e;
}

.feedback-actions .ghost-button:disabled {
    cursor: default;
    opacity: 0.74;
}

.feedback-status {
    color: var(--muted) !important;
    font-size: 0.86rem;
    font-weight: 800 !important;
}

.result-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.result-card {
    display: grid;
    grid-template-columns: 106px 1fr;
    gap: 14px;
    align-items: start;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
}

.poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: #d9d2c8;
}

.poster img,
.poster-placeholder {
    width: 100%;
    height: 100%;
}

.poster img {
    display: block;
    object-fit: cover;
}

.poster-placeholder {
    display: grid;
    place-items: center;
    padding: 10px;
    color: var(--muted);
    font-weight: 900;
    text-align: center;
}

.result-body {
    min-width: 0;
}

.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.title-row h2 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.title-row p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.rating {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e8f8ee;
    color: #067647;
    padding: 6px 8px;
    font-weight: 900;
    font-size: 0.78rem;
}

.overview {
    display: -webkit-box;
    margin: 11px 0;
    overflow: hidden;
    color: #4d463e;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.reason-block {
    border-top: 1px solid rgba(20, 18, 15, 0.09);
    margin-top: 10px;
    padding-top: 10px;
}

.reason-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.action-grid button,
.action-grid .card-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    border: 1px solid rgba(20, 18, 15, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 900;
    text-align: center;
}

.is-hidden {
    display: none;
}

.is-hidden.is-visible {
    display: block;
}

.loading-layer {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(11, 18, 24, 0.46);
}

.is-searching .loading-layer {
    display: grid;
}

.loading-layer div {
    width: min(100%, 320px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    padding: 22px;
    background: #fbfdfb;
    box-shadow: var(--shadow);
    text-align: center;
}

.loading-layer span {
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border: 4px solid rgba(15, 118, 110, 0.18);
    border-top-color: var(--accent-2);
    border-radius: 999px;
    animation: spin 780ms linear infinite;
}

.loading-layer strong {
    display: block;
    font-size: 1.06rem;
}

.loading-layer p {
    margin: 7px 0 0;
    color: var(--muted);
}

@keyframes spin {
    to {
        rotate: 360deg;
    }
}

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

@media (max-width: 430px) {
    .app-shell {
        padding: 18px 12px 28px;
    }

    .hero {
        padding: 18px;
        border-radius: 22px;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 12vw, 3.6rem);
    }

    .result-card {
        grid-template-columns: 94px 1fr;
        gap: 12px;
    }

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

@media (min-width: 760px) {
    .app-shell {
        padding-top: 28px;
    }

    .hero {
        padding: 34px;
    }

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

    .feedback-panel {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .feedback-status {
        grid-column: 1 / -1;
    }

    .filter-summary {
        grid-template-columns: 1fr 1fr auto;
        align-items: center;
    }

    .filter-summary .ghost-button {
        width: auto;
        min-width: 104px;
    }

    .result-sort {
        display: flex;
        flex-wrap: wrap;
    }

    .result-sort a {
        min-width: 126px;
    }

    .sheet-actions {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .sheet-actions .ghost-button {
        min-width: 104px;
    }
}

/* UI revamp overrides */
body {
    background: linear-gradient(180deg, #f7faf8 0%, #eef5f1 48%, #f8fafc 100%);
}

.app-shell {
    max-width: 980px;
}

.topbar {
    margin-bottom: 14px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.top-note {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ffffff;
}

.hero,
.results-summary,
.empty-state {
    border-color: rgba(15, 23, 42, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
}

.hero {
    padding: 18px;
}

.hero::before {
    display: none;
}

.hero-main {
    max-width: 720px;
}

.hero h1,
.results-summary h1 {
    max-width: 15ch;
    font-size: clamp(2rem, 9vw, 3.55rem);
    line-height: 1;
}

.lede {
    margin-top: 12px;
    max-width: 31rem;
    font-size: 1rem;
}

.trust-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.chip-picker {
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.chip-picker h2 {
    font-size: 1rem;
}

.eyebrow,
.section-label,
.mini-label {
    margin-bottom: 8px;
    letter-spacing: 0.06em;
}

.selectable-chip {
    min-height: 44px;
    border-radius: 12px;
    padding: 9px 12px;
    background: #fff;
    color: #1f2937;
}

.selectable-chip.is-selected::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.selectable-chip.chip-nope.is-selected {
    border-color: rgba(190, 60, 45, 0.34);
    background: #fff1ef;
    color: #a53325;
}

.selectable-chip.chip-yep.is-selected {
    border-color: rgba(15, 118, 110, 0.28);
    background: #e9fbf6;
    color: #0f766e;
}

.selected-strip {
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 12px;
    background: #eefaf6;
    color: #0f5f59;
    line-height: 1.35;
}

.primary-button,
.secondary-button,
.ghost-button {
    min-height: 46px;
    border-radius: 12px;
}

.primary-button {
    background: #111827;
}

.secondary-button {
    background: #0f766e;
}

.ghost-button {
    background: rgba(15, 23, 42, 0.06);
}

.compact-button {
    min-height: 40px;
}

.sheet-backdrop {
    border: 0;
    padding: 0;
    cursor: pointer;
}

.sheet-panel {
    border-radius: 20px 20px 0 0;
    padding: 14px 16px 16px;
}

.chip-sheet-content {
    max-height: min(58vh, 540px);
}

.sheet-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(251, 253, 251, 0), #fbfdfb 28%);
}

.results-summary {
    padding: 16px;
}

.filter-summary {
    border-radius: 14px;
    background: #ffffff;
}

.narrowing-meter {
    border-radius: 14px;
    background: #f0fdf8;
}

.meter-copy {
    align-items: flex-start;
}

.meter-copy strong {
    color: #10201f;
}

.summary-grid {
    gap: 12px;
}

.result-list {
    gap: 12px;
}

.result-card {
    grid-template-columns: 92px 1fr;
    gap: 12px;
    border-color: rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.poster {
    border-radius: 12px;
}

.title-row h2 {
    font-size: 1.05rem;
    line-height: 1.18;
}

.overview {
    margin: 9px 0;
    font-size: 0.92rem;
    -webkit-line-clamp: 3;
}

.reason-block {
    margin-top: 8px;
    padding-top: 8px;
}

.reason-block p {
    font-size: 0.86rem;
}

.action-grid {
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
}

.action-grid button,
.action-grid .card-action-link {
    min-height: 40px;
    border-radius: 10px;
    padding: 0 10px;
}

.action-grid .card-primary-action {
    background: #111827;
    color: white;
}

.empty-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.empty-actions .primary-button,
.empty-actions .ghost-button {
    width: 100%;
}

.tmdb-attribution {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.trailer-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}

.trailer-modal.is-open {
    display: block;
}

.trailer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(8, 13, 18, 0.66);
    cursor: pointer;
}

.trailer-panel {
    position: absolute;
    right: 12px;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    max-width: 860px;
    max-height: calc(100vh - 24px);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    overflow: hidden;
    background: #0b1117;
    color: #fff;
    box-shadow: 0 28px 100px rgba(0, 0, 0, 0.42);
}

.trailer-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
}

.trailer-head h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trailer-open-link {
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 900;
}

.trailer-close-button {
    min-height: 40px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.trailer-frame-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 132px);
    background: #05080c;
}

.trailer-frame-wrap iframe,
.trailer-message {
    width: 100%;
    height: 100%;
}

.trailer-frame-wrap iframe {
    display: block;
    border: 0;
}

.trailer-frame-wrap iframe[hidden],
.trailer-message[hidden],
.trailer-help[hidden],
.trailer-open-link[hidden] {
    display: none !important;
}

.trailer-message {
    display: grid;
    place-items: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 850;
    text-align: center;
}

.trailer-help {
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding: 10px 12px 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    line-height: 1.35;
}

@media (max-width: 430px) {
    .app-shell {
        padding: 14px 12px 28px;
    }

    .topbar {
        gap: 8px;
    }

    .brand {
        gap: 8px;
        font-size: 0.96rem;
    }

    .hero {
        padding: 14px;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
    }

    .chip-search-form {
        gap: 12px;
        margin-top: 18px;
    }

    .chip-picker-head {
        align-items: flex-start;
        margin-bottom: 10px;
    }

    .result-card {
        grid-template-columns: 86px 1fr;
        gap: 10px;
        padding: 10px;
    }

    .rating {
        padding: 5px 7px;
    }

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

    .action-grid button,
    .action-grid .card-action-link {
        width: 100%;
    }
}

@media (min-width: 760px) {
    .hero {
        padding: 26px;
    }

    .chip-search-form {
        gap: 16px;
    }

    .result-card {
        grid-template-columns: 118px 1fr;
    }

    .empty-actions {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}
