.ed {
  --ed-line: rgba(184, 154, 255, 0.12);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #13111e;
  font-size: 0.8125rem;
  line-height: 1.4;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  user-select: none;
}

.ed__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--ed-line);
  background: var(--surface);
}
.ed__branch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2rem;
  padding: 0 0.3rem 0 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--raised);
  color: var(--lavender);
}
.ed__branch svg { width: 15px; height: 15px; flex: none; }
.ed__branch select {
  appearance: none;
  height: 100%;
  padding: 0 1.4rem 0 0.1rem;
  border: 0;
  color: var(--text);
  font: 500 0.8125rem var(--sans);
  cursor: pointer;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 0.7rem center / 4px 4px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 0.45rem center / 4px 4px no-repeat;
}
.ed__branch select:focus-visible { outline: none; }
.ed__branch:focus-within { box-shadow: 0 0 0 2px rgba(184, 154, 255, 0.35); }
.ed__branch option { background: var(--raised); color: var(--text); }
.ed__state { color: var(--muted); font: 400 0.75rem var(--mono); }
.ed__state.is-dirty::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #f2b36a;
  vertical-align: 1px;
}
.ed__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-left: auto; }

.ed-btn {
  appearance: none;
  height: 2rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  font: 500 0.8125rem/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.ed-btn:hover:not(:disabled) { background: #2e2645; border-color: rgba(184, 154, 255, 0.45); }
.ed-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ed-btn--primary { background: var(--lavender); border-color: transparent; color: var(--bg); }
.ed-btn--primary:hover:not(:disabled) { background: #c6adff; }
.ed-btn--quiet { background: transparent; }
.ed-btn--xs { height: 1.65rem; padding: 0 0.6rem; font-size: 0.75rem; }
.ed-btn[aria-pressed="true"] { border-color: var(--lavender); background: rgba(184, 154, 255, 0.18); }

.ed__main { display: grid; }
.ed__monitor {
  padding: 0.9rem;
  border-bottom: 1px solid var(--ed-line);
  background: #0b0a12;
}
.ed__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 3px;
  background: #000;
  overflow: hidden;
}
.ed__screen img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.2s; }
.ed__tint { position: absolute; inset: 0; mix-blend-mode: soft-light; transition: background-color 0.2s; }
.ed__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.ed__empty[hidden], .ed__screen img[hidden], .ed__tint[hidden] { display: none; }
.ed__transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.7rem;
}
.ed-play {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 154, 255, 0.55);
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
}
.ed-play svg { width: 14px; height: 14px; }
.ed-play__stop, .ed-play[aria-pressed="true"] .ed-play__go { display: none; }
.ed-play[aria-pressed="true"] .ed-play__stop { display: block; }
.ed__tc { font: 400 0.875rem var(--mono); font-variant-numeric: tabular-nums; }

.ed__panel { display: flex; flex-direction: column; background: var(--surface); }
.ed__tabs { display: flex; padding: 0 0.5rem; border-bottom: 1px solid var(--ed-line); }
.ed-tab {
  position: relative;
  appearance: none;
  padding: 0.7rem 0.6rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.78rem var(--sans);
  cursor: pointer;
}
.ed-tab:hover:not(:disabled) { color: var(--text); }
.ed-tab[aria-selected="true"] { color: var(--text); }
.ed-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 1.5px;
  background: var(--iris);
}
.ed-tab:disabled { opacity: 0.4; cursor: default; }
.ed__side { display: grid; gap: 0.6rem; align-content: start; max-height: 22rem; padding: 0.9rem; overflow: auto; }
.ed-side__title { margin: 0; color: var(--text); font: 600 0.875rem var(--sans); }
.ed-side__sub { margin-top: 0.4rem; color: var(--muted); font-weight: 500; }
.ed-meta, .ed-empty { color: var(--muted); }
.ed-meta { font-size: 0.75rem; }
.ed-field { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; align-items: center; margin: 0.4rem 0; }
.ed-field label { color: var(--muted); }
.ed-out { font: 400 0.8125rem var(--mono); font-variant-numeric: tabular-nums; }
.ed-field input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--lavender); }

.ed-list, .ed-history { list-style: none; margin: 0; padding: 0; display: grid; }
.ed-list { gap: 2px; }
.ed-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  background: rgba(36, 30, 55, 0.6);
}
.ed-row__val { grid-column: 2; color: var(--muted); font: 400 0.75rem var(--mono); }
.ed-chip {
  grid-row: span 2;
  align-self: start;
  padding: 0.15rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
}
.ed-chip--added { color: #9fe0b5; }
.ed-chip--removed { color: #f6a3bc; }
.ed-chip--modified { color: var(--lavender); }
.ed-chip--moved { color: #9cc4ff; }
.ed-hist {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid var(--ed-line);
}
.ed-hist__dot { width: 9px; height: 9px; border: 1.5px solid var(--muted); border-radius: 50%; }
.ed-hist.is-head .ed-hist__dot { border-color: var(--lavender); background: var(--lavender); }
.ed-hist__text { display: grid; }
.ed-hist__text strong { font-weight: 500; }
.ed-status { color: #9fe0b5; font-weight: 500; }
.ed-status.is-blocked { color: #f6a3bc; }
.ed-conflict {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: rgba(36, 30, 55, 0.6);
}
.ed-conflict.is-open { border-color: rgba(246, 163, 188, 0.5); }
.ed-conflict__title { font-weight: 500; }
.ed-conflict__actions, .ed-merge-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ed-merge-actions { justify-content: flex-end; margin-top: 0.4rem; }

.ed__timeline { border-top: 1px solid var(--ed-line); background: #110f1b; overflow-x: auto; }
.ed__scroll { position: relative; min-width: 640px; padding: 0 0.9rem 0.6rem 3.4rem; }
.ed__ruler {
  position: relative;
  height: 1.7rem;
  border-bottom: 1px solid var(--ed-line);
  cursor: ew-resize;
  touch-action: none;
}
.ed-tick {
  position: absolute;
  bottom: 0.3rem;
  transform: translateX(-50%);
  color: var(--muted);
  font: 400 0.625rem var(--mono);
  pointer-events: none;
}
.ed-tick:first-child { transform: none; }
.ed-tick:last-child { transform: translateX(-100%); }
.ed__lanes { position: relative; display: grid; gap: 4px; padding-top: 6px; touch-action: none; }
.ed-lane { position: relative; height: 3.1rem; border-radius: 4px; background: rgba(36, 30, 55, 0.35); }
.ed-lane__name {
  position: absolute;
  left: -2.7rem;
  top: 50%;
  width: 2rem;
  padding: 0.2rem 0;
  transform: translateY(-50%);
  border: 1px solid var(--ed-line);
  border-radius: 4px;
  color: var(--muted);
  font: 500 0.6875rem var(--sans);
  text-align: center;
}
.ed-clip {
  position: absolute;
  top: 0;
  bottom: 0;
  appearance: none;
  padding: 0;
  border: 1px solid rgba(15, 14, 24, 0.9);
  border-radius: 4px;
  background-color: #3b3156;
  background-size: auto 100%;
  background-repeat: repeat-x;
  color: var(--text);
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  transition: box-shadow 0.15s;
}
.ed-clip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 14, 24, 0.75), rgba(15, 14, 24, 0.1) 60%);
}
.ed-clip__name {
  position: absolute;
  left: 0.4rem;
  right: 0.3rem;
  top: 0.25rem;
  overflow: hidden;
  font: 500 0.6875rem/1.2 var(--sans);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-clip__fx {
  position: absolute;
  left: 0.4rem;
  bottom: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 3px;
  background: rgba(15, 14, 24, 0.75);
  font: 500 0.625rem/1.5 var(--sans);
}
.ed-clip__fx.is-warm { color: #f5b77d; }
.ed-clip__fx.is-cool { color: #9cc4ff; }
.ed-clip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px #e7dcff; }
.ed-clip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--iris);
}
.ed-clip.is-dragging { z-index: 2; cursor: grabbing; opacity: 0.9; }
.ed-clip:focus-visible { outline: 1.5px solid var(--lavender); outline-offset: 1px; }
.ed__head {
  position: absolute;
  top: 0;
  bottom: 0.6rem;
  left: calc(3.4rem + (100% - 4.3rem) * var(--p, 0));
  width: 1px;
  background: var(--pink);
  pointer-events: none;
  z-index: 3;
}
.ed__head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 5px solid transparent;
  border-top: 7px solid var(--pink);
}

.ed__binrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--ed-line);
  background: var(--surface);
  overflow-x: auto;
}
.ed__binlabel { color: var(--muted); white-space: nowrap; }
.ed__bin { display: flex; gap: 0.5rem; }
.ed-bin__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  border: 1px solid var(--ed-line);
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  font: 500 0.75rem var(--sans);
  white-space: nowrap;
  cursor: copy;
  transition: border-color 0.15s;
}
.ed-bin__item:hover { border-color: rgba(184, 154, 255, 0.45); }
.ed-bin__item img { width: 48px; height: 27px; border-radius: 3px; object-fit: cover; }
.ed__hint {
  min-height: 2.6rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--ed-line);
  color: var(--muted);
}

@media (min-width: 900px) {
  .ed__main { grid-template-columns: 1.6fr 1fr; }
  .ed__panel { min-height: 17rem; }
  .ed__monitor { border-bottom: 0; border-right: 1px solid var(--ed-line); }
}
