:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #132238;
  --muted: #66758a;
  --border: #dce4ef;
  --primary: #2847b8;
  --primary-dark: #1d348f;
  --primary-soft: #e9efff;
  --success: #157f5b;
  --success-soft: #e9f8f2;
  --warning: #a86508;
  --warning-soft: #fff7e6;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow-sm: 0 2px 8px rgba(20, 34, 56, .06);
  --shadow-md: 0 14px 36px rgba(20, 34, 56, .10);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(69, 98, 220, .08), transparent 28%),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 36%, #eef3f9 100%);
  color: var(--text);
}

a { color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  color: #fff;
  background: linear-gradient(110deg, #16255e 0%, #2847b8 55%, #365bd5 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 8px 26px rgba(22, 37, 94, .22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .26);
  font-weight: 850;
  letter-spacing: -.03em;
}
.brand-copy strong { display: block; font-size: 15px; }
.brand-copy span { display: block; margin-top: 2px; color: #dbe5ff; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 160px;
}

h1, h2, h3 { letter-spacing: -.025em; }
h1 { margin: 10px 0 20px; font-size: clamp(34px, 4.5vw, 56px); line-height: 1.03; }
h2 { margin: 0 0 16px; font-size: 22px; }
h3 { margin: 0 0 12px; font-size: 17px; }
p { line-height: 1.65; }

.hero {
  display: grid;
  grid-template-columns: 1.25fr .8fr;
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 170px);
}
.hero h1 { max-width: 760px; }
.hero p { max-width: 660px; color: var(--muted); font-size: 18px; }

.panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel:hover { box-shadow: var(--shadow-md); transition: box-shadow .2s ease, transform .2s ease; }
.narrow { width: min(620px, 100%); margin: 24px auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.eyebrow, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.app-header .chip { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.18); }

label { display: block; margin: 16px 0; color: #22324a; font-weight: 700; font-size: 14px; }
input, select, textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd9e7;
  border-radius: 11px;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(40, 71, 184, .11);
}
textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: auto; margin-top: 3px; }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 11px 16px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #3c62dc 100%);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(40, 71, 184, .20);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.button:hover, button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(40, 71, 184, .25); }
.full { width: 100%; }
.google {
  color: #202124;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.secondary {
  min-height: 38px;
  color: #fff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: none;
}
.danger { background: linear-gradient(135deg, #b42318, #d83f33); }
button:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.notice, .consent-lock {
  padding: 15px 16px;
  border-radius: 12px;
  background: var(--warning-soft);
  border: 1px solid #efd59f;
  color: #64420b;
}
.item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
  background: var(--surface-soft);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.inline { display: inline; }
.muted { color: var(--muted); }
.flash {
  padding: 13px 15px;
  border-radius: 12px;
  margin-bottom: 16px;
  color: #1d3f87;
  background: #eaf1ff;
  border: 1px solid #cbd9ff;
}
.flash.error, .error { color: var(--danger); background: var(--danger-soft); border-color: #f4c7c3; }
.empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #cbd6e5;
  border-radius: 12px;
  background: #fbfcfe;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e6ebf2; vertical-align: top; }
th { color: #46556b; background: #f7f9fc; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric {
  background: linear-gradient(180deg, #fff 0%, #f8faff 100%);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 7px; font-size: 30px; color: var(--primary-dark); }

.chat-history { min-height: 330px; }
.exchange { display: grid; gap: 12px; margin: 24px 0; }
.message { max-width: 82%; padding: 15px 17px; border-radius: 16px; box-shadow: var(--shadow-sm); }
.user-message { justify-self: end; color: #fff; background: linear-gradient(135deg, #2847b8, #456de1); border-bottom-right-radius: 5px; }
.assistant-message { justify-self: start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.label { margin-bottom: 7px; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; opacity: .78; }
.prewrap { white-space: pre-wrap; line-height: 1.65; }
.composer {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  border-color: #cbd8f1;
  box-shadow: 0 18px 42px rgba(20, 34, 56, .16);
}
.alert { float: right; padding: 4px 8px; background: var(--danger-soft); color: var(--danger); border-radius: 999px; font-size: 11px; font-weight: 750; }

.login-card { padding: 30px; }
.login-card h2 { margin-bottom: 8px; }
.login-feature-list { display: grid; gap: 12px; margin-top: 26px; }
.login-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #34435a;
}
.feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 850;
}

@media (max-width: 840px) {
  .hero, .grid2 { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 32px; }
  .app-header { align-items: flex-start; }
  .header-actions { flex-direction: column; align-items: flex-end; }
  .message { max-width: 94%; }
  main { width: min(100% - 22px, 1180px); padding-top: 28px; }
}

.activity-heading{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.5rem}.risk-badge{display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .55rem;font-size:.72rem;font-weight:800;letter-spacing:.04em}.risk-low{background:#e9f8ef;color:#18794e}.risk-medium{background:#fff5d6;color:#8a5a00}.risk-high{background:#fdecec;color:#b42318}


/* Parent-defined focus planning and alignment */
.focus-summary {display:flex;justify-content:space-between;align-items:center;gap:20px;padding:18px;border:1px solid var(--border);border-radius:16px;margin:18px 0;background:#f8faff;}
.focus-summary h3{margin:.35rem 0;}
.focus-good{border-left:6px solid #22a06b;background:#f0fbf6;}
.focus-watch{border-left:6px solid #d99a17;background:#fff9eb;}
.focus-alert{border-left:6px solid #cf4b45;background:#fff4f3;}
.focus-score{font-size:2.25rem;font-weight:800;letter-spacing:-.04em;color:var(--accent);white-space:nowrap;}
.panel-inset{border:1px solid var(--border);border-radius:14px;padding:18px;margin:18px 0;background:#fbfcff;}
.focus-plan summary{cursor:pointer;font-weight:800;color:var(--text);}
.focus-form{margin-top:16px;}
.weight-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:14px 0 18px;}
.weight-grid label{margin:0;font-size:.88rem;}
.weight-input{display:flex;align-items:center;gap:7px;}
.weight-input input{margin-top:6px;}
.weight-input span{font-weight:800;color:var(--muted);}
.alignment-badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#edf2ff;font-size:.76rem;font-weight:750;}
.positive-deviation{color:#b54708;font-weight:750;}
.negative-deviation{color:#175cd3;font-weight:750;}
.small-note{font-size:.84rem;margin-top:12px;}
.focus-board-summary{display:flex;align-items:center;gap:24px;padding:18px;border-radius:16px;background:#f3f6ff;}
@media(max-width:700px){.focus-summary,.focus-board-summary{align-items:flex-start;flex-direction:column}.weight-grid{grid-template-columns:1fr 1fr}}


.focus-dual-grid { align-items: stretch; }
.focus-dual-grid .focus-summary { height: 100%; }
.school-focus-panel { border-left: 4px solid #2563eb; }
.school-priority-editor { border-top: 4px solid #0f766e; }
.school-priority-editor .section-heading { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; }
.school-priority-table { margin-top:22px; }
@media (max-width: 800px) { .school-priority-editor .section-heading { flex-direction:column; } }

/* Student workspace v1.2 */
.student-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.student-page-head h1 { margin: 8px 0 6px; font-size: clamp(30px, 4vw, 44px); }
.student-session { margin: 0; }
.workspace-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #fff;
}
.workspace-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #a86508; }
.workspace-status.is-ready { color: var(--success); background: var(--success-soft); border-color: #bfe7d8; }
.workspace-status.is-ready::before { background: var(--success); box-shadow: 0 0 0 4px rgba(21,127,91,.10); }
.student-lock { margin-bottom: 20px; }
.student-workspace {
  width: min(1500px, calc(100vw - 28px));
  margin-left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 250px 310px minmax(0, 1fr);
  min-height: 690px;
  height: calc(100vh - 215px);
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(20,34,56,.13);
}
.category-rail, .topic-rail {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 16px;
  background: #f8faff;
  border-right: 1px solid var(--border);
}
.topic-rail { background: #fff; }
.rail-heading, .topic-rail-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.rail-heading h2, .topic-rail-head h2 { margin: 4px 0 0; font-size: 20px; }
.rail-kicker, .chat-breadcrumb {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.category-list { display: grid; gap: 7px; }
.category-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 13px;
  color: #33445e;
  text-decoration: none;
  border: 1px solid transparent;
  transition: .15s ease;
}
.category-link:hover { background:#fff; border-color:var(--border); transform:translateX(2px); }
.category-link.active { color: var(--primary-dark); background:#fff; border-color:#cbd8f4; box-shadow:var(--shadow-sm); }
.category-avatar {
  display:grid;
  place-items:center;
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:11px;
  color:#fff;
  background: linear-gradient(135deg, #1d348f, #5479ed);
  font-size:13px;
  font-weight:900;
}
.category-copy { min-width:0; display:block; }
.category-copy strong, .category-copy small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.category-copy strong { font-size:13px; }
.category-copy small { margin-top:2px; color:var(--muted); font-size:11px; }
.create-category-card { margin-top: 16px; border-top:1px solid var(--border); padding-top:14px; }
.create-category-card summary { cursor:pointer; color:var(--primary); font-weight:800; font-size:13px; }
.create-category-card form { margin-top:10px; }
.create-category-card input { margin:0 0 8px; }
.new-topic-form { padding-bottom:15px; border-bottom:1px solid var(--border); margin-bottom:14px; }
.new-topic-form input { margin:0 0 8px; }
.topic-list { display:grid; gap:8px; }
.topic-card {
  display:grid;
  grid-template-columns: 30px minmax(0,1fr) 16px;
  align-items:center;
  gap:9px;
  padding:12px 10px;
  border:1px solid transparent;
  border-radius:14px;
  color:var(--text);
  text-decoration:none;
  transition:.15s ease;
}
.topic-card:hover { background:#f8faff; border-color:var(--border); }
.topic-card.active { background:var(--primary-soft); border-color:#cbd8f4; }
.topic-icon { display:grid; place-items:center; width:28px; height:28px; border-radius:9px; background:#eef3ff; color:var(--primary); font-size:12px; }
.topic-card.active .topic-icon { color:#fff; background:var(--primary); }
.topic-copy { min-width:0; }
.topic-copy strong, .topic-copy small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topic-copy strong { font-size:13px; }
.topic-copy small { margin-top:4px; color:var(--muted); font-size:10px; }
.topic-arrow { color:#8a98aa; font-size:21px; }
.topic-empty { margin-top:28px; padding:20px 10px; text-align:center; color:var(--muted); }
.topic-empty strong { display:block; color:var(--text); margin:8px 0 3px; }
.topic-empty p { margin:0; font-size:12px; line-height:1.5; }
.topic-empty-icon { margin:auto; display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:var(--primary-soft); color:var(--primary); font-size:24px; }
.chat-stage { min-width:0; display:flex; flex-direction:column; background:#f7f9fd; }
.chat-stage-head {
  min-height:74px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 22px;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--border);
}
.chat-stage-head h2 { margin:3px 0 0; font-size:20px; }
.chat-provider-pill { padding:7px 10px; border-radius:999px; color:var(--muted); background:#f6f8fb; border:1px solid var(--border); font-size:10px; font-weight:750; }
.chat-scroll { flex:1; overflow-y:auto; padding:28px clamp(18px,4vw,54px); scroll-behavior:smooth; }
.modern-exchange { max-width:920px; margin:0 auto 25px; }
.modern-exchange .message { max-width:78%; }
.message-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:11px; }
.message-meta span { padding:4px 7px; border-radius:999px; color:var(--muted); background:#f3f5f8; font-size:9px; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
.message-meta .homework-chip { color:var(--danger); background:var(--danger-soft); }
.chat-welcome { max-width:520px; margin:12vh auto 0; text-align:center; color:var(--muted); }
.chat-welcome h3 { margin:16px 0 8px; color:var(--text); font-size:25px; }
.welcome-orb { display:grid; place-items:center; width:64px; height:64px; margin:auto; border-radius:21px; color:#fff; background:linear-gradient(135deg,#1d348f,#5479ed); box-shadow:0 18px 32px rgba(40,71,184,.22); font-weight:900; }
.chat-composer-wrap { padding:14px 20px 16px; background:rgba(255,255,255,.96); border-top:1px solid var(--border); }
.chat-composer { max-width:980px; margin:auto; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; padding:8px; border:1px solid #cdd8e8; border-radius:17px; background:#fff; box-shadow:0 10px 30px rgba(20,34,56,.08); }
.chat-composer textarea { min-height:54px; max-height:150px; margin:0; padding:10px 12px; border:0; box-shadow:none; background:transparent; resize:none; }
.chat-composer textarea:focus { box-shadow:none; }
.chat-composer button { min-width:84px; border-radius:12px; }
.composer-note { max-width:980px; margin:7px auto 0; color:#8995a7; text-align:center; font-size:9px; }
.chat-stage-empty { margin:auto; max-width:620px; padding:36px; text-align:center; }
.chat-stage-empty h2 { margin:9px 0; font-size:30px; }
.chat-stage-empty p { color:var(--muted); }
.empty-visual { margin:0 auto 20px; display:grid; place-items:center; width:76px; height:76px; border-radius:25px; background:linear-gradient(145deg,#e8eeff,#fff); box-shadow:inset 0 0 0 1px #d8e1f4, 0 18px 38px rgba(20,34,56,.09); }
.empty-visual span { color:var(--primary); font-size:30px; }
.empty-new-topic { max-width:440px; margin:24px auto 0; display:flex; gap:8px; }
.empty-new-topic input { margin:0; }
.empty-new-topic button { flex:0 0 auto; }
.student-notifications { margin-top:18px; padding:14px 16px; border:1px solid var(--border); border-radius:14px; background:#fff; }
.student-notifications summary { cursor:pointer; font-weight:800; }
.student-notifications summary span { margin-left:6px; padding:3px 7px; border-radius:999px; background:var(--primary-soft); color:var(--primary); font-size:10px; }
.notification-grid { margin-top:12px; display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:10px; }
@media (max-width: 1050px) {
  .student-workspace { grid-template-columns:210px 270px minmax(0,1fr); }
}
@media (max-width: 820px) {
  .student-workspace { width:100%; margin-left:0; transform:none; height:auto; min-height:0; grid-template-columns:1fr; overflow:visible; }
  .category-rail, .topic-rail { border-right:0; border-bottom:1px solid var(--border); max-height:none; }
  .category-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .chat-stage { min-height:650px; }
  .student-page-head { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 560px) {
  .category-list { grid-template-columns:1fr; }
  .empty-new-topic { flex-direction:column; }
  .modern-exchange .message { max-width:92%; }
  .chat-stage-head { align-items:flex-start; flex-direction:column; }
  .chat-provider-pill { display:none; }
}


/* v1.3 topic continuation and management */
.topic-card { position: relative; display: flex; align-items: stretch; padding: 0 !important; }
.topic-main-link { display:flex; align-items:center; gap:12px; flex:1; min-width:0; padding:14px 10px; color:inherit; text-decoration:none; }
.topic-row-menu { position:relative; display:flex; align-items:center; }
.topic-row-menu > summary, .topic-actions-menu > summary {
  list-style:none; cursor:pointer; border-radius:10px; padding:8px 10px; font-weight:800; color:#64748b;
}
.topic-row-menu > summary::-webkit-details-marker, .topic-actions-menu > summary::-webkit-details-marker { display:none; }
.topic-row-menu > summary:hover, .topic-actions-menu > summary:hover { background:#eef2ff; color:#2949cc; }
.topic-row-popover, .topic-actions-popover {
  position:absolute; z-index:40; background:white; border:1px solid #dbe3f0; border-radius:14px;
  box-shadow:0 18px 45px rgba(15,23,42,.16); padding:12px; min-width:210px;
}
.topic-row-popover { right:0; top:42px; }
.topic-actions-popover { right:0; top:42px; min-width:250px; }
.topic-row-popover form, .topic-actions-popover form { margin:0 0 9px; }
.topic-row-popover select, .topic-actions-popover select { width:100%; margin:6px 0 8px; }
.topic-row-popover button, .topic-actions-popover button { width:100%; }
.topic-head-actions { display:flex; align-items:center; gap:8px; }
.topic-actions-menu { position:relative; }
.danger-button, .danger-text { border-color:#fecaca !important; color:#b91c1c !important; background:#fff5f5 !important; }
.chat-composer button { white-space:nowrap; min-width:145px; }


/* v1.4 — keep composer visible; scroll only the chat history */
.student-workspace {
  height: calc(100vh - 190px);
  min-height: 620px;
  overflow: hidden;
}

.category-rail,
.topic-rail,
.chat-stage {
  height: 100%;
  min-height: 0;
}

.category-rail,
.topic-rail {
  overflow-y: auto;
}

.chat-stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.chat-stage-head {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 28px;
  scroll-behavior: smooth;
}

.chat-composer-wrap {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid #dbe3f0;
  padding: 14px 18px 12px;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.06);
}

.chat-composer {
  margin: 0;
}

.chat-composer textarea {
  max-height: 130px;
  overflow-y: auto;
  resize: vertical;
}

.student-notifications {
  margin-top: 14px;
}

/* Smaller screens: retain a usable fixed composer */
@media (max-width: 900px) {
  .student-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .category-rail,
  .topic-rail {
    height: auto;
    max-height: 300px;
  }

  .chat-stage {
    height: 72vh;
    min-height: 540px;
  }

  .chat-composer-wrap {
    position: sticky;
    bottom: 0;
  }
}

.app-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.app-logo {
    height: 55px !important;
    width: auto !important;
    max-width: 260px !important;
    object-fit: contain;
    display: block;
}

@media (max-width: 700px) {
    .app-logo {
        height: 45px !important;
        max-width: 210px !important;
    }
}


/* v1.5 — search and token budget */
.student-tools-bar{display:flex;gap:16px;align-items:stretch;margin:14px 0 18px}.prompt-search{flex:1;display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #dbe3f0;border-radius:16px;padding:8px 10px;box-shadow:0 8px 24px rgba(15,23,42,.05)}.prompt-search input{flex:1;border:0!important;box-shadow:none!important;background:transparent!important;min-width:120px}.prompt-search button{padding:9px 16px}.search-icon{font-size:22px;color:#64748b}.search-clear{font-size:13px;color:#64748b}.token-meter-card{min-width:310px;background:linear-gradient(135deg,#172554,#312e81);color:#fff;border-radius:16px;padding:12px 16px;box-shadow:0 10px 28px rgba(30,41,59,.18)}.token-meter-copy{display:flex;align-items:baseline;gap:5px;flex-wrap:wrap}.token-meter-copy strong{font-size:20px}.token-meter-copy small{width:100%;color:#c7d2fe;margin-top:2px}.token-track{height:6px;background:rgba(255,255,255,.18);border-radius:999px;overflow:hidden;margin-top:9px}.token-track span{display:block;height:100%;background:#a5b4fc;border-radius:999px}.search-results-panel{background:#fff;border:1px solid #dbe3f0;border-radius:18px;margin-bottom:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);overflow:hidden}.search-results-head{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border-bottom:1px solid #eef2f7}.search-results-head h2{margin:2px 0 0;font-size:18px}.search-results-list{max-height:270px;overflow-y:auto}.search-result{display:block;padding:13px 18px;border-bottom:1px solid #eef2f7;text-decoration:none;color:inherit}.search-result:hover{background:#f8faff}.search-result-meta{font-size:12px;color:#64748b;margin-bottom:4px}.search-result-prompt{font-weight:650;color:#172033}.message-meta span:last-child{white-space:nowrap}@media(max-width:900px){.student-tools-bar{flex-direction:column}.token-meter-card{min-width:0}}
