/* AyatVideo flow layer — premium studio look with the guided flow. */
.ctl .sec h2 .n { display: none; }

.flow-top {
  margin: 0 0 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(233, 196, 106, .24);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(233, 196, 106, .12), transparent 60%),
    linear-gradient(160deg, rgba(18, 26, 44, .96), rgba(9, 14, 26, .98));
  box-shadow: 0 18px 45px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.flow-kicker { font: 700 10px/1 Inter, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #e9c46a; }
.flow-title { margin: 6px 0 10px; font: 700 24px/1.15 Georgia, serif; color: #f7f0df; }
.flow-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.flow-stats span {
  font: 500 11px/1 Inter, sans-serif; color: #cbd3e6; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; padding: 7px 10px;
}
.flow-stats b { color: #ffe0a0; font-weight: 800; }

.flow-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.flow-modes button {
  text-align: left; padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .035); color: #e9eefb;
  transition: border-color .18s, background .18s, transform .18s;
}
.flow-modes button:hover { transform: translateY(-1px); border-color: rgba(233, 196, 106, .35); }
.flow-modes button.on { border-color: rgba(233, 196, 106, .8); background: linear-gradient(160deg, rgba(233, 196, 106, .18), rgba(233, 196, 106, .04)); }
.flow-modes b { display: block; font: 700 12.5px/1.25 Inter, sans-serif; }
.flow-modes small { display: block; margin-top: 3px; color: #9aa6bf; font-size: 10.5px; }
/* ---------- verse of the day: one tap to a reel ---------- */
.flow-today { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  margin: 0 0 12px; padding: 20px 20px 22px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(233, 196, 106, .1), rgba(255, 255, 255, .02));
  border: 1px solid rgba(233, 196, 106, .3); }
.ft-art { width: 92px; height: 92px; flex: none; }
.ft-art svg { width: 100%; height: 100%; }
.ft-halo { animation: ftPulse 3.6s ease-in-out infinite; transform-origin: 60px 64px; }
.ft-rays { animation: ftSpin 44s linear infinite; transform-origin: 60px 62px; }
.ft-mosque { animation: ftGlow 3.6s ease-in-out infinite; }
.ft-dome { animation: ftDome 3.6s ease-in-out infinite; }
.ft-spark { animation: ftTwinkle 2.2s ease-in-out infinite; transform-origin: 104px 36px; }
.ft-spark2 { animation: ftTwinkle 2.8s ease-in-out infinite .7s; transform-origin: 18px 88px; }
@keyframes ftPulse { 0%,100% { transform: scale(1); opacity: .75 } 50% { transform: scale(1.1); opacity: 1 } }
@keyframes ftSpin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }
@keyframes ftGlow { 0%,100% { opacity: .85 } 50% { opacity: 1 } }
@keyframes ftDome { 0%,100% { opacity: .7 } 50% { opacity: 1 } }
@keyframes ftTwinkle { 0%,100% { opacity: .3; transform: scale(.8) rotate(0deg) } 50% { opacity: 1; transform: scale(1.15) rotate(20deg) } }
.ft-copy { min-width: 0; max-width: 780px; }
.ft-label { display: inline-flex; align-items: center; gap: 7px; font: 700 9.5px/1 Inter, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: #c9b478; margin-bottom: 9px; }
.ft-label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.ft-ar { margin: 0 0 6px; font: 500 22px/1.7 'Noto Naskh Arabic', 'Amiri Quran', serif; color: #f6ecd0; }
.ft-tr { margin: 0; font: 400 13.5px/1.55 Inter, sans-serif; color: #b9c2d4; }
.ft-ref { margin: 8px 0 0; font: 600 10.5px/1.4 Inter, sans-serif; color: #8f9ab1; letter-spacing: .04em; }
.ft-spinner { display: none; width: 24px; height: 24px; margin: 2px 0; border-radius: 50%;
  border: 3px solid rgba(233, 196, 106, .25); border-top-color: #e9c46a; animation: ftSpin .8s linear infinite; }
.flow-today.loading .ft-spinner { display: inline-block; }
.flow-today.loading .ft-ar, .flow-today.loading .ft-tr, .flow-today.loading .ft-ref { display: none; }
.ft-create:disabled { opacity: .6; cursor: default; }
.ft-create { align-self: center; white-space: nowrap; display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 26px; font-size: 14.5px; font-weight: 800; min-width: 250px; justify-content: center; }
.ft-create svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.flow-today-or { margin: 0 0 16px; text-align: center; color: #8f9ab1; font: 600 11px/1 Inter, sans-serif; letter-spacing: .04em; }
@media (max-width: 720px) {
  .flow-today { gap: 12px; padding: 18px 16px 20px; }
  .ft-art { width: 74px; height: 74px; }
  .ft-ar { font-size: 18px; }
  .ft-create { width: 100%; min-width: 0; }
}


.flow-stepbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.flow-stepbar::-webkit-scrollbar { display: none; }
.flow-step {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03);
  color: #aeb8cd; border-radius: 999px; padding: 6px 9px 6px 6px; font: 600 10.5px/1 Inter, sans-serif;
}
.flow-step i {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, .07); color: #cfd6e6; font-style: normal; font-size: 10px;
}
.flow-step.on { color: #1d1606; background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; }
.flow-step.on i { background: rgba(0, 0, 0, .16); color: #1d1606; }

.flow-flowrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 20px; }
.flow-server { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font: 500 10.5px/1.2 Inter, sans-serif; color: #aeb8cd; cursor: pointer; }
.flow-server input { accent-color: #e9c46a; }
.flow-server small { color: #7f8aa3; }
.flow-note { margin: 9px 0 0; color: #8f9ab1; font: 400 10.5px/1.45 Inter, sans-serif; }

.flow-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 0 6px; color: #cfd6e6; font: 600 11px/1.2 Inter, sans-serif; }
.flow-label em { font-style: normal; color: #8f9ab1; font-weight: 500; }
.flow-pick { position: relative; }
.flow-pick-btn, .flow-select {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12);
  color: #f0f3fa; border-radius: 12px; padding: 11px 12px; cursor: pointer;
  font: 600 12px/1.2 Inter, sans-serif; text-align: left;
}
.flow-pick-btn:hover { border-color: rgba(233, 196, 106, .5); }
.flow-pick-panel {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  background: #0d1424; border: 1px solid rgba(233, 196, 106, .28); border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55); padding: 8px; max-height: 320px; overflow: auto;
}
.flow-search, .flow-input {
  width: 100%; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  color: #f0f3fa; border-radius: 10px; padding: 10px 11px; font: 500 12px/1.2 Inter, sans-serif; outline: none;
}
.flow-search:focus, .flow-input:focus { border-color: rgba(233, 196, 106, .7); box-shadow: 0 0 0 3px rgba(233, 196, 106, .1); }
.flow-list { margin-top: 6px; }
.flow-item {
  width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 10px; padding: 8px; color: #e9eefb;
}
.flow-item:hover, .flow-item.on { background: rgba(233, 196, 106, .1); }
.fi-flag { width: 22px; text-align: center; flex: 0 0 22px; font-size: 15px; }
.fi-main { min-width: 0; flex: 1; }
.fi-main b { display: block; font: 700 12px/1.25 Inter, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-main small { display: block; color: #8f9ab1; font-size: 10px; }
.fi-meta { flex: 0 0 auto; text-align: right; color: #b8c2d8; font: 500 9.5px/1.35 Inter, sans-serif; }
.flow-empty, .flow-ok { margin: 7px 2px; color: #8f9ab1; font: 400 11px/1.5 Inter, sans-serif; }
.flow-ok { color: #b9e0b0; }
.flow-inline { margin-top: 7px; }

.flow-card {
  margin: 12px 0; padding: 13px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
}
.flow-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.flow-card-head b { font: 700 12.5px/1.2 Inter, sans-serif; color: #f2f5fc; }
.flow-card-head span { color: #9aa6bf; font: 500 10px/1.2 Inter, sans-serif; }
.flow-search-row { display: flex; gap: 7px; }
.flow-search-row .flow-input { flex: 1; }
.flow-results { margin-top: 9px; max-height: 260px; overflow: auto; }
.flow-result {
  width: 100%; text-align: left; cursor: pointer; display: block; margin: 0 0 6px;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px; padding: 9px 10px; color: #e9eefb;
}
.flow-result:hover { border-color: rgba(233, 196, 106, .4); }
.fr-ar { display: block; font: 500 16px/1.6 'Noto Naskh Arabic', 'Amiri Quran', serif; color: #ffe6b0; }
.fr-tr { display: block; margin-top: 3px; font: 400 11.5px/1.45 Inter, sans-serif; color: #d7ddea; }
.flow-result small { display: block; margin-top: 4px; color: #8f9ab1; font-size: 9.5px; }

.flow-vlist { max-height: 290px; overflow: auto; }
.flow-vrow { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.flow-vrow:first-child { border-top: 0; }
.flow-vrow small { color: #8f9ab1; font: 600 9.5px/1.2 Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.fv-ar { margin-top: 4px; font: 500 18px/1.7 'Noto Naskh Arabic', 'Amiri Quran', serif; color: #ffe6b0; }
.fv-tr { margin-top: 3px; font: 400 11.5px/1.5 Inter, sans-serif; color: #d7ddea; }
.flow-card-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.flow-author { flex: 1; min-width: 150px; color: #9aa6bf; font: 500 10px/1.2 Inter, sans-serif; }
.flow-author select { width: 100%; margin-top: 4px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); color: #e9eefb; border-radius: 9px; padding: 8px; font: 500 11px/1.2 Inter, sans-serif; }
.flow-paste-focus { animation: flowPulse 1.2s ease-in-out 2; }
@keyframes flowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(233, 196, 106, 0); } 50% { box-shadow: 0 0 0 5px rgba(233, 196, 106, .18); } }

.flow-bg-tabs { display: flex; gap: 6px; margin: 8px 0 10px; flex-wrap: wrap; }
.flow-bg-tabs button {
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
  color: #b8c2d8; border-radius: 999px; padding: 7px 10px; font: 600 10.5px/1 Inter, sans-serif; cursor: pointer;
}
.flow-bg-tabs button.on { color: #1d1606; background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; }
.flow-bg-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.flow-bg-search .flow-input { flex: 1 1 220px; width: auto; min-width: 0; }
.flow-bg-search .btn { flex: none; white-space: nowrap; }
.flow-bg-results { flex: 1 0 100%; margin: 0; }
.flow-bg-results .bgrid { margin: 0; }

/* focus ring when a step jumps to a control */
.flow-focus { animation: flowRing 1.6s ease-out; border-radius: 14px; }
@keyframes flowRing { 0% { box-shadow: 0 0 0 0 rgba(233, 196, 106, .55); } 100% { box-shadow: 0 0 0 8px rgba(233, 196, 106, 0); } }

/* ---------------- generation panel ---------------- */
#job.flow-gen {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(4, 8, 17, .82); backdrop-filter: none;
}
#job.flow-gen .mbox {
  width: min(880px, calc(100vw - 32px)); max-height: 90vh; overflow: auto;
  padding: 22px; border-radius: 26px;
  background: linear-gradient(165deg, rgba(19, 27, 46, .99), rgba(8, 12, 24, .99));
  border: 1px solid rgba(233, 196, 106, .28);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .05);
}
#job.flow-gen .ring, #job.flow-gen #jobT, #job.flow-gen #jobMsg { display: none; }
#job.flow-gen #jobActs { justify-content: center; margin-top: 16px; }
.flow-gen { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: center; }
.fg-visual { display: flex; justify-content: center; }
.fg-film {
  position: relative; width: 270px; height: 480px; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255, 224, 160, .4); background:
    radial-gradient(circle at 50% 35%, rgba(233, 196, 106, .16), transparent 62%),
    linear-gradient(160deg, #0b1222, #05070d);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.fg-film::before, .fg-film::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 9px; z-index: 2; opacity: .35;
  background: repeating-linear-gradient(180deg, transparent 0 10px, rgba(255, 255, 255, .4) 10px 16px);
}
.fg-film::before { left: 0; } .fg-film::after { right: 0; }
#flowGenPreview { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.fg-rec {
  position: absolute; z-index: 3; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(4, 8, 17, .72); border: 1px solid rgba(255, 255, 255, .12); color: #f3e9d2;
  border-radius: 999px; padding: 4px 8px; font: 700 9px/1 Inter, sans-serif; letter-spacing: .08em;
}
.fg-rec i { width: 6px; height: 6px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 8px #ff5a5a; animation: fgRec 1.4s ease-in-out infinite; }
@keyframes fgRec { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.fg-corner { position: absolute; z-index: 3; width: 18px; height: 18px; border-color: rgba(255, 224, 160, .75); }
.fg-corner.tl { left: 10px; top: 10px; border-left: 1.5px solid; border-top: 1.5px solid; border-radius: 4px 0 0 0; }
.fg-corner.tr { right: 10px; top: 10px; border-right: 1.5px solid; border-top: 1.5px solid; border-radius: 0 4px 0 0; }
.fg-corner.bl { left: 10px; bottom: 10px; border-left: 1.5px solid; border-bottom: 1.5px solid; border-radius: 0 0 0 4px; }
.fg-corner.br { right: 10px; bottom: 10px; border-right: 1.5px solid; border-bottom: 1.5px solid; border-radius: 0 0 4px 0; }
.fg-copy { min-width: 0; }
.fg-kicker { display: block; font: 700 9.5px/1 Inter, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #e9c46a; }
.fg-title { display: block; margin: 7px 0 7px; font: 700 21px/1.2 Georgia, serif; color: #fff4dd; }
.fg-note { display: block; color: #aab4c8; font: 400 11px/1.5 Inter, sans-serif; }
.fg-bar { height: 7px; margin: 14px 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fg-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #c9963d, #ffe0a0); transition: width .35s ease; }
.fg-time { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; color: #aab4c8; font: 500 10px/1.2 Inter, sans-serif; }
.fg-time b { color: #ffe0a0; font-size: 15px; }
.fg-stages { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.fg-stages span { border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); color: #8f9ab1; border-radius: 999px; padding: 5px 7px; font: 600 9px/1 Inter, sans-serif; }
.fg-stages span.on { color: #1d1606; background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; }
.fg-small { margin: 11px 0 0; color: #7f8aa3; font: 400 9.5px/1.45 Inter, sans-serif; }
@media (max-width: 900px) {
  #job.flow-gen { padding: 12px; }
  #job.flow-gen .mbox { width: calc(100vw - 20px); max-height: 90vh; padding: 16px; border-radius: 22px; }
  .flow-gen { grid-template-columns: 1fr; gap: 13px; text-align: center; }
  .fg-film { width: 190px; height: 338px; }
  .fg-title { font-size: 18px; }
  .fg-time, .fg-stages { justify-content: center; }
  .fg-small { display: none; }
}
.flow-quality { display:inline-flex; align-items:center; gap:5px; color:#8f9ab1; font:500 10px/1.2 Inter,sans-serif; }
.flow-quality select { background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); color:#e9eefb; border-radius:8px; padding:6px 7px; font:500 10px/1.2 Inter,sans-serif; }
.fg-tech { display:inline-block; margin-top:6px; color:#7f8aa3; font:500 9.5px/1.2 Inter,sans-serif; letter-spacing:.03em; }
.fg-stat { color:#d7ddea; font:600 10px/1.2 Inter,sans-serif; }
.fg-live { position:relative; width:100%; height:100%; overflow:hidden; background:radial-gradient(circle at 50% 35%,rgba(233,196,106,.12),transparent 62%),linear-gradient(160deg,#0b1222,#05070d); }
.fg-live > #wrap { pointer-events:none; }
.fg-mode { display:inline-block; margin:0 0 7px; color:#e9c46a; font:600 10px/1.2 Inter,sans-serif; letter-spacing:.06em; text-transform:uppercase; }
.flow-reels { display:inline-block; margin:0 0 10px; color:#e9c46a; font:600 10.5px/1.2 Inter,sans-serif; text-decoration:none; border:1px solid rgba(233,196,106,.3); border-radius:999px; padding:6px 9px; }
.flow-reels:hover { background:rgba(233,196,106,.1); }
.fg-art { width:100%; height:100%; display:block; }
.fg-art-verse { font: 500 8px 'Noto Naskh Arabic','Amiri Quran',serif; fill:#33240b; }
.fg-art-pct { font: 700 9px Inter,sans-serif; fill:#ffe6b0; }
.fg-phone { animation: fgPhone 3.4s ease-in-out infinite; transform-origin: 214px 270px; }
.fg-book { animation: fgBook 4.2s ease-in-out infinite; transform-origin: 97px 150px; }
.fg-star { animation: fgStar 3s ease-in-out infinite; }
@keyframes fgPhone { 0%,100% { opacity:.85; } 50% { opacity:1; } }
@keyframes fgBook { 0%,100% { opacity:.75; } 50% { opacity:1; } }
@keyframes fgStar { 0%,100% { opacity:.25; } 50% { opacity:.8; } }

/* dev switch (owner/admin only) */
.flow-dev { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; padding:10px 12px; border:1px dashed rgba(233,196,106,.35); border-radius:12px; background:rgba(233,196,106,.05); color:#cfd6e6; font:500 11px/1.3 Inter,sans-serif; }
.flow-dev b { font:700 9.5px/1 Inter,sans-serif; letter-spacing:.16em; text-transform:uppercase; color:#e9c46a; }
.flow-dev label { display:inline-flex; align-items:center; gap:5px; cursor:pointer; }
.flow-dev select { background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); color:#e9eefb; border-radius:8px; padding:5px 7px; font:500 10.5px/1.2 Inter,sans-serif; }
.flow-dev[hidden] { display:none; }

/* ---------- readability: every dropdown readable in every browser ---------- */
:root { color-scheme: dark; }
select, .flow-select, .flow-author select, .flow-pick select, .flow-dev select {
  background-color: #0d1424 !important; color: #f0f3fa !important;
  border-color: rgba(255, 255, 255, .18) !important; color-scheme: dark;
}
select option, select optgroup { background: #0d1424; color: #f0f3fa; }
select option:checked { background: #1d2740; color: #ffe6a8; }
input[type=color], input[type=range] { color-scheme: dark; }

/* ---------- step spine: a wizard, not loose pills ---------- */
.flow-stepbar {
  display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding: 0 0 2px;
  margin: 0 0 16px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  scrollbar-width: none;
}
.flow-stepbar::-webkit-scrollbar { display: none; }
.flow-step {
  position: relative; flex: 0 1 auto; display: flex; align-items: center; gap: 7px;
  padding: 11px 10px 13px 0; margin-right: 8px; background: none; border: 0;
  color: #8f9ab1; cursor: pointer; white-space: nowrap;
  font: 600 11.5px/1.1 Inter, sans-serif; transition: color .18s;
}
@media (max-width: 1180px) { .flow-step span { display: none; } .flow-step { margin-right: 4px; } }
.flow-step:hover { color: #dfe6f5; }
.flow-step i {
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  color: #cfd6e6; font: 700 11px/1 Inter, sans-serif; transition: all .18s;
}
.flow-step.on { color: #fff6e2; }
.flow-step.on i {
  background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; color: #1d1606;
  box-shadow: 0 6px 18px -8px rgba(233, 196, 106, .9);
}
.flow-step.on::after {
  content: ''; position: absolute; left: 0; right: 14px; bottom: -3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #e9c46a, rgba(233, 196, 106, .15));
}
.flow-step.done i { background: rgba(233, 196, 106, .16); border-color: rgba(233, 196, 106, .45); color: #ffe6a8; }

/* ---------- template step: Surprise me / Preview all are primary ---------- */
.lookbar { display: flex; gap: 9px; flex-wrap: wrap; margin: 0 0 14px; }
.lookbar .btn { flex: 1 1 190px; padding: 12px 14px; font: 700 13px/1 Inter, sans-serif; }
#shuffle {
  background: linear-gradient(135deg, #f6dc8e, #e9c46a 55%, #c99a35); color: #1a1405;
  border-color: transparent; box-shadow: 0 12px 28px -16px rgba(233, 196, 106, .95);
}
#tour { background: rgba(233, 196, 106, .10); border-color: rgba(233, 196, 106, .45); color: #ffe6a8; }

/* ---------- gallery paging + loader ---------- */
.flow-more { display: block; width: 100%; margin: 12px 0 0; padding: 11px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12); color: #cfd6e6;
  font: 600 12px/1 Inter, sans-serif; cursor: pointer; }
.flow-more:hover { border-color: rgba(233, 196, 106, .45); color: #fff3d6; }
.flow-loading { display: flex; align-items: center; gap: 9px; justify-content: center; margin: 0 0 12px;
  padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08); color: #aeb8cd; font: 500 11.5px/1.3 Inter, sans-serif; }
.flow-loading i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(233, 196, 106, .25);
  border-top-color: #e9c46a; animation: flowSpin .8s linear infinite; display: block; }
@keyframes flowSpin { to { transform: rotate(360deg); } }
.pg-off { display: none !important; }

/* ---------- new controls (verse switch, own wording, photo search) ---------- */
.flow-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: #cfd6e6; font: 600 11.5px/1.2 Inter, sans-serif; }
.flow-switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 99px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); position: relative; cursor: pointer; transition: .18s; }
.flow-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #cfd6e6; transition: .18s; }
.flow-switch input:checked { background: rgba(233, 196, 106, .32); border-color: rgba(233, 196, 106, .6); }
.flow-switch input:checked::after { left: 18px; background: #e9c46a; }
.flow-own { margin-top: 12px; }
.flow-own textarea { width: 100%; min-height: 78px; resize: vertical; line-height: 1.5; }
.flow-bg-results { margin-top: 12px; }
.flow-bg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.flow-bg-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); color: #cfd6e6;
  border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.flow-bg-tabs button:hover { border-color: rgba(233, 196, 106, .45); transform: translateY(-1px); }
.flow-bg-tabs button span { font: 700 12.5px/1.2 Inter, sans-serif; }
.flow-bg-tabs button small { font: 500 10px/1.25 Inter, sans-serif; color: #8f9ab1; }
.flow-bg-tabs button.on { background: linear-gradient(160deg, rgba(233, 196, 106, .2), rgba(233, 196, 106, .04));
  border-color: rgba(233, 196, 106, .55); color: #fff6e2; }
.flow-bg-tabs button.on small { color: #d9c68c; }
@media (max-width: 820px) { .flow-bg-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- generation card: a proper panel, not a pill ---------- */
#job.flow-gen { padding: 18px; }
#job.flow-gen .mbox { padding: 0; overflow: auto; max-height: 92vh; }
.flow-gen { grid-template-columns: 250px 1fr; gap: 0; align-items: stretch; }
.flow-gen .fg-visual { padding: 22px 22px 22px 24px; background: linear-gradient(160deg, rgba(233, 196, 106, .07), rgba(255, 255, 255, .01)); }
.flow-gen .fg-film { width: 100%; height: auto; aspect-ratio: 9/16; max-height: 46vh; }
.flow-gen .fg-copy { padding: 22px 24px 20px; display: flex; flex-direction: column; }
.flow-gen .fg-title { font-size: 22px; }
.flow-gen .fg-bar { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .07); }
.flow-gen .fg-bar i { border-radius: 99px; background: linear-gradient(90deg, #c9963d, #ffe0a0); }
.flow-gen .fg-time { margin-top: 14px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.flow-gen .fg-time b { font-size: 34px; line-height: 1; color: #ffe6a8; font-family: Georgia, serif; }
.flow-gen .fg-time span { font-size: 11px; color: #9aa6bf; }
.flow-gen .fg-stages { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; border-left: 1px solid rgba(255, 255, 255, .08); padding-left: 16px; }
.flow-gen .fg-stages span { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: #7d879c;
  border-radius: 0; padding: 5px 0; font: 600 11.5px/1.3 Inter, sans-serif; position: relative; }
.flow-gen .fg-stages span svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.flow-gen .fg-stages span.on { color: #ffe6a8; background: none; }
.flow-gen .fg-stages span.on svg { stroke: #e9c46a; }
.flow-gen .fg-stages span.done { color: #93a08f; }
.fg-verse { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .08); padding: 16px 24px 18px;
  background: rgba(255, 255, 255, .02); }
.fg-verse .fv-label { display: block; font: 700 9px/1 Inter, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #8a7a4e; margin-bottom: 8px; }
.fg-verse .fv-ar { font: 500 20px/1.7 'Noto Naskh Arabic', 'Amiri Quran', serif; color: #f6ecd0; margin: 0 0 4px; }
.fg-verse .fv-tr { font: 400 12.5px/1.55 Inter, sans-serif; color: #aab4c8; margin: 0; }
.fg-verse .fv-ref { font: 500 10px/1.4 Inter, sans-serif; color: #7f8aa3; margin: 6px 0 0; letter-spacing: .04em; }
@media (max-height: 840px) and (min-width: 901px) {
  .flow-gen { grid-template-columns: 210px 1fr; }
  .flow-gen .fg-visual { padding: 16px; }
  .flow-gen .fg-stages { margin-top: 12px; }
  .fg-verse { padding: 12px 20px 14px; }
  .fg-verse .fv-ar { font-size: 17px; }
}
@media (max-width: 900px) {
  .flow-gen { grid-template-columns: 1fr; }
  .flow-gen .fg-visual { padding: 14px; }
  .flow-gen .fg-film { width: 190px; margin: 0 auto; }
  .flow-gen .fg-copy { padding: 14px 16px 16px; }
  .flow-gen .fg-time b { font-size: 28px; }
}

/* ---------- the step bar is a tab bar now (no pills, no jumps) ---------- */
.flow-stepbar {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
  align-items: stretch; padding: 0; margin: 0 0 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .09); background: #0b1222;
}
.flow-step-hint { margin: 0 0 14px; color: #9aa6bf; font: 400 11px/1.45 Inter, sans-serif; }
.flow-step {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; padding: 11px 4px 13px; background: none !important;
  border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  color: #8f9ab1; cursor: pointer; text-align: left;
  font: 600 11px/1.2 Inter, sans-serif; transition: color .18s;
}
.flow-step .fs-ic { position: relative; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #c3cbdb; }
.flow-step .fs-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.flow-step .fs-ic i { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; background: #1b2540; border: 1px solid rgba(255, 255, 255, .18);
  color: #cfd6e6; font: 700 9px/1 Inter, sans-serif; font-style: normal; }
.flow-step .fs-tx { display: block; font: 600 10.5px/1.25 Inter, sans-serif; color: #b9c2d4;
  white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
.flow-step:hover .fs-ic { border-color: rgba(233, 196, 106, .5); color: #ffe6a8; }
.flow-step.on .fs-ic { background: linear-gradient(160deg, rgba(233, 196, 106, .28), rgba(233, 196, 106, .08));
  border-color: rgba(233, 196, 106, .6); color: #ffe6a8; box-shadow: 0 8px 20px -12px rgba(233, 196, 106, .9); }
.flow-step.on .fs-ic i { background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; color: #1d1606; }
.flow-step.on .fs-tx { color: #fff6e2; }
.flow-step:hover { color: #dfe6f5; }
.flow-step i {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  color: #cfd6e6; font: 700 11px/1 Inter, sans-serif; font-style: normal; transition: all .18s;
}
.flow-step.on { color: #fff6e2 !important; background: none !important; }
.flow-step.on i {
  background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; color: #1d1606;
  box-shadow: 0 6px 18px -8px rgba(233, 196, 106, .9);
}
.flow-step.on::after {
  content: ''; position: absolute; left: 0; right: 15px; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #e9c46a, rgba(233, 196, 106, .2));
}
.flow-step.done i { background: rgba(233, 196, 106, .16); border-color: rgba(233, 196, 106, .45); color: #ffe6a8; }
@media (max-width: 900px) {
  .flow-stepbar { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .flow-stepbar::-webkit-scrollbar { display: none; }
  .flow-step { flex-direction: row; align-items: center; gap: 7px; padding: 11px 12px 13px 0; margin-right: 8px; }
  .flow-step span { display: none; }
  .flow-step.on span { display: inline; }
}

/* ---------- wizard panels ---------- */
.flow-wizard { margin: 0 0 8px; }
.flow-panel { animation: flowFade .22s ease; padding-top: 4px; }
@keyframes flowFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.flow-panel[hidden] { display: none; }
.flow-panel .sec { margin-top: 0; border-top: 0; padding-top: 4px; }
.flow-panel .sec > h2 .n { display: none; }
.flow-panel-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.flow-panel-head b { font: 700 15px/1.2 Inter, sans-serif; color: #fff6e2; }
.flow-summary { display: grid; gap: 8px; margin: 0 0 18px; }
.fs-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 13px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.fs-row span { color: #8f9ab1; font: 600 11px/1.2 Inter, sans-serif; }
.fs-row b { color: #e9eefb; font: 600 12px/1.35 Inter, sans-serif; text-align: right; }
.flow-create { width: 100%; padding: 16px; font: 700 15px/1 Inter, sans-serif; }

.flow-flowrow[hidden] { display: none !important; }

/* ---------- country + voice list ---------- */
.flow-block { margin: 0 0 18px; }
.flow-voices { display: grid; gap: 6px; max-height: 250px; overflow: auto; padding-right: 4px; }
.flow-voice-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08); color: #dfe6f5; cursor: pointer; transition: border .15s, background .15s; }
.flow-voice-row:hover { border-color: rgba(233, 196, 106, .4); }
.flow-voice-row.on { background: rgba(233, 196, 106, .12); border-color: rgba(233, 196, 106, .5); }
.flow-voice-row .vr-main { flex: 1; min-width: 0; }
.flow-voice-row .vr-main b { display: block; font: 600 12px/1.2 Inter, sans-serif; }
.flow-voice-row .vr-main small { display: block; font: 500 10.5px/1.3 Inter, sans-serif; color: #8f9ab1; margin-top: 2px; }
.vr-play { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #e9eefb; font-size: 10px; cursor: pointer; }
.vr-play:hover { background: rgba(233, 196, 106, .2); border-color: rgba(233, 196, 106, .5); }
.vr-play.loading { color: #e9c46a; animation: flowSpin .9s linear infinite; border-radius: 50%; }
.vr-play.loading::after { content: ''; }
.vr-play.playing { background: rgba(233, 196, 106, .25); border-color: rgba(233, 196, 106, .6); color: #ffe6a8; }
.flow-search-opts { margin: 10px 0 0; }
.flow-search-opts label { display: flex; align-items: center; gap: 9px; color: #8f9ab1; font: 600 10.5px/1.2 Inter, sans-serif; }
.flow-search-opts select { width: auto; min-width: 200px; }

/* sample buttons show their state */
#flowQariPrev.loading, #flowQariPrev.playing { color: #ffe6a8; border-color: rgba(233, 196, 106, .5); background: rgba(233, 196, 106, .12); }
.vr-play.loading { animation: flowSpin .9s linear infinite; }

/* ---------- voice list polish ---------- */
.flow-voice-row .vr-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.flow-voice-row .vr-main b { font: 700 13px/1.25 Inter, sans-serif; color: #fff6e2; }
.flow-voice-row .vr-main .vr-voice { font: 600 11.5px/1.2 Inter, sans-serif; color: #c3cbdb; }
.flow-voice-row .vr-main small { font: 500 10.5px/1.2 Inter, sans-serif; color: #8f9ab1; margin: 0; }
.flow-vgender { display: flex; gap: 6px; margin: 0 0 10px; }
.flow-vgender button { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  color: #cfd6e6; border-radius: 99px; padding: 7px 16px; font: 600 11px/1 Inter, sans-serif; cursor: pointer; }
.flow-vgender button.on { background: linear-gradient(160deg, rgba(233, 196, 106, .22), rgba(233, 196, 106, .05));
  border-color: rgba(233, 196, 106, .55); color: #ffeec4; }

/* the country search opens wide, not inside the little box */
.flow-pick-panel.wide {
  position: fixed; left: 0; right: 0; top: 10vh; margin: 0 auto;
  width: min(780px, 94vw); max-height: 74vh; z-index: 500;
  background: #0d1424; border: 1px solid rgba(233, 196, 106, .3); border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7); padding: 14px;
}
.flow-pick-panel.wide .flow-search { font-size: 15px; padding: 12px 14px; }

/* ---------- find a verse: extra language + try words ---------- */
.flow-search-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 13px 0 0; }
.flow-search-opts .fsq-label { color: #cfd6e6; font: 600 11.5px/1.3 Inter, sans-serif; }
.flow-search-opts select { flex: 1 1 240px; min-width: 200px; }
.flow-try { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.flow-try > span { color: #8f9ab1; font: 700 9px/1 Inter, sans-serif; letter-spacing: .16em; text-transform: uppercase; flex: none; }
.flow-try-words { display: flex; flex-wrap: nowrap; gap: 5px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; flex: 1 1 auto; min-width: 0; }
.flow-try-words::-webkit-scrollbar { height: 5px; }
.flow-try-words::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; }
.flow-try-word { font-family: 'Noto Naskh Arabic', 'Noto Sans Tamil', 'Noto Sans Devanagari', 'Noto Sans Bengali', 'Noto Sans Malayalam', Inter, sans-serif;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  color: #cdd5e4; border-radius: 99px; padding: 4px 9px; font: 500 11px/1.15 Inter, sans-serif;
  cursor: pointer; white-space: nowrap; flex: none; }
.flow-try-word:hover { border-color: rgba(233, 196, 106, .5); color: #ffeec4; background: rgba(233, 196, 106, .1); }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; border: 2px solid rgba(36, 26, 6, .3); border-top-color: #1a1405; animation: flowSpin .7s linear infinite; }

/* yes / no for the extra search language */
.flow-yn { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.flow-yn button { background: none; border: 0; color: #aeb8cd; border-radius: 99px; padding: 5px 14px;
  font: 600 11px/1 Inter, sans-serif; cursor: pointer; }
.flow-yn button.on { background: linear-gradient(160deg, #ffe0a0, #d9ad55); color: #1d1606; }
.flow-search-opts .flow-pick { width: 100%; }

/* one paste box per verse */
.flow-own-list { display: grid; gap: 10px; }
.flow-pv { display: block; }
.flow-pv > span { display: block; color: #8f9ab1; font: 600 10px/1.3 Inter, sans-serif; letter-spacing: .04em; margin-bottom: 4px; }
.flow-pv textarea { width: 100%; min-height: 58px; resize: vertical; line-height: 1.5; }

/* [hidden] must always win over our display rules */
.flow-top [hidden], .flow-panel [hidden], .flow-wizard [hidden], .flow-card [hidden] { display: none !important; }

/* ---------- avoid the base flash: the studio appears when our flow is ready ---------- */
html.booting body { opacity: 0; }
body { transition: opacity .18s ease; }
#createBar { display: none !important; }                 /* the mobile bar keeps Edit/Preview only */
@media (max-width: 900px) {
  body[data-view="prev"] #createBar { display: inline-flex !important; }  /* preview mode: offer Create right away */
}
/* the nav always offers to make the reel, with whatever is set right now */
#createTop { display: inline-flex !important; }
#createTop .bar-create-t { white-space: nowrap; }
@media (max-width: 900px) {
  #createTop { padding: 9px 12px !important; font-size: 12px !important; gap: 6px; }
  #createTop svg { width: 15px; height: 15px; }
  .top .bar-create { flex: none; }
}

/* ---------- tweak the look: the quick chips under the preview ---------- */
#qb { width: 100%; }
#qb .qchips { display: flex; flex-wrap: wrap; gap: 6px; }
#qb .qchips button { flex: none; }
#qb .qsheet { margin-top: 8px; }
#qb .qsheet .qh { margin: 14px 0 6px; }
#qb .qsheet .rg { display: block; margin: 10px 0 0; }
#qb .qsheet .rg span { display: block; font: 600 12px Manrope; color: var(--mut); margin-bottom: 6px; }
#qb .qsheet .rg output { color: var(--gold); font-weight: 700; }
#qb .qsheet .rg input[type=range] { width: 100%; }
@media (max-width: 900px) {
  #qb .qchips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding: 2px 0 6px; }
  #qb .qchips::-webkit-scrollbar { display: none; }
  #qb .qsheet { max-height: 34vh; }
  #qb .qsheet .qh { margin: 12px 0 4px; }
}

/* ---------- the steps are connected ---------- */
.flow-stepbar { position: relative; }
.flow-stepbar::before { content: ''; position: absolute; left: 26px; right: 26px; top: 25px; height: 2px;
  background: rgba(255, 255, 255, .12); border-radius: 2px; }
.flow-step { z-index: 1; }
.flow-step .fs-ic { background: #111a30; }
.flow-step.on .fs-ic { background: linear-gradient(160deg, rgba(233, 196, 106, .3), rgba(233, 196, 106, .1)); }
.flow-step .fs-cnt { display: block; min-height: 12px; margin-top: 3px; font: 500 9.5px/1.2 Inter, sans-serif; color: #7f8aa3; }
.flow-step.on .fs-cnt { color: #d9c68c; }

/* ---------- all steps, below the current one ---------- */
.flow-allsteps { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.flow-allsteps .fa-label { display: block; color: #8f9ab1; font: 700 9.5px/1 Inter, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 10px; }
.flow-allsteps .fa-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07); margin-bottom: 6px; }
.flow-allsteps .fa-row:hover { border-color: rgba(233, 196, 106, .4); background: rgba(255, 255, 255, .05); }
.flow-allsteps .fa-row i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .08); color: #cfd6e6; font: 700 10px/1 Inter, sans-serif; font-style: normal; }
.flow-allsteps .fa-ic { width: 20px; height: 20px; flex: none; color: #aeb8cd; }
.flow-allsteps .fa-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.flow-allsteps .fa-tx { min-width: 0; }
.flow-allsteps .fa-tx b { display: block; font: 600 12px/1.2 Inter, sans-serif; color: #e6ebf6; }
.flow-allsteps .fa-tx small { display: block; font: 400 10.5px/1.35 Inter, sans-serif; color: #8f9ab1; margin-top: 2px; }

/* ---------- our own player ---------- */
.apl { display: block; }
.apl-stage { position: relative; width: 100%; aspect-ratio: 9/16; max-height: 340px; margin: 0 auto;
  background: #05070d; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; }
.apl-stage video, .apl-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: center; }
.apl-poster.hidden { display: none; }
.apl-ctrl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 22px 12px 11px; background: linear-gradient(to top, rgba(3, 6, 12, .82), rgba(3, 6, 12, 0));
  opacity: .96; transition: opacity .18s; }
.apl-stage:hover .apl-ctrl, .apl-stage.paused .apl-ctrl { opacity: 1; }
.apl-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(160deg, #ffe0a0, #d9ad55); color: #1d1606; display: grid; place-items: center;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .9); }
.apl-play svg { width: 18px; height: 18px; display: block; }
.apl-bar { position: relative; flex: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .22); cursor: pointer; }
.apl-bar i { position: absolute; inset: 0 auto 0 0; display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #c9963d, #ffe0a0); }
.apl-bar b { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff6e2; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
.apl-time { flex: none; display: flex; gap: 5px; align-items: center; color: #e6ebf5;
  font: 600 10.5px/1 Inter, sans-serif; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.apl-time span:first-child::after { content: '/'; opacity: .5; margin-left: 5px; }

/* ---------- your videos ---------- */
.flow-library { margin: 26px auto 0; padding: 22px 20px 80px; max-width: 1320px; border-top: 1px solid rgba(255, 255, 255, .08); scroll-margin-top: calc(var(--hdr) + 18px); }
.flow-library .fl-anchor { display: block; height: 0; scroll-margin-top: calc(var(--hdr) + 16px); }
.flow-library .fl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.flow-library .fl-head b { font: 700 14px/1.2 Inter, sans-serif; color: #fff6e2; }
.flow-library .fl-note { margin: 12px 0 0; color: #8f9ab1; font: 400 10.5px/1.45 Inter, sans-serif; }
.flow-library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lib-card { background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 10px; }
.lib-info { margin: 9px 0 8px; }
.lib-info b { display: block; font: 600 12px/1.3 Inter, sans-serif; color: #e6ebf6; }
.lib-info small { display: block; font: 400 10px/1.4 Inter, sans-serif; color: #8f9ab1; margin-top: 3px; }
.lib-acts { display: flex; flex-wrap: wrap; gap: 5px; }
.lib-acts button { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); color: #cfd6e6;
  border-radius: 99px; padding: 4px 10px; font: 600 10.5px/1.3 Inter, sans-serif; cursor: pointer; }
.lib-acts button:hover { border-color: rgba(233, 196, 106, .5); color: #ffeec4; }
.lib-acts button.on { background: rgba(233, 196, 106, .18); border-color: rgba(233, 196, 106, .55); color: #ffeec4; }
.lib-acts button.danger:hover { border-color: rgba(255, 122, 122, .5); color: #ffb4b4; }
/* channel card: first tile in the shelf */
.ch-card { grid-column: 1 / -1; background: linear-gradient(165deg, rgba(233, 196, 106, .09), rgba(255, 255, 255, .02));
  border-color: rgba(233, 196, 106, .3); display: flex; flex-direction: column; gap: 10px; }
.ch-card-top { display: flex; align-items: center; gap: 11px; }
.ch-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 800 17px/1 Georgia, serif; color: #1d1606; background: linear-gradient(160deg, #ffe0a0, #d9ad55); }
.ch-card-id b { display: block; font: 700 14px/1.2 Inter, sans-serif; color: #fff6e2; }
.ch-card-id small { display: block; color: #9aa6bf; font: 400 10.5px/1.4 Inter, sans-serif; margin-top: 3px; }
.ch-card-note { margin: 0; color: #aab4c8; font: 400 11.5px/1.5 Inter, sans-serif; }
.ch-card .lib-acts { margin-top: auto; }
.ch-card .lib-acts a, .ch-card .lib-acts button { text-decoration: none; display: inline-flex; align-items: center;
  padding: 6px 12px; font: 700 11.5px/1 Inter, sans-serif; }
@media (max-width: 900px) { .ch-card { grid-column: 1 / -1; } }


/* ---------- share sheet ---------- */
.flow-share { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 8, 17, .74); }
.flow-share .fs-box { width: min(500px, 94vw); max-height: 90vh; overflow: auto; background: #0d1424;
  border: 1px solid rgba(233, 196, 106, .28); border-radius: 20px; padding: 18px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
.flow-share .fs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.flow-share .fs-head b { font: 700 15px/1.2 Inter, sans-serif; color: #fff6e2; }
.flow-share .fs-x { background: none; border: 0; color: #8f9ab1; font-size: 22px; cursor: pointer; line-height: 1; }
.flow-share .fs-label { margin: 14px 0 8px; font: 700 10.5px/1.2 Inter, sans-serif; letter-spacing: .05em;
  text-transform: uppercase; color: #8f9ab1; }
.flow-share .fs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.flow-share .fs-item { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px;
  padding: 12px 6px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.flow-share .fs-item:hover { transform: translateY(-1px); border-color: rgba(233, 196, 106, .5); background: rgba(233, 196, 106, .08); }
.flow-share .fs-item .fs-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); color: #e6ebf6; }
.flow-share .fs-item .fs-ic svg { width: 17px; height: 17px; }
.flow-share .fs-item b { font: 600 11.5px/1.1 Inter, sans-serif; color: #f0f3fa; }
.flow-share .fs-copy { margin-top: 16px; width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 9px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(233, 196, 106, .4);
  background: rgba(233, 196, 106, .12); color: #ffeec4; font: 700 13px/1 Inter, sans-serif; cursor: pointer; }
.flow-share .fs-copy svg { width: 17px; height: 17px; }
.flow-share .fs-copy:hover { background: rgba(233, 196, 106, .2); }
@media (max-width: 420px) { .flow-share .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- mobile: readable steps, no overlap, full-width library ---------- */
@media (max-width: 900px) {
  /* the steps stay connected: one scrolling rail with a line between them */
  .flow-stepbar { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; overflow-y: hidden;
    padding: 4px 2px 10px; border-bottom: 1px solid rgba(255, 255, 255, .09);
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .flow-stepbar::-webkit-scrollbar { display: none; }
  .flow-stepbar::before { display: none; }
  .flow-step { position: relative; flex: 0 0 70px; min-width: 0; flex-direction: column; align-items: center;
    gap: 4px; padding: 4px 0 10px; margin: 0; text-align: center; scroll-snap-align: center; }
  .flow-step:not(:last-child)::after { content: ''; position: absolute; top: 18px; left: calc(50% + 21px);
    width: 44px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .12); }
  .flow-step.on:not(:last-child)::after, .flow-step.done:not(:last-child)::after { background: rgba(233, 196, 106, .45); }
  .flow-step .fs-ic { display: grid !important; }
  .flow-step .fs-tx { display: block !important; font: 600 9.5px/1.15 Inter, sans-serif; text-align: center;
    max-width: 64px; white-space: normal; min-height: 22px; }
  .flow-step .fs-cnt { display: none !important; }
  .flow-step-hint { font-size: 11px; }
  /* the floating preview must not cover the flow */
  .bubble { width: 58px; height: 102px; right: 10px; bottom: 100px; opacity: .92; }
  .bubble > span { font-size: 8px; padding: 7px 0 3px; }
  .flow-library-wide { grid-column: 1 / -1; }
  .flow-library-list { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
  .lib-acts button { padding: 4px 8px; font-size: 10px; }
  /* the generation card: keep the verse strip on screen */
  #job.flow-gen { padding: 10px; }
  .flow-gen .fg-visual { padding: 10px; }
  .flow-gen .fg-film { width: 118px; }
  .flow-gen .fg-copy { padding: 10px 12px 12px; }
  .flow-gen .fg-title { font-size: 16px; }
  .flow-gen .fg-stages { margin-top: 10px; }
  .flow-gen .fg-verse { padding: 10px 12px 12px; }
  .fg-verse .fv-ar { font-size: 17px; }
  .fg-verse .fv-tr { font-size: 11.5px; }
  .flow-share .fs-grid { grid-template-columns: 1fr; }
}

/* ---------- when a tweak sheet is open the preview gives it room (v6.0 behaviour) ---------- */
body.qopen .pvname { display: none; }
body.qopen #qb .qsheet { border-color: rgba(233, 196, 106, .45); }

/* ---------- full preview (v6.0): preview + tweaks side by side ---------- */
.player { position: fixed; inset: 0; z-index: 90; background: #050813; display: flex; flex-direction: column; }
.player[hidden] { display: none; }
body.pl-open { overflow: hidden; }
body.pl-open #start { background: none; }
body.pl-open #start b, body.pl-open #start span { display: none; }
.pl-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pl-top b { font: 700 20px 'Cormorant Garamond', serif; color: var(--gold); }
.pl-top span { font: 500 12px Manrope; color: var(--mut); }
#plClose { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); color: var(--txt); font-size: 17px; }
#plClose:hover { background: rgba(233, 196, 106, .12); }
.pl-body { flex: 1; min-height: 0; display: flex; gap: 28px; padding: 16px 24px; max-width: 1080px; margin: 0 auto; width: 100%; }
.pl-stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.pl-side { width: 380px; flex: none; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; justify-content: center; }
.pl-side #plTrans { display: flex; justify-content: center; }
.pl-side .qsheet { max-height: none; margin-top: 10px; }
.plopen { width: 100%; max-width: 340px; justify-content: center; font-weight: 800; color: var(--gold); border-color: var(--gold); }
@media (max-width: 900px) {
  .player .pl-top span { display: none; }
  .pl-body { flex-direction: column; gap: 8px; padding: 8px 12px; }
  .pl-stage { flex: 0 0 50svh; }
  .pl-side { width: auto; flex: 1; justify-content: flex-start; gap: 8px; }
}

/* ---------- ready popup: the real output, in our own player ---------- */
.mbox.done { width: min(440px, 100%); padding: 20px 20px 18px; }
#job.done #jobMsg { display: none; }
.qr-done-stage { width: auto; margin: 2px auto 15px; display: flex; justify-content: center; }
.qr-done-stage .apl { width: auto; }
.qr-done-stage .apl-stage { width: auto; height: min(46vh, 420px, 163vw); max-height: none; aspect-ratio: 9/16;
  border-radius: 18px; background: #05070f; }
.qr-done-stage .apl-stage video, .qr-done-stage .apl-poster { object-fit: cover; }
.qr-done-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 2px 0 0; }
.qr-done-acts .btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; font-size: 13px;
  text-decoration: none; }
.qr-done-acts .btn.gold { background: linear-gradient(160deg, #ffe0a0, #d9ad55); border-color: transparent; color: #1d1606;
  box-shadow: 0 12px 30px -14px rgba(233, 196, 106, .95); font-weight: 800; }
.qr-done-acts .btn.gold:hover { filter: brightness(1.05); }
.qr-done-acts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.qr-share-arrow { transition: transform .22s ease, opacity .22s ease; }
.qr-done-acts .btn:hover .qr-share-arrow { animation: qrFly .7s ease; }
@keyframes qrFly { 0% { transform: translateY(0); opacity: 1 } 45% { transform: translateY(-5px); opacity: 0 } 55% { transform: translateY(6px); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } }
.qr-ch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 15px auto 0; padding: 10px 12px; border-radius: 14px; max-width: 360px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(233, 196, 106, .22); }
.qr-ch span { font: 600 10px/1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: #8f9ab1; }
.qr-ch b { font: 700 13px/1 Inter, sans-serif; color: #ffeec4; }
.qr-ch-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.qr-ch a, .qr-ch button { font: 700 11.5px/1 Inter, sans-serif; color: #cfd6e6; text-decoration: none;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-radius: 99px;
  padding: 6px 11px; cursor: pointer; }
.qr-ch a:hover, .qr-ch button:hover { border-color: rgba(233, 196, 106, .5); color: #ffeec4; }
.qr-done-note { color: var(--mut); font: 400 11px/1.45 Inter, sans-serif; margin: 12px 0 14px; }
