/* Prism: navigator, visualizer and resource explorer. */
:root {
  --bg: #07080a;
  --bg-2: #0c0e11;
  --panel: #111318;
  --panel-2: #171a20;
  --panel-3: #1e2229;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #eceef2;
  --muted: #8d949e;
  --faint: #5a616b;
  --ok: #5ee38e;
  --warn: #ffd65c;
  --bad: #ff6b5b;
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --spectrum: linear-gradient(90deg, #ff6b5b, #ffa351, #ffd65c, #5ee38e, #56b6ff, #a98bff);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code, pre, kbd, .mono { font-family: var(--mono); }
img, video { display: block; max-width: 100%; }
::selection { background: rgba(169, 139, 255, 0.35); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 22px; background: rgba(7, 8, 10, 0.78); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.brand svg { width: 26px; height: 26px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; min-width: 0; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.crumbs .here { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.toplinks { display: flex; gap: 4px; }
.toplinks a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.toplinks a:hover, .toplinks a.on { color: var(--text); background: var(--panel-2); }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-size: 13.5px; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); }
.btn:hover { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--text); color: #0a0b0d; border-color: transparent; font-weight: 550; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 10px var(--c, #fff); flex: none; }
.chip.on { color: var(--text); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.chip.off .dot { opacity: 0.25; box-shadow: none; }
kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel-2); font-size: 11px; color: var(--muted); text-align: center; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- navigator ---------- */
.page { max-width: 1680px; margin: 0 auto; padding: 0 22px 80px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; padding: 64px 0 34px; }
.hero h1 { margin: 12px 0 14px; font-size: clamp(38px, 5.4vw, 76px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 600; }
.hero h1 .spec { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; max-width: 620px; color: var(--muted); font-size: 17px; }
.hero-beam { position: absolute; inset: 0 0 auto auto; width: 46%; height: 100%; pointer-events: none; opacity: 0.9; }
.stats { display: flex; gap: 28px; justify-content: flex-end; flex-wrap: wrap; }
.stat b { display: block; font-size: 30px; font-weight: 550; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.toolbar { position: sticky; top: 56px; z-index: 30; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.toolbar .grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.matrix { --cols: 6; display: grid; grid-template-columns: 250px repeat(var(--cols), minmax(170px, 1fr)); gap: 10px; }
.matrix .corner { align-self: end; padding: 0 4px 8px; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.col-head { position: sticky; top: 112px; z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.col-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--c); }
.col-head .name { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.col-head .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head:hover { border-color: var(--line-2); }
.row-head { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-height: 100%; transition: border-color 0.15s; }
.row-head:hover { border-color: var(--line-2); }
.row-head h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; font-weight: 580; }
.row-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.row-head .go { color: var(--faint); font-size: 12.5px; }
.row-head .star { color: var(--warn); }

.tile { container-type: inline-size; position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); isolation: isolate; transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile video { opacity: 0; transition: opacity 0.25s; }
.tile.playing video { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.72)); z-index: 1; opacity: 0.85; transition: opacity 0.2s; pointer-events: none; }
.tile .edge { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); z-index: 2; }
.tile .meta { position: absolute; left: 12px; right: 10px; bottom: 9px; z-index: 2; display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.86); white-space: nowrap; min-width: 0; }
.tile .meta .who { overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 250px) { .tile .meta .num { display: none; } }
.tile .meta .who { font-weight: 560; }
.tile .meta .num { margin-left: auto; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, 0.65); }
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--c) 70%, transparent); }
.tile:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.tile.empty { display: grid; place-items: center; border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.018) 10px 20px); color: var(--faint); font-size: 12.5px; text-align: center; padding: 10px; }
.tile.empty::after { display: none; }
.tile.empty .state { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tile.empty.failed { color: var(--bad); }
.badge { position: absolute; top: 9px; right: 9px; z-index: 2; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); font-family: var(--mono); font-size: 10.5px; color: rgba(255, 255, 255, 0.8); }

.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 64px; }
.how > div { padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.how h4 { margin: 8px 0 6px; font-size: 16px; font-weight: 560; }
.how p { margin: 0; color: var(--muted); font-size: 14px; }
.agents-note { margin-top: 14px; padding: 18px 22px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--muted); font-size: 14px; }
.agents-note code { color: var(--text); font-size: 12.5px; }
footer.site { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- input page ---------- */
.input-layout { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: 34px; padding-top: 34px; align-items: start; }
.brief { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.brief h1 { margin: 6px 0 4px; font-size: 40px; letter-spacing: -0.03em; line-height: 1.02; font-weight: 600; }
.brief .lede { color: var(--muted); margin: 0; }
.card { padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.card h2 { margin: 0 0 10px; font-size: 13px; font-weight: 500; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card h2 .grow { flex: 1; }
.prose { font-size: 15px; line-height: 1.62; }
.prose p { margin: 0 0 0.8em; }
.prose p:last-child { margin-bottom: 0; }
.prose code { padding: 1px 5px; border-radius: 5px; background: var(--panel-3); font-size: 0.86em; }
.prose ul { padding-left: 1.1em; margin: 0.4em 0 0.8em; }
.prose li { margin: 0.2em 0; }
.prose h1, .prose h2, .prose h3 { font-family: var(--font); text-transform: none; letter-spacing: -0.01em; color: var(--text); font-size: 1.1em; margin: 1em 0 0.4em; }
.prose table { border-collapse: collapse; font-size: 13px; margin: 0.6em 0; width: 100%; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 5px 8px; text-align: left; vertical-align: top; }
.prose a { color: #9ecbff; text-decoration: underline; text-underline-offset: 2px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); padding: 12px; border-radius: 10px; overflow: auto; font-size: 12.5px; }
details.rules summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
details.rules[open] summary { margin-bottom: 10px; }

.takes { position: relative; }
.takes-head { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.takes-head h2 { margin: 0; font-size: 22px; font-weight: 560; letter-spacing: -0.01em; }
.takes-head .grow { flex: 1; }
.take-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.take { display: flex; flex-direction: column; gap: 10px; }
.take .tile { aspect-ratio: 16 / 10; }
.take .info { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.take .info .who { font-weight: 560; }
.take .info .sub { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-left: auto; }
.take .excerpt { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.beams { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }

/* ---------- viewer ---------- */
body.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
.vbar { position: relative; z-index: 20; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 16px; background: rgba(10, 11, 13, 0.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: margin-top 0.35s var(--ease), opacity 0.3s; }
.vbar .title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.vbar .title .input-name { font-weight: 560; white-space: nowrap; }
.vbar .title .maker-name { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); font-size: 13px; white-space: nowrap; }
.vbar .spacer { flex: 1; }
.vbar .actions { display: flex; gap: 6px; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; background: radial-gradient(1200px 600px at 50% 120%, #14161b, #050506 60%); }
.pane { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pane + .pane { border-left: 1px solid var(--line-2); }
.frame { position: relative; width: 100%; height: 100%; background: #0b0b0c; transition: width 0.45s var(--ease), height 0.45s var(--ease), border-radius 0.45s var(--ease); overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.frame .veil { position: absolute; inset: 0; z-index: 2; background: #0b0b0c center / cover no-repeat; transition: opacity 0.35s ease; pointer-events: none; }
.frame .veil.gone { opacity: 0; }
.frame .loading { position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); font-size: 12px; color: rgba(255, 255, 255, 0.8); transition: opacity 0.2s; }
.frame .loading.gone { opacity: 0; }
.stage.device-tablet .frame, .stage.device-phone .frame { border-radius: 28px; box-shadow: 0 0 0 10px #16181c, 0 0 0 11px #2a2e35, 0 40px 90px rgba(0, 0, 0, 0.6); }
.pane-label { position: absolute; top: 12px; left: 12px; z-index: 5; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10, 11, 13, 0.82); backdrop-filter: blur(10px); border: 1px solid var(--line-2); }
.pane-label button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.pane-label button.on { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); }

.dock { position: absolute; left: 50%; bottom: 18px; z-index: 25; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(12, 13, 16, 0.86); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); transition: opacity 0.35s, transform 0.35s var(--ease); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.dock .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; flex: none; }
.maker-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.maker-btn:hover { background: var(--panel-2); color: var(--text); }
.maker-btn.on { background: color-mix(in srgb, var(--c) 16%, var(--panel-2)); color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent) inset; }
.maker-btn .k { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.maker-btn[disabled] { opacity: 0.35; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.on { background: var(--panel-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.viewer.idle .dock { opacity: 0.28; }
.dock:hover, .dock:focus-within { opacity: 1 !important; }
.viewer.immersive.peek .dock { opacity: 1; pointer-events: auto; }
.viewer.immersive .vbar { margin-top: -50px; opacity: 0; }
.viewer.immersive .dock { opacity: 0; pointer-events: none; }
.viewer.immersive .hot { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; z-index: 26; }
.toast { position: fixed; left: 50%; top: 66px; z-index: 90; transform: translate(-50%, -10px); padding: 9px 14px; border-radius: 12px; background: var(--text); color: #0a0b0d; font-size: 13.5px; font-weight: 520; opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* grid view: all takes at once */
.allgrid { position: absolute; inset: 0; z-index: 8; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 10px; padding: 12px 12px 86px; background: #050506; overflow: auto; }
.allgrid .tile { aspect-ratio: auto; min-height: 180px; }
.allgrid .tile video { opacity: 1; }

/* info popover */
.pop { position: absolute; right: 12px; top: 58px; z-index: 30; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 150px); overflow: auto; padding: 18px; border-radius: var(--radius); background: rgba(17, 19, 24, 0.97); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.pop h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.kv dd.bad { color: var(--bad); }
.kv dd.ok { color: var(--ok); }
.pop .notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- drawers & modals ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.25s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(1080px, 94vw); display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: -40px 0 90px rgba(0, 0, 0, 0.5); transform: translateX(102%); transition: transform 0.38s var(--ease); }
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 560; display: flex; align-items: center; gap: 9px; }
.drawer-head .grow { flex: 1; }
.modal { position: fixed; left: 50%; top: 50%; z-index: 80; width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); transform: translate(-50%, -46%) scale(0.98); opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.3s var(--ease); }
.modal.show { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.modal h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.01em; font-weight: 580; }
.modal .lede { margin: 0 0 18px; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.mode { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; text-align: left; }
.mode b { display: block; font-size: 14px; margin-bottom: 2px; }
.mode span { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }
.mode.on { border-color: rgba(255, 255, 255, 0.5); background: var(--panel-3); }
.copybox { position: relative; margin: 0; padding: 14px 16px; padding-right: 92px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: #dfe3ea; max-height: 300px; overflow: auto; }
.copybox + .btn, .copy-abs { position: absolute; top: 10px; right: 10px; }
.copywrap { position: relative; }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.modal .fine { color: var(--faint); font-size: 12.5px; margin-top: 14px; }

/* ---------- explorer ---------- */
.explorer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.xtabs { display: flex; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.xtabs button { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; white-space: nowrap; }
.xtabs button.on { background: var(--panel-3); color: var(--text); }
.xtabs .count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.xbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.xtree { overflow: auto; padding: 8px 6px 20px; border-right: 1px solid var(--line); font-size: 13px; scrollbar-width: thin; }
.xfilter { width: calc(100% - 8px); margin: 2px 4px 8px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; }
.xnode { display: flex; align-items: center; gap: 7px; width: 100%; height: 28px; padding: 0 8px 0 calc(8px + var(--d, 0) * 14px); border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 13px; }
.xnode:hover { background: var(--panel-2); }
.xnode.on { background: color-mix(in srgb, var(--accent-c, #56b6ff) 16%, var(--panel-2)); }
.xnode .ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; font-size: 10px; font-family: var(--mono); font-weight: 600; border-radius: 4px; }
.xnode .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xnode .sz { color: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.xnode.dir { color: var(--muted); }
.xnode.dir .caret { transition: transform 0.15s; width: 10px; display: inline-block; }
.xnode.dir.open .caret { transform: rotate(90deg); }
.xpreview { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.xph { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 50px; }
.xph .path { font-family: var(--mono); font-size: 12.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xph .facts { color: var(--faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.xph .grow { flex: 1; }
.xview { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.xview.center { display: grid; place-items: center; padding: 24px; }
.xview pre.code { margin: 0; padding: 14px 0; font-size: 12.5px; line-height: 1.6; counter-reset: ln; tab-size: 2; }
.xview pre.code .ln { display: block; padding: 0 16px 0 0; white-space: pre; }
.xview pre.code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 52px; padding-right: 14px; margin-right: 4px; text-align: right; color: var(--faint); user-select: none; border-right: 1px solid var(--line); }
.xview.wrap pre.code .ln { white-space: pre-wrap; word-break: break-word; }
.xview .prose { max-width: 820px; padding: 22px 28px 60px; }
.checker { background-color: #1a1c20; background-image: conic-gradient(#23262b 25%, transparent 0 50%, #23262b 0 75%, transparent 0); background-size: 22px 22px; border-radius: 12px; padding: 18px; }
.xview img.media { max-height: calc(100vh - 240px); border-radius: 6px; }
.xview video.media { max-height: calc(100vh - 240px); border-radius: 10px; background: #000; }
.wave { width: min(760px, 90%); display: flex; flex-direction: column; gap: 14px; }
.wave canvas { width: 100%; height: 150px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.wave audio { width: 100%; }
model-viewer { width: min(900px, 100%); height: min(620px, calc(100vh - 260px)); background: radial-gradient(circle at 50% 40%, #22252b, #0c0d10); border-radius: 14px; }
.specimen { max-width: 820px; padding: 24px; }
.specimen .big { font-size: 64px; line-height: 1.05; margin: 0 0 18px; }
.empty-note { color: var(--faint); font-size: 13.5px; padding: 30px; text-align: center; }

/* session replay */
.replay { padding: 0 0 60px; }
.replay-head { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; background: rgba(12, 14, 17, 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.replay-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.replay-controls input[type="range"] { flex: 1; min-width: 140px; accent-color: #a98bff; }
.strip { display: flex; height: 12px; gap: 1px; border-radius: 4px; overflow: hidden; cursor: pointer; }
.strip i { flex: 1; min-width: 1px; background: var(--faint); opacity: 0.55; }
.strip i.message { background: #eceef2; }
.strip i.thinking { background: #a98bff; }
.strip i.tool { background: #56b6ff; }
.strip i.error { background: #ff6b5b; }
.strip i.result { background: #5ee38e; }
.strip i.past { opacity: 1; }
.step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); transition: opacity 0.25s, background 0.3s; }
.step.future { opacity: 0.18; }
.step.current { background: rgba(169, 139, 255, 0.07); }
.step .si { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-family: var(--mono); background: var(--panel-3); color: var(--muted); }
.step.kind-message .si { background: #eceef2; color: #0a0b0d; }
.step.kind-thinking .si { background: rgba(169, 139, 255, 0.2); color: #cbb9ff; }
.step.kind-tool .si { background: rgba(86, 182, 255, 0.16); color: #8fd0ff; }
.step.kind-error .si, .step.err .si { background: rgba(255, 107, 91, 0.2); color: #ff9a8f; }
.step.kind-result .si { background: rgba(94, 227, 142, 0.2); color: #8ff0b2; }
.step .st { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.step .st b { font-weight: 560; }
.step .st .sum { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.step .txt { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: #d7dbe2; white-space: pre-wrap; word-break: break-word; }
.step.kind-thinking .txt { color: #b8adda; font-style: italic; }
.step details { margin-top: 6px; }
.step details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.step pre { margin: 6px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* ---------- maker page ---------- */
.maker-hero { display: flex; align-items: end; gap: 30px; flex-wrap: wrap; padding: 50px 0 28px; }
.maker-hero h1 { margin: 8px 0 6px; font-size: 54px; letter-spacing: -0.03em; line-height: 1; font-weight: 600; display: flex; align-items: center; gap: 16px; }
.maker-hero h1 .dot { width: 18px; height: 18px; }
.maker-hero .sub { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.maker-hero .stats { margin-left: auto; }
.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .stats { justify-content: flex-start; }
  .hero-beam { display: none; }
  .input-layout { grid-template-columns: 1fr; }
  .brief { position: static; max-height: none; }
  .beams { display: none; }
}
@media (max-width: 1180px) {
  .matrix { display: block; }
  .matrix .corner, .matrix .col-head { display: none; }
  .mrow { display: block; margin-bottom: 22px; }
  .mrow .row-head { margin-bottom: 10px; min-height: 0; }
  .mstrip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
  .mstrip .tile { flex: 0 0 clamp(220px, 30%, 340px); scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .toplinks { display: none; }
  .page { padding: 0 14px 60px; }
  .hero h1 { font-size: 40px; }
  .toolbar { top: 56px; }
  .mstrip .tile { flex: 0 0 76%; }
  .how { grid-template-columns: 1fr; }
  .vbar .title .input-name { display: none; }
  .vbar .actions .label { display: none; }
  .viewer .dock { position: relative; left: auto; bottom: auto; transform: none; flex: none; max-width: none; width: 100%; border-radius: 0; border-width: 1px 0 0; box-shadow: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .viewer.idle .dock { opacity: 1; transform: none; }
  .viewer .hot { display: none; }
  .maker-btn .lbl { display: none; }
  .maker-btn { padding: 0 10px; }
  .xbody { grid-template-columns: 1fr; grid-template-rows: 38% 62%; }
  .xtree { border-right: 0; border-bottom: 1px solid var(--line); }
  .modes { grid-template-columns: 1fr 1fr; }
  .allgrid { grid-template-columns: 1fr 1fr; }
  .maker-hero h1 { font-size: 38px; }
}
@media (min-width: 1181px) {
  .mrow { display: contents; }
  .mstrip { display: contents; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
