/* CLAUDE 10-03: editor chrome polish, loaded after editor.css. The owner's CapCut comparison: cheap glyph icons, a
   wrapping timeline toolbar, handles that did not scale, effects with no visible lane, an oversized UI.
   Dark UI; green only marks the one primary action (Export), so the active / pressed states here are white on grey.
   Interface font: Mona Sans (interface.css). Timecodes: JetBrains Mono ('RipClip Mono', landing.css). */

/* --- icons: one family, 1.75 px strokes, drawn inline in index.html ----------------------------------------- */
.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.ic-play,
.ic-pause {
  fill: currentColor;
}

/* --- rich tooltip (tip.js) ----------------------------------------------------------------------------------- */
.rip-tip {
  position: fixed;
  z-index: 10000;
  max-width: 250px;
  padding: 8px 10px 9px;
  border: 1px solid #34343a;
  border-radius: 8px;
  background: #0e0e10;
  box-shadow: 0 10px 28px #000b;
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.rip-tip[data-side='below'] {
  transform: translateY(-3px);
}
.rip-tip.on {
  opacity: 1;
  transform: none;
}
.rip-tip[hidden] {
  display: none;
}
.rip-tip .rt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rip-tip b {
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.rip-tip p {
  margin: 3px 0 0;
  color: #a8a8b0;
  font-size: 11.5px;
}
.rip-tip .rt-head:last-child + p,
.rip-tip .rt-head + p:empty {
  margin: 0;
}
.rip-tip kbd {
  padding: 1px 6px;
  border: 1px solid #3d3d44;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #1c1c20;
  color: #e9e9ec;
  font:
    600 10.5px/1.5 'RipClip Mono',
    ui-monospace,
    monospace;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .rip-tip {
    transition: none;
  }
}

/* --- player bar ---------------------------------------------------------------------------------------------- */
main .transport {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
main .transport .tp-btn {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c4c4c9;
  font-size: 0;
  cursor: pointer;
}
main .transport .tp-btn:hover:not(:disabled) {
  background: #26262b;
  color: #fff;
}
main .transport .tp-btn:focus-visible {
  outline: 2px solid #f3f2eeb3;
  outline-offset: -2px;
}
main .transport .tp-btn:disabled {
  opacity: 0.32;
  cursor: default;
}
main .transport #playBtn.tp-play {
  width: 36px;
  height: 36px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--q-ink, #f3f2ee);
  color: var(--q-ink-ink, #0b0b0d);
}
main .transport #playBtn.tp-play:hover {
  background: #fff;
  color: #000;
}
main .transport #playBtn .ic-pause,
main .transport #muteBtn .ic-muted {
  display: none;
}
main .transport #playBtn[data-playing='1'] .ic-play,
main .transport #muteBtn[data-muted='1'] .ic-vol {
  display: none;
}
main .transport #playBtn[data-playing='1'] .ic-pause,
main .transport #muteBtn[data-muted='1'] .ic-muted {
  display: block;
}
main .transport #muteBtn[data-muted='1'] {
  background: #26262b;
  color: #fff;
}
/* a narrow player column (a 1100 px window) drops the total time, then the frame-save button, so nothing overflows */
main .transport {
  container-type: inline-size;
}
@container (max-width: 520px) {
  #duration {
    display: none;
  }
}
@container (max-width: 440px) {
  #snapBtn,
  #fullBtn {
    display: none;
  }
  main .transport .tp-btn {
    width: 30px;
  }
  main .transport #playBtn.tp-play {
    width: 34px;
    height: 34px;
    margin-right: 2px;
  }
  main .transport #clock {
    min-width: 54px;
    margin-left: 2px;
  }
  main .transport .ratio-pick {
    margin: 0 2px;
  }
}
main .transport #clock,
main .transport #duration {
  flex: none;
  min-width: 58px;
  color: #e4e4e8;
  font:
    400 12px/1 'RipClip Mono',
    ui-monospace,
    Consolas,
    monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
}
main .transport #clock {
  margin-left: 6px;
}
main .transport #duration {
  color: #85858d;
}
main .transport .ratio-pick {
  flex: none;
  width: auto;
  height: 28px;
  min-height: 0;
  margin: 0 4px;
  padding: 0 22px 0 9px;
  border: 1px solid #2c2c31;
  border-radius: 7px;
  background-color: #1c1c20;
  color: #e4e4e8;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
main .transport .ratio-pick:hover {
  background-color: #26262b;
}
/* the seek bar: a 4 px rail with a white fill (--p, app-project.js seekFill); the knob shows on hover or focus */
main .transport #seek {
  flex: 1 1 60px;
  min-width: 60px;
  height: 18px;
  margin: 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  --p: 0%;
}
main .transport #seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f3f2ee var(--p), #34343a var(--p));
}
main .transport #seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #0b0b0d99;
  transform: scale(0);
  transition: transform 0.12s ease;
}
main .transport #seek:hover::-webkit-slider-thumb,
main .transport #seek:focus-visible::-webkit-slider-thumb,
main .transport #seek:active::-webkit-slider-thumb {
  transform: scale(1);
}
main .transport #seek::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #34343a;
}
main .transport #seek::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: #f3f2ee;
}
main .transport #seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  background: #fff;
}
main .transport #seek:focus-visible {
  outline: none;
}

/* --- timeline toolbar: one row of icon buttons ---------------------------------------------------------------- */
main .tl-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  min-height: 38px;
  margin: 0;
  padding: 4px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #34343a transparent;
  border-bottom: 1px solid #1e1e20;
}
.tl-group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}
.tl-sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 7px;
  background: #34343a;
}
.tl-grow {
  flex: 1 1 0;
  min-width: 8px;
}
main .tl-tools .tl-ibtn {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c4c4c9;
  font-size: 0;
  opacity: 1;
  cursor: pointer;
}
main .tl-tools .tl-ibtn:hover:not(:disabled) {
  background: #26262b;
  color: #fff;
}
main .tl-tools .tl-ibtn:focus-visible,
main .tl-tools .tl-recmute:has(input:focus-visible) {
  outline: 2px solid #f3f2eeb3;
  outline-offset: -2px;
}
main .tl-tools .tl-ibtn:disabled {
  opacity: 0.3;
  cursor: default;
}
/* on = white on a raised grey (never green); the toggles also set aria-pressed */
main .tl-tools .tl-ibtn.on,
main .tl-tools .tl-ibtn[aria-pressed='true'],
main .tl-tools .tl-recmute:has(input:checked) {
  background: #2a2a30;
  color: #fff;
  box-shadow: inset 0 0 0 1px #46464e;
}
main .tl-tools .tl-recmute:not(:has(input:checked)) {
  opacity: 0.55;
}
main .tl-tools .tl-record.on {
  width: auto;
  padding: 0 9px 0 7px;
  gap: 5px;
  grid-auto-flow: column;
  background: #3a1f22;
  color: #ff6b6b;
  box-shadow: inset 0 0 0 1px #6b2f35;
}
main .tl-tools .tl-rec-text {
  font:
    600 11.5px/1 'RipClip Mono',
    ui-monospace,
    monospace;
  letter-spacing: 0;
}
main .tl-tools .tl-rec-text:empty {
  display: none;
}
main .tl-tools .tl-zoom {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin: 0 0 0 4px;
  color: #85858d;
}
main .tl-tools .tl-zoom .ic {
  width: 16px;
  height: 16px;
}
main .tl-tools .tl-zoom input {
  width: 104px;
  margin: 0 2px;
}
/* the shortcut list behind the ? button (a fixed popover set by app-timeline.js) */
.tl-help {
  position: fixed;
  z-index: 9000;
  width: 290px;
  padding: 12px 14px 14px;
  border: 1px solid #34343a;
  border-radius: 10px;
  background: #121214;
  box-shadow: 0 14px 40px #000c;
  color: #d4d4d8;
  font-size: 12px;
}
.tl-help[hidden] {
  display: none;
}
.tl-help h4 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.tl-help dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0;
}
.tl-help dt {
  color: #e9e9ec;
  font:
    600 11px/1.5 'RipClip Mono',
    ui-monospace,
    monospace;
  white-space: nowrap;
}
.tl-help dd {
  margin: 0;
  color: #9a9aa2;
}

/* --- timeline lanes -------------------------------------------------------------------------------------------- */
/* a transition on a cut is a box as wide as the overlap it covers (CapCut), with a swap icon; it selects the cut */
.tl-cut.tl-cut-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max(var(--w, 0%), 30px);
  height: 22px;
  margin: -11px 0 0;
  padding: 0 4px;
  overflow: hidden;
  border: 1px solid #f3f2ee;
  border-radius: 5px;
  background: #2a2a30;
  color: #f3f2ee;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
  z-index: 4;
}
.tl-cut.tl-cut-box svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tl-cut.tl-cut-box b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}
.tl-cut.tl-cut-box:hover {
  background: #3a3a42;
}
.tl-cut.tl-cut-box.selected,
.tl-cut.tl-cut-box.dnd-hot {
  background: #f3f2ee;
  color: #0b0b0d;
  box-shadow: 0 0 0 3px #ffffff40;
}
/* the shaded ends of a text or sticker bar are its In / Out animation; a stripe means it also loops */
.tl-block .tl-anim {
  position: absolute;
  top: 0;
  bottom: 0;
  max-width: 100%;
  pointer-events: none;
}
.tl-block .tl-anim.in {
  left: 0;
  background: linear-gradient(90deg, #000000c4, #00000052);
  border-right: 1px dashed #ffffffb3;
  border-radius: 4px 0 0 4px;
}
.tl-block .tl-anim.out {
  right: 0;
  background: linear-gradient(270deg, #000000c4, #00000052);
  border-left: 1px dashed #ffffffb3;
  border-radius: 0 4px 4px 0;
}
.tl-block.tl-looping {
  background-image: repeating-linear-gradient(135deg, #ffffff1f 0 4px, transparent 4px 9px);
}
.tl-block.tl-ov.tl-looping {
  background-color: #6a5616;
}
/* below 1100 px the video lane and its name were different heights, which pushed every name after it off its lane */
main .tl-track[data-track='video'],
main .tl-labels span[data-video-label] {
  height: 42px;
  line-height: 42px;
}
/* effects: a lane of its own, directly under Adjustments and above the video, a bar per effect */
.tl-track[data-track='effects'] {
  background: #17131a;
}
.tl-fx {
  gap: 6px;
  border-color: #b0386a;
  background: linear-gradient(180deg, #7d2646, #6b1f3a);
}
.tl-fx.selected {
  box-shadow:
    inset 0 0 0 2px #f2f2f4,
    0 0 0 1px #0008;
}

/* --- density: the editor read like ~130% zoom next to CapCut; about 12% smaller, still readable ------------------ */
/* neutral states everywhere inside the editor: white rings, grey numbers (green stays on Export and the logo) */
main {
  --accent: #f3f2ee;
}
main .tl-seg.selected,
main .tl-ov.selected {
  border-color: #f3f2ee;
  box-shadow: 0 0 0 1px #f3f2ee inset;
}
main .overlay-card.selected {
  border-color: #8a8a92;
  box-shadow: 0 0 0 1px #8a8a9255;
}
main output {
  color: #b9b9c0;
}
body main .cc-filter.active,
body main .cc-fx button.added {
  border-color: transparent;
  color: #fff;
}
main .cc-texttpl button:hover {
  border-color: #5a5a62;
}
@media (min-width: 1100px) {
  header {
    height: 46px;
    gap: 12px;
  }
  header .brand {
    font-size: 15px;
    gap: 8px;
  }
  header .brand .studio-mark {
    width: 24px;
    height: 24px;
    font-size: 17px;
  }
  header .project-title input {
    padding: 5px 9px;
    font-size: 13px;
  }
  header #saveStatus {
    font-size: 11px;
  }
  header .header-actions {
    gap: 6px;
  }
  header .header-actions button {
    min-height: 28px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 550;
    border-radius: 7px;
  }
  header .header-actions #exportBtn {
    font-weight: 700;
  }
  header .versions-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    min-height: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    color: #a1a1aa;
    vertical-align: middle;
  }
  header .versions-btn:hover {
    background: #26262b;
    color: #fff;
  }
  header .versions-btn .ic {
    width: 16px;
    height: 16px;
  }
  /* the account is one compact pill; Sign out drops down from it */
  header .account-chip {
    position: relative;
    display: inline-flex;
  }
  header .account-chip b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 130px;
    height: 28px;
    padding: 0 10px 0 11px;
    overflow: hidden;
    border: 1px solid #2c2c31;
    border-radius: 7px;
    background: #1c1c20;
    font-size: 12px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
  }
  header .account-chip b::after {
    content: '';
    flex: none;
    width: 5px;
    height: 5px;
    margin: -2px 0 0 2px;
    border: solid #9a9aa2;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }
  header .account-chip b:hover,
  header .account-chip:focus-within b {
    background: #26262b;
  }
  header .account-chip #signOutBtn {
    position: absolute;
    top: calc(100% - 2px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #34343a;
    border-radius: 8px;
    background: #121214;
    box-shadow: 0 10px 28px #000b;
    font-size: 12px;
    text-align: left;
  }
  header .account-chip:hover #signOutBtn,
  header .account-chip:focus-within #signOutBtn {
    display: block;
  }
  main {
    height: calc(100dvh - 46px);
    gap: 6px;
    padding: 6px;
  }
  .library,
  .inspector {
    padding: 12px;
  }
  /* left panel: category icons and labels smaller, a narrower sub list, 4-5 tiles to a row */
  .library.cc-panel {
    padding: 0;
  }
  main .cc-cats {
    padding: 4px 4px 0;
  }
  main .cc-cats button {
    gap: 3px;
    padding: 5px 1px 6px;
    font-size: 9.5px;
    font-stretch: 84%; /* Mona Sans' width axis: ten names fit the panel without clipping */
    font-weight: 500;
    letter-spacing: 0;
  }
  main .cc-cats button svg {
    width: 17px;
    height: 17px;
  }
  main .cc-subs {
    width: 96px;
    gap: 4px;
    padding: 8px 6px;
  }
  main .cc-subs button {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
  }
  main .cc-content {
    padding: 10px 10px 16px;
  }
  main .cc-section {
    gap: 8px;
  }
  /* tiles: the picture, then its name below in small muted text (CapCut) */
  main .cc-fx,
  main .cc-filters {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 10px 6px;
  }
  main .cc-fx button,
  main .cc-filter {
    align-items: stretch;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a1a1aa;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
  }
  main .cc-fx button i,
  main .cc-filter i {
    border: 1px solid #2c2c31;
    border-radius: 7px;
  }
  main .cc-fx button span,
  main .cc-filter span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  main .cc-fx button:hover,
  main .cc-filter:hover {
    color: #e4e4e8;
  }
  main .cc-fx button:hover i,
  main .cc-filter:hover i {
    border-color: #6a6a72;
  }
  main .cc-fx button.added i,
  main .cc-filter.active i {
    box-shadow: 0 0 0 2px #f3f2ee;
  }
  main .cc-fx-head {
    margin: 6px 0 -2px;
    font-size: 11px;
  }
  main .cc-transition-grid,
  main .cc-cuts .cc-transition-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 10px 6px;
    margin-bottom: 10px;
  }
  main .cc-transition-grid button,
  main .cc-cuts .cc-transition-grid button {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a1a1aa;
    font-size: 11px;
    font-weight: 400;
  }
  main .cc-transition-grid button > span[aria-hidden],
  main .cc-cuts .cc-transition-grid button > span[aria-hidden] {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    border: 1px solid #2c2c31;
    border-radius: 7px;
    background: #171719;
    color: #d4d4d8;
    font-size: 18px;
  }
  main .cc-transition-grid button.tp-on > span[aria-hidden] {
    display: none; /* the live preview (tileprev.js) takes the icon's place */
  }
  main .cc-transition-grid button strong {
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  main .cc-transition-grid button .tp-canvas {
    border: 1px solid #2c2c31;
    border-radius: 7px;
  }
  main .cc-transition-grid button:hover {
    color: #e4e4e8;
  }
  main .cc-transition-grid button[aria-pressed='true'] {
    background: transparent;
    color: #fff;
  }
  main .cc-transition-grid button[aria-pressed='true'] > span[aria-hidden],
  main .cc-transition-grid button[aria-pressed='true'] .tp-canvas {
    box-shadow: 0 0 0 2px #f3f2ee;
  }
  main .cc-cut-family {
    margin-top: 2px;
    font-size: 10.5px;
  }
  main .cc-texttpl {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
  }
  main .cc-texttpl button {
    min-height: 62px;
    gap: 5px;
    padding: 8px 4px;
  }
  main .cc-texttpl b {
    font-size: 12px;
  }
  main .cc-texttpl span {
    font-size: 10.5px;
  }
  /* forms in the left panel and the Style Studio: 12 px labels, tighter rows */
  main :is(.inspector, .cc-content) .field {
    gap: 5px;
    margin-bottom: 10px;
    font-size: 12px;
  }
  main :is(.inspector, .cc-content) .range-field {
    gap: 5px 8px;
    margin-bottom: 12px;
    font-size: 12px;
  }
  main
    :is(.inspector, .cc-content)
    :is(input, select, textarea):not([type='checkbox']):not([type='range']):not([type='color']) {
    padding: 6px 8px;
    font-size: 12px;
  }
  main :is(.inspector, .cc-content) .hint {
    font-size: 11px;
    line-height: 1.45;
  }
  main .inspector .section-title {
    margin-bottom: 10px;
  }
  main .inspector .tabs {
    gap: 2px;
    margin-bottom: 10px;
  }
  main .inspector .tabs button {
    padding: 7px 8px;
    font-size: 11.5px;
  }
  main .inspector .preset-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
  }
  main .inspector .preset-tile .sample {
    height: 54px;
  }
  main .inspector .preset-tile .name {
    padding: 6px 8px;
    font-size: 11px;
  }
  /* the trim bar and the lanes */
  main .trim-bar {
    padding: 4px 10px;
    font-size: 11px;
  }
  main .trim-bar input[type='number'] {
    width: 64px;
    padding: 4px 6px;
    font-size: 12px;
  }
  main .trim-bar button {
    min-height: 24px;
    padding: 3px 9px;
    font-size: 11px;
  }
  main .tl-body {
    gap: 6px;
    padding: 4px 14px 8px 10px;
  }
  main .tl-labels {
    width: 78px;
    gap: 4px;
  }
  main .tl-tracks {
    gap: 4px;
  }
  main .tl-labels span,
  main .tl-track {
    height: 26px;
    line-height: 26px;
  }
  main .tl-labels span:first-child {
    height: 30px;
    line-height: 30px;
  }
  main .tl-track[data-track='video'],
  main .tl-labels span[data-video-label] {
    height: 48px;
    line-height: 48px;
  }
  main .tl-block {
    font-size: 10.5px;
  }
  main .tl-track[data-track='effects'] .tl-block {
    height: 22px;
  }
}
