/* Design v2 (Joshi 29–30 Oct): dashboard tiles, quote of the day, child switch, past lessons, homework, tutors,
   admin read-only bar. Loaded after portal.css. Light theme only; saffron #C2532C = needs attention. */
body.pt { --saff: #C2532C; --saff-bg: #F7E3DC }
.dhead { margin: 18px 0 18px } .dhead h1 { margin-top: 4px }
.mt18 { margin-top: 18px } .mt16 { margin-top: 16px } .mt8 { margin-top: 8px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }

/* Quote of the day */
.quote { display: flex; gap: 16px; align-items: center; margin: 0 0 16px; background: var(--rail); color: #F6F3EF; border-radius: var(--r); padding: 16px 22px }
.quote .qav { width: 48px; height: 48px; flex: none; border-radius: 50%; background: #C7C0B9; color: #152528; display: grid; place-items: center; font-weight: 700; font-size: 14px }
.quote blockquote { margin: 0 } .quote p { margin: 0; font: 400 19px/1.35 Georgia, "Times New Roman", serif }
.quote figcaption { font-size: 12.5px; color: #C7C0B9; margin-top: 4px }

/* Child switch */
.kids { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px }
.kids[hidden] { display: none }
.kids .kid { border-radius: 99px; position: relative; font-weight: 600 }
.kids .kid[aria-pressed="true"] { background: var(--act); color: var(--on-act); border-color: var(--act) }
.kids .dot { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--saff); border: 2px solid var(--bg) }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit }

/* Dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; color: var(--ink); text-decoration: none; min-width: 0 }
.tile:hover { border-color: var(--ink) }
.tile.wide { grid-column: span 2 }
.tile h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px }
.tile p { margin: 0; font-size: 13.5px } .tile p:empty { display: none }
.tile .big { font-size: 22px; font-weight: 700; letter-spacing: -.01em } .tile .big:empty { display: none }
.tile .go { margin-top: auto; padding-top: 4px; font-size: 13.5px; font-weight: 600; text-decoration: underline }
.tile.hot { border-color: #E3B6A6; box-shadow: inset 5px 0 0 var(--saff) } .tile.hot .go { color: var(--saff) }
.badge { background: var(--saff); color: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; white-space: nowrap }
.badge[hidden] { display: none }
@media (max-width: 900px) { .tiles { grid-template-columns: minmax(0, 1fr) } .tile.wide { grid-column: auto } .quote p { font-size: 16px } }

/* Messages */
body.pt .thread { display: grid; gap: 10px; max-height: 52vh; overflow: auto }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 12px; background: #F2EEE8; border: 1px solid var(--line); font-size: 14px }
.bubble.me { justify-self: end; background: #DCE6E4 } .bubble p { margin: 3px 0 0; white-space: pre-wrap } .bubble .hint { font-size: 12px; color: var(--muted) }
body.pt textarea.in, body.pt input.in, body.pt select.in { width: 100%; font: inherit; font-size: 14.5px; background: #F4F0EA; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink) }

/* Past lessons */
body.pt .row.past { grid-template-columns: 120px minmax(0, 1fr) auto }

/* Homework */
.hwlist { display: grid; gap: 16px }
.card.hw.hot { border-color: #E3B6A6; box-shadow: inset 5px 0 0 var(--saff) }
.hwtop { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.hw .meta { margin: 6px 0 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center }
.filechip { border: 1px solid var(--line); background: #F4F0EA; border-radius: 8px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink) }
.track { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 4px 0 14px; position: relative }
.track li { display: grid; justify-items: center; gap: 4px; font-size: 13px; color: var(--muted); position: relative }
.track li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0 }
.track li:first-child::before { display: none }
.track li.done::before { background: var(--rail) }
.track .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #F4F0EA; border: 1.5px solid var(--line); font-size: 12px; font-weight: 700; z-index: 1 }
.track li.done .n { background: var(--rail); color: #fff; border-color: var(--rail) }
.track li.now { color: var(--ink); font-weight: 600 } .track li.now .n { background: var(--saff); color: #fff; border-color: var(--saff) }
.track li.skip { opacity: .45 } .track li.skip::before { background: var(--rail) }
.hwbox { border: 1px solid var(--line); background: #F1ECE6; border-radius: 12px; padding: 14px 16px }
.hwbox p { margin: 4px 0 0 } .hwbox.done { background: #DFE7E4 }
.hwbox .mark { font-size: 24px; font-weight: 700; color: var(--ok) }
.scorebox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px }
body.pt .scorebox input.in { width: 84px }
@media (max-width: 640px) { .track li span:not(.n) { font-size: 11px; text-align: center } }

/* Tutors */
.card.tutor { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 18px; align-items: center }
.tphoto { width: 84px; height: 84px; border-radius: 50%; object-fit: cover }
.tutor .tbody p { margin: 3px 0 0 } .tutor h2 { font-size: 19px }
@media (max-width: 640px) { .card.tutor { grid-template-columns: 64px minmax(0, 1fr) } .tphoto { width: 64px; height: 64px } .tutor .steps { grid-column: 1 / -1 } }

/* Forms (Add a child) */
.formcard { max-width: 760px; display: grid; gap: 14px }
.formcard .sec .optn { text-transform: none; letter-spacing: 0 }
.formcard .sec { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0 }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px } .fields3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px }
body.pt label.f { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600 } .optn { font-weight: 400; color: var(--muted); font-size: 12.5px } .rqm { color: #B3261E }
.note { border: 1px solid var(--line); background: #F1ECE6; border-radius: 10px; padding: 10px 14px; margin: 0 }
@media (max-width: 760px) { .fields, .fields3 { grid-template-columns: 1fr } }

/* Admin read-only bar (handover §3f) */
.adminbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: #7C4F49; color: #fff; border-radius: 12px; padding: 9px 14px; margin-bottom: 12px; font-size: 14px }
.adminbar[hidden] { display: none }
.adminbar .btn { background: #fff; color: #7C4F49; border-color: #fff; font-weight: 600 }
body.pt.readonly main .adminbar button, body.pt.readonly main .adminbar a { pointer-events: auto; opacity: 1 }
body.pt.readonly .kids .kid { pointer-events: auto; opacity: 1 }
body.pt.readonly main .tile:not(#tBook) { pointer-events: auto }

.hwtop .chip.alert { background: var(--saff); color: #fff }

/* Quote of the day, top right of the dashboard (Joshi 30 Oct) */
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap }
.qotd { margin: 0; max-width: 430px; border-left: 3px solid var(--saff); padding: 2px 0 2px 14px }
.qotd[hidden] { display: none }
.qotd .qlbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); font-weight: 600 }
.qotd blockquote { margin: 4px 0 2px; font: italic 400 16px/1.35 Georgia, "Times New Roman", serif; color: var(--ink) }
.qotd figcaption { font-size: 12px; color: var(--muted) }
@media (max-width: 900px) { .qotd { max-width: none } }
/* Tutor profile (name clicked) */
.tname { color: inherit; text-decoration: underline; text-decoration-color: #A79C90; text-underline-offset: 4px }
.tpro { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; margin-top: 10px }
.tbig { width: 200px; height: 200px; border-radius: 16px; object-fit: cover } .tpname { font-size: 24px } .tpro .intro { font-size: 15px; line-height: 1.6; max-width: 70ch }
.tpro .sec { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px } .tpro .ticks { margin: 0; padding-left: 18px }
@media (max-width: 700px) { .tpro { grid-template-columns: 1fr } .tbig { width: 140px; height: 140px } }
/* Birthday (optional) */
.bday { display: inline-flex; gap: 6px } body.pt .bday select.in { width: auto }
.bdrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px }
.fw4 { font-weight: 400 } .wauto { width: auto }
/* Audit phase 1: small dialogs on family pages (Add a subject) */
dialog.dlg { border: 0; border-radius: 16px; padding: 18px 20px; width: min(560px, 94vw); background: var(--surface, #E5DFD7) } dialog.dlg::backdrop { background: rgb(20 30 32 / .5) }
dialog.dlg h2 { margin: 0 0 4px } dialog.dlg .fields { display: grid; gap: 10px; margin-top: 10px } dialog.dlg label.f { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600 }
/* Messages (Joshi 31 Oct): conversations on the left (SpaceTime first), the chosen one on the right */
.convwrap { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: start }
.convlist { padding: 8px; display: grid; gap: 4px }
.convlist button { display: grid; gap: 2px; text-align: left; font: inherit; background: none; border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--ink, #182528); position: relative }
.convlist button:hover { background: var(--sunk, #D3CAC0) } .convlist button[aria-pressed="true"] { background: #163038; color: #F6F3EF }
.convlist button b { font-weight: 600; font-size: 14.5px } .convlist button small { font-size: 12.5px; opacity: .8 }
.convlist .cnt { position: absolute; right: 10px; top: 10px; background: #C2532C; color: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 1px 7px }
@media (max-width: 800px) { .convwrap { grid-template-columns: 1fr } }
/* Step 5 (Joshi 3 Nov): card, receipts, payment notice */
.cardline { display: flex; align-items: center; gap: 10px; margin: 6px 0 } .cardline .vb { font: 700 11px/1 system-ui, sans-serif; color: #1A1F71; border: 1px solid #ccc; border-radius: 4px; padding: 4px 6px; background: #fff; letter-spacing: .02em }
#cardBox .cardslot { max-width: none }
.rcfilter { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0 } .rcfilter:empty { display: none }
.chipbtn { border: 1px solid var(--line, #C2B8AD); background: transparent; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13.5px; color: var(--ink, #182528); cursor: pointer } .chipbtn.on { background: #182528; color: #fff; border-color: #182528 }
.rcsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 } .rcsum .tile small { font-size: 13px; color: var(--muted, #5F6B6D) } .rcsum .tile b { font-size: 22px }
.scrollx { overflow-x: auto }
table.rctbl { width: 100%; border-collapse: collapse; font-size: 14px } .rctbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted, #5F6B6D); padding: 7px 8px; border-bottom: 1px solid var(--line, #CFC6BB); white-space: nowrap }
.rctbl td { padding: 10px 8px; border-bottom: 1px solid var(--line, #CFC6BB) } .rctbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap } .rctbl tr.tot td { font-weight: 700; border-top: 2px solid var(--line, #CFC6BB); border-bottom: 0 }
.rctbl .linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #1F4E5A; text-decoration: underline; cursor: pointer }
.paywarn { background: #F7E3DC; border: 1px solid #E3A994; border-left: 5px solid #C2532C; border-radius: 12px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; margin: 8px 0 14px; font-size: 14.5px }
.paywarn p { margin: 2px 0 0; color: #5F3A2C; font-size: 13.5px } .paywarn .btn { flex: 0 0 auto }
@media (max-width: 700px) { .rcsum { grid-template-columns: 1fr } .paywarn { flex-direction: column; align-items: flex-start } }
/* Joshi 3 Nov 10:14: My account › Card wide enough that nothing in the card box wraps (two equal columns; one column below 1180 px) */
body.pt #vAccount .cols-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) }
@media (max-width: 1180px) { body.pt #vAccount .cols-main { grid-template-columns: 1fr } }
/* Joshi 3 Nov 10:16: names are links to that person's profile, everywhere (same look as the admin portal) */
a.nmlink { color: inherit; text-decoration: underline; text-decoration-color: #A79C90; text-underline-offset: 3px; font-weight: inherit; cursor: pointer } a.nmlink:hover { text-decoration-color: currentColor }
/* Joshi 3 Nov 10:20: My account tabs for parents (Children · Parents and guardians · Card); one card at a time */
.acctabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px }
.acctabs a { border: 1px solid var(--line, #C2B8AD); border-radius: 99px; padding: 7px 16px; font-size: 14.5px; color: var(--ink, #182528); text-decoration: none }
.acctabs a.on { background: #182528; color: #fff; border-color: #182528 }
body.pt #vAccount.tabbed .cols-main { grid-template-columns: minmax(0, 1fr); max-width: 760px }
a.kidtab { text-decoration: none; display: inline-block } .kidtab.add { color: #1F4E5A; font-weight: 600 }
#kidAdd .formcard { margin-top: 4px }
body.pt #vAccount.tabbed .cols-main { gap: 0 } body.pt #vAccount.tabbed .stack:empty, body.pt #vAccount.tabbed .stack > [hidden] { display: none }
/* Joshi 3 Nov 10:41: children as folder tabs (like bookmarks on a folder); the chosen tab joins the page below it */
#vAccount .kidtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid #BFB4A7; margin: 0; padding: 0 0 0 6px }
#vAccount .kidtab { border: 1px solid #CDC3B7; border-bottom: 0; border-radius: 10px 10px 0 0; background: #D8CFC4; color: #4E5A5C; padding: 9px 18px; margin-bottom: -1px; font-size: 14.5px; position: relative }
#vAccount .kidtab:hover { background: #E2DAD0; color: #182528 }
#vAccount .kidtab.on { background: #F4F0EA; color: #182528; font-weight: 600; border-color: #BFB4A7; border-bottom: 1px solid #F4F0EA; z-index: 1 }
#vAccount .kidtab.add { background: transparent; border-color: transparent; color: #1F4E5A; font-weight: 600 } #vAccount .kidtab.add.on { background: #F4F0EA; border-color: #BFB4A7 }
#vAccount .kidtabs + .kidcard, #vAccount #kidAdd { background: #F4F0EA; border: 1px solid #BFB4A7; border-top: 0; border-radius: 0 0 12px 12px; padding: 16px 18px }
#vAccount #kidsCard { padding-top: 18px }
/* Teacher › Students: labels sit level with the first line of the details */
body.pt .row.kv { align-items: start } body.pt .row.kv .t { padding-top: 1px; color: var(--muted); font-weight: 600 }
/* Joshi 3 Nov 17:42: quote of the day at the top right of every tab, always in the same place
   (parents, students, teacher, admin). The page title, notices and buttons sit to its left. */
@media (min-width: 1100px) {
  body.pt .ptmain { position: relative }
  body.pt .ptmain > .qotd.topq { position: absolute; top: 40px; right: 36px; width: 430px; max-width: 430px }
  body.pt .ptmain:has(> .qotd.topq:not([hidden])) .head,
  body.pt .ptmain:has(> .qotd.topq:not([hidden])) .dhead,
  body.pt .ptmain:has(> .qotd.topq:not([hidden])) .otop { padding-right: 470px; min-height: 150px; box-sizing: border-box; flex-direction: column; align-items: flex-start; justify-content: flex-start; flex-wrap: nowrap }
  body.pt .ptmain:has(> .qotd.topq:not([hidden])) > #ok,
  body.pt .ptmain:has(> .qotd.topq:not([hidden])) > #err { margin-right: 470px }
  /* an admin preview bar at the top: the quote goes back into the flow */
  body.pt .ptmain:has(> .adminbar:not([hidden])) > .qotd.topq { position: static; width: auto; margin: 0 0 12px auto }
  body.pt .ptmain:has(> .adminbar:not([hidden])) .head, body.pt .ptmain:has(> .adminbar:not([hidden])) .dhead { padding-right: 0; min-height: 0 }
}
@media (max-width: 1099px) { body.pt .ptmain > .qotd.topq { margin: 8px 0 4px } }

/* Joshi 3 Dec: optional student avatar (none → initials) */
.avb { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex: 0 0 auto; vertical-align: middle; background: #E7DFD3; color: #163038; font: 700 14px/1 system-ui, -apple-system, sans-serif }
.avb svg { width: 100%; height: 100%; display: block }
.avb-sm { width: 32px; height: 32px; font-size: 12px }
.avb-md { width: 48px; height: 48px; font-size: 16px }
.avb-lg { width: 160px; height: 160px; font-size: 44px; border: 4px solid #BE7F63 }
.avme { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.avme .btn { margin-left: auto }
.kidname { display: inline-flex; align-items: center; gap: 10px }
.avdlg { width: min(760px, 96vw) }
.avgrid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; padding: 4px 0 8px }
.avleft { text-align: center } .avleft .muted { margin-top: 10px; text-align: left }
.avprev { display: flex; justify-content: center }
.avrow { margin: 0 0 10px } .avlab { font-size: 13px; font-weight: 700; color: #4A575B; margin: 0 0 6px }
.avch { display: flex; flex-wrap: wrap; gap: 6px }
.avsw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(22, 48, 56, .25); cursor: pointer; padding: 0 }
.avsw[aria-pressed="true"] { box-shadow: 0 0 0 3px #BE7F63 }
.avpill { font: 600 13px/1.2 system-ui, -apple-system, sans-serif; padding: 7px 12px; min-height: 36px; border-radius: 999px; border: 1px solid rgba(22, 48, 56, .3); background: #fff; color: #163038; cursor: pointer }
.avpill[aria-pressed="true"] { background: #163038; color: #F6F3EF; border-color: #163038 }
.avsw:focus-visible, .avpill:focus-visible { outline: 2px solid #163038; outline-offset: 2px }
.avmsg { color: #A32D2D; min-height: 1em; margin: 0 }
.avfoot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap }
@media (max-width: 640px) { .avgrid { grid-template-columns: 1fr } .avb-lg { width: 120px; height: 120px } }
#meInit.meav { padding: 0; overflow: hidden } #meInit.meav svg { width: 100%; height: 100%; display: block }
.avleft { padding-left: 8px }
