/* CLAUDE 10-11: the inspector of a selected video clip (clipinsp.js). It sits in the right-hand panel in place of the Style
   studio (tiledrop.js's .dnd-inspect), and is the bottom sheet on a phone.
   CLAUDE 10-12 Graphite (owner 10-11: "these don't all need boxes, maybe the different pages, but below do a simple
   dropdown with the main 2 available, no box behind it, make it sleek"): one light row of page tabs (Video / Audio /
   Speed / Adjust) with an underline; under it, sections without boxes divided by hairlines (Transform and Opacity open,
   the rest folded). CLAUDE 11-09: rows of name, slider and typed value on one line; one keyframe control per section head. */
.ci {
  display: grid;
  gap: 0;
  align-content: start;
}
.ci-tabs,
.ci-sub {
  display: flex;
  gap: 2px;
}
.ci-tabs {
  gap: var(--s-5);
  margin-bottom: 0;
  border-bottom: 1px solid var(--c-line);
}
.ci-tabs button {
  flex: 0 0 auto;
  min-height: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--c-fg-3);
  font-size: var(--t-label);
  font-weight: 500;
  /* the open tab's bar is the row's sliding one (editor.css .ed-tabs, wired in panels.js) */
  transition:
    color var(--d-hover) ease,
    scale 220ms var(--ease-spring);
}
.ci-tabs button:hover {
  color: var(--c-fg-2);
  background: transparent;
}
.ci-tabs button[aria-selected='true'] {
  border-color: transparent;
  background: transparent;
  color: var(--c-fg);
}
/* Basic / Mask / Animation: on a phone's sheet a light segmented row (the sheet opens one at a time); on a desktop
   they are the sections below instead (see the end of this file) */
.ci-sub {
  gap: var(--s-4);
  margin-top: var(--s-2);
}
.ci-sub button {
  flex: 0 0 auto;
  min-height: 0;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--c-fg-3);
  font-size: var(--t-label);
  font-weight: 500;
}
.ci-sub button[aria-selected='true'] {
  background: transparent;
  color: var(--c-fg);
}
.ci-tabs button:focus-visible,
.ci-sub button:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}
.ci-body,
.ci-pane {
  display: grid;
  gap: 0;
  align-content: start;
}
.ci-pane[hidden] {
  display: none;
}
.ci-say:empty {
  display: none;
}
.ci-say {
  margin: var(--s-2) 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--c-raised);
  border: 0;
  color: var(--c-fg-2);
}
/* a section: its title, then its rows; a hairline above every section after the first, no box */
.ci-sec {
  display: grid;
  gap: var(--s-3);
  border: 0;
  border-top: 1px solid var(--c-line);
  border-radius: 0;
  background: transparent;
  padding: var(--s-4) 0;
}
.ci-pane > .ci-sec:first-child,
.ci-pane > .ci-sub + .ci-sec {
  border-top: 0;
}
.ci-sec[hidden] {
  display: none;
}
.ci-sec > h4 {
  margin: 0;
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--c-fg);
}
.ci .hint {
  margin: 0;
  color: var(--c-fg-3);
  font-size: var(--t-meta);
  line-height: 1.45;
}
.ci .hint:empty {
  display: none;
}
/* a paragraph of help is two quiet lines here, as in the left panels; a click (or focus inside it) opens the rest.
   CLAUDE 11-03 (owner: "this auto popping out when scrolling over is shit"): no longer on hover */
body:not(.pe-on) .ci-body .hint {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  cursor: default;
}
body:not(.pe-on) .ci-body .hint:is(.open, :focus-within) {
  -webkit-line-clamp: unset; /* (a phone's sheet shows the whole line: it has no hover) */
}

/* CLAUDE 11-09 CapCut's Transform: a section head (the title, then the one keyframe control and the reset); rows of the
   name | the slider | the typed number and its unit, on one line */
.ci-head {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
}
.ci-head > h4 {
  flex: 1;
  margin: 0;
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--c-fg);
}
/* the keyframe bar (keyframes.js), compact: ◀ ◆ ▶ as quiet icon buttons; its count is not shown, its ease is a row */
.ci-head .kf-bar {
  flex-wrap: nowrap;
  gap: 2px;
  margin: 0;
}
.ci-head .kf-bar small {
  display: none;
}
.ci-head :is(.kf-bar button, .ci-reset) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-fg-2);
  font-size: var(--t-meta);
  transition:
    background var(--d-hover) ease,
    color var(--d-hover) ease;
}
.ci-head :is(.kf-bar button, .ci-reset):hover:not(:disabled) {
  background: var(--c-raised);
  color: var(--c-fg);
}
.ci-head :is(.kf-bar button, .ci-reset, .kf-dia):focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}
.ci-head :is(.kf-bar button, .ci-reset):disabled {
  opacity: 0.3;
  background: transparent;
  cursor: default;
}
/* the diamond button: the diamond alone (its "Keyframe" name stays for screen readers; the Premium badge still shows) */
.ci-head .kf-here {
  gap: 0;
}
.ci-head .kf-here span {
  font-size: 0;
}
.ci-head .kf-here .kf-dia {
  transform: rotate(45deg) scale(0.9);
}
.ci-head > .kf-dia {
  margin: 0 8px;
}
.ci-rows {
  display: grid;
  gap: var(--s-1);
}
.ci-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 68px;
  align-items: center;
  column-gap: var(--s-3);
  min-height: 32px;
  margin: 0;
  color: var(--c-fg-2);
  font-size: var(--t-label);
}
.ci-row[hidden] {
  display: none;
}
.ci-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ci-row input[type='range'] {
  width: 100%;
  margin: 0;
}
/* the typed value: a small field (it can be typed in), its unit inside it */
.ci-num {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding: 0 8px 0 4px;
  border-radius: var(--r-xs);
  background: var(--c-raised);
  color: var(--c-fg-3);
  transition: box-shadow var(--d-hover) ease;
}
.ci-num:hover {
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
}
.ci-num:focus-within {
  box-shadow: inset 0 0 0 1px var(--c-focus);
}
.ci-num input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--c-fg);
  font: inherit;
  font-size: var(--t-label);
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.ci-num input::-webkit-inner-spin-button,
.ci-num input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ci-num i {
  font-style: normal;
  font-size: var(--t-meta);
}
.ci-row:has(input:disabled) {
  opacity: 0.4;
}
.ci-row input:disabled {
  cursor: default;
}
/* Position while the picture fills the frame: it moves nothing yet (the row's title says so) */
.ci-row.ci-idle :is(.ci-name, input[type='range']) {
  opacity: 0.5;
}
/* the ease of the keyframe under the playhead, and the blend mode: a name and a menu */
.ci-ease,
.ci-blend .field {
  grid-template-columns: 76px minmax(0, 1fr);
}
.ci-blend .field {
  display: grid;
  align-items: center;
  column-gap: var(--s-3);
  margin: 0;
  color: var(--c-fg-2);
  font-size: var(--t-label);
}
.ci-ease select,
.ci-blend .field select {
  width: 100%;
  min-height: 28px;
  font-size: var(--t-label);
}
/* Quick moves: chips under their name */
.ci-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ci-moves span {
  width: 100%;
  font-size: var(--t-meta);
  color: var(--c-fg-3);
}
.ci-moves button {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-raised);
  color: var(--c-fg-2);
  font-size: var(--t-label);
  transition:
    background var(--d-hover) ease,
    color var(--d-hover) ease,
    scale var(--d-press) ease;
}
.ci-moves button:hover:not(:disabled) {
  background: var(--c-surface-2);
  color: var(--c-fg);
}
.ci-moves button:active:not(:disabled) {
  scale: 0.97;
}
.ci-moves button:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}
.ci-moves button:disabled {
  opacity: 0.4;
  cursor: default;
}
.ci-layers {
  display: grid;
  gap: 6px;
}
/* CLAUDE 11-09: a section's one action (Freeze frame, Add an adjustment layer) is the raised pill (controls.css .m-btn)
   at the row's start, not a line of text floating in the middle of the panel */
.ci-sec > .m-btn {
  justify-self: start;
}
/* CLAUDE 10-20: the Layout tab's rows mirrored for a phone (clipinsp.js mirrors): a desktop has them in its Layout tab */
.ci-phone {
  display: none;
}

/* the clip tools' box (clipfx.js) shows one view at a time: Basic has opacity, Arrange and Reverse / Stabilize; Mask and
   Animation each have their own sub-tab, which names them */
.ci .cf .cf-at {
  display: none;
}
.ci .cf[data-view='basic'] .cf-group[data-g='anim'],
.ci .cf[data-view='basic'] .cf-group[data-g='mask'],
.ci .cf[data-view='mask'] .cf-group:not([data-g='mask']),
.ci .cf[data-view='anim'] .cf-group:not([data-g='anim']) {
  display: none;
}
.ci .cf[data-view='mask'] .cf-group > summary,
.ci .cf[data-view='anim'] .cf-group > summary {
  display: none;
}
.ci .cf[data-view='mask'] .cf-group,
.ci .cf[data-view='anim'] .cf-group {
  padding-top: 10px;
}
.ci .cf[data-view='mask'] > .cf-hint,
.ci .cf[data-view='anim'] > .cf-hint {
  display: none;
}

/* a desktop: no second tab row; Basic shows every group (Animation and Mask too) as a folding section under Transform */
@media (min-width: 768px) {
  body:not(.pe-on) .ci-sub {
    display: none;
  }
  body:not(.pe-on) .ci .cf[data-view='basic'] .cf-group[data-g='anim'],
  body:not(.pe-on) .ci .cf[data-view='basic'] .cf-group[data-g='mask'] {
    display: block;
  }
  body:not(.pe-on) .ci .cf[data-view='basic'] > .cf-hint {
    display: none;
  }
}

/* the video's own sound: the audio editor's card (app-audioed.js), here not hidden and without its head (the section
   above names it) */
.ci .audio-ed {
  display: block;
}
.ci .audio-ed .overlay-head {
  display: none;
}
.ci .audio-ed .ae-tabs {
  margin-top: 0;
}

/* a phone: the sheet's controls are a finger wide */
@media (max-width: 767.98px) {
  body.pe-on .ci-tabs button,
  body.pe-on .ci-sub button,
  body.pe-on .ci-moves button,
  body.pe-on .ci-head :is(.kf-bar button, .ci-reset) {
    min-height: 44px;
    min-width: 40px;
  }
  body.pe-on .ci-row input[type='range'] {
    height: 44px;
    margin-block: 0;
  }
  body.pe-on .ci-num {
    height: 36px;
  }
  body.pe-on .ci-num input {
    font-size: var(--t-input); /* under 16 px iOS zooms the page on focus */
  }
  /* the opacity diamond keeps its look and gets a finger-sized hit area */
  body.pe-on .ci-head > .kf-dia {
    position: relative;
  }
  body.pe-on .ci-head > .kf-dia::before {
    content: '';
    position: absolute;
    inset: -14px;
  }
  /* "bring it into view" lands the section below the sheet's own header */
  body.pe-on .ci-sec,
  body.pe-on .cf-group {
    scroll-margin-top: 68px;
  }
  /* CLAUDE 10-20 (owner: "one setting, one home"; the 10-19 audit: Edit > Animations was toolbar > sheet > Video tab >
     Animation sub-tab > In / Out / Combo > chips): each clip tool opens its own part of the inspector as its sheet,
     titled with the tool, so the tab rows above it go; Animations is then sheet > In / Out / Combo, as CapCut's */
  body.pe-on .ci-tabs,
  body.pe-on .ci-sub {
    display: none;
  }
  body.pe-on .ci-phone:not([hidden]) {
    display: grid;
    gap: var(--s-2);
  }
}
