* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --bg-1:#090816;
  --bg-2:#17142f;
  --bg-3:#211c43;
  --panel:rgba(255,255,255,0.035);
  --panel-2:rgba(255,255,255,0.05);
  --text:#edf2ff;
  --muted:#a6b0c9;
  --muted-2:#7f88a6;
  --line:rgba(255,255,255,0.08);
  --line-2:rgba(167,139,250,0.22);
  --violet:#a78bfa;
  --violet-2:#d1c4ff;
  --violet-3:#7c5cff;
  --green:#57e389;
  --cyan:#53d6ff;
  --danger:#ff7b9a;
  --warm:#ffc875;
  --shadow:0 24px 80px rgba(0,0,0,0.42);
  --shadow-soft:0 14px 36px rgba(0,0,0,0.22);
  --radius-xl:28px;
  --radius-lg:22px;
  --radius-md:16px;
  --radius-sm:12px;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top center, rgba(167,139,250,0.16), transparent 24%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}

body {
  min-height: 100vh;
  padding: 20px;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top center, rgba(167,139,250,0.16), transparent 24%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  background-attachment: fixed;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(10, 11, 26, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

h1 {
  margin-bottom: 10px;
  text-align: center;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-size: clamp(2rem, 4vw, 3.25rem);
  background: linear-gradient(135deg, #f4f0ff 0%, #b99cff 34%, #7ea8ff 68%, #80ffe1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.52;
}

.section {
  margin-bottom: 22px;
}

.section-title {
  margin-bottom: 14px;
  color: var(--violet-2);
  font-size: 1.14rem;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.section-title-center {
  text-align: center;
}

.subsection-title {
  margin: 16px 0 12px;
  color: var(--violet-2);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 800;
}

.panel {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.02));
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top center, rgba(167,139,250,0.20), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(83,214,255,0.08), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(255,200,117,0.08), transparent 20%);
}

.hero-panel__inner {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(167,139,250,0.28);
  background: rgba(167,139,250,0.12);
  color: var(--violet-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 900;
}

.hero-subtitle {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.14rem;
}

.hero-hint {
  max-width: 790px;
  margin: 18px auto 0;
}

#uploadSection {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  border-radius: 22px;
  border: 2px dashed rgba(167,139,250,0.34);
  background:
    linear-gradient(180deg, rgba(167,139,250,0.08), rgba(255,255,255,0.02));
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.file-label:hover {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,0.58);
  background:
    linear-gradient(180deg, rgba(167,139,250,0.12), rgba(255,255,255,0.025));
}

.file-label input {
  display: none;
}

.file-icon {
  margin-bottom: 10px;
  font-size: 2.6rem;
}

.file-text {
  max-width: 580px;
  margin: 0 auto;
  color: var(--violet-2);
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 700;
}

.file-name {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
}

.hint-text {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.56;
}

.hint-soft {
  background: rgba(255,255,255,0.022);
}

.landing-accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-accordion--centered {
  max-width: 930px;
  margin-left: auto;
  margin-right: auto;
}

.landing-card {
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(167,139,250,0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  box-shadow: 0 18px 42px rgba(0,0,0,0.18);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.landing-card__head {
  width: 100%;
  min-height: 100px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  color: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
}

.landing-card__head:hover {
  background: rgba(255,255,255,0.025);
}

.landing-card__titlebox {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 780px;
}

.landing-card__icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(167,139,250,0.22);
  background: rgba(167,139,250,0.14);
  font-size: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

.landing-card__title {
  margin-bottom: 4px;
  text-align: left;
  font-size: 1.16rem;
}

.landing-card__lead {
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.46;
}

.landing-card__chevron {
  flex: 0 0 auto;
  color: var(--violet-2);
  font-size: 1.45rem;
  transition: transform .2s ease;
}

.landing-card__body {
  display: none;
  padding: 0 22px 22px;
  text-align: center;
}

.landing-card.is-open {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,0.3);
  box-shadow: 0 22px 54px rgba(0,0,0,0.24);
}

.landing-card.is-open .landing-card__body {
  display: block;
}

.landing-card.is-open .landing-card__chevron {
  transform: rotate(180deg);
}

.landing-card.is-locked {
  border-color: rgba(255,123,154,0.18);
}

.landing-card.is-locked .landing-card__icon {
  border-color: rgba(255,123,154,0.18);
  background: rgba(255,123,154,0.10);
}

.landing-card.is-locked .landing-card__lead {
  color: #caaebb;
}

.btn.disabled,
.go-btn.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.landing-card__body .hint-text,
.landing-card__body .options-grid,
.landing-card__body .mode-actions,
.landing-mini-panel {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.landing-mini-panel {
  margin-top: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.option {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 124px;
  padding: 14px 16px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
  cursor: pointer;
}

.option:hover {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,0.34);
  background: rgba(167,139,250,0.07);
}

.option-static {
  cursor: default !important;
}

.option-static:hover {
  transform: none;
}

.option input[type="checkbox"] {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  accent-color: var(--violet);
  cursor: pointer;
}

.option input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.option:has(input[type="checkbox"]:disabled) {
  opacity: 0.78;
}

.option-icon {
  margin-bottom: 8px;
  font-size: 1.6rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.14));
}

.option-label {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
}

.option-hint {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 0.8rem;
  line-height: 1.42;
}

.mode-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mode-actions-center {
  justify-content: center;
}

.btn,
.go-btn,
.download-btn {
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(167,139,250,0.14);
  border-color: rgba(167,139,250,0.28);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border: none;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #7c5cff 58%, #9b7bff 100%);
}

.btn-secondary {
  border: 1px solid rgba(167,139,250,0.3);
  background: rgba(167,139,250,0.14);
  color: var(--violet-2);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
}

.btn-danger {
  border: 1px solid rgba(255,123,154,0.24);
  background: rgba(255,123,154,0.14);
  color: #ffd3dc;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.go-btn {
  width: 100%;
  min-height: 64px;
  padding: 18px;
  border: none;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #7c5cff 58%, #9b7bff 100%);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.go-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(102,126,234,0.34);
}

.go-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}

.go-icon {
  font-size: 1.28rem;
}

.slider-group {
  margin-bottom: 14px;
}

.slider-title {
  display: block;
  margin-bottom: 6px;
  color: var(--violet-2);
  font-size: 0.9rem;
  font-weight: 700;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  outline: none;
  -webkit-appearance: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea, var(--violet));
  box-shadow: 0 2px 10px rgba(102,126,234,0.34);
  cursor: pointer;
  -webkit-appearance: none;
}

.sl {
  min-width: 34px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.sv {
  min-width: 36px;
  color: var(--violet);
  font-size: 0.94rem;
  text-align: center;
  font-weight: 800;
}

.toggle-btn {
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(167,139,250,0.3);
  background: rgba(167,139,250,0.15);
  color: var(--violet-2);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.toggle-btn:hover {
  transform: translateY(-1px);
  background: rgba(167,139,250,0.22);
}

.advanced-grid,
.enhance-grid,
.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.param-group {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.param-group h4 {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(167,139,250,0.18);
  color: var(--violet-2);
  font-size: 0.9rem;
}

.param-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.83rem;
}

.param-group input[type="number"],
.segfx-field input,
.text-input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
}

.param-group input[type="number"]:focus,
.segfx-field input:focus,
.text-input:focus {
  border-color: rgba(167,139,250,0.55);
}

.color-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.color-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.color-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.color-group input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 3px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}

.sub-preview {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 36%),
    linear-gradient(180deg, #11131d 0%, #090b12 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.sub-preview.sub-preview--portrait {
  width: min(100%, 360px);
  height: 640px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 22px;
}

.sub-preview.sub-preview--landscape {
  width: 100%;
  height: 260px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 18px;
}

#subPreviewText {
  position: absolute;
  left: 50%;
  width: 82%;
  max-width: 82%;
  display: block;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  font-family: Arial, sans-serif;
  font-weight: 900;
  transform: translateX(-50%);
  z-index: 2;
}

.censor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.censor-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.censor-opt:hover {
  border-color: rgba(167,139,250,0.28);
  background: rgba(167,139,250,0.06);
}

.censor-opt input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.censor-opt span {
  color: var(--violet-2);
  font-size: 0.9rem;
  font-weight: 600;
}

.mix-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.replace-check {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}

.replace-check input {
  accent-color: var(--violet);
}

.replace-check span {
  color: var(--muted);
  font-size: 0.86rem;
}

.cut-config-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.cut-config-row--work {
  margin-bottom: 14px;
}

.cut-config-field {
  min-width: 220px;
  flex: 1 1 240px;
}

.cut-config-check {
  align-self: end;
  min-height: 48px;
}

.workspace-hidden {
  display: none !important;
}

#workspaceSection {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 24px;
}

.workspace-intro {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.workspace-panel-center {
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
}

#editorPanel,
#progressSection,
#resultSection,
#storiesResult {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.progress-track {
  height: 32px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}

.progress-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 100%;
  width: 0%;
  border-radius: 12px;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  background: linear-gradient(90deg, #667eea, var(--violet), #f093fb);
  transition: width .28s ease;
}

.progress-text,
.result-info,
.result-title {
  text-align: center;
}

.progress-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.log-output {
  margin-top: 10px;
  max-height: 190px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.42);
  color: #72f2a2;
  font-family: "SF Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.result-section {
  margin-top: 24px;
  text-align: center;
}

.result-title {
  margin-bottom: 12px;
  font-size: 1.84rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-info {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-video {
  display: block;
  width: 100%;
  max-height: 520px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 14px 40px rgba(0,0,0,0.4);
}

.download-btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 13px;
  color: #12212b;
  text-decoration: none;
  font-size: 1.04rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  transition: transform .18s ease, box-shadow .18s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(87,227,137,0.32);
}

.stories-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.story-card {
  padding: 14px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  transition: border-color .18s ease, transform .18s ease;
}

.story-card:hover {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,0.28);
}

.story-card h4 {
  margin-bottom: 8px;
  color: var(--violet-2);
  font-size: 0.95rem;
  line-height: 1.35;
}

.story-card video {
  width: 100%;
  margin-bottom: 8px;
  border-radius: 10px;
}

.story-card a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 9px;
  color: #11222a;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: stretch;
}

.segment-side,
.preview-side {
  min-width: 0;
}

.segment-side {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(167,139,250,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.018));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.preview-side {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(167,139,250,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02)),
    radial-gradient(circle at top, rgba(167,139,250,0.07), transparent 40%);
  box-shadow: 0 14px 36px rgba(0,0,0,0.18);
}

.segment-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.segment-title {
  color: var(--violet-2);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.segment-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.8rem;
}

.segment-list {
  max-height: 430px;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.04);
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.22));
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 9px 11px;
  border-radius: 12px;
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.018);
  cursor: pointer;
  transition: background .14s ease, transform .14s ease, border-color .14s ease, opacity .14s ease;
}

.segment-item:last-child {
  margin-bottom: 0;
}

.segment-item:hover {
  background: rgba(255,255,255,0.06);
}

.segment-item.active {
  transform: translateX(2px);
  border-left-color: var(--green);
  background: linear-gradient(135deg, rgba(87,227,137,0.12), rgba(83,214,255,0.08));
  box-shadow: inset 0 0 0 1px rgba(87,227,137,0.07);
}

.segment-item.disabled {
  opacity: 0.42;
  background: rgba(255,255,255,0.012);
}

.seg-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.seg-line1 {
  color: #f4f6ff;
  font-size: 0.93rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-line2 {
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.01em;
}

.seg-badge {
  padding: 4px 8px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.045);
  color: #d1d7ea;
  font-size: 0.72rem;
}

.segment-item.active .seg-badge {
  border-color: rgba(87,227,137,0.18);
  background: rgba(87,227,137,0.12);
  color: #ddffea;
}

.segment-item.disabled .seg-badge {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}

.editor-video {
  width: 100%;
  min-height: 240px;
  max-height: 390px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #000;
  box-shadow: 0 16px 38px rgba(0,0,0,.28);
}

.transport-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
}

.transport-bar .btn,
.transport-bar .loop-opt {
  min-height: 42px;
}

.transport-bar .btn {
  min-width: 54px;
}

.loop-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}

.loop-opt input {
  accent-color: var(--violet);
}

.edit-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
}

.edit-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.edit-label {
  min-width: 130px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.edit-value {
  flex: 1;
  min-width: 220px;
  color: #f3f6ff;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 900;
}

#activeSegHint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.segment-fx-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(167,139,250,0.12);
  background: linear-gradient(180deg, rgba(167,139,250,0.05), rgba(255,255,255,0.025));
}

.segment-fx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.segment-fx-title {
  color: var(--violet-2);
  font-size: 0.96rem;
  font-weight: 900;
}

.segment-fx-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.segment-live-note {
  margin-bottom: 12px;
  text-align: center;
}

.segment-fx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.segfx-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  cursor: pointer;
}

.segfx-check input {
  accent-color: var(--violet);
}

.segfx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.segfx-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nudge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.nudge-col {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

.nudge-title {
  margin-bottom: 10px;
  color: var(--violet-2);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.nudge-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-bottom: 7px;
}

.nudge-row:last-child {
  margin-bottom: 0;
}

.ms-btn {
  min-width: 0;
  padding: 8px 4px;
  border: none;
  border-radius: 12px;
  color: #141623;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
  transition: transform .12s ease, filter .12s ease;
}

.ms-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.ms-plus {
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.ms-minus {
  background: linear-gradient(135deg, var(--danger), #ff9b52);
}

@media (min-width: 900px) {
  body {
    padding: 28px;
  }

  .container {
    padding: 42px;
  }

  .go-btn {
    min-height: 68px;
  }
}

@media (max-width: 980px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .segment-list {
    max-height: 300px;
  }

  .editor-video {
    max-height: 320px;
  }

  .nudge-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 16px;
    border-radius: 20px;
  }

  h1 {
    font-size: 1.95rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .file-label {
    min-height: 176px;
    padding: 22px 16px;
    border-radius: 18px;
  }

  .file-icon {
    font-size: 2.15rem;
  }

  .file-text {
    max-width: 100%;
    font-size: 0.99rem;
  }

  .section-title {
    font-size: 1.04rem;
  }

  .hint-text {
    font-size: 0.8rem;
    padding: 10px;
  }

  .go-btn {
    min-height: 56px;
    padding: 15px 14px;
    border-radius: 12px;
    font-size: 1rem;
  }

  #landingReadyBtn,
  #landingCutBtn,
  #landingEditOpen {
    width: 100%;
  }

  .mode-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-actions .btn,
  .mode-actions .go-btn {
    width: 100%;
  }

  .options-grid,
  .advanced-grid,
  .enhance-grid,
  .sub-grid,
  .stories-list,
  .segment-fx-grid,
  .nudge-grid {
    grid-template-columns: 1fr;
  }

  .landing-card__head {
    min-height: auto;
    align-items: flex-start;
    padding: 16px;
  }

  .landing-card__titlebox {
    align-items: flex-start;
  }

  .landing-card__body {
    padding: 0 16px 16px;
  }

  .landing-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.22rem;
  }

  .landing-card__title {
    font-size: 1.05rem;
  }

  .landing-card__lead {
    font-size: 0.88rem;
  }

  .panel,
  .preview-side,
  .segment-side,
  .edit-box,
  .segment-fx-box,
  .nudge-col {
    border-radius: 16px;
  }

  .transport-bar {
    justify-content: stretch;
  }

  .transport-bar .btn,
  .transport-bar .loop-opt {
    flex: 1 1 calc(33.333% - 10px);
  }

  .edit-row {
    flex-direction: column;
    gap: 8px;
  }

  .edit-label {
    min-width: 0;
    padding-top: 0;
  }

  .cut-config-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cut-config-check {
    align-self: stretch;
    justify-content: center;
  }

  .mix-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sub-preview.sub-preview--portrait {
    width: min(100%, 300px);
    height: 534px;
  }

  .sub-preview.sub-preview--landscape {
    height: 220px;
  }

  #subPreviewText {
    width: 88%;
    max-width: 88%;
    line-height: 1.08;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 14px;
  }

  h1 {
    font-size: 1.72rem;
  }

  .subtitle {
    font-size: 0.94rem;
  }

  .file-label {
    border-radius: 15px;
  }

  .option {
    min-height: 112px;
  }

  .nudge-row {
    grid-template-columns: repeat(2, 1fr);
  }
}


.cut-config-row--reserved {
  margin-top: 10px;
}

.cut-config-check--locked {
  opacity: 0.72;
  cursor: not-allowed;
  border-style: dashed;
}

.cut-config-check--locked:hover {
  transform: none;
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

.cut-config-check--locked input {
  cursor: not-allowed;
}

.cut-reserved-note {
  margin-top: 10px;
  text-align: center;
}

#storyAiCutReserved {
  margin-bottom: 12px;
  justify-content: center;
}

/* Initially hidden elements - managed by JS */
.is-hidden-block {
  display: none;
}
.is-hidden-panel {
  display: none;
}
