:root {
  color-scheme: light;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-soft: #eef2ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --ink: #111827;
  --muted: #687280;
  --line: #e4e7ef;
  --surface: #ffffff;
  --background: #f7f8fc;
  --shadow: 0 12px 32px rgba(54, 64, 92, .07);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; padding: 22px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; font-weight: 800; letter-spacing: -.5px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 14px; }
.app-version { color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: 0; }
.nav { display: grid; gap: 4px; }
.nav-btn { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; color: #556070; background: transparent; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 650; }
.nav-btn:hover { background: #f7f7fd; color: var(--primary); }
.nav-btn.active { color: var(--primary); background: var(--primary-soft); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.admin-sidebar-note { display: grid; gap: 4px; padding: 11px; border: 1px solid #fecaca; border-radius: 11px; color: #991b1b; background: #fff7f7; }
.admin-sidebar-note strong { font-size: 10px; }
.admin-sidebar-note span { font-size: 9px; color: var(--muted); }
.main { min-width: 0; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar-left { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.back-btn { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-size: 17px; transition: .18s ease; }
.back-btn:hover:not(:disabled) { color: var(--primary); border-color: #c7ccff; background: var(--primary-soft); transform: translateX(-1px); }
.back-btn:disabled { opacity: .35; cursor: default; }
.greeting { min-width: 0; }
.greeting h1 { overflow: hidden; margin: 0 0 3px; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.greeting p { font-size: 11px; color: var(--muted); margin: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; font-size: 12px; font-weight: 800; background: linear-gradient(135deg, #f9a8d4, #818cf8); cursor: pointer; }
.avatar-large { width: 48px; height: 48px; font-size: 15px; cursor: default; }
.account-area { position: relative; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 210px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 18px 45px rgba(17,24,39,.16); z-index: 60; }
.account-menu-head { display: grid; gap: 3px; padding: 9px 10px 11px; border-bottom: 1px solid var(--line); }
.account-menu-head strong { font-size: 11px; }
.account-menu-head span { color: var(--muted); font-size: 9px; }
.account-menu button { display: block; width: 100%; border: 0; border-radius: 8px; padding: 9px 10px; color: var(--ink); background: transparent; text-align: left; font-size: 10px; }
.account-menu button:hover { color: var(--primary); background: var(--primary-soft); }
.content { max-width: 1420px; margin: 0 auto; padding: 22px 28px 90px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h2 { margin: 0 0 5px; font-size: 22px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 17px; }
.card h3 { margin: 0 0 15px; font-size: 14px; }
.stat-card { padding: 16px; min-height: 92px; }
.stat-label { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.stat-value { display: flex; align-items: baseline; gap: 5px; font-size: 25px; font-weight: 800; letter-spacing: -.6px; }
.stat-value small { color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-accent { color: var(--primary); }
.section-stack { display: grid; gap: 14px; }
.progress-row { display: grid; grid-template-columns: minmax(110px, 1fr) 3fr 38px; align-items: center; gap: 10px; margin: 11px 0; font-size: 12px; }
.progress { height: 5px; overflow: hidden; background: #edf0f5; border-radius: 99px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.progress.green > span { background: var(--success); }
.progress.orange > span { background: var(--warning); }
.progress-group { padding: 12px 0; border-bottom: 1px solid var(--line); }
.progress-group:last-child { border-bottom: 0; padding-bottom: 0; }
.progress-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 11px; }
.progress-group-head > span { display: grid; gap: 2px; }
.progress-group-head small { color: var(--muted); font-size: 9px; font-weight: 500; }
.progress-set-list { padding: 3px 0 0 18px; }
.progress-set-list .progress-row { grid-template-columns: minmax(120px, 1.2fr) 2fr 36px; margin: 8px 0 0; font-size: 9px; }
.focus-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; border-radius: 11px; padding: 10px; margin: 8px 0; background: var(--danger-soft); border: 1px solid #fee2e2; }
.focus-item:nth-child(3n) { background: var(--success-soft); border-color: #d1fae5; }
.focus-item:nth-child(3n+2) { background: var(--warning-soft); border-color: #fef3c7; }
.focus-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 11px; background: var(--danger); }
.focus-item:nth-child(3n) .focus-icon { background: var(--success); }
.focus-item:nth-child(3n+2) .focus-icon { background: var(--warning); }
.focus-name { font-size: 12px; font-weight: 700; }
.focus-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 9px; font-size: 10px; font-weight: 700; background: var(--primary-soft); color: var(--primary); border: 1px solid #dfe3ff; }
.chip.easy { color: #047857; background: #ecfdf5; border-color: #d1fae5; }
.chip.medium { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.chip.hard { color: #dc2626; background: #fef2f2; border-color: #fecaca; }
.chip.active { color: white; border-color: var(--primary); background: var(--primary); }
.chip.completed { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.chip.history { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 9px 14px; border-radius: 9px; border: 1px solid transparent; font-size: 12px; font-weight: 750; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--primary), #4f46e5); box-shadow: 0 8px 18px rgba(99,102,241,.2); }
.btn-secondary { color: var(--primary); background: white; border-color: #c7ccff; }
.btn-ghost { color: var(--ink); background: white; border-color: var(--line); }
.btn-danger { color: #b91c1c; background: var(--danger-soft); border-color: #fecaca; }
.btn-completed { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.btn-block { width: 100%; }
.subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subject-card { padding: 16px; overflow: hidden; position: relative; }
.subject-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.subject-identity { display: flex; gap: 10px; align-items: center; }
.subject-top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.subject-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--subject-color); font-size: 12px; font-weight: 800; }
.subject-title { font-size: 13px; font-weight: 800; }
.subject-code { color: var(--muted); font-size: 10px; margin-top: 3px; }
.subject-metrics { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 10px; }
.subject-actions { display: flex; gap: 8px; margin-top: 15px; }
.subject-actions .btn { flex: 1; }
.wide-last:last-child:nth-child(odd) { grid-column: 1 / -1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px 14px; font-size: 11px; font-weight: 750; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.donut { --value: 78; width: 128px; height: 128px; display: grid; place-items: center; margin: 4px auto; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--value) * 1%), #e9ebf6 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: white; }
.donut-value { z-index: 1; text-align: center; font-size: 25px; font-weight: 850; }
.donut-value small { display: block; color: var(--muted); font-size: 9px; font-weight: 600; }
.metric-list { display: grid; gap: 10px; }
.metric-item { display: flex; justify-content: space-between; font-size: 11px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.chart { width: 100%; min-height: 190px; overflow: hidden; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart-grid { stroke: #e9ecf4; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); opacity: .8; }
.chapter-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.chapter-item:last-child { border-bottom: 0; }
.exam-set-list, .practice-set-list { display: grid; gap: 9px; }
.exam-set-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; }
.exam-set-number { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--primary); border-radius: 9px; font-size: 11px; font-weight: 850; }
.exam-set-main { display: grid; gap: 4px; min-width: 0; }
.exam-set-main strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.exam-set-main span { color: var(--muted); font-size: 9px; }
.set-progress { display: grid; grid-template-columns: minmax(100px, 1fr) auto; align-items: center; gap: 8px; max-width: 390px; margin-top: 4px; }
.set-progress small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.exam-set-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.exam-duration { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.exam-duration .field { width: 58px; min-height: 34px; padding: 5px 7px; text-align: center; }
.practice-set-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 10px; }
.practice-set-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-set-row > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.studied-set-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -5px 0 12px; color: var(--muted); font-size: 9px; }

.quiz-shell { max-width: 1180px; margin: 0 auto; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 16px; margin-bottom: 12px; }
.timer-danger { color: var(--danger); }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 12px; }
.question-card { min-height: 490px; display: flex; flex-direction: column; padding: 22px; }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 25px; }
.question-text { font-size: 17px; font-weight: 650; line-height: 1.65; margin-bottom: 22px; }
.question-media { display: grid; gap: 10px; justify-items: center; margin: -8px 0 20px; }
.question-media img { display: block; max-width: min(100%, 720px); max-height: 440px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.answer-list { display: grid; gap: 10px; }
.answer { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; text-align: left; color: var(--ink); }
.answer:hover { border-color: #c7ccff; background: #fafaff; }
.answer.selected { border-color: #9ae6c3; background: var(--success-soft); }
.answer-key { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid #d8dce6; border-radius: 50%; font-size: 10px; font-weight: 800; }
.answer.selected .answer-key { color: white; background: var(--primary); border-color: var(--primary); }
.quiz-controls { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; gap: 10px; }
.palette { padding: 14px; }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 12px 0 18px; }
.palette-btn { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 9px; }
.palette-btn.current { color: white; border-color: var(--primary); background: var(--primary); }
.palette-btn.answered { color: #047857; border-color: #a7f3d0; background: #d1fae5; }
.palette-btn.marked { color: #b45309; border-color: #fde68a; background: #fef3c7; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: var(--muted); font-size: 9px; }

.result-hero { text-align: center; padding: 30px 20px 18px; }
.trophy { font-size: 42px; margin-bottom: 7px; }
.score { font-size: 42px; font-weight: 900; letter-spacing: -1px; }
.score small { font-size: 16px; color: var(--muted); }
.score-label { color: var(--success); font-size: 13px; font-weight: 800; margin-top: 4px; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; margin-top: 18px; }
.result-metric { padding: 14px 9px; text-align: center; border-right: 1px solid var(--line); }
.result-metric:last-child { border: 0; }
.result-metric strong { display: block; font-size: 17px; margin-top: 5px; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.analysis-row { display: grid; grid-template-columns: minmax(120px, 1fr) 3fr 42px; align-items: center; gap: 10px; margin: 13px 0; font-size: 11px; }
.analytics-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.attempt-history-list { display: grid; }
.attempt-history-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 82px 82px 60px auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.attempt-history-row:last-child { border-bottom: 0; }
.attempt-history-row > div { display: grid; gap: 3px; min-width: 0; }
.attempt-history-row > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attempt-history-row > div span { color: var(--muted); font-size: 9px; }
.exam-discussion { margin-top: 14px; }
.exam-discussion .section-title-row { align-items: flex-start; margin-bottom: 12px; }
.exam-discussion .section-title-row h3 { margin: 0; }
.exam-discussion .section-title-row p { margin: 5px 0 0; }
.exam-comment-list { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.exam-comment { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.exam-comment:last-child { border-bottom: 0; }
.exam-comment-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); font-size: 9px; font-weight: 850; }
.exam-comment-body { min-width: 0; }
.exam-comment-head { display: flex; align-items: center; gap: 8px; }
.exam-comment-head strong { font-size: 11px; }
.exam-comment-head time { color: var(--muted); font-size: 8px; }
.exam-comment-head button { width: 24px; height: 24px; display: grid; place-items: center; margin-left: auto; border: 0; border-radius: 7px; color: #b91c1c; background: transparent; font-size: 16px; }
.exam-comment-head button:hover { background: var(--danger-soft); }
.exam-comment-body p { margin: 6px 0 0; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.exam-comment-form { display: grid; gap: 9px; margin-top: 13px; }
.exam-comment-form textarea { resize: vertical; line-height: 1.5; }
.exam-comment-form > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exam-comment-form > div > span, .exam-discussion-gate { color: var(--muted); font-size: 12px; line-height: 1.5; }
.exam-discussion-gate { margin-top: 12px; padding: 11px; border: 1px dashed #c7d2fe; border-radius: 9px; background: var(--primary-soft); text-align: center; }
.chip.discussion { color: #0369a1; background: #e0f2fe; }
.review-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.review-legend span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.legend-correct { color: #047857; background: var(--success-soft); border: 1px solid #a7f3d0; }
.legend-wrong { color: #b91c1c; background: var(--danger-soft); border: 1px solid #fecaca; }
.attempt-review-list { display: grid; gap: 14px; max-width: 900px; margin: 0 auto; }
.attempt-review-card { padding: 18px; }
.attempt-review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.attempt-review-head > strong { font-size: 12px; }
.review-status { padding: 5px 9px; border-radius: 99px; font-size: 9px; font-weight: 800; }
.review-status.correct { color: #047857; background: var(--success-soft); }
.review-status.wrong { color: #b91c1c; background: var(--danger-soft); }
.review-status.skipped { color: #92400e; background: var(--warning-soft); }
.attempt-review-prompt { font-size: 14px; font-weight: 750; line-height: 1.6; margin-bottom: 13px; }
.attempt-review-media { display: grid; justify-items: center; gap: 8px; margin: 8px 0 14px; }
.attempt-review-media img { display: block; max-width: min(100%, 680px); max-height: 380px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; }
.attempt-review-options { display: grid; gap: 8px; }
.attempt-review-option { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 11px; }
.attempt-review-option.correct-answer { color: #065f46; border-color: #86efac; background: #dcfce7; }
.attempt-review-option.wrong-answer { color: #991b1b; border-color: #fca5a5; background: #fee2e2; }
.attempt-review-option.correct-answer .answer-key { color: white; border-color: var(--success); background: var(--success); }
.attempt-review-option.wrong-answer .answer-key { color: white; border-color: var(--danger); background: var(--danger); }
.attempt-review-option > strong { font-size: 9px; white-space: nowrap; }

.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 13px; }
.filter-field { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.field, .select { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 8px 10px; color: var(--ink); outline: none; }
.field:focus, .select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.password-control { position: relative; }
.password-control .field { width: 100%; padding-right: 44px; }
.password-control button { position: absolute; top: 50%; right: 5px; width: 34px; height: 32px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 15px; }
.password-control button:hover { color: var(--primary); background: var(--primary-soft); }
.wrong-list { display: grid; gap: 9px; }
.wrong-panel-head { margin-bottom: 12px; }
.wrong-panel-head .subject-code { margin: 4px 0 0; }
.wrong-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px; }
.wrong-index { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--primary-2); font-size: 10px; font-weight: 800; }
.wrong-title { font-size: 12px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrong-meta { color: var(--muted); font-size: 10px; margin-top: 4px; }
.plan-head-actions { display: flex; align-items: center; gap: 8px; }
.month-calendar { padding: 15px; margin-bottom: 14px; background: linear-gradient(145deg, #f8faff, #eef2ff); }
.calendar-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.calendar-title > div { display: grid; gap: 3px; }
.calendar-title strong { font-size: 14px; text-transform: capitalize; }
.calendar-title span { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.calendar-nav { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid #c7d2fe; border-radius: 9px; color: #4338ca; background: white; font-size: 16px; font-weight: 800; box-shadow: 0 2px 6px rgba(79,70,229,.1); }
.calendar-nav:hover { color: white; border-color: var(--primary); background: var(--primary); }
.calendar-today-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--primary) !important; font-weight: 750; }
.calendar-today-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-weekdays { margin-bottom: 5px; }
.calendar-weekdays strong { color: #475569; font-size: 8px; font-weight: 800; text-align: center; }
.calendar-day { min-height: 36px; display: grid; place-items: center; position: relative; border: 1px solid #d8deef; border-radius: 8px; color: #1e293b; background: #fff; font-size: 10px; font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.calendar-day.has-tasks { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.calendar-day.today { color: white; border-color: #4338ca; background: linear-gradient(135deg, #6366f1, #4f46e5); font-weight: 850; box-shadow: 0 4px 10px rgba(79,70,229,.28); }
.calendar-day.outside { border-color: transparent; background: transparent; box-shadow: none; }
.calendar-day small { position: absolute; right: 3px; bottom: 3px; min-width: 13px; height: 13px; display: grid; place-items: center; border-radius: 99px; color: white; background: var(--success); font-size: 7px; }
.calendar-day.today small { color: var(--primary); background: white; }
.plan-board { margin-top: 0; }
.plan-week-tab { display: grid; gap: 3px; min-width: 150px; text-align: left; }
.plan-week-tab small { color: var(--muted); font-size: 8px; font-weight: 550; }
.plan-week-tab.active small { color: #6366f1; }
.plan-week-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-day { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; overflow: hidden; }
.plan-day:last-child:nth-child(odd) { grid-column: 1 / -1; }
.plan-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--primary-soft); }
.plan-day-head > div { display: grid; gap: 2px; }
.plan-day-head strong { color: #4338ca; font-size: 11px; }
.plan-day-head small { color: var(--muted); font-size: 8px; }
.plan-day-head span { color: var(--muted); font-size: 8px; }
.plan-day-tasks { padding: 0 11px; }
.plan-day-empty { padding: 17px 5px; color: var(--muted); text-align: center; font-size: 9px; }
.plan-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 24px; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border: 0; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #cfd5e1; background: white; color: white; }
.check.done { background: var(--success); border-color: var(--success); }
.plan-text { font-size: 12px; font-weight: 650; }
.plan-text.done { text-decoration: line-through; color: var(--muted); }
.plan-task-main { display: grid; gap: 4px; min-width: 0; }
.plan-task-main small { color: var(--muted); font-size: 8px; }
.plan-delete { width: 24px; height: 24px; border: 0; border-radius: 7px; color: #b91c1c; background: transparent; font-size: 15px; }
.plan-delete:hover { background: var(--danger-soft); }
.plan-progress { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); }
.plan-save-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.plan-save-row > span { color: var(--muted); font-size: 9px; }
.plan-task-input { resize: vertical; line-height: 1.5; }

.dropzone { display: grid; place-items: center; min-height: 175px; text-align: center; border: 1.5px dashed #b9c0d2; border-radius: 13px; background: #fbfcff; padding: 24px; }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.file-picker { position: relative; display: inline-flex; min-width: 112px; min-height: 44px; margin-top: 8px; overflow: hidden; border-radius: 9px; }
.file-picker .btn { width: 100%; min-height: 44px; pointer-events: none; }
.file-picker input[type="file"] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.file-picker:focus-within { outline: 3px solid rgba(99,102,241,.25); outline-offset: 2px; }
.file-picker.disabled { opacity: .5; pointer-events: none; }
.drop-icon { font-size: 34px; margin-bottom: 8px; }
.preview-list, .import-issues {
  max-height: 480px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: #9ca3af #eef0f5;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
}
.preview-list { display: grid; gap: 10px; padding-right: 7px; }
.import-issues { margin-top: 12px; padding-right: 7px; }
.preview-list::-webkit-scrollbar, .import-issues::-webkit-scrollbar { width: 11px; }
.preview-list::-webkit-scrollbar-track, .import-issues::-webkit-scrollbar-track { border-radius: 99px; background: #eef0f5; }
.preview-list::-webkit-scrollbar-thumb, .import-issues::-webkit-scrollbar-thumb { border: 2px solid #eef0f5; border-radius: 99px; background: #9ca3af; }
.preview-list::-webkit-scrollbar-thumb:hover, .import-issues::-webkit-scrollbar-thumb:hover { background: #6b7280; }
.preview-item { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.preview-item h4 { font-size: 12px; margin: 0 0 8px; }
.preview-option { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; margin: 3px 0; padding: 4px 6px; border-radius: 6px; }
.preview-option.correct { color: #047857; background: var(--success-soft); }
.preview-option > span { margin-left: auto; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.preview-media { display: grid; gap: 7px; justify-items: center; margin: 8px 0; }
.preview-media img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 7px; border: 1px solid var(--line); }
.import-error { margin: 12px 0 0; color: var(--danger); font-size: 11px; }
.import-workspace { align-items: start; }
.section-title-row, .import-question-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title-row h3 { margin-bottom: 0; }
.import-help { margin: 8px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.import-question-editor { display: grid; gap: 9px; }
.import-question-head { font-size: 11px; }
.import-prompt { width: 100%; resize: vertical; line-height: 1.45; font-weight: 700; }
.import-options { display: grid; gap: 7px; }
.import-option-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 25px; align-items: center; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.import-option-row.correct { border-color: #a7f3d0; background: var(--success-soft); }
.import-option-key { color: var(--primary); font-size: 11px; font-weight: 850; text-align: center; }
.import-option-row.correct .import-option-key { color: #047857; }
.import-option-text { width: 100%; min-height: 34px; padding: 6px 8px; font-size: 10px; }
.correct-toggle { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.correct-toggle input { accent-color: var(--success); }
.import-option-row.correct .correct-toggle { color: #047857; }
.btn-icon-danger, .btn-link-danger { border: 0; color: #b91c1c; background: transparent; }
.btn-icon-danger { width: 25px; height: 25px; border-radius: 7px; font-size: 17px; line-height: 1; }
.btn-icon-danger:hover { background: var(--danger-soft); }
.btn-link-danger { padding: 3px 0; font-size: 9px; font-weight: 750; }
.btn-small { min-height: 32px; padding: 6px 10px; font-size: 10px; justify-self: start; }
.import-empty-options { padding: 12px; color: var(--muted); background: #fafbfe; border: 1px dashed var(--line); border-radius: 8px; font-size: 10px; text-align: center; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.issue:last-child { border: 0; }
.issue-level { flex: 0 0 56px; text-transform: uppercase; font-size: 8px; font-weight: 800; }
.issue-level.error { color: var(--danger); }
.issue-level.warning { color: var(--warning); }
.issue-level.info { color: var(--primary); }
.issue-level.ok { color: var(--success); }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17,24,39,.38); backdrop-filter: blur(3px); z-index: 100; }
.modal { width: min(480px, 100%); padding: 20px; background: white; border-radius: 16px; box-shadow: 0 25px 80px rgba(17,24,39,.25); }
.modal h3 { margin: 0 0 16px; }
.modal-copy { margin: -7px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.mfa-modal { width: min(440px, 100%); }
.mfa-factor-summary { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #c7d2fe; border-radius: 10px; color: #3730a3; background: var(--primary-soft); }
.mfa-factor-summary > span { font-size: 20px; }
.mfa-factor-summary > strong { font-size: 11px; overflow-wrap: anywhere; }
.mfa-recaptcha { min-height: 1px; }
.mfa-code-input { font-size: 20px; font-weight: 800; letter-spacing: .35em; text-align: center; }
.mfa-actions { flex-wrap: wrap; }
.profile-modal { width: min(820px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.profile-settings { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.profile-settings h4 { margin: 0 0 12px; font-size: 13px; }
.profile-settings .card { box-shadow: none; }
.form-grid { display: grid; gap: 12px; }
.label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.icon-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.icon-picker legend { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.icon-options { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-options input { position: absolute; opacity: 0; pointer-events: none; }
.icon-options span { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 18px; cursor: pointer; }
.icon-options input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px #e0e7ff; }
.profile-summary { display: flex; align-items: center; gap: 11px; padding: 11px; margin-bottom: 14px; border-radius: 11px; background: var(--primary-soft); }
.profile-summary > div:last-child { display: grid; gap: 3px; }
.profile-summary strong { font-size: 12px; }
.profile-summary span { color: var(--muted); font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 230px; max-width: 360px; color: white; background: #1f2937; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.empty { text-align: center; color: var(--muted); padding: 40px 18px; }
.mobile-nav { display: none; }
.install-hint { padding: 10px; border-radius: 10px; color: #4338ca; background: var(--primary-soft); font-size: 10px; line-height: 1.5; }
.support-card { display: grid; justify-items: center; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(54,64,92,.08); }
.support-card > img { display: block; width: 172px; height: 172px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: white; image-rendering: auto; }
.coffee-invite { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 6px; padding: 7px 6px; border: 1px solid #fb923c; border-radius: 7px; color: white; background: linear-gradient(135deg, #fb923c, #f97316); box-shadow: 0 5px 12px rgba(249,115,22,.2); }
.coffee-invite > span:first-child { font-size: 19px; text-align: center; }
.coffee-invite > span:last-child { font-size: 9px; font-weight: 800; line-height: 1.35; }
.cafe-page { display: grid; place-items: start center; padding: 10px 0 24px; }
.cafe-card { width: min(250px, 100%); padding: 14px; }
.cafe-card > img { width: 220px; max-width: 100%; height: auto; aspect-ratio: 1; }
.cafe-card .coffee-invite { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 9px; }
.cafe-card .coffee-invite > span:first-child { font-size: 23px; }
.cafe-card .coffee-invite > span:last-child { font-size: 11px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at top left, #eef2ff, transparent 42%), var(--background); }
.auth-card { width: min(430px, 100%); padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(79,70,229,.12); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.auth-brand img { width: 42px; height: 42px; }
.auth-brand > div { display: grid; gap: 3px; }
.auth-brand strong { font-size: 18px; }
.auth-brand span { color: var(--muted); font-size: 10px; }
.auth-brand .app-version { font-size: 8px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin-bottom: 16px; border-radius: 10px; background: #f2f4f8; }
.auth-tabs button { border: 0; border-radius: 8px; padding: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; }
.auth-tabs button.active { color: var(--primary); background: white; box-shadow: 0 2px 8px rgba(17,24,39,.07); }
.auth-form { display: grid; gap: 12px; }
.auth-text-link { justify-self: end; margin-top: -5px; padding: 2px 0; border: 0; color: var(--primary); background: transparent; font-size: 10px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.auth-text-link:hover { color: #4338ca; }
.auth-error { padding: 9px 11px; margin-bottom: 12px; border: 1px solid #fecaca; border-radius: 9px; color: #b91c1c; background: var(--danger-soft); font-size: 10px; }
.auth-note { margin: 15px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; text-align: center; }
.auth-policy-links, .payment-policy-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px 14px; }
.auth-policy-links { padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); }
.auth-policy-links a, .payment-policy-links a { color: var(--muted); font-size: 9px; font-weight: 650; text-underline-offset: 2px; }
.auth-policy-links a:hover, .payment-policy-links a:hover { color: var(--primary); }
.admin-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at top left, #fee2e2, transparent 42%), var(--background); }
.admin-card { width: min(960px, 100%); padding: 24px; border: 2px solid #fecaca; border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(127,29,29,.12); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-head-actions { display: flex; align-items: center; gap: 8px; }
.admin-head h1 { margin: 8px 0 4px; font-size: 23px; }
.admin-head p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-badge { display: inline-flex; padding: 4px 8px; border-radius: 99px; color: #b91c1c; background: #fee2e2; font-size: 9px; font-weight: 850; letter-spacing: .8px; }
.admin-stat { display: grid; gap: 8px; margin: 24px 0 16px; padding: 22px; border: 1px solid #fecaca; border-radius: 14px; background: #fff7f7; }
.admin-stat > span { color: #7f1d1d; font-size: 12px; font-weight: 750; }
.admin-stat > strong { color: #dc2626; font-size: 42px; line-height: 1; }
.admin-stat > small { color: var(--muted); font-size: 9px; }
.admin-stat > small.error { color: #b91c1c; }
.admin-users-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 22px 0 12px; }
.admin-users-head h2 { margin: 0 0 4px; font-size: 16px; }
.admin-users-head p { margin: 0; color: var(--muted); font-size: 10px; }
.admin-users-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; scrollbar-gutter: stable; }
.admin-users-table { width: 100%; border-collapse: collapse; background: white; font-size: 11px; }
.admin-users-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; color: #7f1d1d; background: #fff7f7; text-align: left; white-space: nowrap; }
.admin-users-table td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-users-table td:first-child { width: 48px; text-align: center; }
.admin-users-table td:nth-child(2) { min-width: 190px; }
.admin-users-table td:nth-child(3) { min-width: 210px; overflow-wrap: anywhere; }
.admin-users-table td:nth-child(4) { min-width: 150px; }
.admin-users-table td:last-child { width: 76px; text-align: right; }
.admin-users-table strong, .admin-users-table small { display: block; }
.admin-users-table small { max-width: 220px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; }
.admin-users-empty { padding: 34px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 11px; }
.chip.shared-content { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
.shared-sync-error { margin: 0 0 14px; }
.feedback-waiting { min-height: 330px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 30px; text-align: center; }
.feedback-waiting h3, .feedback-waiting p { margin: 0; }
.feedback-waiting p { max-width: 480px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.feedback-hero { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 22px; background: var(--primary-soft); font-size: 32px; }
.rating-field { margin: 0 0 14px; padding: 0; border: 0; }
.rating-field legend { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.rating-stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rating-stars input { position: absolute; opacity: 0; pointer-events: none; }
.rating-stars label { color: #d1d5db; font-size: 30px; line-height: 1; cursor: pointer; transition: color .15s ease, transform .15s ease; }
.rating-stars input:checked ~ label, .rating-stars label:hover, .rating-stars label:hover ~ label { color: #f59e0b; }
.rating-stars label:hover { transform: scale(1.08); }
.feedback-summary { display: flex; align-items: baseline; gap: 7px; margin-bottom: 14px; }
.feedback-summary strong { color: var(--primary); font-size: 28px; }
.feedback-summary span { color: var(--muted); font-size: 10px; }
.feedback-list { max-height: 560px; overflow-y: auto; padding-right: 7px; scrollbar-gutter: stable; }
.feedback-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-item-head { display: flex; justify-content: space-between; gap: 12px; }
.feedback-item-head strong { color: #f59e0b; font-size: 13px; letter-spacing: 1px; }
.feedback-item-head time, .feedback-item > span { color: var(--muted); font-size: 9px; }
.feedback-item > span { display: block; margin-top: 3px; }
.feedback-item p { margin: 8px 0 0; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-card { max-width: 720px; }
.share-link-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
.copy-button { position: relative; width: 44px; height: 38px; border: 1px solid #c7d2fe; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.copy-button span { position: absolute; width: 14px; height: 17px; border: 1.5px solid currentColor; border-radius: 2px; background: var(--primary-soft); }
.copy-button span:first-child { left: 13px; top: 8px; }
.copy-button span:last-child { left: 17px; top: 12px; background: white; }
.copy-button:hover { color: white; border-color: var(--primary); background: var(--primary); }
.copy-button:hover span { background: var(--primary); }
.support-settings-form { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 14px; }
.support-preview { width: min(260px, 100%); aspect-ratio: 1; display: grid; place-items: center; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.support-preview img { width: 100%; height: 100%; object-fit: contain; }
.payment-product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: stretch; }
.payment-product-card { min-height: 320px; display: flex; flex-direction: column; gap: 12px; padding: 20px; overflow: hidden; position: relative; }
.payment-product-card h3, .payment-product-card p { margin: 0; }
.payment-product-card h3 { padding-right: 72px; font-size: 17px; }
.payment-product-card p { min-height: 48px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.payment-product-card > small { display: block; margin-bottom: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; white-space: pre-line; }
.payment-product-card .btn { margin-top: auto; }
.payment-product-badge { position: absolute; top: 18px; right: 18px; padding: 5px 8px; border-radius: 99px; color: #5b21b6; background: #ede9fe; font-size: 8px; font-weight: 850; letter-spacing: .5px; }
.payment-price { color: var(--primary); font-size: 25px; font-weight: 900; letter-spacing: -.5px; }
.payment-price small { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 0; }
.subscription-plan-grid { margin-top: 14px; }
.subscription-plan { border-top: 4px solid #cbd5e1; }
.subscription-plan-plus { border-top-color: #6366f1; }
.subscription-plan-pro { border-top-color: #f59e0b; }
.subscription-plan-pro .payment-product-badge { color: #92400e; background: #fef3c7; }
.subscription-benefits { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--ink); font-size: 10px; line-height: 1.45; }
.subscription-benefits li { position: relative; padding-left: 19px; }
.subscription-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.payment-message { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 28px; text-align: center; }
.payment-message > div { font-size: 42px; }
.payment-message h3, .payment-message p { margin: 0; }
.payment-message p { max-width: 560px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.payment-safety-note, .payment-foundation-warning { border: 1px solid #fcd34d; border-radius: 11px; color: #854d0e; background: #fffbeb; }
.payment-safety-note { margin-top: 14px; padding: 12px 14px; font-size: 10px; line-height: 1.55; }
.payment-policy-links { margin: 14px 0 0; }
.payment-foundation-warning { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px 14px; }
.payment-foundation-warning strong { flex: 0 0 auto; font-size: 10px; }
.payment-foundation-warning span { font-size: 10px; line-height: 1.5; }
.payment-entitlements { margin-top: 14px; }
.payment-checkout { width: min(620px, 100%); display: grid; justify-items: center; gap: 16px; margin: 0 auto; padding: 22px; }
.payment-checkout-status { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #c7d2fe; border-radius: 12px; background: #eef2ff; }
.payment-checkout-status > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--primary); font-size: 20px; font-weight: 900; }
.payment-checkout-status h3, .payment-checkout-status p { margin: 0; }
.payment-checkout-status p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.payment-checkout-status.is-terminal { border-color: #bbf7d0; background: #f0fdf4; }
.payment-checkout-status.is-terminal > span { background: var(--success); }
.payment-checkout-qr { width: min(330px, 86vw); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 14px; object-fit: contain; background: white; }
.payment-countdown { color: var(--muted); font-size: 11px; }
.payment-countdown strong { color: #b45309; font-size: 15px; font-variant-numeric: tabular-nums; }
.payment-checkout-details { width: 100%; display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.payment-checkout-details > div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 12px; padding: 11px 13px; border-top: 1px solid var(--line); }
.payment-checkout-details > div:first-child { border-top: 0; }
.payment-checkout-details dt { color: var(--muted); font-size: 10px; }
.payment-checkout-details dd { margin: 0; color: var(--ink); font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.payment-content-row dd { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.payment-content-row code { padding: 5px 7px; border-radius: 6px; color: #4338ca; background: #eef2ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.payment-copy-button { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--primary); background: white; cursor: pointer; }
.payment-checkout-actions { width: 100%; display: flex; justify-content: center; gap: 9px; }
.entitlement-row, .profile-entitlement-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.entitlement-row > span, .profile-entitlement-row > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 12px; font-weight: 850; }
.entitlement-row.is-inactive > span, .profile-entitlement-row.is-inactive > span { background: #94a3b8; }
.entitlement-row > div, .profile-entitlement-row > div { display: grid; gap: 3px; min-width: 0; }
.entitlement-row strong, .profile-entitlement-row strong { font-size: 11px; overflow-wrap: anywhere; }
.entitlement-row small, .profile-entitlement-row small { color: var(--muted); font-size: 9px; }
.profile-entitlements { margin-top: 18px; padding: 13px; border: 1px solid #a7f3d0; border-radius: 11px; background: #f0fdf4; }
.profile-entitlements h4 { margin: 0 0 3px; color: #047857; font-size: 12px; }
.profile-entitlement-row { border-top-color: #d1fae5; }
.payment-stats { margin-bottom: 14px; }
.payment-stats .stat-value { font-size: 18px; overflow-wrap: anywhere; }
.payment-admin-grid { align-items: start; margin-bottom: 14px; }
.payment-admin-section { margin-bottom: 14px; }
.payment-checkbox-group { min-width: 0; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.payment-checkbox-group legend, .payment-mappings legend { padding: 0 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.payment-checkbox-group { display: flex; flex-wrap: wrap; gap: 9px 14px; }
.payment-checkbox-group label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 10px; font-weight: 650; }
.payment-checkbox-group input, .payment-active-toggle input { accent-color: var(--primary); }
.payment-preflight { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.payment-preflight li { display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 10px; line-height: 1.4; }
.payment-preflight li > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 850; }
.payment-preflight .ok { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.payment-preflight .ok > span { background: var(--success); }
.payment-preflight .fail { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.payment-preflight .fail > span { background: var(--warning); }
.payment-role-note { color: var(--muted); font-size: 9px; line-height: 1.5; }
.payment-admin-products { display: grid; gap: 9px; margin-top: 13px; }
.payment-admin-product { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.payment-admin-product > div { display: grid; gap: 4px; min-width: 0; }
.payment-admin-product strong { font-size: 11px; overflow-wrap: anywhere; }
.payment-admin-product span, .payment-admin-product small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.plan-visibility-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 13px 14px; border: 1px solid #c7d2fe; border-radius: 11px; background: #f8faff; }
.plan-visibility-copy { min-width: 0; display: grid; gap: 4px; }
.plan-visibility-copy strong { color: var(--ink); font-size: 11px; }
.plan-visibility-copy span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.plan-visibility-toggle { flex: 0 0 auto; min-width: 92px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 999px; color: #475569; background: #fff; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.plan-visibility-toggle:disabled { cursor: not-allowed; opacity: .55; }
.plan-visibility-toggle:not(:disabled):hover { box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.plan-visibility-toggle > strong { min-width: 23px; font-size: 9px; letter-spacing: .05em; text-align: center; }
.plan-visibility-track { width: 34px; height: 19px; display: flex; align-items: center; padding: 2px; border-radius: 999px; background: #cbd5e1; transition: background .2s ease; }
.plan-visibility-track > span { width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.24); transform: translateX(0); transition: transform .2s ease; }
.plan-visibility-toggle.is-on { color: #047857; border-color: #6ee7b7; background: #ecfdf5; }
.plan-visibility-toggle.is-on .plan-visibility-track { background: #10b981; }
.plan-visibility-toggle.is-on .plan-visibility-track > span { transform: translateX(15px); }
.admin-plan-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.admin-plan-row { min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-content: start; gap: 9px; padding: 13px; border: 1px solid var(--line); border-top: 3px solid #cbd5e1; border-radius: 11px; background: #fbfcff; }
.admin-plan-plus { border-top-color: #6366f1; }
.admin-plan-pro { border-top-color: #f59e0b; }
.admin-plan-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #eef2ff; font-size: 17px; }
.admin-plan-row > div { min-width: 0; display: grid; gap: 4px; }
.admin-plan-row strong { font-size: 12px; overflow-wrap: anywhere; }
.admin-plan-row span:not(.admin-plan-icon) { color: var(--primary); font-size: 11px; font-weight: 800; }
.admin-plan-row small { color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-plan-row .btn { grid-column: 1 / -1; width: 100%; margin-top: 3px; }
.payment-audit-list { display: grid; }
.payment-audit-row { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(200px, 1.4fr) auto; align-items: start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.payment-audit-row:first-child { border-top: 0; }
.payment-audit-row > div { display: grid; gap: 3px; }
.payment-audit-row strong { font-size: 10px; }
.payment-audit-row span, .payment-audit-row time { color: var(--muted); font-size: 9px; }
.payment-audit-row p { margin: 0; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.payment-order-status { display: inline-flex; padding: 4px 7px; border: 1px solid #c7d2fe; border-radius: 99px; color: #4338ca; background: var(--primary-soft); font-size: 8px; font-weight: 800; }
.payment-orders-table td:last-child { width: auto; text-align: left; }
.payment-reconcile-form { min-width: 210px; display: grid; gap: 6px; margin-top: 7px; }
.payment-reconcile-form .field { min-height: 31px; padding: 5px 7px; font-size: 9px; }
.payment-product-modal { width: min(920px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.payment-product-modal > .section-title-row { flex: 0 0 auto; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.payment-product-modal > .section-title-row h3 { margin-bottom: 8px; }
.payment-product-modal .modal-copy { margin: 0; }
.payment-product-form-scroll { min-height: 0; overflow-y: auto; padding: 15px 6px 5px 0; scrollbar-gutter: stable; }
.payment-modal-close, .payment-mapping-remove { display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.payment-modal-close { width: 34px; height: 34px; flex: 0 0 34px; font-size: 23px; }
.payment-modal-close:hover, .payment-mapping-remove:hover { color: #b91c1c; background: var(--danger-soft); }
.payment-active-toggle { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #a7f3d0; border-radius: 9px; color: #065f46; background: #ecfdf5; font-size: 10px; font-weight: 750; }
.payment-mappings { min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.payment-mappings > p { margin: 0 0 11px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.payment-mapping-list { display: grid; gap: 9px; margin-bottom: 10px; }
.payment-mapping-row { display: grid; grid-template-columns: .8fr .9fr 1fr 1.25fr .9fr 32px; align-items: end; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.payment-mapping-row .label { font-size: 9px; }
.payment-mapping-row .field, .payment-mapping-row .select { width: 100%; min-width: 0; min-height: 35px; padding: 6px 8px; font-size: 9px; }
.payment-mapping-remove { width: 32px; height: 35px; font-size: 20px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(99,102,241,.28); outline-offset: 2px; }
.success-modal { text-align: center; }
.success-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; color: white; background: var(--success); font-size: 28px; font-weight: 850; }

@media (max-width: 1050px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .quiz-layout { grid-template-columns: 1fr 210px; }
  .payment-admin-grid { grid-template-columns: 1fr; }
  .admin-plan-list { grid-template-columns: 1fr; }
  .payment-mapping-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-mapping-remove { align-self: end; }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 16px; }
  .top-actions .icon-btn { display: none; }
  .content { padding: 16px 14px 138px; }
  .user-shell-layout .content { padding-bottom: 190px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
  .page-head h2 { font-size: 19px; }
  .grid-4, .grid-3, .grid-2, .subject-grid { grid-template-columns: 1fr; }
  .plan-visibility-control { align-items: flex-start; }
  .stats-mobile { grid-template-columns: repeat(3, 1fr); }
  .stats-mobile .stat-card:first-child { grid-column: 1 / -1; }
  .subject-grid .wide-last { grid-column: auto !important; }
  .quiz-layout { grid-template-columns: 1fr; }
  .palette { display: none; }
  .question-card { min-height: calc(100vh - 180px); padding: 16px; }
  .question-text { font-size: 15px; }
  .quiz-head { padding: 10px 12px; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
  .result-metric:nth-child(2) { border-right: 0; }
  .result-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .exam-set-card { grid-template-columns: 34px minmax(0, 1fr); }
  .exam-set-actions { grid-column: 2; }
  .attempt-history-row { grid-template-columns: repeat(4, auto); align-items: end; }
  .attempt-history-row > div:first-child { grid-column: 1 / -1; }
  .exam-discussion { padding: 15px; }
  .exam-discussion .section-title-row { align-items: stretch; flex-direction: column; }
  .exam-comment-form > div { align-items: stretch; flex-direction: column; }
  .exam-comment-form .btn { width: 100%; }
  .attempt-review-card { padding: 14px; }
  .attempt-review-option { grid-template-columns: 26px minmax(0, 1fr); }
  .attempt-review-option > strong { grid-column: 2; white-space: normal; }
  .wrong-item { grid-template-columns: 34px minmax(0, 1fr); }
  .wrong-item > :last-child { grid-column: 2; }
  .plan-head-actions { width: 100%; flex-wrap: wrap; }
  .plan-head-actions .select, .plan-head-actions .btn { flex: 1; }
  .month-calendar { padding: 11px; }
  .calendar-day { min-height: 32px; }
  .plan-week-tab { min-width: 138px; }
  .plan-week-grid { grid-template-columns: 1fr; }
  .plan-day:last-child:nth-child(odd) { grid-column: auto; }
  .plan-item { grid-template-columns: 24px minmax(0, 1fr) 24px; }
  .plan-item .chip { grid-column: 2; justify-self: start; }
  .plan-delete { grid-column: 3; grid-row: 1; }
  .plan-save-row { flex-wrap: wrap; }
  .plan-save-row .btn { margin-left: auto; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, minmax(48px, auto)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .user-mobile-nav { grid-template-rows: repeat(3, minmax(48px, auto)); }
  .mobile-nav button { min-width: 0; min-height: 48px; padding: 4px 2px; border: 0; background: transparent; color: var(--muted); display: grid; gap: 2px; place-items: center; font-size: 9px; line-height: 1.15; }
  .mobile-nav button span:first-child { font-size: 16px; }
  .mobile-nav button.active { color: var(--primary); }
  .toast-root { left: 14px; right: 14px; bottom: 176px; }
  .toast { min-width: 0; max-width: none; }
  .admin-head { flex-direction: column; }
  .admin-head-actions { width: 100%; flex-direction: column; }
  .admin-head .btn { width: 100%; }
  .admin-users-head { align-items: stretch; flex-direction: column; }
  .admin-users-head .btn { width: 100%; }
  .admin-card { padding: 17px; }
  .support-settings-form { grid-template-columns: 1fr; }
  .support-preview { margin-inline: auto; }
  .profile-modal { max-height: calc(100vh - 24px); }
  .payment-product-grid { grid-template-columns: 1fr; }
  .payment-product-card { min-height: 0; }
  .payment-checkout { padding: 15px; }
  .payment-checkout-details > div { grid-template-columns: 1fr; gap: 4px; }
  .payment-checkout-actions { flex-direction: column; }
  .payment-checkout-actions .btn { width: 100%; }
  .payment-foundation-warning, .payment-admin-product { align-items: stretch; flex-direction: column; }
  .payment-admin-product .btn { width: 100%; }
  .payment-audit-row { grid-template-columns: 1fr; gap: 5px; }
  .payment-product-modal { max-height: calc(100vh - 24px); }
  .payment-product-modal .grid-3 { grid-template-columns: 1fr; }
  .payment-mapping-row { grid-template-columns: 1fr; }
  .payment-mapping-remove { width: 100%; }
  .payment-product-modal .modal-actions { flex-wrap: wrap; }
  .payment-product-modal .modal-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
