/* Medical Terminology Builder: every rule is scoped to .mtb so it won't affect your theme. */
.mtb{
  --mtb-paper:#F6F8FA; --mtb-surface:#FFFFFF; --mtb-ink:#15233B; --mtb-muted:#56637A; --mtb-rule:#DCE3EA;
  --mtb-teal:#0F7B83; --mtb-teal-soft:#E3F2F3; --mtb-chip:#EEF2F6; --mtb-focus:#0F7B83;
  --mtb-good:#2F7D57; --mtb-good-soft:#E6F3EC; --mtb-bad:#B4233A; --mtb-bad-soft:#FBE9EC;
  --mtb-pre:#6A4C93; --mtb-pre-soft:#EFE9F6; --mtb-root:#0F7B83; --mtb-root-soft:#E3F2F3; --mtb-suf:#A3600F; --mtb-suf-soft:#FBF0E1; --mtb-vow:#8A95A5; --mtb-vow-soft:#F1F3F6;
  box-sizing:border-box; width:100%; max-width:var(--mtb-max,none); margin:0 auto 2rem; padding:clamp(1.25rem,4vw,2.5rem);
  background:var(--mtb-paper); color:var(--mtb-ink); border-radius:1rem; font-family:var(--mtb-body); font-size:1.0625rem; line-height:1.6; text-align:left;
}
.mtb:not(.mtb-theme-fonts){
  --mtb-body:"Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --mtb-display:"Bricolage Grotesque","Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}
.mtb.mtb-theme-fonts{font-family:inherit}
.mtb *,.mtb *::before,.mtb *::after{box-sizing:border-box}
.mtb h2,.mtb h3,.mtb h4,.mtb p,.mtb ol,.mtb ul,.mtb li,.mtb fieldset,.mtb legend,.mtb table{margin:0;padding:0;border:0;background:none}
.mtb:not(.mtb-theme-fonts) h2{font-family:var(--mtb-display);color:var(--mtb-ink);text-transform:none;letter-spacing:normal}
.mtb a{color:var(--mtb-teal);text-decoration:underline;text-underline-offset:2px}
.mtb a:focus-visible,.mtb button:focus-visible,.mtb select:focus-visible,.mtb input:focus-visible,.mtb summary:focus-visible,.mtb [tabindex]:focus-visible{outline:3px solid var(--mtb-focus);outline-offset:2px}
.mtb .mtb-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.mtb .mtb-title{font-size:clamp(1.6rem,3.4vw,2.3rem);line-height:1.2;width:100%;text-align:left;text-wrap:balance}
.mtb:not(.mtb-theme-fonts) .mtb-title{font-weight:750;letter-spacing:-.015em}
.mtb .mtb-lede{color:var(--mtb-muted);max-width:48rem;margin-top:.75rem}

.mtb .mtb-tabs{display:flex;gap:.25rem;margin-top:2rem;border-bottom:2px solid var(--mtb-rule);overflow-x:auto;scrollbar-width:none}
.mtb .mtb-tabs::-webkit-scrollbar{display:none}
.mtb .mtb-tab{-webkit-appearance:none;appearance:none;font:inherit;font-size:1rem;line-height:1.3;text-transform:none;letter-spacing:normal;cursor:pointer;white-space:nowrap;flex:none;background:transparent;color:var(--mtb-muted);border:0;border-bottom:3px solid transparent;margin:0 0 -2px;padding:.7rem .95rem;border-radius:0;box-shadow:none;width:auto}
.mtb .mtb-tab:hover{color:var(--mtb-ink)}
.mtb .mtb-tab[aria-selected="true"]{color:var(--mtb-ink);border-bottom-color:var(--mtb-teal);font-weight:700}
.mtb .mtb-panel{padding-top:1.6rem}

/* Settings */
.mtb .mtb-set{margin-bottom:1.6rem;padding-bottom:1.2rem;border-bottom:1px solid var(--mtb-rule)}
.mtb .mtb-set-sum{cursor:pointer;display:flex;flex-wrap:wrap;gap:.25rem .9rem;align-items:baseline;list-style:none}
.mtb .mtb-set-sum::-webkit-details-marker{display:none}
.mtb .mtb-set-title{font-weight:700}
.mtb .mtb-set-detail{font-size:.92rem;color:var(--mtb-muted)}
.mtb .mtb-set-edit{font-size:.92rem;color:var(--mtb-teal);text-decoration:underline}
.mtb .mtb-o{display:none}
.mtb details[open] > .mtb-set-sum .mtb-o{display:inline}
.mtb details[open] > .mtb-set-sum .mtb-c{display:none}
.mtb .mtb-set-body{display:grid;gap:1.1rem;margin-top:1rem}
.mtb .mtb-label{display:block;font-size:.88rem;color:var(--mtb-muted);margin:0 0 .4rem;font-weight:400;padding:0;float:none;width:auto}
.mtb .mtb-chips{display:flex;flex-wrap:wrap;gap:.45rem}
.mtb .mtb-chip{position:relative;display:inline-block;margin:0;padding:0;font-weight:400}
.mtb .mtb-chip input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer;-webkit-appearance:none;appearance:none}
.mtb .mtb-chip span{display:block;padding:.42rem .8rem;border-radius:999px;background:var(--mtb-chip);border:2px solid transparent;font-size:.93rem;line-height:1.3;cursor:pointer}
.mtb .mtb-chip input:checked + span{background:var(--mtb-ink);color:var(--mtb-paper);border-color:var(--mtb-ink)}
.mtb .mtb-chip input:focus-visible + span{outline:3px solid var(--mtb-focus);outline-offset:2px}
.mtb .mtb-inline{display:flex;gap:1rem;margin-top:.55rem}

/* Buttons and inputs */
.mtb .mtb-btn{-webkit-appearance:none;appearance:none;font:inherit;font-size:.98rem;line-height:1.3;text-transform:none;letter-spacing:normal;cursor:pointer;border-radius:.5rem;padding:.6rem 1.05rem;border:2px solid var(--mtb-ink);background:transparent;color:var(--mtb-ink);box-shadow:none;margin:0;width:auto}
.mtb .mtb-btn:hover{background:var(--mtb-chip)}
.mtb .mtb-btn-solid{background:var(--mtb-ink);color:var(--mtb-paper)}
.mtb .mtb-btn-solid:hover{background:var(--mtb-teal);border-color:var(--mtb-teal);color:#fff}
.mtb .mtb-link{-webkit-appearance:none;appearance:none;font:inherit;font-size:inherit;background:none;border:0;padding:0;margin:0;color:var(--mtb-teal);text-decoration:underline;text-underline-offset:2px;cursor:pointer;box-shadow:none;width:auto;text-transform:none;letter-spacing:normal}
.mtb .mtb-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:1.1rem}
.mtb .mtb-in{width:100%;max-width:none;height:2.8rem;font:inherit;font-size:1rem;padding:.45rem .7rem;border-radius:.5rem;border:2px solid var(--mtb-rule);background-color:var(--mtb-surface);color:var(--mtb-ink);box-shadow:none;margin:0}
.mtb .mtb-in:focus{border-color:var(--mtb-teal)}
.mtb .mtb-row{display:flex;flex-wrap:wrap;gap:1rem 1.5rem;align-items:flex-end;margin-top:1rem}
.mtb .mtb-f{display:flex;flex-direction:column;flex:1 1 12rem;max-width:20rem}
.mtb .mtb-f-wide{flex-basis:18rem;max-width:26rem}
.mtb .mtb-check{display:flex;gap:.5rem;align-items:center;font-weight:400;margin:0 0 .6rem;cursor:pointer}
.mtb .mtb-check input{width:1.1rem;height:1.1rem;margin:0;accent-color:var(--mtb-teal)}

/* Cards and practice */
.mtb .mtb-card{background:var(--mtb-surface);border:1px solid var(--mtb-rule);border-radius:1rem;padding:1.35rem 1.3rem;margin-bottom:1rem}
.mtb .mtb-card > p + p{margin-top:.55rem}
.mtb .mtb-score,.mtb .mtb-small{font-size:.92rem;color:var(--mtb-muted);margin-bottom:.8rem}
.mtb .mtb-score b,.mtb .mtb-small b{color:var(--mtb-ink)}
.mtb .mtb-lead{max-width:46rem;margin-bottom:1rem}
.mtb .mtb-qtext{font-family:var(--mtb-display);font-size:1.25rem;font-weight:600;line-height:1.35;color:var(--mtb-ink)}
.mtb .mtb-opts{display:grid;gap:.5rem;margin-top:1rem;max-width:40rem}
.mtb .mtb-opt{-webkit-appearance:none;appearance:none;font:inherit;font-size:1rem;line-height:1.4;text-align:left;text-transform:none;letter-spacing:normal;display:flex;gap:.75rem;align-items:center;padding:.6rem .85rem;border:2px solid var(--mtb-rule);border-radius:.65rem;background:var(--mtb-surface);color:var(--mtb-ink);cursor:pointer;box-shadow:none;margin:0;width:100%}
.mtb .mtb-opt:hover:not(:disabled){border-color:var(--mtb-muted)}
.mtb .mtb-opt:disabled{cursor:default}
.mtb .mtb-letter{display:inline-grid;place-items:center;flex:none;width:1.8rem;height:1.8rem;border-radius:50%;border:2px solid var(--mtb-rule);font-weight:700;font-size:.88rem}
.mtb .mtb-opt.is-right{border-color:var(--mtb-good);background:var(--mtb-good-soft)}
.mtb .mtb-opt.is-right .mtb-letter{background:var(--mtb-good);border-color:var(--mtb-good);color:#fff}
.mtb .mtb-opt.is-wrong{border-color:var(--mtb-bad);background:var(--mtb-bad-soft)}
.mtb .mtb-opt.is-wrong .mtb-letter{background:var(--mtb-bad);border-color:var(--mtb-bad);color:#fff}
.mtb .mtb-fb{margin-top:1.1rem;padding:1rem 1.1rem;border-radius:.75rem;border-left:5px solid}
.mtb .mtb-fb > p + p,.mtb .mtb-fb > p + div,.mtb .mtb-fb > div + ul{margin-top:.5rem}
.mtb .mtb-fb.is-ok{background:var(--mtb-good-soft);border-color:var(--mtb-good)}
.mtb .mtb-fb.is-no{background:var(--mtb-bad-soft);border-color:var(--mtb-bad)}
.mtb .mtb-fb-title{font-weight:700;font-size:1.05rem}
.mtb .mtb-also{font-size:.95rem;margin-top:.6rem}
.mtb .mtb-trouble{margin-top:.4rem;font-size:.95rem}
.mtb .mtb-trouble summary{cursor:pointer;color:var(--mtb-teal)}
.mtb .mtb-trouble ul{padding-left:1.2rem;margin:.6rem 0}
.mtb .mtb-trouble li{list-style:disc;margin:.2rem 0}
.mtb .mtb-empty{border:2px dashed var(--mtb-rule);border-radius:.75rem;padding:1.3rem;color:var(--mtb-muted)}

/* Word part segments */
.mtb .mtb-segs{display:flex;flex-wrap:wrap;gap:.3rem;margin:.8rem 0 .4rem}
.mtb .mtb-seg{display:inline-flex;flex-direction:column;align-items:center;border-radius:.5rem;padding:.35rem .6rem .3rem;border-bottom:4px solid}
.mtb .mtb-seg-text{font-size:1.25rem;font-weight:700;letter-spacing:.01em;line-height:1.2}
.mtb .mtb-seg-mean{font-size:.78rem;color:var(--mtb-muted);text-align:center;max-width:9rem;line-height:1.25;margin-top:.1rem}
.mtb .mtb-seg-p{background:var(--mtb-pre-soft);border-color:var(--mtb-pre)}
.mtb .mtb-seg-r{background:var(--mtb-root-soft);border-color:var(--mtb-root)}
.mtb .mtb-seg-v{background:var(--mtb-vow-soft);border-color:var(--mtb-vow)}
.mtb .mtb-seg-s{background:var(--mtb-suf-soft);border-color:var(--mtb-suf)}
.mtb .mtb-dot{display:inline-block;width:.7rem;height:.7rem;border-radius:50%;margin-right:.45rem;vertical-align:0;flex:none}
.mtb .mtb-dot-p{background:var(--mtb-pre)}.mtb .mtb-dot-r{background:var(--mtb-root)}.mtb .mtb-dot-v{background:var(--mtb-vow)}.mtb .mtb-dot-s{background:var(--mtb-suf)}
.mtb .mtb-legend{display:flex;flex-wrap:wrap;gap:.3rem 1.1rem;font-size:.85rem;color:var(--mtb-muted);margin:.2rem 0 .8rem}
.mtb .mtb-legend i{display:inline-block;width:.65rem;height:.65rem;border-radius:50%;margin-right:.35rem}
.mtb .mtb-parts{list-style:none;display:grid;gap:.3rem;font-size:.96rem}
.mtb .mtb-parts li{list-style:none;display:block}
.mtb .mtb-parts .mtb-dot{transform:translateY(1px)}

/* Flashcards */
.mtb .mtb-fc-top{display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;align-items:center;margin-bottom:1rem}
.mtb .mtb-fc-top .mtb-small{margin:0}
.mtb .mtb-seg-toggle{display:inline-flex;border:2px solid var(--mtb-ink);border-radius:.55rem;overflow:hidden}
.mtb .mtb-tog{-webkit-appearance:none;appearance:none;font:inherit;font-size:.95rem;padding:.45rem .9rem;border:0;background:transparent;color:var(--mtb-ink);cursor:pointer;margin:0;border-radius:0;box-shadow:none;width:auto;text-transform:none;letter-spacing:normal}
.mtb .mtb-tog[aria-pressed="true"]{background:var(--mtb-ink);color:var(--mtb-paper)}
.mtb .mtb-flash{-webkit-appearance:none;appearance:none;font:inherit;text-transform:none;letter-spacing:normal;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%;max-width:36rem;min-height:15rem;padding:2rem 1.5rem;margin:0;border-radius:1rem;border:2px solid var(--mtb-rule);background:var(--mtb-surface);color:var(--mtb-ink);cursor:pointer;box-shadow:0 6px 0 -2px var(--mtb-rule);text-align:center}
.mtb .mtb-flash.is-flipped{background:var(--mtb-teal-soft);border-color:var(--mtb-teal);box-shadow:0 6px 0 -2px var(--mtb-teal)}
.mtb .mtb-flash-sub{font-size:.85rem;color:var(--mtb-muted)}
.mtb .mtb-flash-main{font-size:clamp(1.4rem,3.6vw,2rem);font-weight:700;line-height:1.25;max-width:30rem}
.mtb .mtb-flash.is-flipped .mtb-flash-main{font-size:clamp(1.1rem,2.6vw,1.35rem);font-weight:600}
.mtb .mtb-flash-hint,.mtb .mtb-flash-ex{font-size:.88rem;color:var(--mtb-muted)}
.mtb .mtb-flash .mtb-segs{justify-content:center}
.mtb .mtb-fc-actions{max-width:36rem}

/* Decoder */
.mtb .mtb-dec-row{display:flex;gap:.5rem;flex-wrap:wrap;max-width:34rem}
.mtb .mtb-dec-row .mtb-in{flex:1 1 14rem;width:auto}
.mtb .mtb-dec-out{margin-top:1.1rem}
.mtb .mtb-dec-word{font-family:var(--mtb-display);font-size:1.6rem;font-weight:700;line-height:1.2;word-break:break-word}
.mtb .mtb-def{margin-top:.9rem;font-size:1.02rem}
.mtb .mtb-tip{margin-top:.7rem;font-size:.93rem;color:var(--mtb-muted)}
.mtb .mtb-tip b{color:var(--mtb-ink)}

/* Dictionary */
.mtb .mtb-dict-filters{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.8rem}
.mtb .mtb-table-wrap{overflow-x:auto;border:1px solid var(--mtb-rule);border-radius:.8rem;background:var(--mtb-surface)}
.mtb .mtb-table{width:100%;border-collapse:collapse;font-size:.95rem;min-width:34rem}
.mtb .mtb-table th{text-align:left;font-size:.85rem;color:var(--mtb-muted);font-weight:700;padding:.6rem .8rem;border:0;border-bottom:1px solid var(--mtb-rule);background:var(--mtb-chip)}
.mtb .mtb-table td{padding:.55rem .8rem;border:0;border-bottom:1px solid var(--mtb-rule);vertical-align:top;background:none}
.mtb .mtb-table tr:last-child td{border-bottom:0}
.mtb .mtb-td-part{font-weight:700;white-space:nowrap}

/* Worksheet */
.mtb .mtb-load{margin-top:1.3rem;padding-top:1.1rem;border-top:1px solid var(--mtb-rule)}
.mtb .mtb-code-in{text-transform:uppercase}
.mtb .mtb-code{background:var(--mtb-chip);padding:.1rem .45rem;border-radius:.35rem;letter-spacing:.04em}
.mtb .mtb-err{color:var(--mtb-bad);font-size:.93rem;margin-top:.5rem}
.mtb .mtb-copy{font-size:.93rem;color:var(--mtb-good);word-break:break-all}

.mtb .mtb-related{margin-top:1.6rem;font-size:.95rem}
.mtb .mtb-disclaimer{font-size:.86rem;color:var(--mtb-muted);border-top:1px solid var(--mtb-rule);margin-top:1.6rem;padding-top:1.1rem}
@media (max-width:600px){ .mtb .mtb-card{padding:1.1rem 1rem} .mtb .mtb-seg-text{font-size:1.1rem} .mtb .mtb-flash{min-height:12rem} }

/* How to use this tool */
.mtb .mtb-howto{margin-top:1.25rem;max-width:44rem;background:var(--mtb-surface);border:1px solid var(--mtb-rule);border-left:4px solid var(--mtb-teal);border-radius:.6rem;padding:0}
.mtb .mtb-howto-sum{cursor:pointer;list-style:none;display:flex;align-items:center;gap:.55rem;padding:.7rem 1rem;font-weight:700;color:var(--mtb-ink)}
.mtb .mtb-howto-sum::-webkit-details-marker{display:none}
.mtb .mtb-howto-sum::before{content:"+";display:inline-grid;place-items:center;width:1.45rem;height:1.45rem;border-radius:50%;background:var(--mtb-teal);color:#fff;font-size:1.05rem;line-height:1;flex:none}
.mtb details[open] > .mtb-howto-sum::before{content:"\2212"}
.mtb .mtb-howto-sum:focus-visible{outline:3px solid var(--mtb-teal);outline-offset:2px}
.mtb .mtb-howto-body{padding:0 1.1rem 1rem 1.1rem;font-size:1.05rem;line-height:1.55}
.mtb .mtb-howto-body p{margin:0 0 .5rem}
.mtb .mtb-howto-what{color:var(--mtb-muted)}
.mtb .mtb-howto-body ol{margin:0 0 .6rem;padding-left:1.6rem}
.mtb .mtb-howto-body li{list-style:decimal;margin:.35rem 0;padding-left:.2rem}
.mtb .mtb-howto-body li::marker{font-weight:700;color:var(--mtb-teal)}
.mtb .mtb-howto-tips{margin-top:.6rem !important;padding-top:.6rem;border-top:1px solid var(--mtb-rule)}
.mtb .mtb-howto-sub{margin-top:.6rem !important}
