:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17213a;
  background: #f5f7fb;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex: none;
  background: #fff;
  border-right: 1px solid #e9edf4;
  display: flex;
  flex-direction: column;
  padding: 27px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 44px; }
.brand-mark {
  height: 36px; width: 36px; border-radius: 11px;
  background: #345bd6; color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 21px;
  box-shadow: 0 7px 17px #345bd633;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.03em; }
.brand small { font-size: 10px; color: #9099a9; margin-top: 2px; }
.nav { display: grid; gap: 5px; }
.nav-item {
  border: 0; background: transparent; text-align: left; border-radius: 11px;
  color: #64718a; font-size: 13px; font-weight: 600; padding: 12px 14px;
  display: flex; align-items: center; gap: 14px;
}
.nav-item:hover { background: #f5f7fc; }
.nav-item.active { background: #ecf1ff; color: #3158ca; }
.nav-icon { font-size: 17px; width: 19px; text-align: center; font-weight: 400; }
.sidebar-bottom { margin-top: auto; padding: 0 12px; color: #9aa3b1; }
.sidebar-bottom a { color: #66758e; text-decoration: none; font-size: 12px; }
.sidebar-bottom a:hover { text-decoration: underline; }
.privacy-note { font-size: 11px; line-height: 1.55; border-top: 1px solid #edf0f5; padding: 20px 0 16px; }
.mobile-nav, .nav-scrim, .day-tabs { display: none; }
.main { flex: 1; min-width: 0; }
.topbar {
  height: 72px; border-bottom: 1px solid #e9edf4; background: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 43px;
}
.crumb { display: flex; gap: 11px; align-items: center; font-size: 12px; color: #9aa4b4; min-width: 0; }
.crumb-sep { color: #c2c9d5; }
.crumb b { font-weight: 600; color: #59657b; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.sync-label { font-size: 11px; color: #8c97aa; }
.button { border-radius: 9px; padding: 11px 15px; border: 1px solid transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.button.subtle { background: #f4f6fa; border-color: #ebeff5; color: #52617c; }
.button.subtle:hover { background: #e9edf5; }
.button.primary { color: #fff; background: #315bd6; border-color: #315bd6; box-shadow: 0 7px 16px #315bd626; }
.button.primary:hover { background: #214ac2; }
.button:disabled { opacity: .6; cursor: wait; }
.mobile-menu { display: none; background: none; border: 0; font-size: 18px; color: #344054; }
.content { max-width: 1550px; margin: auto; padding: 38px 43px 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.eyebrow, .section-kicker { font-size: 10px; font-weight: 800; color: #6d82bb; letter-spacing: .13em; }
.page-heading h1 { font-size: 30px; letter-spacing: -.055em; margin: 10px 0 8px; line-height: 1.2; }
.page-heading p { margin: 0; color: #8290a5; font-size: 13px; }
.date-pill {
  border: 1px solid #e6eaf2; background: #fff; border-radius: 30px;
  color: #66738b; font-size: 11px; padding: 10px 14px; white-space: nowrap; text-transform: capitalize;
}
.connect-panel {
  background: #fff; border: 1px solid #e9edf4; border-radius: 17px;
  padding: 29px; box-shadow: 0 12px 36px #1f32600b; max-width: 840px;
}
.connect-copy { display: flex; gap: 17px; align-items: flex-start; }
.connect-icon {
  display: grid; place-items: center; height: 43px; width: 43px; flex: none;
  border-radius: 13px; background: #ebf0ff; color: #315bd6; font-size: 21px;
}
.connect-copy h2 { margin: 1px 0 7px; font-size: 19px; letter-spacing: -.035em; }
.connect-copy p { margin: 0; color: #8290a5; font-size: 12px; line-height: 1.65; max-width: 590px; }
.connect-copy strong { color: #536381; }
.connect-panel form { display: flex; align-items: end; gap: 12px; margin: 28px 0 0 60px; }
.connect-panel label { display: grid; gap: 8px; flex: 1; font-size: 11px; color: #67758d; font-weight: 700; min-width: 0; }
.connect-panel input {
  height: 40px; width: 100%; border: 1px solid #dee5ef; border-radius: 9px;
  padding: 0 12px; outline: none; color: #17213a; min-width: 0; background: #fff;
}
.connect-panel input:focus { border-color: #6b8cec; box-shadow: 0 0 0 3px #6b8cec22; }
.connect-panel form .button { height: 40px; }
.form-error { margin: 15px 0 0 60px; color: #b33939; font-size: 12px; }
.refresh-error { color: #a83d3d; background: #fff0ee; border: 1px solid #f4d4cf; border-radius: 9px; padding: 11px 14px; margin-bottom: 17px; font-size: 12px; }
.demo-link { border: 0; background: none; color: #315bd6; font-size: 11px; font-weight: 700; margin: 21px 0 0 60px; padding: 0; }
.mode-banner { padding: 12px 16px; border: 1px solid #e7d596; background: #fff9e8; border-radius: 10px; color: #8a641e; font-size: 12px; margin-bottom: 18px; }
.mode-banner button { border: 0; background: none; color: #72500d; text-decoration: underline; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card {
  background: #fff; border: 1px solid #e9edf4; border-radius: 15px;
  padding: 20px 21px; min-height: 145px; box-shadow: 0 8px 25px #1f326007;
}
.summary-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .09em; font-weight: 800; color: #8996aa; }
.summary-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 16px; letter-spacing: 0; }
.summary-card.blue .summary-icon { background: #edf2ff; color: #4c70df; }
.summary-card.violet .summary-icon { background: #f3eeff; color: #8b65d8; }
.summary-card.orange .summary-icon { background: #fff1e7; color: #e49445; }
.summary-card.green .summary-icon { background: #eaf8ef; color: #55ad77; }
.summary-card strong { display: block; font-size: 31px; letter-spacing: -.06em; margin-top: 10px; }
.summary-card small { color: #99a3b3; font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.52fr) minmax(330px,1fr); gap: 19px; }
.right-stack { display: grid; gap: 19px; align-content: start; }
.card { background: #fff; border: 1px solid #e9edf4; border-radius: 16px; padding: 23px 25px; box-shadow: 0 8px 25px #1f326007; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 21px; }
.section-head h2 { font-size: 18px; letter-spacing: -.035em; margin: 5px 0 0; }
.text-button { font-size: 11px; color: #315bd6; font-weight: 700; background: none; border: 0; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.grade-list { display: grid; }
.grade-row { display: grid; grid-template-columns: minmax(115px,1fr) minmax(90px,1.4fr) 54px; gap: 13px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eef1f5; min-height: 57px; }
.grade-row:last-child { border-bottom: 0; }
.subject-name { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.subject-name small { display: block; color: #a2adbc; font-weight: 400; margin-top: 4px; }
.grade-values { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.grade-pill { min-width: 27px; height: 27px; padding: 4px 6px; display: inline-grid; place-items: center; background: #ebf1ff; color: #3e65d5; border-radius: 7px; font-size: 12px; font-weight: 800; }
.grade-pill.grade-low { background: #fff1eb; color: #d77b59; }
.average { text-align: center; border-radius: 8px; background: #f5f7fa; font-size: 12px; color: #6d7b91; font-weight: 800; padding: 8px 3px; }
.muted, .helper-text { color: #a4acb8; font-size: 11px; }
.lesson-list, .message-list { display: grid; }
.lesson-row { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.lesson-row:last-child, .message-row:last-child { border-bottom: 0; }
.lesson-time { font-size: 10px; color: #4770d9; background: #eef3ff; border-radius: 7px; min-width: 86px; text-align: center; padding: 9px 5px; align-self: start; font-weight: 700; }
.lesson-row strong, .message-row strong { display: block; font-size: 11px; line-height: 1.4; }
.lesson-row small, .message-row small { display: block; font-size: 10px; color: #a0aaba; margin-top: 4px; }
.message-row { display: flex; gap: 11px; align-items: center; padding: 10px 0; border: 0; border-bottom: 1px solid #eef1f5; background: transparent; color: inherit; text-align: left; width: 100%; border-radius: 7px; }
.message-row:hover, .message-row:focus-visible { background: #f5f7fc; outline: none; }
.message-row.unread strong { color: #315bd6; }
.message-avatar { height: 32px; width: 32px; flex: none; border-radius: 9px; background: #f0f2f8; color: #6d79a0; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.message-row.unread .message-avatar { background: #eaf0ff; color: #3f64cf; }
.message-info { flex: 1; min-width: 0; }
.message-row time { font-size: 10px; color: #a4adba; white-space: nowrap; }
.message-chevron { color: #a5afc0; font-size: 20px; line-height: 1; }
.message-dialog { width: min(620px, calc(100vw - 28px)); max-height: min(740px, calc(100dvh - 28px)); border: 1px solid #e4e9f2; border-radius: 17px; padding: 25px; box-shadow: 0 25px 80px #1423483b; color: #17213a; }
.message-dialog::backdrop { background: #101c3b83; }
.message-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.message-close { border: 0; background: #f2f5fa; color: #52617c; border-radius: 9px; width: 36px; height: 36px; font-size: 25px; line-height: 1; }
.message-dialog h2 { font-size: 21px; margin: 12px 0 6px; overflow-wrap: anywhere; }
.message-meta { color: #8290a5; font-size: 12px; margin: 0 0 22px; }
.message-status { border-top: 1px solid #e9edf4; padding-top: 18px; color: #8290a5; font-size: 13px; }
.message-content { border-top: 1px solid #e9edf4; padding-top: 20px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-files { border-top: 1px solid #e9edf4; margin-top: 22px; padding-top: 12px; color: #66758e; font-size: 12px; }
.message-auth { display: grid; gap: 13px; border-top: 1px solid #e9edf4; padding-top: 17px; }
.message-auth p { font-size: 12px; color: #8290a5; line-height: 1.5; margin: 0; }
.message-auth label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #66758e; }
.message-auth input { width: 100%; min-height: 43px; border: 1px solid #dee5ef; border-radius: 9px; padding: 0 11px; }
.message-auth .button { justify-self: start; }
.message-error { color: #b33939; font-size: 12px; margin: 12px 0 0; }
.full-card { min-height: 280px; }
.week-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.day-column { border: 1px solid #ecf0f5; border-radius: 11px; padding: 11px; min-height: 250px; background: #fbfcfe; min-width: 0; }
.day-column.today { border-color: #a9bcf6; background: #f6f8ff; }
.day-head { font-size: 11px; font-weight: 800; margin: 2px 2px 13px; }
.day-head span { display: block; color: #5474d5; font-size: 9px; margin-top: 3px; }
.lesson-tile { display: grid; gap: 6px; background: #fff; border: 1px solid #e7ebf2; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.lesson-tile small { color: #5878d2; font-size: 9px; font-weight: 700; }
.lesson-tile strong { font-size: 11px; overflow-wrap: anywhere; }
.lesson-tile span { color: #9aa4b3; font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.day-empty { font-size: 10px; color: #a8b1c0; padding: 10px 2px; }
.empty-state { text-align: center; padding: 35px 12px; color: #9ba6b7; }
.empty-state span { font-size: 26px; }
.empty-state p { font-size: 11px; margin: 9px 0 0; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .content { padding: 32px 25px 50px; }
  .topbar { padding: 0 25px; }
  .overview-grid { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: 1fr 1fr; }
  .summary-grid { gap: 10px; }
  .summary-card { padding: 16px; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; width: min(82vw,280px);
    transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 45px #18244718;
  }
  .sidebar.open { transform: none; }
  .nav-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: #101c3b66; }
  .topbar { position: sticky; top: 0; z-index: 18; height: 60px; padding: 0 14px; background: #fffffff2; backdrop-filter: blur(12px); }
  .mobile-menu { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
  .mobile-menu:hover { background: #f3f6fb; }
  .crumb { margin-right: auto; margin-left: 7px; min-width: 0; font-size: 14px; }
  .crumb-parent, .crumb-sep { display: none; }
  .crumb b { color: #213353; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .top-actions { gap: 6px; }
  .top-actions .button { min-width: 40px; min-height: 40px; padding: 8px 10px; }
  .top-actions .button span { display: none; }
  .sync-label { display: none; }
  .content { padding: 25px 14px calc(112px + env(safe-area-inset-bottom)); }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .page-heading h1 { font-size: clamp(23px,6vw,29px); line-height: 1.16; margin: 8px 0; }
  .page-heading p { font-size: 12px; line-height: 1.5; }
  .date-pill { display: inline-flex; padding: 8px 11px; font-size: 10px; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 13px; }
  .summary-card { min-height: 118px; padding: 14px 13px; border-radius: 13px; }
  .summary-top { font-size: 9px; letter-spacing: .04em; align-items: flex-start; gap: 4px; }
  .summary-icon { width: 28px; height: 28px; flex: none; }
  .summary-card strong { font-size: 29px; margin-top: 7px; }
  .summary-card small { font-size: 10px; }
  .overview-grid, .right-stack { gap: 13px; }
  .right-stack { grid-template-columns: 1fr; }
  .card { padding: 19px 15px; border-radius: 13px; }
  .section-head { margin-bottom: 15px; }
  .section-head h2 { font-size: 17px; }
  .grade-row { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "subject average" "values values"; gap: 8px 10px; padding: 13px 0; }
  .subject-name { grid-area: subject; font-size: 13px; }
  .grade-values { grid-area: values; gap: 7px; }
  .grade-pill { min-width: 32px; height: 32px; font-size: 13px; }
  .average { grid-area: average; min-width: 51px; }
  .lesson-row { align-items: flex-start; }
  .lesson-row strong, .message-row strong { font-size: 12px; }
  .lesson-row small, .message-row small { font-size: 11px; }
  .message-row { align-items: flex-start; }
  .message-row time { max-width: 64px; white-space: normal; text-align: right; line-height: 1.35; }
  .message-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; padding: 23px 17px calc(24px + env(safe-area-inset-bottom)); }
  .message-dialog h2 { font-size: 20px; }
  .message-content { font-size: 15px; }
  .message-auth .button { width: 100%; min-height: 45px; }
  .connect-panel { padding: 19px 16px; }
  .connect-copy { gap: 12px; }
  .connect-icon { width: 36px; height: 36px; border-radius: 10px; }
  .connect-copy h2 { font-size: 18px; }
  .connect-panel form { margin: 24px 0 0; display: grid; align-items: stretch; }
  .connect-panel label { font-size: 12px; width: 100%; }
  .connect-panel input, .connect-panel form .button { height: 46px; }
  .connect-panel form .button { width: 100%; }
  .form-error, .demo-link { margin-left: 0; }
  .demo-link { min-height: 44px; display: flex; align-items: center; }
  .day-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; margin-bottom: 13px; }
  .day-tab {
    min-height: 45px; border: 1px solid #e4e9f3; border-radius: 9px;
    background: #f8faff; color: #6c7890; font-size: 12px; font-weight: 800;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  }
  .day-tab small { font-size: 8px; font-weight: 600; }
  .day-tab.selected { background: #e9efff; border-color: #8aa5ed; color: #315bd6; }
  .week-grid { display: block; overflow: visible; }
  .day-column { display: none; min-height: 0; padding: 14px; }
  .day-column.selected { display: block; }
  .day-head { font-size: 14px; margin-bottom: 13px; }
  .lesson-tile { padding: 13px; margin-bottom: 9px; gap: 7px; }
  .lesson-tile small { font-size: 11px; }
  .lesson-tile strong { font-size: 13px; }
  .lesson-tile span { font-size: 11px; }
  .mobile-nav:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: #fffffff2; border-top: 1px solid #e4e9f1;
    box-shadow: 0 -10px 26px #16234b12; backdrop-filter: blur(16px);
  }
  .mobile-nav .nav-item {
    min-width: 0; min-height: 54px; padding: 6px 2px;
    flex-direction: column; justify-content: center; gap: 3px;
    text-align: center; font-size: 10px; border-radius: 10px; line-height: 1.1;
  }
  .mobile-nav .nav-icon { font-size: 21px; width: auto; line-height: 1; }
  .mobile-nav .nav-item.active { background: #edf2ff; }
}
@media (max-width: 380px) {
  .content { padding-left: 11px; padding-right: 11px; }
  .card { padding-left: 12px; padding-right: 12px; }
  .summary-card { padding: 12px 10px; }
  .summary-top { font-size: 8px; }
  .section-head { gap: 5px; }
  .text-button { font-size: 10px; }
}
