/* The pieces of the FrameFlow app that the page shows.
   Values are taken from the app (src/renderer/src/assets/main.css and the editor components),
   in the app's own pixels. A .stage scales its whole content to the space it is given, so
   nothing in here is responsive: it is drawn once, at the app's size. */

.stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--w) / var(--h);
	overflow: hidden;
	background: var(--ground);
	border: 1px solid var(--hair-strong);
	border-radius: 10px;
	contain: layout paint;
}
.stage-in {
	position: absolute;
	left: 0;
	top: 0;
	width: calc(var(--w) * 1px);
	height: calc(var(--h) * 1px);
	transform: scale(var(--s, 1));
	transform-origin: 0 0;
	display: flex;
	flex-direction: column;
	font: 400 12px/1.4 var(--body);
	color: #e4e4e7;
	user-select: none;
	-webkit-user-select: none;
	cursor: default;
}
.stage-in * { box-sizing: border-box; }
.stage-in p { margin: 0; }

/* ---- shared atoms ---- */
.ic { width: 16px; height: 16px; flex: none; display: block; }
.ff-row { display: flex; align-items: center; }
.ff-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ff-grow { flex: 1 1 0; min-width: 0; min-height: 0; }
.ff-hair-t { border-top: 1px solid var(--hair); }
.ff-hair-b { border-bottom: 1px solid var(--hair); }
.ff-hair-l { border-left: 1px solid var(--hair); }
.ff-hair-r { border-right: 1px solid var(--hair); }
.ff-mono { font-family: var(--mono); }
.ff-dim { color: #71717a; }
.ff-lbl { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #a1a1aa; }
.ff-tab { position: relative; height: 36px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: #a1a1aa; white-space: nowrap; }
.ff-tab.on { color: #fafafa; box-shadow: inset 0 -2px 0 var(--line); }
.ff-tab.caps { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ff-iconbtn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #a1a1aa; }
.ff-iconbtn.on { color: var(--line); background: rgba(78, 129, 238, .14); }
.ff-fill { height: 28px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ff-sep { width: 1px; height: 16px; background: var(--hair-strong); margin: 0 6px; }

/* ---- top bar ---- */
.ff-top { height: 40px; padding: 0 10px 0 14px; gap: 10px; }
.ff-top .title { font: 600 15px/1 var(--display); letter-spacing: -.02em; color: #fafafa; white-space: nowrap; }
.ff-top .cost { font: 11px var(--mono); color: #71717a; margin-left: 6px; }
.ff-mode { display: inline-flex; padding: 2px; border-radius: 8px; background: #18181b; box-shadow: inset 0 0 0 1px var(--hair); }
.ff-mode span { height: 22px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 6px; font-size: 11px; font-weight: 600; color: #a1a1aa; }
.ff-mode span.on { background: #3f3f46; color: #fafafa; }
.ff-top .thumb { gap: 6px; font-size: 13px; font-weight: 600; color: #e4e4e7; display: inline-flex; align-items: center; margin: 0 4px; }

/* ---- left rail and the Words panel ---- */
.ff-rail { width: 43px; padding-top: 12px; gap: 14px; align-items: center; color: #a1a1aa; }
.ff-rail .on { width: 32px; height: 28px; border-radius: 6px; background: rgba(78, 129, 238, .12); color: var(--line); display: flex; align-items: center; justify-content: center; }
.ff-words .head { height: 36px; padding: 0 14px; gap: 18px; }
.ff-words .count { padding: 12px 12px 8px; gap: 8px; }
.ff-search { margin: 0 12px 8px; height: 30px; padding: 0 10px; border-radius: 6px; background: #27272a; box-shadow: inset 0 0 0 1px var(--hair); color: #71717a; font-size: 12px; display: flex; align-items: center; }
.ff-word { height: 29px; padding: 0 14px; gap: 6px; font-size: 12px; color: #d4d4d8; border-radius: 4px; }
.ff-word .t { font: 10px var(--mono); color: #71717a; width: 28px; }
.ff-word.now { color: #fff; background: rgba(78, 129, 238, .14); }
.ff-word.now .t { color: var(--line); }

/* ---- monitor ---- */
.ff-mon .head { height: 32px; padding: 0 14px; gap: 18px; }
.ff-mon .meta { font: 11px var(--mono); color: #71717a; gap: 12px; }
.ff-mon .exact { color: #55b685; font-family: var(--body); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.ff-mon .exact::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #55b685; }
.ff-screen { background: var(--stage); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ff-pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.ff-pic video, .ff-pic img, .ff-pic iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
/* color-scheme: a frame whose scheme differs from the page inside it is given an opaque backdrop, which would hide
   the video under the layer. The motion page is a plain (light) document, this site is dark, so say light here. */
.ff-pic iframe { width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none; color-scheme: light; }
.ff-transport { height: 44px; padding: 0 14px; gap: 10px; color: #a1a1aa; }
.ff-play { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.ff-play .ic { width: 13px; height: 13px; }
.ff-time { font-size: 13px; color: #fafafa; white-space: nowrap; margin-left: 22px; font-variant-numeric: tabular-nums; }
.ff-time i { font-style: normal; color: #71717a; }
.ff-scrub { position: relative; height: 4px; border-radius: 2px; background: #e4e4e7; margin: 0 14px 0 8px; }
.ff-scrub b { position: absolute; left: 0; top: 0; bottom: 0; width: var(--at, 0%); border-radius: 2px; background: var(--line); }
.ff-scrub b::after { content: ''; position: absolute; right: -7px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--line); }

/* ---- chat ---- */
.ff-chat .head { height: 36px; padding: 0 16px; gap: 18px; }
.ff-chat .log { padding: 12px 12px 0; gap: 6px; overflow: hidden; }
.ff-bubble { align-self: flex-end; max-width: 86%; padding: 9px 12px; border-radius: 14px 14px 4px 14px; background: var(--primary); color: #fff; font-size: 12.5px; line-height: 1.35; }
.ff-stamp { align-self: flex-end; gap: 8px; font: 10px var(--mono); color: #a1a1aa; margin: 2px 2px 8px; }
.ff-stamp .ic { width: 12px; height: 12px; }
.ff-reply { gap: 6px; align-items: flex-start; }
.ff-reply > .ic { color: var(--ai); margin-top: 6px; width: 14px; height: 14px; }
.ff-reply .body { padding: 10px 12px; border-radius: 14px; background: #18181b; font-size: 11.5px; line-height: 1.5; font-style: italic; color: #a1a1aa; }
.ff-chips { display: flex; gap: 6px; margin-top: 8px; font-style: normal; }
.ff-chip { height: 20px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: 5px; background: #27272a; color: #71717a; font-size: 10px; font-weight: 600; }
.ff-chip.v { background: #28233b; color: #a38cf3; font-family: var(--mono); font-weight: 700; }
.ff-by { margin-top: 8px; text-align: right; font: normal 10px var(--mono); color: #a1a1aa; }
.ff-steps { gap: 8px; padding: 4px 4px 4px 20px; font-size: 11.5px; color: #a1a1aa; }
.ff-dots { display: inline-flex; gap: 3px; }
.ff-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ai); animation: ff-dot 1s infinite ease-in-out; }
.ff-dots i:nth-child(2) { animation-delay: .15s; }
.ff-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ff-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.ff-composer { padding: 12px 14px 10px; }
.ff-composer .field { min-height: 20px; font-size: 14px; color: #71717a; line-height: 1.35; }
.ff-composer .field.typing { color: #fafafa; }
.ff-composer .field.typing::after { content: ''; display: inline-block; width: 1.5px; height: 15px; margin-left: 1px; vertical-align: -2px; background: var(--line); }
.ff-composer .foot { margin-top: 10px; gap: 10px; color: #71717a; }
.ff-composer .foot .ic { width: 13px; height: 13px; }
.ff-engine { white-space: nowrap; gap: 6px; font-size: 12px; font-weight: 600; color: #a38cf3; display: inline-flex; align-items: center; }
.ff-engine::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #a38cf3; }
.ff-scope { gap: 5px; display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.ff-scope .ic { color: var(--line); }
.ff-send { margin-left: auto; }
.ff-send.go { color: var(--line); }

/* ---- timeline ---- */
.ff-tl { background: var(--ground); }
.ff-tl .bar { height: 36px; padding: 0 12px; gap: 16px; }
.ff-tl .tools { gap: 2px; color: #a1a1aa; margin-left: auto; }
.ff-tl .tools .ic { width: 15px; height: 15px; }
.ff-note { gap: 6px; font-size: 12px; color: #8b7cf0; white-space: nowrap; }
.ff-note::before { content: ''; width: 16px; height: 11px; border: 1.5px solid #8b7cf0; border-radius: 4px; }
.ff-note:empty { display: none; }
.ff-lanes { position: relative; overflow: hidden; }
.ff-ruler { position: relative; height: 24px; margin-left: 128px; border-left: 1px solid var(--hair); background-image: repeating-linear-gradient(to right, var(--hair-strong) 0 1px, transparent 1px calc(var(--pps) * 1px)); background-position: 0 14px; background-size: auto 10px; background-repeat: repeat-x; }
.ff-ruler span { position: absolute; top: 5px; padding-left: 4px; height: 19px; border-left: 1px solid var(--hair-strong); font: 9.5px var(--mono); color: #a1a1aa; }
.ff-track { position: relative; display: flex; border-top: 1px solid var(--hair); }
.ff-track .hd { width: 128px; flex: none; padding: 0 10px; gap: 12px; color: #71717a; font: 10px var(--mono); border-right: 1px solid var(--hair); }
.ff-track .hd .ic { width: 13px; height: 13px; }
.ff-track .hd b { font-weight: 400; width: 20px; letter-spacing: .08em; }
.ff-track .lane { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.ff-track.motion { background: #120c11; }
.ff-track.motion .hd b { color: var(--motion); }
.ff-track.motion .hd .ic:first-child { color: var(--motion); }
.ff-clip { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; overflow: hidden; background-color: #1f2937; background-size: auto 100%; background-repeat: repeat-x; }
.ff-clip::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 55%); }
.ff-clip .nm { position: absolute; left: 7px; bottom: 5px; right: 4px; font-size: 10.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.ff-clip.ai { box-shadow: inset 0 0 0 1.5px #9d8cf0; }
.ff-ai { position: absolute; top: 5px; right: 5px; height: 20px; min-width: 22px; padding: 0 5px; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: #7b5fc4; color: #fff; font: 700 9.5px var(--mono); }
.ff-clip.mo { background: #2a1520; background-image: none; box-shadow: inset 0 0 0 1px #6b2f4c; display: flex; align-items: center; padding: 0 8px; font-size: 10.5px; color: #f5d0e0; white-space: nowrap; }
.ff-clip.mo::before { display: none; }
.ff-clip.au { background: #2b3231; background-image: none; }
.ff-clip.au::before { display: none; }
.ff-clip.au svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ff-clip.au .nm { text-shadow: none; color: #d4d4d8; }
.ff-head { position: absolute; top: 0; bottom: 0; left: 128px; width: 1px; background: var(--primary); transform: translateX(calc(var(--x, 0) * 1px)); z-index: 5; pointer-events: none; }
.ff-head::before { content: ''; position: absolute; left: -5px; top: 0; width: 11px; height: 13px; border-radius: 2px; background: var(--primary); }

/* ---- graph nodes (the image board) ---- */
.ff-board { background-color: var(--ground); background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px; }
.ff-node { position: absolute; display: flex; flex-direction: column; overflow: hidden; background: #0d0d10; border: 1px solid var(--hair-strong); border-radius: 3px; }
.ff-node .nh { height: 30px; flex: none; padding: 0 12px; gap: 8px; border-bottom: 1px solid var(--hair); }
.ff-node .nh .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.ff-node .nh .ic { width: 13px; height: 13px; color: #a1a1aa; }
.ff-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ff-edges path { fill: none; stroke: #52525b; stroke-width: 1.2; }
.ff-port { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #71717a; }
.ff-port.out { background: var(--primary); }
