* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Dark theme overrides (activated by setting `data-theme="dark"` on <html>) */
[data-theme="dark"] body {
    background: #0b0f16;
    color: #e6eef8;
}

[data-theme="dark"] header {
    /* keep header background unchanged so the nav color remains the same */
    color: #e6eef8;
}

[data-theme="dark"] .search-panel,
[data-theme="dark"] .results-panel,
[data-theme="dark"] .drafts-panel,
[data-theme="dark"] .reader-panel,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .post-item,
[data-theme="dark"] .inline-editor {
    background: #0f1720;
    color: #e6eef8;
    border-color: #213046;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .bbcode-textarea,
[data-theme="dark"] textarea {
    background: #0b1116;
    color: #e6eef8;
    border: 1px solid #213046;
}

[data-theme="dark"] .bbcode-toolbar,
[data-theme="dark"] .formatting-toolbar,
[data-theme="dark"] .legal-templates {
    background: #071827;
    border-color: #213046;
    color: #d9eefc;
}

[data-theme="dark"] .bbcode-preview {
    background: #071017;
    color: #e6eef8;
}

/* Drafts panel dark-mode overrides */
[data-theme="dark"] .drafts-panel,
[data-theme="dark"] .drafts-panel.left-mode,
[data-theme="dark"] .drafts-panel.active {
    background: #0f1720;
    color: #e6eef8;
    border-color: #213046;
    box-shadow: none;
}

[data-theme="dark"] .drafts-panel .panel-header {
    background: transparent;
    border-bottom-color: #213046;
}

[data-theme="dark"] .drafts-panel .panel-header h3 {
    color: #e6eef8;
}

[data-theme="dark"] .drafts-panel .btn-close {
    color: #dbefff;
}

[data-theme="dark"] .drafts-panel .panel-body {
    background: transparent;
    color: #e6eef8;
}

[data-theme="dark"] .drafts-panel .draft-item {
    background: #071017;
    border: 1px solid #213046;
    color: #e6eef8;
}

[data-theme="dark"] .drafts-panel .draft-header h4 {
    color: #dbefff;
}

[data-theme="dark"] .drafts-panel .draft-date {
    color: #9fb6d6;
}

[data-theme="dark"] .drafts-panel .draft-case {
    color: #cfe6ff;
}

[data-theme="dark"] .drafts-panel .draft-case a {
    color: #9ecbff;
}

[data-theme="dark"] .drafts-panel .draft-actions .btn-small {
    background: transparent;
    color: #e6eef8;
    border-color: #2a435a;
}

[data-theme="dark"] .drafts-panel .draft-actions .btn-small:hover {
    background: rgba(255,255,255,0.03);
    border-color: #153778;
}


/* Make the editor and preview panes adapt to the theme */
[data-theme="dark"] .editor-pane,
[data-theme="dark"] .preview-pane {
    background: #0f1720;
    color: #e6eef8;
    border-color: #213046;
}

[data-theme="dark"] .editor-pane h4,
[data-theme="dark"] .preview-pane h4 {
    color: #dbefff;
}

/* Ensure the BBCode editor textarea uses readable text color in dark mode */
[data-theme="dark"] .bbcode-textarea {
    background: #071017;
    color: #e6eef8;
    border-color: #213046;
}

/* Keep .bbcode-order text black in dark mode for readability as requested */
[data-theme="dark"] .bbcode-order {
    color: #000 !important;
    background: #ffecec; /* light background so black text remains readable */
    border-left-color: #e53935;
}

/* Dark-mode styles for split containers (inline and modal) */
[data-theme="dark"] .editor-split-inline,
[data-theme="dark"] .editor-panel-header,
[data-theme="dark"] .editor-split {
    background: #0f1720;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .btn,
[data-theme="dark"] .btn-small,
[data-theme="dark"] .btn-nav {
    border-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .btn-primary {
    background: #1b6fd6;
    color: white;
}

[data-theme="dark"] .badge {
    background: #213046;
    color: #cfe6ff;
}

[data-theme="dark"] a { color: #9ecbff; }


.container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #153778;
    color: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Auth controls in header (right-aligned) */
.auth-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-controls .auth-username {
    color: white;
    font-size: 0.95rem;
}

.header-logo {
    height: 120px;
    width: auto;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.btn-nav {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Refresh dropdown styles */
.refresh-dropdown {
    position: relative;
    display: flex;
    gap: 0;
}

.btn-dropdown {
    padding: 0.5rem 0.6rem;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.refresh-dropdown .btn-nav:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    color: #333;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f0f0f0;
}

.dropdown-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.stats-bar {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Search Panel */
.search-panel {
    width: 320px;
    background: white;
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    transition: width 0.3s ease, padding 0.3s ease;
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.search-panel-header h2 {
    font-size: 1.3rem;
    margin: 0;
    color: #153778;
}

.btn-collapse-search {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-collapse-search:hover {
    background: #153778;
    color: white;
    border-color: #153778;
}

/* Collapsed search panel */
.search-panel.collapsed {
    width: 48px;
    padding: 0.75rem;
    overflow: hidden;
}

.search-panel.collapsed .search-panel-header {
    flex-direction: column;
    margin-bottom: 0;
}

.search-panel.collapsed .search-panel-header h2 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.search-panel.collapsed #searchForm {
    display: none;
}

.search-panel.collapsed .btn-collapse-search {
    margin-bottom: 0.5rem;
}

/* Dark mode for collapsed search panel */
[data-theme="dark"] .btn-collapse-search {
    background: #0f1720;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .btn-collapse-search:hover {
    background: #1b6fd6;
    border-color: #1b6fd6;
}

.search-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #153778;
}

.form-group {
    margin-bottom: 0.6rem; /* compact spacing for editor form fields */
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #555;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.45rem 0.5rem; /* reduced input padding */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.92rem;
    transition: border-color 0.3s;
    background: #f3f4f6; /* use a light gray for inputs instead of pure white */
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #153778;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #2e6ee6;
    color: black;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-primary:hover {
    background: #e8e9eb;
}

.btn-secondary {
    background: #6c757d;
    color: black;
    width: 100%;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545 !important;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-tertiary {
    background: #6c757d;
    color: white;
}

.btn-tertiary:hover {
    background: #545b62;
}

/* Docket remove button styling */
.docket-remove-btn {
    background: #e74c3c;
    border: none;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.docket-remove-btn:hover {
    background: #c0392b;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.4);
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Panel */
.results-panel {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #fafafa;
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.welcome-message h2 {
    color: #153778;
    margin-bottom: 1rem;
}

/* Featured Cases */
.featured-cases {
    margin-top: 3rem;
    text-align: left;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.featured-cases h3 {
    font-size: 1.5rem;
    color: #153778;
    margin-bottom: 1.5rem;
    text-align: center;
}

.featured-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.featured-case-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-top: 4px solid #4caf50;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    min-height: 260px;
}

.featured-case-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.card-badge {
    display: flex;
    justify-content: flex-end;
}

.card-court {
    font-size: 1.15rem;
    color: #1976d2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.25rem;
}

.card-title {
    font-size: 1.1rem;
    color: #153778;
    margin: 0;
    flex: 1;
    line-height: 1.4;
    font-weight: 600;
}

.card-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.card-date {
    font-size: 0.9rem;
    color: #666;
}

.search-results {
    max-width: 900px;
    margin: 0 auto;
}

.result-item {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.8rem;
}

.case-info h3 {
    font-size: 1.2rem;
    color: #153778;
    margin-bottom: 0.3rem;
}

.case-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-court {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-first-post {
    background: #fff3e0;
    color: #f57c00;
}

.badge-in-progress {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-presiding-officer {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.badge-summons {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.badge-verdict {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.badge-order {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.post-info {
    margin: 1rem 0;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}

.post-author {
    font-weight: 600;
    color: #153778;
}

.post-date {
    color: #666;
    font-size: 0.85rem;
}

.post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* Reader Panel */
.reader-panel {
    width: 0;
    background: white;
    overflow: hidden;
    transition: width 0.2s ease, left 0.2s ease, right 0.2s ease;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    position: relative;
}

.reader-panel.active {
    width: 600px;
}

/* Resizer between results and reader */
.reader-resizer {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s;
}
.reader-resizer:hover {
    background: rgba(0,0,0,0.04);
}

/* When the reader is opened as an overlay covering the left side */
.reader-panel.overlay-left {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: auto;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    z-index: 1200;
    border-left: none;
    border-right: 1px solid #ddd;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

/* Drafts side panel */
.drafts-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 420px;
    background: white;
    box-shadow: -6px 0 24px rgba(0,0,0,0.12);
    z-index: 1150;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
}

.drafts-panel.active {
    transform: translateX(0);
}

.drafts-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap; /* allow header items to wrap on narrow screens */
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.drafts-panel .panel-header h3 {
    margin: 0;
    flex: 1 1 auto; /* allow title to take remaining space and shrink when needed */
    min-width: 0; /* allow flex children to shrink properly */
    font-size: 1.05rem;
}

.drafts-panel .panel-header .btn-close {
    flex: 0 0 auto; /* keep close button sized to content */
    align-self: center;
}

.drafts-panel .panel-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

/* Make sure the close button inside the panel matches header style */
.drafts-panel .btn-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

@media (max-width: 900px) {
    .drafts-panel { width: 100%; }
}

/* Tighter header layout for very small screens */
@media (max-width: 480px) {
    .drafts-panel .panel-header {
        padding: 0.6rem 0.75rem;
    }
    .drafts-panel .panel-header h3 {
        font-size: 1rem;
        width: 100%;
    }
    .drafts-panel .panel-header .btn-close {
        margin-left: auto;
    }
}

/* Left-mode: when drafts replace the Advanced Search panel */
.drafts-panel.left-mode {
    position: relative;
    transform: none;
    right: auto;
    left: auto;
    height: auto;
    width: 320px; /* match search panel width */
    box-shadow: none;
    border-right: 1px solid #ddd;
}

.drafts-panel.left-mode .panel-body {
    padding: 1.5rem;
}

.reader-panel.overlay-left .document-content {
    padding: 2rem;
}

/* Hide resizer when overlay is active */
.reader-panel.overlay-left + .reader-resizer,
.reader-panel.overlay-left ~ .reader-resizer {
    display: none;
}

/* Reader header controls */
.reader-header .reader-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.reader-header .reader-controls .btn-small {
    padding: 0.35rem 0.6rem;
}

/* While resizing, prevent selection */
body.resizing {
    user-select: none;
}

/* My Docket side panel - mirrors drafts-panel */
.docket-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 420px;
    background: white;
    box-shadow: -6px 0 24px rgba(0,0,0,0.12);
    z-index: 1150;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
}

.docket-panel.active {
    transform: translateX(0);
}

.docket-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.docket-panel .panel-header h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.05rem;
}

.docket-panel .panel-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.docket-panel .btn-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

/* Docket item cards */
.docket-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.docket-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #153778;
}

.docket-item.expandable {
    cursor: pointer;
}

.docket-item.expanded {
    border-color: #153778;
}

.docket-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.docket-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.docket-warning {
    color: #ff9800;
    font-size: 1rem;
    animation: pulse-warning 1.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.docket-expand-icon {
    font-size: 0.7rem;
    color: #888;
    margin-left: 0.3rem;
    transition: transform 0.2s;
}

.docket-item-expandable {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e0e0e0;
}

.docket-case-number {
    font-weight: 600;
    color: #153778;
    font-size: 0.95rem;
}

.docket-case-title {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.docket-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #888;
}

.docket-item-date {
    font-style: italic;
}

.docket-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.docket-item-actions .btn-small {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
}

.docket-item-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.4rem;
}

/* Docket reminders section */
.docket-reminders {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #fff8e1;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.docket-reminders h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #856404;
}

.docket-reminders ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.75rem;
    color: #856404;
}

.docket-reminders li {
    margin-bottom: 0.15rem;
}

/* Docket note preview */
.docket-note-preview {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}

.docket-note-preview h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1565c0;
}

.docket-note-preview p {
    margin: 0;
    font-size: 0.75rem;
    color: #1565c0;
    font-style: italic;
}

.docket-empty {
    text-align: center;
    color: #888;
    padding: 2rem 1rem;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .docket-panel { width: 100%; }
}

/* Dark mode for docket panel */
[data-theme="dark"] .docket-panel {
    background: #0a1929;
    box-shadow: -6px 0 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .docket-panel .panel-header {
    background: #071827;
    border-bottom-color: #213046;
}

[data-theme="dark"] .docket-panel .panel-header h3 {
    color: #fff;
}

[data-theme="dark"] .docket-panel .btn-close {
    color: #aaa;
}

[data-theme="dark"] .docket-panel .btn-close:hover {
    color: #fff;
}

[data-theme="dark"] .docket-panel .panel-body {
    background: #0a1929;
}

[data-theme="dark"] .docket-item {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .docket-item:hover {
    border-color: #3399ff;
    box-shadow: 0 2px 8px rgba(51,153,255,0.15);
}

[data-theme="dark"] .docket-case-number {
    color: #66b2ff;
}

[data-theme="dark"] .docket-case-title {
    color: #e0e0e0;
}

[data-theme="dark"] .docket-item-meta {
    color: #8899a6;
}

[data-theme="dark"] .docket-item-stats {
    color: #8899a6;
}

[data-theme="dark"] .docket-expand-icon {
    color: #8899a6;
}

[data-theme="dark"] .docket-item-expandable {
    border-top-color: #213046;
}

[data-theme="dark"] .docket-empty {
    color: #8899a6;
}

[data-theme="dark"] .docket-reminders {
    background: #3d3200;
    border-left-color: #ffc107;
}

[data-theme="dark"] .docket-reminders h6,
[data-theme="dark"] .docket-reminders ul {
    color: #ffd54f;
}

[data-theme="dark"] .docket-note-preview {
    background: #0d3c61;
    border-left-color: #64b5f6;
}

[data-theme="dark"] .docket-note-preview h6,
[data-theme="dark"] .docket-note-preview p {
    color: #90caf9;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.reader-header h2 {
    font-size: 1.3rem;
    color: #153778;
}

/* Reader header adapts to theme */
[data-theme="dark"] .reader-header {
    background: #071827; /* darker panel color */
    border-bottom-color: #213046;
}

[data-theme="dark"] .reader-header h2,
[data-theme="dark"] .reader-header .reader-controls,
[data-theme="dark"] .reader-header .reader-controls * {
    color: #ffffff !important; /* make text in header white for readability */
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.btn-close:hover {
    color: #333;
}

.document-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}
[data-theme="dark"] .case-header h2{
    background: #0f1720;
    color: #ffffff;
}

[data-theme="dark"] .post-body {
    background: #cfe6ff;
}

[data-theme="dark"] .case-details * {
    background: #0f1720;
    color: #cfe6ff;
}


.case-header {
    border-bottom: 2px solid #153778;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.case-header h2 {
    font-size: 1.5rem;
    color: #153778;
    margin-bottom: 0.5rem;
}

.case-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #666;
}

.case-details strong {
    color: #333;
}

.presiding-officers-list {
    display: inline;
    padding: 0;
}

.officer-item {
    display: inline;
    margin: 0;
    padding: 0;
}

.officer-item strong {
    font-weight: normal;
    color: inherit;
}

.case-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    align-items: stretch;
}

.case-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.case-actions-grid .btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.case-actions-docket {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    writing-mode: horizontal-tb;
}

.post-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: white;
}

/* Collapsible post content */
.post-item .post-collapse-content {
    transition: max-height 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
}

.post-item.collapsed .post-collapse-content {
    max-height: 0;
    opacity: 0;
}

.post-item .post-collapse-content > * {
    /* Allow content to size naturally when expanded */
    opacity: 1;
}

.post-item.collapsed .post-collapse-content > * {
    opacity: 0;
}

.collapse-toggle {
    min-width: 34px;
    padding: 0.25rem 0.5rem;
    font-weight: 700;
    border-radius: 4px;
}

.post-item.first-post {
    border-left: 4px solid #f57c00;
    background: #fffbf5;
}

.post-item.presiding-officer-post {
    /* No special styling for presiding officer posts */
}

.post-item.first-post.presiding-officer-post {
    /* Inherits first-post styling only */
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #153778;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.post-author-details {
    display: flex;
    flex-direction: column;
}

.post-username {
    font-weight: 600;
    color: #153778;
}

.post-timestamp {
    font-size: 0.85rem;
    color: #999;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #153778;
}

.post-body {
    line-height: 1.8;
    color: #333;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body blockquote {
    border-left: 3px solid #153778;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.post-reactions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    color: #153778;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 0 0 auto;
}

#notesList {
    margin-bottom: 1.5rem;
}

.note-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
    border-left: 3px solid #153778;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.note-date {
    font-size: 0.85rem;
    color: #666;
}

.note-actions {
    display: flex;
    gap: 0.5rem;
}

.note-actions button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.note-text {
    color: #333;
    line-height: 1.6;
}

.note-form {
    border-top: 2px solid #e0e0e0;
    padding-top: 1rem;
}

.note-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.8rem;
}

.note-form textarea:focus {
    outline: none;
    border-color: #153778;
}

.note-form textarea:focus {
    outline: none;
    border-color: #153778;
}

/* Reminders */
.reminder-filters {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.reminder-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.reminder-item.upcoming {
    border-left: 4px solid #4caf50;
}

.reminder-item.overdue {
    border-left: 4px solid #f44336;
    background: #fff5f5;
}

.reminder-item.completed {
    opacity: 0.6;
    border-left: 4px solid #9e9e9e;
}

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.reminder-date {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.reminder-body {
    margin: 0.5rem 0;
}

.reminder-preview {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.reminder-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

/* BBCode Editor */
.inline-editor {
    background: white;
    padding: 1rem; /* reduced padding to reclaim vertical space */
    border-radius: 8px;
    max-width: 100%;
    height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem; /* tightened spacing */
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #153778; /* thinner divider */
}

.editor-header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.editor-header h2 {
    color: #153778;
    margin: 0;
    font-size: 1rem; /* slightly smaller title */
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* reduced vertical gaps between fields */
    flex: 1;
    overflow: hidden;
}

.editor-split-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem; /* reduced gap */
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.6rem; /* reduced padding */
    background: white;
    margin-top: 0; /* ensure it sits flush under the toolbar */
    flex: 1;
    overflow: hidden;
}

/* Smooth transitions for split panels to make theme toggles less jarring */
.editor-split-inline,
.editor-split,
.editor-pane,
.preview-pane {
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

.bbcode-editor-container {
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.35rem; /* tighter toolbar */
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

/* Compact editor layout helpers */
.editor-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    align-items: start;
}
.editor-top-row .form-group { margin-bottom: 0; }
.editor-field-label { margin-bottom: 0.2rem; font-size: 0.85rem; }

.editor-toolbar-row {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
}
.editor-toolbar-row .formatting-toolbar { flex: 1; display: flex; align-items: center; }
.editor-toolbar-row .legal-templates { margin-left: 0.5rem; white-space: nowrap; display: flex; align-items: center; gap: 0.5rem; }

/* Tighten space between toolbar row and editor split */
.bbcode-editor-container { margin: 0.5rem 0; display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.bbcode-toolbar button {
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: monospace;
    transition: all 0.2s;
}

.bbcode-toolbar button:hover {
    background: #153778;
    color: white;
    border-color: #153778;
}

.formatting-toolbar {
    background: #f0f4ff;
    /* remove bottom border and margin so it lines up with the templates area */
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.formatting-toolbar .format-btn {
    padding: 0.3rem 0.6rem;
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.formatting-toolbar .format-btn:hover {
    background: #153778;
    color: white;
    border-color: #153778;
}

.formatting-toolbar .format-btn strong,
.formatting-toolbar .format-btn em,
.formatting-toolbar .format-btn u,
.formatting-toolbar .format-btn s {
    font-size: 0.85rem;
}

.legal-templates {
    background: #fff8e1;
}

.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    padding: 1rem;
    background: white;
}

.editor-pane h4,
.preview-pane h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #666;
    flex-shrink: 0;
}

.editor-pane,
.preview-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bbcode-textarea {
    width: 100%;
    min-height: 100px;
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    resize: none;
    overflow-y: auto;
}

.bbcode-textarea:focus {
    outline: none;
    border-color: #153778;
}

/* Expanded editor that fills the bbcode-editor-container ("expand into the void") */
.bbcode-editor-container {
    position: relative; /* allow absolute expansion inside */
}

.bbcode-editor-container.expanded-void {
    z-index: 1000; /* ensure it's above surrounding content */
}

.bbcode-editor-container.expanded-void .editor-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: var(--editor-bg, #fff);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.bbcode-editor-container.expanded-void .bbcode-textarea {
    width: 100%;
    height: calc(100% - 5.5rem);
    min-height: 0;
    border-radius: 0.25rem;
    flex: none;
}

.bbcode-editor-container.expanded-void .editor-toolbar-row,
.bbcode-editor-container.expanded-void .editor-top-row {
    z-index: 2001;
}

.bbcode-preview {
    min-height: 100px;
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    overflow-y: auto;
    line-height: 1.6;
}

.bbcode-preview blockquote {
    border-left: 3px solid #153778;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.bbcode-preview pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.bbcode-preview code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem; /* tightened spacing above actions */
}

/* Drafts */
.draft-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.draft-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.draft-header h4 {
    margin: 0;
    color: #153778;
}

.draft-date {
    font-size: 0.85rem;
    color: #666;
}

.draft-case {
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
}

.draft-actions {
    /* Use a 2-column grid so draft action buttons appear 2x2 instead
       of a single row of four. Grid keeps buttons equal-width while
       allowing wrapping into two rows. */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Make the drafts list area explicitly scrollable inside the drafts panel */
.drafts-panel .panel-body #draftsList {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-height: calc(100vh - 350px); /* leave room for header and padding */
    overflow-y: auto;
    padding-right: 0.25rem; /* space for scrollbar */
}

/* Ensure each draft item doesn't force the list to overflow horizontally */
.drafts-panel .panel-body #draftsList .draft-item {
    min-width: 0;
}

/* Make action buttons equal width */
.draft-actions .btn-small {
    /* Full-width buttons inside the grid cells */
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    text-align: center;
}

/* Slightly tighten spacing inside each draft to keep list compact */
.draft-item {
    padding: 0.8rem;
}

.form-control {
    width: 100%;
    padding: 0.45rem 0.5rem; /* reduced padding for compact inputs */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #f3f4f6; /* light gray inputs */
}

.form-control:focus {
    outline: none;
    border-color: #153778;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #153778;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 1200px) {
    .reader-panel.active {
        width: 500px;
    }
    
    .editor-split {
        grid-template-columns: 1fr;
    }
    
    .featured-cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* BBCode Styling */
.bbcode-motion,
.bbcode-order,
.bbcode-case,
.bbcode-summons,
.bbcode-verdict,
.bbcode-objection,
.bbcode-answer {
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8f9fa;
}

.bbcode-motion {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.bbcode-order {
    border-left-color: #f44336;
    background: #ffebee;
}

.bbcode-case {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.bbcode-summons {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.bbcode-verdict {
    border-left-color: #9c27b0;
    background: #f3e5f5;
}

.bbcode-objection {
    border-left-color: #ff5722;
    background: #fbe9e7;
}

.bbcode-answer {
    border-left-color: #00bcd4;
    background: #e0f7fa;
}

/* Legal Templates Toolbar */
.legal-templates {
    background: #e8f5e9;
    border-top: 1px solid #ddd;
    border-radius: 0;
}

.legal-templates button {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.legal-templates button:hover {
    background: #388e3c;
    border-color: #388e3c;
}

.bbcode-quote {
    border-left: 4px solid #153778;
    padding: 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 4px;
}

.quote-header {
    font-weight: 600;
    color: #153778;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.quote-body {
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

.bbcode-mention {
    color: #153778;
    font-weight: 600;
    background: #e3f2fd;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.bbcode-link {
    color: #2196f3;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.bbcode-link:hover {
    border-bottom-color: #2196f3;
}

.bbcode-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.bbcode-code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.bbcode-code code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
}

.bbcode-list {
    margin: 1rem 0;
    padding-left: 2rem;
}

.bbcode-list li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.bbcode-heading {
    margin: 1.5rem 0 1rem 0;
    font-weight: bold;
    color: #1a1a1a;
    line-height: 1.3;
}

.bbcode-heading.h1,
h1.bbcode-heading {
    font-size: 1.8rem;
}

.bbcode-heading.h2,
h2.bbcode-heading {
    font-size: 1.5rem;
}

.bbcode-heading.h3,
h3.bbcode-heading {
    font-size: 1.3rem;
}

.bbcode-heading.h4,
h4.bbcode-heading {
    font-size: 1.1rem;
}

/* Spoiler BBCode styles */
.bbcode-spoiler {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 1rem 0;
    background: #f8f9fa;
}

.bbcode-spoiler summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: #e9ecef;
    font-weight: 600;
    color: #495057;
    border-radius: 4px 4px 0 0;
    user-select: none;
}

.bbcode-spoiler summary:hover {
    background: #dee2e6;
}

.bbcode-spoiler[open] summary {
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.bbcode-spoiler .spoiler-content {
    padding: 1rem;
}

/* Inline spoiler */
.bbcode-ispoiler {
    background: #333;
    color: #333;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.bbcode-ispoiler:hover {
    background: #555;
}

.bbcode-ispoiler.revealed {
    background: transparent;
    color: inherit;
}

/* Inline code */
.bbcode-icode {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.bbcode-icode-rich {
    background: #f0f4ff;
}

/* Command display */
.bbcode-cmd {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    background: #1a1a1a;
    color: #00ff00;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.bbcode-cmd .cmd-prompt {
    color: #888;
}

/* File/path display */
.bbcode-file {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    background: #fff3e0;
    color: #e65100;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #ffe0b2;
}

/* Highlight */
.bbcode-highlight {
    background: #ffff00;
    padding: 0.1rem 0.2rem;
}

/* Email links */
.bbcode-email {
    color: #1976d2;
    text-decoration: none;
}

.bbcode-email:hover {
    text-decoration: underline;
}

/* Media embeds */
.bbcode-media {
    margin: 1rem 0;
    text-align: center;
}

.bbcode-media iframe {
    max-width: 100%;
    border-radius: 4px;
}

/* Tables */
.bbcode-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.bbcode-table th,
.bbcode-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.bbcode-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.bbcode-table tr:nth-child(even) {
    background: #fafafa;
}

.bbcode-table tr:hover {
    background: #f0f4ff;
}

/* Indent */
.bbcode-indent {
    margin: 0.5rem 0;
}

/* Anchor */
.bbcode-anchor {
    /* Invisible anchor point */
}

/* Attachment placeholder */
.bbcode-attach {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px dashed #1976d2;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* Horizontal rule */
.bbcode-hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 1.5rem 0;
}

/* Dark mode adjustments for new BBCode elements */
[data-theme="dark"] .bbcode-spoiler {
    background: #1a2332;
    border-color: #213046;
}

[data-theme="dark"] .bbcode-spoiler summary {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .bbcode-spoiler summary:hover {
    background: #162030;
}

[data-theme="dark"] .bbcode-ispoiler {
    background: #0a0a0a;
    color: #0a0a0a;
}

[data-theme="dark"] .bbcode-ispoiler.revealed {
    background: transparent;
    color: inherit;
}

[data-theme="dark"] .bbcode-icode {
    background: #1a2332;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .bbcode-cmd {
    background: #0a0f16;
    color: #00ff00;
}

[data-theme="dark"] .bbcode-file {
    background: #2a1f0a;
    color: #ffb74d;
    border-color: #4a3510;
}

[data-theme="dark"] .bbcode-highlight {
    background: #665500;
    color: #fff;
}

[data-theme="dark"] .bbcode-table th {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .bbcode-table td {
    border-color: #213046;
}

[data-theme="dark"] .bbcode-table tr:nth-child(even) {
    background: #0a0f16;
}

[data-theme="dark"] .bbcode-table tr:hover {
    background: #162030;
}

[data-theme="dark"] .bbcode-attach {
    background: #0f2040;
    color: #9ecbff;
    border-color: #1976d2;
}

[data-theme="dark"] .bbcode-hr {
    border-top-color: #213046;
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    
    .search-panel {
        width: 100%;
        max-height: 300px;
    }
    
    .reader-panel.active {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }
    
    .modal-content,
    .modal-large {
        width: 95%;
        max-width: none;
    }
    
    .editor-split {
        grid-template-columns: 1fr;
    }
    
    .bbcode-toolbar {
        gap: 0.3rem;
    }
    
    .bbcode-toolbar button {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .featured-cases-grid {
        grid-template-columns: 1fr;
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #153778, #4CAF50);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Reminder Extraction Results */
.extraction-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.extraction-summary h4 {
    margin-bottom: 0.5rem;
    color: #153778;
}

.reminder-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reminder-item .reminder-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.reminder-priority {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.reminder-priority.high {
    background: #dc3545;
    color: white;
}

.reminder-priority.medium {
    background: #ffc107;
    color: #212529;
}

.reminder-priority.low {
    background: #6c757d;
    color: white;
}

.reminder-category {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #e9ecef;
    color: #495057;
}

.reminder-text {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
}

.reminder-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Extract Reminders Button */
.reader-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#extractRemindersBtn {
    background: #28a745;
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

#extractRemindersBtn:hover {
    background: #218838;
}

#extractRemindersBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ===== AUTO-SAVE STATUS INDICATOR ===== */
.auto-save-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 8px;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

.auto-save-status.saving {
    color: #856404;
    background: #fff3cd;
    animation: pulse 1s infinite;
}

.auto-save-status.saved {
    color: #155724;
    background: #d4edda;
}

.auto-save-status.unsaved {
    color: #856404;
    background: #fff3cd;
}

.auto-save-status.error {
    color: #721c24;
    background: #f8d7da;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

[data-theme="dark"] .auto-save-status.saving {
    background: #332701;
    color: #ffc107;
}

[data-theme="dark"] .auto-save-status.saved {
    background: #0d3020;
    color: #28a745;
}

[data-theme="dark"] .auto-save-status.unsaved {
    background: #332701;
    color: #ffc107;
}

[data-theme="dark"] .auto-save-status.error {
    background: #3d1015;
    color: #dc3545;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 400px;
    font-size: 0.9rem;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success {
    background: #28a745;
}

.toast.toast-error {
    background: #dc3545;
}

.toast.toast-info {
    background: #17a2b8;
}

.toast.toast-warning {
    background: #ffc107;
    color: #333;
}

/* ===== CASELAW SEARCH MODAL ===== */

#caselawSearchModal {
    background-color: transparent;
    pointer-events: none;
}

#caselawSearchModal .modal-content {
    pointer-events: all;
}

.caselaw-modal {
    position: fixed;
    max-width: 800px;
}

.caselaw-modal-header {
    cursor: move;
    user-select: none;
}

.caselaw-modal-header:hover {
    background: #f8f9fa;
}

.caselaw-search-controls {
    margin-bottom: 1.5rem;
}

.caselaw-filter-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.caselaw-filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #555;
    cursor: pointer;
}

.caselaw-filter-options input[type="checkbox"] {
    cursor: pointer;
}

.caselaw-results {
    max-height: 60vh;
    overflow-y: auto;
}

.caselaw-help-text {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.caselaw-results-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #153778;
}

.caselaw-results-header h4 {
    color: #153778;
    font-size: 1.1rem;
}

.caselaw-case-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.caselaw-case-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.caselaw-case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.caselaw-case-title {
    flex: 1;
}

.caselaw-case-title h4 {
    color: #153778;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.caselaw-citation {
    display: inline-block;
    background: #153778;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-insert-citation {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-insert-citation:hover {
    background: #218838;
}

.caselaw-precedents-count {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.caselaw-precedent-card {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    position: relative;
}

.caselaw-precedent-card.motion-precedent {
    border-left-color: #007bff;
    background: #e7f3ff;
}

.caselaw-precedent-card.verdict-precedent {
    border-left-color: #28a745;
    background: #e8f5e9;
}

.precedent-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.motion-badge {
    background: #007bff;
    color: white;
}

.verdict-badge {
    background: #28a745;
    color: white;
}

.precedent-content {
    font-size: 0.9rem;
}

.precedent-type {
    color: #153778;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.precedent-holding,
.precedent-rule,
.precedent-value {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.precedent-holding strong,
.precedent-rule strong,
.precedent-value strong {
    color: #495057;
}

.no-results,
.error-message {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error-message {
    color: #dc3545;
}

/* Ensure all BBCode-rendered elements use black text for readability per request */
.bbcode-preview [class*="bbcode-"] {
    color: #000 !important;
}

/* In dark mode, make BBCode blocks have a light background so black text remains readable */
[data-theme="dark"] .bbcode-preview [class*="bbcode-"] {
    color: #000 !important;
    background: #ffffff;
    border-color: #ddd;
}

/* Special case for inline links and mentions: keep black text but remove heavy backgrounds */
.bbcode-preview .bbcode-link,
.bbcode-preview .bbcode-mention {
    color: #000 !important;
    background: transparent !important;
    border: none !important;
}

/* Code blocks: light background and black text */
.bbcode-preview .bbcode-code,
.bbcode-preview pre,
.bbcode-preview code {
    background: #f5f5f5 !important;
    color: #000 !important;
}

/* ============ LAW-SPECIFIC STYLES ============ */

/* Law badge - Purple/Gold theme for legislative content */
.badge-law {
    background: linear-gradient(135deg, #6a0dad, #8b5cf6);
    color: #ffffff;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-law-category {
    background: #ffc107;
    color: #333;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-law-status {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Prefix badge - for Archive, Vetoed, Redundant, etc. */
.badge-prefix {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #ffffff;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Specific prefix colors for different statuses */
.badge-prefix[data-prefix="archive"],
.badge-prefix[data-prefix="archived"] {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.badge-prefix[data-prefix="vetoed"] {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.badge-prefix[data-prefix="redundant"] {
    background: linear-gradient(135deg, #fd7e14, #e55a00);
}

.badge-prefix[data-prefix="passed"] {
    background: linear-gradient(135deg, #28a745, #218838);
}

.badge-poll {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Law results section */
.law-results-section {
    margin-bottom: 2rem;
}

.law-results-section .law-header {
    background: linear-gradient(135deg, #6a0dad15, #8b5cf615);
    border-left: 4px solid #6a0dad;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.law-results-section .law-header h4 {
    color: #6a0dad;
    margin: 0;
}

/* Law result card */
.law-result-card {
    background: #ffffff;
    border: 1px solid #e0d4f0;
    border-left: 4px solid #6a0dad;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.law-result-card:hover {
    box-shadow: 0 2px 8px rgba(106, 13, 173, 0.15);
    border-left-color: #8b5cf6;
}

.law-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.law-result-title {
    flex: 1;
}

.law-result-title h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1rem;
    line-height: 1.3;
}

.law-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.law-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.law-forum {
    color: #6a0dad;
    font-weight: 500;
}

.law-date {
    color: #888;
}

.law-poll-info {
    color: #ff6b6b;
    font-style: italic;
}

/* Insert law button */
.btn-insert-law {
    background: linear-gradient(135deg, #6a0dad, #8b5cf6);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-insert-law:hover {
    background: linear-gradient(135deg, #5a0cad, #7c4ce6);
    transform: translateY(-1px);
}

/* Case results section separator */
.case-results-section {
    margin-top: 1.5rem;
}

/* Poll inline display */
.poll-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.poll-inline .poll-icon {
    font-size: 1rem;
}

.poll-inline .poll-votes {
    font-weight: 600;
    color: #e65100;
}

/* Dark mode overrides for laws */
[data-theme="dark"] .law-result-card {
    background: #1a1a2e;
    border-color: #4a3f6b;
    border-left-color: #8b5cf6;
}

[data-theme="dark"] .law-result-title h4 {
    color: #e6eef8;
}

[data-theme="dark"] .law-result-meta {
    color: #9fb6d6;
}

[data-theme="dark"] .law-forum {
    color: #b794f4;
}

[data-theme="dark"] .law-results-section .law-header {
    background: linear-gradient(135deg, #6a0dad25, #8b5cf625);
}

[data-theme="dark"] .badge-law-category {
    background: #ffc107;
    color: #333;
}

[data-theme="dark"] .badge-law-status {
    background: #4a5568;
    color: #e6eef8;
}

/* Poll Display Styles */
.poll-container {
    background: linear-gradient(135deg, #f8f4ff 0%, #f0e8ff 100%);
    border: 1px solid #d4c4f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
}

.poll-title {
    color: #6f42c1;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.poll-responses {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.poll-response {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e0d4f0;
}

.poll-response-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.poll-bar-container {
    background: #e9ecef;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.poll-bar {
    background: linear-gradient(90deg, #6f42c1 0%, #9b59b6 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.poll-votes {
    font-size: 0.85rem;
    color: #666;
}

.poll-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0d4f0;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.poll-closed {
    color: #dc3545;
    font-weight: 500;
}

/* Law Header Style */
.law-header {
    border-left-color: #6f42c1 !important;
}

/* Results Section Headers */
.results-section-header {
    margin: 1.5rem 0 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eeff 100%);
    border-left: 4px solid #3498db;
    border-radius: 4px;
    font-size: 1rem;
    color: #2c3e50;
}

.results-section-header.results-section-laws {
    background: linear-gradient(135deg, #f8f4ff 0%, #f0e8ff 100%);
    border-left-color: #6f42c1;
}

/* Dark mode poll styles */
[data-theme="dark"] .poll-container {
    background: linear-gradient(135deg, #2d2442 0%, #352850 100%);
    border-color: #4a3d6a;
}

[data-theme="dark"] .poll-title {
    color: #b794f4;
}

[data-theme="dark"] .poll-response {
    background: #1e1e2e;
    border-color: #4a3d6a;
}

[data-theme="dark"] .poll-response-text {
    color: #e6eef8;
}

[data-theme="dark"] .poll-bar-container {
    background: #3a3a4a;
}

[data-theme="dark"] .poll-bar {
    background: linear-gradient(90deg, #9b59b6 0%, #b794f4 100%);
}

[data-theme="dark"] .poll-votes {
    color: #9ca3af;
}

[data-theme="dark"] .poll-footer {
    border-top-color: #4a3d6a;
    color: #9ca3af;
}

[data-theme="dark"] .results-section-header {
    background: linear-gradient(135deg, #1e2a38 0%, #243040 100%);
    color: #e6eef8;
}

[data-theme="dark"] .results-section-header.results-section-laws {
    background: linear-gradient(135deg, #2d2442 0%, #352850 100%);
}

/* ===== SMART CITATION INSERTER STYLES ===== */

/* Citation Modal */
#citationSearchModal {
    background-color: rgba(0, 0, 0, 0.6);
}

#citationSearchModal .modal-content {
    max-width: 900px;
}

.citation-modal {
    position: relative;
}

.citation-modal-header {
    background: linear-gradient(135deg, #153778 0%, #1e4a9a 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.citation-modal-header h3 {
    color: white;
    margin: 0;
}

.citation-modal-header .close {
    color: white;
    opacity: 0.8;
}

.citation-modal-header .close:hover {
    opacity: 1;
}

/* Citation Search Controls */
.citation-search-controls {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.citation-search-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.citation-search-input-group {
    flex: 1;
    margin-bottom: 0;
}

.citation-search-input-group input {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.citation-search-btn {
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Citation Filter Options */
.citation-filter-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.citation-filter-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.citation-type-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.citation-type-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.citation-type-option:hover {
    background: #e9ecef;
    border-color: #153778;
}

.citation-type-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.citation-type-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #153778;
}

/* Citation Results */
.citation-results {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.citation-help-text {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.citation-help-text p {
    margin: 0.5rem 0;
}

.citation-help-text kbd {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

.citation-no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.citation-no-results p {
    margin: 0.5rem 0;
}

.citation-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #fff5f5;
    border-radius: 8px;
}

.citation-results-header {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Citation Result Card */
.citation-result-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.citation-result-card:hover {
    border-color: #153778;
    box-shadow: 0 2px 8px rgba(21, 55, 120, 0.15);
}

.citation-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.citation-result-title {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
}

.citation-type-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.citation-result-title h4 {
    margin: 0;
    font-size: 1rem;
    color: #153778;
    line-height: 1.3;
}

/* Relevance Score */
.citation-relevance {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
}

.citation-relevance.relevance-high {
    background: #d4edda;
    color: #155724;
}

.citation-relevance.relevance-medium {
    background: #fff3cd;
    color: #856404;
}

.citation-relevance.relevance-low {
    background: #f8d7da;
    color: #721c24;
}

/* Citation Meta */
.citation-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.citation-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.citation-badge-case {
    background: #e3f2fd;
    color: #1565c0;
}

.citation-badge-statute {
    background: linear-gradient(135deg, #6a0dad15, #8b5cf615);
    color: #6a0dad;
}

.citation-badge-regulation {
    background: #fff3e0;
    color: #e65100;
}

.citation-badge-rule {
    background: #e8f5e9;
    color: #2e7d32;
}

.citation-id {
    font-size: 0.85rem;
    color: #666;
    font-family: monospace;
}

/* Citation Snippet */
.citation-result-snippet {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #153778;
}

/* Citation Actions */
.citation-result-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.citation-result-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Citation Pagination */
.citation-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.citation-page-info {
    font-size: 0.9rem;
    color: #666;
}

/* Citation Toolbar in BBCode Editor */
.citation-toolbar {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eeff 100%);
    border-top: 1px solid #ddd;
    border-radius: 0;
}

.citation-toolbar button {
    background: #153778;
    color: white;
    border-color: #153778;
}

.citation-toolbar button:hover {
    background: #1e4a9a;
    border-color: #1e4a9a;
}

.citation-insert-btn {
    font-weight: 600;
}

/* Dark Mode Styles for Citation Modal */
[data-theme="dark"] #citationSearchModal .modal-content {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .citation-modal-header {
    background: linear-gradient(135deg, #1b3a6b 0%, #234980 100%);
}

[data-theme="dark"] .citation-search-controls {
    border-bottom-color: #213046;
}

[data-theme="dark"] .citation-search-input-group input {
    background: #0b1116;
    color: #e6eef8;
    border-color: #213046;
}

[data-theme="dark"] .citation-filter-label {
    color: #9fb6d6;
}

[data-theme="dark"] .citation-type-option {
    background: #0b1116;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .citation-type-option:hover {
    background: #162030;
    border-color: #3399ff;
}

[data-theme="dark"] .citation-type-option input[type="radio"]:checked + span {
    color: #66b2ff;
}

[data-theme="dark"] .citation-help-text {
    color: #9fb6d6;
}

[data-theme="dark"] .citation-help-text kbd {
    background: #213046;
    border-color: #2a435a;
    color: #e6eef8;
}

[data-theme="dark"] .citation-no-results {
    color: #9fb6d6;
}

[data-theme="dark"] .citation-error {
    background: #2d1f1f;
    color: #ff6b6b;
}

[data-theme="dark"] .citation-results-header {
    color: #9fb6d6;
    border-bottom-color: #213046;
}

[data-theme="dark"] .citation-result-card {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .citation-result-card:hover {
    border-color: #3399ff;
    box-shadow: 0 2px 8px rgba(51, 153, 255, 0.2);
}

[data-theme="dark"] .citation-result-title h4 {
    color: #66b2ff;
}

[data-theme="dark"] .citation-relevance.relevance-high {
    background: #1a3d2e;
    color: #4ade80;
}

[data-theme="dark"] .citation-relevance.relevance-medium {
    background: #3d3200;
    color: #ffd54f;
}

[data-theme="dark"] .citation-relevance.relevance-low {
    background: #3d1f1f;
    color: #ff8a80;
}

[data-theme="dark"] .citation-badge-case {
    background: #0d3c61;
    color: #64b5f6;
}

[data-theme="dark"] .citation-badge-statute {
    background: #2d2442;
    color: #b794f4;
}

[data-theme="dark"] .citation-badge-regulation {
    background: #3d2a0a;
    color: #ffb74d;
}

[data-theme="dark"] .citation-badge-rule {
    background: #1a3d2e;
    color: #81c784;
}

[data-theme="dark"] .citation-id {
    color: #9fb6d6;
}

[data-theme="dark"] .citation-result-snippet {
    background: #0b1116;
    color: #cfe6ff;
    border-left-color: #3399ff;
}

[data-theme="dark"] .citation-pagination {
    border-top-color: #213046;
}

[data-theme="dark"] .citation-page-info {
    color: #9fb6d6;
}

[data-theme="dark"] .citation-toolbar {
    background: linear-gradient(135deg, #0d3c61 0%, #0f4570 100%);
    border-color: #213046;
}

[data-theme="dark"] .citation-toolbar button {
    background: #1b6fd6;
    border-color: #1b6fd6;
}

[data-theme="dark"] .citation-toolbar button:hover {
    background: #2980e8;
    border-color: #2980e8;
}

/* Responsive styles for citation modal */
@media (max-width: 768px) {
    .citation-search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .citation-search-btn {
        width: 100%;
    }
    
    .citation-type-filters {
        justify-content: center;
    }
    
    .citation-result-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .citation-relevance {
        align-self: flex-start;
    }
    
    .citation-result-actions {
        flex-direction: column;
    }
    
    .citation-result-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== TIMELINE VISUALIZATION STYLES ===== */

/* Timeline Section */
.timeline-section {
    margin: 1.5rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.timeline-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
}

.timeline-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #153778;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-toggle-btn {
    font-size: 0.85rem;
}

/* Timeline Container */
.timeline-container {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.timeline-container.timeline-expanded {
    max-height: none;
}

/* Timeline Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.timeline-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeline-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.timeline-controls {
    display: flex;
    gap: 0.5rem;
}

.timeline-sort-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Timeline Entries */
.timeline-entries {
    position: relative;
    padding-left: 2rem;
}

.timeline-entry {
    position: relative;
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
}

.timeline-entry:last-child {
    padding-bottom: 0;
}

/* Timeline Entry Marker */
.timeline-entry-marker {
    position: absolute;
    left: -2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 2rem;
}

.timeline-entry-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #153778;
    border-radius: 50%;
    font-size: 1rem;
    z-index: 1;
}

.timeline-entry-line {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% - 16px);
    background: linear-gradient(to bottom, #153778, #e0e0e0);
}

.timeline-entry:last-child .timeline-entry-line {
    display: none;
}

/* Timeline Entry Content */
.timeline-entry-content {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.timeline-entry-content:hover {
    border-color: #153778;
    box-shadow: 0 2px 8px rgba(21, 55, 120, 0.1);
}

.timeline-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.timeline-entry-date {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.timeline-entry-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: #153778;
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.timeline-entry-body {
    margin-bottom: 0.5rem;
}

.timeline-entry-description {
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
}

.timeline-entry-party {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.timeline-entry-number {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
}

/* Entry Type Specific Styles */
.timeline-entry-motion .timeline-entry-icon {
    border-color: #2196f3;
    background: #e3f2fd;
}

.timeline-entry-motion .timeline-entry-type {
    background: #2196f3;
}

.timeline-entry-order .timeline-entry-icon {
    border-color: #f44336;
    background: #ffebee;
}

.timeline-entry-order .timeline-entry-type {
    background: #f44336;
}

.timeline-entry-verdict .timeline-entry-icon {
    border-color: #9c27b0;
    background: #f3e5f5;
}

.timeline-entry-verdict .timeline-entry-type {
    background: #9c27b0;
}

.timeline-entry-hearing .timeline-entry-icon {
    border-color: #ff9800;
    background: #fff3e0;
}

.timeline-entry-hearing .timeline-entry-type {
    background: #ff9800;
}

.timeline-entry-notice .timeline-entry-icon {
    border-color: #00bcd4;
    background: #e0f7fa;
}

.timeline-entry-notice .timeline-entry-type {
    background: #00bcd4;
}

.timeline-entry-objection .timeline-entry-icon {
    border-color: #ff5722;
    background: #fbe9e7;
}

.timeline-entry-objection .timeline-entry-type {
    background: #ff5722;
}

.timeline-entry-summons .timeline-entry-icon {
    border-color: #795548;
    background: #efebe9;
}

.timeline-entry-summons .timeline-entry-type {
    background: #795548;
}

.timeline-entry-answer .timeline-entry-icon {
    border-color: #4caf50;
    background: #e8f5e9;
}

.timeline-entry-answer .timeline-entry-type {
    background: #4caf50;
}

/* Timeline Pagination */
.timeline-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.timeline-page-info {
    font-size: 0.9rem;
    color: #666;
}

/* Timeline Loading State */
.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.timeline-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #153778;
    border-radius: 50%;
    animation: timeline-spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

@keyframes timeline-spin {
    to { transform: rotate(360deg); }
}

/* Timeline Empty State */
.timeline-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.timeline-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Timeline Error State */
.timeline-error {
    text-align: center;
    padding: 1.5rem;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
}

.timeline-error p {
    margin: 0 0 1rem 0;
}

/* Dark Mode Timeline Styles */
[data-theme="dark"] .timeline-section {
    background: #0f1720;
    border-color: #213046;
}

[data-theme="dark"] .timeline-section-header {
    background: linear-gradient(135deg, #071827 0%, #0f1720 100%);
    border-bottom-color: #213046;
}

[data-theme="dark"] .timeline-section-header h3 {
    color: #66b2ff;
}

[data-theme="dark"] .timeline-container {
    background: #0f1720;
}

[data-theme="dark"] .timeline-header {
    border-bottom-color: #213046;
}

[data-theme="dark"] .timeline-count {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-entry-content {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .timeline-entry-content:hover {
    border-color: #3399ff;
    box-shadow: 0 2px 8px rgba(51, 153, 255, 0.15);
}

[data-theme="dark"] .timeline-entry-date {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-entry-description {
    color: #e6eef8;
}

[data-theme="dark"] .timeline-entry-party {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-entry-number {
    color: #6b8299;
}

[data-theme="dark"] .timeline-entry-icon {
    background: #0f1720;
    border-color: #3399ff;
}

[data-theme="dark"] .timeline-entry-line {
    background: linear-gradient(to bottom, #3399ff, #213046);
}

[data-theme="dark"] .timeline-pagination {
    border-top-color: #213046;
}

[data-theme="dark"] .timeline-page-info {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-loading {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-spinner {
    border-color: #213046;
    border-top-color: #3399ff;
}

[data-theme="dark"] .timeline-empty {
    color: #9fb6d6;
}

[data-theme="dark"] .timeline-error {
    background: #2d1f1f;
    border-color: #5c2828;
    color: #ff8a80;
}

/* Responsive Timeline Styles */
@media (max-width: 768px) {
    .timeline-section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .timeline-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .timeline-entries {
        padding-left: 1.5rem;
    }
    
    .timeline-entry-marker {
        left: -1.5rem;
    }
    
    .timeline-entry-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .timeline-entry-content {
        padding: 0.75rem;
    }
    
    .timeline-entry-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .timeline-pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== VERSION HISTORY & APPROVAL WORKFLOW STYLES ===== */

/* Version History Modal */
.version-history-modal .modal-content {
    max-width: 1100px;
    max-height: 85vh;
}

.version-history-modal .modal-header {
    background: linear-gradient(135deg, #153778 0%, #1e4a9a 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.version-history-modal .modal-header h3 {
    color: white;
    margin: 0;
}

.version-history-modal .modal-header .close {
    color: white;
    opacity: 0.8;
}

.version-history-modal .modal-header .close:hover {
    opacity: 1;
}

/* Version History Layout - Two Column */
.version-history-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    min-height: 400px;
}

/* Versions List Panel */
.versions-list-panel {
    border-right: 1px solid #e0e0e0;
    padding-right: 1rem;
    overflow-y: auto;
    max-height: 60vh;
}

.versions-list-panel h4 {
    margin: 0 0 1rem 0;
    color: #153778;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #153778;
}

/* Version Item */
.version-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-item:hover {
    border-color: #153778;
    box-shadow: 0 2px 8px rgba(21, 55, 120, 0.15);
}

.version-item.selected {
    border-color: #153778;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(21, 55, 120, 0.2);
}

.version-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.version-number {
    font-weight: 700;
    color: #153778;
    font-size: 1rem;
}

.version-date {
    font-size: 0.8rem;
    color: #666;
}

.version-author {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.version-change-note {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ddd;
}

/* Version Status Badges */
.version-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background: #e9ecef;
    color: #495057;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.badge-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.badge-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Version Detail Panel */
.version-detail-panel {
    overflow-y: auto;
    max-height: 60vh;
}

.version-detail-panel h4 {
    margin: 0 0 1rem 0;
    color: #153778;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #153778;
}

.version-detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Version Detail Content */
.version-detail-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.version-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.version-detail-info h5 {
    margin: 0 0 0.5rem 0;
    color: #153778;
    font-size: 1.1rem;
}

.version-detail-meta {
    font-size: 0.85rem;
    color: #666;
}

.version-detail-meta span {
    display: block;
    margin-bottom: 0.25rem;
}

.version-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.version-detail-actions .btn-small {
    white-space: nowrap;
}

/* Version Content Preview */
.version-content-preview {
    margin-top: 1rem;
}

.version-content-preview h6 {
    margin: 0 0 0.5rem 0;
    color: #555;
    font-size: 0.9rem;
}

.version-content-body {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Approval Section */
.approval-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.approval-section h6 {
    margin: 0 0 1rem 0;
    color: #153778;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Approval Form */
.approval-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.approval-form .form-group {
    margin-bottom: 0.75rem;
}

.approval-form .form-group:last-child {
    margin-bottom: 0;
}

.approval-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.approval-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.approval-form textarea:focus {
    outline: none;
    border-color: #153778;
}

.approval-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-approve {
    background: #28a745;
    color: white;
    border: none;
}

.btn-approve:hover {
    background: #218838;
}

.btn-reject {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-reject:hover {
    background: #c82333;
}

.btn-submit-approval {
    background: #ffc107;
    color: #212529;
    border: none;
}

.btn-submit-approval:hover {
    background: #e0a800;
}

/* Approval History */
.approval-history {
    margin-top: 1rem;
}

.approval-history h6 {
    margin: 0 0 0.75rem 0;
    color: #555;
    font-size: 0.9rem;
}

.approval-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.approval-history-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.approval-history-item:last-child {
    margin-bottom: 0;
}

.approval-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.approval-history-action {
    font-weight: 600;
}

.approval-history-action.action-approved {
    color: #28a745;
}

.approval-history-action.action-rejected {
    color: #dc3545;
}

.approval-history-action.action-submitted {
    color: #ffc107;
}

.approval-history-date {
    font-size: 0.75rem;
    color: #888;
}

.approval-history-user {
    color: #555;
    margin-bottom: 0.25rem;
}

.approval-history-notes {
    color: #666;
    font-style: italic;
    padding-top: 0.25rem;
    border-top: 1px dashed #e0e0e0;
    margin-top: 0.25rem;
}

/* Version Compare Modal */
.version-compare-modal .modal-content {
    max-width: 1200px;
    max-height: 85vh;
}

.version-compare-modal .modal-header {
    background: linear-gradient(135deg, #6f42c1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.version-compare-modal .modal-header h3 {
    color: white;
    margin: 0;
}

.version-compare-modal .modal-header .close {
    color: white;
    opacity: 0.8;
}

.version-compare-modal .modal-header .close:hover {
    opacity: 1;
}

/* Version Compare Container */
.version-compare-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-height: 400px;
}

.version-compare-pane {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.version-compare-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-compare-header h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #153778;
}

.version-compare-content {
    padding: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Compare Diff Highlighting */
.diff-added {
    background: #d4edda;
    color: #155724;
}

.diff-removed {
    background: #f8d7da;
    color: #721c24;
    text-decoration: line-through;
}

.diff-changed {
    background: #fff3cd;
    color: #856404;
}

/* Version History Button in Draft List */
.btn-version-history {
    background: #6f42c1;
    color: white;
    border: none;
}

.btn-version-history:hover {
    background: #5a32a3;
}

/* Loading State for Version History */
.version-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.version-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #153778;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

/* Empty State */
.version-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.version-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Dark Mode Styles for Version History */
[data-theme="dark"] .version-history-modal .modal-content {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .version-history-modal .modal-header {
    background: linear-gradient(135deg, #1b3a6b 0%, #234980 100%);
}

[data-theme="dark"] .versions-list-panel {
    border-right-color: #213046;
}

[data-theme="dark"] .versions-list-panel h4 {
    color: #66b2ff;
    border-bottom-color: #3399ff;
}

[data-theme="dark"] .version-item {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .version-item:hover {
    border-color: #3399ff;
    box-shadow: 0 2px 8px rgba(51, 153, 255, 0.2);
}

[data-theme="dark"] .version-item.selected {
    background: #0d3c61;
    border-color: #3399ff;
}

[data-theme="dark"] .version-number {
    color: #66b2ff;
}

[data-theme="dark"] .version-date,
[data-theme="dark"] .version-author {
    color: #9fb6d6;
}

[data-theme="dark"] .version-change-note {
    color: #8899a6;
    border-top-color: #213046;
}

[data-theme="dark"] .badge-draft {
    background: #213046;
    color: #9fb6d6;
}

[data-theme="dark"] .badge-pending {
    background: #3d3200;
    color: #ffd54f;
    border-color: #665500;
}

[data-theme="dark"] .badge-approved {
    background: #1a3d2e;
    color: #4ade80;
    border-color: #2d5a40;
}

[data-theme="dark"] .badge-rejected {
    background: #3d1f1f;
    color: #ff8a80;
    border-color: #5c2828;
}

[data-theme="dark"] .version-detail-panel h4 {
    color: #66b2ff;
    border-bottom-color: #3399ff;
}

[data-theme="dark"] .version-detail-placeholder {
    background: #132f4c;
    border-color: #213046;
    color: #9fb6d6;
}

[data-theme="dark"] .version-detail-content {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .version-detail-header {
    border-bottom-color: #213046;
}

[data-theme="dark"] .version-detail-info h5 {
    color: #66b2ff;
}

[data-theme="dark"] .version-detail-meta {
    color: #9fb6d6;
}

[data-theme="dark"] .version-content-preview h6 {
    color: #9fb6d6;
}

[data-theme="dark"] .version-content-body {
    background: #0b1116;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .approval-section {
    border-top-color: #213046;
}

[data-theme="dark"] .approval-section h6 {
    color: #66b2ff;
}

[data-theme="dark"] .approval-form {
    background: #0b1116;
    border-color: #213046;
}

[data-theme="dark"] .approval-form label {
    color: #9fb6d6;
}

[data-theme="dark"] .approval-form textarea {
    background: #132f4c;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .approval-form textarea:focus {
    border-color: #3399ff;
}

[data-theme="dark"] .approval-history h6 {
    color: #9fb6d6;
}

[data-theme="dark"] .approval-history-item {
    background: #132f4c;
    border-color: #213046;
}

[data-theme="dark"] .approval-history-date {
    color: #6b8299;
}

[data-theme="dark"] .approval-history-user {
    color: #9fb6d6;
}

[data-theme="dark"] .approval-history-notes {
    color: #8899a6;
    border-top-color: #213046;
}

[data-theme="dark"] .version-compare-modal .modal-content {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .version-compare-modal .modal-header {
    background: linear-gradient(135deg, #5a32a3 0%, #7c4ce6 100%);
}

[data-theme="dark"] .version-compare-pane {
    border-color: #213046;
}

[data-theme="dark"] .version-compare-header {
    background: #071827;
    border-bottom-color: #213046;
}

[data-theme="dark"] .version-compare-header h5 {
    color: #66b2ff;
}

[data-theme="dark"] .version-compare-content {
    background: #0b1116;
    color: #e6eef8;
}

[data-theme="dark"] .diff-added {
    background: #1a3d2e;
    color: #4ade80;
}

[data-theme="dark"] .diff-removed {
    background: #3d1f1f;
    color: #ff8a80;
}

[data-theme="dark"] .diff-changed {
    background: #3d3200;
    color: #ffd54f;
}

[data-theme="dark"] .version-loading {
    color: #9fb6d6;
}

[data-theme="dark"] .version-loading .spinner {
    border-color: #213046;
    border-top-color: #3399ff;
}

[data-theme="dark"] .version-empty {
    color: #9fb6d6;
}

/* Responsive Styles for Version History */
@media (max-width: 900px) {
    .version-history-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .versions-list-panel {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 1rem;
        max-height: 200px;
    }
    
    .version-detail-panel {
        max-height: none;
    }
    
    .version-compare-container {
        grid-template-columns: 1fr;
    }
    
    .version-compare-pane {
        max-height: 300px;
    }
}

@media (max-width: 600px) {
    .version-history-modal .modal-content,
    .version-compare-modal .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .version-item-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .version-detail-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .version-detail-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .approval-actions {
        flex-direction: column;
    }
    
    .approval-actions .btn {
        width: 100%;
    }
}

/* ===== DRAFT ASSISTANT AI STYLES ===== */

/* AI Toolbar in BBCode Editor */
.ai-toolbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-top: 1px solid #ddd;
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-toolbar span {
    color: white;
    font-size: 0.85rem;
}

.ai-assistant-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-assistant-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Draft Assistant Modal */
.draft-assistant-modal {
    max-width: 700px;
}

.draft-assistant-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.draft-assistant-modal .modal-header h3 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draft-assistant-modal .modal-header .close {
    color: white;
    opacity: 0.8;
}

.draft-assistant-modal .modal-header .close:hover {
    opacity: 1;
}

/* Draft Assistant Tabs */
.draft-assistant-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Draft Assistant Tab Content */
.draft-assistant-tab {
    display: none;
    animation: fadeIn 0.2s ease;
}

.draft-assistant-tab.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Assistant Form */
.assistant-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assistant-form .form-group {
    margin-bottom: 0;
}

.assistant-form .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
    display: block;
    font-size: 0.9rem;
}

.assistant-form .form-group small {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.assistant-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.assistant-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.assistant-form select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.assistant-form select:focus {
    outline: none;
    border-color: #667eea;
}

.assistant-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.assistant-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.assistant-form .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Load Selected Text Button */
.btn-load-selected {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #555;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-selected:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

/* AI Output Section */
.ai-output-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.ai-output-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* AI Loading State */
.ai-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.ai-loading.active {
    display: flex;
}

.ai-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.ai-loading p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
}

/* AI Output Content */
.ai-output-content {
    display: none;
}

.ai-output-content.active {
    display: block;
}

.ai-output-text {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* AI Output Actions */
.ai-output-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ai-output-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-insert-ai {
    background: #28a745;
    color: white;
    border: none;
}

.btn-insert-ai:hover {
    background: #218838;
}

.btn-replace-ai {
    background: #ffc107;
    color: #212529;
    border: none;
}

.btn-replace-ai:hover {
    background: #e0a800;
}

.btn-copy-ai {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-copy-ai:hover {
    background: #138496;
}

/* AI Metadata Display */
.ai-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ai-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #555;
}

.ai-meta-item strong {
    color: #333;
}

.ai-confidence {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-confidence.confidence-high {
    background: #d4edda;
    color: #155724;
}

.ai-confidence.confidence-medium {
    background: #fff3cd;
    color: #856404;
}

.ai-confidence.confidence-low {
    background: #f8d7da;
    color: #721c24;
}

/* AI Provenance Information */
.ai-provenance {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border: 1px solid #c5cae9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

.ai-provenance h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #3f51b5;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-provenance p {
    margin: 0;
    font-size: 0.8rem;
    color: #5c6bc0;
    line-height: 1.5;
}

.ai-provenance .provenance-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ai-provenance .provenance-item {
    font-size: 0.75rem;
    color: #7986cb;
}

.ai-provenance .provenance-item strong {
    color: #5c6bc0;
}

/* AI Error Display */
.ai-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 1rem;
    color: #c62828;
    text-align: center;
}

.ai-error.active {
    display: block;
}

.ai-error p {
    margin: 0;
    font-size: 0.95rem;
}

/* Dark Mode Styles for Draft Assistant */
[data-theme="dark"] .ai-toolbar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #213046;
}

[data-theme="dark"] .ai-assistant-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e6eef8;
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .ai-assistant-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .draft-assistant-modal .modal-content {
    background: #0f1720;
    color: #e6eef8;
}

[data-theme="dark"] .draft-assistant-modal .modal-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

[data-theme="dark"] .draft-assistant-tabs {
    border-bottom-color: #213046;
}

[data-theme="dark"] .tab-btn {
    background: #132f4c;
    color: #9fb6d6;
}

[data-theme="dark"] .tab-btn:hover {
    background: #1a3d5c;
    color: #e6eef8;
}

[data-theme="dark"] .tab-btn.active {
    background: #0f1720;
    color: #66b2ff;
    border-bottom-color: #66b2ff;
}

[data-theme="dark"] .assistant-form .form-group label {
    color: #e6eef8;
}

[data-theme="dark"] .assistant-form .form-group small {
    color: #8899a6;
}

[data-theme="dark"] .assistant-form textarea,
[data-theme="dark"] .assistant-form select {
    background: #0b1116;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .assistant-form textarea:focus,
[data-theme="dark"] .assistant-form select:focus {
    border-color: #66b2ff;
    box-shadow: 0 0 0 3px rgba(102, 178, 255, 0.1);
}

[data-theme="dark"] .btn-load-selected {
    background: #132f4c;
    border-color: #213046;
    color: #9fb6d6;
}

[data-theme="dark"] .btn-load-selected:hover {
    background: #1a3d5c;
    border-color: #66b2ff;
    color: #66b2ff;
}

[data-theme="dark"] .ai-output-section {
    border-top-color: #213046;
}

[data-theme="dark"] .ai-output-section h4 {
    color: #e6eef8;
}

[data-theme="dark"] .ai-loading {
    color: #9fb6d6;
}

[data-theme="dark"] .ai-loading .spinner {
    border-color: #213046;
    border-top-color: #66b2ff;
}

[data-theme="dark"] .ai-loading p {
    color: #9fb6d6;
}

[data-theme="dark"] .ai-output-text {
    background: #0b1116;
    border-color: #213046;
    color: #e6eef8;
}

[data-theme="dark"] .ai-meta-item {
    background: #213046;
    color: #9fb6d6;
}

[data-theme="dark"] .ai-meta-item strong {
    color: #e6eef8;
}

[data-theme="dark"] .ai-confidence.confidence-high {
    background: #1a3d2e;
    color: #4ade80;
}

[data-theme="dark"] .ai-confidence.confidence-medium {
    background: #3d3200;
    color: #ffd54f;
}

[data-theme="dark"] .ai-confidence.confidence-low {
    background: #3d1f1f;
    color: #ff8a80;
}

[data-theme="dark"] .ai-provenance {
    background: linear-gradient(135deg, #1a2332 0%, #162030 100%);
    border-color: #2a435a;
}

[data-theme="dark"] .ai-provenance h5 {
    color: #90caf9;
}

[data-theme="dark"] .ai-provenance p {
    color: #64b5f6;
}

[data-theme="dark"] .ai-provenance .provenance-item {
    color: #90caf9;
}

[data-theme="dark"] .ai-provenance .provenance-item strong {
    color: #64b5f6;
}

[data-theme="dark"] .ai-error {
    background: #2d1f1f;
    border-color: #5c2828;
    color: #ff8a80;
}

/* Responsive Styles for Draft Assistant */
@media (max-width: 768px) {
    .draft-assistant-modal .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .draft-assistant-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-bottom: none;
        border-left-color: #667eea;
    }
    
    .ai-output-actions {
        flex-direction: column;
    }
    
    .ai-output-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .ai-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ai-provenance .provenance-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Onboarding page styles */
.container.onboarding {
    background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 100%);
    align-items: flex-start;
    padding: 2.5rem 1rem;
    gap: 1rem;
}
.container.onboarding h1 {
    color: #153778;
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
}
.container.onboarding p,
.container.onboarding ul,
.container.onboarding a {
    max-width: 900px;
    margin: 0.25rem auto;
    color: #374151;
    font-size: 1rem;
}
.container.onboarding a {
    display: inline-block;
    background: #153778;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: background .2s ease, transform .08s;
}
.container.onboarding a:hover { background: #0f3f6f; transform: translateY(-2px); }
.container.onboarding #privacy-btn {
    width: auto !important;
    padding: 0.5rem 0.8rem !important;
    border-radius: 6px !important;
    background: #f59e0b !important;
    border: none !important;
    color: #111 !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 18px rgba(21,55,120,0.08) !important;
}
.container.onboarding #terms-of-service {
    transform: none !important;
    width: 100% !important;
    max-width: 1100px !important;
    display: block !important;
    padding: 1.25rem !important;
    background: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(21,55,120,0.06) !important;
    margin: 1rem auto !important;
    border: 1px solid rgba(21,55,120,0.06) !important;
}
.container.onboarding [data-custom-class='body'] {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 0.25rem;
}
.container.onboarding .onboard-logo {
    display: block;
    margin: 0 auto 1rem;
    width: 140px;
    height: auto;
    background-image: url('/static/caser.png');
    background-size: contain;
    background-repeat: no-repeat;
}

@media (max-width: 900px) {
    .container.onboarding h1 { font-size: 1.6rem; }
    .container.onboarding #terms-of-service { padding: 0.8rem; }
}

/* Onboard header + mascot */
.onboard-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto 0.5rem;
    padding: 0.5rem;
}
/* Ensure the continue button inside the onboarding body is centered */
.container.onboarding .onboard-body { display: flex; justify-content: center; width: 100%; }
.onboard-titles { flex: 1; }
.onboard-titles h1 { text-align: left; margin: 0 0 0.25rem 0; font-size: 2rem; }
.onboard-titles .lead { margin: 0; color: #4b5563; }
.juniper-mascot {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(21,55,120,0.12);
    transform-origin: center;
    animation: float-rotate 4.5s ease-in-out infinite;
    transition: transform .18s ease;}

.juniper-mascot-l {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(21,55,120,0.12);
    transform-origin: center;
    transform: rotate(-10deg); /* negative = counterclockwise */
    animation: float-rotate 4.5s ease-out infinite;
    transition: transform .18s ease;
}

.juniper-mascot:hover { transform: translateY(-6px) rotate(4deg); }

@keyframes float-rotate {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(6deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.btn-continue { display: block; width: max-content; margin: 0.6rem auto; background: linear-gradient(90deg,#1b6fd6,#1765f2); color:#fff; padding:0.6rem 1rem; border-radius:8px; text-decoration:none; font-weight:600; box-shadow: 0 8px 22px rgba(23,101,242,0.12); }
.btn-continue:hover { transform: translateY(-2px); }
.lead { font-size: 1rem; color: #4b5563; }
.muted { color: #6b7280; margin-bottom: 0.25rem; }

@media (max-width: 680px) {
    .onboard-header { flex-direction: column; align-items: center; text-align: center; }
    .onboard-titles h1 { font-size: 1.5rem; }
    .juniper-mascot { width: 96px; height: 96px; }
    .btn-continue { width: 100%; text-align: center; }
}
