:root {
  --brand: #147c68;
  --brand-dark: #0d604f;
  --brand-pale: #e5f3ee;
  --ink: #20312e;
  --muted: #71817c;
  --bg: #f6f8f5;
  --paper: #fff;
  --line: #e1e9e4;
  --danger: #b5473f;
  --shadow: 0 10px 30px rgba(32, 63, 52, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.55; padding-bottom: env(safe-area-inset-bottom); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
#app { width: min(100% - 36px, 1080px); margin: 0 auto; padding-bottom: 54px; }
.top { position: sticky; top: 0; z-index: 10; width: calc(100% + 36px); margin-left: -18px; padding: calc(10px + env(safe-area-inset-top)) 18px 10px; min-height: 68px; display: flex; align-items: center; gap: 22px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid rgba(225, 233, 228, .9); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 760; font-size: 1.12rem; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--brand); font-weight: 800; }
.top-nav { display: flex; gap: 5px; margin-left: auto; }
.top-nav button, .logout-button { border: 0; color: var(--muted); background: transparent; border-radius: 9px; padding: 8px 12px; font-size: .92rem; }
.top-nav button:hover, .top-nav .nav-active { color: var(--brand-dark); background: var(--brand-pale); }
.nav-mobile-label { display: none; }
.profile-button { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: .86rem; }
.profile-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #f3e4c5; color: #76542b; font-weight: 700; }
.logout-button { width: 34px; height: 34px; padding: 0; font-size: 1.1rem; }
.hero { position: relative; overflow: hidden; min-height: 286px; display: flex; align-items: center; margin: 28px 0 22px; padding: 38px 54px; border-radius: 22px; color: white; background: linear-gradient(112deg, #176e5e 0%, #21866c 55%, #65a982 100%); }
.hero-copy { position: relative; z-index: 2; max-width: 630px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: .72rem; letter-spacing: .13em; font-weight: 780; }
.hero .eyebrow { color: #c6e8d8; }
.hero h1 { margin: 0; max-width: 600px; font-size: clamp(2.25rem, 4.7vw, 3.45rem); line-height: 1.04; letter-spacing: -.055em; }
.hero-description { max-width: 490px; margin: 16px 0 23px; color: rgba(255,255,255,.82); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 680; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: white; background: var(--brand); box-shadow: 0 4px 12px rgba(20,124,104,.15); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.light { color: var(--brand-dark); background: white; }
.btn.hero-secondary { border-color: rgba(255,255,255,.3); color: white; background: rgba(255,255,255,.1); }
.btn.hero-secondary:hover { background: rgba(255,255,255,.2); }
.btn.secondary { color: var(--ink); background: #eef3ef; }
.btn.secondary:hover { background: #e2ebe5; }
.btn.danger-outline { color: var(--danger); background: white; border-color: #efcecb; }
.btn.danger-outline:hover { background: #fff5f4; }
.btn.full { width: 100%; }
.hero-art { position: absolute; top: 0; right: 1%; width: 390px; height: 100%; opacity: .9; }
.art-orbit { position: absolute; border: 1px solid rgba(225,255,235,.23); border-radius: 50%; }
.orbit-one { width: 270px; height: 270px; top: 8px; right: 40px; }
.orbit-two { width: 205px; height: 205px; top: 42px; right: 72px; }
.art-book { position: absolute; top: 81px; right: 118px; width: 128px; height: 112px; transform: rotate(-8deg); display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 22px 18px; border-radius: 8px 13px 12px 8px; color: #548c70; background: #fff9e9; box-shadow: 15px 16px 0 rgba(12,73,59,.2); }
.art-book span { position: absolute; top: 10px; left: 15px; font-size: .75rem; font-weight: 850; color: var(--brand); }
.art-book i { display: block; width: 75%; height: 3px; margin-left: 10px; border-radius: 4px; background: #c8d9c8; }
.art-book i:last-child { width: 56%; }
.search-box { position: relative; display: flex; align-items: center; gap: 11px; min-height: 58px; margin: 0 auto 23px; padding: 0 15px; max-width: 740px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 4px 18px rgba(32,63,52,.04); }
.search-icon { color: var(--brand); font-size: 1.8rem; line-height: 1; transform: rotate(-20deg); }
.search-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-input::placeholder { color: #9ba8a2; }
.search-hint { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; color: #87958f; font-size: .75rem; white-space: nowrap; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 0 0 39px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 83px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: var(--brand-pale); font-size: 1.25rem; }
.stat-card strong, .stat-card div span { display: block; }
.stat-card strong { font-size: 1.34rem; line-height: 1.15; }
.stat-card div span { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.content-section { margin: 0 0 39px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.025em; }
.section-description { max-width: 620px; margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.guide-heading { align-items: end; }
.guide-heading .section-description { margin: 0 0 3px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.guide-card { position: relative; display: flex; min-width: 0; min-height: 216px; flex-direction: column; align-items: flex-start; padding: 19px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); text-align: left; background: white; box-shadow: 0 5px 18px rgba(32,63,52,.025); transition: transform .16s, border-color .16s, box-shadow .16s; }
.guide-card:hover, .guide-card:focus-visible { transform: translateY(-3px); border-color: #acd1c2; box-shadow: var(--shadow); outline: none; }
.guide-number { position: absolute; top: 17px; right: 17px; color: #a0afa7; font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.guide-card-icon { display: grid; width: 43px; height: 43px; margin-bottom: 15px; place-items: center; border-radius: 13px; color: var(--brand-dark); background: var(--brand-pale); font-size: 1.25rem; font-weight: 750; }
.guide-card strong { margin-bottom: 5px; font-size: 1.02rem; }
.guide-card > span:not(.guide-number):not(.guide-card-icon):not(.guide-link) { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.guide-link { margin-top: auto; padding-top: 14px; color: var(--brand-dark); font-size: .83rem; font-weight: 750; }
.getting-started { margin-bottom: 39px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.tool-card { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-align: left; background: white; transition: transform .16s, border-color .16s, box-shadow .16s; }
.tool-card:hover, .tool-card:focus-visible { transform: translateY(-2px); border-color: #acd1c2; box-shadow: var(--shadow); outline: none; }
.tool-icon { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--brand-dark); background: var(--brand-pale); font-size: 1rem; font-weight: 800; }
.cards-tool .tool-icon { color: #735e31; background: #f7f0dc; }
.tool-card > span:nth-child(2) { display: block; flex: 1; min-width: 0; }
.tool-card strong, .tool-card small { display: block; }
.tool-card strong { font-size: .98rem; }
.tool-card small { margin-top: 3px; color: var(--muted); font-size: .81rem; line-height: 1.4; }
.tool-arrow { color: var(--brand); font-size: 1.25rem; }
.home-exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.home-exam-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); text-align: left; background: white; transition: border-color .15s, transform .15s, box-shadow .15s; }
.home-exam-card:hover, .home-exam-card:focus-visible { transform: translateY(-2px); border-color: #acd1c2; box-shadow: var(--shadow); outline: none; }
.home-exam-meta { color: var(--muted); font-size: .76rem; }
.home-exam-card > strong { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.home-exam-countdown { color: var(--brand-dark); font-size: clamp(1.25rem, 3vw, 1.8rem); font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.home-exam-link { margin-top: 4px; color: var(--brand); font-size: .8rem; font-weight: 700; }
.home-exam-empty { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border: 1px dashed #b8d4c7; border-radius: 13px; background: #fbfdfa; }
.home-exam-empty p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.calendar-layout { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(0, 1.15fr); align-items: start; gap: 17px; }
.month-calendar, .selected-day-events { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.month-calendar-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.month-calendar-heading .calendar-month-label { margin: 0; text-align: center; font-size: 1.1rem; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekday { display: grid; min-height: 28px; place-items: center; color: var(--muted); font-size: .75rem; font-weight: 750; }
.calendar-blank { min-height: 42px; }
.calendar-day { position: relative; display: grid; min-width: 0; min-height: 42px; place-items: center; padding: 4px; border: 1px solid transparent; border-radius: 10px; color: var(--ink); background: #f8faf8; }
.calendar-day:hover { border-color: #b9d8ca; background: #eff7f2; }
.calendar-day.is-today { border-color: #9fcab5; color: var(--brand-dark); font-weight: 800; }
.calendar-day.is-selected { color: white; background: var(--brand); }
.calendar-day.is-selected.is-today { border-color: var(--brand); }
.calendar-day-number { line-height: 1.1; }
.calendar-day-events { display: flex; min-height: 5px; gap: 3px; margin-top: 3px; }
.calendar-day-events i, .calendar-legend i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #d9993f; }
.calendar-day.is-selected .calendar-day-events i { background: #fff; }
.calendar-legend { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--muted); font-size: .77rem; }
.selected-day-events > .section-heading { align-items: center; margin: 0 0 10px; }
.selected-calendar-date { margin: 0; font-size: 1.08rem; text-transform: capitalize; }
.calendar-day-empty { min-height: 160px; padding: 18px; }
.study-timer-card { max-width: 740px; margin: 4px 0 23px; padding: 20px; border: 1px solid #cfe1d6; border-radius: 17px; background: linear-gradient(145deg, #fff 20%, #f1f8f3); box-shadow: 0 8px 26px rgba(32,63,52,.045); }
.study-timer-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.study-timer-heading h2 { margin: 0; font-size: 1.18rem; }
.study-timer-display { display: block; margin: 14px 0; color: var(--brand-dark); text-align: center; font-size: clamp(2.7rem, 9vw, 4rem); font-variant-numeric: tabular-nums; letter-spacing: .055em; line-height: 1.15; }
.study-timer-display.timer-finished { color: var(--danger); }
.timer-mode-buttons { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: #eaf1ec; }
.timer-mode-button { padding: 7px 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: .83rem; font-weight: 700; }
.timer-mode-button.active { color: var(--brand-dark); background: white; box-shadow: 0 1px 4px rgba(32,63,52,.08); }
.timer-duration { display: flex; max-width: 230px; flex-direction: column; gap: 5px; margin: 0 auto 12px; color: var(--muted); font-size: .8rem; }
.timer-duration[hidden] { display: none; }
.timer-duration input, .study-timer-plan { min-height: 42px; padding: 9px 11px; border: 1px solid #cbd8d1; border-radius: 9px; background: white; }
.study-timer-plan { display: block; width: 100%; margin: 0 auto 12px; }
.study-timer-description { margin: 0 auto 13px; color: var(--muted); text-align: center; font-size: .84rem; }
.study-timer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.study-timer-actions .btn { min-width: 130px; }
.timer-plan-nudge { max-width: 740px; margin: -13px 0 20px; color: var(--muted); font-size: .82rem; }
.library-concept { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.library-concept > div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.library-concept strong { display: block; margin-bottom: 3px; color: var(--brand-dark); }
.library-concept p { margin: 0; color: var(--muted); font-size: .84rem; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: var(--brand-dark); font-size: .88rem; font-weight: 700; white-space: nowrap; }
.subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.subject-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px 14px; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: white; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.subject-card:hover { transform: translateY(-2px); border-color: #b7d8cb; box-shadow: var(--shadow); }
.subject-icon { flex: 0 0 42px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand-dark); background: #e7f2eb; font-size: 1.1rem; font-weight: 750; }
.subject-card:nth-child(3n + 2) .subject-icon { color: #756133; background: #f7f0dc; }
.subject-card:nth-child(3n) .subject-icon { color: #71527c; background: #f1e9f5; }
.subject-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.subject-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.subject-copy small { margin-top: 3px; color: var(--muted); font-size: .79rem; }
.subject-arrow { color: #91a29a; font-size: 1.1rem; }
.welcome-empty { display: flex; align-items: center; gap: 14px; padding: 19px; border: 1px dashed #bdd4c8; border-radius: 13px; background: #fbfdfa; }
.welcome-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; color: var(--brand); background: var(--brand-pale); font-size: 1.4rem; }
.welcome-empty strong { display: block; }
.welcome-empty p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.welcome-empty .btn { margin-left: auto; white-space: nowrap; }
.all-subjects { margin-top: 12px; }
.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.article-card { min-width: 0; padding: 17px 18px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.article-card:hover, .article-card:focus-visible { transform: translateY(-2px); border-color: #b7d8cb; box-shadow: var(--shadow); outline: none; }
.article-card-top, .article-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { display: inline-block; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 9px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-pale); font-size: .75rem; font-weight: 680; }
.tag-neutral { color: #68766f; background: #edf0ed; }
.article-date, .article-card-footer { color: var(--muted); font-size: .76rem; }
.article-card h3 { margin: 13px 0 5px; font-size: 1.06rem; line-height: 1.35; }
.article-summary { display: -webkit-box; min-height: 43px; margin: 0; overflow: hidden; color: #586963; font-size: .88rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.muted { color: #8a9992 !important; }
.article-card-footer { margin-top: 14px; padding-top: 11px; border-top: 1px solid #eff2ef; }
.card-arrow { color: var(--brand); font-size: 1rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 210px; padding: 28px; border: 1px dashed #d7e2db; border-radius: 14px; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); }
.empty-state h2 { margin: 9px 0 0; color: var(--ink); font-size: 1.1rem; }
.empty-state p { margin: 6px 0 16px; }
.empty-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; color: var(--brand); background: var(--brand-pale); font-size: 1.35rem; }
.compact-empty { min-height: 150px; }
.search-results { margin-bottom: 35px; }
.search-results[hidden], .home-sections[hidden] { display: none; }
.app-footer { padding: 22px 0 5px; border-top: 1px solid var(--line); color: #95a19b; text-align: center; font-size: .78rem; }
.page-intro { padding: 35px 0 23px; }
.back-link { display: inline-block; margin-bottom: 21px; padding: 0; border: 0; color: var(--brand-dark); background: transparent; font-size: .9rem; font-weight: 700; }
.page-intro > .eyebrow { margin-bottom: 5px; }
.page-intro h1, .article-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.12; letter-spacing: -.045em; }
.page-description { max-width: 620px; margin: 10px 0 0; color: var(--muted); }
.page-actions { margin-top: 20px; }
.library-search { max-width: unset; margin: 0 0 28px; }
.list-heading { margin-top: 8px; }
.glossary-form-wrap { margin: 0 0 20px; }
.glossary-form-wrap[hidden] { display: none; }
.glossary-form { max-width: 850px; }
.glossary-form textarea { min-height: 95px; resize: vertical; }
.glossary-form .field-grid { margin-top: 8px; }
.glossary-list { display: grid; gap: 10px; }
.glossary-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.glossary-card[open] { border-color: #c4ddd1; box-shadow: 0 5px 18px rgba(32,63,52,.035); }
.glossary-card summary { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; cursor: pointer; list-style: none; }
.glossary-card summary::-webkit-details-marker { display: none; }
.glossary-term-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.glossary-term-copy strong { font-size: 1rem; }
.glossary-term-copy small { color: var(--muted); font-size: .78rem; }
.glossary-chevron { color: var(--brand); font-size: 1.2rem; transition: transform .15s; }
.glossary-card[open] .glossary-chevron { transform: rotate(45deg); }
.glossary-definition { padding: 0 18px 17px; border-top: 1px solid #eff2ef; color: #40544b; }
.glossary-definition > p { margin: 14px 0; white-space: pre-wrap; }
.glossary-example { margin: 12px 0; padding: 12px 14px; border-left: 3px solid #e5b95d; border-radius: 0 8px 8px 0; background: #fbf7eb; }
.glossary-example p { margin: 4px 0 0; white-space: pre-wrap; }
.glossary-source { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; font-size: .83rem; }
.glossary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.glossary-form .editor-actions { margin-top: 14px; }
.flashcard-setup { display: flex; align-items: center; gap: 15px; margin: 3px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.flashcard-setup-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--brand-dark); background: var(--brand-pale); font-size: 1.35rem; }
.flashcard-setup h2 { margin: 0; font-size: 1.05rem; }
.flashcard-setup p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.flashcard-setup-controls { display: flex; align-items: end; gap: 9px; margin-left: auto; }
.flashcard-setup-controls label { width: min(190px, 24vw); }
.flashcard-setup-controls label span { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 700; }
.flashcard-setup-controls select { padding: 9px 10px; }
.flashcard-workspace { max-width: 720px; margin: 0 auto; }
.flashcard-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; color: var(--muted); font-size: .82rem; }
.flashcard-progress-track { flex: 1; max-width: 240px; height: 7px; overflow: hidden; border-radius: 99px; background: #e5ebe7; }
.flashcard-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .2s; }
.flashcard { display: flex; width: 100%; min-height: 310px; flex-direction: column; justify-content: space-between; padding: 22px 25px; border: 1px solid #dce8e1; border-radius: 19px; color: var(--ink); text-align: left; background: linear-gradient(145deg, #fff 20%, #f7fbf8); box-shadow: 0 14px 38px rgba(32,63,52,.07); }
.flashcard.is-flipped { border-color: #c7dfd3; background: linear-gradient(145deg, #f6fbf7 20%, #edf6f0); }
.flashcard-topline { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; }
.flashcard-topline span:last-child { font-weight: 750; letter-spacing: .07em; }
.flashcard-label { align-self: center; margin-top: 20px; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.flashcard > strong { align-self: center; max-width: 600px; margin: auto 0; padding: 23px 0; font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1.4; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.flashcard-hint { align-self: center; color: var(--muted); font-size: .82rem; text-align: center; }
.flashcard-reveal { display: flex; margin: 13px auto; }
.flashcard-rating { display: flex; justify-content: center; gap: 10px; margin: 13px 0; }
.flashcard-complete { padding: 42px 22px; border: 1px solid var(--line); border-radius: 17px; text-align: center; background: white; }
.flashcard-complete-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: var(--brand-dark); background: var(--brand-pale); font-size: 1.5rem; font-weight: 800; }
.flashcard-complete h2 { margin: 0; color: var(--ink); }
.flashcard-complete p:not(.eyebrow) { margin: 7px 0 20px; color: var(--muted); }
.area-intro { padding-bottom: 18px; }
.area-jump-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; }
.area-jump { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-align: left; background: white; }
.area-jump:hover { border-color: #acd1c2; background: #fbfdfa; }
.area-jump strong { color: var(--brand-dark); font-size: 1.14rem; }
.area-jump span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.area-panel { scroll-margin-top: 88px; margin: 0 0 19px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.76); }
.area-panel > .section-heading { align-items: center; }
.area-panel > .section-heading h2 { font-size: 1.25rem; }
.area-panel .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.area-panel .glossary-list { margin-top: 11px; }
.area-panel .glossary-form { margin: 12px 0; padding: 16px; }
.area-empty-copy { margin: 12px 0 4px; color: var(--muted); font-size: .88rem; }
.area-flashcard-list, .document-list { display: grid; gap: 9px; margin-top: 9px; }
.area-flashcard-item, .document-item { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border: 1px solid #e9efeb; border-radius: 11px; background: white; }
.area-flashcard-item > div:first-child, .document-copy { flex: 1; min-width: 0; }
.area-flashcard-item strong, .area-flashcard-item p { display: block; margin: 0; }
.area-flashcard-item p { max-height: 2.9em; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .82rem; white-space: pre-wrap; }
.area-item-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.area-panel .flashcard-form { max-width: none; margin: 10px 0; padding: 16px; }
.area-start-cards { margin-top: 12px; }
.document-help { margin: -5px 0 13px; }
.document-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.document-upload-form .error { flex-basis: 100%; margin: 0; }
.document-icon { display: grid; flex: 0 0 40px; height: 44px; place-items: center; border-radius: 9px; color: #a63d36; background: #fff0ee; font-size: .7rem; font-weight: 850; }
.document-copy strong, .document-copy small { display: block; overflow-wrap: anywhere; }
.document-copy small { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.learning-flashcard-grid { margin-top: 12px; }
.learning-flashcard-item .article-card-footer { align-items: center; }
.article-page { max-width: 790px; margin: 0 auto; padding: 30px 0; }
.article-page > .back-link { margin-bottom: 26px; }
.article-heading { padding: 0 0 25px; }
.article-heading .tag { margin-bottom: 12px; }
.article-heading h1 { max-width: 740px; }
.article-lead { margin: 12px 0; color: #4d6259; font-size: 1.12rem; }
.article-byline { margin-top: 17px; color: var(--muted); font-size: .82rem; }
.article-content-panel { padding: 23px 26px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.article-content-panel > .eyebrow { margin-bottom: 14px; }
.rich-content { color: #344740; overflow-wrap: anywhere; }
.rich-content p { margin: 0 0 13px; white-space: pre-wrap; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h2 { margin: 25px 0 9px; color: var(--ink); font-size: 1.34rem; }
.rich-content h3 { margin: 19px 0 7px; color: var(--ink); font-size: 1.08rem; }
.rich-content ul { margin: 4px 0 16px; padding-left: 22px; }
.rich-content li { padding: 3px 0 3px 3px; }
.rich-content li::marker { color: var(--brand); }
.rich-content blockquote { margin: 12px 0 17px; padding: 13px 16px; border-left: 4px solid #e5b95d; border-radius: 0 8px 8px 0; color: #624b1e; background: #fbf5e6; white-space: pre-wrap; }
.source-panel { display: flex; gap: 13px; margin-top: 14px; padding: 16px 19px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.source-icon { color: var(--brand); font-size: 1.2rem; }
.source-panel strong, .source-panel a, .source-panel span { display: block; overflow-wrap: anywhere; }
.source-panel strong { margin-bottom: 4px; font-size: .9rem; }
.source-panel a, .source-panel div > span { color: var(--brand-dark); font-size: .88rem; }
.article-actions { display: flex; gap: 10px; margin-top: 19px; }
.manage-panel { margin: 0 0 18px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.manage-panel h2 { margin: 0 0 15px; font-size: 1.12rem; }
.add-category-form { display: flex; gap: 10px; }
input, textarea, select { width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #dbe5df; border-radius: 9px; outline: none; color: var(--ink); background: white; font-size: 16px; }
input:focus, textarea:focus, select:focus { border-color: #69a893; box-shadow: 0 0 0 3px rgba(20,124,104,.1); }
.category-manage-list { margin: -6px 0; }
.category-manage-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #eff2ef; }
.category-manage-item:first-child { border-top: 0; }
.small-subject-icon { flex-basis: 38px; width: 38px; height: 38px; }
.category-manage-copy { flex: 1; min-width: 0; }
.category-manage-copy strong, .category-manage-copy small { display: block; }
.category-manage-copy small { color: var(--muted); }
.small-button { min-height: 34px; padding: 6px 10px; font-size: .8rem; }
.editor-intro { padding-bottom: 17px; }
.editor-form { max-width: 820px; margin: 0 auto; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.field-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px; }
.editor-form label { display: block; margin: 13px 0 6px; font-size: .9rem; font-weight: 700; }
.summary-input { min-height: 78px; resize: vertical; }
.content-input { min-height: 300px; resize: vertical; font-family: inherit; line-height: 1.65; }
.field-help { margin: 5px 0 11px; color: var(--muted); font-size: .8rem; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 7px; }
.editor-toolbar button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: #52635b; background: #f7f9f7; font-size: .8rem; }
.editor-toolbar button:hover { color: var(--brand-dark); background: var(--brand-pale); }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 17px; border-top: 1px solid #eff2ef; }
.error { min-height: 1.3em; color: var(--danger); font-size: .88rem; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: calc(25px + env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); padding: 11px 17px; transform: translate(-50%, 12px); border-radius: 10px; color: white; background: #20312e; box-shadow: 0 8px 24px rgba(0,0,0,.16); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0, #e5f3ee 0, transparent 52%), var(--bg); }
.login-card { width: min(100%, 430px); padding: 35px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 18px 60px rgba(32,63,52,.09); }
.login-mark { width: 47px; height: 47px; margin-bottom: 22px; border-radius: 15px; font-size: 1.2rem; }
.login-card h1 { margin: 0; font-size: 2rem; line-height: 1.15; letter-spacing: -.04em; }
.login-copy { margin: 11px 0 22px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 700; }
.security-note { margin: 14px 0 0; color: #83918a; text-align: center; font-size: .78rem; }
@media (max-width: 760px) {
  #app { width: min(100% - 28px, 650px); }
  .top { width: calc(100% + 28px); margin-left: -14px; padding-right: 14px; padding-left: 14px; gap: 10px; }
  .brand { gap: 7px; font-size: 1rem; }
  .brand-mark { width: 31px; height: 31px; }
  .top-nav { gap: 0; }
  .top-nav button { padding: 7px 8px; font-size: .84rem; }
  .profile-button { padding-right: 6px; }
  .profile-name { display: none; }
  .tool-grid { grid-template-columns: 1fr; gap: 9px; }
  .flashcard-setup { align-items: flex-start; flex-wrap: wrap; }
  .flashcard-setup > div:nth-child(2) { flex: 1; min-width: calc(100% - 70px); }
  .flashcard-setup-controls { width: 100%; margin-left: 0; }
  .flashcard-setup-controls label { flex: 1; width: auto; min-width: 0; }
  .hero { min-height: 280px; margin-top: 19px; padding: 31px 27px; }
  .hero-art { right: -125px; opacity: .35; }
  .hero h1 { font-size: clamp(2.15rem, 8vw, 3.1rem); }
  .hero-copy { max-width: 510px; }
  .hero-description { max-width: 400px; }
  .guide-grid { grid-template-columns: 1fr; gap: 9px; }
  .guide-card { min-height: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 14px; }
  .guide-card-icon { grid-row: 1 / span 2; margin: 0; }
  .guide-card strong { align-self: end; margin: 0; }
  .guide-card > span:not(.guide-number):not(.guide-card-icon):not(.guide-link) { grid-column: 2 / 4; }
  .guide-link { grid-column: 2 / 4; padding-top: 7px; }
  .guide-number { top: 10px; right: 12px; font-size: .68rem; }
  .guide-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .area-jump-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-panel { padding: 15px; }
  .area-panel .article-grid { grid-template-columns: 1fr; }
  .area-flashcard-item, .document-item { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .area-flashcard-item > div:first-child, .document-copy { flex-basis: calc(100% - 54px); }
  .area-item-actions { width: 100%; justify-content: flex-end; }
  .document-item .btn { flex: 1; }
  .document-upload-form { align-items: stretch; flex-direction: column; }
  .document-upload-form .btn { width: 100%; }
  .stats-row { gap: 8px; margin-bottom: 31px; }
  .stat-card { min-height: 75px; gap: 9px; padding: 11px; }
  .stat-icon { flex-basis: 34px; width: 34px; height: 34px; font-size: 1rem; }
  .stat-card strong { font-size: 1.15rem; }
  .stat-card div span { font-size: .72rem; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .subject-card { gap: 9px; padding: 12px 10px; }
  .subject-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .subject-copy strong { font-size: .85rem; }
  .subject-copy small { font-size: .73rem; }
  .article-grid { grid-template-columns: 1fr; gap: 9px; }
  .welcome-empty { flex-wrap: wrap; }
  .welcome-empty .btn { margin: 5px 0 0 58px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .home-exam-grid { grid-template-columns: 1fr; }
  .home-exam-card { padding: 13px; }
  .home-exam-countdown { font-size: 1.6rem; }
  .home-exam-empty { align-items: stretch; flex-direction: column; }
  .home-exam-empty .btn { width: 100%; }
  .library-concept { grid-template-columns: 1fr; }
  .month-calendar, .selected-day-events { padding: 12px; }
  .calendar-grid { gap: 3px; }
  .calendar-day, .calendar-blank { min-height: 38px; }
  .month-calendar-heading .calendar-month-label { font-size: 1rem; }
  .study-timer-card { padding: 15px; }
  .study-timer-heading { align-items: flex-start; flex-direction: column; }
  .timer-mode-buttons { width: 100%; }
  .timer-mode-button { flex: 1; }
  .study-timer-actions { flex-direction: column; }
  .study-timer-actions .btn { width: 100%; }
  #app { width: calc(100% - 24px); }
  .top { margin-left: -12px; width: calc(100% + 24px); padding-right: 8px; padding-left: 10px; gap: 3px; }
  .brand { gap: 5px; font-size: .86rem; }
  .brand-mark { width: 28px; height: 28px; }
  .brand > span:last-child { display: none; }
  .top-nav { flex: 1; justify-content: center; }
  .top-nav { min-width: 0; gap: 0; }
  .top-nav button { padding: 4px 3px; font-size: .68rem; white-space: nowrap; }
  .nav-desktop-label { display: none; }
  .nav-mobile-label { display: inline; }
  .logout-button { flex: 0 0 19px; width: 19px; }
  .hero { min-height: 270px; padding: 25px 21px; border-radius: 17px; }
  .hero-description { max-width: 295px; margin: 13px 0 18px; font-size: .93rem; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { min-height: 40px; padding: 9px 11px; font-size: .84rem; }
  .search-box { min-height: 54px; padding: 0 11px; }
  .search-hint { display: none; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card { display: block; padding: 10px 8px; text-align: center; }
  .stat-icon { margin: 0 auto 6px; }
  .stat-card strong { font-size: 1.08rem; }
  .stat-card div span { font-size: .66rem; }
  .section-heading { align-items: start; }
  .section-description { font-size: .82rem; }
  .flashcard-setup { padding: 14px; }
  .flashcard-setup-controls { align-items: stretch; flex-direction: column; }
  .flashcard-setup-controls label { width: 100%; }
  .flashcard-setup-controls .btn { width: 100%; }
  .flashcard { min-height: 285px; padding: 18px; }
  .flashcard-rating { flex-direction: column; }
  .flashcard-rating .btn { width: 100%; }
  .glossary-form { padding: 16px; }
  .glossary-meta-fields { grid-template-columns: 1fr; }
  .area-jump { gap: 7px; padding: 10px 8px; }
  .area-jump strong { font-size: 1rem; }
  .area-jump span { font-size: .75rem; }
  .area-panel { padding: 12px; }
  .area-panel > .section-heading { align-items: flex-start; }
  .area-panel > .section-heading .btn { min-height: 38px; padding: 8px 9px; font-size: .78rem; }
  .section-heading h2 { font-size: 1.22rem; }
  .text-button { font-size: .78rem; }
  .subject-card { padding: 10px 8px; }
  .subject-copy strong { font-size: .8rem; }
  .subject-arrow { font-size: .9rem; }
  .page-intro { padding-top: 27px; }
  .page-intro h1, .article-heading h1 { font-size: 2rem; }
  .manage-panel, .editor-form { padding: 16px; }
  .add-category-form { align-items: stretch; flex-direction: column; }
  .add-category-form .btn { width: 100%; }
  .article-content-panel { padding: 18px; }
  .article-actions { flex-wrap: wrap; }
  .article-actions .btn { flex: 1; }
  .editor-actions { flex-direction: column-reverse; }
  .editor-actions .btn { width: 100%; }
  .login-card { padding: 27px 22px; }
}
.filter-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 21px; padding: 3px 0 7px; }
.filter-tab { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #586963; background: white; font-size: .87rem; }
.filter-tab.active { border-color: var(--brand); color: white; background: var(--brand); }
.progress-badge { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; color: #795a1d; background: #fbf0d7; font-size: .72rem; font-weight: 700; }
.progress-badge.learned { color: var(--brand-dark); background: var(--brand-pale); }
.progress-panel { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0; padding: 16px 18px; border: 1px solid #d8e9df; border-radius: 13px; background: #f0f7f2; }
.progress-copy { display: flex; align-items: center; gap: 12px; }
.progress-copy strong, .progress-copy small { display: block; }
.progress-copy strong { font-size: .9rem; }
.progress-copy small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.progress-panel-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--brand); background: white; font-size: 1.2rem; font-weight: 750; }
.progress-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
@media (max-width: 760px) { .progress-panel { align-items: flex-start; flex-direction: column; } .progress-actions { width: 100%; justify-content: stretch; } .progress-actions .btn { flex: 1; } }
@media (max-width: 430px) { .top-nav { gap: 0; } .top-nav button { padding: 4px 3px; font-size: .68rem; } .progress-actions { flex-direction: column; } }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(22, 39, 34, .48); backdrop-filter: blur(5px); animation: modal-fade-in .16s ease-out; }
.modal-panel { width: min(100%, 440px); padding: 25px; border: 1px solid rgba(225, 233, 228, .9); border-radius: 18px; background: var(--paper); box-shadow: 0 24px 70px rgba(19, 47, 38, .24); animation: modal-rise-in .18s ease-out; }
.modal-title { margin: 0; color: var(--ink); font-size: 1.3rem; letter-spacing: -.025em; }
.modal-message { margin: 9px 0 19px; color: #586963; line-height: 1.55; }
.modal-input { width: 100%; min-height: 46px; margin: 0 0 20px; padding: 10px 12px; border: 1px solid #cbd8d1; border-radius: 10px; color: var(--ink); background: white; outline: none; }
.modal-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 124, 104, .13); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.modal-actions .btn.danger-outline { background: #fff; }
.modal-actions .btn.danger-outline:hover { background: #fff5f4; }
.document-upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.pdf-picker { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 11px; border: 1px dashed #b8d4c7; border-radius: 13px; background: #fbfdfa; }
.pdf-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.pdf-file-input:focus-visible + .pdf-pick-button { outline: 3px solid rgba(20,124,104,.25); outline-offset: 2px; }
.pdf-file-name { min-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.pdf-file-hint { flex: 1 0 100%; color: var(--muted); font-size: .76rem; }
.exam-form, .plan-form { max-width: 740px; margin: 0 0 25px; }
.exam-form h2, .plan-form h2 { margin: 0 0 7px; font-size: 1.12rem; }
.exam-list, .study-plan-list { display: grid; gap: 13px; }
.exam-card, .study-plan-card { display: flex; justify-content: space-between; gap: 18px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 5px 18px rgba(32,63,52,.025); }
.exam-card-main { min-width: 0; flex: 1; }
.exam-card h2, .study-plan-card h2 { margin: 12px 0 5px; font-size: 1.18rem; }
.exam-countdown-label { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }
.exam-countdown { display: block; color: var(--brand-dark); font-size: clamp(1.6rem, 5vw, 2.25rem); font-variant-numeric: tabular-nums; letter-spacing: .035em; line-height: 1.25; }
.exam-author { display: block; margin-top: 5px; color: var(--muted); font-size: .78rem; }
.exam-actions { display: flex; align-items: flex-start; gap: 7px; }
.study-plan-card { flex-direction: column; gap: 11px; }
.study-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.study-plan-heading h2 { margin: 0; }
.study-plan-heading .eyebrow { margin-bottom: 5px; }
.study-plan-stats { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .85rem; }
.study-plan-stats strong { color: var(--ink); font-size: 1rem; }
.study-plan-track { height: 9px; overflow: hidden; border-radius: 99px; background: #e7ede9; }
.study-plan-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #66ae83); transition: width .25s; }
.study-session-form { display: flex; align-items: end; gap: 9px; }
.study-session-form label { flex: 1; }
.study-session-form input { width: 100%; min-height: 42px; margin-top: 5px; padding: 9px 11px; border: 1px solid #cbd8d1; border-radius: 9px; }
.history-panel, .article-history-panel { margin: 15px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.article-history-panel h2 { margin: 0 0 15px; font-size: 1.1rem; }
.history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.history-list li { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.history-list li:last-child { padding-bottom: 0; }
.history-marker { position: relative; flex: 0 0 10px; width: 10px; height: 10px; margin-top: 5px; border: 2px solid var(--brand); border-radius: 50%; background: white; }
.history-list li:not(:last-child) .history-marker::after { position: absolute; top: 8px; left: 2px; width: 2px; height: 35px; background: #dce9e1; content: ""; }
.history-version { min-width: 0; flex: 1; }
.history-version summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; cursor: pointer; list-style: none; }
.history-version summary::-webkit-details-marker { display: none; }
.history-version[open] summary { margin-bottom: 8px; }
.history-version > p { margin: 5px 0; white-space: pre-wrap; }
.history-version .rich-content { margin-top: 8px; padding: 11px 13px; border-radius: 9px; background: #f7faf7; }
.history-list strong, .history-list small { display: block; }
.history-list small { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.quiz-question { padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.quiz-question h2 { margin: 0 0 17px; font-size: 1.3rem; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; background: #fbfdfa; }
.quiz-option:not(:disabled):hover { border-color: var(--brand); background: var(--brand-pale); }
.quiz-option:disabled { cursor: default; opacity: 1; }
.quiz-option.quiz-correct { border-color: #77b796; background: #edf8f0; }
.quiz-option.quiz-incorrect { border-color: #dfaaa5; background: #fff2f1; }
.quiz-feedback { margin: 15px 0; padding: 12px 14px; border-radius: 10px; background: var(--brand-pale); }
.quiz-feedback p { margin: 4px 0 0; white-space: pre-wrap; }
.due-only-option { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: .8rem; }
.due-only-option input { width: 17px; height: 17px; accent-color: var(--brand); }
.pdf-picker:focus-within { border-color: var(--brand); }
.form-help { display: block; margin-top: -6px; color: var(--muted); }
.calendar-section, .plans-section { margin-top: 26px; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise-in { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 430px) {
  .document-upload-form { grid-template-columns: 1fr; }
  .document-upload-form > .btn { width: 100%; }
  .exam-card { flex-direction: column; padding: 15px; }
  .exam-actions { justify-content: flex-end; }
  .study-session-form { align-items: stretch; flex-direction: column; }
  .study-session-form .btn { width: 100%; }
  .study-plan-stats { align-items: flex-start; flex-direction: column; gap: 2px; }
  .quiz-question { padding: 16px; }
  .flashcard-setup { align-items: flex-start; flex-wrap: wrap; }
  .flashcard-setup-controls { width: 100%; }
  .due-only-option { justify-content: flex-start; }
  .modal-backdrop { align-items: end; padding: 12px; }
  .modal-panel { width: 100%; padding: 22px 19px calc(19px + env(safe-area-inset-bottom)); border-radius: 18px; }
  .modal-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-panel { animation: none; }
}

.modal-card-form label { display: block; margin: 0 0 6px; font-weight: 700; }
.modal-card-form textarea.modal-input { resize: vertical; font: inherit; }
.modal-panel:has(.modal-card-form) { max-height: 90vh; overflow-y: auto; }

.hero { min-height: 190px; margin: 18px 0 14px; padding: 26px 40px; }
.compact-guide { margin-bottom: 22px; border: 1px solid var(--line, #dbe7e0); border-radius: 14px; background: #fff; }
.compact-guide > summary { padding: 13px 16px; font-weight: 700; cursor: pointer; }
.compact-guide[open] > summary { border-bottom: 1px solid var(--line, #dbe7e0); }
.compact-guide .guide-grid { padding: 14px; }
.pdf-subject-select { min-height: 44px; margin: 10px 0; padding: 8px 12px; border: 1px solid #cbd8d1; border-radius: 10px; background: #fff; font: inherit; max-width: 100%; }
.content-section, .area-panel { margin-bottom: 22px; }
@media (max-width: 720px) { .hero { min-height: 0; padding: 20px 18px; } }

.menu-toggle, .nav-extra { display: none; }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .brand { margin-right: auto; }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .menu-bar { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
  .menu-open .menu-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-bar:nth-child(2) { opacity: 0; }
  .menu-open .menu-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .logout-button { display: none; }
  .top-nav { display: none; order: 5; flex: 0 0 100%; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(20, 60, 50, .12); }
  .menu-open .top-nav { display: flex; animation: menu-slide .18s ease-out; }
  .top-nav button, .top-nav .nav-extra { display: block; width: 100%; padding: 13px 14px; font-size: 1rem; text-align: left; white-space: normal; }
  .top-nav .nav-desktop-label { display: inline; }
  .top-nav .nav-mobile-label { display: none; }
  .top-nav .nav-extra { border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
  .top-nav .nav-extra:last-child { color: #a33a30; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; }
  .brand > span:last-child { display: inline; }
  .profile-button { margin-left: 0; }
}
@keyframes menu-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.search-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.search-result { cursor: default; }

/* Konten, Noten, Ranking, Admin, Dashboard, Pomodoro */
.auth-card { text-align: center; }
.auth-card .login-mark { margin: 0 auto 16px; }
.auth-card .login-copy { margin-bottom: 18px; }
.auth-form { text-align: left; }
.auth-form input, .editor-form input, .editor-form select, .calculator input, .calculator select { width: 100%; }
.auth-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 16px; border-radius: 12px; background: var(--brand-pale); }
.auth-tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--brand-dark); font: inherit; font-weight: 700; cursor: pointer; }
.auth-tabs button.active { background: white; box-shadow: 0 2px 8px rgba(32,63,52,.1); }
.auth-tabs select { flex: 1; border: 0; border-radius: 9px; background: transparent; font: inherit; }
.auth-heading { margin: 0 0 14px; font-size: 1.15rem; }
.auth-info { color: var(--brand-dark); font-weight: 600; }
.show-password { display: flex !important; align-items: center; gap: 8px; margin: 8px 0 12px; font-weight: 500 !important; }
.show-password input { width: auto; }
.login-card .btn.full { margin-top: 6px; }
.login-card .text-button { display: block; margin: 12px auto 0; }
.login-page { background: linear-gradient(160deg, #0d604f 0, #147c68 45%, #e5f3ee 100%); }

.share-toggle { display: flex !important; align-items: center; gap: 10px; margin: 10px 0; font-weight: 600 !important; }
.share-toggle input { width: auto; }
.scale-grid, .two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.two-cols[hidden] { display: none; }
.plan-members { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }

.pomodoro-settings { display: flex; justify-content: center; gap: 12px; }
.pomodoro-settings[hidden], .pomodoro-phase[hidden] { display: none; }
.pomodoro-phase { margin: 0; text-align: center; font-weight: 700; color: var(--brand-dark); }
.study-timer-display.timer-break { color: #b7791f; }

.due-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 20px; padding: 16px 20px; border-radius: 14px; background: #fff4d6; border: 1px solid #f0d98a; }
.due-banner p { margin: 2px 0 0; color: #6b5a1f; font-size: .9rem; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.progress-panel { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.progress-panel h3 { margin: 0 0 14px; font-size: 1rem; }
.ring-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; }
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .8rem; }
.ring { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-pale) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: white; }
.ring span { position: relative; font-weight: 800; font-size: .8rem; }
.ring-item small { color: var(--muted); }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.week-bar { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.week-bar i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--brand); }
.week-bar small, .week-bar span { color: var(--muted); font-size: .72rem; }
.week-total { margin: 12px 0 0; color: var(--muted); font-size: .85rem; }

.grade-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.grade-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.grade-total, .grade-subject { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.grade-total { background: var(--brand); color: white; }
.grade-total strong, .grade-subject strong { font-size: 1.6rem; }
.grade-subject span, .grade-subject small { color: var(--muted); font-size: .8rem; }
.grade-total span { font-size: .8rem; opacity: .85; }
.grade-list { display: grid; gap: 8px; margin-bottom: 22px; }
.grade-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.grade-badge { display: grid; place-items: center; min-width: 48px; height: 48px; border-radius: 12px; font-weight: 800; background: var(--brand-pale); color: var(--brand-dark); }
.grade-badge.g1, .grade-badge.g2 { background: #dff3e7; color: #176b3a; }
.grade-badge.g4 { background: #fff1d1; color: #8a5a00; }
.grade-badge.g5, .grade-badge.g6 { background: #fbe0dd; color: var(--danger); }
.grade-info { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.grade-info small { color: var(--muted); }
.calc-result { margin: 10px 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--brand-pale); font-weight: 600; }
.calc-result:empty { display: none; }
.calculator h3 { margin: 14px 0 8px; font-size: .95rem; }

.ranking-tabs { max-width: 520px; }
.ranking-list { display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.rank-row.me { border-color: var(--brand); background: var(--brand-pale); }
.rank-pos { min-width: 30px; font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.rank-name { display: flex; flex: 1; flex-direction: column; }
.rank-name small { color: var(--muted); }
.rank-value { font-size: 1.3rem; font-weight: 800; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 24px; }
.admin-list { display: grid; gap: 10px; }
.admin-user { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.admin-user.disabled { opacity: .65; }
.admin-user small { color: var(--muted); }
.admin-user-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.reset-tag, .reset-note { background: #fff4d6; color: #8a5a00; }
.reset-note { padding: 8px 12px; border-radius: 10px; }
@media (max-width: 640px) { .due-banner { flex-direction: column; align-items: stretch; text-align: center; } }

.scan-panel { display: grid; gap: .6rem; margin-bottom: 1rem; padding: .9rem; border: 1px dashed var(--line, #c9d3d0); border-radius: 14px; }
.scan-card { display: flex; gap: .6rem; align-items: flex-start; }
.scan-card > div { flex: 1; display: grid; gap: .3rem; }
.scan-card input[type=checkbox] { margin-top: .8rem; }

.ai-question { display: grid; gap: .4rem; margin-bottom: 1rem; }
.ai-option { text-align: left; }
.ai-right { outline: 2px solid #2e8b57; }
.ai-wrong { outline: 2px solid #c0392b; }
.ai-summary { padding-left: 1.2rem; display: grid; gap: .3rem; }

/* Kompakteres Design */
:root { --shadow: 0 4px 14px rgba(32, 63, 52, .05); }
body { font-size: 14.5px; line-height: 1.45; }
#app { width: min(100% - 24px, 1000px); padding-bottom: 36px; }
.top { min-height: 52px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; gap: 14px; }
.brand { font-size: 1rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; }
.top-nav button, .logout-button { padding: 6px 10px; font-size: .86rem; }
.btn { min-height: 36px; padding: 7px 13px; font-size: .9rem; border-radius: 9px; }
.hero { min-height: 120px; margin: 12px 0 10px; padding: 18px 26px; border-radius: 16px; }
.hero h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.hero-description { margin: 8px 0 14px; font-size: .92rem; }
.hero-art { width: 260px; opacity: .6; }
.stats-row { gap: 8px; margin-bottom: 20px; }
.stat-card { min-height: 60px; padding: 10px 14px; border-radius: 11px; gap: 10px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem; }
.stat-card strong { font-size: 1.1rem; }
.section-heading { margin-bottom: 10px; }
.section-heading h2 { font-size: 1.15rem; }
.area-panel { margin-bottom: 12px; padding: 14px; border-radius: 13px; }
.tool-card { padding: 11px 13px; border-radius: 12px; gap: 10px; }
.tool-card small { font-size: .76rem; }
.editor-form, .glossary-form, .flashcard-form { padding: 14px; }
.scan-panel { padding: .7rem; margin-bottom: .7rem; }
@media (max-width: 700px) {
  body { font-size: 14px; }
  #app { width: min(100% - 18px, 1000px); }
  .hero { padding: 16px 18px; min-height: 100px; }
  .hero-art { display: none; }
}

/* Menü "Mehr", Tab-Leiste, Dropdowns */
.more-menu { position: relative; display: flex; }
.more-toggle { border: 0; color: var(--muted); background: transparent; border-radius: 9px; padding: 6px 10px; font-size: .86rem; }
.more-toggle:hover, .more-open .more-toggle { color: var(--brand-dark); background: var(--brand-pale); }
.more-list { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 210px; padding: 6px; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(20, 60, 50, .14); }
.more-open .more-list { display: flex; animation: menu-slide .15s ease-out; }
.more-list .nav-extra { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; font-size: .9rem; }
.more-list .nav-extra:hover { background: var(--brand-pale); color: var(--brand-dark); }
.more-list .nav-logout { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #a33a30; }
.tabbar { display: none; }

select { appearance: none; -webkit-appearance: none; padding-right: 34px; border-radius: 10px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23147c68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
select:hover { border-color: #9fc9ba; }
select option { padding: 8px; }

@media (max-width: 760px) {
  .top { backdrop-filter: none; background: #fff; }
  .more-menu { display: contents; }
  .more-toggle { display: none; }
  .more-list { display: flex; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .more-list .nav-extra { color: var(--ink); font-size: 1rem; padding: 13px 14px; }
  .more-list .nav-logout { color: #a33a30; }
  .top-nav .nav-desktop-label { display: inline; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -4px 16px rgba(20, 60, 50, .07); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: .68rem; font-weight: 650; }
  .tab-icon { font-size: 1.15rem; line-height: 1.2; }
  .tab-active { color: var(--brand-dark); background: var(--brand-pale); }
  #app { padding-bottom: 84px; }
  .top-nav button:not(.nav-extra) { display: none; }
  .top-nav button.nav-extra { display: block; }
  .menu-open .top-nav button:not(.nav-extra) { display: block; }
}

.scan-card input[type=checkbox] { width: auto; flex: none; }
.scan-card textarea, .scan-card input:not([type=checkbox]) { width: 100%; }
.scan-count { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.scan-count input { width: 90px; flex: none; }

.ring-carousel { display: flex; align-items: center; gap: 6px; }
.ring-track { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 4px 2px; }
.ring-track::-webkit-scrollbar { display: none; }
.ring-track .ring-item { flex: 0 0 92px; }
.ring-arrow { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #cfe0d8; background: white; color: var(--brand); font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ring-arrow:hover:not(:disabled) { background: var(--brand-pale); }
.ring-arrow:disabled { opacity: .3; cursor: default; }
.ring-arrow[hidden] { display: none; }
.progress-panel, .progress-grid > * { min-width: 0; }
.ring-carousel { max-width: 100%; }
.ring-carousel { min-width: 0; width: 100%; }

