/* Project pages. Builds on style.css (tokens, nav, buttons, glass). */

/* ---------- page ---------- */
.p-wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.p-hero { padding: 132px 0 40px; }
.p-hero__label { margin-bottom: 18px; }
.p-hero h1 { font-size: clamp(3rem, 9vw, 7.4rem); font-stretch: 125%; font-weight: 800; letter-spacing: -.045em; line-height: .86; }
.p-hero__lead { max-width: 30ch; margin: 22px 0 0; font-size: clamp(1.25rem, 2.3vw, 1.8rem); font-weight: 520; line-height: 1.25; letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
.p-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 44px; border-top: 1px solid var(--line); }
.p-meta > div { padding: 16px 18px 4px 0; }
.p-meta > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.p-meta dt { margin-bottom: 6px; font: 500 12px/1.3 var(--mono); color: var(--ink-3); }
.p-meta dd { font-size: 14.5px; line-height: 1.5; }
@media (max-width: 860px) { .p-meta { grid-template-columns: 1fr 1fr; } .p-meta > div:nth-child(3) { padding-left: 0; border-left: 0; } .p-meta > div { border-bottom: 1px solid var(--line); padding-bottom: 12px; } }
@media (max-width: 480px) { .p-meta { grid-template-columns: 1fr; } .p-meta > div + div { padding-left: 0; border-left: 0; } }

.p-sec { padding: clamp(56px, 7vw, 96px) 0; }
.p-sec--tight { padding: clamp(40px, 5vw, 64px) 0; }
.p-sec__h { margin-bottom: clamp(24px, 3vw, 40px); }
.p-sec__h .h2 { max-width: 20ch; }
.p-sec__h p:not(.label) { max-width: 64ch; margin-top: 14px; color: var(--ink-2); }

.p-story { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.p-story > section { padding: 22px 22px 8px 0; }
.p-story > section + section { padding-left: 22px; border-left: 1px solid var(--line); }
.p-story b { display: block; margin-bottom: 10px; font: 500 12px/1 var(--mono); color: var(--accent-ink); }
.p-story h3 { margin-bottom: 10px; font-size: 1.25rem; font-stretch: 112%; font-weight: 700; letter-spacing: -.02em; }
.p-story p, .p-story li { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.p-story ul { display: grid; gap: 8px; }
.p-story li { position: relative; padding-left: 14px; }
.p-story li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 1px; background: var(--ink-3); }
@media (max-width: 960px) { .p-story { grid-template-columns: 1fr 1fr; } .p-story > section:nth-of-type(3) { padding-left: 0; border-left: 0; } }
@media (max-width: 560px) { .p-story { grid-template-columns: 1fr; } .p-story > section + section { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

/* the working demonstration */
.p-demo { position: relative; padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.p-demo--dark { background: var(--stage-2); border-color: var(--s-line); color: var(--s-ink); }
.p-demo__intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px 40px; align-items: center; }
.p-demo__intro p { color: var(--ink-2); }
.p-demo--dark .p-demo__intro p { color: var(--s-ink-2); }
.p-demo__go { display: grid; gap: 10px; justify-items: start; }
.p-demo__note { margin: 0; font: 400 12.5px/1.5 var(--mono); color: var(--ink-3); }
.p-demo--dark .p-demo__note { color: var(--s-ink-2); }
.p-demo__app:focus { outline: none; }
.p-demo__err { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #f7e2df; color: #7d231b; font-size: 14px; }
.p-preview { position: relative; border-radius: 14px; overflow: hidden; background: #ebe8e1; aspect-ratio: 16 / 10; }
.p-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .p-demo__intro { grid-template-columns: 1fr; } }

/* walkthrough: real captures of the demo, stepped; the caption sits under the picture so it hides nothing */
.story { position: relative; }
.story__frames { position: relative; aspect-ratio: var(--ar, 16 / 10); border-radius: var(--r-lg); overflow: hidden; background: #ebe9e3; border: 1px solid var(--line); }
.story__frames--dark { background: #0f1012; border-color: #26282d; }
.story__frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity .6s ease; }
.story__frames img.is-on { opacity: 1; }
.story__caps { margin-top: 14px; min-height: 3.2em; }
.story__caps p { margin: 0; max-width: 76ch; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.story__caps p:not(.is-on) { display: none; }
.story__caps b { margin-right: 10px; font: 500 12px/1 var(--mono); color: var(--accent-ink); }
.story__bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.story__dots { display: flex; gap: 6px; }
.story__dots button { position: relative; width: 28px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; transition: width .3s var(--out); }
.story__dots button::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 6px; background: var(--line-2); transition: background-color .2s; }
.story__dots button[aria-current="true"] { width: 44px; }
.story__dots button[aria-current="true"]::before { background: var(--ink); }
.story__bar .pill { margin-left: auto; }
.story__bar .st-play, .story__bar [aria-pressed="true"] .st-pause { display: none; }
.story__bar [aria-pressed="true"] .st-play { display: inline; }

/* proof */
.p-proof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.p-card { padding: clamp(18px, 2.2vw, 26px); border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.p-card h3 { margin-bottom: 14px; }
.p-card--wide { grid-column: 1 / -1; }
.tests { display: grid; gap: 0; }
.tests li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.tests li:last-child { border-bottom: 0; }
.tests li::before { content: "✓"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e3f1e8; color: #1c6b3e; font: 600 11px/1 var(--sans); }
.tests li.is-fail::before { content: "✕"; background: #f7e2df; color: #9b2c22; }
.tests span { color: var(--ink-2); }
.tests em { font: normal 500 12px/1 var(--mono); color: var(--ink-3); }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th, .mtable td { padding: 9px 10px 9px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.mtable th { font: 500 12px/1.3 var(--mono); color: var(--ink-3); }
.mtable td.n { font: 500 13.5px/1.2 var(--mono); white-space: nowrap; }
.mtable tr:last-child td { border-bottom: 0; }
.files { display: grid; gap: 8px; }
.files a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, transform .25s var(--out); }
@media (hover: hover) { .files a:hover { border-color: var(--ink); transform: translateY(-1px); } }
.files b { font: 500 13.5px/1.3 var(--mono); overflow-wrap: anywhere; }
.files span { font: 400 12px/1.3 var(--mono); color: var(--ink-3); }
.files small { grid-column: 1 / -1; font: 400 11px/1.4 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.p-measured { margin: 12px 0 0; font: 400 12.5px/1.5 var(--mono); color: var(--ink-3); }
@media (max-width: 860px) { .p-proof { grid-template-columns: minmax(0, 1fr); } }
.p-card { min-width: 0; overflow-x: auto; } /* a wide table scrolls inside its card instead of widening the page */

/* decision notes */
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.note-c { display: grid; align-content: start; gap: 12px; padding: 22px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.note-c dl { display: grid; gap: 6px; }
.note-c dt { font: 500 12px/1.3 var(--mono); color: var(--ink-3); }
.note-c dd { margin: 0 0 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.note-c h3 { font-size: 1.08rem; font-weight: 680; letter-spacing: -.01em; }
@media (max-width: 960px) { .notes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .notes { grid-template-columns: 1fr; } }

/* built on / added */
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack ul { display: grid; gap: 8px; }
.stack li { display: grid; grid-template-columns: minmax(0, 150px) 1fr; gap: 12px; font-size: 14.5px; color: var(--ink-2); }
.stack li b { font-weight: 600; color: var(--ink); }
@media (max-width: 760px) { .stack { grid-template-columns: 1fr; } .stack li { grid-template-columns: 1fr; gap: 2px; } }

.p-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 0 72px; }
.p-next a { display: grid; gap: 6px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, transform .25s var(--out); }
@media (hover: hover) { .p-next a:hover { border-color: var(--ink); transform: translateY(-2px); } }
.files a:active, .p-next a:active { transform: scale(.985); transition-duration: .08s; }
.p-next a:last-child { text-align: right; }
.p-next span { font: 500 12px/1 var(--mono); color: var(--ink-3); }
.p-next b { font-size: 1.6rem; font-stretch: 120%; font-weight: 760; letter-spacing: -.03em; }
@media (max-width: 560px) { .p-next { grid-template-columns: 1fr; } .p-next a:last-child { text-align: left; } }

.nav__back { padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 520; text-decoration: none; color: var(--ink-2); }
.nav__back:hover { color: var(--ink); }
.nav__proj { display: flex; gap: 2px; }
.nav__proj a { padding: 8px 11px; border-radius: 999px; font: 500 12px/1 var(--mono); letter-spacing: .02em; text-decoration: none; color: var(--ink-3); }
.nav__proj a[aria-current="page"] { background: rgba(0, 0, 0, .07); color: var(--ink); }
.nav__proj a:hover { color: var(--ink); }
@media (max-width: 860px) { .nav__proj { display: none; } }
.foot--p { border-top: 1px solid var(--line); padding: 26px 0 40px; }

/* ---------- FORMTRACE app ---------- */
.ft-app { display: grid; gap: 12px; }
.ft-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ft-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ft-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-2); }
.seg--sm button { padding: 6px 11px; font-size: 13px; }
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill--accent { border-color: var(--accent); color: var(--accent-ink); }
.pill--accent:hover { background: #fff3ec; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.ft-grid { display: grid; grid-template-columns: 238px minmax(0, 1fr) 290px; grid-template-rows: clamp(520px, 64vh, 660px); gap: 12px; align-items: stretch; }
.ft-grid > .ft-panel { overflow: auto; overscroll-behavior: contain; }
.ft-panel { display: grid; align-content: start; gap: 10px; padding: 14px; border-radius: 14px; background: #f7f6f2; border: 1px solid var(--line); min-width: 0; }
.ft-h { margin: 0; font: 500 12px/1.3 var(--mono); color: var(--ink-3); }
.ft-params { display: grid; gap: 10px; }
.ft-p { display: grid; grid-template-columns: 1fr 64px; gap: 4px 8px; align-items: center; }
.ft-p label { font-size: 13px; font-weight: 520; color: var(--ink-2); }
.ft-unit { color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.ft-p input[type="number"], .ft-p select { width: 100%; height: 30px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: 500 13px/1 var(--mono); color: var(--ink); }
.ft-p input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--ink); }
.ft-stage { position: relative; min-height: 520px; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 100% at 50% 0%, #fbfaf7, #ebe8e1); border: 1px solid var(--line); }
.ft-view { position: absolute; inset: 0; }
.ft-view canvas { width: 100% !important; height: 100% !important; touch-action: none; }
.ft-drawing { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 14px 44px; overflow: auto; background: #fbfaf6; background-image: linear-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .035) 1px, transparent 1px); background-size: 16px 16px; }
.ft-dwg-f { display: grid; gap: 4px; align-content: center; }
.ft-dwg { width: 100%; height: auto; max-height: 220px; overflow: visible; }
.ft-dwg .vis { fill: none; stroke: #1b1d21; stroke-width: .45; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ft-dwg .hid { fill: none; stroke: #9a958a; stroke-width: .35; stroke-dasharray: 2 1.6; vector-effect: non-scaling-stroke; }
.ft-dwg .dim { font: 500 5px var(--mono); fill: var(--accent-ink); text-anchor: middle; }
.ft-dwg-f figcaption { font-size: 11px; color: var(--ink-3); text-align: center; }
.ft-banner { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 7px 11px; border-radius: 10px; background: #fff4e0; color: #7a4b00; font: 500 12.5px/1.3 var(--mono); box-shadow: 0 6px 20px -12px rgba(0, 0, 0, .4); }
.ft-legend { position: absolute; right: 12px; top: 12px; display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .88); border: 1px solid var(--line); font-size: 12.5px; }
.ft-legend__t { margin: 0; font-weight: 600; }
.ft-legend p { margin: 0; }
.ft-legend .is-add { color: #1f7a4d; font-weight: 600; }
.ft-legend .is-rem { color: #b23a31; font-weight: 600; }
.ft-section { position: absolute; left: 12px; bottom: 40px; width: min(260px, calc(100% - 24px)); padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .88); border: 1px solid var(--line); }
.ft-stats { position: absolute; left: 12px; bottom: 10px; right: 12px; margin: 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(247, 246, 242, .92); text-align: center; }
.ft-loader__t { margin: 0; font-weight: 600; }
.ft-loader__n { margin: 0; }
.ft-progress { width: 220px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ft-progress i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform .2s; }
.ft-history { display: grid; gap: 2px; }
.ft-part { margin-top: 6px; font: 500 11.5px/1.3 var(--mono); color: var(--ink-3); }
.ft-part:first-child { margin-top: 0; }
.ft-op { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "d l s" "d t s"; gap: 0 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: default; transition: background-color .2s; }
.ft-op:hover, .ft-op:focus-visible { background: #fff; }
.ft-dot { grid-area: d; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.ft-op__l { grid-area: l; font-size: 13px; font-weight: 520; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ft-op__t { grid-area: t; font-size: 10.5px; color: var(--ink-3); }
.ft-op__s { grid-area: s; font-size: 11px; color: var(--ink-3); text-align: right; }
.ft-op.is-computed .ft-dot { background: var(--accent); }
.ft-op.is-cached .ft-dot { background: #9cc3ad; }
.ft-op.is-failed { background: #fbe9e6; }
.ft-op.is-failed .ft-dot { background: var(--bad); }
.ft-op.is-failed .ft-op__s { color: var(--bad); font-weight: 600; }
.ft-op.is-blocked { opacity: .5; }
.ft-op.is-pending .ft-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); animation: ftPulse 1s ease-in-out infinite; }
@keyframes ftPulse { 50% { opacity: .35; } }
.ft-hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.ft-explain { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #f0c8c2; }
.ft-explain h4 { margin: 0; font-size: 15px; }
.ft-explain p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.ft-explain__k { font-size: 11px !important; color: var(--bad) !important; }
.ft-explain__how { font-size: 12.5px !important; color: var(--ink-3) !important; }
.ft-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ft-export { display: grid; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ft-export__row { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-status { min-height: 1.4em; margin: 0; font: 400 12.5px/1.4 var(--mono); color: var(--ink-3); }
@media (max-width: 1100px) { .ft-grid { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: clamp(480px, 60vh, 600px) auto; } .ft-panel--history { grid-column: 1 / -1; overflow: visible; } .ft-history { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 720px) { .ft-grid { grid-template-columns: 1fr; grid-template-rows: auto; } .ft-grid > .ft-panel { overflow: visible; } .ft-stage { min-height: 0; height: 62vh; max-height: 460px; order: -1; } .ft-drawing { grid-template-columns: 1fr; } .ft-history { grid-template-columns: 1fr; } }


/* ---------- TRACEFORGE app (dark) ---------- */
.pill--dark { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); color: var(--s-ink); }
.pill--dark:hover { border-color: rgba(255, 255, 255, .5); }
.pill--dark[aria-pressed="true"] { background: var(--s-ink); color: #111; border-color: var(--s-ink); }
.pill--dark:disabled { opacity: .5; }
.tf-app { display: grid; gap: 14px; color: var(--s-ink); }
.tf-controls { display: grid; gap: 10px; }
.tf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tf-k { font: 500 12px/1 var(--mono); color: var(--s-ink-2); }
.tf-seed { width: 96px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: #0f1012; color: var(--s-ink); font: 500 13px/1 var(--mono); }
.tf-views { display: grid; gap: 12px; }
@media (min-width: 1100px) { .tf-views:has(.tf-view + .tf-view) { grid-template-columns: 1fr 1fr; } }
.tf-view { position: relative; padding: 12px 12px 10px; border-radius: 14px; background: #0f1012; border: 1px solid #26282d; }
.tf-view__k { margin: 0 0 4px; font-size: 11.5px; color: var(--s-ink-2); }
.tf-diagram { width: 100%; height: auto; overflow: visible; }
.tf-links line { stroke: #34373e; stroke-width: 1.5; }
.tf-svc rect { fill: #1a1c20; stroke: #44474f; stroke-width: 1.2; transition: fill .25s, stroke .25s; }
.tf-svc__n { font: 600 13px var(--sans); fill: #f4f4f2; text-anchor: middle; }
.tf-svc__v { font: 500 12px var(--mono); fill: #a6a7ad; text-anchor: middle; }
.tf-svc.is-down rect { fill: #2a1716; stroke: #d6453d; stroke-dasharray: 4 3; }
.tf-svc.is-down .tf-svc__v { fill: #ff8f86; }
.tf-svc.is-bad rect { stroke: var(--accent); stroke-width: 2; }
.tf-svc.is-bad .tf-svc__v { fill: #ffb08a; }
.tf-msgs circle.is-lost { opacity: .35; }
.tf-msgs circle.is-dup { stroke: #fff; stroke-width: 1.4; }
.tf-msg__l { font: 500 9px var(--mono); fill: #ffb08a; text-anchor: middle; }
.tf-banner { min-height: 1.5em; margin: 6px 0 0; font: 500 12.5px/1.45 var(--mono); color: var(--s-ink-2); }
.tf-banner.is-bad { color: #ff8f86; }
.tf-banner.is-ok { color: #6fd6a0; }
.tf-timeline { display: grid; gap: 8px; }
.tf-track { position: relative; height: 40px; border-radius: 10px; background: #0f1012; border: 1px solid #26282d; overflow: hidden; }
.tf-ticks { position: absolute; inset: 0; width: 100%; height: 100%; }
.tk-commit { fill: #ff8a4c; } .tk-crash { fill: #d6453d; } .tk-timeout { fill: #e0a100; } .tk-dedupe { fill: #5fd39a; } .tk-fault { fill: rgba(214, 69, 61, .16); } .tk-bad { fill: #ff8f86; }
.tf-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: ew-resize; }
.tf-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.tf-range::-moz-range-track { height: 100%; background: transparent; }
.tf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 40px; background: #f4f4f2; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.tf-range::-moz-range-thumb { width: 3px; height: 40px; border: 0; border-radius: 0; background: #f4f4f2; }
.tf-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tf-speed { height: 30px; padding: 0 6px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: #0f1012; color: var(--s-ink); font: 500 12px/1 var(--mono); }
.tf-clock { margin: 0; font-size: 12px; color: var(--s-ink-2); }
.tf-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; font: 400 11px/1.3 var(--mono); color: var(--s-ink-2); }
.tf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tf-legend i { width: 10px; height: 10px; border-radius: 2px; }
.tf-legend i.tk-commit { background: #ff8a4c; } .tf-legend i.tk-crash { background: #d6453d; } .tf-legend i.tk-timeout { background: #e0a100; } .tf-legend i.tk-fault { background: rgba(214, 69, 61, .35); } .tf-legend i.tk-bad { background: #ff8f86; }
.tf-lower { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 12px; }
.tf-logbox, .tf-state, .tf-sweep { padding: 12px; border-radius: 14px; background: #0f1012; border: 1px solid #26282d; min-width: 0; }
.tf-state__k { margin: 0 0 8px; font-size: 11.5px; color: var(--s-ink-2); }
.tf-log { position: relative; max-height: 280px; overflow: auto; overscroll-behavior: contain; font-size: 12.5px; }
.p-demo--dark *, .tf-app * { scrollbar-color: #3a3d44 transparent; scrollbar-width: thin; }
.tf-log li { display: grid; grid-template-columns: 30px 64px 52px minmax(0, 1fr); gap: 8px; padding: 3px 6px; border-radius: 6px; color: #d9dade; }
.tf-log li b { font-weight: 500; color: var(--s-ink-2); }
.tf-log li.is-future { opacity: .32; }
.tf-log li.is-now { background: rgba(255, 255, 255, .08); }
.tf-log .lk-commit { color: #ffb08a; } .tf-log .lk-crash { color: #ff8f86; } .tf-log .lk-dedupe { color: #6fd6a0; } .tf-log .lk-timeout { color: #f1c35b; } .tf-log .lk-drop, .tf-log .lk-lost { color: #a6a7ad; text-decoration: line-through; }
.tf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tf-table th, .tf-table td { padding: 5px 6px 5px 0; text-align: left; border-bottom: 1px solid #22252a; }
.tf-table th { font: 500 11px/1 var(--mono); color: var(--s-ink-2); }
.tf-table .js-done td:nth-child(2) { color: #6fd6a0; } .tf-table .js-leased td:nth-child(2) { color: #f1c35b; }
.tf-processed { margin: 0; font-size: 12px; color: #d9dade; overflow-wrap: anywhere; }
.tf-sweep { display: grid; gap: 8px; justify-items: start; }
.tf-sweep__out p { margin: 0 0 6px; font-size: 13.5px; color: #d9dade; }
.tf-seeds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tf-status { min-height: 1.4em; margin: 0; font: 400 12.5px/1.45 var(--mono); color: var(--s-ink-2); overflow-wrap: anywhere; }
@media (max-width: 860px) { .tf-lower { grid-template-columns: 1fr; } .tf-legend { margin-left: 0; } .tf-log li { grid-template-columns: 26px 54px minmax(0, 1fr); } .tf-log li b { display: none; } }

/* ---------- WEAVE app ---------- */
.wv-app { display: grid; gap: 14px; }
.wv-loading { margin: 0; font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.wv-bar { display: grid; gap: 8px; }
.wv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.wv-k { font: 500 12px/1 var(--mono); color: var(--ink-3); }
.wv-title { margin: 0; font-size: 15px; font-weight: 600; }
.pill--sm { padding: 4px 9px; font-size: 11.5px; }
.wv-devices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wv-dev { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 14px; background: #f7f6f2; border: 1px solid var(--line); min-width: 0; }
.wv-dev.is-online { border-color: #9cc3ad; }
.wv-dev__h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wv-dev__h b { font-size: 14px; }
.wv-net { padding: 3px 8px; border-radius: 999px; background: #ecebe6; font: 500 11px/1.2 var(--mono); color: var(--ink-3); }
.wv-net.is-on { background: #e3f1e8; color: #1c6b3e; }
.wv-dev__h .pill:first-of-type { margin-left: auto; }
.wv-graph { width: 100%; height: auto; border-radius: 10px; background: #fff; background-image: radial-gradient(circle, rgba(0, 0, 0, .07) 1px, transparent 1px); background-size: 18px 18px; border: 1px solid var(--line); touch-action: none; user-select: none; }
.wv-edge { fill: none; stroke: #8c8a84; stroke-width: 2; cursor: pointer; }
.wv-edge.is-type, .wv-edge.is-cycle, .wv-edge.is-double-input { stroke: #d48a00; stroke-width: 3.2; stroke-dasharray: 7 4; }
.wv-edge.is-dangling { stroke: var(--bad); stroke-width: 2.6; stroke-dasharray: 4 4; }
.wv-edge.is-focus { stroke-width: 4.4; filter: drop-shadow(0 0 4px rgba(212, 138, 0, .55)); }
.wv-edge.is-picked { stroke: var(--accent); stroke-width: 5; opacity: .35; pointer-events: none; }
.wv-x { font: 700 14px var(--sans); fill: var(--bad); }
.wv-node rect { fill: #fff; stroke: #c9c7c0; stroke-width: 1.3; }
.wv-node { cursor: grab; }
.wv-node.t-sensor rect { fill: #eef4ff; stroke: #9db6e0; }
.wv-node.t-threshold rect { fill: #fff7ea; stroke: #e2c28b; }
.wv-node.t-output rect { fill: #f3f1ea; }
.wv-node.is-picked rect { stroke: var(--accent); stroke-width: 2.4; }
.wv-node.has-issue rect { stroke: #d48a00; stroke-width: 2.4; }
.wv-node.is-focus rect { stroke: #d48a00; stroke-width: 3; }
.wv-node__l { font: 600 13px var(--sans); fill: var(--ink); }
.wv-node__s { font: 400 11px var(--mono); fill: var(--ink-3); }
.wv-type { font: 500 10px var(--mono); fill: #56708f; }
.wv-port { fill: #fff; stroke: #6f6d67; stroke-width: 1.6; cursor: crosshair; }
.wv-port--out.is-armed { fill: var(--accent); stroke: var(--accent); }
.wv-dev__tools { display: grid; gap: 6px; }
.wv-dev__tools select, .wv-num { height: 28px; max-width: 150px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: 500 12px/1 var(--sans); }
.wv-num { width: 80px; }
.wv-hist { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.wv-hist li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.wv-hist .b-A span:first-child { color: #2c64c4; } .wv-hist .b-B span:first-child { color: #b35c00; } .wv-hist .b-C span:first-child { color: var(--ok); }
.wv-dev__v { margin: 0; font: 600 12px/1 var(--mono); color: #b35c00; }
.wv-dev__v.is-ok { color: var(--ok); }
.wv-issues { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.wv-issues .h3 { margin: 0; }
.wv-list { display: flex; flex-wrap: wrap; gap: 6px; }
.wv-issue { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px; border: 1px solid #e2c28b; background: #fff7ea; font-size: 13px; font-weight: 560; cursor: pointer; }
.wv-issue[aria-pressed="true"] { border-color: #d48a00; box-shadow: 0 0 0 2px rgba(212, 138, 0, .25); }
.wv-issue.k-dangling { border-color: #e9b3ad; background: #fbe9e6; }
.wv-issue span { font-size: 11px; color: var(--ink-3); }
.wv-why { display: grid; gap: 8px; }
.wv-why h4 { margin: 6px 0 0; font-size: 14px; }
.wv-why p { margin: 0; font-size: 14px; color: var(--ink-2); }
.wv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wv-change { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; border-left: 3px solid; background: #f7f6f2; font-size: 13.5px; }
.wv-change.b-A { border-color: #2c64c4; } .wv-change.b-B { border-color: #b35c00; }
.wv-change b { font: 500 11.5px/1 var(--mono); }
.wv-muted { color: var(--ink-3) !important; font-size: 13px !important; }
.wv-ok { margin: 0; color: var(--ok); font-weight: 600; }
.wv-status { min-height: 1.4em; margin: 0; font: 400 12.5px/1.4 var(--mono); color: var(--ink-3); }
@media (max-width: 900px) { .wv-devices, .wv-pair { grid-template-columns: 1fr; } }

/* ---------- FRAMEPORT app (dark) ---------- */
.fp-app { display: grid; gap: 14px; color: var(--s-ink); }
.fp-status { margin: 0; font: 500 13px/1.4 var(--mono); color: var(--s-ink-2); }
.fp-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 22px; }
.fp-group { display: grid; gap: 6px; min-width: 0; }
.fp-k { font: 500 12px/1.2 var(--mono); color: var(--s-ink-2); }
.fp-range { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-width: 200px; }
.fp-range .fp-k { grid-column: 1 / -1; }
.fp-range input { width: 100%; accent-color: var(--accent); }
.fp-range output { min-width: 76px; text-align: right; font: 500 13px/1 var(--mono); color: var(--s-ink); }
.fp-group select { height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: #0f1012; color: var(--s-ink); font: 500 13px/1 var(--mono); }
.fp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.fp-stage { position: relative; margin: 0; display: grid; gap: 10px; min-width: 0; }
.fp-wipe { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0b0b0d; border: 1px solid #26282d; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.fp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.fp-top { position: absolute; inset: 0; }
.fp-handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f4f4f2; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.fp-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #f4f4f2; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.fp-tag { position: absolute; top: 10px; max-width: 46%; padding: 6px 10px; border-radius: 10px; background: rgba(11, 11, 13, .74); font: 500 12px/1.3 var(--mono); color: var(--s-ink); pointer-events: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fp-tag--l { left: 10px; }
.fp-tag--r { right: 10px; }
.fp-stagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fp-split { flex: 1 1 160px; min-width: 120px; accent-color: var(--accent); }
.fp-live { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0b0b0d; border: 1px solid #26282d; }
.fp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.fp-canvas:active { cursor: grabbing; }
.fp-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.fp-live__s { position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; padding: 8px 11px; border-radius: 10px; background: rgba(11, 11, 13, .78); font: 500 12px/1.45 var(--mono); color: var(--s-ink); pointer-events: none; }
.fp-live__x { position: absolute; top: 10px; right: 10px; }
.fp-side { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; background: #0f1012; border: 1px solid #26282d; min-width: 0; }
.fp-h { margin: 0; font: 500 12px/1.3 var(--mono); color: var(--s-ink-2); }
.fp-big { margin: 0; font-size: 1.25rem; font-stretch: 110%; font-weight: 700; letter-spacing: -.015em; color: var(--s-ink); }
.fp-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13.5px; }
.fp-dl dt { color: var(--s-ink-2); }
.fp-dl dd { margin: 0; text-align: right; font: 500 13px/1.4 var(--mono); color: var(--s-ink); }
.fp-dl dd em { font-style: normal; color: var(--s-ink-2); font-weight: 400; }
.fp-dl dt:empty { display: none; }
.fp-dl dt:empty + dd { grid-column: 1 / -1; text-align: left; font: 400 11.5px/1.45 var(--mono); color: var(--s-ink-2); }
.fp-per { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fp-per span { display: grid; gap: 2px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .04); font: 500 13px/1.2 var(--mono); }
.fp-per b { font: 400 11px/1.2 var(--sans); color: var(--s-ink-2); }
.fp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fp-note { margin: 0; font: 400 11.5px/1.5 var(--mono); color: var(--s-ink-2); }
.fp-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fp-chartbox, .fp-tablebox { margin: 0; display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; background: #0f1012; border: 1px solid #26282d; min-width: 0; }
.fp-chart { width: 100%; height: auto; overflow: visible; }
.fp-grid-l { stroke: #23252a; stroke-width: 1; }
.fp-tick { font: 500 10.5px var(--mono); fill: #8c8e95; }
.fp-axis { font: 500 11px var(--mono); fill: #a6a7ad; }
.fp-over { fill: rgba(214, 69, 61, .07); }
.fp-budget { stroke: #ff8a4c; stroke-width: 1.5; stroke-dasharray: 5 4; }
.fp-budget-t { font: 500 10.5px var(--mono); fill: #ffb08a; }
.fp-front { fill: none; stroke: #5a5d66; stroke-width: 1.4; }
.fp-pt { cursor: pointer; outline: none; }
.fp-pt circle, .fp-pt rect { fill: #f4f4f2; stroke: #0f1012; stroke-width: 1.5; transition: fill .2s; }
.fp-pt.is-a rect { fill: #0f1012; stroke: #c9c9cf; stroke-width: 1.6; }
.fp-pt.is-out circle, .fp-pt.is-out rect { opacity: .38; }
.fp-pt.is-sel circle:not(.fp-ring), .fp-pt.is-sel rect { fill: var(--accent); stroke: #fff; }
.fp-pt .fp-ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.fp-pt:focus-visible circle:not(.fp-ring), .fp-pt:focus-visible rect { stroke: var(--accent); stroke-width: 3; }
.fp-pt-t { font: 500 10px var(--mono); fill: #c9c9cf; pointer-events: none; }
.fp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font: 400 11px/1.3 var(--mono); color: var(--s-ink-2); }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fp-legend i { display: inline-block; width: 10px; height: 10px; }
.fp-legend .lg-u { border-radius: 50%; background: #f4f4f2; }
.fp-legend .lg-a { transform: rotate(45deg) scale(.85); border: 1.6px solid #c9c9cf; }
.fp-legend .lg-f { height: 2px; background: #5a5d66; }
.fp-legend .lg-b { height: 0; border-top: 2px dashed #ff8a4c; }
.fp-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fp-table th, .fp-table td { padding: 6px 8px 6px 0; text-align: left; border-bottom: 1px solid #22252a; white-space: nowrap; }
.fp-table th { font: 500 11px/1.2 var(--mono); color: var(--s-ink-2); }
.fp-table td.n { font: 500 12px/1.2 var(--mono); }
.fp-table tr.is-out td { color: #8a8c93; }
.fp-table tr.is-sel td { background: rgba(255, 91, 20, .1); }
.fp-pick { border: 0; background: none; padding: 0; font: 600 12.5px/1.2 var(--sans); color: var(--s-ink); text-decoration: underline; text-decoration-color: #5a5d66; text-underline-offset: 3px; cursor: pointer; }
.fp-pick[aria-pressed="true"] { color: #ffb08a; }
.fp-foot { margin: 0; font: 400 12px/1.5 var(--mono); color: var(--s-ink-2); }
@media (max-width: 1060px) { .fp-grid { grid-template-columns: 1fr; } .fp-lower { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .fp-chartbox { overflow-x: auto; overscroll-behavior-x: contain; } .fp-chart { min-width: 560px; } }
@media (max-width: 560px) { .fp-range { min-width: 0; width: 100%; } .fp-bar > .fp-group { width: 100%; } .fp-tag { max-width: 44%; font-size: 11px; } }
.fp-scrollx { overflow-x: auto; overscroll-behavior-x: contain; }
.fp-scrollx .mtable { min-width: 760px; }
.mtable tr.is-pick td { background: #fff3ec; }

/* privacy page: plain reading text */
.p-prose > * { max-width: 70ch; }
.p-prose .h3 { margin: 1.8em 0 .7em; }
.p-prose p, .p-list li { color: var(--ink-2); }
.p-list { display: grid; gap: 10px; margin: 0 0 1em; }
.p-list li { position: relative; padding-left: 20px; }
.p-list li::before { content: ""; position: absolute; left: 0; top: .78em; width: 9px; height: 1.5px; background: var(--accent); }
.p-prose code { padding: 1px 5px; border-radius: 5px; background: var(--sunk); font: 500 .86em/1 var(--mono); color: var(--ink); }
