/*
 * Fi1m — Discover (the app)
 * =========================
 * Three panes. Left: the shelf (your collections as poster stacks; expands
 * to threads + collections). Centre: an editorial Q&A, not a chat log.
 * Right: a floating citation card. Both side panes animate width so the
 * reading column reflows; below 900px they become overlays.
 */

:root {
    --rail-w: 64px;
    --drawer-w: 300px;
    --aside-w: 424px;
    --topbar-h: 60px;
    --col-w: 880px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --shelf-bg: var(--card-background);
}

html, body { height: 100%; }
body { overflow: hidden; }

.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    background: var(--background);
}

/* Atmosphere: a faint red wash at the top of the reading column, dark theme only */
.main::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 320px;
    background: radial-gradient(60% 100% at 50% 0%, rgba(var(--primary-rgb), 0.10), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .main::before { opacity: 0.5; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-muted);
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover { background: var(--search-background); color: var(--text-color); }
.icon-btn svg { width: 18px; height: 18px; }

.wordmark {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.04em;
    color: var(--primary);
    line-height: 1;
}

.wordmark:hover { color: var(--primary); }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--heading-color);
    color: var(--background);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar:hover { color: var(--background); background: var(--primary); }

/* ------------------------------------------------------------------ */
/* The shelf (left)                                                    */
/* ------------------------------------------------------------------ */
.shelf {
    position: relative;
    flex-shrink: 0;
    width: var(--rail-w);
    background: var(--shelf-bg);
    overflow: hidden;
    transition: width 0.32s var(--ease);
    z-index: 2;
}

.app.sidebar-open .shelf { width: var(--drawer-w); }

.rail,
.drawer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.rail {
    width: var(--rail-w);
    align-items: center;
    padding: 18px 0 14px;
    gap: 6px;
}

.drawer {
    width: var(--drawer-w);
    opacity: 0;
    visibility: hidden;
}

.app.sidebar-open .rail { opacity: 0; visibility: hidden; }
.app.sidebar-open .drawer { opacity: 1; visibility: visible; transition-delay: 0.1s; }

.rail .wordmark { margin-bottom: 14px; }

.rail-rule {
    width: 24px;
    height: 1px;
    background: var(--border-color);
    margin: 10px 0 14px;
}

.rail-stacks {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

/* A stack: three posters, fanned. Reads as a pile of films, not an icon. */
.stack {
    position: relative;
    width: 30px;
    height: 44px;
    transition: transform 0.25s var(--ease);
}

.stack img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s var(--ease);
}

.stack img:nth-child(1) { transform: rotate(-9deg) translateX(-5px); }
.stack img:nth-child(2) { transform: rotate(0deg) translateY(-1px); }
.stack img:nth-child(3) { transform: rotate(8deg) translateX(5px); }

.stack:hover img:nth-child(1) { transform: rotate(-14deg) translateX(-9px); }
.stack:hover img:nth-child(3) { transform: rotate(13deg) translateX(9px); }

.rail-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Drawer */
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: var(--topbar-h);
    padding: 0 10px 0 18px;
    flex-shrink: 0;
}

.drawer-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.drawer-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-color-muted);
}

.drawer-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 12px;
    padding: 0 10px;
    height: 36px;
    border-radius: 8px;
    background: var(--search-background);
    color: var(--text-color-muted);
    transition: background-color 0.2s ease;
}

.drawer-search:focus-within { background: var(--search-focus-background); }
.drawer-search svg { width: 15px; height: 15px; flex-shrink: 0; }

.drawer-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.82rem;
    outline: none;
}

.drawer-search input::placeholder { color: var(--placeholder-color); }
.drawer-search input::-webkit-search-cancel-button { display: none; }

.kbd {
    font-size: 0.65rem;
    color: var(--gray);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-color-muted);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.tab:hover { color: var(--text-color); }
.tab[aria-selected="true"] { color: var(--heading-color); background: var(--search-background); }

.tab-new {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-muted);
}

.tab-new:hover { background: var(--search-background); color: var(--text-color); }
.tab-new svg { width: 15px; height: 15px; }

.drawer-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px 12px;
    scrollbar-width: thin;
}

.group-label {
    padding: 8px 10px 6px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-color);
    transition: background-color 0.15s ease;
}

.thread-item:hover,
.thread-item[aria-current="true"] { background: var(--search-background); }

.thread-item[aria-current="true"] .thread-title { color: var(--heading-color); font-weight: 500; }

.thread-thumb {
    width: 26px;
    height: 38px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--search-background);
}

.thread-item > span { display: flex; flex-direction: column; min-width: 0; }

.thread-title {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-meta { font-size: 0.68rem; color: var(--gray); margin-top: 1px; }

.coll {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text-color);
    transition: background-color 0.15s ease;
}

.coll:hover { background: var(--search-background); color: var(--text-color); }

.fan {
    position: relative;
    width: 52px;
    height: 46px;
    flex-shrink: 0;
}

.fan img {
    position: absolute;
    top: 3px;
    left: 11px;
    width: 30px;
    height: 42px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s var(--ease);
}

.fan img:nth-child(1) { transform: rotate(-10deg) translateX(-8px); }
.fan img:nth-child(3) { transform: rotate(10deg) translateX(8px); }
.coll:hover .fan img:nth-child(1) { transform: rotate(-15deg) translateX(-12px); }
.coll:hover .fan img:nth-child(3) { transform: rotate(15deg) translateX(12px); }

.fan-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--gray);
}

.fan-empty svg { width: 16px; height: 16px; }

.coll-body { display: flex; flex-direction: column; min-width: 0; }
.coll-name { font-size: 0.85rem; font-weight: 500; color: var(--heading-color); }
.coll-meta { font-size: 0.7rem; color: var(--gray); }
.coll-new .coll-name { color: var(--text-color-muted); font-weight: 400; }

.drawer-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 500; flex: 1; }
.foot-link { font-size: 0.72rem; color: var(--gray); }
.foot-link:hover { color: var(--text-color); }

.drawer-empty {
    padding: 14px 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--gray);
}

/* An answer that could not be produced */
.a-error {
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    font-size: 0.9rem;
    color: var(--text-color);
}

/* ------------------------------------------------------------------ */
/* Centre                                                              */
/* ------------------------------------------------------------------ */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.topbar {
    position: relative;
    z-index: 1;
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 20px;
    gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }

.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    min-width: 0;
}

.crumb-root { color: var(--text-color-muted); font-weight: 500; }
.crumb-sep { color: var(--gray); }

.crumb-title {
    color: var(--heading-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.topbar-right { display: flex; align-items: center; gap: 6px; }

.topbar .theme-toggle {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 8px;
    background: transparent;
}

.topbar .theme-toggle:hover { background: var(--search-background); }
.topbar .theme-toggle svg { width: 17px; height: 17px; }

.leave {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-color-muted);
    padding: 6px 4px 6px 10px;
}

.leave svg { width: 13px; height: 13px; transition: transform 0.2s ease; }
.leave:hover { color: var(--heading-color); }
.leave:hover svg { transform: translateX(2px); }

.mobile-only { display: none; }

.stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.col {
    width: 100%;
    max-width: var(--col-w);
    margin: 0 auto;
    padding: 0 28px;
}

/* Empty state */
.welcome {
    min-height: 100%;
    display: flex;
    align-items: center;
    padding: 40px 0 56px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-color-muted);
    margin-bottom: 14px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.welcome h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 14px;
}

.lead {
    font-size: 0.95rem;
    color: var(--text-color-muted);
    max-width: 640px;
    margin-bottom: 30px;
}

/* The prompt: a rule, not a box */
.prompt {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 4px 0 12px;
    border-bottom: 2px solid var(--border-color);
    transition: border-color 0.25s ease;
}

.prompt::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.prompt:focus-within::after { transform: scaleX(1); }

.prompt textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--heading-color);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    resize: none;
    outline: none;
    min-height: 32px;
    max-height: 200px;
    padding: 4px 0;
}

.prompt textarea::placeholder { color: var(--placeholder-color); font-weight: 400; }

.go {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s var(--ease);
}

.go svg { width: 18px; height: 18px; }
.go:hover { background: var(--link-hover); transform: translateY(-1px); }
.go:disabled { opacity: 0.25; cursor: default; transform: none; background: var(--heading-color); }

/* Mood tiles: poster-backed starting points */
.moods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 26px 0 22px;
}

.mood {
    position: relative;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
    color: #fff;
    background: var(--card-background);
    isolation: isolate;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.mood img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 0.4s var(--ease);
}

.mood:hover img { transform: scale(1.04); }

.mood::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.15) 100%);
    transition: opacity 0.25s ease;
}

.mood:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.mood:hover::before { opacity: 0.85; }

.mood span {
    display: block;
    padding: 0 12px 10px;
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.fine {
    font-size: 0.72rem;
    color: var(--gray);
    line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Thread: a Q&A column, not a chat log                                */
/* ------------------------------------------------------------------ */
.thread {
    display: none;
    padding-top: 12px;
    padding-bottom: 32px;
}

.app.has-thread .welcome { display: none; }
.app.has-thread .thread { display: block; }

.turn + .turn { margin-top: 36px; }

.q {
    padding: 14px 0 18px;
    border-bottom: 1px solid var(--border-color);
    animation: rise 0.35s var(--ease) both;
}

.q-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 8px;
}

.q h2 {
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.a {
    padding-top: 20px;
    animation: rise 0.4s var(--ease) both;
}

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

.a-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-color-muted);
    margin-bottom: 16px;
}

.a-head .wordmark { font-size: 0.85rem; }
.a-head .sep { color: var(--gray); }

.a-body {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-color);
}

.a-body p { margin-bottom: 14px; }
.a-body p:last-child { margin-bottom: 0; }

.a-body h4 {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-color-muted);
    margin: 26px 0 10px;
}

.a-body ul { list-style: none; margin-bottom: 14px; }

.a-body li {
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.a-body li:last-child { border-bottom: 1px solid var(--border-color); }
.a-body li strong { color: var(--heading-color); font-weight: 600; }
.a-body a { border-bottom: 1px solid rgba(var(--primary-rgb), 0.35); }

/* Citation marker: a small ringed number, like a footnote */
.cite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin: 0 2px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1;
    vertical-align: 0.35em;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cite:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.cite[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* The shelf row: posters standing on a line */
.shelf-row {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin: 16px 0 24px;
    padding: 8px 6px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.shelf-row::-webkit-scrollbar { display: none; }

.shelf-row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(to right, var(--border-color), var(--text-color-muted) 40%, var(--border-color));
    opacity: 0.6;
}

.pick {
    flex: 0 0 104px;
    text-align: left;
    color: inherit;
    transition: transform 0.25s var(--ease);
}

.pick:hover { transform: translateY(-4px); }

.pick img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    transition: box-shadow 0.25s var(--ease);
}

.pick:hover img { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4); }

/* Selected: a ring that follows the poster's corners, and the title picks up the brand colour */
.pick[aria-pressed="true"] img {
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.pick[aria-pressed="true"] .pick-title { color: var(--primary); }

/* The shelf line already separates the row from what follows */
.shelf-row + ul li:first-child { border-top: none; }
.shelf-row + .sources { margin-top: 0; padding-top: 0; border-top: none; }

.pick-title {
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--heading-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pick-meta { font-size: 0.68rem; color: var(--gray); }
.pick-meta b { color: var(--primary); font-weight: 700; }

/* Sources: a numbered list at the foot of the answer */
.sources {
    margin-top: 26px;
    padding-top: 12px;
    border-top: 2px solid var(--heading-color);
}

.sources-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 4px;
}

.source {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 9px 6px 9px 2px;
    border-radius: 6px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.source:last-child { border-bottom: none; }
.source:hover { background: var(--search-background); }

.source .cite { vertical-align: baseline; margin: 0; flex-shrink: 0; }
.source-title { flex: 1; min-width: 0; font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-kind { font-size: 0.68rem; color: var(--gray); flex-shrink: 0; }
.source[aria-pressed="true"] .source-title { color: var(--primary); }

.typing {
    display: inline-flex;
    gap: 5px;
    padding: 22px 0;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typing 1.3s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Follow-up prompt, pinned */
.thread-composer {
    display: none;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding: 6px 28px 18px;
    background: linear-gradient(to bottom, rgba(var(--background-rgb), 0), rgba(var(--background-rgb), 1) 40%);
}

.app.has-thread .thread-composer { display: block; }

.thread-composer .prompt {
    max-width: var(--col-w);
    margin: 0 auto;
}

.thread-composer .prompt textarea { font-size: 1rem; }
.thread-composer .go { width: 36px; height: 36px; }

/* ------------------------------------------------------------------ */
/* Citation card (right)                                               */
/* ------------------------------------------------------------------ */
.aside {
    flex-shrink: 0;
    width: 0;
    overflow: hidden;
    padding: 12px 0;
    transition: width 0.32s var(--ease);
    z-index: 2;
}

.app.aside-open .aside { width: var(--aside-w); }

.aside-card {
    width: calc(var(--aside-w) - 24px);
    margin-left: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);   /* light: barely there, the border does the work */
    overflow: hidden;
    opacity: 0;
    transform: translateX(24px) scale(0.985);
    transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.app.aside-open .aside-card { opacity: 1; transform: none; transition-delay: 0.05s; }

/* Dark: shadows read fainter on dark ground, so a touch more is still quiet */
:root:not([data-theme="light"]) .aside-card { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 12px 0 22px;
    flex-shrink: 0;
}

.card-kind {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-color-muted);
}

.card-kind::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--k, var(--primary));
}

.card-kind.film { --k: var(--primary); }
.card-kind.review { --k: var(--accent-ai); }
.card-kind.data { --k: var(--positive-color); }
.card-kind.media { --k: var(--mixed-color); }

.card-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 22px 22px;
    scrollbar-width: thin;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 4px;
}

.card-sub { font-size: 0.78rem; color: var(--text-color-muted); margin-bottom: 18px; }

/* Hero variants */
.hero-film {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.hero-film img {
    width: 108px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.hero-scores {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.dial {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dial svg {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.dial .ring-bg { stroke: var(--border-color); }
.dial .ring { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease); }
.dial text { fill: var(--heading-color); font-weight: 700; font-size: 20px; font-family: var(--font-main); }

.dial-label { font-size: 0.7rem; color: var(--text-color-muted); line-height: 1.4; }
.dial-label b { display: block; font-size: 0.8rem; color: var(--heading-color); font-weight: 600; }

.other-scores {
    display: flex;
    gap: 14px;
}

.other-scores div { font-size: 0.68rem; color: var(--gray); }
.other-scores b { display: block; font-size: 1rem; color: var(--heading-color); font-weight: 600; line-height: 1.1; }

.hero-pub {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pub-mark {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--heading-color);
    color: var(--background);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pub-body b { display: block; font-size: 0.92rem; color: var(--heading-color); font-weight: 600; }
.pub-body span { font-size: 0.75rem; color: var(--text-color-muted); }
.stars { color: var(--mixed-color); letter-spacing: 0.08em; font-size: 0.85rem; }

.hero-still img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.hero-still figcaption { font-size: 0.72rem; color: var(--gray); margin-top: 8px; }

.hero-data {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.provider {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--search-background);
    color: var(--text-color);
}

/* Pull quote */
.quote {
    position: relative;
    margin: 22px 0 6px;
    padding: 4px 0 0 26px;
}

.quote::before {
    content: "\201C";
    position: absolute;
    left: -4px;
    top: -14px;
    font-size: 3.2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.9;
}

.quote p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--heading-color);
    font-weight: 500;
    letter-spacing: -0.005em;
}

.quote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.7rem;
    font-style: normal;
    color: var(--gray);
}

/* Facts with dotted leaders, like a programme */
.facts {
    margin-top: 22px;
}

.facts-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 6px;
}

.fact {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 0;
    font-size: 0.8rem;
}

.fact-k { color: var(--text-color-muted); flex-shrink: 0; }
.fact-leader { flex: 1; border-bottom: 1px dotted var(--border-color); transform: translateY(-4px); min-width: 12px; }
.fact-v { color: var(--heading-color); text-align: right; font-weight: 500; }
.fact-v a { border-bottom: 1px solid rgba(var(--primary-rgb), 0.35); }

.fact-v.multi { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.card-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 22px 16px;
    border-top: 1px solid var(--border-color);
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.card-cta svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.card-cta:hover svg { transform: translateX(3px); }

.card-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-color-muted);
    padding: 6px 8px;
    border-radius: 6px;
}

.card-save svg { width: 14px; height: 14px; }
.card-save:hover { background: var(--search-background); color: var(--text-color); }

/* Scrim for overlays */
.scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 40;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1240px) {
    :root { --aside-w: 380px; }
}

@media (max-width: 900px) {
    .mobile-only { display: flex; }

    .shelf {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        width: var(--drawer-w);
        transform: translateX(-100%);
        transition: transform 0.32s var(--ease);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }

    .app.sidebar-open .shelf { transform: none; }
    .rail { display: none; }
    .drawer { opacity: 1; visibility: visible; }

    .aside {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 50;
        width: min(100vw, var(--aside-w));
        padding: 10px;
        transform: translateX(100%);
        transition: transform 0.32s var(--ease);
    }

    .app.aside-open .aside { width: min(100vw, var(--aside-w)); transform: none; }
    .aside-card { width: 100%; margin-left: 0; }

    .app.sidebar-open .scrim,
    .app.aside-open .scrim { opacity: 1; visibility: visible; }

    .topbar { padding: 0 10px; }
    .crumb-title { max-width: 40vw; }

    .col { padding: 0 18px; }
    .welcome { padding: 20px 0 40px; }
    .moods { grid-template-columns: repeat(2, 1fr); }
    .mood { height: 74px; }

    .thread-composer { padding: 6px 18px 14px; }
    .hero-film img { width: 88px; }
}
