:root {
    --portal-bg: var(--ds-bg, #090d20);
    --portal-surface: var(--ds-surface, #141a34);
    --portal-line: var(--ds-line, rgba(173, 187, 255, .18));
    --portal-text: var(--ds-ink, #f7f8ff);
    --portal-muted: var(--ds-muted, #a6acc4);
    --portal-accent: var(--ds-lavender, #8b7cff);
    --portal-cyan: var(--ds-cyan, #64d5e8);
    --portal-danger: var(--ds-danger, #ff9a9a);
}
* { box-sizing: border-box; }
body.portal-page { min-width: 320px; min-height: 100vh; margin: 0; color: var(--portal-text); background: radial-gradient(circle at 84% 0, rgba(111, 95, 255, .23), transparent 32rem), var(--portal-bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
.portal-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--portal-text); font-weight: 800; text-decoration: none; }
.portal-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: #11132d; background: linear-gradient(135deg, var(--portal-cyan), #b4a9ff); font-weight: 900; }
.admin-release-badge { padding: 4px 7px; border: 1px solid rgba(103, 215, 238, .34); border-radius: 999px; color: var(--portal-cyan); background: rgba(103, 215, 238, .08); font-size: .68rem; font-weight: 850; letter-spacing: .04em; }
.portal-eyebrow { color: var(--portal-cyan); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-layout, .centered-layout { display: grid; min-height: 100vh; align-content: center; justify-items: center; gap: 28px; padding: 34px 0; }
.auth-layout .portal-brand, .centered-layout .portal-brand { justify-self: start; }
.auth-card { width: min(100%, 470px); padding: 34px; border: 1px solid var(--portal-line); border-radius: 22px; background: rgba(20, 26, 52, .88); box-shadow: 0 25px 70px rgba(0,0,0,.22); }
.auth-intro h1, .result-card h1 { margin: 12px 0 8px; font-size: clamp(2rem, 6vw, 3rem); line-height: 1; letter-spacing: -.055em; }
.auth-intro p, .result-card p { margin: 0 0 26px; color: var(--portal-muted); }
.portal-form, .project-form { display: grid; gap: 15px; }
.project-channel-fields { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--portal-line); border-radius: 12px; background: rgba(99,55,216,.035); }
.project-channel-fields .wizard-field-group-title { margin: 0; color: var(--portal-text); font-size: .82rem; font-weight: 800; }
.project-channel-fields label { display: grid; gap: 7px; color: var(--portal-muted); font-size: .86rem; font-weight: 700; }
.portal-form label, .project-form label { display: grid; gap: 7px; color: var(--portal-muted); font-size: .86rem; font-weight: 700; }
.portal-form input, .project-form input, .project-form textarea { width: 100%; border: 1px solid var(--portal-line); border-radius: 10px; outline: none; padding: 12px 13px; color: var(--portal-text); background: rgba(255,255,255,.055); font: inherit; }
.portal-form input:focus, .project-form input:focus, .project-form textarea:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(100, 213, 232, .12); }
.portal-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 0; border-radius: 11px; padding: 0 18px; color: #11132d; background: linear-gradient(135deg, var(--portal-cyan), #b4a9ff); cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }
.portal-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.portal-button.compact { min-height: 40px; padding: 0 14px; font-size: .88rem; }
.portal-button.button-secondary { border: 1px solid var(--portal-line); color: var(--portal-text); background: rgba(255,255,255,.025); }
.link-button { width: 100%; }
.auth-switch, .portal-back { color: var(--portal-muted); font-size: .9rem; text-align: center; }
.auth-switch a, .portal-back a { color: var(--portal-cyan); font-weight: 750; }
.portal-back { margin: 0; }
.form-feedback { min-height: 20px; margin: 0; color: var(--portal-muted); font-size: .86rem; }
.form-feedback.is-error { color: var(--portal-danger); }
.form-feedback.is-success { color: #91edb9; }
.captcha-box { display: flex; min-height: 65px; align-items: center; margin-top: 2px; }
.captcha-help { margin: -7px 0 0; color: var(--portal-muted, #63718a); font-size: .72rem; line-height: 1.35; }
.captcha-help.is-warning { padding: 9px 11px; border: 1px solid #f6d88b; border-radius: 8px; color: #7a5b00; background: #fff9df; }
.integration-inline-note { margin: 0; color: var(--portal-muted); font-size: .76rem; line-height: 1.45; }
.result-card { text-align: center; }
.result-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; place-items: center; border-radius: 18px; font-size: 1.8rem; font-weight: 900; }
.result-success { color: #0e422b; background: #91edb9; }
.result-error { color: #501d1d; background: #ff9a9a; }
.dashboard-topbar { border-bottom: 1px solid var(--portal-line); background: rgba(9, 13, 32, .72); }
.dashboard-nav { display: flex; min-height: 76px; align-items: center; justify-content: space-between; }
.dashboard-user { display: flex; align-items: center; gap: 14px; color: var(--portal-muted); font-size: .9rem; }
.text-button { padding: 0; border: 0; color: var(--portal-cyan); background: none; cursor: pointer; font: inherit; font-weight: 750; }
.dashboard-main { padding: 64px 0 90px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.dashboard-heading h1 { margin: 9px 0 5px; font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; letter-spacing: -.06em; }
.dashboard-heading p { margin: 0; color: var(--portal-muted); }
.project-filter-bar { display:flex; align-items:center; gap:10px; margin:-12px 0 22px; color:var(--portal-muted); font-size:.9rem; }
.project-filter-bar select { min-width:170px; padding:9px 32px 9px 12px; border:1px solid var(--portal-border); border-radius:9px; background:#fff; color:var(--portal-ink); }
.video-projects-section { margin-top: 30px; }
.video-projects-section[hidden] { display: none !important; }
.video-projects-heading { display:flex; align-items:end; justify-content:space-between; gap:18px; margin-bottom:14px; }
.video-projects-heading h2 { margin:4px 0 4px; color:var(--lumina-ink, var(--portal-ink)); font-family:Georgia, "Times New Roman", serif; font-size:1.5rem; }
.video-projects-heading p { margin:0; color:var(--lumina-muted, var(--portal-muted)); font-size:.88rem; }
.video-project-card .project-card-number { color:#5c31c7; background:#f0eaff; }
.video-projects-empty { grid-column:1 / -1; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.project-form-card { margin-bottom: 22px; padding: 24px; border: 1px solid var(--portal-line); border-radius: 18px; background: var(--portal-surface); }
.form-actions { display: flex; align-items: center; gap: 15px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card[hidden] { display: none !important; }
.project-card, .empty-state { min-height: 190px; padding: 22px; border: 1px solid var(--portal-line); border-radius: 18px; background: rgba(20, 26, 52, .72); }
.project-card-link { display: block; color: inherit; text-decoration: none; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.project-card-link:hover { border-color: rgba(100, 213, 232, .52); background: rgba(28, 36, 72, .86); transform: translateY(-2px); }
.project-card h2 { margin: 23px 0 8px; font-size: 1.15rem; }
.project-card p { min-height: 44px; margin: 0 0 19px; color: var(--portal-muted); font-size: .9rem; }
.project-card small { color: #7f88a8; }
.project-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #0f2b2c; background: var(--portal-cyan); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.project-length { display: block; margin-top: 8px; color: var(--portal-muted); font-size: .82rem; }
.editorial-profile-badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; color: var(--portal-muted); background: rgba(173,187,255,.12); font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.editorial-profile-badge.is-children { color: #6b3a0c; background: #ffe5a8; }
.project-length-setting { display: grid; gap: 5px; padding: 11px 13px; border: 1px solid var(--portal-line); border-radius: 10px; color: var(--portal-text); background: rgba(255,255,255,.035); font-size: .88rem; }
.project-length-setting span, .project-length-setting small { color: var(--portal-muted); font-weight: 500; }
.empty-state { display: grid; grid-column: 1 / -1; justify-items: start; align-content: center; gap: 10px; }
.empty-state strong { font-size: 1.15rem; }
.empty-state span { max-width: 480px; color: var(--portal-muted); }
.admin-main { padding: 52px 0 90px; }
.admin-heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 12px; background: rgba(9, 13, 32, .26); }
.admin-user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: end; }
.admin-invite-card { margin-bottom: 16px; }
.admin-invite-form { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr) auto; gap: 12px; align-items: end; }
.admin-invite-form label { display: grid; gap: 6px; color: var(--portal-muted); font-size: .76rem; font-weight: 750; }
.admin-invite-form input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 9px 11px; border: 1px solid rgba(173, 187, 255, .2); border-radius: 9px; color: var(--portal-text); background: rgba(9, 13, 32, .6); font: inherit; }
.admin-invite-form .form-feedback { grid-column: 1 / -1; }
.account-profile-card { max-width: 640px; }
.profile-section-heading { margin: 16px 0 4px; padding-top: 16px; border-top: 1px solid var(--border, #d7e2ea); }
.profile-section-heading h2 { margin: 0 0 5px; font-size: 1.05rem; }
.profile-section-heading p { margin: 0 0 12px; color: #64748b; font-size: .9rem; line-height: 1.45; }
.account-profile-card small { color: #64748b; font-weight: 400; }
.admin-user-main { display: grid; gap: 4px; min-width: 0; }
.admin-user-main strong, .admin-user-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-main span, .admin-user-status { color: var(--portal-muted); font-size: .8rem; }
.operation-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.operation-card { display: grid; gap: 6px; min-height: 132px; padding: 18px; border: 1px solid var(--portal-line); border-radius: 16px; background: rgba(20, 26, 52, .78); }
.usage-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.usage-summary-grid .operation-card { min-height: 118px; }
.usage-card { display: grid; gap: 12px; }
.usage-table { display: grid; gap: 8px; }
.usage-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; padding: 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.usage-row > div { display: grid; gap: 3px; min-width: 0; }
.usage-row strong { color: var(--portal-text); font-size: .82rem; }
.usage-row span, .usage-row small { color: var(--portal-muted); font-size: .74rem; }
.usage-row b { color: var(--portal-cyan); font-size: .85rem; }
.usage-row small { grid-column: 1 / -1; }
.backup-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.backup-latest { display: block; overflow: hidden; color: var(--portal-cyan); font-size: 1.15rem; line-height: 1.15; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.backup-list { display: grid; gap: 8px; max-height: 560px; overflow: auto; }
.backup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.backup-row > div { display: grid; gap: 4px; min-width: 0; }
.backup-row strong { overflow: hidden; color: var(--portal-text); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.backup-row span, .backup-row small { color: var(--portal-muted); font-size: .74rem; }
.backup-row small { grid-column: 1 / -1; }
.security-card { display: grid; gap: 16px; max-width: 780px; }
.account-main { padding: 52px 0 90px; }
.account-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.account-security-grid .security-card { max-width: none; }
.security-card h3 { margin: 4px 0 0; color: var(--portal-text); font-size: 1rem; }
.security-lead, .security-note p { margin: 0; color: var(--portal-muted); font-size: .86rem; line-height: 1.55; }
.security-state { display: grid; gap: 4px; padding: 14px; border: 1px solid rgba(103, 215, 238, .2); border-radius: 12px; background: rgba(9, 13, 32, .3); }
.security-state strong { color: var(--portal-text); font-size: .88rem; }
.security-state span { color: var(--portal-muted); font-size: .78rem; line-height: 1.45; }
.security-setup { display: grid; gap: 12px; padding-top: 4px; border-top: 1px solid var(--portal-line); }
.security-setup label { display: grid; gap: 6px; color: var(--portal-muted); font-size: .76rem; font-weight: 750; }
.security-setup input, .security-setup textarea { width: 100%; box-sizing: border-box; padding: 10px 11px; border: 1px solid rgba(173, 187, 255, .2); border-radius: 9px; color: var(--portal-text); background: rgba(9, 13, 32, .6); font: .78rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.security-setup textarea { resize: vertical; overflow-wrap: anywhere; }
.recovery-codes { display: grid; gap: 8px; padding: 14px; border: 1px solid rgba(113, 226, 167, .35); border-radius: 12px; background: rgba(40, 151, 104, .09); }
.recovery-codes p { margin: 0; color: var(--portal-muted); font-size: .8rem; line-height: 1.45; }
.recovery-codes code { display: grid; gap: 4px; color: var(--portal-cyan); font: .84rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.two-factor-login-form { display: grid; gap: 14px; }
.two-factor-login-form[hidden] { display: none; }
.system-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.system-state { color: var(--portal-cyan); font-size: 1.25rem; }
.system-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.system-check-list { display: grid; gap: 8px; }
.system-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 10px; background: rgba(9, 13, 32, .24); }
.system-check > div { display: grid; gap: 3px; min-width: 0; }
.system-check strong { color: var(--portal-text); font-size: .8rem; }
.system-check span { color: var(--portal-muted); font-size: .74rem; overflow-wrap: anywhere; }
.system-check b { color: var(--portal-danger); font-size: .7rem; }
.system-check.is-ready b { color: var(--portal-success); }
.system-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.system-metric-list { display: grid; gap: 8px; }
.system-metric-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(173, 187, 255, .1); }
.system-metric-list > div:last-child { border-bottom: 0; }
.system-metric-list span { color: var(--portal-muted); font-size: .75rem; text-transform: capitalize; }
.system-metric-list strong { color: var(--portal-cyan); font-size: .78rem; text-align: right; }
.operation-card small { color: var(--portal-muted); font-size: .76rem; line-height: 1.35; }
.operation-number { color: var(--portal-cyan); font-size: 2.5rem; line-height: 1; letter-spacing: -.06em; }
.operation-danger { color: var(--portal-danger); }
.operations-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.operation-list { display: grid; gap: 8px; }
.operation-job { display: grid; gap: 7px; padding: 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.operation-job header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.operation-job strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-main .operation-job strong { overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.operation-job small { color: var(--portal-muted); font-size: .74rem; }
.operation-error { margin: 0; color: var(--portal-danger); font-size: .76rem; line-height: 1.4; overflow-wrap: anywhere; }
.worker-state { padding: 5px 9px; border-radius: 999px; color: #0e422b; background: var(--ds-success, #91edb9); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.worker-state[data-state="waiting"] { color: #493707; background: var(--ds-warning, #f6d88b); }
.worker-state[data-state="idle"] { color: var(--portal-muted); background: rgba(173, 187, 255, .18); }
.operation-help { display: grid; gap: 12px; }
.operation-help h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
.operation-help p { margin: 0; color: var(--portal-muted); font-size: .84rem; line-height: 1.55; }
.operation-help label { color: var(--portal-muted); font-size: .75rem; font-weight: 750; }
.operation-code { display: block; overflow-x: auto; padding: 11px 12px; border: 1px solid rgba(100, 213, 232, .2); border-radius: 10px; color: var(--portal-cyan); background: rgba(9, 13, 32, .55); font: .74rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.operation-help .muted-label code { color: var(--portal-cyan); }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.integration-card { display: grid; gap: 15px; }
.integration-indicator { padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.integration-indicator.is-configured { color: #0e422b; background: var(--ds-success, #91edb9); }
.integration-indicator.is-missing { color: #501d1d; background: var(--ds-danger, #ff9a9a); }
.integration-indicator.is-pending { color: #5b4510; background: var(--ds-warning, #f6d88b); }
.config-list { display: grid; gap: 9px; margin: 0; }
.config-list div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(173, 187, 255, .1); }
.config-list dt { color: var(--portal-muted); font-size: .76rem; }
.config-list dd { overflow: hidden; margin: 0; color: var(--portal-text); font-size: .81rem; text-overflow: ellipsis; white-space: nowrap; }
.integration-test-form { display: grid; gap: 10px; }
.integration-test-form label { display: grid; gap: 7px; color: var(--portal-muted); font-size: .82rem; font-weight: 700; }
.integration-test-form input { width: 100%; border: 1px solid var(--portal-line); border-radius: 10px; outline: none; padding: 11px 12px; color: var(--portal-text); background: rgba(255,255,255,.055); font: inherit; }
.integration-test-form input:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(100, 213, 232, .12); }
.integration-note { margin-top: 18px; }
.integration-note p { margin: 8px 0 0; color: var(--portal-muted); font-size: .86rem; line-height: 1.6; }
.integration-note code { color: var(--portal-cyan); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.integration-audit { margin-top: 18px; }
.audit-list { display: grid; gap: 8px; }
.audit-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; padding: 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.audit-item > div { display: grid; gap: 3px; min-width: 0; }
.audit-item strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-item span, .audit-item small { color: var(--portal-muted); font-size: .74rem; }
.audit-item small { grid-column: 1 / -1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-item p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--portal-danger); font-size: .78rem; line-height: 1.4; overflow-wrap: anywhere; }
.audit-status { align-self: start; padding: 4px 8px; border-radius: 999px; color: #501d1d; background: var(--ds-danger, #ff9a9a); font-size: .66rem !important; font-weight: 850; text-transform: uppercase; }
.audit-status.is-success { color: #0e422b; background: var(--ds-success, #91edb9); }
.audit-filter-card { margin-bottom: 18px; }
.audit-filter-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.audit-filter-form label { display: grid; min-width: min(100%, 310px); gap: 7px; color: var(--portal-muted); font-size: .8rem; font-weight: 700; }
.audit-filter-form select { min-height: 42px; border: 1px solid var(--portal-line); border-radius: 10px; padding: 0 12px; color: var(--portal-text); background: rgba(255,255,255,.055); font: inherit; }
.audit-table { display: grid; gap: 8px; }
.audit-table-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.audit-table-main { display: grid; gap: 4px; min-width: 0; }
.audit-table-main strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-table-main span { color: var(--portal-muted); font-size: .74rem; overflow-wrap: anywhere; }
.audit-table-row code { grid-column: 1 / -1; color: var(--portal-cyan); font: .73rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-table-row p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--portal-danger); font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; }
.workspace-main { padding: 52px 0 90px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.workspace-heading h1 { margin: 10px 0 6px; font-size: clamp(2.1rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -.06em; }
.workspace-heading p { max-width: 720px; margin: 0; color: var(--portal-muted); }
.workspace-steps { display: grid; grid-template-columns: repeat(9, minmax(74px, 1fr)); gap: 6px; margin-bottom: 24px; padding: 7px; overflow-x: auto; border: 1px solid var(--portal-line); border-radius: 16px; background: rgba(20, 26, 52, .62); scrollbar-width: thin; }
.workspace-step { display: grid; min-height: 54px; align-content: center; justify-items: center; gap: 3px; border-radius: 10px; color: var(--portal-muted); font-size: .68rem; font-weight: 800; text-align: center; text-decoration: none; white-space: nowrap; transition: color .18s ease, background .18s ease, transform .18s ease; }
.workspace-step span { color: #7f88a8; font-size: .64rem; letter-spacing: .08em; }
.workspace-step:hover, .workspace-step.is-current { color: var(--portal-text); background: rgba(100, 213, 232, .12); transform: translateY(-1px); }
.workspace-step.is-current span { color: var(--portal-cyan); }
.workspace-step.is-complete span::after { content: none; }
.workspace-step.is-locked { opacity: .48; }
.workspace-step.is-locked:hover { transform: none; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr); align-items: start; gap: 18px; }
.workspace-content, .workspace-sidebar { display: grid; gap: 18px; }
.workspace-card { padding: 24px; border: 1px solid var(--portal-line); border-radius: 18px; background: rgba(20, 26, 52, .78); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.card-heading h2, .ai-card h2 { margin: 8px 0 0; font-size: 1.25rem; letter-spacing: -.03em; }
.muted-label { color: var(--portal-muted); font-size: .78rem; }
.chapter-add-form { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) auto; gap: 9px; }
.chapter-add-form[hidden] { display: none; }
.chapter-heading-actions { display: flex; align-items: center; gap: 12px; }
.chapter-add-form input, .workspace-input { width: 100%; min-width: 0; border: 1px solid var(--portal-line); border-radius: 10px; outline: none; padding: 11px 12px; color: var(--portal-text); background: rgba(255,255,255,.055); font: inherit; }
.chapter-add-form input:focus, .workspace-input:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(100, 213, 232, .12); }
.chapter-list { display: grid; gap: 9px; margin-top: 5px; }
.chapter-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 13px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 12px; background: rgba(9, 13, 32, .25); }
.chapter-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #11132d; background: var(--portal-cyan); font-size: .75rem; font-weight: 900; }
.chapter-main { display: grid; gap: 4px; min-width: 0; }
.chapter-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-main span { overflow: hidden; color: var(--portal-muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.chapter-empty { padding: 15px 0 4px; color: var(--portal-muted); font-size: .88rem; }
.chapter-editor { display: grid; grid-column: 2 / -1; gap: 9px; padding-top: 7px; }
.chapter-editor label { display: grid; gap: 6px; color: var(--portal-muted); font-size: .78rem; font-weight: 700; }
.chapter-editor textarea { width: 100%; resize: vertical; min-height: 120px; border: 1px solid var(--portal-line); border-radius: 10px; outline: none; padding: 11px 12px; color: var(--portal-text); background: rgba(255,255,255,.045); font: .86rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.chapter-editor textarea:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(100, 213, 232, .12); }
.rich-editor-toolbar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 7px; border: 1px solid var(--portal-line); border-bottom: 0; border-radius: 10px 10px 0 0; background: rgba(9, 13, 32, .3); }
.rich-editor-toolbar .text-button { padding: 5px 8px; border-radius: 7px; color: var(--portal-muted); font-size: .74rem; }
.rich-editor-toolbar .text-button:hover { color: var(--portal-text); background: rgba(100, 213, 232, .12); }
.rich-editor { min-height: 210px; border: 1px solid var(--portal-line); border-radius: 0 0 10px 10px; outline: none; padding: 14px; color: var(--portal-text); background: rgba(255,255,255,.045); font: .92rem/1.65 Inter, ui-sans-serif, system-ui, sans-serif; }
.rich-editor:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(100, 213, 232, .12); }
.rich-editor:empty::before { content: attr(data-placeholder); color: #7f88a8; pointer-events: none; }
.rich-editor h2, .rich-editor h3, .rich-editor h4 { margin: 1em 0 .45em; line-height: 1.2; }
.rich-editor p { margin: .5em 0; }
.rich-editor table, .book-preview-chapter table { width: 100%; margin: 1.2em 0 1.8em; border-collapse: collapse; font-size: .92em; line-height: 1.4; }
.rich-editor th, .rich-editor td, .book-preview-chapter th, .book-preview-chapter td { padding: 8px 10px; border: 1px solid #cbd5e1; text-align: left; vertical-align: top; }
.rich-editor th, .book-preview-chapter th { color: #234d6f; background: #eef4f8; font-weight: 700; }
.rich-editor blockquote { margin: .8em 0; padding-left: 14px; border-left: 3px solid var(--portal-cyan); color: var(--portal-muted); }
.autosave-status.is-error { color: var(--portal-danger); }
.autosave-status.is-success { color: #91edb9; }
.version-history { margin-top: 10px; border-top: 1px solid rgba(173, 187, 255, .12); padding-top: 10px; }
.version-history summary { color: var(--portal-cyan); cursor: pointer; font-size: .78rem; font-weight: 750; }
.version-history > div { display: grid; gap: 7px; margin-top: 9px; }
.version-history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid rgba(173, 187, 255, .1); border-radius: 9px; background: rgba(9, 13, 32, .22); }
.version-history-item div { display: grid; gap: 3px; min-width: 0; }
.version-history-item strong { font-size: .78rem; }
.version-history-item small { color: var(--portal-muted); font-size: .7rem; }
.chapter-editor-actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.output-card { display: grid; gap: 15px; }
.output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.output-block { display: grid; align-content: start; gap: 9px; min-width: 0; padding: 14px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 12px; background: rgba(9, 13, 32, .26); }
.output-block h3 { margin: 0; color: var(--portal-text); font-size: .95rem; }
.output-line { display: grid; gap: 3px; }
.output-line strong { color: var(--portal-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.output-line span { color: var(--portal-text); font-size: .82rem; line-height: 1.45; white-space: pre-wrap; }
.output-list { display: grid; gap: 6px; margin: 0; padding-left: 17px; color: var(--portal-muted); font-size: .8rem; line-height: 1.4; }
.output-list a { color: var(--portal-cyan); }
.generated-files-intro { margin: -4px 0 0; color: var(--portal-muted); font-size: .8rem; }
.generated-files-list { display: grid; gap: 8px; }
.generated-file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 10px; background: rgba(9, 13, 32, .2); }
.generated-file-details { display: grid; gap: 3px; min-width: 0; }
.generated-file-details strong { overflow: hidden; color: var(--portal-text); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.generated-file-meta { overflow: hidden; color: var(--portal-muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.generated-file-error { color: var(--portal-danger); font-size: .72rem; line-height: 1.35; }
.generated-file-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.generated-file-status { padding: 4px 8px; border-radius: 999px; color: var(--portal-muted); background: rgba(173, 187, 255, .12); font-size: .66rem; font-weight: 750; text-transform: uppercase; }
.generated-file-status.is-completed { color: #0e422b; background: #91edb9; }
.generated-file-status.is-failed { color: #7d2525; background: #ffd0d0; }
.generated-file-download { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; text-decoration: none; }
.generated-file-download [data-icon] { width: 1em; height: 1em; }
.output-group { display: grid; gap: 6px; }
.output-group > strong, .output-line-header > strong { color: var(--portal-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.output-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.output-badges span { padding: 4px 7px; border: 1px solid rgba(103, 215, 238, .24); border-radius: 999px; color: var(--portal-cyan); background: rgba(103, 215, 238, .08); font-size: .72rem; }
.output-status-line { display: flex; align-items: center; gap: 8px; }
.output-status { padding: 4px 8px; border-radius: 999px; font-size: .66rem; font-weight: 850; text-transform: uppercase; }
.output-status.is-approved { color: #0e422b; background: var(--ds-success, #91edb9); }
.output-status.is-pending { color: #5b4510; background: var(--ds-warning, #f6d88b); }
.output-status-line small { color: var(--portal-muted); font-size: .72rem; }
.output-score-line { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; align-items: center; gap: 8px; }
.output-score-line strong { color: var(--portal-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.output-score-line b { color: var(--portal-text); font-size: .8rem; }
.output-score-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(173, 187, 255, .14); }
.output-score-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--portal-cyan), var(--portal-lilac)); }
.output-competitors, .output-personas { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.output-competitors article, .output-personas article { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 9px; background: rgba(9, 13, 32, .2); }
.output-competitors article > b, .output-personas article > b { color: var(--portal-text); font-size: .8rem; }
.output-competitors .output-list, .output-personas .output-list { font-size: .76rem; }
.output-line-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.output-copy-line > span { max-height: 190px; overflow: auto; }
.output-copy { flex: 0 0 auto; font-size: .7rem; }
.portal-button-small { min-height: 34px; padding: 8px 12px; font-size: .78rem; }
.review-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; margin: 0; padding: 11px 12px; border-top: 1px solid rgba(148, 163, 184, .22); line-height: 1.45; }
.review-note:first-child { border-top: 0; }
.review-note:nth-child(even) { background: rgba(248, 250, 252, .7); }
.review-note span { min-width: 0; }
.review-note-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.review-note-ai-button { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--lumina-purple); }
.review-note-ai-button .ui-icon, .review-note-ai-all .ui-icon { width: 14px; height: 14px; }
.review-note-status { width: 106px; padding: 4px 6px; border: 1px solid rgba(173, 187, 255, .2); border-radius: 6px; color: var(--portal-text); background: rgba(9, 13, 32, .36); font-size: .7rem; }
.review-notes-locked { margin: 0 0 10px; padding: 9px 11px; border: 1px solid #ccebd9; border-radius: 8px; color: #166534; background: #f0fdf4; font-size: .78rem; }
.review-note-resolved, .review-note-accepted { opacity: .68; }
.output-review { grid-column: 1 / -1; }
.review-note-bulk-actions { display: flex; align-items: center; justify-content: flex-end; margin: 4px 0 2px; padding: 10px 12px; border: 1px solid var(--lumina-line); border-radius: 9px; background: #fafbfc; }
.review-note-bulk-actions .review-note-ai-all { margin-right: auto; }
.review-note-bulk-actions label { display: flex; align-items: center; gap: 10px; color: var(--lumina-ink); font-size: .76rem; font-weight: 700; }
.review-note-bulk-status { width: 148px; }
.output-marketing { grid-column: 1 / -1; gap: 16px; }
.marketing-intro { margin: -4px 0 2px; color: var(--lumina-muted); font-size: .82rem; line-height: 1.45; }
.marketing-guidance-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.marketing-guidance-card { gap: 7px; }
.marketing-guidance-card h4 { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--lumina-ink); font-size: .84rem; }
.marketing-guidance-card .reference-card-icon { display: inline-grid; width: 24px; height: 24px; place-items: center; color: #6337d8; border-radius: 8px; background: #f0ebff; }
.marketing-guidance-hint { margin: 0 0 4px; color: var(--lumina-muted); font-size: .75rem; line-height: 1.4; }
.marketing-guidance-empty { margin: 0; color: var(--lumina-muted); font-size: .78rem; line-height: 1.45; }
.marketing-category-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.marketing-category-list li { padding: 5px 10px; color: #5530be; border-radius: 999px; background: #f0ebff; font-size: .75rem; line-height: 1.35; }
.marketing-keyword-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: marketing-keyword; }
.marketing-keyword-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 7px 9px; border: 1px solid var(--lumina-line); border-radius: 8px; background: #fff; color: var(--lumina-muted); font-size: .78rem; line-height: 1.35; counter-increment: marketing-keyword; }
.marketing-keyword-list li::before { content: counter(marketing-keyword) '.'; flex: 0 0 auto; color: #6337d8; font-weight: 750; }
.marketing-keyword-list li > span { flex: 1 1 auto; min-width: 0; }
.marketing-keyword-list .output-copy { flex: 0 0 auto; }
.marketing-copy-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.marketing-material-card { display: grid; align-content: start; gap: 9px; min-width: 0; padding: 16px; border: 1px solid var(--lumina-line); border-radius: 12px; background: var(--lumina-surface-soft); }
.marketing-material-card .output-line { gap: 8px; }
.marketing-material-card .output-line-header strong { color: var(--lumina-ink); font-size: .78rem; letter-spacing: 0; text-transform: none; }
.marketing-material-card .output-line > span { max-height: none; overflow: visible; color: var(--lumina-muted); font-size: .8rem; line-height: 1.55; }
.marketing-social-card { grid-column: 1 / -1; }
.marketing-social-card h4 { margin: 0; color: var(--lumina-ink); font-size: .84rem; }
.marketing-posts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.marketing-posts-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--lumina-line); border-radius: 10px; background: #fff; color: var(--lumina-muted); font-size: .78rem; line-height: 1.45; }
.marketing-posts-list li > span { min-width: 0; }
.marketing-posts-list .output-copy { flex: 0 0 auto; }
@media (max-width: 900px) { .marketing-guidance-sections, .marketing-copy-sections { grid-template-columns: 1fr; } .marketing-posts-list { grid-template-columns: 1fr; } }
.ai-card { display: grid; gap: 11px; }
.ai-card p { margin: 0 0 4px; color: var(--portal-muted); font-size: .87rem; line-height: 1.55; }
.workspace-input { margin-bottom: 3px; }
.workspace-action { width: 100%; min-height: 42px; }
.export-card { display: grid; gap: 10px; }
.export-card h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
.export-card p { margin: 0; color: var(--portal-muted); font-size: .87rem; line-height: 1.55; }
.export-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.export-actions .portal-button { min-height: 39px; padding: 0 8px; }
.export-format-note { margin: 0; color: var(--portal-muted); font-size: .78rem; line-height: 1.45; }
.preview-main { padding: 52px 0 90px; }
.preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.preview-heading h1 { margin: 9px 0 6px; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -.06em; }
.preview-heading p { max-width: 720px; margin: 0; color: var(--portal-muted); }
.preview-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.preview-readiness { padding: 7px 10px; border-radius: 999px; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.preview-readiness.is-ready { color: #0e422b; background: var(--ds-success, #91edb9); }
.preview-readiness.is-pending { color: #493707; background: var(--ds-warning, #f6d88b); }
.preview-checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.preview-checklist article { display: flex; align-items: center; gap: 11px; padding: 15px; border: 1px solid var(--portal-line); border-radius: 14px; background: rgba(20, 26, 52, .78); }
.preview-checklist article > strong { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; font-size: .8rem; }
.preview-checklist article > strong.is-check { color: #0e422b; background: var(--ds-success, #91edb9); }
.preview-checklist article > strong.is-pending { color: #493707; background: var(--ds-warning, #f6d88b); }
.preview-checklist article div { display: grid; gap: 3px; min-width: 0; }
.preview-checklist article b { font-size: .82rem; }
.preview-checklist article span { color: var(--portal-muted); font-size: .74rem; line-height: 1.35; }
.book-preview { width: min(860px, 100%); margin: 0 auto 18px; padding: clamp(24px, 5vw, 58px); border: 1px solid rgba(173, 187, 255, .22); border-radius: 10px; color: #24344a; background: #fcfdff; box-shadow: 0 25px 75px rgba(0,0,0,.2); }
.book-preview-cover { display: block; width: min(100%, 310px); max-height: 430px; margin: 0 auto 34px; object-fit: cover; border-radius: 5px; box-shadow: 0 12px 35px rgba(17, 29, 48, .22); }
.book-preview-title { padding-bottom: 20px; border-bottom: 1px solid #d7e2ea; text-align: center; }
.book-preview-title .portal-eyebrow { color: #315f82; }
.book-preview-title h2 { margin: 12px 0 8px; color: #234d6f; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -.05em; }
.book-preview-title p { margin: 0; color: #5b6b78; font-size: 1.08rem; }
.book-preview-toc { margin: 28px 0 38px; padding: 18px 26px; border-radius: 8px; color: #304b64; background: #f1f6fa; }
.book-preview-toc strong { color: #234d6f; }
.book-preview-toc ol { margin: 10px 0 0; padding-left: 22px; }
.book-preview-toc li { margin: 5px 0; }
.book-preview-toc a { color: #315f82; text-decoration: none; }
.book-preview-toc a:hover { text-decoration: underline; }
.book-preview-chapter { padding-top: 28px; margin-top: 32px; border-top: 1px solid #d7e2ea; break-before: page; line-height: 1.7; }
.book-preview-chapter:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.book-preview-chapter h3 { margin: 0 0 17px; color: #315f82; font-size: 1.55rem; line-height: 1.2; }
.book-preview-chapter p { margin: .7em 0; }
.book-preview-chapter blockquote { margin: 1em 0; padding-left: 16px; border-left: 4px solid #4682B4; color: #526477; }
.book-preview-chapter a { color: #234d6f; }
.book-preview-illustration { margin: 24px auto 28px; text-align: center; break-inside: avoid; }
.book-preview-illustration img { display: block; width: min(100%, 560px); max-height: 380px; margin: 0 auto 8px; object-fit: cover; border-radius: 10px; box-shadow: 0 8px 24px rgba(17,29,48,.14); }
.book-preview-illustration figcaption { color: #64748b; font-size: .86rem; font-style: italic; }
.preview-missing { padding: 14px; border-radius: 7px; color: #755b19; background: #fff5d8; }
.preview-export-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.preview-export-card h2 { margin: 7px 0 4px; font-size: 1.2rem; }
.preview-export-card p { margin: 0; color: var(--portal-muted); font-size: .82rem; line-height: 1.5; }
.preview-export-card .export-actions { width: min(520px, 100%); }
.preview-link { display: inline-block; margin-bottom: 2px; }
.commercial-release-card { display: grid; gap: 12px; margin-bottom: 18px; }
.commercial-release-description { max-width: 760px; margin: 0; color: var(--portal-muted); font-size: .84rem; line-height: 1.55; }
.commercial-release-status { padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.commercial-release-status.is-finalized { color: #0e422b; background: var(--ds-success, #91edb9); }
.commercial-release-status.is-draft { color: #5b4510; background: var(--ds-warning, #f6d88b); }
.commercial-release-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; color: var(--portal-muted); font-size: .78rem; }
.commercial-release-meta strong { color: var(--portal-text); }
.commercial-release-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.commercial-release-history { display: grid; gap: 7px; padding-top: 5px; border-top: 1px solid rgba(173, 187, 255, .12); }
.commercial-release-history > strong { color: var(--portal-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.job-list { display: grid; gap: 8px; }
.job-item { display: grid; gap: 7px; padding: 11px 12px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 11px; background: rgba(9, 13, 32, .26); }
.job-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-item strong { overflow: hidden; color: var(--portal-text); font-size: .82rem; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.job-item small { color: var(--portal-muted); font-size: .75rem; }
.job-status { padding: 3px 7px; border-radius: 999px; color: #11132d; background: #b9bed3; font-size: .66rem; font-weight: 850; text-transform: uppercase; }
.job-queued, .job-pending, .job-retry_wait { background: #f6d88b; }
.job-running, .job-processing { background: var(--portal-cyan); }
.activity-card { display: grid; gap: 12px; }
.activity-list { display: grid; gap: 8px; max-height: 480px; overflow: auto; }
.activity-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 11px; border: 1px solid rgba(173, 187, 255, .12); border-radius: 10px; background: rgba(9, 13, 32, .24); }
.activity-item > div { display: grid; gap: 3px; min-width: 0; }
.activity-item strong { overflow: hidden; color: var(--portal-text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span, .activity-item small { color: var(--portal-muted); font-size: .7rem; }
.activity-item small { text-transform: uppercase; }
.activity-item p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--portal-muted); font-size: .74rem; line-height: 1.35; overflow-wrap: anywhere; }
.job-completed, .job-succeeded { background: #91edb9; }
.job-failed { color: #501d1d; background: #ff9a9a; }
.job-cancelled { color: #475467; background: #e4e7ec; }
.job-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.job-cancel { color: #b42318; font-size: .74rem; }
.job-error-message { margin: 2px 0 0; color: #b42318; font-size: .74rem; line-height: 1.35; }
.queue-policy { margin: -3px 0 2px; color: var(--lumina-muted); font-size: .76rem; line-height: 1.4; }
@media (max-width: 980px) { .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .operation-summary-grid, .system-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 840px) { .workspace-steps { grid-template-columns: repeat(9, minmax(88px, 1fr)); } .workspace-grid { grid-template-columns: 1fr; } .workspace-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .integration-grid { grid-template-columns: 1fr; } .operations-layout, .system-layout { grid-template-columns: 1fr; } .system-detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .portal-shell { width: min(100% - 28px, 1120px); } .project-grid { grid-template-columns: 1fr; } .dashboard-heading { align-items: start; flex-direction: column; } }
@media (max-width: 900px) { .usage-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .backup-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .workspace-heading { align-items: start; flex-direction: column; } .workspace-sidebar { grid-template-columns: 1fr; } .chapter-add-form { grid-template-columns: 1fr; } .chapter-row { grid-template-columns: 36px minmax(0, 1fr); } .chapter-row .text-button { grid-column: 2; justify-self: start; } .chapter-editor { grid-column: 2; } .output-grid { grid-template-columns: 1fr; } .output-competitors, .output-personas { grid-template-columns: 1fr; } .output-score-line { grid-template-columns: 1fr auto; } .output-score-track { grid-column: 1 / -1; grid-row: 2; } .admin-heading-actions { align-items: stretch; flex-direction: column; width: 100%; } .admin-heading-actions .portal-button { width: 100%; } .admin-user-row { grid-template-columns: 1fr auto; } .admin-user-status { grid-column: 1; } .admin-user-actions { grid-column: 1 / -1; justify-content: start; } .admin-invite-form { grid-template-columns: 1fr; align-items: stretch; } .admin-invite-form .form-feedback { grid-column: auto; } .operation-summary-grid, .usage-summary-grid, .backup-summary-grid, .system-summary-grid { grid-template-columns: 1fr 1fr; } .account-security-grid { grid-template-columns: 1fr; } .preview-heading { align-items: start; flex-direction: column; } .preview-heading-actions { align-items: stretch; width: 100%; } .preview-heading-actions .portal-button { width: 100%; } .preview-checklist { grid-template-columns: 1fr; } .preview-export-card { grid-template-columns: 1fr; } .preview-export-card .export-actions { width: 100%; } }
@media (max-width: 620px) { .generated-file-row { grid-template-columns: 1fr; } .generated-file-actions { justify-content: space-between; } .generated-file-meta { white-space: normal; } }
@media (max-width: 460px) { .auth-card { padding: 24px; } .dashboard-nav { min-height: 68px; } .dashboard-user span { display: none; } }

/* LuminaBook visual language — v2.26. The existing components remain the
   functional source of truth; this layer maps them to the approved light UI. */
:root {
    --lumina-bg: #f6f7f9;
    --lumina-surface: #ffffff;
    --lumina-surface-soft: #f2f3f6;
    --lumina-ink: #111827;
    --lumina-muted: #62708a;
    --lumina-line: #dce1ea;
    --lumina-purple: #6738d5;
    --lumina-purple-dark: #5424bf;
    --lumina-lilac: #eee9ff;
    --lumina-green: #16a34a;
    --lumina-yellow: #f4b400;
    --lumina-red: #ef4444;
    --lumina-blue: #3b82f6;
    --portal-bg: var(--lumina-bg);
    --portal-surface: var(--lumina-surface);
    --portal-line: var(--lumina-line);
    --portal-text: var(--lumina-ink);
    --portal-muted: var(--lumina-muted);
    --portal-accent: var(--lumina-purple);
    --portal-cyan: var(--lumina-purple);
    --portal-danger: var(--lumina-red);
}

body.portal-page {
    color: var(--lumina-ink);
    background: var(--lumina-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}
body.portal-page h1, body.portal-page h2, body.portal-page h3,
body.portal-page .plan-name, body.portal-page .docs-content h1,
body.portal-page .docs-content h2, body.portal-page .lumina-display {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--lumina-ink);
    letter-spacing: -.035em;
}
.lumina-topbar, .dashboard-topbar {
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid var(--lumina-line);
    background: rgba(255,255,255,.96);
    box-shadow: 0 1px 0 rgba(17,24,39,.02);
}
.dashboard-nav { min-height: 60px; gap: 18px; }
.lumina-brand { gap: 10px; color: var(--lumina-ink); min-width: 190px; }
.lumina-mark { width: 36px; height: 36px; border-radius: 11px; color: var(--lumina-purple); background: var(--lumina-lilac); box-shadow: none; font-size: 1.2rem; }
.ui-icon { display: inline-block; width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; vertical-align: middle; }
.lumina-mark .ui-icon { width: 20px; height: 20px; stroke-width: 1.7; }
.lumina-brand-copy { display: grid; gap: 1px; line-height: 1.05; }
.lumina-brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }
.lumina-brand-copy small { color: var(--lumina-muted); font-size: .55rem; letter-spacing: .14em; }
.app-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.app-nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; color: var(--lumina-muted); font-size: .82rem; text-decoration: none; white-space: nowrap; }
.app-nav-link > .ui-icon { color: inherit; }
.app-nav-link:hover { color: var(--lumina-ink); background: var(--lumina-surface-soft); }
.app-nav-link.is-active { color: #fff; background: var(--lumina-purple); box-shadow: 0 5px 14px rgba(103,56,213,.20); }
.lumina-user { gap: 8px; }
.user-chip { padding: 7px 12px; border-radius: 999px; color: var(--lumina-purple-dark); background: var(--lumina-lilac); font-size: .76rem; text-decoration: none; white-space: nowrap; }
.logout-icon { width: 30px; height: 30px; padding: 0; border: 0; color: var(--lumina-muted); background: transparent; cursor: pointer; font-size: 1.05rem; }
.logout-icon:hover { color: var(--lumina-purple); }
.portal-eyebrow { color: var(--lumina-purple); font-size: .68rem; letter-spacing: .13em; }
.admin-release-badge { color: var(--lumina-purple); border-color: #cbbdff; background: var(--lumina-lilac); }
.portal-button { min-height: 42px; border-radius: 9px; color: #fff; background: var(--lumina-purple); box-shadow: 0 7px 14px rgba(103,56,213,.16); }
.portal-button:hover { background: var(--lumina-purple-dark); filter: none; }
.portal-button.button-secondary { color: var(--lumina-ink); border-color: var(--lumina-line); background: var(--lumina-surface); box-shadow: none; }
.text-button { color: var(--lumina-purple); }
.portal-form input, .project-form input, .project-form textarea, .integration-test-form input,
.security-setup input, .security-setup textarea { color: var(--lumina-ink); border-color: var(--lumina-line); background: #fff; }
.portal-form input:focus, .project-form input:focus, .project-form textarea:focus,
.integration-test-form input:focus { border-color: var(--lumina-purple); box-shadow: 0 0 0 3px rgba(103,56,213,.12); }
.dashboard-main, .workspace-main, .preview-main, .admin-main, .account-main, .plans-main { padding-top: 42px; }
.dashboard-heading, .workspace-heading, .preview-heading { margin-bottom: 26px; }
.dashboard-heading h1, .workspace-heading h1, .preview-heading h1 { color: var(--lumina-ink); font-size: clamp(2rem, 4vw, 3.4rem); }
.dashboard-heading p, .workspace-heading p, .preview-heading p { color: var(--lumina-muted); }
.project-form-card, .workspace-card, .operation-card, .integration-card, .security-card,
.audit-filter-card, .admin-invite-card, .admin-card, .preview-checklist article,
.preview-export-card, .commercial-release-card { border-color: var(--lumina-line); border-radius: 13px; background: var(--lumina-surface); box-shadow: 0 2px 5px rgba(17,24,39,.06); }
.project-card, .empty-state { min-height: 194px; border-color: var(--lumina-line); border-radius: 14px; background: var(--lumina-surface); box-shadow: 0 2px 5px rgba(17,24,39,.05); }
.project-card { position: relative; }
.project-card-link { padding-right: 54px; }
.project-card-actions { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 5px; }
.project-card-actions { z-index: 3; }
.project-card-icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid var(--lumina-line); border-radius: 8px; color: var(--lumina-muted); background: #fff; cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease; }
.project-card-icon-button:hover { color: var(--lumina-purple); border-color: #bdaeff; background: var(--lumina-lilac); transform: translateY(-1px); }
.project-card-icon-button.is-danger:hover { color: #b42318; border-color: #f2b8b5; background: #fff1f0; }
.project-card-icon-button .ui-icon { width: 17px; height: 17px; }
.project-card.is-processing { opacity: .58; pointer-events: none; }
.project-card-link:hover { border-color: #bdaeff; background: #fff; box-shadow: 0 8px 20px rgba(103,56,213,.10); }
.project-card h2 { color: var(--lumina-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.22rem; }
.project-card p, .project-card small { color: var(--lumina-muted); }
.project-status { color: var(--lumina-purple-dark); background: var(--lumina-lilac); }
.project-card-meta, .project-card-progress { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--lumina-muted); font-size: .73rem; }
.project-card-progress { margin-top: 12px; }
.project-card-length { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; color: var(--lumina-muted); font-size: .72rem; }
.project-card-length .ui-icon { width: 14px; height: 14px; color: var(--lumina-purple); }
.project-card-length strong { color: var(--lumina-ink); font-weight: 750; }
.project-progress-line, .progress-track { height: 6px; margin-top: 9px; border-radius: 999px; background: #e8eaf0; }
.project-progress-line span, .progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--lumina-purple); }
.workspace-steps { padding: 4px; border-radius: 999px; background: #eceef2; box-shadow: none; }
.workspace-step { min-height: 31px; border: 0; border-radius: 999px; color: #7b8496; background: transparent; font-size: .76rem; }
.workspace-step:hover, .workspace-step.is-active { color: var(--lumina-ink); background: #fff; box-shadow: 0 1px 4px rgba(17,24,39,.10); }
.workspace-step.is-complete { color: var(--lumina-green); }
.workspace-step.is-complete::before { color: var(--lumina-green); }
.workspace-card h2, .card-heading h2 { color: var(--lumina-ink); }
.muted-label, .workspace-card p, .output-line span, .operation-card small { color: var(--lumina-muted); }
.admin-user-row, .usage-row, .backup-row, .system-check, .operation-job, .audit-item,
.audit-table-row, .job-item, .activity-item { border-color: var(--lumina-line); background: var(--lumina-surface-soft); }
.admin-user-main strong, .operation-job strong, .audit-item strong, .system-check strong { color: var(--lumina-ink); }
.admin-user-main span, .admin-user-status, .usage-row span, .backup-row span, .system-check span { color: var(--lumina-muted); }
.worker-state, .integration-indicator.is-configured, .audit-status.is-success { color: #166534; background: #dcfce7; }
.integration-indicator.is-missing, .job-failed { color: #991b1b; background: #fee2e2; }
.job-queued, .job-pending, .job-retry_wait { color: #92400e; background: #fef3c7; }
.job-running, .job-processing { color: #1d4ed8; background: #dbeafe; }
.job-completed, .job-succeeded { color: #166534; background: #dcfce7; }
.job-cancelled { color: #475467; background: #e4e7ec; }
.book-preview { border-color: var(--lumina-line); box-shadow: 0 12px 35px rgba(17,24,39,.08); }
.preview-readiness.is-ready { color: #166534; background: #dcfce7; }
.preview-readiness.is-pending { color: #92400e; background: #fef3c7; }

/* Progress of the real queue worker. The checklist is deliberately plain so
   a non-technical reader can tell what has happened and what is next. */
.process-progress { display: grid; gap: 10px; margin-top: 18px; padding: 16px; border: 1px solid var(--lumina-line); border-radius: 12px; background: var(--lumina-surface-soft); text-align: left; }
.process-progress-head, .process-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.process-progress-head strong { color: var(--lumina-ink); font-size: .86rem; }
.process-progress-head span { color: var(--lumina-purple); font-size: .8rem; font-weight: 800; }
.process-progress .progress-track { margin-top: 0; height: 8px; }
.process-progress .progress-track span { transition: width .35s ease; }
.process-progress-meta { margin: 0; color: var(--lumina-muted); font-size: .72rem; }
.process-steps { display: grid; gap: 7px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--lumina-muted); font-size: .78rem; }
.process-steps li { display: flex; align-items: center; gap: 8px; }
.process-steps li > span:first-child { display: inline-grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #a4acba; background: #e6e9ef; font-size: .7rem; }
.process-steps li.is-complete { color: #166534; }
.process-steps li.is-complete > span:first-child { color: #fff; background: #16a34a; font-size: 0; }
.process-steps li > span:first-child { display: inline-flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; }
.process-steps li.is-current { color: var(--lumina-ink); font-weight: 700; }
.process-steps li.is-current > span:first-child { color: var(--lumina-purple); background: var(--lumina-lilac); }
.process-progress.is-error { border-color: #fecaca; background: #fff7f7; }
.process-progress.is-error .process-progress-head strong { color: #991b1b; }
.process-progress.is-complete { border-color: #bbf7d0; background: #f0fdf4; }
.stage-panel-actions .process-progress { margin-bottom: 2px; }
.process-assist { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--lumina-line); color: var(--lumina-muted); font-size: .74rem; line-height: 1.4; }
.process-assist .text-button { flex: 0 0 auto; padding: 0; color: var(--lumina-purple); font-size: .74rem; }
@media (max-width: 620px) { .process-assist { align-items: stretch; flex-direction: column; } }

/* Plans and documentation screens from the reference product. */
.lumina-page-heading { max-width: 690px; margin-bottom: 30px; }
.lumina-page-heading h1 { margin: 8px 0 6px; font-size: clamp(2rem, 4vw, 3.2rem); }
.lumina-page-heading p { margin: 0; color: var(--lumina-muted); }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; display: grid; gap: 16px; padding: 24px; border: 1px solid var(--lumina-line); border-radius: 14px; background: #fff; box-shadow: 0 2px 5px rgba(17,24,39,.05); }
.plan-card.is-featured { border-color: #ab8dff; box-shadow: 0 10px 24px rgba(103,56,213,.12); }
.plan-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 1.35rem; font-weight: 700; }
.plan-card-head p { margin: 4px 0 0; color: var(--lumina-muted); font-size: .78rem; }
.plan-tag { padding: 4px 8px; border: 1px solid var(--lumina-line); border-radius: 999px; color: var(--lumina-muted); font-size: .68rem; font-weight: 800; }
.plan-tag.is-featured { color: #fff; border-color: var(--lumina-purple); background: var(--lumina-purple); }
.plan-price { display: flex; align-items: baseline; gap: 5px; border-top: 1px solid var(--lumina-line); padding-top: 15px; }
.plan-price strong { color: var(--lumina-ink); font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.plan-price span { color: var(--lumina-muted); font-size: .75rem; }
.plan-metric { display: grid; gap: 4px; color: var(--lumina-muted); font-size: .84rem; }
.plan-metric b { color: var(--lumina-purple); font-weight: 700; }
.plan-card ul { display: grid; gap: 8px; min-height: 122px; margin: 0; padding: 0; list-style: none; color: var(--lumina-muted); font-size: .8rem; }
.plan-card li::before { display: inline-block; width: .9rem; height: .9rem; margin-right: 7px; content: ""; vertical-align: -.12em; background: var(--lumina-green); -webkit-mask: url('/assets/phosphor-icons.svg#check-circle') center / contain no-repeat; mask: url('/assets/phosphor-icons.svg#check-circle') center / contain no-repeat; }
.plans-note { margin-top: 22px; color: var(--lumina-muted); font-size: .8rem; }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 42px; align-items: start; padding-top: 48px; padding-bottom: 90px; }
.docs-sidebar { position: sticky; top: 88px; display: grid; gap: 4px; }
.docs-sidebar-title { margin: 0 10px 10px; color: #7b8496; font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.docs-sidebar a { padding: 9px 11px; border-radius: 9px; color: var(--lumina-muted); font-size: .8rem; text-decoration: none; }
.docs-sidebar a:hover, .docs-sidebar a.is-active { color: var(--lumina-purple-dark); background: var(--lumina-lilac); }
.docs-content { color: var(--lumina-muted); font-size: .91rem; line-height: 1.7; }
.docs-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--lumina-purple-dark); background: var(--lumina-lilac); font-size: .68rem; font-weight: 800; }
.docs-content h1 { margin: 13px 0 5px; font-size: clamp(2.3rem, 5vw, 3.5rem); }
.docs-lead { margin: 0 0 38px; font-size: 1.12rem; }
.docs-content section { padding-top: 20px; margin-top: 25px; border-top: 1px solid var(--lumina-line); }
.docs-content h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 13px; font-size: 1.4rem; }
.docs-content strong, .docs-content b { color: var(--lumina-ink); }
.flow-card { display: grid; gap: 13px; margin: 20px 0; padding: 18px; border: 1px solid var(--lumina-line); border-radius: 12px; background: #fff; box-shadow: 0 2px 5px rgba(17,24,39,.05); }
.flow-card strong { font-size: .82rem; }
.flow-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.flow-pills span { padding: 4px 9px; border-radius: 999px; color: var(--lumina-muted); background: var(--lumina-surface-soft); font-size: .72rem; }
.flow-pills b { color: #9ba3b3; }
.docs-steps { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: docs-step; }
.docs-steps li { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.docs-steps li::before { grid-row: span 2; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--lumina-purple); content: counter(docs-step); counter-increment: docs-step; font-weight: 800; font-size: .75rem; }
.docs-steps span { font-size: .82rem; }
.admin-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 999px; background: #eceef2; }
.admin-tabs a { padding: 8px 12px; border-radius: 999px; color: var(--lumina-muted); text-align: center; font-size: .82rem; text-decoration: none; }
.admin-tabs a:hover, .admin-tabs a.is-active { color: var(--lumina-ink); background: #fff; box-shadow: 0 1px 4px rgba(17,24,39,.10); }
.admin-empty-panel { display: grid; min-height: 104px; place-items: center; color: var(--lumina-muted); font-size: .86rem; }
.admin-subscription-list, .admin-plan-list { display: grid; gap: 9px; }
.admin-subscription-row, .admin-plan-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(100px, .8fr) auto auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--lumina-line); border-radius: 11px; background: var(--lumina-surface-soft); }
.admin-subscription-row > div, .admin-plan-title { display: grid; gap: 3px; min-width: 0; }
.admin-subscription-row strong, .admin-plan-title strong { overflow: hidden; color: var(--lumina-ink); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-subscription-row span, .admin-subscription-row small, .admin-plan-title span, .admin-plan-row small { color: var(--lumina-muted); font-size: .73rem; }
.admin-plan-row > div:nth-child(2) { display: grid; gap: 3px; }.admin-plan-row > div:nth-child(2) b { color: var(--lumina-ink); font-family: Georgia, serif; }.admin-plan-actions { display: flex; gap: 9px; justify-content: end; }.danger-text { color: var(--lumina-red); }
.admin-plan-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 18px 0; padding: 15px; border: 1px solid var(--lumina-line); border-radius: 11px; background: var(--lumina-surface-soft); }
.admin-plan-form[hidden] { display: none; }.admin-plan-form label { display: grid; gap: 6px; color: var(--lumina-muted); font-size: .74rem; font-weight: 750; }.admin-plan-form input:not([type="checkbox"]) { min-height: 38px; padding: 8px 10px; border: 1px solid var(--lumina-line); border-radius: 8px; color: var(--lumina-ink); background: #fff; font: inherit; }.admin-plan-check { display: flex !important; align-items: center; gap: 8px; padding-top: 21px; }.admin-plan-form .form-actions, .admin-plan-form .form-feedback { grid-column: 1 / -1; }
.workspace-card { padding: 22px; border-color: var(--lumina-line); border-radius: 14px; background: var(--lumina-surface); box-shadow: 0 2px 5px rgba(17,24,39,.05); }
.workspace-grid, .workspace-content, .workspace-sidebar { gap: 16px; }
.chapter-add-form input, .workspace-input, .chapter-editor textarea, .rich-editor { color: var(--lumina-ink); border-color: var(--lumina-line); background: #fff; }
.chapter-add-form input:focus, .workspace-input:focus, .chapter-editor textarea:focus, .rich-editor:focus { border-color: var(--lumina-purple); box-shadow: 0 0 0 3px rgba(103,56,213,.12); }
.chapter-row, .version-history-item, .output-block, .output-competitors article, .output-personas article, .review-note-status { border-color: var(--lumina-line); background: var(--lumina-surface-soft); }
.chapter-number { color: #fff; background: var(--lumina-purple); }
.chapter-main strong, .output-block h3, .output-competitors article > b, .output-personas article > b { color: var(--lumina-ink); }
.rich-editor-toolbar { border-color: var(--lumina-line); background: var(--lumina-surface-soft); }
.rich-editor-toolbar .text-button:hover { color: var(--lumina-purple); background: var(--lumina-lilac); }
.rich-editor:empty::before { color: #98a1b3; }
.version-history { border-color: var(--lumina-line); }.version-history summary { color: var(--lumina-purple); }
.output-badges span { color: var(--lumina-purple); border-color: #cbbdff; background: var(--lumina-lilac); }
.output-status.is-approved { color: #166534; background: #dcfce7; }.output-status.is-pending { color: #92400e; background: #fef3c7; }
.output-score-track { background: #e5e7eb; }.output-score-track span { background: linear-gradient(90deg, #6d4be3, #a58cff); }
.review-note-status { color: var(--lumina-ink); }
.operation-code { color: var(--lumina-purple); border-color: #cbbdff; background: var(--lumina-surface-soft); }
.integration-test-form input, .audit-filter-form select { color: var(--lumina-ink); border-color: var(--lumina-line); background: #fff; }
.config-list div, .audit-table-row, .audit-item { border-color: var(--lumina-line); }
.audit-table-row code, .integration-note code, .operation-help .muted-label code { color: var(--lumina-purple); }
.system-check b, .operation-danger, .audit-item p { color: var(--lumina-red); }
.workspace-step.is-complete span::after { color: var(--lumina-green); }
.preview-checklist article { background: #fff; }
.workspace-steps { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.admin-plan-assign { display: inline-flex; align-items: center; gap: 5px; }.admin-plan-assign select { min-height: 30px; padding: 0 7px; border: 1px solid var(--lumina-line); border-radius: 7px; color: var(--lumina-ink); background: #fff; font: .72rem Inter, sans-serif; }
.admin-project-limit { display: inline-flex; align-items: end; gap: 5px; flex-wrap: wrap; }.admin-project-limit label { display: grid; gap: 3px; color: var(--lumina-muted); font-size: .68rem; }.admin-project-limit input { width: 78px; min-height: 30px; padding: 0 7px; border: 1px solid var(--lumina-line); border-radius: 7px; color: var(--lumina-ink); background: #fff; font: .72rem Inter, sans-serif; }.admin-project-limit small { align-self: center; color: var(--lumina-muted); font-size: .68rem; }
.admin-invite-form input { color: var(--lumina-ink); border-color: var(--lumina-line); background: #fff; }
.security-state, .security-setup { border-color: var(--lumina-line); background: var(--lumina-surface-soft); }.security-setup input, .security-setup textarea { color: var(--lumina-ink); border-color: var(--lumina-line); background: #fff; }
.auth-card { border-color: var(--lumina-line); background: #fff; box-shadow: 0 14px 35px rgba(17,24,39,.08); }

@media (max-width: 900px) { .app-nav { gap: 1px; } .app-nav-link { padding: 7px 8px; } .app-nav-link span { display: none; } .plans-grid { grid-template-columns: 1fr; } .docs-layout { grid-template-columns: 1fr; gap: 20px; } .docs-sidebar { position: static; display: flex; flex-wrap: wrap; } .docs-sidebar-title { width: 100%; } .admin-subscription-row, .admin-plan-row { grid-template-columns: 1fr 1fr; }.admin-plan-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .lumina-brand { min-width: auto; } .lumina-brand-copy small { display: none; } .app-nav-link { font-size: .72rem; padding: 7px 6px; } .user-chip { max-width: 100px; overflow: hidden; text-overflow: ellipsis; } .dashboard-nav { gap: 8px; } }
@media (max-width: 840px) { .workspace-steps { grid-template-columns: repeat(7, minmax(90px, 1fr)); } }

/* Account, authentication and operations finish — v2.28. These screens use
   the same Lumina tokens as the product workspace while keeping their actions
   explicit for keyboard and mobile users. */
.portal-shell.auth-layout, .portal-shell.centered-layout {
    width: min(100% - 40px, 560px);
    min-height: 100vh;
    padding: 42px 0;
}
.auth-layout, .centered-layout {
    align-content: center;
    justify-items: stretch;
    gap: 18px;
}
.auth-layout .portal-brand, .centered-layout .portal-brand {
    justify-self: center;
    gap: 11px;
    color: var(--lumina-ink);
}
.auth-layout .portal-mark, .centered-layout .portal-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--lumina-purple);
    background: var(--lumina-lilac);
    font-size: 1.05rem;
}
.auth-layout .portal-brand-copy, .centered-layout .portal-brand-copy { display: grid; gap: 2px; line-height: 1.05; }
.auth-layout .portal-brand-copy strong, .centered-layout .portal-brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.03rem; }
.auth-layout .portal-brand-copy small, .centered-layout .portal-brand-copy small { color: var(--lumina-muted); font-size: .52rem; letter-spacing: .15em; }
.auth-card {
    width: 100%;
    padding: 34px;
    border: 1px solid var(--lumina-line);
    border-radius: 18px;
    background: var(--lumina-surface);
    box-shadow: 0 18px 42px rgba(17,24,39,.08);
}
.auth-intro { margin-bottom: 24px; }
.auth-intro h1, .result-card h1 { margin: 11px 0 8px; font-size: clamp(2rem, 5vw, 2.65rem); line-height: 1.03; }
.auth-intro p, .result-card p { max-width: 46ch; margin: 0; color: var(--lumina-muted); font-size: .91rem; line-height: 1.55; }
.auth-card .portal-form { gap: 14px; }
.auth-card .portal-form label, .account-main .portal-form label, .security-setup label { color: var(--lumina-ink); font-size: .78rem; font-weight: 750; }
.auth-card .portal-form input, .account-main .portal-form input { min-height: 43px; padding: 10px 12px; border-radius: 9px; }
.auth-card .portal-button { width: 100%; margin-top: 3px; }
.auth-card .auth-switch { margin: 21px 0 0; color: var(--lumina-muted); font-size: .82rem; }
.auth-card .auth-switch a, .auth-card .portal-back a { color: var(--lumina-purple); }
.auth-card .form-feedback { margin-top: 1px; }
.auth-card .two-factor-login-form { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--lumina-line); }
.auth-card .text-button { justify-self: center; font-size: .8rem; }
.portal-back { color: var(--lumina-muted); font-size: .78rem; }
.portal-back a { color: var(--lumina-purple); }
.result-card { display: grid; justify-items: center; gap: 0; text-align: center; }
.result-icon { width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 17px; }

/* Keep actions at their natural size instead of stretching across the viewport. */
body :is(.portal-button, .wizard-primary, .wizard-secondary, .landing-button) { width: auto !important; max-width: 100%; flex: 0 0 auto; }
body .auth-card .portal-button,
body .workspace-action,
body .workspace-edit-link,
body .result-card .link-button { width: auto !important; min-width: 150px; }

/* Authentication screens keep a readable, standard form width on large displays. */
body.portal-page .portal-shell.auth-layout,
body.portal-page .portal-shell.centered-layout { width: min(100% - 40px, 520px); }
body.portal-page .portal-shell.auth-layout .auth-card,
body.portal-page .portal-shell.centered-layout .auth-card { width: 100%; max-width: 520px; padding: 30px; }
body.portal-page .portal-shell.auth-layout .brand-logo-full,
body.portal-page .portal-shell.centered-layout .brand-logo-full { width: 180px; max-height: 46px; }
.result-success { color: #166534; background: #dcfce7; }
.result-error { color: #991b1b; background: #fee2e2; }
.result-card .link-button { width: 100%; margin-top: 4px; }
.account-main { padding-bottom: 90px; }
.account-profile-card { padding: 28px; }
.account-profile-card .portal-form { max-width: 470px; }
.account-profile-card .portal-button { justify-self: start; }
.account-security-grid { align-items: stretch; }
.account-security-grid .security-card { height: 100%; }
.security-card .card-heading { align-items: start; }
.security-card .portal-form input { min-height: 42px; }
.security-card .portal-button { justify-self: start; }
.security-note { margin-top: 16px; }
.security-setup { gap: 14px; padding: 18px; border: 1px solid var(--lumina-line); border-radius: 12px; background: var(--lumina-surface-soft); }
.security-setup h3 { margin: 0; color: var(--lumina-ink); font-size: .94rem; }
.security-setup p { margin: 0; color: var(--lumina-muted); font-size: .8rem; line-height: 1.5; }
.security-setup input, .security-setup textarea { border-color: var(--lumina-line); background: #fff; }
.recovery-codes { border-color: #bbf7d0; background: #f0fdf4; }
.recovery-codes code { color: #166534; }
.admin-main .dashboard-heading { align-items: start; }
.admin-heading-actions { max-width: 560px; justify-content: end; }
.admin-heading-actions .portal-button { min-height: 36px; padding: 0 12px; font-size: .78rem; }
.admin-main .operation-card, .admin-main .workspace-card { overflow: hidden; }
.admin-main .operation-card { min-height: 124px; }
.admin-main .operation-number { color: var(--lumina-purple); font-family: Georgia, "Times New Roman", serif; font-size: 1.85rem; letter-spacing: -.04em; }
.admin-main .operation-card small { color: var(--lumina-muted); }
.admin-main .operation-help { background: #fbfbfd; }
.admin-main .operation-help h2, .admin-main .card-heading h2 { font-size: 1.24rem; }
.admin-main .operation-help label { color: var(--lumina-ink); font-size: .73rem; font-weight: 750; }
.admin-main .operation-code { display: block; overflow-wrap: anywhere; color: var(--lumina-purple-dark); border-color: #dcd3ff; background: var(--lumina-lilac); font-size: .72rem; line-height: 1.5; }
.admin-main .audit-table-row, .admin-main .audit-item, .admin-main .job-item, .admin-main .activity-item { border-color: var(--lumina-line); background: var(--lumina-surface-soft); }
.admin-main .audit-table-row p, .admin-main .audit-item p { color: var(--lumina-muted); }
.admin-main .muted-label { color: var(--lumina-muted); }
.admin-main .form-feedback.is-error { color: #b91c1c; }
.admin-main .form-feedback.is-success { color: #15803d; }
@media (max-width: 620px) {
    .portal-shell.auth-layout, .portal-shell.centered-layout { width: min(100% - 28px, 560px); padding: 28px 0; }
    .auth-card { padding: 25px 20px; }
    .auth-intro h1, .result-card h1 { font-size: 2rem; }
    .account-profile-card { padding: 21px; }
    .account-profile-card .portal-button, .security-card .portal-button { width: 100%; }
    .admin-heading-actions { max-width: none; justify-content: stretch; }
}

/* Global visual refresh — v2.87.
   The navigation model stays the same; the visual language becomes clearer,
   more modern and easier to scan across every authenticated page. */
body.portal-page {
    --lumina-ink: #182338;
    --lumina-muted: #66758d;
    --lumina-line: #dbe2ec;
    --lumina-surface: #ffffff;
    --lumina-purple: #6c45dc;
    --lumina-purple-dark: #4d2aa8;
    --lumina-lilac: #eee9ff;
    color: #182338;
    background: #f3f6fa;
    font-family: "Segoe UI Variable", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
}
body.portal-page :is(h1, h2, h3, h4, strong, b, .portal-button, .text-button) {
    font-family: inherit;
}
body.portal-page :is(p, li, label, small, span, input, textarea, select, button) {
    letter-spacing: 0;
}
body.portal-page .app-sidebar {
    border-right: 0;
    color: #e8ebff;
    background: linear-gradient(180deg, #171a38 0%, #20254d 58%, #29225a 100%);
    box-shadow: 10px 0 30px rgba(27, 31, 70, .16);
}
body.portal-page .sidebar-brand-wrap { padding: 0 9px; }
body.portal-page .sidebar-context {
    border-color: rgba(197, 203, 255, .18);
    background: rgba(255, 255, 255, .08);
}
body.portal-page .sidebar-context span,
body.portal-page .sidebar-group h2 { color: #abb2dc; }
body.portal-page .sidebar-context strong,
body.portal-page .sidebar-account-copy strong,
body.portal-page .sidebar-tip strong { color: #fff; }
body.portal-page .sidebar-context small,
body.portal-page .sidebar-account-copy small,
body.portal-page .sidebar-tip small { color: #b9c0df; }
body.portal-page .sidebar-context small b { color: #eae5ff; background: rgba(147, 119, 255, .3); }
body.portal-page .sidebar-link { color: #c6cbea; font-size: .84rem; font-weight: 500; }
body.portal-page .sidebar-link .ui-icon { color: #aeb7e3; width: 18px; height: 18px; }
body.portal-page .sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .09); }
body.portal-page .sidebar-link.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(126, 93, 232, .92), rgba(102, 74, 200, .7));
    box-shadow: inset 3px 0 0 #c3b4ff, 0 7px 17px rgba(9, 13, 38, .16);
}
body.portal-page .sidebar-tip { border-color: rgba(197, 203, 255, .18); color: #c7cceb; background: rgba(255,255,255,.06); }
body.portal-page .sidebar-tip:hover { border-color: rgba(214, 205, 255, .38); background: rgba(255,255,255,.11); }
body.portal-page .sidebar-tip-icon { color: #d8ceff; background: rgba(141, 112, 238, .35); }
body.portal-page .sidebar-account { border-top-color: rgba(197, 203, 255, .18); }
body.portal-page .sidebar-avatar { color: #35216e; background: #dcd3ff; }
body.portal-page .sidebar-logout { color: #bbc2e2; }
body.portal-page .sidebar-logout:hover { border-color: rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.1); }
body.portal-page .app-shell-topbar {
    border-bottom-color: #dfe5ee;
    background: rgba(255,255,255,.94);
    box-shadow: 0 1px 0 rgba(23, 35, 59, .02);
}
body.portal-page .app-breadcrumbs { color: #78869b; font-size: .82rem; }
body.portal-page .app-breadcrumbs strong { color: #1b2940; font-weight: 650; }
body.portal-page .topbar-settings { color: #53647c; background: #fff; }
body.portal-page .portal-shell { width: min(100% - 44px, 1540px); }
body.portal-page .workspace-card,
body.portal-page .project-form-card,
body.portal-page .operation-card,
body.portal-page .integration-card,
body.portal-page .security-card,
body.portal-page .preview-checklist article,
body.portal-page .preview-export-card,
body.portal-page .commercial-release-card {
    border-color: #d9e1eb;
    background: #fff;
    box-shadow: 0 7px 22px rgba(36, 54, 79, .055);
}
body.portal-page :is(.workspace-heading h1, .dashboard-heading h1, .preview-heading h1, .lumina-page-heading h1) {
    color: #17243a;
    font-family: inherit;
    font-weight: 720;
    letter-spacing: -.035em;
}
body.portal-page :is(.workspace-card h2, .card-heading h2, .preview-export-card h2, .commercial-release-card h2) {
    color: #1b2a42;
    font-family: inherit;
    font-weight: 680;
    letter-spacing: -.02em;
}
body.portal-page :is(.workspace-card p, .muted-label, .output-line span, .operation-card small, .workspace-heading p, .preview-heading p) {
    color: #66758d;
    font-size: .88rem;
    font-weight: 400;
    line-height: 1.55;
}
body.portal-page .portal-eyebrow { color: #7651d6; font-size: .68rem; font-weight: 750; letter-spacing: .14em; }
body.portal-page .portal-button {
    min-height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7046df, #5630bf);
    box-shadow: 0 6px 14px rgba(94, 57, 201, .18);
    font-size: .84rem;
    font-weight: 650;
}
body.portal-page .portal-button.button-secondary { color: #4d3b8b; border-color: #d8d1f4; background: #faf9ff; box-shadow: none; }
body.portal-page .portal-button:hover { box-shadow: 0 9px 20px rgba(94,57,201,.23); }
body.portal-page .text-button { color: #6339c8; font-weight: 650; }
body.portal-page .export-actions .portal-button { gap: 8px; }
body.portal-page .export-actions [data-icon],
body.portal-page .portal-button [data-icon],
body.portal-page .text-button [data-icon] { width: 1.05em; height: 1.05em; flex: 0 0 auto; margin-right: 0; }
body.portal-page .ui-icon { stroke-width: 1.8; }
body.portal-page .activity-list,
body.portal-page .job-list,
body.portal-page .output-list { font-size: .84rem; }
body.portal-page .activity-list > *,
body.portal-page .job-list > *,
body.portal-page .output-list > li { border-color: #e0e6ee; background: #f8fafc; }
body.portal-page .review-score-value { font-family: inherit; font-weight: 760; }
body.portal-page .review-summary-panel h4,
body.portal-page .review-notes-heading h4 { font-family: inherit; font-weight: 700; }
@media (max-width: 760px) {
    body.portal-page .portal-shell { width: calc(100% - 28px); }
    body.portal-page .app-shell-topbar { box-shadow: 0 1px 8px rgba(23,35,59,.06); }
}

.character-selection-card { margin-top: 1rem; }
.character-selection-card .stage-lead { max-width: 70rem; }
.project-character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.project-character-option { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--portal-border, #dfe3ef); border-radius: .8rem; padding: .75rem .85rem; cursor: pointer; background: #fff; }
.project-character-option.is-selected { border-color: #7446e8; background: #faf8ff; box-shadow: 0 0 0 1px rgba(116,70,232,.12); }
.project-character-option input { accent-color: #6840d9; width: 1rem; height: 1rem; flex: 0 0 auto; }
.project-character-option-copy { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.project-character-option-copy strong { color: #1f2942; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-character-option-copy small { color: #72809b; }
.character-selection-footer { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: .9rem; }
.character-selection-empty { border: 1px dashed #d6dced; border-radius: .8rem; padding: 1rem; color: #65728a; }
.character-selection-empty a { color: #633bd5; font-weight: 700; }
@media (max-width: 900px) { .project-character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .project-character-grid { grid-template-columns: 1fr; } .character-selection-footer { justify-content: space-between; } }

/* Documentation manual — v2.31. The content mirrors the approved reference
   manual: anchored phases, numbered instructions and contextual callouts. */
.docs-manual { grid-template-columns: 220px minmax(0, 760px); max-width: 1030px; gap: 42px; padding-top: 34px; }
.docs-manual .docs-sidebar { top: 82px; max-height: calc(100vh - 104px); overflow: auto; padding-right: 3px; }
.docs-manual .docs-sidebar a { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.docs-manual .docs-sidebar a > span { width: 14px; color: currentColor; text-align: center; font-size: .82rem; }
.docs-manual-content { max-width: 760px; padding-bottom: 90px; }
.docs-manual-content .docs-section { scroll-margin-top: 84px; padding-top: 28px; margin-top: 34px; border-top: 1px solid var(--lumina-line); }
.docs-manual-content .docs-section.docs-intro { padding-top: 0; margin-top: 0; border-top: 0; }
.docs-manual-content .docs-section-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.docs-manual-content .docs-section-heading h2 { margin: 0; font-size: 1.38rem; line-height: 1.15; }
.docs-manual-content .docs-section-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.docs-section-icon { display: grid; width: 33px; height: 33px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--lumina-purple); background: var(--lumina-lilac); font-size: 1rem; }
.docs-phase { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: 999px; color: var(--lumina-ink); background: #eceef2; font-size: .67rem; font-weight: 800; }
.docs-manual-content .docs-lead { margin-bottom: 34px; }
.docs-manual-content p { line-height: 1.6; }
.docs-flow-card { margin-top: 20px; }
.docs-callout { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 9px; margin: 17px 0 0; padding: 14px 15px; border: 1px solid transparent; border-radius: 11px; font-size: .8rem; line-height: 1.5; }
.docs-callout > span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; font-weight: 850; }
.docs-callout p { margin: 0; color: var(--lumina-ink); }
.docs-callout-info { border-color: #e4defb; background: #f5f2ff; }
.docs-callout-info > span { color: var(--lumina-purple); background: #e9e2ff; }
.docs-callout-warning { border-color: #f5d878; background: #fffbea; }
.docs-callout-warning > span { color: #a16207; background: #fff0b8; }
.docs-manual-content .docs-steps { gap: 14px; margin-top: 18px; }
.docs-manual-content .docs-steps li { grid-template-columns: 32px 1fr; gap: 2px 10px; }
.docs-manual-content .docs-steps li::before { width: 30px; height: 30px; font-size: .76rem; }
.docs-manual-content .docs-steps b { align-self: center; font-size: .84rem; }
.docs-manual-content .docs-steps span { color: var(--lumina-muted); font-size: .79rem; line-height: 1.5; }
.docs-topic-grid, .docs-material-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.docs-topic-grid article, .docs-material-grid article { display: grid; gap: 3px; min-height: 67px; padding: 12px; border: 1px solid var(--lumina-line); border-radius: 10px; background: var(--lumina-surface-soft); }
.docs-topic-grid article strong, .docs-material-grid article strong { color: var(--lumina-ink); font-size: .78rem; }
.docs-topic-grid article span, .docs-material-grid article span { color: var(--lumina-muted); font-size: .7rem; line-height: 1.4; }
.docs-advice-list { display: grid; gap: 11px; margin-top: 17px; }
.docs-advice-list article { display: grid; gap: 3px; padding: 14px 16px 14px 39px; border: 1px solid var(--lumina-line); border-radius: 11px; background: #fbfbfd; position: relative; }
.docs-advice-list article::before { position: absolute; left: 15px; top: 14px; width: 1rem; height: 1rem; content: ""; background: var(--lumina-purple); -webkit-mask: url('/assets/phosphor-icons.svg#sparkle') center / contain no-repeat; mask: url('/assets/phosphor-icons.svg#sparkle') center / contain no-repeat; }
.docs-advice-list article strong { color: var(--lumina-ink); font-size: .8rem; }
.docs-advice-list article span { color: var(--lumina-muted); font-size: .78rem; line-height: 1.5; }
.docs-start-card { display: grid; justify-items: center; gap: 8px; margin-top: 17px; padding: 24px 18px; border: 1px solid #d1c3ff; border-radius: 14px; background: #f3efff; text-align: center; }
.docs-start-card h3 { margin: 0; color: var(--lumina-ink); font: 700 1.15rem Georgia, serif; }
.docs-start-card p { margin: 0 0 7px; color: var(--lumina-muted); font-size: .8rem; }
@media (max-width: 900px) {
    .docs-manual { grid-template-columns: 1fr; gap: 20px; padding-top: 26px; }
    .docs-manual .docs-sidebar { position: sticky; top: 60px; z-index: 5; display: flex; max-height: none; padding: 6px; overflow-x: auto; border: 1px solid var(--lumina-line); border-radius: 11px; background: rgba(255,255,255,.97); box-shadow: 0 4px 12px rgba(17,24,39,.06); }
    .docs-manual .docs-sidebar-title { display: none; }
    .docs-manual .docs-sidebar a { flex: 0 0 auto; white-space: nowrap; }
    .docs-manual-content { max-width: none; }
}
@media (max-width: 620px) {
    .docs-manual-content .docs-section-heading h2 { font-size: 1.22rem; }
    .docs-topic-grid, .docs-material-grid { grid-template-columns: 1fr; }
    .docs-manual-content .docs-steps li { grid-template-columns: 30px 1fr; gap: 2px 9px; }
    .docs-callout { grid-template-columns: 21px 1fr; padding: 12px; }
}

/* Central administration dashboard — v2.30. The overview is intentionally
   calmer than the utility screens: one primary action, one compact summary,
   then clear navigation into the operational tools. */
.admin-page { background: #f3f5f8; }
.admin-page .dashboard-topbar { background: rgba(255,255,255,.98); }
.admin-page .admin-main { padding-top: 34px; }
.admin-page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.admin-page-header h1 { margin: 8px 0 5px; color: var(--lumina-ink); font-size: clamp(2.35rem, 5vw, 3.4rem); line-height: 1; }
.admin-page-header p { max-width: 580px; margin: 0; color: var(--lumina-muted); font-size: .9rem; }
.admin-page-header .admin-heading-actions { max-width: none; flex: 0 0 auto; }
.admin-page-header .admin-heading-actions .portal-button { min-height: 40px; }
.admin-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-summary-card { display: flex; align-items: center; gap: 13px; min-height: 92px; padding: 16px; border: 1px solid var(--lumina-line); border-radius: 13px; background: #fff; box-shadow: 0 2px 5px rgba(17,24,39,.04); }
.admin-summary-card > div { display: grid; gap: 2px; min-width: 0; }
.admin-summary-card strong { color: var(--lumina-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.62rem; line-height: 1; }
.admin-summary-card span:not(.admin-summary-icon) { color: var(--lumina-muted); font-size: .74rem; }
.admin-summary-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--lumina-purple); background: var(--lumina-lilac); font-size: .68rem; font-weight: 850; }
.admin-summary-icon.is-green { color: #15803d; background: #dcfce7; }
.admin-summary-icon.is-blue { color: #1d4ed8; background: #dbeafe; }
.admin-summary-icon.is-yellow { color: #92400e; background: #fef3c7; }
.admin-tool-panel { margin-bottom: 20px; padding: 19px; border: 1px solid var(--lumina-line); border-radius: 14px; background: #fff; box-shadow: 0 2px 5px rgba(17,24,39,.04); }
.admin-tool-panel-head, .admin-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.admin-tool-panel-head h2, .admin-panel-head h2 { margin: 5px 0 0; color: var(--lumina-ink); font-size: 1.2rem; }
.admin-panel-head p { margin: 6px 0 0; color: var(--lumina-muted); font-size: .8rem; }
.admin-panel-note { padding: 6px 9px; border-radius: 999px; color: var(--lumina-muted); background: var(--lumina-surface-soft); font-size: .7rem; white-space: nowrap; }
.admin-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.admin-tool-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 66px; padding: 11px 12px; border: 1px solid var(--lumina-line); border-radius: 11px; color: inherit; background: var(--lumina-surface-soft); text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.admin-tool-link:hover { border-color: #b9a6ff; background: #fff; transform: translateY(-1px); }
.admin-tool-link > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.admin-tool-link strong { overflow: hidden; color: var(--lumina-ink); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-tool-link small { overflow: hidden; color: var(--lumina-muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-tool-link > b { color: var(--lumina-purple); font-size: .95rem; }
.admin-tool-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--lumina-purple); background: var(--lumina-lilac); font-size: .92rem; font-weight: 850; }
.admin-tool-icon.is-green { color: #15803d; background: #dcfce7; }
.admin-tool-icon.is-blue { color: #1d4ed8; background: #dbeafe; }
.admin-tool-icon.is-red { color: #b91c1c; background: #fee2e2; }
.admin-tool-icon.is-yellow { color: #92400e; background: #fef3c7; }
.admin-page .admin-tabs { margin-bottom: 18px; }
.admin-database-warning { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #f5d77d; border-radius: 11px; color: #7a4b00; background: #fff9df; font-size: .78rem; }
.admin-database-warning strong { color: #8b5e00; }
.admin-database-warning a { color: var(--lumina-purple); font-weight: 750; text-decoration: none; white-space: nowrap; }
.admin-page .admin-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; }
.admin-page .admin-tabs a > span { color: currentColor; font-size: .85rem; }
.admin-page .workspace-card { box-shadow: 0 2px 5px rgba(17,24,39,.04); }
.admin-page .admin-invite-card, .admin-page .admin-tab-panel { padding: 22px; }
.admin-page .admin-user-list { gap: 10px; }
.admin-page .admin-user-row { padding: 15px; border-radius: 12px; background: #fbfbfd; }
.admin-page .admin-user-actions .text-button { min-height: 30px; padding: 0 8px; border: 1px solid var(--lumina-line); border-radius: 7px; color: var(--lumina-purple-dark); background: #fff; font-size: .72rem; }
.admin-page .admin-user-actions .text-button:hover { border-color: #b9a6ff; background: var(--lumina-lilac); }
.admin-page .admin-user-actions .danger-text { color: #b91c1c; }
.admin-page .admin-plan-actions .text-button { font-size: .72rem; }
.admin-page .admin-empty-panel { min-height: 138px; border: 1px dashed var(--lumina-line); border-radius: 10px; background: #fbfbfd; }
.admin-request-list { display: grid; gap: 10px; }
.admin-request-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(120px, .75fr) auto; gap: 14px; align-items: start; padding: 15px; border: 1px solid var(--lumina-line); border-radius: 12px; background: #fbfbfd; }
.admin-request-row > div { display: grid; gap: 4px; min-width: 0; }
.admin-request-row strong { color: var(--lumina-ink); font-size: .82rem; }
.admin-request-row span, .admin-request-row small { color: var(--lumina-muted); font-size: .73rem; overflow-wrap: anywhere; }
.admin-request-row b { color: var(--lumina-purple-dark); font-size: .76rem; }
.admin-request-row select { min-height: 32px; padding: 0 8px; border: 1px solid var(--lumina-line); border-radius: 8px; color: var(--lumina-ink); background: #fff; font: inherit; font-size: .72rem; }
.admin-request-message { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--lumina-line); color: var(--lumina-muted); font-size: .76rem; line-height: 1.5; white-space: pre-line; }
@media (max-width: 900px) {
    .admin-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-request-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .admin-page-header, .admin-tool-panel-head, .admin-panel-head { align-items: stretch; flex-direction: column; }
    .admin-page-header .admin-heading-actions { width: 100%; }
    .admin-page-header .admin-heading-actions .portal-button { flex: 1; }
    .admin-summary-grid, .admin-tool-grid { grid-template-columns: 1fr; }
    .admin-tabs { grid-template-columns: repeat(2, 1fr); border-radius: 14px; }
    .admin-request-row { grid-template-columns: 1fr; }
    .admin-panel-note { align-self: start; }
    .admin-page .admin-invite-card, .admin-page .admin-tab-panel { padding: 18px; }
}

/* Public contracting request — release v2.33. */
.sales-request-page { background: #f3f5f8; }
.sales-request-page .dashboard-topbar { background: rgba(255,255,255,.98); }
.sales-request-main { padding: 48px 0 90px; }
.sales-request-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.sales-request-heading h1 { max-width: 690px; margin: 8px 0 7px; color: var(--lumina-ink); font-size: clamp(2.35rem, 5vw, 3.5rem); line-height: 1; }
.sales-request-heading p { max-width: 680px; margin: 0; color: var(--lumina-muted); font-size: .92rem; line-height: 1.55; }
.sales-request-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 18px; align-items: start; }
.sales-request-card, .sales-request-plan-card { padding: 24px; background: #fff; box-shadow: 0 2px 5px rgba(17,24,39,.04); }
.sales-request-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sales-request-card-heading h2, .sales-request-plan-card h2 { margin: 5px 0 0; color: var(--lumina-ink); font-size: 1.25rem; }
.sales-request-required { color: var(--lumina-muted); font-size: .7rem; }
.sales-request-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sales-request-card label { display: grid; gap: 7px; color: var(--lumina-ink); font-size: .76rem; font-weight: 750; }
.sales-request-card input[type="text"], .sales-request-card input[type="email"], .sales-request-card input[type="tel"], .sales-request-card textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--lumina-line); border-radius: 9px; padding: 11px 12px; color: var(--lumina-ink); background: #fff; font: inherit; font-size: .82rem; }
.sales-request-card input:focus, .sales-request-card textarea:focus { border-color: var(--lumina-purple); outline: 0; box-shadow: 0 0 0 3px rgba(103,56,213,.11); }
.sales-request-message { margin-top: 15px; }
.sales-request-message textarea { resize: vertical; line-height: 1.5; }
.sales-request-consent { display: flex !important; grid-template-columns: none; align-items: start; gap: 8px !important; margin: 18px 0; color: var(--lumina-muted) !important; font-size: .72rem !important; font-weight: 500 !important; line-height: 1.45; }
.sales-request-consent input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--lumina-purple); }
.sales-request-card > .portal-button { justify-self: start; min-width: 190px; }
.sales-request-feedback { margin-bottom: 16px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: .8rem; }
.sales-request-feedback.is-success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.sales-request-feedback.is-error { color: #991b1b; border-color: #fecaca; background: #fff1f2; }
.sales-request-login { margin: 17px 0 0; color: var(--lumina-muted); font-size: .76rem; }
.sales-request-login a { color: var(--lumina-purple); font-weight: 750; }
.sales-request-plans { display: grid; gap: 10px; margin-top: 18px; }
.sales-plan-option { display: block !important; position: relative; padding: 14px 14px 14px 42px; border: 1px solid var(--lumina-line); border-radius: 11px; background: var(--lumina-surface-soft); cursor: pointer; }
.sales-plan-option input { position: absolute; left: 15px; top: 19px; accent-color: var(--lumina-purple); }
.sales-plan-option > span { display: grid; gap: 3px; }
.sales-plan-option strong { color: var(--lumina-ink); font-size: .83rem; }
.sales-plan-option small { color: var(--lumina-muted); font-size: .7rem; }
.sales-plan-option b { margin-top: 4px; color: var(--lumina-purple-dark); font-family: Georgia, serif; font-size: .95rem; }
.sales-plan-option.is-selected { border-color: var(--lumina-purple); background: #f5f2ff; box-shadow: 0 0 0 2px rgba(103,56,213,.08); }
.sales-request-note { display: grid; gap: 7px; margin-top: 16px; padding: 16px; border: 1px solid #e4defb; border-radius: 11px; color: var(--lumina-muted); background: #f5f2ff; font-size: .76rem; line-height: 1.45; }
.sales-request-note strong { color: var(--lumina-ink); font-size: .8rem; }
.brand-logo-full { display: block; width: 214px; height: auto; max-height: 52px; object-fit: contain; }
.lumina-brand .brand-logo-full { width: 166px; max-height: 42px; }
.auth-layout .brand-logo-full, .centered-layout .brand-logo-full { width: 214px; max-height: 52px; }
@media (max-width: 800px) {
    .sales-request-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .sales-request-main { padding-top: 30px; }
    .sales-request-heading { align-items: stretch; flex-direction: column; }
    .sales-request-heading .portal-button { align-self: start; }
    .sales-request-fields { grid-template-columns: 1fr; }
    .sales-request-card, .sales-request-plan-card { padding: 19px; }
    .lumina-brand .brand-logo-full { width: 142px; }
    .auth-layout .brand-logo-full, .centered-layout .brand-logo-full { width: 190px; }
    .admin-database-warning { grid-template-columns: 1fr; gap: 5px; }
}

/* Guided creation workspace — the user's decisions stay simple and each
   next phase is released only after the previous one has a saved result. */
.workflow-workspace {
    --portal-bg: #f5f6f8;
    --portal-surface: #ffffff;
    --portal-line: #d9dde6;
    --portal-text: #111827;
    --portal-muted: #667085;
    --portal-accent: #6337d8;
    --portal-cyan: #6337d8;
    --portal-danger: #c9343b;
}
body.portal-page.workflow-workspace { background: #f5f6f8; color: #111827; }
.workflow-workspace .dashboard-topbar { background: rgba(255,255,255,.98); }
.workflow-workspace .dashboard-topbar .portal-brand,
.workflow-workspace .dashboard-topbar .app-nav-link,
.workflow-workspace .dashboard-topbar .dashboard-user { color: #667085; }
.workflow-workspace .dashboard-topbar .app-nav-link.is-active,
.workflow-workspace .dashboard-topbar .app-nav-link:hover { color: #6337d8; }
.workflow-workspace .dashboard-topbar .app-nav-link.is-active { color: #fff; }
.workflow-workspace .portal-button { color: #fff; background: #6337d8; box-shadow: 0 5px 12px rgba(99,55,216,.17); }
.workflow-workspace .portal-button.button-secondary { color: #111827; border-color: #d9dde6; background: #fff; box-shadow: none; }
.workflow-workspace .workspace-heading h1,
.workflow-workspace .card-heading h2,
.workflow-workspace .ai-card h2,
.workflow-workspace .export-card h2 { color: #101527; font-family: Georgia, "Times New Roman", serif; }
.workflow-workspace .workspace-heading p,
.workflow-workspace .workspace-card p,
.workflow-workspace .muted-label { color: #667085; }
.workflow-workspace .workspace-steps { border-color: #e1e4ea; background: #eceef2; }
.workflow-workspace .workspace-step { color: #667085; }
.workflow-workspace .workspace-step.is-current { color: #101527; background: #fff; box-shadow: 0 1px 4px rgba(22,28,45,.08); }
.workflow-workspace .workspace-step.is-complete span::after { color: #14a05a; }
.workflow-workspace .workspace-card { border-color: #d9dde6; background: #fff; box-shadow: 0 2px 6px rgba(22,28,45,.06); }
.workflow-workspace .workspace-card input,
.workflow-workspace .workspace-card textarea,
.workflow-workspace .workspace-card select,
.workflow-workspace .rich-editor { border-color: #d9dde6; color: #111827; background: #fff; }
.workflow-workspace .workspace-card .text-button { color: #6337d8; }
.workflow-workspace .project-status { color: #0e422b; background: #b8f2cf; }
.workflow-workspace .stage-panel-direction { display: none; }
.workflow-workspace .stage-lead { margin: -4px 0 18px; color: #667085; font-size: .9rem; line-height: 1.5; }
.workflow-workspace .writing-bulk-action { margin: 0 0 16px; }
.workflow-workspace .outline-settings { display: grid; gap: 7px; margin: 0 0 16px; padding: 13px; border: 1px solid #d9dde6; border-radius: 11px; background: #f7f7fa; }
.workflow-workspace .outline-settings label { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 12px; color: #111827; font-size: .84rem; font-weight: 750; }
.workflow-workspace .outline-settings input { width: 100%; border: 1px solid #d9dde6; border-radius: 8px; padding: 8px 10px; color: #111827; background: #fff; font: inherit; }
.workflow-workspace .outline-settings small { color: #667085; font-size: .76rem; line-height: 1.4; }
.workflow-workspace .outline-settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.workflow-workspace .outline-settings-actions .portal-button { min-height: 35px; }
.workflow-workspace .outline-settings-actions .muted-label { font-size: .72rem; }
.workflow-workspace .editorial-plan-card { display: grid; gap: 12px; margin: 0 0 16px; padding: 16px; border: 1px solid #d9dde6; border-radius: 12px; background: linear-gradient(180deg, #fbfbff 0%, #f5f6fb 100%); }
.workflow-workspace .editorial-plan-card .card-heading { margin: 0; }
.workflow-workspace .editorial-plan-field { padding: 10px 12px; border: 1px solid #e4e7ec; border-radius: 9px; background: #fff; }
.workflow-workspace .editorial-plan-field strong { display: block; margin-bottom: 5px; color: #26324a; font-size: .8rem; }
.workflow-workspace .editorial-plan-field p { margin: 0; color: #475467; line-height: 1.5; }
.workflow-workspace .editorial-plan-field ul { margin: 4px 0 0 18px; padding: 0; color: #475467; line-height: 1.45; }
.workflow-workspace .editorial-plan-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.workflow-workspace .editorial-plan-actions .muted-label { font-size: .76rem; }
.workflow-workspace .editorial-modules-card { display:block; padding:0; overflow:hidden; }
.workflow-workspace .editorial-modules-summary { display:flex; align-items:center; gap:14px; padding:22px; cursor:pointer; list-style:none; }
.workflow-workspace .editorial-modules-summary::-webkit-details-marker { display:none; }
.workflow-workspace .editorial-modules-summary .card-heading { flex:1; margin:0; }
.workflow-workspace .editorial-modules-summary .details-caret { flex:0 0 auto; color:#6337d8; transition:transform .2s ease; }
.workflow-workspace .editorial-modules-card[open] .editorial-modules-summary .details-caret { transform:rotate(180deg); }
.workflow-workspace .editorial-modules-body { display:grid; gap:14px; padding:0 22px 22px; }
.workflow-workspace .editorial-module-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; }
.workflow-workspace .editorial-module-toggle { display:flex; align-items:center; gap:9px; padding:11px 12px; border:1px solid #d9dde6; border-radius:9px; background:#f7f8fb; color:#26324a; font-size:.86rem; font-weight:700; }
.workflow-workspace .editorial-module-toggle input { accent-color:#6d42dc; }
.workflow-workspace .editorial-module-field { display:grid; gap:6px; }
.workflow-workspace .editorial-module-field > span { color:#26324a; font-size:.84rem; font-weight:750; }
.workflow-workspace .editorial-module-field textarea { width:100%; border:1px solid #d9dde6; border-radius:9px; padding:10px 12px; color:#111827; background:#fff; font:inherit; resize:vertical; }
.workflow-workspace .editorial-module-field small { font-size:.74rem; }
.workflow-workspace .editorial-module-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.workflow-workspace .stage-panel-actions .workspace-action { width: 100%; }
.workflow-workspace .review-flow-hint { display: grid; gap: 7px; margin: 2px 0 12px; padding: 11px 12px; border: 1px solid #e2dafb; border-radius: 10px; background: #faf8ff; color: #5a4a87; font-size: .78rem; line-height: 1.35; }
.workflow-workspace .review-flow-hint span { display: flex; align-items: center; gap: 8px; }
.workflow-workspace .review-flow-hint b { display: inline-grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #fff; background: #6b39dc; font-size: .72rem; }
.workflow-workspace .stage-complete-message { margin: 0; padding: 11px 12px; border: 1px solid #ccebd9; border-radius: 10px; color: #166534; background: #f0fdf4; font-size: .82rem; line-height: 1.45; }
.workflow-workspace .ai-completion-notices { display: grid; gap: 7px; margin: 2px 0 12px; padding: 11px 12px; border: 1px solid #b7e7c9; border-radius: 10px; color: #166534; background: #effcf4; font-size: .82rem; line-height: 1.4; }
.workflow-workspace .ai-completion-notices-heading { display: flex; align-items: center; gap: 7px; font-weight: 800; }
.workflow-workspace .ai-completion-notices-heading [data-icon] { width: 17px; height: 17px; color: #0e9f55; }
.workflow-workspace .ai-completion-notices ul { display: grid; gap: 3px; margin: 0; padding-left: 23px; }
.workflow-workspace .ai-completion-notices small { color: #4b7b5e; font-size: .74rem; }
.workflow-workspace .chapter-word-summary { color: #315f82; font-weight: 750; }
.workflow-workspace .review-note-excerpt { display: block; margin-top: 7px; color: #667085; line-height: 1.45; }
.workflow-workspace .review-note-open-link { margin-right: auto; }
.workflow-workspace .review-current-hint,
.workflow-workspace .review-readiness-hint,
.workflow-workspace .review-action-feedback { margin: 0; padding: 11px 12px; border: 1px solid #eadcfb; border-radius: 10px; color: #5a3b8f; background: #faf7ff; font-size: .82rem; line-height: 1.45; }
.workflow-workspace .review-readiness-hint,
.workflow-workspace .review-action-feedback.is-error { border-color: #f2b8b5; color: #a61b1b; background: #fff1f0; font-weight: 700; }
.workflow-workspace .review-action-feedback { min-height: 0; }
.workflow-workspace .review-action-feedback.is-success { border-color: #ccebd9; color: #166534; background: #f0fdf4; }
.workflow-workspace .portal-button:disabled { cursor: not-allowed; opacity: .65; }
.workflow-workspace .workspace-edit-link { display: block; width: 100%; box-sizing: border-box; text-align: center; }
.workflow-workspace .chapter-editor-top-actions { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #d9dde6; border-top: 0; background: #fafbfc; }
.workflow-workspace .chapter-editor-top-actions .portal-button { flex: 0 0 auto; }
.workflow-workspace .chapter-editor-top-actions .muted-label { font-size: .76rem; }
.workflow-workspace .rich-editor[data-edit-locked="true"] { cursor: not-allowed; background: #f7f8fa; }
.workflow-workspace .chapter-editor.is-editing-unlocked .chapter-editor-top-actions { background: #f3efff; }
.workflow-cover-preview { display: block; width: min(100%, 260px); max-height: 360px; margin: 7px auto 0; border: 1px solid #d9dde6; border-radius: 12px; object-fit: contain; box-shadow: 0 6px 16px rgba(22,28,45,.12); }
.workflow-cover-preview-link { display: block; width: fit-content; max-width: 100%; margin: 7px auto 0; border-radius: 12px; }
.workflow-cover-preview-link:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 4px; }
.workflow-generated-assets { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 4px; padding-top: 16px; border-top: 1px solid #e6e8ee; }
.workflow-generated-assets--only-illustrations .workflow-generated-illustrations { grid-column: 1 / -1; }
.workflow-cover-stack { display: grid; gap: 18px; min-width: 0; align-content: start; }
.workflow-generated-cover { min-width: 0; }
.workflow-generated-assets-label { display: block; margin-bottom: 7px; color: #111827; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.workflow-generated-assets-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.workflow-generated-assets-heading small { color: #667085; font-size: .72rem; }
.workflow-generated-assets-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.workflow-generated-illustrations { min-width: 0; }
.workflow-illustration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, auto)); gap: 8px; min-width: 0; }
.workflow-illustration-grid--cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.workflow-illustration-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.workflow-illustration-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.workflow-illustration-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.workflow-illustration-grid--cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.workflow-illustration-preview, .workflow-illustration-placeholder { display: flex; min-width: 0; aspect-ratio: 4 / 3; flex-direction: column; align-items: stretch; justify-content: flex-end; overflow: hidden; border: 1px solid #d9dde6; border-radius: 9px; background: #f5f6f8; text-decoration: none; }
.workflow-illustration-preview { position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.workflow-illustration-preview:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(22,28,45,.14); }
.workflow-illustration-preview:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 3px; }
.workflow-illustration-preview img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.workflow-illustration-preview span { position: absolute; right: 5px; bottom: 5px; left: 5px; padding: 4px 6px; border-radius: 5px; color: #fff; background: rgba(17,24,39,.72); font-size: .66rem; line-height: 1.1; text-align: center; }
.workflow-illustration-placeholder { align-items: center; justify-content: center; gap: 5px; border-style: dashed; color: #98a2b3; }
.workflow-illustration-placeholder span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #667085; background: #e6e8ee; font-size: .7rem; font-weight: 800; }
.workflow-illustration-placeholder small { font-size: .66rem; }
.workflow-illustration-preview-wrap { position: relative; min-width: 0; }
.workflow-illustration-preview-wrap .workflow-illustration-preview { width: 100%; }
.workflow-illustration-regenerate { position: absolute; right: 6px; bottom: 6px; z-index: 2; display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: #fff; background: rgba(31,41,55,.82); box-shadow: 0 2px 8px rgba(15,23,42,.22); cursor: pointer; }
.workflow-illustration-regenerate:hover, .workflow-illustration-regenerate:focus-visible { color: #fff; background: #6841d8; }
.workflow-illustration-regenerate .ui-icon { width: 15px; height: 15px; }
.workflow-illustration-placeholder.is-failed { border-color: #f0a0a0; color: #b42318; background: #fff6f6; }
.workflow-illustration-placeholder.is-failed .workflow-illustration-regenerate { right: 6px; bottom: 6px; }
.workflow-regenerate-pending, .workflow-regenerate-failed { margin-left: 0; white-space: nowrap; }
.image-style-picker { display: grid; grid-column: 1 / -1; gap: 10px; }
.image-style-picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #111827; }
.image-style-picker-heading small { color: #667085; font-size: .72rem; font-weight: 500; }
.image-style-picker-heading-secondary { margin-top: 8px; padding-top: 12px; border-top: 1px solid #e6e8ee; }
.image-style-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.image-style-option { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 1px solid #d9dde6; border-radius: 10px; color: #111827; background: #fff; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.image-style-option:hover { border-color: #9a7cf1; transform: translateY(-1px); }
.image-style-option.is-selected { border-color: #7040e4; box-shadow: 0 0 0 2px rgba(112,64,228,.15); background: #fbfaff; }
.image-style-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.image-style-option input:focus-visible + .image-style-thumb { outline: 3px solid rgba(112,64,228,.35); outline-offset: 2px; }
.image-style-thumb { position: relative; display: block; width: 76px; height: 58px; overflow: hidden; border-radius: 7px; background: #dbe3ed; }
.image-style-thumb img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }
.image-style-thumb::before, .image-style-thumb::after, .image-style-thumb i, .image-style-thumb b, .image-style-thumb em { position: absolute; display: block; content: ''; }
.image-style-thumb--photo { background: linear-gradient(145deg, #112b47 0%, #387b96 48%, #f0ba68 49%, #24384b 100%); }
.image-style-thumb--photo::before { width: 28px; height: 28px; left: 24px; top: 10px; border-radius: 50%; background: #f2c79b; box-shadow: 0 16px 0 10px #162b3d; }
.image-style-thumb--photo::after { width: 18px; height: 7px; right: 7px; top: 8px; border-radius: 50%; background: rgba(255,231,166,.8); transform: rotate(-25deg); }
.image-style-thumb--photo i { width: 34px; height: 2px; left: 8px; bottom: 12px; background: #f3d38a; box-shadow: 0 -7px 0 rgba(243,211,138,.6); }
.image-style-thumb--painting { background: radial-gradient(circle at 72% 28%, #ffd89a 0 8%, transparent 9%), linear-gradient(135deg, #e8b99b 0%, #9e6da1 48%, #3e527e 49%, #27364f 100%); }
.image-style-thumb--painting::before { width: 31px; height: 24px; left: 22px; top: 16px; border-radius: 55% 45% 48% 52%; background: #d88b68; box-shadow: 18px 7px 0 -6px #f1c39a; transform: rotate(-12deg); }
.image-style-thumb--painting::after { width: 46px; height: 12px; left: 13px; bottom: 6px; border-radius: 50%; background: rgba(245,207,137,.8); transform: rotate(-8deg); }
.image-style-thumb--painting i { width: 18px; height: 18px; right: 10px; bottom: 14px; border: 3px solid #f5d494; border-radius: 50%; }
.image-style-thumb--vector { background: linear-gradient(135deg, #e9f7f4 0 52%, #72c6c4 52% 100%); }
.image-style-thumb--vector::before { width: 30px; height: 30px; left: 20px; top: 12px; border-radius: 8px 18px 8px 18px; background: #237d91; transform: rotate(12deg); }
.image-style-thumb--vector::after { width: 22px; height: 22px; right: 10px; top: 9px; border: 3px solid #f2b84b; border-radius: 50%; }
.image-style-thumb--vector i { width: 43px; height: 4px; left: 10px; bottom: 10px; border-radius: 5px; background: #236c83; box-shadow: 0 -8px 0 #f2b84b; }
.image-style-option-copy { display: grid; gap: 2px; min-width: 0; }
.image-style-option-copy strong { font-size: .77rem; line-height: 1.2; }
.image-style-option-copy small { color: #667085; font-size: .67rem; line-height: 1.25; }
.design-action-buttons { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.design-action-buttons .workspace-action { width: 100% !important; min-width: 0 !important; }
.design-cost-note { display: block; line-height: 1.4; }
.workspace-stage-research .stage-panel-chapters,
.workspace-stage-research .stage-panel-export,
.workspace-stage-research .stage-panel-actions [data-ai-action="outline"],
.workspace-stage-research .stage-panel-actions [data-ai-action="review"],
.workspace-stage-research .stage-panel-actions [data-ai-action="humanize"],
.workspace-stage-research .stage-panel-actions [data-ai-action="cover"],
.workspace-stage-research .stage-panel-actions [data-ai-action="marketing"] { display: none; }
.workspace-stage-outline .stage-panel-results,
.workspace-stage-outline .stage-panel-export,
.workspace-stage-outline .stage-panel-actions [data-ai-action="research"],
.workspace-stage-outline .stage-panel-actions [data-ai-action="review"],
.workspace-stage-outline .stage-panel-actions [data-ai-action="humanize"],
.workspace-stage-outline .stage-panel-actions [data-ai-action="cover"],
.workspace-stage-outline .stage-panel-actions [data-ai-action="marketing"],
.workspace-stage-outline .stage-panel-actions [data-research-info] { display: none; }
.workspace-stage-writing .stage-panel-results,
.workspace-stage-writing .stage-panel-export,
.workspace-stage-writing .stage-panel-actions,
.workspace-stage-writing .chapter-add-form,
.workspace-stage-writing [data-chapter-feedback] { display: none; }
.workspace-stage-review .stage-panel-chapters,
.workspace-stage-review .stage-panel-export,
.workspace-stage-review .stage-panel-actions [data-ai-action="research"],
.workspace-stage-review .stage-panel-actions [data-ai-action="outline"],
.workspace-stage-review .stage-panel-actions [data-ai-action="cover"],
.workspace-stage-review .stage-panel-actions [data-ai-action="marketing"] { display: none; }
.workspace-stage-design .stage-panel-chapters,
.workspace-stage-design .stage-panel-results,
.workspace-stage-design .stage-panel-export,
.workspace-stage-design .stage-panel-actions [data-ai-action="research"],
.workspace-stage-design .stage-panel-actions [data-ai-action="outline"],
.workspace-stage-design .stage-panel-actions [data-ai-action="review"],
.workspace-stage-design .stage-panel-actions [data-ai-action="humanize"],
.workspace-stage-design .stage-panel-actions [data-ai-action="marketing"] { display: none; }
.workspace-stage-marketing .stage-panel-chapters,
.workspace-stage-marketing .stage-panel-export,
.workspace-stage-marketing .stage-panel-actions [data-ai-action="research"],
.workspace-stage-marketing .stage-panel-actions [data-ai-action="outline"],
.workspace-stage-marketing .stage-panel-actions [data-ai-action="review"],
.workspace-stage-marketing .stage-panel-actions [data-ai-action="humanize"],
.workspace-stage-marketing .stage-panel-actions [data-ai-action="cover"] { display: none; }
.workspace-stage-preview .stage-panel-chapters,
.workspace-stage-preview .stage-panel-results,
.workspace-stage-preview .stage-panel-actions { display: none; }
.workflow-workspace .workspace-content { min-width: 0; }
.workflow-workspace .workspace-sidebar { min-width: 0; }
@media (max-width: 800px) {
    .workflow-workspace .workspace-grid { grid-template-columns: 1fr; }
    .workflow-workspace .workspace-sidebar { order: -1; }
    .workflow-workspace .stage-panel-actions { margin-bottom: 0; }
}

/* Optional project details stay out of the way for first-time creators. */
.workflow-workspace .workspace-advanced { padding: 0; overflow: hidden; }
.workflow-workspace .workspace-advanced summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; cursor: pointer; list-style: none; color: #111827; font-weight: 750; }
.workflow-workspace .workspace-advanced summary::-webkit-details-marker { display: none; }
.workflow-workspace .workspace-advanced summary::after { content: none; }
.workflow-workspace .workspace-advanced .details-caret { margin-left: auto; color: #6337d8; transition: transform .2s ease; }
.workflow-workspace .workspace-advanced[open] .details-caret { transform: rotate(180deg); }
.workflow-workspace .workspace-advanced summary small { margin-left: auto; color: #667085; font-size: .72rem; font-weight: 500; }
.workflow-workspace .workspace-advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 20px 20px; }
.workflow-workspace .advanced-subsection { min-width: 0; padding-top: 16px; border-top: 1px solid #e7e9ee; }
.workflow-workspace .advanced-subsection .card-heading { margin-bottom: 12px; }
.workflow-workspace .advanced-subsection .card-heading h2 { font-family: inherit; font-size: 1rem; }

/* Reference workspace layout — broad, calm and readable for non-technical creators. */
.workflow-workspace .portal-shell.workspace-main {
    width: min(1240px, calc(100% - 48px));
    max-width: 1240px;
}
.workflow-workspace .workspace-main { padding-top: 34px; }
.workflow-workspace .workspace-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.workflow-workspace .workspace-back {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #101527;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
}
.workflow-workspace .workspace-back:hover { color: #6337d8; background: #f0ebff; }
.workflow-workspace .workspace-heading-copy { min-width: 0; }
.workflow-workspace .workspace-heading .portal-eyebrow,
.workflow-workspace .workspace-heading .project-status { display: none; }
.workflow-workspace .workspace-heading h1 {
    max-width: 1100px;
    margin: 0 0 5px;
    color: #101527;
    font-size: clamp(2rem, 3.15vw, 2.65rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}
.workflow-workspace .workspace-heading p { max-width: 1060px; margin: 0; font-size: .98rem; line-height: 1.45; }
.workflow-workspace .workspace-steps {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: #eceef2;
}
.workflow-workspace .workspace-step {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px;
    color: #667085;
    font-size: .82rem;
    font-weight: 500;
}
.workflow-workspace .workspace-step span {
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    color: #8993a6;
    border: 1px solid #cbd1db;
    border-radius: 50%;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: 0;
}
.workflow-workspace .workspace-step span::after { content: none !important; }
.workflow-workspace .workspace-step.is-current { color: #101527; background: #fff; box-shadow: 0 1px 4px rgba(17,24,39,.10); }
.workflow-workspace .workspace-step.is-current span { color: #14a05a; border-color: #14a05a; }
.workflow-workspace .workspace-step.is-complete { color: #667085; }
.workflow-workspace .workspace-step.is-complete span { color: #14a05a; border-color: #14a05a; }
.workflow-workspace .workspace-step.is-locked { opacity: .5; }
.workflow-workspace .workspace-grid { grid-template-columns: minmax(0, 1.6fr) minmax(330px, .76fr); gap: 20px; }
.workflow-workspace .workspace-content,
.workflow-workspace .workspace-sidebar { gap: 18px; }
.workflow-workspace .workspace-card { padding: 22px; border-radius: 14px; }
.workflow-workspace .card-heading { margin-bottom: 18px; }
.workflow-workspace .card-heading h2,
.workflow-workspace .ai-card h2,
.workflow-workspace .export-card h2 { font-size: 1.18rem; }
.workflow-workspace .workspace-advanced {
    width: 100%;
    margin-top: 18px;
}
.workflow-workspace .workspace-advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* The research result follows the reference hierarchy: score, title, two-column
   summaries, personas, then the supporting market details. */
.workflow-workspace.workspace-stage-research .workspace-grid { grid-template-columns: 1fr; }
.workflow-workspace.workspace-stage-research .workspace-sidebar { grid-template-columns: minmax(0, 1fr); }
.workflow-workspace.workspace-stage-research #stage-results {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.workflow-workspace.workspace-stage-research #stage-results > .card-heading { display: none; }
.workflow-workspace.workspace-stage-research #stage-results .output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.workflow-workspace.workspace-stage-research #stage-results .output-block {
    min-height: 0;
    padding: 22px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(22,28,45,.06);
}
.workflow-workspace.workspace-stage-research #stage-results .output-block h3 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
}
.workflow-workspace.workspace-stage-research #stage-results .output-research { grid-column: 1 / -1; }
.workflow-workspace.workspace-stage-research #stage-results .output-group { margin-top: 15px; }
.workflow-workspace.workspace-stage-research #stage-results .output-group > strong { color: #101527; font-size: .9rem; }
.workflow-workspace.workspace-stage-research #stage-results .output-list { margin-top: 8px; }
.workflow-workspace.workspace-stage-research #stage-results .output-badges { margin-top: 9px; }
.workflow-workspace.workspace-stage-research #stage-results .output-badges span { font-size: .75rem; }
.workflow-workspace.workspace-stage-research #stage-results .output-competitors,
.workflow-workspace.workspace-stage-research #stage-results .output-personas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.workflow-workspace.workspace-stage-research #stage-results .output-personas article,
.workflow-workspace.workspace-stage-research #stage-results .output-competitors article { padding: 14px; border-radius: 11px; }
.workflow-workspace.workspace-stage-research #stage-results .output-personas { margin-top: 10px; }
.workflow-workspace.workspace-stage-research #stage-results .output-score-line { margin-top: 12px; }
.workflow-workspace.workspace-stage-research .reference-output-card h3 {
    display: flex;
    align-items: center;
    gap: 9px;
}
.workflow-workspace.workspace-stage-research .reference-card-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: #6337d8;
    border-radius: 8px;
    background: #f0ebff;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: .9rem;
}
.workflow-workspace.workspace-stage-research .reference-score-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    column-gap: 20px;
}
.workflow-workspace.workspace-stage-research .reference-score-card h3 { grid-column: 2; grid-row: 1; margin: 0 0 6px; }
.workflow-workspace.workspace-stage-research .reference-score-line { grid-column: 1; grid-row: 1 / span 2; display: grid; justify-items: center; gap: 1px; border-right: 1px solid #d9dde6; padding-right: 20px; }
.workflow-workspace.workspace-stage-research .reference-score-line strong { color: #10a957; font-family: Georgia, serif; font-size: 3.2rem; line-height: .95; }
.workflow-workspace.workspace-stage-research .reference-score-line span { color: #667085; font-size: .76rem; }
.workflow-workspace.workspace-stage-research .reference-score-summary { grid-column: 2; grid-row: 2; margin: 0; line-height: 1.5; }
.workflow-workspace.workspace-stage-research .reference-title { display: block; color: #101527; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; line-height: 1.3; }
.workflow-workspace.workspace-stage-research .reference-title-editor { display: grid; gap: 8px; margin-bottom: 10px; }
.workflow-workspace.workspace-stage-research .reference-title-edit-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #d9dde6; border-radius: 9px; background: #fff; }
.workflow-workspace.workspace-stage-research .reference-title-edit-option input[type="radio"] { flex: 0 0 auto; accent-color: #6337d8; }
.workflow-workspace.workspace-stage-research .reference-title-edit-option input[type="text"] { min-width: 0; flex: 1 1 auto; border: 0; outline: 0; color: #101527; background: transparent; font: 600 .9rem/1.35 inherit; }
.workflow-workspace.workspace-stage-research .reference-title-edit-option:focus-within { border-color: #6337d8; box-shadow: 0 0 0 2px rgba(99,55,216,.1); }
.workflow-workspace.workspace-stage-research .reference-title-edit-option-custom { border-style: dashed; }
.workflow-workspace.workspace-stage-research .reference-card-text { margin: 8px 0 0; line-height: 1.5; }
.workflow-workspace.workspace-stage-research .reference-title-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.workflow-workspace.workspace-stage-research .reference-title-options .text-button { font-size: .78rem; }
.workflow-workspace.workspace-stage-research .reference-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.workflow-workspace.workspace-stage-research .reference-badges span { padding: 5px 10px; color: #5530be; border-radius: 999px; background: #f0ebff; font-size: .75rem; }
.workflow-workspace.workspace-stage-research .reference-bullet-list { display: grid; gap: 7px; margin: 9px 0 0; padding-left: 18px; color: #667085; font-size: .84rem; line-height: 1.4; }
.workflow-workspace.workspace-stage-research .reference-bullet-list li::marker { color: #6337d8; }
.workflow-workspace.workspace-stage-research .reference-persona-grid,
.workflow-workspace.workspace-stage-research .reference-competitor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.workflow-workspace.workspace-stage-research .reference-persona-grid article,
.workflow-workspace.workspace-stage-research .reference-competitor-grid article { min-width: 0; padding: 14px; border: 1px solid #d9dde6; border-radius: 11px; background: #f5f6f8; }
.workflow-workspace.workspace-stage-research .reference-persona-grid article > strong,
.workflow-workspace.workspace-stage-research .reference-competitor-grid article > strong { color: #101527; font-size: .9rem; }
.workflow-workspace.workspace-stage-research .reference-persona-profile { margin: 5px 0 0; font-size: .78rem; line-height: 1.45; }
.workflow-workspace.workspace-stage-research .reference-persona-label { margin: 11px 0 0; font-size: .76rem; font-weight: 700; }
.workflow-workspace.workspace-stage-research .reference-persona-label.is-pain { color: #e53935; }
.workflow-workspace.workspace-stage-research .reference-persona-label.is-goal { color: #0f9d54; }
.workflow-workspace.workspace-stage-research .reference-persona-grid .reference-bullet-list { gap: 3px; margin-top: 4px; padding-left: 14px; font-size: .74rem; }
.workflow-workspace.workspace-stage-research .reference-approve-button { grid-column: 1 / -1; justify-self: end; }
@media (max-width: 640px) {
    .workflow-workspace.workspace-stage-research .reference-score-card { grid-template-columns: 1fr; }
    .workflow-workspace.workspace-stage-research .reference-score-card h3,
    .workflow-workspace.workspace-stage-research .reference-score-summary { grid-column: 1; grid-row: auto; }
    .workflow-workspace.workspace-stage-research .reference-score-line { grid-column: 1; grid-row: auto; justify-items: start; border-right: 0; border-bottom: 1px solid #d9dde6; padding: 0 0 12px; }
}

@media (max-width: 840px) {
    .workflow-workspace .portal-shell.workspace-main { width: min(100% - 32px, 1240px); }
    .workflow-workspace .workspace-grid { grid-template-columns: 1fr; }
    .workflow-workspace .workspace-sidebar { order: -1; }
    .workflow-workspace.workspace-stage-research .workspace-sidebar { order: 0; }
}
@media (max-width: 640px) {
    .workflow-workspace .workspace-heading { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
    .workflow-workspace .workspace-heading h1 { font-size: 2rem; }
    .workflow-workspace .workspace-steps { grid-template-columns: repeat(7, minmax(96px, 1fr)); overflow-x: auto; justify-content: start; }
    .workflow-workspace .workspace-advanced-grid,
    .workflow-workspace.workspace-stage-research #stage-results .output-grid { grid-template-columns: 1fr; }
    .workflow-workspace.workspace-stage-research #stage-results .output-competitors,
    .workflow-workspace.workspace-stage-research #stage-results .output-personas { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .workflow-workspace .workspace-advanced-grid { grid-template-columns: 1fr; }
}

/* App shell: navegação lateral fixa para o ambiente autenticado. */
.app-sidebar {
    position: fixed;
    z-index: 45;
    inset: 0 auto 0 0;
    display: flex;
    width: 254px;
    min-height: 100vh;
    flex-direction: column;
    padding: 18px 14px 14px;
    border-right: 1px solid var(--lumina-line);
    color: var(--lumina-ink);
    background: var(--lumina-surface);
}
.sidebar-brand-wrap { display: flex; min-height: 72px; align-items: center; padding: 6px 12px; }
.sidebar-brand { display: inline-flex; align-items: center; width: 214px; text-decoration: none; }
.sidebar-brand img { display: block; width: 100%; height: auto; max-height: 56px; object-fit: contain; object-position: left center; }
.sidebar-context { display: grid; gap: 3px; margin: 18px 2px 15px; padding: 12px 13px; border: 1px solid #e1def5; border-radius: 11px; background: #f7f5ff; }
.sidebar-context span, .sidebar-group h2 { margin: 0; color: #7b6ac5; font-size: .59rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-context strong { color: var(--lumina-ink); font-size: .82rem; line-height: 1.15; }
.sidebar-context small { color: var(--lumina-muted); font-size: .65rem; }
.sidebar-context small b { margin-left: 3px; padding: 2px 5px; border-radius: 999px; color: var(--lumina-purple-dark); background: #ebe6ff; font-size: .57rem; font-weight: 800; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0 1px; scrollbar-width: thin; scrollbar-color: #d8d2f5 transparent; }
.sidebar-group { margin: 0 0 17px; }
.sidebar-group h2 { padding: 0 10px 6px; color: #8790a2; font-size: .57rem; }
.sidebar-link { display: flex; min-height: 35px; align-items: center; gap: 10px; margin: 2px 0; padding: 8px 10px; border-radius: 9px; color: #5e687c; font-size: .77rem; font-weight: 550; text-decoration: none; transition: color .16s ease, background .16s ease, transform .16s ease; }
.sidebar-link .ui-icon { width: 16px; height: 16px; color: #8290a4; stroke-width: 1.7; }
.sidebar-link:hover { color: var(--lumina-purple-dark); background: #f7f5ff; transform: translateX(2px); }
.sidebar-link:hover .ui-icon, .sidebar-link.is-active .ui-icon { color: var(--lumina-purple); }
.sidebar-link.is-active { color: var(--lumina-purple-dark); background: var(--lumina-lilac); font-weight: 750; box-shadow: inset 3px 0 0 var(--lumina-purple); }
.sidebar-footer { display: grid; gap: 10px; padding-top: 8px; }
.sidebar-tip { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #e1def5; border-radius: 10px; color: var(--lumina-muted); background: #faf9ff; text-decoration: none; }
.sidebar-tip:hover { border-color: #cfc3ff; background: #f7f5ff; }
.sidebar-tip-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--lumina-purple); background: var(--lumina-lilac); }
.sidebar-tip-icon .ui-icon { width: 14px; height: 14px; }
.sidebar-tip span:last-child { display: grid; gap: 2px; }
.sidebar-tip strong { color: var(--lumina-ink); font-size: .68rem; }
.sidebar-tip small { font-size: .63rem; line-height: 1.35; }
.sidebar-account { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px 7px 2px; border-top: 1px solid var(--lumina-line); }
.sidebar-avatar { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--lumina-purple-dark); background: var(--lumina-lilac); font-size: .7rem; font-weight: 800; }
.sidebar-account-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.sidebar-account-copy strong { overflow: hidden; color: var(--lumina-ink); font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy small { color: var(--lumina-muted); font-size: .62rem; }
.sidebar-logout { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 8px; color: var(--lumina-muted); background: transparent; cursor: pointer; }
.sidebar-logout:hover { border-color: #e1def5; color: var(--lumina-purple); background: #f7f5ff; }
.sidebar-logout .ui-icon { width: 15px; height: 15px; }
.sidebar-overlay { display: none; }
.sidebar-overlay[hidden] { display: none !important; }
.app-shell-topbar { z-index: 30; margin-left: 254px; }
.app-shell-topbar .dashboard-nav { width: min(calc(100% - 44px), 1450px); min-height: 62px; margin: 0 22px; gap: 18px; }
.app-breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--lumina-muted); font-size: .78rem; }
.app-breadcrumbs a { overflow: hidden; color: var(--lumina-muted); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.app-breadcrumbs a:hover { color: var(--lumina-purple); }
.app-breadcrumbs > span { color: #b3b8c5; }
.app-breadcrumbs strong { overflow: hidden; color: var(--lumina-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.app-shell-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-settings { padding: 7px 11px; border: 1px solid var(--lumina-line); border-radius: 8px; color: var(--lumina-muted); background: var(--lumina-surface); font-size: .7rem; font-weight: 700; text-decoration: none; }
.topbar-settings:hover { border-color: #cbbdff; color: var(--lumina-purple); background: #faf9ff; }
.app-shell-topbar .admin-release-badge { white-space: nowrap; }
.sidebar-toggle { display: none; width: 34px; height: 34px; flex: 0 0 auto; padding: 7px; border: 1px solid var(--lumina-line); border-radius: 8px; color: var(--lumina-muted); background: var(--lumina-surface); cursor: pointer; }
.sidebar-toggle span { display: block; width: 16px; height: 1.5px; margin: 3px auto; border-radius: 2px; background: currentColor; }
.app-sidebar ~ main.portal-shell { width: min(calc(100% - 300px), 1450px); margin-right: 22px; margin-left: 278px; }
.app-sidebar ~ main.portal-shell.dashboard-main,
.app-sidebar ~ main.portal-shell.workspace-main,
.app-sidebar ~ main.portal-shell.preview-main,
.app-sidebar ~ main.portal-shell.admin-main,
.app-sidebar ~ main.portal-shell.account-main { padding-top: 34px; }
.app-sidebar ~ main.portal-shell.workspace-main { width: min(calc(100% - 300px), 1450px); }
.app-sidebar ~ main.portal-shell.sales-request-main { width: min(calc(100% - 300px), 1450px); }

@media (max-width: 980px) {
    .app-sidebar { width: 228px; }
    .app-shell-topbar { margin-left: 228px; }
    .app-shell-topbar .dashboard-nav { width: min(calc(100% - 32px), 1450px); margin: 0 16px; }
    .app-sidebar ~ main.portal-shell { width: min(calc(100% - 262px), 1450px); margin-left: 244px; margin-right: 18px; }
}
@media (max-width: 760px) {
    .app-sidebar { width: min(286px, calc(100vw - 48px)); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 32px rgba(36, 28, 83, .12); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    .app-shell-topbar { margin-left: 0; }
    .app-shell-topbar .dashboard-nav { width: calc(100% - 28px); min-height: 58px; margin: 0 14px; }
    .sidebar-toggle { display: block; }
    .sidebar-overlay { position: fixed; z-index: 40; inset: 0; display: block; background: rgba(18, 21, 34, .26); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .app-sidebar ~ main.portal-shell,
    .app-sidebar ~ main.portal-shell.workspace-main,
    .app-sidebar ~ main.portal-shell.sales-request-main { width: calc(100% - 28px); margin-right: 14px; margin-left: 14px; }
    .app-sidebar ~ main.portal-shell.dashboard-main,
    .app-sidebar ~ main.portal-shell.workspace-main,
    .app-sidebar ~ main.portal-shell.preview-main,
    .app-sidebar ~ main.portal-shell.admin-main,
    .app-sidebar ~ main.portal-shell.account-main { padding-top: 28px; }
    .app-shell-actions { gap: 6px; }
    .topbar-settings { display: none; }
    .app-breadcrumbs { font-size: .73rem; }
}

/* Full-canvas layout — v2.77. Authenticated screens use the entire area
   beside the navigation. Public production screens get a wider canvas too,
   while the small auth/legal cards keep their readable line length. */
.dashboard-topbar:not(.app-shell-topbar) .dashboard-nav,
.plans-main,
.docs-manual,
.sales-request-main {
    width: min(calc(100% - 40px), 1500px);
    max-width: none;
}
.plans-main { width: min(calc(100% - 40px), 1500px); max-width: none; }
.portal-page.centered-layout .legal-main { width: min(calc(100% - 40px), 760px); max-width: none; }
.plans-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.docs-manual { width: min(calc(100% - 40px), 1500px); max-width: none; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: clamp(28px, 3vw, 56px); }
.docs-manual-content { max-width: none; }
.workflow-workspace .workspace-grid { grid-template-columns: minmax(0, 2.05fr) minmax(360px, .95fr); gap: clamp(20px, 2vw, 30px); }
.workflow-workspace.workspace-stage-writing .workspace-grid { grid-template-columns: 1fr; }
.workflow-workspace.workspace-stage-writing .workspace-content { width: 100%; }
.workflow-workspace .workspace-card { padding: clamp(22px, 2vw, 30px); }
body.portal-page.workflow-workspace .editorial-modules-card { padding: 0; }
.workflow-workspace .workspace-advanced-grid { gap: clamp(16px, 2vw, 28px); }
.onboarding-main .onboarding-shell { padding-left: 0; padding-right: 0; }

@media (min-width: 1440px) {
    .project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 760px) {
    .dashboard-topbar:not(.app-shell-topbar) .dashboard-nav,
    .plans-main, .docs-manual, .sales-request-main, .portal-page.centered-layout .legal-main { width: calc(100% - 28px); }
    .docs-manual { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 840px) {
    .workflow-workspace .workspace-grid { grid-template-columns: 1fr; }
    .workflow-workspace .workspace-sidebar { order: -1; }
}

.integration-config-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.integration-config-panel { min-width: 0; }
.integration-config-list { display: grid; gap: 10px; margin-top: 18px; }
.integration-config-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; padding: 14px; border: 1px solid var(--lumina-line, #d7e0ea); border-radius: 11px; background: #fbfcfe; }
.integration-config-row strong, .integration-config-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.integration-config-row small { margin-top: 4px; color: #70849b; font-size: .72rem; }
.integration-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.integration-row-actions .portal-button { min-height: 30px; }
.button-danger { border-color: #efb4b4 !important; color: #b42318 !important; background: #fff8f8 !important; }
.api-config-editor { margin-top: 18px; }
.api-config-editor[hidden] { display: none; }
.api-config-editor[data-api-editor-kind="ai_image"] [data-audio-option],
.api-config-editor[data-api-editor-kind="ai_text"] [data-audio-option],
.api-config-editor[data-api-editor-kind="ai_image"] [data-audio-option] input,
.api-config-editor[data-api-editor-kind="ai_image"] [data-audio-option] select { display: none !important; }
.api-config-editor[data-api-editor-kind="ai_audio"] [data-image-option],
.api-config-editor[data-api-editor-kind="ai_text"] [data-image-option] { display: none !important; }
.api-config-editor:has([name="kind"][value="ai_image"]) [data-audio-option],
.api-config-editor:has([name="kind"][value="ai_text"]) [data-audio-option],
.api-config-editor:has([name="kind"][value="ai_audio"]) [data-image-option],
.api-config-editor:has([name="kind"][value="ai_text"]) [data-image-option] { display: none !important; }
.form-grid { display: grid; gap: 14px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-span-2 { grid-column: span 2; }
.form-grid label { display: grid; gap: 7px; color: #17324e; font-size: .73rem; font-weight: 700; }
.form-grid input, .form-grid select, .form-actions input { min-height: 40px; border: 1px solid #bfd1e1; border-radius: 8px; padding: 0 11px; color: #17324e; background: #fff; font: inherit; }
.form-checkbox { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; padding-top: 24px; }
.form-checkbox input { min-height: auto; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.form-feedback { min-height: 1.2em; margin: 0; color: #24774b; font-size: .75rem; }
.form-feedback.is-error { color: #b42318; }
@media (max-width: 900px) { .integration-config-columns, .form-grid-3 { grid-template-columns: 1fr; } .form-span-2 { grid-column: auto; } .form-checkbox { padding-top: 0; } }
@media (max-width: 440px) {
    .app-shell-topbar .admin-release-badge { display: none; }
    .sidebar-brand { width: 190px; }
    .sidebar-brand-wrap { min-height: 64px; padding-left: 9px; padding-right: 9px; }
}

/* Admin canvas: use the full content area beside the fixed navigation. The
   utility screens stay aligned to one wide grid instead of inheriting the
   public 1120px marketing container. */
.app-shell-topbar .dashboard-nav {
    width: calc(100% - 44px);
    max-width: none;
}
.app-sidebar ~ main.portal-shell.admin-main {
    width: calc(100% - 322px);
    max-width: none;
    margin-left: 300px;
    margin-right: 22px;
}
.admin-main .dashboard-heading,
.admin-main .admin-page-header {
    width: 100%;
}
.admin-main .admin-heading-actions {
    max-width: 100%;
    justify-content: flex-end;
}
.admin-main .operation-summary-grid,
.admin-main .backup-summary-grid,
.admin-main .system-summary-grid,
.admin-main .usage-summary-grid,
.admin-main .integration-grid,
.admin-main .operations-layout,
.admin-main .system-layout,
.admin-main .system-detail-grid {
    min-width: 0;
}
.admin-main .workspace-card,
.admin-main .operation-card,
.admin-main .integration-card,
.admin-main .admin-tool-panel {
    min-width: 0;
}
.admin-main .admin-user-list,
.admin-main .admin-request-list,
.admin-main .admin-subscription-list,
.admin-main .admin-plan-list,
.admin-main .audit-list,
.admin-main .backup-list,
.admin-main .operation-list,
.admin-main .system-check-list {
    min-width: 0;
}
.admin-main .admin-user-row,
.admin-main .admin-request-row,
.admin-main .admin-subscription-row,
.admin-main .admin-plan-row,
.admin-main .audit-table-row {
    min-width: 0;
}

@media (max-width: 980px) {
    .app-sidebar ~ main.portal-shell.admin-main {
        width: calc(100% - 280px);
        margin-left: 260px;
        margin-right: 20px;
    }
}
@media (max-width: 760px) {
    .app-shell-topbar .dashboard-nav {
        width: calc(100% - 28px);
        max-width: none;
    }
    .app-sidebar ~ main.portal-shell.admin-main {
        width: calc(100% - 28px);
        max-width: none;
        margin-left: 14px;
        margin-right: 14px;
    }
}

/* Guided project creation belongs to the authenticated App Shell too. The
   inner onboarding canvas keeps its approved typography while the outer main
   aligns with Dashboard, Workspace and Administration. */
.app-sidebar ~ main.portal-shell.onboarding-main {
    width: calc(100% - 322px);
    max-width: none;
    margin-left: 300px;
    margin-right: 22px;
    padding-top: 34px;
}
.onboarding-main .onboarding-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 70px;
}
@media (max-width: 980px) {
    .app-sidebar ~ main.portal-shell.onboarding-main {
        width: calc(100% - 280px);
        margin-left: 260px;
        margin-right: 20px;
    }
}
@media (max-width: 760px) {
    .app-sidebar ~ main.portal-shell.onboarding-main {
        width: calc(100% - 28px);
        max-width: none;
        margin-left: 14px;
        margin-right: 14px;
        padding-top: 28px;
    }
    .onboarding-main .onboarding-shell { padding-bottom: 42px; }
}

/* Design system layout contract.
   Every authenticated page shares the same canvas: fixed navigation at the
   left, full-width content at the right, one gutter and the same card rhythm.
   Keep this block last so page-specific legacy max-width rules cannot shrink
   one menu item while the others use the full canvas. */
body.portal-page .app-sidebar ~ main.portal-shell {
    width: calc(100% - var(--ds-shell-main-left) - var(--ds-shell-main-right));
    max-width: var(--ds-shell-content-max);
    margin-left: var(--ds-shell-main-left);
    margin-right: var(--ds-shell-main-right);
}

/* Backup and restore workspace — follows the central administration canvas:
   wide two-column controls, quiet white surfaces and a real file table. */
.backup-admin-page .admin-main { padding-top: 34px; padding-bottom: 74px; }
.backup-page-header { align-items: end; margin-bottom: 24px; }
.backup-page-header h1 { margin-bottom: 7px; }
.backup-page-header p { max-width: 720px; }
.backup-top-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 14px; margin-bottom: 14px; }
.backup-panel { min-width: 0; padding: 25px 22px; border: 1px solid #d8e0ea; border-radius: 14px; color: #132b45; background: #fff; box-shadow: 0 5px 16px rgba(27, 53, 76, .05); }
.backup-panel h2 { margin: 0; color: #12263d; font: 700 1.05rem/1.2 var(--ds-font-sans); letter-spacing: -.02em; }
.backup-panel p { color: #6e8399; font-size: .78rem; line-height: 1.45; }
.backup-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.backup-panel-heading p { margin: 9px 0 0; }
.backup-status-pill, .backup-settings-saved { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; color: #21754a; background: #e6f7ed; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.backup-status-pill { color: var(--lumina-purple-dark); background: var(--lumina-lilac); }
.backup-scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.backup-scope-option { display: block; position: relative; min-height: 91px; padding: 14px 12px; border: 1px solid #cbd9e7; border-radius: 11px; background: #fff; cursor: pointer; }
.backup-scope-option input { position: absolute; opacity: 0; pointer-events: none; }
.backup-scope-option span { display: grid; gap: 5px; }
.backup-scope-option strong { color: #17324e; font-size: .75rem; }
.backup-scope-option small { color: #688099; font-size: .65rem; line-height: 1.4; }
.backup-scope-option b { position: absolute; top: 10px; right: 10px; color: #317092; font-size: .55rem; }
.backup-scope-option.is-selected { border-color: var(--lumina-purple); background: #f5f2ff; box-shadow: inset 3px 0 0 var(--lumina-purple), 0 0 0 1px rgba(103,56,213,.16); }
.backup-destination { margin: 18px 0 13px; overflow-wrap: anywhere; }
.backup-destination strong { color: var(--lumina-purple-dark); }
.backup-destination code { color: #58758e; font-size: .72rem; }
.backup-action-row { display: flex; align-items: center; gap: 14px; }
.backup-action-row .form-feedback { min-height: 0; }
.backup-policy-panel { padding-right: 30px; }
.backup-policy-list { display: grid; gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; color: #1b3550; font-size: .79rem; line-height: 1.5; }
.backup-policy-list li::before { margin-right: 7px; color: var(--lumina-purple); content: '•'; font-size: 1.1rem; }
.backup-policy-list strong { color: #12263d; }
.backup-settings-panel, .backup-files-panel { margin-bottom: 14px; }
.backup-settings-form { display: grid; grid-template-columns: 1.2fr 1.05fr 1.1fr 1.1fr; gap: 12px; align-items: end; }
.backup-settings-form label { display: grid; gap: 7px; color: #17324e; font-size: .7rem; font-weight: 750; }
.backup-settings-form input { width: 100%; min-height: 39px; border: 1px solid #bfd1e1; border-radius: 8px; padding: 0 10px; color: #17324e; background: #f8fbfd; font: inherit; font-size: .76rem; }
.backup-settings-form input:focus { border-color: var(--lumina-purple); outline: 0; box-shadow: 0 0 0 3px rgba(103,56,213,.12); }
.backup-settings-actions { display: flex; align-items: center; gap: 14px; grid-column: 1 / -1; padding-top: 1px; }
.backup-retention-button { color: var(--lumina-purple); font-size: .72rem; }
.backup-file-table-wrap { overflow-x: auto; }
.backup-file-table { width: 100%; min-width: 780px; border-collapse: collapse; color: #17324e; font-size: .72rem; }
.backup-file-table th { padding: 9px 12px; border-bottom: 1px solid #d2dfeb; color: #678199; background: #f4f8fb; font-size: .59rem; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.backup-file-table td { padding: 13px 12px; border-bottom: 1px solid #dce6ef; vertical-align: middle; white-space: nowrap; }
.backup-file-table td:first-child { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.backup-file-table td:first-child strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.backup-file-table tbody tr:hover { background: #f8fbfd; }
.backup-file-table .portal-button { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: .67rem; }
.backup-row-actions { display: flex; min-width: 142px; align-items: center; gap: 14px; padding: 2px 0; }
.backup-row-actions .portal-button { height: 36px; min-height: 36px; box-sizing: border-box; line-height: 1; }
.backup-delete-button { display: inline-flex; width: 38px; min-width: 38px; height: 36px; align-items: center; justify-content: center; margin-left: 2px; padding: 0 !important; color: #a13b4b !important; border: 1px solid #dfc4cc !important; background: #fff !important; box-shadow: none !important; }
.backup-delete-button:hover { color: #8f2d3e !important; border-color: #c98e9b !important; background: #fff5f6 !important; }
.backup-delete-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.backup-integrity { display: inline-flex; min-height: 23px; align-items: center; padding: 0 8px; border: 1px solid; border-radius: 999px; font-size: .61rem; font-weight: 800; }
.backup-integrity.is-valid { border-color: #9cddba; color: #21754a; background: #eefbf3; }
.backup-integrity.is-legacy { border-color: #eed393; color: #9b6c16; background: #fff9e7; }
.backup-empty-state { padding: 28px 12px; text-align: center; }
.backup-restore-dialog { width: min(470px, calc(100% - 28px)); border: 1px solid #d4deeb; border-radius: 14px; padding: 24px; color: #17324e; box-shadow: 0 24px 70px rgba(20,42,65,.2); }
.backup-restore-dialog::backdrop { background: rgba(16,34,54,.32); }
.backup-restore-dialog h2 { margin: 8px 0; color: #12263d; font: 700 1.35rem/1.15 Georgia, serif; }
.backup-restore-dialog p { color: #687f96; font-size: .78rem; line-height: 1.5; }
.backup-restore-dialog label { display: grid; gap: 7px; margin-top: 15px; color: #17324e; font-size: .73rem; font-weight: 750; }
.backup-restore-dialog input { min-height: 40px; border: 1px solid #bfd1e1; border-radius: 8px; padding: 0 10px; color: #17324e; font: inherit; }
.backup-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
@media (max-width: 980px) {
    .backup-top-grid { grid-template-columns: 1fr; }
    .backup-settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .backup-panel { padding: 20px 16px; }
    .backup-panel-heading { align-items: stretch; flex-direction: column; }
    .backup-scope-grid { grid-template-columns: 1fr; }
    .backup-scope-option { min-height: 76px; }
    .backup-settings-form { grid-template-columns: 1fr; }
    .backup-settings-actions { align-items: stretch; flex-direction: column; }
    .backup-action-row { align-items: stretch; flex-direction: column; }
}
body.portal-page .app-sidebar ~ main.portal-shell.dashboard-main,
body.portal-page .app-sidebar ~ main.portal-shell.workspace-main,
body.portal-page .app-sidebar ~ main.portal-shell.preview-main,
body.portal-page .app-sidebar ~ main.portal-shell.admin-main,
body.portal-page .app-sidebar ~ main.portal-shell.account-main,
body.portal-page .app-sidebar ~ main.portal-shell.plans-main,
body.portal-page .app-sidebar ~ main.portal-shell.docs-layout,
body.portal-page .app-sidebar ~ main.portal-shell.sales-request-main,
body.portal-page .app-sidebar ~ main.portal-shell.onboarding-main {
    padding-top: var(--ds-page-top);
}
body.portal-page .app-sidebar ~ main.portal-shell :is(.workspace-card, .project-form-card, .operation-card, .integration-card, .security-card, .admin-card, .preview-checklist article, .preview-export-card, .commercial-release-card, .plan-card, .flow-card) {
    border-radius: var(--ds-radius-md);
}
body.portal-page .app-sidebar ~ main.portal-shell :is(.workspace-card, .project-form-card, .operation-card, .integration-card, .security-card, .admin-card, .preview-checklist article, .preview-export-card, .commercial-release-card, .plan-card, .flow-card) {
    border-color: var(--lumina-line);
}
body.portal-page .app-sidebar ~ main.portal-shell :is(.dashboard-heading, .workspace-heading, .preview-heading, .lumina-page-heading) {
    width: 100%;
    max-width: none;
}
body.portal-page .app-sidebar ~ main.portal-shell :is(.workspace-heading h1, .dashboard-heading h1, .preview-heading h1) {
    max-width: none;
}
body.portal-page .app-sidebar ~ main.portal-shell .docs-content {
    max-width: none;
}

@media (max-width: 980px) {
    body.portal-page .app-sidebar ~ main.portal-shell {
        width: calc(100% - 280px);
        margin-left: 260px;
        margin-right: 20px;
    }
}
@media (max-width: 760px) {
    body.portal-page .app-sidebar ~ main.portal-shell {
        width: calc(100% - 28px);
        margin-left: 14px;
        margin-right: 14px;
    }
    body.portal-page .app-sidebar ~ main.portal-shell.dashboard-main,
    body.portal-page .app-sidebar ~ main.portal-shell.workspace-main,
    body.portal-page .app-sidebar ~ main.portal-shell.preview-main,
    body.portal-page .app-sidebar ~ main.portal-shell.admin-main,
    body.portal-page .app-sidebar ~ main.portal-shell.account-main,
    body.portal-page .app-sidebar ~ main.portal-shell.plans-main,
    body.portal-page .app-sidebar ~ main.portal-shell.docs-layout,
    body.portal-page .app-sidebar ~ main.portal-shell.sales-request-main,
    body.portal-page .app-sidebar ~ main.portal-shell.onboarding-main {
        padding-top: 28px;
    }
}

/* Workspace visual refinement — v2.84.
   The application sidebar is intentionally excluded: only the project canvas
   and its editorial stages use this LuminaBook presentation. */
body.portal-page.workflow-workspace {
    --workspace-ink: #101527;
    --workspace-muted: #667085;
    --workspace-line: #d9dde6;
    --workspace-soft: #f5f6f8;
    --workspace-purple: #6738d5;
    background: #f6f7f9;
}
body.portal-page.workflow-workspace .app-shell-topbar {
    background: #fff;
}
body.portal-page.workflow-workspace .workspace-main {
    padding-top: 24px;
    padding-bottom: 72px;
}
body.portal-page.workflow-workspace .workspace-heading {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 17px;
}
body.portal-page.workflow-workspace .workspace-back {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    margin-top: 5px;
    border-radius: 50%;
    color: var(--workspace-ink);
    font-size: 1.1rem;
    text-decoration: none;
}
body.portal-page.workflow-workspace .workspace-back:hover {
    color: var(--workspace-purple);
    background: var(--lumina-lilac);
}
body.portal-page.workflow-workspace .workspace-heading-copy .portal-eyebrow {
    display: none;
}
body.portal-page.workflow-workspace .workspace-heading h1 {
    margin: 0 0 3px;
    color: var(--workspace-ink);
    font: 700 clamp(1.55rem, 2.7vw, 2.15rem)/1.12 Georgia, "Times New Roman", serif;
    letter-spacing: -.045em;
}
body.portal-page.workflow-workspace .workspace-heading p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: .82rem;
}
body.portal-page.workflow-workspace .workspace-heading .project-length {
    margin-top: 7px;
    color: #8790a2;
    font-size: .7rem;
}
body.portal-page.workflow-workspace .workspace-heading .project-status {
    align-self: start;
    margin-top: 4px;
    padding: 5px 9px;
    color: #166534;
    background: #dcfce7;
    font-size: .63rem;
}
body.portal-page.workflow-workspace .workspace-steps {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 20px;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: #eceef2;
}
body.portal-page.workflow-workspace .workspace-step {
    min-height: 30px;
    gap: 5px;
    color: #667085;
    font-size: .72rem;
    font-weight: 500;
}
body.portal-page.workflow-workspace .workspace-step span {
    display: inline-grid;
    width: 13px;
    height: 13px;
    place-items: center;
    border: 1px solid #18a957;
    border-radius: 50%;
    color: #18a957;
    font-size: .57rem;
    line-height: 1;
}
body.portal-page.workflow-workspace .workspace-step:not(.is-complete):not(.is-locked) span {
    font-size: 0;
}
body.portal-page.workflow-workspace .workspace-step:not(.is-complete):not(.is-locked) span::after {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #18a957;
    content: "";
}
body.portal-page.workflow-workspace .workspace-step.is-current,
body.portal-page.workflow-workspace .workspace-step:hover {
    color: var(--workspace-ink);
    background: #fff;
    box-shadow: 0 1px 4px rgba(17, 24, 39, .1);
    transform: none;
}
body.portal-page.workflow-workspace .workspace-step.is-complete {
    color: #4d6174;
}
body.portal-page.workflow-workspace .workspace-step.is-locked {
    opacity: .48;
}
body.portal-page.workflow-workspace .workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
body.portal-page.workflow-workspace .project-job-queue {
    margin-bottom: 16px;
    overflow: hidden;
    padding: 0;
}
body.portal-page.workflow-workspace .project-job-queue-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    cursor: pointer;
    list-style: none;
}
body.portal-page.workflow-workspace .project-job-queue-summary::-webkit-details-marker { display: none; }
body.portal-page.workflow-workspace .project-job-queue-summary:focus-visible { outline: 3px solid rgba(112, 70, 223, .3); outline-offset: -3px; }
body.portal-page.workflow-workspace .project-job-queue-title { display: grid; gap: 5px; min-width: 0; }
body.portal-page.workflow-workspace .project-job-queue-title h2 { margin: 0; }
body.portal-page.workflow-workspace .project-job-queue-state { color: #66758d; font-size: .82rem; line-height: 1.4; }
body.portal-page.workflow-workspace .project-job-queue-caret { display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; color: #66758d; transition: transform .18s ease; }
body.portal-page.workflow-workspace .project-job-queue[open] .project-job-queue-caret { transform: rotate(180deg); }
body.portal-page.workflow-workspace .project-job-queue-content { padding: 0 20px 18px; }
body.portal-page.workflow-workspace .project-job-queue-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }
body.portal-page.workflow-workspace .project-job-queue .queue-policy { margin: 0 0 12px; }
body.portal-page.workflow-workspace .job-item { padding: 12px 14px; }
body.portal-page.workflow-workspace .job-item header { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
body.portal-page.workflow-workspace .job-item strong { overflow: visible; text-overflow: clip; text-transform: none; white-space: normal; }
body.portal-page.workflow-workspace .job-queue-number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #5630bf; background: #eee9fc; font-size: .76rem; font-weight: 750; }
body.portal-page.workflow-workspace .job-item small { line-height: 1.5; }
@media (max-width: 620px) {
    body.portal-page.workflow-workspace .project-job-queue-summary { padding: 15px; }
    body.portal-page.workflow-workspace .project-job-queue-content { padding: 0 15px 15px; }
    body.portal-page.workflow-workspace .job-item header { grid-template-columns: 26px minmax(0, 1fr); }
    body.portal-page.workflow-workspace .job-item .job-status { grid-column: 2; justify-self: start; }
}
body.portal-page.workflow-workspace .workspace-sidebar {
    display: contents;
}
body.portal-page.workflow-workspace .stage-panel-actions {
    order: -2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .38fr);
    align-items: end;
    gap: 12px 20px;
    padding: 19px 22px;
    border-radius: 14px;
    background: #fff;
}
body.portal-page.workflow-workspace .stage-panel-actions > .portal-eyebrow,
body.portal-page.workflow-workspace .stage-panel-actions > h2,
body.portal-page.workflow-workspace .stage-panel-actions > p,
body.portal-page.workflow-workspace .stage-panel-actions > .review-flow-hint,
body.portal-page.workflow-workspace .stage-panel-actions > .review-current-hint,
body.portal-page.workflow-workspace .stage-panel-actions > .review-readiness-hint,
body.portal-page.workflow-workspace .stage-panel-actions > .stage-complete-message,
body.portal-page.workflow-workspace .stage-panel-actions > .workspace-edit-link,
body.portal-page.workflow-workspace .stage-panel-actions > .muted-label {
    grid-column: 1 / -1;
}
body.portal-page.workflow-workspace .stage-panel-actions h2 {
    margin: 0;
    font: 700 1.2rem/1.2 Georgia, "Times New Roman", serif;
    letter-spacing: -.025em;
}
body.portal-page.workflow-workspace .stage-panel-actions > p {
    margin: -7px 0 0;
    font-size: .78rem;
}
body.portal-page.workflow-workspace .stage-panel-actions .workspace-action {
    width: auto;
    min-width: 170px;
    justify-self: end;
}
/* A rotina concluída continua disponível para nova execução, mas recebe uma
 * cor de aviso para reduzir cliques acidentais que consumam créditos. */
body.portal-page.workflow-workspace :is(.portal-button, .text-button).is-generation-complete {
    color: #fff !important;
    border-color: #d97706 !important;
    background: #f59e0b !important;
    box-shadow: 0 5px 12px rgba(217, 119, 6, .22) !important;
}
body.portal-page.workflow-workspace :is(.portal-button, .text-button).is-generation-complete:hover {
    color: #fff !important;
    background: #d97706 !important;
    filter: none;
}
body.portal-page.workflow-workspace .text-button.is-generation-complete {
    padding: 6px 10px;
    border-radius: 8px;
}
/* Alterações locais ou uma revisão estrutural antiga exigem nova execução.
 * O vermelho diferencia este estado do laranja de rotina concluída. */
body.portal-page.workflow-workspace :is(.portal-button, .text-button).is-generation-stale {
    color: #fff !important;
    border-color: #b91c1c !important;
    background: #dc2626 !important;
    box-shadow: 0 5px 12px rgba(185, 28, 28, .22) !important;
}
body.portal-page.workflow-workspace :is(.portal-button, .text-button).is-generation-stale:hover {
    color: #fff !important;
    background: #b91c1c !important;
    filter: none;
}
body.portal-page.workflow-workspace .text-button.is-generation-stale {
    padding: 6px 10px;
    border-radius: 8px;
}
body.portal-page.workflow-workspace .stage-panel-actions .workspace-input {
    min-height: 40px;
    background: #fff;
}
body.portal-page.workflow-workspace .stage-panel-actions .process-progress {
    grid-column: 1 / -1;
    margin-top: 0;
    padding: 14px;
    background: var(--workspace-soft);
}
body.portal-page.workflow-workspace .stage-panel-actions > .workflow-cover-preview-link,
body.portal-page.workflow-workspace .stage-panel-actions > .workflow-generated-assets,
body.portal-page.workflow-workspace .stage-panel-actions > .form-feedback {
    grid-column: 1 / -1;
}
body.portal-page.workflow-workspace.workspace-stage-writing .stage-panel-actions,
body.portal-page.workflow-workspace.workspace-stage-preview .stage-panel-actions {
    display: none;
}
body.portal-page.workflow-workspace.workspace-stage-writing .stage-panel-actions {
    display: grid;
}
body.portal-page.workflow-workspace .workspace-card {
    padding: clamp(18px, 2vw, 26px);
    border: 1px solid var(--workspace-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(17, 24, 39, .05);
}
body.portal-page.workflow-workspace .card-heading {
    margin-bottom: 15px;
}
body.portal-page.workflow-workspace .card-heading h2 {
    margin-top: 5px;
    font: 700 1.22rem/1.2 Georgia, "Times New Roman", serif;
    letter-spacing: -.03em;
}
body.portal-page.workflow-workspace .stage-lead {
    margin: -3px 0 15px;
    color: var(--workspace-muted);
    font-size: .78rem;
}
body.portal-page.workflow-workspace .chapter-list {
    gap: 8px;
}
body.portal-page.workflow-workspace .chapter-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--workspace-line);
    border-radius: 11px;
    background: #fff;
}
body.portal-page.workflow-workspace .chapter-row:nth-child(even) {
    background: var(--workspace-soft);
}
body.portal-page.workflow-workspace .chapter-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--workspace-purple);
    background: var(--lumina-lilac);
    font-size: .7rem;
}
body.portal-page.workflow-workspace .chapter-main strong {
    color: var(--workspace-ink);
    font-size: .8rem;
}
body.portal-page.workflow-workspace .chapter-main span,
body.portal-page.workflow-workspace .chapter-main small {
    color: var(--workspace-muted);
    font-size: .69rem;
}
body.portal-page.workflow-workspace .chapter-row > .text-button {
    padding: 6px 10px;
    border: 1px solid #d1c7fb;
    border-radius: 8px;
    background: #faf9ff;
    font-size: .7rem;
}
body.portal-page.workflow-workspace .output-grid {
    gap: 12px;
}
body.portal-page.workflow-workspace .output-block,
body.portal-page.workflow-workspace .output-marketing,
body.portal-page.workflow-workspace .output-review {
    border-color: var(--workspace-line);
    border-radius: 12px;
    background: var(--workspace-soft);
}
body.portal-page.workflow-workspace .output-block {
    padding: 16px;
}
body.portal-page.workflow-workspace .output-block h3 {
    font: 700 .95rem/1.25 Georgia, "Times New Roman", serif;
}
body.portal-page.workflow-workspace .review-note {
    padding: 12px 13px;
    border-top-color: var(--workspace-line);
    color: var(--workspace-muted);
    font-size: .78rem;
}
body.portal-page.workflow-workspace .review-note:nth-child(even) {
    background: #fff;
}
body.portal-page.workflow-workspace .review-note-status {
    border-color: var(--workspace-line);
    color: var(--workspace-ink);
    background: #fff;
}
body.portal-page.workflow-workspace .workflow-cover-preview {
    width: min(100%, 280px);
    max-height: 390px;
    border-radius: 8px;
}
body.portal-page.workflow-workspace .workflow-cover-preview-link { width: fit-content; max-width: 100%; margin: 0 auto; }
body.portal-page.workflow-workspace .design-action-buttons { grid-column: 1 / -1; }
body.portal-page.workflow-workspace .image-style-picker { display: grid; grid-column: 1 / -1; gap: 10px; }
body.portal-page.workflow-workspace .image-style-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
body.portal-page.workflow-workspace .image-style-option { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; }
@media (max-width: 620px) {
    body.portal-page.workflow-workspace .design-action-buttons,
    body.portal-page.workflow-workspace .image-style-options { grid-template-columns: 1fr; }
    body.portal-page.workflow-workspace .image-style-option { grid-template-columns: 86px minmax(0, 1fr); }
    body.portal-page.workflow-workspace .workflow-generated-assets { grid-template-columns: 1fr; }
}
body.portal-page.workflow-workspace .export-card {
    /* The export card contains a vertical sequence of headings, actions and
       the generated-files table. It must not inherit the two-column layout
       used by other workspace cards. */
    grid-template-columns: minmax(0, 1fr);
}
body.portal-page.workflow-workspace .export-card > .generated-files-card {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
body.portal-page.workflow-workspace .export-card > .export-actions,
body.portal-page.workflow-workspace .export-card > .export-format-note,
body.portal-page.workflow-workspace .export-card > [data-export-feedback] {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
body.portal-page.workflow-workspace .generated-files-table {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}
body.portal-page.workflow-workspace .workspace-advanced {
    margin-top: 2px;
    border-color: var(--workspace-line);
    background: #fff;
}

/* Dashboard and preview use the same cards and rhythm as the reference tool. */
body.portal-page.dashboard-page .dashboard-main,
body.portal-page.preview-page .preview-main {
    padding-top: 26px;
}
body.portal-page.dashboard-page .dashboard-heading h1,
body.portal-page.preview-page .preview-heading h1 {
    font: 700 clamp(1.8rem, 3vw, 2.55rem)/1.12 Georgia, "Times New Roman", serif;
    letter-spacing: -.045em;
}
body.portal-page.dashboard-page .project-grid {
    gap: 14px;
}
body.portal-page.dashboard-page .project-card {
    min-height: 174px;
    padding: 20px;
}
body.portal-page.dashboard-page .project-card h2 {
    margin-top: 18px;
    font-size: 1.1rem;
}
body.portal-page.dashboard-page .project-card-meta {
    min-height: 31px;
    padding-right: 78px;
}
body.portal-page.dashboard-page .project-card-identity {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
body.portal-page.dashboard-page .project-card-number {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid #d9ccff;
    border-radius: 999px;
    color: #5b35c5;
    background: #f3efff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}
body.portal-page.dashboard-page .project-card-meta time {
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.portal-page.dashboard-page .project-card-actions {
    top: 12px;
    right: 12px;
    gap: 6px;
}
body.portal-page.dashboard-page .project-card.is-editing {
    grid-column: span 1;
}
body.portal-page.dashboard-page .project-card-editor {
    position: relative;
    z-index: 2;
    margin: 18px -20px -20px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--lumina-line);
    border-radius: 0 0 14px 14px;
    background: #fbfcfe;
}
body.portal-page.dashboard-page .project-card-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--lumina-ink);
    font-size: .9rem;
}
body.portal-page.dashboard-page .project-card-edit-form {
    display: grid;
    gap: 13px;
}
body.portal-page.dashboard-page .project-card-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}
body.portal-page.dashboard-page .project-card-edit-grid label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--lumina-muted);
    font-size: .75rem;
    font-weight: 700;
}
body.portal-page.dashboard-page .project-card-edit-grid .project-card-edit-wide {
    grid-column: 1 / -1;
}
body.portal-page.dashboard-page .project-card-edit-grid input,
body.portal-page.dashboard-page .project-card-edit-grid textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid var(--lumina-line);
    border-radius: 8px;
    color: var(--lumina-ink);
    background: #fff;
    font: inherit;
    font-weight: 400;
    resize: vertical;
}
body.portal-page.dashboard-page .project-card-edit-form .form-actions {
    align-items: center;
    margin-top: 0;
}
body.portal-page.dashboard-page .project-card-edit-form .form-feedback {
    min-height: 0;
}
body.portal-page.dashboard-page .project-edit-impact {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid #d7e4f1;
    border-radius: 9px;
    color: #38536e;
    background: #f3f8fc;
    font-size: .75rem;
    line-height: 1.45;
}
body.portal-page.dashboard-page .project-edit-impact strong {
    color: #1f3650;
}
body.portal-page.dashboard-page .project-edit-impact ul {
    margin: 2px 0 0 18px;
    padding: 0;
}
body.portal-page.dashboard-page .project-edit-impact small {
    color: #637b91;
}
@media (max-width: 560px) {
    body.portal-page.dashboard-page .project-card-meta {
        padding-right: 74px;
    }
    body.portal-page.dashboard-page .project-card-actions {
        top: 12px;
        right: 12px;
    }
    body.portal-page.dashboard-page .project-card-edit-grid {
        grid-template-columns: 1fr;
    }
    body.portal-page.dashboard-page .project-card-edit-grid .project-card-edit-wide {
        grid-column: auto;
    }
}
body.portal-page.preview-page .preview-heading {
    margin-bottom: 18px;
}
body.portal-page.preview-page .preview-checklist {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
body.portal-page.preview-page .preview-checklist article {
    min-height: 70px;
    padding: 13px;
    border-radius: 11px;
}
body.portal-page.preview-page .book-preview {
    width: min(100%, 980px);
    padding: clamp(22px, 4vw, 48px);
    border-radius: 12px;
    background: #fff;
}
body.portal-page.preview-page .book-preview-title h2 {
    font: 700 clamp(2rem, 4vw, 3.15rem)/1.1 Georgia, "Times New Roman", serif;
}
body.portal-page.preview-page .book-preview-toc {
    padding: 18px 22px;
    border: 1px solid var(--workspace-line);
    background: var(--workspace-soft);
}

@media (max-width: 840px) {
    body.portal-page.workflow-workspace .stage-panel-actions {
        grid-template-columns: 1fr;
    }
    body.portal-page.workflow-workspace .stage-panel-actions .workspace-action {
        width: 100%;
        justify-self: stretch;
    }
    body.portal-page.preview-page .preview-checklist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    body.portal-page.workflow-workspace .workspace-heading {
        grid-template-columns: 25px minmax(0, 1fr);
    }
    body.portal-page.workflow-workspace .workspace-heading .project-status {
        grid-column: 2;
        justify-self: start;
    }
    body.portal-page.workflow-workspace .workspace-steps {
        grid-template-columns: repeat(7, minmax(96px, 1fr));
        overflow-x: auto;
        justify-content: start;
    }
    body.portal-page.workflow-workspace .chapter-row {
        grid-template-columns: 30px minmax(0, 1fr);
    }
    body.portal-page.workflow-workspace .chapter-row > .text-button,
    body.portal-page.workflow-workspace .chapter-editor {
        grid-column: 2;
        justify-self: start;
    }
    body.portal-page.preview-page .preview-checklist {
        grid-template-columns: 1fr;
    }
}

/* Final book presentation — v2.85. */
body.portal-page.preview-page .book-preview-cover-page {
    min-height: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 0 38px;
    text-align: center;
    break-after: page;
}
body.portal-page.preview-page .book-preview-cover-page .book-preview-cover {
    margin-bottom: 28px;
}
body.portal-page.preview-page .book-preview-cover-page .book-preview-title {
    width: min(100%, 760px);
    padding: 0 0 12px;
    border-bottom: 0;
}
body.portal-page.preview-page .book-preview-cover-page .book-preview-title h2 {
    margin: 10px 0 8px;
}
body.portal-page.preview-page .book-preview-credit {
    margin: 17px 0 0 !important;
    color: #234d6f !important;
    font-size: 1rem !important;
    font-weight: 750;
}
body.portal-page.preview-page .book-preview-imprint {
    margin: 7px 0 0 !important;
    color: #64748b !important;
    font-size: .82rem !important;
}
body.portal-page.preview-page .book-preview-toc-page {
    min-height: 440px;
    margin-top: 0;
    padding: 32px 26px;
    break-after: page;
}
body.portal-page.preview-page .book-preview-toc-page strong {
    display: block;
    margin-bottom: 14px;
    font: 700 1.35rem Georgia, "Times New Roman", serif;
}
body.portal-page.preview-page .book-preview-chapter {
    min-height: 600px;
    padding-top: 34px;
    margin-top: 0;
    border-top: 0;
    break-before: page;
}
body.portal-page.preview-page .book-preview-chapter:first-child {
    padding-top: 34px;
    margin-top: 0;
}
body.portal-page.preview-page .book-preview-chapter h3 {
    font-family: Georgia, "Times New Roman", serif;
}

/* Compact progress disclosure — details stay closed until the user asks. */
body.portal-page .process-progress {
    display: block;
    padding: 0;
    overflow: hidden;
}
body.portal-page .process-progress-summary {
    display: block;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}
body.portal-page .process-progress-summary::-webkit-details-marker { display: none; }
body.portal-page .process-progress-summary::after {
    float: right;
    width: 1rem;
    height: 1rem;
    margin-left: 12px;
    content: '';
    background: currentColor;
    color: var(--lumina-purple, #6337d8);
    -webkit-mask: url('/assets/phosphor-icons.svg#caret-down') center / contain no-repeat;
    mask: url('/assets/phosphor-icons.svg#caret-down') center / contain no-repeat;
}
body.portal-page .process-progress[open] .process-progress-summary::after {
    transform: rotate(180deg);
}
body.portal-page .process-progress-body {
    display: grid;
    gap: 10px;
    padding: 0 16px 16px;
}
body.portal-page .process-progress-summary .process-progress-head { margin: 0; }
body.portal-page .process-progress-summary:focus-visible {
    outline: 2px solid var(--lumina-purple, #6337d8);
    outline-offset: -2px;
}

/* Review dashboard: separate the score, interpretation and actions. */
body.portal-page.workflow-workspace .review-dashboard {
    gap: 18px;
    padding: 20px;
    background: #fff;
}
body.portal-page.workflow-workspace .review-dashboard > h3 {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--workspace-line);
    font-size: 1.12rem;
}
.review-overview {
    display: grid;
    grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr);
    gap: 14px;
}
.review-score-panel, .review-summary-panel {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--workspace-line);
    border-radius: 12px;
    background: #f8f9fc;
}
.review-score-panel {
    justify-items: center;
    align-content: center;
    text-align: center;
    background: linear-gradient(145deg, #f5f1ff, #fff);
}
.review-panel-kicker {
    color: #7252d6;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.review-score-value {
    color: #4d2bb7;
    font: 700 clamp(2.2rem, 5vw, 3.5rem)/1 Georgia, "Times New Roman", serif;
    letter-spacing: -.06em;
}
.review-score-caption { color: var(--workspace-muted); font-size: .7rem; }
.review-summary-panel h4, .review-notes-heading h4 { margin: 0; color: var(--workspace-ink); font: 700 1rem/1.2 Georgia, "Times New Roman", serif; }
.review-summary-panel p, .review-guidance p, .review-readiness-hint p { margin: 0; color: var(--workspace-muted); font-size: .8rem; line-height: 1.55; }
.review-guidance, .review-readiness-hint {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 15px;
    border-radius: 11px;
}
.review-guidance { border: 1px solid #d9cdfd; background: #f8f5ff; }
.review-readiness-hint { border: 1px solid #f1d38a; background: #fff9e9; }
.review-guidance-icon, .review-hint-icon { display: inline-flex; width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: 2px; align-items: center; justify-content: center; color: #6840d2; }
.review-hint-icon { color: #a66b00; }
.review-guidance strong, .review-readiness-hint strong { display: block; margin-bottom: 3px; color: var(--workspace-ink); font-size: .8rem; }
.review-notes-section { display: grid; gap: 10px; padding-top: 4px; }
.review-correction-report { display: grid; gap: 8px; margin: 12px 0; padding: 13px 15px; border: 1px solid #ccebd9; border-radius: 10px; color: #24513a; background: #f3fbf6; }
.review-correction-report strong { color: #166534; }
.review-correction-report p { margin: 0; font-size: .82rem; line-height: 1.45; }
.review-correction-report ul { margin: 0; padding-left: 19px; font-size: .78rem; line-height: 1.45; }
.review-correction-report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.review-notes-section > .output-list { padding-left: 0; list-style: none; }
.review-notes-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 3px; }
.review-notes-count { padding: 5px 9px; border-radius: 999px; color: #5d3bc7; background: #eee9ff; font-size: .68rem; font-weight: 800; }
.review-notes-section .review-note { border: 1px solid var(--workspace-line); border-radius: 9px; background: #fff; }
.review-notes-section .review-note + .review-note { margin-top: 7px; }
.review-notes-section .review-note:nth-child(even) { background: #fbfbfd; }
.review-notes-section .review-note-bulk-actions { margin: 0; }
@media (max-width: 620px) {
    .review-overview { grid-template-columns: 1fr; }
    .review-score-panel { justify-items: start; text-align: left; }
}

/* Local Phosphor SVGs share the same alignment in buttons, cards and menus. */
.icon-inline { display: inline-flex; width: 1em; height: 1em; flex: 0 0 auto; align-items: center; justify-content: center; vertical-align: -.14em; }
.icon-inline .ui-icon, [data-icon] > .ui-icon { width: 1em; height: 1em; }
.landing-feature-icon.icon-inline { width: 42px; height: 42px; font-size: 1.3rem; }
.landing-step-icon.icon-inline { width: auto; height: auto; font-size: 1.1rem; }
.portal-button [data-icon], .wizard-primary [data-icon], .text-button [data-icon], .workspace-back [data-icon] { display: inline-flex; align-items: center; justify-content: center; margin-right: .28em; }
.workspace-step [data-icon], .docs-sidebar [data-icon], .docs-section-icon [data-icon] { margin-right: .35em; }
.docs-section-icon.icon-inline { font-size: 1.1rem; }

/* Keep the visual refresh last so every page, including documentation and
   administration, uses the same modern type scale and branded shell. */
body.portal-page { color: #182338; background: #f3f6fa; font-family: "Segoe UI Variable", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; }
body.portal-page :is(h1, h2, h3, h4, strong, b, .portal-button, .text-button) { font-family: inherit; }
body.portal-page .app-sidebar { border-right: 0; color: #e8ebff; background: linear-gradient(180deg, #171a38 0%, #20254d 58%, #29225a 100%); box-shadow: 10px 0 30px rgba(27,31,70,.16); }
body.portal-page .sidebar-context { border-color: rgba(197,203,255,.18); background: rgba(255,255,255,.08); }
body.portal-page .sidebar-context span, body.portal-page .sidebar-group h2 { color: #abb2dc; }
body.portal-page .sidebar-context strong, body.portal-page .sidebar-account-copy strong, body.portal-page .sidebar-tip strong { color: #fff; }
body.portal-page .sidebar-context small, body.portal-page .sidebar-account-copy small, body.portal-page .sidebar-tip small { color: #b9c0df; }
body.portal-page .sidebar-context small b { color: #eae5ff; background: rgba(147,119,255,.3); }
body.portal-page .sidebar-link { color: #c6cbea; font-size: .84rem; font-weight: 500; }
body.portal-page .sidebar-link .ui-icon { width: 18px; height: 18px; color: #aeb7e3; }
body.portal-page .sidebar-link:hover { color: #fff; background: rgba(255,255,255,.09); }
body.portal-page .sidebar-link.is-active { color: #fff; background: linear-gradient(90deg, rgba(126,93,232,.92), rgba(102,74,200,.7)); box-shadow: inset 3px 0 0 #c3b4ff, 0 7px 17px rgba(9,13,38,.16); }
body.portal-page .sidebar-tip { border-color: rgba(197,203,255,.18); color: #c7cceb; background: rgba(255,255,255,.06); }
body.portal-page .sidebar-tip:hover { border-color: rgba(214,205,255,.38); background: rgba(255,255,255,.11); }
body.portal-page .sidebar-tip-icon { color: #d8ceff; background: rgba(141,112,238,.35); }
body.portal-page .sidebar-account { border-top-color: rgba(197,203,255,.18); }
body.portal-page .sidebar-avatar { color: #35216e; background: #dcd3ff; }
body.portal-page .sidebar-logout { color: #bbc2e2; }
body.portal-page .sidebar-logout:hover { border-color: rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.1); }
body.portal-page .app-shell-topbar { border-bottom-color: #dfe5ee; background: rgba(255,255,255,.94); box-shadow: 0 1px 0 rgba(23,35,59,.02); }
body.portal-page .app-breadcrumbs { color: #78869b; font-size: .82rem; }
body.portal-page .app-breadcrumbs strong { color: #1b2940; font-weight: 650; }
body.portal-page .topbar-settings { color: #53647c; background: #fff; }
body.portal-page .portal-shell { width: min(100% - 44px, 1540px); }
body.portal-page :is(.workspace-card, .project-form-card, .operation-card, .integration-card, .security-card, .preview-checklist article, .preview-export-card, .commercial-release-card) { border-color: #d9e1eb; background: #fff; box-shadow: 0 7px 22px rgba(36,54,79,.055); }
body.portal-page :is(.workspace-heading h1, .dashboard-heading h1, .preview-heading h1, .lumina-page-heading h1) { color: #17243a; font-family: inherit; font-weight: 720; letter-spacing: -.035em; }
body.portal-page :is(.workspace-card h2, .card-heading h2, .preview-export-card h2, .commercial-release-card h2) { color: #1b2a42; font-family: inherit; font-weight: 680; letter-spacing: -.02em; }
body.portal-page :is(.workspace-card p, .muted-label, .output-line span, .operation-card small, .workspace-heading p, .preview-heading p) { color: #66758d; font-size: .88rem; font-weight: 400; line-height: 1.55; }
body.portal-page .portal-eyebrow { color: #7651d6; font-size: .68rem; font-weight: 750; letter-spacing: .14em; }
body.portal-page .portal-button { min-height: 42px; border-radius: 10px; background: linear-gradient(135deg, #7046df, #5630bf); box-shadow: 0 6px 14px rgba(94,57,201,.18); font-size: .84rem; font-weight: 650; }
body.portal-page .portal-button.button-secondary { color: #4d3b8b; border-color: #d8d1f4; background: #faf9ff; box-shadow: none; }
body.portal-page .text-button { color: #6339c8; font-weight: 650; }
body.portal-page .export-actions .portal-button { gap: 8px; }
body.portal-page .export-actions [data-icon], body.portal-page .portal-button [data-icon], body.portal-page .text-button [data-icon] { width: 1.05em; height: 1.05em; flex: 0 0 auto; margin-right: 0; }
body.portal-page .ui-icon { stroke-width: 1.8; }
body.portal-page .activity-list, body.portal-page .job-list, body.portal-page .output-list { font-size: .84rem; }
body.portal-page .activity-list > *, body.portal-page .job-list > *, body.portal-page .output-list > li { border-color: #e0e6ee; background: #f8fafc; }
body.portal-page .review-score-value { font-family: inherit; font-weight: 760; }
body.portal-page .review-summary-panel h4, body.portal-page .review-notes-heading h4 { font-family: inherit; font-weight: 700; }
body.portal-page .generated-files-card { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e3e8ef; }
body.portal-page .generated-files-card h3 { margin: 0; color: #1b2a42; font-size: 1rem; font-weight: 680; }
body.portal-page .generated-files-table { display: grid; gap: 6px; }
body.portal-page .generated-files-table-head,
body.portal-page .generated-file-row { display: grid; grid-template-columns: minmax(260px, 2.2fr) minmax(210px, 1.55fr) minmax(125px, .9fr) minmax(70px, .55fr) minmax(80px, .6fr) minmax(72px, .55fr) 76px; align-items: center; gap: 12px; }
body.portal-page .generated-files-table-head { padding: 0 12px 4px; color: #7a8799; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
body.portal-page .generated-file-row { padding: 10px 12px; border: 1px solid #e1e6ee; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(32,48,74,.04); }
body.portal-page .generated-file-row:nth-of-type(even) { background: #f9fbfd; }
body.portal-page .generated-file-name { overflow: hidden; color: #1d2b42; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
body.portal-page .generated-file-project, body.portal-page .generated-file-date, body.portal-page .generated-file-format, body.portal-page .generated-file-size { overflow: hidden; color: #60718a; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
body.portal-page .generated-file-project { white-space: nowrap; }
body.portal-page .generated-file-actions { justify-content: flex-end; }
body.portal-page .generated-file-status { white-space: nowrap; }
body.portal-page .generated-file-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid #d8dfea; border-radius: 9px; color: #5b3bc1; background: #fff; text-decoration: none; cursor: pointer; }
body.portal-page .generated-file-icon-button:hover { border-color: #bdb0ee; color: #43259d; background: #f7f4ff; }
body.portal-page .generated-file-icon-button.is-danger { color: #b13d4b; }
body.portal-page .generated-file-icon-button.is-danger:hover { border-color: #efb8bf; color: #922c3a; background: #fff5f6; }
body.portal-page .generated-file-icon-button [data-icon] { width: 1.1rem; height: 1.1rem; }
@media (max-width: 980px) { body.portal-page .generated-files-table-head { display: none; } body.portal-page .generated-file-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; } body.portal-page .generated-file-project, body.portal-page .generated-file-date, body.portal-page .generated-file-format, body.portal-page .generated-file-size, body.portal-page .generated-file-status { grid-column: 1; } body.portal-page .generated-file-actions { grid-column: 2; grid-row: 1 / span 6; } }
@media (max-width: 760px) { body.portal-page .portal-shell { width: calc(100% - 28px); } body.portal-page .app-shell-topbar { box-shadow: 0 1px 8px rgba(23,35,59,.06); } }

.characters-main .character-editor-card { margin-bottom: 22px; }
.character-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }
.character-card { display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--portal-line,#dbe4ee); border-radius:16px; background:#fff; box-shadow:0 6px 18px rgba(27,52,78,.06); }
.character-card-image { height:220px; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#eef5fb,#fff8e9); color:#8ca3b7; }
.character-card-image img { width:100%; height:100%; object-fit:cover; }
.character-card-image-link { display:block; width:100%; height:100%; cursor:zoom-in; }
.character-card-image-link:focus-visible { outline:3px solid #7446e8; outline-offset:-3px; }
.design-image-count-control { display:flex; align-items:flex-end; gap:14px; margin-top:14px; padding:12px 14px; border:1px solid #e1dafa; border-radius:10px; background:#faf9ff; }
.design-image-count-control label { display:flex; align-items:center; gap:10px; color:#25324a; }
.design-image-count-control input { width:92px; min-height:38px; padding:7px 9px; border:1px solid #cfc7ed; border-radius:8px; background:#fff; color:#1f2942; font:inherit; }
.design-image-count-control small { flex:1; }
.design-image-count-control .form-feedback { margin:0; }
@media (max-width:760px) { .design-image-count-control { align-items:stretch; flex-direction:column; } .design-image-count-control label { justify-content:space-between; } }
.character-card-image svg { width:64px; height:64px; }
.character-card-body { padding:16px; }
.character-card-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.character-card-title h3 { margin:0; color:#1b334d; }
.character-card-body p { min-height:42px; margin:10px 0; color:#536b80; }
.character-card-body small { color:#71869a; }
.character-role { padding:4px 8px; border-radius:999px; background:#edf1f5; color:#617284; font-size:.72rem; font-weight:700; white-space:nowrap; }
.character-role.is-main { background:#fff0c9; color:#976b09; }
.character-card-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:15px; }
.character-voice-settings { grid-column: 1 / -1; margin: 0; padding: 14px; border: 1px solid var(--portal-line,#dbe4ee); border-radius: 12px; background: #fbfcff; }
.character-voice-settings legend { padding: 0 6px; color: #1b334d; font-weight: 750; }
.character-voice-settings p { margin: 0 0 12px; }
.character-voice-test { display: flex; align-items: end; gap: 8px; min-width: 0; }
.character-voice-test .form-feedback { margin: 0 0 5px; }
.voice-catalog-card { margin-bottom: 22px; }
.voice-catalog-card p { max-width: 78rem; color: #536b80; }
.voice-catalog-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.voice-catalog-pills span { padding: 5px 9px; border-radius: 999px; background: #f1edff; color: #5c35c4; font-size: .78rem; font-weight: 700; }
.character-card-actions .portal-button { font-size:.76rem; }
.button-danger { color:#a13232; border-color:#efb6b6; background:#fff7f7; }
.span-all { grid-column:1/-1; }
@media (max-width:760px) { .span-all{grid-column:auto}.character-grid{grid-template-columns:1fr}.character-card-actions .portal-button{flex:1 1 45%;} }

/* ==========================================================================
   Unified Lumina Layout & UX Refinements (v3.230)
   ========================================================================== */

/* 1. Standard Full-Width Canvas Alignment (Topbar + Main Content in all screens) */
body.portal-page .app-sidebar {
    width: 256px;
}
body.portal-page .app-shell-topbar {
    margin-left: 256px;
}
body.portal-page .app-shell-topbar .dashboard-nav {
    width: calc(100% - 48px) !important;
    max-width: none !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
}
body.portal-page .app-sidebar ~ main.portal-shell,
body.portal-page .app-sidebar ~ main.portal-shell.dashboard-main,
body.portal-page .app-sidebar ~ main.portal-shell.workspace-main,
body.portal-page .app-sidebar ~ main.portal-shell.preview-main,
body.portal-page .app-sidebar ~ main.portal-shell.admin-main,
body.portal-page .app-sidebar ~ main.portal-shell.account-main,
body.portal-page .app-sidebar ~ main.portal-shell.onboarding-main,
body.portal-page .app-sidebar ~ main.portal-shell.video-new-page,
body.portal-page .app-sidebar ~ main.portal-shell.video-workspace,
body.portal-page .app-sidebar ~ main.portal-shell.characters-main {
    width: calc(100% - 256px - 48px) !important;
    max-width: none !important;
    margin-left: 280px !important;
    margin-right: 24px !important;
    padding-top: 28px;
}
@media (max-width: 980px) {
    body.portal-page .app-sidebar { width: 232px; }
    body.portal-page .app-shell-topbar { margin-left: 232px; }
    body.portal-page .app-shell-topbar .dashboard-nav {
        width: calc(100% - 36px) !important;
        margin-left: 18px !important;
        margin-right: 18px !important;
    }
    body.portal-page .app-sidebar ~ main.portal-shell,
    body.portal-page .app-sidebar ~ main.portal-shell.dashboard-main,
    body.portal-page .app-sidebar ~ main.portal-shell.workspace-main,
    body.portal-page .app-sidebar ~ main.portal-shell.preview-main,
    body.portal-page .app-sidebar ~ main.portal-shell.admin-main,
    body.portal-page .app-sidebar ~ main.portal-shell.account-main,
    body.portal-page .app-sidebar ~ main.portal-shell.onboarding-main,
    body.portal-page .app-sidebar ~ main.portal-shell.video-new-page,
    body.portal-page .app-sidebar ~ main.portal-shell.video-workspace,
    body.portal-page .app-sidebar ~ main.portal-shell.characters-main {
        width: calc(100% - 232px - 36px) !important;
        margin-left: 250px !important;
        margin-right: 18px !important;
    }
}
@media (max-width: 760px) {
    body.portal-page .app-shell-topbar { margin-left: 0; }
    body.portal-page .app-shell-topbar .dashboard-nav {
        width: calc(100% - 28px) !important;
        margin-left: 14px !important;
        margin-right: 14px !important;
    }
    body.portal-page .app-sidebar ~ main.portal-shell,
    body.portal-page .app-sidebar ~ main.portal-shell.dashboard-main,
    body.portal-page .app-sidebar ~ main.portal-shell.workspace-main,
    body.portal-page .app-sidebar ~ main.portal-shell.preview-main,
    body.portal-page .app-sidebar ~ main.portal-shell.admin-main,
    body.portal-page .app-sidebar ~ main.portal-shell.account-main,
    body.portal-page .app-sidebar ~ main.portal-shell.onboarding-main,
    body.portal-page .app-sidebar ~ main.portal-shell.video-new-page,
    body.portal-page .app-sidebar ~ main.portal-shell.video-workspace,
    body.portal-page .app-sidebar ~ main.portal-shell.characters-main {
        width: calc(100% - 28px) !important;
        margin-left: 14px !important;
        margin-right: 14px !important;
    }
}

/* 2. Repaginada do Menu Lateral (Sidebar): Tipografia Limpa, Sem Negrito Pesado e Alto Contraste */
body.portal-page .app-sidebar {
    padding: 16px 14px 14px;
    border-right: 1px solid #1e293b;
    color: #f1f5f9;
    background: #0f172a;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .08);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.portal-page .sidebar-brand-wrap {
    min-height: 64px;
    padding: 4px 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}
body.portal-page .sidebar-context {
    margin: 14px 2px 16px;
    padding: 11px 13px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 10px;
    background: rgba(30, 41, 59, .65);
}
body.portal-page .sidebar-context span {
    color: #94a3b8;
    font-size: .64rem;
    font-weight: 500;
    letter-spacing: .08em;
}
body.portal-page .sidebar-context strong {
    color: #f8fafc;
    font-size: .86rem;
    font-weight: 500;
    letter-spacing: -.01em;
}
body.portal-page .sidebar-context small {
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 400;
}
body.portal-page .sidebar-context small b {
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #93c5fd;
    background: rgba(37, 99, 235, .25);
    font-size: .66rem;
    font-weight: 500;
}
body.portal-page .sidebar-group {
    margin: 0 0 16px;
}
body.portal-page .sidebar-group h2 {
    padding: 0 12px 6px;
    color: #64748b;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
body.portal-page .sidebar-link {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 11px;
    margin: 3px 0;
    padding: 8px 12px;
    border-radius: 9px;
    color: #cbd5e1;
    font-size: .9rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.35;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
body.portal-page .sidebar-link .ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #94a3b8;
    stroke-width: 1.75;
}
body.portal-page .sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .07);
    transform: none;
}
body.portal-page .sidebar-link:hover .ui-icon {
    color: #e2e8f0;
}
body.portal-page .sidebar-link.is-active {
    color: #ffffff;
    font-weight: 500;
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .32);
}
body.portal-page .sidebar-link.is-active .ui-icon {
    color: #ffffff;
}
body.portal-page .sidebar-details {
    margin-top: 6px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 10px;
    background: rgba(30, 41, 59, .45);
    overflow: hidden;
}
body.portal-page .sidebar-details-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
    color: #cbd5e1;
    font-size: .88rem;
    font-weight: 400;
    user-select: none;
    transition: background .15s ease, color .15s ease;
}
body.portal-page .sidebar-details-summary::-webkit-details-marker { display: none; }
body.portal-page .sidebar-details-summary:hover { background: rgba(255, 255, 255, .06); color: #fff; }
body.portal-page .sidebar-details-summary > span { display: inline-flex; align-items: center; gap: 10px; }
body.portal-page .sidebar-details-summary .ui-icon { width: 18px; height: 18px; color: #94a3b8; }
body.portal-page .sidebar-details-caret { color: #94a3b8; font-size: .78rem; transition: transform .18s ease; }
body.portal-page .sidebar-details[open] .sidebar-details-caret { transform: rotate(180deg); }
body.portal-page .sidebar-details-body {
    display: grid;
    gap: 10px;
    padding: 8px 8px 10px;
    border-top: 1px solid rgba(148, 163, 184, .12);
    background: rgba(15, 23, 42, .45);
}
body.portal-page .sidebar-group-nested { margin: 0; }
body.portal-page .sidebar-group-nested h2 { padding: 4px 8px 4px; font-size: .65rem; font-weight: 600; }
body.portal-page .sidebar-tip {
    border-color: rgba(148, 163, 184, .15);
    color: #cbd5e1;
    background: rgba(30, 41, 59, .5);
}
body.portal-page .sidebar-tip:hover {
    border-color: rgba(148, 163, 184, .3);
    background: rgba(30, 41, 59, .8);
}
body.portal-page .sidebar-tip strong {
    color: #f8fafc;
    font-size: .78rem;
    font-weight: 500;
}
body.portal-page .sidebar-tip small {
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 400;
}
body.portal-page .sidebar-tip-icon {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
}
body.portal-page .sidebar-account {
    border-top-color: rgba(148, 163, 184, .15);
    padding-top: 10px;
}
body.portal-page .sidebar-avatar {
    color: #ffffff;
    background: #2563eb;
    font-weight: 600;
}
body.portal-page .sidebar-account-copy strong {
    color: #f8fafc;
    font-size: .8rem;
    font-weight: 500;
}
body.portal-page .sidebar-account-copy small {
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 400;
}

/* 3. Dashboard Filter Bar, Segmented Pills & Card Header Anti-Collision */
body.portal-page .dashboard-primary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
body.portal-page .project-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 8px 10px;
    border: 1px solid #dce4ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
}
body.portal-page .project-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
body.portal-page .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #52627a;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
body.portal-page .filter-pill:hover {
    background: #f1f5f9;
    color: #17243a;
}
body.portal-page .filter-pill span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2f7;
    color: #5b6b82;
    font-size: .72rem;
    font-weight: 600;
}
body.portal-page .filter-pill.is-active {
    background: #f3eeff;
    border-color: #d6c8fb;
    color: #5630bf;
}
body.portal-page .filter-pill.is-active span {
    background: #5630bf;
    color: #fff;
}
body.portal-page .project-filter-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
@media (min-width: 761px) {
    body.portal-page .project-filter-select-wrap { display: none; }
}
@media (max-width: 760px) {
    body.portal-page .project-filter-pills { width: 100%; }
    body.portal-page .filter-pill { flex: 1 1 auto; justify-content: center; }
}

/* Fix overlapping badges & timestamp in Dashboard Project Cards */
body.portal-page.dashboard-page .project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
body.portal-page.dashboard-page .project-card-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-height: 44px;
    padding-right: 112px !important;
}
body.portal-page.dashboard-page .project-card-identity {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px !important;
    max-width: 100%;
}
body.portal-page.dashboard-page .project-card-meta .project-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .66rem !important;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
body.portal-page.dashboard-page .project-card-meta time {
    display: block;
    color: #7c8ba1;
    font-size: .72rem;
    font-weight: 400;
    text-align: left !important;
    white-space: nowrap;
}
body.portal-page.dashboard-page .project-card h2 {
    margin-top: 12px !important;
    margin-bottom: 8px;
    font-size: 1.08rem;
    line-height: 1.3;
}
body.portal-page.dashboard-page .project-card-actions {
    top: 16px !important;
    right: 16px !important;
    gap: 5px;
}

/* Expand card across the entire grid row when editing so the 8-field form has generous room */
body.portal-page.dashboard-page .project-card.is-editing,
body.portal-page .project-card.is-editing {
    grid-column: 1 / -1 !important;
    border-color: #b7a3f5;
    box-shadow: 0 14px 36px rgba(36, 54, 79, .1);
}
body.portal-page.dashboard-page .project-card.is-editing .project-card-editor {
    margin: 16px 0 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
body.portal-page.dashboard-page .project-card.is-editing .project-card-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}
body.portal-page.dashboard-page .project-card.is-editing .project-card-edit-wide {
    grid-column: 1 / -1;
}
@media (max-width: 860px) {
    body.portal-page.dashboard-page .project-card.is-editing .project-card-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* 4. Padronização de Formulários, Textareas (Somente Vertical), Meu Perfil e Personagens */
body.portal-page textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    color: #17243a;
    background: #fff;
    font: 400 .88rem/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.portal-page textarea:focus {
    border-color: #7046df;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(112, 70, 223, .12);
}
body.portal-page .field-label-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
body.portal-page .field-label-text em {
    color: #7046df;
    font-style: normal;
}
body.portal-page .field-label-text small {
    color: #64748b;
    font-weight: 400;
}
body.portal-page .form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
body.portal-page .form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}
body.portal-page .form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}
@media (max-width: 1024px) {
    body.portal-page .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    body.portal-page .form-grid-2,
    body.portal-page .form-grid-3,
    body.portal-page .form-grid-4 { grid-template-columns: 1fr; }
}

/* Meu Perfil: ocupa toda a área útil padrão como as demais telas */
body.portal-page .account-profile-card {
    width: 100% !important;
    max-width: none !important;
    padding: 26px;
}
body.portal-page .account-profile-card .portal-form,
body.portal-page .account-profile-form {
    width: 100% !important;
    max-width: none !important;
}
body.portal-page .profile-section-block + .profile-section-block {
    margin-top: 10px;
}
body.portal-page .profile-section-heading.is-first {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Segurança Central e Segurança da Conta: ocupa 100% da área útil sem travar em 780px/470px */
body.portal-page .security-card,
body.portal-page .security-note,
body.portal-page .security-card .portal-form {
    width: 100% !important;
    max-width: none !important;
}
body.portal-page .security-note {
    margin-top: 18px;
}
body.portal-page .security-setup form[data-enable-2fa] {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
body.portal-page .security-setup form[data-enable-2fa] label {
    flex: 1 1 240px;
    max-width: 360px;
}

/* Configuração de APIs e Integrações: distribui os cards em 100% da largura sem buracos vazios */
body.portal-page .integration-config-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
@media (max-width: 1240px) {
    body.portal-page .integration-config-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body.portal-page .integration-config-columns > .integration-config-panel:nth-child(3):last-child {
        grid-column: 1 / -1;
    }
}
@media (max-width: 840px) {
    body.portal-page .integration-config-columns {
        grid-template-columns: 1fr;
    }
}
body.portal-page .integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}
body.portal-page .integration-card > .portal-button {
    justify-self: start;
}

/* Alto Contraste em Selos de Status (Ativa / Inativa / Desligado / Sucesso / Falha) e Botões Secundários */
body.portal-page .integration-indicator,
body.portal-page .audit-status,
body.portal-page .worker-state,
body.portal-page .preview-readiness,
body.portal-page .output-status,
body.portal-page .generated-file-status,
body.portal-page .commercial-release-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .68rem !important;
    font-weight: 700 !important;
    letter-spacing: .03em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}
body.portal-page .integration-indicator.is-configured,
body.portal-page .audit-status.is-success,
body.portal-page .worker-state:not([data-state="waiting"]):not([data-state="idle"]),
body.portal-page .preview-readiness.is-ready,
body.portal-page .output-status.is-approved,
body.portal-page .generated-file-status.is-completed,
body.portal-page .commercial-release-status.is-finalized {
    color: #166534 !important;
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
}
body.portal-page .integration-indicator.is-pending,
body.portal-page .worker-state[data-state="waiting"],
body.portal-page .preview-readiness.is-pending,
body.portal-page .output-status.is-pending,
body.portal-page .commercial-release-status.is-draft {
    color: #92400e !important;
    background: #fef3c7 !important;
    border: 1px solid #fcd34d !important;
}
body.portal-page .integration-indicator.is-missing,
body.portal-page .audit-status:not(.is-success),
body.portal-page .audit-status.is-failed,
body.portal-page .generated-file-status.is-failed,
body.portal-page .job-failed {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
}
body.portal-page .portal-button.button-secondary {
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
body.portal-page .portal-button.button-secondary:hover {
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    background: #f1f5f9 !important;
}
body.portal-page .portal-button.button-danger {
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    background: #fef2f2 !important;
    font-weight: 600;
    box-shadow: none;
}
body.portal-page .portal-button.button-danger:hover {
    color: #991b1b !important;
    border-color: #f87171 !important;
    background: #fee2e2 !important;
}

/* Tela de Login / Autenticação com Fundo Escuro e Modal de Credenciais Claro */
body.portal-page.auth-page,
body.portal-page:has(.auth-layout) {
    color: #f8fafc;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .20), transparent 44rem), #0f172a !important;
}
body.portal-page.auth-page .auth-card,
body.portal-page .auth-layout .auth-card {
    color: #182338 !important;
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, .22) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .42) !important;
}
body.portal-page.auth-page .portal-back,
body.portal-page .auth-layout .portal-back {
    color: #cbd5e1;
}
body.portal-page.auth-page .portal-back a,
body.portal-page .auth-layout .portal-back a {
    color: #93c5fd;
}
body.portal-page.auth-page .portal-back a:hover,
body.portal-page .auth-layout .portal-back a:hover {
    color: #ffffff;
}

/* Edição de Personagem: seções claras e separadas */
body.portal-page .character-editor-form {
    display: grid;
    gap: 18px;
}
body.portal-page .character-form-section {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
body.portal-page .character-section-title {
    margin: 0 0 12px;
    color: #1e293b;
    font-size: .92rem;
    font-weight: 650;
}
body.portal-page .character-voice-settings {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
body.portal-page .character-voice-row {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(240px, 1.8fr) auto;
    gap: 14px;
    align-items: start;
}
body.portal-page .character-voice-row label {
    display: grid;
    gap: 7px;
    color: #17324e;
    font-size: .78rem;
    font-weight: 650;
}
body.portal-page .character-voice-row select {
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 11px;
    color: #17324e;
    background: #fff;
    font: inherit;
}
body.portal-page .character-voice-test {
    padding-top: 23px;
}
@media (max-width: 960px) {
    body.portal-page .character-voice-row {
        grid-template-columns: 1fr;
    }
    body.portal-page .character-voice-test {
        padding-top: 0;
    }
}

/* 5. E-book Workspace Header Chips & Chapter Accordion */
body.portal-page .workspace-heading .project-length {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
body.portal-page .project-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 10px;
    border: 1px solid #dde5f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #4b5c73;
    font-size: .76rem;
    font-weight: 600;
}

/* Hide rich-text chapter editors during Stage 2 (Outline / Estrutura) so it stays a clean chapter list */
body.portal-page.workspace-stage-outline .chapter-editor {
    display: none !important;
}

/* Collapsible Chapter Accordion in Stage 3 (Writing / Escrita) */
body.portal-page.workspace-stage-writing .chapter-row.is-collapsed .chapter-editor {
    display: none !important;
}
body.portal-page .chapter-main-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
body.portal-page .chapter-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}
body.portal-page .chapter-status-pill.is-approved {
    background: #dcfce7;
    color: #166534;
}
body.portal-page .chapter-status-pill.is-written {
    background: #ede9fe;
    color: #5b21b6;
}
body.portal-page .chapter-status-pill.is-pending {
    background: #fef3c7;
    color: #92400e;
}
body.portal-page .chapter-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
body.portal-page .chapter-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
body.portal-page .chapter-collapse-btn:hover {
    border-color: #7046df;
    color: #5630bf;
    background: #faf8ff;
}

/* 6. Characters Collapsible Voice Catalog */
body.portal-page details.voice-catalog-details {
    padding: 0;
    overflow: hidden;
}
body.portal-page .voice-catalog-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
body.portal-page .voice-catalog-summary::-webkit-details-marker { display: none; }
body.portal-page .voice-catalog-summary h2 { margin: 2px 0 0; font-size: 1.05rem; }
body.portal-page details.voice-catalog-details[open] .voice-catalog-summary {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
body.portal-page .voice-catalog-body {
    display: grid;
    gap: 12px;
    padding: 18px 22px;
}
body.portal-page .voice-catalog-body p { margin: 0; }

