/* Mandali · calm layer (2 Dec 2026). Restraint borrowed from Claude Duet and Claude Code, applied to Mandali's own brand:
   warmer surfaces, fewer borders, gold kept for what matters, pill controls, a phone drawer for the less-used sections,
   an always-reachable Ask bar and a dark coach-mark for the What's new tour. Loaded last, student app only (body.stu).
   Brand kept: navy and cream themes, gold, Fraunces, the sloka. Nothing here removes a feature. */

/* ---------- surfaces ---------- */
:root {
  --ink: #0A0E17; --panel: #111726; --raise: #18213A; --line: #1C2539;
  --text: #ECE8DF; --muted: #9CA4B6; --gold: #E2AA31; --gold-soft: rgba(226, 170, 49, .10);
  --calm-r: 18px; --calm-shadow: 0 0 0 1px rgba(255, 255, 255, .035), 0 14px 32px -26px rgba(0, 0, 0, .75);
  --calm-ease: cubic-bezier(.23, 1, .32, 1);
}
html[data-theme="light"] {
  --ink: #ECE8E1; --panel: #F8F5EF; --raise: #E6E0D5; --line: #DED6C9;
  --text: #211B14; --muted: #6B6255; --gold: #8C5F10; --gold-soft: rgba(140, 95, 16, .09);
  --calm-shadow: 0 0 0 1px rgba(60, 45, 25, .06), 0 14px 30px -26px rgba(60, 45, 25, .38);
}
body.stu { background: var(--ink); }

/* cards: separated by tone and space, not outlines */
body.stu .card { border-color: transparent; border-radius: var(--calm-r); box-shadow: var(--calm-shadow); }
body.stu .card .card { box-shadow: none; background: color-mix(in srgb, var(--raise) 55%, transparent); }

/* controls: one shape, the pill */
body.stu .btn { border-radius: 999px; transition: transform 140ms var(--calm-ease), background-color 160ms ease, border-color 160ms ease; }
body.stu .btn:active { transform: scale(.97); }
body.stu .btn.ghost, body.stu .btn.quiet { border-color: color-mix(in srgb, var(--line) 80%, transparent); }

/* tabs become pills; gold only on the one you're on */
body.stu .tabs { border-bottom: 0; gap: 6px; padding: 2px 0 4px; scrollbar-width: none; }
body.stu .tabs::-webkit-scrollbar { display: none; }
body.stu .tab { border: 0; border-radius: 999px; padding: 9px 15px; color: var(--muted); background: transparent; transition: background-color 160ms ease, color 160ms ease; }
body.stu .tab[aria-selected="true"] { color: var(--text); background: var(--raise); border: 0; font-weight: 600; }
body.stu .tab[aria-selected="true"]::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
body.stu .chip { border-color: transparent; background: color-mix(in srgb, var(--raise) 70%, transparent); }
body.stu .chip[aria-pressed="true"] { color: var(--text); background: var(--raise); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }

/* type carries the hierarchy; numbers never jitter */
body.stu .sec-title { font-family: var(--serif); font-weight: 600; font-size: 1.32rem; letter-spacing: -.005em; margin: 30px 0 12px; }
body.stu .mono, body.stu td, body.stu .num, body.stu [class*="price"], body.stu [class*="pct"], body.stu [class*="chg"], body.stu time { font-variant-numeric: tabular-nums; }

/* ---------- phone: four tabs + More ---------- */
.an-more, .sd-ov { display: none; }
@media (max-width: 699.98px) {
  body.stu .an { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; border-top: 0; box-shadow: 0 -10px 30px -24px rgba(0, 0, 0, .7); }
  body.stu .an .an-x { display: none !important; }
  body.stu .an .an-more { display: flex; }
  .sd-ov { display: block; }
}
.an-more { flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: inherit; cursor: pointer; touch-action: manipulation; }

/* the drawer (Duet's channel list, Mandali colours) */
.sd-ov { position: fixed; inset: 0; z-index: 130; background: rgba(4, 7, 14, .5); opacity: 0; pointer-events: none; transition: opacity 200ms var(--calm-ease); }
html[data-theme="light"] .sd-ov { background: rgba(42, 34, 25, .32); }
.sd-ov.on { opacity: 1; pointer-events: auto; }
.sd { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); display: flex; flex-direction: column; background: var(--ink); color: var(--text);
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  transform: translateX(-104%); transition: transform 260ms var(--calm-ease); box-shadow: 24px 0 60px -30px rgba(0, 0, 0, .7); overflow-y: auto; overscroll-behavior: contain; }
.sd-ov.on .sd { transform: none; }
.sd-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); margin-bottom: 12px; }
.sd-head img { width: 34px; height: 34px; border-radius: 50%; }
.sd-head b { font: 600 22px/1 var(--serif); letter-spacing: -.01em; }
.sd-head .sp { flex: 1; }
.sd-x { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.sd-all { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 18px; background: var(--raise); margin: 0 0 14px; touch-action: manipulation; }
.sd-all svg { flex: none; color: var(--gold); }
.sd-all b { display: block; font: 600 17px/1.2 var(--serif); }
.sd-all small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.sd-all:active { transform: scale(.985); }
.sd .sd-g { display: block; margin: 0 0 10px; text-align: left; }
.sd .sd-gh { align-self: stretch; }
.sd .sd-gh { display: flex !important; align-items: center; justify-content: flex-start !important; text-align: left !important; width: auto; gap: 8px; margin: 10px 8px 6px; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sd-gh svg { width: 15px; height: 15px; }
.sd-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; text-align: left; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15.5px; color: var(--text); touch-action: manipulation; }
.sd-row[aria-current="page"] { background: color-mix(in srgb, var(--raise) 85%, transparent); font-weight: 600; }
.sd-row[aria-current="page"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.sd-row:active { background: color-mix(in srgb, var(--raise) 60%, transparent); }
.sd-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); display: flex; align-items: center; gap: 10px; }
.sd-foot button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: var(--raise); font-size: 13.5px; color: var(--text); }
.sd-sloka { margin: 12px 4px 0; font: 500 13px/1.4 var(--serif); color: var(--gold); text-align: center; opacity: .85; }

/* ---------- the Ask bar: always within thumb reach on phones ---------- */
#askPill { display: none; }
@media (max-width: 699.98px) {
  body.stu.has-nav.ask-on #askPill { display: flex; }
  body.stu.has-nav.ask-on .wrap { padding-bottom: 64px; }
}
#askPill { position: fixed; z-index: 39; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 16px;
  border: 0; border-radius: 999px; background: var(--panel); color: var(--muted); font: 400 15px/1 var(--sans); text-align: left; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 90%, transparent), 0 16px 32px -18px rgba(0, 0, 0, .7); transition: transform 140ms var(--calm-ease); }
#askPill:active { transform: scale(.98); }
#askPill .ap-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#askPill .ap-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1205; flex: none; }
#askPill .ap-s { color: var(--gold); flex: none; }

/* ---------- quieter motion on screens seen many times a day ---------- */
@media (prefers-reduced-motion: reduce) { .sd, .sd-ov, #askPill, body.stu .btn, body.stu .tab { transition: opacity 150ms ease !important; } }

/* fee due bar (revoked students keep the basic app) */
.due-bar { position: fixed; left: 10px; right: 10px; top: calc(env(safe-area-inset-top) + 64px); z-index: 60; max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red, #F2665E) 45%, transparent) inset, 0 12px 30px -16px rgba(0,0,0,.6);
  font-size: 14px; line-height: 1.35; animation: dueIn 240ms cubic-bezier(.23,1,.32,1); }
@keyframes dueIn { from { opacity: 0; transform: translateY(-8px); } }
body.has-due main, body.has-due #app { padding-top: 58px; }
.due-bar .db-t { flex: 1; min-width: 0; }
.due-bar .db-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--red, #F2665E); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red, #F2665E) 22%, transparent); }
.due-bar .db-dot.wait { background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
.due-bar .db-b { all: unset; box-sizing: border-box; flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--gold); color: #10131c; font-weight: 700; font-size: 13.5px; line-height: 36px; cursor: pointer; touch-action: manipulation; }
.due-bar .db-b.quiet { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.due-bar .db-b:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .due-bar { animation: none; } }

/* payment deadline reminder */
.dw-left { margin: 0 0 6px; font: 700 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red, #F2665E); }
.dw-lede { margin: 0 0 12px; font-size: 16.5px; line-height: 1.5; }
.dw-list { margin: 0 0 16px; padding-left: 18px; color: var(--text); font-size: 15px; line-height: 1.55; }
.dw-list li { margin: 4px 0; }
.lk-due { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red, #F2665E) 12%, var(--panel)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red, #F2665E) 40%, transparent) inset; font-size: 15px; line-height: 1.5; }

/* wordmark */
.wm { display: block; height: 30px; width: auto; flex: none; }
.wm .wm-m { fill: var(--gold); } .wm .wm-d { fill: var(--text); } .wm .wm-t { fill: var(--muted); }
.topbar .brand .wm { height: 34px; }
.an-brand .wm { height: 34px; }
.sd-head .wm { height: 38px; margin-right: auto; }
@media (max-width: 380px) { .topbar .brand .wm { height: 28px; } }

/* Phone header: wordmark, arrows, search, language and the plan badge must fit in one row */
.topbar { max-width: 100%; }
.topbar .brand { min-width: 0; flex: 0 1 auto; }
.topbar .actions, .topbar .navbtns { flex: none; }
@media (max-width: 440px) {
  .topbar .brand:has(.wm) .brand-mark { display: none; }
  .topbar .brand .wm { height: 30px; }
  .topbar .brand .tier { width: 28px; height: 28px; padding: 0; justify-content: center; gap: 0; margin-left: 0; flex: none; }
  .topbar .brand .tier > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar .brand .tier i svg { width: 13px; height: 13px; }
  .topbar .tb-admin { font-size: 0; gap: 0; width: 32px; height: 32px; padding: 0; justify-content: center; }
}
@media (max-width: 360px) { .topbar .brand .wm { height: 26px; } }
