:root {
  color-scheme: light;
  --page: #f7f5ef;
  --paper: #fffefa;
  --ink: #24262a;
  --muted: #62625f;
  --line: #dcdad2;
  --red: #900025;
  --red-deep: #671127;
  --ok: #226044;
  --ui: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  font-family: var(--ui);
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--page); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.offline-page {
  display: grid; place-items: center; line-height: 1.65;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.offline-page main { width: min(100%, 27rem); }
.offline-page img { display: block; width: 58px; height: 58px; border-radius: 14px; }
.offline-page h1 { margin: 24px 0 10px; font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.3; letter-spacing: -.055em; }
.offline-page p { margin: 0 0 23px; color: var(--muted); word-break: keep-all; }
.offline-page a {
  display: inline-flex; min-height: 46px; align-items: center; padding: 10px 20px;
  border-radius: 10px; background: var(--red); color: white; text-decoration: none; font-weight: 650;
}
button:focus-visible, a:focus-visible { outline: 3px solid #287577; outline-offset: 3px; }
#main:focus, h1[tabindex]:focus { outline: none; }
.skip-link { position: absolute; top: -99px; left: 12px; z-index: 20; padding: 12px 18px; background: white; color: var(--ink); }
.skip-link:focus { top: 8px; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.bar-inner { width: min(1120px, calc(100% - 64px)); margin: 0 auto; min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.identity, #user-nav { display: flex; align-items: center; gap: 12px; }
.identity strong { font-size: 19px; line-height: 1; letter-spacing: -.08em; }
.identity-divider, .nav-divider { width: 1px; height: 15px; background: var(--line); }
.identity-app { font-size: 14px; color: #4a4948; font-weight: 600; }
.brand-symbol { display: inline-flex; width: 32px; height: 32px; background: var(--red); border-radius: 8px; align-items: center; justify-content: center; gap: 2px; }
.brand-symbol i { display: block; width: 8px; height: 14px; border-radius: 1px 1px 0 0; transform: skewY(19deg); background: #fff7e8; }
.brand-symbol i + i { transform: skewY(-19deg); }
.nav-button, .quiet, .back-link, .text-action { background: transparent; border: 0; font-weight: 700; color: var(--muted); }
.nav-button { padding: 8px 1px; min-height: 40px; font-size: 13px; }
.nav-button:hover, .back-link:hover, .text-action:hover { color: var(--red); }
.connection, .global-message { width: min(660px, calc(100% - 36px)); margin: 32px auto; text-align: center; }
.connection p { margin: 0; color: var(--muted); }
.quiet { margin-top: 12px; padding: 8px 20px; border: 1px solid var(--line); border-radius: 5px; }
.auth-layout { display: grid; grid-template-columns: .96fr 1.04fr; width: min(926px, calc(100% - 64px)); margin: clamp(42px,8vh,96px) auto 58px; border-radius: 20px; border: 1px solid #d9d6ca; overflow: hidden; box-shadow: 0 17px 52px #38292212; background: var(--paper); }
.cover-panel { position: relative; min-height: 470px; overflow: hidden; isolation: isolate; background: #82152e; color: #fff9ec; padding: clamp(28px,4.6vw,57px); display: flex; flex-direction: column; justify-content: space-between; }
.cover-content, .cover-foot { position: relative; z-index: 2; }
.cover-course { display: block; font-family: Georgia, "Times New Roman", serif; letter-spacing: .09em; font-size: 23px; color: #f0c99d; }
.cover-panel h2 { margin: 15px 0 13px; font-size: clamp(36px,4.4vw,57px); line-height: 1.2; letter-spacing: -.085em; word-break: keep-all; }
.subjects { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.03em; color: #fbe8dc; }
.subjects span { color: #d69c83; margin: 0 2px; }
.cover-art { position: absolute; right: -15%; bottom: -29%; width: 107%; aspect-ratio: 1; pointer-events: none; transform: rotate(-19deg); }
.cover-art i { position: absolute; width: 91%; aspect-ratio: 1; border: 1px solid #e1a48867; border-radius: 48% 48% 6% 6%; left: 3%; top: 2%; }
.cover-art i:nth-child(2) { top: 8%; left: 8%; }
.cover-art i:nth-child(3) { top: 14%; left: 13%; }
.cover-art i:nth-child(4) { top: 20%; left: 18%; }
.cover-art i:nth-child(5) { top: 26%; left: 23%; }
.cover-foot { align-self: flex-start; border-top: 1px solid #e0b39481; padding-top: 13px; margin-top: 35px; font-size: 12px; color: #f3d6b9; }
.cover-foot strong { font-family: var(--ui); color: #fff9ec; margin-left: 7px; }
.auth-card { padding: clamp(34px,4.6vw,60px); align-self: center; min-width: 0; }
.auth-card h1, .signup-card h1, .dashboard-title h1 { margin: 0; color: var(--ink); font-size: clamp(31px,3.2vw,42px); line-height: 1.22; font-weight: 800; letter-spacing: -.075em; }
.intro { margin: 10px 0 29px; color: var(--muted); font-size: 14px; line-height: 1.7; word-break: keep-all; }
.field { display: block; margin: 0 0 18px; font-size: 14px; font-weight: 700; }
.field > input, .field > select, .input-action { margin-top: 8px; }
.field input, .field select { width: 100%; min-width: 0; height: 46px; border: 1px solid #c6c5bd; border-radius: 7px; background: #fff; color: var(--ink); padding: 0 12px; font-size: 16px; font-weight: 500; }
.field input:focus, .field select:focus { outline: 2px solid #a04b5e; border-color: transparent; outline-offset: 0; }
.field input::placeholder { color: #70716b; }
.field input[readonly] { color: #535550; background: #f1f1eb; }
.field-hint { color: #656662; font-size: 12px; margin-left: 3px; font-weight: 500; }
.primary, .secondary { border: 1px solid transparent; border-radius: 7px; font-weight: 700; min-height: 46px; }
.primary { color: #fff; background: var(--red); padding: 12px 20px; display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; }
.primary:hover { background: var(--red-deep); }
.primary:disabled { opacity: .62; }
.wide { width: 100%; }
.secondary { color: var(--red); background: #f9f1f0; border-color: #dbbfc3; padding: 8px 13px; flex: none; font-size: 13px; }
.secondary:not(:disabled):hover { background: #f0e1e3; }
.secondary:disabled { color: #666; background: #f1f0eb; border-color: #d7d6cf; }
.auth-switch { margin: 24px 0 0; font-size: 13px; text-align: center; color: var(--muted); }
.text-action { padding: 4px; color: var(--red); text-decoration: underline; text-underline-offset: 4px; font-size: inherit; }
.signup-shell { width: min(600px,calc(100% - 48px)); margin: 23px auto 52px; }
.back-link { font-size: 13px; padding: 6px 0; margin-bottom: 10px; }
.back-link span { margin-right: 4px; }
.signup-card, .ranking, .practice-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.signup-card { padding: clamp(24px,5vw,43px); box-shadow: 0 11px 30px #30262708; }
.signup-block { border: 0; padding: 0; margin: 0 0 22px; min-inline-size: 0; }
.signup-block legend { width: 100%; padding: 0 0 11px; border-bottom: 1px solid var(--line); margin-bottom: 17px; font-size: 17px; font-weight: 800; color: #35322e; }
.signup-block .field:last-child { margin-bottom: 0; }
.input-action { display: flex; align-items: stretch; gap: 8px; }
.input-action input { flex: 1; }
.demo-hint { display: grid; gap: 5px; padding: 12px 14px; margin: 0 0 16px; border-radius: 7px; background: #f3ebd5; color: #56401b; font-size: 13px; line-height: 1.5; }
.demo-code { background: #eef3f5; color: #345566; font-weight: 700; padding: 9px 12px; font-size: 14px; border-radius: 5px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.pair .field { margin-bottom: 0; }
.message { padding: 10px 13px; margin-top: 10px; border-radius: 6px; background: #fbedea; color: #862c24; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.global-message { margin-left: auto; margin-right: auto; }
.message.success { background: #eaf4eb; color: var(--ok); }
.dashboard { width: min(1016px,calc(100% - 64px)); margin: clamp(27px,5vw,56px) auto 56px; }
.dashboard-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 23px; }
.month-caption { color: var(--red); font-size: 14px; font-weight: 750; margin: 0 0 6px; }
.student { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 48%; }
.student > span:last-child { display: grid; gap: 3px; min-width: 0; }
.student strong { font-size: 16px; overflow-wrap: anywhere; }
.student span span { font-size: 12px; color: var(--muted); }
.student-mark { position: relative; width: 37px; height: 37px; flex: none; border-radius: 50%; border: 1px solid #d5c2bf; background: #ede0da; overflow: hidden; }
.student-mark::before, .student-mark::after { content: ""; position: absolute; background: #a66a61; left: 50%; transform: translateX(-50%); }
.student-mark::before { top: 7px; width: 10px; height: 10px; border-radius: 50%; }
.student-mark::after { top: 20px; width: 22px; height: 16px; border-radius: 12px 12px 0 0; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; margin-bottom: 23px; }
.score-panel { min-width: 0; color: #fffcf7; background: #801730; border-radius: 14px; padding: 25px 30px; }
.score-top, .score-foot, .ranking-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.score-panel h2, .practice-panel h2, .ranking h2 { margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: -.055em; }
.score-panel h2 { font-size: 15px; color: #f5dacf; }
.score-bars { display: flex; gap: 3px; align-items: end; }
.score-bars i { width: 4px; height: 7px; background: #f1cf96; border-radius: 2px; }
.score-bars i:nth-child(2) { height: 12px; }
.score-bars i:nth-child(3) { height: 17px; }
.score-value { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 17px; color: #fff9ee; font-variant-numeric: tabular-nums; }
.score-value strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(57px,6vw,81px); letter-spacing: -.065em; line-height: 1.12; }
.score-value span { color: #f1ceaa; font-size: 19px; }
.score-foot { border-top: 1px solid #c58c965f; padding-top: 15px; justify-content: flex-start; gap: 38px; }
.score-foot > div { display: grid; gap: 3px; }
.score-foot span { font-size: 12px; color: #f1d5d2; }
.score-foot strong { font-size: 16px; }
.practice-panel { display: flex; flex-direction: column; justify-content: space-between; align-items: start; gap: 12px; padding: 23px 26px; }
.book-icon { display: flex; align-items: center; gap: 1px; width: 39px; height: 37px; }
.book-icon i { width: 17px; height: 22px; border: 2px solid #945268; transform: skewY(13deg); border-radius: 2px; }
.book-icon i + i { transform: skewY(-13deg); background: #f3e6de; }
.practice-panel p { color: var(--muted); font-size: 13px; margin: 7px 0 0; line-height: 1.6; }
.practice-panel button { padding: 8px 16px; min-height: 40px; font-size: 14px; }
.ranking { overflow: hidden; }
.ranking-head { padding: 22px 26px 18px; align-items: baseline; }
.ranking-head p, .ranking-note { color: var(--muted); font-size: 12px; }
.ranking-head p { margin: 0; }
.ranking table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ranking th, .ranking td { text-align: left; padding: 12px 6px; font-size: 14px; vertical-align: middle; word-break: break-word; }
.ranking th { font-weight: 600; color: #5e605a; font-size: 12px; background: #f0efe7; border-block: 1px solid #e4e2d8; }
.ranking td { border-bottom: 1px solid #ece9e0; }
.ranking td:first-child, .ranking th:first-child { padding-left: 26px; width: 15%; }
.ranking td:nth-child(2), .ranking th:nth-child(2) { width: 37%; }
.ranking td:last-child, .ranking th:last-child { padding-right: 26px; text-align: right; width: 21%; }
.ranking td:last-child, .ranking td:first-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking .self-row { background: #fbf0ef; }
.ranking .self-label { color: var(--red); margin-left: 5px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.ranking-note { margin: 0; padding: 14px 26px; line-height: 1.6; }
.network-status { margin: 0; padding: 11px 18px; background: #f2e8cf; color: #594a29; font-size: 13px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.install-footer { width: min(1016px,calc(100% - 32px)); margin: -16px auto 30px; text-align: center; }
.install-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 12px; border: 0; background: transparent; color: #5c5450; font-size: 13px; font-weight: 650; }
.install-link:hover { color: var(--red); }
.install-icon { width: 19px; height: 19px; border: 1.4px solid currentColor; border-radius: 5px; line-height: 16px; font-size: 16px; font-family: Arial,sans-serif; font-weight: 400; }
#install-dialog { width: min(430px,calc(100% - 24px)); max-height: 88vh; max-height: 88dvh; margin: auto; padding: 0; border: 1px solid #d4d0c6; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 70px #271b2140; overflow: auto; overscroll-behavior: contain; }
#install-dialog:not([open]) { display: none; }
#install-dialog::backdrop { background: #20181975; }
.install-sheet { padding: 22px 24px 26px; }
.install-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.06em; }
.close-install { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-family: Arial,sans-serif; font-size: 28px; font-weight: 400; }
#install-description { margin: 2px 0 19px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.install-platforms { display: grid; grid-template-columns: 1.15fr 1fr 1fr; padding: 3px; gap: 2px; background: #efede5; border-radius: 9px; }
.install-platforms button { border: 0; border-radius: 7px; background: transparent; min-height: 42px; color: #514f49; padding: 4px; font-size: 13px; font-weight: 650; }
.install-platforms [aria-pressed="true"] { color: var(--red); background: var(--paper); box-shadow: 0 1px 4px #33221b28; }
#install-steps ol { padding-left: 24px; margin: 20px 0 1px; color: #42413d; }
#install-steps li { margin: 9px 0; padding-left: 3px; font-size: 14px; line-height: 1.7; word-break: keep-all; }
#install-steps li::marker { color: var(--red); font-weight: 750; }
#native-install { margin-top: 16px; }
@media (max-width: 680px) {
  .bar-inner { width: calc(100% - 32px); min-height: 57px; gap: 8px; }
  .identity { gap: 7px; }
  .identity strong { font-size: 17px; }
  .identity-app { font-size: 12px; }
  .brand-symbol { width: 28px; height: 28px; border-radius: 6px; }
  #user-nav { gap: 7px; }
  .nav-button { min-height: 44px; font-size: 13px; }
  .auth-layout { width: min(450px,calc(100% - 32px)); grid-template-columns: 1fr; margin: 20px auto 22px; border-radius: 16px; }
  .cover-panel { min-height: 132px; padding: 21px 24px; flex-direction: row; align-items: end; gap: 8px; }
  .cover-course { font-size: 16px; }
  .cover-panel h2 { font-size: 28px; margin: 5px 0; }
  .cover-panel h2 br { display: none; }
  .subjects { font-size: 12px; }
  .cover-foot { display: grid; text-align: right; align-self: end; font-size: 11px; padding-top: 0; border: none; margin: 0; }
  .cover-foot strong { margin-left: 0; font-size: 13px; }
  .cover-art { width: 62%; bottom: -110%; right: -6%; }
  .auth-card { padding: 24px; }
  .auth-card h1, .signup-card h1, .dashboard-title h1 { font-size: 29px; }
  .intro { margin: 8px 0 20px; font-size: 13px; }
  .signup-shell { width: min(520px,calc(100% - 28px)); margin-top: 12px; }
  .signup-card { padding: 22px 18px; }
  .pair { gap: 9px; }
  .dashboard { width: calc(100% - 28px); margin: 22px auto; }
  .student { gap: 6px; }
  .student-mark { width: 32px; height: 32px; }
  .dashboard-title { margin-bottom: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .score-panel { padding: 20px; }
  .score-foot { padding-top: 11px; gap: 24px; }
  .score-value { padding-bottom: 11px; }
  .practice-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 17px 18px; }
  .practice-panel .book-icon { display: none; }
  .practice-panel h2, .ranking h2 { font-size: 18px; }
  .practice-panel p { margin-top: 3px; font-size: 12px; }
  .practice-panel button { min-height: 46px; padding: 8px 14px; gap: 8px; }
  .ranking-head { padding: 16px; }
  .ranking td, .ranking th { font-size: 12px; padding-block: 10px; }
  .ranking td:first-child, .ranking th:first-child { padding-left: 16px; width: 14%; }
  .ranking td:last-child, .ranking th:last-child { padding-right: 16px; }
  .ranking-note { padding: 12px 16px; font-size: 11px; }
  .install-footer { margin: -7px auto 16px; }
  .text-action, .back-link { min-height: 44px; }
  .auth-switch { margin-top: 13px; }
  .back-link { margin-bottom: 2px; }
  #install-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .install-sheet { padding: 16px max(20px,env(safe-area-inset-right)) max(26px,calc(env(safe-area-inset-bottom) + 12px)) max(20px,env(safe-area-inset-left)); }
}
@media (max-width: 375px) {
  .identity-divider, .nav-divider { display: none; }
  .bar-inner { width: calc(100% - 24px); }
  .pair { grid-template-columns: 1fr; gap: 16px; }
  .student-mark { display: none; }
  .input-action { gap: 5px; }
  .secondary { padding-inline: 9px; }
  .cover-panel { padding-inline: 18px; }
}
