/* Khutwa learning UI. Load after style.css; no asset or font dependencies. */
:root {
  --ink: #182332; --muted: #586779; --green: #0868d6;
  --bg: #f4f6f9; --line: #dde4ed;
  --learning-blue: #0868d6; --learning-teal: #087f71;
  --learning-surface: #fff; --learning-radius: 22px;
  --learning-shadow: 0 3px 18px rgb(22 43 73 / 4%);
}
html { scroll-padding-top: 150px; }
body { background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.8; letter-spacing: normal; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 13px; color: #254665; background: #eaf0f7; box-shadow: none; font-weight: 600; line-height: 1.6; touch-action: manipulation; transition: background-color .16s ease, border-color .16s ease, transform .16s ease; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #2684eb; outline-offset: 3px; }
.primary { background: var(--learning-blue); color: #fff; box-shadow: none; }
.danger { background: #fff0f0; color: #b32332; }
.error { color: #b32332; }
/* The desktop rail remains scrollable even with every teacher tool enabled. */
body > aside { width: 250px; position: fixed; inset-block: 0; inset-inline-start: 0; right: 0; left: auto; height: 100vh; height: 100dvh; padding: 28px 18px 20px; overflow-y: auto; overscroll-behavior: contain; background: #fbfcfe; border: 0; border-inline-end: 1px solid var(--line); box-shadow: none; z-index: 20; scrollbar-width: thin; }
.brand { font-size: 29px; letter-spacing: 0; color: var(--ink); }
.brand > span { width: 44px; height: 44px; border-radius: 14px; background: var(--learning-blue); box-shadow: none; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: 1.4px; }
.school { margin: 26px 4px 20px; }
.school strong { font-size: 15px; }
.school p { font-size: 12px; }
body > aside nav { display: grid; gap: 5px; }
nav button { display: flex; align-items: center; gap: 5px; text-align: start; min-height: 47px; padding: 10px 12px; background: transparent; color: #48576b; font-size: 14px; border-radius: 12px; }
nav button.active { background: #e5efff; color: #075bbd; box-shadow: none; font-weight: 700; }
.asidebottom { padding-top: 28px; font-size: 13px; color: var(--muted); }
.asidebottom span { margin-top: 10px; }
body > main { margin: 0 250px 0 0; padding: 0 clamp(22px, 3.4vw, 54px); max-width: 1700px; min-width: 0; }
main > header { height: 74px; border-bottom: 1px solid var(--line); color: var(--muted); gap: 12px; font-size: 13px; }
.notice { background: #eaf2fc; color: #385779; border: 0; border-radius: 13px; box-shadow: none; margin: 20px 0 26px; padding: 12px 17px; font-size: 13px; }
#content { min-width: 0; padding-bottom: 14px; }
h1, h2, h3 { color: var(--ink); letter-spacing: normal; overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.5; margin: 8px 0 14px; }
h2 { font-size: 22px; line-height: 1.55; }
h3 { font-size: 18px; line-height: 1.6; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.eyebrow { color: #536982; letter-spacing: .5px; font-size: 12px; }
.tag, .pill { background: #edf2f8; color: #435970; padding: 4px 12px; font-size: 12px; line-height: 1.8; }
.card, .assignment-card, .submission-card, .learning-card { background: #fff; border: 1px solid #e1e7ef; border-radius: var(--learning-radius); padding: clamp(20px, 2.3vw, 30px); box-shadow: var(--learning-shadow); min-width: 0; }
.grid > .card:nth-child(n) { border: 1px solid #e1e7ef; }
.grid, .learning-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; }
.columns > *, .row > *, .sectionhead > * { min-width: 0; }
.sectionhead { margin: 30px 0 16px; flex-wrap: wrap; gap: 12px; }
.hero { background: #e8f1ff; color: var(--ink); border: 1px solid #d4e4fb; border-radius: 26px; box-shadow: none; min-height: 0; padding: clamp(25px, 3vw, 38px); margin: 24px 0; }
.hero h1 { font-size: clamp(27px, 3vw, 36px); color: #123d72; }
.hero p, .hero .eyebrow { color: #425e80; }
.hero button { background: var(--learning-blue); color: #fff; border-radius: 13px; box-shadow: none; min-height: 48px; padding: 11px 23px; }
.sound i { background: #4693e8; }
.sound:after { color: #42648a; }
.stats { gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat strong { font-size: 32px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.stat span { color: var(--muted); font-size: 13px; }
.tasknum { color: #536982; font-size: 13px; }
.tasktitle { font-size: 22px; color: #173c68; }
.taskdesc { font-size: 14px; color: var(--muted); }
.taskfoot { gap: 12px; flex-wrap: wrap; }
.taskfoot button { min-height: 44px; font-size: 14px; background: #edf4ff; color: #075bbd; }
.welcome { padding: 28px 0; }
.welcome h1 { background: none; color: #143e70; -webkit-text-fill-color: currentColor; font-size: clamp(32px, 4vw, 46px); letter-spacing: 0; }
.welcomeicons { flex-wrap: wrap; gap: 10px; }
.welcomeicons span { background: #e8eff9; color: #405977; box-shadow: none; padding: 6px 12px; font-size: 12px; }
.authcard { max-width: 540px; border: 1px solid #e1e7ef; box-shadow: var(--learning-shadow); }
label, .learning-label { color: #33465c; font-size: 14px; font-weight: 600; margin: 18px 0 7px; }
input, select, textarea { min-height: 48px; border: 1px solid #bfcbd9; border-radius: 12px; padding: 11px 14px; background: #fff; color: var(--ink); font-size: 16px; max-width: 100%; }
textarea { min-height: 150px; line-height: 1.9; resize: vertical; }
input::placeholder, textarea::placeholder { color: #6c798a; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--learning-blue); outline: 3px solid #d5e7ff; }
input[type=checkbox], input[type=radio] { min-height: 20px; width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--learning-blue); }
input[type=file] { padding: 9px; }
input::file-selector-button { border: 0; border-radius: 8px; padding: 8px 12px; margin-inline-end: 12px; background: #eaf2ff; color: #075bbd; font: inherit; cursor: pointer; }
.check { font-size: 14px; gap: 10px; }
.actions { gap: 10px; margin-top: 22px; }
.hint, .learning-hint { padding: 16px 18px; border-radius: 14px; background: #edf5ff; color: #34577e; font-size: 14px; }
.stage { background: #f0f5fc; border: 1px solid #dce6f3; padding: 24px; }
.english, textarea[lang=en], .learning-editor { direction: ltr; text-align: left; color: #213b57; }
.inbox-summary { background: #fff; border: 1px solid var(--line); box-shadow: none; }
.segmented { background: #e6ecf4; border-radius: 14px; padding: 5px; gap: 4px; }
.segmented button { min-height: 44px; }
.segmented button[aria-pressed=true] { background: #fff; color: #075bbd; box-shadow: 0 1px 4px #172d4914; }
.badge, #unread { background: #c9273a; color: #fff; min-width: 22px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chatlog { background: #f0f4fa; max-height: min(560px, 60vh); padding: 20px; }
.bubble { border: 1px solid #dee6ef; background: #fff; padding: 14px 18px; }
.bubble.mine { background: #dfeeff; border: 1px solid #ccdef5; }
.messagefoot, .bubble small { color: #4a6079; font-size: 12px; }
.replybutton { min-height: 44px; font-size: 13px; }
.composer textarea { min-height: 112px; }
.avatar { background: #e9f1fc; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.futurecard.writing, .futurecard.files { background: #fff; }
.featureicon { width: 56px; height: 56px; border-radius: 17px; font-size: 26px; margin: 18px 0; }
.files .featureicon { background: var(--learning-teal); }
.futurecard h2 { font-size: 24px; }
.futuregrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Separate module surfaces share controls, not competing decoration. */
.learning-shell { --learning-accent: var(--learning-blue); width: 100%; min-width: 0; }
.learning-shell[data-module=writing], .learning-writing { --learning-accent: #6750bc; }
.learning-shell[data-module=files], .learning-files { --learning-accent: #087f71; }
.learning-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 24px 0; }
.learning-header p { max-width: 65ch; color: var(--muted); }
.learning-toolbar, .learning-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.learning-toolbar > input { flex: 1 1 240px; width: auto; }
.learning-toolbar > select { flex: 0 1 230px; width: auto; }
.learning-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 5px 0 12px; }
.learning-tabs button { flex-shrink: 0; }
.learning-tabs [aria-selected=true] { background: var(--learning-accent, #0868d6); color: #fff; }
.learning-card, .assignment-card, .submission-card { display: flex; flex-direction: column; gap: 12px; }
:is(.learning-card, .assignment-card, .submission-card) h3 { margin: 0; }
:is(.learning-card, .assignment-card, .submission-card) .actions { margin-top: auto; padding-top: 12px; }
.learning-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.learning-status { display: inline-flex; align-items: center; align-self: flex-start; padding: 5px 12px; border-radius: 9px; background: #edf2f8; color: #435970; font-size: 13px; font-weight: 600; }
.learning-status[data-status=approved], .learning-status[data-status=completed] { background: #e5f5ed; color: #16613f; }
.learning-status[data-status=pending] { background: #fff3dd; color: #805713; }
.learning-status[data-status=error] { background: #fff0f0; color: #b32332; }
.wizard { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 3vw, 36px); max-width: 920px; margin: 24px auto; }
.stepper { display: flex; align-items: stretch; gap: 10px; list-style: none; padding: 0 0 18px; margin: 0 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.stepper > * { flex: 1 0 115px; padding: 10px 12px; border-radius: 12px; background: #f1f4f8; color: #536378; font-size: 14px; text-align: center; }
.stepper [aria-current=step], .stepper > .active { background: #e6efff; color: #075bbd; box-shadow: inset 0 -3px #0868d6; font-weight: 700; }
.stepper > .completed { background: #e9f6ef; color: #16613f; }
.learning-editor, .wizard textarea { min-height: 240px; font-size: 18px; padding: 18px; }
.learning-counter { text-align: end; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.learning-feedback { padding: 20px; border: 1px solid #cfe7db; border-inline-start: 4px solid #209468; border-radius: 14px; background: #f1faf5; margin: 20px 0; }
.learning-feedback p { overflow-wrap: anywhere; }
.learning-upload { border: 2px dashed #b7cce4; border-radius: 18px; padding: 26px; background: #f6f9fe; text-align: center; }
.learning-upload:focus-within { border-color: var(--learning-blue); background: #edf5ff; }
.learning-file { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin-block: 10px; overflow-wrap: anywhere; }
.learning-file > :first-child { flex: 1; min-width: 0; }
.learning-empty { text-align: center; padding: 40px 24px; color: var(--muted); }
.learning-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { font-size: 14px; }
th, td { text-align: start; padding: 14px 16px; }
th { background: #eef3f9; color: #40546d; }
progress { accent-color: var(--learning-accent, #0868d6); height: 10px; }
summary { min-height: 44px; padding-block: 9px; }
.confirmdialog { max-height: 85dvh; overflow: auto; border-radius: 22px; }
#toast { z-index: 100; background: #1d3047; color: #fff; bottom: max(20px, env(safe-area-inset-bottom)); max-width: min(480px, calc(100% - 32px)); line-height: 1.7; }
footer { color: #586779; padding: 32px 0; font-size: 12px; }
@media (hover: hover) {
  button:hover:not(:disabled) { filter: none; background: #dde8f7; }
  .primary:hover:not(:disabled), .hero button:hover:not(:disabled) { background: #0058bb; color: #fff; }
  .danger:hover:not(:disabled) { background: #ffe0e3; }
  nav button:hover:not(:disabled) { background: #e9eff7; }
}
@media (max-width: 1180px) {
  .grid, .learning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .columns { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body > main { padding-inline: 24px; }
}
/* Mobile: compact sticky rail becomes a horizontally scrollable tab strip.
   Native scrolling keeps every teacher destination reachable without JS. */
@media (max-width: 760px) {
  body > aside { position: sticky; inset-block-start: 0; width: 100%; height: auto; overflow: visible; padding: 10px 16px 8px; padding-top: max(10px, env(safe-area-inset-top)); background: rgb(251 252 254 / 96%); border-inline-end: 0; border-bottom: 1px solid #dce3ec; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .brand { font-size: 24px; }
  .brand > span { width: 35px; height: 35px; font-size: 23px; border-radius: 11px; }
  .brand small, .school, .asidebottom { display: none; }
  body > aside nav { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; margin-top: 9px; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: #b7c9df transparent; }
  nav button { white-space: nowrap; flex: 0 0 auto; font-size: 13px; min-height: 44px; padding: 9px 12px; scroll-snap-align: start; }
  body > main { margin: 0; padding: 0 18px; }
  main > header { height: 55px; font-size: 12px; }
  .notice { font-size: 12px; margin: 16px 0 22px; }
  .hero { grid-template-columns: 1fr; padding: 26px; }
  .sound { display: none; }
  .grid, .learning-grid, .futuregrid { grid-template-columns: 1fr; }
  .card, .assignment-card, .submission-card, .learning-card { padding: 21px; border-radius: 20px; }
  .stats { gap: 12px; }
  .stat strong { font-size: 29px; }
  .stat span { font-size: 12px; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 180px; }
  .actions > button { flex: 1 1 130px; }
  .rubric { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviewtop { flex-wrap: wrap; }
  .bubble { max-width: 94%; }
  .messagefoot { flex-wrap: wrap; }
  .segmented { width: 100%; }
  .segmented button { flex: 1 1 auto; }
  .wizard { margin-block: 18px; padding: 20px; }
  .stepper { gap: 8px; }
  .stepper > * { flex-basis: 108px; font-size: 13px; }
  .learning-header { gap: 12px; }
  .learning-toolbar > select { flex: 1 1 180px; }
  .learning-editor, .wizard textarea { min-height: 220px; font-size: 17px; }
  .learning-upload { padding: 20px 15px; }
  #toast { inset-inline: 16px; width: auto; margin-inline: auto; }
}
@media (max-width: 380px) {
  body > main { padding-inline: 12px; }
  .card, .wizard { padding: 17px; }
  main > header .tag { font-size: 11px; padding-inline: 8px; }
  .rubric { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .card, .learning-card, .assignment-card, .submission-card, .wizard, button { border: 1px solid CanvasText; }
  nav button.active, .stepper [aria-current=step] { outline: 2px solid Highlight; }
}
