:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --ink: #171d35;
  --muted: #565f77;
  --line: #e2e6f0;
  --blue: #2e49d3;
  --blue-dark: #233aaa;
  --paper: #fff;
  --side: 244px;
  font-family: "Inter", "Aptos", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 3px solid #536aeb; outline-offset: 3px; }
p { margin: 0; line-height: 1.55; }
h1, h2, h3 { margin: 0; line-height: 1.16; overflow-wrap: anywhere; }
small { font-size: .8125rem; }
svg { flex-shrink: 0; vertical-align: middle; }
[tabindex="-1"]:focus { outline: none; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 20; padding: 10px 16px; background: white; }
.skip:focus { top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.sidebar { width: var(--side); position: fixed; inset: 0 auto 0 0; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 75px; margin: 0 23px; width: max-content; font-size: 1.375rem; font-weight: 780; letter-spacing: -.062em; }
.brand-icon, .local-icon { display: grid; place-items: center; flex-shrink: 0; }
.brand-icon { width: 37px; height: 37px; border-radius: 11px; background: var(--blue); color: white; }
.brand-dot { color: var(--blue); }
.rail-body { padding: 36px 15px 20px; }
.rail-label { display: block; padding: 0 11px; margin-bottom: 12px; color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .12em; }
.rail-body a { display: flex; align-items: center; gap: 11px; border-radius: 9px; min-height: 45px; margin: 3px 0; padding: 9px 11px; font-size: .9375rem; font-weight: 600; color: var(--muted); }
.rail-body a:hover { background: #f4f6fd; color: var(--blue-dark); }
.rail-body a[aria-current] { background: #e9edff; color: var(--blue-dark); }
.rail-body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 4px 14px; }
.rail-body .rail-import { color: var(--blue-dark); }
.rail-footer { margin: auto 17px 20px; padding: 17px 5px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.local-icon { width: 36px; height: 36px; border-radius: 10px; background: #eef0fb; color: #4b57a1; }
.rail-footer strong, .rail-footer small { display: block; }
.rail-footer strong { font-size: .875rem; }
.rail-footer small { color: var(--muted); margin-top: 4px; font-size: .75rem; }
.workspace { margin-left: var(--side); }
.topbar { min-height: 75px; padding: 0 clamp(20px, 3.4vw, 52px); display: flex; align-items: center; gap: 14px; background: white; border-bottom: 1px solid var(--line); }
.topbar-title { font-size: .875rem; font-weight: 700; }
.topbar-search { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; color: var(--muted); font-size: .875rem; }
.topbar-search:hover, .plain-link:hover, .crumbs a:hover { text-decoration: underline; }
.menu-btn { display: none; }
.main { max-width: 1420px; margin: 0 auto; padding: 33px clamp(20px, 3.4vw, 52px) 55px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(2rem, 3vw, 2.67rem); letter-spacing: -.055em; font-weight: 770; }
.page-heading p, .section-head p { color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.btn { min-height: 43px; border-radius: 9px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: fit-content; padding: 9px 15px; border: 1px solid transparent; font-size: .875rem; font-weight: 740; text-align: center; line-height: 1.3; }
.page-heading .btn { flex-shrink: 0; }
.primary { color: #fff; background: var(--blue); }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: white; border-color: #d7dded; color: var(--blue-dark); }
.secondary:hover { background: #f1f4ff; }
.white { background: white; color: #263d9e; }
.white:hover { background: #ecf0ff; }

.hero { position: relative; overflow: hidden; isolation: isolate; min-height: 285px; display: flex; align-items: center; border-radius: 15px; color: white; background: radial-gradient(ellipse at 87% 2%, #485ded 0, transparent 56%), linear-gradient(117deg, #263a9d, #263bb5 54%, #324ad8); }
.hero-copy { z-index: 1; position: relative; width: 62%; padding: 32px 38px; }
.hero-label { display: inline-flex; gap: 8px; align-items: center; color: #e4e9ff; font-size: .75rem; font-weight: 760; letter-spacing: .11em; }
.hero-copy h2 { font-size: clamp(2.4rem, 4.1vw, 4rem); line-height: .99; letter-spacing: -.064em; margin: 13px 0 12px; font-weight: 760; }
.hero-copy p { color: #e7ebff; max-width: 380px; }
.hero-copy .btn { margin-top: 22px; }
.hero-art { position: absolute; inset: 0 0 0 56%; display: grid; place-items: center; }
.orbit { position: absolute; width: 370px; aspect-ratio: 1; border: 1px solid #9caaff40; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.o2 { width: 295px; }
.o3 { width: 220px; }
.art-card { position: absolute; width: 128px; height: 161px; border-radius: 17px; padding: 19px; }
.art-card span { width: 47px; height: 46px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 15px; }
.art-card i { display: block; width: 86%; height: 5px; background: currentColor; border-radius: 7px; margin: 9px 0; opacity: .4; }
.art-card i:nth-of-type(even) { width: 62%; }
.art-back { background: #a7b5ff; color: #4a5cc7; box-shadow: 0 13px 40px #17297969; transform: translate(32px, -10px) rotate(19deg); }
.art-back span { background: #7588ec; }
.art-front { background: #f9faff; color: #445bd5; box-shadow: 0 15px 36px #15278172; transform: translate(-25px, 4px) rotate(-13deg); }
.art-front span { background: #e6ebff; }
.art-front b { position: absolute; bottom: -11px; right: -9px; display: grid; place-items: center; border-radius: 50%; width: 35px; height: 35px; background: #beefdf; color: #166c56; box-shadow: 0 4px 12px #24389940; }
.art-spark { position: absolute; color: #c8d1ff; }
.sp1 { left: 16%; top: 29%; }
.sp2 { right: 12%; bottom: 28%; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 31px 0 16px; }
.section-head h2, .panel h2 { font-size: 1.42rem; letter-spacing: -.035em; }
.plain-link { color: var(--blue-dark); font-size: .875rem; font-weight: 740; }
.section-head .plain-link { flex-shrink: 0; margin-bottom: 4px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(185px, 1fr); gap: 16px; align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.course-card, .panel, .summary { border: 1px solid var(--line); background: white; border-radius: 13px; box-shadow: 0 3px 8px #13214a07; }
.course-card { padding: 18px; display: flex; flex-direction: column; transition: border-color .16s, box-shadow .16s; }
.course-card:hover { border-color: #a6b1f1; box-shadow: 0 7px 21px #263eb610; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 15px; }
.course-icon, .mini-icon { display: grid; place-items: center; flex-shrink: 0; }
.course-icon { width: 47px; height: 47px; border-radius: 12px; }
.mini-icon { width: 35px; height: 35px; border-radius: 9px; }
.blue { color: #304cc9; background: #e8edff; }
.mint { color: #196854; background: #e1f4ee; }
.lilac { color: #6740a2; background: #f1e9fa; }
.tag { background: #f2f4f9; color: #4e5870; border-radius: 5px; padding: 5px 7px; font-size: .75rem; font-weight: 680; }
.tag.own { color: #3043a0; background: #edf0ff; }
.card-copy { flex: 1; overflow-wrap: anywhere; }
.card-copy > span { color: var(--muted); font-size: .8125rem; font-weight: 680; }
.card-copy h3 { font-size: 1.18rem; letter-spacing: -.032em; margin: 4px 0 7px; }
.card-copy p { color: var(--muted); font-size: .9375rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; padding: 14px 0 12px; color: var(--muted); font-size: .8125rem; }
.card-meta span { display: flex; align-items: center; gap: 4px; }
.card-progress { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .8125rem; font-weight: 680; white-space: nowrap; }
progress { appearance: none; border: 0; color: var(--blue); background: #e9ecf6; border-radius: 12px; height: 7px; width: 100%; }
progress::-webkit-progress-bar { background: #e9ecf6; border-radius: 12px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 12px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 12px; }
.summary { padding: 17px; }
.summary h3 { font-size: 1rem; letter-spacing: -.02em; margin-bottom: 14px; }
.summary-row { display: flex; gap: 9px; align-items: center; margin-bottom: 13px; }
.summary-row strong, .summary-row div span { display: block; }
.summary-row div span { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.summary .plain-link { display: block; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 12px; }

.panel { padding: clamp(17px, 2.5vw, 28px); overflow-wrap: anywhere; }
.panel h2 { margin-bottom: 10px; }
.panel p { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 13px; align-items: center; margin-bottom: 16px; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter { padding: 8px 11px; background: white; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .875rem; font-weight: 650; }
.filter[aria-pressed="true"] { background: #e8edff; border-color: #d5ddff; color: var(--blue-dark); }
.search { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 8px; padding: 7px 10px; max-width: 100%; }
.search input { background: transparent; border: 0; min-width: 0; width: 155px; color: var(--ink); }
.search:focus-within { outline: 2px solid #536aeb; }
.search input:focus { outline: none; }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 24px 0; }
.progress-list article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 190px); align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.progress-list article:last-child { border-bottom: 0; }
.progress-list article h2 { font-size: 1.2rem; }
.progress-list article h2 a:hover { text-decoration: underline; }
.progress-list article progress { max-width: 380px; }

.import-grid, .detail-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.45fr); }
.detail-grid { grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); }
.import-help h2, .detail-side h2, .quiz > .course-icon { margin-top: 13px; }
.import-help ol { padding-left: 22px; line-height: 1.52; color: var(--muted); }
.import-help li { padding-left: 4px; margin: 8px 0; }
.import-help .btn, .detail-side .btn { margin: 8px 3px 0 0; }
.import-help .support { margin-top: 17px; font-size: .875rem; }
.file-picker { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--blue-dark); background: #f2f5ff; border: 1px dashed #9ba9e8; border-radius: 9px; padding: 18px 9px; margin: 15px 0 19px; font-weight: 680; cursor: pointer; }
.file-picker:hover, .file-picker:has(+ input:focus-visible) { background: #e9eeff; border-color: var(--blue-dark); }
textarea { display: block; width: 100%; min-height: 166px; padding: 11px; margin: 8px 0 11px; resize: vertical; border: 1px solid #cfd7ea; border-radius: 8px; color: var(--ink); background: #fcfdff; font: .875rem/1.5 ui-monospace, monospace; }
.import-entry .btn { margin: 6px 6px 0 0; }
.import-review { background: #eaf7f1; padding: 12px; border-radius: 8px; margin: 10px 0; }
.import-review h3 { font-size: 1rem; }
.panel .error, .error { background: #fff1ef; border: 1px solid #f1c5bf; color: #923a2c; padding: 10px 12px; border-radius: 8px; }
.storage { margin-bottom: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.crumbs a { color: var(--blue-dark); font-weight: 670; }
.detail-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: baseline; }
.detail-title span { font-size: .875rem; color: var(--muted); }
.module h3 { font-size: 1rem; margin: 17px 0 5px; }
.lesson-row { border-bottom: 1px solid var(--line); display: flex; gap: 11px; align-items: center; padding: 10px 4px; font-weight: 650; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row > svg:last-child { margin-left: auto; color: var(--muted); }
.lesson-row:hover { color: var(--blue-dark); }
.lesson-row small { display: block; color: var(--muted); font-weight: 480; margin-top: 4px; }
.reading, .quiz { max-width: 790px; padding: clamp(20px, 4vw, 45px); }
.reading h1, .quiz h1 { font-size: clamp(1.7rem, 3.8vw, 2.65rem); letter-spacing: -.045em; margin: 11px 0 18px; }
.lesson-meta, .quiz-count { color: var(--muted); font-size: .875rem; font-weight: 680; }
.lesson-meta { display: flex; align-items: center; gap: 7px; }
.reading-body { max-width: 65ch; }
.reading-body p { margin: 0 0 15px; font-size: 1.06rem; color: var(--ink); line-height: 1.68; }
.reading-body h2 { margin-top: 25px; }
.source { background: #f0f3fd; padding: 9px 12px; border-radius: 6px; margin-top: 14px; font-size: .875rem; }
.source strong { color: var(--ink); padding-right: 5px; }
.lesson-controls, .result-actions { display: flex; justify-content: space-between; gap: 9px; flex-wrap: wrap; margin-top: 23px; }
.lesson-controls > :last-child { margin-left: auto; }
.result-actions { justify-content: flex-start; }
.quiz > p { margin: 10px 0; }
.quiz > .btn { margin-top: 9px; }
.quiz fieldset { display: grid; gap: 8px; padding: 0; margin: 0; border: 0; }
.answer { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.answer:has(:checked) { background: #edf0ff; border-color: #8c9bef; }
.answer input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); flex-shrink: 0; }
.quiz .score { font-size: 1.5rem; color: var(--blue-dark); font-weight: 780; }
.results article { padding: 18px 0; border-top: 1px solid var(--line); }
.results article h2 { font-size: 1.1rem; }
.results { margin-top: 18px; }
.results p { margin: 6px 0; }
.results .right { color: #186657; font-weight: 700; }
.results .wrong { color: #953626; font-weight: 700; }
#notice:not(:empty) { position: fixed; bottom: 18px; right: 18px; left: auto; z-index: 10; max-width: calc(100% - 36px); border-radius: 8px; background: var(--ink); color: white; padding: 12px 16px; box-shadow: 0 6px 20px #11172935; }

@media (max-width: 1150px) {
  :root { --side: 211px; }
  .dashboard-grid { grid-template-columns: minmax(0, 2.6fr) minmax(165px, 1fr); }
}
@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .summary h3, .summary .plain-link { grid-column: 1 / -1; }
  .summary h3, .summary-row, .summary .plain-link { margin: 0; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; top: 56px; width: min(280px, 90vw); box-shadow: 10px 0 34px #1f285329; }
  .sidebar.open { display: flex; }
  .brand { min-height: 63px; }
  .rail-body { padding-top: 18px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 56px; }
  .main { padding-top: 23px; }
  .menu-btn { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; width: 36px; height: 34px; color: var(--ink); }
}
@media (max-width: 510px) {
  .page-heading, .toolbar { align-items: flex-start; flex-direction: column; }
  .hero { min-height: 244px; }
  .hero-copy { width: 85%; padding: 25px 20px; }
  .hero-art { opacity: .38; left: 68%; pointer-events: none; }
  .art-card { scale: .68; }
  .art-back { transform: translate(27px, -10px) rotate(19deg); }
  .sp1, .sp2 { display: none; }
  .card-grid, .detail-grid, .progress-list article { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .topbar-search span { display: none; }
}

.rail-footer { flex-wrap: wrap; }
.rail-footer div { min-width: 0; overflow-wrap: anywhere; }
.rail-signout { flex-basis: 100%; }
.rail-signout button { background: white; border: 0; padding: 5px 0; cursor: pointer; }
.rail-signout button:hover { text-decoration: underline; }
.loading { margin: 0 auto; max-width: 780px; padding: 48px 24px; }
.loading .btn { margin-top: 15px; }
.account-layout { margin: 0 auto; padding: 23px 24px 60px; max-width: 950px; }
.account-layout .brand { margin: 0; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: clamp(20px, 5vw, 75px); padding-top: clamp(16px, 6vw, 78px); }
.account-intro h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); letter-spacing: -.06em; margin-bottom: 12px; }
.account-intro p { color: var(--muted); font-size: 1.125rem; }
.account-panel form label { display: block; font-size: .9375rem; font-weight: 680; margin-bottom: 6px; }
.account-panel form input { width: 100%; min-height: 43px; padding: 8px 10px; margin-bottom: 14px; border: 1px solid #cfd7ea; border-radius: 8px; background: #fcfdff; color: var(--ink); }
.account-panel .btn { display: flex; width: 100%; }
.account-panel > a { display: inline-block; margin-top: 18px; }
.account-panel .support { margin: -7px 0 13px; font-size: .875rem; }
.account-errors { color: #923a2c; padding: 10px 12px 10px 29px; margin: 0 0 16px; background: #fff1ef; border: 1px solid #f1c5bf; border-radius: 8px; }
@media (max-width: 620px) {
  .account-grid { grid-template-columns: 1fr; }
}
