/* A pastel stationery theme. Microscopy images keep their original colors. */
:root{
  --ink:#594466;--sub:#73617f;--blue:#e4f2ff;--pink:#ffe3ef;
  --line:#e7dcec;--paper:#fffcfe;--bg:#fff7fb;--accent:#765298;
  --rose:#995073;--green:#42685e;--error:#96516d;
  --mint:#e8f6ef;--butter:#fff3cf;--lilac:#f0e8ff;
  --shadow:0 8px 28px #77558e0d;
}
body{background:linear-gradient(145deg,#fff5fb 0%,#f4f8ff 60%,#fff8fb 100%);color:var(--ink);font-family:ui-rounded,"Aptos","Segoe UI",system-ui,sans-serif}
.topbar{background:#fffafd;border-bottom:1px solid #eeddec;gap:1.1rem}
.brand{font-weight:750;letter-spacing:-.045em}
.brandmark{width:3.15rem;height:3.15rem;border-radius:0;background:transparent;color:var(--ink)}
.brandmark img{width:100%;height:100%;object-fit:contain}
.brand-sub{letter-spacing:.1em;color:var(--sub)}
.nav{border:1px solid transparent;border-radius:12px;font-weight:650;color:#6b567b}
.nav.active{background:var(--pink);color:#785070;border-color:#efd0e2;box-shadow:0 3px 0 #f6e5ef}
.nav:hover{background:var(--lilac);color:#654b86}
.header-extras{display:flex;flex-direction:column;align-items:flex-end;gap:.4rem;flex-shrink:0}
.exam-tag{background:var(--butter);border-color:#f0dfb4;color:#806445;font-size:.875rem}
.motion-toggle{background:transparent;border:0;padding:.2rem .1rem;color:#775e92;font-size:.875rem;white-space:nowrap;min-height:30px;cursor:pointer}
.motion-toggle:hover{color:#584575;text-decoration:underline;text-underline-offset:4px}
.motion-toggle:disabled{opacity:1;color:var(--sub);cursor:default}
.eyebrow{color:#79618a;letter-spacing:.11em}
.view-head h1{letter-spacing:-.035em}
.stat{background:#fff9fd;border-color:#eadced;box-shadow:0 3px 0 #f2eaf7;color:#6c537d}
.card{background:var(--paper);border-color:var(--line);border-radius:22px;box-shadow:var(--shadow)}
.image-card{background:#fffafd}
.image-top .pill{background:var(--lilac);color:#6d528d}
.micro-surface{background:#f6f2fb;border-color:#e9e0f0;border-radius:16px}
.image-caption,.source-credit{color:var(--sub)}
.button{border-color:#e4d5e9;border-radius:12px;background:#fffafd;color:#634d78;box-shadow:0 2px 0 #efe5f2}
.button.primary{background:#ffddeb;border-color:#e9bed6;color:#704769;box-shadow:0 3px 0 #eecddd}
.button.primary:hover{background:#ffd3e5;border-color:#dba6c5;color:#653d5e}
.button.secondary{background:var(--blue);border-color:#cadff2;color:#4c617e;box-shadow:0 3px 0 #dceaf7}
.button.secondary:hover{background:#d9edff;color:#40577b}
.text-button{color:#7a5599;text-decoration-color:#cbb4dd}
.pill{background:var(--blue);color:#50617f;font-size:.8125rem}
.pill.pink{background:var(--pink);color:#8b4d72}
select,input,textarea{border-color:#ddcde6;background:#fffdff;color:var(--ink);border-radius:11px}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-color:#a17cbc}
.option{border-color:#e6d9ed;background:#fffafd;border-radius:14px}
.option:hover{background:#f7f0ff;border-color:#c6addc}
.option.selected{background:#f0e7ff;border-color:#9d7ebe;box-shadow:0 0 0 1px #ae90c7}
.option.correct{background:var(--mint);border-color:#a8d0bd;color:#416354}
.option.wrong{background:#fff0f7;border-color:#ddb1ca;color:#85526f}
.key{border-color:#e6d9ed;background:#faf4ff;color:#826694}
.progress-line{height:7px;background:#eee7f6}
.progress-line span{background:linear-gradient(90deg,#f3aecf,#d1bbf2,#a8d7f4);border-radius:99px}
.round-progress{position:relative;margin:1.4rem 0 1.6rem;padding:.85rem 0}
.round-progress .progress-line{margin:0;overflow:hidden}
.progress-star{position:absolute;top:50%;width:36px;height:36px;transform:translate(-50%,-50%);pointer-events:none}
.progress-star img{display:block;width:100%;height:100%;object-fit:contain}
.study-details{border:1px solid #e4d7ed;border-radius:13px;background:#fffafd;margin:.9rem 0;color:var(--ink)}
.study-details>summary{display:flex;align-items:center;justify-content:space-between;gap:.8rem;list-style:none;cursor:pointer;padding:.85rem 1rem;font-size:.9375rem;font-weight:650;line-height:1.4;border-radius:12px;color:#745587;min-height:48px}
.study-details>summary::-webkit-details-marker{display:none}
.study-details>summary::after{content:'+';font-size:1.3rem;font-weight:500;line-height:1;flex:none;color:#9876af}
.study-details[open]>summary::after{content:'−'}
.study-details[open]>summary{background:#f4edff;border-bottom:1px solid #e8dcef;border-radius:12px 12px 0 0}
.study-details>summary:hover{background:#f4edff}
.study-details>summary:focus-visible{outline:3px solid #a17cbc;outline-offset:3px}
.study-detail-content{padding:1rem;font-size:1rem;overflow-wrap:anywhere}
.study-detail-content>:last-child{margin-bottom:0}
.study-detail-content .morphology-list dd,.study-detail-content .morphology-list dt{font-size:.9375rem}
.study-detail-content .support-findings,.study-detail-content .case-cell-grid{margin:0}
.lookalike .study-details{background:#fff9fc;border-color:#e9cfe0}
.lookalike .study-details>summary{color:#895879}
.study-actions .button{min-height:46px}
.feedback{background:#f2edff;border-left-color:#b5a0d6;border-radius:0 14px 14px 0}
.feedback.correct-feedback{background:var(--mint);border-color:#a3cdbc;position:relative;padding-right:3.3rem}
.feedback.correct-feedback::after{content:"";position:absolute;right:.65rem;top:.7rem;width:2rem;height:2rem;background:url('assets/sticker-star.png') center/contain no-repeat;pointer-events:none}
.feedback .result{font-size:.875rem;color:#456c61;letter-spacing:.035em;text-transform:none}
.feedback.wrong-feedback .result{color:#93618a}
.clue{color:#745487}
.hint{background:var(--butter);border-color:#f0dfb9;color:#7a6240;border-radius:13px}
.lookalike{background:#fff0f8;border:1px dashed #dbb6d1;border-radius:17px;padding:1.1rem;margin-top:1.2rem;color:#765372}
.lookalike h3{font-size:1rem;color:#9a567d;margin-bottom:.6rem}
.tip-heading{display:inline-flex;align-items:center;gap:.55rem;line-height:1.35}
.tip-kicker{font-family:"Comic Sans MS","Chalkboard SE",ui-rounded,sans-serif;font-size:1.12rem;font-weight:700;display:block;color:#9b4f7a;transform:rotate(-2deg)}
.tip-label{display:block;font-size:.875rem;color:#7c5c86;font-weight:650;margin-top:.1rem}
.tip-pop{position:relative;display:grid;place-items:center;background:var(--butter);border:1px solid #efd9a0;border-radius:50%;font-family:"Comic Sans MS",ui-rounded,sans-serif;font-size:1.4rem;font-weight:700;color:#947046;flex-shrink:0;width:2.1rem;height:2.1rem;transform:rotate(-8deg)}
.tip-pop svg{position:absolute;width:1.5rem;height:2rem;left:-1.25rem;top:-.1rem;fill:none;stroke:#ce98bc;stroke-width:2.4;stroke-linecap:round;overflow:visible;pointer-events:none}
.lookalike .tip-pop{margin-left:.35rem}
.note-heading{display:inline-flex;align-items:center;gap:.6rem;line-height:1.35;max-width:100%}
.note-heading>span:last-child{min-width:0}
.note-art{position:relative;flex:none;width:44px;height:44px;margin-left:.25rem}
.note-art img{display:block;width:100%;height:100%;object-fit:contain}
.note-art svg{position:absolute;width:17px;height:26px;left:-13px;top:4px;fill:none;stroke:#c29dcf;stroke-width:2.3;stroke-linecap:round;overflow:visible;pointer-events:none}
.note-kicker{display:block;font-family:"Comic Sans MS","Chalkboard SE",ui-rounded,sans-serif;font-size:1.12rem;font-weight:700;color:#875887;transform:rotate(-1.5deg)}
.note-label{display:block;font-size:.875rem;font-weight:650;color:#79618a;margin-top:.2rem}
.note-card{padding:.8rem .95rem;border:1px dashed #d4c8e7;border-radius:16px;background:#f2f4ff;margin:1rem 0}
.note-card h3,.hint h3{margin:0 0 .55rem}
.note-card .clue,.hint>p{font-size:1rem;line-height:1.55;margin:0}
.note-notebook{background:#f4edff;border-color:#d5bfdf}
.feedback .note-card{background:#fcfaff;border-color:#d9cde7}
.star-tutor{position:fixed;right:1.2rem;bottom:1.1rem;width:100px;z-index:45}
.tutor-launcher{position:relative;display:block;border:0;padding:0;width:100%;height:100px;background:transparent;cursor:pointer;border-radius:24px}
.tutor-launcher img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.tutor-launcher:focus-visible{outline-offset:3px}
.tutor-bubble{position:absolute;bottom:calc(100% - 4px);right:0;min-width:100%;max-width:10rem;width:max-content;padding:.45rem .7rem;background:#fffafd;border:1px solid #e6d1e8;border-radius:15px 15px 5px 15px;box-shadow:0 3px 12px #79548e0e;color:#805f90;font-size:.875rem;font-weight:650;line-height:1.3;text-align:center;pointer-events:none}
.tutor-bubble[hidden]{display:none}
.tutor-open .tutor-bubble{visibility:hidden}
.tutor-panel{position:absolute;right:0;bottom:calc(100% + .7rem);width:min(360px,calc(100vw - 2.4rem));max-height:min(62vh,32rem);max-height:min(62dvh,32rem);overflow:auto;overscroll-behavior:contain;background:#fffcfe;border:1px solid #dcc7e7;border-radius:20px;box-shadow:0 12px 42px #75538b26;scrollbar-gutter:stable}
.tutor-panel[hidden]{display:none}
.tutor-panel-head{display:flex;align-items:center;gap:.75rem;padding:.8rem .7rem .8rem 1rem;background:linear-gradient(110deg,#ffeaf4,#f0edff,#edf7ff);border-bottom:1px solid #e7d7ec}
.tutor-panel-head>img{flex:none;width:40px;height:40px;object-fit:contain}
.tutor-panel-head h2{flex:1;font-family:"Comic Sans MS","Chalkboard SE",ui-rounded,sans-serif;font-size:1.15rem;margin:0;line-height:1.35;letter-spacing:0;overflow-wrap:anywhere;color:#7a5488;outline:0}
#tutor-close{flex:none;display:grid;place-items:center;border:0;background:transparent;border-radius:12px;min-width:44px;min-height:44px;padding:0;font-size:1.65rem;color:#856394}
#tutor-close:hover{background:#fff8fd}
.tutor-content{padding:1rem;font-size:1rem;line-height:1.55;overflow-wrap:anywhere}
.tutor-lead{color:#725086;font-weight:600;margin:0 0 .85rem}
.tutor-section{border-top:1px dashed #e1d2e8;padding-top:.8rem;margin-top:.8rem}
.tutor-section h3,.tutor-section>summary{font-size:.9375rem;line-height:1.4;margin:0 0 .5rem;color:#79558a;font-weight:700}
.tutor-section>summary{cursor:pointer;min-height:34px}
.tutor-section>summary:focus-visible{outline:3px solid #a17cbc;outline-offset:3px;border-radius:5px}
.tutor-section p{margin:0 0 .65rem}
.tutor-section ul{margin:.5rem 0 .7rem;padding-left:1.2rem}
.tutor-section li+li{margin-top:.35rem}
.tutor-content>.button{max-width:100%}
footer{padding-bottom:9rem}
.atlas-nav{background:#fffafd;border-color:var(--line);border-radius:18px}
.atlas-entry.active{background:var(--blue);border-color:#c9dff0}
.atlas-entry:hover{background:#f4edff}
.abnormal-review .atlas-entry.active{background:var(--pink);border-color:#edc4db}
.gallery-image{background:#fffbfd;border-color:#e8dcec;border-radius:13px}
.gallery-image.selected{background:var(--blue);border-color:#a9c8e5;box-shadow:0 0 0 1px #b8d3eb}
.abnormal-review .gallery-image.selected{background:var(--pink);border-color:#d5a7c4;box-shadow:0 0 0 1px #e3b6d1}
.location-note{background:#eaf4ff;border:1px solid #d6e7f7;border-radius:15px}
.context-note{background:var(--butter);border-color:#eddfb7}
.subnav button{background:#fffbfd;border-color:#e5d7eb;color:#745a89}
.subnav button.active{background:var(--lilac);border-color:#cdb5e6;color:#6d4f88;box-shadow:0 2px 0 #e4d4f3}
.count-button{background:#fffafd;border-color:#e5d8eb;border-radius:12px;color:#6b537e;min-height:46px}
.count-button:hover{background:#efe6ff}
.count-button strong{background:#edf4ff;color:#556c91;border-radius:8px}
.compare-note{background:var(--blue);border:1px solid #d0e4f5;border-radius:16px;color:#53647e}
.table-wrap table th{background:#f5eefb;color:#745784}
.lab-sheet-head{border-bottom-color:#d4bedf}
.lab-flag{background:var(--pink);color:#925275}
.lab-value.abnormal{color:#955478}
.report-history{background:#f7f2fc;border:1px solid #eee2f4;border-radius:14px}
.report-smear{background:#eef6ff;border-left-color:#b4d5f0;border-radius:0 14px 14px 0}
.report-feedback{border-top-color:#c9addf}
.cell-choice{border-color:#e5d8eb;background:#fffafd;border-radius:13px}
.cell-choice:has(input:checked){background:var(--lilac);border-color:#c9addf}
.cell-choice input{accent-color:#ad86c8}
.support-findings>div{background:#f3f0ff;border-color:#e3d8f1;border-radius:15px}
.case-cell-grid>div{background:#f7f2fc;border-color:#e8ddef;border-radius:15px}
.study-target{background:#fff0f7;border:1px solid #f0d4e5;border-radius:14px}
.diff-review{background:#fffcfe;border-color:#e6d9ee;border-radius:17px}
.diff-review.missed{background:#fff7fb;border-color:#ecc8dd}
.diff-review img{border-color:#eadff0;border-radius:13px}
.score-sticker{display:flex;align-items:center;gap:1rem;position:relative;margin:-.2rem 0 1.4rem;padding:.75rem 1rem;background:linear-gradient(115deg,#fff0f8,#f0edff,#eaf6ff);border:1px solid #ecdeee;border-radius:20px;min-height:102px;overflow:hidden}
.score-sticker img{width:5.3rem;height:5.3rem;object-fit:contain;flex:none;transform:rotate(-8deg)}
.score-sticker>div{position:relative;z-index:1}
.hand-note{display:block;font-family:"Comic Sans MS","Chalkboard SE",ui-rounded,sans-serif;color:#8b5485;font-size:1.45rem;font-weight:700;line-height:1.25;transform:rotate(-2deg);margin-bottom:.35rem}
.score-sticker p{color:#78628a;font-size:.9375rem;margin:0;line-height:1.45}
.score-sparkles{margin-left:auto;align-self:flex-start;color:#ac8bc7;font-size:1.6rem;white-space:nowrap;letter-spacing:.15em;transform:rotate(10deg)}
.score-display{color:#9b6b9d}
.summary .card{border-color:#e6d5ec}
#celebration-canvas{position:fixed;inset:0;z-index:100;width:100vw;height:100vh;pointer-events:none}
#celebration-canvas[hidden]{display:none}
footer{border-color:#e5d7eb;color:#7b6886}
.ok{color:#436b5b}.no{color:#955477}
@media(prefers-reduced-motion:no-preference){
  body:not(.motion-paused) .button,body:not(.motion-paused) .option,body:not(.motion-paused) .count-button{transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}
  body:not(.motion-paused) .button:active:not(:disabled),body:not(.motion-paused) .count-button:active:not(:disabled){transform:scale(.97)}
  body:not(.motion-paused) .high-score img{animation:sticker-pop .65s cubic-bezier(.2,.8,.3,1) 1}
  body:not(.motion-paused) .high-score .score-sparkles{animation:sparkle-pop .75s ease-out 1}
  @keyframes sticker-pop{0%{transform:rotate(-8deg) scale(.82)}55%{transform:rotate(6deg) scale(1.07)}100%{transform:rotate(-8deg) scale(1)}}
  @keyframes sparkle-pop{0%{opacity:.2;transform:rotate(10deg) scale(.6)}60%{opacity:1;transform:rotate(-5deg) scale(1.12)}100%{opacity:1;transform:rotate(10deg) scale(1)}}
}
.motion-paused *, .motion-paused *::before,.motion-paused *::after{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}#celebration-canvas{display:none}}
@media(max-width:1050px){.topbar{gap:.75rem}.header-extras{margin-left:auto}.exam-tag{margin-left:0}}
@media(max-width:720px){.brandmark{width:2.6rem;height:2.6rem}.header-extras{gap:.15rem}.exam-tag{font-size:.8125rem}.motion-toggle{font-size:.8125rem}.score-sticker{gap:.5rem;padding:.7rem}.score-sticker img{width:4.3rem;height:4.3rem}.hand-note{font-size:1.22rem}.score-sticker p{font-size:.875rem}.score-sparkles{display:none}.nav{font-size:.875rem}.tip-kicker{font-size:1.05rem}}
@media(max-width:720px){
  body.has-study-actions main{padding-bottom:calc(var(--study-dock-height,7rem) + 7rem)}
  body.has-study-actions footer{padding-bottom:calc(var(--study-dock-height,7rem) + 7rem)}
  .study-actions{position:fixed;bottom:0;left:.6rem;right:.6rem;z-index:40;margin:0;display:flex;flex-wrap:nowrap;gap:.5rem;padding:.7rem .7rem calc(.7rem + env(safe-area-inset-bottom,0px));border:1px solid #e4d0e6;border-bottom:0;border-radius:18px 18px 0 0;background:#fff9fdeF;box-shadow:0 -5px 22px #78538b14}
  .study-actions .button{flex:1;min-width:0;min-height:48px;padding:.65rem .6rem;font-size:.875rem;line-height:1.3;text-align:center;overflow-wrap:anywhere}
  body.editing-study-input .study-actions{visibility:hidden}
  .star-tutor{right:.65rem;bottom:calc(.8rem + env(safe-area-inset-bottom,0px));width:72px}
  body.has-study-actions .star-tutor{bottom:calc(var(--study-dock-height,7rem) + .65rem)}
  .tutor-launcher{height:72px}
  .tutor-bubble{max-width:8rem;padding:.4rem .55rem;font-size:.875rem}
  .tutor-panel{width:min(350px,calc(100vw - 1.3rem));max-height:min(55vh,calc(100vh - var(--study-dock-height,0px) - 110px));max-height:min(55dvh,calc(100dvh - var(--study-dock-height,0px) - 110px));border-radius:17px}
  body.editing-study-input .star-tutor{visibility:hidden}
  footer{padding-bottom:7rem}
  .study-details>summary{padding:.8rem .9rem}
  .study-detail-content{padding:.9rem}
  .image-card{scroll-margin-top:.8rem}
}
@media print{#celebration-canvas,.header-extras,.score-sparkles{display:none}body{background:white}.score-sticker{background:white;box-shadow:none}}
@media(max-height:520px){
  .tutor-panel{position:fixed;right:1.2rem;bottom:.8rem;max-height:calc(100vh - 1.6rem);max-height:calc(100dvh - 1.6rem)}
  .tutor-open .tutor-launcher{visibility:hidden}
}
@media(max-width:720px) and (max-height:520px){
  .tutor-panel{right:.65rem;bottom:calc(var(--study-dock-height,0px) + .65rem);max-height:calc(100vh - var(--study-dock-height,0px) - 1.3rem);max-height:calc(100dvh - var(--study-dock-height,0px) - 1.3rem)}
}
@media print{.study-actions,.round-progress,.star-tutor{display:none}body.has-study-actions main{padding:0}.study-details>summary{background:white}.study-details>.study-detail-content{display:block!important}.study-details{break-inside:avoid}}
/* The new study notes inherit the pastel cards without touching microscopy. */
.finding-explanation{margin:1rem 0 1.4rem;line-height:1.65}
.finding-explanation>h3{margin-bottom:.55rem}
.finding-explanation>.small{margin-top:.6rem}
.challenge-note{margin:1.25rem 0}
.challenge-note .button{margin-top:.4rem}
.exam-setup{max-width:700px;display:grid;gap:1rem}
.tutor-modes{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.tutor-modes .button{min-height:40px}
.compare-picker{flex:1;min-width:0}
.comparison-cell{min-width:0;display:flex;flex-direction:column;gap:1rem}
.comparison-cell .image-card{box-shadow:none}
.comparison-cell .image-caption{font-size:.875rem}
.related-comparisons{margin:1.2rem 0}
.related-comparisons .actions{flex-wrap:wrap}
.compare-grid .micro-surface{aspect-ratio:4/3}
@media(max-width:720px){.compare-grid{grid-template-columns:1fr}.exam-setup{padding:1.2rem}.tutor-modes .button{font-size:.875rem}}
