:root {
    --ink: #181511;
    --muted: #6a5f54;
    --cream: #f6f2ea;
    --sand: #e9dfd1;
    --accent: #c27b4a;
    --accent-dark: #8b4d26;
    --surface: #ffffff;
    --shadow: 0 24px 50px rgba(24, 21, 17, 0.12);
}

/* Reusable layout utilities for template content. */
.book-cover-placeholder {
    width: 286px;
    height: 440px;
    background-color: #eee;
}

.related-cover-column {
    width: 80px;
}

.related-cover-placeholder {
    width: 80px;
    height: 120px;
    background-color: #eee;
}

.content-width-860 {
    max-width: 860px;
}

.content-width-760 {
    max-width: 760px;
}

.content-width-420 {
    width: 100%;
    max-width: 420px;
}

.surface-cream {
    background: var(--cream);
}

.auth-shell {
    min-height: 80vh;
}

.chart-height-560 {
    height: 560px;
}

.chart-height-420 {
    height: 420px;
}

.map-canvas {
    height: 600px;
}

.progress-compact {
    height: 10px;
    max-width: 100px;
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top, #fdf7ee 0%, var(--cream) 40%, #f1e7d8 100%);
    min-height: 100vh;
    padding-top: 5.5rem;
    padding-bottom: 3rem;
}

.navbar {
    background: rgba(244, 241, 234, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(24, 21, 17, 0.06);
}

.navbar .nav-link {
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "DM Serif Display", "Georgia", serif;
}

.container,
.container-fluid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.card,
.dashboard-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(24, 21, 17, 0.06);
}

.dashboard-card.compact {
    padding: 1rem 1.25rem;
}

.dashboard-card.compact h2 {
    margin-bottom: 0.6rem;
}

.dashboard-column.sidebar {
    display: block;
}

.dashboard-column.sidebar .dashboard-card {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.dashboard-column.sidebar .dashboard-card h2 {
    margin-bottom: 0.6rem;
}

.dashboard-column.sidebar .item-row {
    padding: 0.6rem 0.75rem;
}

.dashboard-column.sidebar .item-cover {
    width: 40px;
}

.dashboard-column.sidebar .dashboard-card:last-child {
    margin-bottom: 0;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(24, 21, 17, 0.08);
    font-weight: 600;
}

.list-group-item {
    border: none;
    padding: 0.85rem 1rem;
    background: transparent;
}

.stat-box .list-group-item {
    border-bottom: 1px solid rgba(24, 21, 17, 0.08);
}

.stat-box .list-group-item:last-child {
    border-bottom: 0;
}

.table {
    border-radius: 16px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 1px solid rgba(24, 21, 17, 0.08);
}

.reading-dashboard {
    width: min(1200px, 100%);
    box-sizing: border-box;
    padding: 2.5rem 2rem 4rem;
    margin: 0 auto;
}

.dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 2rem;
}

.dashboard-column {
    display: grid;
    gap: 1.5rem;
}

.message-card {
    min-width: 240px;
    background: linear-gradient(135deg, rgba(194, 123, 74, 0.12), rgba(255, 255, 255, 0.9));
}

.message-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--accent-dark);
    margin: 0 0 0.6rem;
    font-weight: 600;
}

.message-text {
    margin: 0;
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.6;
}

.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--cream);
    border-radius: 16px;
    min-width: 0;
}

.item-cover {
    width: 44px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 12px 18px rgba(24, 21, 17, 0.15);
}

.item-meta {
    flex: 1;
    min-width: 0;
}

.item-meta h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.item-meta a {
    color: var(--ink);
    text-decoration: none;
}

.item-meta a:hover {
    color: var(--accent-dark);
}

.item-meta .small {
    color: var(--muted);
    font-size: 0.9rem;
}

.item-meta .text-truncate {
    max-width: 100%;
}

.item-date {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.rating {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.quote {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
    padding: 2.1rem 1.2rem 1.1rem;
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 245, 237, 0.9));
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(22, 29, 37, 0.08);
    position: relative;
    color: #1f2a36;
}

.quote::before {
    content: "“";
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 2.6rem;
    color: rgba(31, 42, 54, 0.15);
    font-weight: 700;
}

.quote:not(.quote-detail) .quote-text {
    display: block;
    padding-top: 0.8rem;
}

.quote p {
    margin: 0 0 0.8rem;
}

.quote p:last-child {
    margin-bottom: 0;
}

.quote footer {
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.quote.quote-detail {
    font-size: 1rem;
    line-height: 1.75;
    padding: 2rem 1.3rem 1.1rem;
    background: linear-gradient(140deg, rgba(248, 245, 237, 0.95), rgba(255, 255, 255, 0.95));
    border-left: 4px solid rgba(31, 42, 54, 0.2);
}

.quote.quote-detail::before {
    top: -0.7rem;
    color: rgba(31, 42, 54, 0.1);
}

.quote-detail .quote-text p {
    margin: 0 0 0.8rem;
}

.quote-detail .quote-text p:last-child {
    margin-bottom: 0;
}

.quote-detail .quote-footer {
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.streak-grid {
    display: grid;
    gap: 0.6rem;
    font-size: 1rem;
}

.stat {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.4rem 0 0;
}

.progress.dashboard-progress {
    height: 8px;
    background: var(--sand);
    border-radius: 999px;
    overflow: hidden;
}

.progress.dashboard-progress .progress-bar {
    background: var(--accent);
}

.goal-footer {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    text-align: center;
}

.calendar-controls a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
}

.calendar-controls a:hover {
    color: var(--accent);
}

.calendar-year {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.calendar-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.calendar-grid .dashboard-card {
    padding: 2rem;
}

.month-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.calendar-table {
    width: 100%;
    border: solid 1px rgba(24, 21, 17, 0.08);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--cream);
    table-layout: fixed;
}

.calendar-table td,
.calendar-table th {
    width: 14.28%;
    height: 44px;
    vertical-align: top;
    font-size: 12px;
    padding: 4px;
}

.calendar-table th {
    vertical-align: middle;
    font-weight: 600;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.75);
}

.day {
    border-right: 1px solid rgba(24, 21, 17, 0.06);
    border-bottom: 1px solid rgba(24, 21, 17, 0.06);
    min-width: 0;
}

.day:hover {
    filter: brightness(1.05);
}

.day-square {
    aspect-ratio: 1 / 1;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    transition: background-color 0.3s ease;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.day-muted {
    color: rgba(24, 21, 17, 0.35);
}

.day-number {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
}

.book-title {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    opacity: 0.9;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: auto;
    text-align: center;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    transform: translateY(-50%);
    box-sizing: border-box;
}

.book-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.25;
}

.book-title a + a {
    margin-top: 1rem;
}

.book-title a:hover {
    color: var(--accent-dark);
}

.book-title .more-count {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.muted {
    color: var(--muted);
}

@media (max-width: 960px) {
    .dashboard-main {
        grid-template-columns: 1fr;
    }

    .message-card {
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    body {
        padding-top: 4.8rem;
    }

    .reading-dashboard {
        padding: 2rem 1.25rem 3rem;
    }
}

/* Homestead-inspired reading interface */
:root {
    --ink: #17211c;
    --muted: #68736d;
    --cream: #f7f5ef;
    --sand: #e7e5dc;
    --accent: #4f8a50;
    --accent-dark: #356b3b;
    --surface: #fff;
    --line: #d8ddd7;
    --shadow: 0 16px 36px rgba(38, 48, 41, 0.07);
}

body {
    display: flex;
    flex-direction: column;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    background: #f8f6f1;
    min-height: 100vh;
    padding-top: 7.25rem;
}

body::before {
    content: "";
    position: fixed;
    z-index: 1029;
    inset: 0 0 auto;
    height: 6.5rem;
    background: #f8f6f1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "DM Sans", "Segoe UI", sans-serif;
    letter-spacing: -0.035em;
}

body h1:not(.modal-title) {
    font-size: clamp(2.5rem, 5vw, 3.5rem) !important;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.navbar {
    top: 1rem;
    width: min(1120px, calc(100% - 2rem));
    min-height: 4.5rem;
    margin: 0 auto;
    padding: 0.65rem 0.8rem;
    background: rgba(248, 246, 241, 0.94);
    border: 1px solid rgba(58, 70, 61, 0.13);
    border-radius: 15px;
    box-shadow: 0 8px 28px rgba(38, 48, 41, 0.07);
    backdrop-filter: blur(14px);
}

.navbar .container-fluid {
    padding: 0;
    gap: 1rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: 1.2rem;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.navbar-nav {
    gap: 0.35rem;
}

.navbar .nav-link {
    padding: 0.55rem 0.78rem !important;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: #edf5e9;
    border-color: #bdd2b9;
    color: var(--accent-dark);
    text-decoration: none;
}

.navbar .form-control,
.navbar .btn {
    min-height: 2.45rem;
    border-color: var(--line);
    font-size: 0.85rem;
}

.navbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.navbar .form-control {
    width: 9rem;
    background: rgba(255,255,255,.78);
}

.dropdown-menu {
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.dropdown-item {
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #edf5e9;
    color: var(--accent-dark);
}

.site-footer {
    width: min(1120px, calc(100% - 2rem));
    margin: auto auto 0;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.reading-dashboard {
    width: min(1120px, calc(100% - 2rem));
    padding: 1.75rem 0 5rem;
}

.reading-dashboard > h1 {
    margin-top: 0 !important;
    margin-bottom: 2.25rem !important;
}

.page-heading {
    margin-bottom: 2.25rem;
}

.page-heading h1 {
    margin: 0 !important;
}

.page-heading .subtitle {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.reading-dashboard > .dashboard-header,
.reading-dashboard > header.dashboard-header {
    margin-top: 0;
    margin-bottom: 2.25rem;
}

body > .container {
    padding-top: 1.75rem !important;
}

.dashboard-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.dashboard-eyebrow,
.card-kicker {
    margin: 0 0 0.35rem;
    color: #8c6647;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.dashboard-header h1 {
    margin: 0;
}

.dashboard-header .subtitle {
    max-width: 28rem;
    margin: 0 0 0.3rem;
    text-align: right;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.dashboard-card,
.card,
.stat-box {
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.dashboard-card {
    padding: 1.4rem;
}

.dashboard-card h2 {
    margin: 0 0 1rem;
    font-size: 1.08rem;
    font-weight: 800;
}

.overview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 92px;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.6rem;
    background: linear-gradient(105deg, #f0f7ec 0%, #fffaf0 55%, #eef8fa 100%);
    border-color: #cfdfd3;
}

.overview-banner h2 {
    margin: 0;
    font-size: 1rem;
}

.status-pill {
    flex: none;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: #e7f3e4;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    min-height: 130px;
    padding: 1.15rem;
    border: 1px solid;
    border-radius: 9px;
    box-shadow: var(--shadow);
}

.summary-card:nth-child(1) { background: #fff9e9; border-color: #eadbb0; }
.summary-card:nth-child(2) { background: #f0f7e9; border-color: #d4e2c8; }
.summary-card:nth-child(3) { background: #faf1e9; border-color: #e5d8cc; }
.summary-card:nth-child(4) { background: #eaf6f5; border-color: #c9e0de; }

.summary-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.summary-value {
    margin: 0.5rem 0 0.2rem;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.summary-note {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.dashboard-main { gap: 1.15rem; }
.dashboard-column { gap: 1.15rem; }

.item-row {
    background: #f6f7f2;
    border: 1px solid #e3e6df;
    border-radius: 8px;
}

.item-cover { border-radius: 5px; }
.progress.dashboard-progress { background: #dfe6dc; }
.progress.dashboard-progress .progress-bar { background: var(--accent); }
.message-card { background: #f3f8ef; }

@media (max-width: 991px) {
    body { padding-top: 6.5rem; }
    body::before { height: 5.85rem; }
    .navbar { top: 0.65rem; }
    .navbar-collapse { padding-top: 0.8rem; }
    .navbar .d-flex.align-items-center { align-items: stretch !important; flex-direction: column; gap: 0.5rem; }
    .navbar .form-control { width: 100%; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .reading-dashboard { width: min(100% - 1.25rem, 1120px); padding-top: 1.25rem; }
    .dashboard-header { align-items: start; flex-direction: column; gap: 0.75rem; }
    .dashboard-header .subtitle { text-align: left; }
    .summary-grid { grid-template-columns: 1fr; }
    .overview-banner { align-items: start; flex-direction: column; }
    .item-date { display: none; }
}
