/* Learning Portal | Shikshanganga Foundation
   Colours and fonts from the official letterhead. */
:root {
  --navy: #0B2A49;
  --navy-2: #133A61;
  --teal: #1F7A73;
  --teal-soft: #DCEAE9;
  --gold: #EFB523;
  --gold-soft: #FDF3DA;
  --bg: #F3F7F7;
  --card: #FFFFFF;
  --ink: #1E2B3A;
  --muted: #4A6075;
  --line: #E3E9EF;
  --red: #B3402A;
  --red-soft: #FBE9E5;
  --green: #217A4B;
  --green-soft: #E3F3EA;
  --radius: 12px;
  --head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --deva: 'Eczar', 'Noto Serif Devanagari', serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --body: 'Nunito', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); color: var(--navy); line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
a { color: var(--teal); }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Boot + sign in */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(90deg, var(--teal) 70%, var(--gold) 70%); }
.auth-side h1 { color: #fff; font-size: 2.3rem; margin-top: 28px; }
.auth-side .tag { color: var(--gold); font-weight: 700; }
.auth-side p { color: #d4e0ea; max-width: 34em; }
.auth-logo { display: flex; align-items: center; gap: 14px; }
.auth-logo img { width: 74px; height: 74px; background: #fff; border-radius: 16px; padding: 4px; border: 3px solid var(--gold); }
.auth-logo b { font-family: var(--head); font-size: 1.25rem; letter-spacing: .3px; display: block; }
.open-list { margin-top: 26px; display: grid; gap: 8px; max-width: 34em; }
.open-list div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 9px 12px; font-size: .92rem; }
.open-list b { color: #fff; }
.open-list span { color: #b9c9d8; display: block; font-size: .84rem; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card h2 { font-size: 1.6rem; }
.tabs { display: flex; gap: 4px; background: #e6eeee; padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(11,42,73,.12); }
.code-input { font: 700 1.8rem/1 Consolas, Menlo, monospace !important; letter-spacing: .5em; text-align: center; }

/* Layout */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #cfdbe6; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none; }
.brand img { width: 46px; height: 46px; background: #fff; border-radius: 11px; padding: 2px; border: 2px solid var(--gold); }
.brand b { font-family: var(--head); color: #fff; font-size: 1rem; display: block; line-height: 1.15; }
.brand span { color: var(--gold); font-size: .8rem; font-weight: 700; }
.nav { padding: 10px 10px 20px; flex: 1; }
.nav h4 { margin: 16px 10px 6px; font-size: .78rem; color: #8fa6bb; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #dbe5ee; text-decoration: none; font-weight: 600; font-size: .94rem; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: rgba(240,180,41,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .ic { width: 18px; text-align: center; opacity: .9; }
.nav .count { margin-left: auto; background: var(--gold); color: var(--navy); font-size: .75rem; font-weight: 800; border-radius: 20px; padding: 0 7px; }
.side-foot { padding: 12px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: .86rem; }
.side-foot b { color: #fff; display: block; }
.side-foot button { margin-top: 8px; }
.main { min-width: 0; }
.top { display: none; }
.page { padding: 26px 30px 60px; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { font-family: var(--head); font-size: 1.9rem; color: var(--navy); display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.hl { border-top: 4px solid var(--gold); }
.stat.tl { border-top: 4px solid var(--teal); }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.course-card h3 { margin: 0; }
.course-card .meta { color: var(--muted); font-size: .86rem; }
.course-card .actions { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar { height: 8px; background: #e5eded; border-radius: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 10px; }
.bar.big { height: 12px; }

/* Badges */
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: #edf1f4; color: var(--navy); white-space: nowrap; }
.b-teal { background: var(--teal-soft); color: #145650; }
.b-gold { background: var(--gold-soft); color: #7a5607; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-navy { background: var(--navy); color: #fff; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--navy); color: #fff; padding: 9px 16px; border-radius: 9px; font-weight: 700; cursor: pointer; text-decoration: none; font-size: .93rem; line-height: 1.2; }
.btn:hover { background: var(--navy-2); }
.btn.teal { background: var(--teal); } .btn.teal:hover { background: #18655f; }
.btn.gold { background: var(--gold); color: var(--navy); } .btn.gold:hover { background: #e3a619; }
.btn.light { background: #fff; color: var(--navy); border-color: var(--line); } .btn.light:hover { background: #f2f6f6; }
.btn.red { background: #fff; color: var(--red); border-color: #efc8bf; } .btn.red:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 11px; font-size: .84rem; border-radius: 7px; }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.linkbtn { background: none; border: 0; color: var(--teal); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
.side .btn.light { background: transparent; color: #dbe5ee; border-color: rgba(255,255,255,.25); }
label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 4px; color: var(--navy); }
.field { margin-bottom: 14px; }
.field small { display: block; font-weight: 400; margin-top: 3px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9d6d5; border-radius: 9px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal-soft); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: .92rem; margin: 6px 0; color: var(--ink); cursor: pointer; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--teal); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; background: #f3f7f7; color: var(--navy); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid #edf2f2; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: .83rem; display: block; }
td.num, th.num { text-align: right; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* Course player */
.course-head { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; border-bottom: 5px solid var(--gold); }
.course-head h1 { color: #fff; margin: 4px 0 6px; }
.course-head p { color: #d4e0ea; margin: 0 0 6px; }
.course-head .badge { background: rgba(255,255,255,.14); color: #fff; }
.course-head .bar { background: rgba(255,255,255,.2); margin-top: 10px; }
.course-head .bar i { background: var(--gold); }
.module { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.module > h3 { margin: 0; padding: 13px 18px; background: #f3f7f7; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.item { border-bottom: 1px solid #edf2f2; }
.item:last-child { border-bottom: 0; }
.item-head { display: flex; gap: 12px; align-items: center; padding: 12px 18px; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.item-head:hover { background: #f8fbfb; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c3d1d0; display: grid; place-items: center; flex: none; font-size: .8rem; color: #fff; }
.tick.done { background: var(--teal); border-color: var(--teal); }
.tick.retry { border-color: var(--gold); color: var(--gold); }
.item-head .t { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); }
.item-head .t small { display: block; font-weight: 600; }
.item-body { padding: 4px 18px 18px 56px; }
.prose { max-width: 70ch; }
.prose ul { padding-left: 1.2em; margin: 0 0 .8em; }
.embed { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; max-width: 760px; margin-bottom: 12px; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.quiz-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.quiz-q p { font-weight: 700; margin-bottom: 6px; }
.note { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: .93rem; }
.note.teal { background: var(--teal-soft); border-color: var(--teal); }
.note.red { background: var(--red-soft); border-color: var(--red); }
.feed { display: grid; gap: 10px; }
.feed .ann { border-left: 4px solid var(--teal); background: #fff; border-radius: 0 10px 10px 0; padding: 10px 14px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feed .ann b { color: var(--navy); }

/* Builder */
.b-item { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid #edf2f2; }
.b-item:last-child { border-bottom: 0; }
.b-item .t { flex: 1; min-width: 0; }
.b-item .t b { display: block; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; width: 30px; height: 30px; cursor: pointer; color: var(--navy); }
.icon-btn:hover { background: #f2f6f6; }
.qrow { border: 1px dashed #c3d1d0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fafcfc; }

/* Charts (simple bars) */
.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: 140px 1fr 40px; gap: 8px; align-items: center; font-size: .87rem; }
.hbar .tr { background: #e8efef; border-radius: 6px; height: 14px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--teal); }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: .72rem; color: var(--muted); }
.cols .pair { display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; flex: 1; }
.cols .pair i { width: 40%; max-width: 16px; background: var(--navy); border-radius: 3px 3px 0 0; min-height: 2px; }
.cols .pair i + i { background: var(--gold); }
.legend { display: flex; gap: 14px; font-size: .83rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: rgba(11,42,73,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 50px rgba(11,42,73,.3); }
.modal-box.wide { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: #fff; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 92vw; border-bottom: 3px solid var(--gold); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); border-color: #fff; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pill-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }

/* Live class room + chat */
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "top side" "rest side"; grid-template-rows: auto 1fr; gap: 0 16px; align-items: start; }
.live-top { grid-area: top; } .live-rest { grid-area: rest; }
.live-side { grid-area: side; position: sticky; top: 16px; }
.b-item .t small { display: block; }
.join-card { border-top: 4px solid var(--gold); }
.countdown { font-family: var(--head); font-size: 1.35rem; color: var(--navy); margin-bottom: 6px; }
.join-big { font-size: 1.05rem; padding: 13px 22px; }
.code-big { font: 700 2.4rem/1.2 Consolas, Menlo, monospace; letter-spacing: .35em; color: var(--navy); margin: 6px 0; }
.chat-card { padding: 0; overflow: hidden; }
.chat { display: flex; flex-direction: column; height: min(72vh, 640px); }
.chat-card .chat { height: min(72vh, 640px); }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #f3f7f7; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { background: #f3f7f7; border-radius: 10px; padding: 7px 11px; max-width: 92%; align-self: flex-start; font-size: .92rem; }
.msg.me { background: var(--teal-soft); align-self: flex-end; }
.msg.q { border-left: 4px solid var(--gold); }
.msg.q.ans { border-left-color: var(--green); }
.msg .mh { font-size: .8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .mh b { color: var(--navy); }
.msg .mh small { color: var(--muted); margin-left: auto; }
.msg .mb { word-break: break-word; }
.msg .ma { display: flex; gap: 10px; font-size: .78rem; }
.msg .ma:empty { display: none; }
.chat-form { border-top: 1px solid var(--line); padding: 10px 12px; }
.chat-form textarea { min-height: 52px; margin-bottom: 6px; }
@media (max-width: 1000px) { .live-grid { grid-template-columns: 1fr; grid-template-areas: "top" "side" "rest"; } .live-side { position: static; } .chat, .chat-card .chat { height: 460px; } }

/* Mobile */
@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 26px 22px 30px; }
  .auth-side h1 { font-size: 1.7rem; margin-top: 16px; }
  .open-list { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(11,42,73,.45); }
  .top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; border-bottom: 3px solid var(--gold); }
  .top img { width: 34px; height: 34px; background: #fff; border-radius: 8px; padding: 1px; }
  .top b { font-family: var(--head); font-size: 1rem; }
  .top button { background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 0 6px; }
  .page { padding: 18px 14px 50px; }
  .g2, .f2, .f3, .perm-grid { grid-template-columns: 1fr; }
  .item-body { padding-left: 18px; }
  .hbar { grid-template-columns: 100px 1fr 34px; }
}
@media (max-width: 480px) { .g4, .g3 { grid-template-columns: 1fr 1fr; } h1 { font-size: 1.45rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .top, .btn, .toolbar { display: none !important; } .shell { display: block; } }

/* ---------- Welcome / sign-in page: "river of learning" ---------- */
.welcome { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "hero main" "vision main"; background: var(--bg); }
.w-hero, .w-vision { background: var(--navy); color: #fff; padding-left: clamp(22px, 5vw, 64px); padding-right: clamp(22px, 5vw, 64px); }
.w-hero { grid-area: hero; padding-top: clamp(26px, 5vh, 52px); padding-bottom: 8px; position: relative; overflow: hidden; }
.w-vision { grid-area: vision; padding-top: 28px; padding-bottom: 40px; position: relative; }
.w-vision::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(90deg, var(--teal) 70%, var(--gold) 70%); }
.w-main { grid-area: main; display: grid; place-items: center; padding: 36px 20px; align-self: start; position: sticky; top: 0; min-height: 100vh; }

.w-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.w-brand img { width: 64px; height: 64px; background: #fff; border-radius: 15px; padding: 4px; border: 3px solid var(--gold); }
.w-brand b { font-family: var(--head); font-size: 1.2rem; display: block; line-height: 1.2; }
.w-brand span { color: var(--gold); font-weight: 700; font-size: .92rem; }

/* The organisation's name in Marathi, as a quiet watermark behind the headline */
.w-dev { position: absolute; right: -0.08em; top: 1.15em; margin: 0; font-family: var(--deva); font-weight: 700; font-size: clamp(4.5rem, 10vw, 8.5rem); line-height: 1; color: rgba(240, 180, 41, .09); pointer-events: none; user-select: none; white-space: nowrap; }

.w-hero h1 { position: relative; color: #fff; font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.08; letter-spacing: -.01em; margin: clamp(26px, 6vh, 64px) 0 14px; max-width: 18ch; }
.w-note { position: relative; color: #cfdce8; max-width: 36em; font-size: 1.02rem; margin-bottom: 22px; }

.w-quote { position: relative; margin: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--gold); max-width: 34em; min-height: 6.2em; }
.w-quote blockquote { margin: 0; font-family: var(--head); font-weight: 600; font-size: clamp(1.08rem, 1.6vw, 1.28rem); line-height: 1.45; color: #fff; }
.w-quote figcaption { margin-top: 6px; color: var(--gold); font-family: var(--hand); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.w-quote.in { animation: wq-in .6s ease both; }
@keyframes wq-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.w-dots { display: flex; gap: 8px; margin: 14px 0 0 18px; }
.w-dots button { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.w-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); transition: width .2s, background .2s; }
.w-dots button[aria-pressed="true"]::before { width: 22px; border-radius: 6px; background: var(--gold); }

.w-kicker, .w-vision h2.w-kicker { color: var(--gold); font-family: var(--body); font-weight: 800; margin: 0 0 6px; font-size: .95rem; max-width: none; }
.w-vision h2 { color: #fff; font-size: clamp(1.3rem, 2.1vw, 1.65rem); max-width: 22em; margin-bottom: 10px; }

.river { margin: 6px 0 18px; max-width: 640px; }
.river-line { display: block; width: 100%; height: auto; overflow: visible; }
.river-line path { fill: none; stroke-linecap: round; }
.river-line .r-main { stroke: #3FB0A6; stroke-width: 5; stroke-dasharray: 1; stroke-dashoffset: 0; animation: river-draw 2.2s ease-out .2s both; }
.river-line .r-soft { stroke: rgba(63, 176, 166, .28); stroke-width: 3; }
.river-line circle { fill: var(--gold); stroke: var(--navy); stroke-width: 4; animation: stop-in .4s ease-out both; }
.river-line circle:nth-of-type(1) { animation-delay: .7s; } .river-line circle:nth-of-type(2) { animation-delay: 1.3s; } .river-line circle:nth-of-type(3) { animation-delay: 1.9s; }
@keyframes river-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes stop-in { from { opacity: 0; } to { opacity: 1; } }
.river-stops { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: center; }
.river-stops b { display: block; font-family: var(--head); font-size: 1.2rem; color: #fff; }
.river-stops span { display: block; color: #b9cad9; font-size: .88rem; line-height: 1.4; max-width: 15em; margin: 2px auto 0; }

.w-story { color: #cfdce8; max-width: 38em; font-size: .95rem; }
.w-open { margin-top: 18px; display: grid; gap: 8px; max-width: 36em; }
.w-open h3 { color: var(--gold); font-family: var(--body); font-size: .95rem; font-weight: 800; margin: 0; }
.w-open div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 9px 12px; font-size: .92rem; }
.w-open b { color: #fff; }
.w-open span { color: #b9c9d8; display: block; font-size: .84rem; }
.w-help { margin: 22px 0 0; font-size: .88rem; color: #cfdce8; }
.w-help a { color: var(--gold); }

.welcome.calm .w-quote.in, .welcome.calm .river-line .r-main, .welcome.calm .river-line circle { animation: none; }
@media (prefers-reduced-motion: reduce) { .w-quote.in, .river-line .r-main, .river-line circle { animation: none !important; } }

/* Phones and small tablets: brand + headline first, then the sign-in form, then the vision */
@media (max-width: 860px) {
  .welcome { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "hero" "main" "vision"; }
  .w-hero { padding-bottom: 26px; border-bottom: 5px solid var(--gold); }
  .w-hero h1 { margin-top: 26px; max-width: 16ch; }
  .w-dev { top: auto; bottom: -0.12em; font-size: 5.2rem; }
  .w-quote { min-height: 7.4em; }
  .w-main { padding: 28px 18px 34px; place-items: start center; position: static; min-height: 0; }
  .w-vision { padding-top: 30px; }
}
@media (max-width: 520px) {
  .w-brand img { width: 52px; height: 52px; }
  .w-brand b { font-size: 1.05rem; }
  .river-line { display: none; }
  .river-stops { grid-template-columns: 1fr; gap: 0; text-align: left; position: relative; padding-left: 30px; }
  .river-stops::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: linear-gradient(#3FB0A6, rgba(63,176,166,.35)); }
  .river-stops li { position: relative; padding: 4px 0 14px; }
  .river-stops li::before { content: ""; position: absolute; left: -28px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid var(--navy); }
  .river-stops span { margin: 2px 0 0; max-width: none; }
}

/* ---------- Inside the portal: icons, brand, dashboards ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i.sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.btn .i { width: 1.05em; height: 1.05em; }

/* Sidebar */
.brand { padding: 20px 18px 18px; gap: 12px; }
.brand img { width: 48px; height: 48px; }
.brand b { font-size: 1.04rem; }
.brand span { font-size: .8rem; letter-spacing: .2px; }
.nav h4 { margin: 18px 12px 6px; font-size: .74rem; color: #7f97ad; font-weight: 800; letter-spacing: .3px; }
.nav a { gap: 12px; padding: 9px 12px; font-size: .92rem; color: #d3dee8; transition: background .15s, color .15s; }
.nav a .i { width: 19px; height: 19px; color: #8fb3c9; transition: color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a:hover .i { color: #fff; }
.nav a.on { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.on .i { color: var(--gold); }
.side-foot { padding: 14px 16px 18px; }
.side-foot .me { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; }
.side-foot .me div { min-width: 0; }
.side-foot .me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot small { color: #8fa6bb; display: block; font-size: .8rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; border: 2px solid rgba(240,180,41,.7); }
.side-foot .btn { width: 100%; }

/* Mobile top bar */
.top-brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top-brand b { font-family: var(--head); font-size: .98rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-brand span { color: var(--gold); font-size: .74rem; font-weight: 700; }
.top #menu { display: grid; place-items: center; width: 38px; height: 38px; background: transparent; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; color: #fff; cursor: pointer; padding: 0; }
.top #menu .i { width: 20px; height: 20px; }

/* Small square buttons and list icons */
.icon-btn { display: inline-grid; place-items: center; padding: 0; }
.icon-btn .i { width: 16px; height: 16px; }
.b-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.b-ic .i { width: 18px; height: 18px; }
.tick .i { width: 14px; height: 14px; stroke-width: 2.6; }
.chat-head b { display: inline-flex; align-items: center; gap: 6px; }

/* Section headings: a short gold rule ties them to the letterhead */
h2.sec { display: flex; align-items: center; gap: 10px; font-size: 1.18rem; margin: 6px 0 12px; }
h2.sec::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--gold); flex: none; }

/* Learner home banner */
.hello { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 16px; padding: 26px 28px 30px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.hello > div { position: relative; z-index: 1; max-width: 40em; }
.hello > .btn { position: relative; z-index: 1; }
.hello-org { color: var(--gold); font-weight: 800; font-size: .86rem; margin: 0 0 4px; }
.hello h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 6px; }
.hello p { color: #cfdce8; margin: 0; }
.hello-river { position: absolute; left: 0; right: 0; bottom: -22px; width: 100%; height: 56px; pointer-events: none; }
.hello-river path { fill: none; stroke-linecap: round; }
.hello-river path:first-child { stroke: rgba(63,176,166,.45); stroke-width: 3; }
.hello-river path:last-child { stroke: rgba(240,180,41,.22); stroke-width: 2; }

/* KPI cards */
.kpis { display: grid; gap: 14px; margin-bottom: 14px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.kpi-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #E7EDF3; color: var(--navy); }
.kpi-ic .i { width: 22px; height: 22px; }
.kpi.teal .kpi-ic { background: var(--teal-soft); color: var(--teal); }
.kpi.gold .kpi-ic { background: var(--gold-soft); color: #A8730A; }
.kpi b { display: block; font-family: var(--head); font-size: 1.85rem; line-height: 1.05; color: var(--navy); }
.kpi > div > span { color: var(--muted); font-size: .88rem; display: block; line-height: 1.35; }
.kpi em { display: block; font-style: normal; color: var(--teal); font-weight: 700; font-size: .8rem; margin-top: 2px; }

/* Secondary figures in one calm strip */
.figs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.fig { padding: 14px 16px; border-left: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.fig:first-child { border-left: 0; }
.fig .i { grid-row: span 2; color: var(--teal); width: 18px; height: 18px; align-self: start; margin-top: 6px; }
.fig b { font-family: var(--head); font-size: 1.3rem; color: var(--navy); line-height: 1.15; }
.fig b small { font-family: var(--body); font-size: .8rem; color: var(--muted); font-weight: 700; }
.fig span { color: var(--muted); font-size: .8rem; line-height: 1.3; }

/* Charts */
.chart-card .cols { height: 190px; margin-top: 8px; padding-top: 14px; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #edf2f2 calc(25% - 1px), #edf2f2 25%); border-bottom: 1px solid var(--line); }
.cols .pair { gap: 3px; }
.cols .pair i { background: var(--teal); border-radius: 4px 4px 0 0; max-width: 14px; }
.cols .pair i + i { background: var(--gold); }
.cols .c { font-size: .7rem; }
.hbar { grid-template-columns: 130px 1fr 38px; font-size: .86rem; }
.hbar .tr { height: 10px; border-radius: 5px; background: #edf2f2; }
.hbar .tr i { border-radius: 5px; background: linear-gradient(90deg, var(--teal), #3FB0A6); }
.hbar b { color: var(--navy); }

@media (max-width: 1100px) { .figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fig:nth-child(4) { border-left: 0; } .fig:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 960px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .kpis.k3, .kpis.k4 { gap: 10px; }
  .kpis.k3 .kpi, .kpis.k4 .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpis.k3 .kpi-ic, .kpis.k4 .kpi-ic { width: 36px; height: 36px; border-radius: 10px; }
  .kpis.k3 .kpi-ic .i, .kpis.k4 .kpi-ic .i { width: 19px; height: 19px; }
  .kpis.k3 .kpi > div > span, .kpis.k4 .kpi > div > span { font-size: .78rem; }
  .kpi { padding: 13px 14px; }
  .kpi b { font-size: 1.55rem; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig:nth-child(n) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .fig:nth-child(odd) { border-left: 0; }
  .fig:nth-child(-n+2) { border-top: 0; }
  .hello { padding: 22px 20px 30px; border-radius: 14px; }
  .hello > .btn { width: 100%; }
  .hbar { grid-template-columns: 96px 1fr 32px; }
}

.grid > .card { margin-bottom: 0; }
.grid.g2 + h2.sec, .grid.g2 + .grid.g2 { margin-top: 16px; }

/* Vision, mission and the Shiksha Path (content from shikshanganga.org) */
.w-statement { font-family: var(--head); font-weight: 500; color: #fff; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.35; max-width: 26em; margin: 0 0 16px; }
.w-mission { border-left: 3px solid rgba(239,181,35,.55); padding: 2px 0 2px 14px; margin: 0 0 22px; max-width: 38em; }
.w-mission h3, .w-path { font-family: var(--body); font-weight: 800; color: var(--gold); font-size: .9rem; margin: 0 0 4px; }
.w-mission p { color: #D6E2EC; font-size: .95rem; margin: 0; }
.w-path { margin-top: 4px; }
.w-facts { list-style: none; padding: 14px 0 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; color: #D6E2EC; font-size: .85rem; line-height: 1.35; max-width: 36em; border-top: 1px solid rgba(255,255,255,.12); }
.w-facts b { display: block; font-family: var(--head); color: #fff; font-size: 1.5rem; line-height: 1.1; margin-bottom: 2px; }
.w-values { font-family: var(--hand); color: var(--gold); font-size: 1.3rem; margin: 8px 0 0; }

/* Minimal sign-in: one laptop screen, short phone scroll */
.w-hero { padding-bottom: 0; }
.w-hero h1 { margin: clamp(22px, 5vh, 48px) 0 10px; }
.w-note { margin-bottom: 18px; }
.w-quote { min-height: 5.4em; }
.w-vision { padding-top: clamp(18px, 3.5vh, 32px); padding-bottom: 32px; }
.w-statement { font-size: clamp(1.15rem, 1.7vw, 1.4rem); margin-bottom: 6px; }
.river { margin: 0 0 6px; max-width: 560px; }
.w-help { margin-top: 14px; }
@media (max-width: 860px) {
  .w-hero { padding-bottom: 22px; }
  .w-hero h1 { font-size: 1.85rem; margin-top: 20px; }
  .w-note { margin-bottom: 0; font-size: .95rem; }
  .w-quote, .w-dots { display: none; }
  .w-main { padding-top: 24px; }
  .w-vision { padding-top: 24px; }
}
@media (min-width: 861px) {
  .w-hero h1 { font-size: clamp(2rem, 3vw, 2.6rem); max-width: 20ch; }
  .w-brand img { width: 56px; height: 56px; }
  .w-quote { min-height: 0; }
  .w-quote blockquote { font-size: 1.08rem; }
  .w-dots { margin-top: 8px; }
  .river { max-width: 460px; }
  .river-stops b { font-size: 1.05rem; }
}
@media (min-width: 861px) and (max-height: 760px) { .w-note { display: none; } }
@media (min-width: 861px) { .welcome { grid-template-rows: auto minmax(0, 1fr); } }
/* One line + one quote */
.w-note { font-family: var(--hand); color: var(--gold); font-size: 1.6rem; line-height: 1.2; margin: 0 0 18px; }
.w-quote { animation: none; }
@media (max-width: 860px) { .w-quote { display: block; margin-top: 16px; } .w-note { font-size: 1.45rem; } }
@media (min-width: 861px) and (max-height: 760px) { .w-note { display: block; } }
@media (min-width: 861px) {
  .w-hero h1 { margin-top: clamp(28px, 10vh, 96px); }
  .w-vision { padding-top: clamp(24px, 7vh, 64px); }
  .river { margin-top: 8px; }
}
@media (max-width: 860px) { .w-dev { display: none; } }
@media (min-width: 861px) { .w-vision { display: flex; flex-direction: column; } .w-help { margin-top: auto; padding-top: 16px; } }
