.icanread-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 56px;
    color: #172033;
}

.icanread-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.icanread-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    background: #e6eefc;
    color: #17346f;
    text-decoration: none;
    font-weight: 600;
}

.icanread-nav .nav-link.active {
    background: #17346f;
    color: #fff;
}

.icanread-page .card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.icanread-page .btn.btn-primary {
    background: #17346f;
    border-color: #17346f;
}

.icanread-page .btn.btn-primary:hover,
.icanread-page .btn.btn-primary:focus {
    background: #122a59;
    border-color: #122a59;
}

.hero-card,
.panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d6e2f5;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(23, 52, 111, 0.08);
}

.hero-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 28px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5170a6;
}

.hero-card h1,
.panel-header h2 {
    margin: 0;
}

.hero-meta {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.hero-meta span,
.panel-header span,
.history-meta span {
    color: #4b5c7f;
    font-size: 14px;
}

.panel {
    padding: 24px;
    margin-bottom: 20px;
}

.progress-panel {
    display: grid;
    gap: 12px;
}

.progress-track {
    height: 52px;
    padding: 6px;
    border-radius: 999px;
    background: #dcdcdc;
    border: 5px solid #b5b5b5;
    overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(180deg, #79db00 0%, #62bd00 52%, #4f9d00 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38);
    transition: width 0.35s ease;
}

.progress-note {
    margin: 0;
    color: #27436f;
    font-weight: 600;
}

.generate-form,
.profile-form,
.field-row,
.actions-row,
.history-cards,
.history-inline,
.vocab-list {
    display: flex;
}

.generate-form,
.profile-form {
    gap: 16px;
    flex-wrap: wrap;
    align-items: end;
}

.field-row {
    flex-direction: column;
    gap: 8px;
}

.field-row.grow {
    flex: 1 1 320px;
}

.field-row label {
    font-weight: 700;
}

.field-row input,
.field-row select {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #b7c8e6;
    border-radius: 12px;
    background: #fff;
}

.checkbox-row {
    justify-content: center;
}

.btn-generate {
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: #17346f;
    color: #fff;
    font-weight: 700;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 16px;
}

.panel-header h2 a {
    color: #17346f;
    text-decoration: none;
}

.panel-header h2 a:hover,
.panel-header h2 a:focus {
    text-decoration: underline;
}

.story-body {
    font-size: 25px;
    line-height: 1.8;
    color: #19253d;
}

.story-image-wrap {
    margin-top: 16px;
}

.story-image-wrap.compact {
    margin-top: 12px;
}

.story-image {
    width: 100%;
    max-width: 420px;
    display: block;
    border-radius: 14px;
    border: 1px solid #d6e2f5;
    box-shadow: 0 10px 24px rgba(23, 52, 111, 0.12);
}

.story-body.compact {
    font-size: 16px;
}

.vocab-list,
.history-inline {
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.vocab-list li,
.history-inline li,
.history-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: #eef4ff;
}

.vocab-list li {
    display: grid;
    gap: 4px;
}

.history-cards {
    flex-direction: column;
    gap: 16px;
}

.history-card .story-image-wrap.compact {
    display: flex;
    justify-content: flex-start;
}

.history-card .story-image {
    width: 200px;
    max-width: 100%;
}

.history-pagination {
    margin-top: 16px;
}

.history-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.history-pagination .pagination a,
.history-pagination .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #c5d4ee;
    background: #f1f6ff;
    color: #17346f;
    text-decoration: none;
    font-weight: 600;
}

.history-pagination .pagination .active span {
    background: #17346f;
    border-color: #17346f;
    color: #ffffff;
}

.history-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.icanread-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(17, 32, 65, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.icanread-loading[hidden] {
    display: none;
}

.icanread-loading-box {
    background: #fff;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(23, 52, 111, 0.18);
    max-width: 320px;
    width: 90%;
}

.icanread-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #d6e2f5;
    border-top-color: #17346f;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: icanread-spin 0.9s linear infinite;
}

@keyframes icanread-spin {
    to { transform: rotate(360deg); }
}

.icanread-loading-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #172033;
}

.icanread-loading-sub {
    margin: 0;
    font-size: 13px;
    color: #5170a6;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-toolbar h2 {
    margin: 0;
}

.calendar-nav-link {
    color: #17346f;
    font-weight: 700;
    text-decoration: none;
}

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

.calendar-grid-head {
    margin-bottom: 14px;
}

.calendar-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #5170a6;
}

.calendar-cell {
    min-height: 112px;
    padding: 14px;
    border-radius: 18px;
    background: #eef4ff;
    border: 1px solid #d6e2f5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-cell.is-empty {
    background: transparent;
    border-style: dashed;
    opacity: 0.35;
}

.calendar-cell.is-read {
    background: linear-gradient(180deg, #effaf4 0%, #daf2e3 100%);
    border-color: #9fd3b1;
}

.calendar-cell.is-today {
    box-shadow: inset 0 0 0 2px #17346f;
}

.calendar-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.calendar-day-number {
    font-size: 22px;
    font-weight: 700;
    color: #172033;
}

.calendar-mark {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #2d8a57;
    box-shadow: 0 0 0 6px rgba(45, 138, 87, 0.12);
}

.calendar-count {
    font-size: 14px;
    font-weight: 600;
    color: #1f5f3c;
}

.calendar-count.muted {
    color: #7b8aa8;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero-card {
        flex-direction: column;
    }

    .panel {
        padding: 18px;
    }

    .story-body {
        font-size: 18px;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-grid {
        gap: 8px;
    }

    .calendar-cell {
        min-height: 88px;
        padding: 10px;
    }
}