/* Keep this native dialog compact inside the Caja window manager. */
@layer quotation-overrides {
  #quotationChooser[data-quotation-window] {
    --chooser-header: 44px;
    --chooser-close: 32px;
    box-sizing: border-box;
    position: fixed !important;
    inset: 0 !important;
    width: min(418px, calc(100% - 24px)) !important;
    min-width: 0 !important;
    max-width: calc(100% - 24px) !important;
    height: max-content !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 16px) !important;
    margin: auto !important;
    padding: 0 !important;
    translate: var(--quote-window-x, 0px) var(--quote-window-y, 0px) !important;
    transform: none !important;
    border: 1px solid #dce5eb !important;
    border-radius: 16px !important;
    overflow: hidden;
    resize: none;
    background: #f6f9fc !important;
    color: #172b43;
    box-shadow: 0 16px 44px #12294236, 0 3px 10px #12294214 !important;
    font: 14px/1.3 Inter, 'Segoe UI', sans-serif;
  }

  #quotationChooser[data-chooser-mobile] {
    --chooser-header: 48px;
    --chooser-close: 44px;
  }

  #quotationChooser[data-quotation-window]:not([open]) { display: none !important; }
  #quotationChooser[data-quotation-window][open] { display: flex !important; flex-direction: column; }
  #quotationChooser[data-quotation-window]::backdrop { background: #14263e38 !important; }

  #quotationChooser .quotation-chooser-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    flex: 0 0 var(--chooser-header) !important;
    min-height: 0 !important;
    height: var(--chooser-header) !important;
    gap: 8px;
    padding: 0 8px 0 16px !important;
    margin: 0 !important;
    background: linear-gradient(105deg,#142e4c,#1c3c50 74%,#24535c) !important;
    border: 0 !important;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  #quotationChooser .quotation-chooser-head:active { cursor: grabbing; }
  #quotationChooser .quotation-chooser-head:focus-visible { outline: 2px solid #507897; outline-offset: -3px; }
  #quotationChooser .quotation-chooser-head::before,
  #quotationChooser .quotation-chooser-head::after { content: none !important; }

  #quotationChooser #quotationChooserTitle {
    margin: 0 !important;
    color: #fff !important;
    font: 680 15px/1.2 Inter, 'Segoe UI', sans-serif !important;
    letter-spacing: -.02em;
  }

  #quotationChooser .quotation-chooser-close {
    box-sizing: border-box;
    display: grid !important;
    place-items: center;
    flex: 0 0 var(--chooser-close) !important;
    width: var(--chooser-close) !important;
    height: var(--chooser-close) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #fff !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
  }

  #quotationChooser .quotation-chooser-close span {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #ffffff25;
    font: 500 18px/1 Inter, 'Segoe UI', sans-serif;
  }

  #quotationChooser .quotation-chooser-close:hover span { background: #ffffff42; }
  #quotationChooser .quotation-chooser-close:focus-visible { outline: 2px solid #507897 !important; outline-offset: -4px; }

  #quotationChooser .quotation-chooser-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
    padding: 12px !important;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #quotationChooser .quotation-chooser-options > button {
    --tile-cap: #e3edff;
    --tile-fill: #fff;
    --tile-hover: #f0f5fe;
    --tile-surface: var(--tile-fill);
    --tile-border: #c8d8ee;
    --tile-focus: #43649a;
    --icon-fill: #d7e5ff;
    --icon-ink: #2e538d;
    box-sizing: border-box;
    display: grid !important;
    justify-items: start;
    grid-template-rows: 34px minmax(34px,auto) auto;
    align-content: start;
    gap: 5px;
    min-width: 0 !important;
    min-height: 130px !important;
    margin: 0 !important;
    padding: 11px !important;
    border: 1px solid var(--tile-border) !important;
    border-radius: 11px !important;
    background: linear-gradient(153deg,var(--tile-cap),var(--tile-surface) 57%) !important;
    box-shadow: none !important;
    text-align: left !important;
    cursor: pointer;
  }

  #quotationChooser #viewSavedQuotes {
    --tile-cap: #def2e9;
    --tile-hover: #edf8f3;
    --tile-border: #bddbce;
    --tile-focus: #347569;
    --icon-fill: #d2ecdf;
    --icon-ink: #235f53;
  }

  #quotationChooser .quotation-chooser-options > button:is(:hover, :focus-visible) { --tile-surface: var(--tile-hover); }
  #quotationChooser .quotation-chooser-options > button:focus-visible {
    border-color: var(--tile-focus) !important;
    outline: none !important;
  }

  #quotationChooser .quotation-chooser-options strong {
    display: grid;
    align-items: center;
    max-width: 100%;
    margin: 0 !important;
    color: #172b43 !important;
    font: 700 14px/1.2 Inter, 'Segoe UI', sans-serif !important;
  }

  #quotationChooser .quotation-chooser-options small {
    color: #425975 !important;
    font: 500 12px/1.25 Inter, 'Segoe UI', sans-serif !important;
  }

  #quotationChooser .quotation-chooser-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--icon-fill);
    color: var(--icon-ink);
  }
}

#quotationChooser .quotation-chooser-add::before {
  width: 12px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  content: '';
}

#quotationChooser .quotation-chooser-add::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 650 12px/1 Inter, 'Segoe UI', sans-serif;
  content: '+';
}

#quotationChooser .quotation-chooser-folder::before {
  width: 15px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  content: '';
}

#quotationChooser .quotation-chooser-folder::after {
  position: absolute;
  top: 8.5px;
  left: 8.5px;
  width: 7px;
  height: 3px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  content: '';
}
