/* AI Content Editor page. Reuses site tokens from /styles.css (Orbitron headings, Instrument Sans body, dark theme). */
.page-reel .reel {
  position: relative;
  padding: calc(var(--header-h) + 1.75rem) 1.15rem 3.5rem;
  min-height: calc(100vh - 4rem);
  overflow: hidden;
}
.page-reel .reel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, color-mix(in srgb, var(--pfp-gold) 18%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 82% 68%, color-mix(in srgb, var(--pfp-pink) 12%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 12% 55%, color-mix(in srgb, var(--pfp-green) 12%, transparent) 0%, transparent 52%);
}
.reel-inner { position: relative; z-index: 1; max-width: 44rem; margin: 0 auto; text-align: left; }
.page-reel .articles-title, .page-reel .articles-intro { text-align: center; }
.page-reel .articles-intro { margin-bottom: 1.35rem; }

.reel-form { display: grid; gap: 1rem; }
.reel-card {
  margin: 0; padding: 1.1rem 1.15rem 1.2rem; min-width: 0;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
  background: rgba(255, 255, 255, 0.03);
}
.reel-card--action { display: grid; gap: 0.7rem; }
.reel-step {
  padding: 0 0.4rem; margin: 0 0 0.6rem; font-family: var(--font-display);
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
.reel-result > .reel-step { padding: 0; font-size: 0.9rem; }
.reel-optional { color: var(--text-muted); text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.reel-meta { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.reel-hint { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--text-muted); }
.reel-note {
  margin: 0.9rem 0 0; padding: 0.65rem 0.85rem; font-size: 0.88rem; line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--pfp-gold) 35%, var(--border)); border-radius: var(--radius);
  background: color-mix(in srgb, var(--pfp-gold) 8%, transparent);
}
[hidden].reel-btn, .reel-review[hidden], .reel-check[hidden], .reel-link-btn[hidden], .reel-note[hidden], .reel-meta[hidden], .mp3-error[hidden], .reel-progress[hidden], .reel-result[hidden] { display: none !important; }
.page-reel .mp3-error { margin-top: 0.9rem; }

.reel-clip-list { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.reel-clip {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 0.75rem;
  padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(0, 0, 0, 0.35);
}
.reel-clip video { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; background: #111; }
.reel-clip-name { display: block; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reel-clip-info { display: block; font-size: 0.78rem; color: var(--text-muted); }
.reel-clip-btns { display: flex; gap: 0.25rem; }
.reel-icon-btn {
  min-width: 2.2rem; min-height: 2.2rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer; font: inherit; line-height: 1;
}
.reel-icon-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--pfp-gold) 55%, var(--border)); }
.reel-icon-btn:disabled { opacity: 0.35; cursor: default; }

.reel-audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.reel-label { display: block; margin: 0 0 0.35rem; font-size: 0.82rem; color: var(--text-muted); }
.reel-input {
  width: 100%; padding: 0.6rem 0.7rem; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border); border-radius: var(--radius);
}
textarea.reel-input { resize: vertical; min-height: 4.5rem; }
.reel-input:focus-visible, .reel-seg input:focus-visible + span, .reel-check input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.reel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.9rem; align-items: end; }
.reel-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.reel-seg label { cursor: pointer; }
.reel-seg input { position: absolute; opacity: 0; pointer-events: none; }
.reel-seg span { display: block; padding: 0.6rem 1.1rem; font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.reel-seg input:checked + span { background: color-mix(in srgb, var(--pfp-gold) 22%, transparent); color: var(--accent-bright); }
.reel-check { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 1rem; cursor: pointer; }
.reel-check input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--pfp-gold); }
.reel-check small { color: var(--text-muted); }

.reel-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.reel-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0.7rem 1.4rem;
  font-family: var(--font-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #000; background: var(--accent-bright); border: 1px solid var(--accent-bright); border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
}
.reel-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--pfp-gold) 70%, #fff); }
.reel-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.reel-btn--ghost { color: var(--text); background: transparent; border-color: color-mix(in srgb, var(--pfp-gold) 40%, var(--border)); }
.reel-btn--ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--pfp-gold) 12%, transparent); }
.reel-link-btn { background: none; border: 0; color: var(--text-muted); text-decoration: underline; cursor: pointer; font: inherit; }

.reel-progress { margin-top: 1rem; }
.reel-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.reel-bar span { display: block; height: 100%; width: 0; background: var(--chrome-accent); background-color: var(--pfp-gold); transition: width 0.25s ease; }
.reel-progress .reel-meta { margin-top: 0.5rem; }

.reel-result { margin-top: 1.4rem; display: grid; gap: 0.8rem; justify-items: center; }
.reel-result > .reel-step { justify-self: start; }
.reel-result video { width: min(100%, 320px); aspect-ratio: 9 / 16; background: #000; border-radius: 12px; border: 1px solid var(--border); }
.page-reel .mp3-steps { margin-top: 2rem; }

.reel-label--gap { margin-top: 0.9rem; }
#reel-cap-auto, #reel-cap-script { margin-top: 0.9rem; }
#reel-cap-auto[hidden], #reel-cap-script[hidden] { display: none !important; }
select.reel-input { appearance: auto; }

/* effects picker */
.reel-fx-groups { display: grid; gap: 0.85rem; }
.reel-fx-group-name { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.reel-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.reel-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.4rem; padding: 0.4rem 0.8rem; font: inherit; font-size: 0.86rem;
  color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.reel-chip:hover:not(:disabled) { border-color: color-mix(in srgb, var(--pfp-gold) 55%, var(--border)); }
.reel-chip[aria-pressed="true"] { color: var(--accent-bright); background: color-mix(in srgb, var(--pfp-gold) 20%, transparent); border-color: color-mix(in srgb, var(--pfp-gold) 70%, var(--border)); }
.reel-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.reel-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.reel-chip-cost { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.reel-chip[data-cost="heavy"] .reel-chip-cost { color: #ffb74d; }
.reel-row--fx { margin-top: 1.1rem; }
.reel-check--fx { margin-top: 0; }
.reel-fx-links { margin: 0.7rem 0 0; display: flex; gap: 1rem; }
#reel-fx-warn { margin-top: 0.8rem; }
#reel-fx-warn[hidden] { display: none !important; }

/* watermark / X gate */
.reel-wm-title { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.reel-wm-text { margin: 0 0 0.8rem; font-size: 0.92rem; }
.reel-wm.is-verified { border-color: color-mix(in srgb, var(--pfp-gold) 60%, var(--border)); }

/* caption review */
.reel-review { margin-top: 1rem; }
.reel-lines { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.reel-line {
  display: grid; grid-template-columns: minmax(0, 1fr) 6.2rem 6.2rem auto; gap: 0.5rem; align-items: start;
  padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(0, 0, 0, 0.35);
}
.reel-line.is-bad { border-color: #ff8a80; }
.reel-line textarea.reel-input { min-height: 2.9rem; padding: 0.45rem 0.6rem; }
.reel-line .reel-input { padding: 0.45rem 0.55rem; }
.reel-line input.reel-input { font-variant-numeric: tabular-nums; text-align: center; }
.reel-line-tools { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.reel-line small { display: block; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.15rem; text-align: center; }
.reel-review-actions { margin-top: 1rem; }

@media (max-width: 560px) {
  .reel-line { grid-template-columns: 1fr 1fr; }
  .reel-line > .reel-line-text { grid-column: 1 / -1; }
  .reel-line > .reel-line-tools { grid-column: 1 / -1; }
  .reel-review-actions .reel-btn { flex: 1 1 100%; }
  .reel-fx-links { flex-wrap: wrap; }
  .reel-row { grid-template-columns: 1fr; }
  .reel-clip { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .reel-clip video { width: 48px; height: 48px; }
  .reel-actions .reel-btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- Reels | Photos tabs */
.reel-tabs { display: flex; justify-content: center; gap: 0.4rem; margin: 0 auto 1.2rem; padding: 0.3rem; width: fit-content; border: 1px solid var(--border); border-radius: 999px; background: rgba(0, 0, 0, 0.35); }
.reel-tab { min-height: 2.5rem; padding: 0.4rem 1.5rem; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.reel-tab[aria-selected="true"] { color: var(--accent-bright); background: color-mix(in srgb, var(--pfp-gold) 22%, transparent); }
.reel-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#reel-mode-reels[hidden], #photo-mode[hidden] { display: none !important; }
.reel-inner.is-photos { max-width: 70rem; }

/* ---------------------------------------------------------------- Photo editor */
.ph { display: grid; gap: 1rem; }
.ph [hidden] { display: none !important; }
.ph-work { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .ph-work { grid-template-columns: minmax(0, 1fr) 22rem; }
  .ph-stage { position: sticky; top: calc(var(--header-h, 72px) + 0.8rem); }
}
.ph-stage { display: grid; gap: 0.7rem; min-width: 0; }
.ph-compare { --cmp: 50%; --ar: 4 / 3; position: relative; width: 100%; aspect-ratio: var(--ar); max-height: 72vh; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #000 repeating-conic-gradient(#1c1c1c 0 25%, #121212 0 50%) 0 0 / 18px 18px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; border: 1px solid var(--border); }
@media (max-width: 899px) {
  .ph-stage { display: contents; }
  .ph-compare { position: sticky; top: calc(var(--header-h, 72px) - 0.2rem); z-index: 5; max-height: 38vh; box-shadow: 0 8px 14px -6px rgba(0, 0, 0, 0.8); }
  .ph-stage-bar, .ph-strip, .ph-info { grid-column: 1; }
}
.ph-compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ph-before { clip-path: inset(0 calc(100% - var(--cmp)) 0 0); }
.ph-handle { position: absolute; top: 0; bottom: 0; left: var(--cmp); width: 44px; margin-left: -22px; display: grid; place-items: center; cursor: ew-resize; }
.ph-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.ph-handle span { position: relative; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 1px 8px rgba(0, 0, 0, 0.55); }
.ph-handle span::before, .ph-handle span::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border: 5px solid transparent; }
.ph-handle span::before { left: 3px; border-right-color: #222; border-left: 0; }
.ph-handle span::after { right: 3px; border-left-color: #222; border-right: 0; }
.ph-handle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.ph-tag { position: absolute; top: 0.5rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; pointer-events: none; }
.ph-tag--l { left: 0.5rem; } .ph-tag--r { right: 0.5rem; }
.ph-busy { position: absolute; left: 50%; bottom: 0.6rem; transform: translateX(-50%); padding: 0.2rem 0.7rem; border-radius: 999px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.78rem; pointer-events: none; }
.ph-stage-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.ph-sm { min-height: 2.4rem; padding: 0.4rem 0.9rem; font-size: 0.7rem; }
.ph-strip { list-style: none; margin: 0; padding: 0.15rem 0; display: flex; gap: 0.5rem; overflow-x: auto; }
.ph-thumb { position: relative; flex: 0 0 auto; }
.ph-thumb > button:first-child { display: block; padding: 0; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; }
.ph-thumb.is-cur > button:first-child { border-color: var(--pfp-gold); }
.ph-thumb img { display: block; width: 56px; height: 56px; object-fit: cover; }
.ph-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #000; color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; border: 1px solid var(--border); }
.ph-info { text-align: center; }
.ph-panel { display: grid; gap: 0.7rem; min-width: 0; }
.ph-sec { padding: 0.8rem 1rem; }
.ph-sec > summary { cursor: pointer; font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; min-height: 2rem; display: flex; align-items: center; }
.ph-sec[open] > summary { margin-bottom: 0.6rem; }
.ph-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.4rem 0; }
.ph-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-muted); }
.ph-w { width: auto; }
.ph-color { width: 2.6rem; height: 2.4rem; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; }
.ph-slider { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) 2.4rem; align-items: center; gap: 0.5rem; min-height: 2.3rem; font-size: 0.82rem; }
.ph-slider label { color: var(--text-muted); }
.ph-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.ph-slider input[type="range"] { width: 100%; min-height: 2rem; accent-color: var(--pfp-gold); }
.ph-looks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; }
.ph-look { display: grid; gap: 0.2rem; justify-items: center; padding: 0.25rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; font-size: 0.66rem; cursor: pointer; }
.ph-look canvas { width: 100%; aspect-ratio: 1; border-radius: 6px; display: block; }
.ph-look span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-look[aria-pressed="true"] { border-color: var(--pfp-gold); background: color-mix(in srgb, var(--pfp-gold) 18%, transparent); color: var(--accent-bright); }
.ph-look:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ph-auto { font-weight: 600; }
.ph-slot { margin: 0.6rem 0; }
.ph-slot .reel-wm { margin: 0; }
.ph-export .reel-btn { flex: 1 1 10rem; }
.ph-dropcard .master-drop.is-over { border-color: var(--pfp-gold); }
.ph-sec .reel-input { min-width: 0; }
@media (max-width: 560px) {
  .ph-slider { grid-template-columns: 5.2rem minmax(0, 1fr) 2.2rem; }
  .ph-looks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reel-tab { padding: 0.4rem 1.2rem; }
}
/* the generic .section clips with overflow:hidden, which would stop the preview from sticking; clip does not create a scroll container */
.section.reel { overflow: visible; overflow: clip; }
