/* Creative Studio PRO. The whole look of the PRO layout (views/pro_wrapper.php) and its screens: nothing else is loaded.
   The rules of the system are in the module's DESIGN.md. Mobile first; the side menu appears from 900px. */

:root {
    --p-bg: #FFFFFF;
    --p-ink: #141414;
    --p-ink-2: #3D3D3A;
    --p-muted: #5C5C57;
    --p-line: #E4E4E0;
    --p-line-strong: #B9B9B3;
    --p-panel: #F1F1EE;
    --p-accent: #D9F24A;
    --p-danger: #B3261E;
    --p-danger-bg: #FBEAE8;
    --p-ok-bg: #EAF3DC;
    --p-radius: 10px;
    --p-radius-lg: 12px;
    --p-font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --p-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
    --p-ease: 140ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.pro {
    margin: 0;
    background: var(--p-bg);
    color: var(--p-ink);
    font: 400 1rem/1.45 var(--p-font);
    overflow-x: hidden;
}

.pro a { color: var(--p-ink); }
.pro a:hover { color: var(--p-ink-2); }
.pro:not(.pro-legacy) img { max-width: 100%; display: block; }
.p-side img, .p-top img { max-width: 100%; display: block; }
.pro:not(.pro-legacy) h1, .pro:not(.pro-legacy) h2, .pro:not(.pro-legacy) h3, .pro:not(.pro-legacy) p { margin: 0; }
.pro :focus-visible { outline: 3px solid var(--p-ink); outline-offset: 2px; border-radius: 4px; }
.pro [hidden] { display: none !important; }

.p-skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--p-ink); color: #fff !important; padding: 10px 14px; border-radius: 8px; }
.p-skip:focus { left: 8px; }

/* ---- layout */

.p-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.p-side { display: none; }
.p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 84px; }
.p-content { flex: 1; width: 100%; max-width: 1180px; padding: 20px 16px 32px; outline: 0; }

.p-brand { font: 700 1.25rem/1 var(--p-display); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.p-brand img { max-height: 32px; max-width: 170px; width: auto; object-fit: contain; }

.p-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--p-line); }
.p-top-end { display: flex; align-items: center; gap: 8px; }
.p-top-credits { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 600; text-decoration: none; padding: 0 12px; border: 1px solid var(--p-line-strong); border-radius: 8px; white-space: nowrap; }
.p-top-account { width: 44px; height: 44px; border-radius: 50%; background: var(--p-panel); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; }

.p-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; background: var(--p-bg); border-top: 1px solid var(--p-line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.p-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; text-decoration: none; font-size: .75rem; color: var(--p-muted); border-radius: 12px; transition: background var(--p-ease), color var(--p-ease); }
.p-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tabbar a[aria-current] { color: var(--p-ink); font-weight: 600; background: var(--p-panel); }
/* "create" is the round button in the middle, lifted above the bar */
.p-tabbar a.p-tab-create { justify-self: center; width: 58px; height: 58px; min-height: 0; margin-top: -26px; border-radius: 50%; background: var(--p-ink); color: #fff; border: 4px solid var(--p-bg); box-sizing: content-box; }
.p-tabbar a.p-tab-create:active { transform: scale(.96); }
.p-tabbar a.p-tab-create[aria-current] { background: var(--p-ink); color: var(--p-accent); }
.p-tabbar a.p-tab-create svg { width: 28px; height: 28px; stroke-width: 2.2; }

@media (min-width: 900px) {
    .p-app { flex-direction: row; }
    .p-side { display: flex; flex-direction: column; gap: 4px; flex: 0 0 240px; padding: 20px 16px; border-right: 1px solid var(--p-line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
    .p-side .p-brand { padding: 0 12px; margin-bottom: 16px; }
    .p-top, .p-tabbar { display: none; }
    .p-main { padding-bottom: 0; }
    .p-content { padding: 40px 48px 56px; }
}

.p-nav { display: flex; flex-direction: column; gap: 4px; }
.p-nav a { display: block; padding: 12px; border-radius: 8px; text-decoration: none; transition: background var(--p-ease); }
.p-nav a:hover { background: var(--p-panel); }
.p-nav a[aria-current] { background: var(--p-panel); font-weight: 600; }

.p-side-end { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.p-credits { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border: 1px solid var(--p-line); border-radius: var(--p-radius); }
.p-credits strong { font: 700 1.625rem/1.1 var(--p-display); }
.p-credits a { font-size: .875rem; font-weight: 600; }

.p-account summary { list-style: none; cursor: pointer; padding: 12px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-account summary::-webkit-details-marker { display: none; }
.p-account summary::after { content: '▾'; float: right; color: var(--p-muted); }
.p-account[open] summary::after { content: '▴'; }
.p-account summary:hover { background: var(--p-panel); }
.p-account div { display: flex; flex-direction: column; padding: 4px 0; }
.p-account div a { padding: 10px 12px; border-radius: 8px; text-decoration: none; font-size: .9375rem; }
.p-account div a:hover { background: var(--p-panel); }

/* ---- type */

.p-h1 { font: 700 clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem)/1.1 var(--p-display); letter-spacing: -.01em; text-wrap: balance; }
.p-h2 { font: 700 1.375rem/1.2 var(--p-display); }
.p-h3 { font: 600 1.125rem/1.3 var(--p-font); }
.p-lead { font-size: 1.125rem; color: var(--p-muted); max-width: 62ch; }
.p-muted { color: var(--p-muted); }
.p-small { font-size: .875rem; }
.p-back { font-size: .875rem; display: inline-flex; align-items: center; min-height: 44px; }

.p-stack { display: flex; flex-direction: column; gap: 28px; }
.p-stack-s { display: flex; flex-direction: column; gap: 12px; }
.p-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.p-row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.p-narrow { max-width: 760px; }
.p-row > a:not(.p-btn), .p-row-between > a:not(.p-btn) { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- buttons */

.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid var(--p-ink); border-radius: var(--p-radius); background: var(--p-bg); color: var(--p-ink); font: 600 1rem/1 var(--p-font); text-decoration: none; cursor: pointer; transition: background var(--p-ease), transform var(--p-ease), opacity var(--p-ease); }
.p-btn:hover { background: var(--p-panel); color: var(--p-ink); }
.p-btn:active { transform: translateY(1px); }
.p-btn-primary { background: var(--p-ink); color: #fff !important; }
.p-btn-primary:hover { background: var(--p-ink-2); }
.p-btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.0625rem; }
.p-btn-quiet { border-color: transparent; padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; }
.p-btn-danger { border-color: var(--p-danger); color: var(--p-danger); }
.p-btn-danger:hover { background: var(--p-danger-bg); color: var(--p-danger); }
.p-btn[disabled], .p-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.p-btn.is-busy { pointer-events: none; opacity: .7; }
.p-btn.is-busy::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: p-spin .7s linear infinite; }

@keyframes p-spin { to { transform: rotate(360deg); } }

/* ---- fields */

.p-field { display: flex; flex-direction: column; gap: 6px; }
.p-label { font-size: .875rem; font-weight: 600; }
.p-input, .p-select, .p-textarea { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--p-line-strong); border-radius: 8px; background: var(--p-bg); color: var(--p-ink); font: 400 1rem/1.4 var(--p-font); transition: border-color var(--p-ease); }
.p-input, .p-select, .p-textarea { min-width: 0; max-width: 100%; }
.p-textarea { padding: 12px; min-height: 96px; resize: vertical; }
.p-input:hover, .p-select:hover, .p-textarea:hover { border-color: var(--p-ink); }
.p-input:focus-visible, .p-select:focus-visible, .p-textarea:focus-visible { outline: 3px solid var(--p-ink); outline-offset: 1px; }
.p-input[aria-invalid="true"], .p-textarea[aria-invalid="true"] { border-color: var(--p-danger); }
.p-help { font-size: .875rem; color: var(--p-muted); }
.p-error { font-size: .875rem; color: var(--p-danger); font-weight: 500; }
.p-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
.p-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--p-ink); flex: none; }
.p-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

/* a pair of choices shown as one switch (photo / describe) */
.p-switch { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--p-panel); border-radius: var(--p-radius-lg); }
.p-switch label { flex: 1 1 200px; position: relative; }
.p-switch input { position: absolute; opacity: 0; inset: 0; }
.p-switch span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 12px; border-radius: 8px; font-weight: 600; cursor: pointer; text-align: center; transition: background var(--p-ease); }
.p-switch input:checked + span { background: var(--p-bg); box-shadow: 0 0 0 1px var(--p-line-strong); }
.p-switch input:focus-visible + span { outline: 3px solid var(--p-ink); outline-offset: 2px; }

.p-drop { position: relative; border: 2px dashed var(--p-line-strong); border-radius: var(--p-radius-lg); padding: 32px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: border-color var(--p-ease), background var(--p-ease); }
.p-drop.is-over { border-color: var(--p-ink); background: var(--p-panel); }
.p-drop img { max-height: 220px; border-radius: 8px; }
.p-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---- cards */

.p-card { border: 1px solid var(--p-line); border-radius: var(--p-radius-lg); }
.p-panel { background: var(--p-panel); border-radius: var(--p-radius-lg); padding: 20px 22px; }

.p-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.p-action { display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 132px; border: 1px solid #D9D9D4; border-radius: var(--p-radius-lg); text-decoration: none; transition: border-color var(--p-ease), background var(--p-ease), transform var(--p-ease); }
.p-action:hover { border-color: var(--p-ink); }
.p-action:active { transform: translateY(1px); }
.p-action strong { font: 700 1.375rem/1.15 var(--p-display); }
.p-action span { color: var(--p-muted); }
.p-action-primary { background: var(--p-ink); border-color: var(--p-ink); color: #fff !important; }
.p-action-primary:hover { background: var(--p-ink-2); color: #fff; }
.p-action-primary span { color: #D8D8D3; }
.p-action-primary em { margin-top: auto; font-style: normal; font-size: .875rem; font-weight: 600; color: var(--p-accent); }

.p-tag { display: inline-flex; align-items: center; font-size: .8125rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--p-accent); color: var(--p-ink); }
.p-tag-plain { background: var(--p-panel); }

.p-avatar { width: 84px; height: 84px; border-radius: 50%; background: #D6D2C8; object-fit: cover; flex: none; }
.p-avatar-s { width: 44px; height: 44px; }

.p-list { border: 1px solid var(--p-line); border-radius: var(--p-radius-lg); }
.p-list > * { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; }
.p-list > * + * { border-top: 1px solid var(--p-line); }
.p-list > a:hover { background: var(--p-panel); }
.p-list-main { flex: 1 1 200px; min-width: 0; }
.p-list-main strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.p-list-button { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.p-list-button:hover { background: var(--p-panel); }
.p-list > .p-list-button + .p-list-button { border-top: 1px solid var(--p-line); }
.p-btn-link { border: 0; background: none; padding: 0; font: inherit; color: var(--p-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.p-btn-link:hover { color: var(--p-ink-2); }

/* the people: influencers, portrait options, reference photos */
.p-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.p-person { position: relative; display: flex; flex-direction: column; border: 3px solid var(--p-line); border-radius: var(--p-radius-lg); background: var(--p-bg); text-decoration: none; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer; overflow: hidden; transition: border-color var(--p-ease); }
.p-person:hover { border-color: var(--p-line-strong); }
.p-person.is-on, .p-person:has(input:checked) { border-color: var(--p-ink); }
.p-person input { position: absolute; opacity: 0; }
.p-person:has(input:focus-visible) { outline: 3px solid var(--p-ink); outline-offset: 2px; }
.p-photo { aspect-ratio: 3 / 4; background: #D6D2C8; width: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #4A4A45; font-size: .8125rem; text-align: center; padding: 8px; }
img.p-photo { padding: 0; }
.p-photo.is-busy { background: var(--p-panel); flex-direction: column; gap: 10px; }
.p-photo.is-busy::before { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--p-ink); border-right-color: transparent; animation: p-spin .8s linear infinite; }
.p-photo.is-failed { background: var(--p-danger-bg); color: var(--p-danger); }
.p-person-foot { display: block; padding: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-badge { position: absolute; top: 8px; right: 8px; z-index: 1; font-size: .75rem; font-weight: 700; line-height: 1; padding: 6px 8px; border-radius: 6px; background: var(--p-accent); color: var(--p-ink); }
.p-person-new { border-style: dashed; align-items: center; justify-content: center; min-height: 180px; font-weight: 600; gap: 6px; padding: 16px; text-align: center; }

.p-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.p-photos .p-photo { border-radius: 8px; }
.p-photos a { display: block; border-radius: 8px; }

/* one influencer: the name edited in place, a main photo with the others beside it */
.p-title-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.p-title-input { flex: 0 1 auto; min-width: 0; width: min(100%, 22ch); padding: 4px 8px; margin-left: -8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--p-ink); font: 700 clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem)/1.15 var(--p-display); letter-spacing: -.01em; field-sizing: content; transition: border-color var(--p-ease); }
.p-title-input:hover { border-color: var(--p-line-strong); }
.p-title-input:focus-visible { border-color: var(--p-ink); outline: 3px solid var(--p-ink); outline-offset: 1px; }

.p-gallery { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.p-gallery-main { flex: 0 1 300px; min-width: 200px; border-radius: var(--p-radius-lg); overflow: hidden; background: #D6D2C8; }
.p-gallery-main img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.p-gallery-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.p-gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-width: 520px; }
.p-gallery-thumbs button { padding: 0; border: 3px solid transparent; border-radius: 10px; background: none; cursor: pointer; overflow: hidden; transition: border-color var(--p-ease); }
.p-gallery-thumbs button:hover { border-color: var(--p-line-strong); }
.p-gallery-thumbs button.is-on { border-color: var(--p-ink); }
.p-gallery-thumbs img, .p-gallery-thumbs .p-photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.p-gallery-thumbs .p-photo.is-busy::before { width: 18px; height: 18px; border-width: 2px; }
button.p-action { text-align: left; font: inherit; color: inherit; background: var(--p-bg); cursor: pointer; }
button.p-action.p-action-primary { background: var(--p-ink); }

/* ---- feedback */

.p-empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--p-line-strong); border-radius: var(--p-radius-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; }

.p-bar { height: 8px; border-radius: 4px; background: #E9E9E5; overflow: hidden; flex: 0 1 200px; }
.p-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--p-ink); animation: p-slide 1.4s ease-in-out infinite; }
@keyframes p-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.pro .alert { position: relative; padding: 14px 48px 14px 16px; border-radius: var(--p-radius); margin: 0 0 20px; background: var(--p-panel); border: 1px solid var(--p-line); }
.pro .alert i { display: none; }
.pro .alert-danger { background: var(--p-danger-bg); border-color: #E8B4AF; color: #7A1A14; }
.pro .alert-success { background: var(--p-ok-bg); border-color: #C5DBA0; }
.pro .alert .close { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.25rem; color: inherit; }
.pro .alert .close::before { content: '×'; }

.p-dialog { border: 0; border-radius: var(--p-radius-lg); padding: 24px; width: min(440px, calc(100vw - 32px)); color: var(--p-ink); }
.p-dialog-media { width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 14px; }
.p-dialog-media:not([open]) { display: none; }
.p-dialog-media img, .p-dialog-media video { width: 100%; max-height: 68vh; object-fit: contain; border-radius: 8px; background: #1E1E1C; }
.p-example { align-self: flex-start; min-height: 44px; margin-top: 2px; font-size: .875rem; font-weight: 600; }
.p-voice { display: flex; gap: 8px; }
.p-voice .p-select { flex: 1; }
.p-voice .p-btn { flex: none; padding: 0 16px; }
.p-dialog::backdrop { background: rgba(20, 20, 20, .45); }
.p-dialog[open] { animation: p-pop var(--p-ease); }
@keyframes p-pop { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
    .pro *, .pro *::before, .pro *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .p-bar i { width: 100%; transform: none; opacity: .5; }
}

/* ---- creating a video */

.p-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.p-choice { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 3px solid var(--p-line); border-radius: var(--p-radius-lg); cursor: pointer; transition: border-color var(--p-ease); }
.p-choice:hover { border-color: var(--p-line-strong); }
.p-choice:has(input:checked) { border-color: var(--p-ink); }
.p-choice:has(input:focus-visible) { outline: 3px solid var(--p-ink); outline-offset: 2px; }
.p-choice input { position: absolute; opacity: 0; }
.p-choice strong { font-weight: 600; font-size: 1.0625rem; }
.p-choice span { color: var(--p-muted); font-size: .9375rem; }
.p-choice em { font-style: normal; font-size: .8125rem; font-weight: 600; margin-top: auto; padding-top: 6px; }

.p-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.p-seg label { position: relative; }
.p-seg input { position: absolute; opacity: 0; inset: 0; }
.p-seg span { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 16px; border: 1px solid var(--p-line-strong); border-radius: 8px; font-weight: 500; cursor: pointer; }
.p-seg input:checked + span { border-color: var(--p-ink); background: var(--p-ink); color: #fff; }
.p-seg input:focus-visible + span { outline: 3px solid var(--p-ink); outline-offset: 2px; }

.p-more > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.p-more > summary::-webkit-details-marker { display: none; }
.p-more > summary::after { content: '+'; text-decoration: none; }
.p-more[open] > summary::after { content: '−'; }
.p-more > div { padding-top: 12px; }

.p-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.p-summary strong { display: block; font-size: 1.125rem; font-weight: 600; }

.p-scene { display: flex; gap: 16px; padding: 22px 0; border-top: 1px solid var(--p-line); }
.p-scene-num { flex: 0 0 40px; font: 700 2.25rem/1 var(--p-display); }
.p-scene-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.p-scene-text { font-size: 1.0625rem; }
.p-cut { margin-left: 56px; padding: 10px 14px; border-radius: 8px; background: var(--p-panel); font-size: .875rem; color: var(--p-ink-2); }
.p-mono { font: 400 .875rem/1.5 ui-monospace, 'SF Mono', Consolas, monospace; }

.p-result { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.p-player { flex: 0 1 360px; min-width: 240px; border-radius: 14px; background: #1E1E1C; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #D8D8D3; text-align: center; padding: 0; }
.p-player video { width: 100%; height: 100%; display: block; }
.p-player-wait { flex-direction: column; gap: 14px; padding: 24px; }
.p-player-wait::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; border-right-color: transparent; animation: p-spin .8s linear infinite; }
@media (max-width: 899px) { .p-player-wait { aspect-ratio: auto !important; min-height: 180px; flex: 1 1 100%; } }
.p-player-wait.is-failed::before { display: none; }
.p-result-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.p-progress { height: 8px; border-radius: 4px; background: #E9E9E5; overflow: hidden; }
.p-progress i { display: block; height: 100%; border-radius: 4px; background: var(--p-ink); transition: width 400ms ease; }

.p-takes > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--p-line); }
.p-takes > div:last-child { border-bottom: 1px solid var(--p-line); }

.p-wait { display: flex; flex-direction: column; gap: 16px; }
.p-wait-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.p-wait-head strong { font: 700 1.375rem/1.2 var(--p-display); }
.p-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.p-steps li { display: flex; align-items: center; gap: 10px; color: var(--p-line-strong); transition: color 300ms ease; }
.p-steps li::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.p-steps li.is-done { color: var(--p-muted); }
.p-steps li.is-done::before { background: currentColor; }
.p-steps li.is-now { color: var(--p-ink); font-weight: 600; }
.p-steps li.is-now::before { border-color: var(--p-ink); border-right-color: transparent; animation: p-spin .8s linear infinite; }

/* ---- products */

.p-upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.p-upload-list img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--p-line); }
.p-square { aspect-ratio: 1 / 1; }
.p-tips { margin: 0; padding-left: 18px; color: var(--p-muted); font-size: .9375rem; display: flex; flex-direction: column; gap: 4px; }

/* the product a page is about, once chosen: one line and a way to change it */
.p-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--p-line); border-radius: var(--p-radius-lg); max-width: 520px; }
.p-picked img, .p-picked .p-photo { width: 56px; height: 56px; aspect-ratio: 1; border-radius: 8px; object-fit: cover; flex: none; padding: 0; font-size: .6875rem; }
.p-picked strong { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- photos */

.p-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.p-shot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-shot .p-photo { border-radius: var(--p-radius-lg); width: 100%; }
.p-shot a { display: block; border-radius: var(--p-radius-lg); }
.p-shot .p-row-between a { display: inline-flex; }
.p-tile-media.p-tile-photo { aspect-ratio: 4 / 5; background: #D6D2C8; color: #4A4A45; }

/* ---- contents */

.p-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.p-tile { position: relative; display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--p-line); border-radius: var(--p-radius-lg); overflow: hidden; transition: border-color var(--p-ease); }
.p-tile:hover { border-color: var(--p-ink); }
.p-tile-media { aspect-ratio: 9 / 16; width: 100%; object-fit: cover; background: #1E1E1C; color: #D8D8D3; display: flex; align-items: center; justify-content: center; font-size: .8125rem; text-align: center; padding: 10px; }
img.p-tile-media { padding: 0; }
.p-tile-foot { padding: 10px 12px; font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tile .p-badge { background: #fff; }
.p-tile .p-badge.is-review { background: var(--p-accent); }
.p-tile .p-badge.is-failed { background: var(--p-danger-bg); color: var(--p-danger); }

.p-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.p-filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--p-line-strong); border-radius: 22px; text-decoration: none; font-weight: 500; }
.p-filters a[aria-current] { background: var(--p-ink); border-color: var(--p-ink); color: #fff; }

/* ---- pages written for the dashboard layout, shown inside the PRO layout (.pro-legacy): the account, the plan, the payments and the
   older pages of the module. Their stylesheets are loaded before this one; here they are brought to the PRO look. */

body.pro-legacy {
    --primary-50: #F1F1EE; --primary-100: #E9E9E5; --primary-200: #D9D9D4; --primary-300: #B9B9B3; --primary-400: #5C5C57;
    --primary-500: #3D3D3A; --primary-600: #141414; --primary-700: #141414; --primary-800: #141414; --primary-900: #141414;
    --app-font: 'Instrument Sans', system-ui, sans-serif; --app-radius: .625rem;
    --st-grad: #141414; --st-radius: 12px;
    background: var(--p-bg); color: var(--p-ink); font-family: var(--p-font);
}
.pro-legacy::after, .pro-legacy.overlay-active::after { display: none; }
.pro-legacy .p-content h1, .pro-legacy .p-content h2, .pro-legacy .p-content .h1, .pro-legacy .p-content .h2, .pro-legacy .p-content .h3, .pro-legacy .st-title { font-family: var(--p-display); font-weight: 700; letter-spacing: -.01em; color: var(--p-ink); }
.pro-legacy .p-content h1, .pro-legacy .p-content .h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem); }
.pro-legacy .card h1, .pro-legacy .card .h1, .pro-legacy .card h2, .pro-legacy .card .h2 { font-size: 1.25rem; }
.pro-legacy .custom-breadcrumbs, .pro-legacy .st-crumb { display: none; }

.pro-legacy .card, .pro-legacy .st-card { border: 1px solid var(--p-line); border-radius: var(--p-radius-lg); box-shadow: none; background: var(--p-bg); }
.pro-legacy .card-header, .pro-legacy .card-footer { background: none; border-color: var(--p-line); }
.pro-legacy .account-cover { background: var(--p-panel); background-image: none; }

.pro-legacy .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--p-radius); font-weight: 600; box-shadow: none; }
.pro-legacy .btn-sm { min-height: 36px; border-radius: 8px; }
.pro-legacy .btn-lg { min-height: 52px; }
.pro-legacy .btn-primary, .pro-legacy .btn-primary-600, .pro-legacy .st-btn-grad { background: var(--p-ink) !important; background-image: none !important; border-color: var(--p-ink) !important; color: #fff !important; }
.pro-legacy .btn-primary:hover, .pro-legacy .btn-primary-600:hover, .pro-legacy .st-btn-grad:hover { background: var(--p-ink-2) !important; border-color: var(--p-ink-2) !important; }
.pro-legacy .btn-outline-primary, .pro-legacy .btn-outline-primary-600, .pro-legacy .btn-outline-secondary, .pro-legacy .btn-light { background: var(--p-bg); border: 1px solid var(--p-ink); color: var(--p-ink); }
.pro-legacy .btn-outline-primary:hover, .pro-legacy .btn-outline-primary-600:hover, .pro-legacy .btn-outline-secondary:hover, .pro-legacy .btn-light:hover { background: var(--p-panel); color: var(--p-ink); }
.pro-legacy .btn-danger, .pro-legacy .btn-outline-danger { background: var(--p-bg); border: 1px solid var(--p-danger); color: var(--p-danger); }
.pro-legacy .btn-danger:hover, .pro-legacy .btn-outline-danger:hover { background: var(--p-danger-bg); color: var(--p-danger); }
.pro-legacy .btn:focus-visible, .pro-legacy .form-control:focus, .pro-legacy .form-select:focus, .pro-legacy .form-check-input:focus { outline: 3px solid var(--p-ink); outline-offset: 2px; box-shadow: none; border-color: var(--p-ink); }

.pro-legacy .form-control, .pro-legacy .form-select { min-height: 48px; border: 1px solid var(--p-line-strong); border-radius: 8px; background-color: var(--p-bg); color: var(--p-ink); font-size: 1rem; }
.pro-legacy textarea.form-control { min-height: 96px; }
.pro-legacy .form-control-sm, .pro-legacy .form-select-sm { min-height: 40px; }
.pro-legacy label, .pro-legacy .form-label { font-weight: 600; font-size: .875rem; color: var(--p-ink); }
.pro-legacy .form-check-input:checked { background-color: var(--p-ink); border-color: var(--p-ink); }
.pro-legacy .form-text, .pro-legacy .text-muted, .pro-legacy .text-secondary-light { color: var(--p-muted) !important; }
.pro-legacy .invalid-feedback { color: var(--p-danger); font-weight: 500; }
.pro-legacy .form-control.is-invalid { border-color: var(--p-danger); }

.pro-legacy .p-content a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge) { color: var(--p-ink); }
.pro-legacy .nav-pills .nav-link, .pro-legacy .list-group-item { border-radius: 8px; color: var(--p-ink); border-color: var(--p-line); }
.pro-legacy .nav-pills .nav-link.active, .pro-legacy .list-group-item.active { background: var(--p-panel); color: var(--p-ink); font-weight: 600; border-color: var(--p-line); }
.pro-legacy .badge.bg-primary-50, .pro-legacy .badge.bg-primary-100 { background: var(--p-panel) !important; color: var(--p-ink) !important; }
.pro-legacy .text-primary, .pro-legacy .text-primary-600, .pro-legacy .text-primary-900 { color: var(--p-ink) !important; }
.pro-legacy .table { --bs-table-bg: transparent; border-color: var(--p-line); }
.pro-legacy .table thead th { font-size: .8125rem; color: var(--p-muted); font-weight: 600; border-bottom-color: var(--p-line); }
.pro-legacy .modal-content { border: 0; border-radius: var(--p-radius-lg); }
.pro-legacy .dropdown-menu { border: 1px solid var(--p-line); border-radius: var(--p-radius); box-shadow: 0 8px 24px rgba(20, 20, 20, .08); }
.pro-legacy .alert { border-radius: var(--p-radius); }
.pro-legacy .alert i { display: inline-block; }
.pro-legacy .alert .close::before { content: none; }
.pro-legacy .progress-bar { background-color: var(--p-ink); }

/* ---- captions: the choices next to a preview with the shape of the video. The preview is a container, so every length of the
   caption is a part of its width (cqw), like in the real video. */
.p-cap { display: flex; flex-direction: column; gap: 6px; }
.p-cap-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 720px) { .p-cap-grid { grid-template-columns: minmax(0, 1fr) auto; } }
.p-cap-preview { margin: 0; display: flex; flex-direction: column; gap: 8px; width: 220px; max-width: 100%; }
.p-cap-preview:has(.is-wide) { width: 320px; }
.p-cap-screen { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #8A8A84 center / cover no-repeat; container-type: inline-size; }
.p-cap-screen.is-wide { aspect-ratio: 16 / 9; }
.p-cap-text { position: absolute; left: 8cqw; right: 8cqw; text-align: center; color: #fff; }
.p-cap-text > span { box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.p-cap-swatch { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 24px; margin-right: 8px; border-radius: 4px; font: 700 .8125rem/1 var(--p-font); font-style: normal; }
