/* Workshop by nax.works: a calm, flat dashboard. Monochrome chrome like nax.works; each discipline
   brings one quiet colour. Inter for the interface, PT Mono for small labels. Dark and light themes. */

:root {
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "PT Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --rail: 248px;
  --top: 56px;
  --r: 10px;
  --r-lg: 14px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --surface: #111113;
  --surface2: #16161a;
  --raise: #1b1b20;
  --hover: rgba(255, 255, 255, 0.045);
  --press: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.075);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #ececea;
  --text2: #a3a3a0;
  --text3: #6c6c6a;
  --strong: #fafaf7;
  --btn: #f5f5f3;
  --btn-text: #0a0a0b;
  --dot: rgba(255, 255, 255, 0.07);
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line2);
  --bad: #ff8577;
  --good: #7ee3a0;
  --ds: 88%; --dl: 70%;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface2: #f9f9f8;
  --raise: #ffffff;
  --hover: rgba(0, 0, 0, 0.04);
  --press: rgba(0, 0, 0, 0.07);
  --line: rgba(0, 0, 0, 0.08);
  --line2: rgba(0, 0, 0, 0.15);
  --text: #1a1a19;
  --text2: #5d5d5a;
  --text3: #8b8b88;
  --strong: #0a0a0a;
  --btn: #111111;
  --btn-text: #fafaf7;
  --dot: rgba(0, 0, 0, 0.07);
  --scrim: rgba(20, 20, 20, 0.35);
  --shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--line);
  --bad: #c9382a;
  --good: #1d8a4a;
  --ds: 72%; --dl: 40%;
}

/* a discipline's colour: put class "d" and style="--h: <hue>" on anything */
.d { --dc: hsl(var(--h) var(--ds) var(--dl)); --dbg: hsl(var(--h) var(--ds) var(--dl) / 0.12); --dline: hsl(var(--h) var(--ds) var(--dl) / 0.35); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--strong); font-weight: 600; letter-spacing: -0.015em; }
::selection { background: var(--strong); color: var(--bg); }
:focus-visible { outline: 2px solid var(--strong); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 500; padding: 8px 12px; border-radius: 8px; background: var(--btn); color: var(--btn-text); }
.mono { font-family: var(--mono); }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.label { font: 11px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes float { 50% { transform: translateY(-6px); } }

::view-transition-old(page) { animation: 120ms ease both vt-out; }
::view-transition-new(page) { animation: 260ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------------------------------------------------------------- boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-dots { display: flex; gap: 6px; }
.boot-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: blink 1s infinite; }
.boot-dots i:nth-child(2) { animation-delay: 0.15s; }
.boot-dots i:nth-child(3) { animation-delay: 0.3s; }

/* ---------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--strong); }
.brand-mark { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--strong); display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; place-content: center; }
.brand-mark i { width: 4px; height: 4px; border-radius: 50%; background: var(--bg); }
.brand-mark i:nth-child(5) { background: hsl(218 90% 66%); transform: scale(1.35); }
.brand-text { display: grid; line-height: 1.1; min-width: 0; }
.brand-text b { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-text small { font: 10.5px var(--mono); letter-spacing: 0.06em; color: var(--text3); }

/* ---------------------------------------------------------------- buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; font-weight: 550; font-size: 13.5px; white-space: nowrap; border: 1px solid var(--line2); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, transform .15s var(--ease), opacity .15s; user-select: none; }
.btn:hover { background: var(--surface2); border-color: var(--text3); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.btn.primary:hover { opacity: 0.88; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn[disabled], .btn.busy { opacity: 0.5; pointer-events: none; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; color: var(--text); }
.field > small { color: var(--text3); font-size: 12px; }
.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--text3); }
.input:hover { border-color: var(--text3); }
.input:focus { border-color: var(--strong); box-shadow: 0 0 0 3px var(--hover); }
.input[readonly] { background: var(--surface2); color: var(--text2); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.input.sm { height: 32px; font-size: 13px; }
.pw { position: relative; }
.pw .input { padding-right: 42px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--text3); }
.pw button:hover { color: var(--text); background: var(--hover); }
.form-error { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); animation: rise .25s var(--ease); }
.form-error .i { width: 16px; height: 16px; margin-top: 1px; }
.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; font: 11px var(--mono); color: var(--text3); border: 1px solid var(--line2); background: var(--surface2); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; color: var(--text2); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.seg button .i { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raise); color: var(--strong); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .3s var(--ease); }
.rail-mini .app { --rail: 64px; }
.main { min-width: 0; display: flex; flex-direction: column; }

.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface2); overflow: hidden; z-index: 60; }
.side-head { height: var(--top); flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; display: grid; align-content: start; gap: 18px; scrollbar-width: none; }
.side-scroll::-webkit-scrollbar { display: none; }
.nav-group { display: grid; gap: 1px; }
.nav-group > .label { padding: 0 10px 6px; white-space: nowrap; }
.nav { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text2); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--press); color: var(--strong); }
.nav .i { width: 17px; height: 17px; }
.nav .count { margin-left: auto; font: 11px var(--mono); color: var(--text3); }
.nav.d .i { color: var(--dc); }
.nav-text { overflow: hidden; text-overflow: ellipsis; }
.side-foot { flex: none; padding: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.plan-note { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 2px; font-size: 12.5px; white-space: nowrap; }
.plan-note b { font-weight: 600; color: var(--strong); display: flex; align-items: center; gap: 6px; }
.plan-note b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.plan-note span { color: var(--text3); }

/* collapsed rail (desktop) */
.rail-mini .side-head { padding: 0; justify-content: center; }
.rail-mini .side-head .brand-text, .rail-mini .side-head .collapse { display: none; }
.rail-mini .nav { justify-content: center; padding: 0; }
.rail-mini .nav-text, .rail-mini .nav .count, .rail-mini .nav-group > .label, .rail-mini .plan-note { display: none; }
.rail-mini .side-scroll { padding: 12px 10px; }
.rail-mini .nav-group > .label + .nav { margin-top: 0; }
.rail-mini .nav-group:not(:first-child) { border-top: 1px solid var(--line); padding-top: 14px; }
.expand { display: none; }
.rail-mini .expand { display: flex; }

.top { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.top .burger { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--text2); }
.crumbs a { padding: 3px 6px; border-radius: 6px; white-space: nowrap; transition: background .15s, color .15s; }
.crumbs a:hover { background: var(--hover); color: var(--text); }
.crumbs .sep { color: var(--text3); }
.crumbs b { font-weight: 550; color: var(--strong); padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 34px; width: 240px; padding: 0 6px 0 11px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); color: var(--text3); transition: border-color .15s; }
.search-btn:hover { border-color: var(--text3); color: var(--text2); }
.search-btn .i { width: 16px; height: 16px; }
.search-btn span:not(.kbd) { flex: 1; text-align: left; font-size: 13px; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--btn-text); background: var(--btn); transition: box-shadow .15s; }
.avatar:hover, .avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--press); }

.scrim { display: none; }

#view { flex: 1; outline: none; view-transition-name: page; }
.page { width: min(1180px, 100%); margin: 0 auto; padding: 28px 32px 64px; animation: rise .35s var(--ease); }
.page.narrow { width: min(820px, 100%); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; line-height: 1.2; }
.page-head p { color: var(--text2); margin-top: 4px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; }
.section-head a { font-size: 13px; color: var(--text2); display: inline-flex; align-items: center; gap: 4px; }
.section-head a:hover { color: var(--strong); }
.section-head a .i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- cards */
.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; }
.card-head p { color: var(--text2); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; display: grid; gap: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface2); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 13px; color: var(--text3); }
.card.danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.card.danger .card-foot { background: color-mix(in srgb, var(--bad) 6%, var(--surface2)); }
.stack { display: grid; gap: 16px; }

/* discipline icon tile */
.dicon { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--dc); background: var(--dbg); box-shadow: inset 0 0 0 1px var(--dline); }
.dicon .i { width: 18px; height: 18px; }
.dicon.lg { width: 44px; height: 44px; border-radius: 12px; }
.dicon.lg .i { width: 22px; height: 22px; }
.dicon.sm { width: 26px; height: 26px; border-radius: 7px; }
.dicon.sm .i { width: 15px; height: 15px; }
.ddot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text2); border: 1px solid var(--line2); white-space: nowrap; }
.pill.d { color: var(--dc); border-color: var(--dline); background: var(--dbg); }
.pill .i { width: 13px; height: 13px; }
.badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font: 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text2); background: var(--hover); border: 1px solid var(--line); }
.badge.lead { color: var(--dc, var(--strong)); border-color: var(--dline, var(--line2)); background: var(--dbg, var(--hover)); }

/* quick-start tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s, transform .25s var(--ease), background .2s; overflow: hidden; }
.tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, var(--dbg), transparent 55%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.tile:hover { border-color: var(--dline); transform: translateY(-1px); }
.tile:hover::after { opacity: 1; }
.tile-text { display: grid; min-width: 0; }
.tile-text b { font-weight: 600; color: var(--strong); font-size: 13.5px; }
.tile-text small { color: var(--text3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .go { margin-left: auto; color: var(--text3); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .25s var(--ease); }
.tile:hover .go { opacity: 1; transform: none; color: var(--dc); }

/* ---------------------------------------------------------------- project list (table) */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search .i { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--text3); pointer-events: none; }
.toolbar .search .input { padding-left: 34px; height: 34px; }
.toolbar select.input { width: auto; height: 34px; }

.table { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.thead, .trow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) 110px 76px; align-items: center; gap: 16px; padding: 0 16px; }
.thead { height: 38px; border-bottom: 1px solid var(--line); background: var(--surface2); }
.thead .label { font-size: 10.5px; }
.trow { min-height: 62px; border-bottom: 1px solid var(--line); transition: background .15s; cursor: pointer; animation: fade .3s both; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface2); }
.pname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pname-text { display: grid; min-width: 0; }
.pname-text b { font-weight: 550; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname-text small { color: var(--text3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parts { display: flex; align-items: center; gap: 5px; }
.parts .ddot { width: 9px; height: 9px; box-shadow: 0 0 0 2px var(--surface); }
.parts .none { color: var(--text3); font-size: 12.5px; }
.when { color: var(--text2); font-size: 13px; white-space: nowrap; }
.row-acts { display: flex; justify-content: flex-end; gap: 2px; }
.star { color: var(--text3); }
.star:hover { color: var(--text); }
.star.on { color: #f5b83d; }
.star.on .i { fill: currentColor; }

/* grid of project cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pcard { position: relative; display: grid; gap: 14px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; animation: rise .35s var(--ease) both; overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 72px; background: radial-gradient(90% 120% at 0% 0%, var(--dbg), transparent 70%); pointer-events: none; }
.pcard:hover { border-color: var(--dline); transform: translateY(-2px); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.5); }
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; position: relative; }
.pcard h3 { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard p { color: var(--text3); font-size: 12.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* empty states */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; border: 1px dashed var(--line2); border-radius: var(--r-lg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 16px 16px; }
.empty .ring { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line2); color: var(--text2); margin-bottom: 4px; }
.empty .ring .i { width: 22px; height: 22px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--text2); max-width: 420px; }
.empty .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- create project */
.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 13px; color: var(--text3); }
.step { display: flex; align-items: center; gap: 8px; }
.step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11.5px var(--sans); font-style: normal; border: 1px solid var(--line2); color: var(--text3); transition: all .25s; }
.step.on { color: var(--strong); }
.step.on i { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.step.done i { background: var(--press); color: var(--text); }
.step-line { width: 36px; height: 1px; background: var(--line2); }
.choose { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; display: grid; align-content: start; gap: 12px; padding: 18px; min-height: 168px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s, transform .25s var(--ease), box-shadow .2s; animation: rise .4s var(--ease) both; overflow: hidden; }
.choice::after { content: ""; position: absolute; inset: 0; background: radial-gradient(130% 100% at 0% 0%, var(--dbg), transparent 60%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.choice:hover { border-color: var(--dline); transform: translateY(-2px); }
.choice:hover::after, .choice.on::after { opacity: 1; }
.choice.on { border-color: var(--dc); box-shadow: 0 0 0 1px var(--dc); }
.choice b { font-size: 15px; font-weight: 600; color: var(--strong); }
.choice p { color: var(--text2); font-size: 12.5px; line-height: 1.45; }
.choice .tick { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--dc); color: var(--bg); opacity: 0; transform: scale(0.6); transition: all .25s var(--ease); }
.choice .tick .i { width: 13px; height: 13px; stroke-width: 2.6; }
.choice.on .tick { opacity: 1; transform: none; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 9px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); color: var(--text2); font-size: 13px; font-weight: 500; transition: all .18s; }
.chip .i { width: 15px; height: 15px; color: var(--dc); }
.chip:hover { border-color: var(--dline); color: var(--text); }
.chip.on { background: var(--dbg); border-color: var(--dc); color: var(--strong); }
.chip .ck { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line2); display: grid; place-items: center; transition: all .18s; }
.chip.on .ck { background: var(--dc); border-color: var(--dc); }
.chip .ck svg { width: 10px; height: 10px; stroke: var(--bg); stroke-width: 3; opacity: 0; }
.chip.on .ck svg { opacity: 1; }
.summary { position: sticky; top: calc(var(--top) + 20px); overflow: hidden; }
.summary-hero { position: relative; padding: 20px; display: grid; gap: 12px; border-bottom: 1px solid var(--line); background: radial-gradient(120% 120% at 0% 0%, var(--dbg), transparent 65%); }
.summary-hero h3 { font-size: 17px; word-break: break-word; }
.summary-hero p { color: var(--text2); font-size: 13px; word-break: break-word; }
.summary-list { display: grid; gap: 2px; padding: 12px; }
.sitem { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 13px; animation: rise .25s var(--ease) both; }
.sitem .badge { margin-left: auto; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 20px; }
.tool { font-size: 12px; color: var(--text2); padding: 3px 8px; border-radius: 6px; background: var(--hover); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- project page */
.phead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.phead h1 { font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead-text { min-width: 0; flex: 1; display: grid; gap: 4px; }
.phead-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text3); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; color: var(--text2); font-weight: 500; white-space: nowrap; transition: color .15s; }
.tab .i { width: 16px; height: 16px; }
.tab.d .i { color: var(--dc); }
.tab:hover { color: var(--strong); }
.tab::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--strong); transform: scaleX(0); transition: transform .3s var(--ease); }
.tab.on { color: var(--strong); }
.tab.on::after { transform: none; }
.tab.d.on::after { background: var(--dc); }
.tab .badge { height: 16px; font-size: 9.5px; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.parts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.part { position: relative; display: grid; gap: 10px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .25s var(--ease); overflow: hidden; }
.part:hover { border-color: var(--dline); transform: translateY(-1px); }
.part.lead { grid-column: 1 / -1; border-color: var(--dline); background: radial-gradient(100% 140% at 0% 0%, var(--dbg), var(--surface) 60%); }
.part-top { display: flex; align-items: center; gap: 12px; }
.part-top b { font-weight: 600; color: var(--strong); }
.part p { color: var(--text2); font-size: 13px; }
.part .tools { padding: 0; }
.part .open { margin-left: auto; }
.add-part { display: grid; place-items: center; gap: 6px; padding: 16px; min-height: 120px; border-radius: var(--r-lg); border: 1px dashed var(--line2); color: var(--text3); font-size: 13px; transition: color .2s, border-color .2s, background .2s; }
.add-part:hover { color: var(--text); border-color: var(--text3); background: var(--hover); }
.dl { display: grid; gap: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--text3); }
.dl dd { margin: 0; color: var(--text); text-align: right; }

/* a workspace that ships in a later phase */
.stage { position: relative; display: grid; place-items: center; min-height: 440px; padding: 40px 24px; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; background-color: var(--surface); background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 18px 18px; text-align: center; }
.stage::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, var(--dbg), transparent 65%); top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.stage-inner { position: relative; display: grid; justify-items: center; gap: 12px; max-width: 520px; }
.stage .dicon { animation: float 4s ease-in-out infinite; }
.stage h2 { font-size: 20px; }
.stage p { color: var(--text2); }
.stage .tools { justify-content: center; padding: 6px 0 0; }
.stage .tool { background: var(--surface); }

/* ---------------------------------------------------------------- menus, dialogs, palette, toasts */
.menu { position: fixed; z-index: 300; min-width: 200px; padding: 5px; border-radius: 11px; background: var(--raise); box-shadow: var(--shadow); animation: pop .16s var(--ease); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.menu-head b { color: var(--strong); font-weight: 600; }
.menu-head small { color: var(--text3); font-size: 12px; }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border-radius: 7px; color: var(--text); font-size: 13px; text-align: left; }
.menu button:hover, .menu a:hover, .menu .act:focus-visible { background: var(--hover); outline: none; }
.menu .i { width: 16px; height: 16px; color: var(--text2); }
.menu .danger, .menu .danger .i { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .seg { width: calc(100% - 8px); margin: 4px; display: flex; }
.menu .seg button { flex: 1; justify-content: center; height: 26px; padding: 0; width: auto; }

.overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s; }
.dialog { width: min(440px, 100%); border-radius: var(--r-lg); background: var(--raise); box-shadow: var(--shadow); animation: pop .22s var(--ease); overflow: hidden; }
.dialog-body { padding: 20px; display: grid; gap: 14px; }
.dialog-body h3 { font-size: 16px; }
.dialog-body p { color: var(--text2); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface2); }

.palette { align-items: start; padding-top: 12vh; }
.palette .dialog { width: min(580px, 100%); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-input .i { color: var(--text3); }
.pal-input input { flex: 1; height: 52px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.pal-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.pal-group { padding: 10px 10px 4px; }
.pal-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 8px; text-align: left; color: var(--text); }
.pal-item.sel { background: var(--press); }
.pal-item small { margin-left: auto; color: var(--text3); font-size: 12px; white-space: nowrap; }
.pal-item .i { color: var(--text2); }
.pal-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-empty { padding: 28px; text-align: center; color: var(--text3); }
.pal-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text3); background: var(--surface2); }
.pal-foot span { display: inline-flex; align-items: center; gap: 6px; }

#toasts { position: fixed; z-index: 400; right: 20px; bottom: 20px; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 10px 14px; border-radius: 10px; background: var(--raise); box-shadow: var(--shadow); font-size: 13.5px; animation: pop .25s var(--ease); pointer-events: auto; transition: opacity .25s, transform .25s; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast .i { width: 16px; height: 16px; color: var(--good); }
.toast.bad .i { color: var(--bad); }

/* ---------------------------------------------------------------- sign in / sign up */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }
.auth-side { display: flex; flex-direction: column; padding: 28px 40px; }
.auth-box { width: min(380px, 100%); margin: auto; display: grid; gap: 22px; padding: 32px 0; animation: rise .45s var(--ease); }
.auth-box h1 { font-size: 26px; line-height: 1.15; }
.auth-box > div > p { color: var(--text2); margin-top: 6px; }
.auth-form { display: grid; gap: 14px; }
.auth-switch { color: var(--text2); font-size: 13.5px; text-align: center; }
.auth-switch a { color: var(--strong); font-weight: 550; border-bottom: 1px solid var(--line2); }
.auth-switch a:hover { border-color: var(--strong); }
.auth-legal { margin-top: auto; color: var(--text3); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.auth-legal a:hover { color: var(--text); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row a { font-size: 12.5px; color: var(--text2); }
.field-row a:hover { color: var(--strong); }
.free-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text2); }
.free-note .i { color: var(--good); width: 16px; height: 16px; }

.auth-art { position: relative; margin: 12px 12px 12px 0; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; background-color: #0c0c0e; color: #ececea; background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.3px); background-size: 18px 18px; isolation: isolate; }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 75% 30%, rgba(122, 162, 255, 0.16), transparent 70%), radial-gradient(50% 50% at 20% 85%, rgba(255, 106, 213, 0.1), transparent 70%); }
.auth-art h2 { color: #fafaf7; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.1; letter-spacing: -0.025em; max-width: 520px; }
.auth-art .muted { color: #a3a3a0; max-width: 440px; margin-top: 12px; font-size: 15px; }
.orbit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.orb { --ds: 88%; --dl: 70%; display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); backdrop-filter: blur(6px); animation: rise .6s var(--ease) both, float 6s ease-in-out infinite; }
.orb:nth-child(2n) { animation-delay: .05s, -1.5s; }
.orb:nth-child(3n) { animation-delay: .1s, -3s; }
.orb:nth-child(4n) { animation-delay: .15s, -4.5s; }
.orb span { font-size: 12.5px; font-weight: 500; color: #d8d8d5; }
.orb .dicon { width: 32px; height: 32px; }
.auth-art .label { color: #6c6c6a; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .tiles, .choose { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-grid, .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .thead, .trow { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 110px 76px; }
  .col-parts { display: none !important; }
}
@media (max-width: 900px) {
  .app, .rail-mini .app { grid-template-columns: minmax(0, 1fr); --rail: 272px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: none; }
  .nav-open .side { transform: none; box-shadow: var(--shadow); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .side-head .collapse, .expand { display: none !important; }
  /* the drawer always shows full labels */
  .rail-mini .side-head { padding: 0 12px 0 16px; justify-content: space-between; }
  .rail-mini .side-head .brand-text { display: grid; }
  .rail-mini .nav { justify-content: flex-start; padding: 0 10px; }
  .rail-mini .nav-text, .rail-mini .nav .count, .rail-mini .nav-group > .label { display: initial; }
  .rail-mini .plan-note { display: grid; }
  .rail-mini .nav-group:not(:first-child) { border-top: 0; padding-top: 0; }
  .top { padding: 0 12px; }
  .top .burger { display: inline-flex; }
  .search-btn { width: 34px; padding: 0; justify-content: center; }
  .search-btn span { display: none; }
  .page { padding: 20px 16px 56px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-side { padding: 20px; }
}
@media (max-width: 640px) {
  .crumbs > :not(:last-child) { display: none; }
  .top-create span { display: none; }
  .top-create { width: 34px; padding: 0; }
  .thead { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .col-lead, .col-when { display: none !important; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 11px 12px; gap: 10px; }
  .tile .dicon { width: 30px; height: 30px; }
  .tile-text small, .tile .go { display: none; }
  .choose { grid-template-columns: minmax(0, 1fr); }
  .choice { min-height: 0; grid-template-columns: auto 1fr; align-items: center; }
  .choice .dicon { grid-row: span 2; }
  .parts-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 21px; }
  .page-head .btn { width: 100%; }
  .card-head, .card-body { padding: 16px; }
  .card-foot { padding: 12px 16px; flex-wrap: wrap; }
  .stage { min-height: 360px; }
  #toasts { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; }
}

/* ================================================================ workspaces (phase 2) */
.small { font-size: 12.5px; }
.ws { display: flex; flex-direction: column; height: max(480px, calc(100dvh - var(--top) - 236px)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; animation: rise .3s var(--ease); }
.ws-bar { flex: none; display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--surface2); overflow-x: auto; scrollbar-width: none; }
.ws-bar::-webkit-scrollbar { display: none; }
.ws-tools { display: flex; align-items: center; gap: 2px; }
.ws-tool { color: var(--text); }
.ws-tool[aria-pressed="true"] { background: var(--dbg); color: var(--dc); }
.ws-sep { width: 1px; height: 20px; background: var(--line2); margin: 0 4px; flex: none; }
.ws-status { display: inline-flex; align-items: center; gap: 7px; padding: 0 6px; font-size: 12.5px; color: var(--text3); white-space: nowrap; }
.ws-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); transition: background .2s; }
.ws-status.ok i { background: var(--good); }
.ws-status.busy i { background: var(--dc); animation: blink 1s infinite; }
.ws-status.warn { color: #d89614; } .ws-status.warn i { background: #f5a524; }
.ws-status.bad { color: var(--bad); } .ws-status.bad i { background: var(--bad); }

.ws-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; transition: grid-template-columns .3s var(--ease); }
.ws.no-panel .ws-body { grid-template-columns: minmax(0, 1fr) 0; }
.ws-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.ws-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.ws-fill { height: 100%; min-height: 0; border: 0; border-radius: 0; }
.ws-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; outline: none; }
.ws-canvas.grabbing { cursor: grabbing; }
.ws-canvas-host { background: var(--surface); }
.ws-readout { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 7px; font-size: 12px; color: var(--text2); background: color-mix(in srgb, var(--raise) 88%, transparent); box-shadow: 0 0 0 1px var(--line); pointer-events: none; white-space: pre; }
.ws-inspector { min-width: 0; overflow-y: auto; overflow-x: hidden; border-left: 1px solid var(--line); background: var(--surface2); }
.ws.no-panel .ws-inspector { border-left: 0; }
.ins-sec { border-bottom: 1px solid var(--line); }
.ins-sec summary { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; color: var(--strong); user-select: none; }
.ins-sec summary::-webkit-details-marker { display: none; }
.ins-sec summary .chev { width: 14px; height: 14px; color: var(--text3); transform: rotate(-90deg); transition: transform .2s var(--ease); }
.ins-sec[open] summary .chev { transform: none; }
.ins-sec summary:hover { background: var(--hover); }
.ins-body { display: grid; gap: 10px; padding: 2px 14px 16px; }
.notes { min-height: 180px; }

/* focus mode: the workspace takes the whole window */
html.ws-focus { overflow: hidden; }
/* #view's view-transition name makes it a stacking context, which would keep the workspace under the sidebar */
html.ws-focus #view { view-transition-name: none; }
html.ws-focus .side, html.ws-focus .top { visibility: hidden; }
html.ws-focus .ws { position: fixed; inset: 0; z-index: 90; height: auto; border: 0; border-radius: 0; animation: fade .2s; }

/* functions (mathematics) */
.fn-list { display: grid; gap: 6px; }
.fn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px; border-radius: 9px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.fn-row.sel { border-color: var(--line2); background: var(--surface); }
.fn-row .input { background: transparent; border-color: transparent; }
.fn-row .input:hover { border-color: var(--line2); }
.fn-row .input:focus { background: var(--surface); border-color: var(--strong); }
.fn-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c); margin: 0 4px; transition: background .15s, transform .15s var(--ease); }
.fn-dot.on { background: var(--c); }
.fn-dot:hover { transform: scale(1.12); }
.fn-err { grid-column: 2 / -1; color: var(--bad); font-size: 12px; padding: 0 2px; }
.ops { display: flex; flex-wrap: wrap; width: 100%; }
.ops button { flex: 1 1 auto; justify-content: center; height: 26px; padding: 0 8px; font-size: 12px; }
.answer { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.answer-math { font-size: 17px; color: var(--strong); word-break: break-word; }
.answer .btn { justify-self: start; }
.step-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: s; }
.step-list li { display: grid; gap: 2px; padding: 8px 10px 8px 34px; position: relative; border-radius: 8px; font-size: 13px; counter-increment: s; }
.step-list li::before { content: counter(s); position: absolute; left: 8px; top: 9px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--sans); background: var(--dbg); color: var(--dc); }
.step-list li:nth-child(odd) { background: var(--hover); }
.step-list .rule { font-size: 12px; font-weight: 500; color: var(--text2); }
.step-list .mono { word-break: break-word; }

/* workspace controls shared by the inspectors */
.ws-chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ws-chart[hidden], .ws-canvas[hidden] { display: none; }
.tog { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 550; color: var(--text); cursor: pointer; user-select: none; }
.tog input { width: 16px; height: 16px; accent-color: var(--dc); margin: 0; }
.num-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); flex-wrap: wrap; }
.num-row .input { flex: 1 1 60px; min-width: 0; width: auto; }
.num-row input[type="range"] { flex: 1 1 100%; accent-color: var(--dc); margin: 0; }
.num-row > b { min-width: 46px; text-align: right; color: var(--strong); font-weight: 600; }
.num-row[hidden], .kv[hidden] { display: none; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; align-items: baseline; }
.kv > span { color: var(--text3); white-space: nowrap; }
.kv > b { font-weight: 500; color: var(--strong); text-align: right; word-break: break-word; }
.kv > b.wrap { text-align: left; }
.kv:empty { display: none; }
.kv .err { color: var(--bad); }
.kv .coins { letter-spacing: .12em; font-size: 11.5px; }
.ex-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ex { height: 24px; padding: 0 8px; border-radius: 6px; font: 11.5px var(--mono); color: var(--text2); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, color .15s; }
.ex:hover { border-color: var(--dline); color: var(--strong); }
.go-row { display: flex; gap: 6px; flex-wrap: wrap; }
.go-row .btn:not(.icon) { flex: 1 1 auto; }
.chips.sm { gap: 6px; }
.chips.sm .chip { height: 28px; font-size: 12.5px; padding: 0 10px 0 7px; }
.cz { font-weight: 600; color: var(--c); font-family: var(--mono); min-width: 32px; }

/* coding */
.ws-run { color: var(--good); }
.ws-run .i { fill: currentColor; }
.i.flip { transform: rotate(180deg); }
.code-split { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.code-left { position: relative; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.ed-wrap, .blk-wrap { position: absolute; inset: 0; }
.ed-wrap[hidden], .blk-wrap[hidden] { display: none; }
.ed { position: absolute; inset: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); background: var(--surface); }
.ed-gutter { position: relative; overflow: hidden; background: var(--surface2); border-right: 1px solid var(--line); }
.ed-gutter > div { padding: 12px 0; font: 12px/20px var(--mono); color: var(--text3); text-align: right; }
.ed-gutter span { display: block; padding-right: 10px; }
.ed-gutter span.err { color: var(--bad); font-weight: 700; background: color-mix(in srgb, var(--bad) 14%, transparent); }
.ed-main { position: relative; overflow: hidden; }
.ed-hl, .ed-ta { margin: 0; padding: 12px 14px; font: 13px/20px var(--mono); tab-size: 4; white-space: pre; letter-spacing: 0; word-spacing: 0; }
.ed-hl { position: absolute; left: 0; top: 0; min-width: 100%; color: var(--text); pointer-events: none; }
.ed-hl i { font-style: normal; }
.ed-ta { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: none; resize: none; background: transparent; color: transparent; caret-color: var(--strong); overflow: auto; }
.ed-ta::selection { background: color-mix(in srgb, var(--dc) 30%, transparent); color: transparent; }
.ed-errbar { position: absolute; left: 0; right: 0; height: 20px; background: color-mix(in srgb, var(--bad) 12%, transparent); border-left: 2px solid var(--bad); pointer-events: none; }
.t-k { color: #c678dd; } .t-s { color: #98c379; } .t-n { color: #d19a66; } .t-c { color: var(--text3); font-style: italic !important; } .t-b { color: #61afef; } .t-f { color: #56b6c2; }
:root[data-theme="light"] .t-k { color: #a626a4; } :root[data-theme="light"] .t-s { color: #3f8f2f; } :root[data-theme="light"] .t-n { color: #b76b01; } :root[data-theme="light"] .t-b { color: #2f6fdb; } :root[data-theme="light"] .t-f { color: #0e8a95; }
.code-out { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface2); }
.out-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.out-tabs button { height: 26px; font-size: 12.5px; position: relative; }
.out-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dc); }
.out-speed { width: auto; height: 30px; font-size: 12.5px; padding-left: 10px; }
.out-body { position: relative; flex: 1; min-height: 0; }
.paper { position: absolute; inset: 10px; border-radius: 10px; background: #fbfaf7; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.paper[hidden], .out-chart[hidden], .out-text[hidden] { display: none; }
.out-chart { position: absolute; inset: 0; }
.out-text { position: absolute; inset: 0; overflow: auto; padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.out-ok, .out-err { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line2); font-family: var(--sans); font-size: 12.5px; }
.out-ok { color: var(--text3); } .out-ok .i { width: 15px; height: 15px; color: var(--good); }
.out-err { color: var(--bad); } .out-err .i { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.out-status { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 40px); padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--text); background: var(--raise); box-shadow: 0 6px 20px rgba(0, 0, 0, .25), 0 0 0 1px var(--line); animation: rise .25s var(--ease); }
.out-status[hidden] { display: none; }
.out-status .i { width: 16px; height: 16px; flex: none; }
.out-status.ok { color: var(--good); } .out-status.ok b { color: var(--strong); }
.out-status.bad { color: var(--bad); }
.out-status .boot-dots { transform: scale(.7); }
/* blocks */
.blk-wrap { display: grid; grid-template-columns: 158px minmax(0, 1fr); }
.blk-palette { overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface2); border-right: 1px solid var(--line); }
.blk-palette .label { margin: 0 2px 2px; }
.blk-palette p { margin: 6px 2px 0; }
.blk-pick, .blk { --bc: #3b82f6; }
.c-move { --bc: #3b82f6; } .c-pen { --bc: #16a34a; } .c-ctrl { --bc: #f59e0b; }
.blk-pick { text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--bc); cursor: grab; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); transition: transform .12s var(--ease), filter .12s; }
.blk-pick:hover { filter: brightness(1.08); transform: translateX(2px); }
.blk-pick:active { cursor: grabbing; }
.blk-prog { overflow: auto; padding: 14px; background: var(--surface); }
.blk-start { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 12px 12px 4px 4px; font-size: 12.5px; font-weight: 600; color: #fff; background: #8b5cf6; }
.blk-start .i { width: 13px; height: 13px; fill: currentColor; }
.blk-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 4px 0; border-radius: 8px; min-height: 30px; }
.blk { border-radius: 8px; background: var(--bc); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); animation: rise .2s var(--ease); max-width: 520px; }
.blk-row { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px 4px 12px; cursor: grab; }
.blk-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.blk-in { width: 62px; height: 26px; padding: 0 8px; border-radius: 999px; border: 0; outline: none; background: #fff; color: #111827; font: 600 12.5px var(--sans); }
select.blk-in { width: auto; padding-right: 6px; }
.blk-in:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.blk-unit { font-size: 12px; opacity: .85; }
.blk-acts { margin-left: auto; display: flex; gap: 1px; opacity: .55; transition: opacity .15s; }
.blk-row:hover .blk-acts, .blk-acts:focus-within { opacity: 1; }
.blk-acts button { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.blk-acts button:hover { background: rgba(0, 0, 0, .18); }
.blk-acts .i { width: 14px; height: 14px; }
.blk-inner { margin: 0 0 6px 14px; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--surface) 86%, transparent); }
.blk-else { padding: 2px 12px 4px; font-size: 12px; font-weight: 600; }
.blk-add { display: flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px dashed var(--line2); font-size: 12px; color: var(--text3); cursor: pointer; transition: all .15s; }
.blk-add:hover { color: var(--text); border-color: var(--text3); }
.blk-list.target > .blk-add { border-style: solid; border-color: var(--dc); color: var(--dc); background: var(--dbg); }
.blk-drop { height: 4px; border-radius: 2px; background: var(--dc); margin: 1px 0; }
.maze-goal { display: grid; gap: 2px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--dbg); border: 1px solid var(--dline); font-size: 13px; }
.maze-goal b { color: var(--strong); }
.maze-goal span { color: var(--text2); }
/* coding inspector */
.script-list { display: grid; gap: 4px; }
.script { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; color: var(--text3); }
.script .i { width: 15px; height: 15px; }
.script .input { background: transparent; border-color: transparent; }
.script .input:hover { border-color: var(--line2); }
.script .input:focus { background: var(--surface); border-color: var(--strong); }
.script.sel { border-color: var(--line2); background: var(--surface); color: var(--dc); }
.script .btn { opacity: 0; } .script:hover .btn, .script .btn:focus { opacity: 1; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ex-card { height: 34px; padding: 0 10px; border-radius: 8px; text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s var(--ease); }
.ex-card:hover { border-color: var(--dline); transform: translateY(-1px); }
.ref { display: grid; gap: 2px; }
.ref + .ref { margin-top: 6px; }
.ref .label { margin: 2px 0 4px; }
.ref-item { display: grid; gap: 1px; padding: 5px 8px; border-radius: 7px; text-align: left; }
.ref-item:hover { background: var(--hover); }
.ref-item .mono { font-size: 12px; color: var(--strong); }
.ref-item small { font-size: 11.5px; color: var(--text3); }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.sw { width: 20px; height: 20px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); transition: transform .12s; }
.sw:hover { transform: scale(1.15); }
.code-view { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; overflow: auto; max-height: 260px; white-space: pre; }
.code-view i { font-style: normal; }
.levels { display: grid; gap: 6px; }
.level { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s; }
.level:hover { border-color: var(--line2); }
.level.on { border-color: var(--dc); background: var(--dbg); }
.level > span:last-child { display: grid; gap: 1px; min-width: 0; }
.level b { font-size: 13px; color: var(--strong); font-weight: 600; }
.level small { font-size: 11.5px; color: var(--text3); }
.lv-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--text2); background: var(--surface2); border: 1px solid var(--line2); }
.level.done .lv-n { background: var(--good); border-color: var(--good); color: #fff; }
.lv-n .i { width: 15px; height: 15px; stroke-width: 2.6; }
@media (max-width: 900px) {
  .code-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .code-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .blk-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .blk-palette { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .blk-palette .label, .blk-palette p { display: none; }
  .blk-pick { flex: none; }
}

/* project files */
.files { display: grid; gap: 8px; }
.drop { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 1px dashed var(--line2); cursor: pointer; color: var(--text2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--dc, var(--strong)); background: var(--dbg, var(--hover)); }
.drop span { display: grid; }
.drop b { font-weight: 600; color: var(--strong); font-size: 13px; }
.drop small { font-size: 11.5px; color: var(--text3); }
.file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; animation: rise .25s var(--ease); }
.file-thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text3); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-text { display: grid; min-width: 0; }
.file-text b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-text small { color: var(--text3); font-size: 11.5px; }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--line2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--dc, var(--strong)); transition: width .2s; }

@media (max-width: 900px) {
  .ws { height: max(440px, calc(100dvh - var(--top) - 200px)); }
  .ws-body, .ws.no-panel .ws-body { grid-template-columns: minmax(0, 1fr); }
  .ws-inspector { position: absolute; left: 0; right: 0; bottom: 0; max-height: 62%; z-index: 5; border-left: 0; border-top: 1px solid var(--line2); border-radius: 14px 14px 0 0; box-shadow: 0 -16px 40px -18px rgba(0, 0, 0, 0.5); transform: translateY(105%); transition: transform .35s var(--ease); }
  .ws.sheet-open .ws-inspector { transform: none; }
  .ws-tool span { display: none; }
  .ws-status span { display: none; }
}

/* ---------------------------------------------------------------- Sound */
.snd-stage { position: absolute; inset: 0; background: var(--surface); }
.snd-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 180px); font-size: 12px; color: var(--text3); pointer-events: none;
  background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snd-time { font: 500 12.5px var(--mono); color: var(--text2); min-width: 54px; padding: 0 4px; font-variant-numeric: tabular-nums; align-self: center; }
.sf { display: grid; grid-template-columns: minmax(78px, 100px) minmax(0, 1fr) 64px; gap: 8px; align-items: center; font-size: 13px; color: var(--text2); }
.sf > span small { color: var(--text3); font-size: 11px; }
.sf input[type="range"] { width: 100%; min-width: 0; margin: 0; accent-color: var(--dc); }
.sf .input { min-width: 0; padding-right: 4px; }
.sf.sel { grid-template-columns: minmax(78px, 100px) minmax(0, 1fr); }
.sf.sel select { width: 100%; min-width: 0; }
.sf.sel .seg { justify-self: start; }
.snd-sub { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--text3); }
.snd-sub small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.snd-head { display: flex; align-items: center; gap: 10px; }
.snd-head .input { flex: 1; min-width: 0; font-weight: 600; }
.sdot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.snd-where { font-size: 12.5px; color: var(--text2); }
.snd-togs { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.snd-xy .input, .snd-dims .input { width: 72px; }
.snd-xy small, .snd-dims small { color: var(--text3); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.snd-list { display: grid; gap: 2px; }
.snd-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 46px auto; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: background .15s; }
.snd-row:hover { background: var(--hover); }
.snd-row.sel { background: var(--dbg); border-color: var(--dline); }
.snd-row:focus-visible { outline: 2px solid var(--dc); outline-offset: 1px; }
.snd-name { min-width: 0; }
.snd-name b, .snd-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snd-name b { font-size: 13px; font-weight: 550; color: var(--text); }
.snd-name small { font-size: 11.5px; color: var(--text3); }
.snd-meter { height: 4px; border-radius: 2px; background: var(--surface2); overflow: hidden; }
.snd-meter i { display: block; height: 100%; width: 0; background: var(--c, var(--dc)); transition: width .08s linear; }
.ms { display: flex; gap: 3px; }
.ms button { width: 22px; height: 22px; border-radius: 5px; font: 650 10.5px var(--sans); color: var(--text3); border: 1px solid var(--line2); background: var(--surface); transition: all .15s; }
.ms button:hover { color: var(--text); }
.ms button.on { color: #fff; background: var(--text2); border-color: transparent; }
.ms button.solo.on { background: #d97706; }
.snd-amb { display: grid; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.snd-cpu { flex: 1; min-width: 60px; height: 5px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.snd-cpu i { display: block; height: 100%; background: var(--dc); transition: width .2s; }
.snd-cpu.warn i { background: #d97706; }
.kv:has(.snd-cpu) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.snd-result { display: grid; gap: 8px; }
.snd-result audio { width: 100%; height: 36px; }
@media (max-width: 900px) {
  .snd-hint { display: none; }
  .snd-time { min-width: 0; }
}

/* ---------------------------------------------------------------- Video workspace */
.vid { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--surface); outline: none; }
.vid-top { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 0; border-bottom: 1px solid var(--line); }
.vid-bin { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; border-right: 1px solid var(--line); background: var(--surface2); }
.vid-bin-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 6px 0 12px; font-size: 12px; color: var(--text2); border-bottom: 1px solid var(--line); }
.vid-bin-head b { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 11.5px; color: var(--text3); }
.vid-bin-list { overflow: auto; padding: 6px; display: grid; align-content: start; gap: 2px; }
.vid-bin-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 10px; color: var(--text3); font-size: 12.5px; }
.vid-bin-empty > .i { width: 22px; height: 22px; }
.vb, .vjob { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px; border-radius: 8px; cursor: grab; transition: background .15s; animation: rise .25s var(--ease); }
.vb:hover, .vjob:hover { background: var(--hover); }
.vb .btn, .vjob .btn { opacity: 0; transition: opacity .15s; }
.vb:hover .btn, .vjob:hover .btn, .vb .btn:focus-visible, .vjob .btn:focus-visible { opacity: 1; }
@media (hover: none) { .vb .btn, .vjob .btn { opacity: 1; } }
.vb-thumb { width: 44px; height: 30px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--text3); }
.vb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vb-thumb .i { width: 15px; height: 15px; }
.vb-text { display: grid; min-width: 0; }
.vb-text b { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.vb-text small { font-size: 11px; color: var(--text3); }
.vb-text small.bad { color: var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vjob { cursor: default; }
.vjob .boot-dots { transform: scale(.6); transform-origin: left; margin: 3px 0; }
.vid-view { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; min-width: 0; min-height: 0; padding: 12px 12px 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 16px 16px; }
.vid-screen { position: relative; background: #000; border-radius: 4px; box-shadow: 0 0 0 1px var(--line2), 0 10px 30px -12px rgba(0, 0, 0, .5); overflow: hidden; }
.vid-screen canvas { display: block; width: 100%; height: 100%; cursor: move; touch-action: none; }
.vid-transport { display: flex; align-items: center; gap: 6px; height: 40px; }
.vid-play { width: 34px !important; height: 30px; border-radius: 8px; background: var(--btn); color: var(--btn-text); border-color: transparent; }
.vid-play:hover { opacity: .88; }
.vid-time { font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; min-width: 120px; padding-left: 4px; }
.vtl { display: grid; grid-template-columns: 112px minmax(0, 1fr); background: var(--surface); user-select: none; }
.vtl-heads { border-right: 1px solid var(--line); background: var(--surface2); }
.vtl-corner { height: 24px; display: flex; align-items: center; gap: 0; padding: 0 2px; border-bottom: 1px solid var(--line); }
.vtl-corner .btn { width: 20px !important; height: 20px; padding: 0; font-size: 14px; color: var(--text3); }
.vtl-corner input { flex: 1; min-width: 0; margin: 0; accent-color: var(--dc); height: 14px; }
.vtl-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 0 10px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text2); }
.vtl-head .vtl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtl-ic .i { width: 13px; height: 13px; color: var(--text3); }
.vtl-head .btn { width: 24px !important; height: 24px; color: var(--text3); }
.vtl-head .btn[aria-pressed="true"] { color: var(--bad); }
.vtl-head[data-head="t1"], .vtl-lane[data-lane="t1"] { height: 30px; }
.vtl-head[data-head="v1"], .vtl-head[data-head="v2"], .vtl-lane[data-lane="v1"], .vtl-lane[data-lane="v2"] { height: 48px; }
.vtl-head[data-head="a1"], .vtl-head[data-head="a2"], .vtl-lane[data-lane="a1"], .vtl-lane[data-lane="a2"] { height: 40px; }
.vtl-scroll { position: relative; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: thin; }
.vtl-inner { position: relative; min-width: 100%; }
.vtl-ruler { position: sticky; left: 0; display: block; height: 24px; border-bottom: 1px solid var(--line); cursor: text; z-index: 2; background: var(--surface2); }
.vtl-lane { position: relative; border-bottom: 1px solid var(--line); background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 0 0; }
.vtl-lane.off { opacity: .4; }
.vc { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 6px; overflow: hidden; cursor: grab; --c: hsl(44 88% 62%); color: var(--c);
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); will-change: transform; }
.vc.k-image { --c: hsl(205 85% 64%); }
.vc.k-text { --c: hsl(265 80% 72%); }
.vc.k-audio { --c: hsl(150 60% 55%); }
.vc.sel { box-shadow: inset 0 0 0 2px var(--strong), 0 0 0 1px var(--c); z-index: 1; }
.vc.missing { --c: var(--bad); background-image: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--bad) 18%, transparent) 6px 12px) !important; }
.vc.muted { opacity: .6; }
.vc-body { position: absolute; inset: 0; background-size: auto 100%; background-repeat: repeat-x; background-position: left center; }
.vc.k-video .vc-body::after, .vc.k-image .vc-body::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 60%); }
.vc-name { position: absolute; left: 7px; top: 3px; right: 6px; z-index: 1; display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 550; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc.k-video .vc-name, .vc.k-image .vc-name { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.vc-name .i { width: 11px; height: 11px; flex: none; }
.vc-wave { position: absolute; left: 0; top: 0; opacity: .75; }
.vc-fade { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; }
.vc-fade.in { left: 0; background: linear-gradient(to top right, rgba(0, 0, 0, .35) 50%, transparent 50.5%); }
.vc-fade.out { right: 0; background: linear-gradient(to top left, rgba(0, 0, 0, .35) 50%, transparent 50.5%); }
.vc-h { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 2; cursor: ew-resize; opacity: 0; transition: opacity .15s; background: var(--strong); }
.vc-h.l { left: 0; border-radius: 6px 0 0 6px; } .vc-h.r { right: 0; border-radius: 0 6px 6px 0; }
.vc:hover .vc-h, .vc.sel .vc-h { opacity: .55; }
.vtl-ph { position: absolute; top: 0; bottom: 0; left: 0; width: 0; pointer-events: none; z-index: 3; will-change: transform; }
.vtl-ph::before { content: ""; position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px; background: var(--dc); }
.vtl-ph i { position: absolute; top: 0; left: -6px; width: 12px; height: 14px; background: var(--dc); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.vid-kind { width: 26px; height: 26px; flex: none; border-radius: 7px; display: grid; place-items: center; color: var(--c, var(--dc)); background: color-mix(in srgb, var(--c, var(--dc)) 16%, transparent); }
.vid-kind.k-video { --c: hsl(44 88% 62%); } .vid-kind.k-image { --c: hsl(205 85% 64%); } .vid-kind.k-text { --c: hsl(265 80% 72%); } .vid-kind.k-audio { --c: hsl(150 60% 55%); }
.vid-kind .i { width: 14px; height: 14px; }
.vid-kname { font-size: 13px; font-weight: 600; color: var(--strong); }
.ellip { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.vid-text { min-height: 56px; resize: vertical; font-family: var(--sans); line-height: 1.4; padding-top: 8px; }
.vid-color { width: 44px; height: 28px; padding: 2px; border-radius: 7px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer; justify-self: start; }
.vid-prog { display: grid; gap: 6px; }
.vid-prog-row { display: flex; align-items: center; justify-content: space-between; color: var(--text2); }
.vid-result { width: 100%; border-radius: 8px; background: #000; max-height: 220px; }
.vai { display: grid; gap: 10px; }
.vai-connect { display: grid; gap: 10px; justify-items: start; }
.vai-connect p { color: var(--text2); }
.vai-acct { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); }
.vai-acct .ellip { flex: 1; }
.vai-acct b { font-size: 12px; color: var(--strong); }
.vai-tools, .vai-kinds { display: flex; width: 100%; }
.vai-tools button, .vai-kinds button { flex: 1; justify-content: center; padding: 0 4px; font-size: 12px; }
.vai-prompt { min-height: 72px; resize: vertical; font-family: var(--sans); line-height: 1.45; padding-top: 8px; }
.vai-go { justify-self: start; }
.vai-go .boot-dots { transform: scale(.6); }
.vai-jobs { display: grid; gap: 2px; margin-top: 12px; }
.vai-jobs:empty { display: none; }
.ph-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #f59e0b, #ec4899 55%, #8b5cf6); box-shadow: 0 6px 18px -6px rgba(236, 72, 153, .6); }
.ph-logo .i { width: 18px; height: 18px; }
.ph-logo.sm { width: 28px; height: 28px; border-radius: 8px; } .ph-logo.sm .i { width: 15px; height: 15px; }
.ph-logo.xs { width: 20px; height: 20px; border-radius: 6px; box-shadow: none; } .ph-logo.xs .i { width: 12px; height: 12px; }
.ph-connect .dialog-body { justify-items: start; }
.ph-step { display: grid; gap: 10px; width: 100%; }
.ph-code { font-size: 26px; font-weight: 700; letter-spacing: .14em; color: var(--strong); padding: 10px 16px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line2); justify-self: start; }
.ph-wait { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); }
.ph-wait .boot-dots { transform: scale(.7); }
@media (max-width: 900px) {
  .vid-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .vid-bin { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); grid-template-rows: auto; grid-template-columns: auto minmax(0, 1fr); }
  .vid-bin-head { border-bottom: 0; border-right: 1px solid var(--line); height: auto; flex-direction: column; justify-content: center; padding: 6px; gap: 2px; }
  .vid-bin-list { grid-auto-flow: column; grid-auto-columns: 168px; overflow-x: auto; overflow-y: hidden; padding: 4px; }
  .vid-bin-empty { grid-auto-flow: column; padding: 8px; text-align: left; }
  .vtl { grid-template-columns: 84px minmax(0, 1fr); }
  .vtl-head { padding-left: 6px; }
  .vtl-head .vtl-ic { display: none; }
}
@media (max-width: 640px) {
  .vtl-head .vtl-name { font-size: 10.5px; }
  .vid-time { min-width: 0; }
}

/* ---------------------------------------------------------------- Home promo (blue, interactive) */
.promo { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 176px; max-height: 300px; margin-bottom: 28px;
  padding: 26px 30px; border-radius: var(--r-lg); color: #eaf2ff; --mx: 75%; --my: 50%;
  background: radial-gradient(120% 140% at 0% 0%, #1d4ed8 0%, #1e3a8a 42%, #0b1736 100%);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .28), 0 18px 40px -22px rgba(37, 99, 235, .7);
  animation: promo-in .6s var(--ease) both; transition: opacity .3s var(--ease), transform .3s var(--ease), margin .3s var(--ease), max-height .3s var(--ease); }
.promo::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, rgba(11, 23, 54, .55) 0%, rgba(11, 23, 54, .15) 45%, transparent 70%); }
.promo.gone { opacity: 0; transform: translateY(-8px) scale(.985); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.promo-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.promo-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(96, 165, 250, .22), transparent 70%); }
.promo.hot .promo-glow { opacity: 1; }
.promo-text { position: relative; max-width: 490px; display: grid; gap: 8px; }
.promo-badge { justify-self: start; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: #dbeafe; background: rgba(59, 130, 246, .28); box-shadow: inset 0 0 0 1px rgba(147, 197, 253, .4); }
.promo-badge .i { width: 12px; height: 12px; }
.promo h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; color: #fff; }
.promo p { font-size: 13.5px; line-height: 1.5; color: rgba(219, 234, 254, .82); }
.promo-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.promo-go { background: #fff; color: #0b1736; border-color: transparent; font-weight: 600; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.promo-go:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(147, 197, 253, .9); opacity: 1; }
.promo-go .i { color: #2563eb; }
.promo-keys { font-size: 12px; color: rgba(191, 219, 254, .7); display: inline-flex; align-items: center; gap: 5px; }
.promo-keys kbd { font: 600 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; color: #dbeafe; background: rgba(255, 255, 255, .1); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .12); }
.promo-keys kbd + kbd, .promo-keys kbd:not(:first-child) { margin-left: 6px; }
.promo-x { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: rgba(219, 234, 254, .75); transition: background .15s, color .15s; }
.promo-x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.promo-x .i { width: 15px; height: 15px; }
@keyframes promo-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 640px) {
  .promo { min-height: 0; padding: 20px 18px 18px; margin-bottom: 22px; }
  .promo::after { background: linear-gradient(180deg, rgba(11, 23, 54, .5), rgba(11, 23, 54, .2)); }
  .promo h2 { font-size: 18px; padding-right: 26px; }
  .promo p { font-size: 13px; }
  .promo-keys { display: none; }
}
