/* B"H — Nesher Studio compact grid: the control room stops becoming a hallway. */
:root {
  --nesher-bg: #03050d;
  --nesher-deck: #071020;
  --nesher-panel: rgba(10, 18, 35, 0.94);
  --nesher-panel-2: rgba(14, 27, 52, 0.9);
  --nesher-card: rgba(17, 30, 55, 0.9);
  --nesher-line: #284066;
  --nesher-line-hot: rgba(118, 255, 231, 0.58);
  --nesher-ink: #eef6ff;
  --nesher-soft: #c8d7ff;
  --nesher-muted: #94a8d3;
  --nesher-faint: #61779d;
  --nesher-cyan: #76ffe7;
  --nesher-blue: #73a7ff;
  --nesher-violet: #a78bfa;
  --nesher-gold: #ffd166;
  --nesher-orange: #ffb347;
  --nesher-red: #ff4f7b;
  --nesher-green: #70ffba;
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.5);
  --shadow-panel: 0 0 0 1px rgba(118, 255, 231, 0.08), 0 18px 54px rgba(0, 0, 0, 0.38);
  --focus-ring: 0 0 0 3px rgba(118, 255, 231, 0.28), 0 0 34px rgba(118, 255, 231, 0.18);
  --touch: 42px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--nesher-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% -10%, rgba(46, 99, 175, 0.66), transparent 30%),
    radial-gradient(circle at 86% 7%, rgba(167, 139, 250, 0.34), transparent 28%),
    linear-gradient(145deg, var(--nesher-bg), #08101f 58%, #01030a);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0, rgba(0, 0, 0, 0.72) 44%, transparent 86%);
}

button,
input,
select,
textarea {
  min-width: 0;
  min-height: var(--touch);
  border: 1px solid var(--nesher-line);
  border-radius: 14px;
  padding: 0.65rem 0.82rem;
  color: var(--nesher-ink);
  background: rgba(5, 13, 27, 0.95);
  font: inherit;
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.34);
}

button {
  width: auto;
  cursor: pointer;
  color: #031018;
  font-weight: 850;
  letter-spacing: 0.01em;
  border-color: var(--nesher-line-hot);
  background: linear-gradient(135deg, var(--nesher-cyan), var(--nesher-blue) 62%, #dffdf8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 0 18px rgba(118, 255, 231, 0.12);
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.home-tile:hover,
summary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  filter: grayscale(0.55);
}

button:focus-visible,
input:focus,
select:focus,
textarea:focus,
a:focus-visible,
summary:focus-visible,
.clip:focus-visible {
  border-color: var(--nesher-cyan);
  box-shadow: var(--focus-ring);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  letter-spacing: -0.035em;
}

h2,
h3 {
  margin: 0 0 0.55rem;
}

p {
  line-height: 1.45;
}

textarea,
pre,
#encodingBenchmarkOutput {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.nesher-shell {
  width: min(1580px, 96vw);
  margin: 0 auto;
  padding: 14px 0 28px;
}

.studio-page {
  display: block;
}

.nle-page {
  min-height: calc(100vh - 130px);
}

.hero,
.nav-rail,
.studio-home,
.studio-drawer,
.stream-health,
.studio-grid,
.nle-panel,
.page-kicker {
  border: 1px solid rgba(71, 103, 154, 0.7);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--nesher-panel), rgba(5, 11, 24, 0.93));
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(16px) saturate(1.18);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 4.6rem);
  line-height: 0.9;
}

.hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0.55rem 0 0;
  color: var(--nesher-soft);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--nesher-cyan);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.record-controls,
.nav-rail,
.source-toolbar,
.benchmark-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.record-controls {
  min-width: 260px;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid rgba(118, 255, 231, 0.16);
  border-radius: 20px;
  background: rgba(2, 8, 18, 0.45);
}

.record-controls button:first-child {
  color: #fff8fb;
  border-color: rgba(255, 209, 102, 0.72);
  background: linear-gradient(135deg, #ff275f, #ff8a3d 52%, #ffd166);
}

#fmp4StreamButton {
  color: #eaf7ff;
  background: linear-gradient(135deg, #10213f, #1e3a67 56%, #153c4d);
}

.nav-rail {
  position: sticky;
  top: 8px;
  z-index: 5;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
}

.nav-rail button {
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  color: #ddecff;
  background: linear-gradient(135deg, #111f3b, #17294b);
}

.nav-rail button.active {
  color: #02110f;
  background: linear-gradient(135deg, #1ed8bd, #8fffe7);
}

.studio-home {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.home-tile {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  border: 1px solid rgba(118, 255, 231, 0.18);
  border-radius: 18px;
  padding: 12px;
  color: var(--nesher-ink);
  background: linear-gradient(160deg, rgba(18, 34, 65, 0.94), rgba(5, 13, 28, 0.94));
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

.home-tile-primary {
  border-color: rgba(118, 255, 231, 0.46);
  background: linear-gradient(135deg, rgba(20, 72, 85, 0.95), rgba(29, 54, 100, 0.94));
}

.home-tile span,
.stream-health span {
  color: #8fa6d8;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.home-tile strong {
  display: block;
  color: var(--nesher-cyan);
  font-size: 1.02rem;
}

.home-tile em {
  color: var(--nesher-soft);
  font-size: 0.82rem;
  font-style: normal;
}

.studio-drawer {
  margin: 10px 0;
  overflow: hidden;
}

.studio-drawer summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 0 16px;
  color: var(--nesher-cyan);
  font-weight: 900;
  list-style: none;
}

.studio-drawer summary::-webkit-details-marker {
  display: none;
}

.studio-drawer summary::after {
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(118, 255, 231, 0.32);
  border-radius: 999px;
  color: var(--nesher-cyan);
}

.studio-drawer[open] summary::after {
  content: "–";
}

.studio-drawer summary span {
  color: var(--nesher-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.control-grid,
.source-toolbar {
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(71, 103, 154, 0.42);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  align-items: end;
}

.source-toolbar {
  align-items: center;
}

.control-grid label,
.toolbar-select,
.transform-panel label,
.crop-grid label,
.visualizer-panel label {
  display: grid;
  gap: 6px;
  color: var(--nesher-muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.toolbar-select {
  min-width: 190px;
  flex: 1 1 190px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: var(--touch);
  border: 1px solid rgba(71, 103, 154, 0.7);
  border-radius: 14px;
  padding: 0.58rem 0.74rem;
  background: rgba(7, 17, 35, 0.78);
}

.check-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--nesher-cyan);
}

.source-toolbar button,
.layer-buttons button,
.quick-actions button,
.tool-pills button,
.nle-actions button,
.benchmark-buttons button {
  color: #ddecff;
  border-color: #416195;
  background: linear-gradient(135deg, #111f3b, #17294b);
}

.source-toolbar button {
  flex: 0 1 auto;
  min-height: 38px;
  padding: 0.5rem 0.76rem;
}

#addMonitor,
#addDisplayAudio,
#addMic,
#addAudioVisualizer,
#addVisualizerFamily {
  border-color: rgba(112, 255, 186, 0.48);
  background: linear-gradient(135deg, #0e2b36, #17455f 58%, #1e3150);
}

#removeSource,
#rippleDeleteClip {
  color: #ffdbe5;
  border-color: rgba(255, 79, 123, 0.56);
  background: linear-gradient(135deg, #2b1020, #1a2136);
}

.stream-health {
  display: grid;
  grid-template-columns: repeat(8, minmax(88px, 1fr));
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
}

.status-compact {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.stream-health div,
.nle-panel > div,
.inspector,
aside {
  border: 1px solid rgba(43, 61, 101, 0.94);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--nesher-card), rgba(7, 14, 28, 0.95));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}

.stream-health div {
  position: relative;
  min-height: 66px;
  padding: 10px 12px;
  overflow: hidden;
}

.stream-health div::after {
  position: absolute;
  inset: auto 10px 7px 10px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--nesher-cyan), transparent);
  opacity: 0.45;
}

.stream-health strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--nesher-cyan);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#recordPhase,
#streamState {
  color: var(--nesher-green);
}

#recordErrors,
#streamErrors {
  color: var(--nesher-orange);
}

#providerNote,
#recordNote {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(118, 255, 231, 0.13);
  border-radius: 14px;
  padding: 0.62rem 0.78rem;
  color: #c5d6ff;
  background: rgba(3, 9, 20, 0.66);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(420px, 1fr) minmax(300px, 390px);
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
}

.scene-panel,
.right-panel,
.nle-panel > div,
.inspector {
  padding: 12px;
}

.stage-wrap {
  position: relative;
  display: grid;
  min-height: clamp(360px, 42vw, 560px);
  place-items: center;
  overflow: auto;
  border: 1px solid rgba(118, 255, 231, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(35, 58, 105, 0.92), rgba(5, 9, 20, 0.96) 62%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 14px);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.72), var(--shadow-panel);
}

.stage-wrap::before {
  position: absolute;
  inset: 14px;
  content: "";
  pointer-events: none;
  border: 1px dashed rgba(200, 215, 255, 0.12);
  border-radius: 16px;
}

#stage {
  position: relative;
  z-index: 1;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(118, 255, 231, 0.42);
  border-radius: 12px;
  background: #111;
  box-shadow: 0 0 0 1px rgba(131, 255, 231, 0.22), 0 28px 76px rgba(0, 0, 0, 0.7);
  touch-action: none;
}

aside button,
.nle-panel button {
  margin: 0.25rem 0;
}

.layer-buttons,
.quick-actions,
.tool-pills,
.nle-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0.62rem 0;
}

.nle-actions {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  max-height: 205px;
  overflow: auto;
}

.layer-buttons button,
.quick-actions button,
.tool-pills button,
.nle-actions button {
  width: 100%;
  margin: 0;
  padding: 0.56rem;
}

.transform-panel,
.crop-grid,
.visualizer-panel {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #273a5f;
}

.crop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crop-grid h3,
.transform-panel h3,
.visualizer-panel h3 {
  grid-column: 1 / -1;
  margin: 0.1rem 0;
  color: var(--nesher-cyan);
}

.visualizer-panel {
  border: 1px solid rgba(112, 255, 186, 0.24);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(7, 27, 36, 0.72), rgba(5, 11, 24, 0.86));
}

.visualizer-panel[hidden] {
  display: none;
}

.visualizer-panel input[type="range"] {
  padding-inline: 0.35rem;
  accent-color: var(--nesher-cyan);
}

#visualizerCustomJs {
  min-height: 132px;
  color: #bfffee;
  background: #030812;
}

#sourceList,
#sceneList,
#nleBin,
#nleTimeline {
  padding-left: 1rem;
  color: #d8e4ff;
}

#sceneList li,
#sourceList li,
#nleBin li,
#nleTimeline li {
  margin: 0.28rem 0;
  padding: 0.55rem;
  cursor: pointer;
  border: 1px solid #20345a;
  border-radius: 14px;
  background: linear-gradient(180deg, #111e37, #0a1428);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

#sceneList li:hover,
#sourceList li:hover,
#nleBin li:hover,
#nleTimeline li:hover,
#sceneList li:focus-within,
#sourceList li:focus-within,
#nleBin li:focus-within,
#nleTimeline li:focus-within {
  transform: translateX(2px);
  border-color: rgba(118, 255, 231, 0.5);
}

#sourceList li span,
#nleBin li span,
#nleTimeline li span {
  display: block;
  margin-top: 0.15rem;
  color: #9fb4ff;
  font-size: 0.76rem;
}

#sourceList li.selected-source,
#sceneList li.active,
#nleBin li.active {
  color: var(--nesher-cyan);
  border-color: rgba(131, 255, 231, 0.66);
  background: linear-gradient(135deg, #243e68, #11392f);
}

#status,
#nleExport,
#nleSelectionSummary,
#inspectorMeta,
.download-list {
  color: #b6c7f6;
  line-height: 1.45;
}

#status,
#nleExport,
#nleSelectionSummary {
  border: 1px solid rgba(71, 103, 154, 0.42);
  border-radius: 14px;
  padding: 0.62rem 0.78rem;
  background: rgba(4, 11, 23, 0.58);
}

.download-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.download-link {
  display: block;
  overflow: hidden;
  border: 1px solid #274b72;
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--nesher-cyan);
  background: #071428;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nle-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(360px, 1.45fr) minmax(180px, 0.82fr) minmax(210px, 0.9fr);
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
}

.nle-page {
  margin-top: 10px;
}

.nle-panel > .page-kicker {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.page-kicker h2,
.page-kicker p {
  margin: 0.2rem 0 0;
}

.page-kicker h2 {
  color: var(--nesher-cyan);
  font-size: clamp(1.7rem, 3vw, 3.2rem);
}

#backToStudio {
  flex: 0 0 auto;
  color: #ddecff;
  background: linear-gradient(135deg, #111f3b, #17294b);
}

.timeline-real {
  position: relative;
  min-height: 214px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #2a426d;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(13, 22, 41, 0.94), rgba(5, 9, 19, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 64px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), inset 0 -36px 72px rgba(0, 0, 0, 0.34);
  scrollbar-color: rgba(118, 255, 231, 0.55) rgba(5, 11, 24, 0.92);
}

.timeline-real::before {
  position: absolute;
  inset: 30px 0 0;
  min-width: 700px;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(118, 255, 231, 0.08) 0 1px, transparent 1px 9%);
}

.timeline-ruler,
.timeline-markers {
  position: relative;
  min-width: 700px;
  height: 32px;
  border-bottom: 1px solid #263a61;
  color: #91a9db;
  background: linear-gradient(180deg, rgba(20, 33, 58, 0.82), rgba(8, 14, 28, 0.6));
}

.timeline-ruler span {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 800;
}

.timeline-markers {
  display: grid;
  grid-template-columns: 86px minmax(614px, 1fr);
  align-items: stretch;
  height: 38px;
}

.timeline-markers strong {
  display: grid;
  place-items: center;
  color: var(--nesher-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-markers .timeline-lane {
  height: 28px;
  margin: 5px 7px 5px 0;
}

.timeline-markers em {
  position: absolute;
  left: 12px;
  top: 7px;
  color: var(--nesher-faint);
  font-size: 0.73rem;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(614px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 700px;
  padding: 7px;
  border-bottom: 1px solid rgba(38, 58, 97, 0.55);
}

.timeline-track header {
  display: grid;
  align-content: center;
  min-height: 50px;
  border: 1px solid rgba(71, 103, 154, 0.4);
  border-radius: 13px;
  padding: 7px;
  background: linear-gradient(180deg, #101c34, #081222);
}

.timeline-track header b,
.timeline-track header small {
  display: block;
}

.timeline-track header b {
  color: #e6f2ff;
  font-size: 0.8rem;
}

.timeline-track header small {
  color: var(--nesher-faint);
  font-size: 0.66rem;
}

.timeline-lane,
.clip-lane {
  position: relative;
  height: 50px;
  overflow: hidden;
  border: 1px solid #243656;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 52px),
    linear-gradient(180deg, #050b17, #091225);
}

.clip {
  position: absolute;
  top: 6px;
  min-width: 58px;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(131, 255, 231, 0.42);
  border-radius: 12px;
  padding: 4px 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #244fd1, #6a92ff 62%, #7dd3fc);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 9px 20px rgba(0, 0, 0, 0.32);
  text-align: left;
  text-overflow: ellipsis;
}

.clip:hover {
  filter: brightness(1.08);
}

.clip span,
.clip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip span {
  font-size: 0.72rem;
  font-weight: 850;
}

.clip small {
  opacity: 0.82;
  font-size: 0.64rem;
}

.clip.active {
  color: #02110f;
  border-color: #dffdf8;
  background: linear-gradient(135deg, #16c9a7, #8fffe7 62%, #fff7c2);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.36), 0 0 30px rgba(118, 255, 231, 0.34);
}

.clip.muted {
  border-style: dashed;
  color: #dbe6ff;
  background: linear-gradient(135deg, #33405f, #4b5d82);
}

.clip.muted::before {
  position: absolute;
  right: 5px;
  bottom: 3px;
  content: "mute";
  color: #d8e4ff;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clip.disabled {
  opacity: 0.48;
  filter: grayscale(0.74);
}

.clip.disabled::before {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(0, 0, 0, 0.24) 7px 9px);
}

.clip.faded::after {
  position: absolute;
  right: 5px;
  top: 3px;
  content: "fade";
  color: var(--nesher-gold);
  font-size: 0.56rem;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.72);
}

.marker {
  position: absolute;
  top: 4px;
  width: 20px;
  height: 22px;
  color: var(--nesher-gold);
  font-style: normal;
  line-height: 22px;
  text-align: center;
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.9);
  transform: translateX(-50%);
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 2px;
  min-height: 100%;
  background: var(--nesher-cyan);
  box-shadow: 0 0 18px rgba(118, 255, 231, 0.9);
}

.playhead::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  border-top: 9px solid var(--nesher-cyan);
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  transform: translateX(-50%);
}

#encodingBenchmarkOutput,
pre,
textarea {
  border-color: #2b4d75;
  color: #b9ffef;
  background: #030812;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.56);
}

#encodingBenchmarkOutput {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 1320px) {
  .nesher-shell {
    width: min(1240px, 96vw);
  }

  .studio-home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stream-health {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .studio-grid {
    grid-template-columns: minmax(155px, 210px) minmax(380px, 1fr) minmax(280px, 350px);
  }

  .nle-panel {
    grid-template-columns: minmax(130px, 0.65fr) minmax(330px, 1.45fr) minmax(170px, 0.8fr) minmax(190px, 0.85fr);
  }
}

@media (max-width: 1080px) {
  .hero,
  .studio-grid,
  .nle-panel {
    grid-template-columns: 1fr;
  }

  .nle-panel > .page-kicker {
    display: grid;
  }

  .record-controls {
    justify-content: start;
  }

  .stage-wrap {
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .studio-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-controls button,
  .benchmark-buttons button {
    flex: 1 1 210px;
  }

  .stream-health {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nle-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --touch: 50px;
  }

  .nesher-shell {
    width: 94vw;
    padding: 10px 0 22px;
  }

  .hero,
  .nav-rail,
  .studio-home,
  .studio-drawer,
  .stream-health,
  .studio-grid,
  .nle-panel {
    border-radius: 20px;
  }

  .hero,
  .studio-home,
  .studio-grid,
  .nle-panel,
  .page-kicker {
    padding: 12px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 14vw, 3.4rem);
  }

  .record-controls,
  .nav-rail,
  .source-toolbar,
  .benchmark-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  button,
  .source-toolbar button,
  .record-controls button,
  .benchmark-buttons button {
    width: 100%;
  }

  .studio-home,
  .control-grid,
  .stream-health {
    grid-template-columns: 1fr;
  }

  .stage-wrap {
    min-height: 300px;
  }

  .crop-grid,
  .layer-buttons,
  .quick-actions,
  .tool-pills,
  .nle-actions {
    grid-template-columns: 1fr;
  }

  .timeline-real {
    min-height: 210px;
  }

  .timeline-ruler,
  .timeline-markers,
  .timeline-track,
  .timeline-real::before {
    min-width: 780px;
  }

  .download-link,
  .stream-health strong {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
