:root {
    color-scheme: light;
    --paper: #fbf8f2;
    --ink: #201b18;
    --muted: #786e66;
    --line: #ded4c7;
    --accent: #bd3b2d;
    --soft: #f2eadf;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.library-shell { width: min(1120px, calc(100% - 32px)); margin: auto; padding: 28px 0 64px; }
.library-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 12px 0 38px; border-bottom: 1px solid var(--line); }
.library-brand { color: var(--ink); font-weight: 800; text-decoration: none; }
.library-header p { margin: 0; color: var(--muted); }
.library-section { padding: 38px 0; border-bottom: 1px solid var(--line); }
.section-heading span { color: var(--accent); font-weight: 800; letter-spacing: .06em; }
.section-heading h1, .section-heading h2 { margin: .35rem 0 .45rem; font: 700 clamp(2rem, 4vw, 3.5rem)/1.08 Georgia, "Noto Serif SC", serif; }
.section-heading p { color: var(--muted); margin: 0; }
.section-heading.compact h2 { font-size: 1.5rem; }

.today-card { margin-top: 22px; padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 28px; background: #fff; display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.today-card h2 { font: 700 clamp(2rem, 5vw, 4.4rem)/1.05 Georgia, "Noto Serif SC", serif; margin: 18px 0 8px; }
.today-card p { color: var(--muted); max-width: 650px; }
.today-card p[lang="es"] { font: 1.1rem Georgia, serif; color: var(--ink); }
.today-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.today-actions a, .article-card > a, .continue-card > a { border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.today-actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.article-card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.article-card-meta span { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); }
.article-status { color: var(--accent) !important; border-color: #e6b6af !important; }
.level-group { margin-top: 34px; }
.level-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.level-heading h3 { font-size: 1.5rem; margin: 0; }
.level-heading span { color: var(--muted); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.article-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; min-height: 285px; }
.article-card h3 { font: 700 1.5rem Georgia, "Noto Serif SC", serif; margin: 18px 0 4px; }
.article-card p { color: var(--muted); margin: .35rem 0; }
.article-card p[lang="es"] { color: var(--ink); font-family: Georgia, serif; }
.article-card > a { margin-top: auto; align-self: flex-start; }

.continue-card { margin-top: 16px; background: var(--soft); border-radius: 18px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.continue-card div { display: flex; flex-direction: column; gap: 5px; }
.continue-card span { color: var(--muted); font-size: .9rem; }
.empty-state { padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.library-message { color: var(--accent); }

@media (max-width: 800px) {
    .article-grid { grid-template-columns: 1fr 1fr; }
    .today-card { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
    .library-shell { width: min(100% - 22px, 1120px); padding-top: 15px; }
    .library-header { align-items: flex-start; flex-direction: column; padding-bottom: 24px; }
    .library-section { padding: 28px 0; }
    .article-grid { grid-template-columns: 1fr; }
    .today-card { border-radius: 20px; padding: 22px; }
    .today-actions { width: 100%; }
    .today-actions a { flex: 1; text-align: center; }
    .continue-card { align-items: flex-start; gap: 14px; flex-direction: column; }
    .article-card { min-height: 0; }
}

.library-footer{padding:28px 0}.library-footer a{color:var(--muted);font-size:.9rem}.level-empty{color:var(--muted);margin:0}

.library-footer{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.library-footer small{color:var(--muted)}

.beta-badge{display:inline-block;margin-left:8px;padding:2px 7px;border:1px solid #c89d8d;border-radius:99px;color:#a83e2e;font:700 .7rem/1.4 system-ui,sans-serif;vertical-align:middle}
