:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg2: #131a2e;
  --card: #161f36;
  --card2: #1d2844;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .30);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #818cf8;
  --accent2: #6366f1;
  --study: #2dd4bf;
  --exam: #fb7185;
  --info: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(4, 7, 15, .28);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: 'Inter', 'Be Vietnam Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg2: #e2e8f0;
  --card: #ffffff;
  --card2: #f8fafc;
  --line: rgba(15, 23, 42, .11);
  --line-strong: rgba(15, 23, 42, .22);
  --text: #0f172a;
  --muted: #475569;
  --accent: #4f46e5;
  --accent2: #4338ca;
  --study: #0d9488;
  --exam: #e11d48;
  --info: #0284c7;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
html[data-theme="light"] body {
  background: radial-gradient(1100px 550px at 85% -8%, rgba(79, 70, 229, .08), transparent 62%), radial-gradient(800px 450px at 10% 100%, rgba(14, 165, 233, .06), transparent 60%), var(--bg);
}
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .topbar { background: rgba(248, 250, 252, .88); }
html[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, .94); }
html[data-theme="light"] .tt-day { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .tt-slot { background: #f8fafc; }
html[data-theme="light"] .tt-slot:hover { background: #f1f5f9; }
html[data-theme="light"] .wallet-card { background: linear-gradient(180deg, #ffffff, #f8fafc); }
html[data-theme="light"] .btn.ghost, html[data-theme="light"] .btn.quiet { color: #334155; }
html[data-theme="light"] code { background: rgba(79, 70, 229, .10); color: #312e81; }
html[data-theme="light"] .slot-time, html[data-theme="light"] .tt-time { color: var(--accent); }
html { font-size: 17px; margin: 0; background: var(--bg); }
html[data-font="sm"] { font-size: 15px; }
html[data-font="lg"] { font-size: 19px; }
* { box-sizing: border-box; font-family: var(--font); }
body { margin: 0; color: var(--text); font: 1rem/1.58 var(--font); font-family: var(--font); -webkit-font-smoothing: antialiased; background: radial-gradient(1100px 550px at 85% -8%, rgba(99, 102, 241, .11), transparent 62%), radial-gradient(800px 450px at 10% 100%, rgba(56, 189, 248, .06), transparent 60%), var(--bg); min-height: 100vh; }
button, input, select, textarea, code, pre, kbd, samp { font-family: var(--font); }
button { color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.015em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
h4 { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0; }
p { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { background: rgba(129, 140, 248, .12); padding: 2px 7px; border-radius: 6px; font-size: 0.82rem; font-weight: 600; color: #dbe4ff; font-family: var(--font); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.hidden { display: none !important; }
.grow { flex: 1; }
.right { margin-left: auto; }

/* ---------- smooth transitions ---------- */
@keyframes viewIn { from { opacity: .72; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.view-enter > * { animation: viewIn .18s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .view-enter > * { animation: none; } }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 258px; flex-shrink: 0; background: rgba(15, 20, 32, .88); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand strong { display: block; font-size: 1.02rem; }
.brand small { color: var(--muted); font-size: 0.78rem; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; background: linear-gradient(135deg, #818cf8, #38bdf8); color: #0c101a; box-shadow: 0 4px 14px rgba(129, 140, 248, .28); }
.logo.sm { width: 32px; height: 32px; font-size: 0.78rem; border-radius: 9px; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px; color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); }
.nav-item:hover { background: rgba(255, 255, 255, .04); color: var(--text); transform: translateX(2px); }
.nav-item.active { background: linear-gradient(90deg, rgba(129, 140, 248, .18), rgba(129, 140, 248, .04)); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.ni { font-size: 1.15rem; width: 24px; text-align: center; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.mini-stat { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); padding: 10px 13px; border-radius: 11px; font-size: 0.85rem; color: var(--muted); }
.mini-stat strong { color: var(--text); font-size: 0.98rem; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(12, 16, 26, .78); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mobile { display: none; }
.main { padding: 22px 28px 60px; max-width: 1920px; width: 100%; margin: 0 auto; }
.bottom-nav { display: none; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- controls ---------- */
.btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: 0.91rem; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--text); transition: all .18s var(--ease); white-space: nowrap; }
.btn:hover { border-color: rgba(129, 140, 248, .55); background: rgba(129, 140, 248, .10); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; box-shadow: 0 5px 16px rgba(99, 102, 241, .28); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 7px 20px rgba(99, 102, 241, .38); }
.btn.success { background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .3); color: var(--ok); }
.btn.success:hover { background: rgba(52, 211, 153, .22); }
.btn.ghost { background: transparent; border-color: var(--line); color: #cbd5e6; }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.btn.quiet { background: transparent; border-color: transparent; color: #c4d0e6; padding: 6px 10px; font-weight: 500; }
.btn.quiet:hover { color: var(--text); background: rgba(255, 255, 255, .07); border-color: transparent; }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .12); }
.btn.sm { padding: 7px 11px; font-size: 0.85rem; border-radius: 9px; }
.icon-btn { all: unset; cursor: pointer; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 0.96rem; flex-shrink: 0; transition: all .18s var(--ease); }
.icon-btn:hover { border-color: var(--accent); background: rgba(129, 140, 248, .12); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 0.82rem; border-radius: 8px; color: var(--muted); border-color: transparent; background: transparent; }
.icon-btn.sm:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.link { all: unset; cursor: pointer; color: var(--text); font-weight: 500; transition: color .15s; }
.link:hover { color: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 0.84rem; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; transition: .18s var(--ease); }
.badge.ok { color: var(--ok); background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .25); }
.badge.warn { color: #fde68a; border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .1); cursor: pointer; font: inherit; font-size: 0.84rem; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: rgba(148, 163, 184, .18); color: #dce4f2; border: 1px solid transparent; transition: .15s var(--ease); }
.pill.ok { color: #6ee7b7; background: rgba(52, 211, 153, .16); }
.pill.warn { color: #fde68a; background: rgba(251, 191, 36, .16); }
.pill.danger { color: #fecaca; background: rgba(248, 113, 113, .18); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 600; padding: 2px 9px; border-radius: 7px; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 72%, white); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input { width: 100%; background: var(--bg2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 0.94rem; outline: none; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(129, 140, 248, .16); }
.input.sm { padding: 7px 10px; font-size: 0.88rem; border-radius: 8px; }
.input.num { width: 76px; text-align: right; }
input[type=date].input, input[type=month].input { color-scheme: dark; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: none; padding: 2px; }
select.input { cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.row.wrap { flex-wrap: wrap; }
.progress { height: 7px; background: rgba(255, 255, 255, .05); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; border-radius: 99px; transition: width .55s var(--ease); }
.seg { display: inline-flex; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { all: unset; cursor: pointer; padding: 7px 13px; border-radius: 8px; font-size: 0.86rem; font-weight: 600; color: var(--muted); transition: all .18s var(--ease); white-space: nowrap; }
.seg.font-seg button { padding: 5px 9px; font-size: 0.8rem; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--accent2); color: #fff; box-shadow: 0 2px 8px rgba(99, 102, 241, .3); }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.courses { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.span2 { grid-column: span 2; }
.today-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(350px, 1fr); gap: 18px; align-items: start; }
.today-col { display: grid; gap: 18px; min-width: 0; }
.acad-split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(350px, 24vw, 410px); gap: 20px; align-items: start; }
.acad-aside { display: grid; gap: 14px; position: sticky; top: 74px; }
.growth-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); gap: 18px; align-items: start; }
.card { background: linear-gradient(180deg, rgba(25, 34, 54, .92), rgba(20, 28, 45, .94)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.card.compact { padding: 16px 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.06rem; margin-bottom: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p.muted { font-size: 0.92rem; margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.menu-wrap { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 255px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 13px; padding: 6px; box-shadow: 0 18px 44px rgba(0, 0, 0, .58); z-index: 40; display: grid; gap: 3px; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px) scale(.98); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s; }
.menu-wrap.open .menu-pop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.menu-pop .btn { width: 100%; justify-content: flex-start; border-color: transparent; background: transparent; padding: 9px 12px; border-radius: 9px; font-weight: 500; font-size: 0.9rem; }
.menu-pop .btn:hover { background: rgba(129, 140, 248, .14); border-color: transparent; transform: none; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .06em; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 11px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.hero-chip strong { font-size: 1.04rem; color: var(--text); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 12px; }
.hero-stats.wide { margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.stat { background: rgba(255, 255, 255, .028); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; transition: border-color .2s var(--ease); }
.stat:hover { border-color: var(--line-strong); }
.stat span { display: block; font-size: 0.84rem; color: var(--muted); }
.stat strong { font-size: 1.38rem; font-weight: 700; display: block; margin-top: 2px; }
.alert { padding: 13px 16px; border-radius: 13px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border: 1px solid; font-size: 0.92rem; }
.alert.warn { background: rgba(251, 191, 36, .07); border-color: rgba(251, 191, 36, .28); color: #fde68a; }
.alert.danger { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); color: #fecaca; }
.callout { padding: 11px 14px; border-radius: 11px; font-size: 0.92rem; margin: 12px 0; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); line-height: 1.5; }
.callout.info { border-color: rgba(129, 140, 248, .28); background: rgba(129, 140, 248, .07); }
.callout.ok { border-color: rgba(52, 211, 153, .26); background: rgba(52, 211, 153, .06); }
.callout.warn { border-color: rgba(251, 191, 36, .26); background: rgba(251, 191, 36, .06); }
.callout.danger { border-color: rgba(248, 113, 113, .28); background: rgba(248, 113, 113, .07); }
.empty { text-align: center; padding: 30px 14px; color: var(--muted); font-size: 0.94rem; }
.empty-icon { font-size: 2.2rem; margin-bottom: 8px; }
.empty .btn { margin-top: 12px; }
.hint { margin-top: 12px; }

/* ---------- task rows ---------- */
.task-row { display: flex; gap: 12px; padding: 11px 12px; border-radius: 11px; cursor: pointer; transition: background .18s var(--ease), transform .18s var(--ease); flex: 1; min-width: 0; align-items: flex-start; }
.task-row:hover { background: rgba(255, 255, 255, .045); }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-weight: 600; font-size: 0.96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; font-size: 0.86rem; margin-top: 4px; }
.due { font-weight: 600; font-size: 0.86rem; }
.due.muted { color: var(--muted); }
.top-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.top-item:last-child { border-bottom: 0; }
.rank { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; background: linear-gradient(135deg, var(--accent), #38bdf8); color: #0c101a; }
.top-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; opacity: .88; transition: opacity .15s; }
.top-item:hover .top-actions { opacity: 1; }
.next-up { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.next-up .task-row { padding: 6px; }

/* focus */
.focus-task { font-weight: 600; font-size: 0.98rem; margin-bottom: 4px; }
.timer { font-size: 2.8rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, #a5b4fc, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* habits */
.habit-list { display: grid; gap: 9px; }
.habit-card { border-radius: 11px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); overflow: hidden; transition: border-color .18s var(--ease), background .18s var(--ease); }
.habit-card:hover { border-color: rgba(129, 140, 248, .45); }
.habit-card.on { border-color: rgba(52, 211, 153, .38); background: rgba(52, 211, 153, .07); }
.habit-check { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); font-size: 0.94rem; transition: all .18s var(--ease); box-sizing: border-box; }
.habit-card .habit-check { width: 100%; border: 0; background: transparent; border-radius: 0; padding: 10px 13px 6px; }
.habit-card .habit-check:hover { background: rgba(255, 255, 255, .03); }
.habit-card-foot { padding: 0 13px 10px 46px; display: grid; gap: 7px; }
.habit-card-foot .progress { margin-top: 0; height: 6px; }
.habit-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.habit-qbtn { all: unset; cursor: pointer; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: rgba(129, 140, 248, .13); color: #c7d2fe; border: 1px solid rgba(129, 140, 248, .22); transition: all .15s var(--ease); white-space: nowrap; }
.habit-qbtn:hover { background: var(--accent2); color: #fff; border-color: transparent; }
.habit-qbtn.ghost { background: rgba(255, 255, 255, .04); color: var(--muted); border-color: var(--line); }
.habit-qbtn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.habit-check:hover { border-color: rgba(129, 140, 248, .5); background: rgba(255, 255, 255, .04); }
.habit-check .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; transition: all .18s var(--ease); flex-shrink: 0; }
.habit-check.on, .habit-card.on .habit-check { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.habit-card.on .habit-check { background: transparent; }
.habit-check.on .box, .habit-card.on .box { background: var(--ok); border-color: var(--ok); color: #0c101a; transform: scale(1.05); }
.habit-check .hl { flex: 1; min-width: 0; }
.streak { font-size: 0.86rem; font-weight: 600; color: var(--warn); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
table.habits th { font-size: 0.84rem; color: var(--muted); font-weight: 500; padding: 6px; }
table.habits td { padding: 6px; text-align: center; font-size: 0.9rem; }
table.habits td:first-child { text-align: left; max-width: 220px; }
.hcell { all: unset; cursor: pointer; min-width: 28px; height: 28px; padding: 0 3px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 0.78rem; font-weight: 700; transition: all .15s var(--ease); box-sizing: border-box; }
.hcell:hover { border-color: var(--accent); }
.hcell.on { background: var(--ok); border-color: var(--ok); color: #0c101a; }
.hcell.part { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .48); color: #fde68a; font-size: 0.72rem; }
.habit-mode-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.habit-mode-pills .btn { flex: 1; justify-content: center; min-width: 120px; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.log-row i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* courses */
.course, .goal { border-top: 3px solid var(--c); }
.course:hover, .goal:hover { border-color: var(--line-strong); border-top-color: var(--c); }
.course-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.course-h .pill { margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.kpis div { background: rgba(255, 255, 255, .025); border-radius: 11px; padding: 9px 11px; }
.kpis span { display: block; font-size: 0.82rem; color: var(--muted); }
.kpis strong { font-size: 1.22rem; font-variant-numeric: tabular-nums; }
.big-pct { font-size: 2.1rem; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; }
table.grades { margin-top: 8px; font-variant-numeric: tabular-nums; }
table.grades th { text-align: left; font-size: 0.84rem; color: var(--muted); font-weight: 500; padding: 5px; white-space: nowrap; }
table.grades td { padding: 4px; }
table.grades th:first-child, table.grades td.drag-cell { width: 22px; min-width: 22px; max-width: 22px; padding: 2px 2px 2px 0; text-align: center; }
table.grades td:nth-child(2) { width: 100%; min-width: 110px; }
table.grades .input.num { width: 66px; }

/* analytics */
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut { width: 158px; height: 158px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; position: relative; }
.donut::after { content: ''; position: absolute; inset: 24px; background: var(--card); border-radius: 50%; }
.donut span { position: relative; z-index: 1; font-weight: 700; font-size: 1.32rem; }
.bal-list { flex: 1; min-width: 230px; display: grid; gap: 13px; }
.bal-h { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; flex-wrap: wrap; }
.bal-h i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.bal-track { position: relative; height: 9px; background: rgba(255, 255, 255, .05); border-radius: 99px; margin-top: 6px; overflow: visible; flex: 1; }
.bal-fill { height: 100%; border-radius: 99px; transition: width .55s var(--ease); }
.bal-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .6; }
.wchart { display: flex; align-items: flex-end; gap: 14px; height: 225px; padding-top: 12px; }
.wcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.wstack { width: 100%; max-width: 48px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 3px 3px; overflow: hidden; min-height: 2px; transition: height .5s var(--ease); }
.wv { font-size: 0.84rem; font-weight: 600; }
.wl { font-size: 0.8rem; color: var(--muted); }
.ov-row { display: grid; grid-template-columns: 118px 1fr 150px; gap: 12px; align-items: center; padding: 8px 0; font-size: 0.92rem; }
.ov-row.bad span:first-child { color: var(--danger); font-weight: 600; }
.ov-row .bal-track { margin: 0; }

/* toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); margin-left: auto; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.lg i.ms { width: 9px; height: 9px; transform: rotate(45deg); background: var(--warn); border-radius: 2px; }
.lg i.od { background: transparent; border: 2px solid var(--danger); }
.lg i.ol { background: repeating-linear-gradient(45deg, rgba(248, 113, 113, .45) 0 3px, transparent 3px 6px); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 7, 15, .7); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease); }
.modal { width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: pop .24s var(--ease); }
.modal.wide { width: min(920px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-h h2 { font-size: 1.18rem; }
.modal-body { padding: 20px 22px 22px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.form .full, .form h4 { grid-column: 1 / -1; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 0.92rem; }
.form-foot { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.step-row { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.step-row .input:not(.num) { flex: 1; }
.step-n { width: 24px; height: 24px; border-radius: 7px; background: var(--card2); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.unit { font-size: 0.86rem; color: var(--muted); }
.ms { flex-direction: row !important; align-items: center; gap: 4px !important; font-size: 0.86rem; white-space: nowrap; cursor: pointer; color: var(--warn) !important; }
.pillar-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pillar-row .input:not(.num) { flex: 1; }
.pv-sum { font-size: 0.92rem; margin-bottom: 10px; }
.pv { background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.pv-row { display: grid; grid-template-columns: minmax(130px, 1.2fr) 105px 2fr; gap: 10px; align-items: center; padding: 5px 0; font-size: 0.86rem; }
.pv-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-d { color: var(--muted); }
.pv-track { position: relative; height: 14px; background: rgba(255, 255, 255, .03); border-radius: 4px; }
.pv-bar { position: absolute; top: 2px; bottom: 2px; background: linear-gradient(90deg, var(--accent), #38bdf8); border-radius: 4px; min-width: 4px; }
.pv-ms { position: absolute; top: 1px; width: 12px; height: 12px; background: var(--warn); transform: rotate(45deg); border-radius: 2px; }
.rb-list { display: grid; gap: 6px; margin: 14px 0; max-height: 50vh; overflow: auto; }
.rb-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: var(--bg2); border-radius: 10px; font-size: 0.92rem; }

/* toast */
#toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; }
.toast { background: var(--card2); border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); max-width: 420px; font-size: 0.92rem; animation: pop .22s var(--ease); transition: opacity .35s, transform .35s; }
.toast.ok { border-color: rgba(52, 211, 153, .4); }
.toast.error { border-color: rgba(248, 113, 113, .45); color: #fecaca; }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- subtasks, timetable & calendar sync ---------- */
.sub-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sub-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 0.84rem; padding: 3px 8px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); transition: .15s; }
.sub-chip:hover { border-color: var(--accent); }
.sub-chip.done { color: var(--muted); text-decoration: line-through; background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .28); }
.sub-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.sub-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); cursor: pointer; flex-shrink: 0; }
.sub-row .input { flex: 1; }

.slot-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); margin-bottom: 8px; font-size: 0.92rem; cursor: pointer; transition: .18s var(--ease); }
.slot-item.class { --c: #818cf8; }
.slot-item.study_block { --c: #2dd4bf; background: rgba(45, 212, 191, .07); }
.slot-item.extra_study { --c: #38bdf8; background: rgba(56, 189, 248, .06); }
.slot-item.work { --c: #fbbf24; }
.slot-item.exam { --c: #fb7185; background: rgba(251, 113, 133, .09); }
.slot-item.other { --c: #34d399; }
.slot-item:hover { background: rgba(255, 255, 255, .05); border-color: rgba(129, 140, 248, .45); border-left-color: var(--c, var(--accent)); }
.slot-item i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.slot-time { font-weight: 700; font-size: 0.86rem; color: #a5b4fc; min-width: 96px; font-variant-numeric: tabular-nums; }

.tt-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding-bottom: 4px; }
.tt-day { background: rgba(23, 31, 49, .85); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 9px; min-height: 230px; min-width: 0; }
.tt-day.today { border-color: rgba(129, 140, 248, .55); box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .22); }
.tt-head { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tt-head-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 0.94rem; flex-wrap: wrap; }
.tt-head-top strong { white-space: nowrap; }
.tt-head > span { font-size: 0.82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tt-cap-bar { height: 5px; border-radius: 99px; background: rgba(148, 163, 184, .14); overflow: hidden; display: flex; margin-top: 2px; }
.tt-cap-busy { height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.tt-cap-free { height: 100%; background: var(--study); opacity: .55; }
.tt-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tt-slot { all: unset; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border-radius: 10px; background: rgba(19, 25, 39, .92); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); transition: all .18s var(--ease); }
.tt-slot.class { --c: #818cf8; }
.tt-slot.study_block { --c: #2dd4bf; background: rgba(45, 212, 191, .09); }
.tt-slot.extra_study { --c: #38bdf8; background: rgba(56, 189, 248, .08); }
.tt-slot.work { --c: #fbbf24; }
.tt-slot.other { --c: #34d399; }
.tt-slot.study_block .tt-time { color: var(--study); }
.tt-slot.extra_study .tt-time { color: var(--info); }
.tt-slot.work .tt-time { color: var(--warn); }
.tt-slot.other .tt-time { color: var(--ok); }
.tt-slot:hover { border-color: var(--line-strong); border-left-color: var(--c, var(--accent)); background: rgba(29, 39, 61, .95); transform: translateY(-2px); }
.tt-time { font-size: 0.84rem; font-weight: 700; color: #a5b4fc; font-variant-numeric: tabular-nums; }
.tt-title { font-size: 0.91rem; font-weight: 600; color: var(--text); white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; }
.tt-slot .muted { white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.38; font-size: 0.84rem; }
.tt-slot .chip { max-width: 100%; white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.3; }
.tt-meta { font-size: 0.82rem; color: var(--muted); }

.digest-preview { background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 14px; font: 0.88rem/1.6 var(--font); color: var(--text); white-space: pre-wrap; max-height: 220px; overflow: auto; margin: 0; }
textarea.input { resize: vertical; min-height: 90px; font-family: var(--font); font-size: 0.9rem; }

/* ---------- finance & wallets ---------- */
.wallets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; margin-bottom: 20px; }
.wallet-card { background: linear-gradient(180deg, rgba(25, 34, 54, .92), rgba(20, 28, 45, .94)); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--accent)); border-radius: 15px; padding: 16px 18px; cursor: pointer; transition: all .2s var(--ease); display: flex; flex-direction: column; gap: 9px; }
.wallet-card .row { margin-top: auto; padding-top: 4px; }
.wallet-card:hover { border-color: var(--line-strong); border-top-color: var(--c, var(--accent)); transform: translateY(-2px); }
.wallet-card.active { border-color: var(--c, var(--accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--accent)) 28%, transparent); background: var(--card2); }
.wallet-head { display: flex; align-items: center; gap: 10px; }
.wallet-icon { font-size: 1.25rem; width: 34px; height: 34px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; flex-shrink: 0; }
.wallet-bal { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wallet-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; color: var(--muted); }
.quick-amts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fin-bars { display: flex; align-items: flex-end; gap: 14px; height: 215px; padding-top: 14px; }
.fin-mcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.fin-pair { display: flex; align-items: flex-end; gap: 4px; height: 155px; width: 100%; justify-content: center; }
.fin-bar { width: 17px; border-radius: 6px 6px 2px 2px; min-height: 3px; transition: height .5s var(--ease); }
.fin-bar.inc { background: var(--ok); }
.fin-bar.exp { background: var(--danger); }
.tx-list { display: grid; }
.tx-row { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.tx-row:hover { background: rgba(255, 255, 255, .04); }
.tx-row:last-child { border-bottom: 0; }
.tx-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line); font-size: 1.05rem; flex-shrink: 0; }
.tx-amt { font-weight: 700; font-size: 0.96rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

/* ---------- transcript table & drag-and-drop ---------- */
.drag-handle { cursor: grab; color: var(--muted); opacity: .7; user-select: none; display: inline-flex; align-items: center; justify-content: center; padding: 4px; border-radius: 6px; font-size: 0.86rem; letter-spacing: -1px; line-height: 1; transition: .15s; }
.drag-handle:hover { color: var(--text); opacity: 1; background: rgba(255, 255, 255, .07); }
.drag-handle:active { cursor: grabbing; }
.drag-cell { width: 22px; min-width: 22px; max-width: 22px; padding: 2px !important; text-align: center; white-space: nowrap; }
.grade-row.dragging, .sem-item.dragging, .course-row.dragging, .card.course.dragging { opacity: .45; }
.grade-row.drag-over td, .course-row.drag-over td { box-shadow: inset 0 2px 0 var(--accent); }
.sem-item.drag-over, .card.course.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.sem-list { display: grid; gap: 10px; }
.sem-item { background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.sem-item-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; font-size: 0.94rem; }
.sem-item-stats { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 0.86rem; margin-left: auto; }
.sem-detail { border-top: 1px solid var(--line); background: rgba(12, 16, 26, .45); padding: 8px 12px 12px; overflow-x: auto; }
table.transcript { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.transcript th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.transcript td { padding: 8px 7px; border-bottom: 1px solid rgba(148, 163, 184, .08); vertical-align: middle; }
table.transcript tr:last-child td { border-bottom: 0; }
.sem-summary-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 15px; margin-top: 10px; border-radius: 11px; background: rgba(129, 140, 248, .08); border: 1px solid rgba(129, 140, 248, .25); font-size: 0.92rem; }
.grad-stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); margin: 10px 0; }
.grad-seg { height: 100%; transition: width .55s var(--ease); }
.gpa-bars { display: flex; align-items: flex-end; gap: 14px; height: 215px; padding-top: 18px; }
.gpa-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; }
.gpa-bar { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #34d399, #818cf8); min-height: 6px; transition: height .5s var(--ease); }
.gpa-sub { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- exam schedules & interactive progress ---------- */
.tt-slot.exam { border-left-color: #fb7185; background: rgba(251, 113, 133, .12); }
.tt-slot.exam .tt-time { color: #fda4af; }
.exam-box { background: rgba(251, 113, 133, .08); border: 1px solid rgba(251, 113, 133, .28); border-radius: 12px; padding: 11px 13px; margin: 12px 0; display: grid; gap: 8px; }
.exam-box-h { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: #e2e8f0; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.exam-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.92rem; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(251, 113, 133, .26); color: var(--text); width: 100%; text-align: left; transition: border-color .18s var(--ease), background .18s var(--ease), transform .15s var(--ease); }
button.exam-row { cursor: pointer; }
button.exam-row:hover { background: rgba(251, 113, 133, .10); border-color: rgba(251, 113, 133, .52); transform: translateY(-1px); }
.exam-row strong { color: var(--text); font-weight: 600; }
.exam-row .muted { color: #c4cee2; }
.exam-row .grow { min-width: 120px; }
.exam-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.bulk-exam-wrap { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; }

.prog-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.prog-row .progress { flex: 1; margin-top: 0; height: 7px; }
.prog-pct { font-size: 0.82rem; font-weight: 700; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.prog-step-btn { all: unset; cursor: pointer; font-size: 0.8rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(129, 140, 248, .12); color: #a5b4fc; transition: all .15s var(--ease); white-space: nowrap; }
.prog-step-btn:hover { background: var(--accent2); color: #fff; }
.tr-check { all: unset; cursor: pointer; width: 23px; height: 23px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, .02); display: grid; place-items: center; font-size: 0.82rem; font-weight: 700; color: transparent; flex-shrink: 0; margin-top: 2px; transition: all .18s var(--ease); }
.tr-check:hover { border-color: var(--ok); color: var(--ok); background: rgba(52, 211, 153, .12); transform: scale(1.05); }

.ring-wrap { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring-wrap svg circle:last-child { transition: stroke-dashoffset .6s var(--ease); }
.ring-wrap span { position: absolute; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-sub { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--muted); margin-top: 5px; }
.stat .progress { height: 5px; margin-top: 7px; }
.mini-stat-col { background: rgba(255, 255, 255, .025); border: 1px solid var(--line); padding: 10px 13px; border-radius: 11px; font-size: 0.85rem; color: var(--muted); display: grid; gap: 5px; }
.mini-stat-col .row-sb { display: flex; justify-content: space-between; align-items: center; }
.mini-stat-col strong { color: var(--text); font-size: 0.9rem; }
.dual-prog { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.dual-prog-item span { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.dual-prog-item strong { color: var(--text); font-weight: 700; }
.course-tasks { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 4px; }
.course-tasks-h { display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; color: var(--muted); font-weight: 600; }
.sched-mix { background: rgba(23, 31, 49, .85); border: 1px solid var(--line); border-radius: 13px; padding: 13px 16px; margin-bottom: 16px; }
.sched-mix-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.86rem; color: var(--muted); margin-top: 7px; }
.sched-mix-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.tr-quick { display: inline-flex; align-items: center; gap: 3px; opacity: .82; transition: opacity .15s; }
.task-row:hover .tr-quick, .task-row:focus-within .tr-quick { opacity: 1; }
.tr-mini { all: unset; cursor: pointer; width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; font-size: 0.78rem; color: var(--muted); transition: all .15s var(--ease); }
.tr-mini:hover { background: rgba(255, 255, 255, .09); color: var(--text); }
.tr-mini.del:hover { background: rgba(248, 113, 113, .16); color: var(--danger); }

.whatif-stepper { display: inline-flex; align-items: center; gap: 3px; background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; }
.whatif-stepper .input.num { width: 64px; border: 0; background: transparent; text-align: center; font-weight: 700; padding: 4px; box-shadow: none; }
.whatif-panel { overflow: hidden; animation: viewIn .24s var(--ease) both; }

/* ---------- bulk multi-select & batch delete ---------- */
.bulk-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 11px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); margin-bottom: 10px; }
.bulk-list { max-height: 48vh; overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; }
.bulk-group { border: 1px solid var(--line); border-radius: 12px; background: rgba(15, 21, 35, .65); overflow: hidden; }
.bulk-group-h { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: rgba(255, 255, 255, .035); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.94rem; cursor: pointer; }
.bulk-group-h:hover { background: rgba(129, 140, 248, .08); }
.bulk-items { display: grid; }
.bulk-item { display: flex; align-items: flex-start; gap: 11px; padding: 9px 13px; border-bottom: 1px solid rgba(148, 163, 184, .08); cursor: pointer; transition: background .15s; }
.bulk-item:last-child { border-bottom: 0; }
.bulk-item:hover { background: rgba(255, 255, 255, .04); }
.bulk-item.selected { background: rgba(248, 113, 113, .10); }
.bulk-check { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--danger); cursor: pointer; flex-shrink: 0; }
.bulk-item-title { font-weight: 500; font-size: 0.94rem; color: var(--text); }
.bulk-item-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.84rem; color: var(--muted); margin-top: 3px; }

/* ---------- AI smart planner ---------- */
.modal.ai-wide { width: min(880px, 100%); }
.ai-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(34, 211, 238, .10)); border: 1px solid rgba(129, 140, 248, .35); margin-bottom: 12px; }
.ai-ctx-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-ctx-pill { font-size: 0.79rem; padding: 3px 9px; border-radius: 999px; background: rgba(15, 22, 43, .65); border: 1px solid var(--line); color: var(--text); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.ai-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(129, 140, 248, .28); background: rgba(129, 140, 248, .10); color: var(--text); font-size: 0.80rem; cursor: pointer; transition: background .15s, border-color .15s; }
.ai-chip:hover { background: rgba(129, 140, 248, .22); border-color: rgba(129, 140, 248, .55); }
.ai-prompt-input { width: 100%; min-height: 102px; resize: vertical; line-height: 1.5; }
.ai-opt-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0; padding: 9px 12px; border-radius: 11px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); }
.ai-check-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; cursor: pointer; color: var(--text); }
.ai-check-lbl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ai-action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ai-subpanel { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(15, 21, 35, .75); border: 1px solid var(--line); display: grid; gap: 10px; animation: fadeUp .18s ease-out; }
.ai-code-box { width: 100%; min-height: 92px; max-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.80rem; line-height: 1.45; }
.ai-preview { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; animation: fadeUp .2s ease-out; }
.ai-prev-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ai-prev-group { border: 1px solid var(--line); border-radius: 12px; background: rgba(15, 21, 35, .60); overflow: hidden; }
.ai-prev-group-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 13px; background: rgba(255, 255, 255, .035); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.90rem; }
.ai-prev-list { display: grid; max-height: 280px; overflow-y: auto; }
.ai-prev-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 13px; border-bottom: 1px solid rgba(148, 163, 184, .08); }
.ai-prev-item:last-child { border-bottom: 0; }
.ai-prev-item.unchecked { opacity: 0.55; }
.ai-prev-body { flex: 1; min-width: 0; }
.ai-prev-title { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.ai-prev-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.ai-sublist { margin: 6px 0 0; padding-left: 16px; font-size: 0.82rem; color: var(--muted); display: grid; gap: 2px; }
.ai-hrs-input { width: 64px !important; padding: 3px 6px !important; font-size: 0.82rem !important; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .acad-split, .today-split, .growth-split { grid-template-columns: 1fr; }
  .acad-aside { position: static; }
}
@media (max-width: 1100px) {
  .today-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}
@media (max-width: 820px) {
  html, body, .app, .main-wrap { max-width: 100vw; width: 100%; overflow-x: clip; }
  body { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .sidebar { display: none; }
  .brand-mobile { display: inline-flex; }
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    gap: 6px;
  }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; }
  .main { padding: 14px max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .today-split, .today-col, .card, .top-item, .task-row, .tr-main { min-width: 0; max-width: 100%; }
  .card { padding: 14px; }
  .card-h { flex-wrap: wrap; gap: 6px; font-size: 1rem; }
  .tr-title { white-space: normal; overflow-wrap: anywhere; }
  .tr-quick { opacity: 1; }
  .input, select.input, textarea.input { font-size: max(16px, 0.94rem); }
  .modal-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .badge { max-width: 112px; padding: 4px 8px; font-size: 0.74rem; }
  .icon-btn { width: 34px; height: 34px; font-size: 0.92rem; }
  .bottom-nav { display: flex; width: 100%; box-sizing: border-box; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(15, 22, 43, .95); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav .nav-item { flex: 1 1 0; min-width: 0; overflow: hidden; flex-direction: column; gap: 2px; padding: 5px 1px; font-size: 0.64rem; text-align: center; justify-content: center; }
  .bottom-nav .ni { font-size: 1.05rem; width: auto; }
  .bottom-nav .nav-item.active { box-shadow: none; background: rgba(129, 140, 248, .18); }
  .bottom-nav .nl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; }
  .today-grid, .grid.two { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .grid.courses { grid-template-columns: 1fr; }
  .hero-stats { width: 100%; }
  .top-item { flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: flex-end; padding: 0 0 6px 38px; }
  .form { grid-template-columns: 1fr; }
  .legend { margin-left: 0; }
  .pv-row { grid-template-columns: 1fr 80px; }
  .pv-track { grid-column: 1 / -1; }
  .ov-row { grid-template-columns: 80px 1fr; }
  .ov-row span:last-child { grid-column: 1 / -1; color: var(--muted); font-size: 0.82rem; }
  .topbar-right .btn.primary { padding: 6px 9px; }
  .tt-grid { grid-template-columns: 1fr; }
  .tt-day { min-height: auto; }
  h1 { font-size: 1.38rem; }
}
@media (max-width: 580px) {
  .font-seg { display: none; }
}
