/* recordings.css — meeting recording review surfaces.
 *
 * A file of its own rather than more of app.css. A meeting plays back from
 * independent camera, microphone and screen sources laid on one clock, and the
 * rules for that stage and timeline belong together.
 */

/* --- meeting recordings -------------------------------------------------- */

/* --- the player ----------------------------------------------------------
 *
 * A meeting plays back from its separate sources rather than from one baked
 * picture, so the layout here is the room's layout rather than a frame someone
 * rendered months ago: cameras in a strip, a shared screen on the stage. Same
 * idea as .meeting-strip / .meeting-stage in app.css, and named to rhyme with
 * them on purpose — a recording should read the way the meeting looked.
 */

.mrec-media {
    background: #06090c;
    border: 1px solid rgba(245, 245, 245, 0.12);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    /* A definite height, tied to the viewport, rather than letting the stage
       grow to its videos' intrinsic sizes. Unbounded, the stage alone filled a
       laptop screen and the play button, timeline and transcript all started
       below the fold — scrolling past the video to reach the scrubber, on the
       control everyone reaches for first. Capped, the whole player is one
       screen; the video shrinks, which is what object-fit is for. */
    height: clamp(280px, 56vh, 900px);
}

/* Cameras. With nothing shared they are the whole picture; when a screen goes
   up they shrink to a filmstrip above it, exactly as the room does. */
.mrec-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    /* Rows split the capped height instead of growing to their content, or a
       two-row grid would push right back past the stage's fixed height. */
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.mrec-media.is-presenting .mrec-strip {
    flex: 0 0 120px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 160px));
}

/* The stage. Hidden until something is actually being shared, so the ordinary
   case is not a large empty rectangle. */
.mrec-screen {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
}

.mrec-media.is-presenting .mrec-screen {
    display: block;
}

.mrec-tile {
    position: relative;
    background: #0a0f14;
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

.mrec-tile video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Nobody is dimmed (2026-10-08, by request: "when im watching back the
   recording it should be just like i was sitting in the meeting"). A tile is
   one person — all their capture rows — and it is simply not there before
   they joined or after they left, so the strip reflows as people come and go,
   the way the room's gallery did. */
.mrec-tile.is-absent {
    display: none;
}

.mrec-tile.is-screen {
    height: 100%;
}

/* A person's rows share their tile; only the one running is drawn. */
.mrec-tile .mrec-video {
    display: none;
}

.mrec-tile .mrec-video.is-current {
    display: block;
}

/* Camera off, as the room drew it: the room's own avatar (initials over the
   name — .meeting-tile-avatar in app.css) instead of a black or frozen frame. */
.mrec-tile.is-cam-off .mrec-video {
    visibility: hidden;
}

.mrec-tile.is-cam-off .meeting-tile-avatar {
    display: flex;
}

.mrec-media.is-presenting .mrec-strip .meeting-tile-initials {
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
}

.mrec-media.is-presenting .mrec-strip .meeting-tile-avatar-name {
    display: none;
}

/* Who is talking — playback only, the room itself never drew this. Inset, so
   the tile's own clipping can't cut it off. */
.mrec-tile.is-speaking {
    box-shadow: inset 0 0 0 3px #48BB78;
}

.mrec-tile-label,
.mrec-tile-mute {
    z-index: 1;
}

/* Full screen: the picture takes everything the play bar doesn't. */
.mrec-viewer:fullscreen {
    display: flex;
    flex-direction: column;
    background: #06090c;
    padding: 8px;
}

.mrec-viewer:fullscreen .mrec-media {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.mrec-viewer:fullscreen .mrec-controls {
    flex: 0 0 auto;
}

.mrec-tile-label {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(6, 9, 12, 0.72);
    color: rgba(245, 245, 245, 0.85);
    font-size: 0.7rem;
    pointer-events: none;
}

/* Per-source mute, bottom-right — the corner opposite the label, so neither
   ever covers the other. Chip-styled to rhyme with .mrec-tile-label, but this
   one is a button, so no pointer-events:none. Invisible until the tile is
   hovered (or the button focused), except when muted: a muted state must stay
   at least faintly visible at all times, or a silenced participant reads as a
   broken one. Being a child of the tile it inherits the idle dim for free,
   which is right — an idle source is not producing sound anyway, and a second
   opacity rule fighting .is-idle was the alternative rejected. */
.mrec-tile-mute {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    border: 0;
    border-radius: 4px;
    background: rgba(6, 9, 12, 0.72);
    color: rgba(245, 245, 245, 0.85);
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease;
}

/* Hover/focus outranks .is-muted below (three simple selectors to its two),
   so a muted chip still brightens fully under the pointer. */
.mrec-tile:hover .mrec-tile-mute,
.mrec-tile-mute:focus-visible {
    opacity: 1;
}

.mrec-tile-mute:focus-visible {
    outline: 2px solid #7fb0ff;
    outline-offset: 1px;
}

.mrec-tile-mute.is-muted {
    opacity: 0.6;
}

.mrec-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 4px;
}

/* Master volume, compact enough to sit in the controls bar next to the speed
   menu. A native range input under accent-color rather than a re-skinned
   track: the full -webkit-slider-thumb / -moz-range-thumb treatment is a page
   of prefixed CSS that lands where accent-color already does. */
.mrec-volume {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 10px 0 4px;
    color: rgba(245, 245, 245, 0.6);
}

.mrec-volume input[type="range"] {
    width: 100px;
    accent-color: #7fb0ff;
    cursor: pointer;
}

.mrec-time {
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: rgba(245, 245, 245, 0.75);
}

/* --- the timeline --------------------------------------------------------
 *
 * Editor-shaped and strictly read-only: one row per source, each clip drawn
 * where it actually ran. Somebody who joined late starts late; a screen share
 * is a clip whose extent you can see at a glance. Nothing here changes the
 * recording — only where you are looking at it.
 */

.mrec-timeline {
    padding: 4px 4px 12px;
}

/* One gutter width, declared once.
   The label column, the ruler, the lane overlay and the click mapping all have
   to agree about where the lanes begin. When that was four separate 120s, three
   of them were right and the playhead was measured against the full width — so
   clicking put the marker somewhere to the right of where you clicked, drifting
   further the closer to the end you went. */
.mrec-timeline {
    --mrec-gutter: 120px;
}

.mrec-ruler {
    position: relative;
    height: 18px;
    /* Left gutter matches the row labels so ticks line up with the lanes. */
    margin-left: var(--mrec-gutter);
    /* A seek surface like the lanes below — people aim at timestamps. Same
       drag rules as .mrec-tracks: no selection, no touch panning. */
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.mrec-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(245, 245, 245, 0.18);
}

.mrec-tick-label {
    position: absolute;
    left: 4px;
    top: 0;
    font-size: 0.66rem;
    color: rgba(245, 245, 245, 0.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mrec-tracks {
    position: relative;
    background: #10151a;
    border: 1px solid rgba(245, 245, 245, 0.12);
    border-radius: 6px;
    padding: 4px 0;
    cursor: pointer;
}

.mrec-tracks:focus-visible {
    outline: 2px solid #7fb0ff;
    outline-offset: 2px;
}

.mrec-row {
    display: flex;
    align-items: center;
    height: 26px;
}

.mrec-row-label {
    flex: 0 0 var(--mrec-gutter);
    padding: 0 8px;
    font-size: 0.72rem;
    color: rgba(245, 245, 245, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrec-row-lane {
    position: relative;
    flex: 1 1 auto;
    height: 100%;
}

.mrec-clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(30, 111, 235, 0.55), rgba(30, 111, 235, 0.3));
    border: 1px solid rgba(127, 176, 255, 0.45);
    min-width: 2px;
}

/* A screen share reads differently from a person, because when reviewing a
   client meeting it is usually the thing you are looking for. */
.mrec-clip.is-screen {
    background: linear-gradient(180deg, rgba(212, 175, 125, 0.55), rgba(212, 175, 125, 0.28));
    border-color: rgba(212, 175, 125, 0.6);
}

/* The lane region, as a box: everything to the right of the labels.
   Exists so the playhead has the same coordinate space the clips do, and so the
   click mapping has something real to measure instead of subtracting a constant
   from the container. Transparent and click-through — the seek handler stays on
   the track container beneath it. */
.mrec-lanes {
    position: absolute;
    left: var(--mrec-gutter);
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

/* Spans every row, since the whole point is that one instant is one instant
   across all of them. Positioned within the lane region, so a percentage here
   means the same thing it means on a clip. */
.mrec-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff5252;
    pointer-events: none;
}

/* "You were here" — where the previous look at this meeting left off, usually
   another perspective of the same call. Amber and dashed so it cannot be read
   as a second playhead, and clickable (unlike everything else in the lanes)
   because its entire purpose is the jump back. */
.mrec-lastmark {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed #d9b45f;
    pointer-events: auto;
    cursor: pointer;
    /* A widened hit area, since a 2px line is a miserable click target. */
    padding: 0 5px;
    margin-left: -5px;
}

.mrec-lastmark::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9b45f;
}

/* The timeline is a scrubber: draggable, not just clickable. Selection and
   touch scrolling are turned off so a drag scrubs instead of highlighting
   labels or panning the page. */
.mrec-tracks {
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

/* The playhead is in a span where nothing was being captured. Without this,
   an hour of dead air between two sittings plays as dimmed tiles and total
   silence — indistinguishable from the player being broken, and it was
   reported as exactly that. */
/* A removed section (2026-10-16). The files themselves are black and silent
   there; this says it was a decision. ::before, because ::after is the
   dead-air note's. */
.mrec-media.is-section-removed::before {
    content: "A section was removed from the recording here";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(6, 9, 12, 0.9);
    color: rgba(245, 245, 245, 0.85);
    font-size: 0.85rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
}

/* Its place on the timeline: a hatched band across every lane. */
.mrec-cut {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 2px;
    background: repeating-linear-gradient(135deg,
        rgba(120, 120, 120, 0.45) 0 4px, rgba(120, 120, 120, 0.15) 4px 8px);
    pointer-events: none;
}

/* And in the transcript, where the lines were. */
.mrec-line.mrec-line-cut .mrec-line-text {
    font-style: italic;
    opacity: 0.75;
}

.mrec-media.is-dead-air::after {
    content: "Nothing was being recorded at this moment — skip ahead to the next capture";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(6, 9, 12, 0.85);
    color: rgba(245, 245, 245, 0.75);
    font-size: 0.85rem;
    pointer-events: none;
    white-space: nowrap;
}

/* ::after needs a positioning context; the stage never had one because
   nothing floated over the whole stage before. */
.mrec-media { position: relative; }

/* A video sprinting to catch the clock after a seek — frames on screen the
   whole way, unlike the hard-seek loop this replaced, which showed a frozen
   frame while it re-decoded forever. Said quietly on the tile, because a
   picture visibly fast-forwarding for a couple of seconds invites "is it
   broken", and "catching up" is the honest answer. */
.mrec-tile.is-chasing::after {
    content: "» catching up";
    position: absolute;
    right: 6px;
    top: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(6, 9, 12, 0.72);
    color: rgba(245, 245, 245, 0.75);
    font-size: 0.66rem;
    pointer-events: none;
}

/* Playback holding for data instead of skipping over it. */
.mrec-buffering {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    color: #8b939d;
    font-size: 0.78rem;
}

/* --- Transcript ------------------------------------------------------------
   The whole transcript is on the page at once and playback moves through it,
   rather than one caption at a time. Reviewing a meeting is mostly scanning for
   the part worth listening to, and a single live caption forces you to scrub to
   read — which is the slowest possible way to find anything. */
.mrec-transcript {
    margin-top: 16px;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid rgba(245, 245, 245, 0.12);
    border-radius: 6px;
    background: #10151a;
    padding: 8px 0;
}

.mrec-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 5px 14px;
    cursor: pointer;
    /* Unspoken lines are legible, not hidden. They are the thing being scanned
       ahead for; dimming them to unreadable would defeat having them there. */
    color: rgba(245, 245, 245, 0.42);
    transition: color 120ms ease, background-color 120ms ease;
}

.mrec-line:hover {
    background: rgba(245, 245, 245, 0.05);
}

.mrec-line:focus-visible {
    outline: 2px solid #7fb0ff;
    outline-offset: -2px;
}

/* Already said: full contrast. The change between this and the state above is
   the only thing that has to read at a glance, which is why it is carried by
   brightness rather than by a marker somewhere in the row. */
.mrec-line.is-spoken {
    color: rgba(245, 245, 245, 0.92);
}

/* Being said right now. A left edge rather than a fill, so the line does not
   jump or reflow as playback moves — a transcript that twitches every few
   seconds is unreadable while it is doing it. */
.mrec-line.is-current {
    background: rgba(30, 111, 235, 0.14);
    box-shadow: inset 2px 0 0 #7fb0ff;
}

.mrec-line-time {
    flex: 0 0 auto;
    min-width: 46px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: rgba(245, 245, 245, 0.4);
}

.mrec-line-who {
    flex: 0 0 auto;
    min-width: 92px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrec-line-text {
    flex: 1 1 auto;
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 700px) {
    /* The speaker column is the first thing to go: on a narrow screen the words
       matter more than the alignment. */
    .mrec-line { flex-wrap: wrap; }
    .mrec-line-text { flex: 1 1 100%; }
}

/* --- the connection log (Meeting page → Connections) --------------------- */

/* Tab panels clip overflow, so each tab must scroll itself. */
.artifacts-connlog { height: 100%; box-sizing: border-box; padding: 8px 4px; overflow: auto; }
.connlog-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.connlog-table th { text-align: left; color: #8b939d; font-weight: 600; padding: 4px 8px; border-bottom: 1px solid rgba(245, 245, 245, 0.12); }
.connlog-table td { padding: 3px 8px; border-bottom: 1px solid rgba(245, 245, 245, 0.05); vertical-align: top; color: #d5dae0; }
.connlog-table tr.is-notable td { color: #f6c453; }
/* The door (2026-10-20): knocks, approvals and the people who gave up waiting
   read as one story down the log, so they share a colour of their own. */
.connlog-table tr.is-door td { color: #8fd3ff; }
.connlog-table tr.is-door .connlog-detail { color: #b9e3ff; }
.connlog-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.connlog-detail { word-break: break-word; color: #9aa3ad; }
