:root{color-scheme:dark;--bg:#071825;--dark:#081b2a;--surface:#102b3e;--surface2:#163749;--surface3:#0d2232;--line:#30546a;--text:#ecf7fd;--muted:#a9c4d0;--mint:#36e1ad;--sky:#79cefa;--gold:#ffc96c;--danger:#ff858b;--violet:#c6aafa;--chat:#102f3b}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif}button,textarea,select,input{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.43;cursor:not-allowed}button:focus-visible,textarea:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--gold);outline-offset:2px}p{line-height:1.55}.app{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:radial-gradient(ellipse at 14% 1%,#16445690,transparent 37%),var(--bg);overflow:hidden}.topbar{background:#081c2bf2;border-bottom:1px solid var(--line);padding:8px clamp(10px,1.5vw,25px);display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:76px}.brand{display:flex;align-items:center;min-width:0;gap:11px}.shield{width:45px;height:45px;border-radius:14px;display:grid;place-items:center;font-size:30px;background:linear-gradient(145deg,#4aebb8,#087f7a);color:#03362c;flex-shrink:0}.brand-copy h1{font-weight:900;letter-spacing:-.035em;font-size:clamp(21px,2vw,30px);margin:1px 0;line-height:1.02}.brand-copy h1 span{font-size:.5em;letter-spacing:0;color:var(--gold)}.brand-small{font-size:9px;font-weight:900;letter-spacing:.13em;color:var(--mint)}.brand-copy p{margin:0;color:var(--muted);font-size:11px;font-weight:650}.metrics{display:flex;gap:12px;align-items:center;margin-left:auto}.metric{min-width:107px;display:grid;grid-template-columns:1fr auto;column-gap:8px;row-gap:3px;font-size:10px;color:var(--muted);font-weight:750}.metric b{color:var(--text);font-size:12px}.metertrack{grid-column:1/3;height:5px;border-radius:100px;background:#010d14;overflow:hidden}.metertrack i{display:block;height:100%;width:50%;border-radius:100px;background:var(--mint);transition:width .35s}.header-actions{display:flex;gap:6px;align-items:center}.small-button{border:1px solid var(--line);color:var(--text);background:var(--surface2);border-radius:10px;padding:9px 10px;white-space:nowrap;font-size:12px;font-weight:750}.icononly{min-width:36px}.mobile-menu{display:none}.main{display:grid;grid-template-columns:minmax(192px,230px) minmax(350px,1.06fr) minmax(350px,.94fr);gap:11px;min-height:0;padding:10px clamp(8px,1.2vw,18px)}.panel{border:1px solid var(--line);border-radius:17px;background:linear-gradient(157deg,var(--surface),var(--surface3));overflow:hidden;min-height:0;min-width:0}.paneltitle{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:13px 15px;border-bottom:1px solid var(--line);background:#17374855}.paneltitle h2{font-size:17px;margin:3px 0 0;letter-spacing:-.02em}.kicker{font-weight:900;font-size:9px;letter-spacing:.13em;color:var(--mint);text-transform:uppercase}.sidebar{display:flex;flex-direction:column}.sidebar-scroll{overflow-y:auto;min-height:0;flex:1;scrollbar-width:thin}.act-label{font-size:10px;padding:13px 12px 5px;color:var(--gold);font-weight:900;letter-spacing:.09em}.case-row{border:1px solid transparent;background:transparent;color:var(--muted);width:calc(100% - 16px);margin:3px 8px;padding:10px 8px;text-align:left;display:flex;align-items:center;gap:9px;border-radius:11px;font-size:12px}.case-row .circle{width:28px;height:28px;border-radius:9px;border:1px solid #406576;display:grid;place-items:center;flex-shrink:0;font-weight:900}.case-row.active{background:#176553;border-color:var(--mint);color:white}.case-row.completed{color:#d8f5e9}.case-row.completed .circle{color:#05392d;background:#4ae0ae;border-color:transparent}.case-row:disabled{opacity:.72}.case-row .mini{font-size:10px;display:block;opacity:.8;margin-top:2px}.communitybox{padding:12px;margin:13px 9px;border-radius:14px;background:linear-gradient(145deg,#16505b,#0a2b3d);border:1px solid #34717b}.communitybox p{font-size:11px;margin:9px 0;color:#d1f4ea}.pulse-people{display:grid;grid-template-columns:1fr 1fr;gap:6px}.relationship{border:1px solid #3a7880;border-radius:9px;padding:6px;font-size:10px}.relationship b{color:var(--gold)}.sidebarfoot{padding:11px;border-top:1px solid var(--line)}.progresshead{font-size:10px;display:flex;justify-content:space-between;color:var(--muted);font-weight:700}.progressbar{height:6px;background:#051622;border-radius:50px;margin:7px 0 12px;overflow:hidden}.progressbar div{height:100%;width:0;background:var(--mint);transition:width .3s}.sidebuttons{display:grid;grid-template-columns:1fr 1fr;gap:5px}.sidebuttons button:last-child{grid-column:span 2}.softbutton{font-size:10px;font-weight:800;border:1px solid #416176;background:#1a4055;color:white;border-radius:9px;min-height:38px;padding:7px}.sidebarfoot p{font-size:9px;color:var(--muted);margin:9px 0 0}.chat,.lab{display:flex;flex-direction:column}.chat-header{min-height:65px;display:flex;align-items:center;padding:10px 13px;gap:10px;background:#183d4c;border-bottom:1px solid var(--line)}.chat-avatar{font-size:22px;background:#226c69;border-radius:50%;width:41px;height:41px;display:grid;place-items:center;flex-shrink:0}.chat-heading{min-width:0;flex:1}.chat-heading strong{display:block;font-size:13px}.chat-heading span{font-size:10px;color:#b9d4dc}.casepill{background:#0c2d37;border:1px solid #2c6d6d;border-radius:8px;color:var(--mint);padding:6px 8px;font-size:10px;font-weight:850;white-space:nowrap}.chatfeed{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 13px 9px;background:radial-gradient(#eafaff0b 0.8px,transparent 1px) 0 0/19px 19px,linear-gradient(115deg,#0a2635,#153745);scrollbar-width:thin}.bubble{max-width:92%;width:max-content;min-width:140px;border-radius:4px 17px 17px 17px;padding:11px 13px;border:1px solid #487185;background:#20495a;margin-bottom:11px;animation:pop .17s ease-out}.bubble.self{border-radius:17px 4px 17px 17px;margin-left:auto;background:#165e51;border-color:#2d987d}.bubble.system{border:1px dashed #547c85;background:#163544;max-width:100%;margin:13px auto;text-align:center}.bubble .sender{color:#a5ffdc;font-size:11px;font-weight:850;margin:0 0 5px}.bubble p{margin:0;font-size:12px;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}.bubble small{display:block;color:#b6cfda;font-size:10px;margin-top:7px}.bubble .chat-media{width:100%;display:block;border-radius:11px;margin:9px 0 4px;max-height:205px;object-fit:cover;cursor:zoom-in}.bubble .attachment{border-top:1px solid #ffffff29;margin-top:7px;padding-top:7px;color:#b2f5dc;font-size:10px}.typing{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:11px;padding:6px 0 14px}.typing span{width:5px;height:5px;border-radius:50%;background:var(--mint);animation:blink 1s infinite}.typing span:nth-child(3){animation-delay:.2s}.typing span:nth-child(4){animation-delay:.4s}@keyframes blink{50%{opacity:.25}}@keyframes pop{from{transform:translateY(5px);opacity:0}to{transform:translateY(0);opacity:1}}.result-card{border:1px solid #538a98;background:linear-gradient(150deg,#214d60,#0e3445);border-radius:16px;padding:15px;margin:15px 0;color:#e9f9fd}.result-card h3{margin:5px 0 8px;font-size:20px}.result-card p{font-size:12px}.result-card .inline-stat{font-size:11px;color:var(--mint);font-weight:700}.round-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.result-card .round-actions button{min-height:40px}.composer{padding:11px 13px 12px;border-top:1px solid var(--line);background:#0c2937;display:grid;gap:7px}.composer-label{display:flex;align-items:flex-end;justify-content:space-between;gap:8px}.composer-label strong{display:block;font-size:12px}.proofcount{font-size:10px;color:var(--gold);white-space:nowrap}.choicebar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.choice{min-height:38px;border-radius:9px;border:1px solid #456b7d;background:#244657;color:#e7f7f5;font-size:10px;font-weight:850;padding:6px 4px}.choice:hover{background:#2b6071}.choice.selected{border-color:var(--mint);background:#117a67;color:#fff;box-shadow:inset 0 0 0 1px #55e9b5}.reply-label{font-size:10px;color:var(--mint);font-weight:850}.reply-label span{font-weight:500;color:var(--muted)}.composer textarea{width:100%;min-height:54px;max-height:95px;resize:vertical;background:#061d29;border:1px solid #466c7b;border-radius:10px;padding:9px 11px;color:var(--text);font-size:12px;line-height:1.4}.composer-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px}.composer-bottom select{color:var(--text);border-radius:8px;padding:7px 9px;background:#1d4253;border:1px solid #4e7887;font-size:11px;min-height:36px}.send-button,.primary{border:0;background:var(--mint);color:#07352b;border-radius:10px;font-weight:900;font-size:12px;min-height:39px;padding:9px 16px}.send-button span{margin-left:8px}.lab .paneltitle{min-height:65px}.evidencebadge{border-radius:8px;background:#1b6959;padding:7px 10px;font-size:11px;font-weight:850}.labscroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:11px 12px 22px;scrollbar-width:thin}.disclaimer{padding:9px 10px;background:#6147205c;border:1px solid #987941;border-radius:10px;color:#ffe9c0;font-size:10px;line-height:1.45}.case-card{display:flex;gap:11px;padding:12px 0;align-items:center}.case-card img{width:41%;height:113px;object-fit:cover;border-radius:12px;cursor:zoom-in}.case-card div{flex:1}.case-card h3{font-size:16px;margin:4px 0}.case-card p{font-size:11px;color:var(--muted);margin:0 0 6px}.textbutton{border:0;background:none;color:var(--sky);font-size:11px;font-weight:800;padding:4px;text-decoration:underline;text-underline-offset:3px}.lab-subhead{display:flex;justify-content:space-between;gap:8px;align-items:center}.lab-subhead h3{font-size:12px;margin:6px 0 9px}.lab-subhead span{font-size:10px;color:var(--muted)}.toolgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.tool{display:flex;align-items:flex-start;gap:9px;min-height:64px;text-align:left;border:1px solid #42718a;border-radius:11px;background:#1b4358;color:white;padding:10px}.tool:hover{background:#24556b}.tool.selected{background:#146153;border-color:var(--mint)}.tool.clipped{border-color:var(--mint)}.tool .ico{font-size:18px}.tool strong{font-size:11px;display:block}.tool small{font-size:10px;color:#bfd5df;display:block;margin-top:4px}.inspector{background:#0a2637;border:1px solid #365f70;border-radius:13px;margin-top:11px;padding:13px;min-height:138px}.inspector-empty{display:grid;place-items:center;text-align:center;color:var(--muted);font-size:11px;min-height:105px;line-height:1.65}.inspector h4{color:var(--sky);font-size:13px;margin:0 0 7px}.inspector p{font-size:11px;margin:6px 0 10px}.inspector .clue-observation{border-left:3px solid var(--sky);padding:9px 10px;background:#173c4e;border-radius:7px}.inspect-badge{color:var(--gold);font-size:10px;font-weight:800}.compare{position:relative;margin:9px 0;border-radius:9px;overflow:hidden;aspect-ratio:2.35;touch-action:pan-y}.compare img{height:100%;width:100%;object-fit:cover;position:absolute;inset:0}.compare .front{clip-path:inset(0 50% 0 0)}.compare .dividerline{position:absolute;width:3px;height:100%;background:white;left:50%;box-shadow:0 0 0 1px #0007}.compare input{position:absolute;bottom:7px;left:8%;width:84%;accent-color:var(--mint);z-index:2;touch-action:pan-x}.compare .comparelabels{position:absolute;z-index:1;top:7px;left:7px;right:7px;display:flex;justify-content:space-between;font-size:9px;color:#fff;text-shadow:0 1px 5px #000;font-weight:850}.checklist{display:grid;gap:6px;margin:10px 0}.checklist button{padding:8px 9px;background:#214b5b;border:1px solid #4d7789;border-radius:9px;color:white;text-align:left;font-size:11px;min-height:40px}.checklist button.selected{border-color:var(--mint);background:#175c4e}.clue-action{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-top:9px}.clue-action button{background:var(--mint);color:#042f27;border:0;border-radius:9px;padding:9px 13px;font-size:11px;font-weight:900}.clue-action small{color:var(--muted);font-size:10px}.evidence-board{margin-top:14px;padding-top:8px;border-top:1px solid var(--line)}.board-items{display:flex;flex-wrap:wrap;gap:6px}.board-item{border:1px solid #3e987e;background:#16483f;color:#ccffe9;font-size:10px;font-weight:700;border-radius:9px;padding:7px 9px}.board-empty{color:var(--muted);font-size:11px;padding:6px}.source-note{border-top:1px solid var(--line);padding:14px 0;margin-top:14px;color:var(--muted);font-size:10px;line-height:1.55}.footerline{display:flex;justify-content:space-between;gap:10px;border-top:1px solid var(--line);background:#071824;padding:7px 18px;font-size:9px;color:var(--muted)}.mobiletabs{display:none}.overlay[hidden]{display:none}.overlay{position:fixed;inset:0;background:#010d17d9;display:flex;align-items:center;justify-content:center;padding:15px;z-index:200;backdrop-filter:blur(3px)}.dialog{width:min(690px,100%);max-height:90dvh;overflow:auto;border:1px solid #52839a;border-radius:19px;background:#112e42;padding:21px;box-shadow:0 24px 80px #0009}.dialogtop{display:flex;justify-content:space-between;align-items:center}.xbtn{background:#1d4257;color:white;border:1px solid #53849a;border-radius:9px;padding:7px 11px;min-width:38px;font-size:15px}.dialog h2{font-size:26px;margin:6px 0 10px;line-height:1.15}.dialog h3{font-size:15px;margin:10px 0 4px;color:var(--gold)}.dialog p,.dialog li{font-size:13px;line-height:1.65;color:#d2e6ef}.dialog a{color:#94e3ff}.dialog .callout{border:1px solid #4e7c8c;border-radius:12px;background:#0a2536;padding:14px;margin:12px 0}.modalbuttons{display:flex;justify-content:flex-end;gap:9px;margin-top:17px;flex-wrap:wrap}.secondary{border:1px solid #4a7585;background:#1d4558;color:#fff;border-radius:10px;padding:10px 14px;font-size:12px;font-weight:800}.certificate-preview{border:4px double #b8a16b;border-radius:9px;background:#fffdf3;color:#1e3542;padding:20px;text-align:center}.certificate-preview h2{font-family:Georgia,serif;font-size:27px;color:#0c5a54}.certificate-preview p{color:#374d52}.certificate-preview .certline{border-bottom:1px solid #aaa;width:75%;margin:20px auto;padding-bottom:5px;font-family:Georgia,serif;font-size:20px}.certificate-preview .certfoot{font-size:10px}.cert-name{width:100%;padding:11px;border:1px solid #3d7285;border-radius:10px;background:#061c2b;color:#fff;margin-top:8px}.lightbox-panel{width:min(95vw,1200px);background:#0b2131;border:1px solid #456b80;border-radius:16px;padding:10px}.lightbox-panel .xbtn{float:right}.lightbox-panel p{font-size:11px;color:#b7d5e1;margin:8px}.lightbox-panel #lightboxStage{height:min(74dvh,800px);overflow:hidden;touch-action:none;position:relative;border-radius:10px;clear:both;background:#07121a}.lightbox-panel img{height:100%;width:100%;object-fit:contain;touch-action:none;transform-origin:center;user-select:none}.certificate{display:none}
body.light{--bg:#e6f2f3;--dark:#e1f1f4;--surface:#f6fcfc;--surface2:#dcefeb;--surface3:#eaf6f7;--line:#8daeb8;--text:#143344;--muted:#46687a;--mint:#087c62;--sky:#155f91;--gold:#9a5b11;--danger:#b22f43;color-scheme:light}body.light .app{background:#e4f1f3}body.light .topbar{background:#f6fcfc}body.light .metric b{color:#143344}body.light .panel{background:linear-gradient(145deg,#f8fcfd,#edf6f7)}body.light .composer{background:#e2f1ef}body.light .composer textarea{background:#fff;color:#183440}body.light .composer-bottom select,body.light .small-button,body.light .softbutton,body.light .tool,body.light .checklist button{background:#deeeef;color:#143344}body.light .footerline{background:#e5f1f3}body.light .chatfeed{background:radial-gradient(#226f8015 1px,transparent 1px) 0 0/19px 19px,#e0ebed}body.light .bubble{background:#fff;color:#183440;border-color:#aac2c4}body.light .bubble.self{background:#d2f1e1}body.light .bubble .sender{color:#006850}body.light .bubble small{color:#527281}body.light .inspector{background:#eaf5f7;color:#234452}body.light .clue-observation{color:#1b3846}body.light .dialog{background:#f4fbfd;color:#153344}body.light .dialog p,body.light .dialog li{color:#28495a}body.light .modalbuttons .secondary{background:#daedf0;color:#173b4c}body.light .disclaimer{color:#694300;background:#fff1d0}body.light .casepill{color:#bdf9e4}body.light .labscroll .source-note{color:#365668}body.light .tool small{color:#466678}
@media(max-width:1250px){.main{grid-template-columns:184px minmax(320px,1fr) minmax(320px,1fr)}.metrics{gap:6px}.metric{min-width:86px}.paneltitle h2{font-size:15px}.brand-copy h1{font-size:22px}}
@media(max-width:1020px){.metrics{display:none}.main{grid-template-columns:155px minmax(300px,1fr) minmax(305px,1fr)}.sidebar .case-row{font-size:11px}.brand-small{font-size:8px}.brand-copy h1{font-size:20px}.brand-copy h1 span{display:none}}
@media(max-width:850px){.app{grid-template-rows:auto auto minmax(0,1fr) auto}.topbar{min-height:58px;padding:6px 9px}.brand-copy h1{font-size:17px}.brand-copy p{font-size:9px}.brand-small{font-size:7px}.shield{height:38px;width:38px;font-size:24px}.header-actions{gap:4px}.header-actions .small-button{font-size:10px;padding:7px}.mobile-menu{display:inline-flex}.mobiletabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px 8px 2px}.mobiletabs button{background:#18445a;border:1px solid #477789;color:#fff;border-radius:10px;padding:9px;font-size:11px;font-weight:900;min-height:38px}.mobiletabs button.selected{background:#127762;border-color:#4ce2af}.main{display:grid;grid-template-columns:1fr;padding:7px;gap:0}.chat,.lab{grid-area:1/1}.chat{display:flex}.lab{display:none}.app.show-lab .chat{display:none}.app.show-lab .lab{display:flex}.sidebar{position:fixed;z-index:130;top:65px;left:7px;bottom:7px;width:min(310px,90vw);box-shadow:0 10px 0 500vw #03121dc9;display:none}.app.show-cases .sidebar{display:flex}.chatfeed{padding:12px}.composer{padding:8px;gap:6px}.choicebar{gap:4px}.choice{font-size:10px;min-height:39px}.reply-label span{display:none}.footerline span:last-child{display:none}.footerline{padding:4px 9px;font-size:8px;min-height:19px}.case-card img{height:105px}.labscroll{padding:10px}.dialog{padding:16px}}
@media(max-width:400px){.topbar{gap:5px}.brand-copy h1{font-size:15px}.brand-copy p{font-size:8px}.shield{width:34px;height:34px}.header-actions .icononly{min-width:29px;padding:6px}.chat-header{min-height:53px;padding:7px}.chat-heading strong{font-size:12px}.chat-heading span{font-size:9px}.choice{font-size:9px;padding:5px 2px}.chatfeed .bubble{max-width:97%}.composer textarea{min-height:47px}.dialog h2{font-size:22px}}
@media(max-height:680px) and (min-width:851px){.topbar{min-height:56px;padding:5px 12px}.main{padding:6px}.composer textarea{min-height:45px}.composer{padding:7px;gap:5px}.choice{min-height:33px}.labscroll{padding:8px}.case-card img{height:90px}.paneltitle{padding:9px}.footerline{padding:4px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
@media print{body>*:not(#printCertificate){display:none!important}#printCertificate{display:block!important;width:100%;min-height:95vh;padding:14mm;color:#18313f;background:white}#printCertificate .certificate-preview{border:5px double #8f7741;padding:24mm 8mm;height:244mm;display:flex;flex-direction:column;justify-content:center}#printCertificate .certificate-preview h2{font-size:35px}#printCertificate .certificate-preview .certline{font-size:30px}}

.bubble .sender{display:flex;align-items:center;gap:7px}.personicon{display:inline-grid;place-items:center;flex-shrink:0;width:23px;height:23px;border-radius:50%;background:linear-gradient(145deg,#eab35e,#b47189);border:1px solid #f9d89b;color:#122f39;font-size:9px;font-weight:1000}.bubble.self .personicon{background:linear-gradient(145deg,#4ae2ba,#62baf0);border-color:#9de4f9}

/* v3.1: readable light theme, media controls, delivery receipt, and owner-only QA */
[hidden]{display:none!important}
#stopMediaBtn{background:#9a3b43;color:#fff;border-color:#ca737c;font-weight:900}
.post-receipt{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:#0a705c;border-top:1px solid #4af0b4;color:#fff;font-size:11px;font-weight:800}
.post-receipt button{background:#d8fff2;color:#064b3f;border:0;border-radius:8px;min-height:32px;padding:5px 10px;font-weight:900;font-size:11px;white-space:nowrap}
.voiceplay,#listenTool{touch-action:manipulation;min-height:38px}
.footerline a{color:#9cecca;text-underline-offset:2px;font-weight:800}
.footerline a:hover{color:#fff}
button:disabled{opacity:.50;cursor:not-allowed}
body.light .topbar,body.light .brand-copy h1,body.light .brand-copy h1 span,body.light .brand-copy p,body.light .brand-small{color:#153645}
body.light .shield{color:#073d31}
body.light .sidebar .paneltitle,body.light .chat-header,body.light .lab .paneltitle{background:#e6f3f4;color:#19394b}
body.light .case-row,body.light .case-row .mini,body.light .act-label,body.light .progresshead,body.light .sidebarfoot p{color:#2e5361}
body.light .case-row.active{background:#d0f2e8;color:#124939;border-color:#319e7f}
body.light .case-row.completed{color:#144c3b}
body.light .bubble.system{background:#d9edf1;color:#264957;border-color:#9bbcc5}
body.light .bubble.self{background:#d1f1df;color:#123c33}
body.light .bubble .attachment{color:#426375;border-color:#8bafa9}
body.light .post-receipt{background:#c7f1e2;color:#105542;border-top-color:#60b698}
body.light .post-receipt button{background:#1a745b;color:#fff}
body.light .choice{background:#deebed;color:#173c4b;border-color:#8faeb7}
body.light .choice:hover{background:#c4e4e7}
body.light .choice.selected{background:#116c58;color:#fff;border-color:#168368}
body.light .send-button,body.light .primary{background:#168468;color:#fff}
body.light .send-button:disabled{background:#93cbb9;color:#224b42}
body.light .tool{background:#e3f1f3;color:#194051;border-color:#a1c0c8}
body.light .tool.selected,body.light .tool.clipped{background:#cfefe4;color:#124839;border-color:#269d7a}
body.light .tool small,body.light .tool.selected small{color:#385e6b}
body.light .inspector{background:#e9f6f8;color:#18384a;border-color:#9dbfc5}
body.light .inspector .clue-observation{background:#dceff4;color:#1d4353}
body.light .checklist button{background:#d8edf2;color:#163b4c;border-color:#88afb9}
body.light .board-item{background:#d1efe4;color:#13533e;border-color:#67b497}
body.light .result-card{background:linear-gradient(145deg,#ecfbfd,#d7edf0);color:#153d4b;border-color:#8bb7bd}
body.light .result-card .inline-stat{color:#0e654f}
body.light .source-note{color:#365b6b}
body.light .footerline a{color:#0b6c59}
body.light .footerline a:hover{color:#08372e}
/* In the original build, light-mode dialog callouts remained dark while text became dark. */
body.light .dialog{background:#f6fbfc;color:#153948;border-color:#8ab6c3}
body.light .dialog h2,body.light .dialog strong,body.light .dialog label,body.light .dialog .kicker{color:#143e4e}
body.light .dialog h3{color:#855000}
body.light .dialog p,body.light .dialog li,body.light .dialog small{color:#294c5c}
body.light .dialog .callout{background:#e7f3f5;color:#163c4c;border-color:#a2c3cd}
body.light .dialog .callout strong,body.light .dialog .callout label,body.light .dialog .callout p{color:#193e4d}
body.light .dialog .callout select,body.light .dialog .callout input:not([type=checkbox]),body.light .cert-name{background:#fff;color:#153947;border:1px solid #8aaeb8}
body.light .dialog .secondary{background:#d4ecef;color:#174155;border-color:#84acba}
body.light .dialog .secondary:hover{background:#bce1e7}
body.light .dialog .primary{background:#168468;color:#fff}
body.light .dialog a{color:#0b677a}
body.light .dialog .xbtn{background:#d8ebee;color:#14384a;border-color:#91b2bc}
body.light .dialog .subtle{color:#335867}
body.light .dialog .certificate-preview{background:#fffdf3;color:#1e3542}
body.light .dialog .certificate-preview h2{color:#0c5a54}
body.light .dialog .certificate-preview h3{color:#916313}
body.light .dialog .certificate-preview p{color:#374d52}
body.light .dialog .certificate-preview .award-title{color:#936b2e}
body.light .dialog .certificate-preview .certfoot{color:#50606a}
.voice-controls{display:flex;gap:7px;flex-wrap:wrap}
.owner-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.owner-json{font:11px/1.55 ui-monospace,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;color:#d9f8ee}
body.light .owner-json{color:#1d4956}
.qa-cases{display:grid;gap:8px;max-height:52vh;overflow:auto}
.qa-case{background:#0c3241;border:1px solid #4f8193;padding:10px;border-radius:10px;display:grid;gap:5px;font-size:12px}
.qa-case span{font-size:11px;color:#d4f7e9}
.qa-case small{font-size:10px;color:#b4cbd2}
.qa-case details{font-size:11px;color:#cce7eb}
body.light .qa-case{background:#e5f3f6;color:#173c4c;border-color:#a2bdc7}
body.light .qa-case span,body.light .qa-case small,body.light .qa-case details{color:#244c5c}
.certificate-preview{position:relative;overflow:hidden;padding:24px 22px;background:#fffdf5;color:#1c3a4b}
.certificate-preview .award-brand{font-size:12px;color:#0f6855;font-weight:950;letter-spacing:.14em}
.certificate-preview .award-seal{font-size:34px;margin:9px 0;color:#9c7836}
.certificate-preview .award-title{font:700 12px Georgia,serif;letter-spacing:.16em;color:#9d7335;margin-top:6px}
.certificate-preview .award-subtitle{font-weight:750}
.certificate-preview h3{color:#88601a;font:700 20px Georgia,serif;margin:8px 0}
.certificate-preview .award-stats{display:flex;justify-content:center;gap:30px;flex-wrap:wrap;border-top:1px solid #d0c5a3;margin:16px 0 10px;padding-top:10px;font-size:11px}
.certificate-preview .award-signature{font-weight:900;color:#0b6251;font-size:13px;margin-top:15px}
.certificate-preview .certfoot{color:#4f6163!important;font-size:10px}
.sample-stamp{position:absolute;left:-50px;top:36px;background:#a43741;color:#fff;transform:rotate(-31deg);width:240px;font-size:11px;letter-spacing:.13em;font-weight:900;padding:7px}
.printable-award .award-border{border:1px solid #af975f;padding:22px}
@media (max-width:850px){.post-receipt{padding:6px 8px;font-size:10px}.post-receipt button{font-size:10px;min-height:29px}.footerline a{font-size:8px}}
@media print{#printCertificate .certificate-preview{height:244mm;padding:15mm 10mm}#printCertificate .award-border{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}#printCertificate .award-brand{font-size:17px}#printCertificate .award-title{font-size:19px}#printCertificate .award-seal{font-size:52px}#printCertificate .certificate-preview h2{font-size:42px}#printCertificate .certificate-preview h3{font-size:29px}#printCertificate .award-subtitle{font-size:20px}#printCertificate .award-stats{font-size:15px}#printCertificate .certfoot{max-width:490px}}
/* Final small-screen and light-mode readability refinements */
body.light .chat-heading span,body.light #chatStatus{color:#315868}
body.light .sidebar .case-row .mini{color:#496877}
body.light .case-row:disabled{opacity:.82}
body.light .metric>span,body.light .metric span,body.light .brand-copy p{color:#2a5666}
body.light .round-actions .secondary{color:#fff}
@media(max-width:450px){
  .brand-small{display:none}
  .brand-copy h1{font-size:18px}
  .brand-copy p{font-size:9px;line-height:1.15}
  .topbar{min-height:61px}
  .header-actions{gap:3px}
  .header-actions .small-button{min-height:30px}
  .footerline{line-height:1.35}
}

/* v3.2: responsive soundtrack and realistic paced community messaging */
#musicBtn[aria-pressed="true"]{background:#155846;color:#b4ffe2;border-color:#32aa84}
body.light #musicBtn[aria-pressed="true"]{background:#c9ecdc;color:#185b44;border-color:#59ad8f}
.sound-settings{display:grid;gap:9px;background:var(--field,#123349);padding:15px;border:1px solid var(--line,#4b7589);border-radius:12px;margin:12px 0}
.sound-settings .toggle-row{display:flex;align-items:center;gap:10px;min-height:30px;cursor:pointer}
.sound-settings input[type="checkbox"]{width:17px;height:17px;accent-color:#29cda6}
.sound-settings input[type="range"]{width:100%;accent-color:#27c9a5;touch-action:pan-y}
.sound-settings select{min-width:0;width:100%;margin-top:4px}
body.light .sound-settings{background:#e7f3f5;color:#183d4d;border-color:#a1bfca}
body.light .sound-settings .subtle{color:#315c6c}
.typing{display:flex;align-items:center;gap:5px;min-height:41px;padding:12px 16px;max-width:max-content;background:#21435a;border:1px solid #3e7585;border-radius:16px;color:#c4e2e6;font-size:12px;margin:10px 0}
.typing span{width:5px;height:5px;background:#42dcb5;border-radius:50%;animation:typing-bounce 1.1s ease-in-out infinite;opacity:.4}
.typing span:nth-child(2){animation-delay:.17s}.typing span:nth-child(3){animation-delay:.34s}
@keyframes typing-bounce{0%,70%,100%{transform:translateY(0);opacity:.45}35%{transform:translateY(-4px);opacity:1}}
body.light .typing{background:#e0f0f3;color:#315463;border-color:#8ebec7}
@media(max-width:480px){.sound-settings{padding:10px}.header-actions{gap:2px}#musicBtn{min-width:29px}}


/* v3.2.1 accessible light-mode Community Pulse cards: the original panel kept dark-fill colors but inherited dark text. */
body.light .communitybox{background:linear-gradient(145deg,#e3f5f3,#d5eceb);border-color:#78abb0;color:#173e4a}
body.light .communitybox p{color:#254c56}
body.light .communitybox .kicker{color:#00624f}
body.light .communitybox .relationship{background:#f8fdfd;border:1px solid #8eb6ba;color:#173e4b;font-weight:700}
body.light .communitybox .relationship b{color:#006a53}
body.light .chatfeed .bubble .sender{color:#075d4b}
body.light .communitybox .pulse-people *{opacity:1}
body.light .progressbar{background:#c5dce2}
body.light .metric .metertrack{background:#c4d9e0}
body.light .act-label{color:#815007}
@media (forced-colors:active){.communitybox,.relationship{forced-color-adjust:auto}}
