@font-face {
  font-family: Inter;
  src: url("fonts/Inter-latin.65850a373e25.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-latin.74f5c996fd97.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Nanum Myeongjo";
  src: url("fonts/NanumMyeongjo.36c3b6205049.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nanum Myeongjo";
  src: url("fonts/NanumMyeongjoBold.fcb28bb8049a.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Nanum Myeongjo";
  src: url("fonts/NanumMyeongjoExtraBold.0605433803e8.woff") format("woff");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --green: #087459;
  --green-dark: #125a49;
  --green-soft: #e5f7f0;
  --sage: #f4f7f6;
  --paper: #fcfdfc;
  --white: #ffffff;
  --ink: #141d1a;
  --text: #303b36;
  --muted: #55645e;
  --line: #d9e2dd;
  --amber: #8c5b19;
  --amber-soft: #fbf3e3;
  --red: #aa3c36;
  --red-soft: #fff0ed;
  --shadow: none;
  --on-accent: #ffffff;
  --radius: 12px;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ui-font: Inter, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --reading-font: "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  font-family: var(--ui-font);
  font-size: 15px;
}

.public-page { font-family: var(--ui-font); }
.account-sections { display: grid; gap: 24px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.question-body { min-width: 0; overflow-x: auto; overflow-wrap: anywhere; }
.question-body img, .question-figure img { max-width: 100%; height: auto; }
.question-body table { min-width: min(100%, 480px); }
html { min-width: min(320px, 100%); background: var(--paper); }
body { margin: 0; color: var(--text); line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, .button, nav, .public-footer, .theme-picker, .account-menu,
.filter-label, .badge, .stat-label, .brand-caption, .question-progress, .source-list,
.results-count, .question-index, .build-label, .cover-details, .cover-heading small {
  font-family: var(--ui-font);
}
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button:disabled, .button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
::selection { background: var(--sage); color: var(--green-dark); }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.4; letter-spacing: -.035em; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 3vw, 37px); font-weight: 600; }
h2 { margin-bottom: 18px; font-size: 22px; }
h3 { margin-bottom: 12px; font-size: 18px; }
p { margin-bottom: 1em; }
svg { display: block; flex-shrink: 0; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }

.app-shell {
  display: grid;
  grid-template: "sidebar account" auto "sidebar content" 1fr / auto minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  grid-area: sidebar;
  align-self: start;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 236px;
  height: 100vh;
  padding: 32px 20px 24px;
  background: var(--sage);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 13px; color: var(--green-dark); }
.brand:hover { color: var(--green-dark); }
.brand-mark {
  display: grid;
  flex: 0 0 39px;
  place-items: center;
  width: 39px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px 11px 11px 3px;
  background: var(--sage);
  color: var(--green);
  font-size: 22px;
  font-weight: 600;
}
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-title { color: var(--green-dark); font-size: 20px; font-weight: 600; letter-spacing: -.045em; line-height: 1.3; }
.brand-caption { color: var(--text); font-size: 10px; font-weight: 600; letter-spacing: 0; }
.nav-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  padding: 11px 15px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
}
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover { color: var(--green-dark); background: var(--green-soft); }
.nav-link.active { color: var(--green-dark); background: var(--white); box-shadow: inset 3px 0 var(--green); font-weight: 600; }
.nav-count { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: var(--sage); color: var(--green); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; padding: 25px 13px 0; color: var(--text); font-size: 12px; }
.sidebar-footer p { margin-bottom: 7px; }
.sidebar-footer a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.topbar { grid-area: account; }
.main-content { grid-area: content; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 18px 42px; border-bottom: 1px solid var(--line); background: var(--white); }
.breadcrumb { color: var(--muted); font-size: 12px; }
.account-menu { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: 12px; }
.account-menu form { margin: 0; }
.account-menu button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.account-menu a:hover, .account-menu button:hover { color: var(--green); }
.main-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 40px 72px; }
.page-heading { margin-bottom: 27px; }
.eyebrow { margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.subtitle { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 14px; word-break: keep-all; overflow-wrap: anywhere; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 25px 0 30px; }
.stat-card { padding: 21px 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.stat-number { display: block; color: var(--green-dark); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.05em; }
.stat-number small { margin-left: 4px; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.stat-label { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }

.toolbar { margin-bottom: 25px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.search-form { margin: 0; }
.search-wrap { display: flex; align-items: stretch; gap: 9px; }
.search-input { flex: 1; width: 100%; min-width: 0; min-height: 47px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--sage); color: var(--ink); font-size: 14px; }
.search-input::placeholder { color: var(--text); }
.search-button { flex: 0 0 auto; min-width: 77px; min-height: 47px; padding: 10px 20px; border: 1px solid var(--green); border-radius: 9px; background: var(--green); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.search-button:hover { background: var(--green-dark); }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 13px; margin-top: 19px; }
.field { flex: 1 1 130px; min-width: 0; }
.filter-label { display: block; margin: 0 0 6px 1px; color: var(--text); font-size: 11px; font-weight: 600; }
.filter-select { width: 100%; min-height: 40px; padding: 8px 32px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--text); font-size: 12px; cursor: pointer; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 15px; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 550; }
.filter-chip a { padding: 0 2px; color: var(--green); }
.library-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.results-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.results-count { color: var(--text); font-size: 12px; }
.results-count strong { color: var(--green-dark); font-size: 14px; }
.export-actions, .export-choice { display: flex; align-items: center; gap: 8px; }
.export-actions { flex-wrap: wrap; }
.export-choice { color: var(--text); cursor: pointer; min-height: 32px; }
.export-choice input { margin: 0; width: 16px; height: 16px; accent-color: var(--green); }
.question-list { display: grid; gap: 16px; }
.question-card { padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.question-card:hover { border-color: var(--line); }
.question-card.compact { padding: 19px 23px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 13px; color: var(--text); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; border-radius: 5px; background: var(--sage); color: var(--text); font-size: 10px; font-weight: 600; line-height: 1.55; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.muted { background: var(--sage); color: var(--text); }
.card-title { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.question-preview { display: -webkit-box; overflow: hidden; margin-bottom: 18px; color: var(--text); font-size: 14px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.question-preview p { margin: 0; }
.card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; padding-top: 14px; border-top: 1px solid var(--line); }
.professor-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 11px; }
.professor-chip strong { color: var(--text); font-weight: 600; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; padding: 10px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--green); font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center; cursor: pointer; }
.button:hover { border-color: var(--line); background: var(--sage); color: var(--green-dark); }
.button.primary { border-color: var(--green); background: var(--green); color: var(--on-accent); }
.button.primary:hover { border-color: var(--green-dark); background: var(--green-dark); color: var(--on-accent); }
.button.secondary { border-color: var(--line); background: var(--sage); color: var(--green); }
.button.ghost { border-color: transparent; background: transparent; color: var(--text); }
.button.ghost:hover { background: var(--sage); color: var(--green); }
.button.small { min-height: 33px; padding: 7px 12px; font-size: 11px; }
.button.danger { border-color: var(--line); color: var(--red); }
.button.danger:hover { background: var(--red-soft); }
.empty-state { padding: 55px 25px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--sage); color: var(--text); text-align: center; }
.empty-state h2, .empty-state h3 { color: var(--text); }
.empty-state p { margin-bottom: 18px; font-size: 13px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 35px; min-height: 35px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.page-link:hover { background: var(--sage); }
.page-link.current { border-color: var(--green); background: var(--green); color: var(--on-accent); }

.study-layout { display: grid; grid-template-columns: minmax(0, 1fr) 274px; align-items: start; gap: 23px; }
.study-aside { display: grid; gap: 17px; min-width: 0; }
.study-aside > section, .study-aside > .aside-card { padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.study-aside h2, .study-aside h3 { margin-bottom: 13px; font-size: 14px; }
.study-card { overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.study-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--line); }
.study-header .card-meta { margin-bottom: 10px; }
.study-header h2 { margin-bottom: 0; font-size: 17px; }
.question-body { padding: 28px 28px 16px; color: var(--text); font-size: 16px; line-height: 1.95; word-break: keep-all; overflow-wrap: anywhere; }
.question-body > :last-child { margin-bottom: 0; }
.question-body p, .explanation p { margin-bottom: 15px; }
.question-body h2, .question-body h3, .question-body h4 { margin: 24px 0 13px; font-size: 17px; }
.question-body strong, .explanation strong { color: var(--text); }
.question-body blockquote, .explanation blockquote { margin: 16px 0; padding: 13px 17px; border-left: 3px solid var(--line); border-radius: 0 7px 7px 0; background: var(--sage); color: var(--text); }
.question-body blockquote p:last-child, .explanation blockquote p:last-child { margin-bottom: 0; }
.question-body ul, .explanation ul { margin: 13px 0; padding-left: 21px; list-style-type: "-  "; }
.question-body ol, .explanation ol { margin: 13px 0; padding-left: 24px; }
.question-body li, .explanation li { padding-left: 3px; margin-bottom: 6px; }
.question-body table, .explanation table { display: block; max-width: 100%; overflow-x: auto; margin: 18px 0; border-collapse: collapse; font-size: 13px; line-height: 1.7; }
.question-body th, .question-body td, .explanation th, .explanation td { min-width: 75px; padding: 9px 12px; border: 1px solid var(--line); text-align: left; }
.question-body th, .explanation th { background: var(--sage); color: var(--text); font-weight: 600; }
.question-body img, .explanation img, .question-figure img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 5px; }
.question-figure { margin: 5px 29px 21px; }
.question-figure figcaption { margin-top: 6px; color: var(--muted); font-size: 11px; text-align: center; }
.choices-list { display: grid; gap: 10px; margin: 13px 29px 25px; padding: 0; list-style: none; }
.choice { position: relative; display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--text); line-height: 1.75; }
.choice:hover { border-color: var(--line); background: var(--sage); }
.choice input { flex: 0 0 17px; width: 17px; height: 17px; margin: 5px 0 0; accent-color: var(--green); cursor: pointer; }
.choice label { display: flex; flex: 1; align-items: flex-start; gap: 12px; min-width: 0; color: inherit; cursor: pointer; }
.choice-text > * { margin-block: 0; }
.choice:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.choice.selected, .choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.choice.correct { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.choice.incorrect { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.choice-number { display: inline-grid; flex: 0 0 25px; place-items: center; min-width: 25px; height: 25px; margin-top: 1px; border: 1px solid var(--line); border-radius: 7px; background: var(--sage); color: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.choice.selected .choice-number, .choice:has(input:checked) .choice-number, .choice.correct .choice-number { border-color: var(--green); background: var(--green); color: var(--on-accent); }
.choice.incorrect .choice-number { border-color: var(--line); background: var(--sage); color: var(--white); }
.choice-text { display: grid; align-self: center; gap: 4px; min-width: 0; font-size: 14px; word-break: keep-all; overflow-wrap: anywhere; }
.study-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 29px; border-top: 1px solid var(--line); background: var(--sage); }
.answer-panel { margin: 24px 29px 27px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--sage); }
.answer-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--green); font-size: 15px; font-weight: 600; }
.answer-heading.error { color: var(--red); }
.explanation { color: var(--text); font-size: 14px; line-height: 1.85; word-break: keep-all; overflow-wrap: anywhere; }
.explanation h2, .explanation h3, .explanation h4 { margin: 19px 0 10px; font-size: 15px; }
.explanation > :last-child { margin-bottom: 0; }
.review-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.source-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.source-row { padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; }
.source-row:first-child { padding-top: 0; }
.source-row:last-child { padding-bottom: 0; border-bottom: 0; }
.source-row strong { display: block; color: var(--text); font-weight: 600; }
.source-note { margin: 8px 0 0; color: var(--text); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.note-form { margin: 0; }
.note-form label { display: block; margin-bottom: 10px; color: var(--text); font-size: 13px; font-weight: 600; }
.note-form textarea { display: block; width: 100%; min-height: 150px; margin-bottom: 12px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; background: var(--sage); color: var(--text); font-size: 13px; line-height: 1.8; }
.note-form textarea::placeholder { color: var(--text); }
.save-status { display: inline-block; min-height: 19px; margin-left: 8px; color: var(--text); font-size: 11px; }
.progress-track { overflow: hidden; height: 6px; border-radius: 4px; background: var(--sage); }
.progress-fill { min-width: 0; max-width: 100%; height: 100%; border-radius: inherit; background: var(--green); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 17px; margin: 25px 0; }
.lecture-progress { display: grid; gap: 0; overflow: hidden; padding: 7px 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.progress-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(100px, 1fr) auto; align-items: center; gap: 25px; padding: 20px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.progress-row:last-child { border-bottom: 0; }
.progress-row strong { color: var(--text); font-weight: 600; }
.progress-row small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.alert { margin: 17px 0; padding: 14px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--amber-soft); color: var(--amber); font-size: 12px; line-height: 1.8; }
.alert p:last-child { margin-bottom: 0; }
.messages { display: grid; gap: 8px; margin-bottom: 22px; padding: 0; list-style: none; }
.message { padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--sage); color: var(--text); font-size: 13px; }
.message.success { border-color: var(--line); background: var(--sage); color: var(--green); }
.message.error { border-color: var(--line); background: var(--red-soft); color: var(--red); }
.is-loading { cursor: wait; opacity: .62; pointer-events: none; }
[hidden] { display: none !important; }

.auth-page { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(400px, 1fr); min-height: 100vh; background: var(--sage); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 65px; overflow: hidden; padding: 52px clamp(35px, 6vw, 105px) 48px; background: var(--sage); }
.auth-story .brand { padding: 0; }
.auth-story h1 { max-width: 460px; margin: 0 0 22px; color: var(--text); font-size: clamp(35px, 3.8vw, 53px); font-weight: 600; line-height: 1.38; letter-spacing: -.065em; word-break: keep-all; }
.auth-story .subtitle { max-width: 400px; color: var(--text); font-size: 14px; line-height: 1.9; }
.auth-story .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 37px; }
.auth-story .stat-card { padding: 0 15px 0 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.auth-story .stat-card:last-child { padding-right: 0; border-right: 0; }
.auth-story .stat-number { font-size: 27px; }
.auth-story .stat-label { color: var(--text); font-size: 11px; }
.auth-story > footer { color: var(--text); font-size: 11px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 58px 38px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { margin-bottom: 9px; font-size: 29px; }
.auth-card h2 { margin-bottom: 9px; font-size: 28px; }
.auth-card .subtitle { margin-bottom: 30px; font-size: 13px; }
.auth-card form { display: grid; gap: 18px; }
.auth-card form p { margin-bottom: 0; }
.auth-card form > p > label, .form-field label, .auth-card .form-field > label { display: block; margin-bottom: 8px; color: var(--text); font-size: 12px; font-weight: 600; }
.auth-card input:not([type="checkbox"]):not([type="radio"]), .form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea {
  display: block;
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 14px;
}
.auth-card input::placeholder, .form-field input::placeholder { color: var(--text); }
.auth-card .button { width: 100%; min-height: 47px; margin-top: 5px; font-size: 13px; }
.auth-card .auth-links { margin-top: 25px; color: var(--text); font-size: 12px; text-align: center; }
.auth-card .auth-links a { margin-left: 7px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.auth-card .helptext, .helptext { display: block; margin-top: 7px; color: var(--text); font-size: 11px; line-height: 1.7; }
.helptext ul { margin: 3px 0 0; padding-left: 0; list-style: none; }
.errorlist { display: grid; gap: 5px; margin: 0 0 10px; padding: 0; color: var(--red); font-size: 12px; line-height: 1.65; list-style: none; }
.form-field .errorlist { margin-top: 7px; margin-bottom: 0; }
.errorlist.nonfield { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--sage); }

.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mobile-only { display: none; }

@media (min-width: 1600px) {
  .sidebar { width: 252px; padding-right: 24px; padding-left: 24px; }
  .main-content { padding-top: 49px; }
}

@media (max-width: 1150px) {
  .sidebar { width: 209px; padding-right: 13px; padding-left: 13px; }
  .brand { gap: 9px; padding-right: 8px; padding-left: 8px; }
  .brand-title { font-size: 18px; }
  .brand-caption { font-size: 9px; }
  .topbar { padding-right: 27px; padding-left: 27px; }
  .main-content { padding-right: 27px; padding-left: 27px; }
  .study-layout { grid-template-columns: minmax(0, 1fr); }
  .study-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .study-aside > :only-child { grid-column: 1 / -1; }
  .auth-story { padding-right: 37px; padding-left: 37px; }
}

@media (max-width: 760px) {
  :root { font-size: 14px; }
  .app-shell { display: block; }
  .sidebar { position: static; display: block; width: 100%; height: auto; padding: 0 19px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { gap: 10px; padding: 0; }
  .brand-mark { flex-basis: 32px; width: 32px; height: 35px; border-radius: 8px 8px 8px 2px; font-size: 18px; }
  .brand-title { font-size: 19px; }
  .brand-caption { font-size: 9px; }
  .nav-list { display: flex; gap: 2px; overflow-x: auto; margin-top: 0; padding-block: 9px; scrollbar-width: thin; }
  .nav-list li { flex: 0 0 auto; }
  .nav-link { gap: 7px; min-height: 39px; padding: 8px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
  .nav-link svg { width: 16px; height: 16px; }
  .nav-count { padding: 0 5px; font-size: 10px; }
  .sidebar-footer { display: none; }
  .topbar { min-height: 51px; padding: 13px 20px; background: var(--sage); }
  .breadcrumb { font-size: 10px; }
  .account-menu { gap: 11px; font-size: 11px; }
  .account-menu button { font-size: 11px; }
  .main-content { padding: 28px 19px 50px; }
  .page-heading { margin-bottom: 22px; }
  h1 { margin-bottom: 10px; font-size: 27px; }
  h2 { font-size: 19px; }
  .eyebrow { font-size: 10px; }
  .subtitle { font-size: 12px; line-height: 1.8; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 22px; }
  .stat-card { min-width: 0; padding: 15px 12px; border-radius: 10px; }
  .stat-number { font-size: 24px; }
  .stat-number small { font-size: 11px; }
  .stat-label { margin-top: 6px; font-size: 10px; word-break: keep-all; }
  .toolbar { margin-bottom: 20px; padding: 15px; border-radius: 12px; }
  .search-wrap { gap: 7px; }
  .search-input { min-height: 44px; padding: 10px 11px; font-size: 12px; }
  .search-button { min-width: 56px; min-height: 44px; padding: 9px 12px; font-size: 12px; }
  .filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 9px; margin-top: 15px; }
  .filter-select { min-height: 38px; padding-left: 9px; font-size: 11px; }
  .filter-label { font-size: 10px; }
  .active-filters { margin-top: 12px; }
  .filter-chip { font-size: 10px; }
  .results-header { gap: 8px; margin-bottom: 12px; }
  .results-count { font-size: 11px; }
  .results-count strong { font-size: 12px; }
  .question-list { gap: 13px; }
  .question-card, .question-card.compact { padding: 19px 18px; border-radius: 12px; }
  .card-meta { gap: 5px; margin-bottom: 11px; font-size: 10px; }
  .badge { padding: 3px 6px; font-size: 9px; }
  .card-title { font-size: 13px; }
  .question-preview { margin-bottom: 14px; font-size: 13px; line-height: 1.85; -webkit-line-clamp: 4; }
  .card-footer { gap: 10px; padding-top: 12px; }
  .professor-chip { font-size: 10px; }
  .button { min-height: 39px; padding: 9px 13px; font-size: 11px; }
  .button.small { min-height: 32px; padding: 7px 10px; font-size: 10px; }
  .study-layout { gap: 16px; }
  .study-card { border-radius: 12px; }
  .study-header { padding: 20px 19px 16px; }
  .study-header h2 { font-size: 15px; }
  .question-body { padding: 23px 19px 13px; font-size: 15px; line-height: 1.95; }
  .question-figure { margin-right: 19px; margin-left: 19px; }
  .choices-list { gap: 9px; margin: 12px 17px 21px; }
  .choice { gap: 9px; padding: 13px 12px; border-radius: 9px; }
  .choice label { gap: 9px; }
  .choice input { flex-basis: 16px; width: 16px; height: 16px; }
  .choice-number { flex-basis: 23px; min-width: 23px; height: 23px; font-size: 10px; }
  .choice-text { font-size: 13px; }
  .study-actions { gap: 10px; padding: 16px 18px; }
  .study-actions .button { flex: 1 1 auto; }
  .study-aside { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .study-aside > section, .study-aside > .aside-card { padding: 20px; border-radius: 12px; }
  .answer-panel { margin: 20px 17px; padding: 18px 15px; border-radius: 10px; }
  .answer-heading { font-size: 14px; }
  .explanation { font-size: 13px; }
  .review-controls { gap: 7px; }
  .review-controls .button { flex: 1 1 auto; }
  .note-form textarea { min-height: 130px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lecture-progress { padding-right: 18px; padding-left: 18px; }
  .progress-row { grid-template-columns: minmax(0, 1fr) auto; gap: 11px 15px; padding: 17px 0; font-size: 12px; }
  .progress-row .progress-track { grid-row: 2; grid-column: 1 / -1; }
  .progress-row small { font-size: 10px; }
  .empty-state { padding: 37px 20px; }
  .empty-state p { font-size: 12px; }
  .auth-page { display: flex; flex-direction: column; min-height: 100vh; }
  .auth-story { gap: 27px; padding: 25px 26px 28px; }
  .auth-story h1 { max-width: 350px; margin-bottom: 12px; font-size: 32px; }
  .auth-story .subtitle { max-width: 400px; font-size: 12px; }
  .auth-story .hero-stats { max-width: 355px; margin-top: 23px; margin-bottom: 0; }
  .auth-story .stat-number { font-size: 24px; }
  .auth-story .stat-label { font-size: 10px; }
  .auth-story > footer { display: none; }
  .auth-panel { flex: 1; align-items: flex-start; padding: 34px 27px 45px; }
  .auth-card { max-width: 390px; }
  .auth-card h1, .auth-card h2 { font-size: 25px; }
  .auth-card .subtitle { margin-bottom: 25px; font-size: 12px; }
  .auth-card form { gap: 16px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: initial; }
}

@media (max-width: 380px) {
  .main-content { padding-right: 14px; padding-left: 14px; }
  .topbar { padding-right: 15px; padding-left: 15px; }
  .sidebar { padding-right: 14px; padding-left: 14px; }
  .stat-card { padding-right: 9px; padding-left: 9px; }
  .stat-number { font-size: 21px; }
  .stat-label { font-size: 9px; }
  .account-menu { gap: 8px; }
  .auth-story { padding-right: 23px; padding-left: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .nav-list > .filter-label { display: none; }
  .nav-list .nav-link { flex: 0 0 auto; white-space: nowrap; }
  .sidebar .brand { margin-bottom: 12px; }
  .nav-list .nav-link { font-size: 13px; }
  .card-title { font-size: 16px; }
  .question-preview, .choice-text { font-size: 15px; }
  .filter-select { font-size: 13px; }
  .stat-label { font-size: 11px; }
  .auth-story { gap: 16px; padding: 24px; }
  .auth-story h1 { font-size: 26px; }
  .auth-story .hero-stats, .auth-story > .small-text { display: none; }
  .auth-story .subtitle { margin-bottom: 0; font-size: 13px; }
  .auth-panel { padding-top: 24px; }
  .auth-card form:has([name="invite_code"]) .form-field input { font-size: 16px; }
}

@media print {
  .sidebar, .topbar, .toolbar, .pagination, .study-aside, .study-actions, .review-controls, .account-menu { display: none !important; }
  .app-shell { display: block; }
  html, body { background: var(--white); }
  .main-content { max-width: none; margin: 0; padding: 0; }
  .study-layout { display: block; }
  .study-card, .question-card { box-shadow: none; border-color: var(--line); break-inside: avoid; }
  .question-body { font-size: 11pt; }
  .choice-text { font-size: 10pt; }
  a { color: inherit; }
}

.public-hero-copy .beta-note { text-wrap: pretty; overflow-wrap: break-word; }
.lineage-entry { margin: 1rem 0; }
.lineage-entry h2 { font-size: 1.2rem; }
.lineage-entry h3 { font-size: 1rem; margin: .4rem 0 .75rem; }
.lineage-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin: .8rem 0; }
.lineage-pair article { min-width: 0; padding-top: .65rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.lineage-pair .question-body { padding: 0; }
.lineage-pair details { margin: .8rem 0; }
.lineage-pair summary { cursor: pointer; }
.lineage-choice { display: flex; align-items: baseline; gap: .5rem; }
.lineage-choice p { margin: .2rem 0; }
@media (max-width: 760px) { .lineage-pair { grid-template-columns: minmax(0, 1fr); gap: .75rem; } }

.choice-dilemma { margin: .75rem 0; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 8px; }
.choice-dilemma summary, .dilemma-review summary { cursor: pointer; font-weight: 650; }
.choice-dilemma label { display: block; margin: .75rem 0 .35rem; }
.choice-dilemma select { width: 100%; min-width: 0; font-size: 16px; }
.choice-dilemma p { margin: .35rem 0 0; }
.dilemma-review { margin: 1rem 0; }
.dilemma-review .question-body { padding: .5rem 0; }
.dilemma-option { display: flex; gap: .7rem; align-items: baseline; margin: .45rem 0; }
.dilemma-option p { margin: 0; }
.dilemma-review details { padding: .75rem 0; border-top: 1px solid var(--line); }
.dilemma-review img { max-width: 100%; height: auto; }

.featured-study { grid-column: 1 / -1; min-width: 0; margin-bottom: 1.4rem; }
.featured-study h2 { margin: 0 0 16px; font-size: clamp(20px, 2vw, 28px); line-height: 1.3; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-link { box-shadow: var(--card-depth, none); display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--text); transition: border-color .16s ease, box-shadow .16s ease; }
.feature-link h3 { margin: 0; font-size: 18px; font-weight: 600; }
.feature-link p { margin: 8px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; word-break: keep-all; }
.feature-link span { margin-top: auto; color: var(--green-dark); font-size: 13px; font-weight: 600; }
.feature-link:hover, .feature-link:focus-visible { border-color: var(--green); box-shadow: 0 3px 12px rgb(18 49 39 / 7%); }
.feature-link:hover span, .feature-link:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }
.contest-feature span { color: var(--red); }
@media (max-width: 850px) {
  .featured-grid { gap: 10px; }
  .feature-link { padding: 16px; }
}
@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; }
  .feature-link p { margin-bottom: 12px; }
}
