/* Recording controls, replay viewer and compact waiting-room preferences. */
.neurospy-waiting-preferences { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.neurospy-waiting-preferences :is(.neurospy-recording-preference,.neurospy-hat-preference) { display: block; margin: 0; }
.neurospy-recording-preference { color: var(--text-main); }
.neurospy-recording-preference.hidden { display: none; }
.neurospy-waiting-preferences :is(.neurospy-recording-preference,.neurospy-hat-preference) label { display: flex; align-items: center; gap: 6px; min-height: 24px; font-size: 12px; }
.neurospy-waiting-preferences input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent-color); }
.neurospy-waiting-preferences .neurospy-preference-hint { display: none; }
.neurospy-control-panel:not(.is-participant) .neurospy-main-actions { margin-top: 8px; }
.neurospy-control-panel:not(.is-participant) .neurospy-main-actions .primary { min-height: 36px; padding: 7px 12px; }
.neurospy-control-panel:not(.is-participant) .neurospy-control-actions { gap: 6px; margin-top: 8px; }
.neurospy-control-panel:not(.is-participant) .neurospy-control-actions>button { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.neurospy-control-panel:not(.is-participant) .neurospy-control-actions>.neurospy-compact-icon:not(.hidden) { display: inline-grid; place-items: center; width: 34px; min-width: 34px; padding: 6px; }
.neurospy-compact-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media(min-height:600px) {
  .neurospy-side-column:has(#nsRecordingPreference:not(.hidden)) { grid-template-rows: max-content minmax(0,1fr); }
}
.neurospy-discovery-card.recordings { background: var(--bg-modal); }
.neurospy-discovery-card.recordings svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
#nsRecordingsModal { z-index: 660; }
.ns-recordings-card { display: flex; flex-direction: column; width: min(900px,100%); height: min(760px,calc(100dvh - 40px)); min-height: 0; color: var(--text-main); }
.ns-recordings-card .modal-head { flex: 0 0 auto; }
.ns-recordings-tools { display: flex; gap: 12px; padding: 12px 18px; align-items: center; }
.ns-recordings-tools nav { display: flex; gap: 5px; flex-shrink: 0; }
.ns-recordings-tools button,.ns-recordings-footer button { color: var(--text-main); font-size: 13px; }
.ns-recordings-tools button[aria-pressed="true"] { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.ns-recordings-tools input { min-width: 0; background: var(--bg-input); color: var(--text-main); border-color: var(--border-color); font-size: 14px; }
.ns-recordings-tools input::placeholder { color: var(--text-muted); }
.ns-recordings-list { flex: 1; min-height: 0; overflow: auto; padding: 0 18px; scrollbar-gutter: stable; overflow-anchor: none; }
.ns-record-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.ns-record-info { min-width: 0; display: grid; gap: 7px; }
.ns-record-title { text-align: left; width: fit-content; max-width: 100%; color: var(--text-main); background: none; border: 0; padding: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.ns-record-title:hover { color: var(--accent-color); }
.ns-record-info small { color: var(--text-muted); font-size: 12px; }
.ns-record-people { display: flex; gap: 4px; flex-wrap: wrap; }
.ns-record-person { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-size: 11px; color: var(--text-main); }
.ns-record-avatar { display: block; flex: 0 0 25px; width: 25px; height: 25px; }
.ns-record-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.ns-record-icon { display: inline-grid; place-items: center; width: 35px; height: 35px; padding: 7px; border: 1px solid var(--border-color); border-radius: 5px; background: transparent; color: var(--text-main); text-decoration: none; }
.ns-record-icon svg,.ns-replay-controls svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ns-record-icon[aria-pressed="true"] { color: #ffce65; background: #473a25; }
.ns-record-empty { max-width: 50ch; margin: 55px auto; color: var(--text-muted); text-align: center; font-size: 14px; line-height: 1.6; }
.ns-recordings-footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px 4px; color: var(--text-main); font-size: 13px; }
.ns-record-import { position: relative; cursor: pointer; color: var(--text-main); padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 5px; }
.ns-record-import input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ns-record-import:focus-within { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.ns-record-more { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0; color: #c9c3df; font-size: 13px; }
.ns-record-more:empty { display: none; }
.ns-recordings-note { margin: 8px 18px 14px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
#nsReplayModal { z-index: 670; padding: 0; background: #101014; backdrop-filter: none; }
.ns-replay-shell { position: relative; width: 100%; height: 100%; overflow: hidden; color: #f3f4fa; background: #242429; }
.ns-replay-stage { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }
.ns-replay-background { position: absolute; inset: 0; background: #282015 center/cover no-repeat; }
.ns-replay-shell .neurospy-game-character.ai-inspectable { pointer-events: auto !important; cursor: pointer !important; }
.ns-replay-hud { position: absolute; z-index: 176; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(720px,calc(100% - 24px)); pointer-events: none; }
#nsReplayPhaseBar { max-width: 100%; min-height: 54px; flex-wrap: nowrap; gap: 12px; padding: 8px 12px; }
#nsReplayPhaseBar.hidden { display: none; }
#nsReplaySecret { min-width: 0; max-width: 540px; min-height: 36px; padding: 7px 30px 7px 12px; color: #eef8ff; background: #245876; border-color: #6b99b7; font-size: 16px; font-weight: 700; pointer-events: auto; }
#nsReplaySecret.expanded { max-width: 540px; white-space: pre-line; }
#nsReplayTurnCounter { flex: 0 0 auto; color: #f5f7fb; font-size: 16px; font-variant-numeric: tabular-nums; }
#nsReplayNotice { max-height: min(35dvh,240px); overflow: auto; pointer-events: auto; }
.ns-replay-hud>.neurospy-victory-panel { position: relative; top: auto; left: auto; transform: none; }
#nsReplayVoteHistory { z-index: 175; top: 10px; right: 10px; }
#nsReplayVoteHistory:not(.is-expanded) { width: max-content; }
#nsReplayBubble .speech-text { max-height: none; overflow: visible; }
#nsReplaySideReactions { z-index: 144; top: auto; bottom: max(108px, 16%); width: min(220px, 52vw); }
.ns-replay-stage :is(.neurospy-player-reaction, .neurospy-side-reaction) { animation-play-state: paused; }
.ns-replay-chat { position: absolute; z-index: 150; top: 8px; left: 8px; width: min(350px,38%); height: calc(100% - 120px); min-width: min(240px,calc(100% - 16px)); min-height: 130px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); display: flex; flex-direction: column; resize: both; overflow: hidden; color: #f1f3f7; background: #26272bf5; border: 2px solid #484b53; border-radius: 7px; box-shadow: var(--shadow); }
.ns-replay-chat.hidden { display: none; }
.ns-replay-chat>header { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-bottom: 1px solid #484b53; cursor: move; touch-action: none; user-select: none; }
.ns-replay-chat>header>span { color: #c0c3ce; font-size: 18px; }
.ns-replay-chat>header>strong { color: #f1f3f7; font-size: 13px; }
.ns-replay-chat>header>button { margin-left: auto; padding: 0 4px; color: #c5c9d5; background: transparent; border: 0; font-size: 22px; }
#nsReplayChatMessages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; scrollbar-gutter: stable; }
.ns-replay-thought { margin: 8px 0; padding: 8px; background: #343148; font-size: 12px; }
.ns-replay-thought p { white-space: pre-wrap; line-height: 1.5; }
.ns-replay-options { position: absolute; z-index: 220; top: 12px; right: 12px; bottom: 120px; width: min(340px,46%); padding: 16px; overflow: auto; background: #242429; border-radius: 8px; box-shadow: 0 10px 24px #0005; }
.ns-replay-options label { display: grid; gap: 5px; color: #f1f0f7; font-size: 13px; margin-bottom: 13px; }
.ns-replay-options label.ns-replay-check { display: flex; gap: 8px; align-items: center; }
.ns-replay-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: #8180ff; margin: 0; }
.ns-replay-options select,.ns-replay-options input[type="text"] { width: 100%; color: #f1f0f7; background: #16161a; padding: 7px; border: 1px solid #50505c; border-radius: 5px; font-size: 12px; }
.ns-replay-options small { display: block; color: #bfc0ce; font-size: 11px; line-height: 1.5; margin-bottom: 12px; }
.ns-replay-voices-dialog { top: calc((100% - 100px)/2); right: auto; bottom: auto; left: 50%; transform: translate(-50%,-50%); width: min(760px,calc(100% - 32px)); max-height: calc(100% - 130px); }
.ns-replay-voices-dialog>header { position: sticky; z-index: 1; top: -16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; color: #f3f4fa; background: #242429; font-size: 16px; }
.ns-replay-voices-dialog>header button { color: #f3f4fa; padding: 3px 9px; font-size: 22px; }
.ns-replay-voice-row { display: grid; grid-template-columns: minmax(120px,1fr) minmax(130px,1fr) minmax(180px,2fr); gap: 8px 12px; padding: 12px 0; border-top: 1px solid #484850; }
.ns-replay-voice-name { display: flex; min-width: 0; align-items: center; gap: 8px; font-size: 14px; }
.ns-replay-voice-row label { min-width: 0; margin: 0; font-size: 11px; }
.ns-replay-voice-row>label.hidden { display: none; }
#nsReplayInspector header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
#nsReplayInspector header button { color: #f3f4fa; }
#nsReplayInspectorContent { font-size: 13px; line-height: 1.55; }
#nsReplayInspectorContent .ns-replay-thought { margin-top: 15px; padding: 10px; border-radius: 5px; }
.ns-replay-controls { position: absolute; z-index: 210; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(860px,calc(100% - 32px)); display: grid; gap: 6px; padding: 8px; color: #f3f4fa; background: #242429f5; border: 1px solid #66616b; border-radius: 12px; box-shadow: 0 8px 25px #0006; }
.ns-replay-transport,.ns-replay-secondary { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ns-replay-secondary { flex-wrap: wrap; }
.ns-replay-controls button { display: inline-grid; flex: 0 0 auto; min-width: 34px; height: 32px; padding: 6px 8px; place-items: center; color: #f3f4fa; font-size: 12px; white-space: nowrap; }
.ns-replay-controls button[aria-pressed="true"],.ns-replay-controls button[aria-expanded="true"]:not(#nsReplayCollapse) { background: #5553bb; }
#nsReplayControls.collapsed { width: auto; padding: 0; gap: 0; border: 0; border-radius: 7px; box-shadow: none; background: transparent; }
.ns-replay-controls.collapsed .ns-replay-secondary,
.ns-replay-controls.collapsed .ns-replay-status,
.ns-replay-controls.collapsed .ns-replay-transport>:not(#nsReplayCollapse) { display: none; }
.ns-replay-controls.collapsed #nsReplayCollapse { width: 38px; height: 30px; border-color: #66616b; border-radius: 7px; background: #242429ee; }
.ns-replay-controls.collapsed #nsReplayCollapse svg { rotate: 180deg; }
.ns-replay-controls button:disabled { opacity: .35; cursor: default; }
.ns-replay-controls input[type="range"] { flex: 1; width: 0; min-width: 30px; height: 28px; padding: 0; accent-color: #a7a0ff; background: transparent; border: 0; box-shadow: none; }
.ns-replay-controls select { color: #f3f4fa; background: #34343d; border: 1px solid #555560; border-radius: 5px; padding: 6px 3px; font-size: 12px; }
.ns-replay-secondary>strong { flex: 1; min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
#nsReplayPhase { max-width: 150px; max-height: 30px; overflow: auto; color: #d8d9e5; font-size: 11px; line-height: 1.25; }
.ns-replay-secondary label { display: flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.ns-replay-secondary input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #a7a0ff; }
#nsReplayClose { margin-left: auto; }
#nsReplayTime { font-size: 11px; color: #c9cad7; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-replay-status { color: #e1d2b5; font-size: 11px; line-height: 1.4; }
.ns-replay-status:empty { display: none; }
:is(#nsRecordingsModal,#nsReplayModal) :is(button,a,input,select,summary):focus-visible { outline: 2px solid #bcb4ff; outline-offset: 2px; }
:is(#nsRecordingsModal,#nsReplayModal) ::selection { color: #fff; background: #6a59ac; }
@media(max-width:650px) {
  .ns-recordings-tools { flex-wrap: wrap; gap: 8px; }
  .ns-recordings-tools input[type="search"] { flex-basis: 100%; }
  .ns-record-row { align-items: flex-start; gap: 7px; }
  .ns-record-actions { width: 74px; flex-wrap: wrap; justify-content: flex-end; }
  .ns-record-info small { font-size: 11px; line-height: 1.5; }
  .ns-replay-secondary>strong { display: none; }
  .ns-replay-secondary { gap: 5px; }
  #nsReplayPhase { max-width: 75px; font-size: 10px; }
  #nsReplayTime { display: none; }
  .ns-replay-voice-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .ns-replay-voice-row label:last-child { grid-column: 1/-1; }
}
@media(orientation:landscape) and (max-height:550px) {
  #nsRecordingsModal { padding: 6px; }
  .ns-recordings-card { height: calc(100dvh - 12px); }
  .ns-recordings-card .modal-head { padding: 8px 12px; font-size: 14px; }
  .ns-recordings-card .modal-close { width: 28px; height: 28px; }
  .ns-recordings-tools { padding: 7px 12px; gap: 9px; flex-wrap: nowrap; }
  .ns-recordings-tools input[type="search"] { flex-basis: auto; padding: 7px 9px; }
  .ns-recordings-tools button { padding: 7px 9px; font-size: 12px; }
  .ns-recordings-list { padding: 0 12px; }
  .ns-record-row { padding: 10px 0; align-items: center; }
  .ns-record-title { font-size: 14px; }
  .ns-record-actions { width: auto; flex-wrap: nowrap; }
  .ns-recordings-footer { padding: 6px 12px 0; }
  .ns-recordings-note { margin: 4px 12px 6px; font-size: 10px; }
  .ns-replay-controls { width: min(680px,calc(100% - 16px)); bottom: 6px; gap: 5px; padding: 6px; }
  .ns-replay-transport,.ns-replay-secondary { gap: 5px; }
  .ns-replay-controls button { min-width: 29px; height: 29px; padding: 5px 6px; font-size: 11px; }
  .ns-replay-controls select { padding: 4px 2px; }
  .ns-replay-secondary>strong { max-width: 100px; font-size: 10px; }
  .ns-replay-secondary label { font-size: 11px; }
  #nsReplayPhase { max-width: 90px; font-size: 10px; }
  #nsReplayTime { display: none; }
  .ns-replay-options { bottom: 95px; }
  .ns-replay-voices-dialog { bottom: auto; max-height: calc(100% - 105px); padding: 12px; }
  .ns-replay-voices-dialog>header { top: -12px; font-size: 14px; }
  .ns-replay-voice-row { padding: 8px 0; }
}

@media(max-width:700px) {
  .ns-replay-voice-name { grid-column: 1/-1; }
}
@media(max-width:950px), (max-height:560px) {
  #nsReplayVoteHistory { top: 64px; }
  #nsReplayVoteList { max-height: clamp(64px, calc(100dvh - 165px), 42dvh); }
}
@media(orientation:landscape) and (max-height:560px) {
  .ns-replay-controls { width: min(420px,calc(100% - 16px)); }
  .ns-replay-secondary>strong,.ns-replay-secondary label:has(#nsReplaySpectators) { display: none; }
  .ns-replay-hud { top: 6px; gap: 5px; width: min(560px,calc(100% - 16px)); }
  #nsReplayPhaseBar { min-height: 42px; gap: 9px; padding: 5px 8px; }
  #nsReplaySecret { min-height: 30px; font-size: 14px; padding: 5px 27px 5px 9px; }
  #nsReplayTurnCounter { font-size: 13px; }
  #nsReplayNotice { width: 100%; padding: 7px 10px; }
  #nsReplayNotice>strong { font-size: 13px; }
  #nsReplayNotice>p { font-size: 11px; }
  .ns-replay-chat { width: 42%; height: calc(100% - 100px); }
  .ns-replay-chat>header { min-height: 26px; }
  .ns-replay-voice-row { grid-template-columns: minmax(115px,1fr) minmax(115px,1fr) minmax(160px,2fr); gap: 8px; }
}

/* Replay and archive share the lobby's violet-blue controls. */
:is(#nsRecordingsModal,#nsReplayModal) { --replay-accent:#746ce0; --replay-button:#323247; --replay-line:#7770bc; }
:is(#nsRecordingsModal,#nsReplayModal) :is(button,.ns-record-icon,.ns-record-import) { color:#f5f3ff; background:var(--replay-button); border:1px solid var(--replay-line); border-radius:8px; }
:is(#nsRecordingsModal,#nsReplayModal) :is(button,.ns-record-icon,.ns-record-import):hover { color:#fff; background:#484568; border-color:#aaa1ef; }
:is(#nsRecordingsModal,#nsReplayModal) :is(.primary,[aria-pressed="true"],button[aria-expanded="true"]):not(#nsReplayCollapse) { color:#fff; background:#635bd1; border-color:#ada4ff; }
:is(#nsRecordingsModal,#nsReplayModal) :is(input,select) { color:#f5f3ff; background:#19191f; border-color:#53515f; }
:is(#nsRecordingsModal,#nsReplayModal) input::placeholder { color:#b4b0c1; }
.ns-recordings-tools { flex-wrap:wrap; gap:8px; padding:12px 18px; }
.ns-recordings-tools input[type="search"] { flex:1 1 180px; width:200px; padding:9px 11px; }
.ns-recordings-tools select { flex:1 1 135px; min-width:0; width:auto; padding:9px 10px; font-size:13px; border-radius:7px; }
.ns-recordings-tools .ns-record-favorite { display:flex; flex:0 0 auto; align-items:center; gap:7px; color:#e6e1fb; font-size:13px; white-space:nowrap; }
.ns-record-favorite input,.ns-replay-check input { width:15px; height:15px; margin:0; accent-color:#9386f4; }
.ns-record-row { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; padding:10px 14px; margin:0 0 8px; border:1px solid #4e4b61; border-radius:12px; background:#1d1d25; }
.ns-record-row.is-favorite { border-color:#b59147; background:#28251f; }
.ns-record-heading { display:flex; align-items:baseline; justify-content:space-between; gap:4px 16px; flex-wrap:wrap; }
.ns-record-heading time { flex-shrink:0; color:#c1bbcf; font-size:12px; font-variant-numeric:tabular-nums; }
.ns-record-title { border:0!important; background:none!important; padding:0!important; color:#f8f5ff!important; font-size:15px; line-height:1.4; }
.ns-record-info { gap:4px; }
.ns-record-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 14px; color:#c1bbcf; font-size:12px; line-height:1.4; }
.ns-record-secret { margin:0; color:#d9d2ff; font-size:12px; font-weight:600; white-space:pre-line; }
.ns-record-cast { display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; }
.ns-record-people { flex:1 1 350px; min-width:0; gap:2px 8px; }
.ns-record-host { display:flex; flex:0 1 auto; max-width:100%; align-items:center; gap:6px; color:#c1bbcf; font-size:12px; }
.ns-record-host strong { color:#eee9fb; font-weight:600; }
.ns-record-actions { display:flex; width:auto; gap:6px; flex-wrap:wrap; justify-content:flex-start; }
.ns-record-icon { width:32px; height:32px; padding:6px; }
.ns-record-icon.ns-record-watch { display:inline-flex; width:auto; gap:6px; padding:6px 10px; background:#4a4379!important; font-size:12px; font-weight:600; }
#nsRecordingsModal .ns-record-icon[aria-pressed="true"] { color:#ffda7b; background:#554325; border-color:#caa355; }
#nsRecordingsModal .ns-record-icon[aria-pressed="true"] svg { fill:currentColor; }
.ns-record-person { min-width:0; max-width:100%; margin-right:0; font-size:12px; color:#e3dff0; }
.ns-record-avatar { width:24px; height:24px; flex-basis:24px; }
.ns-replay-controls { width:min(980px,calc(100% - 24px)); color:#f3efff; background:#252532f5; border-color:#8177bb; border-radius:12px; }
.ns-replay-controls button { min-width:34px; height:34px; padding:6px 8px; }
.ns-replay-controls select { max-width:180px; border-radius:7px; padding:7px 8px; }
#nsReplayTime { display:inline; min-width:102px; color:#e7e2fa; font-size:12px; font-variant-numeric:tabular-nums; }
#nsReplayView { margin-left:auto; }
#nsReplayLocal { max-width:145px; }
#nsReplayLocal.hidden { display:none; }
.ns-replay-secondary>strong { max-width:170px; color:#ded7f5; }
#nsReplayPhase { display:none; }
.ns-replay-check { display:flex; align-items:center; gap:5px; margin-left:auto; color:#c8c1d8; font-size:11px; }
.ns-replay-chat>header>button { margin-left:0; }
body.ns-replay-open #soundPanel { z-index:700; }
.ns-record-info :is(.ns-record-secret,.ns-record-host,.ns-record-person) { overflow-wrap:anywhere; }
@media(orientation:landscape) and (max-height:560px) {
  .ns-recordings-tools { gap:6px; flex-wrap:wrap; padding:7px 12px; }
  .ns-recordings-tools input[type="search"] { flex:1 1 140px; padding:7px 9px; }
  .ns-recordings-tools select { flex:1 1 110px; padding:7px 8px; font-size:12px; }
  .ns-record-row { gap:6px; padding:8px 10px; margin-bottom:8px; }
  .ns-record-title { font-size:15px; }
  .ns-record-secret { font-size:12px; }
  .ns-replay-controls { width:min(650px,calc(100% - 16px)); padding:6px; }
  .ns-replay-controls button { height:30px; min-width:30px; padding:5px 6px; }
  .ns-replay-controls select { max-width:160px; padding:5px 6px; font-size:11px; }
  #nsReplayTime { min-width:92px; font-size:11px; }
  #nsReplayLocal { max-width:120px; }
}
@media(max-width:650px) { .ns-recordings-tools { gap:7px; } #nsReplayLocal { max-width:110px; } }
@media(max-width:400px) {
  .ns-replay-transport { gap:5px; }
  .ns-replay-transport button { min-width:30px; }
  #nsReplayTime { display:none; }
}
@media(pointer:coarse) { #nsRecordingsModal .ns-record-icon { min-width:40px; height:40px; } }

.ns-mobile-control, .ns-recordings-extras, .ns-replay-mobile-options { display: none; }
.ns-recordings-filters, .ns-recordings-bottom { display: contents; }
.ns-recordings-filters .ns-record-favorite { order: -1; }

@media (max-width: 700px), (orientation: landscape) and (max-height: 560px) and (max-width: 950px) {
  #nsRecordingsModal { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .ns-recordings-card { height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); }
  .ns-recordings-card .modal-head { min-height: 50px; padding: 3px 10px; }
  .ns-recordings-card .modal-close { width: 44px; height: 44px; }
  .ns-recordings-tools {
    position: relative;
    flex: none;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 4px 8px 8px;
  }
  .ns-recordings-tools input[type="search"] { flex: 1 1 0; min-width: 0; min-height: 44px; width: auto; padding: 8px 10px; }
  #nsRecordingsModal .ns-mobile-control { display: inline-grid; place-items: center; min-height: 44px; min-width: 44px; }
  #nsRecordingsMoreToggle, #nsReplayMoreToggle { font-size: 22px; line-height: 1; }
  .ns-recordings-tools .ns-recordings-filters,
  .ns-recordings-extras { display: none; }
  .ns-recordings-filters.mobile-open, .ns-recordings-extras.mobile-open {
    position: absolute;
    z-index: 2;
    top: 100%;
    right: 8px;
    display: grid;
    gap: 6px;
    width: min(370px, calc(100% - 16px));
    max-height: calc(100dvh - 122px);
    overflow: auto;
    padding: 9px;
    color: var(--text-main);
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
  }
  .ns-recordings-filters.mobile-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-recordings-filters .ns-record-favorite {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 40px;
    padding-inline: 4px;
    cursor: pointer;
  }
  .ns-recordings-filters .ns-record-favorite input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    padding: 0;
    cursor: inherit;
  }
  .ns-recordings-filters :is(select, #nsRecordingsReset) { min-height: 40px; }
  .ns-recordings-filters #nsRecordingsReset { grid-column: 1 / -1; }
  .ns-recordings-extras .ns-recordings-footer { padding: 0; }
  .ns-recordings-extras .ns-record-import { display: grid; align-items: center; min-height: 44px; }
  .ns-recordings-extras .ns-recordings-note { margin: 3px 0 0; }
  .ns-recordings-list { padding-inline: 8px; }

  #nsReplayControls:not(.collapsed) {
    bottom: max(6px, env(safe-area-inset-bottom));
    width: min(540px, calc(100% - 12px));
    padding: 4px;
  }
  .ns-replay-transport { gap: 4px; }
  .ns-replay-transport button { flex: 0 0 44px; min-width: 44px; height: 44px; padding: 4px; }
  #nsReplayClose { flex-basis: auto; padding-inline: 7px; margin-left: 0; }
  #nsReplayMoreToggle { display: inline-grid; }
  .ns-replay-mobile-options.mobile-open {
    position: absolute;
    right: 0;
    bottom: calc(100% + 5px);
    display: grid;
    gap: 8px;
    width: min(340px, 100%);
    max-height: min(340px, calc(100dvh - 84px));
    overflow: auto;
    padding: 8px;
    background: #252532;
    border: 1px solid var(--replay-line);
    border-radius: 10px;
    box-shadow: var(--shadow);
  }
  .ns-replay-mobile-transport {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
  }
  .ns-replay-mobile-options .ns-replay-secondary { display: flex; }
  .ns-replay-mobile-options .ns-replay-secondary > strong { display: block; flex: 1 0 100%; max-width: 100%; }
  .ns-replay-mobile-options :is(button, select) { min-height: 40px; }
  .ns-replay-mobile-options #nsReplayTime { display: inline; min-width: 0; margin-right: auto; }
  .ns-replay-mobile-options #nsReplayView { margin-left: 0; }
  .ns-replay-chat { max-height: calc(100% - 64px); }
}
