/* Edupro Study Room, curriculum-first layout: "Exercise Book" design system.
   Loaded after app.css by v2.html. New screens use the x- classes; legacy screens (accounts, teacher, parent, tests...) keep
   working inside the new shell and are re-skinned below under body.v2 until each role has its own redesigned screens.
   Ruled paper with a red margin, subjects as coloured exercise-book covers, the current unit as a sticky note. */
@font-face{font-family:"Patrick Hand";src:url(../assets/fonts/patrick-hand-latin-400.woff2) format("woff2");font-weight:400;font-display:swap}

body.v2{
  --ink:#1B2230; --paper:#FFFDF5; --rule:#C9DDF0; --muted:#56607A; --desk:#D9D3C7; --note:#FFF4B8; --note-ink:#7A5A00;
  --s-maths:#2F6FDB; --s-sci:#1E9E5A; --s-eng:#D6332F; --s-sn:#E57A1F; --s-nd:#8A4FBF; --s-soc:#B8861B; --s-art:#D6428B; --s-ict:#0E8FA3;
  --font-d:"Patrick Hand","Comic Sans MS",cursive; --mx:44px; --nav-h:68px;
  background:var(--desk);color:var(--ink);
}
body.v2 .x-app{max-width:1180px;margin:0 auto;min-height:100vh;position:relative;background:var(--paper);background-image:repeating-linear-gradient(transparent 0 31px,var(--rule) 31px 32px);background-position:0 12px;padding:0 16px calc(var(--nav-h) + 40px) var(--mx);box-shadow:0 0 0 1px rgba(0,0,0,.08)}
body.v2 .x-app::before{content:"";position:absolute;left:calc(var(--mx) - 16px);top:0;bottom:0;width:2px;background:rgba(229,0,30,.5);pointer-events:none}
body.v2 .x-app::after{content:"";position:absolute;left:8px;top:0;bottom:0;width:14px;background:radial-gradient(circle at 7px 40px,var(--desk) 0 5px,transparent 6px) 0 0/14px 120px;pointer-events:none}
@media(min-width:768px){body.v2{--mx:64px}body.v2 .x-app{padding-bottom:48px}}

/* headings and text */
body.v2 h1,body.v2 h2,body.v2 h3,body.v2 h4{font-family:var(--font-d);font-weight:400;text-transform:none;letter-spacing:.01em;line-height:1.1}
body.v2 h1{font-size:clamp(2.1rem,6vw,3.2rem)}
body.v2 .x-sub{color:var(--muted);margin:2px 0 14px}

/* top bar */
.x-top{display:flex;align-items:center;gap:12px;padding:14px 0;min-height:76px;flex-wrap:wrap}
.x-sticker{display:flex;align-items:center;gap:10px;background:#fff;border:2px solid var(--ink);border-radius:6px;padding:6px 12px;transform:rotate(-.6deg);text-decoration:none;color:var(--ink)}
.x-sticker img{height:26px}.x-sticker b{font:400 1.3rem var(--font-d);white-space:nowrap}.x-sticker b span{color:#E5001E}
.x-who{margin-left:auto;text-align:right;font-family:var(--font-d);font-size:1.25rem;line-height:1.1;background:none;border:0;color:var(--ink);text-decoration:none}
.x-who small{display:block;font:400 .85rem var(--font-b);color:var(--muted)}
.x-out{display:inline-flex;align-items:center;gap:6px;min-height:40px;white-space:nowrap}
.x-sync{display:inline-flex;align-items:center;gap:6px;font-size:.8rem;font-weight:700;color:#1E7A46}.x-sync.bad{color:#B8001A}.x-sync.wait{color:var(--note-ink)}
.x-lang{display:flex;gap:4px}.x-lang button{min-width:44px;min-height:36px;border:2px solid var(--ink);border-radius:8px;background:#fff;font-weight:700;font-size:.85rem}.x-lang button[aria-pressed=true]{background:var(--ink);color:#fff}

/* navigation: bottom bookmarks on a phone, left rail on a tablet, wider on a laptop */
.x-nav{position:fixed;left:0;right:0;bottom:0;z-index:40;background:#fff;border-top:2px solid var(--ink);display:grid;grid-auto-flow:column;grid-auto-columns:1fr;padding-bottom:env(safe-area-inset-bottom)}
.x-nav a,.x-nav button{position:relative;border:0;background:transparent;min-height:var(--nav-h);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:400 1.1rem var(--font-d);color:var(--ink);text-decoration:none}
.x-nav [aria-current=page]{color:#E5001E}
.x-nav [aria-current=page]::before{content:"";position:absolute;top:0;left:50%;width:26px;height:14px;background:#E5001E;transform:translateX(-50%);clip-path:polygon(0 0,100% 0,100% 100%,50% 70%,0 100%)}
.x-nav .pill{display:flex;border:0;background:none;width:auto;height:auto;transform:none;position:relative}
.x-nav .pill .i{width:24px;height:24px}
@media(min-width:768px){
  body.v2 .x-shell{display:grid;grid-template-columns:112px minmax(0,1fr);max-width:1280px;margin:0 auto;background:var(--paper)}
  body.v2 .x-shell .x-app{box-shadow:none;margin:0;max-width:none}
  .x-nav{position:sticky;top:0;align-self:start;height:100vh;grid-auto-flow:row;grid-auto-rows:min-content;align-content:start;gap:4px;padding:92px 6px 0;border-top:0;border-right:2px solid var(--ink);z-index:30}
  .x-nav a,.x-nav button{min-height:72px;border-radius:10px}
  .x-nav [aria-current=page]{background:#FFE7E9}.x-nav [aria-current=page]::before{left:0;top:50%;width:14px;height:26px;transform:translateY(-50%);clip-path:polygon(0 0,100% 50%,0 100%)}
}
@media(min-width:1100px){body.v2 .x-shell{grid-template-columns:230px minmax(0,1fr)}.x-nav a,.x-nav button{flex-direction:row;justify-content:flex-start;gap:12px;padding:0 16px;font-size:1.25rem}}

@media(max-width:767px){.x-nav .x-sec{display:none}}
.x-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}h1[tabindex='-1']:focus{outline:none}
.x-nav .l-long{display:none}.x-nav .l-short{display:inline}@media(min-width:1100px){.x-nav .l-long{display:inline}.x-nav .l-short{display:none}}
@media(min-width:768px){.x-nav .x-morebtn{display:none}}

/* the current unit, as a sticky note */
.x-note{position:relative;background:var(--note);border:2px solid var(--ink);border-radius:4px;padding:16px 18px;transform:rotate(-.4deg);box-shadow:3px 4px 0 rgba(0,0,0,.12);margin-top:12px}
.x-note::before{content:"";position:absolute;top:-10px;left:50%;width:70px;height:22px;background:rgba(255,255,255,.65);border:1px solid rgba(0,0,0,.15);transform:translateX(-50%) rotate(2deg)}
.x-note .k{font:400 1rem var(--font-d);letter-spacing:.06em;text-transform:uppercase;color:var(--note-ink)}
.x-note h2{font-size:1.9rem;margin:2px 0 4px}
.x-steps{display:flex;gap:4px;margin:10px 0 14px}.x-steps i{flex:1;height:10px;border:2px solid var(--ink);border-radius:3px;background:#fff}.x-steps i.on{background:var(--s-maths)}.x-steps i.cur{background:#FF0527}
.x-go{display:inline-flex;align-items:center;gap:10px;min-height:54px;padding:0 22px;border:2px solid var(--ink);border-bottom-width:6px;border-radius:12px;background:#E5001E;color:#fff;font:400 1.4rem var(--font-d);text-decoration:none;cursor:pointer;transition:transform .15s var(--ease)}
.x-go:active{transform:translateY(3px);border-bottom-width:3px}.x-go.ghost{background:#fff;color:var(--ink)}
.x-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* cards and lists */
.x-card{background:#fff;border:2px solid var(--ink);border-radius:6px;padding:14px 16px;margin:0 0 16px}
.x-card h3{font-size:1.4rem;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.x-list{list-style:none;margin:0;padding:0}
.x-li{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed var(--rule);text-decoration:none;color:var(--ink);background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:left;font:inherit;cursor:pointer}
.x-li:last-child{border-bottom:0}.x-li .t{flex:1;min-width:0}.x-li b{display:block}.x-li small{color:var(--muted)}
.x-li.soft{opacity:.65}
.x-tag{display:inline-flex;align-items:center;gap:4px;font-size:.8rem;font-weight:700;padding:1px 8px;border:2px solid var(--ink);border-radius:99px;background:#fff;white-space:nowrap}.x-tag.due{background:#FFE1E5}.x-tag.ok{background:#DDF5E6}.x-tag.soon{background:var(--note);border-style:dashed;color:var(--note-ink)}
.x-stat{display:flex;align-items:center;gap:8px;min-height:46px;padding:0 14px;border:2px solid var(--ink);border-radius:99px;background:#fff;font:400 1.3rem var(--font-d)}.x-stat .i{color:#E5001E}
.x-cols{display:grid;gap:16px}
@media(min-width:900px){.x-cols{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);align-items:start}}
.x-bar{display:block;height:8px;border:2px solid var(--ink);border-radius:5px;background:#fff;overflow:hidden}.x-bar i{display:block;height:100%;background:var(--c,var(--s-maths))}
.x-crumb{display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center;font-size:.9rem;color:var(--muted);margin-bottom:2px}.x-crumb a{color:var(--muted);display:inline-flex;align-items:center;min-height:44px;min-width:44px;padding:0 6px;margin:0 -6px}

/* subjects as exercise books (Grades 1-3 and the Subjects grid) */
.x-books{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.x-book{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:170px;padding:12px 12px 12px 22px;background:var(--c);color:#fff;border-radius:3px 12px 12px 3px;border:2px solid var(--ink);text-align:left;text-decoration:none;box-shadow:inset 12px 0 0 rgba(0,0,0,.22),3px 4px 0 rgba(0,0,0,.14);transition:transform .2s var(--ease);cursor:pointer}
.x-book:hover{transform:translateY(-4px) rotate(-1deg)}
.x-book .ic{position:absolute;top:12px;right:12px;width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.22);display:grid;place-items:center}
.x-book .lab{background:#fff;color:var(--ink);border:2px solid var(--ink);border-radius:3px;padding:6px 8px;transform:rotate(-1.2deg)}
.x-book .lab b{display:block;font:400 1.25rem/1.05 var(--font-d)}.x-book .lab small{color:var(--muted);font-size:.85rem}
.x-book .x-bar{margin-top:6px}
.x-book.soon{background:#B9B5AA;--c:#B9B5AA;cursor:default}.x-book.soon:hover{transform:none}
.x-book.soon .lab::after{content:"Coming soon";display:block;margin-top:4px;font-size:.8rem;font-weight:700;color:var(--note-ink);background:var(--note);border:1px dashed var(--note-ink);padding:0 6px;width:max-content}
.x-spine{display:grid;grid-template-columns:14px 34px 1fr auto;gap:12px;align-items:center;padding:10px 14px 10px 0;border:0;border-bottom:1px solid var(--rule);background:#fff;width:100%;text-align:left;text-decoration:none;color:var(--ink);cursor:pointer;font:inherit}
.x-spine::before{content:"";align-self:stretch;background:var(--c)}.x-spine:last-child{border-bottom:0}.x-spine .n{font:400 1.25rem var(--font-d)}.x-spine .ic{color:var(--c)}.x-spine.soon{opacity:.6;cursor:default}
.x-spines{border:2px solid var(--ink);border-radius:6px;overflow:hidden;background:#fff;margin-bottom:16px}

/* mastery chips reuse the existing states */
.x-m{font-size:.75rem;font-weight:700;padding:1px 8px;border:2px solid var(--ink);border-radius:99px}
.x-m.m-not_started{background:#E7EDF2}.x-m.m-learning{background:#DCE8FF}.x-m.m-developing{background:#FFE9DA}.x-m.m-proficient{background:#FFF1BF}.x-m.m-mastered{background:#DDF5E6}

/* unit page */
.x-unit{display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}
@media(min-width:1024px){.x-unit{grid-template-columns:minmax(0,1fr) 420px;align-items:start}.x-unit .x-side{position:sticky;top:16px}}
.x-stage{background:#fff linear-gradient(var(--c,var(--s-sci)),var(--c,var(--s-sci))) top/100% 10px no-repeat;border:2px solid var(--ink);border-radius:6px;padding:22px 12px 12px;overflow:hidden;min-width:0}

/* Grades 1-3: fewer, bigger things; Listen everywhere */
body.v2.young h1{font-size:clamp(2.4rem,9vw,4rem)}
body.v2.young .x-books{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.x-book .lab b{overflow-wrap:anywhere;hyphens:auto}
body.v2.young .x-book{min-height:210px}body.v2.young .x-book .ic{width:64px;height:64px}body.v2.young .x-book .ic .i{width:36px;height:36px}body.v2.young .x-book .lab b{font-size:1.6rem}
body.v2.young .x-note h2{font-size:2.4rem}body.v2.young .x-go{min-height:72px;font-size:1.9rem;padding:0 32px}
body.v2.young .x-li{padding:16px 0}body.v2.young .x-li b{font-size:1.25rem}
body.v2.young .old-only,body.v2:not(.young) .young-only{display:none!important}
.x-listen{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 16px;border:2px solid var(--ink);border-radius:12px;background:#fff;font:400 1.15rem var(--font-d);cursor:pointer}

/* ---- legacy screens inside the new shell: same paper, same ink ---- */
body.v2 .panel,body.v2 .doc,body.v2 .hub-item,body.v2 .card,body.v2 .stage{border-width:2px;border-radius:6px;box-shadow:none;background:#fff}
body.v2 .panel h4,body.v2 .section-h{font-family:var(--font-d)}
body.v2 .panel.daily{background-color:var(--glass-2);background-image:radial-gradient(circle,rgba(255,255,255,.14) 1.6px,transparent 2.2px);background-size:14px 14px;color:#fff}
body.v2 .btn{font-family:var(--font-d);text-transform:none;letter-spacing:.01em;font-size:1.25rem;border-radius:12px}
body.v2 .btn.sm{font-size:1.1rem}
body.v2 .chip,body.v2 .tile,body.v2 .tag,body.v2 .iconbtn{border-width:2px}
body.v2 .lb li{border-width:2px;border-radius:6px;flex-wrap:wrap}
body.v2 .lb li b{flex-wrap:wrap;max-width:100%;margin-left:0}
body.v2 select,body.v2 input:not([type=checkbox]):not([type=radio]){max-width:100%}
body.v2 .info{border-radius:6px}
body.v2 .page{max-width:none}
body.v2 .main{padding:0}
body.v2 .crumb a{color:var(--muted)}
@media print{.x-top,.x-nav{display:none!important}body.v2 .x-app{background:#fff;padding:0}body.v2 .x-app::before,body.v2 .x-app::after{display:none}}
@media(prefers-reduced-motion:reduce){.x-book,.x-go{transition:none}.x-bar i,.x-steps i{transition-duration:.2s!important}}

/* past papers: reference, shared context, diagrams */
.qref{margin:0 0 6px}.qctx{border:2px solid var(--hair);padding:6px 12px;margin:0 0 10px;background:rgba(127,127,127,.07);border-radius:6px}
.qfig{margin:8px 0;max-width:420px;color:var(--ink,#0f172a);overflow-x:auto}.qfig svg{width:100%;height:auto;display:block}
.qtable{border-collapse:collapse;width:100%;font-size:.9rem}.qtable th,.qtable td{border:1.5px solid currentColor;padding:4px 6px;text-align:center}.qfig:has(.qtable){max-width:100%}.qtable th{font-weight:700}
.x-opt-row{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
.qctx,.qfig{min-width:0;max-width:100%;overflow-x:auto}.x-card{min-width:0}.qtable th,.qtable td{padding:3px 4px;font-size:.82rem}
.qtable td:empty,.qtable th:empty{border:0}.qtable caption{font-weight:700;padding:2px 0 4px}
.parts .part{margin:10px 0}.parts .part-h{margin:0 0 4px}.working{border:2px dashed var(--hair);border-radius:6px;padding:4px 10px;margin-top:6px}
.qtips{margin:6px 0 10px;border:2px dashed var(--rule,#cbd5e1);border-radius:10px;padding:6px 12px}.qtips summary{cursor:pointer;font-weight:700}.qtips ul{margin:4px 0 8px 18px}
/* phone: comfortable tap targets for the question numbers and the writing checklist */
.qprog{flex-wrap:wrap}.dotq{min-width:44px;min-height:44px}
.chk-row{display:flex;gap:10px;align-items:center;min-height:44px;margin:0!important}.chk-row input{width:24px;height:24px;flex:none}
/* strand mastery: one stacked bar of its topics (mastered, getting there, learning, not started) */
.x-stack{display:flex;height:12px;border:2px solid var(--ink);border-radius:7px;overflow:hidden;background:#fff}.x-stack i{display:block;height:100%}.x-stack .m{background:#4CBF7C}.x-stack .g{background:#F2C14E}.x-stack .l{background:#F28B9B}
.x-mastery{margin:6px 0 10px}.x-mastery small{display:block;margin-top:4px;color:var(--ink-soft,inherit)}
/* tokens for answer feedback and the two-way sorters (used by activities and the Learn screens) */
:root{--ok-tint:#BBF7D0;--bad-tint:#FECACA;--tint-blue:#DBEAFE;--tint-amber:#FEF3C7}.x-search{width:100%;max-width:420px;min-height:44px;padding:8px 12px;font:inherit;border:2px solid var(--ink);border-radius:6px;background:#fff}
.x-ic-lg{font-size:1.75rem;line-height:1}
.x-pgrid{display:grid;gap:2px 16px;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.x-prow{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px dashed var(--hair)}.x-prow .k{color:var(--ink-2)}.x-prow .v{text-align:right;overflow-wrap:anywhere}

/* subject journeys and trophies (js/v2/journeys.js) */
.x-path{list-style:none;margin:6px 0 0;padding:0 0 0 4px;position:relative}
.x-stop{display:flex;gap:12px;align-items:flex-start;padding:0 0 14px;position:relative}
.x-stop:not(:last-child)::before{content:"";position:absolute;left:17px;top:36px;bottom:-2px;width:4px;background:var(--rule);border-radius:2px}
.x-stop.done:not(:last-child)::before{background:var(--c,var(--s-maths))}
.x-stop .dot{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;border:2px solid var(--ink);background:#fff;font-weight:700;color:var(--muted)}
.x-stop .dot svg{width:20px;height:20px}
.x-stop.done .dot{background:var(--c,var(--s-maths));color:#fff}.x-stop.current .dot{background:var(--note);color:var(--note-ink);box-shadow:0 0 0 3px var(--c,var(--s-maths))}
.x-stop.end .dot{background:#fff;color:var(--muted)}.x-stop.end.done .dot{background:#F2C14E;color:var(--ink)}
.x-stop .t{flex:1;min-width:0}.x-stop .t b{display:block}.x-stop .t small{color:var(--muted)}.x-stop.todo .t b{color:var(--muted)}
.x-journey{border-top:1px dashed var(--rule);padding:8px 0}.x-journey summary{display:flex;gap:12px;align-items:center;cursor:pointer;list-style:none}.x-journey summary::-webkit-details-marker{display:none}
.x-journey summary .t{flex:1;min-width:0}.x-journey summary .t b{display:block}.x-journey summary .t small{color:var(--muted)}
.x-trophy{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:50%;border:2px solid var(--ink);background:#EEF0F4;color:#8A92A6}
.x-trophy svg{width:24px;height:24px}.x-trophy small{font-size:.65rem;font-weight:700;line-height:1}
.x-trophy.won{background:#F2C14E;color:var(--ink);box-shadow:0 0 0 3px var(--c,var(--s-maths))}
.x-shelf{display:flex;gap:14px;flex-wrap:wrap;margin:0 0 16px}.x-shelf-i{display:flex;flex-direction:column;align-items:center;gap:4px;width:84px;text-align:center}.x-shelf-i .x-trophy{width:56px;height:56px}

/* Grade 2 layout (js/v2/grade2.js) */
body.g2 .x-nav a{min-height:64px}
.g2-btn{display:flex;width:100%;min-height:72px;margin:0 0 12px;font-size:1.7rem}.g2-btn small{display:block;font-size:1rem;opacity:.9}
.g2-btn.alt{background:#fff;color:var(--ink)}
.g2-note{background:var(--note,#FFF4B8)}.g2-note small{display:block;text-transform:uppercase;letter-spacing:.06em;color:var(--note-ink,#7A5A00)}.g2-note b{display:block;font:400 1.9rem var(--font-d);line-height:1.15;margin:2px 0 12px}.g2-note .g2-btn{margin:0}
.g2-dot{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;border:2px solid var(--ink);background:#fff;font-weight:700;color:var(--muted)}.g2-dot svg{width:20px;height:20px}
.g2-dot.ok{background:var(--s-sci);color:#fff}.g2-dot.cur{background:var(--note,#FFF4B8);color:var(--note-ink,#7A5A00);box-shadow:0 0 0 3px var(--s-maths)}
.g2-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 0}
.g2-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:132px;padding:12px;background:#fff;border:2px solid var(--ink);border-radius:10px;box-shadow:0 6px 0 var(--c);margin-bottom:6px;color:var(--ink);text-decoration:none;text-align:center}
.g2-tile svg{width:44px;height:44px;color:var(--c)}.g2-tile b{font:400 1.6rem var(--font-d)}.g2-tile small{color:var(--muted)}
.g2-stars{display:flex;gap:8px;justify-content:center;margin:16px 0}.g2-star svg{width:40px;height:40px;color:var(--rule);fill:none}.g2-star.on svg{color:#E5001E;fill:#E5001E}
body.g2 .opts .opt{min-height:68px;font-size:1.4rem}
.x-stop a.t{text-decoration:none;color:var(--ink);min-height:48px}.x-stop a.t small{display:block}
.g2-tile .x-bar{width:80%;max-width:160px}.g2-extras .g2-tile{min-height:96px}

.g2-learn{display:flex;align-items:center;gap:14px;box-shadow:0 6px 0 var(--c)}.g2-learn-ic{flex:none;display:grid;place-items:center;width:72px;height:72px;border-radius:50%;border:2px solid var(--ink);background:#fff;color:var(--c)}.g2-learn-ic svg{width:40px;height:40px}.g2-learn h3{margin:0 0 8px}
.g2-can{list-style:none;margin:0 0 16px;padding:0}.g2-can li{display:flex;gap:12px;align-items:flex-start;font-size:1.25rem;padding:8px 0;border-bottom:1px dashed var(--rule)}.g2-can svg{flex:none;width:28px;height:28px;color:var(--s-sci)}

.g2-h{font:400 1.5rem var(--font-d);margin:22px 0 0}.g2-extras .g2-tile{min-height:72px;flex-direction:row;gap:12px;box-shadow:0 4px 0 var(--c)}.g2-extras .g2-tile svg{width:32px;height:32px}.g2-extras .g2-tile b{font-size:1.35rem}
.opt.right{background:#BBF7D0;border-color:#1E9E5A;color:var(--ink)}.opt.wrong{background:#FECACA;border-color:#D6332F;color:var(--ink)}.opt:disabled{cursor:default;opacity:1}
.fb{display:flex;gap:12px;align-items:flex-start;margin:14px 0 0;padding:12px 14px;border:2px solid var(--ink);border-radius:10px;font-size:1.2rem}.fb.ok{background:#BBF7D0}.fb.bad{background:#FEF3C7}.fb svg{flex:none;width:30px;height:30px}.fb b{font-size:1.3rem}

.g2-syl{margin:18px 0 0;padding:10px 14px;border:2px dashed var(--rule);border-radius:8px;color:var(--muted);font-size:.95rem}.g2-syl summary{cursor:pointer;font-weight:700;color:var(--ink)}.g2-syl code{font-size:.85rem;background:#EEF0F4;padding:1px 5px;border-radius:4px}.g2-syl ul{margin:4px 0 0 18px;padding:0}

/* study notes on the topic page (js/v2/notes.js) */
.nt{border-top:8px solid var(--c);padding-top:14px}
.nt-h{display:flex;align-items:center;justify-content:space-between;gap:10px}.nt-h h3{margin:0}
.nt h4{font:400 1.25rem var(--font-d);margin:16px 0 6px;color:var(--c)}
.nt-fig{margin:12px 0 4px;background:#fff;border:2px solid var(--ink);border-radius:10px;padding:6px;box-shadow:3px 4px 0 rgba(0,0,0,.1)}
.nt-fig svg{display:block;width:100%;height:auto;max-height:300px}
.nt-ideas{margin:0;padding-left:1.4em}.nt-ideas li{margin:0 0 8px;line-height:1.45;padding-left:2px}.nt-ideas li::marker{color:var(--c);font-weight:700}
.nt-words{margin:0;display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.nt-words>div{background:color-mix(in srgb,var(--c) 10%,#fff);border:2px solid var(--ink);border-radius:8px;padding:8px 10px}
.nt-words dt{font:400 1.1rem var(--font-d);color:var(--c);filter:brightness(.8)}.nt-words dd{margin:2px 0 0;font-size:.95rem;line-height:1.35}
.nt-ex{border:2px dashed var(--ink);border-radius:8px;padding:2px 12px 8px;background:#fff;margin-top:12px}.nt-ex h4{margin-top:10px}.nt-ex p{margin:4px 0;line-height:1.5}
.nt-tip{position:relative;background:var(--note);border:2px solid var(--ink);border-radius:4px;padding:10px 14px;margin:14px 0 2px;box-shadow:3px 4px 0 rgba(0,0,0,.12);color:var(--note-ink);line-height:1.45}
.nt-fig{cursor:zoom-in}.nt-fig:focus-visible{outline:3px solid var(--c);outline-offset:2px}.nt-hint{margin:2px 0 0;font-size:.8rem;color:var(--muted)}
.nt-zoom{position:fixed;inset:0;z-index:9999;background:rgba(27,34,48,.92);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:8px}
.nt-zoombox{width:100%;max-width:900px;background:#fff;border:3px solid var(--ink);border-radius:12px;padding:8px}.nt-zoombox svg{display:block;width:100%;height:auto;max-height:80vh}
.nt-x{align-self:flex-end;background:#fff}
@media(min-width:768px){.nt-hint{display:none}}
/* the enlarged diagram is wider than a phone screen on purpose: scroll sideways to read it at a comfortable size */
.nt-zoombox{overflow:auto;-webkit-overflow-scrolling:touch;max-height:86vh}.nt-zoombox svg{min-width:540px;max-height:none}.nt-slide{margin:0;color:#fff;font-size:.9rem;text-align:center}
@media(min-width:768px){.nt-zoombox svg{min-width:0;max-height:80vh}.nt-slide{display:none}}

/* ---- parent dashboard (js/v2/parent.js) ---- */
.pd-strip{gap:12px;margin:14px 0}
.pd-child .x-stat{min-width:90px!important}
.pd-note{overflow-wrap:anywhere;margin:10px 0 0;padding:10px 12px;border:2px solid var(--ink);border-radius:6px;background:var(--note);color:var(--note-ink);font-weight:600}
.pd-empty{text-align:left;max-width:560px}
.pd-kv{display:flex;gap:10px;justify-content:space-between;align-items:baseline;padding:6px 0;border-bottom:1px dashed var(--line,rgba(0,0,0,.2))}
.pd-kv .k{color:var(--muted,#555)}.pd-kv .v{text-align:right;overflow-wrap:anywhere}
.pd-ref{font-family:var(--font-d);letter-spacing:.08em;font-size:1.15rem;padding:0 6px;border:2px dashed var(--ink);border-radius:4px}
.pd-how{padding-left:1.3em;margin:8px 0 12px}.pd-how li{margin:6px 0}
.pd-steps{display:flex;gap:6px;list-style:none;margin:14px 0;padding:0;flex-wrap:wrap}
.pd-steps li{display:flex;align-items:center;gap:6px;font-size:.85rem;opacity:.6}
.pd-steps li.cur,.pd-steps li.done{opacity:1;font-weight:700}
.pd-steps .n{display:inline-flex;width:24px;height:24px;border:2px solid var(--ink);border-radius:50%;align-items:center;justify-content:center;font-size:.8rem}
.pd-steps li.done .n{background:var(--ink);color:var(--paper,#fff)}.pd-steps li.done .n .i{width:14px;height:14px}
.pd-steps li:not(:last-child)::after{content:"";width:14px;border-top:2px solid var(--ink);opacity:.4}
.pd-bars{display:flex;gap:6px;align-items:flex-end;margin-top:12px}.pd-bars>div{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}.pd-bars i{display:block;width:100%;border-radius:3px 3px 0 0;min-height:3px}.pd-bars small{font-size:.75rem}

.pd-chart{margin:14px 0;overflow-x:auto}.pd-chart svg{max-width:100%;height:auto;border:1px solid var(--line,#E3E7ED);border-radius:6px}

/* sign-in (js/account.js): Show sits inside the password field; switch links are plain links with a 44px hit area */
.fld.pw{position:relative;display:block}.fld.pw label{display:flex;flex-direction:column;margin:0;font-weight:700;font-size:17px}.fld.pw input{padding-right:84px}
.pw-show{position:absolute;right:6px;bottom:4px;min-height:40px;min-width:64px;padding:0 12px;border:2px solid var(--ink);border-radius:8px;background:var(--paper,#fff);font:inherit;font-weight:700;cursor:pointer}
.authbox a.go{display:inline-block;padding:12px 4px;min-height:44px;box-sizing:border-box}
.authbox summary{cursor:pointer;min-height:44px;display:flex;align-items:center}
body.x-authpage .x-nav,body.x-authpage .x-who,body.x-authpage .x-out{display:none!important}body.x-authpage .x-app{padding-bottom:24px}

body.x-authpage .x-shell { display: block !important; max-width: 1180px; margin: 0 auto; } body.x-authpage .x-shell .x-app { max-width: 620px; margin: 0 auto; box-shadow: none; }

.x-back{display:none;align-items:center;gap:6px;min-height:40px;white-space:nowrap}body:not(.x-ishome):not(.x-authpage) .x-back{display:inline-flex}
.x-searchbox{padding:14px}.x-searchbox .x-search{width:100%;min-height:48px;font-size:1.05rem}.x-found{margin:8px 0 0}.x-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* the helpdesk line at the foot of every screen (js/helpdesk.js) */
body.v2 .x-help{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:28px 0 8px;padding:12px 14px;border:2px dashed var(--ink);border-radius:10px;background:#fff;font-size:.95rem}
body.v2 .x-hneed{font-family:var(--font-d);font-size:1.15rem}
body.v2 .x-hlinks{display:flex;flex-wrap:wrap;gap:8px}
body.v2 .x-hbtn{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:2px solid var(--ink);border-radius:8px;background:var(--note);color:var(--ink);font-weight:700;text-decoration:none}
body.v2 .x-hbtn:hover,body.v2 .x-hbtn:focus-visible{background:var(--ink);color:#fff}
body.v2 .x-hhours{color:var(--muted);font-size:.85rem;width:100%}
@media print{body.v2 .x-help{display:none}}

/* Dzidzo chat helper (js/assistant.js) */
.x-chat-fab{position:fixed;right:16px;bottom:calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));z-index:45;display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 18px;border:2px solid var(--ink);border-radius:999px;background:#E5001E;color:#fff;font:400 1.2rem var(--font-d);box-shadow:0 3px 10px rgba(0,0,0,.18);cursor:pointer}
.x-chat-fab svg{width:22px;height:22px}
.x-chat-fab:focus-visible,.x-chat button:focus-visible,.x-chat-in:focus-visible{outline:3px solid #1B66C9;outline-offset:2px}
.x-chat{position:fixed;z-index:60;right:16px;left:16px;bottom:calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));top:72px;display:flex;flex-direction:column;background:#fff;color:var(--ink);border:2px solid var(--ink);border-radius:14px;box-shadow:0 8px 28px rgba(0,0,0,.22);overflow:hidden}
.x-chat[hidden],.x-chat-fab[hidden]{display:none}
.x-chat-head{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 14px;border-bottom:2px solid var(--ink);background:var(--note)}
.x-chat-head strong{flex:1;display:flex;align-items:center;gap:6px;font:400 1.35rem var(--font-d)}
.x-chat-head svg{width:20px;height:20px}
.x-chat-x{min-width:44px;min-height:44px;border:0;background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}
.x-chat-log{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.x-chat-msg{max-width:88%;padding:10px 12px;border-radius:12px;line-height:1.45;overflow-wrap:anywhere}
.x-chat-msg p{margin:0 0 6px}.x-chat-msg p:last-child{margin-bottom:0}
.x-chat-msg ol,.x-chat-msg ul{margin:4px 0 6px;padding-left:22px}
.x-chat-msg.bot{align-self:flex-start;background:#F2F5FA;border:1px solid var(--rule)}
.x-chat-row{display:flex;align-items:flex-start;gap:8px;align-self:flex-start;max-width:94%}
.x-chat-row .x-chat-msg{max-width:none;min-width:0;flex:1}
.x-chat-face{flex:none;width:32px;height:32px;border-radius:50%;margin-top:2px;padding:0;object-fit:cover;box-sizing:border-box;background:#FFF4B8;border:1.5px solid var(--ink)}
.x-chat-head-face{width:34px;height:34px;border-radius:50%;vertical-align:middle;padding:2px;box-sizing:border-box;background:#FFF4B8;border:1.5px solid var(--ink)}
.x-chat-fab-face{width:36px;height:36px;border-radius:50%;margin-left:-8px;padding:0;object-fit:cover;box-sizing:border-box;background:#FFF4B8;border:1.5px solid #fff}
.x-chat-msg.me{align-self:flex-end;background:var(--ink);color:#fff}
.x-chat-msg.wait{color:var(--muted);font-style:italic}
.x-chat-sugg{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.x-chat-lbl{width:100%;font-size:.85rem;color:var(--muted);font-weight:700}
.x-chat-sugg .chip{min-height:44px;padding:6px 12px;border:2px solid var(--ink);border-radius:999px;background:#fff;color:var(--ink);font-size:.95rem;cursor:pointer;text-align:left}
.x-chat-err{margin:0 12px;color:#B00020;font-weight:700}.x-chat-err:empty{display:none}
.x-chat-form{display:flex;gap:8px;padding:10px 12px 4px;border-top:1px solid var(--rule)}
.x-chat-in{flex:1;min-width:0;min-height:44px;max-height:120px;resize:none;padding:10px 12px;border:2px solid var(--ink);border-radius:10px;font:inherit}
.x-chat-send{min-width:48px;min-height:44px;display:grid;place-items:center}
.x-chat-note{margin:0;padding:2px 12px 10px;font-size:.8rem;color:var(--muted)}
.x-chat-sugg .chip svg,.x-chat-rb svg{width:16px;height:16px;vertical-align:-3px;margin-right:4px}
.x-chat-msg.small{font-size:.85rem;color:var(--muted);background:transparent;border:0;padding:2px 4px}
.x-chat-msg.ok{border-color:#1E7F4F;background:#EAF7EF}
.x-chat-msg.no{border-color:#B3541E;background:#FFF3EA}
.x-chat-opts{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.x-chat-opts .chip{display:block;width:100%;min-height:44px;padding:8px 12px;border:2px solid var(--ink);border-radius:10px;background:#fff;color:var(--ink);font-size:1rem;text-align:left;cursor:pointer}
.x-chat-msg .x-chat-sugg{margin-top:8px}
.x-chat-rate{display:flex;gap:8px;margin-top:8px}
.x-chat-why{display:block;color:var(--muted);font-size:.85rem}
.x-chat-help{display:flex;gap:8px;padding:6px 12px 0;flex-wrap:wrap}
.x-chat-help[hidden]{display:none}
.x-chat-helpb{min-height:36px;font-size:.9rem}
.x-chat-world{display:block;width:100%;max-width:340px;height:auto;margin-top:8px;border:2px solid var(--ink,#1b1410);border-radius:12px}
.x-chat-mic{min-width:44px;min-height:44px;display:grid;place-items:center}
.x-chat-mic[hidden]{display:none}
.x-chat-mic.on{color:#e5001e;border-color:#e5001e}
.x-chat-rb{min-height:36px;padding:4px 10px;border:1px solid var(--rule);border-radius:999px;background:#fff;color:var(--muted);font-size:.85rem;cursor:pointer}
.x-chat-rb:hover{color:var(--ink);border-color:var(--ink)}
.x-chat-rated,.x-chat-en{margin:6px 0 0;font-size:.8rem;color:var(--muted)}
.x-chat-links{margin:6px 0 0;padding-left:20px}.x-chat-links a{color:#1B66C9;font-weight:700}
.x-chat-contact{display:flex;flex-direction:column;gap:8px;max-width:100%;width:100%}
.x-chat-contact .x-chat-err{margin:0}
.x-chat-msg img,.x-chat-msg svg.fig{max-width:100%;height:auto}
@media (min-width:768px){
  .x-chat-fab{bottom:20px;right:20px}
  .x-chat{left:auto;width:400px;top:auto;height:min(620px,calc(100vh - 40px));bottom:20px;right:20px}
}
@media print{.x-chat,.x-chat-fab{display:none}}
/* Dzidzo's pop-up when a child opens the app (js/assistant.js peek): a speech bubble above the chat button */
.x-chat-peek{position:fixed;right:16px;bottom:calc(var(--nav-h) + 76px + env(safe-area-inset-bottom));z-index:46;display:flex;gap:10px;align-items:flex-start;max-width:min(340px,calc(100vw - 32px));padding:14px 38px 14px 12px;border:2px solid var(--ink);border-radius:20px;background:#fff;box-shadow:4px 4px 0 var(--ink);font-size:1.05rem;line-height:1.4;animation:x-peek .35s ease-out}
.x-chat-peek[hidden]{display:none}
.x-chat-peek::after{content:"";position:absolute;right:34px;bottom:-12px;width:20px;height:20px;background:#fff;border-right:2px solid var(--ink);border-bottom:2px solid var(--ink);transform:rotate(45deg)}
.x-chat-peek-face{flex:0 0 auto;width:48px;height:48px;border-radius:50%;padding:0;object-fit:cover;box-sizing:border-box;background:#FFF4B8;border:2px solid var(--ink)}
.x-chat-peek-body p{margin:0 0 8px}
.x-chat-peek-acts{display:flex;flex-wrap:wrap;gap:8px}
.x-chat-peek-acts .btn{min-height:44px}
.x-chat-peek-x{position:absolute;top:6px;right:6px;width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.x-chat-peek-x svg{width:18px;height:18px}
@keyframes x-peek{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.x-chat-peek{animation:none}}
/* Tino's avatar (js/tino-avatar.js): the photo, with movement and small effects for each state. Gentle moves only; none with reduced motion. */
.tino-wrap{display:inline-flex;flex:none;width:46px;height:46px}
.tino{position:relative;display:block;width:100%;height:100%}
.tino-photo{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;box-sizing:border-box;border:2px solid var(--ink);background:#FFF4B8;transition:transform .35s cubic-bezier(.3,1.4,.5,1),box-shadow .3s}
.x-chat-head .tino-fx-layer,.tino-fx-layer{position:absolute;left:-18%;top:-18%;width:136%;height:136%;overflow:visible;pointer-events:none}
.tino .tino-fx{opacity:0;transition:opacity .2s;transform-box:fill-box;transform-origin:center}
.tino[data-state=thinking] .tino-dots,.tino[data-state=celebrating] .tino-stars,.tino[data-state=welcoming] .tino-wave,.tino[data-state=goodbye] .tino-wave,
.tino[data-state=encouraging] .tino-heart,.tino[data-state=curious] .tino-q,.tino[data-state=surprised] .tino-bang,.tino[data-state=excited] .tino-spark,.tino[data-state=playful] .tino-spark{opacity:1}
.tino[data-state=thinking] .tino-photo,.tino[data-state=listening] .tino-photo,.tino[data-state=encouraging] .tino-photo{transform:rotate(-5deg)}
.tino[data-state=curious] .tino-photo{transform:rotate(6deg)}
.tino[data-state=listening] .tino-photo{transform:rotate(-5deg) scale(1.04)}
.tino[data-state=celebrating] .tino-photo,.tino[data-state=excited] .tino-photo{box-shadow:0 0 0 3px #F2C14E}
.tino[data-state=encouraging] .tino-photo{box-shadow:0 0 0 3px #F7A8A0}
.tino.tino-talk .tino-photo{animation:tino-ring .7s ease-in-out infinite alternate}
.tino.tino-go[data-state=welcoming] .tino-photo,.tino.tino-go[data-state=goodbye] .tino-photo{animation:tino-wiggle .5s ease-in-out 3}
.tino.tino-go[data-state=welcoming] .tino-wave,.tino.tino-go[data-state=goodbye] .tino-wave{animation:tino-blink-fx .5s ease-in-out 3 alternate}
.tino.tino-go[data-state=celebrating] .tino-photo,.tino.tino-go[data-state=excited] .tino-photo{animation:tino-hop .45s ease-out 2}
.tino.tino-go[data-state=celebrating] .tino-stars{animation:tino-pop .6s ease-out}
.tino.tino-go[data-state=excited] .tino-spark,.tino.tino-go[data-state=playful] .tino-spark{animation:tino-twinkle .8s ease-in-out infinite alternate}
.tino.tino-go[data-state=surprised] .tino-photo{animation:tino-boing .45s ease-out 1}
.tino.tino-go[data-state=surprised] .tino-bang,.tino.tino-go[data-state=curious] .tino-q{animation:tino-pop .4s ease-out}
.tino.tino-go[data-state=thinking] .tino-dots circle{animation:tino-dot 1.2s ease-in-out infinite}
.tino.tino-go[data-state=thinking] .tino-dots circle:nth-child(2){animation-delay:.2s}.tino.tino-go[data-state=thinking] .tino-dots circle:nth-child(3){animation-delay:.4s}
.tino.tino-go[data-state=encouraging] .tino-photo{animation:tino-nod 2.4s ease-in-out 2}
.tino.tino-go[data-state=encouraging] .tino-heart{animation:tino-beat 1.2s ease-in-out 3}
.tino.tino-go[data-state=playful] .tino-photo{animation:tino-wiggle 1.4s ease-in-out infinite}
.tino.tino-go[data-state=explaining] .tino-photo{animation:tino-sway 3s ease-in-out infinite}
.tino.tino-go[data-state=happy] .tino-photo{animation:tino-breathe 3.2s ease-in-out infinite}
@keyframes tino-ring{from{box-shadow:0 0 0 0 rgba(242,193,78,.0)}to{box-shadow:0 0 0 4px rgba(242,193,78,.85)}}
@keyframes tino-wiggle{0%,100%{transform:rotate(0)}25%{transform:rotate(-7deg)}75%{transform:rotate(7deg)}}
@keyframes tino-blink-fx{from{opacity:.35}to{opacity:1}}
@keyframes tino-hop{0%,100%{transform:translateY(0)}40%{transform:translateY(-6px)}}
@keyframes tino-boing{0%{transform:scale(1)}40%{transform:scale(1.12)}100%{transform:scale(1)}}
@keyframes tino-pop{0%{transform:scale(.4);opacity:0}60%{opacity:1}100%{transform:scale(1)}}
@keyframes tino-twinkle{from{transform:scale(.8);opacity:.6}to{transform:scale(1.1);opacity:1}}
@keyframes tino-dot{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes tino-nod{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(-5deg) translateY(2px)}}
@keyframes tino-beat{0%,100%{transform:scale(1)}50%{transform:scale(1.2)}}
@keyframes tino-sway{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2deg)}}
@keyframes tino-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.025)}}
@media (prefers-reduced-motion:reduce){.tino,.tino *{animation:none!important;transition:none!important}}
.x-chat-headbits{display:contents}
/* Tino's "What shall we do?" menu: one colourful button that opens a drop-down of things to do (in place of rows of suggestions) */
.x-chat-help{position:relative;display:block;padding:8px 12px 2px}
.x-chat-menubtn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 16px;border-radius:999px;border:2px solid var(--ink);background:#E5001E;color:#fff;font:700 15px inherit;box-shadow:0 3px 0 var(--ink);cursor:pointer}
.x-chat-menubtn svg{width:18px;height:18px}
.x-chat-menubtn:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.x-chat-menubtn.glow{animation:x-chat-glow 1.8s ease-in-out infinite}
@keyframes x-chat-glow{50%{transform:translateY(-2px);box-shadow:0 5px 0 var(--ink),0 0 0 5px rgba(229,0,30,.3)}}
.x-chat-menubtn:hover{background:#C4001A}
.x-chat-menu{position:absolute;left:10px;right:10px;bottom:calc(100% + 4px);display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px;background:#fff;border:2px solid var(--ink);border-radius:18px;box-shadow:0 14px 34px rgba(0,0,0,.2);max-height:min(360px,55vh);overflow:auto;z-index:6}
.x-chat-menu[hidden]{display:none}
.x-chat-tile{display:flex;align-items:center;gap:8px;min-height:48px;padding:8px 10px;border-radius:14px;border:1.5px solid rgba(0,0,0,.14);background:var(--tc,#FFF0BF);color:#1b2230;font:600 14px/1.2 inherit;text-align:left;cursor:pointer}
.x-chat-tile svg{width:22px;height:22px;flex:none}
.x-chat-tile:hover,.x-chat-tile:focus-visible{border-color:var(--ink);transform:translateY(-1px)}
.x-chat-hint{margin:4px 14px 8px;color:var(--muted,#5a6070);font-size:.92rem}
.x-chat-hw{display:block;max-width:180px;max-height:180px;border-radius:10px;margin:0 0 6px;object-fit:cover}
@media (prefers-reduced-motion:reduce){.x-chat-menubtn.glow{animation:none}}

/* Tino chat, v209: the cream "study buddy" look (header with a red name, a big welcome, ideas in a 2 x 2 grid, a red-edged message bar) */
.x-chat{background:#fff;--tino-red:#D7262E}
.x-chat-head{gap:12px;padding:10px 10px 10px 14px;background:#fff;border-bottom:1px solid #EEE}
.x-chat-head .tino-wrap{width:54px;height:54px}
.x-chat-head .tino-photo,.x-chat-head-face{border:3px solid var(--tino-red);box-shadow:0 2px 8px rgba(215,38,46,.18)}
.x-chat-head-face{width:54px;height:54px;padding:0;object-fit:cover}
.x-chat-title{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.15}
.x-chat-title strong{font:800 1.55rem var(--font-d);color:var(--tino-red)}
.x-chat-sub{font-size:.92rem;color:#7a6a5c}
.x-chat-grade{flex:none;padding:6px 14px;border:1.5px solid #E7CFC0;border-radius:999px;background:#fff;font-weight:700;font-size:.95rem}
.x-chat-head .btn.ghost{border-radius:999px}
.x-chat-log{background:#fff;padding:14px}
.x-chat-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:6px 4px 4px}
.x-chat-hero-face{width:132px;height:132px;border-radius:50%;object-fit:cover;border:4px solid var(--tino-red);box-shadow:0 6px 22px rgba(215,38,46,.22);background:#FFF4B8}
.x-chat-hero h2{margin:10px 0 2px;font:800 1.6rem var(--font-d);color:#2a1d14}
.x-chat-hero>p{margin:0;max-width:34em;color:#6d5d50;line-height:1.5}
.x-chat-starts{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;margin-top:14px}
.x-chat-starts .chip{display:flex;align-items:center;gap:6px;min-height:52px;padding:10px 14px;border:1.5px solid #E3E3E3;border-radius:16px;background:#fff;color:#2a1d14;font-size:1rem;font-weight:600;text-align:left;cursor:pointer;transition:border-color .15s,transform .15s}
.x-chat-starts .chip:hover,.x-chat-starts .chip:focus-visible{border-color:var(--tino-red);transform:translateY(-1px)}
.x-chat-starts .chip svg{width:18px;height:18px;flex:none;color:var(--tino-red)}
.x-chat-hero .x-chat-hint{margin:10px 0 0}
.x-chat-msg.bot{background:#F4F6FA;border:1px solid #E6E9EF}
.x-chat-msg.me{background:var(--tino-red);color:#fff}
.x-chat-face{border:2px solid var(--tino-red)}
.x-chat-sugg .chip{border:1.5px solid #E3E3E3;background:#fff}
.x-chat-sugg .chip:hover{border-color:var(--tino-red)}
.x-chat-form{align-items:center;margin:6px 12px 2px;padding:6px 6px 6px 14px;border:2px solid var(--tino-red);border-radius:999px;background:#fff}
.x-chat-form .x-chat-in{border:0;padding:10px 4px;background:transparent;outline:none}
.x-chat-form:focus-within{box-shadow:0 0 0 3px rgba(215,38,46,.18)}
.x-chat-send{min-height:44px;padding:0 22px;border:0;border-radius:999px;background:var(--tino-red);color:#fff;font:700 1.05rem inherit;cursor:pointer}
.x-chat-send:hover{background:#B81E25}
.x-chat-form:not(:focus-within) .x-chat-send{background:#EFA3A6}
.x-chat-mic{border:0;background:transparent;border-radius:50%}
.x-chat-note{text-align:center}
@media (max-width:420px){.x-chat-starts{grid-template-columns:1fr}.x-chat-hero-face{width:108px;height:108px}.x-chat-grade{display:none}}
@media (min-width:768px){.x-chat{width:520px;height:min(700px,calc(100vh - 40px))}}

/* v212: the menu as modern cards: white, a thin edge, a soft shadow, the icon in a muted colour square */
.x-chat-menu{background:#fff;border:1px solid #E4E6EA;border-radius:18px;box-shadow:0 16px 40px rgba(20,24,32,.16)}
.x-chat-tile{gap:10px;min-height:56px;padding:8px 10px;border:1px solid #E8EAEE;border-radius:14px;background:#fff;color:#2B3140;font-weight:600;box-shadow:0 1px 2px rgba(20,24,32,.06);transition:box-shadow .15s,transform .15s,border-color .15s}
.x-chat-tile:hover,.x-chat-tile:focus-visible{border-color:#D5D9E0;box-shadow:0 6px 16px rgba(20,24,32,.10);transform:translateY(-1px)}
.x-chat-ticon{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--tc,#EEF0F3);color:var(--ti,#4A5568)}
.x-chat-ticon svg{width:20px;height:20px}
/* the chat is a page of a Study Room exercise book: ruled blue lines and a red margin, lines move with the messages */
.x-chat-log{background-color:var(--paper,#FFFDF5);background-image:linear-gradient(90deg,transparent 30px,rgba(229,0,30,.45) 30px 32px,transparent 32px),repeating-linear-gradient(transparent 0 31px,var(--rule,#C9DDF0) 31px 32px);background-attachment:local;padding-left:42px}
.x-chat-hero .x-chat-md{max-width:30em;margin-top:8px;color:var(--ink);line-height:1.55;font-size:1.02rem}
.x-chat-hero .x-chat-md p{margin:0}
/* no pink anywhere: the Send button stays Study Room red, the focus ring is a soft grey */
.x-chat-form:not(:focus-within) .x-chat-send{background:var(--tino-red)}
.x-chat-form:focus-within{box-shadow:0 0 0 3px rgba(21,17,14,.10)}
.x-chat-hero .x-chat-hint{margin:14px 0 0;font-size:1.1rem;font-weight:600;color:var(--ink)}
.x-chat-hero{padding-top:24px}
.x-pdfmenu{position:relative}.x-pdfmenu>summary{list-style:none;cursor:pointer}.x-pdfmenu>summary::-webkit-details-marker{display:none}
.x-pdfmenu-list{position:absolute;left:0;white-space:nowrap;z-index:20;margin-top:4px;display:flex;flex-direction:column;gap:6px;padding:8px;background:#fff;border:2px solid var(--ink);border-radius:12px;min-width:190px}
.x-pdfmenu-list .x-go{justify-content:flex-start;width:100%}
.x-li .x-pdfmenu-list,.x-card h3~.x-pdfmenu .x-pdfmenu-list{left:auto;right:0}
