.se-app {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 32px 0 80px;
  color: #0f1f3d;
}

.se-app *,
.se-app *::before,
.se-app *::after {
  box-sizing: border-box;
}

.se-intro {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 34px 38px;
  border: 1px solid rgba(110, 132, 255, 0.3);
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(71, 221, 255, 0.24), transparent 32%),
    linear-gradient(120deg, #061730 0%, #102c65 58%, #5a35d5 100%);
  box-shadow: 0 22px 58px rgba(21, 46, 100, 0.2);
}

.se-intro::after {
  position: absolute;
  right: -55px;
  bottom: -95px;
  width: 290px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
  transform: rotate(-12deg);
}

.se-intro > * {
  position: relative;
  z-index: 1;
}

.se-eyebrow {
  margin: 0 0 10px;
  color: #70e7ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.se-intro h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.se-intro p:last-child {
  max-width: 690px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.75;
}

.se-intro__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 265px;
}

.se-intro__badges span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ecf8ff;
  background: rgba(5, 17, 44, 0.34);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.se-panel {
  margin-top: 20px;
  padding: 30px;
  border: 1px solid #dbe5f5;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(31, 62, 118, 0.1);
}

.se-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.se-step {
  display: inline-flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 9px 22px rgba(72, 77, 222, 0.22);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.se-panel__head h3 {
  margin: 0 0 4px;
  color: #0b1b38;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.se-panel__head p {
  margin: 0;
  color: #63728d;
  font-size: 14px;
  line-height: 1.6;
}

.se-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 16px;
}

.se-dropzone,
.se-import-card {
  min-height: 156px;
  border: 1px solid #cad8f0;
  border-radius: 18px;
  background: #f7faff;
}

.se-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed #a8bff0;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.se-dropzone:hover,
.se-dropzone:focus-visible,
.se-dropzone.is-dragging {
  border-color: #4169f6;
  outline: none;
  background: #edf4ff;
  transform: translateY(-2px);
}

.se-dropzone > i {
  margin-bottom: 12px;
  color: #3974f5;
  font-size: 32px;
}

.se-dropzone strong,
.se-import-card strong {
  color: #122546;
  font-size: 16px;
  font-weight: 800;
}

.se-dropzone span,
.se-import-card span {
  margin-top: 4px;
  color: #6c7b94;
  font-size: 13px;
  line-height: 1.55;
}

.se-import-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px 14px;
  padding: 23px;
}

.se-import-card > i {
  grid-row: span 2;
  color: #6b4cf6;
  font-size: 30px;
}

.se-import-card div {
  display: flex;
  flex-direction: column;
}

.se-import-card .se-button {
  grid-column: 2;
  justify-self: start;
}

.se-file-status,
.se-result-message,
.se-timeline-message {
  min-height: 22px;
  margin: 16px 2px 0;
  color: #58708f;
  font-size: 13px;
  font-weight: 600;
}

.se-file-status.is-success,
.se-result-message.is-success,
.se-timeline-message.is-success {
  color: #168746;
}

.se-file-status.is-error,
.se-result-message.is-error,
.se-timeline-message.is-error {
  color: #c52944;
}

.se-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.se-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.se-icon-button,
.se-button,
.se-text-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.se-icon-button,
.se-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid #cfddf2;
  border-radius: 12px;
  color: #213b63;
  background: #f7faff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.se-icon-button:hover:not(:disabled),
.se-button:hover:not(:disabled) {
  border-color: #7f9cf4;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(45, 91, 190, 0.13);
}

.se-icon-button--primary,
.se-button--primary,
.se-button--save {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, #2563eb, #7045ed);
}

.se-button--save {
  min-height: 48px;
  padding-inline: 22px;
}

.se-button--soft {
  color: #2257b8;
  background: #edf4ff;
}

.se-icon-button:disabled,
.se-button:disabled,
.se-text-button:disabled,
.se-app input:disabled,
.se-app textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.se-icon-button:focus-visible,
.se-button:focus-visible,
.se-text-button:focus-visible,
.se-app input:focus-visible,
.se-app textarea:focus-visible {
  outline: 3px solid rgba(42, 107, 255, 0.26);
  outline-offset: 2px;
}

.se-time-readout {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.se-time-readout strong {
  color: #1a3761;
}

.se-timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.se-timeline-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.se-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #3860a6;
  background: #edf4ff;
  font-size: 12px;
  font-weight: 700;
}

.se-chip strong {
  font-weight: 900;
}

.se-chip--status {
  color: #5b4fc4;
  background: #f1eeff;
}

.se-chip--status.is-cue {
  color: #0f6f45;
  background: #e4f6ec;
}

.se-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.se-zoom input[type="range"] {
  width: 150px;
  accent-color: #4c6ef5;
}

.se-zoom span {
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}

.se-timeline {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #284d82;
  border-radius: 18px;
  background: linear-gradient(180deg, #081a38, #0c2d58);
  overscroll-behavior-x: contain;
  scrollbar-color: #4f7ad1 #0b1f44;
}

.se-timeline::-webkit-scrollbar {
  height: 12px;
}

.se-timeline::-webkit-scrollbar-track {
  background: #0b1f44;
}

.se-timeline::-webkit-scrollbar-thumb {
  border: 3px solid #0b1f44;
  border-radius: 999px;
  background: #4f7ad1;
}

.se-timeline__inner {
  position: relative;
  min-width: 100%;
}

.se-waveform-shell {
  position: relative;
  height: 230px;
  background:
    linear-gradient(rgba(91, 140, 215, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 215, 0.12) 1px, transparent 1px);
  background-size: 100% 48px, 80px 100%;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

/* 캔버스는 보이는 폭만큼만 만들어 sticky 로 고정하고, 스크롤 위치에 맞는 시간 창을 JS 가 다시 그린다. */
.se-waveform-shell canvas {
  position: sticky;
  z-index: 2;
  left: 0;
  display: block;
  width: var(--se-view-width, 100%);
  height: 100%;
}

.se-selection {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-inline: 1px solid rgba(97, 229, 255, 0.85);
  background: rgba(58, 169, 255, 0.22);
  pointer-events: none;
}

.se-playhead {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #ffda57;
  box-shadow: 0 0 12px rgba(255, 218, 87, 0.9);
  pointer-events: none;
}

.se-waveform-empty {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #b8c9e8;
  text-align: center;
  pointer-events: none;
}

.se-waveform-shell.has-waveform .se-waveform-empty {
  display: none;
}

.se-cue-track {
  position: relative;
  height: 168px;
  border-top: 1px solid rgba(120, 160, 230, 0.35);
  background: rgba(6, 20, 48, 0.55);
}

.se-cue-track__empty {
  position: sticky;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: var(--se-view-width, 100%);
  height: 100%;
  padding: 0 20px;
  color: #a9bde0;
  font-size: 13px;
  text-align: center;
}

.se-cue-track__empty strong {
  color: #dbe7ff;
}

.se-cue-track.has-cues .se-cue-track__empty {
  display: none;
}

.se-cue-block {
  position: absolute;
  z-index: 2;
  top: 10px;
  bottom: 10px;
  display: flex;
  min-width: 14px;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid #9db6ea;
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: 0 6px 16px rgba(3, 12, 40, 0.35);
  container-type: inline-size;
  cursor: grab;
  overflow: hidden;
}

.se-cue-block.is-selected {
  z-index: 3;
  border-color: #7c6bff;
  box-shadow: 0 0 0 2px rgba(124, 107, 255, 0.75), 0 10px 22px rgba(3, 12, 40, 0.45);
}

.se-cue-block.is-active::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #ffda57;
  content: "";
}

.se-cue-block.is-empty {
  border-style: dashed;
  border-color: #e58a9d;
  background: #fff6f8;
}

.se-cue-block__head {
  display: grid;
  flex: 0 0 auto;
  grid-template-areas: "num start arrow end move play del";
  grid-template-columns: auto auto auto auto 1fr auto auto;
  align-items: center;
  gap: 4px;
}

.se-cue-block__number {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  grid-area: num;
  align-items: center;
  justify-content: center;
  justify-self: start;
  padding: 0 5px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-size: 11px;
  font-weight: 900;
}

/* 사이트 공통 input 규칙(min-height 48px 등)보다 우선해야 하므로 !important 를 쓴다. */
.se-app .se-cue-block input.se-cue-block__time {
  width: 80px;
  height: 26px !important;
  min-height: 26px !important;
  padding: 2px 6px !important;
  border-radius: 7px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  font-weight: 700;
  text-align: center;
}

.se-app.has-hours .se-cue-block input.se-cue-block__time {
  width: 96px;
}

.se-cue-block__time[data-field="startMs"] {
  grid-area: start;
}

.se-cue-block__time[data-field="endMs"] {
  grid-area: end;
}

.se-cue-block__arrow {
  grid-area: arrow;
  color: #7f90ad;
  font-size: 11px;
}

.se-cue-block__move {
  display: inline-flex;
  min-width: 28px;
  height: 24px;
  grid-area: move;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  border-radius: 7px;
  color: #7184a5;
  cursor: grab;
  touch-action: none;
}

.se-cue-block:hover .se-cue-block__move {
  color: #315fc1;
  background: #e4edff;
}

.se-app .se-cue-block .se-cue-block__button {
  display: inline-flex;
  width: 24px !important;
  min-width: 0 !important;
  height: 24px !important;
  min-height: 0 !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 0;
  border-radius: 7px;
  color: #2a5ab3;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  line-height: 1 !important;
}

.se-cue-block__button--play {
  grid-area: play;
}

.se-cue-block__button--danger {
  grid-area: del;
  color: #d32b45;
}

.se-cue-block__button:hover {
  background: #e4edff;
}

.se-cue-block__button--danger:hover {
  background: #ffe6ea;
}

.se-app .se-cue-block textarea.se-cue-block__text {
  min-height: 0 !important;
  flex: 1 1 auto;
  padding: 6px 8px !important;
  border-radius: 8px;
  font-size: 13px !important;
  line-height: 1.45 !important;
  resize: none;
}

.se-cue-block input:focus-visible,
.se-cue-block textarea:focus-visible {
  outline-width: 2px;
  outline-offset: 0;
}

.se-app input.is-invalid {
  border-color: #d32b45 !important;
  box-shadow: 0 0 0 3px rgba(211, 43, 69, 0.18);
}

/* 칸 양끝의 드래그 핸들. 시작·종료 시간을 끌어서 조정한다. */
.se-cue-block__handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize;
  touch-action: none;
}

.se-cue-block__handle::before {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: rgba(124, 107, 255, 0.55);
  content: "";
  transform: translateY(-50%);
}

.se-cue-block__handle--start {
  left: 0;
}

.se-cue-block__handle--end {
  right: 0;
}

.se-cue-block__handle:hover::before,
.se-cue-block.is-dragging .se-cue-block__handle::before {
  background: #5b4fe0;
}

.se-cue-block.is-dragging {
  cursor: ew-resize;
  user-select: none;
}

.se-cue-block.is-moving,
.se-cue-block.is-moving .se-cue-block__move {
  z-index: 4;
  cursor: grabbing;
  user-select: none;
}

/* 칸 폭에 따라 시간 입력을 두 줄로 내리거나 숨긴다. 좁은 칸은 선택 후 아래 시간 입력으로 고친다. */
@container (max-width: 289px) {
  .se-cue-block__head {
    grid-template-areas:
      "num move play del"
      "start end end end";
    grid-template-columns: auto 1fr auto auto;
  }

  .se-cue-block__arrow {
    display: none;
  }
}

@container (max-width: 179px) {
  .se-cue-block__head {
    grid-template-areas: "num move play del";
    grid-template-columns: auto 1fr auto auto;
  }

  .se-cue-block__time {
    display: none;
  }
}

@container (max-width: 79px) {
  .se-cue-block {
    padding: 4px;
  }

  .se-cue-block__head {
    grid-template-areas: "num";
    grid-template-columns: 1fr;
  }

  .se-cue-block__button,
  .se-cue-block__move,
  .se-cue-block__text {
    display: none;
  }
}


.se-range-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.se-range-grid label,
.se-save-row label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #2e4261;
  font-size: 13px;
  font-weight: 800;
}

.se-stopped-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #d6e2f5;
  border-radius: 12px;
  color: #536b8d;
  background: #f7faff;
  font-size: 13px;
}

.se-stopped-end .se-button {
  flex: 0 0 auto;
}

.se-app input[type="text"],
.se-app textarea {
  width: 100%;
  border: 1px solid #cbd9ee;
  border-radius: 12px;
  color: #12284b;
  background: #f9fbff;
  font: inherit;
}

.se-app input[type="text"] {
  min-height: 44px;
  padding: 10px 13px;
  font-variant-numeric: tabular-nums;
}

.se-app textarea {
  padding: 13px 15px;
  line-height: 1.6;
  resize: vertical;
}

.se-help {
  margin: 11px 2px 0;
  color: #72819a;
  font-size: 12px;
}

.se-help code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #315ca8;
  background: #edf4ff;
}

.se-text-button {
  padding: 6px;
  color: #bd2941;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}


.se-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  padding: 26px;
  border: 1px dashed #c8d6eb;
  border-radius: 15px;
  color: #7b8ba5;
  text-align: center;
}

.se-empty i {
  margin-bottom: 8px;
  color: #8da7d7;
  font-size: 24px;
}

.se-empty p {
  margin: 0;
}

.se-save-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.se-account-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 12px;
  color: #435b7c;
  background: #f1f6ff;
  font-size: 13px;
  line-height: 1.55;
}

.se-account-note i {
  color: #376cef;
}

.se-account-note a {
  color: #285fd5;
  font-weight: 800;
}

.se-saved-list {
  display: grid;
  gap: 9px;
}

.se-saved-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 15px;
  border: 1px solid #dce6f5;
  border-radius: 13px;
  background: #f9fbff;
}

.se-saved-list article > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.se-saved-list strong,
.se-saved-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-saved-list strong {
  color: #16335d;
  font-size: 14px;
}

.se-saved-list span {
  color: #74839b;
  font-size: 12px;
}

@media (max-width: 991px) {
  .se-app {
    padding-inline: 16px;
  }

  .se-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .se-intro__badges {
    justify-content: flex-start;
    min-width: 0;
  }

  .se-upload-grid,
  .se-range-grid {
    grid-template-columns: 1fr 1fr;
  }

  .se-zoom input[type="range"] {
    width: 120px;
  }
}

@media (max-width: 767px) {
  .se-app {
    padding-top: 20px;
    padding-inline: 14px;
  }

  .se-intro,
  .se-panel {
    border-radius: 20px;
  }

  .se-intro {
    padding: 27px 22px;
  }

  .se-intro h2 {
    font-size: 27px;
  }

  .se-panel {
    padding: 22px 16px;
  }

  .se-upload-grid,
  .se-range-grid,
  .se-save-row {
    grid-template-columns: 1fr;
  }

  .se-import-card {
    grid-template-columns: auto 1fr;
  }

  .se-player-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .se-player-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .se-stopped-end {
    align-items: stretch;
    flex-direction: column;
  }

  .se-stopped-end .se-button {
    width: 100%;
  }

  .se-icon-button {
    width: 100%;
  }

  .se-waveform-shell {
    height: 180px;
  }

  .se-cue-track {
    height: 158px;
  }

  .se-timeline-toolbar__group,
  .se-zoom,
  .se-zoom input[type="range"] {
    width: 100%;
  }

  .se-saved-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .se-saved-list article .se-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .se-dropzone,
  .se-icon-button,
  .se-button {
    transition: none;
  }
}
