:root {
  --editor-orange: #ff8a2a;
  --editor-orange-2: #ff6a00;
  --editor-orange-3: #ff9f43;
  --editor-orange-4: #ff5e3a;
  --editor-orange-deep: #a94f17;
  --editor-orange-dark: #6c3212;

  --editor-red: #eb5136;
  --editor-blue: #fc2617;
  --editor-gold: #ffd26f;

  --editor-bg: #0b0c10;
  --panel-bg: #15171e;
  --border-ui: rgba(255, 255, 255, 0.06);

  --neon-orange: #ff8a2a;
  --text-main: #e8edf7;
  --text-soft: rgba(232, 237, 247, 0.72);

  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --shadow-soft-orange: 0 10px 28px rgba(255, 122, 36, 0.18);
  --shadow-strong-orange: 0 14px 34px rgba(255, 122, 36, 0.28);

  --editor-amber: #ffb347;
  --editor-amber-light: #ffd580;
  --editor-amber-deep: #ff9a2e;

  --editor-gold-soft: rgba(255, 179, 71, 0.18);
  --editor-gold-glow: rgba(255, 179, 71, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, #1c120d 0%, #120d0c 48%, #070608 100%);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  display: flex;
  height: 100vh;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.orbitron {
  font-family: 'Orbitron', sans-serif;
}

.sidebar-montage {
  width: 58px;
  background: #090a0e;
  border-right: 1px solid var(--border-ui);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 24px;
  z-index: 20;
  flex-shrink: 0;
}

.app-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--editor-orange), var(--editor-red));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  box-shadow: 0 10px 24px rgba(255,106,0,.25);
}

.tool-btn {
  color: rgba(255,255,255,.28);
  cursor: pointer;
  transition: all .2s ease;
}

.tool-btn:hover,
.tool-btn.active {
  color: var(--editor-orange);
  transform: translateY(-1px);
}

.tool-bottom {
  margin-top: auto;
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  background: rgba(10,12,18,.88);
  border-bottom: 1px solid var(--border-ui);
}

.title {
  font-size: 0.95rem;
  letter-spacing: .08em;
  color: white;
}

.subtitle {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.top-link {
  color: #ffc18a;
  text-decoration: none;
}

.top-link:hover {
  color: white;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.86);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff8a2a;
  box-shadow: 0 0 10px rgba(255,138,42,.55);
}

.editor-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-container {
  display: flex;
  gap: 2px;
  background: #000;
  border-bottom: 1px solid var(--border-ui);
  height: 54%;
  min-height: 320px;
}

.viewer-box {
  flex: 1;
  position: relative;
  background: #040506;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.viewer-program {
  border-left: 1px solid rgba(255,255,255,.05);
}

.viewer-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.hud-top,
.hud-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.hud-label {
  font-size: 9px;
  color: rgba(255,255,255,.34);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}

.live-render {
  color: #ff9c70;
}

.text-orange {
  color: var(--neon-orange);
}

.viewer-poster-wrap {
  position: absolute;
  inset: 0;
}

.viewer-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) contrast(1.02);
}

.viewer-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.18);
}

.viewer-fallback svg {
  width: 120px;
  height: 120px;
}

.video-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 14px;
}

.video-stage {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-landscape {
  aspect-ratio: 16 / 9;
  height: 100%;
  width: auto;
  max-width: 100%;
}

.stage-portrait {
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
  max-width: min(34%, 320px);
}

.showreel-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  pointer-events: auto;
  border-radius: 14px;
}

.glass-lite {
  background: linear-gradient(180deg, rgba(12,16,25,.78), rgba(10,13,19,.52));
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overlay-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--editor-gold);
  font-size: 0.72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

@keyframes scan-move {
  0% {
    left: 0%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--neon-orange);
  box-shadow: 0 0 15px var(--neon-orange);
  z-index: 25;
  pointer-events: none;
  opacity: 0;
}

.viewer-box:hover .scan-line {
  animation: scan-move 3s infinite linear;
}

.timeline-section {
  flex: 1;
  background: var(--editor-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timeline-header {
  min-height: 38px;
  background: #171920;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  font-size: 10px;
  color: rgba(255,255,255,.42);
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timeline-icon,
.timeline-icon-wrap {
  color: rgba(255,255,255,.72);
}

.timeline-icon-wrap {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.clip.jaune-orange {
  background: linear-gradient(
    135deg,
    #ffb347 0%,
    #ff8a2a 50%,
    #ff5e3a 100%
  );
  box-shadow:
    inset 2px 0 0 rgba(255,255,255,.3),
    0 0 10px rgba(255, 180, 80, 0.25);
}

.timeline-icon {
  width: 14px;
  height: 14px;
}

.timeline-time {
  color: white;
  letter-spacing: .12em;
}

.timeline-legend {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
}

.legend-item.orange {
  color: #ffb077;
}

.legend-item.red {
  color: #ff7e72;
}

.legend-item.blue {
  color: #8cb5ff;
}

.timeline-tracks {
  flex: 1;
  overflow: auto;
  position: relative;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 100% 44px;
}

.track-row {
  display: flex;
  min-height: 44px;
  border-bottom: 1px solid rgba(255,255,255,.03);
}

.track-label {
  width: 70px;
  flex-shrink: 0;
  background: #171920;
  border-right: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.54);
}

.track-lane {
  position: relative;
  flex: 1;
  min-width: 900px;
}

.clip {
  position: absolute;
  top: 4px;
  height: auto;
  min-height: 24px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  color: white;
  white-space: normal;
  line-height: 1.3;
  word-break: break-word;
  box-shadow: inset 2px 0 0 rgba(255,255,255,.28);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.clip:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.clip.orange {
  background: var(--editor-orange);
}

.clip.red {
  background: var(--editor-red);
}

.clip.blue {
  background: var(--editor-blue);
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: white;
  z-index: 50;
  pointer-events: none;
}

.playhead::after {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid white;
}

.footer-bar {
  min-height: 38px;
  padding: 0 18px;
  background: #090a0e;
  border-top: 1px solid var(--border-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dim {
  color: rgba(255,255,255,.34);
}

.inspector-panel {
  width: 330px;
  background: #15171e;
  border-left: 1px solid var(--border-ui);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inspector-header {
  padding: 16px 18px;
  background: #1a1c23;
  border-bottom: 1px solid #000;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.inspector-scroll {
  flex: 1;
  overflow-y: auto;
}

.info-block {
  padding: 18px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.block-dark {
  background: rgba(0,0,0,.18);
}

.block-accent {
  background: linear-gradient(180deg, rgba(255, 122, 36, 0.10), rgba(255, 106, 0, 0.05));
}

.mini-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.34);
  font-weight: 700;
  margin-bottom: 8px;
}

.info-block h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: .05em;
}

.info-block p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.info-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.inspector-btn,
.inspector-btn.alt,
.software-btn,
.software-btn.alt {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .06em;
  border: 1px solid rgba(255, 173, 112, 0.18);
  cursor: pointer;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    filter .2s ease,
    border-color .2s ease,
    opacity .2s ease;
}

.inspector-btn.active,
.software-btn.active,
.inspector-btn:not(.alt):not(.software-btn),
.software-btn:not(.alt) {
  background: linear-gradient(135deg, #ff9736 0%, #ff7b2f 48%, #ff5e3a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 10px 22px rgba(255, 116, 36, 0.24);
  border-color: rgba(255, 190, 132, 0.28);
}

.inspector-btn.alt,
.software-btn.alt {
  background: linear-gradient(135deg, rgba(98, 53, 27, 0.92) 0%, rgba(72, 39, 22, 0.96) 100%);
  color: rgba(255,255,255,.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 0 0 1px rgba(255, 146, 68, 0.06);
}

.action-stack .software-btn:nth-child(1),
.action-stack .software-btn.alt:nth-child(1) {
  background-image: linear-gradient(135deg, #ff9b45 0%, #ff7f2a 55%, #ff6a00 100%);
}

.action-stack .software-btn:nth-child(2),
.action-stack .software-btn.alt:nth-child(2) {
  background-image: linear-gradient(135deg, #ff9440 0%, #ff7430 55%, #ff5e3a 100%);
}

.action-stack .software-btn:nth-child(3),
.action-stack .software-btn.alt:nth-child(3) {
  background-image: linear-gradient(135deg, #ffad54 0%, #ff8b2c 55%, #ff6b1f 100%);
}

.action-stack .software-btn:nth-child(4),
.action-stack .software-btn.alt:nth-child(4) {
  background-image: linear-gradient(135deg, #ff8b3a 0%, #ff6e29 55%, #ff5533 100%);
}

.action-stack .software-btn.alt:nth-child(1),
.action-stack .software-btn.alt:nth-child(2),
.action-stack .software-btn.alt:nth-child(3),
.action-stack .software-btn.alt:nth-child(4) {
  filter: saturate(.72) brightness(.62);
}

.action-stack .software-btn.active,
.action-stack .software-btn:not(.alt) {
  filter: saturate(1.06) brightness(1.04);
}

.inspector-btn:hover,
.software-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 12px 26px rgba(255, 120, 36, 0.24);
}

.inspector-btn:focus-visible,
.software-btn:focus-visible {
  outline: 2px solid rgba(255, 196, 138, 0.95);
  outline-offset: 2px;
}

.inspector-btn::before,
.software-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0));
  pointer-events: none;
}

.inspector-btn,
.software-btn {
  position: relative;
  overflow: hidden;
}

.code-box {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.65;
  color: #ffc18a;
  background: rgba(0,0,0,.35);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
}

.source-overlay {
  position: absolute;
  left: 24px;
  right: auto;
  bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0;
  z-index: 12;
  pointer-events: none;
}

.source-overlay-card {
  max-width: 520px;
  width: min(520px, calc(100vw - 160px));
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}

.source-overlay-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.08;
}

.source-overlay-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.source-overlay .glass-lite {
  max-width: 400px;
  backdrop-filter: blur(10px);
}


@media (max-width: 1100px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar-montage {
    width: 100%;
    height: 58px;
    flex-direction: row;
    justify-content: center;
    padding: 0 16px;
    margin-bottom: 10px;
  }

  .topbar {
    padding-top: 15px;
    padding-bottom: 15px;
    margin-top: 5px;
  }

  .tool-bottom {
    margin-top: 0;
  }

  .workspace {
    min-height: 0;
  }

  .inspector-panel {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--border-ui);
  }

  .source-overlay {
    left: 18px;
    bottom: 18px;
  }

  .source-overlay-card {
    max-width: 460px;
    width: min(460px, calc(100vw - 120px));
  }
}

@media (max-width: 760px) {
  .topbar,
  .timeline-header,
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .stage-landscape {
  width: 100%;
  height: auto;
  max-height: 100%;
}

.viewer-program {
  min-height: 220px;
}

  .viewer-container {
    flex-direction: column;
    height: auto;
  }

  .viewer-box {
    min-height: 260px;
  }

  .stage-portrait {
    width: min(58%, 300px);
  }

  .track-label {
    width: 54px;
  }

  .source-overlay {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .source-overlay-card {
    width: 100%;
    max-width: 100%;
    padding: 14px 15px 13px;
  }

  .source-overlay-card h1 {
    font-size: 1.05rem;
    line-height: 1.12;
    margin-bottom: 8px;
  }

  .inspector-panel {
    width: 100%;
  }
}