.tech-dialog-backdrop[data-tech-modal=order-edit]{z-index:75}
#app:has(.tech-order-edit-modal)>.toast{z-index:76}

.tech-dialog.tech-order-edit-modal{
  --edit-paper:#fff;
  --edit-soft:#f7f7f6;
  --edit-line:#e8e8e7;
  --edit-ink:#333;
  --edit-muted:#666;
  --edit-gutter:26px;
  width:min(100%,820px);
  max-height:calc(100dvh - 40px);
  padding:0;
  border:1px solid var(--edit-line);
  border-radius:16px;
  background:var(--edit-paper);
  color:var(--edit-ink);
  overscroll-behavior:contain;
}
.tech-edit-dialog-head,.tech-edit-dialog-footer{
  position:sticky;
  z-index:3;
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px var(--edit-gutter);
  background:var(--edit-paper);
}
.tech-edit-dialog-head{top:0;justify-content:space-between;border-bottom:1px solid var(--edit-line)}
.tech-edit-dialog-head h2{margin:0;font-size:clamp(19px,3vw,24px);line-height:1.22;letter-spacing:-.02em}
.tech-order-edit-modal .tech-edit-dialog-head p{margin:4px 0 0;font-size:12px;line-height:1.4;color:var(--edit-muted);overflow-wrap:anywhere}
.tech-edit-dialog-head .tech-dialog-close{
  position:static;flex:0 0 38px;display:grid;place-items:center;
  width:38px;height:38px;margin:0;border:1px solid transparent;border-radius:8px;background:var(--edit-soft);color:var(--edit-muted);
}
.tech-order-edit-modal #tech-order-edit-form{display:block}
.tech-edit-dialog-body{display:grid;gap:24px;padding:20px var(--edit-gutter) 24px}
.tech-edit-patient-grid,.tech-order-edit-modal .tech-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.tech-edit-service-choice{grid-column:1/-1}
.tech-order-edit-modal :is(label,.finance-date){min-width:0;gap:6px;color:var(--edit-muted);font-size:12px;font-weight:650}
.tech-order-edit-modal :is(input:not([type=hidden]),select,textarea,.down-select-trigger,.date-picker-trigger){
  min-height:44px;
  border:1px solid var(--edit-line);
  border-radius:8px;
  background:var(--edit-paper);
  color:var(--edit-ink);
  font-size:13px;
}
.tech-order-edit-modal .finance-date .date-picker-trigger{font-weight:600}
.tech-order-edit-modal .finance-date .date-picker-trigger:not(.has-value){color:var(--edit-muted)}
.tech-order-edit-modal .date-picker-popover[hidden]{display:none}
.tech-order-edit-modal textarea{padding:10px 12px;resize:vertical}
.tech-order-edit-modal :is(button,input,textarea,select):focus-visible{outline:2px solid #5c5c5c;outline-offset:2px}
.tech-order-edit-modal .tech-edit-variants-wrap{gap:14px}
.tech-order-edit-modal .tech-edit-variants-heading{align-items:baseline;flex-direction:row}
.tech-order-edit-modal .tech-edit-variants-heading h3{margin:0;font-size:17px}
.tech-order-edit-modal .tech-edit-variants-heading span{color:var(--edit-muted);font-size:12px;font-variant-numeric:tabular-nums}
.tech-order-edit-modal .tech-edit-variant{
  min-width:0;
  gap:16px;
  padding:16px;
  border-color:var(--edit-line);
  border-radius:12px;
  background:var(--edit-paper);
}
.tech-order-edit-modal .tech-edit-service-head{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding-bottom:12px;border-bottom:1px solid var(--edit-line);
}
.tech-edit-service-title{min-width:0}
.tech-edit-service-title h4{margin:0;color:var(--edit-ink);font-size:16px;font-weight:650;line-height:1.3;overflow-wrap:anywhere}
.tech-order-edit-modal .tech-edit-service-head span{
  color:var(--edit-muted);font-size:11px;font-weight:500;letter-spacing:0;text-transform:none;
}
.tech-order-edit-modal .tech-edit-service-head .tech-edit-service-actions{display:flex;align-items:center;gap:10px}
.tech-edit-service-head .tech-edit-price{display:grid;gap:3px;justify-items:end;padding:0;text-align:right}
.tech-edit-service-head .tech-edit-price strong{font-size:15px;white-space:nowrap}
.tech-edit-service-head .tech-edit-remove{
  display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:8px;
  border:1px solid var(--edit-line);background:var(--edit-paper);color:var(--edit-muted);
}
.tech-order-edit-modal .tech-edit-teeth-field{min-width:0;margin:0;padding:0;border:0}
.tech-edit-sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.tech-edit-jaw-layout{
  display:grid;grid-template-columns:minmax(210px,1fr) minmax(0,1fr);grid-template-areas:"chart controls";
  align-items:start;min-width:0;gap:24px;padding:16px;background:var(--edit-soft);border-radius:10px;
}
.tech-edit-jaw-chart{grid-area:chart;min-width:0;margin:0;text-align:center}
.tech-edit-jaw-chart>span{display:block;color:var(--edit-muted);font-size:11px;line-height:1.35}
.tech-edit-jaw-chart .tooth-chart{max-width:288px;margin:3px auto}
.tech-edit-jaw-chart .tooth path,.tech-edit-jaw-chart .tooth text{cursor:pointer}
.tech-edit-jaw-chart .tooth[role=button]:focus-visible .tooth-hitbox{stroke:#444;stroke-width:3;stroke-dasharray:none}
.tech-edit-jaw-controls{grid-area:controls;display:grid;gap:10px;min-width:0}
.tech-edit-jaw-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}
.tech-edit-jaw-heading h4{margin:0;font-size:15px;letter-spacing:-.01em}
.tech-order-edit-modal .tech-edit-jaw-hint{margin:0;color:var(--edit-muted);font-size:13px;line-height:1.5}
.tech-edit-jaw-clear{
  min-height:36px;margin:-5px -8px -5px 0;padding:0 8px;border:0;border-radius:7px;
  background:transparent;color:var(--edit-muted);font-size:12px;font-weight:650;
}
.tech-edit-jaw-selection{display:grid;gap:7px;margin-top:4px;padding-top:12px;border-top:1px solid var(--edit-line)}
.tech-edit-jaw-selection>span{color:var(--edit-muted);font-size:12px}
.tech-order-edit-modal .tech-edit-jaw-selection p{margin:0;color:var(--edit-muted);font-size:13px}
.tech-edit-jaw-selection ul{display:flex;flex-wrap:wrap;gap:5px;margin:0;padding:0;list-style:none}
.tech-edit-jaw-selection li{
  padding:4px 8px;border:1px solid #dededd;border-radius:6px;background:var(--edit-paper);
  font-size:12px;font-weight:650;line-height:1.3;font-variant-numeric:tabular-nums;
}
.tech-edit-jaw-controls .jaw-choice button{min-height:44px}
.tech-edit-quantity{display:grid;width:min(100%,170px)}
.tech-order-edit-modal .tech-edit-add{min-height:44px;gap:8px;border-color:#d9d9d8}
.tech-edit-dialog-footer{
  bottom:0;
  justify-content:flex-end;
  margin:0;
  border-top:1px solid var(--edit-line);
}
.tech-edit-dialog-footer .btn{min-height:44px}
.tech-order-edit-modal button{-webkit-tap-highlight-color:transparent}
@media(hover:hover) and (pointer:fine){
  .tech-edit-dialog-head .tech-dialog-close:hover,.tech-edit-jaw-clear:hover,.tech-edit-service-head .tech-edit-remove:hover{background:#ececeb;color:var(--edit-ink)}
  .tech-edit-dialog-footer .btn.primary:hover:not(:disabled){background:#6d6d6d;border-color:#6d6d6d}
}
@media(min-width:641px) and (max-height:980px){
  .tech-edit-jaw-chart .tooth-chart{max-width:clamp(204px,calc(37dvh - 102px),262px)}
}
@media(max-width:640px){
  .tech-dialog-backdrop[data-tech-modal=order-edit]{padding:8px}
  .tech-dialog.tech-order-edit-modal{--edit-gutter:14px;max-height:calc(100dvh - 16px);border-radius:14px}
  .tech-edit-dialog-head,.tech-edit-dialog-footer{padding-block:10px}
  .tech-edit-dialog-head .tech-dialog-close,.tech-edit-service-head .tech-edit-remove{width:44px;height:44px;flex-basis:44px}
  .tech-edit-dialog-body{gap:18px;padding-block:14px 20px}
  .tech-order-edit-modal .tech-edit-patient-grid,.tech-order-edit-modal .tech-edit-grid{grid-template-columns:minmax(0,1fr)}
  .tech-order-edit-modal .tech-edit-variant{padding:12px;gap:12px}
  .tech-edit-jaw-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:"controls" "chart";gap:12px;padding:10px}
  .tech-edit-jaw-chart .tooth-chart{max-width:340px}
  .tech-edit-jaw-clear{min-height:44px}
  .tech-edit-dialog-footer .btn{flex:1}
}

.tech-dialog.tech-new-order {
  width: min(100%, 880px);
  max-height: none;
  overflow: visible;
  margin: 0;
  box-shadow: none;
}
.tech-new-order-section {
  display: grid;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--edit-line);
}
.tech-new-order-section h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}
.tech-new-order .tech-edit-dialog-footer {
  position: static;
  border-radius: 0 0 16px 16px;
}
