/*
 * eBook2video AI - application styles
 *
 * 1. Tokens
 * 2. Base
 * 3. Layout (sidebar, mobile bar, page)
 * 4. Components (brand, card, buttons, forms, alerts)
 * 5. Auth screens
 * 6. Dashboard
 * 7. Tables, badges, admin
 * 8. Integrations
 * 9. Academies (wizard steps, eBook upload, chapter review, dashboard list)
 * 10. Course blueprint and lesson editor
 * 11. Video style and render page
 * 12. Publishing (course page settings, students, sales)
 * 13. eBook Vault, members area settings, buyer traffic
 * 14. Responsive
 */

/* 1. Tokens ------------------------------------------------------------ */
:root {
    --c-bg: #f8f6f3;
    --c-surface: #ffffff;
    --c-border: #e9e4dd;
    --c-text: #201a16;
    --c-muted: #766c63;
    --c-primary: #ea580c;
    --c-primary-hover: #c2410c;
    --c-primary-soft: #fff1e6;
    --c-primary-ink: #9a3412;
    --c-danger: #b91c1c;
    --c-danger-soft: #fee2e2;
    --c-success: #166534;
    --c-success-soft: #dcfce7;
    --radius: 12px;
    --sidebar-w: 264px;
    --shadow: 0 1px 2px rgba(32, 26, 22, .04), 0 2px 8px rgba(32, 26, 22, .05);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Base -------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2 {
    margin: 0 0 .25rem;
    line-height: 1.25;
}

h1 {
    font-size: 1.6rem;
}

h2 {
    font-size: 1.2rem;
}

.muted {
    color: var(--c-muted);
    margin: 0 0 1rem;
}

/* 3. Layout ------------------------------------------------------------ */
.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    z-index: 100;
    padding: .5rem .9rem;
    border-radius: 8px;
    background: var(--c-text);
    color: #fff;
}

.skip-link:focus {
    top: .75rem;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

/* Sidebar: fixed on desktop, an off-canvas drawer below 992px. */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: var(--sidebar-w);
    padding: 1.25rem 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--c-border);
    background: var(--c-surface);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .25rem .5rem .5rem;
}

.sidebar-head .brand-logo {
    height: 34px;
}

.sidebar-close {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    flex: 1;
}

.sidebar-label {
    margin: 1rem .8rem .35rem;
    color: var(--c-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-label:first-child {
    margin-top: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem .8rem;
    border-radius: 10px;
    color: #4b423b;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-link:hover {
    background: var(--c-bg);
    color: var(--c-text);
    text-decoration: none;
}

.nav-link.is-active {
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-weight: 600;
}

.nav-icon {
    flex: none;
    color: #9a8f86;
}

.nav-link:hover .nav-icon {
    color: var(--c-text);
}

.nav-link.is-active .nav-icon {
    color: var(--c-primary);
}

.sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--c-border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .65rem;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-bg);
}

.user-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
    font-weight: 700;
}

.user-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--c-text);
    font-size: .85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-logout {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--c-muted);
}

.user-logout:hover {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(32, 26, 22, .45);
}

.sidebar-backdrop[hidden] {
    display: none;
}

.app-main {
    min-width: 0;
    margin-left: var(--sidebar-w);
}

.mobile-bar {
    display: none;
}

.page {
    max-width: 1680px;
    margin: 0 auto;
    padding: 2rem clamp(1.25rem, 2.2vw, 2.5rem) 3.5rem;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-head h1 {
    font-size: 1.75rem;
    letter-spacing: -.01em;
}

.page-head .muted {
    margin: .25rem 0 0;
}

/* 4. Components -------------------------------------------------------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--c-text);
    font-size: 1.05rem;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 34px;
    width: auto;
}

.brand-lg .brand-logo {
    height: 48px;
}

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    transition: background .15s, box-shadow .15s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--c-primary-hover);
    box-shadow: 0 4px 12px rgba(194, 65, 12, .28);
}

.btn-ghost {
    background: transparent;
    border-color: var(--c-border);
    color: var(--c-text);
}

.btn-ghost:hover {
    background: var(--c-bg);
}

.btn-sm {
    padding: .35rem .75rem;
    font-size: .875rem;
}

.btn-block {
    width: 100%;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.field-label {
    font-size: .875rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: .65rem .8rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.check {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
}

.check input {
    flex: none;
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
}

.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .925rem;
}

.alert-danger {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.alert-success {
    background: var(--c-success-soft);
    color: var(--c-success);
}

.alert-info {
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
}

/* 5. Auth screens ------------------------------------------------------ */
.auth-title {
    font-size: 1.4rem;
}

.auth-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .9rem;
    color: var(--c-muted);
}

.auth-links p {
    margin: .35rem 0;
}

/* 6. Dashboard --------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.75rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 880px;
    margin: 2rem auto 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    text-align: left;
}

.steps li {
    counter-increment: step;
    padding: 1rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-bg);
}

.steps li::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-bottom: .5rem;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-weight: 700;
    font-size: .85rem;
}

.steps strong,
.steps span {
    display: block;
}

.steps span {
    color: var(--c-muted);
    font-size: .875rem;
}

.plan-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.plan-label {
    display: block;
    color: var(--c-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.plan-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.plain-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

/* 7. Tables, badges, admin --------------------------------------------- */
.card-flush {
    padding: 0;
    overflow: hidden;
}

.card-narrow {
    max-width: 520px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    background: var(--c-bg);
    color: var(--c-muted);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table .is-revoked td {
    opacity: .5;
}

.card .table td {
    padding-left: 0;
}

.card-flush .table td {
    padding-left: 1rem;
}

.cell-actions,
.cell-right {
    text-align: right;
}

.table-empty {
    padding: 1.5rem;
    margin: 0;
}

/* Admin: Launchpad */
.launchpad-save {
    padding: 1rem;
    border-top: 1px solid var(--c-border);
}

.launchpad-payload {
    max-width: 640px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    margin: .1rem .15rem .1rem 0;
    border-radius: 999px;
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-size: .78rem;
    font-weight: 600;
}

.muted-inline {
    color: var(--c-muted);
    font-size: .85rem;
}

.search-bar,
.inline-form {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}

.search-bar {
    max-width: 480px;
}

.inline-form {
    margin-top: 1rem;
    margin-bottom: 0;
}

.breadcrumb {
    margin: 0 0 1rem;
    font-size: .9rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.section-gap {
    margin-top: 1.75rem;
}

.flag-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flag-list li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .45rem 0;
    border-bottom: 1px solid var(--c-border);
}

.flag-list li:last-child {
    border-bottom: 0;
}

.flag-list code {
    display: block;
    color: var(--c-muted);
    font-size: .75rem;
}

.flag-list .is-off {
    opacity: .45;
}

.flag-dot {
    flex: none;
    width: 10px;
    height: 10px;
    margin-top: .4rem;
    border-radius: 50%;
    background: var(--c-border);
}

.is-on .flag-dot {
    background: var(--c-primary);
}

.pagination {
    display: flex;
    gap: .35rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.pagination a {
    display: block;
    padding: .35rem .7rem;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-surface);
}

.pagination .active a {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

/* 8. Integrations ------------------------------------------------------ */
.page-hero {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 2rem;
    padding: 1.6rem 2rem;
    overflow: hidden;
    border: 1px solid #fde1c8;
    border-radius: 20px;
    background:
        radial-gradient(26rem 14rem at 92% 120%, rgba(251, 146, 60, .28), transparent 65%),
        linear-gradient(120deg, #fff4ea, #ffe6d0);
}

.page-hero-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 1px solid #fde1c8;
    border-radius: 20px;
    background: rgba(255, 255, 255, .7);
    color: var(--c-primary);
    box-shadow: 0 6px 18px rgba(234, 88, 12, .15);
}

.page-hero-text {
    flex: 1 1 22rem;
    min-width: 0;
}

.page-hero > .int-pill {
    margin-left: auto;
}

.page-hero-text h1 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -.02em;
}

.page-hero-text p {
    margin: .2rem 0 0;
    color: #5b4a3f;
    font-size: 1.1rem;
}

.page-hero-text .page-hero-note {
    max-width: 46rem;
    color: var(--c-muted);
    font-size: .875rem;
}

.int-pill {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
}

.int-pill-ok {
    border: 1px solid #bbf0cd;
    background: #e3f9ea;
    color: var(--c-success);
}

.int-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 1rem;
}

.int-section-head h2 {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    font-size: 1.3rem;
}

.int-section-head h2::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--c-primary);
}

.int-count {
    flex: none;
    padding: .35rem .9rem;
    border-radius: 999px;
    background: #efebe6;
    color: #4b423b;
    font-size: .85rem;
    font-weight: 600;
}

.int-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.5rem;
}

.int-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    align-content: start;
    padding: 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.int-card > .int-error,
.int-card > .integration-note,
.int-card > details,
.int-card > .int-manage {
    grid-column: 1 / -1;
}

.int-identity {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
}

.int-tile {
    display: grid;
    flex: none;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.int-tile-openai {
    background: #d8f4ec;
    color: #0f172a;
}

.int-tile-pexels {
    background: #05a081;
    color: #fff;
}

.int-tile-pixabay {
    background: #48a31d;
    color: #fff;
}

.int-tile-stripe {
    background: #635bff;
    color: #fff;
}

.int-tile-paypal {
    background: #0070e0;
    color: #fff;
}

.int-tile-paystack {
    background: #0ba4db;
    color: #fff;
}

.int-tile-flutterwave {
    background: #f5a623;
    color: #fff;
}

.int-identity-text {
    min-width: 0;
}

.int-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .65rem;
}

.int-title-row h3 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -.01em;
}

.int-desc {
    margin: .3rem 0 0;
    color: var(--c-muted);
}

.int-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .15rem .65rem;
    border-radius: 999px;
    background: #efebe6;
    color: #5b4a3f;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

.int-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.int-status-connected {
    background: var(--c-success-soft);
    color: #15803d;
}

.int-status-untested {
    background: #fef3c7;
    color: #92400e;
}

.int-status-failed {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.int-required {
    padding: .15rem .6rem;
    border-radius: 999px;
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.int-key {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    background: #fcfbf9;
}

.int-key-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 600;
}

.int-key-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .5rem .45rem .9rem;
    border-radius: 12px;
    background: #f1eee9;
}

.int-key-value code {
    overflow: hidden;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: .95rem;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.int-tested {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .4rem;
    padding: .3rem .75rem;
    border-radius: 10px;
    background: #e3f9ea;
    color: #15803d;
    font-size: .875rem;
    font-weight: 600;
}

.int-key-meta {
    color: var(--c-muted);
    font-size: .85rem;
}

.int-side {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.int-side form {
    flex: 1 1 8rem;
}

.int-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    padding: .65rem 1.1rem;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface);
    box-shadow: 0 1px 2px rgba(32, 26, 22, .06);
    color: var(--c-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.int-action:hover {
    background: var(--c-bg);
}

.int-action-danger {
    color: var(--c-danger);
}

.int-action-danger:hover {
    border-color: #f5c2c2;
    background: var(--c-danger-soft);
}

.int-error {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 0;
    padding: .75rem 1rem;
    border-radius: 12px;
    background: var(--c-danger-soft);
    color: var(--c-danger);
    font-size: .9rem;
}

.int-error svg {
    flex: none;
    margin-top: .1rem;
}

.int-manage-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .8rem 1.25rem;
    border-radius: 12px;
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    color: #fff;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
    transition: background .15s;
}

.int-manage-toggle::-webkit-details-marker {
    display: none;
}

.int-manage-toggle:hover {
    background: var(--c-primary-hover);
}

.int-manage-toggle .int-chevron {
    display: inline-flex;
    transition: transform .2s;
}

.int-manage[open] .int-chevron {
    transform: rotate(180deg);
}

.int-manage[open] .int-manage-toggle {
    background: var(--c-primary-soft);
    box-shadow: none;
    color: var(--c-primary-ink);
}

.int-manage[open] .int-manage-toggle:hover {
    background: #ffe4cc;
}

details.int-manage > .int-form {
    margin-top: 1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--c-border);
}

.int-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
}

.integration-docs {
    font-size: .9rem;
    font-weight: 600;
}

@media (min-width: 1100px) {
    .int-grid.is-single .int-card {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 11rem;
        align-items: center;
        column-gap: 2rem;
    }

    .int-grid.is-single .int-key {
        padding: 0 0 0 2rem;
        border: 0;
        border-left: 1px solid var(--c-border);
        border-radius: 0;
        background: transparent;
    }

    .int-grid.is-single .int-side {
        flex-direction: column;
        padding-left: 2rem;
        border-left: 1px solid var(--c-border);
    }

    .int-grid.is-single .int-side form {
        flex: none;
    }

    .int-grid.is-single .int-manage-toggle {
        display: inline-flex;
    }
}

@media (max-width: 700px) {
    .page-hero {
        padding: 1.25rem;
    }

    .page-hero-icon {
        width: 60px;
        height: 60px;
    }

    .page-hero-text {
        flex-basis: 100%;
    }

    .page-hero > .int-pill {
        margin-left: 0;
    }

    .page-hero-text h1 {
        font-size: 1.6rem;
    }

    .int-section-head h2 {
        font-size: 1.1rem;
    }

    .int-tile {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
}

.status {
    margin-left: auto;
    padding: .15rem .6rem;
    border-radius: 999px;
    background: var(--c-bg);
    color: var(--c-muted);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-connected {
    background: var(--c-success-soft);
    color: var(--c-success);
}

.status-failed {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.badge-neutral {
    background: var(--c-bg);
    color: var(--c-muted);
}

.badge-danger {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.btn-danger-text {
    color: var(--c-danger);
}

.setup-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid #fcd9b6;
    border-radius: 16px;
    background: var(--c-primary-soft);
}

.setup-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    color: var(--c-primary);
    box-shadow: 0 2px 8px rgba(234, 88, 12, .15);
}

.setup-text {
    flex: 1;
    min-width: 0;
}

.setup-text h2 {
    margin: 0;
    font-size: 1.05rem;
}

.setup-text p {
    margin: .15rem 0 0;
    color: #5b4a3f;
    font-size: .9rem;
}

/* Dashboard: usage strip and academy cards */
.btn-lg {
    padding: .85rem 1.5rem;
    border-radius: 12px;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, auto) minmax(0, 1.4fr);
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.dash-stat,
.dash-usage {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
}

.dash-stat + .dash-stat,
.dash-usage {
    border-left: 1px solid var(--c-border);
}

.dash-stat-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
}

.dash-stat-icon.is-orange {
    background: #ffe9d6;
    color: var(--c-primary);
}

.dash-stat-icon.is-green {
    background: #dcfce7;
    color: #16a34a;
}

.dash-stat-icon.is-violet {
    background: #ede9fe;
    color: #7c3aed;
}

.dash-stat-label {
    display: block;
    color: var(--c-muted);
    font-size: .9rem;
}

.dash-stat-value {
    display: block;
    font-size: 1.6rem;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.dash-stat-value small {
    color: var(--c-muted);
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: 0;
}

.dash-usage {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
}

.dash-usage-pct {
    align-self: flex-end;
    color: #15803d;
    font-size: .9rem;
    font-weight: 700;
}

.dash-usage-pct.is-full {
    color: var(--c-danger);
}

.dash-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee9e3;
}

.dash-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.dash-bar-fill.is-full {
    background: var(--c-danger);
}

.dash-usage-note {
    color: var(--c-muted);
    font-size: .875rem;
}

.dash-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    grid-column: 1 / -1;
    padding: .85rem 1.75rem;
    border-top: 1px solid var(--c-border);
}

.dash-flags .badge {
    margin: 0;
}

.acad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.5rem;
}

.acad-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
    color: var(--c-text);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}

.acad-card:hover {
    border-color: #f9c79c;
    box-shadow: 0 12px 28px rgba(32, 26, 22, .1);
    text-decoration: none;
    transform: translateY(-2px);
}

.acad-banner {
    position: relative;
    display: grid;
    place-items: center;
    height: 168px;
    margin: .6rem .6rem 0;
    overflow: hidden;
    border-radius: 14px;
}

.acad-banner::after {
    content: "";
    position: absolute;
    right: -10%;
    bottom: -45%;
    left: -10%;
    height: 70%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
}

.acad-banner svg {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
}

.acad-banner-live {
    background: linear-gradient(160deg, #ffeedd, #fdd9b8);
}

.acad-banner-outline {
    background: linear-gradient(160deg, #f3ecff, #e1d4fb);
}

.acad-banner-render {
    background: linear-gradient(160deg, #e8f1ff, #cfe0fb);
}

.acad-banner-draft {
    background: linear-gradient(160deg, #f6f1ea, #e9e0d3);
}

.acad-badge {
    position: absolute;
    top: .8rem;
    left: .8rem;
    z-index: 2;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.acad-badge-live {
    background: #d7f7e1;
    color: #15803d;
}

.acad-badge-outline {
    background: #fff;
    color: #6d28d9;
}

.acad-badge-render {
    background: #fff;
    color: #1d4ed8;
}

.acad-badge-draft {
    background: #fff;
    color: #6b5d4f;
}

.acad-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .85rem;
    padding: 1.1rem 1.2rem 1.25rem;
}

.acad-body h3 {
    display: -webkit-box;
    min-height: 2.5em;
    margin: 0;
    overflow: hidden;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: -.01em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.acad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    margin: 0;
    color: #5b4a3f;
    font-size: .875rem;
}

.acad-meta span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}

.acad-meta svg {
    color: #9a8f86;
}

.acad-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: auto;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    color: #fff;
    font-weight: 600;
    transition: background .15s;
}

.acad-card:hover .acad-cta {
    background: var(--c-primary-hover);
}

@media (max-width: 1100px) {
    .dash-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-usage {
        grid-column: 1 / -1;
        border-top: 1px solid var(--c-border);
        border-left: 0;
    }
}

@media (max-width: 700px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }

    .dash-stat + .dash-stat {
        border-top: 1px solid var(--c-border);
        border-left: 0;
    }

    .page-hero .btn {
        width: 100%;
    }
}

/* 9. Academies --------------------------------------------------------- */
.hint {
    margin: .5rem 0 0;
    color: var(--c-muted);
    font-size: .85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Stepper: numbered circles joined by a line, label underneath. */
.wizard-steps {
    display: flex;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.wizard-step {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    color: var(--c-muted);
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
}

.wizard-step + .wizard-step::before {
    content: "";
    position: absolute;
    top: 15px;
    right: 50%;
    left: -50%;
    height: 2px;
    background: #ddd6cd;
}

.wizard-step.is-done::before,
.wizard-step.is-current::before {
    background: var(--c-primary);
}

.wizard-step-number {
    position: relative;
    z-index: 1;
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd6cd;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
}

.wizard-step.is-current {
    color: var(--c-text);
}

.wizard-step.is-current .wizard-step-number,
.wizard-step.is-done .wizard-step-number {
    background: var(--c-primary);
}

.wizard-step.is-current .wizard-step-number {
    box-shadow: 0 0 0 5px rgba(234, 88, 12, .18);
}

.wizard-step.is-done {
    color: var(--c-primary-ink);
}

.source-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.source-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.source-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.15rem;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.source-tab:hover {
    background: var(--c-bg);
}

.source-radio:checked + .source-tab {
    border-color: var(--c-primary);
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    color: #fff;
}

.source-radio:focus-visible + .source-tab {
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.source-panel {
    display: none;
    flex-basis: 100%;
    margin-top: .5rem;
}

.source-radio-file:checked ~ .source-panel-file,
.source-radio-url:checked ~ .source-panel-url {
    display: block;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 2.25rem 1rem 1.75rem;
    border: 2px dashed #f7b985;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff7f0, #fff1e6);
    text-align: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.dropzone:hover,
.dropzone.is-dragover,
.dropzone:focus-within {
    border-color: var(--c-primary);
    background: linear-gradient(180deg, #fff2e5, #ffe8d3);
}

.dropzone-cloud {
    color: var(--c-primary);
}

.dropzone-title {
    margin-top: .25rem;
    font-size: 1.2rem;
}

.dropzone-sub {
    color: #5b4a3f;
}

.dropzone-browse {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .6rem;
    padding: .6rem 1.4rem;
    border-radius: 10px;
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    color: #fff;
    font-weight: 600;
}

.dropzone:hover .dropzone-browse {
    background: var(--c-primary-hover);
}

.dropzone-types {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: .9rem;
    padding-top: .75rem;
    border-top: 1px solid #f3d9bf;
    color: #5b4a3f;
    font-size: .875rem;
}

.upload-note {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: .9rem 0 0;
    color: #5b4a3f;
    font-size: .9rem;
}

.upload-note svg {
    flex: none;
    margin-top: .1rem;
    color: var(--c-muted);
}

.upload-card {
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.upload-head h2 {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    font-size: 1.3rem;
}

.upload-head h2::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--c-primary);
}

.req-pill {
    padding: .3rem .85rem;
    border-radius: 999px;
    background: #ffe9d6;
    color: var(--c-primary-ink);
    font-size: .8rem;
    font-weight: 700;
}

.upload-actions {
    padding-top: 1.25rem;
    border-top: 1px solid var(--c-border);
}

.upload-card:has(input[name="rights"]:not(:checked)) .js-busy-button {
    opacity: .55;
}

.vault-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: .9rem 1.5rem .9rem 1rem;
    overflow: hidden;
    border: 1px solid #fde1c8;
    border-radius: 18px;
    background:
        radial-gradient(22rem 12rem at 100% 120%, rgba(251, 146, 60, .25), transparent 65%),
        linear-gradient(110deg, #ffeedd, #fff6ee 60%, #ffe9d4);
    color: var(--c-text);
}

.vault-banner:hover {
    border-color: #f9c79c;
    text-decoration: none;
}

.vault-banner-art {
    flex: none;
}

.vault-banner-text {
    flex: 1;
    min-width: 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--c-primary);
}

.vault-banner-text strong {
    display: block;
    font-size: 1.2rem;
}

.vault-banner-text span {
    display: block;
    margin-top: .15rem;
    color: #5b4a3f;
    font-size: .9rem;
}

.vault-banner-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.25rem;
    border: 1px solid var(--c-primary);
    border-radius: 12px;
    background: rgba(255, 255, 255, .6);
    color: var(--c-primary);
    font-weight: 600;
    transition: background .15s, color .15s;
}

.vault-banner-btn:hover {
    background: var(--c-primary);
    color: #fff;
}

@media (max-width: 760px) {
    .vault-banner {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .vault-banner-art {
        display: none;
    }

    .vault-banner-text {
        padding-left: 1rem;
    }

    .vault-banner-btn {
        width: 100%;
        justify-content: center;
    }

    .upload-card {
        padding: 1.1rem;
    }

    .upload-actions .btn {
        flex: 1;
    }

    .wizard-step-label {
        font-size: .72rem;
    }
}

.dropzone-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dropzone-icon {
    font-size: 2rem;
}

.dropzone-file {
    font-weight: 600;
    color: var(--c-primary-ink);
}

.dropzone-file.is-error {
    color: var(--c-danger);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 1.25rem;
}

.stat strong {
    font-size: 1.25rem;
}

.stat .stat-source {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 400;
}

.chapter-head {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.chapter-head .muted {
    margin: 0;
}

.chapter-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.chapter {
    padding: .75rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.chapter:last-child {
    border-bottom: 0;
}

.chapter:has(.chapter-check:not(:checked)) {
    background: var(--c-bg);
}

.chapter:has(.chapter-check:not(:checked)) .chapter-title {
    color: var(--c-muted);
    text-decoration: line-through;
}

.chapter-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.chapter-check {
    flex: none;
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
}

.chapter-number {
    flex: none;
    width: 2rem;
    color: var(--c-muted);
    font-size: .85rem;
    text-align: right;
}

.chapter-title {
    flex: 1;
    padding: .45rem .65rem;
}

.chapter-words {
    flex: none;
    width: 6.5rem;
    color: var(--c-muted);
    font-size: .85rem;
    text-align: right;
}

.chapter-preview {
    margin: .35rem 0 0 4.4rem;
    font-size: .875rem;
}

.chapter-preview summary {
    color: var(--c-primary);
    cursor: pointer;
}

.chapter-text {
    max-height: 22rem;
    margin-top: .5rem;
    padding: .75rem 1rem;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-surface);
}

.chapter-text h4 {
    margin: .75rem 0 .25rem;
}

.chapter-text p {
    margin: 0 0 .6rem;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h2 {
    font-size: 1rem;
}

.danger-zone .muted {
    margin: 0;
}

.academy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.academy-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    color: var(--c-text);
}

.academy-card:hover {
    border-color: var(--c-primary);
    text-decoration: none;
}

.academy-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.academy-card .muted {
    margin: 0;
    font-size: .875rem;
}

.academy-next {
    margin-top: auto;
    color: var(--c-primary);
    font-weight: 600;
    font-size: .9rem;
}

/* 10. Course blueprint and lesson editor -------------------------------- */
.form-control-lg {
    font-size: 1.1rem;
    font-weight: 600;
}

.hint-right {
    text-align: right;
}

.breadcrumb {
    margin: 0 0 .25rem;
    font-size: .875rem;
}

.writer-progress {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.5rem;
}

.writer-progress-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.writer-bar {
    width: 100%;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: var(--c-bg);
    accent-color: var(--c-primary);
    overflow: hidden;
}

.writer-bar::-webkit-progress-bar {
    background: var(--c-bg);
}

.writer-bar::-webkit-progress-value {
    background: var(--c-primary);
}

.writer-bar::-moz-progress-bar {
    background: var(--c-primary);
}

.module-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg);
}

.module-label {
    flex: none;
    color: var(--c-primary-ink);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.module-title {
    font-weight: 600;
}

.lesson-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lesson {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: .9rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.lesson:last-child {
    border-bottom: 0;
}

.lesson-number {
    flex: none;
    width: 2.5rem;
    padding-top: .5rem;
    color: var(--c-muted);
    font-size: .85rem;
    font-weight: 600;
}

.lesson-body {
    flex: 1;
    min-width: 0;
}

.lesson-title {
    padding: .45rem .65rem;
}

.lesson-summary {
    margin: .35rem 0 0;
    color: var(--c-muted);
    font-size: .85rem;
}

.lesson-error {
    margin: .35rem 0 0;
    color: var(--c-danger);
    font-size: .85rem;
}

.lesson-error:empty {
    display: none;
}

.lesson-side {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
    width: 11rem;
    padding-top: .35rem;
}

.lesson-side .status {
    margin-left: 0;
}

.lesson-edit {
    font-size: .85rem;
}

.lesson-retry {
    display: none;
}

.lesson[data-status="failed"] .lesson-retry {
    display: inline-flex;
}

.status-ready {
    background: var(--c-success-soft);
    color: var(--c-success);
}

.status-writing {
    background: #fef3c7;
    color: #92400e;
}

.module {
    margin-bottom: 1.25rem;
}

.lesson-brief {
    margin: 0;
}

.slide-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.slide-head h2 {
    font-size: 1rem;
}

.slide-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
}

.slide-voiceover {
    height: 100%;
    min-height: 12rem;
    line-height: 1.6;
}

/* 11. Video style and render page --------------------------------------- */
.approve-card {
    margin-top: 1.5rem;
}

.approve-card h2 {
    font-size: 1.15rem;
}

.approve-card .muted {
    margin: 0;
}

.approve-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1.5rem;
    align-items: start;
}

.theme-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.theme-picker legend {
    margin-bottom: .5rem;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .75rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.theme-option:has(input:checked) {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}

.theme-option input {
    accent-color: var(--c-primary);
}

.theme-swatch {
    flex: none;
    width: 34px;
    height: 22px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
}

.theme-swatch-clean {
    background: linear-gradient(90deg, #16a34a 0, #16a34a 4px, #ffffff 4px);
}

.theme-swatch-midnight {
    background: linear-gradient(135deg, #0b1220, #1e3a5f);
}

.theme-swatch-sunrise {
    background: linear-gradient(135deg, #fff7ed, #fdba74);
}

.theme-swatch-photo {
    background: linear-gradient(135deg, #0f172a, #134e4a 60%, #4ade80);
}

/* Studio Pro cinema template swatches (generated from Config\Render::$cinemaPalettes). */
.theme-swatch-cinema-01 {
    background: linear-gradient(135deg, #050505 0%, #1c1c1c 70%, #f5c518 70%);
}

.theme-swatch-cinema-02 {
    background: linear-gradient(135deg, #0b1026 0%, #1d2552 70%, #e6b94f 70%);
}

.theme-swatch-cinema-03 {
    background: linear-gradient(135deg, #1a0603 0%, #4a1208 70%, #ff7a3d 70%);
}

.theme-swatch-cinema-04 {
    background: linear-gradient(135deg, #03141f 0%, #08374f 70%, #2ec4f1 70%);
}

.theme-swatch-cinema-05 {
    background: linear-gradient(135deg, #03140d 0%, #0a3d27 70%, #34d399 70%);
}

.theme-swatch-cinema-06 {
    background: linear-gradient(135deg, #12051f 0%, #33114f 70%, #c084fc 70%);
}

.theme-swatch-cinema-07 {
    background: linear-gradient(135deg, #1a0207 0%, #4c0619 70%, #fb4d6d 70%);
}

.theme-swatch-cinema-08 {
    background: linear-gradient(135deg, #0f1417 0%, #2a343b 70%, #7dd3fc 70%);
}

.theme-swatch-cinema-09 {
    background: linear-gradient(135deg, #1f1208 0%, #5c3615 70%, #fbbf24 70%);
}

.theme-swatch-cinema-10 {
    background: linear-gradient(135deg, #04121a 0%, #0d3b3a 70%, #5eead4 70%);
}

.theme-swatch-cinema-11 {
    background: linear-gradient(135deg, #1c0d10 0%, #4a232b 70%, #f4a7b9 70%);
}

.theme-swatch-cinema-12 {
    background: linear-gradient(135deg, #020b26 0%, #0a2a7a 70%, #60a5fa 70%);
}

.theme-swatch-cinema-13 {
    background: linear-gradient(135deg, #07120a 0%, #1e3a24 70%, #a3e635 70%);
}

.theme-swatch-cinema-14 {
    background: linear-gradient(135deg, #111214 0%, #2b2e33 70%, #bef264 70%);
}

.theme-swatch-cinema-15 {
    background: linear-gradient(135deg, #200a1e 0%, #5b1a3a 70%, #fb923c 70%);
}

.theme-swatch-cinema-16 {
    background: linear-gradient(135deg, #e9f1f7 0%, #c9dbe8 70%, #0369a1 70%);
}

.theme-swatch-cinema-17 {
    background: linear-gradient(135deg, #faf7f0 0%, #ece4d2 70%, #b45309 70%);
}

.theme-swatch-cinema-18 {
    background: linear-gradient(135deg, #fdf2f4 0%, #f6d6dd 70%, #be185d 70%);
}

.theme-swatch-cinema-19 {
    background: linear-gradient(135deg, #effaf5 0%, #cfeee0 70%, #047857 70%);
}

.theme-swatch-cinema-20 {
    background: linear-gradient(135deg, #f5f3ff 0%, #e0dbfa 70%, #6d28d9 70%);
}

.theme-swatch-cinema-21 {
    background: linear-gradient(135deg, #f8f1e7 0%, #e7d5bb 70%, #9a3412 70%);
}

.theme-swatch-cinema-22 {
    background: linear-gradient(135deg, #0e1726 0%, #24364f 70%, #fcd34d 70%);
}

.theme-swatch-cinema-23 {
    background: linear-gradient(135deg, #06010f 0%, #1b0640 70%, #f0abfc 70%);
}

.theme-swatch-cinema-24 {
    background: linear-gradient(135deg, #140b07 0%, #3d2214 70%, #fdba74 70%);
}

.theme-swatch-cinema-25 {
    background: linear-gradient(135deg, #f4f4f5 0%, #d4d4d8 70%, #18181b 70%);
}

.theme-preview {
    margin: 0;
}

.theme-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-bg);
    object-fit: cover;
}

.theme-preview figcaption {
    margin-top: .4rem;
    font-size: .85rem;
}

.worker-alert {
    margin: .5rem 0 0;
}

.render-bar {
    height: 6px;
    margin-top: .4rem;
}

.render-player {
    margin-top: .5rem;
}

.render-player summary {
    color: var(--c-primary);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.render-player video {
    display: block;
    width: 100%;
    max-width: 720px;
    margin-top: .5rem;
    border-radius: 8px;
    background: #000;
}

.stale-note {
    color: #92400e;
    font-weight: 600;
}

.status-queued {
    background: var(--c-bg);
    color: var(--c-muted);
}

.status-running {
    background: #fef3c7;
    color: #92400e;
}

.status-done {
    background: var(--c-success-soft);
    color: var(--c-success);
}

.status-none {
    background: var(--c-bg);
    color: var(--c-muted);
}

/* 12. Publishing ------------------------------------------------------- */
.form-control-code {
    margin-top: .4rem;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: .85rem;
}

.integration-note {
    padding: .75rem .9rem;
    border-radius: 8px;
    background: var(--c-bg);
    font-size: .85rem;
}

.setup-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-color: var(--c-primary);
}

.live-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #fcd9b6;
    border-radius: 18px;
    background: linear-gradient(120deg, #fff7f0, #fff1e6);
}

.live-main {
    flex: 1;
    min-width: 0;
}

.live-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .65rem;
}

.live-head strong {
    font-size: 1.05rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .7rem;
    border-radius: 999px;
    background: var(--c-success-soft);
    color: #15803d;
    font-size: .8rem;
    font-weight: 700;
}

.live-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.live-url {
    height: 46px;
    margin: 0;
    border-radius: 12px;
}

.live-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: .6rem;
}

.live-card .live-actions .btn {
    height: 46px;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .live-card {
        flex-direction: column;
        align-items: stretch;
    }

    .live-actions .btn {
        flex: 1;
    }
}

.setup-link {
    flex-direction: column;
    align-items: stretch;
    gap: .3rem;
    background: var(--c-primary-soft);
}

.setup-link .muted {
    margin: 0;
}

.input-prefix {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .85rem;
}

.input-prefix .form-control {
    flex: 1;
    min-width: 8rem;
}

.trust-picker {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.trust-picker .hint {
    margin: 0 0 .25rem;
}

.price-modes {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.students-card {
    margin-top: 1.5rem;
}

.students-card h2 {
    font-size: 1.1rem;
}

.students-card .inline-form {
    flex-wrap: wrap;
}

.students-card .inline-form .form-control {
    flex: 1;
    min-width: 12rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
}

.empty-row {
    margin: 0;
    padding: 1rem 1.5rem;
}

/* 13. eBook Vault, members area settings, buyer traffic ---------------- */
.vault-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
    color: var(--c-text);
}

.vault-cta:hover {
    border-color: var(--c-primary-hover);
    text-decoration: none;
}

.vault-cta strong,
.vault-cta .muted {
    display: block;
}

.vault-cta-icon {
    font-size: 1.8rem;
}

.vault-cta-arrow {
    margin-left: auto;
    color: var(--c-primary-ink);
    font-size: 1.3rem;
    font-weight: 700;
}

.tool-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.25rem;
    color: var(--c-text);
}

.tool-link:hover {
    border-color: var(--c-primary);
    text-decoration: none;
}

.tool-link strong,
.tool-link .muted {
    display: block;
}

.tool-link .muted {
    font-size: .85rem;
}

.tool-link-icon {
    font-size: 1.6rem;
}

.resource-form {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--c-border);
}

.resource-form h3 {
    margin: 0;
    font-size: 1rem;
}

.traffic-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
}

.traffic-layout > div {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stamp-sample {
    margin: 0;
    padding: .8rem 1rem;
    border-radius: 8px;
    background: var(--c-primary);
    color: #ffffff;
    font-size: .9rem;
}

.stamp-sample strong {
    display: block;
}

.stamp-ready {
    border-color: var(--c-primary);
}

.stamp-ready h2 {
    margin-top: .5rem;
}

.stamp-ready .muted {
    overflow-wrap: anywhere;
}

.syndication {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.syndication li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    font-size: .85rem;
}

.teaser-card {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.teaser-state {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.teaser-form {
    margin-top: 1rem;
}

.teaser-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    text-align: center;
}

.teaser-video,
.teaser-placeholder {
    width: 100%;
    max-width: 270px;
    aspect-ratio: 9 / 16;
    border-radius: var(--radius);
    background: #000000;
}

.teaser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    border: 2px dashed var(--c-border);
    background: var(--c-bg);
    color: var(--c-muted);
    font-size: .875rem;
}

.teaser-placeholder span {
    font-size: 1.5rem;
    font-weight: 700;
}

.dub-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
}

/* DFY Academy Vault. */
.dfy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dfy-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
}

.dfy-card h2 {
    margin: .25rem 0 0;
    font-size: 1.05rem;
}

.dfy-card .muted,
.dfy-meta {
    margin: 0;
    font-size: .875rem;
}

.dfy-meta {
    flex: 1;
    color: var(--c-muted);
}

.dfy-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.dfy-form .form-control {
    width: auto;
    min-width: 140px;
}

/* Studio Pro: the Cinema template picker. */
.cinema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: .5rem;
}

.cinema-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .4rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: .72rem;
    text-align: center;
    cursor: pointer;
}

.cinema-option:has(input:checked) {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px var(--c-primary-soft);
}

.cinema-option input {
    position: absolute;
    opacity: 0;
}

.cinema-option .theme-swatch {
    width: 100%;
    height: 34px;
}

/* Studio Pro: the quiz editor on the lesson page. */
.quiz-editor {
    margin-top: 1.5rem;
}

.quiz-list {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.quiz-list ul {
    margin: .3rem 0;
    padding-left: 1.1rem;
    color: var(--c-muted);
}

.quiz-right {
    color: var(--c-success);
    font-weight: 600;
}

.quiz-add {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--c-border);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
}

/* Traffic Domination on the Buyer Traffic page. */
.domination-card h3 {
    margin: 1.5rem 0 .4rem;
}

.domination-card h3:first-of-type {
    margin-top: .5rem;
}

.clip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.clip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.clip-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
}

.clip-video {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    background: #000000;
}

.clip-caption {
    font-size: .78rem;
}

/* Multi-Platform Publisher page. */
.pub-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.pub-platform {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: .9rem;
    border: 1px solid var(--c-border);
    border-radius: 10px;
}

.pub-platform .is-disabled {
    pointer-events: none;
    opacity: .5;
}

.pub-audiobook {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0 0;
}

/* AutoFlow page. */
.flow-email {
    padding: .75rem 0;
    border-top: 1px solid var(--c-border);
}

.flow-email summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-weight: 600;
}

.flow-email[open] summary {
    margin-bottom: .75rem;
}

.flow-reset {
    margin-top: .75rem;
}

.dub-steps {
    padding-left: 1.25rem;
    line-height: 1.6;
}

.dub-editions {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dub-editions li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.dub-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0 0;
    font-size: .9rem;
}

.affiliate-card {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.input-suffix {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.input-suffix .form-control {
    max-width: 6rem;
}

.affiliate-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
}

.affiliate-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    width: 100%;
    margin: 0;
}

.affiliate-stats div {
    padding: .75rem;
    border-radius: 8px;
    background: var(--c-bg);
}

.affiliate-stats dt {
    color: var(--c-muted);
    font-size: .8rem;
}

.affiliate-stats dd {
    margin: .2rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Public Course Marketplace and affiliate dashboard. */
.market-head {
    max-width: 720px;
    margin-bottom: 1.75rem;
}

.market-head h1 {
    margin: 0 0 .5rem;
}

.market-search {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.market-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.market-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--c-bg);
}

.market-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-muted);
    font-size: 2rem;
}

.market-body {
    flex: 1;
    padding: 1rem 1rem .5rem;
}

.market-body h2 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
}

.market-verified {
    margin-bottom: .35rem;
    background: #eff6ff;
    color: #1d4ed8;
}

.market-body .muted {
    margin: 0;
    font-size: .875rem;
}

.market-earn {
    display: flex;
    flex-direction: column;
    margin: .75rem 0 0;
    color: var(--c-success);
    font-weight: 700;
}

.market-earn .muted {
    font-weight: 400;
}

.market-earn-lg {
    font-size: 1.35rem;
}

.market-actions {
    display: flex;
    gap: .5rem;
    padding: .5rem 1rem 1rem;
}

.market-promote {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.market-promote h1 {
    margin-top: 0;
}

.market-steps {
    padding-left: 1.25rem;
    line-height: 1.6;
}

.market-welcome,
.market-recover {
    max-width: 640px;
    margin: 0 auto;
}

.market-welcome h1 {
    margin: .75rem 0 .5rem;
}

.market-welcome h2 {
    margin-top: 1.75rem;
}

.market-payout {
    max-width: 640px;
    margin-top: 1.5rem;
}

.dash-link-cell {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 260px;
}

/* 14. Responsive ------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .traffic-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .sidebar {
        width: min(300px, 86vw);
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(32, 26, 22, .25);
    }

    .sidebar-close {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--c-muted);
        cursor: pointer;
    }

    .sidebar-close:hover {
        background: var(--c-bg);
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        gap: .75rem;
        height: 58px;
        padding: 0 12px;
        border-bottom: 1px solid var(--c-border);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(8px);
    }

    .mobile-bar .brand-logo {
        height: 30px;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--c-border);
        border-radius: 10px;
        background: var(--c-surface);
        color: var(--c-text);
        cursor: pointer;
    }

    .page {
        padding: 1.5rem 20px 3rem;
    }

    body.has-drawer {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .page-head .btn {
        width: 100%;
    }

    .card {
        padding: 1.25rem;
    }

    .card-flush {
        overflow-x: auto;
    }
}
@media (max-width: 760px) {
    .tool-links,
    .traffic-layout,
    .teaser-card,
    .affiliate-card,
    .market-promote,
    .dub-layout {
        grid-template-columns: 1fr;
    }
    .live-card {
        flex-direction: column;
        align-items: stretch;
    }

    .approve-grid,
    .theme-picker {
        grid-template-columns: 1fr;
    }

    .slide-grid {
        grid-template-columns: 1fr;
    }

    .lesson {
        flex-wrap: wrap;
    }

    .lesson-side {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

    .module-head {
        flex-direction: column;
        align-items: stretch;
    }

    .danger-zone {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-row {
        flex-wrap: wrap;
    }

    .chapter-words {
        width: auto;
    }

    .chapter-preview {
        margin-left: 0;
    }

    .setup-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .page {
        padding: 1.25rem 16px 2.5rem;
    }

    .page-head {
        flex-direction: column;
    }

    .steps,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .plan-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Profile -------------------------------------------------------------- */
.profile-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    box-shadow: 0 6px 18px rgba(234, 88, 12, .25);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.page-pill {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border: 1px solid #fcd9b6;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--c-primary-ink);
    font-weight: 600;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.profile-lock {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.profile-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.profile-row {
    display: grid;
    grid-template-columns: 40px minmax(7rem, 9rem) minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--c-border);
}

.profile-row:last-child {
    border-bottom: 0;
}

.profile-row-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.profile-row dt {
    color: var(--c-muted);
    font-size: .9rem;
}

.profile-row dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.profile-card .upload-note {
    margin: 0;
}

.profile-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.profile-card .profile-list {
    padding-top: .25rem;
    border-top: 1px solid var(--c-border);
}

.profile-plan {
    margin-top: 1.5rem;
}

.plan-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
}

.plan-heading {
    margin: 0 0 .6rem;
    color: var(--c-muted);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.plan-heading:not(:first-child) {
    margin-top: 1.5rem;
}

.plan-products,
.plan-license {
    margin: 1.25rem 0 0;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: var(--c-success-soft);
    color: var(--c-success);
    font-size: .9rem;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plan-products li {
    display: flex;
    flex-direction: column;
    padding: .7rem .9rem;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-bg);
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.plan-features svg {
    flex: none;
    margin-top: .2rem;
    color: var(--c-success);
}

.plan-limits {
    margin: 0;
}

.plan-limits div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--c-border);
}

.plan-limits div:last-child {
    border-bottom: 0;
}

.plan-limits dt {
    color: var(--c-muted);
}

.plan-limits dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.user-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: inherit;
}

.user-link:hover {
    text-decoration: none;
}

.user-card.is-active {
    border-color: #f9c79c;
    background: var(--c-primary-soft);
}

@media (max-width: 991px) {
    .profile-grid,
    .plan-columns {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-stats .dash-stat:nth-child(3) {
        border-left: 0;
    }

    .profile-stats .dash-stat:nth-child(n + 3) {
        border-top: 1px solid var(--c-border);
    }
}

@media (max-width: 700px) {
    .page-pill {
        order: 3;
    }

    .profile-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .profile-row dd {
        grid-column: 2;
    }

    .profile-stats .dash-stat {
        padding: 1rem;
    }

    .profile-stats .dash-stat:nth-child(2) {
        border-top: 0;
    }

    .profile-stats .dash-stat:nth-child(even) {
        border-left: 1px solid var(--c-border);
    }

    .profile-stats .dash-stat-icon {
        width: 44px;
        height: 44px;
    }
}

/* eBook Vault ---------------------------------------------------------- */
.hero-btn {
    flex: none;
    background: rgba(255, 255, 255, .75);
}

.vault-search {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.vault-search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.vault-search-field svg {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: #8a7e74;
    transform: translateY(-50%);
    pointer-events: none;
}

.vault-search-field .form-control {
    height: 100%;
    min-height: 52px;
    padding-left: 3rem;
    border-radius: 14px;
}

.niche-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: 1.75rem;
}

.niche-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-text);
    font-size: .9rem;
    font-weight: 600;
    transition: background .15s, border-color .15s;
}

.niche-chip:hover {
    border-color: #f9c79c;
    background: var(--c-primary-soft);
    text-decoration: none;
}

.niche-chip.is-active {
    border-color: var(--c-primary);
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(194, 65, 12, .3);
    color: #fff;
}

.niche-count {
    padding: .05rem .5rem;
    border-radius: 999px;
    background: #efebe6;
    color: #5b4a3f;
    font-size: .75rem;
}

.niche-chip.is-active .niche-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.book-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
    transition: transform .18s, box-shadow .18s;
}

.book-card:not(.is-locked):hover {
    box-shadow: 0 12px 28px rgba(32, 26, 22, .1);
    transform: translateY(-2px);
}

.book-cover {
    position: relative;
    display: grid;
    place-items: center;
    height: 150px;
    margin: .6rem .6rem 0;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--c1) 12%, #fff), color-mix(in srgb, var(--c1) 32%, #fff));
}

.book-cover::after {
    content: "";
    position: absolute;
    right: -10%;
    bottom: -50%;
    left: -10%;
    height: 70%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
}

.book-art {
    position: relative;
    z-index: 1;
    margin-top: .75rem;
    filter: drop-shadow(0 8px 10px rgba(32, 26, 22, .18));
}

.book-art-body {
    fill: var(--c1);
}

.book-art-spine {
    fill: var(--c2);
}

.book-art-play {
    fill: var(--c2);
}

.book-niche,
.book-lock {
    position: absolute;
    top: .75rem;
    z-index: 2;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.book-niche {
    left: .75rem;
    background: #fff;
    color: var(--c2);
}

.book-lock {
    right: .75rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #fef3c7;
    color: #92400e;
}

.book-new {
    position: absolute;
    bottom: .75rem;
    left: .75rem;
    z-index: 2;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* Niche Vault Pro: the weekly Hot Niche Drop (vault page and dashboard). */
.drop-section {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff7ed, var(--c-bg));
}

.drop-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.drop-head h2 {
    margin: 0;
}

.drop-head .muted {
    margin: .15rem 0 0;
}

.drop-flame {
    font-size: 1.8rem;
    line-height: 1;
}

.vault-all-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.drop-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-color: #fed7aa;
    background: #fff7ed;
    color: var(--c-text);
}

.drop-banner:hover {
    text-decoration: none;
}

.drop-banner > span:nth-child(2) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.drop-banner-go {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .35rem;
    color: var(--c-primary);
    font-weight: 600;
}

.drop-weeks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.drop-week {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    padding: .75rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}

.drop-week.is-short {
    border-color: var(--c-danger-soft);
}

.drop-week strong {
    font-size: 1.2rem;
}

.book-card.is-locked .book-art {
    filter: grayscale(.6) drop-shadow(0 8px 10px rgba(32, 26, 22, .12));
    opacity: .75;
}

.book-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .7rem;
    padding: 1rem 1.2rem 1.25rem;
}

.book-body h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 1.1rem;
    line-height: 1.3;
    letter-spacing: -.01em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.book-desc {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--c-muted);
    font-size: .875rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.book-body form {
    margin-top: auto;
}

.book-body .acad-meta {
    margin-top: auto;
}

.book-body .acad-meta + form,
.book-body .acad-meta + .book-locked-note {
    margin-top: .3rem;
}

.book-cta {
    width: 100%;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.book-cta:hover:not(:disabled) {
    background: var(--c-primary-hover);
}

.book-locked-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border: 1px dashed #e4c98f;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: .9rem;
    font-weight: 600;
}

.pagination {
    justify-content: center;
    gap: .4rem;
    margin-top: 2rem;
}

.pagination a {
    min-width: 40px;
    padding: .5rem .8rem;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}

.pagination a:hover {
    border-color: #f9c79c;
    background: var(--c-primary-soft);
    text-decoration: none;
}

@media (max-width: 700px) {
    .vault-search {
        flex-direction: column;
    }

    .hero-btn {
        width: 100%;
    }
}

/* Confirm dialog ------------------------------------------------------- */
.confirm-dialog {
    width: min(440px, calc(100vw - 2rem));
    margin: auto;
    padding: 2rem 1.75rem 1.5rem;
    border: 0;
    border-radius: 22px;
    background: var(--c-surface);
    box-shadow: 0 24px 60px rgba(32, 26, 22, .3);
    color: var(--c-text);
    text-align: center;
}

.confirm-dialog[open] {
    animation: confirm-in .18s ease-out;
}

.confirm-dialog::backdrop {
    background: rgba(32, 26, 22, .5);
    backdrop-filter: blur(3px);
}

@keyframes confirm-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.97);
    }
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    background: var(--c-danger-soft);
    box-shadow: 0 0 0 8px rgba(254, 226, 226, .55);
    color: var(--c-danger);
}

.confirm-icon-danger,
.confirm-dialog.is-trash .confirm-icon-warn {
    display: none;
}

.confirm-dialog.is-trash .confirm-icon-danger {
    display: block;
}

.confirm-title {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -.01em;
}

.confirm-text {
    margin: .6rem 0 1.5rem;
    color: #5b4a3f;
    overflow-wrap: anywhere;
}

.confirm-actions {
    display: flex;
    gap: .75rem;
}

.confirm-actions .btn {
    flex: 1;
}

.confirm-ok {
    background: #dc2626;
    box-shadow: 0 1px 2px rgba(185, 28, 28, .35);
    color: #fff;
}

.confirm-ok:hover {
    background: #b91c1c;
}

@media (max-width: 480px) {
    .confirm-actions {
        flex-direction: column-reverse;
    }
}

/* Admin: customers ----------------------------------------------------- */
.hero-cta {
    flex: none;
    gap: .45rem;
}

.cust-card {
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(120, 60, 20, .06);
}

.cust-scroll {
    overflow-x: auto;
}

.cust-table {
    min-width: 760px;
}

.cust-table th {
    padding: .95rem 1.25rem;
    border-bottom: 1px solid var(--c-border);
    background: #faf7f3;
}

.cust-table td {
    padding: .9rem 1.25rem;
    color: #4a3f37;
    font-size: .93rem;
}

.cust-table tbody tr {
    transition: background .15s;
}

.cust-table tbody tr:hover {
    background: #fffaf5;
}

.cust-who {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: var(--c-text);
    font-weight: 600;
}

.cust-who:hover {
    color: var(--c-primary);
    text-decoration: none;
}

.cust-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
}

.cust-email {
    overflow-wrap: anywhere;
}

.badge-ok {
    background: var(--c-success-soft);
    color: var(--c-success);
}

.cust-table .btn-sm {
    gap: .35rem;
}

.cust-empty {
    display: grid;
    justify-items: center;
    gap: .35rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.cust-empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: .5rem;
    border-radius: 18px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

@media (max-width: 700px) {
    .hero-cta {
        width: 100%;
    }
}

/* Admin: account forms ------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
}

.page-hero + .acct-form,
.page-hero + .acct-form-narrow {
    margin-top: 0;
}

.acct-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.acct-form-narrow {
    max-width: 640px;
}

.acct-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.acct-card .form-control {
    min-height: 48px;
    border-radius: 12px;
}

.acct-card select.form-control {
    padding-right: 2.5rem;
    background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23766c63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9rem center;
    appearance: none;
    cursor: pointer;
}

.acct-card .hint {
    margin: 0;
}

.acct-self {
    margin: 0;
    padding: .9rem 1rem;
    border: 1px solid #fcd9b6;
    border-radius: 12px;
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-size: .9rem;
}

.acct-actions {
    align-items: center;
}

.acct-danger {
    gap: 1.25rem;
    padding: 1.4rem 1.75rem;
    border-color: #fbcaca;
    border-radius: 18px;
    background: linear-gradient(120deg, #fff, #fff5f5);
}

.acct-danger-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.acct-danger-text {
    flex: 1;
    min-width: 0;
}

.acct-danger h2 {
    margin: 0 0 .2rem;
}

.btn-danger-outline {
    border-color: #f3b4b4;
    color: var(--c-danger);
}

.btn-danger-outline:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

@media (max-width: 900px) {
    .acct-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .acct-danger {
        flex-direction: column;
        align-items: stretch;
    }

    .acct-danger .btn {
        width: 100%;
    }

    .acct-actions {
        flex-direction: column-reverse;
    }

    .acct-actions .btn {
        width: 100%;
    }
}

.breadcrumb + .page-hero {
    margin-top: .75rem;
}

/* Admin: eBook vault --------------------------------------------------- */
.vlt-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.vlt-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: 18px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.vlt-add .upload-head {
    margin-bottom: .25rem;
}

.vlt-file {
    padding: 1.1rem 1rem;
    border: 2px dashed #f3c9a6;
    background: #fffaf5;
    color: var(--c-muted);
    cursor: pointer;
}

.vlt-file:hover {
    border-color: var(--c-primary);
}

.vlt-file::file-selector-button {
    margin-right: 1rem;
    padding: .55rem 1.1rem;
    border: 0;
    border-radius: 10px;
    background: var(--c-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.vlt-file::file-selector-button:hover {
    background: var(--c-primary-hover);
}

.acct-card textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.vlt-book {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.vlt-book strong {
    color: var(--c-text);
}

.vlt-book-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.vlt-file-name {
    display: block;
    color: var(--c-muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.cust-table .table-actions {
    flex-wrap: nowrap;
    align-items: center;
}

.vlt-visible {
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: #fffaf5;
}

.vlt-visible input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: .15rem;
    accent-color: var(--c-primary);
}

.vlt-visible > span {
    display: grid;
}

@media (max-width: 900px) {
    .vlt-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .acct-card .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.acct-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

/* Select dropdowns ----------------------------------------------------- */
/* Fallback (every browser): same closed look everywhere. */
select.form-control {
    padding-right: 2.5rem;
    background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23766c63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9rem center;
    appearance: none;
    cursor: pointer;
}

/* Chromium 135+: the open list itself becomes stylable. Other browsers keep the native list. */
@supports (appearance: base-select) {
    select.form-control,
    .acct-card select.form-control,
    select.form-control::picker(select) {
        appearance: base-select;
    }

    select.form-control,
    .acct-card select.form-control {
        padding-right: .9rem;
        background-image: none;
    }

    select.form-control:open {
        border-color: var(--c-primary);
        box-shadow: 0 0 0 3px var(--c-primary-soft);
    }

    select.form-control::picker-icon {
        color: var(--c-muted);
        transition: rotate .2s;
    }

    select.form-control:open::picker-icon {
        color: var(--c-primary);
        rotate: 180deg;
    }

    select.form-control::picker(select) {
        max-height: min(340px, 55vh);
        margin-top: .4rem;
        padding: .4rem;
        border: 1px solid var(--c-border);
        border-radius: 14px;
        background: var(--c-surface);
        box-shadow: 0 18px 44px rgba(60, 30, 10, .18);
    }

    select.form-control option {
        display: flex;
        align-items: center;
        gap: .6rem;
        padding: .6rem .8rem;
        border-radius: 10px;
        color: var(--c-text);
        font-size: .93rem;
        cursor: pointer;
    }

    select.form-control option:hover,
    select.form-control option:focus-visible {
        background: var(--c-primary-soft);
        color: var(--c-primary-ink);
        outline: none;
    }

    select.form-control option:checked {
        background: #ffe9d6;
        color: var(--c-primary-ink);
        font-weight: 600;
    }

    select.form-control option::checkmark {
        order: 1;
        margin-left: auto;
        color: var(--c-primary);
    }

    select.form-control option:disabled {
        opacity: .45;
        cursor: not-allowed;
    }
}

/* Dashboard: empty state ------------------------------------------------ */
.acad-empty {
    padding: 3rem clamp(1.25rem, 3vw, 3rem) 3rem;
    border-radius: 20px;
    background:
        radial-gradient(34rem 16rem at 50% -8%, rgba(251, 146, 60, .16), transparent 70%),
        var(--c-surface);
    box-shadow: var(--shadow);
}

.acad-empty-art {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin: 0 auto 1.25rem;
    border: 1px solid #fde1c8;
    border-radius: 28px;
    background: linear-gradient(145deg, #fff7f0, #ffe9d6);
    box-shadow: 0 10px 26px rgba(234, 88, 12, .16);
}

.acad-empty h2 {
    margin: 0 0 .35rem;
    font-size: 1.6rem;
    letter-spacing: -.02em;
}

.acad-empty > .muted {
    max-width: 34rem;
    margin: 0 auto;
    font-size: 1.02rem;
}

.acad-steps {
    gap: 1.5rem;
    max-width: 1100px;
    margin-top: 2.25rem;
}

.acad-steps li {
    position: relative;
    padding: 1.25rem 1.25rem 1.35rem;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fbf8f5);
    box-shadow: 0 4px 14px rgba(120, 60, 20, .05);
    transition: transform .18s, border-color .18s, box-shadow .18s;
}

.acad-steps li:hover {
    transform: translateY(-3px);
    border-color: #f9c79c;
    box-shadow: 0 12px 28px rgba(234, 88, 12, .12);
}

.acad-steps li::before {
    width: 38px;
    height: 38px;
    margin-bottom: .9rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 10px rgba(234, 88, 12, .3);
    color: #fff;
    font-size: 1rem;
}

.acad-steps li + li::after {
    content: "";
    position: absolute;
    top: 2.15rem;
    right: 100%;
    width: 1.5rem;
    border-top: 2px dashed #f3c9a6;
}

.acad-steps strong {
    margin-bottom: .3rem;
    font-size: 1.02rem;
}

.acad-steps span {
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .acad-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acad-steps li::after {
        display: none;
    }
}

@media (max-width: 560px) {
    .acad-steps {
        grid-template-columns: minmax(0, 1fr);
    }
}
