/* ══════════ v2 additions ══════════ */
.foot-dom { color: var(--ink-2); font-size: 12px; }
.foot-dom:hover { color: var(--ink); }

/* Landing scene */
body.is-scene { background: #000; }
body.is-scene .top, body.is-scene .foot { display: none; }
body.is-scene main { max-width: none; padding: 0; }
body.is-scene main.enter > * { animation: fade 240ms var(--ease) both; }
.scene { position: fixed; inset: 0; overflow: hidden; background: #000; color: #8a8a8a; }
.scene-media, .scene-media picture, .scene-media img, .scene-media video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-media img, .scene-media video { object-fit: cover; object-position: 51% 53%; }
.scene-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; }
.scene-brand { color: #ededed; }
.scene-btn { display: inline-flex; align-items: center; gap: 28px; height: 30px; padding: 0 10px 0 11px; border: 1px solid rgba(237,237,237,.32); border-radius: 2px; font-size: 12px; letter-spacing: 0; color: #d6d6d6; background: rgba(0,0,0,.35); transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.scene-btn span { color: #8a8a8a; transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.scene-btn:hover { border-color: rgba(237,237,237,.7); color: #fff; background: rgba(0,0,0,.6); }
.scene-btn:hover span { transform: translateX(2px); color: var(--accent); }
.scene-copy { position: absolute; left: var(--gx, 50%); top: calc(var(--gy, 53%) + 72px); transform: translateX(-50%); margin: 0; display: grid; gap: 6px; text-align: center; font: 400 14px/22px var(--mono); letter-spacing: .01em; color: #7c7c7c; white-space: nowrap; }
.scene-copy span:first-child { color: #a8a8a8; }
.scene-foot { position: absolute; left: 0; right: 0; bottom: 22px; display: grid; justify-items: center; gap: 6px; font-size: 12px; }
.scene-foot nav { display: flex; gap: 18px; margin-bottom: 6px; }
.scene-foot nav a { color: #6f6f6f; transition: color var(--t) var(--ease); }
.scene-foot nav a:hover { color: #ededed; }
.scene-dom { color: #d6d6d6; font-size: 13px; }
.scene-dom:hover { color: #fff; }
.scene-foot small { font-size: 10px; color: #5c5c5c; letter-spacing: .02em; }

/* composer v2 */
.tools { row-gap: var(--s2); }
.palette { flex-wrap: wrap; }
.ibtn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease); }
.ibtn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.ibtn:disabled { opacity: .35; cursor: not-allowed; }
.circuit-f .hint a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.circuit-f .hint a:hover { color: var(--ink); }
.ctitle { color: var(--ink); font-weight: 500; font-size: 13px; letter-spacing: -0.01em; padding-right: var(--s3); border-right: 1px solid var(--line-2); }
.sysid { font: 400 11px/1 var(--mono); color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.seg.two { grid-template-columns: 1fr 1fr; }
.skel { display: grid; gap: 8px; }
.skel span { height: 18px; border-radius: 3px; background: var(--bg); }
.skel span:nth-child(2) { width: 72%; } .skel span:nth-child(3) { width: 48%; }
.bestfit { width: 100%; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: -4px 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); font-size: 12.5px; color: var(--ink-2); text-align: left; cursor: pointer; transition: border-color var(--t) var(--ease); }
.bestfit:hover { border-color: var(--line-3); }
.bestfit.on { cursor: default; }
.bestfit > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bestfit .bf-sw { color: var(--ink); font-weight: 500; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; border: 1px solid var(--line-2); font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; }
.pill.dim { color: var(--ink-3); }

/* ranking */
.rank { margin-top: var(--s4); }
.rtbl tbody tr.sel { background: var(--card-2); box-shadow: inset 2px 0 0 var(--accent); }
.rtbl td { padding-top: 12px; padding-bottom: 12px; }
.esp { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.ebar { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.ebar span { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width 220ms var(--ease); }
.rtbl tr.sel .ebar span { background: var(--accent); }
.esp .m { font: 400 13px/20px var(--mono); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.tags-c { display: flex; gap: 6px; justify-content: flex-end; align-items: center; min-height: 20px; }
.rank-f { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--ink-3); }

/* state tab */
.blochs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--s2); }
.bfig { margin: 0; display: grid; justify-items: center; padding: var(--s2) 0 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.bfig figcaption { display: flex; gap: 6px; font: 400 11px/14px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bfig figcaption b { color: var(--ink); font-weight: 500; }
.bloch .bs { fill: none; stroke: var(--line-3); stroke-width: 1; }
.bloch .be { fill: none; stroke: var(--line-3); stroke-width: .8; }
.bloch .be.back { stroke-dasharray: 1.5 2; opacity: .6; }
.bloch .ba { stroke: var(--line-2); stroke-width: .8; }
.bloch .bl { fill: var(--ink-4); font: 400 7px var(--mono); text-anchor: middle; }
.bloch .bv { stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.bloch .bd { fill: var(--accent); }
.bloch .bm { fill: var(--ink-3); }
.bnote { font-size: 12px; line-height: 18px; color: var(--ink-3); margin: var(--s3) 0 var(--s4); }

/* static circuit svg */
.csvg .cw { stroke: var(--line-3); stroke-width: 1; }
.csvg .cv { stroke: var(--ink); stroke-width: 1.2; }
.csvg .cd { fill: var(--ink); }
.csvg .ct { fill: var(--card); stroke: var(--ink); stroke-width: 1.2; }
.csvg .cb { fill: var(--card-2); stroke: var(--line-3); stroke-width: 1; }
.csvg .cb.m { fill: var(--bg); }
.csvg .cm { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; }
.csvg .ct2 { fill: var(--ink); font: 500 9.5px var(--mono); text-anchor: middle; }
.csvg .ct2.sm { font-size: 7.5px; }
.csvg .cl { fill: var(--ink-3); font: 400 10px var(--mono); }
.trmeta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: 12px; color: var(--ink-3); margin-bottom: var(--s3); }
.trmeta .kv { font-family: var(--mono); }
.trmeta b { color: var(--ink); font-weight: 500; }
.trwrap { overflow-x: auto; scrollbar-width: thin; }
.trwrap svg { display: block; }

/* library */
.lib { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.libc { display: flex; flex-direction: column; overflow: hidden; transition: border-color var(--t) var(--ease); }
.libc:hover { border-color: var(--line-2); }
.lib-prev { height: 132px; display: flex; align-items: center; padding: 0 var(--s4); background: var(--bg); border-bottom: 1px solid var(--line); overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.lib-prev svg { flex: none; }
.lib-b { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.lib-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.lib-h h3 { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: -0.015em; }
.lib-b p { font-size: 13px; line-height: 20px; color: var(--ink-2); }
.lib-m { display: flex; gap: var(--s3); font: 400 12px/16px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lib-f { margin-top: auto; padding-top: var(--s3); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); border-top: 1px solid var(--line); }
.lib-o { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-o b { color: var(--ink); font-weight: 500; }

/* backend detail v2 */
.h1-sys { font-size: 14px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-left: 6px; vertical-align: 6px; }
.dhead-r { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.chips.sm { padding: 2px; }
.chips.sm button { height: 24px; padding: 0 9px; font-size: 12px; }
.heat-wrap { position: relative; background: var(--bg); padding: var(--s5) var(--s4); overflow-x: auto; }
.heat-c { display: grid; place-items: center; min-width: max-content; }
.heat-svg { display: block; height: auto; }
.heat-svg .hq, .heat-svg .he { cursor: crosshair; }
.heat-svg .hq:hover { stroke: var(--ink); stroke-width: 2; }
.heat-svg .he:hover { stroke-width: 7; }
.htip { position: absolute; left: 0; top: 0; width: 216px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: 0 12px 40px rgba(0,0,0,.55); pointer-events: none; opacity: 0; transition: opacity 120ms var(--ease); z-index: 3; }
.htip.on { opacity: 1; }
.ht-h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.ht-h span { font: 400 11px var(--mono); color: var(--ink-3); }
.htip dl { margin: 0; display: grid; gap: 3px; }
.htip dl div { display: flex; justify-content: space-between; font-size: 12px; }
.htip dt { color: var(--ink-3); }
.htip dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.heat-f { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.glegend { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ramp { display: inline-block; width: 72px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #3a3a3a, #ededed); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sw.err { background: var(--err); }
.sw.ring { border: 1.5px solid var(--accent); }
.snap { margin-left: auto; font-size: 11px; }
.snap a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.srcs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.srcs a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: color var(--t) var(--ease); }
.srcs a:hover { color: var(--ink); }
.cta-card { display: grid; gap: 4px; padding: var(--s4) 48px var(--s4) var(--s4); position: relative; transition: border-color var(--t) var(--ease); }
.cta-card:hover { border-color: var(--line-3); }
.cta-card b { font-weight: 500; letter-spacing: -0.015em; }
.cta-card .muted { font-size: 13px; }
.cta-card .go { position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%); }
.cta-card:hover .go { color: var(--ink); transform: translate(2px, -50%); }
.ul { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.toolbar-r { margin-left: auto; font-size: 13px; }

/* credits */
.credits-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s4); margin-bottom: var(--s4); align-items: start; }
.unlocks { list-style: none; margin: 0; padding: var(--s1) var(--s4) var(--s2); display: grid; }
.unlocks li { display: grid; grid-template-columns: 132px 1fr; gap: var(--s3); padding: 11px 0; font-size: 13px; line-height: 20px; }
.unlocks li + li { border-top: 1px solid var(--line); }
.unlocks b { font-weight: 500; }
.unlocks span { color: var(--ink-2); }
.ladder td { padding-top: 11px; padding-bottom: 11px; }
.ladder tbody tr { cursor: default; } .ladder tbody tr:hover { background: none; }
.holding { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px var(--s3); border: 1px dashed var(--line-2); border-radius: var(--r-md); font-size: 12px; color: var(--ink-3); }
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.cc { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.cc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.cc-h > div { display: grid; gap: 1px; }
.cc-h .v { font-size: 12px; }
.cc-h b { font-weight: 500; font-size: 15px; letter-spacing: -0.015em; }
.cc-h .mono { font-size: 11px; }
.cc-rate { margin-top: var(--s2); display: flex; align-items: baseline; gap: 4px; }
.cc-rate .num { font-size: 24px; line-height: 30px; font-weight: 500; letter-spacing: -0.035em; }
.cc-rate small { color: var(--ink-3); font-size: 12px; }
.cc-note { font-size: 11px; font-family: var(--mono); min-height: 16px; }
.blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: var(--s2); }
.blk { display: grid; gap: 2px; justify-items: start; padding: 8px 9px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); color: var(--ink); cursor: pointer; text-align: left; min-width: 0; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.blk:hover { border-color: var(--ink); background: var(--card-2); }
.blk:disabled { opacity: .5; cursor: progress; }
.blk .bh { font-weight: 500; font-size: 14px; letter-spacing: -0.02em; }
.blk .bp { font: 400 11px/14px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.blk .bd { font: 500 10px/14px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.fine { font-size: 12px; line-height: 18px; color: var(--ink-3); margin-top: var(--s5); max-width: 760px; }

/* jobs / permalink */
.empty-a { display: flex; gap: var(--s2); }
.empty.sm { padding: var(--s6) var(--s4); }
.urlbox { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.og { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; margin-top: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }

/* keys modal */
.modal.wide { max-width: 520px; }
.keys .kgroup { margin-top: var(--s4); }
.keys .kgroup .label { margin-bottom: 4px; }
.krow { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; color: var(--ink-2); }
.krow + .krow { border-top: 1px solid var(--line); }
.krow > span:last-child { display: flex; gap: 4px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--card-2); font: 500 11px/1 var(--mono); color: var(--ink); }

@media (max-width: 1180px) {
  .lib { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credits-top { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; height: auto; row-gap: 0; }
  .brand { height: 52px; }
  .top-r { height: 52px; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; height: 44px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .lib { grid-template-columns: 1fr; }
  .heat-f .snap { margin-left: 0; }
  .toolbar-r { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .brand .word { display: inline; }
  .cgrid { grid-template-columns: 1fr; }
  .unlocks li { grid-template-columns: 1fr; gap: 2px; }
  .scene-top { padding: 18px 16px; }
  .scene-btn { gap: 16px; }
  .scene-copy { font-size: 13px; line-height: 20px; }
  .scene-foot nav { gap: 14px; }
}

.circuit-f .hint kbd { min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
.bestfit .bf-sw { flex: none; }

@media (max-width: 560px) { .ladder th, .ladder td { padding-left: 12px; padding-right: 12px; white-space: normal; } .ladder td.muted { font-size: 13px; } }
.tabs button { white-space: nowrap; }
@media (max-width: 560px) { #results .card-h .aside { display: none; } .tabs { overflow-x: auto; scrollbar-width: none; } }
.circuit-wrap::-webkit-scrollbar, .trwrap::-webkit-scrollbar, .tbl-scroll::-webkit-scrollbar, .heat-wrap::-webkit-scrollbar { height: 6px; }
.circuit-wrap::-webkit-scrollbar-thumb, .trwrap::-webkit-scrollbar-thumb, .tbl-scroll::-webkit-scrollbar-thumb, .heat-wrap::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 3px; }
.circuit-wrap::-webkit-scrollbar-track, .trwrap::-webkit-scrollbar-track, .tbl-scroll::-webkit-scrollbar-track, .heat-wrap::-webkit-scrollbar-track { background: transparent; }

/* interactive hands */
.scene .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 51% 53%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.scene .hand { inset: auto; object-fit: fill; will-change: transform; backface-visibility: hidden; }
.scene .hand-l { transition: filter 180ms var(--ease); }
.scene.touching .hand-l { filter: brightness(1.25); }
.scene.touching { cursor: pointer; }
.scene-top, .scene-copy, .scene-foot { z-index: 2; }
.scene-copy span { transition: color 180ms var(--ease); }
.scene.touching .scene-copy span:not(:first-child) { color: #d6d6d6; }
.scene.touching .scene-btn { border-color: rgba(255,255,255,.6); background: rgba(255, 255, 255,.15); color: #fff; }
.scene.touching .scene-btn span { color: var(--accent); transform: translateX(2px); }
.scene { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
