:root{--bg:#f4f6f8;--panel:#fff;--border:#d6dde3;--text:#1f2d3a;--muted:#65758a;--accent:#1f6f8b;--accent-soft:#e3f0f4;--donate:#c2557a;--strip:#eaf3e6;--radius:6px}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);margin:0;font-family:Segoe UI,system-ui,-apple-system,Arial,sans-serif;font-size:15px}.app{flex-direction:column;min-width:1100px;height:100vh;display:flex}.topbar{background:var(--panel);border-bottom:1px solid var(--border);align-items:center;gap:24px;height:56px;padding:0 20px;display:flex}.brand{white-space:nowrap;font-size:17px;font-weight:700}.brand-logo{vertical-align:middle;border-radius:50%;width:36px;height:36px;margin-right:8px}.tabs{flex:1;gap:4px;height:100%;display:flex}.tab{font:inherit;color:var(--muted);cursor:pointer;background:0 0;border:none;border-bottom:3px solid #0000;padding:0 14px}.tab:hover:not(:disabled){color:var(--text)}.tab.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.tab.locked{cursor:not-allowed;opacity:.55}.actions{gap:8px;display:flex}.btn{border:1px solid var(--accent);border-radius:var(--radius);background:var(--panel);color:var(--accent);font:inherit;cursor:pointer;padding:7px 14px;text-decoration:none;display:inline-block}.btn:hover{background:var(--accent-soft)}.btn-donate{border-color:var(--donate);color:var(--donate)}.btn-donate:hover{background:#fbe9ef}.btn-small{padding:4px 10px;font-size:13px}.workspace{flex:1;grid-template-columns:2fr 1fr;gap:16px;min-height:0;padding:16px 20px;display:grid}.work-area,.findings{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);overflow:auto}.work-area h1{margin:0 0 12px;font-size:20px}.findings{flex-direction:column;display:flex}.findings-header{border-bottom:1px solid var(--border);flex-direction:column;gap:6px;padding:14px 16px;display:flex}.findings-header h2{margin:0 0 4px;font-size:16px}.findings-buttons{gap:6px;margin-top:6px;display:flex}.findings-text{flex:1;padding:14px 16px;font-family:Consolas,Courier New,monospace;font-size:14px}.placeholder{color:var(--muted);font-style:italic}.mascot-strip{background:var(--strip);border-top:1px solid var(--border);justify-content:space-between;align-items:center;height:72px;padding:0 20px;display:flex}.mascot-world{align-items:center;width:50%;height:100%;display:flex;position:relative}.house{font-size:34px}.mascot{color:var(--accent);font-size:22px;animation:12s ease-in-out infinite alternate wander;position:absolute;left:60px}@keyframes wander{0%{left:60px}to{left:85%}}.mascot-world.quiet .mascot{animation:none}@media (prefers-reduced-motion:reduce){.mascot{animation:none}}.footer-info{color:var(--muted);align-items:center;gap:20px;font-size:13px;display:flex}@media print{.topbar,.work-area,.mascot-strip,.findings-header{display:none}.app{min-width:0;height:auto}.workspace{padding:0;display:block}.findings{border:none}}.selection-note{color:var(--muted);margin:10px 0 12px;font-size:14px}.message{color:#a3561c}.conditions{grid-template-columns:minmax(260px,1fr) minmax(360px,1.3fr);align-items:start;gap:20px;display:grid}.conditions h4{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:0 0 6px;font-size:13px}.grid-note{text-transform:none;letter-spacing:0;margin-left:6px;font-weight:400}.by-tooth-buttons{grid-template-columns:1fr 1fr;gap:4px;display:grid}.cond-wrap{display:flex}.cond-wrap.wide{grid-column:span 2}.cond-btn{text-align:left;font:inherit;border:1px solid var(--border);background:var(--panel);color:var(--text);cursor:pointer;border-radius:4px;flex:1;padding:4px 8px;font-size:13px}.cond-btn.has-popup:after{content:" …";color:var(--muted)}.cond-btn:hover:not(:disabled){background:var(--accent-soft)}.cond-btn.lit{background:var(--accent);border-color:var(--accent);color:#fff}.cond-btn.lit:after{color:#d8ecf3}.cond-btn:disabled,.reason-btn:disabled{opacity:.4;cursor:not-allowed}.reason-btn{font:inherit;border:1px solid var(--border);background:var(--panel);color:var(--accent);cursor:pointer;border-radius:4px;margin-left:2px;padding:0 6px;font-size:11px}.by-surface.disabled .surface-grid{opacity:.55}.surface-grid{border-collapse:collapse;font-size:13px}.surface-grid th{padding:0 4px;font-weight:600}.surface-grid thead th{color:var(--accent);text-align:center;font-size:12px}.surface-grid tbody th{text-align:left;white-space:nowrap;padding-right:10px;font-weight:400}.cell{border:1px solid var(--border);background:var(--panel);width:30px;height:22px;font:inherit;color:#fff;cursor:pointer;border-radius:3px;padding:0;font-size:11px;font-weight:700}.cell:hover:not(:disabled){border-color:var(--accent)}.cell:disabled{cursor:not-allowed;background:#eef1f4;border-color:#e6eaee}.cell.lit.existing{background:#2f6fd0;border-color:#2f6fd0}.cell.lit.pathology{background:#d0453b;border-color:#d0453b}.findings-options{grid-template-columns:1fr 1fr;gap:2px 10px;font-size:13px;display:grid}.muted{color:var(--muted)}.btn:disabled{opacity:.45;cursor:not-allowed}.findings-text{font-family:inherit}.finding-line{cursor:text;border-radius:4px;align-items:flex-start;gap:8px;padding:6px;font-family:Consolas,Courier New,monospace;font-size:13.5px;line-height:1.5;display:flex}.finding-line:hover{background:#f4f8fa}.finding-line.current{background:var(--accent-soft)}.line-text{flex:1}.note{font:inherit;color:#5a3d8a;background:0 0;border:none;border-bottom:1px dashed #0000;max-width:100%;margin-left:6px;padding:0}.note::placeholder{color:#0000}.finding-line:hover .note::placeholder,.note:focus::placeholder{color:#b5bfca}.note:focus{border-bottom-color:#b5bfca;outline:none}.copy-line{flex-shrink:0}.print-only{display:none}.popup-backdrop{z-index:10;background:#14233259;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.popup{background:var(--panel);border-radius:8px;min-width:320px;max-width:460px;padding:18px 20px;box-shadow:0 10px 30px #0003}.popup h3{margin:0 0 10px;font-size:16px}.popup fieldset{border:none;margin:0 0 10px;padding:0}.popup legend{color:var(--muted);margin-bottom:4px;font-size:13px;font-weight:600}.choice{cursor:pointer;padding:2px 0;font-size:14px;display:block}.choice.inline{margin-right:12px;display:inline-block}.choice input{margin-right:6px}.popup-buttons{gap:8px;margin-top:8px;display:flex}.spacer{flex:1}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{background:#185a71}.btn-danger{color:#c0392b;border-color:#c0392b}.btn-danger:hover{background:#fbeaea}.tab.attention{color:#d0453b;animation:1.2s ease-in-out infinite blink}@keyframes blink{50%{opacity:.35}}@media (prefers-reduced-motion:reduce){.tab.attention{animation:none}}@media print{.finding-line{display:none}.print-only{white-space:pre-wrap;font-family:Consolas,monospace;display:block}}.work-area{padding:14px 20px}.selection-note{margin:6px 0 8px}.surface-grid td{padding:0 1px 1px}.cell{height:19px}.surface-grid tbody th{font-size:12.5px;line-height:1.1}.cond-btn{padding:3px 8px}.note:placeholder-shown:not(:focus){width:1ch}.line-tag{background:var(--accent-soft);min-width:34px;color:var(--accent);text-align:center;-webkit-user-select:none;user-select:none;border-radius:3px;flex-shrink:0;padding:0 4px;font-weight:700}.treatment{color:#1d7a4a;font-weight:600}.risk{margin-top:4px;font-size:13px;font-weight:600}.risk-high{color:#c0392b}.risk-low{color:#1d7a4a}.row-action{padding-left:4px}.row-btn{border:1px solid var(--border);background:var(--panel);width:20px;height:19px;color:var(--accent);font:inherit;cursor:pointer;border-radius:3px;padding:0;font-size:13px;line-height:1}.row-btn:hover{background:var(--accent-soft)}.extra-row th{color:var(--muted);font-style:italic}.legend{vertical-align:-1px;border-radius:2px;width:12px;height:12px;margin:0 2px 0 8px;display:inline-block}.legend.concern{background:#e3564b}.legend.baseline{background:#f8cbc7}.endo-table-wrap{margin-top:4px;overflow-x:auto}.endo-table{border-collapse:collapse;font-size:12.5px}.endo-table th,.endo-table td{text-align:center;white-space:nowrap;border-bottom:1px solid #edf0f3;padding:3px}.endo-table thead th{color:var(--accent);vertical-align:bottom;font-size:12px;font-weight:600}.endo-table tbody th{text-align:left;font-size:13px}.endo-table select{font:inherit;border:1px solid var(--border);background:#fff;border-radius:3px;max-width:96px;padding:1px 2px;font-size:12px}.endo-table select.abnormal{color:#a3261c;border-color:#d0453b;font-weight:600}.check-head{max-width:48px;line-height:1.1;white-space:normal!important}.check-cell input{width:15px;height:15px}.ept-input{width:46px;font:inherit;border:1px solid var(--border);border-radius:3px;padding:1px 3px;font-size:12px}.ept-head{line-height:1.2}.cutoff{color:var(--muted);font-size:11px;font-weight:400;display:block}.cutoff input{width:40px;font:inherit;border:1px solid var(--border);border-radius:3px;margin-left:2px;padding:0 2px;font-size:11px}.role{text-transform:uppercase;letter-spacing:.03em;font-size:10px;font-weight:600;display:block}.role.concern{color:#c0392b}.role.baseline{color:#d98a83}tr.concern th{border-left:3px solid #e3564b;padding-left:4px}tr.baseline th{border-left:3px solid #f8cbc7;padding-left:4px}.small{margin:0;font-size:12px}.endo-line{cursor:default}.dx{margin-top:4px;font-family:Segoe UI,system-ui,sans-serif;font-size:13.5px}.dx-label{color:var(--accent);font-weight:700}.dx-note{color:#a3561c}.updated{color:#1d7a4a;margin-top:2px;font-size:12px}.line-buttons{flex-direction:column;flex-shrink:0;gap:4px;display:flex}.btn-on{background:var(--accent);color:#fff}.btn-on:hover{background:#185a71}.endo-dx{color:#7a3d8a}.workspace.wide-work{grid-template-columns:2.5fr 1fr}.endo-table select{width:76px;max-width:76px}.endo-table th,.endo-table td{padding:3px 2px}.check-head{max-width:40px;font-size:11px!important}.perio-form{grid-template-columns:1fr 1fr;align-items:start;gap:10px;display:grid}.perio-rest{border:none;margin:0;padding:0;display:contents}.perio-rest:disabled .card{opacity:.45}.card{border:1px solid var(--border);background:#fbfcfd;border-radius:6px;padding:10px 12px}.card h4{text-transform:uppercase;letter-spacing:.04em;color:var(--accent);margin:0 0 8px;font-size:13px}.card .row{flex-wrap:wrap;gap:8px 14px;margin-bottom:6px;display:flex}.field{color:var(--muted);flex-direction:column;gap:2px;font-size:12.5px;display:flex}.field input[type=number]{width:64px;font:inherit;border:1px solid var(--border);color:var(--text);border-radius:3px;padding:2px 4px;font-size:13px}.field select{font:inherit;border:1px solid var(--border);color:var(--text);background:#fff;border-radius:3px;max-width:200px;padding:2px;font-size:13px}.check-field input{width:16px;height:16px;margin-top:3px}.input-unit{align-items:center;gap:4px;display:flex}.input-unit em{font-size:12px;font-style:normal}.check{cursor:pointer;padding:2px 0;font-size:13px;display:block}.radios{flex-wrap:wrap;gap:4px 14px;display:flex}.sub{color:var(--muted);margin:8px 0 2px;font-size:12px;font-weight:600}.hint{color:var(--muted);margin:4px 0 0;font-size:12px}.from-chart{color:#1d7a4a;font-size:12px}.perio-results{font-family:Segoe UI,system-ui,sans-serif}.perio-dx{color:var(--text);margin-bottom:10px;font-size:17px;font-weight:700;line-height:1.35}.reasons{margin-bottom:8px}.reasons ul{margin:2px 0 0;padding-left:18px;font-size:13.5px}.reasons li{margin:2px 0}.perio-form{columns:2;column-gap:10px;display:block}.perio-form .card{break-inside:avoid;margin-bottom:10px}.workspace.plan-work{grid-template-columns:1.7fr 1fr}.plan-tab{flex-direction:column;gap:10px;display:flex}.questionnaire .q-row{flex-wrap:wrap;align-items:center;gap:8px;margin:4px 0;font-size:13px;display:flex}.q-label{min-width:150px;font-size:13px;font-weight:600}.q-tooth{width:54px;font:inherit;border:1px solid var(--border);border-radius:3px;padding:2px 4px;font-size:13px}.q-text{min-width:220px;font:inherit;border:1px solid var(--border);border-radius:3px;flex:1;padding:3px 6px;font-size:13px}.q-block{margin-top:8px}.tag{color:#a3561c;margin-left:4px;font-size:11px;font-style:normal;font-weight:400}.crown-row{flex-wrap:wrap;gap:8px 14px;display:flex}.phase-grid{grid-template-columns:1fr 1fr;align-items:start;gap:10px;display:grid}.phase h4{margin-bottom:6px}.phase-urgent{border-top:4px solid #d0453b}.phase-control{border-top:4px solid #e0a52b}.phase-definitive{border-top:4px solid #1f6f8b}.phase-maintenance{border-top:4px solid #3f9a5c}.plan-items{margin:0;padding:0;font-size:13px;list-style:none}.plan-items li{align-items:flex-start;gap:4px;padding:2px 0;display:flex}.plan-items li label{cursor:pointer}.plan-items li.off label{color:#a3adb8;text-decoration:line-through}.plan-items li.pending label{color:#a3561c;font-style:italic}.plan-items li.added span{color:#5a3d8a;flex:1;padding-left:20px}.add-item{gap:4px;margin-top:6px;display:flex}.add-item input{font:inherit;border:1px solid var(--border);border-radius:3px;flex:1;padding:2px 6px;font-size:12.5px}.plan-text{white-space:pre-wrap;flex:1;margin:0;padding:14px 16px;font-family:Consolas,Courier New,monospace;font-size:13px;line-height:1.5;overflow:auto}.pending-note{color:#a3561c;margin:4px 0 0;font-size:12px;font-weight:600}@media print{.plan-text{display:block}}.terms-backdrop{z-index:50;background:#1423328c;justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.terms{background:var(--panel);border-radius:10px;flex-direction:column;width:min(760px,100%);max-height:calc(100vh - 32px);padding:20px 24px;display:flex;box-shadow:0 16px 40px #00000040}.terms h2{margin:0;font-size:20px}.terms-key{background:#fff8e6;border:1px solid #f0d58c;border-radius:6px;margin:12px 0;padding:10px 14px;font-size:14px}.terms-key ul{margin:6px 0 0;padding-left:20px}.terms-key li{margin:3px 0}.terms-body{border:1px solid var(--border);border-radius:6px;flex:1;min-height:120px;padding:4px 14px;font-size:13px;line-height:1.5;overflow-y:auto}.terms-body h3{margin:12px 0 2px;font-size:13.5px}.terms-body p{margin:0 0 6px}.terms-check{cursor:pointer;align-items:flex-start;gap:8px;margin:12px 0 4px;font-size:13.5px;font-weight:600;display:flex}.terms-check input{flex-shrink:0;width:16px;height:16px;margin-top:3px}.terms-actions{gap:8px;margin-top:10px;display:flex}.terms-declined{color:#8a2a20;background:#fbeaea;border-radius:6px;margin-top:12px;padding:10px 14px;font-size:14px}.footer-info a{color:var(--accent)}.link-btn{font:inherit;color:var(--accent);cursor:pointer;background:0 0;border:none;padding:0;text-decoration:underline}.btn-primary:disabled{background:#9fbfca;border-color:#9fbfca}.plan-notice{color:#6b4a00;background:#fff8e6;border:1px solid #f0d58c;border-radius:6px;margin:4px 0 0;padding:6px 10px;font-size:12.5px}.plan-notice.banner{margin:0;font-size:13px;font-weight:600}.app.reduce-motion *,.app.reduce-motion :before{animation:none!important}:focus-visible{outline-offset:2px;outline:2px solid #1f6f8b}.footer-info label{color:#3d4a59}.app.a11y{--donate:#a8436a;--muted:#4f5d70}.app.a11y .footer-info{color:#3d4a59}.app.a11y .by-surface.disabled .surface-grid{opacity:1}.app.a11y .by-surface.disabled .cell{opacity:.55}.app.a11y .tab.attention{color:#b3261e;animation:none}.app.a11y .tab.attention:before{content:"";vertical-align:1px;background:#d0453b;border-radius:50%;width:8px;height:8px;margin-right:6px;animation:1.2s ease-in-out infinite blink;display:inline-block}.app.a11y .surface-grid td{padding:1px}.app.a11y .cell{height:22px}.app.a11y .cell:not(:disabled),.app.a11y .tooth{border-color:#8a96a3}@media (prefers-reduced-motion:reduce){.app.a11y .tab.attention:before{animation:none}}.tooth-chart{--chart-line:#f28c28;--chart-line-width:3px;flex-direction:column;display:inline-flex}.chart-row{display:flex}.chart-row.upper{border-bottom:var(--chart-line-width) solid var(--chart-line)}.chart-half{display:flex}.chart-half.right{border-right:var(--chart-line-width) solid var(--chart-line)}.tooth{border:1px solid var(--border,#d6dde3);width:40px;height:40px;color:var(--text,#1f2d3a);font:inherit;cursor:pointer;background:#fff;border-radius:0;margin:0;font-weight:600}.tooth+.tooth{border-left:none}.chart-row.lower .tooth{border-top:none}.tooth:hover{background:var(--accent-soft,#e3f0f4)}.tooth.selected{background:var(--accent,#1f6f8b);color:#fff}.tooth.charted{box-shadow:inset 0 -3px #8fb9c9}.tooth.selected.charted{box-shadow:inset 0 -3px #fff}.tooth.missing{color:#a3adb8;text-decoration:line-through}.tooth.selected.missing{color:#fff}.tooth{-webkit-user-select:none;user-select:none}.tooth.blink-concern{animation:1.1s ease-in-out infinite tooth-blink-concern}.tooth.blink-baseline{animation:1.1s ease-in-out infinite tooth-blink-baseline}@keyframes tooth-blink-concern{50%{color:#fff;background:#e3564b}}@keyframes tooth-blink-baseline{50%{background:#f8cbc7}}@media (prefers-reduced-motion:reduce){.tooth.blink-concern{color:#fff;background:#e3564b;animation:none}.tooth.blink-baseline{background:#f8cbc7;animation:none}}.tooth:disabled{cursor:not-allowed}
