/* ==========================================================================
   Reel Studio kit, part 2 (media): Clips board, one shot's clip, Generate card, Cut editor, Post editor.
   Builds on system.css ("Graphite"): the same tokens, radii, type sizes (13/14/15/17/20/32) and its
   .btn / .pill / .segmented / .switch / .tip / .chip / .progress / .skeleton / .toast components.
   Every class here starts with rskm- so nothing in system.css or the core kit is overridden.
   New values (reasons in notes-media.md): the error colour (shared with the core kit's --danger),
   the video black, the stripe of a cut that has no clip, and the subtitle highlight yellow.
   ========================================================================== */
:root {
  --rskm-danger: var(--danger, #F28B82);   /* errors: failed generation, export or post (7:1 on the cards) */
  --rskm-black: #050608;                   /* behind video, so letterboxing reads as the film's own black */
  --rskm-gap-stripe: rgba(255, 255, 255, 0.045);
  --rskm-word: #FFE27A;                    /* the word being spoken in the "Bold words" subtitle look */
}

/* ---------- shared ---------- */
.rskm { position: relative; min-width: 0; color: var(--fg-2); font: 400 var(--t-15)/1.5 var(--font-sans); }
.rskm *, .rskm *::before, .rskm *::after { box-sizing: border-box; }
.rskm [hidden] { display: none !important; }
.rskm-mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
.rskm-dur { white-space: nowrap; }

.rskm-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); min-height: 40px; }
.rskm-head__titles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s-4); min-width: 0; }
.rskm-head__title { margin: 0; font-size: var(--t-20); font-weight: 600; line-height: 1.25; color: var(--fg-1); letter-spacing: -0.01em; }
.rskm-head__meta { margin: 0; font-size: var(--t-14); color: var(--fg-3); }
.rskm-head__meta b { color: var(--fg-1); font-weight: 600; }
.rskm-head__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-left: auto; }

.rskm-note { display: flex; align-items: flex-start; gap: var(--s-2); min-width: 0; margin: 0; font-size: var(--t-14); line-height: 1.45; color: var(--fg-2); }
.rskm-note > .i { flex: none; margin-top: 2px; width: 16px; height: 16px; color: var(--fg-3); }
.rskm-note.is-ok > .i { color: var(--success); }
.rskm-note.is-warn > .i { color: var(--warning); }
.rskm-note.is-bad > .i { color: var(--rskm-danger); }
.rskm-note > .i[aria-hidden]:first-child:has(use[href="#rskm-spinner"]) { animation: spin 0.9s linear infinite; }

/* glass surfaces: thin frost and the 1px rim that catches the light (the same recipe as .shot in system.css) */
.rskm-glass { position: relative; background: var(--glass-card); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-radius: var(--r-14); box-shadow: var(--shadow-card); }
.rskm-panel { position: relative; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--r-20); box-shadow: var(--rim-top), var(--shadow-card); }
.rskm-glass::after, .rskm-panel::after, .rskm-selbar::after, .rskm-pop::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.rskm-iconbtn { width: var(--h-36); padding: 0; }
.rskm-btn-cost { font-weight: 400; color: #fff; padding-left: 2px; font-variant-numeric: tabular-nums; }
.btn:not(.btn--primary) .rskm-btn-cost { color: var(--fg-2); }
.btn:disabled .rskm-btn-cost { color: inherit; }
.rskm-file { position: relative; overflow: hidden; }
.rskm-file input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.rskm-file:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled .i, .btn[disabled] .i { color: var(--fg-4); }
.btn:disabled .i:has(use[href="#rskm-spinner"]) { animation: spin 0.9s linear infinite; color: var(--fg-3); }

/* messages: in the page's top bar when there is one (the core shell), otherwise at the bottom of the screen */
/* without a shell, messages sit at the top right: the selection bar owns the bottom of the screen */
.rskm-toasts { position: fixed; right: 20px; top: 16px; z-index: 95; display: flex; justify-content: flex-end; max-width: calc(100vw - 40px); pointer-events: none; }
.rskm-toasts .toast { pointer-events: auto; box-shadow: var(--rim-top), var(--shadow-float); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.rskm-toast { max-width: min(560px, calc(100vw - 40px)); }
.rskm-toasts .rskm-toast { border-radius: var(--r-14); padding-top: 8px; padding-bottom: 8px; }
.rskm-toast.is-warn > .i { color: var(--warning); }
.rskm-toast.is-bad > .i { color: var(--rskm-danger); }

/* popovers and their small menus (the look of .menu) */
.rskm-pop { position: absolute; z-index: 80; min-width: 240px; max-width: 360px; padding: var(--s-4); border-radius: var(--r-14); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--rim-top), var(--shadow-float); animation: pop var(--t-med) var(--ease); }
.rskm-pop:has(.rskm-menu), .rskm-pop:has(.rskm-times) { padding: 6px; }
.rskm-pop__title { margin: 0 0 4px; font-size: var(--t-15); font-weight: 600; color: var(--fg-1); }
.rskm-pop__text { margin: 0 0 var(--s-3); font-size: var(--t-14); line-height: 1.5; color: var(--fg-2); }
.rskm-pop__group { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s-4); }
.rskm-pop__label { font-size: var(--t-13); color: var(--fg-3); }
.rskm-pop__actions { display: flex; justify-content: flex-end; gap: var(--s-2); }
.rskm-radio { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 7px 10px; border-radius: var(--r-10); cursor: pointer; font-size: var(--t-14); color: var(--fg-1); transition: background var(--t-fast) var(--ease); }
.rskm-radio:hover { background: var(--surface-3); }
.rskm-radio input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.rskm-radio small { display: block; font-size: var(--t-13); color: var(--fg-3); }
.rskm-menu { display: flex; flex-direction: column; gap: 2px; min-width: 228px; }
.rskm-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--h-36); padding: 8px 10px; border-radius: var(--r-10); color: var(--fg-1); font-size: var(--t-14); text-align: left; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.rskm-menu__item:hover, .rskm-menu__item:focus-visible, .rskm-menu__item:focus-within { background: var(--surface-4); outline: none; }
.rskm-menu__item .i { color: var(--fg-3); }

/* the picture of a shot with no clip and no image: an icon and a word */
.rskm-nopic { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-bottom: 22px; color: var(--fg-2); font-size: var(--t-13); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 10px, transparent 10px 20px), #16181D; }
.rskm-nopic .i { width: 26px; height: 26px; color: var(--fg-3); stroke-width: 1.5; }

/* ==========================================================================
   1. Clips board
   ========================================================================== */
.rskm-board { container: rskm-board / inline-size; display: flex; flex-direction: column; gap: var(--s-4); }
.rskm-board__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.rskm-board__bar .segmented button { font-size: var(--t-14); }
.rskm-board__bar .segmented .rskm-count { display: inline-block; min-width: 2ch; padding-left: 5px; color: var(--fg-3); font-variant-numeric: tabular-nums; text-align: left; }
.rskm-board__bar .segmented button[aria-pressed="true"] .rskm-count { color: var(--fg-2); }
.rskm-board__gen { margin-left: auto; }
.rskm-board__hint { margin: 0; font-size: var(--t-14); color: var(--fg-3); }
.rskm-board__hint b { color: var(--fg-2); font-weight: 500; }
/* slots are sized for their picture: four across in a 1,150 px page at 1440, more on wide screens */
.rskm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--slot-min, 264px), 1fr)); gap: var(--s-3); align-items: stretch; }
@container rskm-board (min-width: 1500px) { .rskm-grid { --slot-min: 300px; } }
@container rskm-board (max-width: 560px) { .rskm-grid { --slot-min: 168px; gap: var(--s-2); } .rskm-board__gen { margin-left: 0; } .rskm-board__hint { display: none; } .rskm-slot__reusetext { display: none; } .rskm-slot__reuseshort { display: inline; } }

.rskm-slot { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-14); transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.rskm-slot:hover { background: var(--glass-card-hover); }
.rskm-slot.is-selected { background: var(--glass-card-selected); box-shadow: 0 0 0 2px var(--accent), var(--shadow-card); }
.rskm-slot.is-drop { box-shadow: 0 0 0 2px var(--ring), var(--shadow-card); background: var(--glass-card-selected); }
.rskm-slot.is-flash { animation: rskm-flash 1.4s var(--ease); }
@keyframes rskm-flash { 0%, 45% { box-shadow: 0 0 0 2px var(--success), var(--shadow-card); } 100% { box-shadow: var(--shadow-card); } }

.rskm-slot__pic { position: relative; flex: none; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-14) var(--r-14) 0 0; background: #15171C; }
.rskm-slot.has-clip .rskm-slot__pic { cursor: pointer; }
.rskm-slot__pic > img, .rskm-slot__pic > video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.rskm-slot__pic > video { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.rskm-slot__pic.is-playing > video, .rskm-slot__pic.is-preview > video { opacity: 1; }
/* a shot without a clip keeps its picture grey and dark, so the shots that have one are the ones in colour */
.rskm-slot:not(.has-clip) .rskm-slot__pic > img { filter: grayscale(1) brightness(0.5) contrast(1.05); }
.rskm-slot__pic::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: linear-gradient(180deg, rgba(8, 9, 12, 0.35) 0%, rgba(8, 9, 12, 0) 28%, rgba(8, 9, 12, 0) 52%, rgba(8, 9, 12, 0.82) 100%); transition: opacity var(--t-fast) var(--ease); }
.rskm-slot__pic.is-playing::after { opacity: 0; }
/* the shot's number, and for a shot the cut uses more than once, how often (the core Shots board's "Plays 10 times") */
.rskm-slot__id { position: absolute; left: 13px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 84px); }
.rskm-slot__no { font: 600 var(--t-32)/1 var(--font-sans); letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6); }
.rskm-slot__reuse { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 8px; border-radius: var(--r-full); background: rgba(8, 9, 12, 0.78); color: #fff; font-size: var(--t-13); white-space: nowrap; cursor: help; }
.rskm-slot__reuse .i { color: rgba(255, 255, 255, 0.72); }
.rskm-slot__reuse:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.rskm-slot__reuseshort { display: none; }
.rskm-slot__len { position: absolute; right: 10px; bottom: 13px; z-index: 2; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: var(--r-full); background: rgba(8, 9, 12, 0.78); color: #fff; font-size: var(--t-13); white-space: nowrap; }
.rskm-slot__pic.is-playing .rskm-slot__id, .rskm-slot__pic.is-playing .rskm-slot__len { opacity: 0; }
.rskm-slot__check { position: absolute; top: 8px; left: 8px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(8, 9, 12, 0.7); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); color: transparent; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.rskm-slot__check:hover { background: rgba(8, 9, 12, 0.9); }
.rskm-slot__check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rskm-slot__check .i { width: 18px; height: 18px; stroke-width: 2.4; }
.rskm-slot.is-selected .rskm-slot__check { background: var(--accent); box-shadow: none; color: #fff; }
.rskm-slot__check:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.rskm-slot__play { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(8, 9, 12, 0.72); color: #fff; pointer-events: none; }
.rskm-slot__play .i { width: 16px; height: 16px; margin-left: 2px; }
.rskm-slot__pic.is-playing .rskm-slot__play .i { margin-left: 0; }
.rskm-slot__bar { position: absolute; left: 0; bottom: 0; z-index: 3; height: 3px; width: 0; background: #fff; opacity: 0; }
.rskm-slot__pic.is-playing .rskm-slot__bar { opacity: 0.9; }
.rskm-slot__busy { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.rskm-slot.is-busy .rskm-slot__pic > img { filter: grayscale(1) brightness(0.36) contrast(1.05); }
.rskm-slot.is-busy .rskm-nopic > * { visibility: hidden; }
.rskm-ring { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: rgba(8, 9, 12, 0.78); }
.rskm-ring svg { position: absolute; inset: 0; width: 52px; height: 52px; transform: rotate(-90deg); }
.rskm-ring circle { fill: none; stroke-width: 3; }
.rskm-ring .rskm-ring__track { stroke: rgba(255, 255, 255, 0.16); }
.rskm-ring .rskm-ring__fill { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 220ms linear; }
.rskm-ring__pct { position: relative; font: 500 var(--t-13)/1 var(--font-mono); color: #fff; letter-spacing: -0.02em; }
.rskm-ring > .i { position: relative; width: 20px; height: 20px; color: #fff; }
.rskm-ring > .i:has(use[href="#rskm-spinner"]) { animation: spin 0.9s linear infinite; }
.rskm-ring.is-bad > .i { color: var(--rskm-danger); }
.rskm-slot__drop { position: absolute; inset: 0; z-index: 4; display: none; place-items: center; padding: 12px; text-align: center; background: rgba(14, 20, 34, 0.88); color: #fff; font-size: var(--t-14); font-weight: 500; }
.rskm-slot.is-drop .rskm-slot__drop { display: grid; }

.rskm-slot__body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px 12px; }
.rskm-slot__action { margin: 0; font-size: var(--t-15); line-height: 1.42; color: var(--fg-1); }
.rskm-slot__prompt { margin: 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }
.rskm-slot__prompt .rskm-mono { color: var(--fg-2); }
.rskm-slot__state { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 22px; margin: 0; font-size: var(--t-13); line-height: 1.35; color: var(--fg-2); }
.rskm-slot__actions { margin-top: auto; padding-top: 4px; }
/* Every slot's parts line up with the slots beside it: the slots of a row share their row heights (subgrid), so the
   descriptions, the "No clip yet" / "Seedance 2.5 clip" lines and the first buttons sit at the same height across the row.
   A slot with less to say ends with a little room under its last button, never a hole in the middle. */
@supports (grid-template-rows: subgrid) {
  .rskm-grid { grid-auto-rows: auto; }
  .rskm-slot { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
  .rskm-slot__body { display: contents; }
  .rskm-slot__action { padding: 12px 14px 0; }
  .rskm-slot__prompt { padding: 5px 14px 0; }
  .rskm-slot__state { padding: 8px 14px 0; align-self: start; }
  .rskm-slot__actions { margin-top: 0; padding: 10px 14px 12px; align-self: start; }
}
.rskm-slot__state .i { flex: none; width: 16px; height: 16px; color: var(--fg-3); }
.rskm-slot__state.is-ok .i { color: var(--success); }
.rskm-slot__state.is-warn .i { color: var(--warning); }
.rskm-slot__state.is-bad .i { color: var(--rskm-danger); }
.rskm-slot__state.is-busy .i { animation: spin 0.9s linear infinite; color: var(--fg-1); }
.rskm-slot__statetext { min-width: 0; overflow-wrap: anywhere; }
.rskm-slot__actions { display: flex; flex-direction: column; gap: 6px; }
.rskm-slot__actions .btn { height: var(--h-32); padding: 0 12px; font-size: var(--t-13); }
.rskm-slot__stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.rskm-slot__stack .btn { width: 100%; }
.rskm-slot__row { display: flex; align-items: center; gap: 6px; }
.rskm-slot__row > .btn:not(.rskm-iconbtn) { flex: 1 1 auto; }
.rskm-slot__actions .rskm-iconbtn { width: var(--h-32); padding: 0; flex: none; }
.rskm-menu__cost { margin-left: auto; padding-left: var(--s-3); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.rskm-takes { display: inline-flex; align-items: center; gap: 2px; height: var(--h-32); padding: 0 2px; border-radius: var(--r-full); background: var(--surface-3); font-size: var(--t-13); color: var(--fg-1); }
.rskm-takes button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--fg-2); }
.rskm-takes button:hover { background: var(--surface-4); color: var(--fg-1); }
.rskm-takes button:disabled { color: var(--fg-4); background: none; cursor: not-allowed; }
.rskm-takes span { padding: 0 4px; white-space: nowrap; }

/* the selection bar: pinned to the bottom of the screen while the board is in view */
.rskm-selbar { position: sticky; bottom: 14px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: 8px 8px 8px 18px; border-radius: var(--r-full); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--rim-top), var(--shadow-float); animation: rskm-in var(--t-med) var(--ease); }
.rskm-selbar__text { flex: 1 1 220px; min-width: 0; margin: 0; font-size: var(--t-14); color: var(--fg-1); }
.rskm-selbar__text .rskm-mono { color: var(--fg-2); }
.rskm-selbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
@container rskm-board (max-width: 560px) { .rskm-selbar { border-radius: var(--r-20); padding: 10px; } }
@keyframes rskm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* the Generate card */
.rskm-card { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); min-width: 0; }
.rskm-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 32px; }
.rskm-card__title { margin: 0; font-size: var(--t-17); font-weight: 600; color: var(--fg-1); }
.rskm-card__sub { margin: 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }

/* ==========================================================================
   2. One shot's clip (inspector)
   ========================================================================== */
.rskm-shot { container: rskm-shot / inline-size; display: flex; flex-direction: column; gap: var(--s-3); }
.rskm-shot--framed { padding: var(--s-4); }
.rskm-shot__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px var(--s-3); }
.rskm-shot__title { margin: 0; font-size: var(--t-20); font-weight: 600; color: var(--fg-1); }
.rskm-shot__sub { font-size: var(--t-14); color: var(--fg-3); }
.rskm-shot__stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-14); background: var(--rskm-black); }
.rskm-shot__stage > video, .rskm-shot__stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.rskm-shot__stage.is-pic > img { object-fit: cover; filter: grayscale(1) brightness(0.5) contrast(1.05); }
.rskm-shot__stage.is-pic .rskm-nopic > * { visibility: hidden; }
.rskm-shot__drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-4); text-align: center; border-radius: inherit; border: 1.5px dashed var(--line-3); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 10px, transparent 10px 20px), #121419; color: var(--fg-2); font-size: var(--t-14); }
.rskm-shot__drop > .i { width: 26px; height: 26px; color: var(--fg-3); }
.rskm-shot__drop.is-over { border-color: var(--ring); background: rgba(46, 107, 240, 0.12); }
.rskm-shot__drop p { margin: 0; max-width: 34ch; line-height: 1.5; }
.rskm-shot__drop b { color: var(--fg-1); font-weight: 600; }
.rskm-shot__busy { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.rskm-shot__playbtn { position: absolute; inset: 0; display: grid; place-items: center; }
.rskm-shot__playbtn span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: rgba(8, 9, 12, 0.72); color: #fff; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.rskm-shot__playbtn:hover span { transform: scale(1.06); background: rgba(8, 9, 12, 0.88); }
.rskm-shot__playbtn .i { width: 22px; height: 22px; margin-left: 3px; }
.rskm-shot__playbtn.is-playing span { opacity: 0; }
.rskm-shot__playbtn.is-playing:hover span { opacity: 1; }
.rskm-shot__playbtn.is-playing .i { margin-left: 0; }
.rskm-shot__action { margin: 0; font-size: var(--t-17); line-height: 1.5; color: var(--fg-1); }
.rskm-shot__prompt { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-14); background: var(--well); border: 1px solid var(--line-1); font-size: var(--t-14); line-height: 1.65; color: var(--fg-2); }
.rskm-shot__takes { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rskm-take { position: relative; display: flex; flex-direction: column; gap: 4px; width: 150px; padding: 0; text-align: left; border-radius: var(--r-10); }
.rskm-take__img { position: relative; width: 150px; aspect-ratio: 16 / 9; border-radius: var(--r-10); overflow: hidden; background: #15171C; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-take__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rskm-take.is-on .rskm-take__img { box-shadow: 0 0 0 2px var(--accent); }
.rskm-take__label { font-size: var(--t-13); color: var(--fg-2); }
.rskm-take.is-on .rskm-take__label { color: var(--fg-1); }
.rskm-shot__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ==========================================================================
   3. Cut editor: player, subtitles, timeline
   ========================================================================== */
.rskm-cut { container: rskm-cut / inline-size; display: flex; flex-direction: column; gap: var(--s-4); }
/* stacked (a narrow box or a tall screen): the stage, then the timeline right under it, then the subtitles;
   side by side (is-side): the stage beside the subtitles, the timeline across the bottom. fit() picks and sizes. */
.rskm-cut__main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "player" "tl" "subs"; gap: var(--s-4); align-items: start; }
.rskm-cut__player { grid-area: player; min-width: 0; width: 100%; justify-self: center; }
.rskm-cut__subs { grid-area: subs; min-width: 0; }
.rskm-cut__tl { grid-area: tl; min-width: 0; }
.rskm-cut.is-side .rskm-cut__main { grid-template-areas: "player subs" "tl tl"; }
.rskm-cut__skel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@container rskm-cut (min-width: 900px) { .rskm-cut__skel { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); } }
.rskm-cut__progress { display: flex; align-items: center; gap: var(--s-3); }

.rskm-player { container: rskm-player / inline-size; display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.rskm-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-14); background: var(--rskm-black); box-shadow: inset 0 0 0 1px var(--line-1); container: rskm-stage / inline-size; user-select: none; }
.rskm-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; pointer-events: none; }
.rskm-stage > video.is-on { opacity: 1; }
.rskm-stage__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.rskm-stage__big { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; cursor: pointer; }
.rskm-stage__big span { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: rgba(8, 9, 12, 0.72); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.rskm-stage__big:hover span { transform: scale(1.06); background: rgba(8, 9, 12, 0.9); }
.rskm-stage__big .i { width: 26px; height: 26px; margin-left: 4px; }
.rskm-stage.is-playing .rskm-stage__big span { opacity: 0; }
.rskm-stage.is-playing .rskm-stage__big:hover span { opacity: 1; }
.rskm-stage.is-playing .rskm-stage__big .i { margin-left: 0; }
.rskm-stage__empty > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.26); }
.rskm-stage__empty > :not(img) { position: relative; z-index: 1; }
.rskm-stage__gap, .rskm-stage__empty { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-5); text-align: center; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 12px, transparent 12px 24px), #0F1115; }
/* the cards over the stage sit above its big play button, so their buttons take the click; a click anywhere else on
   them still reaches the play button (plays the cut, or plays it again after the end) */
.rskm-stage__gap, .rskm-stage__empty, .rskm-stage__end { z-index: 4; pointer-events: none; }
.rskm-stage__gap .btn, .rskm-stage__empty .btn, .rskm-stage__end .btn { pointer-events: auto; }
.rskm-stage__end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-5); text-align: center; }
.rskm-stage__endpic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) brightness(0.32) saturate(1.1); }
.rskm-stage__end > :not(img) { position: relative; z-index: 1; }
.rskm-stage__end:not(:has(> img)) { background: rgba(8, 9, 12, 0.85); }
.rskm-stage.is-ended .rskm-stage__big span { display: none; }
.rskm-stage__gap > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.3); }
.rskm-stage__gap > .rskm-nopic { opacity: 0.35; }
.rskm-stage__gap > :not(img):not(.rskm-nopic) { position: relative; z-index: 1; }
.rskm-stage__gaptitle { margin: 0; font-size: var(--t-20); font-weight: 600; color: var(--fg-1); }
.rskm-stage__gaptext { margin: 0; max-width: 46ch; font-size: var(--t-14); line-height: 1.5; color: var(--fg-2); }
.rskm-stage__gapacts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
@container rskm-stage (max-width: 420px) { .rskm-stage__gaptext { display: none; } .rskm-stage__gaptitle { font-size: var(--t-15); } }
.rskm-stage__label { position: absolute; left: 12px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-full); background: rgba(8, 9, 12, 0.76); color: #fff; font-size: var(--t-13); pointer-events: none; }

/* subtitles on the picture, sized with the picture (the stage is a size container) */
.rskm-subs { position: absolute; left: 7%; right: 7%; bottom: 7%; z-index: 2; display: flex; justify-content: center; pointer-events: none; text-align: center; }
.rskm-subs__line { display: inline; font-family: var(--font-sans); font-size: max(10px, 2.7cqw); line-height: 1.3; color: #fff; text-wrap: balance; }
.rskm-subs--clean .rskm-subs__line { font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.75); }
.rskm-subs--bold .rskm-subs__line { font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; font-size: max(11px, 3.6cqw); line-height: 1.15; paint-order: stroke fill; -webkit-text-stroke: max(1.5px, 0.36cqw) #000; }
.rskm-subs--bold .rskm-subs__w { color: rgba(255, 255, 255, 0.62); }
.rskm-subs--bold .rskm-subs__w.is-on { color: #fff; }
.rskm-subs--bold .rskm-subs__w.is-now { color: var(--rskm-word); display: inline-block; animation: rskm-pop 220ms var(--ease); }
@keyframes rskm-pop { from { transform: translateY(0.18em) scale(0.92); } to { transform: none; } }
.rskm-subs--boxed .rskm-subs__line { font-weight: 500; background: rgba(0, 0, 0, 0.8); padding: 0.34em 0.62em; border-radius: 0.26em; box-decoration-break: clone; -webkit-box-decoration-break: clone; line-height: 1.66; }

.rskm-transport { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); min-height: 40px; }
.rskm-transport__play { width: 40px; height: 40px; padding: 0; }
.rskm-transport__time { font: 500 var(--t-14)/1 var(--font-mono); color: var(--fg-1); white-space: nowrap; letter-spacing: -0.02em; }
.rskm-transport__time span { color: var(--fg-3); }
.rskm-transport__note { flex: 1 1 200px; min-width: 0; margin: 0; font-size: var(--t-13); line-height: 1.4; color: var(--fg-3); }
.rskm-transport__note b { color: var(--fg-2); font-weight: 500; }

/* subtitles panel */
.rskm-subed { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; padding: var(--s-4); }
.rskm-subed__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.rskm-subed__title { margin: 0; font-size: var(--t-17); font-weight: 600; color: var(--fg-1); }
.rskm-subed__empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); padding: var(--s-1) 0; }
.rskm-subed__empty p { margin: 0; font-size: var(--t-14); line-height: 1.5; color: var(--fg-2); }
.rskm-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); max-width: 480px; }
.rskm-preset { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 8px; border-radius: var(--r-10); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-1); text-align: center; transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.rskm-preset:hover { background: var(--surface-3); }
.rskm-preset[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--glass-card-selected); }
.rskm-preset__look { display: grid; place-items: end center; height: 46px; padding-bottom: 7px; border-radius: 7px; background: linear-gradient(180deg, #2A3142 0%, #151821 100%); overflow: hidden; }
.rskm-preset__look span { font-family: var(--font-sans); font-size: var(--t-14); line-height: 1.1; color: #fff; }
.rskm-preset__look.is-clean span { font-weight: 600; text-shadow: 0 1px 2px #000; }
.rskm-preset__look.is-bold span { font-weight: 700; text-transform: uppercase; -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; }
.rskm-preset__look.is-bold span i { font-style: normal; color: var(--rskm-word); }
.rskm-preset__look.is-boxed span { font-weight: 500; background: rgba(0, 0, 0, 0.8); padding: 2px 6px; border-radius: 3px; }
.rskm-preset__name { font-size: var(--t-13); color: var(--fg-1); }
.rskm-subed__source { margin: 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }
/* the lines are rows divided by a hairline (not cards inside the panel); the line under the playhead gets a blue bar */
.rskm-lines { display: flex; flex-direction: column; max-height: var(--lines-max, none); overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4); border-top: 1px solid var(--line-1); scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.rskm-line { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time del" "text text"; align-items: center; gap: 2px 8px; padding: 8px 2px 10px 12px; border-bottom: 1px solid var(--line-1); transition: background var(--t-fast) var(--ease); }
.rskm-line::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 12px; width: 3px; border-radius: 2px; background: transparent; transition: background var(--t-fast) var(--ease); }
.rskm-line.is-now::before { background: var(--accent); }
.rskm-line.is-now .rskm-line__time { color: var(--accent-fg); }
.rskm-line__time { grid-area: time; justify-self: start; min-height: 26px; padding: 2px 0; border: 0; background: none; text-align: left; font: 500 var(--t-13)/1.3 var(--font-mono); color: var(--fg-3); cursor: pointer; letter-spacing: -0.02em; }
.rskm-line__time:hover { color: var(--fg-1); }
.rskm-line__del { grid-area: del; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--fg-3); }
.rskm-line__del:hover { background: var(--surface-3); color: var(--fg-1); }
.rskm-line__text { grid-area: text; width: calc(100% + 6px); min-height: 26px; padding: 3px 6px; margin: 0 0 0 -6px; border: 1px solid transparent; border-radius: var(--r-6); background: transparent; color: var(--fg-1); font: 400 var(--t-14)/1.45 var(--font-sans); resize: none; overflow: hidden; outline: none; field-sizing: content; }
.rskm-line__text:hover { border-color: var(--line-2); }
.rskm-line__text:focus { border-color: var(--accent-line); background: var(--well); }
.rskm-subed__foot { display: flex; flex-wrap: wrap; gap: var(--s-2); }
/* the compact ruler of a subtitle editor that stands alone: the cut to scale, its clips, the lines, the playhead */
.rskm-sruler { display: flex; flex-direction: column; gap: 6px; }
.rskm-sruler__scale { position: relative; height: 18px; margin: 0 2px; }
.rskm-sruler__tick { position: absolute; top: 0; height: 18px; padding-left: 4px; border-left: 1px solid var(--line-2); font: 400 var(--t-13)/16px var(--font-mono); color: var(--fg-3); white-space: nowrap; letter-spacing: -0.02em; }

.rskm-sruler__track { position: relative; height: 48px; margin: 0 2px; border-radius: 8px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-1); cursor: pointer; touch-action: none; user-select: none; }
.rskm-sruler__cuts { position: absolute; left: 0; right: 0; top: 5px; height: 8px; }
.rskm-sruler__cut { position: absolute; top: 0; bottom: 0; border-radius: 2px; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.5); background: rgba(255, 255, 255, 0.07); }
.rskm-sruler__cut.has-clip { background: #8A97B0; }
.rskm-sruler__lines { position: absolute; left: 0; right: 0; top: 17px; bottom: 5px; }
.rskm-sruler__line { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; cursor: grab; }
.rskm-sruler__line::before { content: ""; position: absolute; inset: 0 1px; border-radius: 6px; background: #2A2F3B; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-sruler__line > span { position: relative; font: 500 var(--t-13)/1 var(--font-mono); color: var(--fg-1); pointer-events: none; }
.rskm-sruler__line.is-now::before { background: #2E3A57; box-shadow: inset 0 0 0 1px var(--accent-line); }
.rskm-sruler__line.is-drag { z-index: 2; cursor: grabbing; }
.rskm-sruler__line.is-drag::before { background: #34446A; box-shadow: inset 0 0 0 1.5px var(--accent); }
.rskm-sruler__head { position: absolute; top: -3px; bottom: -3px; left: 0; z-index: 3; width: 2px; margin-left: -1px; border-radius: 1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); pointer-events: none; }
.rskm-sruler__key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3); margin: 0 2px; font-size: var(--t-13); color: var(--fg-3); }
.rskm-sruler__key > span { display: inline-flex; align-items: center; gap: 6px; }
.rskm-sruler__sw { width: 16px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.rskm-sruler__sw.has-clip { background: #8A97B0; }
.rskm-sruler__sw.is-line { height: 12px; background: #2A2F3B; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-cut.is-tall .rskm-subed { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; grid-template-areas: "head head" "looks lines" "source lines" "foot lines"; align-items: start; column-gap: var(--s-5); }
.rskm-cut.is-tall .rskm-subed__head { grid-area: head; }
.rskm-cut.is-tall .rskm-presets { grid-area: looks; }
.rskm-cut.is-tall .rskm-subed__source { grid-area: source; }
.rskm-cut.is-tall .rskm-lines { grid-area: lines; }
.rskm-cut.is-tall .rskm-subed__foot { grid-area: foot; }

/* timeline */
.rskm-tl { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-3) var(--s-4) var(--s-4); }
.rskm-tl__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.rskm-tl__title { margin: 0; font-size: var(--t-15); font-weight: 600; color: var(--fg-1); }
.rskm-tl__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-4); font-size: var(--t-13); color: var(--fg-3); }
.rskm-tl__key { display: inline-flex; align-items: center; gap: 6px; }
.rskm-tl__swatch { width: 22px; height: 14px; border-radius: 3px; }
.rskm-tl__swatch.is-gap { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 3px, transparent 3px 6px), #1A1C22; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-tl__swatch.is-clip { background: linear-gradient(90deg, #6C7A92, #4A5468); }
.rskm-tl__zoom { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.rskm-overview { position: relative; height: 16px; border-radius: 5px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.rskm-overview__cell { position: absolute; top: 3px; bottom: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
.rskm-overview__cell.has-clip { background: #8A97B0; }
.rskm-overview__view { position: absolute; top: 0; bottom: 0; border-radius: 5px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.06); }
.rskm-overview__head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; }
.rskm-tl__scroll { position: relative; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; margin: 0 calc(var(--s-2) * -1); scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.rskm-tl__inner { position: relative; padding: 0 12px 8px; cursor: text; touch-action: pan-y; }
.rskm-ruler { position: relative; height: 24px; }
.rskm-ruler__tick { position: absolute; top: 4px; height: 20px; padding-left: 5px; border-left: 1px solid var(--line-2); font: 400 var(--t-13)/16px var(--font-mono); color: var(--fg-3); white-space: nowrap; letter-spacing: -0.02em; pointer-events: none; }
.rskm-ruler__tick.is-minor { height: 6px; top: 18px; padding: 0; }
/* the Cut editor makes the tracks taller when the screen has height to spare (bigger frames) */
.rskm-track { position: relative; height: var(--rskm-track-h, 64px); margin-top: 4px; }
.rskm-track--subs { height: var(--rskm-subtrack-h, 38px); margin-top: 6px; }
.rskm-cell { position: absolute; top: 0; bottom: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.rskm-cell::before { content: ""; position: absolute; inset: 0 1px; border-radius: 5px; background: var(--surface-3); transition: box-shadow var(--t-fast) var(--ease); }
.rskm-cell.is-gap::before { background: repeating-linear-gradient(135deg, var(--rskm-gap-stripe) 0 5px, transparent 5px 10px), #16181D; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-cell.is-part::before, .rskm-cell.is-part .rskm-cell__frames { left: 3px; }
.rskm-cell__frames { position: absolute; inset: 0 1px; display: flex; overflow: hidden; border-radius: 5px; }
.rskm-cell__frames img { -webkit-user-drag: none; user-select: none; flex: 1 0 auto; height: 100%; width: auto; min-width: 0; object-fit: cover; display: block; }
.rskm-cell__no { position: absolute; left: 3px; top: 5px; z-index: 1; display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 6px; background: rgba(8, 9, 12, 0.84); color: #fff; font: 500 var(--t-13)/1 var(--font-mono); letter-spacing: -0.02em; }
.rskm-cell.is-gap .rskm-cell__no { background: #23262E; color: var(--fg-2); }
/* a shot the cut uses more than once: "×10" on its first cut; its repeats drawn as an outline, the way the core kit draws a repeat in its cut strip ("Repeat of a shot") */
.rskm-cell__x { position: absolute; left: 3px; bottom: 5px; z-index: 1; display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(8, 9, 12, 0.84); color: #fff; font: 500 var(--t-13)/1 var(--font-mono); letter-spacing: -0.02em; pointer-events: none; }
.rskm-cell.is-gap .rskm-cell__x { background: #2C3039; color: var(--fg-1); }
.rskm-cell.is-repeat::before { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 5px, transparent 5px 10px), transparent; box-shadow: inset 0 0 0 1.5px var(--line-3); }
.rskm-cell.is-repeat .rskm-cell__frames { opacity: 0.5; outline: 1.5px solid var(--line-3); outline-offset: -1.5px; }
.rskm-cell.is-repeat .rskm-cell__no { background: transparent; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line-3); }
.rskm-tl__swatch.is-repeat { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-3); }
.rskm-cell.is-sel::before, .rskm-cell.is-sel .rskm-cell__frames { box-shadow: inset 0 0 0 2px var(--accent); }
.rskm-cell:hover::before { box-shadow: inset 0 0 0 1px var(--line-3); }
.rskm-cell.is-gap:hover::before { box-shadow: inset 0 0 0 1px var(--fg-4); }
.rskm-sub { position: absolute; top: 3px; bottom: 3px; padding: 0; border: 0; text-align: left; cursor: grab; touch-action: none; }
/* the line's two edges: drag one to change when the line starts or ends */
.rskm-sub__h { position: absolute; top: 0; bottom: 0; z-index: 1; width: 9px; cursor: ew-resize; }
.rskm-sub__h.is-l { left: 0; }
.rskm-sub__h.is-r { right: 0; }
.rskm-sub__h::after { content: ""; position: absolute; top: 28%; bottom: 28%; left: 4px; width: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.5); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.rskm-sub:hover .rskm-sub__h::after, .rskm-sub.is-drag .rskm-sub__h::after { opacity: 1; }
.rskm-sub.is-drag { z-index: 2; cursor: grabbing; }
.rskm-sub.is-drag::before { background: #34446A; box-shadow: inset 0 0 0 1.5px var(--accent); }
.rskm-sub::before { content: ""; position: absolute; inset: 0 1px; border-radius: 6px; background: #2A2F3B; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-sub.is-now::before { background: #2E3A57; box-shadow: inset 0 0 0 1px var(--accent-line); }
.rskm-sub__text { position: absolute; left: 9px; right: 7px; top: 50%; transform: translateY(-50%); font-size: var(--t-13); line-height: 1; color: var(--fg-1); white-space: nowrap; pointer-events: none; }
.rskm-track__empty { position: absolute; inset: 3px auto 3px 0; display: flex; align-items: center; gap: 8px; padding-left: 12px; border-radius: 6px; border: 1px dashed var(--line-2); font-size: var(--t-13); color: var(--fg-3); }
.rskm-track__empty .i { color: var(--fg-3); }
.rskm-head-line { position: absolute; top: 0; bottom: 0; z-index: 5; width: 0; pointer-events: none; }
.rskm-head-line::before { content: ""; position: absolute; top: 2px; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.rskm-head-line::after { content: ""; position: absolute; top: 0; left: -6px; width: 12px; height: 12px; border-radius: 3px 3px 6px 6px; background: #fff; }

/* ==========================================================================
   4. Post editor
   ========================================================================== */
.rskm-post { container: rskm-post / inline-size; display: flex; flex-direction: column; gap: var(--s-4); }
.rskm-post__grid { display: grid; gap: var(--s-5); align-items: start; grid-template-columns: minmax(0, 1fr); }
@container rskm-post (min-width: 700px) { .rskm-post__grid { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); } .rskm-post__side { grid-column: 2; } }
@container rskm-post (min-width: 1080px) { .rskm-post__grid { grid-template-columns: minmax(270px, 312px) minmax(0, 1fr) minmax(300px, 360px); } .rskm-post__side { grid-column: auto; } }
/* very wide: a bigger phone, the caption at a readable width, the whole thing centred instead of stretched */
@container rskm-post (min-width: 1700px) { .rskm-post__grid { grid-template-columns: minmax(380px, 440px) minmax(0, 1040px) minmax(380px, 440px); justify-content: center; } }
.rskm-post__phonecol { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); position: sticky; top: calc(var(--rsk-top, 0px) + 16px); }
@container rskm-post (max-width: 699px) { .rskm-post__phonecol { position: static; } }
.rskm-post__col { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.rskm-status { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--r-full); background: var(--surface-3); font-size: var(--t-13); font-weight: 500; color: var(--fg-1); white-space: nowrap; }
.rskm-status .i { width: 14px; height: 14px; color: var(--fg-3); }
.rskm-status .i:has(use[href="#rskm-spinner"]) { animation: spin 0.9s linear infinite; }
.rskm-status.is-ok { background: rgba(87, 211, 158, 0.14); }
.rskm-status.is-ok .i { color: var(--success); }
.rskm-status.is-sched { background: var(--accent-wash); }
.rskm-status.is-sched .i { color: var(--accent-fg); }

/* the phone */
.rskm-phone { position: relative; width: 100%; max-width: 312px; padding: 9px; border-radius: 38px; background: #1A1C21; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 60px -24px rgba(0, 0, 0, 0.8); }
@container rskm-post (min-width: 1700px) { .rskm-phone { max-width: 440px; } .rskm-phone__caption-note { max-width: 440px; } }
.rskm-phone__screen { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 30px; background: #000; }
.rskm-phone__top { position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; color: #fff; font-size: var(--t-17); font-weight: 600; pointer-events: none; }
.rskm-phone__top .i { width: 22px; height: 22px; }
.rskm-phone__video { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-58%); aspect-ratio: 16 / 9; }
.rskm-phone__video .rskm-stage { border-radius: 0; box-shadow: none; }
.rskm-phone__video .rskm-stage__big span { width: 52px; height: 52px; }
.rskm-phone__rail { position: absolute; right: 10px; bottom: 96px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 18px; color: #fff; pointer-events: none; }
.rskm-phone__rail .i { width: 24px; height: 24px; }
.rskm-phone__meta { position: absolute; left: 14px; right: 54px; bottom: 16px; z-index: 4; display: flex; flex-direction: column; gap: 6px; color: #fff; pointer-events: none; }
.rskm-phone__who { display: flex; align-items: center; gap: 8px; font-size: var(--t-13); font-weight: 600; }
.rskm-phone__avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #3A4252, #1E222B); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); display: grid; place-items: center; }
.rskm-phone__avatar .i { width: 15px; height: 15px; }
.rskm-phone__follow { padding: 3px 9px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7); font-weight: 600; }
.rskm-phone__ai { font-size: var(--t-13); color: #E8EAEE; }
.rskm-phone__cap { margin: 0; font-size: var(--t-13); line-height: 1.4; color: #fff; overflow-wrap: anywhere; }
.rskm-phone__cap span { color: #C8CDD6; }
.rskm-phone__audio { display: flex; align-items: center; gap: 6px; font-size: var(--t-13); color: #fff; }
.rskm-phone__audio .i { width: 14px; height: 14px; }
.rskm-phone__badge { position: absolute; left: 50%; top: 54px; z-index: 5; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-full); background: rgba(8, 9, 12, 0.84); color: #fff; font-size: var(--t-13); white-space: nowrap; pointer-events: none; }
.rskm-phone__caption-note { margin: 0; max-width: 312px; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); text-align: center; }
.rskm-skelphone { width: 100%; max-width: 312px; aspect-ratio: 9 / 17; min-height: 0; border-radius: 38px; }

/* caption options and the editor */
.rskm-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.rskm-opt { position: relative; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px 11px 40px; border-radius: var(--r-14); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line-1); text-align: left; cursor: pointer; transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.rskm-opt:hover:not(:disabled) { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-opt:disabled { cursor: default; }
.rskm-opt[aria-checked="true"] { background: var(--glass-card-selected); box-shadow: inset 0 0 0 2px var(--accent); }
.rskm-opt__dot { position: absolute; left: 13px; top: 13px; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fg-3); }
.rskm-opt[aria-checked="true"] .rskm-opt__dot { box-shadow: inset 0 0 0 5px var(--accent); background: #fff; }
.rskm-opt__label { font-size: var(--t-13); font-weight: 600; color: var(--fg-1); }
.rskm-opt__text { font-size: var(--t-14); line-height: 1.45; color: var(--fg-2); text-wrap: pretty; }
.rskm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rskm-field__label { font-size: var(--t-13); color: var(--fg-3); }
.rskm-captext { width: 100%; min-height: 150px; padding: 12px 14px; border-radius: var(--r-14); border: 1px solid var(--line-2); background: var(--well); color: var(--fg-1); font: 400 var(--t-15)/1.6 var(--font-sans); resize: vertical; outline: none; field-sizing: content; }
.rskm-captext::placeholder { color: var(--fg-3); }
.rskm-captext:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(46, 107, 240, 0.18); }
.rskm-captext[readonly] { color: var(--fg-2); border-style: dashed; }
.rskm-counts { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); font-size: var(--t-13); color: var(--fg-3); }
.rskm-counts b { font-weight: 500; color: var(--fg-1); }
.rskm-counts .is-bad, .rskm-counts .is-bad b { color: var(--rskm-danger); }
.rskm-writer { margin: 0; font-size: var(--t-13); color: var(--fg-3); }
.rskm-writer b { color: var(--fg-2); font-weight: 500; }
.rskm-skel { display: flex; flex-direction: column; gap: var(--s-2); }
.rskm-skel .skeleton { min-height: 84px; }

/* cover picker */
.rskm-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--s-2); }
.rskm-cover { position: relative; display: block; padding: 0; border-radius: var(--r-10); overflow: hidden; aspect-ratio: 16 / 9; background: #15171C; box-shadow: inset 0 0 0 1px var(--line-2); }
.rskm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-fast) var(--ease); }
.rskm-cover:hover:not(:disabled) img { transform: scale(1.04); }
.rskm-cover:disabled { cursor: default; }
.rskm-cover[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.rskm-cover[aria-checked="true"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--accent); }
.rskm-cover__t { position: absolute; left: 6px; bottom: 5px; z-index: 1; padding: 1px 6px; border-radius: 6px; background: rgba(8, 9, 12, 0.84); color: #fff; font: 500 var(--t-13)/1.35 var(--font-mono); letter-spacing: -0.02em; }

/* AI label, checks, when */
.rskm-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.rskm-row__label { font-size: var(--t-15); font-weight: 500; color: var(--fg-1); }
.rskm-row__hint { margin: 2px 0 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }
.rskm-row__hint.is-warn { color: var(--warning); }
.rskm-checks { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rskm-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-14); line-height: 1.45; color: var(--fg-2); }
.rskm-checks li .i { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--success); }
.rskm-checks li.is-warn .i { color: var(--warning); }
.rskm-checks li.is-bad .i { color: var(--rskm-danger); }
.rskm-checks li b { color: var(--fg-1); font-weight: 500; }
/* date and time side by side; the time drops under the date when the card is too narrow for "Tomorrow, 29 Nov" */
.rskm-when { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rskm-when > .rskm-field:first-child { flex: 1.45 1 176px; }
.rskm-when > .rskm-field:last-child { flex: 1 1 118px; }
.rskm-picker { display: flex; align-items: center; gap: 8px; width: 100%; height: var(--h-40); padding: 0 12px; border-radius: var(--r-10); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg-1); font-size: var(--t-15); text-align: left; cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.rskm-picker:hover { border-color: var(--line-3); background: var(--surface-3); }
.rskm-picker[aria-expanded="true"] { border-color: var(--accent-line); }
.rskm-picker .i { width: 16px; height: 16px; color: var(--fg-3); flex: none; }
.rskm-picker__value { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
input.rskm-picker { cursor: text; font-family: var(--font-mono); letter-spacing: -0.02em; outline: none; }
input.rskm-picker:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(46, 107, 240, 0.18); }
.rskm-timefield { position: relative; }
.rskm-timefield > .i { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; color: var(--fg-3); pointer-events: none; }
.rskm-timefield input { padding-left: 36px; }
.rskm-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.rskm-when__tz { font-size: var(--t-13); color: var(--fg-3); }
.rskm-when__err { font-size: var(--t-13); color: var(--rskm-danger); }
.rskm-when__err:empty { display: none; }
.rskm-post__buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rskm-post__buttons .btn--primary { flex: 1 1 auto; }
.rskm-ig { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }
.rskm-ig .i { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--fg-3); }
.rskm-ig.is-on .i { color: var(--success); }
.rskm-ig b { font-weight: 500; color: var(--fg-1); }
.rskm-done { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-14); background: rgba(46, 107, 240, 0.09); box-shadow: inset 0 0 0 1px var(--accent-line); }
.rskm-done.is-posted { background: rgba(87, 211, 158, 0.08); box-shadow: inset 0 0 0 1px rgba(87, 211, 158, 0.45); }
.rskm-done__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--t-17); font-weight: 600; color: var(--fg-1); }
.rskm-done__title .i { width: 20px; height: 20px; color: var(--accent-fg); }
.rskm-done.is-posted .rskm-done__title .i { color: var(--success); }
.rskm-done__when { margin: 0; font-size: var(--t-15); color: var(--fg-1); }
.rskm-done__sub { margin: 0; font-size: var(--t-13); line-height: 1.45; color: var(--fg-3); }
.rskm-done__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* calendar and time list */
.rskm-cal { display: flex; flex-direction: column; gap: var(--s-2); width: 280px; }
.rskm-cal__head { display: flex; align-items: center; justify-content: space-between; }
.rskm-cal__month { font-size: var(--t-15); font-weight: 600; color: var(--fg-1); }
.rskm-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.rskm-cal__dow { height: 26px; display: grid; place-items: center; font-size: var(--t-13); color: var(--fg-3); }
.rskm-cal__day { height: 34px; display: grid; place-items: center; border-radius: var(--r-10); font-size: var(--t-14); color: var(--fg-1); font-variant-numeric: tabular-nums; }
.rskm-cal__day:hover:not(:disabled) { background: var(--surface-4); }
.rskm-cal__day:disabled { color: var(--fg-4); cursor: not-allowed; }
.rskm-cal__day.is-today { box-shadow: inset 0 0 0 1px var(--line-3); }
.rskm-cal__day[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.rskm-times { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.rskm-times button { display: flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--r-10); font: 500 var(--t-14)/1 var(--font-mono); color: var(--fg-1); letter-spacing: -0.02em; }
.rskm-times button:hover:not(:disabled) { background: var(--surface-4); }
.rskm-times button[aria-selected="true"] { background: var(--accent); color: #fff; }
.rskm-times button:disabled { color: var(--fg-4); cursor: not-allowed; }

/* empty, loading and error states shared by the components */
/* 24 px inside the component's own 24 px padding: 48 px of air above the icon and under the last line, enough for a
   centred message; 32 px left the panel mostly empty (the audit's empty-box check, 123 px of 261) */
.rskm-state { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-6); text-align: center; }
/* loading cards are glass like the cards they stand in for */
.rskm .skeleton { -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.rskm-state__title { margin: 0; font: 400 var(--t-32)/1.1 var(--font-serif); color: var(--fg-1); letter-spacing: -0.01em; text-wrap: balance; }
.rskm-state__text { margin: 0; max-width: 52ch; font-size: var(--t-15); line-height: 1.55; color: var(--fg-2); }
.rskm-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-1); }
.rskm-state__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--fg-2); }
.rskm-state__icon .i { width: 22px; height: 22px; }
.rskm-state.is-bad .rskm-state__icon { color: var(--rskm-danger); }
.rskm-skelgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--s-3); }
.rskm-skelgrid .skeleton { min-height: 0; aspect-ratio: 236 / 200; }
@container rskm-board (max-width: 560px) { .rskm-skelgrid .skeleton:nth-child(n+3) { display: none; } }
/* a loading card shows a faint icon of what is coming, so it reads as a picture on its way, not an empty box */
.rskm-skelicon { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 34px; height: 34px; color: var(--fg-4); opacity: 0.6; }
.rskm-skelgrid .skeleton i:nth-of-type(1) { top: auto; bottom: 64px; width: 30%; }
.rskm-skelgrid .skeleton i:nth-of-type(2) { top: auto; bottom: 44px; width: 78%; }
.rskm-skelgrid .skeleton i:nth-of-type(3) { top: auto; bottom: 24px; width: 60%; }
.rskm-skelgrid .skeleton i:nth-of-type(4) { display: none; }

@media (prefers-reduced-motion: reduce) { .rskm-ring .rskm-ring__fill { transition: none; } .rskm-subs--bold .rskm-subs__w.is-now { animation: none; } .rskm-slot.is-flash { animation: none; } }
