#referenceEditor { padding: 28px 0 64px; }
#referenceEditor .ref-head {align-items:center;gap:8px 16px}
#referenceEditor .ref-head h1 {overflow-wrap:anywhere;line-height:1.2}
[data-dirty] {font-size:.8rem;color:var(--green)}
.ref-steps li {min-width:0}
#referenceEditor .ref-steps button {display:flex;gap:7px;align-items:center;height:100%;line-height:1.4;word-break:keep-all}
.ref-steps button span {display:grid;place-items:center;width:1.45em;height:1.45em;flex:none;border:1px solid var(--line);border-radius:50%}
.ref-steps [aria-current=step] span {color:#fff;background:var(--green);border-color:var(--green)}
#refSectionTitle small {display:block;font-size:.75rem;line-height:1.6;color:var(--green)}
#referenceEditor .ref-foot {display:grid;gap:7px;justify-content:stretch}
#referenceEditor .ref-foot:has([data-next]) {position:sticky;bottom:0;z-index:2;background:var(--paper);padding-block:10px;margin-bottom:0}
.ref-foot [data-status]:empty {display:none}
#referenceEditor [data-action=fix-missing] {padding:4px 0;background:none;color:#854726;text-align:left;border:0}
#referenceEditor .ref-footer-actions [data-next] {margin-left:auto;padding:10px 16px}
#referenceEditor .ref-upload-grid {grid-template-columns:minmax(0,1fr)}
.ref-panel,.ref-compare {overflow-wrap:anywhere}
.ref-panel input,.ref-panel select,.ref-panel textarea,.ref-panel summary {scroll-margin-block:76px}
.ref-head,.ref-foot,.ref-inline,.ref-caption-row,.ref-section-head { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.ref-head,.ref-foot,.ref-section-head { justify-content:space-between; }
.ref-head { margin:15px 0 20px; }
.ref-head h1 { font-size:clamp(27px,3.5vw,42px); letter-spacing:-.055em; }
.ref-steps { list-style:none; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; padding:0; margin:12px 0 18px; }
.ref-steps button { background:transparent; border:0; border-bottom:3px solid var(--line); text-align:left; font-weight:650; width:100%; padding:9px 2px; font-size:14px; }
.ref-steps [aria-current=step] { border-color:var(--green); color:var(--green); }
.ref-panel,.ref-compare { padding:clamp(14px,2vw,22px); border:1px solid var(--line); border-radius:14px; background:var(--paper); min-width:0; }
.ref-panel h2,.ref-compare h2 { font-size:20px; margin-bottom:8px; }
.ref-panel h3,.ref-compare h3 { font-size:15px; margin:12px 0 5px; }
.ref-note,.ref-panel small,.ref-compare small,.ref-foot small { color:var(--dim); font-size:13px; line-height:1.6; }
.ref-grid { display:grid; grid-template-columns:minmax(295px,1.05fr) minmax(330px,1fr); align-items:start; gap:16px; }
.ref-compare { position:sticky; top:8px; }
.ref-views { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.ref-views figure { margin:0; min-width:0; }
.ref-views figcaption { font-weight:650; font-size:13px; padding:6px 0; }
.ref-screen { width:100%; aspect-ratio:9/16; display:block; object-fit:contain; background:#20241f; border-radius:6px; }
.ref-source-player { width:min(100%,480px); max-height:230px; background:#272821; display:block; margin:7px auto; }
.ref-panel label,.ref-compare label { display:grid; gap:4px; margin:8px 0; font-size:13px; font-weight:650; min-width:0; }
.ref-panel input,.ref-panel select,.ref-panel textarea,.ref-compare select,.ref-compare input { min-width:0; width:100%; font:inherit; }
.ref-panel input:not([type=range]):not([type=checkbox]),.ref-panel select,.ref-panel textarea,.ref-compare select { background:#fff; border:1px solid #b9beb1; border-radius:7px; padding:8px; color:var(--ink); }
.ref-panel input[type=checkbox],.ref-compare input[type=checkbox] { width:auto; margin:0 5px 0 0; }
.ref-inline label { flex:1 1 90px; }
.ref-panel [data-action],.ref-compare button,.ref-head button,.ref-foot button,.ref-section-head a,.ref-panel a.ref-download { border:1px solid var(--line); padding:7px 10px; border-radius:6px; background:var(--paper); font:inherit; font-size:13px; }
.ref-foot [data-next],.ref-panel button.ref-primary,.ref-panel a.ref-download { background:var(--dark); color:white; font-weight:650; }
.ref-foot { margin:15px 0; border-top:1px solid var(--line); padding-top:12px; }
.ref-cuts,.ref-saved { list-style:none; padding:0; margin:10px 0; display:grid; gap:5px; }
.ref-cuts li button { display:grid; grid-template-columns:62px 1fr; gap:10px; width:100%; text-align:left; align-items:center; border:1px solid var(--line); border-radius:8px; padding:6px; background:#fff; }
.ref-cuts li button[aria-pressed=true] { border-color:var(--green); box-shadow:inset 0 0 0 1px var(--green); }
.ref-cuts img { width:62px; height:46px; object-fit:cover; background:#e1e4d9; border-radius:4px; }
.ref-cuts small { display:block; }
.ref-cuts li:has([data-replace]) {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center}
.ref-cuts li [data-replace] {display:block;width:auto;border:1px solid var(--line);padding:7px 9px}
.ref-match-state {display:inline-block;font-size:.75rem;color:var(--green);font-weight:700;padding-left:6px}
.ref-match-state.ref-check {color:#89430e}
.ref-review-title {font-weight:750;margin:8px 0}
.ref-alternatives {padding:8px 0;margin:10px 0;border-bottom:1px solid var(--line)}
.ref-alternatives [data-alternate] {display:block;margin:5px 0;text-align:left}
.ref-pool-summary {margin:6px 0;padding-left:20px;font-size:13px;overflow-wrap:anywhere}
.ref-pool label {display:flex;align-items:center;gap:5px;overflow-wrap:anywhere}
.ref-match-progress progress {width:100%;accent-color:var(--green)}
.ref-cuts .ref-alert { color:#8e3b23; }
.ref-cue-summary { white-space:pre-line; overflow-wrap:anywhere; }
.ref-alert { color:#8e3b23; font-size:13px; }
.ref-help { background:var(--muted); border-radius:9px; padding:11px 14px; margin:10px 0; font-size:13px; line-height:1.65; }
.ref-help summary { cursor:pointer; font-weight:650; }
.ref-help p { margin:5px 0; }
.ref-time-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; }
.ref-cue { padding:7px 10px; border:1px solid var(--line); border-radius:7px; margin:7px 0; }
.ref-focus { scroll-margin-top:10px; }
#referenceEditor [role=status] { min-height:1.3em; }
.ref-timeline { display:flex; height:24px; gap:2px; width:100%; }
.ref-timeline button { min-width:2px; overflow:hidden; padding:0; border:0; background:#dbdfd1; border-radius:3px; }
.ref-timeline button[aria-pressed=true] { background:var(--green); color:white; }
.ref-seek { width:100%; accent-color:var(--green); }
.ref-footer-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ref-mobile-jump { display:none; }
.ref-output-video { width:min(100%,280px); max-height:510px; background:#222; }
@media(max-width:840px) {
  .ref-grid { grid-template-columns:minmax(0,1fr); }
  .ref-compare { position:static; }
  .ref-mobile-jump { display:inline-block; }
  .ref-steps button { font-size:12px; }
  .ref-views { max-width:540px; margin-inline:auto; }
}
@media(max-width:520px) {
  #referenceEditor .ref-steps button {flex-direction:column;gap:4px;text-align:center;font-size:11px}
  #referenceEditor .ref-footer-actions [data-next] {flex:1 1 auto}
  .ref-section-head {align-items:start}
}
