#dialog:has(.offer-editor) { width:min(960px,96vw); background:#f8f7f7; }
.offer-editor {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(228px,.55fr);
  align-items:start;
  gap:16px;
}
.offer-editor-content { display:grid; gap:13px; min-width:0; }
.offer-editor-context {
  grid-column:1/-1;
  display:grid;
  gap:5px;
  padding:12px 14px;
  background:#fff;
  border:1px solid #dfdcde;
  border-radius:12px;
}
.offer-editor-context div { display:flex; align-items:center; gap:8px; overflow-wrap:anywhere; }
.offer-editor-context p { font-size:.83rem; }
.offer-editor-context .offer-context-back { display:inline-flex; align-items:center; gap:6px; justify-self:start; min-height:40px; padding:4px 8px; margin-left:-8px; background:transparent; color:#742535; font-size:.83rem; }
.offer-context-back::before { content:'‹'; font-size:1.2rem; }
.offer-editor-group,.offer-editor-review,.offer-editor-result { display:grid; gap:11px; min-width:0; }
.offer-editor-group,.offer-editor-review {
  padding:clamp(14px,2vw,20px);
  border:1px solid #dfdcde;
  border-radius:14px;
  background:white;
}
.offer-editor :is(h3,legend) { font-size:.94rem; }
.offer-editor-review { position:sticky; top:0; align-self:start; box-shadow:0 6px 18px #20182009; }
.offer-editor-review-price { padding:13px; background:#282429; border-radius:9px; color:white; font-size:clamp(1.22rem,2.3vw,1.63rem); line-height:1.2; letter-spacing:-.025em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.offer-editor-review-data { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 10px; margin:0; font-size:.83rem; }
.offer-editor-review-data dt { color:#655b5e; }
.offer-editor-review-data dd { margin:0; text-align:right; font-weight:650; }
.offer-editor-review > p { font-size:.8rem; }
.offer-editor-context .offer-draft-status{font-size:.78rem;color:#645b61}
.offer-review-details{min-width:0;border-top:1px solid #e5dfe2;padding-top:10px}
.offer-review-details summary{cursor:pointer;font-weight:650;font-size:.85rem}
.offer-review-details[open] summary{margin-bottom:10px}
.offer-review-details p{margin:.65rem 0 0;font-size:.8rem}
.offer-editor-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.offer-editor-review .offer-editor-actions { display:grid; grid-template-columns:minmax(0,1fr); }
.offer-editor-actions > :is(button,a) { min-height:42px; }
.offer-editor-result .offer-editor-actions a {
  display:inline-flex;
  align-items:center;
  margin:0;
  padding:7px 9px;
  border:1px solid #debec8;
  border-radius:8px;
  text-decoration:none;
}
.offer-editor-result .offer-editor-actions a:hover { background:#faeef1; }
.offer-editor-result > button { justify-self:start; }
.client-link-settings{display:grid;gap:14px;min-width:0}
.client-link-settings > button{justify-self:start}
.client-link-settings .client-link-price{display:flex;align-items:center;gap:10px}
.client-link-price input[type=checkbox]{width:18px;height:18px;flex:none;margin:0}
.offer-editor .offer-photo-grid { max-height:300px; overscroll-behavior:contain; scrollbar-width:thin; }
.offer-editor .offer-photo-grid img { height:auto; aspect-ratio:16/10; }
.offer-client-price .offer-breakdown-toggle {
  display:flex; flex-direction:row-reverse; justify-content:flex-end; align-items:center;
  gap:9px; min-height:40px; margin-top:3px; border-top:1px solid #ead8de; text-align:left;
}
.offer-breakdown-toggle input { width:17px; height:17px; margin:0; accent-color:#852139; }
.offer-breakdown-editor {
  min-width:0; margin:0; padding:11px; border:1px solid #e8d4db; border-radius:9px; background:#fff;
}
.offer-breakdown-editor legend { padding:0 4px; font-weight:650; }
.offer-breakdown-editor p { font-size:.82rem; }
.offer-breakdown-rows { display:grid; gap:8px; margin:10px 0; }
.offer-breakdown-row { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto; align-items:end; gap:7px; }
.offer-breakdown-row label { min-width:0; font-size:.82rem; }
.offer-breakdown-row input { padding:8px; font-weight:500; }
.offer-breakdown-editor button { padding:8px 10px; min-height:40px; font-size:.83rem; }
@media (max-width:650px) {
  .offer-editor { grid-template-columns:minmax(0,1fr); gap:11px; }
  #dialog:has(.offer-editor){scroll-padding-bottom:135px}
  .offer-editor-review { position:sticky;top:auto;bottom:0;z-index:2;grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr);align-items:center;gap:5px 9px;padding:10px 12px;box-shadow:0 -3px 14px #26182119 }
  .offer-editor-review>h3{grid-column:1;grid-row:1;font-size:.71rem;font-weight:550;color:#695e63}
  .offer-editor-review-price{grid-column:1;grid-row:2;align-self:start;background:transparent;color:#602437;font-size:1rem;padding:0}
  .offer-editor-review .offer-editor-actions {grid-column:2;grid-row:1/3}
  .offer-editor-review .offer-editor-actions button{padding:7px;font-size:.79rem;line-height:1.15}
  .offer-editor-context .offer-context-back{min-height:44px}
  .offer-review-details,.offer-editor-review>.form-status{grid-column:1/-1}
  .offer-review-details{padding-top:5px}
  .offer-editor-review>.form-status:empty{display:none}
  .offer-editor :is(input:not([type=checkbox]),textarea,select) { font-size:1rem; }
  .offer-editor .offer-photo-grid { grid-template-columns:repeat(auto-fill,minmax(74px,1fr)); }
}
@media (max-width:460px) {
  .offer-breakdown-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .offer-breakdown-row label:first-child { grid-column:1/-1; }
  .offer-breakdown-row button { grid-column:2; justify-self:end; }
}
#dialog:has(.selection-order) {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(16px, 4vw, 26px);
  background: #fff;
}
.selection-order { gap: 16px; }
.selection-form,.selection-vehicles { display: grid; gap: 12px; }
.selection-vehicle,.selection-form .selection-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px 12px;
}
.selection-vehicle {
  grid-template-columns: repeat(3,minmax(0,1fr)) auto;
  align-items: end;
  padding: 14px;
  border: 1px solid #e6dfe3;
  border-radius: 12px;
  background: #faf8f9;
}
.selection-vehicle label,.selection-vehicle select,.selection-brand { min-width: 0; }
.selection-vehicle select { width: 100%; text-overflow: ellipsis; }
.selection-vehicle select:disabled { background:#f4f1f3; color:#615861; opacity:1; }
.selection-brand { display: grid; gap: 6px; }
.selection-brand-label { font-size: .9rem; font-weight: 650; }
.selection-brand-picker { position: relative; }
.selection-brand-picker summary {
  display: block;
  position: relative;
  min-height: 42px;
  padding: 10px 28px 10px 10px;
  overflow: hidden;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: white;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  line-height: 20px;
}
.selection-brand-picker summary::-webkit-details-marker { display:none; }
.selection-brand-picker summary::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.selection-brand-picker summary:focus-visible { outline: 2px solid #bd1937; outline-offset: 2px; }
.selection-brand-menu {
  display: grid;
  gap: 8px;
  position: absolute;
  z-index: 3;
  top: calc(100% + 5px);
  inset-inline-start: 0;
  width: max(100%, 218px);
  padding: 10px;
  border: 1px solid #ded5da;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px #29132324;
}
.selection-brand-options { display:grid; gap:3px; max-height:min(190px,32dvh); overflow:auto; padding:2px; }
.selection-brand-option {
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  color: #242026;
  text-align: left;
  overflow-wrap: anywhere;
}
.selection-brand-option:is(:hover,[aria-pressed=true]) { background: #f7e8ee; color: #8d1d39; }
.selection-brand-menu > p { padding: 7px 4px; font-size: .85rem; }
.selection-remove-vehicle,.selection-add-vehicle {
  min-height: 42px;
  border: 1px solid #e1d3d9;
  background: #fff;
  color: #8d1d39;
}
.selection-remove-vehicle { padding-inline: 10px; }
.selection-add-vehicle { justify-self: start; }
.selection-add-vehicle::before { content: '+ '; }
.selection-remove-vehicle:hover,.selection-add-vehicle:hover { border-color:#a94c65; background:#fff6f8; }
.selection-picker-status { grid-column:1/-1; font-size:.9rem; color:#8d1d39; }
.selection-picker-status:empty { display:none; }
.selection-budget,.selection-advanced {
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e6dfe3;
  border-radius: 12px;
}
.selection-budget legend { padding-inline: 5px; font-weight: 700; }
.selection-advanced summary { cursor:pointer; font-weight:650; }
.selection-advanced[open] summary { margin-bottom:12px; }
.selection-order-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding: 10px 0 2px;
  border-top: 1px solid #eee6e9;
  background: #fff;
}
.selection-order-actions button { min-height:44px; }
.selection-options .selection-match-criteria{display:flex;align-items:center;gap:8px;margin:8px 0}
.selection-match-criteria input[type=checkbox]{width:auto}
.selection-form .selection-check{display:flex;align-items:center;gap:8px}
.selection-form .selection-check input{width:auto}
@media(max-width:650px){
  .selection-vehicle { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .selection-brand { grid-column:1/-1; }
  .selection-remove-vehicle { justify-self:start; }
}
@media(max-width:380px){
  .selection-vehicle > label { grid-column:1/-1; }
}
.saved-search-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.selection-option{display:grid;gap:7px;padding:12px;border:1px solid #ddd9db;border-radius:10px}
.selection-option .desk-link{justify-self:start;text-align:left}
.selection-option small{color:#655c60}
.selection-option-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.selection-option-actions span{flex:1 1 12rem}
.selection-options details summary{margin:8px 0;cursor:pointer}
.selection-results{display:grid;gap:7px}
.offer-preview-button{background:white;color:#762840;border:1px solid #dbb8c4}
.offer-price-decision:not([hidden]) {
  grid-column:1/-1; display:grid; gap:8px; padding:12px; border:1px solid #d9b9c3; border-radius:10px; background:#fff7f9;
}
.offer-price-decision p { margin:0 0 2px; color:#70283e; font-size:.94rem; font-variant-numeric:tabular-nums; }
.offer-price-decision button { min-height:40px; }
