/* ==========================================================================

   FURSONA STUDIO — SEQUENTIAL COMIC STUDIO & PAGE LAYOUT ENGINE (V2.0)

   Sovereign Multi-Panel Graphic Novel Pipeline & High-Usability UI

   ========================================================================== */

body.view-comic .comic-workspace {

    display: flex !important;

}

body.view-comic .studio-workspace,

body.view-comic .director-chat-workspace,

body.view-comic .rainscript-workspace {

    display: none !important;

}

.comic-workspace {

    display: none;

    flex-direction: column;

    width: 100%;

    max-width: 1720px;

    margin: 0 auto;

    padding: 16px 20px 60px 20px;

    gap: 18px;

    color: #e2e8f0;

    box-sizing: border-box;

}

/* --- Top Header & Config Toolbar --- */

.comic-toolbar {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    padding: 14px 18px;

    background: rgba(10, 16, 29, 0.9);

    border: 1px solid rgba(56, 189, 248, 0.25);

    border-radius: 14px;

    backdrop-filter: blur(14px);

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

}

.comic-toolbar-left {

    display: flex;

    flex-direction: column;

    gap: 8px;

    flex: 1 1 360px;

}

.comic-brand-title {

    display: flex;

    align-items: center;

    gap: 10px;

    font-size: 1.1rem;

    font-weight: 800;

    letter-spacing: 0.05em;

    color: #f8fafc;

    text-transform: uppercase;

}

.comic-brand-title i {

    color: #00f2fe;

}

.comic-brand-tag {

    font-size: 0.68rem;

    padding: 2px 8px;

    border-radius: 6px;

    background: rgba(0, 242, 254, 0.15);

    color: #00f2fe;

    border: 1px solid rgba(0, 242, 254, 0.35);

    font-weight: 700;

}

.comic-anchor-row {

    display: flex;

    align-items: center;

    gap: 8px;

}

.comic-anchor-input {

    flex: 1;

    background: rgba(4, 7, 15, 0.7);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 8px;

    padding: 7px 12px;

    font-size: 0.82rem;

    color: #f1f5f9;

    outline: none;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;

}

.comic-anchor-input:focus {

    border-color: #00f2fe;

    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);

}

.comic-meta-row {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-wrap: wrap;

}

.comic-meta-field {

    display: flex;

    align-items: center;

    gap: 6px;

    flex: 1 1 200px;

}

.comic-meta-input {

    flex: 1;

    background: rgba(4, 7, 15, 0.75);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 8px;

    padding: 6px 10px;

    font-size: 0.8rem;

    color: #f8fafc;

    font-family: 'Plus Jakarta Sans', sans-serif;

    outline: none;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;

}

.comic-title-input {

    font-weight: 700;

    color: #ffffff;

}

.comic-subtitle-input {

    color: #38bdf8;

    font-family: 'JetBrains Mono', monospace;

    font-size: 0.76rem;

}

.comic-meta-input:focus {

    border-color: #00f2fe;

    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);

}

/* Toolbar Center: Format & Layout Selectors */

.comic-toolbar-center {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-wrap: wrap;

}

.comic-format-pills,

.comic-layout-pills {

    display: inline-flex;

    align-items: center;

    flex-wrap: wrap;

    background: rgba(4, 7, 15, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 10px;

    padding: 3px;

    gap: 3px;

    overflow-x: visible;

    max-width: 100%;

}

.comic-format-pills::-webkit-scrollbar,

.comic-layout-pills::-webkit-scrollbar {

    display: none;

    width: 0;

    height: 0;

}

.comic-format-pill,

.comic-layout-pill {

    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 5px 9px;

    background: transparent;

    border: 1px solid transparent;

    border-radius: 7px;

    color: #94a3b8;

    font-size: 0.76rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

    white-space: nowrap;

}

.comic-format-pill:hover,

.comic-layout-pill:hover {

    color: #f8fafc;

    background: rgba(255, 255, 255, 0.06);

}

.comic-format-pill.active,

.comic-layout-pill.active {

    color: #ffffff;

    background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(6, 182, 212, 0.25));

    border-color: #00f2fe;

    box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);

}

.layout-panel-badge {

    font-size: 0.65rem;

    font-weight: 800;

    padding: 1px 5px;

    border-radius: 4px;

    background: rgba(255, 255, 255, 0.12);

    color: #cbd5e1;

    margin-left: 2px;

}

.comic-layout-pill.active .layout-panel-badge {

    background: rgba(0, 242, 254, 0.25);

    color: #00f2fe;

}

.comic-config-group {

    display: flex;

    align-items: center;

    gap: 6px;

    background: rgba(15, 23, 42, 0.6);

    padding: 4px 8px;

    border-radius: 10px;

    border: 1px solid rgba(255, 255, 255, 0.08);

}

.comic-config-label {

    font-size: 0.75rem;

    font-weight: 700;

    color: #94a3b8;

    text-transform: uppercase;

    letter-spacing: 0.04em;

}

.comic-select {

    background: rgba(4, 7, 15, 0.85);

    border: 1px solid rgba(56, 189, 248, 0.3);

    border-radius: 6px;

    padding: 5px 10px;

    font-size: 0.82rem;

    color: #38bdf8;

    font-weight: 600;

    outline: none;

    cursor: pointer;

}

/* Toolbar Right: Cost & Batch Action Buttons */

.comic-toolbar-right {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-wrap: wrap;

}

.comic-cost-badge {

    display: flex;

    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    background: rgba(245, 158, 11, 0.12);

    border: 1px solid rgba(245, 158, 11, 0.35);

    border-radius: 8px;

    font-size: 0.82rem;

    font-weight: 700;

    color: #fbbf24;

}

.comic-btn-primary {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 16px;

    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    border: 1px solid #38bdf8;

    border-radius: 8px;

    color: #ffffff;

    font-size: 0.85rem;

    font-weight: 700;

    cursor: pointer;

    transition: transform 0.15s ease, box-shadow 0.15s ease;

}

.comic-btn-primary:hover:not(:disabled) {

    transform: translateY(-1px);

    box-shadow: 0 0 16px rgba(14, 165, 233, 0.5);

}

.comic-btn-export {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 16px;

    background: linear-gradient(135deg, #10b981 0%, #059669 100%);

    border: 1px solid #34d399;

    border-radius: 8px;

    color: #ffffff;

    font-size: 0.85rem;

    font-weight: 700;

    cursor: pointer;

    transition: transform 0.15s ease, box-shadow 0.15s ease;

}

.comic-btn-export:hover:not(:disabled) {

    transform: translateY(-1px);

    box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);

}

/* --- Main Layout: Deck & Live Canvas --- */

.comic-main-split {

    display: grid;

    grid-template-columns: 1fr 430px;

    gap: 20px;

}

@media (max-width: 1250px) {

    .comic-main-split {

        grid-template-columns: 1fr;

    }

}

/* --- Panels Deck --- */

.comic-deck-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));

    gap: 16px;

}

.comic-panel-card {

    display: flex;

    flex-direction: column;

    background: rgba(10, 16, 29, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    padding: 14px;

    gap: 10px;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;

}

.comic-panel-card.active-generating {

    border-color: #00f2fe;

    box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);

}

.comic-panel-card-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding-bottom: 8px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

}

.panel-card-title-group {

    display: flex;

    align-items: center;

    gap: 8px;

}

.panel-card-act {

    font-size: 0.88rem;

    font-weight: 800;

    color: #00f2fe;

    font-family: 'JetBrains Mono', monospace;

    letter-spacing: 0.05em;

}

.panel-card-subact {

    font-size: 0.72rem;

    font-weight: 700;

    color: #64748b;

    padding: 1px 6px;

    border-radius: 4px;

    background: rgba(255, 255, 255, 0.05);

}

.panel-card-status {

    font-size: 0.7rem;

    font-weight: 700;

    padding: 2px 8px;

    border-radius: 5px;

    text-transform: uppercase;

    font-family: 'JetBrains Mono', monospace;

}

.panel-card-status.idle {

    background: rgba(148, 163, 184, 0.12);

    color: #94a3b8;

}

.panel-card-status.ready {

    background: rgba(16, 185, 129, 0.15);

    color: #34d399;

    border: 1px solid rgba(16, 185, 129, 0.35);

}

.panel-card-status.generating {

    background: rgba(14, 165, 233, 0.2);

    color: #38bdf8;

    border: 1px solid rgba(56, 189, 248, 0.4);

    animation: pulseGlow 1.5s infinite;

}

/* Panel Card Viewport / Frame */

.panel-viewport {

    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    background: rgba(4, 7, 15, 0.95);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 10px;

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

}

.panel-viewport img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}

/* Empty State */

.panel-empty-state {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 20px;

    text-align: center;

    gap: 8px;

    width: 100%;

    height: 100%;

    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.08) 0%, rgba(4, 7, 15, 0.95) 75%);

}

.empty-state-icon {

    width: 48px;

    height: 48px;

    border-radius: 50%;

    background: rgba(56, 189, 248, 0.12);

    border: 1px solid rgba(56, 189, 248, 0.3);

    display: flex;

    align-items: center;

    justify-content: center;

    color: #38bdf8;

    font-size: 1.25rem;

    margin-bottom: 2px;

}

.empty-state-title {

    font-size: 0.9rem;

    font-weight: 700;

    color: #f1f5f9;

}

.empty-state-desc {

    font-size: 0.72rem;

    color: #94a3b8;

    max-width: 260px;

    line-height: 1.3;

}

.empty-state-actions {

    display: flex;

    flex-direction: column;

    gap: 6px;

    margin-top: 6px;

    width: 100%;

    max-width: 240px;

}

.btn-empty-generate {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 7px 14px;

    background: linear-gradient(135deg, #0ea5e9, #0284c7);

    border: 1px solid #38bdf8;

    border-radius: 7px;

    color: #ffffff;

    font-size: 0.8rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

}

.btn-empty-generate:hover {

    transform: translateY(-1px);

    box-shadow: 0 0 14px rgba(14, 165, 233, 0.45);

}

.btn-empty-pick {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 6px 14px;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 7px;

    color: #cbd5e1;

    font-size: 0.78rem;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;

}

.btn-empty-pick:hover {

    background: rgba(255, 255, 255, 0.12);

    color: #ffffff;

}

/* Image Hover Actions Overlay */

.panel-image-overlay {

    position: absolute;

    inset: 0;

    background: rgba(4, 7, 15, 0.75);

    backdrop-filter: blur(4px);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 8px;

    opacity: 0;

    transition: opacity 0.2s ease;

    padding: 16px;

}

.panel-viewport:hover .panel-image-overlay {

    opacity: 1;

}

.btn-overlay-action {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 6px 14px;

    background: rgba(15, 23, 42, 0.9);

    border: 1px solid rgba(255, 255, 255, 0.2);

    border-radius: 6px;

    color: #f1f5f9;

    font-size: 0.78rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

    width: 170px;

    justify-content: center;

}

.btn-overlay-action.reroll:hover {

    background: #0284c7;

    border-color: #38bdf8;

    color: #ffffff;

}

.btn-overlay-action.cutout:hover {

    background: #8b5cf6;

    border-color: #a78bfa;

    color: #ffffff;

}

.btn-overlay-action.pick:hover {

    background: #10b981;

    border-color: #34d399;

    color: #ffffff;

}

.btn-overlay-action.clear {

    width: 32px;

    height: 32px;

    padding: 0;

    border-radius: 50%;

    background: rgba(239, 68, 68, 0.2);

    border-color: rgba(239, 68, 68, 0.4);

    color: #f87171;

    position: absolute;

    top: 8px;

    right: 8px;

}

.btn-overlay-action.clear:hover {

    background: #ef4444;

    color: #ffffff;

}

/* Progress Overlay */

.panel-progress-overlay {

    position: absolute;

    inset: 0;

    background: rgba(6, 11, 22, 0.92);

    backdrop-filter: blur(8px);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;

    z-index: 10;

    padding: 24px;

    text-align: center;

}

.progress-pulse-ring {

    font-size: 2rem;

    color: #00f2fe;

    animation: pulseRing 1.5s infinite;

}

.progress-step-text {

    font-size: 0.88rem;

    font-weight: 800;

    letter-spacing: 0.08em;

    color: #ffffff;

    font-family: 'JetBrains Mono', monospace;

}

.progress-step-detail {

    font-size: 0.78rem;

    font-weight: 700;

    color: #38bdf8;

    font-family: 'JetBrains Mono', monospace;

}

.panel-progress-bar-bg {

    width: 80%;

    height: 8px;

    background: rgba(255, 255, 255, 0.1);

    border-radius: 4px;

    overflow: hidden;

    border: 1px solid rgba(56, 189, 248, 0.25);

}

.panel-progress-bar-fill {

    height: 100%;

    background: linear-gradient(90deg, #00f2fe, #38bdf8);

    transition: width 0.3s ease;

    box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);

}

.progress-footnote {

    font-size: 0.68rem;

    color: #64748b;

    font-family: 'JetBrains Mono', monospace;

}

/* Character Quick Chips */

.comic-character-chips {

    display: flex;

    align-items: center;

    gap: 6px;

    flex-wrap: wrap;

    padding: 4px 0;

}

.chips-label {

    font-size: 0.7rem;

    font-weight: 700;

    color: #64748b;

    text-transform: uppercase;

}

.comic-chip {

    padding: 3px 8px;

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    color: #cbd5e1;

    font-size: 0.72rem;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.15s ease;

}

.comic-chip:hover {

    background: rgba(56, 189, 248, 0.18);

    border-color: #38bdf8;

    color: #38bdf8;

}

/* Inputs Group */

.panel-inputs-group {

    display: flex;

    flex-direction: column;

    gap: 8px;

}

.panel-field-label {

    font-size: 0.72rem;

    font-weight: 700;

    color: #94a3b8;

    letter-spacing: 0.04em;

    text-transform: uppercase;

    display: flex;

    align-items: center;

    gap: 6px;

}

.panel-prompt-textarea {

    width: 100%;

    height: 64px;

    background: rgba(4, 7, 15, 0.75);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 8px;

    padding: 8px 10px;

    color: #f1f5f9;

    font-size: 0.8rem;

    line-height: 1.35;

    resize: vertical;

    outline: none;

    box-sizing: border-box;

    transition: border-color 0.2s ease;

}

.panel-prompt-textarea:focus {

    border-color: #00f2fe;

}

/* Dialogue Section */

.panel-dialogue-section {

    display: flex;

    flex-direction: column;

    gap: 6px;

    background: rgba(4, 7, 15, 0.4);

    padding: 8px;

    border-radius: 8px;

    border: 1px solid rgba(255, 255, 255, 0.06);

}

.dialogue-meta-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

}

.panel-bubble-style-select {

    background: rgba(15, 23, 42, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 5px;

    padding: 3px 6px;

    font-size: 0.72rem;

    color: #93c5fd;

    outline: none;

}

.dialogue-inputs-row {

    display: grid;

    grid-template-columns: 90px 1fr;

    gap: 6px;

}

.panel-speaker-input {

    background: rgba(15, 23, 42, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 6px;

    padding: 6px 8px;

    font-size: 0.78rem;

    color: #38bdf8;

    font-weight: 700;

    outline: none;

}

.panel-dialogue-input {

    background: rgba(15, 23, 42, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 6px;

    padding: 6px 10px;

    font-size: 0.8rem;

    color: #f8fafc;

    outline: none;

}

.panel-dialogue-input:focus,

.panel-speaker-input:focus {

    border-color: #38bdf8;

}

/* Card Actions */

.panel-card-actions {

    display: flex;

    align-items: center;

    gap: 8px;

    padding-top: 4px;

}

.btn-panel-action {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    background: rgba(15, 23, 42, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 6px;

    color: #cbd5e1;

    font-size: 0.76rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.btn-panel-action.reroll {

    background: rgba(14, 165, 233, 0.15);

    border-color: rgba(56, 189, 248, 0.35);

    color: #38bdf8;

}

.btn-panel-action.reroll:hover {

    background: #0284c7;

    color: #ffffff;

}

.btn-panel-action.pick:hover {

    background: rgba(16, 185, 129, 0.2);

    border-color: #34d399;

    color: #34d399;

}

.btn-panel-action.cutout:hover {

    background: rgba(139, 92, 246, 0.2);

    border-color: #a78bfa;

    color: #a78bfa;

}

/* Panel Card Reordering */

.panel-reorder-group {

    display: inline-flex;

    align-items: center;

    gap: 2px;

    margin-left: 8px;

    background: rgba(4, 7, 15, 0.7);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 6px;

    padding: 1px;

}

.btn-panel-reorder {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 24px;

    height: 22px;

    background: transparent;

    border: none;

    color: #94a3b8;

    border-radius: 4px;

    cursor: pointer;

    font-size: 0.7rem;

    transition: all 0.15s ease;

}

.btn-panel-reorder:hover:not(:disabled) {

    background: rgba(56, 189, 248, 0.25);

    color: #00f2fe;

}

.btn-panel-reorder:disabled {

    opacity: 0.25;

    cursor: not-allowed;

}

/* Director Cinematography Chips */

.comic-framing-chips {

    display: flex;

    align-items: center;

    gap: 5px;

    flex-wrap: wrap;

    padding: 2px 0 4px 0;

}

.comic-frame-chip {

    padding: 3px 8px;

    background: rgba(14, 165, 233, 0.08);

    border: 1px solid rgba(56, 189, 248, 0.2);

    border-radius: 6px;

    color: #7dd3fc;

    font-size: 0.71rem;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.15s ease;

}

.comic-frame-chip:hover {

    background: rgba(14, 165, 233, 0.22);

    border-color: #38bdf8;

    color: #ffffff;

    transform: translateY(-1px);

}

/* Dialogue Style & Position Toggles */

.dialogue-style-toggles {

    display: inline-flex;

    align-items: center;

    gap: 6px;

}

.panel-bubble-pos-select {

    background: rgba(15, 23, 42, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 5px;

    padding: 3px 6px;

    font-size: 0.72rem;

    color: #fbbf24;

    outline: none;

    cursor: pointer;

}

/* --- Right Column: Live Page Preview Pane --- */

.comic-preview-pane {

    display: flex;

    flex-direction: column;

    background: rgba(10, 16, 29, 0.85);

    border: 1px solid rgba(56, 189, 248, 0.2);

    border-radius: 14px;

    padding: 16px;

    gap: 12px;

    position: sticky;

    top: 80px;

    height: fit-content;

}

.comic-preview-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    font-size: 0.95rem;

    font-weight: 800;

    color: #f1f5f9;

    padding-bottom: 8px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

}

.comic-page-canvas-container {

    width: 100%;

    border-radius: 8px;

    overflow: hidden;

    background: #04070f;

    border: 1px solid rgba(255, 255, 255, 0.1);

    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);

}

#comic-page-canvas {

    width: 100%;

    height: auto;

    display: block;

}

/* --- Library Picker Modal --- */

.comic-library-modal {

    position: fixed;

    inset: 0;

    margin: auto;

    max-width: 900px;

    width: 92%;

    max-height: 85vh;

    background: transparent;

    border: none;

    padding: 0;

    z-index: 10000;

}

.comic-library-modal::backdrop {

    background: rgba(4, 7, 15, 0.8);

    backdrop-filter: blur(8px);

}

.comic-modal-box {

    display: flex;

    flex-direction: column;

    background: #0b1120;

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 16px;

    padding: 20px 24px;

    gap: 14px;

    max-height: 82vh;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);

    color: #f1f5f9;

}

.comic-modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding-bottom: 10px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

}

.modal-title-group {

    display: flex;

    align-items: center;

    gap: 10px;

}

.modal-title-group h3 {

    margin: 0;

    font-size: 1.05rem;

    font-weight: 800;

    color: #f8fafc;

}

.modal-icon {

    color: #00f2fe;

    font-size: 1.2rem;

}

.comic-modal-close {

    background: transparent;

    border: none;

    color: #94a3b8;

    font-size: 1.5rem;

    cursor: pointer;

    line-height: 1;

}

.comic-modal-close:hover {

    color: #f87171;

}

.comic-modal-subtitle {

    font-size: 0.8rem;

    color: #94a3b8;

}

.comic-library-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));

    gap: 12px;

    overflow-y: auto;

    max-height: 55vh;

    padding-right: 4px;

}

.comic-library-item {

    position: relative;

    aspect-ratio: 1 / 1;

    border-radius: 8px;

    overflow: hidden;

    background: #04070f;

    border: 1px solid rgba(255, 255, 255, 0.1);

    cursor: pointer;

    transition: transform 0.15s ease, border-color 0.15s ease;

}

.comic-library-item img {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}

.comic-library-item:hover {

    transform: scale(1.04);

    border-color: #00f2fe;

    box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);

}

.library-item-hover {

    position: absolute;

    inset: 0;

    background: rgba(4, 7, 15, 0.8);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 8px;

    text-align: center;

    opacity: 0;

    transition: opacity 0.15s ease;

    gap: 6px;

}

.comic-library-item:hover .library-item-hover {

    opacity: 1;

}

.library-item-char {

    font-size: 0.7rem;

    font-weight: 700;

    color: #38bdf8;

    text-transform: uppercase;

}

.library-item-cta {

    font-size: 0.72rem;

    font-weight: 800;

    color: #ffffff;

    background: #0284c7;

    padding: 3px 8px;

    border-radius: 4px;

}

.library-loading,

.library-empty {

    grid-column: 1 / -1;

    text-align: center;

    padding: 40px;

    color: #64748b;

    font-size: 0.9rem;

}

/* Mobile Polish for Metadata & Anchors */

@media (max-width: 680px) {

    .comic-meta-row {

        flex-direction: column;

        align-items: stretch;

        gap: 6px;

    }

    .comic-meta-field {

        width: 100%;

        flex: 1 1 100%;

    }

    .comic-anchor-row {

        flex-direction: column;

        align-items: flex-start;

        gap: 4px;

    }

    .comic-anchor-input {

        width: 100%;

        box-sizing: border-box;

    }

}

/* ==========================================================================

   MULTI-PAGE CHAPTER BAR & EXPORT SPLIT GROUP

   ========================================================================== */

.comic-export-split-group {

    display: inline-flex;

    align-items: center;

    gap: 6px;

}

.comic-btn-export-alt {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 8px 13px;

    background: rgba(15, 23, 42, 0.85);

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 8px;

    color: #38bdf8;

    font-size: 0.82rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.comic-btn-export-alt:hover:not(:disabled) {

    background: rgba(14, 165, 233, 0.25);

    border-color: #00f2fe;

    color: #ffffff;

    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);

    transform: translateY(-1px);

}

.comic-btn-export-alt:disabled {

    opacity: 0.4;

    cursor: not-allowed;

}

/* Chapter Pages Navigation Bar */

.comic-pages-bar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 10px 16px;

    background: rgba(10, 16, 29, 0.75);

    border: 1px solid rgba(56, 189, 248, 0.2);

    border-radius: 12px;

    backdrop-filter: blur(10px);

}

.comic-pages-label {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 0.76rem;

    font-weight: 800;

    color: #94a3b8;

    letter-spacing: 0.05em;

    text-transform: uppercase;

    font-family: 'JetBrains Mono', monospace;

    white-space: nowrap;

}

.comic-pages-label i {

    color: #00f2fe;

}

.comic-pages-scroll {

    display: flex;

    align-items: center;

    gap: 8px;

    overflow-x: auto;

    padding: 2px 4px;

    flex: 1;

}

.comic-page-tab {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 14px;

    background: rgba(15, 23, 42, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 8px;

    color: #94a3b8;

    font-size: 0.78rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

    white-space: nowrap;

}

.comic-page-tab:hover {

    color: #ffffff;

    border-color: rgba(56, 189, 248, 0.4);

    background: rgba(255, 255, 255, 0.06);

}

.comic-page-tab.active {

    color: #ffffff;

    background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(6, 182, 212, 0.2));

    border-color: #00f2fe;

    box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);

}

.comic-page-tab-badge {

    font-size: 0.65rem;

    padding: 1px 5px;

    border-radius: 4px;

    background: rgba(0, 0, 0, 0.35);

    color: #00f2fe;

}

.comic-pages-actions {

    display: flex;

    align-items: center;

    gap: 8px;

    white-space: nowrap;

}

.btn-comic-page-action {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 7px;

    color: #cbd5e1;

    font-size: 0.76rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.btn-comic-page-action:hover {

    background: rgba(56, 189, 248, 0.2);

    border-color: #38bdf8;

    color: #ffffff;

}

.btn-comic-page-action.danger:hover {

    background: rgba(239, 68, 68, 0.2);

    border-color: #f87171;

    color: #f87171;

}

.pages-divider {

    width: 1px;

    height: 20px;

    background: rgba(255, 255, 255, 0.15);

}

.btn-comic-reader {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 14px;

    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(147, 51, 234, 0.25));

    border: 1px solid #c084fc;

    border-radius: 7px;

    color: #e9d5ff;

    font-size: 0.78rem;

    font-weight: 800;

    cursor: pointer;

    transition: all 0.15s ease;

}

.btn-comic-reader:hover {

    transform: translateY(-1px);

    box-shadow: 0 0 14px rgba(192, 132, 252, 0.45);

    color: #ffffff;

}

/* Discord Sticker Button */

.btn-panel-action.sticker {

    background: rgba(168, 85, 247, 0.15);

    border-color: rgba(192, 132, 252, 0.35);

    color: #c084fc;

}

.btn-panel-action.sticker:hover {

    background: #9333ea;

    border-color: #c084fc;

    color: #ffffff;

    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);

}

/* ==========================================================================

   IMMERSIVE FULLSCREEN CHAPTER & WEBTOON READER MODAL

   ========================================================================== */

.comic-reader-modal {

    position: fixed;

    inset: 0;

    z-index: 100000;

    display: flex;

    flex-direction: column;

    background: #060911;

    overflow: hidden;

}

.reader-chrome {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 12px 24px;

    background: rgba(10, 16, 29, 0.95);

    border-bottom: 1px solid rgba(56, 189, 248, 0.25);

    backdrop-filter: blur(12px);

    z-index: 10;

}

.reader-chrome-left {

    display: flex;

    flex-direction: column;

    gap: 2px;

}

.reader-title {

    font-size: 1.05rem;

    font-weight: 800;

    color: #ffffff;

    text-transform: uppercase;

    letter-spacing: 0.04em;

}

.reader-subtitle {

    font-size: 0.72rem;

    font-weight: 700;

    color: #00f2fe;

    font-family: 'JetBrains Mono', monospace;

}

.reader-chrome-center {

    display: flex;

    align-items: center;

    gap: 12px;

}

.reader-nav-btn {

    width: 34px;

    height: 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 8px;

    color: #f1f5f9;

    cursor: pointer;

    font-size: 0.85rem;

    transition: all 0.15s ease;

}

.reader-nav-btn:hover {

    background: #00f2fe;

    color: #080c16;

}

.reader-page-indicator {

    font-size: 0.82rem;

    font-weight: 800;

    color: #cbd5e1;

    font-family: 'JetBrains Mono', monospace;

    min-width: 90px;

    text-align: center;

}

.reader-chrome-right {

    display: flex;

    align-items: center;

    gap: 12px;

}

.reader-tool-btn {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    background: rgba(56, 189, 248, 0.12);

    border: 1px solid rgba(56, 189, 248, 0.3);

    border-radius: 7px;

    color: #38bdf8;

    font-size: 0.78rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.reader-tool-btn.active {

    background: #0ea5e9;

    color: #ffffff;

    border-color: #38bdf8;

    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);

}

.reader-close-btn {

    background: transparent;

    border: none;

    color: #94a3b8;

    font-size: 1.8rem;

    cursor: pointer;

    line-height: 1;

    transition: color 0.15s ease;

}

.reader-close-btn:hover {

    color: #f87171;

}

.reader-content-scroll {

    flex: 1;

    overflow-y: auto;

    overflow-x: hidden;

    display: flex;

    flex-direction: column;

    align-items: center;

    padding: 40px 20px 80px 20px;

    gap: 32px;

    scroll-behavior: smooth;

}

.reader-page-frame {

    max-width: 900px;

    width: 100%;

    border-radius: 12px;

    overflow: hidden;

    background: #080c16;

    border: 1px solid rgba(56, 189, 248, 0.3);

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);

}

.reader-page-frame img {

    width: 100%;

    height: auto;

    display: block;

}

@media (max-width: 680px) {

    .comic-pages-bar {

        flex-direction: column;

        align-items: stretch;

        gap: 8px;

    }

    .comic-pages-actions {

        justify-content: space-between;

        width: 100%;

        overflow-x: auto;

    }

    .comic-export-split-group {

        display: flex;

        width: 100%;

        flex-wrap: wrap;

        gap: 6px;

    }

    .comic-export-split-group button {

        flex: 1 1 120px;

    }

}

/* ==========================================================================

   DISCORD STICKER & EMOTE STUDIO MODAL

   ========================================================================== */

.sticker-modal {

    border: none;

    background: transparent;

    padding: 0;

    max-width: 960px;

    width: 95vw;

    color: #f1f5f9;

}

.sticker-modal::backdrop {

    background: rgba(4, 7, 14, 0.85);

    backdrop-filter: blur(12px);

}

.sticker-modal-box {

    background: #0d121f;

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 18px;

    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 242, 254, 0.15);

    display: flex;

    flex-direction: column;

    overflow: hidden;

}

.sticker-modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 18px 24px;

    border-bottom: 1px solid rgba(56, 189, 248, 0.18);

    background: rgba(15, 23, 42, 0.6);

}

.sticker-title-group {

    display: flex;

    align-items: center;

    gap: 12px;

}

.sticker-modal-title {

    margin: 0;

    font-size: 1.15rem;

    font-weight: 800;

    letter-spacing: 0.02em;

    color: #f8fafc;

    display: flex;

    align-items: center;

    gap: 10px;

}

.sticker-modal-tag {

    font-size: 0.7rem;

    font-weight: 800;

    font-family: 'JetBrains Mono', monospace;

    color: #00f2fe;

    background: rgba(0, 242, 254, 0.12);

    padding: 3px 8px;

    border-radius: 6px;

    border: 1px solid rgba(0, 242, 254, 0.25);

}

.sticker-modal-body {

    display: grid;

    grid-template-columns: 1.1fr 1fr;

    gap: 24px;

    padding: 24px;

    background: #090d18;

}

/* Discord Chat Simulator Stage */

.discord-preview-column {

    display: flex;

    flex-direction: column;

}

.discord-chat-box {

    background: #313338;

    border-radius: 14px;

    padding: 20px;

    display: flex;

    flex-direction: column;

    gap: 14px;

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);

}

.discord-msg-header {

    display: flex;

    align-items: center;

    gap: 12px;

}

.discord-avatar-circle {

    width: 40px;

    height: 40px;

    border-radius: 50%;

    background: linear-gradient(135deg, #0ea5e9, #00f2fe);

    display: flex;

    align-items: center;

    justify-content: center;

    color: #ffffff;

    font-size: 1.1rem;

    flex-shrink: 0;

}

.discord-user-meta {

    display: flex;

    align-items: center;

    gap: 8px;

}

.discord-username {

    font-weight: 700;

    font-size: 0.95rem;

    color: #f2f3f5;

}

.discord-bot-badge {

    background: #5865F2;

    color: #ffffff;

    font-size: 0.65rem;

    font-weight: 800;

    padding: 2px 5px;

    border-radius: 4px;

}

.discord-timestamp {

    font-size: 0.75rem;

    color: #949ba4;

}

.discord-sticker-stage {

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    min-height: 240px;

    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.15) 100%);

    border-radius: 8px;

}

.discord-sticker-img {

    max-width: 220px;

    max-height: 220px;

    object-fit: contain;

    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));

    transition: transform 0.2s ease;

}

.discord-sticker-img:hover {

    transform: scale(1.04);

}

.discord-msg-reply {

    background: rgba(0, 0, 0, 0.2);

    border-radius: 8px;

    padding: 10px 14px;

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 0.88rem;

    color: #dbdee1;

}

.discord-reply-user {

    font-weight: 700;

    color: #38bdf8;

}

.discord-emote-inline {

    width: 32px;

    height: 32px;

    object-fit: contain;

    vertical-align: middle;

    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));

    transition: transform 0.15s ease;

}

.discord-emote-inline:hover {

    transform: scale(1.25);

}

/* Controls Column */

.sticker-controls-column {

    display: flex;

    flex-direction: column;

    gap: 16px;

}

.sticker-config-panel,

.sticker-downloads-panel {

    background: rgba(15, 23, 42, 0.65);

    border: 1px solid rgba(56, 189, 248, 0.2);

    border-radius: 12px;

    padding: 16px;

    display: flex;

    flex-direction: column;

    gap: 12px;

}

.sticker-panel-title {

    margin: 0;

    font-size: 0.82rem;

    font-weight: 800;

    color: #94a3b8;

    text-transform: uppercase;

    letter-spacing: 0.05em;

    font-family: 'JetBrains Mono', monospace;

    display: flex;

    align-items: center;

    gap: 8px;

}

.sticker-ctrl-group {

    display: flex;

    flex-direction: column;

    gap: 6px;

}

.sticker-ctrl-label-row {

    display: flex;

    justify-content: space-between;

    align-items: center;

    font-size: 0.85rem;

    font-weight: 700;

    color: #cbd5e1;

}

.sticker-ctrl-badge {

    font-family: 'JetBrains Mono', monospace;

    color: #00f2fe;

    font-weight: 800;

    font-size: 0.8rem;

}

.sticker-slider {

    width: 100%;

    accent-color: #00f2fe;

    cursor: pointer;

}

.sticker-color-palette {

    display: flex;

    gap: 8px;

}

.sticker-color-btn {

    width: 28px;

    height: 28px;

    border-radius: 50%;

    border: 2px solid transparent;

    cursor: pointer;

    transition: transform 0.15s ease, border-color 0.15s ease;

}

.sticker-color-btn:hover {

    transform: scale(1.15);

}

.sticker-color-btn.active {

    border-color: #38bdf8;

    transform: scale(1.2);

    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);

}

.btn-sticker-refresh {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 8px 14px;

    background: rgba(14, 165, 233, 0.15);

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 8px;

    color: #38bdf8;

    font-size: 0.82rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.btn-sticker-refresh:hover:not(:disabled) {

    background: rgba(14, 165, 233, 0.3);

    border-color: #00f2fe;

    color: #ffffff;

    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);

}

.sticker-export-btn {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 14px;

    background: rgba(10, 16, 29, 0.7);

    border: 1px solid rgba(56, 189, 248, 0.22);

    border-radius: 9px;

    color: #f1f5f9;

    text-decoration: none;

    transition: all 0.15s ease;

}

.sticker-export-btn i {

    font-size: 1.25rem;

    color: #38bdf8;

    flex-shrink: 0;

}

.sticker-export-btn:hover {

    background: rgba(14, 165, 233, 0.2);

    border-color: #00f2fe;

    transform: translateY(-1px);

    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.2);

}

.sticker-export-btn.primary-pack {

    background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(0, 242, 254, 0.2));

    border-color: rgba(0, 242, 254, 0.5);

}

.sticker-export-btn.primary-pack i {

    color: #00f2fe;

}

.sticker-export-btn.primary-pack:hover {

    background: linear-gradient(135deg, rgba(14, 165, 233, 0.5), rgba(0, 242, 254, 0.35));

    border-color: #00f2fe;

    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);

}

.export-btn-text {

    display: flex;

    flex-direction: column;

}

.export-btn-title {

    font-size: 0.85rem;

    font-weight: 700;

    color: #f8fafc;

}

.export-btn-sub {

    font-size: 0.72rem;

    color: #94a3b8;

}

/* ==========================================================================

   AI STORY DIRECTOR MODAL

   ========================================================================== */

.comic-story-modal {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

}

.comic-story-backdrop {

    position: absolute;

    inset: 0;

    background: rgba(4, 7, 14, 0.85);

    backdrop-filter: blur(12px);

}

.comic-story-box {

    position: relative;

    max-width: 820px;

    width: 100%;

    background: #0d121f;

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 18px;

    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 242, 254, 0.15);

    display: flex;

    flex-direction: column;

    overflow: hidden;

}

.comic-story-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 18px 24px;

    border-bottom: 1px solid rgba(56, 189, 248, 0.18);

    background: rgba(15, 23, 42, 0.6);

}

.comic-story-title {

    margin: 0;

    font-size: 1.15rem;

    font-weight: 800;

    color: #f8fafc;

    display: flex;

    align-items: center;

    gap: 10px;

}

.comic-story-sub {

    margin: 4px 0 0 0;

    font-size: 0.78rem;

    color: #94a3b8;

}

.comic-story-body {

    padding: 24px;

    display: flex;

    flex-direction: column;

    gap: 20px;

    max-height: 70vh;

    overflow-y: auto;

}

.story-section-label {

    font-size: 0.82rem;

    font-weight: 800;

    color: #94a3b8;

    text-transform: uppercase;

    letter-spacing: 0.05em;

    font-family: 'JetBrains Mono', monospace;

    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 8px;

}

.story-presets-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

    gap: 12px;

}

.story-preset-card {

    background: rgba(15, 23, 42, 0.7);

    border: 1px solid rgba(56, 189, 248, 0.2);

    border-radius: 10px;

    padding: 14px;

    cursor: pointer;

    transition: all 0.15s ease;

    display: flex;

    flex-direction: column;

    gap: 6px;

}

.story-preset-card:hover {

    background: rgba(14, 165, 233, 0.15);

    border-color: #00f2fe;

    transform: translateY(-2px);

    box-shadow: 0 4px 16px rgba(0, 242, 254, 0.2);

}

.story-preset-card.active {

    background: rgba(14, 165, 233, 0.22);

    border-color: #00f2fe;

    box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);

}

.story-preset-badge {

    align-self: flex-start;

    font-size: 0.65rem;

    font-weight: 800;

    font-family: 'JetBrains Mono', monospace;

    color: #00f2fe;

    background: rgba(0, 242, 254, 0.1);

    padding: 2px 6px;

    border-radius: 4px;

}

.story-preset-name {

    margin: 0;

    font-size: 0.9rem;

    font-weight: 700;

    color: #f1f5f9;

}

.story-preset-desc {

    margin: 0;

    font-size: 0.75rem;

    color: #94a3b8;

    line-height: 1.35;

}

.story-pitch-input {

    width: 100%;

    box-sizing: border-box;

    background: rgba(10, 16, 29, 0.85);

    border: 1px solid rgba(56, 189, 248, 0.25);

    border-radius: 8px;

    padding: 10px 14px;

    font-size: 0.85rem;

    color: #f1f5f9;

    font-family: inherit;

    transition: all 0.15s ease;

}

.story-pitch-input:focus {

    outline: none;

    border-color: #00f2fe;

    box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);

}

.story-scope-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}

.story-scope-pills {

    display: flex;

    gap: 8px;

}

.story-scope-pill {

    padding: 6px 14px;

    background: rgba(15, 23, 42, 0.8);

    border: 1px solid rgba(56, 189, 248, 0.25);

    border-radius: 6px;

    color: #94a3b8;

    font-size: 0.8rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.story-scope-pill.active {

    background: #0ea5e9;

    color: #ffffff;

    border-color: #38bdf8;

    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);

}

.comic-story-footer {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 12px;

    padding: 16px 24px;

    border-top: 1px solid rgba(56, 189, 248, 0.18);

    background: rgba(15, 23, 42, 0.6);

}

.btn-comic-story-director {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    background: rgba(14, 165, 233, 0.18);

    border: 1px solid rgba(56, 189, 248, 0.35);

    border-radius: 6px;

    color: #38bdf8;

    font-size: 0.8rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.15s ease;

}

.btn-comic-story-director:hover {

    background: rgba(14, 165, 233, 0.35);

    border-color: #00f2fe;

    color: #ffffff;

    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);

}

@media (max-width: 768px) {

    .sticker-modal-body {

        grid-template-columns: 1fr;

    }

    .story-presets-grid {

        grid-template-columns: 1fr;

    }

    .story-scope-row {

        flex-direction: column;

        align-items: flex-start;

    }

}

/* ==========================================================================

   BUTTON STYLING SYSTEM: SECONDARY & DANGER

   ========================================================================== */

.comic-btn-secondary {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 14px;

    background: rgba(14, 165, 233, 0.16);

    border: 1px solid rgba(56, 189, 248, 0.4);

    border-radius: 9px;

    color: #38bdf8;

    font-size: 0.82rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

    white-space: nowrap;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);

}

.comic-btn-secondary i {

    color: #00f2fe;

}

.comic-btn-secondary:hover:not(:disabled) {

    background: rgba(14, 165, 233, 0.32);

    border-color: #00f2fe;

    color: #ffffff;

    box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);

    transform: translateY(-1px);

}

.comic-btn-secondary:active {

    transform: translateY(0);

}

.comic-btn-danger {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 8px 13px;

    background: rgba(239, 68, 68, 0.12);

    border: 1px solid rgba(239, 68, 68, 0.35);

    border-radius: 9px;

    color: #f87171;

    font-size: 0.82rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

}

.comic-btn-danger:hover:not(:disabled) {

    background: rgba(239, 68, 68, 0.25);

    border-color: #ef4444;

    color: #ffffff;

    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);

    transform: translateY(-1px);

}

/* ==========================================================================

   MOBILE RESPONSIVENESS OVERHAUL (ZERO HORIZONTAL OVERFLOW)

   ========================================================================== */

@media (max-width: 768px) {

    html, body {

        overflow-x: hidden !important;

        max-width: 100vw !important;

    }

    .comic-workspace {

        width: 100% !important;

        max-width: 100vw !important;

        overflow-x: hidden !important;

        box-sizing: border-box !important;

        padding: 10px 8px !important;

    }

    .comic-toolbar {

        flex-direction: column !important;

        align-items: stretch !important;

        width: 100% !important;

        max-width: 100% !important;

        box-sizing: border-box !important;

        overflow: hidden !important;

        padding: 12px 10px !important;

        gap: 12px !important;

    }

    .comic-toolbar-left,

    .comic-toolbar-center,

    .comic-toolbar-right {

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

        flex: 1 1 100% !important;

        box-sizing: border-box !important;

    }

    .comic-toolbar-center {

        flex-direction: column !important;

        align-items: stretch !important;

        gap: 8px !important;

    }

    .comic-config-group {

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

        box-sizing: border-box !important;

        display: flex !important;

        align-items: center !important;

        gap: 6px !important;

        padding: 6px 8px !important;

        overflow: hidden !important;

    }

    .comic-config-label {

        flex-shrink: 0 !important;

        font-size: 0.72rem !important;

    }

    .comic-format-pills,

    .comic-layout-pills {

        flex: 1 1 auto !important;

        width: 0 !important; /* Critical for flexing inside scrollable area */

        min-width: 0 !important;

        max-width: 100% !important;

        display: flex !important;

        overflow-x: auto !important;

        overflow-y: hidden !important;

        white-space: nowrap !important;

        -webkit-overflow-scrolling: touch !important;

        scrollbar-width: none !important; /* Completely hide clunky scrollbar */

        -ms-overflow-style: none !important;

        scroll-behavior: smooth !important;

        overscroll-behavior-x: contain !important;

        padding-right: 14px !important;

        -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%) !important;

        mask-image: linear-gradient(to right, #000 85%, transparent 100%) !important;

    }

    .comic-format-pills::-webkit-scrollbar,

    .comic-layout-pills::-webkit-scrollbar {

        display: none !important;

        width: 0 !important;

        height: 0 !important;

    }

    .comic-format-pill,

    .comic-layout-pill {

        flex: 0 0 auto !important;

        padding: 4px 8px !important;

        font-size: 0.72rem !important;

    }

    .comic-meta-row {

        flex-direction: column !important;

        align-items: stretch !important;

        width: 100% !important;

        gap: 6px !important;

    }

    .comic-meta-field {

        width: 100% !important;

        flex: 1 1 100% !important;

        box-sizing: border-box !important;

    }

    .comic-meta-input {

        width: 100% !important;

        box-sizing: border-box !important;

    }

    .comic-anchor-row {

        flex-direction: column !important;

        align-items: stretch !important;

        width: 100% !important;

    }

    .comic-anchor-input {

        width: 100% !important;

        box-sizing: border-box !important;

    }

    .comic-toolbar-right {

        display: flex !important;

        flex-wrap: wrap !important;

        gap: 8px !important;

        align-items: center !important;

        justify-content: stretch !important;

    }

    .comic-cost-badge {

        width: 100% !important;

        justify-content: center !important;

        box-sizing: border-box !important;

    }

    .comic-btn-secondary,

    .comic-btn-primary {

        flex: 1 1 calc(50% - 4px) !important;

        justify-content: center !important;

        box-sizing: border-box !important;

    }

    .comic-export-split-group {

        width: 100% !important;

        display: flex !important;

        flex-wrap: wrap !important;

        gap: 6px !important;

    }

    .comic-export-split-group button {

        flex: 1 1 100px !important;

        justify-content: center !important;

    }

    .comic-btn-danger {

        flex: 0 0 auto !important;

    }

    .comic-pages-bar {

        flex-direction: column !important;

        align-items: stretch !important;

        gap: 8px !important;

        width: 100% !important;

        box-sizing: border-box !important;

        overflow: hidden !important;

    }

    .comic-pages-scroll {

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

        overflow-x: auto !important;

        -webkit-overflow-scrolling: touch !important;

        scrollbar-width: none !important;

        -ms-overflow-style: none !important;

    }

    .comic-pages-scroll::-webkit-scrollbar {

        display: none !important;

        width: 0 !important;

        height: 0 !important;

    }

    .comic-pages-actions {

        width: 100% !important;

        justify-content: space-between !important;

        flex-wrap: wrap !important;

        gap: 6px !important;

    }

    .comic-deck-grid {

        grid-template-columns: 1fr !important;

        width: 100% !important;

        box-sizing: border-box !important;

    }

    .comic-panel-card {

        width: 100% !important;

        box-sizing: border-box !important;

        min-width: 0 !important;

    }

}

/* ==========================================================================
   COMIC STUDIO PRESENTATION & COMPOSITION BAR V3.5
   ========================================================================== */
.comic-options-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 18px;
    background: rgba(10, 16, 28, 0.95);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.comic-options-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comic-options-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comic-checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.comic-checkbox-pill:hover {
    border-color: rgba(0, 242, 254, 0.6);
    background: rgba(15, 23, 42, 1);
    color: #ffffff;
}

.comic-checkbox-pill input[type="checkbox"] {
    accent-color: #00f2fe;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

.comic-checkbox-pill input[type="checkbox"]:checked + span {
    color: #00f2fe;
}

.comic-options-divider {
    width: 1px;
    height: 22px;
    background: rgba(56, 189, 248, 0.2);
}

.panel-fit-mode-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 5px;
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    outline: none;
    cursor: pointer;
}

/* ==========================================================================
   COMIC STUDIO RESPONSIVE MOBILE OPTIONS & ADAPTIVE VIEWPORTS
   ========================================================================== */
@media (max-width: 768px) {
    .comic-workspace {
        padding: 12px 14px 60px 14px !important;
        gap: 14px !important;
    }
    .comic-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }
    .comic-toolbar-left,
    .comic-toolbar-center,
    .comic-toolbar-right {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    .comic-toolbar-right {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .comic-export-split-group {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 6px !important;
    }
    .comic-export-split-group button {
        flex: 1 1 calc(50% - 6px) !important;
        justify-content: center !important;
    }
    .comic-export-split-group .comic-btn-export {
        flex: 1 1 100% !important;
    }
    .comic-main-split {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .comic-deck-grid {
        grid-template-columns: 1fr !important;
    }
    .comic-options-bar {
        padding: 8px 10px !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }
    .comic-options-divider {
        display: none !important;
    }
    .comic-options-group {
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    .comic-checkbox-pill {
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
    }
    .panel-fit-mode-select {
        font-size: 0.72rem !important;
        padding: 3px 6px !important;
    }
    .comic-pages-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .comic-pages-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 480px) {
    .comic-workspace {
        padding: 8px 8px 60px 8px !important;
        gap: 10px !important;
    }
    .comic-toolbar {
        padding: 10px !important;
        gap: 10px !important;
        border-radius: 10px !important;
    }
    .comic-brand-title {
        font-size: 0.95rem !important;
    }
    .comic-anchor-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }
    .comic-meta-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    .comic-meta-field {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    .comic-meta-input,
    .comic-anchor-input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .comic-panel-card {
        padding: 10px !important;
        border-radius: 10px !important;
    }
    .comic-panel-card-header {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .comic-options-bar {
        padding: 6px 8px !important;
    }
    .comic-checkbox-pill span {
        font-size: 0.68rem !important;
    }
    .comic-btn-primary,
    .comic-btn-secondary,
    .comic-btn-export {
        width: 100% !important;
        justify-content: center !important;
    }
    .comic-page-canvas-container {
        padding: 6px !important;
    }
    .comic-story-modal {
        padding: 10px 10px calc(76px + env(safe-area-inset-bottom, 0px)) 10px !important;
        align-items: flex-start !important;
    }
    .comic-story-box {
        max-height: calc(100dvh - 96px - env(safe-area-inset-bottom, 0px)) !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .comic-story-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        min-height: 0 !important;
    }
    .comic-story-footer {
        flex-shrink: 0 !important;
    }
}

/* OC Consistency Locker Integration inside Comic Studio */
.comic-oc-anchor-select {
    flex: 0 1 215px;
    max-width: 240px;
    min-width: 155px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.42);
    background: rgba(12, 22, 42, 0.88);
    color: #e0f2fe;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comic-oc-anchor-select:hover,
.comic-oc-anchor-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.comic-chip-oc {
    border-color: rgba(56, 189, 248, 0.5) !important;
    background: rgba(14, 116, 144, 0.28) !important;
    color: #bae6fd !important;
}

.comic-chip-oc:hover {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.24) !important;
    color: #ffffff !important;
}

.comic-btn-publish {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.55);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.24));
    color: #d1fae5;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.comic-btn-publish:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #34d399;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
    color: #ffffff;
}

.comic-btn-publish:disabled {
    opacity: 0.6;
    cursor: wait;
}
