/* Family portal layout from mock-up v49 (stone + petrol, dark menu on the left). Loaded after site.css on /home only. */
body.pt {
  --bg: #DAD2C9; --rail: #163038; --surface: #E5DFD7; --sunk: #D3CAC0; --line: #C2B8AD;
  --ink: #182528; --muted: #424D50; --rail-ink: #E6E2DC; --rail-hover: rgb(246 243 239 / .10); --rail-act: #C7C0B9; --on-rail-act: #152528;
  --act: #163038; --on-act: #F6F3EF; --accent-text: #7C4F49;
  --ok: #2E6A4F; --ok-bg: #E3EFE7; --pending: #6B5B95; --pending-bg: #ECE8F4; --alert: #A8432A; --alert-bg: #F7E3DC;
  --r: 14px;
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "DM Sans", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased;
}
body.pt .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh }
body.pt .app[hidden] { display: none }
.rail { background: var(--rail); padding: 28px 16px 20px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh }
.rail .logo { display: block; width: 108px; margin: 0 auto 2px } .rail .logo img { width: 100%; height: auto; display: block }
body.pt .eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); font-weight: 500 }
.rail .eyebrow { color: #C7C0B9; padding-left: 14px }
.rail nav { display: grid; gap: 4px }
.rail nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--rail-ink); font-size: 15px; text-decoration: none }
.rail nav a:hover { background: var(--rail-hover) }
.rail nav a[aria-current="page"] { background: var(--rail-act); color: var(--on-rail-act) }
.rail nav a[hidden] { display: none }
.rail .count { margin-left: auto; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 99px; background: #C2532C; color: #fff; font-weight: 700 }
.rail .count[hidden] { display: none }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6 }
.rail .foot { margin-top: auto; display: grid; gap: 12px }
.rail .me { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #C7C0B9 } .rail .me b { display: block; color: #F6F4EF; font-weight: 500 }
.railbtn { border: 1px solid rgb(246 243 239 / .25); background: none; color: var(--rail-ink); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; text-align: left }
.railbtn:hover { background: var(--rail-hover) }
body.pt .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--ink); font-weight: 600; font-size: 13px; flex: none }
body.pt .avatar.photo { background: url('/img/joshi.jpg') center / cover; width: 52px; height: 52px } body.pt .avatar.photo.big { width: 84px; height: 84px }

.ptmain { min-width: 0; padding: 22px 36px 40px }
body.pt .head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin: 18px 0 24px }
body.pt h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 6px; font-weight: 700; letter-spacing: -.01em }
body.pt h2 { font-size: 17px; margin: 0; font-weight: 600 }
body.pt .lead { color: var(--muted); margin: 0; max-width: 62ch }
body.pt .btn { border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; color: var(--ink); text-decoration: none; cursor: pointer }
body.pt .btn:hover { border-color: var(--ink) }
body.pt .btn.primary { background: var(--act); color: var(--on-act); border-color: var(--act) }
body.pt .btn.small { padding: 6px 12px; font-size: 13px }
body.pt .btn.ghost { border-color: transparent; background: none; padding-inline: 8px; color: var(--muted) }
body.pt .steps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
body.pt .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; min-width: 0 }
body.pt .grid { display: grid; gap: 18px }
body.pt .cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr) }
body.pt .stack { display: grid; gap: 18px; align-content: start; min-width: 0 }
body.pt .muted { color: var(--muted) } body.pt .small { font-size: 13px } .m0 { margin: 0 } .mb4 { margin-bottom: 4px }
body.pt .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--sunk); color: var(--muted); white-space: nowrap }
body.pt .chip.ok { background: var(--ok-bg); color: var(--ok) } body.pt .chip.pending { background: var(--pending-bg); color: var(--pending) } body.pt .chip.alert { background: var(--alert-bg); color: var(--alert) }
.next { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center }
.next .time { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1 } .next .time small { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 6px }
.next h2 { margin-top: 2px }
.grouph { display: flex; gap: 8px; align-items: center; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 18px 0 8px }
body.pt .list { display: grid }
body.pt .row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line) }
body.pt .row:first-child { border-top: 0 }
body.pt .row .t { font-weight: 600; font-variant-numeric: tabular-nums } body.pt .row .t span { display: block; font-weight: 400; font-size: 12px; color: var(--muted) }
body.pt .row .d { min-width: 0 } body.pt .row .d p { margin: 2px 0 0; font-size: 13px; color: var(--muted) }
.empty { color: var(--muted); font-size: 13px; margin: 0 }
.calbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px }
.ltop { display: flex; gap: 12px; align-items: center }
.avail { margin-top: 14px; font-size: 13px } .avail ul { list-style: none; padding: 0; margin: 4px 0 0; font-variant-numeric: tabular-nums } .avail li span { display: inline-block; min-width: 64px; color: var(--muted) }
.kids { display: flex; gap: 8px; margin-bottom: 6px }
.ptfoot { margin-top: 40px; font-size: 12px; color: var(--muted) } .ptfoot a { color: inherit }
body.pt .thread { max-height: 52vh }
@media (max-width: 900px) {
  body.pt .app { grid-template-columns: 1fr }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px }
  .rail .logo { width: 44px; margin: 0 } .rail .eyebrow { display: none }
  .rail nav { display: flex; overflow-x: auto; gap: 2px; order: 3; width: 100% } .rail nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px }
  .rail .foot { margin: 0 0 0 auto; display: flex; align-items: center } .rail .me { display: none }
  .ptmain { padding: 16px }
  body.pt .cols-main { grid-template-columns: 1fr }
}
body.pt .rail .eyebrow { color: #C7C0B9 }
@media (max-width: 900px) { body.pt .app { grid-template-columns: minmax(0, 1fr) } .rail { min-width: 0 } .rail nav { min-width: 0 } }
/* Lessons offered by Joshi (28 Oct, mock-up v49): Needs your approval; Join on the next lesson */
body.pt .offers { display: grid; gap: 10px }
body.pt .offer { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1.5px dashed var(--pending); border-radius: 12px; background: var(--pending-bg) }
body.pt .offer .t { font-weight: 600; font-variant-numeric: tabular-nums } body.pt .offer .t span { display: block; font-weight: 400; font-size: 12px; color: var(--muted) }
body.pt .offer .d p { margin: 2px 0 0; font-size: 13px; color: var(--muted) }
body.pt .next:has(.joinbox:not(:empty)) { grid-template-columns: auto minmax(0, 1fr) auto }
body.pt .joinbox { display: grid; gap: 4px; justify-items: center; text-align: center } body.pt .joinbox .hint { font-size: 12px; color: var(--muted) } body.pt .joinbox .live { font-size: 12px; color: var(--ok); font-weight: 600 }
@media (max-width: 640px) { body.pt .offer { grid-template-columns: 64px minmax(0, 1fr) } body.pt .offer .steps { grid-column: 1 / -1 } body.pt .next:has(.joinbox:not(:empty)) { grid-template-columns: auto minmax(0, 1fr) } body.pt .joinbox { grid-column: 1 / -1; justify-items: start } }
/* Spec v1 (29 Oct): the menu fits short windows; the links scroll, Log out always stays in view */
@media (min-width: 901px) { .rail nav { flex: 0 1 auto; min-height: 0; overflow-y: auto } .rail { overflow: hidden; box-sizing: border-box } }
body.pt .preview { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; border-radius: 12px; background: var(--pending-bg); color: var(--pending); font-size: 14px; font-weight: 500; margin-bottom: 8px }
body.pt.readonly main button:not(.keep), body.pt.readonly main form { pointer-events: none; opacity: .55 }
body.pt.readonly main a:not(.keep) { pointer-events: none }
.preview:has(#previewText[data-mode="manage"]) { background: var(--alert-bg) !important; color: var(--alert) !important }
/* short screens (e.g. 1280×720): the whole family menu fits without scrolling */
@media (min-width: 901px) and (max-height: 820px) { .rail { gap: 12px; padding-top: 20px } .rail .logo { width: 80px } .rail nav { gap: 2px } .rail nav a { padding: 8px 14px } .rail .foot { gap: 8px } }
body.pt .kids .btn[aria-pressed="true"] { background: var(--act); color: var(--on-act); border-color: var(--act) }
/* Welcome (signed up, not registered yet) · Joshi 29 Oct */
body.pt .choose { display: grid; grid-template-columns: 1fr 1fr; gap: 18px } body.pt .choose .card { display: grid; gap: 10px; align-content: start }
body.pt .choose .chip { justify-self: start } body.pt .ch { font: 400 24px/1.2 Georgia, "Times New Roman", serif }
body.pt .cl { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px }
@media (max-width: 900px) { body.pt .choose { grid-template-columns: 1fr } }
/* Joshi 31 Oct: Log out only as wide as its word (it touched the rail edge) */
.rail .foot .railbtn { justify-self: start; width: auto }
/* Joshi 3 Nov: no blank screen. The menu column and page frame show at once; "Loading…" until the data arrives. */
.boot { display: flex; align-items: center; gap: 10px; color: #5F6B6D; font-size: 15px; padding: 48px 0 }
.boot .spin { width: 18px; height: 18px; border: 2px solid #CFC6BA; border-top-color: #163038; border-radius: 50%; animation: stspin .8s linear infinite }
@keyframes stspin { to { transform: rotate(360deg) } }
.app.booting #nav:empty { display: block; min-height: 460px; background: repeating-linear-gradient(to bottom, rgb(255 255 255 / .07) 0 54px, transparent 54px 66px); border-radius: 12px }
.app.booting #meName:empty::before { content: ''; display: inline-block; width: 110px; height: 12px; border-radius: 6px; background: rgb(255 255 255 / .14) }
.app.booting #meInit:empty { background: rgb(255 255 255 / .14) }
/* Joshi 4 Nov: change password while logged in (every portal page) */
.pwform { margin-top: 18px }
.pwform .pwh { margin: 0 0 10px; font-size: 1rem }
.pwgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px }
.pwgrid .f { display: grid; gap: 5px; margin: 0 }
.pwgrid .f > span { font-size: .85rem; font-weight: 600 }
.pwform .in.bad { border-color: #B3261E; box-shadow: 0 0 0 2px rgb(179 38 30 / .2) }
.pwmsg { margin: 8px 0 0; min-height: 1.2em } .pwmsg.bad { color: #B3261E } .pwmsg.good { color: #2E6B4F; font-weight: 600 }
@media (max-width: 700px) { .pwgrid { grid-template-columns: 1fr } }
/* Joshi 4 Nov 12:47: every tab bar in the portals looks the same — folder tabs; the open tab and its panel are one piece
   (#F4F0EA), inactive tabs darker. The tabs stay put and only the panel scrolls (scroll bar on hover). */
body.pt .ftabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 0; position: relative; z-index: 1; border: 0 }
body.pt .ftabs.ftabs > button, body.pt .ftabs.ftabs > a { margin: 0 0 -1px; padding: 9px 18px; min-height: 0; border: 1px solid #BFB4A7; border-bottom: 0; border-radius: 10px 10px 0 0; background: #D8CFC4; color: #4E5A5C; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; box-shadow: none; cursor: pointer }
body.pt .ftabs.ftabs > button:hover, body.pt .ftabs.ftabs > a:hover { background: #E2DAD0; color: #182528 }
body.pt .ftabs.ftabs > :is([aria-selected="true"], .on), body.pt .ftabs.ftabs > :is([aria-selected="true"], .on):hover { /* stays the panel colour under the mouse too */ background: #F4F0EA; color: #182528; border-bottom: 1px solid #F4F0EA }
body.pt .head:has(.ftabs), body.pt .ptmain:has(> .qotd.topq:not([hidden])) .head:has(.ftabs) { margin-bottom: 0; min-height: 0 }
body.pt .head:has(.ftabs) .lead { margin-bottom: 0 }
body.pt .tabpanel { background: #F4F0EA; border: 1px solid #BFB4A7; border-radius: 0 14px 14px 14px; padding: 22px 24px; margin-top: -1px }
body.pt .tabpanel > .card, body.pt .tabpanel > * > .card, body.pt .tabpanel .cols-main > .stack > .card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0 0 22px; border-radius: 0 }
body.pt .tabpanel .tsep { border-top: 1px solid #E2DAD0; margin: 6px 0 22px }
@media (min-width: 900px) {
  body.pt .tabpanel { max-height: calc(100vh - var(--tp-top, 230px)); overflow-y: auto; scrollbar-width: none }
  body.pt .tabpanel:hover { scrollbar-width: thin; scrollbar-color: #C9C0B5 transparent }
  body.pt .tabpanel::-webkit-scrollbar { width: 0 } body.pt .tabpanel:hover::-webkit-scrollbar { width: 8px }
  body.pt .tabpanel::-webkit-scrollbar-thumb { background: #C9C0B5; border-radius: 8px }
}
body.pt .tabpanel .panelbar { display: flex; justify-content: flex-end; margin: -6px 0 14px }
body.pt .ftabs.ftabs { flex-wrap: nowrap; width: max-content; max-width: calc(100vw - 340px) } /* one row, may run under the quote area */

/* Joshi 16 Nov: a teal heading ribbon and alternate row shading on every list, in all three portals */
body.pt .card.rb { padding: 0 14px 12px; overflow: hidden }
body.pt .card.rb > h2:first-child { background: var(--rail); color: #fff; font-size: 17px; font-weight: 700; margin: 0 -14px 8px; padding: 12px 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
body.pt .card.rb > h2:first-child :is(.muted, small, span, a) { color: #fff; opacity: .85 }
body.pt .card.rb > p { margin: 4px 4px 8px }
body.pt .card.rb .list > .row { padding: 13px 12px; border-top: 0; border-radius: 10px }
body.pt .card.rb .list > .row:nth-child(even) { background: #DBD2C8 }
body.pt .card.rb > .bk-row, body.pt .card.rb > .bk-group > .bk-row { padding: 11px 12px; border-bottom: 0; border-radius: 10px }
body.pt .card.rb > .bk-row:nth-child(odd):not(.offer) { background: #DBD2C8 }
body.pt .card.rb .empty, body.pt .card.rb .bk-empty { padding: 8px 4px }
body.pt table.tbl:not(.sgrid):not(.chtbl) tr:first-child th { background: var(--rail); color: #fff; font-size: 13px; padding: 10px 8px; border-bottom: 0 }
body.pt table.tbl:not(.sgrid):not(.chtbl) tr:first-child th:first-child { border-radius: 10px 0 0 10px } body.pt table.tbl:not(.sgrid):not(.chtbl) tr:first-child th:last-child { border-radius: 0 10px 10px 0 }
body.pt table.tbl:not(.sgrid):not(.chtbl) tr:nth-child(odd):not(:first-child):not(.tot) td { background: #DBD2C8 }
body.pt table.tbl tr.rc-refund td { color: var(--muted); font-size: 13px }
body.pt .bk-kid { display: inline-block; background: #EDE8E1; border: 1px solid #CDC4BA; color: var(--ink); border-radius: 20px; padding: 1px 10px; margin-right: 8px; font-size: 13px; font-weight: 600; vertical-align: 1px }
body.pt table.tbl td.nowrap { white-space: nowrap }
/* Joshi 17 Nov: lesson states on the family dashboard */
body.pt .bk-live { color: var(--ok); font-weight: 600 }
body.pt .bk-ended { color: var(--ok); font-weight: 600 }
body dialog.dlg.notedlg { background: #F4F1EC } body dialog.dlg.notedlg:focus { outline: none } body dialog.dlg.notedlg textarea { width: 100%; margin-top: 4px } body dialog.dlg.notedlg .steps { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px }
body.pt .rc-saved { display: block; color: #356D4A; font-weight: 600; font-size: 12px; white-space: nowrap }
/* Joshi 18 Nov: statement controls beside the child filter */
body.pt .rcbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px }
body.pt .rcbar .rcfilter { margin: 0 } body.pt .rcstate { display: flex; gap: 8px; align-items: center; margin-left: auto } body.pt .rcper { width: auto; padding: 8px 10px }
body.pt .rcstate .bk-btn { white-space: nowrap }
body.pt table.tbl td.rc-cr { color: #356D4A; font-weight: 600 }
