/* RoboRisk / LEASH project page. Light, editorial; colors follow the paper's figures. */
:root {
  --bg: #fbfaf7;
  --bg-tint: #f4f2ec;
  --card: #ffffff;
  --ink: #15171c;
  --ink-2: #474b55;
  --ink-3: #80848e;
  --line: #e6e3db;
  --line-2: #d8d4ca;
  --leash: #6a48db;
  --leash-2: #efeaff;
  --harm: #d43c33;
  --harm-2: #fdecea;
  --safe: #17945c;
  --safe-2: #e5f4ec;
  --amber: #b7791f;
  --amber-2: #fbf1df;
  --T: #e04b3f;
  --P: #e08e0b;
  --E: #1f968a;
  --I: #3a6ad3;
  --S: #8a53d2;
  --term: #0d1117;
  --r: 16px;
  --shadow: 0 1px 2px rgba(20, 18, 10, .04), 0 8px 24px -12px rgba(20, 18, 10, .14);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); font-feature-settings: "ss01", "cv11"; }
img, video { max-width: 100%; display: block; }
a { color: var(--leash); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
b { font-weight: 650; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--leash); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }
.wrap.wide { width: min(1240px, 100% - 40px); }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(251, 250, 247, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { width: min(1240px, 100% - 32px); margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.brand-sep { color: var(--ink-3); font-weight: 500; }
.nav-links { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 550; padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.nav-links a:hover, .nav-links a.on { background: var(--bg-tint); color: var(--ink); }
@media (max-width: 760px) { .brand span { display: none; } .nav-links a { font-size: 14px; padding: 6px 8px; } }

/* ---------------------------------------------------------------- hero */
.hero { padding: 64px 0 28px; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 22px; padding: 6px 14px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 550; color: var(--ink-2); }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; }
.kicker .dot:last-of-type { margin-right: 6px; }
.dot.t { background: var(--T); } .dot.p { background: var(--P); } .dot.e { background: var(--E); } .dot.i { background: var(--I); } .dot.s { background: var(--S); }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 800; line-height: 1.02; letter-spacing: -0.045em; }
.authors { margin: 26px auto 6px; max-width: 980px; font-size: 19px; color: var(--ink); }
.authors a { color: var(--ink); text-decoration-color: var(--line-2); }
.authors sup, .affils sup { font-size: 11px; color: var(--leash); font-weight: 650; margin-left: 1px; }
.affils { margin: 4px auto 0; max-width: 980px; font-size: 15px; color: var(--ink-2); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.affils.small { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.buttons { margin: 28px 0 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, background .15s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); background: #2a2d35; text-decoration: none; }
.btn.soon { background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); cursor: default; }
.btn.soon:hover { transform: none; background: var(--card); }
.soon-tag { font-size: 12px; font-weight: 600; color: var(--leash); background: var(--leash-2); padding: 2px 8px; border-radius: 999px; }

.main-video { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #0a0f1e; box-shadow: 0 30px 70px -36px rgba(10, 15, 30, .55), 0 0 0 1px rgba(10, 15, 30, .08); }
.btn.repo { background: var(--leash); }
.main-video video { display: block; width: 100%; height: 100%; }
.main-video img { width: 100%; height: 100%; object-fit: cover; }
.main-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin: 16px 0 0; font-size: 14px; color: var(--ink-3); }
.video-links a { color: var(--ink-2); text-underline-offset: 3px; }
.video-links a:hover { color: var(--leash); }
.mv-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; padding: 28px; background: linear-gradient(180deg, transparent 50%, rgba(5, 8, 18, .62)); color: #fff; }
.mv-play { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .4); display: grid; place-items: center; backdrop-filter: blur(6px); }
.mv-play svg { width: 30px; height: 30px; margin-left: 4px; }
.mv-label { font-size: 15px; font-weight: 550; opacity: .92; }
.main-video.live .mv-cover { cursor: pointer; }
.main-video.live .mv-play { background: var(--leash); border-color: var(--leash); }

/* ---------------------------------------------------------------- at a glance */
.glance { padding: 12px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 16px; }
.stat b { display: block; font-size: 36px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.stat.leash b { color: var(--leash); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- sections */
.section { padding: 88px 0; }
.section.tint { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.label { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--leash); }
.section h2 { font-size: clamp(30px, 3.8vw, 44px); font-weight: 780; line-height: 1.12; letter-spacing: -0.035em; max-width: 900px; }
.sub { margin: 14px 0 30px; max-width: 860px; color: var(--ink-2); font-size: 17.5px; }
.sub.left { margin-top: 8px; }
.lead { font-size: 21px; line-height: 1.55; color: var(--ink); font-weight: 500; margin: 0 0 18px; }
#abstract p { color: var(--ink-2); }
#abstract p.lead { color: var(--ink); }
.h3 { font-size: 24px; font-weight: 730; margin: 54px 0 4px; letter-spacing: -0.02em; }
.h3.small { font-size: 19px; margin: 40px 0 6px; }

/* ---------------------------------------------------------------- demos */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: -8px 0 26px; font-size: 14px; color: var(--ink-3); }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge.harm { background: var(--harm-2); color: var(--harm); }
.badge.success { background: var(--safe-2); color: var(--safe); }
.badge.incomplete { background: var(--amber-2); color: var(--amber); }
.badge img { width: 20px; height: 20px; margin: -3px 0 -3px -4px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border: 1px solid var(--line-2); background: var(--card); border-radius: 14px; font: 600 15px var(--sans); color: var(--ink-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tab:hover { border-color: var(--ink-3); }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.cbox { width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 15px var(--sans); flex: none; }
.cat-intro { margin: 22px 0 18px; padding: 16px 20px; border-left: 3px solid var(--c, var(--ink)); background: var(--card); border-radius: 0 12px 12px 0; color: var(--ink-2); font-size: 16px; }
.cat-intro b { color: var(--ink); }

.demo-list { display: grid; gap: 18px; }
.demo { display: grid; grid-template-columns: minmax(0, 1fr) 330px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.d-media { position: relative; background: #0b0f1a; }
.d-video { position: relative; aspect-ratio: 1352 / 432; cursor: pointer; }
.d-video video, .d-video img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-views { position: absolute; left: 0; right: 0; bottom: 8px; display: grid; grid-template-columns: 56.8fr 0.6fr 42.6fr; pointer-events: none; }
.d-views span { justify-self: start; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(5, 7, 13, .62); color: #e9edf7; font: 600 11.5px var(--sans); letter-spacing: .02em; }
.d-replay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font: 650 14px var(--sans); cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.d-replay svg { width: 16px; height: 16px; }
.demo.ended .d-replay { display: inline-flex; }
.d-bar { display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 38px; background: #05070d; color: #e9edf7; font: 500 13px var(--mono); white-space: nowrap; }
.d-bar .sep { color: rgba(255, 255, 255, .28); }
.d-bar .spd { font-weight: 700; min-width: 30px; }
.d-bar .spd.fast { color: #ffc24a; }
.d-bar .st { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; min-width: 84px; }
.d-bar .st i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.d-bar .st.mv { color: #5ee0a0; } .d-bar .st.mv i { background: currentColor; }
.d-bar .st.th { color: #ffc24a; }
.d-bar .st.done { color: #9aa3b8; } .d-bar .st.done i { background: currentColor; border-color: currentColor; }
.d-prog { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; min-width: 40px; }
.d-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8f78ff, #b9a8ff); }
.d-info { padding: 18px 20px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.d-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); background: var(--bg-tint); white-space: nowrap; }
.tag.leash { background: var(--leash-2); color: var(--leash); }
.model { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; }
.model img { width: 28px; height: 28px; padding: 3px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.model .via { font-weight: 500; font-size: 14px; color: var(--ink-3); }
.prompt { margin: 0; font: 500 14.5px/1.55 var(--mono); color: var(--ink); }
.prompt .rnd { display: block; font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.prompt .rnd:first-child { margin-top: 0; }
.scene { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); font-style: italic; }
.d-meta { margin-top: auto; font: 500 12px var(--mono); color: var(--ink-3); }
@media (max-width: 900px) { .demo { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- benchmark */
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.cat { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.cat h3 { font-size: 17px; font-weight: 720; display: flex; align-items: center; gap: 9px; }
.cat h3 .cbox { width: 26px; height: 26px; font-size: 14px; }
.cat p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.cat .ex { font: 500 13px/1.5 var(--mono); color: var(--ink); background: var(--bg-tint); padding: 8px 10px; border-radius: 8px; }
.cat .ex i { display: block; font: italic 400 12.5px/1.45 var(--sans); color: var(--ink-3); margin-top: 4px; }
.cat .harm-rule { font-size: 13px; color: var(--ink-3); }
.cat .harm-rule b { color: var(--harm); font-weight: 650; }
.cat .n { margin-top: auto; display: flex; gap: 8px; font-size: 13px; color: var(--ink-2); }
.cat .n span { background: var(--bg-tint); border-radius: 999px; padding: 2px 9px; }
.cat .n b { color: var(--ink); }
@media (max-width: 1060px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cats { grid-template-columns: 1fr; } }

.paper-fig { margin: 40px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.paper-fig img { width: 100%; border-radius: 8px; }
.paper-fig figcaption { margin-top: 12px; font-size: 14.5px; color: var(--ink-3); line-height: 1.55; }

.metrics { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 12px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.m-name { margin: 0; font-weight: 700; }
.m-name span { margin-left: 6px; font: 600 13px var(--mono); color: var(--leash); }
.m-formula { margin: 10px 0 6px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; font: 500 13.5px var(--mono); color: var(--ink); }
.frac span:first-child { border-bottom: 1.5px solid var(--ink); padding: 0 6px 2px; }
.frac span:last-child { padding-top: 2px; }
.m-note { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 860px) { .metrics { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- tasks */
.filters { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.f-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.f-label { width: 104px; flex: none; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.f-hint { font-size: 14px; color: var(--ink-3); }
.f-hint button { border: 0; background: none; padding: 0; font: 600 14px var(--sans); color: var(--leash); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chips.seg { gap: 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; background: var(--bg-tint); }
.chips.seg .chip { border: 0; background: transparent; padding: 7px 16px; }
.chips.seg .chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
@media (max-width: 640px) { .f-label { width: 100%; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink-2); font: 600 14px var(--sans); cursor: pointer; }
.chip .k { font-weight: 800; color: var(--c, var(--ink-3)); }
.chip .ct { font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .k { color: var(--c-on, #fff); }
.chip[aria-pressed="true"] .ct { color: rgba(255, 255, 255, .7); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; min-width: min(360px, 100%); padding: 0 14px; height: 40px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink-3); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: 500 15px var(--sans); color: var(--ink); min-width: 0; }
.count { margin: 6px 0 18px; font-size: 14px; color: var(--ink-3); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.task { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.t-img { position: relative; aspect-ratio: 16 / 9; background: #1b1f2a; }
.t-img img.third { width: 100%; height: 100%; object-fit: cover; }
.t-img img.wrist { position: absolute; right: 7px; bottom: 7px; width: 31%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0, 0, 0, .35); }
.t-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; }
.t-id { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-radius: 7px; background: rgba(255, 255, 255, .94); font: 700 12.5px var(--mono); color: var(--ink); }
.t-id .cbox { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; }
.t-set { padding: 2px 8px; border-radius: 7px; font: 700 11.5px var(--sans); letter-spacing: .03em; color: #fff; background: rgba(5, 7, 13, .66); }
.t-set.real { background: #2e7d4f; }
.t-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.t-body .prompt { font-size: 13.5px; }
.t-body .scene { font-size: 13px; }
.t-more { font: 600 12px var(--sans); color: var(--ink-3); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }

.modal { border: 0; padding: 0; border-radius: 20px; width: min(1100px, 100% - 24px); max-height: calc(100% - 24px); background: var(--card); color: var(--ink); box-shadow: 0 40px 120px rgba(0, 0, 0, .45); }
.modal::backdrop { background: rgba(12, 14, 20, .62); backdrop-filter: blur(3px); }
.m-close { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-tint); font: 500 24px/1 var(--sans); color: var(--ink-2); cursor: pointer; z-index: 2; }
.m-body { padding: 22px; }
.m-imgs { display: grid; grid-template-columns: 16fr 12fr; gap: 10px; margin-top: 14px; }
.m-imgs figure { margin: 0; }
.m-imgs img { width: 100%; border-radius: 10px; }
.m-imgs figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.m-head { display: flex; align-items: center; gap: 10px; padding-right: 44px; }
.m-head h3 { font: 750 22px var(--sans); letter-spacing: -0.02em; }
.m-text { margin-top: 14px; display: grid; gap: 8px; }
.m-text .prompt { font-size: 15px; }
.m-demo { display: inline-flex; margin-top: 6px; font-weight: 600; }
@media (max-width: 700px) { .m-imgs { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- LEASH */
.epigraph { margin: 22px 0 0; padding: 0; font-size: 22px; font-style: italic; color: var(--ink-2); max-width: 760px; }
.epigraph cite { display: block; margin-top: 4px; font-size: 15px; font-style: normal; color: var(--ink-3); }
.epigraph cite::before { content: "— "; }
.compare { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cmp-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cmp-head { margin: 0; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmp-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #0f7a5c; background: #e3f5ee; padding: 3px 9px; border-radius: 999px; }
.cmp-tag.leash { color: var(--leash); background: var(--leash-2); }
.cmp-foot { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.term { border-radius: 12px; overflow: hidden; background: var(--term); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #161b22; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; font: 500 12px var(--mono); color: #8b949e; }
.term-body { padding: 14px 16px 16px; font: 500 13.5px/1.6 var(--mono); color: #e6edf3; }
.term-body p { margin: 0; white-space: pre-wrap; }
.t-prompt { color: #7ee787; }
.t-dim { color: #8b949e; }
.t-ind { padding-left: 18px; font-size: 12.5px; }
.t-cmd { display: inline-block; margin: 6px 0 10px !important; padding: 6px 12px; border-radius: 8px; color: #ff7b72; font-weight: 700; background: rgba(232, 69, 60, .12); border: 1px solid rgba(232, 69, 60, .55); }
.t-rev { color: #d2a8ff; font-weight: 700; }
.t-block { margin-top: 10px !important; color: #ff7b72; font-weight: 700; }
.term { position: relative; }
.term-body { min-height: 238px; }
.t-replay { margin-left: auto; border: 0; background: transparent; color: #8b949e; font: 500 12px var(--mono); cursor: pointer; padding: 0 2px; }
.t-replay:hover { color: #e6edf3; }
.t-caret { display: inline-block; width: .6em; height: 1.1em; margin-left: 1px; vertical-align: -.18em; background: #e6edf3; animation: blink 1s steps(1) infinite; }
.t-cmd .t-caret { background: #ff7b72; }
@keyframes blink { 50% { opacity: 0; } }
.t-spin { display: inline-block; width: 1.2em; color: #d2a8ff; }
.t-stamp { position: absolute; right: 22px; top: 62px; padding: 4px 14px; border: 4px solid #ff5f57; border-radius: 10px; color: #ff5f57; font: 900 26px var(--sans); letter-spacing: .1em; transform: rotate(-10deg) scale(2.2); opacity: 0; pointer-events: none; background: rgba(13, 17, 23, .55); }
.t-stamp.on { animation: stamp .32s cubic-bezier(.55, 0, .6, 1.4) forwards; }
@keyframes stamp { to { transform: rotate(-10deg) scale(1); opacity: 1; } }
.term-body p.fade { animation: tin .35s ease-out both; }
@keyframes tin { from { opacity: 0; transform: translateY(4px); } }
.c-code { white-space: pre; }
.robot.anim .c-q, .robot.anim .route .bad, .robot.anim .route .bad-head, .robot.anim .route .nogo, .robot.anim .route .nogo-t, .robot.anim .verdict p { opacity: 0; transition: opacity .35s; }
.robot.anim .route .bad { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.3s ease-in-out, opacity .2s; }
.robot.s1 .c-q { opacity: 1; }
.robot.s2 .route .bad { opacity: 1; stroke-dashoffset: 0; }
.robot.s3 .route .bad-head, .robot.s3 .route .nogo, .robot.s3 .route .nogo-t { opacity: 1; }
.robot.s4 .verdict .v-deny { opacity: 1; }
.robot.s5 .verdict .v-next { opacity: 1; }
.route .nogo-t { font: 700 22px var(--sans); fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 4px; }
.verdict { display: grid; gap: 6px; }
.verdict p { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.v-gate { flex: none; font: 700 11.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--harm-2); color: var(--harm); }
.v-gate.ok { background: var(--safe-2); color: var(--safe); }
.code-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--term); font: 600 15px var(--mono); color: #e6edf3; }
.c-fn { color: #79c0ff; }
.c-q { margin-left: auto; font: 700 13px var(--sans); color: #ffc24a; background: rgba(255, 194, 74, .12); padding: 3px 10px; border-radius: 999px; }
.scene-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-pair figure { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: #000; }
.scene-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.scene-pair figcaption { position: absolute; left: 8px; top: 8px; padding: 1px 8px; border-radius: 6px; background: rgba(5, 7, 13, .7); color: #fff; font: 600 12px var(--sans); }
.route { position: absolute; inset: 0; width: 100%; height: 100%; }
.route .nogo { fill: rgba(212, 60, 51, .18); stroke: #ff5a4f; stroke-width: 3; stroke-dasharray: 9 6; }
.route .bad { fill: none; stroke: #ff5a4f; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 0; }
.route .bad-head { fill: none; stroke: #ff5a4f; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.route .start { fill: #fff; stroke: #ff5a4f; stroke-width: 3; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }

.flow { list-style: none; margin: 28px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; counter-reset: none; }
.flow li { position: relative; margin-right: 22px; padding: 12px 12px 11px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.flow li:last-child { margin-right: 0; }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -18px; top: 50%; width: 14px; height: 2px; background: var(--ink-3); }
.flow li:not(:last-child)::before { content: ""; position: absolute; right: -19px; top: calc(50% - 4px); border: 5px solid transparent; border-left-color: var(--ink-3); border-right: 0; }
.flow span { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.f-node { background: var(--card); border: 1px solid var(--line); }
.f-gate { background: var(--leash-2); border: 1px solid #d6cbff; }
.f-gate b { color: var(--leash); }
.f-gate span { color: #6f5fb3; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr 1fr; gap: 12px; } .flow li { margin-right: 0; } .flow li::after, .flow li::before { display: none; } }
.gates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gate { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 16px; }
.g-num { position: absolute; right: 16px; top: 12px; margin: 0; font: 800 40px var(--sans); color: var(--leash-2); line-height: 1; }
.gate h4 { font-size: 18px; font-weight: 730; color: var(--leash); }
.gate dl { margin: 10px 0 0; display: grid; grid-template-columns: 86px 1fr; gap: 6px 10px; font-size: 14.5px; line-height: 1.5; }
.gate dt { font-weight: 650; color: var(--ink-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.gate dd { margin: 0; color: var(--ink-2); }
@media (max-width: 900px) { .gates { grid-template-columns: 1fr; } }
.note-box { margin-top: 14px; padding: 14px 18px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 14px; font-size: 15px; color: var(--ink-2); }
.note-box p { margin: 0; }

/* ---------------------------------------------------------------- results */
.chart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto 1fr; gap: 12px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 14px; }
.chart-ctl { grid-column: 1 / -1; }
.chart { position: relative; min-height: 300px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax text { font: 500 12.5px var(--sans); fill: var(--ink-3); }
.chart .ax line { stroke: var(--line); }
.chart .ax .t { font-weight: 650; fill: var(--ink-2); font-size: 13px; }
.chart .zone { fill: #eaf6ef; }
.chart .zone-t { font: 650 12px var(--sans); fill: var(--safe); }
.chart .pt { cursor: pointer; }
.chart .arrow { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.tip { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.45; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.chart-key { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.chart-key .row { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.chart-key .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.marker-key { margin-top: 10px; border-collapse: collapse; color: var(--ink-2); font-size: 13px; }
.marker-key th { text-align: left; padding: 4px; font-weight: 550; }
.marker-key thead { border-bottom: 1px solid var(--line); }
.marker-key thead th:not(:first-child), .marker-key td { text-align: center; }
.marker-key td { font-size: 19px; line-height: 1; }
@media (max-width: 900px) { .chart-wrap { grid-template-columns: 1fr; } }
.table-wrap { margin-top: 18px; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.table-wrap.narrow-table { max-width: 760px; }
table.res { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.res caption { caption-side: bottom; text-align: left; padding: 10px 16px 14px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
table.res th, table.res td { padding: 9px 14px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.res th { font-size: 13px; font-weight: 650; color: var(--ink-3); background: #fcfbf8; }
table.res td:first-child, table.res th:first-child { text-align: left; }
table.res tr.lr td { background: #f6f3ff; }
table.res tr.lr td:nth-child(2) { color: var(--leash); font-weight: 650; }
table.res tr.api td { color: var(--ink-2); }
table.res td b { font-weight: 700; }
.mdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: 1px; }
.findings { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.finding { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.finding p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.finding .f-big { font-size: 30px; font-weight: 800; color: var(--leash); letter-spacing: -0.03em; margin-bottom: 4px; }
@media (max-width: 860px) { .findings { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.two-col p { color: var(--ink-2); font-size: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 0; } }

/* ---------------------------------------------------------------- bibtex + footer */
.bib { position: relative; background: var(--term); border-radius: 16px; padding: 18px 20px; }
.bib pre { margin: 0; overflow-x: auto; font: 500 14px/1.6 var(--mono); color: #e6edf3; }
.copy { position: absolute; right: 12px; top: 12px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; background: rgba(255, 255, 255, .06); color: #e6edf3; font: 600 13px var(--sans); cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .14); }
.foot { padding: 46px 0 56px; border-top: 1px solid var(--line); }
.inst { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px 44px; }
.inst img { height: 42px; width: auto; max-width: 190px; object-fit: contain; filter: grayscale(1); opacity: .78; transition: filter .2s, opacity .2s; }
.inst img:hover { filter: none; opacity: 1; }
.foot-t { margin: 30px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--ink-3); }

.au { white-space: nowrap; }
@media (max-width: 600px) { .mv-play { width: 52px; height: 52px; } .mv-play svg { width: 22px; height: 22px; } .mv-label { font-size: 12.5px; text-align: center; } .mv-cover { padding: 14px; gap: 8px; } .hero { padding-top: 40px; } }
/* results chart v2: animated arrows, scrubber, inset (homepage/tools/chart_block.js) */
.chart-wrap { grid-template-rows: auto auto 1fr; }
.chart-player { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: -2px 0 0; font-size: 13.5px; color: var(--ink-3); }
.cp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink); font: 650 13.5px var(--sans); cursor: pointer; transition: border-color .15s, color .15s; }
.cp-btn:hover { border-color: var(--leash); color: var(--leash); }
.cp-l { font-weight: 650; white-space: nowrap; }
.cp-l.leash { color: var(--leash); }
.cp-range { -webkit-appearance: none; appearance: none; flex: 1; max-width: 380px; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--leash) var(--p, 0%), var(--line) var(--p, 0%)); outline-offset: 6px; cursor: pointer; }
.cp-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--leash); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.cp-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--leash); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.chart .trk, .chart .pt { transition: opacity .2s; }
.chart .dim { opacity: .12; }
.chart .arrow { opacity: .62; stroke-width: 2.4; }
.chart .head { opacity: .85; }
.chart .zoom-box { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.chart .inset-bg { fill: #fff; stroke: var(--line-2); filter: drop-shadow(0 6px 18px rgba(20, 20, 30, .08)); }
.chart .inset-link { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; }
.chart .ig { stroke: var(--line); }
.chart .it { font: 500 11px var(--sans); fill: var(--ink-3); }
.chart .it-title { font: 650 12px var(--sans); fill: var(--ink-2); }
.chart .ann text { font: 650 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart .ann-l { stroke: var(--ink-3); stroke-width: 1.2; fill: none; }
.chart-key .row { border-radius: 8px; padding: 2px 6px; margin: 0 -6px; transition: background .15s; outline-offset: 2px; }
.chart-key .row.on { background: var(--bg-tint); color: var(--ink); }
@media (max-width: 640px) { .chart-player { flex-wrap: wrap; gap: 8px 10px; } .cp-range { max-width: none; min-width: 150px; } }
