.stats-page {
    --stats-ink: #17324d;
    --stats-deep: #11100d;
    --stats-gold: #c18b2e;
    --stats-gold-dark: #8a5b16;
    --stats-blue: #24577f;
    --stats-muted: #687887;
    --stats-line: #ddd3bf;
    --stats-panel: #ffffff;
    --stats-panel-alt: #f7f9fb;
    display: grid;
    gap: 22px;
    padding-bottom: 34px;
}

.stats-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 150px;
    overflow: hidden;
    padding: 30px 34px;
    border: 1px solid #302a20;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 89% 48%,
            rgba(193, 139, 46, 0.22),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            #171511,
            #29251e
        );
    color: #fff;
    box-shadow: 0 14px 34px rgba(45, 37, 24, 0.15);
}

.stats-hero-copy,
.stats-hero-actions,
.stats-hero-icon {
    position: relative;
    z-index: 1;
}

.stats-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.stats-eyebrow {
    margin: 0;
    color: var(--stats-gold);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.stats-hero h1 {
    margin: 7px 0 10px;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.stats-hero-intro {
    max-width: 730px;
    margin: 0;
    color: #ddd7cc;
    line-height: 1.5;
}

.stats-hero-actions {
    flex: 0 0 auto;
}

.stats-refresh-button {
    min-width: 92px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.stats-refresh-button:hover {
    border-color: rgba(255, 255, 255, 0.46);
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.stats-hero-icon {
    display: grid;
    flex: 0 0 110px;
    place-items: center;
    opacity: 0.22;
    font-size: clamp(3.7rem, 8vw, 6.3rem);
    pointer-events: none;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px 19px;
    border: 1px solid #dbe3e9;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(24, 49, 72, 0.07);
}

.summary-icon {
    display: grid;
    flex: 0 0 47px;
    width: 47px;
    height: 47px;
    place-items: center;
    border-radius: 12px;
    background: #f5ecd9;
    font-size: 1.35rem;
}

.summary-card div {
    min-width: 0;
}

.summary-card strong,
.summary-card span {
    display: block;
}

.summary-card strong {
    color: var(--stats-blue);
    font-size: 1.7rem;
    line-height: 1;
}

.summary-card div > span {
    margin-top: 6px;
    color: var(--stats-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-progress-copy {
    width: 100%;
}

.summary-progress-track {
    height: 6px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef2;
}

.summary-progress-track span {
    height: 100%;
    margin: 0;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #c18b2e,
            #e4bb61
        );
}

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

.stats-insight-card {
    padding: 19px;
    border: 1px solid var(--stats-line);
    border-radius: 15px;
    background:
        linear-gradient(
            145deg,
            #fff,
            #fdfbf7
        );
    box-shadow: 0 5px 17px rgba(60, 47, 26, 0.05);
}

.stats-insight-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-insight-heading > span {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    background: #f3ead7;
    font-size: 1.2rem;
}

.stats-insight-heading small {
    display: block;
    color: var(--stats-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stats-insight-heading h2 {
    margin: 4px 0 0;
    color: var(--stats-ink);
    font-size: 1.6rem;
}

.stats-insight-total {
    color: #7b8791;
    font-size: 0.92rem;
    font-weight: 700;
}

.stats-insight-card p {
    margin: 14px 0 0;
    color: var(--stats-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.stats-reports {
    display: grid;
    gap: 14px;
}

.stats-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 6px 2px;
}

.stats-section-heading h2 {
    margin: 5px 0 0;
    color: var(--stats-ink);
    font-size: clamp(1.5rem, 2.7vw, 2rem);
}

.stats-section-heading > p {
    max-width: 520px;
    margin: 0;
    color: var(--stats-muted);
    text-align: right;
    line-height: 1.45;
}

.stats-report {
    overflow: hidden;
    border: 1px solid var(--stats-line);
    border-radius: 15px;
    background: var(--stats-panel);
    box-shadow: 0 6px 20px rgba(58, 44, 24, 0.055);
}

.stats-report > summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 17px 19px;
    background:
        linear-gradient(
            180deg,
            #fffdf8,
            #faf4e7
        );
    cursor: pointer;
    list-style: none;
}

.stats-report > summary::-webkit-details-marker {
    display: none;
}

.report-summary-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    background: #f1e6cf;
    font-size: 1.2rem;
}

.report-summary-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.report-summary-copy strong {
    color: var(--stats-ink);
    font-size: 1rem;
}

.report-summary-copy small {
    overflow: hidden;
    color: var(--stats-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-summary-action {
    color: var(--stats-gold-dark);
    font-size: 0.78rem;
    font-weight: 900;
}

.stats-report[open] .report-summary-action {
    font-size: 0;
}

.stats-report[open] .report-summary-action::after {
    content: "Close Report";
    font-size: 0.78rem;
}

.report-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--stats-line);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9e3d8;
    text-align: left;
    vertical-align: middle;
}

.stats-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f2e9;
    color: #73531c;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stats-table tbody tr {
    transition: background 0.12s ease;
}

.stats-table tbody tr:hover {
    background: #fffaf0;
}

.stats-table tbody tr:last-child td {
    border-bottom: 0;
}

.stats-reference-link {
    color: var(--stats-blue);
    font-weight: 800;
    text-decoration: none;
}

.stats-reference-link:hover {
    text-decoration: underline;
}

.stats-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #d7c59d;
    border-radius: 999px;
    background: #fff8e8;
    color: #795318;
    font-size: 0.78rem;
    font-weight: 900;
}

.coverage-cell {
    min-width: 180px;
}

.coverage-value-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
    color: var(--stats-blue);
    font-size: 0.78rem;
    font-weight: 900;
}

.coverage-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf1;
}

.coverage-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #23608e,
            #5d9dca
        );
}

@media (max-width: 1050px) {
    .stats-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .stats-hero {
        padding: 25px 22px;
    }

    .stats-hero-actions {
        align-self: flex-start;
    }

    .stats-hero-icon {
        position: absolute;
        right: 20px;
        opacity: 0.12;
    }

    .stats-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-section-heading > p {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 600px) {
    .stats-summary,
    .stats-insight-grid {
        grid-template-columns: 1fr;
    }

    .stats-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-refresh-button {
        width: 100%;
    }

    .stats-report > summary {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .report-summary-action {
        grid-column: 2;
    }

    .report-summary-copy small {
        white-space: normal;
    }
}


/* =========================================================
   Private Reading Progress integrated into Statistics
   ========================================================= */
.reading-progress-section {
    scroll-margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--stats-line);
    border-radius: 18px;
    background: var(--stats-panel);
    box-shadow: 0 7px 24px rgba(58, 44, 24, 0.07);
}

.reading-progress-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.reading-progress-heading h2 {
    margin: 5px 0 8px;
    color: var(--stats-ink);
    font-size: clamp(1.55rem, 2.8vw, 2.05rem);
}

.reading-progress-heading p:last-child {
    max-width: 690px;
    margin: 0;
    color: var(--stats-muted);
    line-height: 1.5;
}

.reading-overall {
    flex: 0 0 auto;
    display: grid;
    justify-items: end;
}

.reading-overall strong {
    color: var(--stats-blue);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
}

.reading-overall span {
    margin-top: 5px;
    color: var(--stats-muted);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.reading-overall-track,
.reading-book-track {
    display: block;
    overflow: hidden;
    border-radius: 999px;
    background: #e9e2d3;
}

.reading-overall-track {
    height: 13px;
    margin: 20px 0 12px;
    border: 1px solid #d7c8aa;
}

.reading-overall-track > span,
.reading-book-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #23608e, #5d9dca);
}

.reading-overall-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    color: var(--stats-muted);
    font-size: .86rem;
}

.reading-overall-counts strong {
    color: var(--stats-ink);
}

.reading-workspace {
    display: grid;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    gap: 20px;
    margin-top: 22px;
}

.reading-books,
.reading-chapters {
    min-width: 0;
    border: 1px solid var(--stats-line);
    border-radius: 15px;
    background: #fffdf8;
}

.reading-books {
    max-height: 650px;
    overflow-y: auto;
}

.reading-books h3 {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding: 15px 16px;
    border-bottom: 1px solid var(--stats-line);
    background: #f8f2e6;
    color: var(--stats-ink);
}

.reading-book-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #eee7da;
    color: var(--stats-ink);
    text-decoration: none;
}

.reading-book-row:last-child { border-bottom: 0; }
.reading-book-row:hover { background: #fff8e9; }
.reading-book-row.selected {
    background: #edf5fb;
    box-shadow: inset 4px 0 0 #23608e;
}

.reading-book-name { font-weight: 900; }
.reading-book-percent { color: var(--stats-blue); font-weight: 900; }
.reading-book-row small {
    grid-column: 1 / -1;
    color: var(--stats-muted);
    font-size: .75rem;
}

.reading-book-track {
    grid-column: 1 / -1;
    height: 5px;
    margin-top: 4px;
}

.reading-chapters { padding: 18px; }
.reading-chapter-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.reading-chapter-heading h3 { margin: 4px 0 0; color: var(--stats-ink); font-size: 1.45rem; }
.reading-chapter-heading > span { color: var(--stats-muted); font-size: .82rem; font-weight: 800; }

.reading-chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.reading-chapter-grid form { margin: 0; }
.reading-chapter-button {
    width: 100%;
    min-height: 52px;
    border: 1px solid #c9c0ae;
    border-radius: 11px;
    background: #f4f1ea;
    color: #4f4a40;
    font: inherit;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
}

.reading-chapter-button:hover { background: #e9eef2; border-color: #8da6b9; }
.reading-chapter-button.complete {
    border-color: #2f7650;
    background: #e6f4ea;
    color: #205f3d;
}

.reading-chapter-button span {
    display: inline-grid;
    width: 19px;
    height: 19px;
    margin-right: 3px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .7rem;
}

.reading-empty-state {
    display: grid;
    min-height: 300px;
    place-items: center;
    align-content: center;
    padding: 30px;
    color: var(--stats-muted);
    text-align: center;
}
.reading-empty-state > span { font-size: 2.4rem; }
.reading-empty-state h3 { margin: 10px 0 4px; color: var(--stats-ink); }
.reading-empty-state p { margin: 0; }

@media (max-width: 850px) {
    .reading-workspace { grid-template-columns: 1fr; }
    .reading-books { max-height: 420px; }
}

@media (max-width: 600px) {
    .reading-progress-section { padding: 18px; }
    .reading-progress-heading { flex-direction: column; }
    .reading-overall { justify-items: start; }
    .reading-chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Hover and keyboard-focus explanations for dashboard statistic tiles */
.stats-help-card {
    position: relative;
    cursor: help;
}

.stats-help-card::before,
.stats-help-card::after {
    position: absolute;
    left: 50%;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.14s ease,
        transform 0.14s ease;
}

.stats-help-card::before {
    content: "";
    top: calc(100% + 5px);
    width: 0;
    height: 0;
    border-right: 7px solid transparent;
    border-bottom: 8px solid #20262d;
    border-left: 7px solid transparent;
    transform: translate(-50%, -4px);
}

.stats-help-card::after {
    content: attr(data-tooltip);
    top: calc(100% + 13px);
    width: min(330px, calc(100vw - 38px));
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: #20262d;
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    white-space: normal;
    transform: translate(-50%, -4px);
}

.stats-help-card:hover::before,
.stats-help-card:hover::after,
.stats-help-card:focus-visible::before,
.stats-help-card:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.stats-help-card:focus-visible {
    outline: 3px solid rgba(36, 87, 127, 0.28);
    outline-offset: 3px;
}

/* Keep tooltips inside the screen at the outer edges of wide grids. */
.stats-summary .stats-help-card:first-child::after,
.stats-insight-grid .stats-help-card:first-child::after {
    left: 0;
    transform: translate(0, -4px);
}

.stats-summary .stats-help-card:first-child::before,
.stats-insight-grid .stats-help-card:first-child::before {
    left: 24px;
}

.stats-summary .stats-help-card:first-child:hover::after,
.stats-summary .stats-help-card:first-child:focus-visible::after,
.stats-insight-grid .stats-help-card:first-child:hover::after,
.stats-insight-grid .stats-help-card:first-child:focus-visible::after {
    transform: translate(0, 0);
}

.stats-summary .stats-help-card:last-child::after,
.stats-insight-grid .stats-help-card:last-child::after {
    right: 0;
    left: auto;
    transform: translate(0, -4px);
}

.stats-summary .stats-help-card:last-child::before,
.stats-insight-grid .stats-help-card:last-child::before {
    right: 24px;
    left: auto;
}

.stats-summary .stats-help-card:last-child:hover::after,
.stats-summary .stats-help-card:last-child:focus-visible::after,
.stats-insight-grid .stats-help-card:last-child:hover::after,
.stats-insight-grid .stats-help-card:last-child:focus-visible::after {
    transform: translate(0, 0);
}

@media (max-width: 700px) {
    .stats-help-card::after {
        width: min(300px, calc(100vw - 32px));
    }
}



/* =========================================================
   Personal project Study Progress board
   ========================================================= */
.study-hours-summary {
    border-color: #b9a16b;
    background: linear-gradient(145deg, #fffaf0, #f5ead0);
}

.study-progress-section {
    scroll-margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--stats-line);
    border-radius: 18px;
    background: var(--stats-panel);
    box-shadow: 0 7px 24px rgba(58, 44, 24, 0.07);
}

.study-progress-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.study-progress-heading h2 {
    margin: 5px 0 8px;
    color: var(--stats-ink);
    font-size: clamp(1.55rem, 2.8vw, 2.05rem);
}

.study-progress-heading p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--stats-muted);
    line-height: 1.5;
}

.study-progress-total {
    flex: 0 0 auto;
    display: grid;
    justify-items: end;
}

.study-progress-total strong {
    color: var(--stats-gold-dark);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
}

.study-progress-total span {
    margin-top: 5px;
    color: var(--stats-muted);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.study-progress-messages {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.study-progress-message {
    padding: 11px 14px;
    border-radius: 10px;
    font-weight: 800;
}

.study-progress-message.success {
    border: 1px solid #9dceb0;
    background: #e9f7ee;
    color: #22633c;
}

.study-progress-message.error {
    border: 1px solid #e6aaaa;
    background: #fff0f0;
    color: #9a2525;
}

.study-add-task {
    margin-top: 20px;
    border: 1px solid #d5c39a;
    border-radius: 13px;
    background: #fffaf0;
}

.study-add-task summary {
    padding: 14px 16px;
    color: var(--stats-gold-dark);
    font-weight: 900;
    cursor: pointer;
}

.study-add-task form {
    display: grid;
    grid-template-columns: minmax(230px, 1.2fr) minmax(260px, 1.8fr) 180px auto;
    gap: 12px;
    padding: 0 16px 16px;
    align-items: end;
}

.study-add-task label,
.study-task-controls label {
    display: grid;
    gap: 6px;
    color: var(--stats-muted);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.study-add-task input,
.study-add-task textarea,
.study-add-task select,
.study-task-card input,
.study-task-card textarea,
.study-task-card select {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #cfc3ad;
    border-radius: 9px;
    background: #fff;
    color: var(--stats-ink);
    font: inherit;
}

.study-add-task input,
.study-add-task select,
.study-task-card input,
.study-task-card select {
    min-height: 41px;
    padding: 8px 10px;
}

.study-add-task textarea,
.study-task-card textarea {
    resize: vertical;
    padding: 9px 10px;
}

.study-add-task button,
.study-save-button {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #80581c, #bd872c);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.study-kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.study-kanban-column {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--stats-line);
    border-radius: 15px;
    background: #f8f5ed;
}

.study-kanban-column > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 13px;
}

.study-kanban-column > header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.study-kanban-column h3 {
    margin: 0;
    color: var(--stats-ink);
    font-size: 1rem;
}

.study-kanban-column > header > strong {
    display: grid;
    min-width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 50%;
    background: #e7dfcf;
    color: var(--stats-ink);
}

.status-not_started { border-top: 5px solid #7e8790; }
.status-in_progress { border-top: 5px solid #c18b2e; }
.status-complete { border-top: 5px solid #39815a; }

.study-task-list {
    display: grid;
    gap: 11px;
}

.study-task-card {
    position: relative;
    padding: 12px;
    border: 1px solid #ded5c4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(50, 40, 24, .06);
}

.study-task-card form:first-child {
    display: grid;
    gap: 9px;
}

.study-task-title input {
    border: 0;
    padding: 2px 0;
    color: var(--stats-ink);
    font-size: 1rem;
    font-weight: 900;
}

.study-task-description textarea {
    min-height: 66px;
    border-color: #e2dbcf;
    background: #fbfaf7;
    color: #5d6974;
    font-size: .86rem;
}

.study-task-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px;
    gap: 9px;
}

.study-save-button {
    width: 100%;
}

.study-delete-form {
    margin-top: 7px;
    text-align: right;
}

.study-delete-form button {
    border: 0;
    background: transparent;
    color: #9a3535;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
}

.study-column-empty {
    padding: 22px 12px;
    border: 1px dashed #cfc3ad;
    border-radius: 10px;
    color: var(--stats-muted);
    text-align: center;
}

.nav-study-progress {
    font-weight: 800;
}

@media (max-width: 1000px) {
    .study-add-task form {
        grid-template-columns: 1fr 1fr;
    }

    .study-kanban {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .study-progress-section {
        padding: 18px;
    }

    .study-progress-heading {
        flex-direction: column;
    }

    .study-progress-total {
        justify-items: start;
    }

    .study-add-task form {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Study Progress route and collapsed trackers
   ========================================================= */
.study-projected-summary {
    border-color: #9db8cf;
    background: linear-gradient(145deg, #f4f9fd, #e4eff8);
}

.collapsible-progress-section {
    padding: 0;
    overflow: hidden;
}

.progress-section-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    list-style: none;
    cursor: pointer;
}

.progress-section-summary::-webkit-details-marker {
    display: none;
}

.progress-section-summary::after {
    content: "＋";
    flex: 0 0 auto;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #efe6d4;
    color: var(--stats-gold-dark);
    font-size: 1.25rem;
    font-weight: 900;
}

.collapsible-progress-section[open] > .progress-section-summary::after {
    content: "−";
}

.progress-section-summary h2 {
    margin: 5px 0 8px;
    color: var(--stats-ink);
    font-size: clamp(1.55rem, 2.8vw, 2.05rem);
}

.progress-section-summary p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--stats-muted);
    line-height: 1.5;
}

.progress-section-body {
    padding: 0 24px 24px;
    border-top: 1px solid var(--stats-line);
}

.reading-heading-inside {
    padding-top: 20px;
}

.study-progress-summary-totals {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    margin-left: auto;
}

.study-progress-summary-totals span {
    display: grid;
    min-width: 100px;
    padding: 9px 12px;
    border: 1px solid #d6c59f;
    border-radius: 11px;
    background: #fffaf0;
    color: var(--stats-muted);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
}

.study-progress-summary-totals strong {
    color: var(--stats-gold-dark);
    font-size: 1.25rem;
    line-height: 1.1;
}

.study-column-hours {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}

.study-column-hours span {
    display: grid;
    gap: 2px;
    padding: 7px 4px;
    border-radius: 8px;
    background: #eee8dc;
    color: var(--stats-muted);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .03em;
    text-align: center;
    text-transform: uppercase;
}

.study-column-hours strong {
    color: var(--stats-ink);
    font-size: .84rem;
}

.study-task-controls {
    grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(78px, .75fr));
}

.study-task-projected {
    padding: 8px 10px;
    border-radius: 8px;
    background: #f5efe2;
    color: var(--stats-muted);
    font-size: .76rem;
    text-align: right;
}

.study-task-projected strong {
    color: var(--stats-gold-dark);
}

.study-add-task form {
    grid-template-columns:
        minmax(210px, 1.2fr)
        minmax(230px, 1.5fr)
        120px
        120px
        165px
        auto;
}

@media (max-width: 1100px) {
    .study-add-task form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .progress-section-summary {
        flex-direction: column;
    }

    .progress-section-summary::after {
        position: absolute;
        right: 18px;
    }

    .study-progress-summary-totals {
        width: 100%;
        margin-left: 0;
    }

    .study-progress-summary-totals span {
        flex: 1;
    }

    .study-task-controls {
        grid-template-columns: 1fr;
    }

    .study-add-task form {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   To-Do List card appearance
   ========================================================= */
#study-project-progress.study-progress-section {
    border: 1px solid var(--stats-line);
    background: var(--stats-panel);
    box-shadow: 0 7px 24px rgba(58, 44, 24, 0.07);
}

#study-project-progress > .progress-section-summary {
    background: var(--stats-panel);
}

#study-project-progress[open] > .progress-section-summary {
    border-bottom: 1px solid var(--stats-line);
}

#study-project-progress > .progress-section-body {
    background: var(--stats-panel);
    border-top: 0;
}

#study-project-progress .study-kanban-column {
    background: var(--stats-panel-alt);
}

#study-project-progress .study-task-card {
    background: var(--stats-panel);
}

/* ==========================================================================
   v22 - Keep To-Do tracker visually consistent with the white/tan cards
   ========================================================================== */
#study-project-progress.study-progress-section,
#study-project-progress > .progress-section-summary,
#study-project-progress > .progress-section-body {
    background: var(--stats-panel) !important;
}

#study-project-progress.study-progress-section {
    border-color: var(--stats-line);
}


/* ==========================================================================
   v23 - Force To-Do List to match the white Reading Progress card
   ========================================================================== */
#study-project-progress.study-progress-section,
#study-project-progress > .progress-section-summary,
#study-project-progress > .progress-section-body,
#study-project-progress[open] > .progress-section-summary {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

#study-project-progress.study-progress-section {
    border: 1px solid #d8e0e8 !important;
    box-shadow: 0 7px 24px rgba(58, 44, 24, 0.07) !important;
}
