/* HandCam Studio (desk.html). Builds on shared/ui.css. */
html, body { height: 100%; overflow: hidden; }
body { background: radial-gradient(1200px 600px at 50% -200px, #1a1512 0%, var(--bg) 60%); }

/* Top bar */
.topbar { height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(11,11,13,.75); backdrop-filter: blur(14px); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font: 700 17px var(--display); letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; }
.brand .sub { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); padding: 4px 7px; border: 1px solid var(--line-2); border-radius: 6px; }
.steps { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); }
.step { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 6px; border-radius: 999px; color: var(--mute); font: 600 13px var(--font); transition: background .25s, color .25s; cursor: default; }
.step .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 11px var(--mono); transition: all .25s var(--ease); }
.step.now { background: var(--raise); color: var(--fg); }
.step.now .n { border-color: var(--accent); color: var(--accent-2); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #0c1a10; font-size: 0; }
.step.done .n::after { content: ''; width: 9px; height: 5px; border: 2px solid #0c1a10; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.step-sep { width: 14px; height: 1px; background: var(--line-2); }
.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* Layout */
.layout { height: calc(100% - 60px); display: grid; grid-template-columns: 320px minmax(0, 1fr) 372px; gap: 12px; padding: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; scrollbar-width: thin; padding-bottom: 4px; }
.panel { padding: 16px; display: flex; flex-direction: column; gap: 12px; animation: rise .5s var(--ease) both; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel h3 { margin: 4px 0 0; font: 700 19px/1.15 var(--display); letter-spacing: -.01em; }
.panel p { margin: 0; color: var(--mute); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); border-radius: 999px; padding: 5px 10px; font: 500 12px var(--font); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }

/* Phone card */
.qr-wrap { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.qr { width: 120px; height: 120px; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px -12px rgba(224,122,82,.5); position: relative; }
.qr canvas { width: 100% !important; height: 100% !important; display: block; }
.qr::after { content: ''; position: absolute; inset: -4px; border-radius: 17px; border: 1px solid rgba(224,122,82,.35); pointer-events: none; }
.how { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.how li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; color: var(--fg-2); font-size: 12.5px; }
.how li span { font: 600 11px/18px var(--mono); color: var(--accent-2); }
.room { font: 600 12px var(--mono); letter-spacing: .12em; color: var(--fg); }
.link { font: 12px var(--mono); color: var(--mute); word-break: break-all; }
.warn-box { background: var(--warn-soft); border: 1px solid rgba(232,176,74,.35); color: #f3cf86; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.warn-box code { font: 11.5px var(--mono); color: #fff3d6; }

/* Stage */
.stage { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); background: radial-gradient(900px 500px at 50% 0%, #17171c, #0a0a0c); box-shadow: var(--shadow-lg); min-height: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.stage-top > * { pointer-events: auto; }
.rec-chip { color: #ffd2d2; border-color: rgba(255,77,77,.4); background: rgba(60,10,10,.6); font-family: var(--mono); }
#inset, #inset2 { position: absolute; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 20px 50px -10px rgba(0,0,0,.8); }
#inset span, #inset2 span { position: absolute; top: -26px; left: 0; white-space: nowrap; }
.stage-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,10,12,.55); backdrop-filter: blur(6px); }
.stage-veil .card { padding: 18px 22px; display: flex; gap: 12px; align-items: center; }

/* Player (timeline) */
.player { position: absolute; left: 14px; right: 14px; bottom: 14px; display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(18,18,22,.82); border: 1px solid var(--line-2); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); animation: rise .35s var(--ease) both; }
.play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream); color: #111; display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.play:hover { transform: scale(1.06); }
.play svg { width: 16px; height: 16px; }
.take-name { font: 600 13px var(--font); }
.timeline { position: relative; height: 34px; }
.timeline svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.timeline input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.timeline .head { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); border-radius: 2px; pointer-events: none; box-shadow: 0 0 12px var(--accent); }
.time { font: 500 12px var(--mono); color: var(--fg-2); min-width: 92px; text-align: right; }

/* Takes */
.takes { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 8px;
  /* fixed height, scrolls inside, so the panels below stay in view however many takes there are */
  max-height: min(42vh, 360px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.takes .take { flex: none; }
.take { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.015); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.take:hover { border-color: var(--line-2); background: rgba(255,255,255,.035); }
.take.sel { border-color: var(--accent); background: var(--accent-soft); }
.take .t-name { font: 600 13.5px var(--font); display: flex; align-items: center; gap: 6px; }
.take .t-meta { font: 11.5px var(--mono); color: var(--mute); grid-column: 1; }
.take svg { grid-row: 1 / span 2; grid-column: 2; width: 92px; height: 34px; }
.empty { text-align: center; padding: 18px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(0,0,0,.5)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg) } 50% { transform: translateY(-8px) rotate(2deg) } }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.note { font-size: 12px; color: var(--mute); }
.note a { color: var(--accent-2); }

/* Make video */
.cost { display: flex; justify-content: space-between; gap: 8px; font: 12px var(--mono); color: var(--mute); padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 10px; }
.cost #costEta { white-space: nowrap; }
.timeline-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.timeline-steps li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; color: var(--faint); font-weight: 500; transition: color .2s, background .2s; }
.timeline-steps li .ic { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.timeline-steps li.now { color: var(--fg); background: rgba(255,255,255,.03); }
.timeline-steps li.now .ic { border: 0; }
.timeline-steps li.done { color: var(--fg-2); }
.timeline-steps li.done .ic { background: var(--ok); border-color: var(--ok); }
.timeline-steps li.done .ic::after { content: ''; width: 7px; height: 4px; border: 2px solid #0c1a10; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.timeline-steps .when { font: 11px var(--mono); color: var(--mute); }
.approve img { width: 100%; border-radius: 12px; display: block; border: 1px solid var(--line-2); max-height: 340px; object-fit: contain; background: #000; }
.result-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.result-card video { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; background: #000; }
.ring { --p: 0; --c: var(--ok); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.ring b { position: relative; font: 700 17px var(--display); }
.ring.warn { --c: var(--warn); }
.ring.none { --c: var(--faint); }

/* Result modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5,5,7,.72); backdrop-filter: blur(10px); animation: rise .25s var(--ease) both; padding: 24px; }
.modal-card { width: min(1100px, 100%); max-height: 100%; overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-head { display: flex; align-items: center; gap: 16px; }
.modal-head h2 { margin: 0; font: 700 26px/1.1 var(--display); letter-spacing: -.015em; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.compare video { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; border: 1px solid var(--line-2); object-fit: contain; }
.compare figcaption { display: flex; justify-content: space-between; align-items: center; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; }
.version { border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); border-radius: 10px; padding: 7px 10px; font: 600 12px var(--mono); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.version.sel { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.why div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.why b { display: block; font: 700 20px var(--display); }
.why span { font-size: 12px; color: var(--mute); }

/* Settings popover */
.popover { position: absolute; top: 54px; right: 16px; z-index: 30; width: 280px; padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: rise .2s var(--ease) both; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--fg-2); }
.switch input { accent-color: var(--accent); width: 18px; height: 18px; }

/* Tour */
.tour-veil { position: fixed; inset: 0; z-index: 80; pointer-events: auto; }
.tour-hole { position: fixed; z-index: 81; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(5,5,7,.72), 0 0 0 2px var(--accent), 0 0 40px 4px rgba(224,122,82,.35); transition: all .45s var(--ease); pointer-events: none; }
.tour-tip { position: fixed; z-index: 82; width: 340px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: top .45s var(--ease), left .45s var(--ease); }
.tour-tip h4 { margin: 0; font: 700 18px/1.2 var(--display); }
.tour-tip p { margin: 0; color: var(--fg-2); font-size: 13.5px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: all .3s; }
.tour-dots i.on { width: 18px; border-radius: 3px; background: var(--accent); }
.welcome { width: min(560px, 100%); padding: 0; overflow: hidden; }
.welcome .art { height: 200px; position: relative; background: radial-gradient(400px 200px at 50% 120%, rgba(224,122,82,.35), transparent), linear-gradient(180deg, #1c1714, #121214); display: flex; align-items: center; justify-content: center; gap: 4px; }
.welcome .art img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0,0,0,.5)); animation: float 6s ease-in-out infinite; }
.welcome .art img:nth-child(2) { width: 150px; height: 150px; animation-delay: -2s; }
.welcome .art img:nth-child(3) { animation-delay: -4s; }
.welcome .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.welcome h2 { margin: 0; font: 800 30px/1.05 var(--display); letter-spacing: -.02em; }
.welcome p { margin: 0; color: var(--fg-2); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr) 330px; }
  .steps .label { display: none; }
}
@media (max-width: 960px) {
  html, body { overflow: auto; }
  .layout { height: auto; grid-template-columns: 1fr; }
  .stage { height: 62vh; }
  .topbar { grid-template-columns: 1fr auto; }
  .steps { display: none; }
}

/* Phase 3: fix the set */
.edit-words { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.edit-words .btn.quiet { align-self: flex-start; }
.sel-pill { gap: 8px; border-color: rgba(240,160,125,.45); }
.sel-pill b { color: var(--accent-2); font: 600 12.5px var(--font); }

/* Phase 4: export */
.export-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.015); }
.actions.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.smooth-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; color: var(--fg-2); }
.smooth-row input { accent-color: var(--accent); }
.smooth-row span { font: 11.5px var(--mono); color: var(--mute); min-width: 62px; text-align: right; }
.prompt-box { display: flex; flex-direction: column; gap: 6px; }
.prompt-box textarea { font-size: 12px; line-height: 1.45; resize: vertical; }
.prompt-box .btn { align-self: flex-end; }

/* Phase 4b: star, compare, ghost */
.star { font-size: 18px; color: var(--mute); }
.star.on { color: #f3c45a; }
.take .t-star { color: #f3c45a; margin-right: 2px; }
#inset2 { box-shadow: 0 0 0 1px rgba(159,208,255,.5), 0 20px 50px -10px rgba(0,0,0,.8); }

/* Phase 5b: sequence */
.shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.shot { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.015); }
.shot .row { gap: 4px; }
.shot .field { padding: 6px 8px; font-size: 12.5px; }
.shot select { font-size: 12px; }
.shot-n { font: 600 11px var(--mono); color: var(--accent-2); width: 16px; text-align: center; }
.trim { display: grid; gap: 4px; }
.trim label { display: grid; grid-template-columns: 26px 1fr 44px; gap: 6px; align-items: center; font: 11px var(--mono); color: var(--mute); }
.trim input { accent-color: var(--accent); }
.btn.icon.sm { width: 26px; height: 26px; padding: 0; }
