/* Reviews: queue, traditional view, immersive view, markup. Uses the tokens and semantic colours in app.css. */

:root { --mk: #FF6A2B; --mk-resolved: #8A8378; --imm-bg: #121211; --imm-panel: #1B1B1A; --imm-line: #2E2D2A; --imm-text: #E9E4DA; --imm-muted: #A39C90; }

.page-wide { max-width: 1280px; }
.notice.is-warn { background: var(--warn-wash); color: var(--warn); }
.fmt-chip { font-size: 12px; padding: 1px 8px; border-radius: var(--s7-radius-pill); background: var(--color-wash); color: var(--color-accent); }
.stage-chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: var(--s7-radius-pill); background: var(--warn-wash); color: var(--warn); }
.stage-chip.is-approved { background: var(--ok-wash); color: var(--ok); }
.stage-chip.is-changes { background: var(--bad-wash); color: var(--bad); }

.owner-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text); white-space: nowrap; }
.owner-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 600; background: var(--m-forest); color: #fff; }
.owner-chip.is-agent .owner-dot { background: #5566BC; }

/* Queue */
.q-list { list-style: none; margin: 0; padding: 0; }
.q-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--color-rule-soft); }
.q-row:last-child { border-bottom: 0; }
.q-main { display: grid; gap: 4px; text-decoration: none; color: var(--color-ink); min-width: 0; }
.q-title { font-weight: 600; }
.q-main:hover .q-title { color: var(--color-accent); }
.q-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--color-muted); }

/* Traditional view */
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.review-main .card + .card { margin-top: 16px; }
.review-aside { position: sticky; top: 76px; display: grid; gap: 16px; }
.review-aside .card + .card { margin-top: 0; }
.el-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.el-head .card-title { margin: 0; }
.check-ok { font-size: 12px; color: var(--ok); }
.check-ok::before { content: "✓ "; }
.el-img, .el-video { max-width: 100%; border-radius: var(--s7-radius-sm); display: block; background: #000; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 14px 0; font-size: 14px; }
.facts dt { color: var(--color-muted); }
.facts dd { margin: 0; }
.decide { display: grid; gap: 8px; }
.history { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.add-cmt { display: grid; gap: 8px; margin-top: 12px; }
.fp-wrap { display: grid; place-items: center; }

.doc-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; color: var(--color-text); }
mark.hl { background: rgba(255, 106, 43, .22); color: inherit; border-bottom: 2px solid var(--mk); border-radius: 2px; cursor: pointer; }
mark.hl.is-resolved { background: rgba(138, 131, 120, .18); border-bottom-color: var(--mk-resolved); }
mark.hl.is-active { background: rgba(255, 106, 43, .45); }

/* Comments */
.cmt-list { display: grid; gap: 8px; margin-top: 12px; }
.cmt { border: 1px solid var(--color-rule-soft); border-radius: var(--s7-radius-sm); padding: 10px 12px; background: var(--color-surface); cursor: pointer; }
.cmt:hover { border-color: var(--color-rule); }
.cmt.is-active { border-color: var(--mk); box-shadow: 0 0 0 2px rgba(255, 106, 43, .2); }
.cmt.is-resolved { opacity: .7; }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cmt-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--mk); color: #fff; font-size: 11px; font-weight: 600; }
.cmt.is-resolved .cmt-n { background: var(--mk-resolved); }
.cmt-state { margin-left: auto; font-size: 12px; color: var(--ok); }
.cmt-body { margin: 6px 0 0; font-size: 14px; }
.cmt-suggest { margin: 6px 0 0; font-size: 14px; padding: 6px 8px; border-left: 3px solid var(--ok); background: var(--ok-wash); border-radius: 4px; }
.cmt-reply { margin: 6px 0 0; font-size: 13px; padding: 6px 8px; background: var(--color-wash); border-radius: 4px; }
.cmt-actions { margin-top: 6px; }

/* Feed preview (generic, no platform branding) */
.fp { background: #fff; color: #1F1F1E; border: 1px solid #E2DDD3; border-radius: 12px; width: min(100%, 540px); overflow: hidden; }
.fp-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px 0; }
.fp-head strong { display: block; font-size: 14px; }
.fp-sub { display: block; color: #6B675F; }
.fp-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: #DC602D; color: #fff; font-weight: 600; font-size: 13px; }
.fp-text { white-space: pre-wrap; margin: 10px 14px 4px; font-size: 14px; line-height: 1.5; }
.fp .linkish { margin: 0 14px 10px; color: #6B675F; }
.fp-media { display: block; width: 100%; background: #000; margin-top: 8px; }
.fp-article { padding-bottom: 16px; }
.fp-hero { width: 100%; display: block; }
.fp-title { font-size: 24px; margin: 16px 18px 4px; color: #1F1F1E; }
.fp-meta { margin: 0 18px 8px; }
.fp-para { margin: 8px 18px; font-size: 15px; line-height: 1.6; color: #373833; }

/* Decision dialogs */
.dialog-wide { max-width: 620px; }
.sum-list { display: grid; gap: 12px; max-height: 40vh; overflow: auto; }
.sum-el { font-size: 14px; margin-bottom: 4px; }
.json-wrap summary { cursor: pointer; font-size: 14px; color: var(--color-accent); }
.json { font: 12px/1.45 ui-monospace, Menlo, monospace; background: var(--color-paper); border: 1px solid var(--color-rule-soft); border-radius: 8px; padding: 10px; max-height: 240px; overflow: auto; white-space: pre; }
textarea.input { resize: vertical; }

/* ── Immersive ── */
html.imm-open, html.imm-open body { overflow: hidden; }
.imm { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto 1fr auto; background: var(--imm-bg); color: var(--imm-text);
  --color-surface: #22221F; --color-ink: #F4F0E8; --color-text: var(--imm-text); --color-muted: var(--imm-muted); --color-rule: #3B3A36; --color-rule-soft: var(--imm-line);
  --color-wash: rgba(232, 116, 63, .12); --color-accent: #F28A58; --ok: #A5D6A7; --ok-wash: rgba(102, 187, 106, .14); }
.imm-top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--imm-line); }
.imm-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--imm-line); background: transparent; color: var(--imm-text); cursor: pointer; font-size: 14px; }
.imm-close:hover { background: rgba(255, 255, 255, .06); }
.imm-title { display: grid; min-width: 0; flex: 1; }
.imm-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #F4F0E8; }
.imm-sub { font-size: 12px; color: var(--imm-muted); }
.imm .owner-chip { color: var(--imm-text); }
.imm-btn.button.is-quiet { color: var(--imm-text); border-color: var(--imm-line); }
.imm-btn.button.is-quiet:hover { background: rgba(255, 255, 255, .06); }

.imm-body { display: grid; grid-template-columns: 200px minmax(0, 1fr) 360px; min-height: 0; }
.imm-rail { border-right: 1px solid var(--imm-line); padding: 12px 8px; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.imm-el { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--imm-text); font: 500 14px var(--s7-font); cursor: pointer; }
.imm-el:hover { background: rgba(255, 255, 255, .05); }
.imm-el[aria-current="true"] { background: rgba(232, 116, 63, .16); color: #F4F0E8; }
.imm-el-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--imm-muted); flex: none; }
.imm-el-dot.is-seen { background: var(--m-sage); border-color: var(--m-sage); }
.imm-el-label { flex: 1; }
.imm-count { font-size: 11px; font-weight: 600; min-width: 18px; padding: 1px 6px; border-radius: 9px; background: var(--mk); color: #fff; text-align: center; }

.imm-stage { position: relative; min-width: 0; min-height: 0; display: flex; padding: 20px; overflow: hidden; }
.imm-stage > * { flex: 1; min-height: 0; }
.imm-doc { position: relative; overflow-y: auto; display: grid; justify-items: center; align-content: start; padding: 8px 0 40px; }
.doc-card { background: #FDFAF3; color: #373833; border-radius: 12px; padding: 32px 36px; width: min(100%, 720px); box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.doc-card.is-title { font-size: 26px; font-weight: 600; color: #1F1F1E; line-height: 1.3; }
.doc-card ::selection { background: rgba(255, 106, 43, .35); }
.sel-pop { position: absolute; display: flex; gap: 6px; padding: 6px; background: #2A2A27; border: 1px solid var(--imm-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); z-index: 2; }

.imm-media-wrap { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 0; }
.imm-media-wrap.is-small { flex: 1.2; }
/* The frame sits on its controls: free space goes above, never between video and controls. */
.imm-frame-host { flex: 0 1 auto; width: 100%; height: min(68vh, calc(100% - 96px)); min-height: 120px; display: grid; place-items: end center; }
.imm-frame { position: relative; background: #000; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); container-type: inline-size; }
.imm-media { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.imm-cap { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); max-width: 86%; padding: 4px 10px; background: rgba(0, 0, 0, .75); color: #fff; font-size: clamp(10px, 3.2cqw, 24px); line-height: 1.35; text-align: center; border-radius: 4px; pointer-events: none; }
.imm-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 20px; min-height: 0; }
.imm-cues { overflow-y: auto; min-height: 0; }

/* Markup layer */
.mk-layer { position: absolute; inset: 0; z-index: 1; }
.mk-layer.is-active { cursor: crosshair; touch-action: none; }
.mk-layer:not(.is-active) { pointer-events: none; }
.mk-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mk-shape { fill: none; stroke: var(--mk); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .8)); }
ellipse.mk-shape, .mk-shape.is-filled { fill: rgba(255, 106, 43, .1); }
.mk-shape.is-resolved { stroke: var(--mk-resolved); fill: none; }
.mk-shape.is-active { stroke-width: 4.5; }
.mk-shape.is-draft { stroke: #FFD08A; stroke-dasharray: 7 5; }
.mk-pins { position: absolute; inset: 0; pointer-events: none; }
.mk-pin { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--mk); color: #fff; font: 600 12px var(--s7-font); box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, .5); }
.mk-pin.is-dot { min-width: 12px; width: 12px; height: 12px; padding: 0; }
.mk-pin.is-resolved { background: var(--mk-resolved); }
.mk-pin.is-draft { background: #FFD08A; color: #1F1F1E; }
.mk-pin.is-active { transform: translate(-50%, -50%) scale(1.25); }

/* Video controls */
.vc { display: grid; gap: 8px; }
.vc-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vc-gap { flex: 1; }
.vc-play { width: 38px; height: 32px; border-radius: 8px; border: 1px solid var(--imm-line); background: rgba(255, 255, 255, .06); color: var(--imm-text); cursor: pointer; font-size: 12px; }
.vc-btn { height: 30px; min-width: 30px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--imm-line); background: transparent; color: var(--imm-text); font: 500 12px var(--s7-font); cursor: pointer; }
.vc-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .06); }
.vc-btn:disabled { opacity: .4; cursor: default; }
.vc-btn[aria-pressed="true"] { background: rgba(255, 106, 43, .2); border-color: var(--mk); color: #fff; }
.vc-time { font: 12px ui-monospace, Menlo, monospace; color: var(--imm-muted); min-width: 104px; margin-left: 4px; }

/* Timeline */
.tl { display: grid; gap: 4px; user-select: none; }
.tl-marks { position: relative; height: 20px; }
.tl-mark { position: absolute; top: 2px; transform: translateX(-50%); height: 16px; min-width: 16px; padding: 0; border: 0; border-radius: 8px; background: var(--mk); cursor: pointer; display: flex; align-items: center; }
.tl-mark.is-range { transform: none; border-radius: 4px; background: rgba(255, 106, 43, .35); border-left: 3px solid var(--mk); }
.tl-mark-n { color: #fff; font: 600 10px var(--s7-font); padding: 0 5px; white-space: nowrap; }
.tl-mark.is-resolved { background: var(--mk-resolved); }
.tl-mark.is-range.is-resolved { background: rgba(138, 131, 120, .3); border-left-color: var(--mk-resolved); }
.tl-mark.is-active { outline: 2px solid #fff; outline-offset: 1px; }
.tl-track { position: relative; height: 48px; border-radius: 8px; overflow: visible; background: #0B0B0A; cursor: pointer; touch-action: none; }
.tl-track:focus-visible { outline: 2px solid #F28A58; outline-offset: 2px; }
.tl-strip { position: absolute; inset: 0; display: flex; border-radius: 8px; overflow: hidden; opacity: .8; }
.tl-strip img { flex: 1; min-width: 0; height: 100%; object-fit: cover; pointer-events: none; }
.tl-strip.is-plain { background: repeating-linear-gradient(90deg, #1E1E1C 0 40px, #252522 40px 80px); }
.tl-range { position: absolute; top: -3px; bottom: -3px; background: rgba(255, 208, 138, .18); border: 2px solid #FFD08A; border-radius: 6px; pointer-events: none; }
.tl-edge { position: absolute; top: 50%; width: 10px; height: 26px; margin-top: -13px; border-radius: 3px; background: #FFD08A; cursor: ew-resize; pointer-events: auto; }
.tl-edge.is-in { left: -6px; }
.tl-edge.is-out { right: -6px; }
.tl-head { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .8); pointer-events: none; }
.tl-knob { position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; cursor: grab; pointer-events: auto; }
.tl-hover { position: absolute; bottom: calc(100% + 26px); transform: translateX(-50%); padding: 2px 6px; border-radius: 4px; background: #000; color: #fff; font: 11px ui-monospace, Menlo, monospace; pointer-events: none; white-space: nowrap; }
.tl-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #FFD08A; }

.tools { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--imm-line); background: transparent; color: var(--imm-text); font: 500 13px var(--s7-font); cursor: pointer; }
.tool[aria-pressed="true"] { background: rgba(255, 106, 43, .2); border-color: var(--mk); color: #fff; }
.tool kbd { font: 11px ui-monospace, Menlo, monospace; color: var(--imm-muted); }

/* Keys */
.keys-pop { position: fixed; right: 16px; bottom: 64px; z-index: 31; width: min(420px, calc(100% - 32px)); max-height: 70vh; overflow: auto; padding: 16px 18px; background: #22221F; color: var(--imm-text); border: 1px solid var(--imm-line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.keys-title { font-size: 15px; margin-bottom: 10px; color: #F4F0E8; }
.keys-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.keys-list dd { margin: 0; color: var(--imm-muted); }
.keys-list kbd { font: 12px ui-monospace, Menlo, monospace; padding: 1px 6px; border-radius: 4px; background: #141413; border: 1px solid var(--imm-line); }

/* Captions list */
.cue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cue { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-rule-soft); }
.cue.is-now { border-color: rgba(232, 116, 63, .6); background: rgba(232, 116, 63, .08); }
.cue.is-active { border-color: var(--mk); box-shadow: 0 0 0 2px rgba(255, 106, 43, .2); }
.cue-time { font: 12px ui-monospace, Menlo, monospace; }
.cue-list.is-static .cue-time { color: var(--color-muted); }
.cue-acts { grid-column: 2 / -1; display: flex; gap: 14px; }

/* Comments panel */
.imm-panel { border-left: 1px solid var(--imm-line); background: var(--imm-panel); overflow-y: auto; padding: 12px 14px 24px; display: grid; align-content: start; gap: 12px; }
.imm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--imm-line); }
.imm-tab { padding: 8px 10px; border: 0; background: none; color: var(--imm-muted); font: 500 13px var(--s7-font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.imm-tab[aria-selected="true"] { color: #F4F0E8; border-bottom-color: #E8743F; }
.imm-hint { padding: 10px 12px; border: 1px dashed var(--imm-line); border-radius: 10px; color: var(--imm-muted); }
.imm-hint p { margin: 0 0 4px; }
.imm-empty { margin: 0; }
.composer { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--mk); border-radius: 10px; background: rgba(255, 106, 43, .06); }
.composer-at { margin: 0; color: #FFB08C; font-weight: 500; }
.composer-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.composer-tip { margin: 0; }
.imm .input { background: #141413; color: #F4F0E8; border-color: var(--imm-line); }
.imm-older summary { cursor: pointer; font-size: 13px; color: var(--imm-muted); }

.imm-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--imm-line); }
.imm-progress { font-size: 13px; color: var(--imm-muted); }
.imm-spacer { flex: 1; }
.imm-decide { display: flex; gap: 8px; }

@media (max-width: 1100px) {
  .review-grid { grid-template-columns: 1fr; }
  .review-aside { position: static; }
  .imm-body { grid-template-columns: 160px minmax(0, 1fr) 300px; }
}
@media (max-width: 760px) {
  .q-row { grid-template-columns: 1fr; }
  .imm-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) minmax(0, 40%); }
  .imm-rail { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--imm-line); padding: 6px; }
  .imm-el { width: auto; white-space: nowrap; }
  .imm-panel { border-left: 0; border-top: 1px solid var(--imm-line); }
  .imm-split { grid-template-columns: 1fr; }
  .imm-stage { padding: 10px; }
  .imm-top .owner-chip { display: none; }
}
