/* New editing request and Send to editing (a Calendar card's hand-off): footage on the left, the job on the right,
   one send bar. Markup: ticketPageCollective / ticketFootagePane in app.js and the plan page in team.js.
   Behaviour: ticket-media.js. Loaded after ds.css so these rules win over the older single-column composer. */

body.lab .tkc { max-width: 1320px; margin: 0 auto; padding-bottom: 8px; }
body.lab .tkc-head { display: flex; align-items: flex-start; gap: 16px; margin: 0 0 18px; padding: 0; border: 0; background: none; }
body.lab .tkc-head h1 { margin: 0; font-size: 28px; line-height: 1.15; }
body.lab .tkc-head p { margin: 6px 0 0; max-width: 62ch; color: var(--ds-ink-3); font-size: 14px; }
body.lab .tkc .ticket-request-panel { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
body.lab .tkc .ticket-send-note { margin: 0 0 14px; }
body.lab .tkc-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, 1fr); gap: 18px; align-items: start; }

/* ---------- Left: the files panel ---------- */
body.lab .tkm { display: grid; gap: 14px; align-content: start; min-width: 0; padding: 18px; border-radius: var(--ds-r-lg, 20px); transition: box-shadow .15s; }
body.lab .tkc-dragging .tkm { box-shadow: inset 0 0 0 2px var(--accent), var(--ds-shadow); }
body.lab .tkm-tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--ds-r-pill, 999px); background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--ds-stroke); }
body.lab .tkm-tabs button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 0 !important; height: 34px; padding: 0 12px !important; border: 0 !important; border-radius: var(--ds-r-pill, 999px) !important; background: none !important; box-shadow: none !important; color: var(--ds-ink-3) !important; font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
body.lab .tkm-tabs button[aria-selected="true"] { color: var(--ds-ink) !important; background: linear-gradient(180deg, rgba(255, 246, 230, .22), rgba(255, 246, 230, .12)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 12px rgba(0, 0, 0, .35) !important; }
body.lab .tkm-tabs b, body.lab .tkm-seg b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 246, 230, .1); font-size: 11.5px; font-variant-numeric: tabular-nums; }
body.lab .tkm-tabs button[aria-selected="true"] b { background: var(--accent); color: var(--ds-on-accent); }

body.lab .tkm-pane { display: grid; gap: 12px; min-width: 0; padding: 0; }
body.lab .tkm-pane[hidden] { display: none; }
body.lab .tkm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
body.lab .tkm-head h2 { margin: 0; font-size: 16px; }
body.lab .tkm-head h2 small { color: var(--ds-ink-3); font-size: 12px; font-weight: 500; }
body.lab .tkm-head > small { color: var(--ds-ink-3); font-size: 12.5px; white-space: nowrap; }
body.lab .tkm .ticket-request-help { margin: -4px 0 0; color: var(--ds-ink-3); font-size: 12.5px; }
body.lab .tkm .ticket-request-sources { margin-top: 0; gap: 10px; }

/* Drop zone: the whole box is the file picker; it lights up while files are dragged over the page. */
body.lab .tkm-drop { position: relative; display: grid; justify-items: center; gap: 4px; margin: 0; padding: 22px 16px; border: 1.5px dashed rgba(255, 216, 77, .32); border-radius: 16px; background: var(--ds-well); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
body.lab .tkm-drop:hover, body.lab .tkc-dragging .tkm-pane:not([hidden]) .tkm-drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
body.lab .tkm-drop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
body.lab .tkm-drop:has(input:disabled) { opacity: .55; cursor: progress; }
body.lab .tkm-drop-ic { width: 30px; height: 30px; margin-bottom: 4px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.lab .tkm-drop strong { font-size: 15px; color: var(--ds-ink); }
body.lab .tkm-drop span { font-size: 13px; color: var(--ds-ink-2); }
body.lab .tkm-drop u { color: var(--accent); text-underline-offset: 3px; }
body.lab .tkm-drop small { font-size: 12px; color: var(--ds-ink-3); }
body.lab .tkm-drop input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

body.lab #app .tkm-links { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; min-height: 0; padding: 12px 14px; text-align: left; }
body.lab .tkm-links > :is(strong, small) { grid-column: 1 / -1; }
body.lab .tkm-links strong { display: flex; align-items: center; gap: 7px; font-size: 13px; }
body.lab .tkm-links strong svg { width: 15px; height: 15px; color: var(--accent); }
body.lab .tkm-links small { color: var(--ds-ink-3); font-size: 12px; line-height: 1.45; }
body.lab .tkm-links input { width: 100%; min-height: 38px; }
body.lab .tkm-links .ds-btn { grid-column: 1 / -1; justify-self: start; }

body.lab .tkm-status { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--ds-well); color: var(--ds-ink-2); font-size: 13px; }
body.lab .tkm-status:empty { display: none; }

/* Attached files: numbered in the order the editor gets them. */
body.lab .tkm-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 0 0; }
body.lab .tkm-subhead h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ds-ink-2); }
body.lab .tkm-subhead small { color: var(--ds-ink-3); font-size: 12px; }
body.lab .tkm-picked { display: grid; gap: 6px; }
body.lab .tkm-row { display: grid; grid-template-columns: 20px 38px minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--ds-well)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
body.lab .tkm-row.missing { box-shadow: inset 0 0 0 1px var(--ds-down); }
body.lab .tkm-num { color: var(--accent); font-size: 13px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
body.lab .tkm-rthumb { display: grid; place-items: center; width: 38px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #0b0a08; }
body.lab .tkm-rthumb :is(video, img) { width: 100%; height: 100%; object-fit: cover; display: block; }
body.lab .tkm-meta { min-width: 0; }
body.lab .tkm-meta b { display: block; overflow: hidden; color: var(--ds-ink); font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
body.lab .tkm-meta small { display: block; color: var(--ds-ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
body.lab .tkm-row select { width: 138px; min-height: 32px; padding: 0 30px 0 10px !important; background-position: right 10px center !important; font-size: 12px; }
body.lab .tkm-x { position: relative; display: grid; place-items: center; width: 32px; height: 32px; margin: 0; border-radius: 50%; color: var(--ds-ink-3); font-size: 13px; cursor: pointer; }
body.lab .tkm-x:hover { background: var(--ds-glass-3); color: var(--ds-ink); }
body.lab .tkm-x:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
body.lab .tkm-x input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; min-height: 0 !important; margin: 0; opacity: 0; cursor: pointer; }

/* Library: frames you click to add. A yellow ring and a numbered check show what is in the request. */
body.lab .tkm-lib { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ds-stroke); }
body.lab .tkm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.lab .tkm-tools input[type=search] { flex: 1 1 160px; min-width: 0; min-height: 36px; }
body.lab .tkm-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--ds-stroke); }
body.lab .tkm-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 0 !important; height: 30px; padding: 0 12px !important; border: 0 !important; border-radius: 999px !important; background: none !important; box-shadow: none !important; color: var(--ds-ink-3) !important; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
body.lab .tkm-seg button[aria-pressed="true"] { color: var(--ds-ink) !important; background: rgba(255, 246, 230, .16) !important; }
body.lab .tkm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: max(380px, calc(100vh - 300px)); overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 2px 6px 6px; scrollbar-gutter: stable; }
body.lab .tkm-tile { position: relative; display: grid; align-content: start; gap: 5px; margin: 0; padding: 5px; border-radius: 13px; font-weight: 400; cursor: pointer; transition: background .15s; }
body.lab .tkm-tile[hidden] { display: none; }
body.lab .tkm-tile:hover { background: var(--ds-glass-1); }
body.lab .tkm-input { position: absolute !important; top: 0; left: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0; opacity: 0; pointer-events: none; }
body.lab .tkm-frame { position: relative; display: grid; place-items: center; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #0b0a08; box-shadow: inset 0 0 0 1px var(--ds-stroke); transition: box-shadow .15s; }
body.lab .tkm-frame :is(video, img) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
body.lab .tkm-frame img:not([src]) { visibility: hidden; }
body.lab .tkm-frame .notice { padding: 6px; font-size: 10.5px; color: var(--ds-ink-3); text-align: center; }
body.lab .tkm-ph { color: var(--ds-ink-3); font-size: 22px; }
body.lab .tkm-tile.picked .tkm-frame { box-shadow: 0 0 0 2.5px var(--accent); }
body.lab .tkm-tile.picked .tkm-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 216, 77, .16), transparent 45%); pointer-events: none; }
body.lab .tkm-tile:has(.tkm-input:focus-visible) .tkm-frame { outline: 2px solid var(--accent); outline-offset: 3px; }
body.lab .tkm-tile:has(.tkm-input:disabled) { cursor: not-allowed; opacity: .6; }
body.lab .tkm-check { position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8); color: #fff; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.lab .tkm-tile:not(.picked):hover .tkm-check::before { content: "+"; font-size: 16px; line-height: 1; }
body.lab .tkm-tile.picked .tkm-check { background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); color: var(--ds-on-accent); }
body.lab .tkm-dur { position: absolute; left: 6px; bottom: 6px; z-index: 1; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
body.lab .tkm-zoom { position: absolute; right: 6px; bottom: 6px; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(0, 0, 0, .62) !important; color: #fff !important; cursor: zoom-in; opacity: 0; transition: opacity .15s; }
body.lab .tkm-zoom svg { width: 13px; height: 13px; fill: currentColor; }
body.lab .tkm-tile:hover .tkm-zoom, body.lab .tkm-zoom:focus-visible { opacity: 1; }
body.lab .tkm-zoom:hover, body.lab .tkm-zoom:focus-visible { background: var(--accent) !important; color: var(--ds-on-accent) !important; }
@media (hover: none) { body.lab .tkm-zoom { opacity: 1; } }
body.lab .tkm-tile > b { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ds-ink-2); font-size: 12px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
body.lab .tkm-tile.picked > b { color: var(--ds-ink); }
body.lab .tkm-tile > small { margin-top: -3px; color: var(--ds-ink-3); font-size: 11px; }
body.lab .tkm-none { margin: 0; color: var(--ds-ink-3); font-size: 13px; }
body.lab .tkm-none[hidden] { display: none; }

/* Full-size preview */
.tkm-view { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .78); }
.tkm-view[hidden] { display: none; }
.tkm-view-card { display: grid; gap: 10px; width: min(420px, 100%); max-height: 100%; padding: 14px; border-radius: 16px; background: var(--ds-glass-solid, #1E1A15); box-shadow: inset 0 0 0 1px var(--ds-stroke), var(--ds-shadow); color: var(--ds-ink, #F6F1E6); }
.tkm-view-card header, .tkm-view-card footer { display: flex; align-items: center; gap: 8px; }
.tkm-view-card header b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.tkm-view-card footer { justify-content: space-between; }
.tkm-view-card video { width: 100%; max-height: calc(100vh - 170px); aspect-ratio: 9 / 16; object-fit: contain; border-radius: 10px; background: #000; }

/* ---------- Right: what to make ---------- */
body.lab .tkc-details { display: grid; gap: 18px; min-width: 0; }
body.lab .tkc .tkc-card { display: grid; gap: 14px; margin: 0; padding: 22px; border-radius: var(--ds-r-lg, 20px); }
body.lab .tkc .tkc-card h2 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 16px; }
body.lab .tkc .tkc-card h2 small { color: var(--ds-ink-3); font-size: 12px; font-weight: 500; }
body.lab .tkc .tkc-card label { display: block; max-width: none; margin: 0; font-size: 13px; font-weight: 600; color: var(--ds-ink-2); }
body.lab .tkc .tkc-card label > :is(input:not([type=checkbox]), select, textarea) { display: block; margin-top: 7px; }
body.lab .tkc .tkc-card label small { color: var(--ds-ink-3); font-weight: 500; }
body.lab .tkc .tkc-card :is(input:not([type=checkbox]), select, textarea) { width: 100%; max-width: none; }
body.lab .tkc .tkc-card textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
body.lab .tkc .ticket-request-campaign select { min-height: 44px; }
body.lab .tkc .ticket-request-ask { display: grid; gap: 12px; padding-top: 4px; }
body.lab .tkc .ticket-request-ask > h2::before { display: none; }
body.lab .tkc .ticket-request-help, body.lab .tkc .tkc-card > small { margin-top: -6px; color: var(--ds-ink-3); font-size: 12px; }
body.lab .tkc-pair { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 12px; align-items: end; }
body.lab .tkc .ticket-request-references { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--ds-stroke); }
body.lab .tkc .ticket-request-references h3 { margin: 0; font-size: 14px; }
body.lab .tkc .ticket-request-references p { margin: -6px 0 0; color: var(--ds-ink-3); font-size: 12.5px; }
body.lab .tkc .ticket-request-references .ds-btn { justify-self: start; }
body.lab .tkc .ticket-request-voice { margin: 0; }
body.lab .tkc .ticket-request-scripts { display: grid; gap: 10px; }
body.lab .tkc .tkc-ref { display: block; color: var(--ds-ink); font-size: 13px; overflow-wrap: anywhere; }
body.lab .tkc .pl-handoff-main textarea { min-height: 200px; }
body.lab .tkc .pl-handoff-side .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.lab .tkc .pl-handoff-side label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 8px; }

/* ---------- Send bar: what is still missing, and the one button ---------- */
body.lab .tkc-foot { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 0; padding: 10px 10px 10px 20px; border-radius: 18px; background: var(--ds-glass-solid); box-shadow: inset 0 0 0 1px var(--ds-stroke), var(--ds-shadow); }
body.lab .tkc-ready { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--ds-ink-3); font-size: 13px; }
body.lab .tkc-ready li { display: inline-flex; align-items: center; gap: 7px; }
body.lab .tkc-ready li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ds-ink-4); }
body.lab .tkc-ready li.ok { color: var(--ds-ink); }
body.lab .tkc-ready li.ok::before { content: "✓"; display: grid; place-items: center; background: var(--ds-up); box-shadow: none; color: #0d1a12; font-size: 10px; font-weight: 900; }
body.lab .tkc-foot .ds-btn-primary { flex: none; }

@media (max-width: 1100px) {
  body.lab .tkc-grid { grid-template-columns: minmax(0, 1fr); }
  body.lab .tkm-grid { max-height: 460px; }
}
@media (max-width: 600px) {
  body.lab .tkc-head { flex-direction: column; gap: 10px; }
  body.lab .tkc-head h1 { font-size: 24px; }
  body.lab .tkm, body.lab .tkc .tkc-card { padding: 14px; }
  body.lab .tkm-tabs button { padding: 0 8px !important; font-size: 12px; }
  body.lab .tkm-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  body.lab .tkm-row { grid-template-columns: 18px 34px minmax(0, 1fr) 32px; }
  body.lab .tkm-row select { grid-column: 3; grid-row: 2; justify-self: start; }
  body.lab .tkm-row .tkm-x { grid-column: 4; grid-row: 1; }
  body.lab .tkc-pair { grid-template-columns: minmax(0, 1fr); }
  body.lab .tkc-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; }
  body.lab .tkc-ready { gap: 4px 12px; font-size: 12px; }
  body.lab .tkc-foot .ds-btn-primary { width: 100%; }
}
