/* Study Smarter · Surgery: shared styles (built by Derma-Site/build_site.py) */
:root{
  --bg:#F4F5F8; --surface:#FFFFFF; --fg:#18223A; --muted:#5E6780; --faint:#8A91A5; --line:#E3E6EE; --line2:#EEF0F5;
  --acc:#2B3A67; --on-acc:#FFFFFF; --good:#2D7A4E; --good-bg:#E4F2E9; --bad:#B03A4B; --bad-bg:#F8E3E6; --warn:#9A6A00; --warn-bg:#FBF0D2;
  --yel:#FDF3C4; --yel-line:#EBD27A; --yel-ink:#3D3412;
  --shadow:0 1px 2px rgba(20,30,60,.05),0 4px 16px rgba(20,30,60,.04);
  --font:"Inter","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#12141A; --surface:#1B1E26; --fg:#E7E9EF; --muted:#A1A8B9; --faint:#7C8396; --line:#2C303B; --line2:#252932;
  --acc:#A9B8E8; --on-acc:#12141A; --good:#7CC89C; --good-bg:#1E3328; --bad:#F08C9A; --bad-bg:#3A2228; --warn:#E8C36A; --warn-bg:#352C14;
  --yel:#36311C; --yel-line:#6B5E2A; --yel-ink:#F4E6AE; --shadow:none; color-scheme:dark}
  :root:not([data-theme="light"]) [style*="--hd"]{--hx:var(--hd)}}
:root[data-theme="dark"]{
  --bg:#12141A; --surface:#1B1E26; --fg:#E7E9EF; --muted:#A1A8B9; --faint:#7C8396; --line:#2C303B; --line2:#252932;
  --acc:#A9B8E8; --on-acc:#12141A; --good:#7CC89C; --good-bg:#1E3328; --bad:#F08C9A; --bad-bg:#3A2228; --warn:#E8C36A; --warn-bg:#352C14;
  --yel:#36311C; --yel-line:#6B5E2A; --yel-ink:#F4E6AE; --shadow:none; color-scheme:dark}
[style*="--hd"]{--hx:var(--h)}
:root[data-theme="dark"] [style*="--hd"]{--hx:var(--hd)}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--fg)}
body{font-family:var(--font);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
svg.i{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}
/* header */
header{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line)}
header .in{max-width:1180px;margin:0 auto;padding:10px 20px;display:flex;align-items:center;gap:10px}
.word{display:flex;flex-direction:column;line-height:1.1;text-decoration:none}
.word b{font-size:16px;font-weight:700;letter-spacing:-.01em}
.word span{font-size:12px;color:var(--muted);font-weight:500}
.sp{flex:1}
.pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 12px;font-size:13.5px;font-weight:500;cursor:pointer;white-space:nowrap;text-decoration:none}
.pill:hover{border-color:color-mix(in srgb,var(--acc) 35%,var(--line))}
.pill.on{background:color-mix(in srgb,var(--acc) 10%,var(--surface));border-color:color-mix(in srgb,var(--acc) 35%,var(--line));color:var(--acc);font-weight:600}
.ib{display:inline-grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);background:var(--surface);border-radius:10px;cursor:pointer}
main{max-width:1180px;margin:0 auto;padding:22px 20px 60px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;background:var(--acc);color:var(--on-acc);border-radius:10px;padding:9px 18px;font-weight:600;cursor:pointer;text-decoration:none;font-size:14.5px}
.btn.g{background:var(--surface);color:var(--fg);border:1px solid var(--line);font-weight:500}
.btn[disabled]{opacity:.45;cursor:default}
.btn.armed{background:var(--bad-bg);color:var(--bad);border:1px solid var(--bad)}
.btn.sm{padding:6px 12px;font-size:13.5px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);min-width:0}
.card>h2{display:flex;align-items:center;gap:8px;margin:0;padding:14px 18px 12px;font-size:14.5px;font-weight:600;border-bottom:1px solid var(--line2)}
.card>h2 span{margin-left:auto;font-size:12.5px;font-weight:500;color:var(--muted)}
.cb{padding:14px 18px}
.empty{color:var(--muted);font-size:14px;padding:14px 18px}
.cap{font-size:12.5px;color:var(--muted)}
.bar{height:7px;border-radius:7px;background:var(--line2);overflow:hidden;display:flex}
.bar i{display:block;height:100%}
.seg{display:inline-flex;flex-wrap:wrap;background:var(--line2);border-radius:10px;padding:3px;gap:3px}
.seg button{border:0;background:none;border-radius:8px;padding:7px 14px;font-size:14px;font-weight:500;color:var(--muted);cursor:pointer}
.seg button.on{background:var(--surface);color:var(--fg);font-weight:600;box-shadow:0 1px 3px rgba(20,30,60,.12)}
.tag{display:inline-block;font-size:12.5px;font-weight:600;border-radius:6px;padding:2px 8px;color:#fff;background:var(--hx)}
:root[data-theme="dark"] .tag{color:#12141A}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .tag{color:#12141A}}
/* questions */
.qc{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px 18px;margin:0 0 14px}
.qhead{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin:0 0 6px}
.chip{font-size:12px;font-weight:600;border-radius:999px;padding:1px 9px;background:var(--warn-bg);color:var(--warn)}
.qhead{flex-wrap:wrap}
.chip.past{background:color-mix(in srgb,var(--acc) 12%,var(--surface));color:var(--acc)}
.mk{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:999px;padding:3px 10px 3px 8px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit}
.mk svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
.mk:hover{border-color:var(--faint);color:var(--fg)}
.mk.on{border-color:var(--warn);background:var(--warn-bg);color:var(--warn)}
.mk.on svg{fill:currentColor}
.stem{font-size:17px;font-weight:600;margin:4px 0 12px;line-height:1.45}
.opt{display:flex;gap:10px;width:100%;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:11px 12px;margin:7px 0;cursor:pointer;align-items:flex-start}
.opt .l{font-weight:700;color:var(--muted);min-width:16px}
.opt:hover:not([disabled]){border-color:var(--acc)}
.opt[disabled]{cursor:default}
.opt.pick{border-color:var(--acc);background:color-mix(in srgb,var(--acc) 8%,var(--surface))}
.opt.right{border-color:var(--good);background:var(--good-bg)} .opt.right .l{color:var(--good)}
.opt.wrong{border-color:var(--bad);background:var(--bad-bg)} .opt.wrong .l{color:var(--bad)}
.ansbar{background:var(--yel);border-left:4px solid var(--yel-line);color:var(--yel-ink);border-radius:8px;padding:9px 12px;font-weight:600;margin:10px 0 0}
.photo{display:block;margin:4px 0 10px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:6px;text-align:center}
.photo img{max-width:100%;max-height:420px;border-radius:6px;cursor:zoom-in}
.sc{font-size:15.5px;margin:0 0 6px;line-height:1.5}
.ex{margin:12px 0 0;border-top:1px solid var(--line2);padding-top:10px}
.ex ul{margin:0;padding-left:20px}.ex li{margin:3px 0}
.imgretry{display:block;margin:10px auto}
.exi{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0}
.exi img{height:120px;max-width:100%;border-radius:8px;border:1px solid var(--line);background:#fff;cursor:zoom-in;object-fit:cover}
.qact{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0 0}
.qact .res{font-weight:600;font-size:14px}
.ok{color:var(--good);font-weight:600}.no{color:var(--bad);font-weight:600}
.pglink{font-size:13px;color:var(--muted)}
.pglink a{color:var(--acc);font-weight:600}
/* zoom overlay */
.zoom{position:fixed;inset:0;z-index:40;background:rgba(10,14,25,.85);overflow:auto;-webkit-overflow-scrolling:touch}
.zoom img{display:block;margin:0 auto;background:#fff;width:100%;max-width:none;cursor:zoom-in}
.zoom.big img{width:auto;max-width:none;cursor:zoom-out}
.zoom .x{position:fixed;top:12px;right:12px;z-index:41;border:0;border-radius:10px;background:#fff;color:#18223A;font-weight:600;padding:8px 14px;cursor:pointer}
/* modal */
.modal{position:fixed;inset:0;z-index:30;background:rgba(10,14,25,.45);display:grid;place-items:center;padding:16px}
.modal .box{width:min(420px,100%);background:var(--surface);border-radius:16px;border:1px solid var(--line);padding:20px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.modal h3{margin:0 0 6px;font-size:18px}
.modal p{margin:0 0 12px;color:var(--muted);font-size:14px}
.modal .row{display:flex;gap:8px;margin-top:6px}
.modal .msg{font-size:13.5px;color:var(--muted);margin-top:10px}
@media (max-width:620px){
  header .in,main{padding-left:16px;padding-right:16px}
  .word span{display:none}
  .word b{font-size:14.5px}
  header .in{gap:6px}
  .pill{padding:6px 9px}
  .pill .lbl{display:none}
  .qc{padding:14px}
  .stem{font-size:16px}
}

/* ---- Surgery additions (18 Nov 2026) ---- */
.chip.card{background:color-mix(in srgb,var(--hx,#2F6E8F) 14%,var(--surface));color:var(--hx,#2F6E8F)}
.chip.tier{background:var(--line2);color:var(--muted)}
.chip.tier.tA{background:#FCE3E3;color:#B42318}.chip.tier.tB{background:#FFF0D6;color:#9A5B00}.chip.tier.tC{background:#E8ECF1;color:#4B5768}
.chip.beyond{background:#EFE7FB;color:#6A3FB5}
.photo img+img{margin-left:6px}
.notesbox{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 2px 10px 2px;margin:10px 0 0;overflow:hidden;max-width:100%;min-width:0}
.qc{min-width:0;max-width:100%}
.deptl{margin:8px 0 0}
.notes{--row:6.8mm;--fs:13.5pt;--ink:#1A1A1A;--name:#1F3FC4;--struct:#1F3FC4;--blk:#1A1A1A;--grn:#17803A;--red:#E0222E;
  --pur:#8B2A9E;--org:#F07D00;--pnk:#C2187A;--pill:#CDEEFA;--hd:#333;--hl:#FFF06A;--hand:"Patrick Hand","Segoe Print",cursive;
  width:720px;font-family:var(--hand);font-size:var(--fs);line-height:var(--row);color:var(--ink);margin:0 auto}
.notes *{margin:0;padding:0;box-sizing:border-box}
.notes *{box-sizing:border-box;margin:0;padding:0}
.notes .ttl{text-align:center;height:calc(var(--row) * 2);margin-bottom:var(--row)}
.notes .ttl b{display:inline-block;font-weight:normal;border:3px solid var(--blk);padding:0 6mm;color:var(--blk);
  font-size:23pt;line-height:calc(var(--row) * 2 - 6px);letter-spacing:1.5px;text-transform:uppercase}
.notes .l{min-height:var(--row)}
.notes .i1{padding-left:7mm}
.notes .i2{padding-left:15mm}
.notes .i3{padding-left:24mm}
.notes .i4{padding-left:34mm}
.notes .gap{height:var(--row)}
.notes .pill{display:inline-block;background:var(--pill);border-radius:999px;padding:0 4mm 0 3mm;color:var(--blk);line-height:calc(var(--row) - 1.2mm);margin:.6mm 0}
.notes .pill::before{content:"• "}
.notes .k{color:var(--struct,var(--blk))}
.notes .g{color:var(--name,var(--grn))}
.notes .r{color:var(--red)}
.notes .p{color:var(--pur)}
.notes .o{color:var(--org)}
.notes .m{color:var(--pnk)}
.notes .u{text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:2px}
.notes .ar::before{content:"→ ";color:inherit}
.notes .hk::before{content:"↳ ";color:inherit}
.notes .num{display:inline-block;width:1.25em;height:1.25em;line-height:1.15em;border:1.6px solid currentColor;border-radius:50%;text-align:center;font-size:.8em;margin-right:1.2mm;vertical-align:.08em;text-indent:0}
.notes .br{display:flex;align-items:center}
.notes .br svg{flex:0 0 auto;width:4mm;margin:0 2mm}
.notes .br .br-l{display:flex;flex-direction:column}
.notes .tb{display:grid;background:#fff;outline:1.6px solid var(--struct,var(--blk));margin:0 1mm;color:var(--ink)}
.notes .tb>div{padding:0 2mm;box-shadow:inset 1.2px 0 0 var(--struct,var(--blk)),inset 0 -1px 0 #AFC0E4}
.notes .tb>.th{background:var(--th,#E4E6EA);color:var(--blk);text-align:center}
.notes .tier{display:inline-block;font:bold 9.5pt "Segoe UI",Arial,sans-serif;line-height:1;padding:1mm 1.6mm .8mm;border-radius:1.2mm;
  vertical-align:.25em;margin-left:1.5mm;color:#fff;text-indent:0;letter-spacing:.3px}
.notes .tier.a{background:#D62828}
.notes .tier.b{background:#E58A00}
.notes .tier.c{background:#6C7A89}
.notes .ttl .tier{vertical-align:.6em;font-size:11pt}
.notes .tb>.rh{color:var(--name,var(--grn))}
.notes .tb>.sp{grid-column:1/-1;text-align:center}
.notes .tb>.c{text-align:center}
.notes .tb.in{margin-left:7mm}
.notes .ch{display:inline-block;background:var(--hl);border-radius:1mm;padding:0 1.5mm;  
  line-height:calc(var(--row) - 2.2mm);color:var(--blk);text-indent:0}
.notes .ch.r{color:var(--red)}
.notes .ch.f{background:var(--pill)}
.notes .hi{background:var(--hl);border-radius:1mm;padding:0 .8mm;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.notes .br svg.bx{flex:0 0 auto;width:4mm;margin:0 2mm}
.notes .br .br-l>*{white-space:nowrap}
.notes .xr{display:flex;gap:6mm;align-items:flex-start;padding-left:7mm}
.notes .xr svg{display:block;width:auto}
.notes .xr .lb{font-family:var(--font,"Patrick Hand");fill:var(--blk)}
.notes .xr .ld{stroke:var(--blk);stroke-width:4;fill:none}
.notes .side{display:flex;align-items:flex-start;gap:4mm}
.notes .side>.col{flex:1 1 0;min-width:0}
.notes .side>svg{flex:0 0 auto;display:block;width:auto}
.notes .side .lb{font-family:var(--font,"Patrick Hand");fill:var(--blk)}
.notes .side .ld{stroke:var(--blk);stroke-width:4;fill:none}
.notes .tb{clear:both}
.notes .tier.c{display:none}
.notes .st{display:flex;align-items:center;gap:4mm;height:var(--row);color:var(--pnk);font-size:18pt;letter-spacing:1px;text-transform:uppercase}
.notes .st::before,.notes .st::after{content:"";flex:1 1 0;border-top:2px solid var(--pnk)}
.notes .st{margin-top:var(--row)}
.notes .st .tier{text-transform:none}
.notes .tree{margin:0}
.notes .tr-h{text-align:center;min-height:var(--row)}
.notes .tr-c{display:grid;grid-template-columns:repeat(var(--n,2),1fr);padding-top:var(--row);position:relative;
  grid-template-columns:var(--cols,repeat(var(--n,2),1fr))}
.notes .tr-c::before{content:"";position:absolute;left:50%;top:0;height:calc(var(--row) * .45);border-left:2px solid var(--struct,var(--blk))}
.notes .tr-c>div{position:relative;padding:0 2mm;min-width:0}
.notes .tr-c>div::before{content:"";position:absolute;left:0;right:0;top:calc(var(--row) * -.55);border-top:2px solid var(--struct,var(--blk))}
.notes .tr-c>div:first-child::before{left:50%}
.notes .tr-c>div:last-child::before{right:50%}
.notes .tr-c>div::after{content:"";position:absolute;left:calc(50% - 1.5mm);top:calc(var(--row) * -.55);width:3mm;height:calc(var(--row) * .5);
  background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 50' preserveAspectRatio='none'><path d='M15 0V44M6 32L15 48L24 32' fill='none' stroke='%231F3FC4' stroke-width='4'/></svg>") no-repeat center/100% 100%}
.notes .tr-c>div>.l.c{text-align:center}
.notes .tr-c>div>.l:not(.c){padding-left:3mm}
.notes .tr-c>div>.l.i1{padding-left:8mm}
.notes .tr-c>div>.l.i2{padding-left:13mm}
.notes .tr-c .side{gap:2mm}
.notes .l.b::before,.notes .l.cn::before{content:"";display:inline-block;width:1.7mm;height:1.7mm;margin-right:1.6mm;vertical-align:.22em;border-radius:50%}
.notes .l.b::before{background:var(--struct,var(--blk))}
.notes .pair{display:grid;grid-template-columns:1fr 1fr}
.notes .pair>div{padding:0 2mm 0 3mm;min-width:0}
.notes .pair>div+div{box-shadow:inset 1.5px 0 0 #B9C6E6}
.notes .hc{text-align:center}
.notes .down{padding-left:var(--x,10mm)}
.notes .down::before{content:"↓";color:var(--struct,var(--blk))}
.notes .st{margin-top:0;font-size:16pt}
.notes .st+*{margin-top:0}
.notes svg{max-width:100%}
.tiers{display:inline-flex;gap:4px;vertical-align:middle}
/* member's marks on cards (18 Nov 2026) */
.ctools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0 0}
.flag{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);background:var(--surface);cursor:pointer;padding:0}
.flag.fr{border-color:#E0222E}.flag.fy{border-color:#E8B400}.flag.fg{border-color:#17803A}
.flag.fr.on{background:#E0222E}.flag.fy.on{background:#F5C518}.flag.fg.on{background:#17803A}
.flagdot.fr{background:#E0222E}.flagdot.fy{background:#F5C518}.flagdot.fg{background:#17803A}
.mynote{margin:8px 0 0;padding:8px 12px;border-left:4px solid #F5C518;background:color-mix(in srgb,#F5C518 12%,var(--surface));border-radius:6px;white-space:pre-wrap;font-size:14.5px}
.notes mark.uhl{background:#FFE066;color:inherit;border-radius:2px;cursor:pointer}
.notes mark.uhl.armed{outline:2px dashed #E0222E}
.pglink{font-size:13.5px}
.deptl{display:flex;gap:8px;flex-wrap:wrap}
