/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-7);
}

.stepper-step {
  display: flex;
  align-items: center;
}

.stepper-dot {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--fg-5);
  transition: all 0.3s;
}

.stepper-dot.active { background: var(--fg-0); color: var(--bg-0); }
.stepper-dot.completed { background: var(--success); color: white; }

.stepper-line {
  flex: 0 1 60px;
  min-width: 12px;
  height: 2px;
  background: var(--bg-2);
  margin: 0 var(--space-3);
  transition: background 0.3s;
}

.stepper-line.active { background: var(--success); }

.card {
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--rule);
  transition: var(--transition-theme);
}

/* Editorial pages sit straight on the paper instead of inside a panel. */
.page-plain {
  background: transparent;
  border: 0;
  padding: 0;
}

.step-panel { display: none; }
.step-panel.active { display: block; }

.step-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.014em;
  margin-bottom: var(--space-5);
  color: var(--fg-0);
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-5);
  margin-bottom: var(--space-2);
}

input[type="text"], select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 8px;
}

select::-ms-expand { display: none; }

input:focus, select:focus {
  border-color: var(--fg-0);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field { margin-bottom: var(--space-5); }

/* Video preview card */
.video-preview {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
  border: 1px solid var(--border);
}

.video-preview:hover { border-color: var(--accent); }

.video-preview img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.video-preview .vp-info { flex: 1; min-width: 0; }

.video-preview .vp-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-1);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-preview .vp-duration {
  font-size: 0.8rem;
  color: var(--fg-4);
  margin-bottom: 0.5rem;
}

.video-preview .vp-link {
  font-size: 0.8rem;
  color: var(--accent);
}

/* Time inputs */
.time-inputs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.time-group {
  flex: 1;
}

.time-group label {
  margin-bottom: 0.5rem;
}

.time-fields {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.time-fields input {
  width: 52px;
  padding: 0.55rem 0.4rem;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.time-fields input:focus { border-color: var(--accent); }

.time-fields .sep {
  color: var(--fg-5);
  font-weight: 700;
  font-size: 1.1rem;
}

.time-group .marker-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.marker-badge.a { background: var(--success-tint); color: var(--success); }
.marker-badge.b { background: var(--warm-tint); color: var(--danger); }

/* Range bar */
.range-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.range-bar-fill {
  position: absolute;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: left 0.2s, width 0.2s;
}

.range-summary {
  font-size: 0.8rem;
  color: var(--fg-5);
  text-align: center;
}

.hint-text {
  font-size: 0.78rem;
  color: var(--fg-5);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* YouTube inline player for custom range */
.yt-embed-block {
  margin-bottom: 1rem;
}

.yt-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  color: var(--fg-5);
}

.yt-player-wrap::before {
  content: "Loading player…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--fg-5);
  pointer-events: none;
}

.yt-player-wrap iframe,
.yt-player-wrap > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

.yt-capture-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.yt-capture-now {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.75rem;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 7.5rem;
}

.yt-capture-now-label {
  font-size: 0.7rem;
  color: var(--fg-5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yt-capture-now-val {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95rem;
  color: var(--fg-2);
  font-weight: 600;
}

.btn-capture {
  flex: 1 1 140px;
  background: var(--bg-2);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-capture:hover { background: var(--bg-3); }
.btn-capture .marker-badge { margin-right: 0; }

.yt-embed-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.yt-embed-error[hidden] { display: none; }

.yt-embed-error-icon {
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.yt-embed-error-body {
  flex: 1;
  min-width: 14rem;
}

.yt-embed-error-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 0.2rem;
}

.yt-embed-error-msg {
  font-size: 0.8rem;
  color: var(--fg-5);
  line-height: 1.45;
}

.yt-embed-error-btn {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}
