#web-video-editor,
#web-video-editor * {
  box-sizing: border-box;
}

#web-video-editor {
  --editor-ink: #182321;
  --editor-muted: #6b7772;
  --editor-line: #dfe7e2;
  --editor-paper: #f5f8f5;
  --editor-accent: #087f68;
  color: var(--editor-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 12px 0 36px;
}

#web-video-editor .sticky-note {
  margin: 0 0 18px;
  padding: 9px 13px;
  border-left: 3px solid #d39b3e;
  border-radius: 7px;
  background: #fff8e9;
  color: #624a22;
  font-size: 13px;
}

#web-video-editor #count-display {
  font-weight: 750;
}

#web-video-editor .app-lead {
  margin: 0 0 20px;
  color: var(--editor-muted);
  font-size: 14px;
  line-height: 1.8;
}

#web-video-editor h2 {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--editor-ink);
  font-size: 17px;
  line-height: 1.4;
}

#web-video-editor h2::before,
#web-video-editor h2::after {
  content: none !important;
  display: none !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
}

#web-video-editor .editor-shell {
  overflow: clip;
  border: 1px solid var(--editor-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(27, 55, 43, .08);
}

#web-video-editor .editor-topbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--editor-line);
  background: #fbfcfb;
}

#web-video-editor #video-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

#web-video-editor .file-button,
#web-video-editor .button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}

#web-video-editor .file-button:hover,
#web-video-editor .button:hover:not(:disabled) {
  transform: translateY(-1px);
}

#web-video-editor .file-button,
#web-video-editor .button-accent {
  background: var(--editor-accent);
  color: #fff;
}

#web-video-editor .button-dark {
  background: #1c2925;
  color: #fff;
}

#web-video-editor .button-quiet {
  min-height: 34px;
  margin-left: auto;
  background: #edf2ee;
  color: #47564e;
}

#web-video-editor .button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

#web-video-editor .file-label {
  overflow: hidden;
  color: var(--editor-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#web-video-editor .editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
}

#web-video-editor .clip-section {
  padding: 20px 22px;
  border-top: 1px solid var(--editor-line);
}

#web-video-editor .clip-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#web-video-editor .clip-heading span {
  color: var(--editor-muted);
  font-size: 12px;
}

#web-video-editor .clip-section .panel-help {
  margin: 7px 0 12px;
}

#web-video-editor .clip-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#web-video-editor .clip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--editor-line);
  border-radius: 10px;
  background: #fff;
}

#web-video-editor .clip-item.is-active {
  border-color: var(--editor-accent);
  background: #f1faf6;
}

#web-video-editor .clip-name {
  overflow: hidden;
  flex: 1;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--editor-ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

#web-video-editor .clip-range {
  flex: 0 0 auto;
  color: var(--editor-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#web-video-editor .clip-action {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--editor-line);
  border-radius: 7px;
  background: #fff;
  color: var(--editor-ink);
  cursor: pointer;
}

#web-video-editor .clip-action:disabled {
  opacity: .4;
  cursor: not-allowed;
}

#web-video-editor .preview-column {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  min-width: 0;
  padding: 22px;
  background: var(--editor-paper);
}

#web-video-editor .preview-frame {
  position: relative;
  display: flex;
  width: 100%;
  max-height: 560px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #111714;
  aspect-ratio: 16 / 9;
  transition: aspect-ratio .2s ease;
}

#web-video-editor .preview-frame:not(.is-loaded) {
  height: clamp(250px, 38vw, 440px);
  aspect-ratio: auto;
}

#web-video-editor .preview-frame.ratio-square {
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 1;
}

#web-video-editor .preview-frame.ratio-tall {
  width: min(100%, 340px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
}

#web-video-editor #source-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#web-video-editor .preview-frame.is-loaded #source-video {
  display: block;
}

#web-video-editor .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 16px;
  border: 0;
  background: transparent;
  color: #d3ddd7;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

#web-video-editor .empty-state:hover .empty-mark,
#web-video-editor .empty-state:focus-visible .empty-mark {
  background: rgba(14, 137, 111, .35);
  border-color: #35c4a0;
}

#web-video-editor .empty-state:focus-visible {
  outline: 2px solid #35c4a0;
  outline-offset: -4px;
}

#web-video-editor .empty-state strong {
  color: #f3f7f4;
  font-size: 15px;
}

#web-video-editor .empty-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 15px;
  font-size: 27px;
}

#web-video-editor .preview-frame.is-loaded .empty-state {
  display: none;
}

#web-video-editor .title-overlay {
  position: absolute;
  right: 8%;
  bottom: 9%;
  left: 8%;
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .8), 0 1px 14px rgba(0, 0, 0, .5);
  white-space: pre-wrap;
}

#web-video-editor .preview-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

#web-video-editor .time-readout {
  color: var(--editor-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

#web-video-editor .ratio-control {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--editor-muted);
  font-size: 12px;
}

#web-video-editor select,
#web-video-editor input,
#web-video-editor textarea {
  accent-color: var(--editor-accent);
}

#web-video-editor select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--editor-line);
  border-radius: 7px;
  background: #fff;
  color: var(--editor-ink);
}

#web-video-editor .seek-control,
#web-video-editor .seek-control input {
  display: block;
  width: 100%;
}

#web-video-editor .seek-control {
  padding-top: 11px;
}

#web-video-editor .settings-panel {
  padding: 23px 20px;
  border-left: 1px solid var(--editor-line);
}

#web-video-editor .panel-help,
#web-video-editor .export-note {
  margin: 6px 0 15px;
  color: var(--editor-muted);
  font-size: 12px;
  line-height: 1.65;
}

#web-video-editor .time-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#web-video-editor .time-fields > label,
#web-video-editor .field-label {
  display: block;
  color: #4c5b54;
  font-size: 12px;
  font-weight: 650;
}

#web-video-editor .time-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--editor-muted);
  font-size: 11px;
}

#web-video-editor .time-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 37px;
  padding: 0 8px;
  border: 1px solid var(--editor-line);
  border-radius: 7px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

#web-video-editor .segment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

#web-video-editor .segment-actions .button {
  min-width: 0;
  padding: 0 9px;
  font-size: 12px;
}

#web-video-editor .segment-actions .button-quiet {
  margin-left: 0;
}

#web-video-editor .panel-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--editor-line);
}

#web-video-editor .settings-panel h2 + .field-label {
  margin-top: 12px;
}

#web-video-editor textarea {
  width: 100%;
  min-height: 76px;
  margin-top: 7px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--editor-line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

#web-video-editor .caption-options {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 14px;
  margin-top: 11px;
}

#web-video-editor .caption-options .field-label {
  margin: 0;
}

#web-video-editor .caption-options input[type="color"] {
  width: 38px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--editor-line);
  border-radius: 6px;
  background: #fff;
}

#web-video-editor .caption-options input[type="range"] {
  width: 110px;
}

#web-video-editor .bgm-file {
  display: block;
  width: 100%;
  margin-top: 7px;
  color: var(--editor-muted);
  font: inherit;
  font-size: 12px;
}

#web-video-editor .bgm-label {
  overflow: hidden;
  margin: 8px 0;
  color: var(--editor-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#web-video-editor .bgm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#web-video-editor .bgm-controls input[type="range"] {
  min-width: 60px;
  flex: 1;
}

#web-video-editor .bgm-controls .button-quiet {
  min-height: 34px;
  margin-left: 0;
  padding: 0 9px;
  font-size: 11px;
}

#web-video-editor .settings-panel > .button-accent {
  width: 100%;
}

#web-video-editor #export-progress {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 12px;
  accent-color: var(--editor-accent);
}

#web-video-editor .status-message {
  min-height: 36px;
  margin: 10px 0 0;
  color: var(--editor-muted);
  font-size: 11px;
  line-height: 1.6;
}

#web-video-editor .guide-section {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--editor-line);
  border-radius: 15px;
  background: #fff;
}

#web-video-editor .guide-section ol {
  margin: 13px 0 10px;
  padding-left: 22px;
  color: #3f4f47;
  font-size: 13px;
  line-height: 1.9;
}

#web-video-editor .guide-section p {
  margin: 0;
  color: var(--editor-muted);
  font-size: 12px;
  line-height: 1.7;
}

#web-video-editor .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 800px) {
  #web-video-editor .editor-grid {
    grid-template-columns: 1fr;
  }

  #web-video-editor .settings-panel {
    border-top: 1px solid var(--editor-line);
    border-left: 0;
  }

  #web-video-editor .preview-column {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 14px;
  }
}

@media (max-width: 520px) {
  #web-video-editor .editor-topbar {
    flex-wrap: wrap;
    gap: 9px;
    padding: 11px;
  }

  #web-video-editor .file-label {
    order: 3;
    width: 100%;
  }

  #web-video-editor .preview-controls {
    flex-wrap: wrap;
    gap: 9px;
  }

  #web-video-editor .ratio-control {
    width: 100%;
    margin-left: 0;
  }

  #web-video-editor .guide-section {
    padding: 18px;
  }
}
