:root {
  --ink: #20233a;
  --muted: #7b8098;
  --line: #e8e9f1;
  --surface: #ffffff;
  --canvas: #f7f7fb;
  --primary: #5965e8;
  --primary-dark: #424dc8;
  --green: #14a37f;
  --coral: #f07d65;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 34px 22px 25px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 11px; margin: 0 8px 42px; }
.logo-mark { width: 37px; height: 37px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6c78f1, #4c57d6); font: 800 20px Georgia, serif; box-shadow: 0 7px 18px #5965e832; }
.logo b { display: block; font-size: 18px; letter-spacing: -.02em; }
.logo small { display: block; margin-top: 2px; color: #969bad; font-size: 10px; }
.main-nav { display: grid; gap: 7px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 11px; color: #676d83; font-size: 14px; font-weight: 700; }
.main-nav a span { width: 20px; text-align: center; font-size: 17px; font-weight: 500; }
.main-nav a:hover { background: #f5f5fa; color: var(--ink); }
.main-nav a.active { color: var(--primary); background: #f0f1ff; }
.sidebar-note { margin-top: auto; padding: 16px; border: 1px solid #e7e8fb; border-radius: 13px; background: #f8f8ff; }
.sidebar-note span { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.sidebar-note p { margin: 7px 0 0; color: #777d93; font-size: 11px; line-height: 1.55; }
.account-panel p b, .account-panel p small, .mobile-learner-panel p b, .mobile-learner-panel p small { display: block; }
.account-panel p small, .mobile-learner-panel p small { margin-top: 2px; color: #979bad; font-size: 9px; }
.account-panel form { margin-top: 10px; }
.account-panel button, .mobile-learner-panel button { width: 100%; padding: 7px; color: #777d93; background: #fff; border: 1px solid #e4e5ef; border-radius: 8px; font-size: 10px; font-weight: 800; }
.learner-switch { display: grid; gap: 7px; margin-top: 10px; }
.learner-switch label { display: grid; gap: 5px; color: #777d93; font-size: 10px; font-weight: 800; }
.learner-switch select { padding: 8px 9px; border-radius: 8px; font-size: 11px; }
.learner-switch small { color: #969bad; font-size: 9px; line-height: 1.45; }

.main-content { width: 100%; max-width: 1240px; padding: 46px 52px 80px; margin: 0 auto; }
.mobile-header { display: none; }
.eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 37px); letter-spacing: -.045em; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.page-hero, .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin-bottom: 31px; }
.page-hero p:last-child, .page-heading p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.page-heading { align-items: center; }
.home-hero { min-height: 105px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 44px; padding: 0 18px; border-radius: 11px; font-size: 13px; font-weight: 800; }
.primary-button { color: #fff; background: var(--primary); box-shadow: 0 7px 20px #5965e82b; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { color: var(--primary); border: 1px solid #dfe1f9; background: #f8f8ff; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 38px; }
.summary-grid article { display: flex; align-items: center; gap: 17px; min-height: 96px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px #282b4708; }
.summary-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; font-weight: 900; }
.summary-icon.purple { color: var(--primary); background: #eff0ff; }
.summary-icon.coral { color: var(--coral); background: #fff0ed; }
.summary-icon.green { color: var(--green); background: #eaf9f5; }
.summary-icon.amber { color: #a87822; background: #fbf4e7; }
.summary-grid small { display: block; color: var(--muted); font-size: 12px; }
.summary-grid strong { display: inline-block; margin-top: 3px; font-size: 25px; }
.summary-grid em { margin-left: 4px; color: #9a9daf; font-size: 11px; font-style: normal; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading > a { color: var(--primary); font-size: 12px; font-weight: 800; }
.section-heading.spaced { margin-top: 36px; }

.deck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.deck-card { position: relative; overflow: hidden; padding: 20px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--deck-color); border-radius: 15px; box-shadow: 0 6px 20px #282b4708; }
.deck-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -28px; top: -32px; border-radius: 50%; background: color-mix(in srgb, var(--deck-color) 9%, white); }
.deck-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.deck-top span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--deck-color); font-size: 10px; font-weight: 900; }
.deck-top b { color: #9a9eb0; font-size: 10px; }
.deck-card h3 { margin: 18px 0 5px; font-size: 16px; }
.deck-card p { margin: 0; color: var(--muted); font-size: 11px; }
.deck-actions { display: flex; gap: 8px; margin-top: 18px; }
.deck-actions a { flex: 1; padding: 9px 5px; border-radius: 8px; text-align: center; color: var(--deck-color); background: color-mix(in srgb, var(--deck-color) 8%, white); font-size: 11px; font-weight: 800; }
.deck-actions a:first-child { color: #fff; background: var(--deck-color); }
.deck-actions a:nth-child(2) { color: var(--deck-color); background: color-mix(in srgb, var(--deck-color) 11%, white); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px #282b4708; }
.recent-list { padding: 5px 19px; }
.recent-list > a { display: grid; grid-template-columns: 9px minmax(150px, .8fr) 1.2fr 12px; align-items: center; gap: 15px; padding: 14px 4px; border-bottom: 1px solid #f0f1f5; }
.recent-list > a:last-child { border-bottom: 0; }
.color-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.recent-list b, .recent-list small { display: block; }
.recent-list b { font-size: 13px; }
.recent-list small { margin-top: 3px; color: #a0a4b4; font-size: 10px; }
.recent-list em { color: #666b81; font-size: 12px; font-style: normal; }
.recent-list i { color: #b9bcc8; font-style: normal; }

.flash-stack { position: fixed; z-index: 1000; top: 22px; right: 25px; width: min(390px, calc(100vw - 32px)); display: grid; gap: 9px; pointer-events: none; }
.flash { padding: 13px 16px; margin: 0; border-radius: 11px; font-size: 13px; line-height: 1.45; box-shadow: 0 12px 32px #282b4722; animation: toast-in .22s ease-out, toast-out .28s ease-in 3.4s forwards; pointer-events: auto; }
.flash.success { color: #0d795e; background: #e8f8f3; border: 1px solid #cfeee5; }
.flash.error { color: #b44b3a; background: #fff0ed; border: 1px solid #f9dcd6; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-7px); } }
.form-card { max-width: 850px; padding: 27px; }
.study-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.three-columns { grid-template-columns: repeat(3, 1fr); }
.study-form label { display: grid; gap: 7px; color: #545a72; font-size: 12px; font-weight: 800; }
.study-form label small { display: inline; margin-left: 5px; color: #a2a6b5; font-weight: 500; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid #dddfea; border-radius: 10px; outline: 0; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #9fa6f4; box-shadow: 0 0 0 3px #5965e812; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 11px; padding-top: 5px; }
.form-actions a, .form-actions button { min-width: 100px; padding: 11px 16px; border: 0; border-radius: 10px; text-align: center; font-size: 12px; font-weight: 800; }
.form-actions a { color: #777c90; background: #f0f1f5; }
.form-actions button { color: #fff; background: var(--primary); }
.color-input { width: 70px; height: 43px; padding: 4px; }
.form-warning { margin: -5px 0 0; padding: 10px 12px; color: #9a7126; background: #fff8e9; border-radius: 9px; font-size: 11px; }
.deck-management-layout { display: grid; grid-template-columns: 310px 1fr; gap: 16px; align-items: start; }
.compact-form-card { max-width: 560px; }
.compact-form-card h2 { margin: 0 0 20px; }
.deck-management-list { display: grid; gap: 10px; }
.deck-manage-card { display: grid; grid-template-columns: 45px 1fr auto; gap: 14px; align-items: center; padding: 17px 18px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--deck-color); border-radius: 13px; }
.deck-manage-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--deck-color); border-radius: 11px; font-size: 10px; font-weight: 900; }
.deck-manage-card h3 { margin: 0 0 5px; font-size: 14px; }
.deck-manage-card p { margin: 0; color: var(--muted); font-size: 10px; }
.deck-manage-actions { display: flex; gap: 7px; }
.deck-manage-actions a { padding: 7px 9px; color: var(--primary); background: #f0f1ff; border-radius: 8px; font-size: 10px; font-weight: 800; }
.deck-manage-actions .danger-link { color: #c45f4d; background: #fff0ed; }
.danger-eyebrow { color: #c45f4d; }
.delete-confirm-card { max-width: 620px; padding: 32px; }
.delete-warning-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; background: var(--coral); border-radius: 50%; font-size: 23px; font-weight: 900; }
.delete-confirm-card > p { margin: 0 0 25px; color: #72778d; font-size: 13px; line-height: 1.7; }
.form-actions .danger-button { color: #fff; background: #c45f4d; }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-layout .form-card { max-width: none; }
.learning-volume-settings { grid-column: 1 / -1; }
.settings-description { margin: 8px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.quick-limit-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-limit-buttons button { padding: 7px 11px; color: var(--primary); background: #f0f1ff; border: 1px solid #dfe1f9; border-radius: 8px; font-size: 11px; font-weight: 800; }
.deck-limit-list { display: grid; gap: 10px; }
.deck-limit-row { display: grid; grid-template-columns: 8px minmax(150px, 1fr) 82px auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid #ececf2; border-left: 3px solid var(--deck-color); border-radius: 10px; }
.deck-limit-row label { gap: 3px; }
.deck-limit-row label b, .deck-limit-row label small { display: block; }
.deck-limit-row label small { margin: 0; }
.deck-limit-row input { text-align: center; }
.deck-limit-row .quick-limit-buttons { flex-wrap: nowrap; gap: 4px; }
.deck-limit-row .quick-limit-buttons button { padding: 6px 8px; }
.danger-settings { border-color: #f0d5cf; }
.danger-settings .form-actions .danger-button { background: #c45f4d; }
.auth-page { min-height: 100vh; background: linear-gradient(145deg,#f4f5ff,#fff8f4); }
.auth-page .app-shell { display: block; min-height: 100vh; }
.auth-page .main-content { display: grid; place-items: center; min-height: 100vh; padding: 25px; }
.auth-card { width: min(440px,100%); padding: 34px; }
.auth-logo { margin-bottom: 30px; }
.auth-card h1 { font-size: 31px; }
.auth-description { margin: 9px 0 25px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-actions button { width: 100%; }
.user-management-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.user-list { display: grid; gap: 10px; }
.user-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; padding: 16px; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 11px; font-weight: 900; }
.user-card h3 { margin: 0 0 4px; font-size: 14px; }
.user-card h3 em { margin-left: 6px; padding: 3px 6px; color: var(--primary); background: #eff0ff; border-radius: 99px; font-size: 8px; font-style: normal; }
.user-card h3 em.pending { color: #a87822; background: #fbf4e7; }
.user-card h3 em.sub-admin { color: #0d795e; background: #e8f8f3; }
.user-card h3 em.expired { color: #b23a3a; background: #fdecec; }
.user-card p { margin: 0; color: var(--muted); font-size: 10px; }
.user-card p.user-access-period { margin-top: 5px; color: #565d75; }
.user-card p.user-admin-memo { margin-top: 5px; max-width: 520px; color: #7b6747; white-space: pre-wrap; overflow-wrap: anywhere; }
.user-actions { display: flex; gap: 6px; }
.user-actions a, .user-actions button { padding: 7px 9px; color: var(--primary); background: #f0f1ff; border: 0; border-radius: 7px; font-size: 10px; font-weight: 800; }
.user-actions button { color: #c45f4d; background: #fff0ed; }
.user-actions button.switch-user { color: #0d795e; background: #e8f8f3; }
.user-actions a.deck-access-link { color: #7655b5; background: #f3effb; }
.user-search { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: end; padding: 12px; }
.user-search label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.user-search input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.user-search button, .user-search a { min-height: 36px; display: grid; place-items: center; padding: 0 12px; color: var(--primary); background: #f0f1ff; border: 0; border-radius: 8px; font-size: 10px; font-weight: 800; }
.user-search small { align-self: center; color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; font-size: 11px; }
.pagination a { color: var(--primary); font-weight: 800; }
.deck-access-card { max-width: 820px; }
.deck-access-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.deck-access-toolbar label { flex: 1; display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.deck-access-toolbar input { min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.deck-access-toolbar > div { display: flex; gap: 6px; }
.deck-access-toolbar button { min-height: 40px; padding: 0 12px; color: var(--primary); background: #f0f1ff; border: 0; border-radius: 8px; font-size: 10px; font-weight: 800; }
.deck-access-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.deck-access-list > label { display: grid; grid-template-columns: auto 8px 1fr; gap: 10px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.deck-access-list > label:has(input:checked) { border-color: #cfd2f5; background: #f7f7ff; }
.deck-access-list input { width: auto; }
.deck-access-list b, .deck-access-list small { display: block; }
.deck-access-list b { font-size: 12px; }
.deck-access-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.language-management-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.language-list { display: grid; gap: 9px; }
.language-card { position: relative; padding: 15px; }
.language-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.language-card-heading b { font-size: 14px; }
.language-card-heading code { margin-left: 7px; padding: 3px 6px; color: var(--primary); background: #eff0ff; border-radius: 6px; font-size: 10px; }
.language-card-heading small { color: var(--muted); font-size: 9px; }
.language-edit-row { display: grid; grid-template-columns: 1fr 90px auto auto; gap: 8px; align-items: end; }
.language-edit-row label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.language-edit-row input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.language-edit-row button, .language-delete-form button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 8px; font-size: 10px; font-weight: 800; }
.language-edit-row button { color: #fff; background: var(--primary); }
.language-delete-form { position: absolute; right: 15px; top: 48px; }
.language-delete-form button { color: #c45f4d; background: #fff0ed; }
.user-switch-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -18px 0 24px; padding: 13px 15px; color: #43506b; background: #eef8f5; border: 1px solid #cdebe2; border-radius: 12px; font-size: 12px; }
.user-switch-banner strong { color: #0d795e; }
.user-switch-banner form { margin: 0; }
.user-switch-banner button { padding: 8px 11px; color: #fff; background: #13866a; border: 0; border-radius: 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.checkbox-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.checkbox-label input { width: auto; }
.temporary-password-card { padding: 20px; color: #fff; background: linear-gradient(135deg,#4e5ce5,#6d78f2); border-radius: 14px; box-shadow: 0 10px 26px #5965e830; }
.temporary-password-card > span { font-size: 9px; font-weight: 900; letter-spacing: .08em; opacity: .8; }
.temporary-password-card h3 { margin: 6px 0 13px; font-size: 15px; }
.temporary-password-card > div { display: flex; gap: 8px; }
.temporary-password-card code { flex: 1; padding: 11px 13px; color: #28305e; background: #fff; border-radius: 9px; font-size: 17px; font-weight: 900; letter-spacing: .06em; }
.temporary-password-card button { padding: 0 13px; color: #fff; background: #ffffff20; border: 1px solid #ffffff50; border-radius: 9px; font-weight: 800; }
.temporary-password-card p { margin: 10px 0 0; font-size: 10px; opacity: .82; }
.temporary-password-card .temporary-access-link { display: inline-flex; margin-top: 11px; padding: 8px 10px; color: #34409f; background: #fff; border-radius: 8px; font-size: 10px; font-weight: 900; }
.forced-password-card { margin: 30px auto; }
.change-password-logout { margin-top: 12px; text-align: center; }
.change-password-logout button { color: var(--muted); background: transparent; border: 0; font-size: 11px; text-decoration: underline; }
.settings-target { display: inline-flex; gap: 5px; margin: 12px 0 0; padding: 6px 9px; color: #6e7388; background: #f3f4f8; border-radius: 8px; font-size: 10px; }
.date-delete-settings { grid-column: 1 / -1; }
.date-delete-settings .form-actions .danger-button { background: #c45f4d; }
.review-day-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-day-list > b { grid-column: 1 / -1; color: #545a72; font-size: 11px; }
.review-day-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 11px; color: #555b71; background: #f7f7fb; border: 1px solid #ececf2; border-radius: 9px; text-align: left; }
.review-day-list button:hover { border-color: #cfd2f5; background: #f1f2ff; }
.review-day-list span { font-size: 11px; font-weight: 800; }
.review-day-list small { color: #999daf; font-size: 9px; }
.import-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(360px, 1.2fr); gap: 16px; align-items: start; }
.import-guide { padding: 27px; }
.import-guide > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.field-guide { display: grid; gap: 8px; margin: 20px 0; }
.field-guide div { display: grid; grid-template-columns: 95px 1fr; gap: 12px; padding: 11px 12px; background: #f7f7fb; border-radius: 9px; }
.field-guide b { color: var(--primary); font-size: 11px; }
.field-guide span { color: #6e7388; font-size: 11px; overflow-wrap: anywhere; }

.heading-actions { display: flex; gap: 9px; }
.filter-bar { display: grid; grid-template-columns: minmax(210px, 1fr) repeat(4, minmax(105px, 145px)) auto; gap: 9px; margin-bottom: 17px; }
.filter-bar button { padding: 0 20px; color: #fff; background: var(--primary); border: 0; border-radius: 10px; font-weight: 800; }
.search-field { position: relative; }
.search-field span { position: absolute; left: 13px; top: 10px; color: #999dad; }
.search-field input { padding-left: 36px; }
.result-count { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.library-card { position: relative; padding: 21px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--deck-color); border-radius: 14px; }
.library-meta { display: flex; justify-content: space-between; align-items: center; }
.library-meta span { color: var(--deck-color); font-size: 10px; font-weight: 900; }
.library-meta em { padding: 4px 8px; border-radius: 99px; color: #83879a; background: #f2f3f7; font-size: 9px; font-style: normal; }
.library-meta em.mastered { color: #12856a; background: #e8f8f3; }
.card-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.library-card h3 { margin: 15px 0 2px; font-size: 19px; }
.library-card .pronunciation { margin: 0; color: #a0a4b4; font-size: 11px; }
.library-card .meaning { margin: 13px 0; color: #52576c; font-size: 13px; font-weight: 700; }
.library-card blockquote { margin: 0; padding: 10px 12px; color: #74798d; background: #f7f7fa; border-left: 2px solid #d9dbea; border-radius: 4px; font-size: 11px; line-height: 1.5; }
.library-card blockquote small { display: block; margin-top: 5px; color: #a0a4b4; font-size: 10px; }
.card-back blockquote small { position: static; display: block; margin-top: 7px; color: #a0a4b4; font-size: 10px; font-weight: 500; line-height: 1.5; }
.library-card .note { margin: 10px 0 0; color: #999daf; font-size: 10px; }
.library-card form { display: flex; justify-content: flex-end; margin-top: 9px; }
.text-danger { padding: 3px; color: #c96756; background: transparent; border: 0; font-size: 10px; }
.empty-state { grid-column: 1 / -1; padding: 55px; text-align: center; }
.empty-state > span { font-size: 30px; color: #b7bac8; }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.study-heading form { width: 220px; }
.today-review-count { display: inline-block; margin-top: 12px; padding: 6px 10px; color: var(--primary); background: #eff0ff; border-radius: 99px; font-size: 10px; font-weight: 700; }
.study-progress { display: flex; align-items: center; gap: 16px; max-width: 680px; margin: 0 auto 19px; color: var(--muted); font-size: 11px; }
.study-progress > i { flex: 1; height: 5px; overflow: hidden; border-radius: 99px; background: #e7e8ee; }
.study-progress > i b { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.flashcard-wrap { width: min(680px, 100%); height: 390px; margin: 0 auto; perspective: 1200px; }
.flashcard { position: relative; width: 100%; height: 100%; padding: 0; border: 0; color: inherit; background: transparent; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.flashcard.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 45px; border: 1px solid var(--line); border-top: 4px solid var(--deck-color); border-radius: 22px; background: #fff; box-shadow: 0 17px 45px #282b4712; }
.card-face > small { position: absolute; top: 25px; color: var(--deck-color); font-size: 10px; font-weight: 900; }
.card-face strong { max-width: 92%; font-size: clamp(28px, 5vw, 43px); letter-spacing: -.035em; line-height: 1.25; }
.card-face em { margin-top: 13px; color: #9da1b2; font-size: 13px; font-style: normal; }
.card-face i { position: absolute; bottom: 22px; color: #b0b3c0; font-size: 10px; font-style: normal; }
.card-back { transform: rotateY(180deg); }
.card-back strong { font-size: clamp(21px, 4vw, 31px); }
.card-back blockquote { margin: 22px 0 0; padding: 13px 18px; color: #696f85; background: #f7f7fb; border-radius: 10px; font-size: 13px; }
.card-back em { color: var(--primary); }
.review-panel { max-width: 680px; margin: 22px auto 0; text-align: center; opacity: .38; pointer-events: none; transition: opacity .25s; }
.review-panel.visible { opacity: 1; pointer-events: auto; }
.review-panel > p { margin: 0 0 10px; color: #808598; font-size: 11px; }
.review-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.review-actions button { width: 100%; padding: 10px; border-radius: 11px; background: #fff; border: 1px solid var(--line); }
.review-actions b, .review-actions small { display: block; }
.review-actions b { font-size: 12px; }
.review-actions small { margin-top: 3px; color: #999daf; font-size: 9px; }
.review-actions .again { color: #d06451; border-color: #f0cbc4; }
.review-actions .hard { color: #c18a2a; border-color: #eedebd; }
.review-actions .good { color: #148a6c; border-color: #bfe5da; }
.practice-actions { max-width: 680px; margin: 22px auto 0; display: flex; justify-content: flex-end; }
.practice-actions .primary-button { min-width: 150px; }
.complete-state { max-width: 680px; margin: 45px auto; padding: 55px 25px; text-align: center; }
.complete-state > span { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; color: #fff; background: var(--green); border-radius: 50%; font-size: 25px; }
.complete-state p { color: var(--muted); font-size: 13px; }
.complete-state div { display: flex; justify-content: center; gap: 9px; margin-top: 23px; }
.complete-state form { margin: 0; }
.complete-state .primary-button { border: 0; }

.stats-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.stats-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 15px; }
.stats-layout > .card { padding: 22px; }
.deck-stat-list > div { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #f0f1f5; }
.deck-stat-list > div:last-child { border-bottom: 0; }
.deck-stat-list span b, .deck-stat-list span small { display: block; }
.deck-stat-list span b { font-size: 12px; }
.deck-stat-list span small { margin-top: 3px; color: #9ca0b1; font-size: 9px; }
.deck-stat-list em { font-size: 12px; font-style: normal; font-weight: 900; }
.deck-stat-list i { grid-column: 2 / 4; height: 5px; overflow: hidden; margin-top: -6px; border-radius: 99px; background: #eef0f4; }
.deck-stat-list i b { display: block; height: 100%; border-radius: inherit; }
.review-history > div { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f1f5; }
.review-history > div:last-child { border-bottom: 0; }
.review-history span b, .review-history span small { display: block; }
.review-history span b { font-size: 12px; }
.review-history span small { margin-top: 3px; color: #a0a4b4; font-size: 9px; }
.review-history em { padding: 5px 8px; border-radius: 99px; font-size: 9px; font-style: normal; font-weight: 800; }
.result-good { color: #12856a; background: #e8f8f3; }
.result-hard { color: #a87822; background: #fbf4e7; }
.result-again { color: #c45f4d; background: #fff0ed; }
.empty-inline { color: var(--muted); font-size: 12px; }

@media (max-width: 950px) {
  .app-shell { grid-template-columns: 195px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .main-content { padding: 38px 30px 65px; }
  .deck-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
  .deck-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 12px 14px 24px; }
  .mobile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .flash-stack { top: 67px; right: 16px; }
  .mobile-header .logo { margin: 0; }
  .mobile-header .logo-mark { width: 32px; height: 32px; }
  .mobile-menu { position: relative; }
  .mobile-menu summary { list-style: none; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 800; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu[open] summary { color: var(--primary); border-color: #cfd2f5; background: #f5f5ff; }
  .mobile-menu-panel { position: fixed; z-index: 20; right: 14px; top: 58px; width: min(300px, calc(100vw - 28px)); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px #282b4730; }
  .mobile-menu .main-nav { gap: 4px; }
  .mobile-menu .main-nav a { padding: 10px 11px; font-size: 13px; }
  .mobile-learner-panel { margin-top: 8px; padding: 11px; background: #f8f8ff; border-radius: 10px; }
  .mobile-learner-panel > span { color: var(--primary); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
  .mobile-learner-panel p { margin: 7px 0 10px; }
  .page-hero, .page-heading { align-items: flex-start; flex-direction: column; }
  .page-hero .primary-button, .with-action .primary-button { width: 100%; }
  .summary-grid, .deck-grid, .stats-layout { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: 1fr; }
  .summary-grid { gap: 9px; }
  .summary-grid article { min-height: 78px; }
  .deck-card:last-child { grid-column: auto; }
  .recent-list > a { grid-template-columns: 8px 1fr 12px; }
  .recent-list em { display: none; }
  .form-row, .form-row.three-columns, .library-grid, .import-layout, .settings-layout { grid-template-columns: 1fr; }
  .review-day-list { grid-template-columns: 1fr; }
  .deck-limit-row { grid-template-columns: 8px 1fr 78px; }
  .deck-limit-row .quick-limit-buttons { grid-column: 2 / -1; }
  .deck-management-layout { grid-template-columns: 1fr; }
  .user-management-layout { grid-template-columns: 1fr; }
  .user-card { grid-template-columns: 40px 1fr; }
  .user-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .user-search { grid-template-columns: 1fr auto; }
  .user-search label { grid-column: 1 / -1; }
  .deck-access-toolbar { align-items: stretch; flex-direction: column; }
  .deck-access-list { grid-template-columns: 1fr; }
  .language-management-layout { grid-template-columns: 1fr; }
  .language-edit-row { grid-template-columns: 1fr 90px; }
  .user-switch-banner { align-items: stretch; flex-direction: column; margin-top: 0; }
  .user-switch-banner button { width: 100%; }
  .deck-manage-card { grid-template-columns: 42px 1fr; }
  .deck-manage-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .heading-actions { width: 100%; }
  .heading-actions a { flex: 1; }
  .filter-bar button { min-height: 41px; }
  .study-heading { gap: 10px; margin-bottom: 10px; }
  .study-heading > div { width: 100%; }
  .study-heading > div > p:not(.eyebrow) { display: none; }
  .study-heading .eyebrow { margin-bottom: 4px; }
  .study-heading h1 { font-size: 24px; line-height: 1.2; }
  .study-heading form { width: 100%; }
  .study-heading select { min-height: 40px; padding-block: 8px; }
  .today-review-count { margin-top: 7px; padding: 5px 8px; font-size: 9px; }
  .study-progress { gap: 10px; margin-bottom: 8px; font-size: 10px; }
  .flashcard-wrap { height: clamp(220px, calc(100dvh - 390px), 320px); }
  .card-face { padding: 28px 18px; border-radius: 18px; }
  .card-face > small { top: 16px; max-width: calc(100% - 28px); text-align: center; line-height: 1.35; }
  .card-face strong { max-width: 96%; font-size: clamp(24px, 8vw, 34px); }
  .card-face em { margin-top: 8px; }
  .card-face i { bottom: 13px; }
  .card-back strong { font-size: clamp(19px, 6vw, 25px); }
  .card-back blockquote { margin-top: 13px; padding: 9px 12px; font-size: 11px; line-height: 1.4; }
  .card-back blockquote small { margin-top: 4px; }
  .review-panel { margin-top: 9px; }
  .review-panel > p { margin-bottom: 6px; }
  .review-actions { gap: 6px; }
  .review-actions button { padding: 8px 5px; }
  .complete-state { margin: 18px auto; padding: 32px 18px; }
}

@media (max-width: 720px) and (max-height: 700px) {
  .main-content { padding-top: 8px; }
  .mobile-header { margin-bottom: 8px; }
  .mobile-header .logo small { display: none; }
  .study-heading .eyebrow { display: none; }
  .study-heading h1 { font-size: 21px; }
  .today-review-count { margin-top: 5px; }
  .study-heading select { min-height: 36px; padding-block: 6px; }
  .card-face strong { font-size: clamp(22px, 7vw, 30px); }
}
