
:root {
  --ink: #040608;
  --muted: #6c7079;
  --line: #d9dee6;
  --panel: #ffffff;
  --canvas: #e6eef7;
  --navy: #040608;
  --mint: #c4f69a;
  --mint-strong: #6fb63b;
  --violet: #4139c3;
  --violet-soft: #e8e6ff;
  --coral: #d66859;
  --coral-soft: #f8e0dc;
  --blue-soft: #e6eef7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; min-height: 100vh; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, textarea, select):focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.ring-inner strong,.metric strong,.insight-icon,.mastery-cell strong,.cpu-chip{font-family:'Manrope',system-ui,sans-serif!important}

.topbar { height: 72px; padding: 0 clamp(20px,4vw,58px); background: var(--navy); color: white; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; color: white; text-decoration: none; font-family: 'Manrope', sans-serif; font-weight: 800; letter-spacing:-.04em; width: fit-content; }
.brand > span:last-child span { color: white; }
.brand-mark { display:none; }
.primary-nav { display: flex; align-items: center; gap: 5px; }
.primary-nav a { color: #8f97a8; padding: 9px 16px; text-decoration: none; border-radius: 20px; font-size: 14px; font-weight: 600; }
.primary-nav a:hover, .primary-nav a.active { color: var(--navy); background: white; }
.profile-chip { justify-self: end; display: flex; align-items: center; gap: 9px; color:white; text-decoration:none; }
.profile-dot { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--mint) 0 25%, #6b71ed 26% 52%, #202a3c 53%); border: 2px solid #394357; }
.profile-copy { display: grid; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; color: #9098aa; }
.account-card-action { display:inline-flex; width:max-content; margin-top:10px; padding:8px 11px; color:white; border-radius:8px; background:var(--navy); font-size:10px; font-weight:800; text-decoration:none; }

.dashboard-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 45px 0 70px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 24px; }
.eyebrow, .section-label { font-size: 10px; letter-spacing: .12em; font-weight: 800; color: #777c89; margin: 0 0 7px; }
h1, h2 { font-family: 'Manrope', sans-serif; }
h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.045em; margin: 0 0 9px; line-height: 1.05; }
.welcome-copy { color: var(--muted); margin: 0; max-width: 650px; }
.today-chip { background: white; border: 1px solid var(--line); border-radius: 30px; padding: 10px 15px; color: #555b68; font-size: 12px; white-space: nowrap; }
.today-chip span { color: var(--mint-strong); margin-right: 6px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .72fr); gap: 18px; align-items: start; }
.main-column, .side-column { display: grid; gap: 18px; }
.card { background: var(--panel); border: 1px solid #cfd8e4; border-radius: 15px; box-shadow: 0 10px 30px rgba(46,62,82,.06); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 0; }
.card-heading.compact { padding: 20px 20px 0; }
.card-heading h2, .insights-title h2 { font-size: 18px; margin: 0; letter-spacing: -.025em; }
.text-link { font-size: 12px; font-weight: 700; text-decoration: none; color: var(--violet); }

.overview-body { padding: 22px 24px 26px; display: grid; grid-template-columns: 150px minmax(190px, .85fr) minmax(240px, 1.2fr); gap: 28px; align-items: center; }
.progress-ring { --progress: 0; width: 140px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--violet) calc(var(--progress) * 1%), #edf0f5 0); position: relative; }
.progress-ring::before { content: ''; position: absolute; width: 112px; aspect-ratio: 1; border-radius: 50%; background: white; }
.ring-inner { z-index: 1; text-align: center; display: grid; }
.ring-inner strong { font: 700 31px 'Manrope'; letter-spacing: -.04em; }
.ring-inner span { color: var(--muted); font-size: 11px; }
.overview-stats { display: grid; gap: 15px; }
.metric { display: flex; align-items: center; gap: 11px; }
.metric-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.mint { background: #e8fbd9; color: #4f9927; }
.violet { background: var(--violet-soft); color: #5b56cf; }
.coral { background: var(--coral-soft); color: #c85e52; }
.blue { background: #e4efff; color: #476aa5; }
.metric div { display: grid; }
.metric strong { font: 700 17px 'Manrope'; }
.metric small { font-size: 11px; color: var(--muted); }
.paper-progress { display: grid; gap: 19px; }
.paper-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.paper-row span { color: var(--muted); }
.bar { height: 7px; background: #edf0f4; border-radius: 20px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #9cdc70; border-radius: inherit; transition: width .35s ease; }
.bar.violet-bar > span { background: var(--violet); }
.bar.large { height: 8px; }

.insights-card { background: #e7fbd5; border-color: #cfe9bb; padding: 22px; }
.insights-title { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.insights-link { margin-left:auto; color:#47752e; font-size:10px; font-weight:800; text-decoration:none; }
.spark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #d9f9bc; color: #579b2e; }
.insight-list { display: grid; gap: 7px; }
.insight-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: rgba(255,255,255,.8); border: 1px solid rgba(110, 162, 73, .16); border-radius: 10px; padding: 12px; text-decoration: none; transition: transform .15s, background .15s; }
.insight-row:hover { transform: translateY(-1px); background: white; }
.insight-icon { width: 29px; height: 29px; display: grid; place-items: center; background: #f2f5f0; border-radius: 8px; font: 700 10px 'Manrope'; color: #747b70; }
.insight-copy { display: grid; min-width: 0; }
.insight-copy strong { font-size: 12px; }
.insight-copy small { color: #747b70; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-pill { border: 1px solid #d4dfcb; border-radius: 8px; padding: 7px 11px; font-size: 10px; font-weight: 800; }

.syllabus-card { overflow: hidden; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.complete { background: #8fd55f; }
.dot.learning { background: var(--violet); }
.topic-table { padding: 15px 24px 22px; display: grid; }
.topic-row { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(100px, .65fr) 75px 130px 75px; gap: 14px; align-items: center; min-height: 84px; border-top: 1px solid #eef0f4; }
.topic-row .question-count { display:grid; gap:7px; padding:12px 0; }
.topic-test-button { display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border-radius:8px;background:var(--ink);color:var(--mint);font:700 12px/1.4 'DM Sans',system-ui,sans-serif;text-decoration:none;text-align:center; }
.topic-test-button:hover { background:#284a18; }
.topic-row:first-child { border-top: 0; }
.topic-name { display: flex; align-items: center; gap: 10px; }
.topic-name { text-decoration: none; }
.topic-code { width: 29px; height: 29px; border-radius: 8px; background: var(--blue-soft); color: #476aa5; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.topic-name strong { font-size: 12px; }
.topic-name small { display: block; font-size: 10px; color: var(--muted); }
.mini-progress { display: flex; align-items: center; gap: 8px; }
.mini-progress .bar { flex: 1; height: 5px; }
.mini-progress span { color: var(--muted); font-size: 10px; width: 28px; }
.question-count { color: var(--muted); font-size: 10px; }
.mastery-cell { display: grid; }
.mastery-cell strong { color: var(--violet); font: 700 12px 'Manrope'; }
.mastery-cell small { color: var(--muted); font-size: 9px; }
.mastery-cell.empty strong { color: #a1a8b3; }
.status-button { justify-self: end; border: 1px solid var(--line); background: white; color: #6f7480; border-radius: 8px; padding: 6px 9px; font: 700 9px 'DM Sans'; cursor: pointer; }
.status-button:hover { border-color: #a8a3ef; color: #5651cb; }
.status-button.studied { background: #ecfbe2; color: #4b9324; border-color: #ccebb8; }
.topic-row-locked{grid-template-columns:minmax(190px,1.4fr) minmax(175px,.9fr) 78px 75px;background:linear-gradient(90deg,rgba(65,57,195,.035),transparent);padding-inline:8px;border-radius:9px}.topic-row-locked .topic-code{background:var(--violet-soft);color:var(--violet)}.topic-lock-copy{display:grid}.topic-lock-copy strong{color:var(--violet);font-size:10px}.topic-lock-copy small{color:var(--muted);font-size:9px}.status-button.pro-link{text-decoration:none;background:var(--violet-soft);border-color:#d2ceff;color:var(--violet);text-align:center}

.continue-card { padding: 18px; }
.continue-art { height: 104px; overflow: hidden; border-radius: 12px; background: #111a2c; position: relative; margin-bottom: 19px; }
.continue-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 18px 18px; }
.cpu-chip { position: absolute; width: 52px; height: 52px; border: 2px solid #9fe56d; color: #baf092; border-radius: 9px; display: grid; place-items: center; font: 700 13px 'Manrope'; top: 26px; right: 35px; box-shadow: 0 0 0 7px rgba(159,229,109,.08); }
.code-line { position: absolute; height: 5px; background: #6878a5; border-radius: 5px; left: 24px; }
.line-one { width: 78px; top: 31px; }.line-two { width: 58px; top: 49px; }.line-three { width: 91px; top: 67px; background: #7370df; }
.continue-card h2 { font-size: 21px; margin: 0 0 4px; }
.continue-card > p:not(.section-label) { font-size: 11px; color: var(--muted); margin: 0 0 19px; }
.continue-progress { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.continue-progress strong { color: var(--ink); }
.primary-button, .secondary-button { width: 100%; min-height: 42px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; text-decoration: none; font-size: 12px; font-weight: 800; margin-top: 14px; }
.primary-button { background: var(--navy); color: white; }
.secondary-button { justify-content: center; border: 1px solid var(--line); background: white; color: #606574; cursor: pointer; margin-top: 8px; }
.secondary-button:hover { border-color: var(--violet); color: var(--violet); }

.task-card { padding-bottom: 8px; }
.task-total { font-size: 9px; background: #f1f2f5; padding: 5px 8px; border-radius: 8px; color: var(--muted); }
.task-list { padding: 12px; display: grid; }
.task-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px 8px; border-top: 1px solid #eef0f4; text-decoration: none; }
.task-row:first-child { border-top: 0; }
.task-type { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.task-row > span:nth-child(2) { display: grid; }
.task-row strong { font-size: 11px; }
.task-row small { font-size: 9px; color: var(--muted); }
.task-row b { color: var(--muted); font-size: 9px; }

.local-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 15px; }
.local-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); font-weight: 800; }
.local-card strong { font-size: 11px; }
.local-card p { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.local-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.local-card button { border: 1px solid #d4d9e1; color: #4f5562; background: #f6f8fb; border-radius: 7px; padding: 7px 9px; font: 700 9px 'DM Sans'; cursor: pointer; }
.local-card button:hover { border-color: var(--violet); color: var(--violet); }
.local-card button.danger { color: #9a5a54; background: var(--coral-soft); border-color: #edc7c1; }
.local-message { grid-column: 2 / -1; min-height: 12px; margin: -3px 0 0 !important; color: #4b9324 !important; }
.local-message.error { color: #a4473d !important; }
.mobile-nav { display: none; }

@media (max-width: 1080px) {
  .overview-body { grid-template-columns: 140px 1fr; }
  .paper-progress { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 20px; }
  .primary-nav { display: none; }
  .dashboard-shell { width: min(100% - 28px, 720px); padding-top: 25px; padding-bottom: 90px; }
  .welcome-row { align-items: flex-start; }
  .today-chip { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-column { grid-row: 1; grid-template-columns: 1fr 1fr; align-items: start; }
  .local-card { grid-column: 1 / -1; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; display: flex; overflow-x: auto; background: var(--navy); border-radius: 16px; padding: 7px; box-shadow: 0 15px 40px rgba(13,20,35,.28); scrollbar-width: thin; }
  .mobile-nav a { min-height: 42px; flex: 1 0 86px; display: grid; place-items: center; gap: 2px; color: #8790a2; text-decoration: none; font-size: 9px; padding: 5px; border-radius: 10px; }
  .mobile-nav a span { font-size: 16px; }
  .mobile-nav a.active { background: white; color: var(--navy); }
}

@media (max-width: 620px) {
  .topbar { height: 60px; }
  .profile-copy { display: none; }
  .dashboard-shell { width: min(100% - 20px, 520px); }
  h1 { font-size: 31px; }
  .welcome-copy { font-size: 13px; }
  .overview-body { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .overview-stats { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .metric { display: grid; justify-items: center; gap: 5px; }
  .paper-progress { grid-template-columns: 1fr; width: 100%; text-align: left; }
  .side-column { grid-template-columns: 1fr; }
  .local-card { grid-column: auto; grid-template-columns: auto 1fr; }
  .local-actions { justify-content: flex-start; grid-column: 1 / -1; }
  .local-message { grid-column: 1 / -1; }
  .insight-row { grid-template-columns: auto 1fr; }
  .action-pill { display: none; }
  .card-heading { padding-inline: 16px; }
  .topic-table { padding-inline: 16px; }
  .topic-row { grid-template-columns: 1fr auto; padding: 8px 0; }
  .mini-progress, .question-count, .topic-lock-copy { display: none; }
  .topic-row:not(.topic-row-locked) .question-count { display:grid;grid-column:1;justify-self:start; }
  .topic-row:not(.topic-row-locked) .status-button { grid-column:2; }
  .topic-row-locked .question-count { display:none; }
  .status-button { grid-column: 1 / -1; justify-self: stretch; min-height: 36px; }
  .legend { display: none; }
}

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