/* Clear contrast in the dark access bar, including substitute mode. */
.context button:not(.primary),.context .badge{background:#fff;color:#17324a;-webkit-text-fill-color:#17324a}
.context button.primary{color:#fff;-webkit-text-fill-color:#fff}
.context select,.context input,.search-choice{color:#17324a;-webkit-text-fill-color:#17324a}
.top-gap{margin-top:20px}.picker-body{padding:22px}.req-compact{display:flex;flex-wrap:wrap;gap:3px 6px;font:13px/1.9 "Segoe UI",Tahoma,sans-serif;color:#17324a;text-align:left;margin:8px 0;max-width:100%;min-width:180px}.req-compact>span{white-space:nowrap}.req-separator{color:#8b9cab}.deficit{color:#b32236;margin-left:2px}.search-select{position:relative;width:100%;color:#17324a}.search-choice{background:#fff;padding-inline-end:24px!important;cursor:text}.search-options{position:absolute;top:100%;inset-inline:0;z-index:30;background:white;color:#17324a;border:1px solid #98acc0;box-shadow:0 12px 24px #14365126;border-radius:9px;max-height:250px;overflow:auto;min-width:180px}.search-options>button{display:block;width:100%;border:0;border-radius:0;text-align:right;color:#17324a;background:white;font-size:.88rem;padding:10px 12px}.search-options>button:hover,.search-options>button.focused{background:#e9f3ff}.search-select:has(.search-options:not([hidden])){z-index:30}.field:has(.search-select){overflow:visible}.pulp-panel{background:white;border:1px solid #dbc0c4;border-radius:12px;padding:16px;margin:16px 0}.pulp-panel h3{margin-bottom:10px}.pulp-case{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;border-radius:9px;padding:12px;margin-top:8px;font-size:.86rem}.pulp-case.pending{background:#fff0f2;border:1px solid #e7a9b2;color:#93283c}.pulp-case.resolved{background:#f0f7f3;border:1px solid #cae0d3}.submission-mini{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:10px}.patient-fields{margin-top:14px}.remove-circle{border-radius:50%;background:#bd3144!important;color:white!important;width:28px;height:28px;min-height:28px;min-width:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;font:20px/1 "Segoe UI",sans-serif;border:0}.formula-cell{position:relative;padding:22px 10px 10px;border:1px solid #d4e0ea;border-radius:10px}.formula-cell>.remove-circle{position:absolute;top:-10px;inset-inline-start:10px}.restore-component{display:none}.component-removed .field,.component-removed>.remove-circle{display:none}.component-removed .restore-component{display:block}.component-removed{background:#f1f3f5}.topic-row{display:grid;grid-template-columns:35px minmax(100px,1fr) auto 28px;gap:10px;align-items:center;margin-top:12px}.teeth-scroll{overflow-x:auto;margin:18px 0}.teeth-board{display:grid;grid-template-columns:1fr 1fr;gap:22px 26px;min-width:535px;padding:12px;background:linear-gradient(to right,transparent calc(50% - 1px),#b9ccd9 calc(50% - 1px),#b9ccd9 calc(50% + 1px),transparent calc(50% + 1px))}.teeth-quadrant{background:#fff;min-width:0}.teeth-quadrant h3{text-align:center;margin-bottom:10px;font-size:.88rem}.teeth-permanent{display:grid;grid-template-columns:repeat(8,1fr);gap:3px}.teeth-milk{display:flex;gap:4px;margin-top:8px}.teeth-milk.align-end{justify-content:flex-end}.teeth-milk.align-start{justify-content:flex-start}.teeth-board button{padding:4px 2px;border-radius:7px;min-width:26px;min-height:50px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0;line-height:1.4}.teeth-board button strong{font-size:16px}.teeth-board button small{font-size:10px;color:#617286}.teeth-board button.selected{background:#145c9d;color:#fff}.teeth-board button.selected small{color:#fff}.teeth-milk button{min-width:32px;background:#f6f9fd}#toothPicker{width:800px}.formula-custom-row>.remove-circle{align-self:center}#submissionSearch,#catalogSearch{max-width:400px}#submissionStatus{max-width:200px}
@media(max-width:680px){.pulp-case,.submission-mini{flex-direction:column}.topic-row{gap:5px}.picker-body{padding:14px}.req-compact{font-size:12px}.search-options{max-height:200px}.teeth-scroll{scrollbar-width:thin}.formula-grid{gap:22px 10px}.grid.three{grid-template-columns:1fr}.pulp-case button{align-self:flex-end}}

/* v0.7: mobile-first refinements and explicit previews. */
.matched-students{margin-top:7px;padding:8px 10px;border-radius:8px;background:#f0f7fb;font-size:.78rem;line-height:1.8}
.requirement-link{display:inline-block;margin:0 0 7px 8px;text-decoration:underline;font-weight:700}
.requirement-page{min-width:min(900px,86vw)}
.message-lab-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:18px}
.message-scenario{min-width:0}.phone-preview{margin-top:12px;border:1px solid #bfd0df;border-radius:14px;background:#f8fbfd;overflow:hidden}
.phone-preview-head{padding:8px 12px;background:#e9f1f7;font-size:.78rem;font-weight:700}.phone-preview p{padding:14px;margin:0;line-height:1.9}
@media(max-width:760px){
  body{font-size:15px}.shell{display:block}.nav{position:sticky;top:0;z-index:15;display:flex;overflow-x:auto;gap:6px;padding:8px;-webkit-overflow-scrolling:touch}
  .nav button,.nav .term{flex:0 0 auto;min-height:44px}.topbar{align-items:flex-start;gap:10px;flex-wrap:wrap}.userbox{width:100%;justify-content:space-between}
  main{padding:12px}.toolbar,.split,.row{gap:8px}.toolbar{align-items:stretch}.toolbar>.row,.toolbar>.actions{width:100%;overflow-x:auto;flex-wrap:nowrap}
  button,.button,input,select,textarea{min-height:44px}.grid.two,.grid.four,.formula-grid{grid-template-columns:1fr!important}
  .week-board{grid-template-columns:1fr!important}.message-lab-grid{grid-template-columns:1fr}.requirement-page{min-width:0;width:100%}
  dialog{width:100vw!important;max-width:100vw!important;height:100dvh;max-height:100dvh;margin:0;border-radius:0;padding:12px}dialog::backdrop{background:#0a2235aa}
  #dialogBody{max-height:calc(100dvh - 24px);overflow:auto}.table-wrap,table{max-width:100%}.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  table{min-width:720px}.card{padding:13px}.teeth-scroll{margin-inline:-8px}.savebar{position:sticky;bottom:0;background:#fff;padding:9px 0;z-index:6}
}
