/* BookForge Pro Turbo CSS Stylesheet */

:root {
    --bg-dark: #000000;
    --bg-sidebar: #0b0c0f;
    --bg-panel: #12141a;
    --color-primary: #ffc83b; /* Dourado Mais Vivo e Brilhante */
    --color-primary-hover: #ffe49e; /* Dourado Claro */
    --color-text-bright: #f1f3f5;
    --color-text-muted: #868e96;
    --color-text-bronze: #ffd052; /* Dourado Vibrante para Rótulos */
    --border-color: rgba(255, 200, 59, 0.25);
    --border-color-active: rgba(255, 200, 59, 0.75);
    --font-ui: 'Outfit', 'Inter', sans-serif;
    
    /* Document Colors */
    --paper-cream: #fbf6eb;
    --paper-white: #ffffff;
}

/* General Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text-bright);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 200, 59, 0.25);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 200, 59, 0.5);
}

/* Main Layout Structure */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header / Navigation Bar */
.main-header {
    height: 64px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-primary);
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.header-logo svg {
    filter: drop-shadow(0 0 5px rgba(255, 200, 59, 0.5));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Workspace Layout (Left Sidebar + Center + Right Sidebar) */
.workspace-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 64px);
    position: relative;
}

/* Left & Right Sidebars */
.sidebar-left, .sidebar-right {
    width: 310px;
    background-color: var(--bg-sidebar);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-left {
    border-right: 1px solid var(--border-color);
}

.sidebar-right {
    border-left: 1px solid var(--border-color);
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 200, 59, 0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-primary);
    margin-bottom: 16px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 200, 59, 0.15);
    padding-bottom: 6px;
}

/* Center Workspace Area */
.workspace-center {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    position: relative;
}

.workspace-center.has-book {
    justify-content: flex-start;
}

/* Center Banner / Logo */
.center-branding {
    text-align: center;
    margin-bottom: 30px;
}

.center-branding svg {
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(255, 200, 59, 0.4));
}

.center-title {
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.center-subtitle {
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Uploader dashed card */
.upload-card {
    border: 2px dashed rgba(255, 200, 59, 0.35);
    background-color: rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 680px;
    border-radius: 12px;
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.upload-card:hover {
    border-color: var(--color-primary);
    background-color: rgba(255, 200, 59, 0.04);
    box-shadow: 0 0 25px rgba(255, 200, 59, 0.08);
}

.upload-card-icon {
    color: var(--color-primary);
}

.upload-card-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

.upload-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-bright);
    letter-spacing: 0.5px;
}

.upload-card-sub {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Warning Attention card */
.warning-card {
    background-color: rgba(184, 15, 10, 0.12);
    border: 1px solid rgba(255, 200, 59, 0.4);
    border-radius: 8px;
    padding: 20px 24px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.warning-title {
    font-size: 12px;
    color: #e63946;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.warning-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-text-bright);
    margin-bottom: 8px;
}

.warning-tip {
    font-size: 11px;
    color: #ffd166;
    font-weight: 500;
}

/* Buttons Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #000000;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-bright);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-active);
}

.btn-accent {
    background-color: var(--color-primary);
    color: #000000;
    font-weight: 600;
}

.btn-accent:hover {
    background-color: var(--color-primary-hover);
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-full {
    width: 100%;
}

/* Form Controls & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-bronze);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-select, .form-input, .form-textarea {
    width: 100%;
    background-color: var(--bg-panel);
    border: 1px solid rgba(255, 200, 59, 0.25);
    color: var(--color-text-bright);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    transition: all 0.2s ease;
}

.form-select:hover, .form-input:hover {
    border-color: var(--border-color-active);
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 200, 59, 0.15);
}

/* Custom Select styling (no browser defaults) */
.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffc83b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 200, 59, 0.25);
    margin-bottom: 16px;
    gap: 4px;
}

.tab-btn, .tab-btn-right {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 8px 12px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover, .tab-btn-right:hover {
    color: var(--color-primary-hover);
}

.tab-btn.active, .tab-btn-right.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    text-shadow: 0 0 5px rgba(255, 200, 59, 0.3);
}

.tab-content {
    display: flex;
    flex-direction: column;
}

.tab-content.hidden {
    display: none !important;
}

/* Color Picker Control styling */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-panel);
    border: 1px solid rgba(255, 200, 59, 0.25);
    border-radius: 6px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.color-picker-wrapper:hover {
    border-color: var(--border-color-active);
}

.color-picker-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-picker-value {
    font-family: monospace;
    font-size: 13px;
    color: var(--color-text-bright);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Ornament Grid (9 Button Grid from screenshot) */
.ornament-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.ornament-grid-btn {
    background-color: var(--bg-panel);
    border: 1px solid rgba(255, 200, 59, 0.22);
    color: var(--color-text-bright);
    padding: 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    font-family: var(--font-ui);
    transition: all 0.15s ease;
}

.ornament-grid-btn[data-ornament="none"] {
    grid-column: span 3;
}

.ornament-grid-btn:hover {
    border-color: var(--border-color-active);
}

.ornament-grid-btn.active {
    border-color: var(--color-primary);
    background-color: rgba(255, 200, 59, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

/* Special Page Checkbox List */
.page-checkbox-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 200, 59, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.3s ease;
}

.page-checkbox-item.expanded {
    background: rgba(255, 200, 59, 0.04);
    border-color: rgba(255, 200, 59, 0.4);
}

.page-checkbox-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    width: 100%;
    padding: 4px 0;
}

.page-checkbox-header input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.page-title-click {
    flex: 1;
    display: flex;
    align-items: center;
    color: var(--color-text-bright);
    transition: color 0.2s ease;
    padding: 2px 0;
}

.page-title-click:hover {
    color: var(--color-primary);
}

.struct-chevron {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.page-checkbox-item.expanded .struct-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.checkbox-sub-input {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
    padding-left: 26px;
}

.page-checkbox-item.expanded .checkbox-sub-input {
    max-height: 400px;
    opacity: 1;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Bottom Actions container in Left Sidebar */
.left-bottom-actions {
    padding: 20px;
    border-top: 1px solid rgba(255, 200, 59, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

/* Waiting / Aguardando Indicator Box */
.waiting-badge {
    background-color: rgba(255, 200, 59, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    margin-top: 12px;
    text-transform: uppercase;
}

.hidden {
    display: none !important;
}

/* --- ESTILOS DO PREVIEW DE PÁGINAS (ROLO DE FITA) --- */

.pages-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.page-sheet {
    background-color: var(--paper-cream);
    color: #1a1a1a;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 65px 55px 80px 55px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    position: relative;
    transition: all 0.2s ease;
    user-select: text;
}

/* Formatos de Livro (Aspect Ratios) */
.page-sheet.format-14x21 {
    width: 630px;
    height: 855px; /* 1:1.35 */
}

.page-sheet.format-A5 {
    width: 640px;
    height: 830px; /* 1:1.3 */
}

.page-sheet.format-16x23 {
    width: 680px;
    height: 900px; /* 1:1.32 */
}

/* Cores de Papel */
.page-sheet.paper-cream {
    background-color: #fbf6eb;
}

.page-sheet.paper-white {
    background-color: #ffffff;
}

/* Elementos internos da página */
.page-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 6px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-body {
    flex: 1;
    margin-top: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    font-size: 16.5px;
    line-height: 1.65;
    text-align: justify;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-body div {
    max-width: 100%;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-body > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.page-body p {
    text-indent: 1.5em;
    margin-bottom: 0;
    margin-top: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.page-body p:first-of-type {
    text-indent: 0; /* Primeira linha de capítulo ou seção sem recuo */
}

.page-body p.paragraph-continuation {
    text-indent: 0 !important; /* Parágrafo que continua na página seguinte sem recuo */
}

.page-footer {
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    color: #666;
}

/* Fontes do Texto */
.font-cinzel { font-family: 'Cinzel', serif; }
.font-garamond, .font-ebgaramond { font-family: 'EB Garamond', serif; }
.font-georgia { font-family: 'Georgia', serif; }
.font-lora { font-family: 'Lora', serif; }
.font-merriweather { font-family: 'Merriweather', serif; }
.font-greatvibes { font-family: 'Great Vibes', cursive; }
.font-inter { font-family: 'Inter', sans-serif; }
.font-outfit { font-family: 'Outfit', sans-serif; }

/* Título de Início de Capítulo */
.page-chapter-title {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 16px; /* Aumentado para melhor espaçamento quando sem ornamento */
    text-transform: uppercase;
}

/* Ajusta o espaçamento do ornamento quando segue o título do capítulo */
.page-chapter-title + .page-ornament {
    margin-top: 10px;
}

.chapter-number {
    display: block;
    font-size: 16px;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Se houver apenas o número do capítulo sem subtítulo, aumenta o tamanho */
.page-chapter-title > .chapter-number:only-child {
    font-size: 26px;
    margin-bottom: 0;
}

.chapter-title-sep {
    display: none;
}

.chapter-title-text {
    display: block;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Estilo do Ornamento */
.page-ornament {
    text-align: center;
    margin-bottom: 24px;
    color: #000000;
    font-size: 18px;
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: none !important; /* Impedir esmagamento pelo flexbox */
}

.page-ornament svg {
    display: inline-block;
    max-width: 180px;
    max-height: 36px;
}

/* Letra Capitular */
.has-dropcap p:first-of-type::first-letter {
    font-size: 58px;
    font-weight: 700;
    float: left;
    line-height: 46px;
    padding-right: 10px;
    padding-top: 6px;
    color: #000000;
    font-family: 'Cinzel', serif;
}

/* Layouts das Páginas Especiais */
.titlepage-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    text-align: center;
    padding: 30px 0;
}

.titlepage-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1a1a1a;
    text-transform: uppercase;
    margin-top: 60px;
}

.titlepage-line {
    width: 80px;
    height: 1px;
    background-color: #c5a059;
    margin: 24px auto;
}

.titlepage-author {
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 60px;
}

.copyright-layout {
    display: block;
    width: 100%;
}
.copyright-layout .copyright-text {
    font-size: 16.5px;
    line-height: 1.7;
    color: #1a1a1a;
    text-align: left;
}
.copyright-layout.first-page .copyright-text {
    margin-top: 20%;
}

/* Remove cabeçalhos e linhas divisórias das páginas estruturais */
[data-section-id="copyright"] .page-header,
[data-section-id="dedication"] .page-header,
[data-section-id="epigraph"] .page-header,
[data-section-id="bio"] .page-header,
[data-section-id="preface"] .page-header,
[data-section-id="epilogue"] .page-header,
[data-section-id="toc"] .page-header {
    display: none !important;
}

.dedication-layout {
    display: block;
    width: 100%;
    text-align: center;
}
.dedication-layout .dedication-text {
    font-style: italic;
    font-size: 16px;
    padding: 0 20px;
    line-height: 1.8;
}
.dedication-layout.first-page .dedication-text {
    margin-top: 25%;
}

.epigraph-layout {
    display: block;
    width: 100%;
    text-align: center;
}
.epigraph-layout .epigraph-text {
    font-style: italic;
    font-size: 16.5px;
    padding: 0 20px;
    line-height: 1.8;
}
.epigraph-layout.first-page .epigraph-text {
    margin-top: 25%;
}

.toc-layout h2 {
    text-align: center;
    font-size: 20px;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.toc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
}

.toc-leader {
    flex: 1;
    border-bottom: 1px dotted #777;
    margin: 0 8px;
}

.bio-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
}

.bio-layout p {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.bio-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #e2e8f0;
    border: 1px solid #c5a059;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.bio-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #c5a059;
}

/* Estilo do Item de Capítulo na Sidebar */
.chapter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    color: #c8c9cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    user-select: none;
}

.chapter-item::before {
    content: "►";
    color: var(--color-primary);
    font-size: 9px;
    transition: transform 0.15s ease;
    display: inline-block;
}

.chapter-item:hover {
    background-color: rgba(255, 200, 59, 0.08);
    color: var(--color-primary);
}

.chapter-item.active {
    background-color: rgba(255, 200, 59, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

.chapter-item.active::before {
    transform: rotate(90deg);
}

/* Centralização vertical para capítulos que não exibem o miolo */
.chapter-start-only .page-body {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.chapter-start-only .page-chapter-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 800; /* Super negrito */
}

/* --- ESTILOS DE IMPRESSÃO ESTÁTICOS PARA EXPORTAÇÃO PDF --- */
@media print {
    /* Ocultar elementos de UI */
    .main-header, .sidebar-left, .sidebar-right, .center-branding, .upload-card {
        display: none !important;
    }
    
    /* Configurar body e html */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
    }
    
    .app-container, .workspace-body, .workspace-center {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
    }
    
    .pages-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }
    
    .page-sheet {
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        box-sizing: border-box !important;
    }
    .page-body {
        overflow: visible !important;
    }
}

/* Grouped 2-Column Font Selectors UI */
.font-section-group {
    border-bottom: 1px solid rgba(255, 200, 59, 0.12);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.font-section-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.font-section-group h4 {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

.form-row-2col {
    display: flex;
    gap: 8px;
}

.form-row-2col .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row-2col .form-group label {
    font-size: 9px;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.form-row-2col .form-select {
    padding: 6px 10px;
    font-size: 12px;
    background-position: right 6px center;
    background-size: 12px;
}

/* Dropdown de Exportar */
.dropdown-export {
    position: relative;
    display: inline-block;
}

.dropdown-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    padding: 6px 0;
}

.dropdown-menu-content.show {
    display: block;
    animation: fadeInDropdown 0.15s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    background: none;
    border: none;
    color: var(--color-text-bright);
    padding: 10px 16px;
    width: 100%;
    text-align: left;
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 200, 59, 0.12);
    color: var(--color-primary);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

/* Proofread / Spell Checker Styles */
.proofread-error {
    background-color: rgba(255, 75, 75, 0.2);
    border-bottom: 2px dashed #ff4b4b;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0 2px;
}
.proofread-error:hover {
    background-color: rgba(255, 75, 75, 0.4);
}

.proofread-popover {
    position: absolute;
    background-color: #1e1e24;
    border: 1px solid rgba(255, 200, 59, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 12px;
    z-index: 10000;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    animation: fadeIn 0.15s ease-out;
}

.proofread-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffc83b;
    font-weight: 600;
}

.proofread-popover-close {
    background: none;
    border: none;
    color: #a0a0a5;
    cursor: pointer;
    font-size: 12px;
}
.proofread-popover-close:hover {
    color: #ffffff;
}

.proofread-popover-body {
    font-size: 13px;
    color: #e0e0e5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proofread-popover-type {
    font-size: 11px;
    color: #a0a0a5;
}

.proofread-popover-diff {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 4px;
}

.diff-original {
    color: #ff6b6b;
    text-decoration: line-through;
}

.diff-arrow {
    color: #a0a0a5;
}

.diff-suggestion {
    color: #51cf66;
    font-weight: 600;
}

.proofread-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    height: auto;
}

/* Button Spell Check Active Styling */
#btn-toggle-proofreader.active {
    background-color: #ffc83b !important;
    color: #121214 !important;
    border-color: #ffc83b !important;
    box-shadow: 0 0 10px rgba(255, 200, 59, 0.4);
}

.paragraph-editable:focus {
    outline: none;
    border-left: 2px solid var(--color-primary);
    padding-left: 10px;
    background-color: rgba(255, 200, 59, 0.03);
}

/* Custom Spellcheck Suggestions & Input */
.btn-sug-pill {
    background: rgba(255, 200, 59, 0.1);
    border: 1px solid rgba(255, 200, 59, 0.3);
    color: #ffc83b;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-sug-pill:hover {
    background: rgba(255, 200, 59, 0.25);
    border-color: #ffc83b;
}
.custom-correction-input {
    flex: 1;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e5;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease;
}
.custom-correction-input:focus {
    border-color: #ffc83b;
}

/* Molduras Decorativas de Página (Premium) */
.page-border-frame {
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: 25px;
    right: 25px;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
}

.page-border-frame.style-vitoriana {
    border: 3px double #000000;
}
.page-border-frame.style-artdeco {
    border: 1px solid #000000;
}
.page-border-frame.style-floral {
    border: 1px solid #000000;
}
.page-border-frame.style-minimalista {
    border: 1px solid #000000;
}
.page-border-frame.style-botanica {
    border: 1px solid #000000;
    border-radius: 12px;
}
.page-border-frame.style-barroco {
    border: 3px double #000000;
}
.page-border-frame.style-rosas {
    border: 3px double #000000;
}

.page-border-frame .corner {
    position: absolute;
    width: 32px;
    height: 32px;
    color: #000000;
}

.page-border-frame.style-botanica .corner {
    width: 65px;
    height: 75px;
}
.page-border-frame.style-barroco .corner {
    width: 60px;
    height: 60px;
}
.page-border-frame.style-rosas .corner {
    background-image: url('assets/canto_vitoriano.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 38px;
    height: 38px;
    mix-blend-mode: multiply;
}

.page-border-frame.style-vitoriana .corner.top-left { top: -6px; left: -6px; }
.page-border-frame.style-vitoriana .corner.top-right { top: -6px; right: -6px; transform: scaleX(-1); }
.page-border-frame.style-vitoriana .corner.bottom-left { bottom: -6px; left: -6px; transform: scaleY(-1); }
.page-border-frame.style-vitoriana .corner.bottom-right { bottom: -6px; right: -6px; transform: scale(-1); }

.page-border-frame.style-artdeco .corner.top-left,
.page-border-frame.style-floral .corner.top-left,
.page-border-frame.style-minimalista .corner.top-left { top: -4px; left: -4px; }

.page-border-frame.style-artdeco .corner.top-right,
.page-border-frame.style-floral .corner.top-right,
.page-border-frame.style-minimalista .corner.top-right { top: -4px; right: -4px; transform: scaleX(-1); }

.page-border-frame.style-artdeco .corner.bottom-left,
.page-border-frame.style-floral .corner.bottom-left,
.page-border-frame.style-minimalista .corner.bottom-left { bottom: -4px; left: -4px; transform: scaleY(-1); }

.page-border-frame.style-artdeco .corner.bottom-right,
.page-border-frame.style-floral .corner.bottom-right,
.page-border-frame.style-minimalista .corner.bottom-right { bottom: -4px; right: -4px; transform: scale(-1); }

.page-border-frame.style-botanica .corner.top-left { top: -2px; left: -2px; }
.page-border-frame.style-botanica .corner.top-right { top: -2px; right: -2px; transform: scaleX(-1); }
.page-border-frame.style-botanica .corner.bottom-left { bottom: -2px; left: -2px; transform: scaleY(-1); }
.page-border-frame.style-botanica .corner.bottom-right { bottom: -2px; right: -2px; transform: scale(-1); }

.page-border-frame.style-barroco .corner.top-left { top: -4px; left: -4px; }
.page-border-frame.style-barroco .corner.top-right { top: -4px; right: -4px; transform: scaleX(-1); }
.page-border-frame.style-barroco .corner.bottom-left { bottom: -4px; left: -4px; transform: scaleY(-1); }
.page-border-frame.style-barroco .corner.bottom-right { bottom: -4px; right: -4px; transform: scale(-1); }

.page-border-frame.style-rosas .corner.top-left { top: -6px; left: -6px; }
.page-border-frame.style-rosas .corner.top-right { top: -6px; right: -6px; transform: scaleX(-1); }
.page-border-frame.style-rosas .corner.bottom-left { bottom: -6px; left: -6px; transform: scaleY(-1); }
.page-border-frame.style-rosas .corner.bottom-right { bottom: -6px; right: -6px; transform: scale(-1); }

/* Suporte para Ornamentos Premium (Imagens com Máscara de Cor) */
.premium-ornament-container {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px auto 30px auto;
}

.premium-ornament-mask {
    display: block;
    margin: 0 auto;
    width: 100%;
    height: 250px;
    background-color: #000000;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}







