#splash { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, rgb(56 213 255 / 12%), transparent 22rem), linear-gradient(145deg, var(--canvas), var(--canvas-deep)); transition: opacity .35s ease, visibility .35s ease; }
#splash.is-leaving { opacity: 0; visibility: hidden; }
.splash-core { position: relative; display: grid; justify-items: center; gap: 1rem; }
.splash-core::before, .splash-core::after { content: ""; position: absolute; top: 66px; left: 50%; width: 150px; height: 150px; translate: -50% -50%; border: 1px solid rgb(107 215 255 / 25%); border-radius: 50%; animation: orbit 7s linear infinite; }
.splash-core::after { width: 190px; height: 100px; transform: rotate(35deg); animation-duration: 11s; animation-direction: reverse; }
.splash-core img { position: relative; z-index: 1; width: 132px; height: 132px; object-fit: contain; filter: drop-shadow(0 0 28px rgb(66 200 255 / 28%)); }
.splash-core strong { font-size: 1.1rem; letter-spacing: .01em; }
.splash-bar { width: 160px; height: 3px; overflow: hidden; border-radius: 999px; background: var(--line); }
.splash-bar::after { content:""; display:block; width:55%; height:100%; background:linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent); animation:loading-bar 1.25s ease-in-out infinite; }

#auth-root { min-height: 100dvh; }
.auth-stage { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: max(1rem, env(safe-area-inset-top)) clamp(1rem,3vw,3.5rem) max(1rem,env(safe-area-inset-bottom)); }
.auth-topbar { display:flex; justify-content:space-between; align-items:center; }
.brand-lockup { display:flex; align-items:center; gap:.75rem; min-width:0; }
.brand-mark { width:48px; height:48px; padding:4px; border-radius:16px; }
.brand-mark img { width:100%; height:100%; object-fit:contain; }
.brand-copy { display:grid; line-height:1.15; }
.brand-copy strong { font-size:1rem; }
.brand-copy small { color:var(--ink-faint); font-size:.75rem; }
.auth-secure { display:flex; align-items:center; gap:.45rem; color:var(--ink-faint); font-size:.78rem; }
.auth-layout { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(360px,520px); align-items:center; gap:clamp(2rem,7vw,8rem); width:min(1180px,100%); margin:auto; padding:3rem 0; }
.auth-product-mark { width:110px; height:110px; margin-bottom:1.5rem; }
.auth-product-mark img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 18px 32px rgb(49 134 255 / 25%)); }
.auth-product h1 { margin:0; max-width:650px; font-size:clamp(2.7rem,6vw,5.4rem); line-height:.96; letter-spacing:-.055em; }
.auth-product h1 span { color:var(--cyan); }
.auth-product > p:not(.eyebrow) { max-width:600px; color:var(--ink-soft); font-size:1rem; }
.auth-signal-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.75rem; margin-top:2rem; }
.auth-signal-grid span { display:grid; gap:.2rem; padding:1rem; border:1px solid var(--line); border-radius:18px; background:rgb(255 255 255 / 4%); }
.auth-signal-grid img { width:32px; height:32px; object-fit:contain; margin-bottom:.35rem; }
.auth-signal-grid b { font-size:.84rem; }
.auth-signal-grid small { color:var(--ink-faint); font-size:.72rem; }
.auth-panel { padding:clamp(1.35rem,3vw,2rem); border-radius:30px; }
.auth-panel-head h2 { margin:.25rem 0; font-size:1.9rem; }
.auth-panel-head p { margin:0; color:var(--ink-faint); }
.auth-segments { display:grid; grid-template-columns:1fr 1fr; gap:.35rem; margin:1.5rem 0; padding:.3rem; border:1px solid var(--line); border-radius:15px; background:rgb(255 255 255 / 3%); }
.auth-segments button { min-height:40px; border:0; border-radius:11px; color:var(--ink-faint); background:transparent; font-weight:700; }
.auth-segments button.is-active { color:var(--ink); background:rgb(110 92 255 / 16%); }
.auth-form { display:grid; gap:1rem; }
.auth-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.auth-field { display:grid; gap:.45rem; }
.auth-field > span { display:flex; justify-content:space-between; gap:.5rem; color:var(--ink-soft); font-size:.8rem; font-weight:700; }
.auth-field small { color:var(--ink-faint); font-weight:500; }
.auth-input, .form-field input, .form-field select, .form-field textarea, .auth-field input, .auth-field select { width:100%; min-height:48px; padding:.7rem .85rem; border:1px solid var(--line-strong); border-radius:14px; color:var(--ink); background:rgb(255 255 255 / 5%); outline:none; }
.auth-input:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus, .auth-field input:focus, .auth-field select:focus { border-color:rgb(54 213 255 / 50%); box-shadow:0 0 0 3px rgb(54 213 255 / 8%); }
.auth-check { display:flex; align-items:flex-start; gap:.65rem; color:var(--ink-soft); font-size:.78rem; }
.auth-check input { margin-top:.18rem; accent-color:var(--violet); }
.auth-submit { width:100%; }
.auth-text-action { border:0; color:var(--cyan); background:transparent; font-size:.8rem; }
.form-message { margin:.2rem 0 0; color:var(--ink-soft); font-size:.8rem; }
.form-message.is-error { color:var(--danger); }
.auth-footer { display:flex; justify-content:space-between; color:var(--ink-faint); font-size:.72rem; }
.auth-footer nav { display:flex; gap:1rem; }
.auth-state { display:grid; gap:1rem; text-align:center; }
.auth-state-icon { width:74px; height:74px; margin:auto; }
.auth-state-icon img { width:100%; height:100%; object-fit:contain; }
.auth-state-actions { display:grid; gap:.6rem; }
.school-preview { padding:1rem; border:1px solid var(--line); border-radius:16px; background:rgb(255 255 255 / 4%); }

.academic-app { min-height:100dvh; }
.app-stage { min-height:100dvh; margin-left:var(--sidebar-width); transition:margin 180ms var(--ease-liquid); }
.desktop-sidebar { position:fixed; z-index:50; inset:12px auto 12px 12px; width:calc(var(--sidebar-width) - 18px); display:flex; flex-direction:column; padding:14px; border-radius:26px; }
.desktop-sidebar nav { display:grid; gap:.3rem; margin-top:1.3rem; }
.desktop-sidebar nav button, .sidebar-foot button { display:flex; align-items:center; gap:.75rem; width:100%; min-height:45px; padding:.45rem .6rem; border:0; border-radius:14px; color:var(--ink-faint); background:transparent; text-align:left; }
.desktop-sidebar nav button:hover, .desktop-sidebar nav button.is-active, .sidebar-foot button.is-active { color:var(--ink); background:linear-gradient(120deg, rgb(110 92 255 / 18%), rgb(54 213 255 / 8%)); }
.desktop-sidebar nav img, .sidebar-foot img, .mobile-tabbar img { width:28px; height:28px; flex:0 0 auto; object-fit:contain; }
.desktop-sidebar nav b { margin-left:auto; min-width:22px; padding:.12rem .35rem; border-radius:999px; color:#fff; background:var(--danger); text-align:center; font-size:.68rem; }
.sidebar-foot { display:grid; gap:.75rem; margin-top:auto; }
.mini-profile { display:flex; align-items:center; gap:.7rem; padding:.6rem; border-top:1px solid var(--line); }
.mini-profile > span { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; color:white; background:linear-gradient(135deg,var(--violet),#258fdc); font-weight:800; }
.mini-profile div { display:grid; min-width:0; }
.mini-profile strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.8rem; }
.mini-profile small { color:var(--ink-faint); font-size:.68rem; }
.top-control { position:sticky; z-index:40; top:12px; display:flex; align-items:center; gap:1rem; min-height:var(--top-height); margin:12px; padding:.7rem 1rem; border-radius:22px; }
.sidebar-toggle { display:none; }
.mobile-brand { display:none; }
.evaluation-picker { display:flex; align-items:center; gap:.75rem; }
.evaluation-picker span { color:var(--ink-faint); font-size:.68rem; font-weight:800; }
.evaluation-picker select, .top-control select { min-height:40px; padding:0 .75rem; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--surface-solid); }
.top-actions { display:flex; align-items:center; gap:.55rem; margin-left:auto; }
.sync-badge { display:inline-flex; align-items:center; gap:.35rem; color:var(--ink-faint); font-size:.72rem; }
.sync-badge::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--warning); }
.sync-saved::before { background:var(--success); }
.sync-error::before, .sync-conflict::before { background:var(--danger); }
.command-trigger { min-height:42px; padding:0 .85rem; border:1px solid var(--line); border-radius:13px; color:var(--ink-faint); background:rgb(255 255 255 / 4%); }
.app-content { width:min(1450px,calc(100% - 24px)); min-height:calc(100dvh - 112px); margin:0 auto; padding:12px 0 42px; }
.mobile-tabbar { display:none; }

.view-page { display:grid; gap:1rem; animation:page-in .3s var(--ease-liquid); }
.view-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.view-heading > div { display:flex; align-items:center; gap:.9rem; }
.view-heading img { width:54px; height:54px; object-fit:contain; }
.view-heading h1 { margin:0; font-size:clamp(1.7rem,3vw,2.5rem); }
.view-heading p { margin:.2rem 0 0; color:var(--ink-faint); font-size:.82rem; }
.panel { padding:1.15rem; border-radius:24px; }
.stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; }
.stat-card { padding:1rem; border:1px solid var(--line); border-radius:20px; background:var(--surface); }
.stat-card img { width:34px; height:34px; object-fit:contain; margin-bottom:.7rem; }
.stat-card strong { display:block; font-size:1.5rem; }
.stat-card span { color:var(--ink-faint); font-size:.75rem; }
.content-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.7fr); gap:1rem; }
.list { display:grid; gap:.6rem; }
.list-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.75rem; padding:.8rem; border:1px solid var(--line); border-radius:16px; background:rgb(255 255 255 / 3%); }
.list-row img { width:34px; height:34px; object-fit:contain; }
.list-row > div { min-width:0; }
.list-row strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-row small { color:var(--ink-faint); }
.empty-state { display:grid; place-items:center; align-content:center; min-height:240px; padding:2rem; color:var(--ink-faint); text-align:center; }
.empty-state img { width:72px; height:72px; object-fit:contain; margin-bottom:1rem; }
.module-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
.module-card { min-height:170px; padding:1.15rem; border:1px solid var(--line); border-radius:23px; color:var(--ink); background:linear-gradient(145deg,rgb(255 255 255 / 7%),var(--surface)); text-align:left; }
.module-card img { width:52px; height:52px; object-fit:contain; }
.module-card h2 { margin:1rem 0 .25rem; font-size:1.05rem; }
.module-card p { margin:0; color:var(--ink-faint); font-size:.78rem; }
.modal-layer { position:fixed; z-index:300; inset:0; display:grid; place-items:center; padding:1rem; background:rgb(0 4 18 / 62%); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.modal { width:min(620px,100%); max-height:min(88dvh,850px); overflow:auto; padding:1.25rem; border-radius:25px; }
.modal header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.modal h2 { margin:0; }
.modal-form { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.form-field { display:grid; gap:.4rem; }
.form-field > span { color:var(--ink-soft); font-size:.78rem; font-weight:700; }
.form-field textarea { min-height:100px; resize:vertical; }
.form-span { grid-column:1 / -1; }
.modal footer { display:flex; justify-content:flex-end; gap:.6rem; margin-top:1rem; }

@media (max-width: 860px) {
  .auth-layout { grid-template-columns:1fr; padding:1.5rem 0; }
  .auth-product { display:none; }
  .auth-stage { padding:.85rem; }
  .auth-panel { width:min(100%,520px); margin:auto; }
  .auth-footer { gap:1rem; flex-direction:column; align-items:center; }
  .desktop-sidebar { display:none; }
  .app-stage { margin-left:0; padding-bottom:82px; }
  .top-control { top:0; min-height:64px; margin:0; border-radius:0 0 20px 20px; padding-top:max(.6rem,env(safe-area-inset-top)); }
  .sidebar-toggle, .mobile-brand { display:flex; }
  .sidebar-toggle { width:42px; height:42px; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:13px; color:var(--ink); background:transparent; }
  .mobile-brand { align-items:center; gap:.5rem; min-width:0; }
  .mobile-brand img { width:36px; height:36px; object-fit:contain; }
  .mobile-brand strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem; }
  .evaluation-picker, .command-trigger, .top-actions .btn-primary { display:none; }
  .sync-badge { margin-left:auto; }
  .app-content { width:100%; min-height:calc(100dvh - 150px); padding:12px; }
  .mobile-tabbar { position:fixed; z-index:80; right:8px; bottom:max(8px,env(safe-area-inset-bottom)); left:8px; display:grid; grid-template-columns:repeat(5,1fr); min-height:68px; padding:.35rem; border-radius:21px; }
  .mobile-tabbar button { display:grid; place-items:center; gap:.15rem; border:0; border-radius:15px; color:var(--ink-faint); background:transparent; }
  .mobile-tabbar button.is-active { color:var(--ink); background:rgb(110 92 255 / 15%); }
  .mobile-tabbar img { width:29px; height:29px; }
  .mobile-tabbar small { font-size:.62rem; }
  .stat-grid { grid-template-columns:repeat(2,1fr); }
  .content-grid { grid-template-columns:1fr; }
  .module-grid { grid-template-columns:repeat(2,1fr); }
  .view-heading img { width:46px; height:46px; }
  .view-heading p { display:none; }
  .modal-form { grid-template-columns:1fr; }
  .form-span { grid-column:auto; }
}

@media (max-width: 520px) {
  .auth-form-grid, .auth-signal-grid { grid-template-columns:1fr; }
  .stat-grid { gap:.65rem; }
  .module-grid { grid-template-columns:1fr 1fr; gap:.65rem; }
  .module-card { min-height:145px; padding:.9rem; }
  .module-card img { width:44px; height:44px; }
  .view-heading { align-items:flex-start; }
  .view-heading .btn-primary span { display:none; }
}

/* Static application integration */
.hidden { display:none !important; }
.view-stack { display:grid; gap:16px; }
.page-intro { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.module-heading { display:flex; align-items:center; gap:15px; min-width:0; }
.module-heading > img { width:56px; height:56px; object-fit:contain; filter:drop-shadow(0 9px 18px rgb(67 100 255 / 22%)); }
.page-intro h1 { margin:0; font-size:clamp(1.8rem,4vw,2.7rem); letter-spacing:-.04em; }
.page-intro p:not(.eyebrow) { margin:.25rem 0 0; color:var(--ink-faint); font-size:.82rem; }
.page-actions { display:flex; align-items:center; gap:.55rem; }
.content-panel { padding:18px; border:1px solid var(--line); border-radius:24px; background:var(--surface); box-shadow:var(--glass-shadow); }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:10px; }
.section-heading h2 { margin:0; font-size:1rem; }
.section-heading button { border:0; color:var(--violet-soft); background:transparent; font-size:.72rem; font-weight:700; }
.panel-kicker { color:var(--cyan); font-size:.66rem; font-weight:850; }
.icon-button { display:grid; place-items:center; min-width:34px; height:34px; border:1px solid var(--line); border-radius:11px; color:var(--ink-faint); background:rgb(255 255 255 / 4%); }
.module-card { cursor:pointer; transition:transform 180ms var(--ease-liquid),border-color 180ms; }
.module-card:hover { transform:translateY(-3px); border-color:rgb(54 213 255 / 30%); }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.setting-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:62px; padding:10px 0; border-bottom:1px solid var(--line); }
.setting-row:last-child { border-bottom:0; }
.setting-row > span { display:grid; }
.setting-row strong { font-size:.82rem; }
.setting-row small { margin-top:4px; color:var(--ink-faint); font-size:.7rem; }
.setting-row select,.setting-row input[type="number"] { min-height:40px; max-width:190px; padding:0 .7rem; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--surface-solid); }
.danger-zone { grid-column:1/-1; }
.danger-zone .btn-danger { margin-left:10px; padding:12px; }
.schedule-mobile-row { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
.schedule-mobile-row span { display:grid; }
.schedule-mobile-row small { color:var(--ink-faint); }
.focus-modal { width:min(500px,100%); display:grid; justify-items:center; text-align:center; }
.focus-modal > strong { margin:12px 0; font-size:clamp(3rem,12vw,6rem); font-variant-numeric:tabular-nums; }
.legal-stage { width:min(900px,calc(100% - 28px)); margin:auto; padding:28px 0 60px; }
.legal-stage > .brand-lockup { color:var(--ink); text-decoration:none; }
.legal-card { margin-top:28px; padding:clamp(22px,5vw,52px); border-radius:30px; }
.legal-card h1 { font-size:clamp(2rem,5vw,4rem); }
.legal-card h2 { margin-top:2rem; }
.legal-card p { color:var(--ink-soft); line-height:1.7; }
.toast-region { position:fixed; z-index:1000; right:16px; bottom:16px; display:grid; gap:8px; width:min(380px,calc(100% - 32px)); pointer-events:none; }
.toast { padding:12px 14px; border:1px solid var(--line-strong); border-radius:14px; color:var(--ink); background:var(--surface-solid); box-shadow:0 18px 42px rgb(0 0 0 / 25%); animation:message-in 180ms ease; }
.toast-success { border-color:color-mix(in srgb,var(--success) 40%,var(--line)); }
.toast-error { border-color:color-mix(in srgb,var(--danger) 45%,var(--line)); }

@media (max-width:860px) {
  .page-intro { align-items:flex-start; }
  .module-heading > img { width:46px; height:46px; }
  .page-actions { flex-wrap:wrap; justify-content:flex-end; }
  .settings-grid { grid-template-columns:1fr; }
  .danger-zone { grid-column:auto; }
  .agent-shell { min-height:calc(100dvh - 144px); }
  .agent-hero { min-height:auto; grid-template-columns:auto 1fr; padding:15px; border-radius:22px; }
  .agent-hero-actions { grid-column:1/-1; max-width:none; justify-content:flex-start; }
  .agent-hero h1 { font-size:1.55rem; }
  .agent-orb { width:58px; height:58px; border-radius:20px; }
  .agent-control { grid-template-columns:1fr auto; }
  .agent-control > label { grid-column:1/-1; padding:10px 0 0; border-left:0; border-top:1px solid var(--line); }
  .agent-workspace { grid-template-columns:1fr; min-height:calc(100dvh - 330px); }
  .agent-side { order:2; }
  .agent-conversation { min-height:calc(100dvh - 330px); }
  .agent-messages { max-height:none; min-height:calc(100dvh - 460px); }
  .agent-composer { position:sticky; bottom:74px; padding-bottom:max(13px,env(safe-area-inset-bottom)); }
  .academic-app[data-view="agent"] .top-control { display:none; }
  .academic-app[data-view="agent"] .app-content { min-height:100dvh; padding-top:max(10px,env(safe-area-inset-top)); }
}

@media (max-width:620px) {
  .page-intro { display:grid; }
  .page-actions { justify-content:flex-start; }
  .module-heading > img { width:42px; height:42px; }
  .agent-control { display:none; }
  .agent-hero { grid-template-columns:auto 1fr; }
  .agent-provider { display:none; }
  .agent-hero-actions button:last-child { display:none; }
  .agent-workspace { display:block; }
  .agent-side { display:grid; margin-top:12px; }
  .agent-conversation { min-height:calc(100dvh - 250px); border-radius:20px; }
  .agent-messages { min-height:calc(100dvh - 385px); padding:14px; }
  .agent-message { max-width:94%; }
  .agent-composer { bottom:76px; grid-template-columns:1fr; }
  .agent-composer-actions { justify-content:flex-end; }
  .agent-composer footer { display:none; }
  .toast-region { bottom:92px; }
}

/* v5.2 responsive refinement: dashboard, grades, schedule and Agent */
@media (min-width:861px) {
  .home-view .now-panel { min-height:210px; grid-template-columns:minmax(0,1fr) 150px; }
  .schedule-shell { padding:12px; border-radius:28px; }
  .schedule-row { min-height:90px; }
  .agent-hero { min-height:132px; }
  .agent-workspace { min-height:600px; }
  .agent-conversation { min-height:600px; }
}

@media (max-width:860px) {
  .app-content { padding:22px 8px 24px; }
  .view-stack { gap:14px; }
  .page-intro { min-height:auto; gap:13px; }
  .module-heading { gap:10px; }
  .module-heading > img { width:42px; height:42px; }
  .page-intro h1 { font-size:clamp(28px,8vw,34px); line-height:1; }
  .page-intro p:not(.eyebrow) { display:block; margin-top:4px; font-size:12px; line-height:1.35; }
  .page-intro .eyebrow { margin-bottom:5px; font-size:9px; }
  .page-actions { width:100%; justify-content:stretch; }
  .page-actions > * { min-height:44px; }
  .content-panel { border-radius:20px; }

  .now-panel { min-height:0; grid-template-columns:1fr; gap:17px; padding:19px; border-radius:24px; }
  .now-panel::before { display:none; }
  .now-orbit { right:-34%; top:-42%; width:250px; opacity:.42; }
  .now-content h2 { margin-top:7px; font-size:clamp(24px,7.5vw,30px); line-height:1.06; }
  .now-content p { font-size:13px; }
  .now-actions { margin-top:17px; }
  .now-actions > * { min-width:0; min-height:44px; }
  .today-meter { width:100%; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:0 12px; padding:12px 14px; border-radius:17px; }
  .today-meter strong { grid-row:1 / 3; font-size:25px; }
  .today-meter > span { margin:0; font-size:11px; }
  .today-meter .progress-bar { align-self:start; }

  .grades-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .grades-actions select { width:100%; min-width:0; }
  .grade-overview { min-height:0; grid-template-columns:1fr auto; gap:14px; padding:17px; border-radius:21px; }
  .grade-overview > img { width:58px; height:58px; }
  .grade-overview-main { grid-column:1 / -1; gap:11px; }
  .grade-overview-copy > strong { font-size:38px !important; }
  .grade-overview-stats { flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
  .grade-overview-stats::-webkit-scrollbar { display:none; }
  .grade-overview-stats span { flex:0 0 auto; }
  .grade-panel { padding:12px; }
  .grade-table { grid-template-columns:1fr; }
  .grade-row { grid-template-columns:auto minmax(0,1fr) auto auto; padding:12px; border-radius:17px; }
  .grade-entry-list { grid-column:1 / -1; }
  .grade-subject strong { font-size:14px; }
  .grade-score { min-width:42px; font-size:20px; }

  .mobile-schedule { gap:8px; }
  .mobile-schedule details { border-radius:18px; background:linear-gradient(145deg,rgb(255 255 255 / 6%),var(--surface)); box-shadow:inset 0 1px rgb(255 255 255 / 7%); }
  .mobile-schedule summary { min-height:62px; padding:10px 12px; }
  .mobile-schedule summary > span { width:38px; height:38px; }
  .mobile-schedule article { min-height:64px; }

  .academic-app[data-view="agent"] { height:100dvh; min-height:0; overflow:hidden; }
  .academic-app[data-view="agent"] .top-control,
  .academic-app[data-view="agent"] .mobile-tabbar { display:none; }
  .academic-app[data-view="agent"] .app-stage { height:100dvh; min-height:0; padding:0; }
  .academic-app[data-view="agent"] .app-content { height:100%; min-height:0; padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom)); overflow:hidden; }
  .academic-app[data-view="agent"] #agent-root { height:100%; min-height:0; }
  .agent-shell { height:100%; min-height:0; grid-template-rows:auto minmax(0,1fr); gap:8px; }
  .agent-hero { position:relative; z-index:2; min-height:58px; grid-template-columns:auto auto minmax(0,1fr) auto; gap:9px; padding:8px 10px; border-radius:18px; }
  .agent-mobile-back { display:grid; place-items:center; width:40px; height:40px; padding:0; border:1px solid var(--line); border-radius:13px; color:var(--ink); background:rgb(255 255 255 / 5%); font-size:25px; }
  .agent-orb { width:40px; height:40px; border-radius:14px; animation:none; }
  .agent-orb::before { width:30px; height:30px; }
  .agent-orb::after, .agent-orb > span { display:none; }
  .agent-orb > img { width:31px; height:31px; }
  .agent-identity { min-width:0; }
  .agent-identity .eyebrow, .agent-identity > p:not(.eyebrow) { display:none; }
  .agent-hero h1 { overflow:hidden; font-size:16px; line-height:1.1; text-overflow:ellipsis; white-space:nowrap; }
  .agent-hero-actions { grid-column:auto; flex-wrap:nowrap; justify-content:flex-end; }
  .agent-provider, .agent-hero-actions button:last-child { display:none; }
  .agent-new-thread { min-width:42px; width:42px; padding:0; font-size:0; }
  .agent-new-thread::after { content:"＋"; font-size:20px; }
  .agent-control, .agent-side { display:none; }
  .agent-workspace { height:100%; min-height:0; display:block; }
  .agent-conversation { height:100%; min-height:0; display:grid; grid-template-rows:minmax(0,1fr) auto auto; border-radius:19px; }
  .agent-messages { min-height:0; max-height:none; gap:13px; padding:14px 11px; overscroll-behavior:contain; }
  .agent-welcome { min-height:100%; padding:18px 5px; }
  .agent-welcome > span { width:56px; height:56px; margin-bottom:13px; border-radius:19px; }
  .agent-welcome h2 { max-width:290px; font-size:21px; line-height:1.08; }
  .agent-welcome > p { margin-bottom:16px; font-size:13px; }
  .agent-welcome > div { display:grid; width:100%; gap:7px; }
  .agent-welcome button { min-height:42px; padding:9px 12px; text-align:left; font-size:12px; }
  .agent-message { max-width:92%; gap:7px; }
  .agent-message.is-user { max-width:88%; }
  .agent-message > div { min-width:0; padding:11px 12px; border-radius:16px 16px 16px 5px; }
  .agent-message.is-user > div { border-radius:16px 16px 5px 16px; }
  .agent-message p, .agent-message li { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
  .agent-avatar { width:27px; height:27px; border-radius:9px; }
  .agent-mobile-pending { display:block; max-height:38dvh; overflow:auto; padding:10px; border-top:1px solid var(--line); background:color-mix(in srgb,var(--surface-solid) 93%,transparent); }
  .agent-mobile-pending > header { display:flex; align-items:center; gap:9px; margin-bottom:7px; }
  .agent-mobile-pending > header img { width:25px; height:25px; object-fit:contain; }
  .agent-mobile-pending > header div { display:grid; }
  .agent-mobile-pending > header strong { font-size:12px; }
  .agent-mobile-pending > header small { color:var(--ink-faint); font-size:10px; }
  .agent-mobile-pending .agent-action-card { margin:0; }
  .agent-composer { position:relative; bottom:auto; grid-template-columns:minmax(0,1fr) auto; gap:7px; padding:8px; padding-bottom:max(8px,env(safe-area-inset-bottom)); background:color-mix(in srgb,var(--surface-solid) 90%,transparent); }
  .agent-composer textarea { min-height:46px; max-height:96px; padding:11px 12px; border-radius:14px; font-size:16px; }
  .agent-composer-actions { gap:5px; }
  .agent-composer-actions .btn-glass,
  .agent-composer-actions .btn-primary { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; border-radius:13px; }
  .agent-composer footer { display:none; }
}

@media (max-width:430px) {
  .app-content { padding-inline:5px; }
  .page-intro { display:grid; }
  .page-actions { justify-content:stretch; }
  .page-actions > .btn-primary { padding-inline:14px; }
  .now-actions { display:grid; grid-template-columns:1fr 1fr; }
  .grade-row { grid-template-columns:auto minmax(0,1fr) auto; }
  .grade-add { grid-column:3; grid-row:2; justify-self:end; }
  .grade-score { grid-column:3; grid-row:1; }
  .grade-entry-list { grid-column:1 / -1; }
  .mobile-schedule article { grid-template-columns:43px 38px minmax(0,1fr) 30px; gap:8px; }
  .agent-composer-actions .btn-glass:first-child { display:none; }
}
