/* ───────────────  Screen 1 — Upload  ─────────────── */
.upload-wrap { max-width: 560px; margin: 0 auto; }

.upload-head { text-align: center; margin-bottom: var(--sp-8); }
.upload-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
.upload-head p { color: var(--text-secondary); font-size: 15px; }

/* Drop zone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: var(--sp-5);
  transition: all 0.18s ease;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--violet);
  border-style: solid;
  background: var(--violet-dim);
}
.dropzone__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.dropzone:hover .dropzone__icon, .dropzone.is-dragover .dropzone__icon {
  color: var(--violet-alt);
  border-color: var(--border-focus);
}
.dropzone__primary { font-size: 15px; color: var(--text-secondary); }
.dropzone__secondary { font-size: 13px; color: var(--text-muted); }
.dropzone.has-file { border-style: solid; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.06); }
.dropzone__file { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-primary); font-size: 14px; word-break: break-all; }
.dropzone__file svg { color: var(--success); flex-shrink: 0; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Upload progress bar (during file upload) */
.upload-progress { margin-top: var(--sp-3); display: none; }
.upload-progress.is-active { display: block; }
.upload-progress__track { height: 6px; border-radius: 999px; background: var(--bg-surface); overflow: hidden; }
.upload-progress__bar { height: 100%; width: 0%; background: var(--violet); border-radius: 999px; transition: width 0.2s ease; }
.upload-progress__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: var(--sp-2); }

/* Divider */
.divider {
  display: flex; align-items: center; gap: var(--sp-4);
  color: var(--text-muted); font-size: 13px;
  margin: var(--sp-6) 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }

/* URL input with leading icon */
.url-field { position: relative; }
.url-field__icon {
  position: absolute; left: var(--sp-4); top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.url-field .input { height: 48px; padding-left: var(--sp-10); }

/* Advanced options disclosure */
.advanced { margin-top: var(--sp-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.advanced__toggle { list-style: none; }
.advanced__toggle::-webkit-details-marker { display: none; }
.advanced__toggle {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--text-secondary); background: var(--bg-surface);
}
.advanced__toggle:hover { color: var(--text-primary); }
.advanced__chevron { transition: transform 0.18s ease; color: var(--text-muted); }
.advanced[open] .advanced__chevron, .advanced.is-open .advanced__chevron { transform: rotate(180deg); }
.advanced__panel { padding: var(--sp-5) var(--sp-4); display: grid; gap: var(--sp-5); border-top: 1px solid var(--border-subtle); }
.field-row { display: grid; gap: var(--sp-4); }
.checkbox-row { display: flex; align-items: center; gap: var(--sp-3); }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--violet); cursor: pointer; }
.checkbox-row label { font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: var(--sp-1); }

/* Accessible-only text */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* DeepSeek feature toggle */
.feature-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--violet-dim), transparent 70%);
  border: 1px solid var(--border);
}
.feature-toggle__icon { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-md); background: rgba(108, 92, 231, 0.15); color: var(--violet-alt); }
.feature-toggle__body { flex: 1; min-width: 0; }
.feature-toggle__title { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: var(--sp-2); }
.feature-toggle__tag { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-violet); background: rgba(108, 92, 231, 0.18); padding: 2px 6px; border-radius: var(--radius-sm); }
.feature-toggle__desc { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.feature-toggle__hint { font-size: 12px; color: var(--warning); margin-top: var(--sp-2); }
.feature-toggle__hint code { font-family: var(--font-mono); font-size: 11px; background: rgba(245, 158, 11, 0.12); padding: 1px 5px; border-radius: 4px; }
.feature-toggle.is-unavailable { opacity: 0.85; }

/* Toggle switch */
.switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; cursor: pointer; align-self: center; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__slider { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-subtle); transition: all 0.18s ease; }
.switch__slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-muted); transition: all 0.18s ease; }
.switch input:checked + .switch__slider { background: var(--violet); border-color: var(--violet); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__slider { outline: 2px solid var(--violet); outline-offset: 3px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch__slider { opacity: 0.5; }

/* Clip length: Auto / Custom */
.cliplen { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.cliplen__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.cliplen__label { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.cliplen__hint { font-size: 12.5px; color: var(--text-muted); margin-top: var(--sp-2); }

.seg { display: inline-flex; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 3px; gap: 3px; }
.seg__btn { min-height: 40px; padding: 0 var(--sp-4); border-radius: 7px; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-secondary); transition: all 0.18s ease; }
.seg__btn.is-active { background: var(--violet); color: #fff; }
.seg__btn:not(.is-active):hover { color: var(--text-primary); }

.cliplen__panel { margin-top: var(--sp-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 var(--sp-4); border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: all 0.18s ease; }
.chip.is-active { background: var(--violet-dim); border-color: var(--border-focus); color: var(--text-violet); }
.chip:hover:not(.is-active) { color: var(--text-primary); border-color: var(--border); }
.cliplen__free { display: flex; align-items: center; gap: var(--sp-2); }
.cliplen__free .input { width: 90px; min-height: 44px; text-align: center; }
.cliplen__unit { font-size: 13px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--error); width: 100%; margin-top: var(--sp-1); }
.cliplen.has-error .cliplen__free .input { border-color: var(--error); box-shadow: none; }

/* Section labels */
.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--sp-4); }

/* How it works */
.how { margin-top: var(--sp-12); }
.how__steps { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.how__step { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--sp-5); }
.how__num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--violet-dim); color: var(--text-violet); font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: var(--sp-3); }
.how__step h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: var(--sp-2); }
.how__step p { font-size: 13px; color: var(--text-secondary); }

/* CTA */
.cta-submit { height: 52px; font-size: 16px; margin-top: var(--sp-6); }

/* Recent uploads */
.recent { margin-top: var(--sp-10); }
.recent__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.recent__all { font-size: 13px; font-weight: 600; color: var(--text-violet); }
.recent__all:hover { color: var(--violet-alt); }
.recent__list { display: grid; gap: var(--sp-3); }
.recent__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); min-height: 44px;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.recent__row:hover { border-color: var(--border); }
.recent__row-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent__row-meta { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; font-size: 12px; color: var(--text-muted); }

@media (min-width: 481px) {
  .upload-head h1 { font-size: 32px; }
  .dropzone { height: 220px; }
}
@media (min-width: 769px) {
  .how__steps { grid-template-columns: repeat(3, 1fr); }
}
