:root {
  --ink: #18343a;
  --muted: #718187;
  --line: #dfe7e7;
  --surface: #ffffff;
  --teal: #168277;
  --deep: #173f4f;
  --shadow: 0 8px 22px rgba(24, 52, 58, 0.055);
}

body { background: #f2f6f5; color: var(--ink); }
.sidebar { width: 244px; padding: 24px 16px; background: #fbfdfd; }
.main-content { margin-left: 244px; }
.brand { padding: 6px 10px 30px; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 4px 10px rgba(23, 63, 79, .14); }
.brand strong { font-size: 15px; }
.brand small { font-size: 11px; }
.side-nav { gap: 6px; }
.nav-item { position: relative; height: 45px; border-radius: 7px; font-size: 13px; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active { background: #e8f3f1; color: #116d65; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #168277; }
.nav-icon, .nav-symbol { display: inline-block; flex: 0 0 auto; width: 19px; height: 19px; background-color: currentColor; -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; mask-position: center; mask-repeat: no-repeat; mask-size: contain; }
.icon-dashboard { -webkit-mask-image: url('/icons/layout-dashboard.svg'); mask-image: url('/icons/layout-dashboard.svg'); }
.icon-today { -webkit-mask-image: url('/icons/list-checks.svg'); mask-image: url('/icons/list-checks.svg'); }
.icon-assistant { -webkit-mask-image: url('/icons/message-circle.svg'); mask-image: url('/icons/message-circle.svg'); }
.icon-plan { -webkit-mask-image: url('/icons/calendar-days.svg'); mask-image: url('/icons/calendar-days.svg'); }
.icon-knowledge { -webkit-mask-image: url('/icons/book-open.svg'); mask-image: url('/icons/book-open.svg'); }
.icon-records { -webkit-mask-image: url('/icons/history.svg'); mask-image: url('/icons/history.svg'); }
.icon-settings { -webkit-mask-image: url('/icons/settings-2.svg'); mask-image: url('/icons/settings-2.svg'); }
.icon-plus { -webkit-mask-image: url('/icons/plus.svg'); mask-image: url('/icons/plus.svg'); }
.local-badge { font-size: 10px; }
.topbar { height: 66px; padding-inline: 42px; border-color: #e5ebeb; }
.exam-label { padding: 7px 10px; background: #edf5f3; border-radius: 5px; }
.icon-button { width: 36px; height: 36px; transition: background .16s ease, border-color .16s ease; }
.icon-button:hover { background: #edf6f4; border-color: #bfd9d3; }
.view { max-width: 1440px; padding: 38px 42px 54px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: 28px; letter-spacing: 0; }
.page-heading .muted { font-size: 13px; }
.eyebrow { font-size: 11px; }
.date-chip { background: #fff; box-shadow: 0 2px 8px rgba(24,52,58,.035); }
.metric-card { border-radius: 8px; padding: 17px 19px; min-height: 118px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(24,52,58,.09); }
.metric-card>span { font-size: 12px; }
.metric-card strong { font-size: 29px; }
.metric-card small { font-size: 11px; }
.progress-compare { border-radius: 8px; padding: 13px 17px; box-shadow: 0 2px 8px rgba(24,52,58,.025); }
.progress-compare span { font-size: 11px; }
.progress-compare strong { font-size: 15px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { font-size: 15px; }
.section-heading p { font-size: 11px; }
.subject-progress { margin-bottom: 28px; }
.subject-grid { gap: 12px; }
.subject-card { border-radius: 8px; padding: 14px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.subject-card:hover { transform: translateY(-2px); border-color: #c5d9d5; box-shadow: var(--shadow); }
.subject-name { font-size: 12px; }
.subject-card>strong { font-size: 17px; }
.dashboard-columns { gap: 16px; margin-bottom: 16px; }
.panel { border-radius: 8px; padding: 19px 20px; box-shadow: var(--shadow); }
.today-preview, .health-panel { min-height: 245px; }
.mini-task { padding: 12px 0; }
.mini-task strong { font-size: 12px; }
.mini-task small { font-size: 10px; }
.health-reason { font-size: 12px; line-height: 1.7; }
.health-stats span { font-size: 10px; }
.trend-panel { padding: 19px 20px; }
.trend-track { height: 92px; }
.trend-track span { width: 22px; border-radius: 4px 4px 2px 2px; background: #48a99b; }
.trend-day small { font-size: 10px; }
.footnote { border-radius: 6px; font-size: 10px; padding: 11px 13px; }
.button { border-radius: 6px; font-weight: 600; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: #174a56; }
.button.primary:hover { background: #116b68; }
.button.secondary:hover { border-color: #a9cbc3; background: #f2f8f6; }
.task-card { border-radius: 8px; padding: 16px; box-shadow: 0 3px 12px rgba(24,52,58,.035); }
.task-card h3 { font-size: 13px; line-height: 1.55; }
.task-meta { font-size: 10px; }
.log-form label { font-size: 10px; }
.log-form input, .chat-compose textarea, .cloud-login input { border-radius: 6px; }
.week-day { padding-block: 15px; }
.week-day-heading b { font-size: 12px; }
.week-plan-task { padding: 7px 9px; border-radius: 5px; font-size: 11px; }
.week-plan-task>b { font-size: 10px; }
.knowledge-group, .syllabus-panel { border-radius: 8px; box-shadow: var(--shadow); }
.knowledge-row { padding: 12px 14px; }
.knowledge-title strong { font-size: 12px; }
.knowledge-title small { font-size: 10px; }
.ai-chat-panel { min-height: 520px; }
.chat-transcript { min-height: 340px; padding: 10px 4px; }
.chat-message { padding: 13px 15px; border-radius: 9px; }
.chat-message.from-user { background: #e9f5f1; border-color: #cfe5dd; }
.chat-message p { font-size: 14px; }
.chat-compose textarea { min-height: 84px; }
.plan-proposal { border-radius: 8px; padding: 16px; }
.backup-panel, .settings-form { align-self: start; }
.status-chip { padding: 6px 9px; }
.toast { border-radius: 8px; padding: 12px 17px; font-size: 12px; }

@media (max-width: 960px) {
  .view { padding-inline: 26px; }
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
  .topbar { padding-inline: 26px; }
}

@media (max-width: 680px) {
  body { background: #f3f6f5; }
  .main-content { margin-left: 0; }
  .topbar { height: 58px; padding-inline: 15px; }
  .topbar-meta { gap: 6px; }
  .exam-label { padding: 5px 7px; }
  .view { padding: 23px 15px 30px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading .muted { font-size: 11px; }
  .metric-grid.four { gap: 9px; }
  .metric-card { min-height: 104px; padding: 12px 13px; border-radius: 7px; }
  .metric-card>span { font-size: 10px; }
  .metric-card strong { font-size: 24px; margin: 9px 0 4px; }
  .metric-card small { font-size: 9px; line-height: 1.4; }
  .progress-compare { padding: 10px 11px; }
  .subject-grid { gap: 8px; }
  .subject-card { padding: 10px; border-radius: 7px; }
  .dashboard-columns { gap: 10px; }
  .panel { padding: 15px 14px; border-radius: 7px; }
  .today-preview, .health-panel { min-height: 0; }
  .section-heading h2 { font-size: 13px; }
  .section-heading p { font-size: 9px; }
  .mini-task { padding: 10px 0; }
  .mini-task strong { font-size: 11px; }
  .mini-task small { font-size: 9px; }
  .trend-track { height: 65px; }
  .trend-track span { width: 15px; }
  .task-card { padding: 13px; }
  .task-card h3 { font-size: 12px; }
  .mobile-nav { height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 3px calc(5px + env(safe-area-inset-bottom)); background: rgba(251,253,253,.98); }
  .mobile-nav button { gap: 4px; font-size: 8px; }
  .mobile-nav button span { font-size: 17px; }
  .mobile-nav button.active { color: #116d65; }
  .mobile-nav button.active span { transform: translateY(-1px); }
  .chat-transcript { min-height: 280px; max-height: 52vh; }
  .chat-message p { font-size: 12px; }
  .ai-chat-panel { min-height: 0; }
  .week-day { padding-block: 12px; }
}

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