:root {
  color-scheme: light;
  font-family: Inter, 'Avenir Next', system-ui, -apple-system, sans-serif;
  color: #222238;
  background: #f5f5fb;
  font-synthesis: none;
  --ink: #222238;
  --muted: #565670;
  --line: #e2e1ee;
  --paper: #fff;
  --wash: #f6f5fc;
  --accent: #593ec9;
  --accent-dark: #4329ac;
  --accent-wash: #eeebff;
  --shadow: 0 4px 18px #24204c0a;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; line-height: 1.55; }
[hidden] { display: none !important; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, a, select, input, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #248472; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
ul, ol { margin: 0; padding: 0; }
.shell { width: calc(100% - 64px); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 12px 16px; background: #fff; }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: 68px; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); font-size: 1.12rem; font-weight: 800; line-height: 1.2; text-decoration: none; white-space: nowrap; letter-spacing: -.03em; }
.brand-logo { position: relative; display: block; flex: none; width: 124px; aspect-ratio: 4; overflow: hidden; }
/* Center the wordmark inside the PNG's built-in margins. */
.brand-logo img { position: absolute; top: 50%; left: 50%; width: 132%; height: auto; transform: translate(-50%, -50%); }
.brand-partner-logo { display: block; flex: none; width: 64px; height: auto; }
.navigation { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; }
.navigation a { font-size: .9rem; font-weight: 690; text-decoration: none; white-space: nowrap; }
.navigation a { color: var(--muted); padding: 10px 14px; border-radius: 9px; }
.navigation a:hover, .navigation a[aria-current] { color: var(--accent-dark); background: var(--accent-wash); }
main { min-height: 72vh; }
#view { padding-block: 22px 32px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.workspace { display: grid; grid-template-columns: minmax(224px, 1fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.workspace .panel { padding: 22px; min-width: 0; }
.history-panel h2 { font-size: 1.34rem; }
.recommend-panel { container-type: inline-size; }
.recommend-panel h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); }
.recommend-panel > .section-head { align-items: end; }
.recommend-panel > .section-head > .field { width: min(100%, 310px); }
.secondary { color: var(--muted); }
.subtext { margin-top: 7px; color: var(--muted); font-size: .91rem; }
.field { display: grid; gap: 5px; }
.field > label, .field-label { font-size: .88rem; font-weight: 720; color: var(--muted); }
input[type='search'], select {
  width: 100%; min-width: 0; min-height: 42px; border: 1px solid #d9d7e8; border-radius: 9px;
  background-color: var(--paper); color: var(--ink); padding: 8px 12px;
}
select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #595674 50%), linear-gradient(135deg, #595674 50%, transparent 50%);
  background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type='search']::placeholder { color: #686884; }
.movie-search { margin-top: 16px; position: relative; }
.history-footer { margin-top: 12px; }
.search-results { position: absolute; z-index: 4; top: 100%; inset-inline: 0; margin-top: 5px; max-height: 265px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 25px #2520411f; background: var(--paper); }
.search-results ul { list-style: none; }
.search-results button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; padding: 6px 11px; background: white; color: var(--ink); text-align: left; }
.search-results button:hover, .search-results button:focus-visible { background: var(--accent-wash); }
.search-results small { display: block; margin-top: 1px; color: var(--muted); }
.search-results p { padding: 10px 12px; color: var(--muted); }
.history-list { list-style: none; display: grid; gap: 7px; margin-top: 14px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 10px; }
.history-movie { display: flex; align-items: center; min-width: 0; gap: 8px; }
.history-movie strong { display: block; font-size: .94rem; line-height: 1.25; overflow-wrap: anywhere; }
.history-movie small { display: block; margin-top: 3px; font-size: .79rem; color: var(--muted); }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #52516a; }
.icon-button:hover { background: var(--accent-wash); border-color: #ded6ff; color: var(--accent-dark); }
.icon-button .remove-icon { font-size: 1.32rem; line-height: 1; }
.notice { padding: 16px; background: var(--wash); color: var(--muted); border-radius: 10px; }
.notice p + p { margin-top: 5px; }
.history-panel .notice { margin-top: 12px; }
.section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.results-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin-top: 10px; color: var(--muted); font-size: .86rem; }
.global-ranking-note { margin-bottom: 12px; }
.result-links { display: flex; flex-wrap: wrap; gap: 0 12px; justify-content: end; }
.mobile-jump { display: none; }
.text-button { padding: 6px 1px; border: 0; background: transparent; color: var(--accent-dark); font-weight: 720; text-decoration: none; font-size: .88rem; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.small-button, .plain-button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 8px 13px;
  border-radius: 9px; border: 1px solid var(--line); background: white; color: var(--accent-dark); text-decoration: none;
  font-size: .88rem; font-weight: 720; text-align: center;
}
.small-button:hover:not(:disabled), .plain-button:hover:not(:disabled) { background: var(--accent-wash); border-color: #d9cffc; }
.recommend-list { display: grid; gap: 12px; list-style: none; margin-top: 8px; }
.film-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); border: 1px solid var(--line); border-radius: 12px; }
.film-overview { display: flex; align-items: start; gap: 14px; min-width: 0; padding: 14px; }
.film-art { position: relative; flex: none; }
.poster { position: relative; isolation: isolate; overflow: hidden; flex: none; background: linear-gradient(132deg, hsl(var(--hue) 59% 23%), hsl(calc(var(--hue) + 30) 58% 40%)); }
.film-art .poster { display: block; width: 74px; aspect-ratio: 2 / 3; border-radius: 7px; }
.poster::before, .poster::after { content: ''; position: absolute; pointer-events: none; }
.poster::before { width: 66%; aspect-ratio: 1; border-radius: 50%; left: 29%; top: -18%; background: linear-gradient(140deg, hsl(calc(var(--hue) + 31) 90% 76% / .88), hsl(var(--hue) 55% 45% / .07) 75%); box-shadow: 0 0 0 10px #f8eeff15, 0 0 0 22px #e1d5ff16; transform: rotate(18deg); }
.poster::after { inset: 0; background: repeating-linear-gradient(133deg, transparent 0 9px, #f7f2ff1d 9px 10px), radial-gradient(ellipse at 10% 114%, #11102f 12%, transparent 62%); }
.poster[data-shape='1']::before { border-radius: 13%; left: 42%; top: -24%; transform: rotate(38deg); }
.poster[data-shape='2']::before { width: 42%; left: 42%; top: 10%; }
.poster[data-shape='3']::before { width: 86%; top: 27%; left: 7%; transform: rotate(-25deg); border-radius: 60% 9%; }
.poster-mini { width: 26px; height: 39px; border-radius: 5px; }
.poster-mini::before { box-shadow: 0 0 0 3px #fff3; }
.poster img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #191829; opacity: 0; }
.poster img.ready { opacity: 1; }
.film-rank { position: absolute; z-index: 2; left: 6px; top: 6px; min-width: 20px; padding: 1px 4px; border-radius: 5px; color: #fff; background: #1e183bdd; font-size: .8rem; font-weight: 750; text-align: center; }
.film-info { min-width: 0; padding-block: 2px; overflow-wrap: anywhere; }
.film-info h3 { font-size: 1.2rem; }
.film-meta { margin-top: 4px; color: var(--muted); font-size: .84rem; }
.film-score { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 8px; padding: 3px 8px; border-radius: 7px; background: var(--accent-wash); color: var(--accent-dark); }
.film-score dt { font-size: .83rem; font-weight: 660; }
.film-score dd { font-size: .91rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.film-explanation { display: grid; align-items: center; min-width: 0; padding: 6px 15px; border-inline-start: 1px solid var(--line); border-start-end-radius: 11px; border-end-end-radius: 11px; background: #faf9fe; }
.film-rules { list-style: none; }
.film-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 38px; }
.film-rule + .film-rule { margin-block-start: 5px; padding-block-start: 5px; border-block-start: 1px solid var(--line); }
.film-rule-copy { padding-block: 2px; color: var(--muted); overflow-wrap: anywhere; }
.film-rule-expression { font-size: .875rem; line-height: 1.35; }
.film-rule-expression strong { color: var(--ink); font-weight: 700; }
.film-rule-arrow { margin-inline: 4px; color: var(--accent-dark); }
.film-rule-evidence { margin-top: 2px; font-size: .8125rem; line-height: 1.25; }
.film-rule-components { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; }
.film-rule-components > div { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.film-rule-components dd { color: var(--accent-dark); font-weight: 720; font-variant-numeric: tabular-nums; }
.film-rule-link { min-height: 36px; padding-block: 3px; }
@container (max-width: 560px) {
  .film-card { grid-template-columns: minmax(0, 1fr); }
  .film-overview { align-items: center; }
  .film-art .poster { width: 58px; }
  .film-explanation { border-inline-start: 0; border-block-start: 1px solid var(--line); border-start-end-radius: 0; border-end-start-radius: 11px; }
}
.result-empty { margin-top: 12px; }
.score-pill, .match-pill { display: inline-flex; width: fit-content; gap: 6px; align-items: center; border-radius: 7px; padding: 3px 8px; color: var(--accent-dark); background: var(--accent-wash); font-size: .83rem; font-weight: 730; white-space: nowrap; }
.match-pill.eligible { color: #115846; background: #dff5ed; }
.match-pill.inactive { color: #5e5b75; background: #f0eef5; }
.map-heading h2 { font-size: 1.38rem; }
.evidence-map {
  position: relative; isolation: isolate; container: evidence-map / inline-size;
  margin-top: 13px; padding: 17px 20px 19px; overflow: hidden; border-radius: 15px;
  background: radial-gradient(ellipse at 76% 76%, #253e586e, transparent 62%), radial-gradient(circle, #ded0ff32 1px, transparent 1.4px) 0 0 / 20px 20px, #201a39;
  color: #f9f6ff;
}
.evidence-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-columns { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 7cqw, 83px); }
.map-column { min-width: 0; display: flex; flex-direction: column; }
.map-column h3 { margin: 0 0 12px; line-height: 1.16; letter-spacing: normal; color: #e6dffc; font-size: .89rem; font-weight: 720; }
.map-nodes { display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 8px; }
.map-node {
  display: grid; gap: 3px; min-height: 43px; place-content: center stretch; min-width: 0;
  border: 1px solid #7183af; border-left: 4px solid #92b6ff; padding: 8px 9px;
  border-radius: 9px; background: #302b4b; color: #fff; text-align: left;
  box-shadow: 0 4px 12px #0e0c2070; font: inherit;
}
.map-node strong { font-size: .89rem; line-height: 1.18; overflow-wrap: anywhere; }
.map-node small { color: #e1d5f9; font-size: .79rem; font-weight: 570; line-height: 1.28; overflow-wrap: anywhere; }
.map-node.map-rule { border-color: #8670c5; border-left-color: #bda0ff; background: #392b58; }
.map-node.map-outcome { border-color: #65aaab; border-left-color: #7ce4cc; background: #254148; }
.map-node.map-outcome small { color: #b8f5e7; }
.map-node.is-dim { color: #ded9eb; border-color: #625975; border-left-color: #898199; background: #2d2840; }
.map-node.is-dim small { color: #c2bcd5; }
.map-node.is-focused, button.map-node:hover { border-color: #ecdfff; box-shadow: 0 0 0 2px #d1baff55, 0 4px 14px #100a26aa; }
.rule-list-disclosure { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.map-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; }
.map-key { list-style: none; display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; color: var(--muted); font-size: .82rem; }
.map-key li { display: flex; align-items: center; gap: 5px; }
.map-key i { width: 15px; height: 4px; border-radius: 4px; background: #7150c6; }
.map-key .matched { background: #8c7cb7; }
.map-key .muted { background: #d0c9e1; height: 2px; }
.inset-panel { padding: 22px; }
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; gap: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 15px 0; }
.stats-grid div { min-width: 0; padding: 10px; border-radius: 9px; background: var(--wash); }
.stats-grid dt { color: var(--muted); font-size: .83rem; line-height: 1.3; }
.stats-grid dd { font-weight: 750; font-size: 1.13rem; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rule-diagram { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); gap: 9px; align-items: center; margin-top: 14px; }
.node-label { display: block; color: var(--muted); font-size: .83rem; font-weight: 690; margin-bottom: 4px; }
.rule-node { display: flex; flex-wrap: wrap; gap: 5px; }
.movie-chip { display: inline-flex; max-width: 100%; padding: 5px 8px; background: var(--accent-wash); color: var(--accent-dark); line-height: 1.25; border-radius: 7px; font-weight: 680; font-size: .89rem; overflow-wrap: anywhere; }
.outcome-node .movie-chip { background: #def4ee; color: #125c4e; }
.rule-connector { position: relative; border-top: 2px solid #765fc6; align-self: center; margin-top: 17px; }
.rule-connector::after { content: ''; position: absolute; right: 0; top: -5px; width: 8px; height: 8px; border-top: 2px solid #765fc6; border-right: 2px solid #765fc6; transform: rotate(45deg); }
.content-components { width: 100%; margin-bottom: 12px; border-collapse: collapse; font-size: .86rem; }
.content-components caption { text-align: start; color: var(--ink); font-weight: 720; }
.content-components :is(th, td) { padding: 5px 0 5px 8px; border-block-end: 1px solid var(--line); text-align: end; }
.content-components th:first-child { padding-inline-start: 0; text-align: start; }
.content-components td { font-variant-numeric: tabular-nums; }
.content-components :is(th, td):nth-child(2) { text-align: start; overflow-wrap: anywhere; }
.calculation-steps { display: grid; gap: 9px; margin-top: 12px; }
.calculation-steps dt { margin-bottom: 4px; color: var(--ink); font-weight: 720; }
.formula { display: grid; gap: 5px; padding: 9px 12px; color: #3f279d; background: var(--accent-wash); border-radius: 8px; font: 650 .91rem / 1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
summary { cursor: pointer; color: var(--accent-dark); font-weight: 720; }
.genre-overlap { margin: 13px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #faf9fd; }
.genre-overlap table { width: 100%; border-collapse: collapse; font-size: .86rem; line-height: 1.3; }
.genre-overlap caption > div { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; padding-block-end: 8px; text-align: start; font-size: .94rem; }
.genre-overlap caption span { color: var(--accent-dark); font-size: .83rem; font-weight: 680; }
.genre-overlap :is(th, td) { padding: 5px 6px; border-block-end: 1px solid var(--line); text-align: center; }
.genre-overlap th:first-child { text-align: start; }
.genre-overlap thead { color: var(--muted); font-size: .79rem; }
.genre-overlap tbody th { width: 44%; font-weight: 550; overflow-wrap: anywhere; }
.genre-overlap .genre-shared { background: var(--accent-wash); }
.genre-overlap .genre-shared th, .genre-present { color: var(--accent-dark); font-weight: 720; }
.genre-absent { color: var(--muted); }
.genre-overlap tfoot :is(th, td) { border: 0; font-weight: 680; }
.venn-chart { margin: 13px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #faf9fd; }
.venn-chart figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.venn-chart figcaption span, .venn-hint { font-size: .83rem; color: var(--muted); }
.venn-sets { display: flex; justify-content: center; gap: 6px 12px; flex-wrap: wrap; margin: 9px 0 7px; font-size: .83rem; }
.venn-sets > span { padding: 2px 8px; border-radius: 7px; background: #ebe1ff; color: #4f327f; }
.venn-sets > span:last-child { background: #def3ea; color: #1d5d4c; }
.venn-sets strong { margin-inline-start: 3px; font-variant-numeric: tabular-nums; }
.venn-chart svg { display: block; width: 100%; max-width: 360px; margin-inline: auto; }
.venn-region { outline: none; cursor: pointer; }
.venn-region path { fill: var(--region-fill); stroke: var(--region-line); stroke-width: 1.2; pointer-events: fill; }
.venn-region.is-active path { fill: var(--region-active); stroke: var(--region-ink); }
.venn-region:focus-visible path { stroke: #222238; stroke-width: 2.3; stroke-dasharray: 4 2; }
.venn-region text { fill: var(--region-ink); font-size: 12px; font-weight: 650; pointer-events: none; }
.venn-count { font-size: 21px; font-weight: 780; font-variant-numeric: tabular-nums; }
.venn-left { --region-fill: #ebe1ff; --region-active: #daccfa; --region-line: #9776cf; --region-ink: #4f327f; }
.venn-both { --region-fill: #dce3ff; --region-active: #c5d1fa; --region-line: #7e8bc9; --region-ink: #33417c; }
.venn-right { --region-fill: #def3ea; --region-active: #c2e8d9; --region-line: #6ba58f; --region-ink: #1d5d4c; }
.venn-neither { --region-fill: #f3f1f8; --region-active: #e9e5f1; --region-line: #d4cee4; --region-ink: #514862; }
.venn-detail { display: grid; margin-top: 7px; padding: 7px 9px; border-radius: 7px; background: #f0edf8; font-size: .85rem; }
.venn-detail > p { grid-area: 1 / 1; }
.venn-detail:has(.venn-region-detail:not([hidden])) .venn-summary { visibility: hidden; }
.venn-hint { margin-top: 5px; }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 0 9px; }
.filter-row > .checkbox-label { grid-column: 1 / -1; justify-self: start; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; min-height: 41px; color: var(--muted); font-size: .9rem; font-weight: 690; }
.checkbox-label input { accent-color: var(--accent); width: 17px; height: 17px; }
.rules-header, .rule-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) clamp(3.6rem, 18%, 5.6rem) clamp(3.1rem, 11%, 3.9rem); align-items: center; gap: 9px; text-align: left; }
.rules-header { margin-top: 12px; padding: 3px 8px; border-inline: 1px solid transparent; color: var(--muted); font-size: .83rem; font-weight: 740; }
.rule-sort-button { display: flex; align-items: center; justify-content: end; gap: 4px; min-height: 34px; padding: 3px 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; line-height: 1.15; text-align: end; overflow-wrap: anywhere; }
.rule-sort-button:hover, .rule-sort-button:not([data-direction='']) { color: var(--accent-dark); }
.rule-sort-icon::before { content: '↕'; }
.rule-sort-button[data-direction='ascending'] .rule-sort-icon::before { content: '↑'; }
.rule-sort-button[data-direction='descending'] .rule-sort-icon::before { content: '↓'; }
.rule-row { width: 100%; border: 1px solid transparent; border-top-color: var(--line); background: white; color: var(--ink); font-size: .91rem; padding: 8px 8px; min-height: 41px; overflow-wrap: anywhere; }
.rule-row:hover, .rule-row[aria-pressed='true'] { border-color: #dfd6ff; border-radius: 7px; background: var(--accent-wash); }
.rule-row > span:nth-child(n+3) { font-variant-numeric: tabular-nums; text-align: end; }
.rule-pagination { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .88rem; color: var(--muted); }
.rule-inspector { position: sticky; top: 12px; scroll-margin-top: 12px; }
.rule-inspector .section-head { align-items: start; }
.rule-evidence-panels { display: grid; gap: 8px; margin-block: 16px 12px; }
.rule-evidence-panel { min-width: 0; border: 1px solid var(--line); border-radius: 9px; }
.rule-evidence-panel > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 7px 12px; border-radius: 8px; }
.rule-evidence-panel > summary::-webkit-details-marker { display: none; }
.rule-evidence-panel > summary:hover, .rule-evidence-panel[open] > summary { background: var(--wash); }
.rule-evidence-panel > summary:focus-visible { outline-offset: -2px; }
.rule-evidence-panel > summary > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rule-evidence-panel > summary::after {
  content: ''; flex: none; width: 8px; height: 8px; margin: -4px 2px 0 1px;
  border: solid var(--accent-dark); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rule-evidence-panel[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.rule-evidence-preview { display: grid; text-align: end; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rule-evidence-preview small { margin-top: 2px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.rule-evidence-body { padding: 10px 12px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .91rem; }
.rule-evidence-body > .subtext:first-child { margin-top: 0; }
.rule-support strong { color: var(--ink); }
.rule-final-score { padding: 10px 12px; border: 1px solid #ded5ff; border-radius: 9px; background: var(--accent-wash); color: var(--accent-dark); }
.rule-final-score > dl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 760; }
.rule-final-score dd { font-size: 1.28rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rule-score-blend { margin-top: 7px; font-size: .87rem; }
.rule-score-blend .formula { background: var(--paper); }
.compare-panel h2 { font-size: 1.32rem; }
.comparison-context { margin: 12px 0; }
.comparison-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.compare-result { border: 1px solid var(--line); border-radius: 11px; min-width: 0; padding: 12px; }
.compare-result h3 { font-size: .98rem; overflow-wrap: anywhere; }
.compare-table { width: 100%; margin-top: 5px; border-collapse: collapse; table-layout: fixed; font-size: .86rem; }
.compare-table :is(th, td) { padding-block: 4px; text-align: start; }
.compare-table thead { color: var(--muted); }
.compare-table tbody tr { border-block-start: 1px solid var(--line); }
.compare-table tbody th { font-weight: 550; }
.compare-table .compare-rank { width: 1.4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.compare-table .compare-value { width: 3.45rem; padding-inline-start: 5px; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.comparison-movie { display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.compare-help { position: relative; display: inline-flex; }
.compare-help-trigger { padding: 2px 1px; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.compare-tooltip { position: absolute; z-index: 3; inset-block-start: 100%; inset-inline-end: 0; width: min(12rem, 65vw); padding: 8px 10px; border-radius: 7px; background: #29233f; color: #fff; box-shadow: var(--shadow); font-size: .81rem; font-weight: 500; line-height: 1.4; text-align: start; white-space: normal; visibility: hidden; }
.compare-help:not([data-dismissed]):is(:hover, :focus-within) .compare-tooltip { visibility: visible; }
.compare-result .text-button { margin-top: 3px; }
.site-footer { padding: 16px 0 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.site-footer > p, .site-footer details > p, .site-footer details details { margin-top: 8px; }
.site-footer ul { padding-left: 18px; margin: 6px 0; }
.site-footer pre { max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; font: inherit; }

@media (max-width: 1010px) {
  .shell { width: calc(100% - 38px); }
  .workspace { gap: 12px; }
  .workspace .panel, .inset-panel { padding: 16px; }
  .explorer-grid { gap: 12px; }
}

@media (max-width: 1100px) {
  .header-inner { flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; padding-block: 11px 8px; }
  .brand { white-space: normal; }
  .navigation { order: 3; justify-content: start; width: 100%; flex: 0 0 100%; overflow-x: auto; padding-bottom: 3px; }
  .navigation a { padding: 8px 11px; }
}

@media (min-width: 1500px) {
  .comparison-results { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .comparison-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  #view { padding-top: 14px; }
  .explorer-grid { grid-template-columns: 1fr; }
  .rule-inspector { position: static; }
}

@media (min-width: 666px) and (max-width: 900px) {
  .history-movie .poster-mini:not(:has(img)) { display: none; }
}

@media (max-width: 665px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .comparison-results { grid-template-columns: minmax(0, 1fr); }
  .mobile-jump { display: inline-block; }
  .history-panel > .mobile-jump { margin-top: 5px; }
  #history-title, #recommend-title { scroll-margin-top: 12px; }
}

@container evidence-map (max-width: 525px) {
  .map-columns { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .map-column h3 { margin-bottom: 6px; }
  .map-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .map-nodes > :only-child { grid-column: 1 / -1; }
}

@media (max-width: 475px) {
  .shell { width: calc(100% - 24px); }
  .brand { flex: 1 1 200px; gap: 8px; font-size: .98rem; }
  .brand-logo { width: 88px; }
  .brand-partner-logo { width: 48px; }
  .navigation { gap: 2px; }
  .navigation a { font-size: .84rem; padding-inline: 6px; }
  .section-head { align-items: start; }
  .filter-row { grid-template-columns: 1fr; gap: 3px; }
  .evidence-map { padding: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, button, input, select, .poster img { transition: background-color .15s ease, border-color .15s ease, opacity .15s ease; }
}
