.dental-nav{margin-top:4px}
.nav-group.dental-nav{display:grid;gap:5px;margin:8px 0 4px;padding:4px 0 10px;border-top:1px solid #142b40;border-bottom:1px solid #142b40}
.nav-group.dental-nav.hidden{display:none}
.nav-group.dental-nav .nav-section-label{padding-top:8px}
.dental-metrics{margin-bottom:16px}
.dental-dash-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,.8fr) minmax(0,.9fr);gap:14px}
.dental-dash-list{display:grid;gap:8px;max-height:420px;overflow:auto}
.dental-dash-row{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid #1c3a52;border-radius:10px;background:#0d2235;color:inherit;text-align:left;cursor:pointer}
.dental-dash-row strong,.dental-dash-row small{display:block}
.dental-dash-row small{color:#7692a8;margin-top:3px}
.dental-dash-row time{color:#8bb4d4;font-size:.72rem;font-weight:700}
.dental-status{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:999px;border:1px solid #35516a;font-size:.62rem;font-weight:800}
.dental-status.scheduled{color:#8cc6ff;border-color:#396d9f;background:#142f4b}
.dental-status.confirmed{color:#70e2fa;border-color:#2f7287;background:#123641}
.dental-status.arrived,.dental-status.seated{color:#ffdc82;border-color:#8e722f;background:#3d3219}
.dental-status.in-progress{color:#c8b2ff;border-color:#7059a1;background:#302448}
.dental-status.completed{color:#70e3b5;border-color:#347d63;background:#183b31}
.dental-status.cancelled,.dental-status.no-show{color:#ff9ca6;border-color:#743d48;background:#321d29}

.dental-book-page .content,.dental-book-page{min-width:0}
.dental-book-heading{align-items:flex-end}
.dental-book-actions{display:flex;gap:8px}
.dental-book-toolbar{display:flex;align-items:center;gap:14px;margin:-4px 0 14px;flex-wrap:wrap}
.dental-date-nav{display:flex;align-items:center;gap:10px;background:#0c2033;border:1px solid #1c3951;border-radius:10px;padding:6px 8px}
.dental-date-nav button{width:34px;height:34px;border:1px solid #29445c;border-radius:8px;background:#10243a;color:#dceafa;cursor:pointer;font-size:1.1rem}
.dental-date-nav strong{min-width:190px;text-align:center;font-size:.92rem}
.dental-view-toggle{display:flex;border:1px solid #1c3951;border-radius:9px;overflow:hidden}
.dental-view-toggle button{height:38px;padding:0 16px;border:0;background:#10243a;color:#8da5b9;cursor:pointer;font-weight:700}
.dental-view-toggle button.is-active{background:linear-gradient(100deg,#216bd3,#268ce9);color:white}
.dental-column-mode{display:grid;gap:4px;color:#7590a6;font-size:.68rem}
.dental-column-mode select{height:38px;border:1px solid #1c3951;border-radius:8px;background:#0c2033;color:var(--text);padding:0 10px}

.dental-book-board{border:1px solid #1d3a53;border-radius:13px;background:linear-gradient(145deg,rgba(17,40,62,.95),rgba(12,31,49,.95));overflow:auto;min-height:640px;max-height:calc(100vh - 220px)}
.dental-book-grid{display:grid;min-width:720px}
.dental-book-head,.dental-book-row{display:grid;grid-template-columns:64px repeat(var(--dental-cols,1),minmax(160px,1fr))}
.dental-book-head{position:sticky;top:0;z-index:3;background:#0b1c2d;border-bottom:1px solid #1b374f}
.dental-book-head>div{padding:12px 10px;border-left:1px solid #173149;color:#d8e9f5;font-size:.74rem}
.dental-book-head small{display:block;color:#6f899d;margin-top:3px;font-weight:500}
.dental-gutter{color:#638097;font-size:.62rem;padding:0 8px;border-right:1px solid #173149;background:#0b1c2d}
.dental-col{position:relative;border-left:1px solid #173149;background:repeating-linear-gradient(to bottom,transparent 0,transparent 47px,rgba(60,102,135,.16) 47px,rgba(60,102,135,.16) 48px)}
.dental-now{position:absolute;left:0;right:0;height:2px;background:#ff7180;box-shadow:0 0 0 1px rgba(255,113,128,.25);z-index:2;pointer-events:none}
.dental-now:before{content:"";position:absolute;left:-5px;top:-4px;width:10px;height:10px;border-radius:50%;background:#ff7180}
.dental-appt{position:absolute;left:6px;right:6px;border-radius:8px;padding:7px 8px 8px;border:1px solid rgba(47,140,255,.35);background:linear-gradient(180deg,rgba(32,92,158,.92),rgba(18,58,104,.94));color:#eaf3fb;cursor:grab;box-shadow:0 8px 18px rgba(0,0,0,.18);overflow:hidden;z-index:1}
.dental-appt:active{cursor:grabbing}
.dental-appt.is-dragging{opacity:.72;z-index:5}
.dental-appt.is-conflict{border-color:#ff7180;box-shadow:0 0 0 2px rgba(255,113,128,.25)}
.dental-appt strong,.dental-appt small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dental-appt strong{font-size:.72rem}
.dental-appt small{font-size:.61rem;color:#b7d4ee;margin-top:2px}
.dental-appt .dental-status{margin-top:5px}
.dental-resize{position:absolute;left:8px;right:8px;bottom:0;height:8px;cursor:ns-resize}
.dental-week-day{min-height:520px;border-left:1px solid #173149;position:relative;padding:8px}
.dental-week-stack{display:grid;gap:6px}

.dental-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.dental-settings-list{display:grid;gap:8px}
.dental-settings-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 0;border-top:1px solid #1a354d}
.dental-settings-row:first-child{border-top:0}
.dental-settings-row small{display:block;color:#6f8ba1;margin-top:3px}
.dental-settings-row select{height:34px;border:1px solid #28465f;border-radius:7px;background:#10273c;color:#b8cad8;padding:0 8px}

.dental-chart-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:4px 0 18px}
.dental-chart-card{border:1px solid #1c3a52;border-radius:10px;background:#0d2235;padding:14px 16px}
.dental-chart-card h3{margin:0 0 10px;font-size:.86rem}
.dental-chart-card ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.dental-chart-card li{display:grid;gap:2px;font-size:.76rem}
.dental-chart-card li small{color:#7692a8}
.dental-family{display:grid;gap:10px}
.dental-family-head{font-weight:800}
.dental-future{display:flex;flex-wrap:wrap;gap:6px}
.dental-future span{font-size:.62rem;color:#7794aa;background:#091c2c;border:1px solid #1b354a;border-radius:5px;padding:4px 6px}

.dental-chart-subnav{display:flex;gap:6px;margin:0 0 12px;padding:4px;border:1px solid #1c3a52;border-radius:10px;background:#0b1c2d;width:max-content}
.dental-chart-subnav button{height:34px;padding:0 14px;border:0;border-radius:8px;background:transparent;color:#8da5b9;font-weight:700;cursor:pointer}
.dental-chart-subnav button.is-active{background:linear-gradient(100deg,#216bd3,#268ce9);color:#fff}
.dental-odontogram-root{min-width:0}
.odontogram-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin-bottom:10px}
.odontogram-toolbar label{display:grid;gap:4px;color:#7590a6;font-size:.68rem}
.odontogram-toolbar select,.odontogram-toolbar input{height:36px;border:1px solid #28465f;border-radius:8px;background:#10273c;color:#dceafa;padding:0 10px}
.odontogram-legend{display:flex;flex-wrap:wrap;gap:12px;list-style:none;margin:0 0 12px;padding:0;color:#c5d8e8;font-size:.72rem}
.odontogram-legend li{display:flex;align-items:center;gap:6px}
.legend-swatch{width:22px;height:14px;border-radius:3px;display:inline-block}
.legend-swatch.faint-outline{border:1px dashed #5d7a90;background:transparent}
.legend-swatch.solid-fill{border:2px solid #70a7d8;background:#1d4d75}
.legend-swatch.dashed-outline{border:2px dashed #e3c15a;background:transparent}
.legend-swatch.solid-check{border:2px solid #70e3b5;background:#183b31;position:relative}
.legend-swatch.solid-check:after{content:"✓";display:block;text-align:center;font-size:.62rem;line-height:10px;color:#70e3b5}
.legend-swatch.hatch{border:2px solid #c8b2ff;background:repeating-linear-gradient(45deg,#302448,#302448 2px,#7059a1 2px,#7059a1 4px)}
.legend-swatch.extracted{border:2px solid #ff9ca6;background:transparent;position:relative}
.legend-swatch.extracted:before,.legend-swatch.extracted:after{content:"";position:absolute;left:3px;right:3px;top:6px;height:2px;background:#ff9ca6}
.legend-swatch.extracted:after{transform:rotate(90deg)}
.legend-swatch.implant{border:2px solid #9fd0c2;background:#183b31;box-shadow:inset 0 -4px 0 #70e3b5}
.legend-swatch.bridge{border:2px solid #d7b07a;background:#3d3219}
.legend-swatch.denture{border:2px solid #8bb4d4;background:#142f4b;border-radius:8px}
.odontogram-tooth.is-extracted .odontogram-tooth-frame{stroke:#ff9ca6;stroke-width:2;fill:#321d29}
.odontogram-tooth.is-pontic .odontogram-tooth-frame{stroke-dasharray:2 3;fill:#1a2733}
.odontogram-tooth.has-implant .odontogram-tooth-frame{stroke:#70e3b5}
.odontogram-tooth.has-bridge .odontogram-tooth-frame{stroke:#d7b07a}
.odontogram-tooth.has-denture .odontogram-tooth-frame{stroke:#8bb4d4}
.odontogram-implant{fill:#70e3b5;stroke:#183b31;stroke-width:.6}
.odontogram-implant.is-plan{fill:none;stroke:#e3c15a;stroke-dasharray:2 2}
.odontogram-bridge-bar{stroke:#d7b07a;stroke-width:3;stroke-linecap:round}
.odontogram-bridge-bar.is-plan{stroke:#e3c15a;stroke-dasharray:4 3}
.odontogram-pontic{fill:#0b1c2d;stroke:#d7b07a;stroke-width:1.4;stroke-dasharray:2 2}
.odontogram-pontic.is-plan{stroke:#e3c15a}
.odontogram-denture{fill:#8bb4d4;opacity:.85}
.odontogram-denture.is-plan{fill:none;stroke:#e3c15a;stroke-dasharray:3 2;opacity:1}
.odontogram-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.85fr);gap:14px;align-items:start}
.odontogram-svg{width:100%;height:auto;max-height:680px;background:#071423;border:1px solid #1c3a52;border-radius:12px}
.odontogram-row-title{fill:#6f899d;font-size:11px}
.odontogram-label{fill:#d8e9f5;font-size:9px;text-anchor:middle}
.odontogram-tooth-frame{fill:#0d2235;stroke:#35516a;stroke-width:1}
.odontogram-tooth.is-not-charted .odontogram-tooth-frame{fill:transparent;stroke:#3d5870;stroke-dasharray:3 3}
.odontogram-tooth.is-documented .odontogram-tooth-frame{stroke:#70a7d8;stroke-width:1.6}
.odontogram-tooth.has-existing .odontogram-surface.existing{fill:#1d4d75;stroke:#8bb4d4}
.odontogram-tooth.has-proposed .odontogram-tooth-frame{stroke:#e3c15a;stroke-dasharray:4 3;stroke-width:2}
.odontogram-tooth.has-completed .odontogram-tooth-frame{stroke:#70e3b5;stroke-width:2}
.odontogram-tooth.has-watch .odontogram-tooth-frame{stroke:#c8b2ff;stroke-dasharray:none;fill:url(#odontogram-hatch)}
.odontogram-tooth.is-selected .odontogram-tooth-frame{stroke:#fff;stroke-width:2.4;stroke-dasharray:none}
.odontogram-surface{fill:#10273c;stroke:#2a4660;stroke-width:.8;cursor:pointer}
.odontogram-surface.existing{fill:#1d4d75}
.odontogram-surface.proposed{fill:none;stroke:#e3c15a;stroke-width:1.6;stroke-dasharray:3 2}
.odontogram-surface.completed{fill:#183b31;stroke:#70e3b5}
.odontogram-surface.watch{fill:url(#odontogram-hatch);stroke:#c8b2ff}
.odontogram-surface.is-picked{stroke:#fff;stroke-width:1.8}
.odontogram-missing-mark{stroke:#ff9ca6;stroke-width:2}
.odontogram-check{fill:#70e3b5;font-size:11px;font-weight:700}
.odontogram-watch-icon{fill:#c8b2ff;font-size:10px}
.odontogram-editor{border:1px solid #1c3a52;border-radius:12px;background:#0d2235;padding:14px}
.odontogram-editor header{margin-bottom:10px}
.odontogram-editor h3{margin:0;font-size:.95rem}
.odontogram-editor h4{margin:12px 0 6px;font-size:.78rem}
.surface-row{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.surface-chip{border:1px solid #35516a;background:#10273c;color:#dceafa;border-radius:8px;padding:6px 8px;cursor:pointer}
.surface-chip.is-on{border-color:#70a7d8;background:#163656}
.odontogram-fast-form{display:grid;gap:8px}
.odontogram-fast-form label{display:grid;gap:4px;color:#7590a6;font-size:.68rem}
.odontogram-fast-form select,.odontogram-fast-form input,.odontogram-fast-form textarea{border:1px solid #28465f;border-radius:8px;background:#10273c;color:#dceafa;padding:8px}
.odontogram-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.odontogram-split{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.odontogram-split ul,.odontogram-history-block{list-style:none;margin:0;padding:0}
.history-item{display:grid;width:100%;text-align:left;gap:2px;margin-bottom:6px;padding:8px;border:1px solid #1c3a52;border-radius:8px;background:#10273c;color:inherit;cursor:pointer}
.history-item.is-on{border-color:#70a7d8}
.odontogram-imaging{margin-top:12px}
.odontogram-imaging select{width:100%;margin:4px 0 8px;border:1px solid #28465f;border-radius:8px;background:#10273c;color:#dceafa;padding:8px}
.odontogram-link-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.odontogram-link-list li{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:.72rem;color:#c5d8e8;word-break:break-all}

@media(max-width:1100px){
  .odontogram-layout,.odontogram-split{grid-template-columns:1fr}
}

@media(max-width:1100px){
  .dental-dash-grid,.dental-settings-grid,.dental-chart-overview{grid-template-columns:1fr}
  .dental-book-board{max-height:none}
}

/* Generic Dental chrome honors Light/Dark. Clinical odontogram colours stay hex. */
html[data-theme="light"] .nav-group.dental-nav{border-color:var(--border)}
html[data-theme="light"] .dental-dash-row,html[data-theme="light"] .dental-chart-card,html[data-theme="light"] .odontogram-editor,html[data-theme="light"] .history-item{background:var(--bg-surface);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .dental-dash-row small,html[data-theme="light"] .dental-chart-card li small,html[data-theme="light"] .odontogram-toolbar label,html[data-theme="light"] .odontogram-fast-form label,html[data-theme="light"] .dental-settings-row small{color:var(--text-muted)}
html[data-theme="light"] .dental-date-nav,html[data-theme="light"] .dental-chart-subnav,html[data-theme="light"] .dental-view-toggle{background:var(--bg-elevated);border-color:var(--border)}
html[data-theme="light"] .dental-date-nav button,html[data-theme="light"] .dental-view-toggle button,html[data-theme="light"] .dental-chart-subnav button{background:transparent;color:var(--text-muted);border-color:var(--border)}
html[data-theme="light"] .dental-date-nav strong,html[data-theme="light"] .dental-column-mode{color:var(--text)}
html[data-theme="light"] .dental-view-toggle button.is-active,html[data-theme="light"] .dental-chart-subnav button.is-active{background:var(--selected);color:var(--text)}
html[data-theme="light"] .dental-column-mode select,html[data-theme="light"] .dental-settings-row select,html[data-theme="light"] .odontogram-toolbar select,html[data-theme="light"] .odontogram-toolbar input,html[data-theme="light"] .odontogram-fast-form select,html[data-theme="light"] .odontogram-fast-form input,html[data-theme="light"] .odontogram-fast-form textarea,html[data-theme="light"] .odontogram-imaging select{background:var(--bg-input);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .dental-book-board{background:var(--bg-surface);border-color:var(--border)}
html[data-theme="light"] .dental-book-head,html[data-theme="light"] .dental-gutter{background:var(--table-header);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .dental-book-head>div,html[data-theme="light"] .dental-col,html[data-theme="light"] .dental-week-day{border-color:var(--border)}
html[data-theme="light"] .dental-future span{background:var(--bg-input);border-color:var(--border);color:var(--text-muted)}
html[data-theme="light"] .odontogram-legend{color:var(--text-secondary);background:var(--bg-elevated);border:1px solid var(--border);border-radius:10px;padding:8px 12px}
html[data-theme="light"] .odontogram-svg{background:var(--bg-input);border-color:var(--border)}
html[data-theme="light"] .odontogram-row-title{fill:var(--text-muted)}
html[data-theme="light"] .odontogram-label{fill:var(--text)}
html[data-theme="light"] .odontogram-tooth-frame{fill:#ffffff;stroke:#8aa4b8}
html[data-theme="light"] .odontogram-surface{fill:#e8eef4;stroke:#9bb0c2}
html[data-theme="light"] .surface-chip{background:var(--bg-input);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .surface-chip.is-on{border-color:#70a7d8;background:#d7e8f6;color:var(--text)}
html[data-theme="light"] .odontogram-tooth.is-selected .odontogram-tooth-frame{stroke:#132433}
html[data-theme="light"] .odontogram-surface.is-picked{stroke:#132433}
html[data-theme="light"] .odontogram-tooth.is-not-charted .odontogram-tooth-frame{fill:transparent;stroke:#8aa4b8}
html[data-theme="light"] .odontogram-link-list li{color:var(--text-secondary)}
/* Clinical meaning: re-assert after chrome so accent/theme cannot replace it. */
html[data-theme="light"] .odontogram-tooth.has-proposed .odontogram-tooth-frame,html[data-theme="light"] .odontogram-surface.proposed,html[data-theme="light"] .odontogram-implant.is-plan,html[data-theme="light"] .odontogram-bridge-bar.is-plan,html[data-theme="light"] .odontogram-pontic.is-plan,html[data-theme="light"] .odontogram-denture.is-plan{stroke:#e3c15a}
html[data-theme="light"] .odontogram-tooth.has-completed .odontogram-tooth-frame,html[data-theme="light"] .odontogram-surface.completed,html[data-theme="light"] .odontogram-tooth.has-implant .odontogram-tooth-frame{stroke:#70e3b5}
html[data-theme="light"] .odontogram-surface.completed{fill:#183b31}
html[data-theme="light"] .odontogram-check,html[data-theme="light"] .odontogram-implant{fill:#70e3b5}
html[data-theme="light"] .odontogram-tooth.has-watch .odontogram-tooth-frame{stroke:#c8b2ff;fill:url(#odontogram-hatch)}
html[data-theme="light"] .odontogram-surface.watch{fill:url(#odontogram-hatch);stroke:#c8b2ff}
html[data-theme="light"] .odontogram-watch-icon{fill:#c8b2ff}
html[data-theme="light"] .odontogram-tooth.is-extracted .odontogram-tooth-frame{stroke:#ff9ca6;fill:#fde8ea}
html[data-theme="light"] .odontogram-missing-mark{stroke:#ff9ca6}
html[data-theme="light"] .odontogram-surface.existing,html[data-theme="light"] .odontogram-tooth.has-existing .odontogram-surface.existing{fill:#1d4d75;stroke:#8bb4d4}

.dental-perio-root{min-width:0}
.perio-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin-bottom:12px;padding:10px 12px;border:1px solid #1c3a52;border-radius:12px;background:#0d2235}
.perio-toolbar label{display:grid;gap:4px;color:#7590a6;font-size:.68rem}
.perio-toolbar input,.perio-toolbar select{height:38px;border:1px solid #1c3951;border-radius:8px;background:#0c2033;color:var(--text);padding:0 10px}
.perio-hint{color:#6f899d;font-size:.68rem;max-width:280px}
.perio-layout{display:grid;grid-template-columns:minmax(220px,.7fr) minmax(0,1.6fr);gap:14px;align-items:start}
.perio-history,.perio-grid-wrap{border:1px solid #1c3a52;border-radius:12px;background:#0d2235;padding:12px}
.perio-exam-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.perio-exam-list li{padding:8px 10px;border:1px solid #1c3a52;border-radius:8px;cursor:pointer}
.perio-exam-list li.is-on{border-color:#70a7d8;background:#142f4b}
.perio-exam-list small{display:block;color:#7692a8}
.perio-exam-meta{color:#8bb4d4;margin:0 0 10px}
.perio-arch h4{margin:0 0 8px;color:#8bb4d4;font-size:.78rem}
.perio-tooth-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.perio-tooth{width:132px;border:1px solid #1c3a52;border-radius:10px;background:#0b1c2d;padding:6px}
.perio-tooth.is-selected{outline:2px solid #fff}
.perio-tooth.skipped{opacity:.45}
.perio-tooth.implant{border-color:#70e3b5}
.perio-tooth.unassessed header small{color:#8bb4d4}
.perio-tooth header{display:flex;justify-content:space-between;font-size:.72rem;margin-bottom:4px}
.perio-sites{display:grid;grid-template-columns:repeat(3,1fr);gap:3px}
.perio-cell{min-height:44px;border:1px solid #29445c;border-radius:6px;background:#10243a;color:#dceafa;padding:2px;cursor:pointer}
.perio-cell.is-focused{outline:2px solid #fff}
.perio-cell.is-pocket{background:#3d3219;border-color:#e3c15a}
.perio-cell.is-deep{background:#321d29;border-color:#ff9ca6}
.perio-cell.has-bop{box-shadow:inset 0 -3px 0 #ff7180}
.perio-site-id{display:block;font-size:.55rem;color:#6f899d}
.perio-cell strong,.perio-cell em,.perio-cell small{display:block;line-height:1.1}
.perio-cell em{color:#8bb4d4;font-size:.62rem}
.perio-cell small{color:#70e3b5;font-size:.58rem}
.perio-tooth footer{margin-top:4px;color:#6f899d;font-size:.58rem}
.perio-furc-row{display:inline-flex;gap:3px;flex-wrap:wrap}
.perio-furc{min-height:28px;padding:0 5px;border:1px solid #29445c;border-radius:5px;background:#10243a;color:#dceafa;font-size:.58rem;cursor:pointer}
.perio-furc.is-on{outline:2px solid #fff}
.perio-compare{margin-top:16px;overflow:auto}
.perio-compare table{width:100%;border-collapse:collapse}
.perio-compare th,.perio-compare td{border-bottom:1px solid #1c3a52;padding:6px;text-align:left;font-size:.72rem}

html[data-theme="light"] .perio-toolbar,html[data-theme="light"] .perio-history,html[data-theme="light"] .perio-grid-wrap,html[data-theme="light"] .perio-tooth{background:var(--bg-surface);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .perio-toolbar input,html[data-theme="light"] .perio-toolbar select,html[data-theme="light"] .perio-cell{background:var(--bg-input);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .perio-hint,html[data-theme="light"] .perio-exam-list small,html[data-theme="light"] .perio-tooth footer,html[data-theme="light"] .perio-site-id{color:var(--text-muted)}
html[data-theme="light"] .perio-exam-list li.is-on,html[data-theme="light"] .perio-tooth.is-selected{background:var(--selected)}
html[data-theme="light"] .perio-cell.is-focused{outline-color:#132433}
html[data-theme="light"] .perio-cell.is-pocket{background:#fff4d4;border-color:#e3c15a}
html[data-theme="light"] .perio-cell.is-deep{background:#fde8ea;border-color:#ff9ca6}
html[data-theme="light"] .perio-cell.has-bop{box-shadow:inset 0 -3px 0 #ff7180}
html[data-theme="light"] .perio-cell small{color:#1f7a55}
html[data-theme="light"] .perio-furc{background:var(--bg-input);border-color:var(--border);color:var(--text)}
html[data-theme="light"] .perio-furc.is-on{outline-color:#132433}
html[data-scale="large"] .perio-cell,html[data-scale="extra_large"] .perio-cell{min-height:52px}
html[data-scale="extra_large"] .perio-tooth{width:156px}
html[data-density="spacious"] .perio-cell{min-height:56px;padding:4px}
html[data-density="spacious"] .perio-tooth{width:148px}
html[data-density="compact"] .perio-cell{min-height:40px}

.dental-treatment-root{display:flex;flex-direction:column;gap:12px;min-height:360px}
.tp-toolbar,.tp-composer,.tp-tabs,.tp-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:end}
.tp-toolbar label,.tp-composer label{display:flex;flex-direction:column;gap:4px;font-size:.75rem}
.tp-toolbar select,.tp-composer input,.tp-composer select{min-width:8rem}
.tp-status{margin-left:auto;color:var(--text-muted);font-size:.8rem}
.tp-tab{border:1px solid var(--border);background:var(--bg-surface);color:var(--text);padding:6px 10px;border-radius:6px}
.tp-tab.is-on{outline:2px solid #4ea1ff}
.tp-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:8px}
.tp-table{width:100%;border-collapse:collapse}
.tp-table th,.tp-table td{padding:8px;border-bottom:1px solid var(--border);text-align:left;font-size:.8rem}
.tp-row-actions{display:flex;flex-wrap:wrap;gap:4px}
.tp-history{display:grid;gap:8px}
.tp-version{border:1px solid var(--border);border-radius:8px;padding:8px;background:var(--bg-surface)}
html[data-theme="light"] .tp-tab.is-on{outline-color:#132433}
html[data-theme="dark"] .tp-tab.is-on{outline-color:#8ec5ff}
html[data-theme="dark"] .tp-table th,html[data-theme="dark"] .tp-table td{border-bottom-color:var(--border)}

.pacsivo-search-field{position:relative;display:grid;gap:6px}
.pacsivo-search-list{position:absolute;z-index:8;left:0;right:0;top:100%;margin-top:4px;display:grid;background:var(--bg-surface);border:1px solid var(--border);border-radius:8px;max-height:240px;overflow:auto}
.pacsivo-search-list.hidden{display:none}
.pacsivo-search-item{display:grid;gap:2px;padding:8px 10px;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}
.pacsivo-search-item:hover,.pacsivo-search-item.is-active{background:var(--bg-input);outline:2px solid var(--focus, #4ea1ff)}
.pacsivo-search-item small{color:var(--text-muted)}
.dental-duplicate-panel{margin:12px 0;padding:10px;border:1px solid var(--border);border-radius:8px;display:grid;gap:8px}
.dental-medical-root,.dental-documents-root{display:grid;gap:12px}
.dental-print-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.dental-import-form{display:flex;flex-wrap:wrap;gap:8px;align-items:end;padding:8px}
