/* Masar v131 · Simpler Today, Plan and Friends. Colours come only from the theme variables, so every theme
   (light, night and the colour skins) stays readable. */

/* ---------- Today: summary + 3 cards; the old cards are folded away (still in "More for today") ---------- */
html.m132 body[data-tab="today"] #nextcard,
html.m132 body[data-tab="today"] #hero,
html.m132 body[data-tab="today"] #m62route,
html.m132 body[data-tab="today"] #m62goal,
html.m132 body[data-tab="today"] #m60chk,
html.m132 body[data-tab="today"] #m62row,
html.m132 body[data-tab="today"] #m106tm,
html.m132 body[data-tab="today"] #m40qotd,
html.m132 body[data-tab="today"] #m124,
html.m132 body[data-tab="today"] #m108p,
html.m132 body[data-tab="today"] #m108q,
html.m132:not(.m132coach) body[data-tab="today"] #m100card{display:none!important}
html.m132.m132coach body[data-tab="today"] #m100card{order:-6!important}
html.m132 body[data-tab="today"] .lanes > .lane.t:not(:has(> :not(#m62route))){display:none}
.m132sum,.m132card{display:none}
html.m132 body[data-tab="today"] .m132sum,html.m132 body[data-tab="today"] .m132card{display:block}
html.m132 body[data-tab="today"] .m132more[hidden]{display:none}
/* order inside the Today column: welcome note, summary, tasks, review, progress, more */
html.m132 body[data-tab="today"] #m61w1{order:-12!important}
html.m132 body[data-tab="today"] #m132cd,html.m132 body[data-tab="month"] #m132cd{order:-11!important}
html.m132 body[data-tab="today"] #m132sum{order:-9!important}
html.m132 body[data-tab="today"] #m74note{order:-8!important}
html.m132 body[data-tab="today"] #tasks{order:-7!important}
html.m132 body[data-tab="today"] #m132rev{order:-6!important}
html.m132 body[data-tab="today"] #m132pro{order:-5!important}
html.m132 body[data-tab="today"] #m132more{order:-4!important}

.m132sum{padding:20px 22px!important}
.m132top{display:flex;align-items:center;gap:16px;justify-content:space-between}
.m132tt{display:flex;flex-direction:column;gap:2px;min-width:0}
.m132date{font-size:13px;color:var(--mute);font-weight:600}
.m132big{font-size:22px;line-height:1.25;color:var(--ink);font-weight:800}
.m132left{font-size:14px;color:var(--mute)}
.m132ring{--p:0;flex:0 0 auto;width:58px;height:58px;border-radius:50%;display:grid;place-items:center;
  background:conic-gradient(var(--acc) calc(var(--p) * 1%),var(--sunk) 0)}
.m132ring b{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--card);color:var(--ink);font-size:13px;font-weight:800}
.m132bar{height:8px;border-radius:99px;background:var(--sunk);overflow:hidden;margin-top:14px}
.m132bar i{display:block;height:100%;border-radius:inherit;background:var(--acc);transition:width .4s ease}
.m132go{display:flex;align-items:center;gap:12px;margin-top:16px;flex-wrap:wrap}
.m132next{display:flex;flex-direction:column;min-width:0;flex:1 1 180px;color:var(--ink);font-weight:700;font-size:16px}
.m132next small{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--acc-ink);font-weight:700}
.m132next bdi{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m132start{flex:1 1 220px;min-height:48px;border-radius:14px!important;font-weight:700}

.m132card{padding:18px 20px!important}
.m132h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:4px}
.m132h h3{margin:0;font-size:18px;color:var(--ink)}
.m132lbl{font-size:12px;color:var(--mute);font-weight:600}
.m132sub{margin:0 0 10px;font-size:14px;color:var(--mute);line-height:1.6}
.m132row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin-top:8px;padding:12px 14px;
  border:1px solid var(--line);border-radius:14px;background:var(--sunk);color:var(--ink);font:inherit;text-align:start;cursor:pointer}
.m132row:hover{border-color:var(--acc-line)}
.m132row:focus-visible,.m132mh:focus-visible,.m132fh:focus-visible,.m132sprint .cal-h:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.m132rt{display:flex;flex-direction:column;gap:2px;min-width:0}
.m132rt b{font-size:15px;color:var(--ink)}
.m132rt small{font-size:13px;color:var(--mute);line-height:1.5}
.m132n{flex:0 0 auto;min-width:34px;height:34px;padding:0 10px;border-radius:99px;display:grid;place-items:center;background:var(--acc);color:var(--on-acc);font-weight:800;font-size:15px}
.m132row.ok .m132n{background:transparent;color:var(--good);border:1px solid var(--line)}
.m132sec{margin-top:12px}
.m132sl{display:flex;justify-content:space-between;gap:10px;font-size:14px}
.m132sl b{color:var(--ink)}
.m132sl span{color:var(--mute)}
.m132sec .m132bar{margin-top:6px}
.m132goal{display:flex;justify-content:space-between;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);font-size:14px;color:var(--ink);font-weight:600}
.m132goal span+span{color:var(--mute);font-weight:500}
.m132link{margin-top:12px;padding:0;border:0;background:none;color:var(--acc-ink);font:inherit;font-weight:700;font-size:14px;cursor:pointer}
.m132mh{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;cursor:pointer}
.m132mh b{font-size:17px}
.m132chev{flex:0 0 auto;color:var(--mute);font-size:22px;line-height:1;transition:transform .2s ease}
.m132more .m132ml{display:none}
.m132more.open .m132ml{display:block;margin-top:6px}
.m132more.open .m132mh .m132chev{transform:rotate(90deg)}
@media (max-width:600px){.m132big{font-size:19px}.m132sum,.m132card{padding:16px!important}}

/* ---------- Plan: calendar first, one month at a time; Sprint Method folded ---------- */
html.m132 body[data-tab="month"] .m132cal{order:-3!important}
html.m132 body[data-tab="month"] #m38emp{order:-2!important}
html.m132 body[data-tab="month"] .m132sprint{order:-1!important}
html.m132 #cal .cell.m132hide{display:none}
html.m132 #cal .cell.m132dim{opacity:.35}
.m132nav{display:flex;align-items:center;gap:6px}
.m132nb{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:18px;line-height:1;cursor:pointer}
.m132nb:disabled{opacity:.35;cursor:default}
.m132mn{min-width:130px;text-align:center;font-size:15px;color:var(--ink)}
/* busy days: a calm row, not a red warning box */
html.m132 body[data-tab="month"] #m38emp{border:1px solid var(--line)!important;background:var(--card)!important;color:var(--ink)!important;padding:12px 16px!important}
html.m132 body[data-tab="month"] #m38emp *{color:inherit}
.m132fold.m132sprint .cal-h{cursor:pointer;margin-bottom:0}
.m132fold.m132sprint .cal-h .lbl{margin-inline-start:auto}
.m132fold.m132sprint:not(.open) > :not(.cal-h){display:none!important}
.m132fold.m132sprint.open .cal-h{margin-bottom:12px}
.m132fold.open > .cal-h .m132chev,.m132frow.open .m132fh .m132chev{transform:rotate(90deg)}

/* ---------- Friends: no empty Requests card, Community first, two equal cards, then one-line rows ---------- */
html.m132 body[data-tab="friends"] #m66inv.m66empty{display:none!important}
html.m132 body[data-tab="friends"] #m62friends{align-items:stretch}
html.m132 body[data-tab="friends"] #m62friends > #m65hub{grid-column:1/-1}
/* Study together sits next to Study buddy (same row, same height); the once-only cards go last as one-line rows */
html.m132 body[data-tab="friends"] #m62friends > #m103card{order:8!important}
html.m132 body[data-tab="friends"] #m62friends > #m64inv{order:60!important;grid-column:1/-1}
html.m132 body[data-tab="friends"] #m62friends > #m63join{order:61!important;grid-column:1/-1}
html.m132 body[data-tab="friends"] #m62friends > #m63pa{order:62!important;grid-column:1/-1}
html.m132 body[data-tab="friends"] #m62bud,html.m132 body[data-tab="friends"] #m103card{height:auto;display:flex;flex-direction:column}
html.m132 body[data-tab="friends"] #m62bud > :last-child,html.m132 body[data-tab="friends"] #m103card > :last-child{margin-top:auto}
.m132frow{padding:14px 18px!important}
.m132frow .m132fh{display:flex!important;align-items:center;gap:10px;cursor:pointer;margin:0!important}
.m132frow .m132fh > :not(.m132chev){flex:1 1 auto}
.m132fh .m132chev,.m132sprint .cal-h .m132chev{margin-inline-start:auto}
[dir="rtl"] .m132fold.open > .cal-h .m132chev,[dir="rtl"].m132frow.open .m132fh .m132chev,[dir="rtl"] .m132frow.open .m132fh .m132chev{transform:rotate(-90deg)}
.m132frow:not(.open) > :not(.m132fh){display:none!important}
.m132frow.open > .m132fh{margin-bottom:10px!important}

/* ---------- Header: nothing overlaps, nothing breaks over three lines ---------- */
html.m132 #m70btn,html.m132 #m61tgb{white-space:nowrap}
html.m132 #m61trow{flex-wrap:wrap}
@media (min-width:601px){html.m132:not(.wide) header.bar{flex-wrap:wrap}html.m132:not(.wide) header.bar > .ttl{flex:1 1 100%}html.m132:not(.wide) #m61trow{width:auto}}
/* phone: the fixed chat button sits in the top corner, so the header row leaves room for it */
@media (max-width:600px){html.m132 header.bar > .nav,html.m132 header.bar > .m40streak{margin-inline-end:0}html.m132 header.bar{padding-right:42px!important;column-gap:8px!important}html.m132 header.bar > .nav{gap:2px!important}}

/* ---------- Sync status: never shown to anyone, admin included, from the first paint (owner, 2026-12-02).
   Saving and the other-device check run the same way in the background. ---------- */
#syncpill,#sbsync{display:none!important}

/* ---------- Countdown: big and centred on Today, with Hide. Four tiles; each number slides in when it changes ---------- */
.m132cd{display:none}
html.m132 body[data-tab="today"] .m132cd,html.m132 body[data-tab="month"] .m132cd{display:flex;flex-direction:column;align-items:stretch;gap:14px;padding:18px 20px 18px!important}
html.m132.m132cdon body[data-tab="today"] #m48cd,html.m132.m132cdon body[data-tab="month"] #m48cd{display:none!important}
.m132cdh{display:flex;align-items:center;justify-content:space-between;gap:10px}
.m132cdk{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;color:var(--ink)}
.m132cdk svg{width:22px;height:19px;color:var(--acc);flex:0 0 auto}
.m132cdn{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1.6vw,14px)}
.m132cdu{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:clamp(12px,2vw,18px) 4px clamp(10px,1.6vw,14px);
  border-radius:18px;background:var(--sunk);border:1px solid var(--line)}
.m132cdu b{position:relative;display:block;width:100%;height:1.1em;overflow:hidden;text-align:center;
  font-size:clamp(34px,6.4vw,54px);line-height:1.1;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.m132cdu b span{position:absolute;inset:0}
.m132cdu b span.in{animation:m132in .42s cubic-bezier(.2,.8,.2,1) both}
.m132cdu b span.out{animation:m132out .42s cubic-bezier(.2,.8,.2,1) both}
@keyframes m132in{from{transform:translateY(45%);opacity:0;filter:blur(6px)}to{transform:none;opacity:1;filter:none}}
@keyframes m132out{from{transform:none;opacity:1;filter:none}to{transform:translateY(-45%);opacity:0;filter:blur(6px)}}
.m132cdu.ud b{color:var(--acc)}
.m132cdu small{margin-top:6px;font-size:13px;font-weight:600;color:var(--mute)}
.m132cdd{align-self:center;font-size:14px;color:var(--mute);font-weight:600;text-align:center}
.m132cdt{display:none;text-align:center;font-weight:800;font-size:18px;color:var(--acc-ink)}
.m132cd.done .m132cdn,.m132cd.done .m132cdd{display:none}
.m132cd.done .m132cdt{display:block}
.m132cdx{padding:6px 12px;border-radius:99px;border:1px solid var(--line);background:var(--card);color:var(--mute);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.m132cdx:hover{color:var(--ink)}
.m132cdx:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
@media (max-width:600px){.m132cdu{border-radius:14px}.m132cdu small{font-size:12px}}
@media (prefers-reduced-motion:reduce){.m132cdu b span.in,.m132cdu b span.out{animation:none}.m132cdu b span.out{display:none}}
/* alone on its own row, centred, never beside another card (owner, 2026-12-02) */
html.wide .grid > .m132cd{width:100%;margin:0 0 18px;box-sizing:border-box}
html.wide .grid > .m132cd .m132cdu b{font-size:clamp(44px,4.6vw,68px)}
html.m132 body[data-tab="today"] .m132cd,html.m132 body[data-tab="month"] .m132cd{padding:22px clamp(18px,3vw,32px) 20px!important}

/* ---------- No plan yet: one locked card, nothing else on Today and Plan ---------- */
.m132lock{display:none}
html.m132nop body[data-tab="today"] .grid > :not(#m132lock),
html.m132nop body[data-tab="month"] .grid > :not(#m132lock){display:none!important}
html.m132nop body[data-tab="today"] #m132lock,html.m132nop body[data-tab="month"] #m132lock{
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px;
  min-height:min(62vh,560px);padding:clamp(28px,5vw,56px) clamp(20px,5vw,56px)!important;box-sizing:border-box}
.m132lart{position:relative;width:clamp(96px,14vw,132px);color:var(--acc);animation:m132rise .9s cubic-bezier(.2,.8,.2,1) both}
.m132lart > svg{display:block;width:100%;height:auto;opacity:.9}
.m132lk{position:absolute;right:-10px;bottom:-8px;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  background:var(--card);border:1px solid var(--line);color:var(--ink);box-shadow:0 6px 18px -10px rgba(0,0,0,.35)}
.m132lk svg{width:22px;height:22px}
.m132lh{margin:10px 0 0;font-size:clamp(28px,4.4vw,44px);line-height:1.1;font-weight:800;letter-spacing:-.03em;color:var(--ink)}
.m132lp{margin:0;max-width:34em;font-size:16px;line-height:1.7;color:var(--mute)}
.m132lb{margin-top:8px;min-width:min(100%,280px);min-height:54px;padding:0 28px;border:0;border-radius:16px;background:var(--acc);color:var(--on-acc,#fff);
  font:inherit;font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 14px 30px -16px rgba(var(--acc-rgb,45,91,255),.8)}
.m132lb:hover{filter:brightness(1.05)}
.m132lb:focus-visible{outline:3px solid var(--acc-line,var(--acc));outline-offset:3px}
.m132ls{font-size:13px;color:var(--mute);font-weight:600}
@keyframes m132rise{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.m132lart{animation:none}}

/* Masar v132 · One look on every page (owner approved, 2026-12-02).
   Loaded last. Visual only: nothing is hidden or moved. Colours come only from the theme variables,
   so light, night and every colour skin stay readable. */

/* ---------- One segmented switch (Paper/Practice/Adaptive, Weekly/Monthly, RW/Math, Mistakes/Marked) ---------- */
html .m38seg,html .qb-seg,html .m42psw,html .m107seg{
  display:inline-flex;gap:4px;padding:4px;border-radius:14px;border:1px solid var(--line);
  background:var(--sunk);box-shadow:none}
html .m38seg button,html .qb-seg button,html .m42psw button,html .m107seg .m107tab{
  border:0;background:transparent;color:var(--mute);opacity:1;box-shadow:none;
  font-family:inherit;font-size:14.5px;font-weight:600;line-height:1;padding:10px 16px;border-radius:10px;
  cursor:pointer;white-space:nowrap;transition:background .15s ease,color .15s ease}
html .m38seg button:hover,html .qb-seg button:hover,html .m42psw button:hover,html .m107seg .m107tab:hover{color:var(--ink)}
html .m38seg button.on,html .qb-seg button[aria-pressed=true],html .m42psw button[aria-pressed=true],html .m107seg .m107tab.on{
  background:var(--acc);color:var(--on-acc,#fff);box-shadow:none}
html .m38seg button:focus-visible,html .qb-seg button:focus-visible,html .m42psw button:focus-visible,html .m107seg .m107tab:focus-visible{
  outline:2px solid var(--acc);outline-offset:2px}
html .m38seg.sm button{padding:8px 12px;font-size:13px}

/* ---------- No card inside a card ---------- */
/* Progress: Badges, weak skills and the skill map sit inside the big progress card: one card, divided by lines */
html #m38week > .card{border:0!important;border-top:1px solid var(--line)!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;padding-inline:0!important;margin-inline:0!important}
/* Question Bank: the two subject tiles stand on the page, not inside another box */
html #m35qb.card{border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important}

/* ---------- Hard mode: a calm card like the others (the warm gradient looked like an ad) ---------- */
html #m71hard.card{background:var(--card)!important;background-image:none!important}
html #m38week > .card:first-child{border-top:0!important;padding-top:0!important}

/* plan builder: full test day picker reads as choices, not as days off */
.m38pe .m132td button{opacity:1}
