:root {
  --ink: #17203b;
  --ink-soft: #566078;
  --purple: #5b4de2;
  --purple-dark: #4235bd;
  --purple-soft: #eeeafd;
  --yellow: #ffcb47;
  --yellow-soft: #fff6d7;
  --mint: #42d3a5;
  --mint-soft: #dcf8ee;
  --blue-soft: #e7f2ff;
  --red: #e96868;
  --red-soft: #ffebeb;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --line: #e6e8f0;
  --shadow: 0 18px 50px rgba(23, 32, 59, .08);
  --radius: 22px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, .brand { font-family: Manrope, "DM Sans", sans-serif; }
h1 { font-size: clamp(2.8rem, 5vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -.035em; }
h3 { font-size: 1.18rem; letter-spacing: -.02em; }
p { line-height: 1.6; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.25rem; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px 11px 11px 3px; color: white; background: var(--purple); font-size: 1.05rem; }
.brand--light { color: white; }
.brand--light .brand-mark { color: var(--ink); background: var(--yellow); }
.muted { color: var(--ink-soft); }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.06fr) minmax(420px, .94fr); }
.login-brand { min-height: 100vh; padding: clamp(35px, 6vw, 80px); color: white; background: linear-gradient(145deg, #17203b 0%, #312874 62%, #5849cf 100%); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.login-brand::before { width: 550px; height: 550px; right: -300px; top: 12%; }
.login-brand::after { width: 340px; height: 340px; left: -190px; bottom: 1%; }
.login-copy { position: relative; max-width: 720px; padding: 80px 0 50px; }
.login-copy h1 { margin: 18px 0 28px; }
.login-copy p { font-size: 1.15rem; color: rgba(255,255,255,.72); max-width: 520px; }
.eyebrow { display: inline-flex; padding: 8px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 30px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quote-card { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; max-width: 620px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: rgba(255,255,255,.09); backdrop-filter: blur(10px); }
.quote-card p { margin: 0; line-height: 1.4; }
.quote-card > span { grid-column: 2; color: rgba(255,255,255,.58); font-size: .82rem; margin-top: 4px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fbfbfd; }
.login-box { width: min(100%, 500px); }
.login-box h2 { margin: 15px 0 9px; }
.demo-label { color: var(--purple-dark); background: var(--purple-soft); border-radius: 30px; padding: 7px 11px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.profile-list { display: grid; gap: 12px; margin: 30px 0 20px; }
.profile-option { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: white; text-align: left; cursor: pointer; transition: .2s ease; }
.profile-option:hover, .profile-option:focus-visible { border-color: var(--purple); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(91,77,226,.10); outline: none; }
.profile-option strong, .profile-option small { display: block; }
.profile-option small { color: var(--ink-soft); margin-top: 4px; }
.profile-option .arrow { font-size: 1.8rem; color: #9aa0b4; }
.demo-note { padding: 14px 16px; background: var(--yellow-soft); border-radius: 14px; color: #745910; font-size: .82rem; line-height: 1.45; }
.login-fields { margin-top: 28px; }
.login-fields label, .install-form label { display: grid; gap: 7px; font-weight: 700; font-size: .86rem; }
.login-fields input, .install-form input, .install-form select { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: white; }
.login-fields input:focus, .install-form input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.login-help { margin: 18px 0 0; color: var(--ink-soft); font-size: .8rem; }
.form-alert, .install-status { margin: 18px 0; padding: 13px 15px; border-radius: 13px; font-size: .88rem; }
.form-alert.error, .install-status.error { color: #8c2929; background: var(--red-soft); border: 1px solid #f5c7c7; }
.install-status.success { color: #166044; background: var(--mint-soft); border: 1px solid #aee6d3; }
.mobile-brand { display: none; }
.avatar { display: grid; flex: 0 0 auto; width: 45px; height: 45px; place-items: center; border-radius: 14px; font-weight: 800; }
.avatar--purple { color: #fff; background: var(--purple); }
.avatar--yellow { color: #5f4600; background: var(--yellow); }
.avatar--mint { color: #155f4b; background: var(--mint); }

.app-shell { min-height: 100vh; padding-left: 256px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 256px; display: flex; flex-direction: column; padding: 28px 20px 20px; background: white; border-right: 1px solid var(--line); }
.side-nav { display: grid; gap: 5px; margin: 42px 0; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 47px; padding: 0 14px; border: 0; border-radius: 13px; background: transparent; color: var(--ink-soft); font-weight: 600; text-align: left; cursor: pointer; }
.nav-link:hover { color: var(--ink); background: var(--canvas); }
.nav-link.active { color: var(--purple-dark); background: var(--purple-soft); }
.nav-icon { width: 22px; font-size: 1.1rem; text-align: center; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 12px; color: white; background: var(--purple); font-size: .72rem; text-align: center; }
.sidebar-card { margin-top: auto; padding: 17px; border-radius: 18px; background: var(--ink); color: white; }
.sidebar-card span { font-weight: 700; }
.sidebar-card p { margin: 5px 0 9px; color: rgba(255,255,255,.68); font-size: .82rem; line-height: 1.45; }
.text-button { padding: 0; border: 0; color: var(--yellow); background: none; font-weight: 700; font-size: .82rem; cursor: pointer; }
.sidebar-profile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 5px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: var(--ink-soft); font-size: .72rem; margin-top: 2px; }
.sidebar-profile .avatar { width: 38px; height: 38px; border-radius: 12px; }
.topbar { position: fixed; z-index: 15; top: 0; right: 0; left: 256px; height: 74px; display: flex; justify-content: flex-end; align-items: center; padding: 0 34px; border-bottom: 1px solid rgba(230,232,240,.8); background: rgba(246,247,251,.86); backdrop-filter: blur(14px); }
.mobile-page-label { display: none; font-family: Manrope, sans-serif; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sync-state { color: #28765f; font-size: .76rem; font-weight: 700; }
.sync-state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--mint); }
.sync-state.busy { color: var(--ink-soft); }
.sync-state.busy::before { background: var(--yellow); }
.icon-button, .avatar-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: -4px; right: -4px; display: grid; min-width: 18px; height: 18px; place-items: center; border: 2px solid var(--canvas); border-radius: 12px; color: white; background: var(--red); font-size: .65rem; }
.avatar-button { border: 0; color: white; background: var(--purple); font-weight: 800; }
.main-content { max-width: 1440px; margin: 0 auto; padding: 108px 38px 54px; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 7px; font-size: clamp(2rem, 3.6vw, 3.35rem); }
.page-heading p { margin: 0; color: var(--ink-soft); }
.primary-button, .secondary-button { min-height: 45px; padding: 0 18px; border-radius: 13px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.primary-button { border: 1px solid var(--purple); color: white; background: var(--purple); box-shadow: 0 10px 24px rgba(91,77,226,.18); }
.primary-button:hover { background: var(--purple-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: white; }
.secondary-button:hover { border-color: #b8bfd0; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 1.42fr .88fr; gap: 22px; }
.stack { display: grid; gap: 22px; align-content: start; }
.card { border: 1px solid rgba(230,232,240,.88); border-radius: var(--radius); background: white; box-shadow: 0 8px 25px rgba(23,32,59,.035); }
.card-pad { padding: 24px; }
.focus-card { min-height: 250px; padding: clamp(25px, 4vw, 42px); color: white; background: linear-gradient(135deg, var(--ink) 0%, #353080 100%); border: 0; overflow: hidden; position: relative; }
.focus-card::after { content: ""; position: absolute; width: 290px; height: 290px; border: 55px solid rgba(255,255,255,.06); border-radius: 50%; right: -120px; top: -100px; }
.focus-card > * { position: relative; z-index: 1; }
.focus-card .date { color: var(--yellow); font-weight: 700; }
.focus-card h2 { margin: 15px 0 10px; max-width: 620px; font-size: clamp(2rem, 4vw, 3.6rem); }
.focus-card p { color: rgba(255,255,255,.68); margin-bottom: 25px; }
.focus-card .primary-button { color: var(--ink); background: var(--yellow); border-color: var(--yellow); box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card { padding: 20px; }
.stat-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; margin-bottom: 18px; background: var(--purple-soft); }
.stat-card strong { display: block; font: 800 1.85rem/1 Manrope, sans-serif; }
.stat-card span { display: block; color: var(--ink-soft); margin-top: 8px; font-size: .85rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.card-header h3 { margin: 0; }
.card-header button { border: 0; background: none; color: var(--purple-dark); font-weight: 700; cursor: pointer; }
.session-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 17px; border-radius: 17px; background: var(--purple-soft); }
.session-time { display: grid; align-content: center; min-width: 62px; height: 62px; border-radius: 14px; color: white; background: var(--purple); text-align: center; font-weight: 800; }
.session-time small { display: block; font-size: .7rem; opacity: .76; }
.session-card h4 { margin: 3px 0 4px; }
.session-card p { margin: 0; color: var(--ink-soft); font-size: .84rem; }
.task-list { display: grid; gap: 9px; }
.task-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border: 0; }
.task-check { width: 24px; height: 24px; border: 2px solid #cfd3df; border-radius: 8px; background: white; cursor: pointer; }
.task-check.done { color: white; border-color: var(--mint); background: var(--mint); }
.task-title { font-weight: 600; }
.task-title.done { text-decoration: line-through; color: #8a91a4; }
.task-meta { display: flex; gap: 8px; margin-top: 5px; color: var(--ink-soft); font-size: .78rem; }
.tag { display: inline-flex; align-items: center; width: fit-content; min-height: 27px; padding: 3px 9px; border-radius: 20px; font-size: .76rem; font-weight: 700; }
.tag--purple { color: var(--purple-dark); background: var(--purple-soft); }
.tag--yellow { color: #745910; background: var(--yellow-soft); }
.tag--mint { color: #17694f; background: var(--mint-soft); }
.tag--red { color: #963a3a; background: var(--red-soft); }
.progress-ring { --value: 72; width: 122px; height: 122px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--purple) calc(var(--value) * 1%), var(--purple-soft) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: white; }
.progress-ring strong { z-index: 1; font: 800 1.45rem Manrope, sans-serif; }
.progress-wrap { display: flex; gap: 22px; align-items: center; }
.progress-copy p { margin: 6px 0 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.45; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: white; cursor: pointer; }
.filter-button.active { color: white; border-color: var(--ink); background: var(--ink); }
.task-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.board-column { min-width: 0; padding: 18px; border-radius: 20px; background: #eff1f6; }
.board-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 800; }
.board-title span { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 9px; background: white; font-size: .75rem; }
.board-items { display: grid; gap: 11px; }
.board-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 6px 14px rgba(23,32,59,.04); }
.board-card h3 { margin: 11px 0 8px; font-size: 1rem; }
.board-card p { margin: 0; color: var(--ink-soft); font-size: .8rem; }
.board-card .task-check { margin-top: 13px; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; margin-bottom: 22px; }
.day-button { min-height: 82px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }
.day-button span, .day-button strong { display: block; }
.day-button span { color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; }
.day-button strong { margin-top: 8px; font-size: 1.2rem; }
.day-button.active { color: white; border-color: var(--purple); background: var(--purple); }
.day-button.active span { color: rgba(255,255,255,.7); }
.timeline { display: grid; }
.timeline-row { display: grid; grid-template-columns: 74px 1fr; min-height: 80px; }
.timeline-time { padding-top: 8px; color: var(--ink-soft); font-size: .82rem; }
.timeline-line { border-top: 1px solid var(--line); padding: 7px 0 16px; }
.calendar-event { max-width: 620px; padding: 14px 16px; border-left: 4px solid var(--purple); border-radius: 4px 13px 13px 4px; background: var(--purple-soft); }
.calendar-event--yellow { border-color: var(--yellow); background: var(--yellow-soft); }
.calendar-event h3 { margin: 0 0 4px; font-size: .95rem; }
.calendar-event p { margin: 0; color: var(--ink-soft); font-size: .78rem; }

.subject-list { display: grid; gap: 15px; }
.subject-row { display: grid; grid-template-columns: minmax(100px, 150px) 1fr 46px; gap: 15px; align-items: center; }
.subject-name { font-weight: 700; }
.bar { height: 10px; border-radius: 8px; background: #eceef4; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--purple); }
.subject-grade { font-weight: 800; text-align: right; }
.insight-card { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 19px; border-radius: 17px; background: var(--mint-soft); }
.insight-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: white; }
.insight-card h3 { margin: 1px 0 5px; }
.insight-card p { margin: 0; color: #326456; font-size: .88rem; }

.messages-layout { display: grid; grid-template-columns: 330px 1fr; min-height: 610px; overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); }
.conversation-list h3 { padding: 22px 20px 10px; }
.conversation { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 15px 18px; border: 0; border-top: 1px solid var(--line); background: white; text-align: left; cursor: pointer; }
.conversation.active { background: var(--purple-soft); }
.conversation strong, .conversation small { display: block; }
.conversation small { color: var(--ink-soft); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-header { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.chat-header h3 { margin: 0; }
.chat-header span { color: var(--ink-soft); font-size: .8rem; }
.chat-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 24px; background: #fafafd; }
.message { max-width: min(78%, 540px); padding: 12px 15px; border-radius: 16px 16px 16px 4px; background: white; box-shadow: 0 4px 14px rgba(23,32,59,.05); }
.message.own { align-self: flex-end; color: white; background: var(--purple); border-radius: 16px 16px 4px 16px; }
.message p { margin: 0; line-height: 1.45; }
.message time { display: block; margin-top: 5px; opacity: .6; font-size: .68rem; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; height: 45px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; outline: none; }
.chat-form input:focus { border-color: var(--purple); }

.student-table { width: 100%; border-collapse: collapse; }
.student-table th, .student-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.student-table th { color: var(--ink-soft); font-size: .78rem; }
.student-name { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.student-name .avatar { width: 35px; height: 35px; border-radius: 11px; }
.account-grid { display: grid; grid-template-columns: .85fr 1.4fr; gap: 22px; }
.account-card { text-align: center; }
.account-card .avatar { width: 86px; height: 86px; margin: 0 auto 14px; border-radius: 26px; font-size: 1.6rem; }
.settings-list { display: grid; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 70px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { color: var(--ink-soft); margin-top: 4px; }
.switch { width: 48px; height: 27px; padding: 3px; border: 0; border-radius: 20px; background: #ccd0dc; cursor: pointer; }
.switch::after { content: ""; display: block; width: 21px; height: 21px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.switch.on { background: var(--purple); }
.switch.on::after { transform: translateX(21px); }
.empty-state { padding: 45px 20px; text-align: center; color: var(--ink-soft); }
.empty-state .empty-icon { display: grid; width: 60px; height: 60px; place-items: center; margin: 0 auto 15px; border-radius: 19px; background: var(--purple-soft); font-size: 1.4rem; }
.loading-card { min-height: 250px; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.danger-button { min-height: 45px; padding: 0 18px; border: 1px solid #e9b9b9; border-radius: 13px; color: #a83f3f; background: #fffafa; font-weight: 700; cursor: pointer; }

.installer-page { min-height: 100vh; padding: 36px 18px; background: linear-gradient(145deg, #f5f3ff, #f8fbff); }
.installer-card { width: min(100%, 760px); margin: 0 auto; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.installer-card > .brand { margin-bottom: 42px; }
.installer-card h1 { margin: 17px 0 10px; font-size: clamp(2.1rem, 5vw, 3.4rem); }
.install-form { display: grid; gap: 22px; margin-top: 28px; }
.install-form fieldset { display: grid; gap: 15px; margin: 0; padding: 19px; border: 1px solid var(--line); border-radius: 17px; }
.install-form legend { padding: 0 8px; font-family: Manrope, sans-serif; font-weight: 800; }
.install-form small { color: var(--ink-soft); font-weight: 500; }
.form-grid--two { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.check-label { grid-template-columns: auto 1fr !important; align-items: center; }
.check-label input { width: 20px; min-height: 20px; }
.credential-box { margin: 22px 0; padding: 18px; border-radius: 15px; background: var(--canvas); }
.credential-box p { margin: 5px 0; font-size: .9rem; }

.bottom-nav { display: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translate(-50%, 25px); padding: 12px 18px; border-radius: 13px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(14,20,39,.58); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(100%, 520px); max-height: 90vh; overflow: auto; padding: 28px; border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(14,20,39,.28); }
.modal-close { position: absolute; top: 17px; right: 17px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--canvas); font-size: 1.3rem; cursor: pointer; }
.form-grid { display: grid; gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-weight: 700; font-size: .84rem; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; }
.form-field textarea { min-height: 95px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.notice-list { display: grid; gap: 12px; }
.notice { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 13px; border-radius: 14px; background: var(--canvas); }
.notice p { margin: 2px 0 0; color: var(--ink-soft); font-size: .84rem; line-height: 1.4; }

@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 280px 1fr; }
}

@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 20px; align-content: center; }
  .mobile-brand { display: inline-flex; margin-bottom: 50px; }
  .app-shell { padding-left: 0; padding-bottom: 76px; }
  .sidebar { display: none; }
  .topbar { left: 0; height: 66px; padding: 0 18px; justify-content: space-between; }
  .mobile-page-label { display: block; }
  .main-content { padding: 88px 18px 35px; }
  .bottom-nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(15px); }
  .bottom-link { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; color: #777f94; font-size: .67rem; cursor: pointer; }
  .bottom-link .nav-icon { font-size: 1.15rem; }
  .bottom-link.active { color: var(--purple); font-weight: 700; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 2.2rem; }
  .task-board { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; min-height: 630px; }
  .conversation-list { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .sync-state { display: none; }
}

@media (max-width: 570px) {
  .login-box h2 { font-size: 1.75rem; }
  .profile-option { padding: 14px; }
  .demo-note { font-size: .78rem; }
  .main-content { padding-inline: 14px; }
  .page-heading { display: grid; }
  .page-heading .primary-button { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-card:last-child { grid-column: 1 / -1; }
  .week-strip { overflow-x: auto; grid-template-columns: repeat(7, 68px); padding-bottom: 5px; }
  .day-button { min-height: 72px; }
  .subject-row { grid-template-columns: 90px 1fr 38px; gap: 9px; }
  .progress-wrap { align-items: flex-start; }
  .progress-ring { width: 96px; height: 96px; }
  .student-table th:nth-child(3), .student-table td:nth-child(3) { display: none; }
  .chat-body { padding: 16px; }
  .message { max-width: 88%; }
  .form-grid--two { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

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