/* analyzer */
.wrap.wide { max-width: 1520px; }
.lab { padding: 16px var(--gutter) 48px; max-width: 1520px; margin-inline: auto; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-main { min-width: 0; }

.stage-shell { display: flex; justify-content: center; background: var(--film); border-radius: var(--radius); border: 2px solid var(--ink); overflow: hidden; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 68vh; }
.stage:not(.loaded) { aspect-ratio: auto; min-height: clamp(340px, 52vh, 560px); }
.stage.loaded { width: min(100%, calc(68vh * var(--ar, 1.7778))); aspect-ratio: var(--ar, 1.7778); }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: contain; background: var(--film); }
.stage canvas { touch-action: none; }
.stage[data-tool="box"] canvas, .stage[data-tool="ring"] canvas, .stage[data-tool="arrow"] canvas, .stage[data-tool="angle"] canvas { cursor: crosshair; }
.drop { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #fff; background: var(--film); text-align: center; }
.drop.over { outline: 4px dashed var(--signal); outline-offset: -12px; }
.drop h1 { font-size: clamp(1.8rem, 4vw, 3rem); color: #fff; margin-bottom: 12px; }
.drop p { color: #d0d0d6; margin-inline: auto; max-width: 46ch; }
.drop .btn { margin: 8px 0 14px; }
.stage-status { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(10,10,14,0.88); color: #fff; font-size: 0.85rem; font-weight: 600; padding: 6px 10px; border-radius: 6px; pointer-events: none; }
.stage-status:empty { display: none; }
@media (max-width: 1080px) { .stage, .stage.loaded { max-height: 56vh; } .stage.loaded { width: min(100%, calc(56vh * var(--ar, 1.7778))); } }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; }
.t-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tools { margin-left: auto; }
.readout { font-size: 1rem; padding: 4px 10px; background: var(--chalk); border-radius: 6px; min-width: 15ch; }
select.compact { width: auto; margin: 0; padding: 7px 8px; font-weight: 700; }
.tool[aria-pressed="true"] { background: var(--signal); }

.timeline-wrap { position: relative; border: 1.5px solid var(--rule); border-radius: var(--radius-s); background: var(--paper); }
#timeline { width: 100%; height: 140px; cursor: pointer; }
.tl-tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 0.8rem; padding: 3px 8px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.keys { margin-top: 8px; }
@media (hover: none) { .keys { display: none !important; } }

.lab-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 1081px) { .lab-side { max-height: calc(100vh - 80px); overflow: auto; position: sticky; top: 76px; padding-right: 4px; } }
.lab-side .bug { flex: none; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notes li { font-size: 0.85rem; background: #fffbe0; border-left: 4px solid var(--signal); padding: 6px 10px; border-radius: 0 6px 6px 0; }
.step { border: 1.5px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.step[open] { border-color: var(--ink); }
.step summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 800; font-stretch: 108%; list-style: none; }
.step summary::-webkit-details-marker { display: none; }
.step summary::after { content: '+'; margin-left: auto; font-weight: 700; font-size: 1.2rem; }
.step[open] summary::after { content: '–'; }
.step .step-n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 0.85rem; font-stretch: 80%; flex: none; }
.step[open] .step-n { background: var(--signal); }
.step .count { font-weight: 600; font-stretch: 90%; color: var(--ink-3); font-size: 0.85rem; }
.step-body { padding: 0 14px 14px; }
.step-body .field { margin-bottom: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; }
.clipinfo { background: var(--chalk); padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; overflow-wrap: anywhere; }
details.more { margin: 4px 0 6px; }
details.more summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; }
fieldset.show { border: 0; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
fieldset.show legend { width: 100%; font-weight: 700; margin-bottom: 2px; }

.marks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mark { display: grid; grid-template-columns: auto minmax(0, 1fr) 84px auto; gap: 6px; align-items: center; padding: 6px; border: 1.5px solid var(--rule); border-radius: var(--radius-s); }
.mark.next { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--signal); }
.mark .m-label { margin: 0; padding: 5px 7px; font-size: 0.9rem; font-weight: 600; border-color: transparent; }
.mark .m-label:hover, .mark .m-label:focus { border-color: #9a9b96; }
.mark .m-d { margin: 0; padding: 5px 6px; font-size: 0.9rem; }
.mark .m-time { font-size: 0.8rem; color: var(--ink-2); grid-column: 2 / 3; padding-left: 8px; }
.mark .m-time button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; cursor: pointer; }
.mark .m-more { grid-column: 1 / -1; display: none; gap: 6px; grid-template-columns: 1fr 1fr auto; align-items: end; }
.mark.editing .m-more { display: grid; }
.mark .m-more input, .mark .m-more select { margin-top: 2px; padding: 5px 6px; font-size: 0.85rem; }
.mark .m-more label { font-size: 0.75rem; }
.d-wrap { position: relative; }
.d-wrap .unit { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; color: var(--ink-3); pointer-events: none; }
.d-wrap input { padding-right: 24px !important; }
.icon-btn { background: none; border: 1.5px solid transparent; border-radius: 6px; padding: 4px 7px; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.85rem; }
.icon-btn:hover { border-color: var(--rule); }

.angles td:nth-child(2) { font-size: 1.1rem; }
.caps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.cap { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; border: 1.5px solid var(--rule); border-radius: var(--radius-s); padding: 8px; }
.cap canvas { width: 96px; height: auto; aspect-ratio: 9 / 16; border-radius: 6px; background: var(--film); }
.cap input, .cap textarea { margin-top: 0; font-size: 0.88rem; padding: 6px 8px; }
.cap textarea { min-height: 64px; margin-top: 6px; }
.cap .cap-meta { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 6px; }
.cap .btn-row { margin: 6px 0 0; }

.summary { margin: 0 0 12px; }
.summary > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.summary dt { font-size: 0.88rem; color: var(--ink-2); }
.summary dd { margin: 0; font-size: 1.25rem; }
.summary dd small { font-size: 0.75rem; color: var(--ink-3); font-weight: 500; font-stretch: 100%; }
.size { font-size: 0.86rem; color: var(--ink-2); margin-bottom: 12px; }
.size h4 { font-size: 0.9rem; margin: 6px 0; }
.size ul { margin: 0; padding-left: 1.1em; }
.progress { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.progress .bar { flex: 1; height: 10px; background: var(--chalk-2); border-radius: 5px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--live); }
.downloads { display: grid; gap: 6px; }
.downloads a { font-weight: 700; }

/* what to work on */
.plan-item { border: 1.5px solid var(--rule); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 10px; }
.plan-item.k-fix { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--signal); }
.plan-item.k-check { border-color: var(--ink-3); }
.plan-item.k-data { background: var(--chalk); }
.plan-item header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.plan-item h4 { margin: 0; font-size: 1rem; font-stretch: 105%; }
.plan-item p { margin: 4px 0; font-size: 0.88rem; }
.plan-item .why { color: var(--ink-2); }
.ptag { flex: none; font-size: 0.66rem; font-weight: 800; font-stretch: 90%; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1.5px solid var(--ink); }
.plan-item.k-fix .ptag { background: var(--signal); }
.plan-item.k-check .ptag { border-style: dashed; }
.plan-item.k-good .ptag { background: var(--ink); color: var(--paper); }
.plan-item.k-data .ptag { background: var(--paper); }
.drills { list-style: none; margin: 8px 0 2px; padding: 0; border-top: 1px solid var(--rule); }
.drills li { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 0.85rem; color: var(--ink-2); }
.drills li strong { color: var(--ink); }
.drills .dose { font-size: 0.78rem; color: var(--ink-3); }
.plan-item.k-goal { border-color: var(--ink-3); background: #f6f6f2; }
.plan-item.k-goal .ptag { background: var(--paper); border-style: dotted; }
.plan-item header { flex-wrap: wrap; }
.rtag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; padding: 1px 6px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.rtag.ok { background: var(--signal); color: var(--ink); }
.plan-item .hist { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.profile-pick .pick-row { display: flex; gap: 6px; align-items: center; }
.profile-pick .pick-row select { flex: 1; min-width: 0; }
.save-box { border: 1.5px solid var(--ink); border-radius: var(--radius-s); padding: 10px 12px; margin: 10px 0 14px; background: #fffef3; }
.save-box h4 { margin: 0 0 4px; font-size: 0.95rem; }
.save-box #save-status:empty { display: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; cursor: pointer; }
.plan-note { font-size: 0.85rem; background: #fffbe0; border-left: 4px solid var(--signal); padding: 6px 10px; border-radius: 0 6px 6px 0; }

.track-box { border: 1.5px dashed #9a9b96; border-radius: var(--radius-s); padding: 8px 10px; margin: 10px 0; }
.track-box .btn-row { margin: 0 0 4px; }

.vo-box { border: 1.5px solid var(--rule); border-radius: var(--radius-s); padding: 10px 12px; margin: 0 0 12px; }
.vo-box h4 { margin: 0 0 6px; font-size: 0.95rem; }
.vo-script { display: grid; gap: 8px; margin-bottom: 4px; }
.vo-seg span { display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.vo-seg textarea { min-height: 0; font-size: 0.86rem; line-height: 1.4; margin-top: 3px; }
.vo-seg textarea[readonly] { background: var(--chalk); color: var(--ink-2); }

.lab-help { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 8px; color: var(--ink-3); }
.lab-help a { font-weight: 600; }
/* guided tour */
.tour { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.tour-hl { position: fixed; border-radius: 10px; box-shadow: 0 0 0 4px var(--signal), 0 0 0 9999px rgba(0, 0, 0, 0.55); transition: all 180ms ease; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.35); pointer-events: auto; }
.tour-card h2 { font-size: 1.15rem; margin: 6px 0 6px; }
.tour-card p { font-size: 0.92rem; margin: 0 0 12px; color: var(--ink-2); }
.tour-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
.tour-x { background: none; border: 0; font: inherit; font-weight: 700; color: var(--ink-2); text-decoration: underline; cursor: pointer; padding: 2px; }
.tour-btns { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .tour-card { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; } }
@media (prefers-reduced-motion: reduce) { .tour-hl { transition: none; } }
