:root {
    --cj-primary: #1e3a5f;
    --cj-gold: #d4af37;
    --cj-bg: #f8f5ef;
    --cj-ink: #263238;
    --cj-muted: #6f766f;
    --cj-card: #ffffff;
    --cj-border: rgba(30, 58, 95, 0.12);
    --cj-radius: 8px;
    --cj-font-size: 16px;
}

html {
    font-size: var(--cj-font-size);
}

body {
    color: var(--cj-ink);
    background: var(--cj-bg);
}

a {
    color: var(--cj-primary);
}

.btn-primary {
    --bs-btn-bg: var(--cj-primary);
    --bs-btn-border-color: var(--cj-primary);
    --bs-btn-hover-bg: #162b47;
    --bs-btn-hover-border-color: #162b47;
}

.btn-gold {
    --bs-btn-bg: var(--cj-gold);
    --bs-btn-border-color: var(--cj-gold);
    --bs-btn-color: #1d241f;
    --bs-btn-hover-bg: #c59f2e;
    --bs-btn-hover-border-color: #c59f2e;
}

.bg-primary-subtle {
    background: linear-gradient(180deg, #1e3a5f, #16304f) !important;
}

.sidebar-brand {
    min-height: 84px;
    padding: 16px 12px;
}

.brand-image,
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--cj-gold);
    color: #17243a;
    font-weight: 800;
}

.tagline {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.app-main {
    background: var(--cj-bg);
}

.app-content-header h1 {
    font-size: 1.35rem;
    font-weight: 750;
}

.c-card,
.toolbar-card,
.metric-card,
.journal-card,
.auth-card {
    background: var(--cj-card);
    border: 1px solid var(--cj-border);
    border-radius: var(--cj-radius);
    box-shadow: 0 12px 28px rgba(31, 45, 61, 0.06);
}

.c-card,
.toolbar-card {
    padding: 18px;
}

.welcome-card {
    min-height: 178px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #ffffff, #fff8e4);
}

.welcome-card h2,
.c-card h3,
.auth-card h1 {
    font-weight: 760;
    color: var(--cj-primary);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--cj-gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.verse-card blockquote {
    margin: 8px 0;
    font-size: 1.05rem;
    line-height: 1.55;
}

.metric-card {
    padding: 16px;
    min-height: 116px;
}

.metric-card span,
.metric-card small {
    color: var(--cj-muted);
}

.metric-card strong {
    display: block;
    margin: 8px 0 2px;
    color: var(--cj-primary);
    font-size: 2rem;
    line-height: 1;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.journal-stack {
    display: grid;
    gap: 10px;
}

.journal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--cj-border);
    border-radius: var(--cj-radius);
    background: rgba(255, 255, 255, 0.58);
}

.journal-row:hover {
    border-color: rgba(212, 175, 55, 0.7);
}

.journal-row small {
    display: block;
    color: var(--cj-muted);
}

.color-dot {
    width: 12px;
    height: 36px;
    flex: 0 0 12px;
    border-radius: 99px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.quick-action {
    display: grid;
    place-items: center;
    min-height: 78px;
    color: var(--cj-primary);
    text-decoration: none;
    border: 1px solid var(--cj-border);
    border-radius: var(--cj-radius);
    background: #fffaf0;
}

.quick-action i {
    color: var(--cj-gold);
    font-size: 1.35rem;
}

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

.journal-card {
    padding: 16px;
    border-top: 4px solid var(--entry-color, var(--cj-primary));
}

.journal-card-head,
.journal-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.journal-card h4 {
    margin: 0;
    color: var(--cj-primary);
    font-size: 1rem;
    font-weight: 750;
}

.journal-card p {
    min-height: 70px;
    margin: 10px 0;
    color: var(--cj-muted);
}

.favorite-toggle {
    color: var(--cj-gold);
    text-decoration: none;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.08);
    color: var(--cj-primary);
    font-size: 0.78rem;
    font-weight: 650;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 24px;
    text-align: center;
    color: var(--cj-muted);
}

.empty-state i {
    color: var(--cj-gold);
    font-size: 2rem;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
}

.editor-title {
    flex: 1;
    min-width: 240px;
    border: 0;
    border-bottom: 2px solid var(--cj-border);
    color: var(--cj-primary);
    font-size: 1.45rem;
    font-weight: 760;
    outline: 0;
}

.rich-editor {
    height: 280px;
    background: #fff;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.image-preview figure {
    position: relative;
    margin: 0;
}

.image-preview img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--cj-radius);
}

.image-preview button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
    color: var(--cj-muted);
    font-weight: 750;
    text-align: center;
}

.calendar-day {
    min-height: 96px;
    padding: 10px;
    text-align: left;
    border: 1px solid var(--cj-border);
    border-radius: var(--cj-radius);
    background: #fff;
}

.calendar-day span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--cj-gold);
    color: #16243b;
    font-size: 0.8rem;
    font-weight: 800;
}

.calendar-day.muted {
    background: transparent;
    border-color: transparent;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cj-primary);
    color: #fff;
    font-weight: 800;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

.avatar-xl {
    width: 104px;
    height: 104px;
    font-size: 2.4rem;
}

.stats-list,
.setting-row {
    display: grid;
    gap: 12px;
}

.stats-list span,
.setting-row {
    padding: 12px;
    border: 1px solid var(--cj-border);
    border-radius: var(--cj-radius);
}

.stats-list span {
    display: flex;
    justify-content: space-between;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-row span {
    display: block;
    color: var(--cj-muted);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top left, rgba(212, 175, 55, 0.22), transparent 34%), var(--cj-bg);
}

.auth-card {
    width: min(460px, 100%);
    padding: 30px;
}

.auth-card .brand-mark {
    margin-bottom: 14px;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(10, 20, 32, 0.42);
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.prose {
    line-height: 1.7;
}

[data-bs-theme="dark"] body,
body.dark-mode {
    --cj-bg: #101820;
    --cj-card: #172331;
    --cj-ink: #edf2f7;
    --cj-muted: #aab4bf;
    --cj-border: rgba(255, 255, 255, 0.12);
    background: var(--cj-bg);
}

[data-bs-theme="dark"] .app-main,
body.dark-mode .app-main {
    background: var(--cj-bg);
}

[data-bs-theme="dark"] .welcome-card,
[data-bs-theme="dark"] .quick-action,
[data-bs-theme="dark"] .journal-row,
[data-bs-theme="dark"] .calendar-day,
[data-bs-theme="dark"] .rich-editor,
body.dark-mode .welcome-card,
body.dark-mode .quick-action,
body.dark-mode .journal-row,
body.dark-mode .calendar-day,
body.dark-mode .rich-editor {
    background: var(--cj-card);
}

@media (max-width: 991.98px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 575.98px) {
    .welcome-card,
    .section-head,
    .journal-card-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-day {
        min-height: 72px;
        padding: 8px;
    }

    .auth-card {
        padding: 22px;
    }
}

