/* ===== Knovell design system ===== */
:root {
  --brand: #ff5a3c; --brand-2: #ff3d6e; --brand-soft: #fff0eb; --sun: #ffc23d;
  --ink: #17152b; --ink-2: #4a4862; --muted: #8a879e; --line: #ece7e1;
  --bg: #fbf7f2; --card: #ffffff; --card-2: #f6f2ec; --ok: #18b26b; --bad: #ef4444;
  --shadow: 0 1px 2px rgba(23,21,43,.06), 0 8px 24px rgba(23,21,43,.06);
  --shadow-lg: 0 20px 60px rgba(23,21,43,.18);
  --radius: 18px; --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: #3a1f1c; --ink: #f4f2fb; --ink-2: #c9c6dc; --muted: #8f8ca7; --line: #2c2a40;
    --bg: #0f0e1a; --card: #18172a; --card-2: #201f35; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-soft: #3a1f1c; --ink: #f4f2fb; --ink-2: #c9c6dc; --muted: #8f8ca7; --line: #2c2a40;
  --bg: #0f0e1a; --card: #18172a; --card-2: #201f35; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 800; } h2 { font-size: 22px; font-weight: 800; } h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.hidden { display: none !important; }

/* ===== Layout ===== */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.03em; padding: 4px 10px 18px; }
.brand img { width: 36px; height: 36px; }
.brand span b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; transition: background .15s; }
.nav a:hover { background: var(--card-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .ico { width: 22px; text-align: center; font-size: 18px; }
.sidebar .cta { margin-top: 10px; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .mobile-brand { display: none; }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { width: 100%; padding: 11px 16px 11px 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search::before { content: '🔍'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; }
.page { padding: 28px; max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 820px; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; }
  .topbar .mobile-brand { display: flex; padding: 0; font-size: 19px; }
  .topbar .mobile-brand img { width: 30px; height: 30px; }
  .page { padding: 18px 16px 100px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 8px; border-radius: 10px; }
  .bottom-nav a .ico { font-size: 20px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a.plus .ico { background: var(--grad); color: #fff; border-radius: 12px; width: 40px; height: 32px; display: grid; place-items: center; font-size: 22px; }
  h1 { font-size: 24px; }
}
@media (max-width: 560px) { .topbar .search { display: none; } .topbar .search.show-mobile { display: block; } }

/* ===== Components ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; background: var(--card-2); color: var(--ink); transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { background: color-mix(in srgb, var(--card-2) 80%, var(--ink) 6%); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(255,74,80,.3); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(255,74,80,.4); }
.btn.outline { background: transparent; border-color: var(--line); }
.btn.ghost { background: transparent; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; font-size: 18px; position: relative; }
.icon-btn:hover { background: var(--card-2); }
.badge-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--brand-2); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.field { display: block; }
.field > span { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none; transition: border .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.error { color: var(--bad); font-weight: 600; font-size: 14px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-2); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.pick.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; font-weight: 700; color: var(--muted); border: 0; background: none; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs .active { color: var(--ink); border-color: var(--brand); }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; text-transform: uppercase; }
.avatar.lg { width: 88px; height: 88px; font-size: 34px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.subject-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }

/* Know cards */
.know-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.know-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; cursor: pointer; }
.know-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.know-thumb { height: 150px; padding: 16px; position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.know-thumb .paper { position: absolute; right: -10px; bottom: -30px; width: 62%; height: 150px; background: rgba(255,255,255,.95); border-radius: 10px; transform: rotate(-6deg); padding: 12px; color: #333; font-size: 7px; line-height: 1.35; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.know-thumb .paper b { display: block; font-size: 9px; margin-bottom: 4px; }
.know-thumb .emoji { font-size: 30px; position: relative; }
.know-thumb .ftype { position: relative; align-self: flex-start; background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.know-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.know-body h3 { margin: 0; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.know-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: auto; }
.know-meta .stat { margin-left: auto; display: flex; gap: 10px; }

/* Hero / landing */
.landing { min-height: 100vh; }
.landing nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; max-width: 1180px; margin: 0 auto; }
.hero { max-width: 1180px; margin: 0 auto; padding: 50px 28px 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.03; letter-spacing: -.04em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 540px; }
.free-badge { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-soft); color: var(--brand); padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 13px; margin-bottom: 18px; }
.hero-art { position: relative; height: 440px; }
.hero-art .float { position: absolute; border-radius: 22px; box-shadow: var(--shadow-lg); background: var(--card); padding: 18px; border: 1px solid var(--line); }
.hero-art .f1 { top: 10px; left: 30px; width: 260px; transform: rotate(-5deg); }
.hero-art .f2 { top: 150px; right: 0; width: 250px; transform: rotate(4deg); }
.hero-art .f3 { bottom: 0; left: 0; width: 280px; transform: rotate(-2deg); }
.features { max-width: 1180px; margin: 0 auto; padding: 30px 28px 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 24px; }
.feature .fi { font-size: 30px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); margin-bottom: 14px; }
.compare { max-width: 820px; margin: 0 auto 70px; padding: 0 28px; }
.compare table { width: 100%; border-collapse: collapse; }
.compare th, .compare td { padding: 14px; border-bottom: 1px solid var(--line); text-align: left; }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.stats-band { display: flex; gap: 40px; margin-top: 30px; }
.stats-band b { display: block; font-size: 28px; font-weight: 800; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-art { height: 360px; }
  .features { grid-template-columns: 1fr; }
  .landing nav { padding: 14px 16px; }
  .hero, .features, .compare { padding-left: 16px; padding-right: 16px; }
}

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--brand-soft), transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 430px; }

/* Know detail */
.know-head { display: flex; gap: 16px; align-items: flex-start; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px; box-shadow: var(--shadow); }
@media (max-width: 640px) { .doc { padding: 22px 18px; } }
.md h1 { font-size: 26px; margin-top: .2em; } .md h2 { font-size: 20px; margin-top: 1.4em; color: var(--brand); } .md h3 { margin-top: 1.2em; }
.md p, .md ul, .md ol { margin: .6em 0; } .md li { margin: .25em 0; }
.md blockquote { margin: 1em 0; padding: 12px 16px; border-left: 4px solid var(--sun); background: color-mix(in srgb, var(--sun) 14%, transparent); border-radius: 0 12px 12px 0; }
.md code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.md pre { background: #17152b; color: #f4f2fb; padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md a { color: var(--brand); text-decoration: underline; }
.md table { border-collapse: collapse; width: 100%; } .md td, .md th { border: 1px solid var(--line); padding: 6px 10px; }
.md strong { font-weight: 800; }
.file-view { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: var(--card-2); }
.layout-2 { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .layout-2 { grid-template-columns: 1fr; } }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.act { display: inline-flex; gap: 6px; align-items: center; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.act.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }

/* Profile */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-row div { text-align: center; } .stat-row b { display: block; font-size: 20px; font-weight: 800; }
.stat-row button { background: none; border: 0; cursor: pointer; padding: 0; }
.xp-bar { height: 10px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.xp-bar > div { height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }

/* Flashcards */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.deck-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform .15s; position: relative; overflow: hidden; }
.deck-card:hover { transform: translateY(-2px); }
.deck-card::after { content: ''; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 22px; transform: rotate(18deg); background: var(--c, var(--brand)); opacity: .15; }
.flip-wrap { perspective: 1200px; max-width: 620px; margin: 0 auto; }
.flip { position: relative; height: 340px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.8,.2,1); cursor: pointer; }
.flip.flipped { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; text-align: center; padding: 30px; font-size: 24px; font-weight: 700; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: auto; }
.flip .back { transform: rotateY(180deg); background: var(--ink); color: var(--bg); }
.flip .face small { position: absolute; top: 16px; left: 20px; font-size: 12px; opacity: .6; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.progress { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); transition: width .3s; }
.learn-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 620px; margin: 20px auto 0; }
.learn-btns .btn { padding: 16px; font-size: 16px; }
.btn.know-no { background: #fee2e2; color: #b91c1c; } .btn.know-yes { background: #d1fae5; color: #047857; }
[data-theme="dark"] .btn.know-no, :root:not([data-theme="light"]) .btn.know-no { }
.quiz-opt { display: block; width: 100%; text-align: left; padding: 16px 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.quiz-opt:hover:not([disabled]) { border-color: var(--ink-2); }
.quiz-opt.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.quiz-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--card)); }
.card-editor-row { display: grid; grid-template-columns: 28px 1fr 1fr 36px; gap: 10px; align-items: start; margin-bottom: 10px; }
.card-editor-row .num { padding-top: 12px; font-weight: 800; color: var(--muted); }
@media (max-width: 640px) { .card-editor-row { grid-template-columns: 1fr 36px; } .card-editor-row .num { display: none; } .card-editor-row textarea:nth-of-type(2) { grid-column: 1; } }
.card-editor-row textarea { min-height: 48px; }
.box-dots { display: flex; gap: 3px; } .box-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .box-dots i.on { background: var(--ok); }

/* AI chat */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - 140px); }
.chat-list { overflow-y: auto; padding: 10px; }
.chat-list a { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list a.active, .chat-list a:hover { background: var(--card-2); color: var(--ink); }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 18px; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 6px; }
.msg.assistant .md > :first-child { margin-top: 0; } .msg.assistant .md > :last-child { margin-bottom: 0; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; resize: none; min-height: 48px; max-height: 160px; }
.nova-hello { text-align: center; margin: auto; max-width: 520px; }
.nova-hello .orb { width: 84px; height: 84px; border-radius: 28px; margin: 0 auto 16px; background: var(--grad); display: grid; place-items: center; font-size: 40px; box-shadow: 0 16px 40px rgba(255,74,80,.35); }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.suggest button { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; }
.typing::after { content: '▍'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 190px); } .chat-list { display: none; } .msg { max-width: 92%; } .suggest { grid-template-columns: 1fr; } }

/* Groups */
.group-chat { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 380px; }
.gmsg { display: flex; gap: 10px; max-width: 80%; }
.gmsg.mine { align-self: flex-end; flex-direction: row-reverse; }
.gmsg .bubble { background: var(--card-2); padding: 9px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
.gmsg.mine .bubble { background: var(--ink); color: var(--bg); }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 34px; font-weight: 800; font-size: 18px; text-align: center; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; margin-bottom: 20px; }
.podium .p { text-align: center; padding: 18px 10px; border-radius: 18px 18px 6px 6px; }
.podium .p1 { background: linear-gradient(180deg, #ffe08a, #ffc23d); color: #3a2a00; min-height: 190px; }
.podium .p2 { background: linear-gradient(180deg, #eef0f5, #cfd4df); color: #2a2d36; min-height: 160px; }
.podium .p3 { background: linear-gradient(180deg, #ffd7b8, #e9a274); color: #3a1f0c; min-height: 140px; }
.podium .avatar { margin: 0 auto 8px; width: 54px; height: 54px; font-size: 20px; border: 3px solid #fff; }

/* Misc */
#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) { #toast { bottom: 90px; } }
.modal-back { position: fixed; inset: 0; background: rgba(15,14,26,.5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--card-2), var(--line), var(--card-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 14px; }
.section-title h2 { margin: 0; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.subject-tile { padding: 16px; border-radius: 16px; color: #fff; font-weight: 800; display: flex; flex-direction: column; gap: 10px; min-height: 96px; transition: transform .15s; }
.subject-tile:hover { transform: scale(1.03); }
.subject-tile .e { font-size: 28px; }
.welcome-banner { background: var(--grad); color: #fff; border-radius: 24px; padding: 26px 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.welcome-banner::after { content: '✦'; position: absolute; right: 30px; top: -20px; font-size: 140px; opacity: .15; }
.welcome-banner h1 { margin: 0 0 4px; }
.welcome-banner .btn { background: #fff; color: var(--brand); }
.streak { display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.2); padding: 6px 12px; border-radius: 99px; font-weight: 800; }
.notif { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif.unread { background: var(--brand-soft); }
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 26px; text-align: center; cursor: pointer; transition: border .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.editor-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.toolbar button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 700; font-size: 13px; }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-pick button.active { border-color: var(--ink); }
