/* Custom Study Modules: shared design system */
:root{
  --bg:#f7f6f2; --panel:#ffffff; --ink:#1c1b1a; --muted:#6b6862; --line:#e4e1da;
  --accent:#3b5bdb; --accent-soft:#e8edfb;
  --row:#fde68a; --row-strong:#d97706;
  --col:#bfdbfe; --col-strong:#2563eb;
  --cell:#bbf7d0; --cell-strong:#16a34a;
  --bad:#fecaca; --bad-strong:#dc2626;
  --shape:#7c3aed; --shape-soft:rgba(124,58,237,.35);
  --a:#d97706; --b:#2563eb; --c:#16a34a; --d:#7c3aed; --e:#db2777;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif}
.app{display:flex;min-height:100vh}
nav.side{width:256px;flex:none;border-right:1px solid var(--line);background:#fbfaf7;padding:22px 14px;position:sticky;top:0;height:100vh;overflow:auto}
nav.side h1{font-size:17px;margin:2px 10px 4px;letter-spacing:-.01em}
nav.side .sub{font-size:12px;color:var(--muted);margin:0 10px 16px}
nav.side a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;color:var(--ink);text-decoration:none;font-size:14px;line-height:1.25}
nav.side a:hover{background:#f0eee8}
nav.side a.active{background:var(--accent-soft);color:var(--accent);font-weight:600}
nav.side a .n{width:22px;height:22px;border-radius:50%;border:1.5px solid #cfcbc2;display:grid;place-items:center;font-size:11px;flex:none;color:var(--muted)}
nav.side a.done .n{background:var(--cell-strong);border-color:var(--cell-strong);color:#fff}
nav.side .hub{display:block;font-size:12px;color:var(--muted);margin:0 10px 14px;text-decoration:none}
nav.side .hub:hover{color:var(--accent)}
nav.side .reset{margin:18px 10px 0;font-size:12px;color:var(--muted);background:none;border:0;cursor:pointer;text-decoration:underline;padding:0}
main{flex:1;padding:40px 52px 90px;max-width:1040px;min-width:0}
section{display:none}
section.active{display:block;animation:fade .25s ease}
@keyframes fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);font-weight:700;margin:0 0 6px}
h2{font-size:32px;margin:0 0 8px;letter-spacing:-.015em;line-height:1.15}
.lead{color:var(--muted);font-size:17px;margin:0 0 22px}
h3{font-size:19px;margin:36px 0 10px}
h4{font-size:15px;margin:18px 0 6px}
p{margin:8px 0}
ul,ol{margin:8px 0;padding-left:22px}
li{margin:3px 0}
.card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px 22px;margin:14px 0}
.card.tint{background:#fbfaf6}
.card h4:first-child{margin-top:0}
.note{background:var(--accent-soft);border-radius:10px;padding:12px 16px;margin:12px 0;font-size:15px}
.note b{color:var(--accent)}
.warn{background:#fff4e5;border-radius:10px;padding:12px 16px;margin:12px 0;font-size:15px}
.warn b{color:#b45309}
.formula{text-align:center;font-size:18px;padding:14px 10px;margin:12px 0;background:#fbfaf6;border:1px solid var(--line);border-radius:12px}
.formula .cap{display:block;font-size:14px;color:var(--muted);margin-top:8px}
.legend{display:flex;gap:18px;flex-wrap:wrap;font-size:14px;margin:8px 0}
.legend span{display:inline-flex;align-items:center;gap:7px}
.dot{width:14px;height:14px;border-radius:4px;display:inline-block;flex:none}
.swatch{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:middle;margin-right:4px}
kbd{font:12px ui-monospace,Menlo,monospace;background:#eee;border:1px solid #d5d2ca;border-bottom-width:2px;border-radius:5px;padding:1px 6px}
code{font:14px ui-monospace,SFMono-Regular,Menlo,monospace;background:#efede7;padding:1px 5px;border-radius:4px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.muted{color:var(--muted)}
.small{font-size:14px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
.xf{display:grid;grid-template-columns:minmax(300px,480px) 1fr;gap:24px;align-items:start}
@media (max-width:980px){.two,.xf{grid-template-columns:1fr}}
@media (max-width:760px){.app{display:block}nav.side{position:static;height:auto;width:auto;border-right:0;border-bottom:1px solid var(--line)}main{padding:24px 18px 60px}}

/* math */
mjx-container{font-size:105%}
mjx-container[display="true"]{margin:6px 0!important}
.tex{white-space:nowrap}

/* matrices and vectors (from the matrix module) */
.mat{display:inline-grid;gap:6px 12px;padding:8px 16px;position:relative;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:17px;vertical-align:middle}
.mat::before,.mat::after{content:"";position:absolute;top:0;bottom:0;width:9px;border:2px solid var(--ink);pointer-events:none}
.mat::before{left:0;border-right:0;border-radius:3px 0 0 3px}
.mat::after{right:0;border-left:0;border-radius:0 3px 3px 0}
.mat.det::before,.mat.det::after{width:2px;border-top:0;border-bottom:0;border-radius:0}
.cell{min-width:36px;height:36px;display:grid;place-items:center;border-radius:6px;padding:0 5px;transition:background .18s,transform .18s;white-space:nowrap}
input.cell{border:1px solid var(--line);background:#fff;text-align:center;font:inherit;width:60px;outline:none;padding:0 4px}
input.cell:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.cell.hl-row{background:var(--row)}
.cell.hl-col{background:var(--col)}
.cell.hl-cell{background:var(--cell)}
.cell.dim{opacity:.35}
.cell.now{outline:2.5px solid var(--ink);transform:scale(1.08)}
.cell.ok{background:var(--cell);border-color:var(--cell-strong)}
.cell.bad{background:var(--bad);border-color:var(--bad-strong)}
.matwrap{display:inline-flex;flex-direction:column;align-items:center;gap:5px;margin:6px 10px;vertical-align:middle}
.matlabel{font-size:13px;color:var(--muted);font-family:ui-monospace,Menlo,monospace}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.row.center{justify-content:center}
.op{font-size:22px;margin:0 8px;font-family:ui-monospace,Menlo,monospace}
.tag{display:inline-block;font-size:12px;padding:2px 8px;border-radius:99px;background:#eee;color:var(--muted);font-family:ui-monospace,Menlo,monospace}

/* controls */
.btn{font:600 14px/1 inherit;padding:10px 14px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer;transition:background .12s,transform .05s;text-decoration:none;display:inline-block}
.btn:hover{background:#f3f1ec}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.primary:hover{background:#3350c4}
.btn.small{padding:7px 10px;font-size:13px}
.btn[disabled]{opacity:.45;cursor:default}
.btn.on{background:var(--ink);color:#fff;border-color:var(--ink)}
input.num{width:74px;font:inherit;padding:7px 8px;border:1px solid var(--line);border-radius:8px;text-align:center;outline:none;background:#fff}
input.num.wide{width:170px;text-align:left}
input.num.xwide{width:300px;text-align:left}
input.num:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
input.num.ok{background:var(--cell);border-color:var(--cell-strong)}
input.num.bad{background:var(--bad);border-color:var(--bad-strong)}
select{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff}
label.chk{font-size:14px;display:inline-flex;align-items:center;gap:6px}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff;vertical-align:middle}
.stepper button{border:0;background:none;width:30px;height:32px;cursor:pointer;font-size:16px}
.stepper button:hover{background:#f0eee8}
.stepper span{min-width:26px;text-align:center;font-family:ui-monospace,Menlo,monospace;font-weight:600}
.pager{display:flex;justify-content:space-between;margin-top:44px;padding-top:20px;border-top:1px solid var(--line)}
.choice{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.choice .btn.picked{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:14px 0}
.status{font-size:14px;color:var(--muted)}
.sliders{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
.sliders.three{grid-template-columns:1fr 1fr 1fr}
.sliders label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted)}
.sliders label b{font-family:ui-monospace,Menlo,monospace;color:var(--ink);font-size:15px}
input[type=range]{width:100%;accent-color:var(--accent)}
.readout{font-family:ui-monospace,Menlo,monospace;font-size:15px;margin-top:10px;line-height:1.7}
.presets{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.field{display:inline-flex;align-items:center;gap:6px;margin:2px 8px 2px 0;font-size:15px}
.field input.num{width:64px}

/* canvases */
canvas.scene{width:100%;aspect-ratio:1/1;background:#fff;border:1px solid var(--line);border-radius:12px;touch-action:none;display:block;cursor:grab}
canvas.scene:active{cursor:grabbing}
canvas.scene.wide{aspect-ratio:4/3}
canvas.scene.short{aspect-ratio:3/2}
.minis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:10px}
.minis.two{grid-template-columns:repeat(2,1fr)}
.minis .cap{font-size:13px;color:var(--muted);text-align:center;margin-top:6px}
.plotcap{font-size:13px;color:var(--muted);margin-top:6px}

/* drills */
.drill .prompt{font-size:16px;margin:0 0 10px}
.drill .ans{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
.drill .ans.col{flex-direction:column;align-items:flex-start}
.drill .fb{min-height:24px;margin:12px 0 4px;font-size:15px}
.drill .fb.good{color:var(--cell-strong);font-weight:600}
.drill .fb.bad{color:var(--bad-strong)}
.drill .fb .sol{color:var(--ink);font-weight:400;margin-top:6px;line-height:1.7}
.drill .parse-err{font-size:13px;color:var(--bad-strong);margin-top:4px}
.preview{display:inline-block;font-size:15px;color:var(--muted);padding:2px 10px;border-radius:8px;background:#f1efe9;margin-left:6px;vertical-align:middle;max-width:100%;overflow-x:auto}
.preview mjx-container{font-size:100%;color:var(--ink)}
.drill-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
.score{margin-left:auto;font-size:13px;color:var(--muted);display:flex;gap:12px;align-items:center}
.score b{color:var(--ink)}
.goalbar{display:inline-block;vertical-align:middle;width:110px;height:8px;background:#e9e6df;border-radius:99px;overflow:hidden}
.goalbar i{display:block;height:100%;background:var(--cell-strong);width:0;transition:width .3s}
.hint{font-size:14px;color:var(--muted);margin-top:8px}
.given{display:flex;flex-wrap:wrap;gap:6px 22px;align-items:center;margin:6px 0 4px;font-size:17px}

/* walkthroughs */
.expr{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:17px;line-height:2;margin-top:14px}
.expr .t{padding:2px 5px;border-radius:5px}
.expr .t.a{background:var(--row)}
.expr .t.b{background:var(--col)}
.expr .t.c{background:var(--cell)}
.expr .t.now{outline:2px solid var(--ink)}
.expr .faint{opacity:.3}
.steps{counter-reset:s;list-style:none;padding:0;margin:10px 0}
.steps li{position:relative;padding:8px 0 8px 40px;border-top:1px solid var(--line)}
.steps li:first-child{border-top:0}
.steps li::before{counter-increment:s;content:counter(s);position:absolute;left:0;top:9px;width:26px;height:26px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:13px;display:grid;place-items:center}
.steps li.now{background:#fbfaf6}
.steps li.dim{opacity:.35}

/* quiz */
.quiz-head{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--muted)}
.qbar{height:8px;background:#e9e6df;border-radius:99px;overflow:hidden;margin:10px 0 18px}
.qbar i{display:block;height:100%;background:var(--accent);width:0;transition:width .3s}
.result{font-size:26px;font-weight:700;margin:6px 0}
.review li{margin:6px 0}
table.simple{border-collapse:collapse;font-size:15px;margin:8px 0}
table.simple td,table.simple th{padding:7px 12px;border:1px solid var(--line);text-align:left;vertical-align:top}
table.simple th{background:#fbfaf6;font-weight:600}
table.simple.mono td{font-family:ui-monospace,Menlo,monospace}
.inner{color:var(--accent);font-weight:700}
.outer{color:var(--cell-strong);font-weight:700}

/* hub */
.hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;margin-top:18px}
.hub-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px 20px;text-decoration:none;color:var(--ink);display:flex;flex-direction:column;gap:6px;transition:transform .08s,box-shadow .12s}
.hub-card:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.06)}
.hub-card .num{font-size:12px;color:var(--accent);font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.hub-card .title{font-size:18px;font-weight:700;letter-spacing:-.01em}
.hub-card .desc{font-size:14px;color:var(--muted);flex:1}
.hub-card .prog{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);margin-top:6px}
.hub-card .prog .goalbar{width:100%}

/* calcPad-style math fields */
.mqf{position:relative;display:inline-block;vertical-align:middle;min-width:96px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:5px 10px;transition:box-shadow .12s}
.mqf.wide{min-width:200px}
.mqf.xwide{min-width:330px}
.mqf .mqfield{display:block;min-height:26px}
.mqf .mq-editable-field{border:0!important;box-shadow:none!important;min-width:60px;font-size:18px;display:block}
.mqf .mq-editable-field.mq-focused{box-shadow:none!important;border:0!important}
.mqf:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.mqf.ok{background:var(--cell);border-color:var(--cell-strong)}
.mqf.bad{background:var(--bad);border-color:var(--bad-strong)}
.mqph{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#a39f97;font-size:14px;pointer-events:none;display:none;white-space:nowrap}
.mqf.empty .mqph{display:block}
.mq-math-mode .mq-root-block{padding:2px 0}

/* WebAssign-sourced questions */
.wa-tag{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:#6d28d9;background:#f3e8ff;border-radius:99px;padding:4px 11px;margin:0 0 10px}
.wa-dot{width:8px;height:8px;border-radius:50%;background:#7c3aed;display:inline-block}
.wa-partlabel{font-size:15px;margin-top:10px}
.drill .prompt .fig{font-size:14px;color:var(--muted);background:#fbfaf6;border:1px solid var(--line);border-radius:8px;padding:8px 12px;margin:8px 0}

/* ---------------------------------------------------------------- tutor chat (assets/chat.js) */
.tutor-fab[hidden],#tutor[hidden],#tutor [hidden],.tutor-snip [hidden]{display:none!important}
.tutor-fab{position:fixed;right:22px;bottom:22px;z-index:60;display:inline-flex;align-items:center;gap:8px;font:600 14px/1 inherit;padding:11px 16px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.08)}
.tutor-fab:hover{background:#f3f1ec}
.tutor-fab svg{color:var(--accent)}
#tutor .btn.icon{display:inline-flex;align-items:center;gap:6px}
#tutor .btn.icon.only{padding:7px 8px}
#tutor .btn.icon svg{flex:none}
#tutor{position:fixed;top:0;right:0;height:100vh;height:100dvh;width:min(440px,100vw);z-index:70;background:var(--panel);border-left:1px solid var(--line);box-shadow:-8px 0 28px rgba(0,0,0,.06);display:flex;flex-direction:column;font-size:15px}
#tutor .head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
#tutor .ttl{display:flex;flex-direction:column;min-width:0}
#tutor .ttl strong{font-size:15px}
#tutor .ctx{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tutor .acts{display:flex;gap:6px;flex:none}
#tutor .msgs{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--bg)}
#tutor .welcome{color:var(--muted);font-size:14px;padding:6px 2px}
#tutor .welcome p{margin:0 0 8px}
#tutor .m{max-width:100%}
#tutor .m .body{border-radius:12px;padding:10px 13px;line-height:1.5;overflow-wrap:anywhere}
#tutor .m.user{align-self:flex-end;max-width:88%}
#tutor .m.user .body{background:var(--accent-soft);white-space:pre-wrap}
#tutor .m.assistant .body{background:var(--panel);border:1px solid var(--line)}
#tutor .m .shot{display:block;max-width:100%;max-height:220px;border-radius:10px;border:1px solid var(--line);margin:0 0 6px auto;background:#fff}
#tutor .body p{margin:6px 0}
#tutor .body p:first-child,#tutor .body h3:first-child,#tutor .body h4:first-child{margin-top:0}
#tutor .body p:last-child,#tutor .body ul:last-child,#tutor .body ol:last-child{margin-bottom:0}
#tutor .body h3{font-size:16px;margin:12px 0 4px}
#tutor .body h4,#tutor .body h5,#tutor .body h6{font-size:15px;margin:10px 0 4px}
#tutor .body ul,#tutor .body ol{margin:6px 0;padding-left:20px}
#tutor .body pre{background:#f3f1ec;border-radius:8px;padding:8px 10px;overflow:auto;font-size:13px;margin:8px 0}
#tutor .body code{font:13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;background:#f3f1ec;border-radius:4px;padding:1px 4px}
#tutor .body pre code{background:none;padding:0}
#tutor .body .tex-d{overflow-x:auto;margin:8px 0}
#tutor .body mjx-container{overflow-x:auto;overflow-y:hidden;max-width:100%}
#tutor .body hr{border:0;border-top:1px solid var(--line);margin:10px 0}
#tutor .body .err{color:var(--bad-strong);font-size:14px}
#tutor .thinking{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px;min-width:0}
#tutor .thinking .pulse{width:8px;height:8px;border-radius:50%;background:var(--accent);animation:tutor-blink 1s infinite;flex:none}
#tutor .thinking .lbl{flex:none;font-weight:600}
#tutor .thinking .peek{flex:1;min-width:0;overflow:hidden;white-space:nowrap;font-size:13px;color:#a09c95;-webkit-mask-image:linear-gradient(90deg,transparent,#000 55%);mask-image:linear-gradient(90deg,transparent,#000 55%)}
#tutor .thinking .peek span{float:right;white-space:nowrap}
#tutor .thought{font-size:12px;color:var(--muted);margin:0 0 6px}
#tutor .body>.in{animation:tutor-in .22s ease}
@keyframes tutor-in{from{opacity:0;transform:translateY(2px)}}
#tutor .streaming::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:6px;vertical-align:middle;animation:tutor-blink 1s infinite}
@keyframes tutor-blink{0%,100%{opacity:.2}50%{opacity:1}}
#tutor .compose{border-top:1px solid var(--line);padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px}
#tutor .attach{display:flex;align-items:center;gap:10px;padding:6px 8px 6px 6px;border:1px solid var(--line);border-radius:10px;background:#fbfaf6}
#tutor .attach img{display:block;height:54px;width:96px;object-fit:contain;border-radius:6px;border:1px solid var(--line);background:#fff;flex:none}
#tutor .attach .meta{flex:1;min-width:0;display:flex;flex-direction:column;font-size:13px}
#tutor .attach .meta strong{font-size:13px}
#tutor .attach .meta span{color:var(--muted);font-size:12px}
#tutor .attach .x{flex:none;width:26px;height:26px;border-radius:50%;border:1px solid var(--line);background:#fff;display:grid;place-items:center;cursor:pointer;color:var(--muted)}
#tutor .attach .x:hover{color:var(--ink);background:#f3f1ec}
#tutor .body .tbl{overflow-x:auto;margin:8px 0}
#tutor .body table{border-collapse:collapse;font-size:14px;min-width:60%}
#tutor .body th,#tutor .body td{border:1px solid var(--line);padding:5px 9px;text-align:left;vertical-align:top}
#tutor .body th{background:#f7f6f2;font-weight:600}
#tutor .notice{font-size:13px;color:var(--bad-strong);background:#fff5f5;border:1px solid var(--bad);border-radius:8px;padding:8px 10px}
#tutor textarea{width:100%;resize:none;font:inherit;line-height:1.45;padding:9px 11px;border:1px solid var(--line);border-radius:10px;outline:none;background:#fff;max-height:160px}
#tutor textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#tutor .tools{display:flex;align-items:center;gap:6px}
#tutor .board{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;background:#fbfaf6;overflow:hidden}
#tutor .board .bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-bottom:1px solid var(--line);background:#fff}
#tutor .board .pens{display:flex;align-items:center;gap:4px}
#tutor .board .pen{width:26px;height:26px;border-radius:50%;border:1px solid transparent;background:none;display:grid;place-items:center;cursor:pointer;padding:0;color:var(--muted)}
#tutor .board .pen i{display:block;width:14px;height:14px;border-radius:50%;border:1px solid rgba(0,0,0,.12)}
#tutor .board .pen:hover{background:#f3f1ec}
#tutor .board .pen.on{border-color:var(--ink);background:#fff}
#tutor .board .pen.tool.on{color:var(--ink)}
#tutor .board .acts{display:flex;gap:4px}
#tutor .board .stage{position:relative;display:grid;place-items:center;aspect-ratio:16/10;background:#eeece6}
#tutor .board canvas{display:block;background:#fff;touch-action:none;cursor:crosshair;box-shadow:0 1px 3px rgba(0,0,0,.08)}
#tutor .board .attach{position:absolute;right:10px;bottom:10px;box-shadow:0 2px 8px rgba(0,0,0,.12)}
#tutor .board .attach[disabled]{opacity:1;background:#fff;color:var(--muted);border-color:var(--line);box-shadow:none}
#tutor .board.full{position:fixed;inset:0;z-index:95;border:0;border-radius:0;background:var(--panel)}
#tutor .board.full .bar{padding:10px 16px}
#tutor .board.full .stage{flex:1;aspect-ratio:auto;min-height:0}
#tutor .board.full .attach{right:24px;bottom:24px}
#tutor .tools .spacer{flex:1}
/* interactive graphs the tutor draws (```graph blocks) */
#tutor .graph{border:1px solid var(--line);border-radius:12px;background:#fbfaf6;padding:12px 14px;margin:10px 0}
#tutor .graph .gh{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px}
#tutor .graph .gh strong{font-size:14px}
#tutor .graph .gh .thinking{gap:6px;font-size:13px}
#tutor .graph .gx{display:flex;flex-direction:column;gap:10px}
#tutor .graph .gstage{min-width:0}
#tutor .graph canvas.scene{aspect-ratio:1/1;max-height:70vh}
#tutor .graph .plotcap{margin:6px 0 0}
#tutor .graph .plotcap p,#tutor .graph .hint p{margin:0}
#tutor .graph .sliders{grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:8px 14px}
#tutor .graph .presets{margin:8px 0 0}
#tutor .graph .readout{font-size:13px;margin-top:8px;line-height:1.6}
#tutor .graph .hint{font-size:13px;margin-top:8px}
#tutor .graph .gside:empty{display:none}
#tutor .graph.full{position:fixed;inset:0;z-index:95;margin:0;border:0;border-radius:0;background:var(--panel);padding:18px 28px 28px;overflow:auto;display:flex;flex-direction:column}
#tutor .graph.full .gh{margin-bottom:14px}
#tutor .graph.full .gh strong{font-size:18px}
#tutor .graph.full .gx{flex:1;display:grid;grid-template-columns:minmax(320px,min(62vh,620px)) 1fr;gap:28px;align-items:start;max-width:1200px;width:100%;margin:0 auto}
#tutor .graph.full canvas.scene{max-height:none}
#tutor .graph.full .sliders{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px 18px}
#tutor .graph.full .readout,#tutor .graph.full .hint{font-size:15px}
@media (max-width:820px){#tutor .graph.full .gx{grid-template-columns:1fr}}
#tutor .graph.gerr{color:var(--muted);font-size:13px;background:#fff;text-align:center;padding:14px}
#tutor .gcut{color:var(--muted);font-size:13px;margin:8px 0}
#tutor .graph.skel .ph{border-radius:12px;background:linear-gradient(90deg,#efede7 0%,#f7f6f2 40%,#efede7 80%);background-size:200% 100%;animation:tutor-shimmer 1.4s linear infinite}
#tutor .graph.skel .ph.stage{aspect-ratio:1/1;max-height:70vh;border:1px solid var(--line);background-color:#fff}
#tutor .graph.skel .ph-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:12px 0 0}
#tutor .graph.skel .ph-row i{display:block;height:34px;border-radius:8px;background:linear-gradient(90deg,#efede7 0%,#f7f6f2 40%,#efede7 80%);background-size:200% 100%;animation:tutor-shimmer 1.4s linear infinite}
#tutor .graph.skel .ph.line{height:12px;width:70%;border-radius:6px;margin-top:12px}
@keyframes tutor-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
.tutor-snip{position:fixed;inset:0;z-index:100;background:#111;cursor:crosshair;display:grid;place-items:center;user-select:none;touch-action:none}
.tutor-snip img{max-width:100vw;max-height:100vh;display:block;pointer-events:none;filter:brightness(.62)}
.tutor-snip .guide{position:fixed;left:0;top:0;pointer-events:none;background:rgba(255,255,255,.35)}
.tutor-snip .gx{width:1px;height:100vh}
.tutor-snip .gy{height:1px;width:100vw}
.tutor-snip.dragging .guide{display:none}
.tutor-snip .sel{position:fixed;border:1.5px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 0 0 100vmax rgba(0,0,0,.25);pointer-events:none;backdrop-filter:brightness(1.6);-webkit-backdrop-filter:brightness(1.6)}
.tutor-snip .sel::before,.tutor-snip .sel::after{content:"";position:absolute;width:10px;height:10px;border:2px solid #fff;}
.tutor-snip .sel::before{left:-2px;top:-2px;border-right:0;border-bottom:0}
.tutor-snip .sel::after{right:-2px;bottom:-2px;border-left:0;border-top:0}
.tutor-snip .dim{position:absolute;right:-1px;top:-26px;background:rgba(28,27,26,.92);color:#fff;font:600 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;padding:5px 7px;border-radius:5px;white-space:nowrap;letter-spacing:.02em}
.tutor-snip .dim.below{top:auto;bottom:-26px}
.tutor-snip .tip{position:fixed;top:16px;left:50%;transform:translateX(-50%);display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.96);color:var(--ink);font-size:13px;padding:8px 14px 8px 12px;border-radius:999px;pointer-events:none;box-shadow:0 6px 20px rgba(0,0,0,.25)}
.tutor-snip .tip svg{color:var(--accent)}
.tutor-snip .tip kbd{font:600 11px/1 inherit;background:#f3f1ec;border:1px solid var(--line);border-radius:5px;padding:3px 6px;margin-left:4px}
.tutor-snip .tip .muted{color:var(--muted)}
@media (max-width:760px){.tutor-fab{right:14px;bottom:14px}}
