@font-face {
  font-family: "Newsreader"; src: url("assets/newsreader-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 700; font-display: swap;
}
@font-face {
  font-family: "Newsreader"; src: url("assets/newsreader-italic-latin.woff2") format("woff2");
  font-style: italic; font-weight: 400 600; font-display: swap;
}
@font-face {
  font-family: Inter; src: url("assets/inter-latin.woff2") format("woff2");
  font-style: normal; font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono"; src: url("assets/jetbrains-mono-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 800; font-display: swap;
}
:root {
  --ink: #14171F; --muted: #525866; --red: #BE2B2E; --border: #E6E4DF;
  --serif: "Newsreader", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --shadow: 0 1px 2px rgb(20 23 31 / 3%), 0 8px 24px rgb(20 23 31 / 3.5%);
  font: 16px/1.6 var(--sans); color: var(--ink); background: #FAF9F6;
  scroll-behavior: smooth; scroll-padding-top: 86px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-image: radial-gradient(ellipse 85% 420px at 50% -90px, rgb(190 43 46 / 6.5%), transparent 70%);
  background-repeat: no-repeat;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.site-header { position: sticky; z-index: 5; top: 0; background: rgb(250 249 246 / 88%); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: box-shadow .2s ease; }
.site-header::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--red); transform-origin: left; transform: scaleX(var(--scroll, 0)); }
.site-header.is-scrolled { box-shadow: 0 3px 14px rgb(20 23 31 / 7%); }
.site-header nav a { position: relative; }
.site-header nav a::after { content: ''; position: absolute; inset: auto 0 -4px; height: 2px; border-radius: 2px; background: var(--red); transform: scaleX(0); transition: transform .22s ease; }
.site-header nav a[aria-current="location"]::after { transform: scaleX(1); }
.nav-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 64px; }
.wordmark { display: inline-flex; gap: .4rem; align-items: center; font-weight: 750; font-size: 1.15rem; letter-spacing: -0.025em; }
.wordmark svg { color: var(--red); width: 25px; height: 25px; stroke-width: 2; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(12px,2.8vw,35px); }
nav a { font-size: .875rem; font-weight: 540; color: var(--muted); }
nav a:hover, nav a[aria-current] { color: var(--red); }
main > section { padding-block: 52px; border-bottom: 1px solid var(--border); min-width: 0; }
h1,h2,h3,p,figure,dl,dd,pre { margin: 0; }
h1,h2,h3 { text-wrap: balance; line-height: 1.15; }
h2 { font-family: var(--serif); font-size: clamp(1.65rem, 2.35vw, 2.05rem); font-weight: 600; line-height: 1.18; letter-spacing: -0.014em; margin: 0; }
.section-head { margin-bottom: 22px; }
.eyebrow { font: 600 0.72rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
h3 { font-size: 1.05rem; font-weight: 620; letter-spacing: -0.015em; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; padding-block: 48px 40px; }
.hero-text { width: 100%; }
h1 { margin-inline: auto; font-family: var(--serif); font-size: clamp(2rem, 3.05vw, 2.7rem); font-weight: 600; line-height: 1.18; letter-spacing: -0.016em; text-wrap: balance; }
h1 span { display: inline; color: var(--red); font-weight: 650; font-size: inherit; line-height: inherit; letter-spacing: inherit; margin: 0; }
.authors { max-width: 780px; margin: 20px auto 10px; font-size: 0.98rem; font-weight: 520; line-height: 1.72; color: #1F2937; text-wrap: balance; }
.authors span { white-space: nowrap; }
sup { color: var(--red); font-size: .68em; line-height: 0; font-weight: 600; }
.affiliations { max-width: 860px; margin: 0 auto; font-size: 0.84rem; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.affiliations p + p { margin-top: 3px; }
.author-notes span { padding: 0 .3em; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.action, #copy-citation, .light-controls button {
  background: white; border: 1px solid var(--border); border-radius: 7px; font-weight: 560;
}
.action, #copy-citation { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: .815rem; box-shadow: var(--shadow); }
.action { border-radius: 999px; padding: 8.5px 16px; font-size: 0.83rem; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.action svg, #copy-citation svg { width: 16px; height: 16px; }
.action img { width: 17px; height: 16px; object-fit: contain; }
.action:first-child { color: white; border-color: var(--red); background: linear-gradient(180deg, #CC3336, #B32427); box-shadow: 0 4px 14px rgb(190 43 46 / 22%); }
.action:hover, #copy-citation:hover { border-color: var(--red); }
.action:hover { transform: translateY(-1px); }
.action-code:hover { border-color: #9CA3AF; box-shadow: 0 6px 16px rgb(17 24 39 / 10%); }
.action-hf:hover { border-color: #F59E0B80; box-shadow: 0 6px 16px rgb(245 158 11 / 12%); }
#copy-citation { transition: border-color .18s ease, box-shadow .18s ease; }
.copy-icons { display: grid; }
.copy-icons svg { grid-area: 1 / 1; transition: opacity .18s ease, transform .18s ease; }
.copy-icons svg:last-child { color: #15803d; }
.copy-icons svg:last-child, .is-copied .copy-icons svg:first-child { opacity: 0; transform: scale(.8); }
.is-copied .copy-icons svg:last-child { opacity: 1; transform: scale(1); }
#copy-citation.is-copied { border-color: #39a96a; box-shadow: 0 0 0 2px rgb(57 169 106 / 12%); }
.paper-figure { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.figure-open { position: relative; display: block; background: white; border: 0; width: 100%; padding: clamp(10px,2vw,24px); cursor: zoom-in; }
.figure-open img { display: block; width: 100%; height: auto; margin: auto; }
.enlarge-icon { position: absolute; right: 10px; top: 10px; color: var(--muted); border: 1px solid var(--border); background: rgb(255 255 255 / 95%); border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; }
.enlarge-icon svg { width: 13px; height: 13px; }
.paper-figure figcaption { font-size: 0.84rem; line-height: 1.55; color: #6B7280; padding: 12px 18px; text-align: left; text-wrap: pretty; border-top: 1px solid var(--border); }
.stats { width: 100%; margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: center; align-items: center; text-align: center; gap: 5px; padding: 18px 16px; background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.stats dt { font-size: .79rem; color: var(--muted); font-weight: 535; }
.stats dd { font: 700 clamp(1.3rem, 1.9vw, 1.6rem)/1.2 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.022em; white-space: nowrap; }
.stats > div:first-child { border-color: rgb(190 43 46 / 26%); background: linear-gradient(180deg, #FFF9F9, #FFFFFF); }
.stats > div:first-child dd { color: var(--red); }
.count-slot { display: inline-grid; vertical-align: baseline; text-align: right; }
.count-slot::before, .count-slot > span { grid-area: 1 / 1; }
.count-slot::before { content: attr(data-end); visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .hero :is(h1,.authors,.affiliations,.actions), .stats > div {
    animation: hero-enter 520ms cubic-bezier(.22,1,.36,1) var(--enter, 0ms) backwards;
  }
  .authors, .affiliations { --enter: 60ms; }
  .actions { --enter: 120ms; }
  .stats > div:nth-child(1) { --enter: 180ms; }
  .stats > div:nth-child(2) { --enter: 240ms; }
  .stats > div:nth-child(3) { --enter: 300ms; }
  .stats > div:nth-child(4) { --enter: 360ms; }
  @keyframes hero-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .52s ease, transform .52s cubic-bezier(.22,1,.36,1); }
  .reveal.is-revealed { opacity: 1; transform: none; }
}
@media (hover: hover) {
  .figure-open img { transition: transform .35s ease; }
  .enlarge-icon { transition: color .35s ease, border-color .35s ease, transform .35s ease; }
  .figure-open:hover img { transform: scale(1.012); }
  .figure-open:hover .enlarge-icon { color: var(--red); border-color: var(--red); transform: scale(1.08); }
}
#overview { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 0 28px; align-items: stretch; }
#overview > .section-head { grid-column: 1 / -1; }
#overview .paper-figure { display: flex; flex-direction: column; justify-content: space-between; border-radius: 14px; }
#overview .figure-open { flex: 1; display: flex; align-items: center; }
.abstract-card {
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--red);
  border-radius: 14px; padding: 28px 32px; box-shadow: var(--shadow);
}
.abstract-card p { margin: 0; font: 400 1.04rem/1.75 var(--serif); color: #272A33; text-align: left; text-wrap: pretty; }
.abstract-card strong { font-weight: 600; color: var(--ink); }
.score-comparison, #efficiency, .ab-panel {
  padding: 24px 28px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
#efficiency { margin-top: 22px; }
.citation-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
#citation pre { padding: 24px 26px; font: .87rem/1.7 var(--mono); background: #FFFFFF; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: auto; }
pre code { font: inherit; }
.footer-inner { min-height: 85px; }
footer nav a { display: inline-flex; align-items: center; gap: 5px; }
footer nav svg, footer nav img { width: 15px; height: 15px; object-fit: contain; }
footer .brand-arxiv { color: #B31B1B; }
dialog { padding: 0; margin: 0; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; background: #fafafa; color: var(--ink); }
dialog[open] { display: flex; flex-direction: column; }
body:has(dialog[open]) { overflow: hidden; }
.lightbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(12px,3vw,50px); border-bottom: 1px solid var(--border); background: white; }
#light-title { font-size: .88rem; font-weight: 550; }
.light-controls { display: flex; gap: 6px; }
.light-controls button { width: 39px; height: 38px; font: 1.3rem var(--mono); }
.light-stage { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.light-stage img { display: block; margin: auto; }
@media (max-width: 860px) {
  .hero-br { display: none; }
  #overview { grid-template-columns: 1fr; gap: 20px; }
  .score-comparison, #efficiency, .ab-panel, .abstract-card { padding: 18px; }
  #overview .paper-figure img { max-width: 500px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  main > section { padding-block: 35px; }
  .nav-inner { min-height: 56px; gap: 8px; }
  .nav-inner nav { gap: clamp(7px,2.4vw,15px); }
  .nav-inner nav a { font-size: .77rem; }
  #citation pre { font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 10px; padding-block: 18px; }
  footer nav { gap: 8px 14px; }
  .nav-inner { width: calc(100% - 24px); flex-direction: column; justify-content: center; gap: 3px; padding-block: 5px 8px; }
  .nav-inner nav { justify-content: center; gap: clamp(6px, 2.5vw, 12px); }
  .wordmark { font-size: 1rem; }
  .wordmark svg { width: 19px; }
}
@media (max-width: 380px) {
  .nav-inner { flex-wrap: wrap; padding-block: 6px; gap: 1px 14px; }
  .stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .figure-open:hover :is(img,.enlarge-icon), .video-card:hover, .action:hover { transform: none; }
}

.results-section { min-width: 0; }
.bench-chart-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.bench-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.bench-switch { padding: 3px; background: #f4f5f6; border: 1px solid #e5e7eb; border-radius: 20px; }
.bench-switch button {
  border: 0; border-radius: 18px; padding: 6px 12px; background: transparent;
  color: #4b5563; font-size: 12px; font-weight: 550; line-height: 1.3;
}
.bench-switch button:hover { color: #111827; }
.bench-switch button[aria-pressed="true"] { background: #fff; color: #111827; box-shadow: 0 1px 4px #1118271c; }
.bench-plot :focus-visible { outline: 2px solid #2863aa; outline-offset: 2px; }
.bench-y-label, .bench-x-label {
  font-size: 12px; line-height: 1.4; font-weight: 550; color: #4b5563;
}
.bench-y-label { margin: 24px 0 0; }
.bench-x-label { margin: 0; text-align: center; }
.bench-plot-area { position: relative; min-width: 0; }
.bench-svg { display: block; width: 100%; height: clamp(245px, 27vw, 335px); overflow: visible; }
.bench-svg .grid-line { stroke: #e5e7eb; stroke-width: 1; }
.bench-svg .axis-line { stroke: #c9cdd3; stroke-width: 1; }
.bench-svg .axis-tick {
  fill: #4b5563; font: 11px var(--mono);
  font-variant-numeric: tabular-nums;
}
.bench-svg .frontier { fill: none; stroke: #c12f32; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .65; }
.bench-svg [data-point] { cursor: pointer; outline: none; }
.score-row, .bench-svg [data-point] { transition: opacity .2s ease, transform .32s cubic-bezier(.22,1,.36,1); }
.bench-switch button, .ab-studies button, .clip-filters button { transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.bench-svg .hit-zone { fill: transparent; }
.bench-svg .symbol { fill: var(--series); stroke: white; stroke-width: 1; }
.bench-svg .symbol { transition: transform .18s ease; }
.bench-svg [data-point]:is(:hover,:focus-visible) .symbol { transform: scale(1.18); }
.bench-svg .pulse-ring { fill: none; stroke: var(--series); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  #efficiency.is-revealed .pulse-ring { animation: point-pulse 2.8s ease-out infinite; }
  @keyframes point-pulse { from { opacity: .46; transform: scale(.85); } 75%, to { opacity: 0; transform: scale(1.9); } }
}
.bench-svg .point-ring { stroke: transparent; fill: none; }
.bench-svg [data-point]:focus-visible .point-ring, .bench-svg [data-active] .point-ring { stroke: #111827; stroke-width: 1.5; }
.plot-tip {
  position: absolute; z-index: 3; width: max-content; max-width: calc(100% - 8px);
  background: #fff; border: 1px solid #d8dde1; border-radius: 9px;
  padding: 10px 12px; box-shadow: 0 4px 15px #11182715;
  color: #111827; font: 12px/1.4 var(--sans);
}
.plot-tip { transition: opacity .18s ease, transform .18s ease, display .18s allow-discrete; }
.plot-tip[hidden] { opacity: 0; transform: translateY(4px); }
@starting-style { .plot-tip:not([hidden]) { opacity: 0; transform: translateY(4px); } }
.plot-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.plot-tip-head strong { font-weight: 650; }
.plot-tip-head button { border: 1px solid #e5e7eb; border-radius: 12px; padding: 2px 7px; color: #4b5563; background: #fafafa; font-size: 11px; }
.plot-tip dl { margin: 6px 0 0; display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.plot-tip dt, .plot-tip dd { margin: 0; }
.plot-tip dt { color: #4b5563; }
.plot-tip dd { text-align: right; font-family: var(--mono); }
@media (max-width: 620px) {
  .bench-switch button { padding: 6px 9px; }
  .bench-chart-head { align-items: start; }
  .bench-svg .axis-tick { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bench-svg [data-point] { transition: none; }
}

.bench-axes { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; }
.bench-axes label { display: inline-flex; align-items: center; gap: 7px; color: #4b5563; font-size: 13px; }
.bench-axes select {
  color: #111827; background: white; border: 1px solid #d8dde1; border-radius: 6px;
  padding: 6px; font: 550 13px var(--sans);
}
.bench-svg .bench-point-label {
  fill: #374151; font: 550 11px var(--sans); paint-order: stroke;
  stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none;
}
.bench-svg .ours .bench-point-label { fill: #C12F32; font-weight: 720; }
@media (max-width: 410px) { .bench-axes { gap: 8px; } .bench-switch [data-metric] { padding: 6px 9px; } }

.score-comparison header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#bench-view { background: white; color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: 550 .85rem var(--sans); }
.score-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 15px 0 18px; }
.score-legend button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; background: none; border: 0; color: var(--muted); font-size: .77rem; line-height: 1.4; }
.score-legend button::before { content: ''; background: var(--series); width: 9px; height: 9px; border-radius: 2px; }
.score-legend button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.score-plots { --columns: 5; display: grid; grid-template-columns: repeat(var(--columns),minmax(0,1fr)); gap: 20px 18px; }
.score-plots[data-benchmark="plus"] { --columns: 4; }
.score-plots figure { min-width: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.score-plots figcaption { border: 0; padding: 0; margin-bottom: 6px; color: var(--ink); font: 600 .86rem/1.5 var(--sans); }
.score-row { display: grid; grid-template-columns: minmax(0,1fr) 6.5ch; align-items: center; gap: 6px; min-height: 19px; color: var(--muted); font: .72rem/1.25 var(--mono); text-align: right; }
.score-row:hover, .ab-bar:hover { background: #f5f6f7; }
.score-row i, .ab-bar i { display: block; height: 6px; border-radius: 1px; background: #edf0f2; }
.score-row i::after, .ab-bar i::after { content: ''; display: block; width: var(--score); height: 100%; background: var(--series); border-radius: inherit; transform-origin: left; }
@media (prefers-reduced-motion: no-preference) {
  .score-row i::after, .ab-bar i::after { transform: scaleX(0); transition: transform .52s cubic-bezier(.22,1,.36,1) calc(var(--row,0) * 18ms); }
  :is(.score-comparison,.ab-panel).is-revealed .bars-ready i::after { transform: scaleX(1); }
}
.score-row.dimmed, .bench-svg [data-point].dimmed { opacity: .24; }
@media (max-width: 900px) { .score-plots { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 650px) { .score-plots { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; } }

.ab-controls, .ab-studies, .ab-key { display: flex; align-items: center; flex-wrap: wrap; }
.ab-controls { justify-content: space-between; gap: 10px 18px; }
.ab-studies { gap: 3px; }
.ab-studies button, #ab-view {
  padding: 6px 10px; border: 0; border-radius: 5px; background: transparent;
  color: var(--muted); font: 550 .84rem/1.5 var(--sans);
}
.ab-studies button:hover, .ab-studies button[aria-pressed="true"] { color: var(--red); background: #f8e9e9; }
#ab-view { border: 1px solid var(--border); background: #fff; cursor: pointer; }
#ab-view:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
#ab-figures h3 { margin: 24px 0 0; }
.ab-key { gap: 5px 15px; margin: 15px 0 16px; font-size: .78rem; color: var(--muted); }
.ab-key span { display: inline-flex; align-items: center; gap: 6px; }
.ab-key span::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--series); }
.ab-plots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 24px; }
.ab-plots figure { min-width: 0; margin: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.ab-plots figcaption { margin: 0 0 6px; padding: 0; border: 0; color: var(--ink); font: 600 .86rem/1.5 var(--sans); }
.ab-bar { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 7ch; align-items: center; gap: 6px; min-height: 19px; color: var(--muted); font: .75rem/1.25 var(--mono); text-align: right; }
.ab-bar i { background: #eef0f2; }
.ab-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 650px) {
  .ab-plots { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
  .ab-studies button { padding-inline: 7px; }
}
@media (max-width: 360px) { .ab-plots { grid-template-columns: 1fr; } }

.video-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 14px; }
.video-card { display: flex; flex-direction: column; width: calc((100% - 42px) / 4); padding: 0; text-align: left; min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.video-card:hover { transform: translateY(-2px); border-color: #CFB8B8; box-shadow: 0 10px 26px rgb(20 23 31 / 7%); }
.clip-screen { display: block; position: relative; width: 100%; aspect-ratio: 1; background: #fff center / cover no-repeat; }
.clip-screen video { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .3s ease; }
.clip-screen video.playing { opacity: 1; }
.clip-screen::after {
  content: ''; position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px;
  border: 1px solid rgb(255 255 255 / 55%); border-radius: 50%; backdrop-filter: blur(6px);
  background: rgb(31 41 55 / 55%) center / 17px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3H4v5m11 13h5v-5' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m10 7 7 5-7 5z' fill='white'/%3E%3C/svg%3E");
  opacity: 0; transform: scale(.9); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.video-card:is(:hover, :focus-visible) .clip-screen::after { opacity: 1; transform: scale(1); }
.clip-label { position: absolute; left: 8px; top: 8px; border-radius: 20px; padding: 3px 9px; background: rgb(255 255 255 / 90%); backdrop-filter: blur(8px); border: 1px solid #e5e7eb; color: var(--red); font-weight: 650; font-size: .73rem; line-height: 1.5; }
.group-1 .clip-label { color: #217f45; }
.group-2 .clip-label { color: #2863aa; }
.clip-instruction { display: block; font: italic 400 0.94rem/1.48 var(--serif); color: #272A33; padding: 12px 14px 14px; overflow-wrap: break-word; text-wrap: pretty; }
.clip-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.clip-filters button { border: 1px solid var(--border); background: white; font-size: .85rem; border-radius: 999px; padding: 7px 13px; }
.clip-filters [aria-pressed=true] { color: var(--red); background: #fff5f4; border-color: var(--red); }
#video-viewer { inset: 0; width: min(92vw, 650px); height: fit-content; max-height: 95dvh; padding: 0; margin: auto; border-radius: 12px; background: white; overflow: auto; }
#video-viewer[open] { display: block; }
#video-viewer::backdrop { background: rgb(17 24 39 / 58%); }
.video-popover header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; }
#video-title { font-size: 1rem; line-height: 1.4; margin: 1px 0 0; letter-spacing: -.02em; text-wrap: initial; }
#video-group { color: var(--red); font-size: .78rem; font-weight: 650; }
#video-close { flex: none; width: 34px; height: 34px; background: white; border: 1px solid var(--border); border-radius: 6px; font-size: 22px; line-height: 1; }
.video-popover > video { width: 100%; height: auto; max-height: 69dvh; background: #111; display: block; }
.playback-speed { display: flex; justify-content: flex-end; gap: 8px; align-items: center; padding: 8px 15px; color: var(--muted); font-size: .84rem; }
.playback-speed select { color: var(--ink); background: white; font: inherit; border: 1px solid var(--border); border-radius: 5px; padding: 4px; }

@media (max-width: 900px) {
  .video-card { width: calc((100% - 28px) / 3); }
}
@media (max-width: 760px) {
  .video-grid { column-gap: 10px; }
  .video-card { width: calc((100% - 10px) / 2); }
}
@media (max-width: 620px) {
  .clip-label { left: 5px; top: 5px; padding: 3px 6px; font-size: .66rem; }
}
