/*
 * MAiWeb RFQ form — selector-scoped excerpt of the vendored Matrix preview styles
 * (sites/cnc-001/preview/styles.css). Boundary: exactly the class/id inventory of
 * parts/quote-dialog.php plus the app.js-injected elements (#request-recovery,
 * #pending-request-reference, #check-request-status, #check-pending-request). Every
 * selector is scoped under #quote-dialog (or the body.dialog-open state the modal wiring
 * adds) so the excerpt cannot clash with the site theme. The palette/typography variables
 * the source defines at :root are re-declared on the dialog itself. Rule values are the
 * source's verbatim except the recorded MAiWeb deltas, marked inline: the scoped universal
 * [hidden] restatement, the box-sizing restatement, the inline-mode flow switch and the
 * 2026-10-18 typography tier re-base.
 * See PROVENANCE.md for the exact upstream source and delta list.
 */

#quote-dialog {
  --ink: #102c3b;
  --green: #087f75;
  --green-dark: #07695f;
  --paper: #fff;
  --stone: #f3f3ee;
  --muted: #52616a;
  --line: #d9dfdc;
  --soft-green: #e7f2ee;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "Courier New", monospace;
  border: none;
  box-shadow: 0 20px 100px #102c3b35;
  padding: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
}
#quote-dialog::backdrop { background: rgba(7, 25, 35, .62); backdrop-filter: blur(3px); }
#quote-dialog[open] { animation: dialog-in .2s ease-out; }
#quote-dialog.quote-dialog { position: fixed; left: auto; right: 0; top: 0; bottom: 0; width: min(690px, 100%); height: 100dvh; max-height: 100dvh; max-width: 100%; margin: 0; overflow-y: auto; }
body.dialog-open { overflow: hidden; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* MAiWeb delta (hidden semantics): the source carries a universal
   [hidden]{display:none!important}; the excerpt's per-rule display:flex/grid/inline-flex
   values on .preview-notice/.wizard-progress/.button overrode the UA [hidden] behavior and
   kept hidden status notices, step bars and action buttons visible. Scoped restatement of
   the source's exact semantics — nothing outside #quote-dialog is affected. */
#quote-dialog [hidden] { display: none !important; }

/* MAiWeb delta (box sizing): the source also carries a universal
   *{box-sizing:border-box}; without it the excerpt's width:100% inputs/selects/textareas
   overflow their track by their own padding+border (observed on the Cinra Contact/Quote
   form at 390px: inputs met the right viewport edge against the 20px left inset), and the
   padded buttons/checkbox/icon-button metrics silently grew past the source values.
   Scoped restatement of the source's exact semantics — nothing outside #quote-dialog is
   affected; the plugin-owned opener button below restates it directly because it sits
   outside the dialog. */
#quote-dialog, #quote-dialog *, #quote-dialog *::before, #quote-dialog *::after { box-sizing: border-box; }

/* MAiWeb delta (typography tiers, 2026-10-18): the source ships a 9–13px helper/label/input
   scale (the own-stage 390px check measured .form-hint at a computed 11px) that the
   operator's standing feedback and the native Quote review both flagged unreadable.
   Font sizes are re-based on semantic tiers: 16px body and typed entry (inputs, selects,
   textareas, intro, consent statement, success paragraphs), 14px labels/helpers/errors/
   control text (field labels, placeholders, legends, hints, readiness notices, progress,
   errors, buttons, links, file names, summary rows) and a 12px floor for auxiliary
   metadata (file policy, format/size/state annotations, required markers, step bar,
   counters, footnotes). Large headings, spacing, colors and interaction are unchanged, and
   the text tiers hold at every width — see the responsive note at the breakpoints below. */
#quote-dialog .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 35px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 2; }
#quote-dialog .icon-button { display: grid; place-items: center; min-width: 38px; min-height: 38px; border: 1px solid var(--line); background: #fff; font-size: 24px; font-weight: 400; line-height: 1; }
#quote-dialog .icon-button:hover { background: var(--stone); }
#quote-dialog .quote-content { padding: 33px 39px 43px; }
#quote-dialog .quote-content > h2 { font-size: 43px; }
#quote-dialog .dialog-intro { font-size: 16px; margin-top: 16px; }
#quote-dialog .preview-notice { font-size: 14px; line-height: 1.7; background: var(--soft-green); color: #386557; display: flex; align-items: flex-start; gap: 8px; padding: 12px 13px; margin-top: 20px; }
#quote-dialog .status-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
#quote-dialog .preview-notice > .status-dot { margin-top: 9px; }

#quote-dialog .form-section { border: 0; padding: 0; margin: 32px 0 0; min-width: 0; }
#quote-dialog .form-section > legend { padding: 0; margin-bottom: 16px; width: 100%; font-size: 14px; font-weight: 600; }
#quote-dialog .form-panel .form-section { margin-top: 23px; }
#quote-dialog .drop-zone { position: relative; border: 1px dashed #a5bdb3; background: #f6f8f5; text-align: center; padding: 25px 15px; transition: background .15s, border-color .15s; }
#quote-dialog .drop-zone.drag-over { border-color: var(--green); background: var(--soft-green); }
#quote-dialog .drop-zone svg { display: block; margin: 0 auto 12px; color: var(--green); }
#quote-dialog .drop-zone > strong { font-size: 14px; display: block; }
#quote-dialog .drop-zone > span { font-size: 14px; color: var(--muted); display: block; margin-top: 4px; }
#quote-dialog .drop-zone label { color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; position: relative; z-index: 1; }
#quote-dialog .drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#quote-dialog .drop-zone > p { font-size: 12px; line-height: 1.8; margin-top: 14px; pointer-events: none; }
#quote-dialog .drop-zone:focus-within { outline: 3px solid #18a99b; outline-offset: 4px; }
#quote-dialog .file-list, #quote-dialog .summary-files ul { list-style: none; padding: 0; margin: 11px 0 0; }
#quote-dialog .file-item { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 11px 0; font-size: 14px; }
#quote-dialog .file-item > div { min-width: 0; flex: 1; }
#quote-dialog .file-item strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
#quote-dialog .file-item > div > span { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
#quote-dialog .file-item > span { font-family: var(--mono); font-size: 12px; color: var(--green); }
#quote-dialog .file-item button { background: none; border: none; min-width: 36px; min-height: 36px; font-size: 19px; color: #6d8076; }
#quote-dialog .file-state { color: var(--green) !important; }
#quote-dialog .field-error { color: #9a3630; font-size: 14px; background: #fff0ea; padding: 10px 12px; margin-top: 10px; }

#quote-dialog .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
#quote-dialog .field-grid label, #quote-dialog .full-field { font-size: 14px; line-height: 1.5; display: block; font-weight: 600; }
#quote-dialog .field-grid input, #quote-dialog .field-grid select, #quote-dialog .full-field textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid #bfcac4; background: #fff; border-radius: 0; min-height: 44px; padding: 10px 12px; font-size: 16px; color: var(--ink); font-weight: 400; }
#quote-dialog .field-grid input::placeholder, #quote-dialog .full-field textarea::placeholder { color: #83938a; opacity: 1; font-size: 14px; }
#quote-dialog .field-grid select { padding-right: 25px; }
#quote-dialog .field-span { grid-column: 1 / -1; }
#quote-dialog .full-field { margin-top: 17px; }
#quote-dialog .full-field textarea { resize: vertical; min-height: 97px; }
#quote-dialog .required-note { color: #7d8d84; font-size: 12px; font-weight: 400; margin-left: 4px; }

#quote-dialog .request-summary { padding: 30px 0 0; }
#quote-dialog .request-summary[hidden], #quote-dialog #quote-form[hidden] { display: none; }
#quote-dialog .request-summary > h3 { font-size: 31px; }
#quote-dialog .summary-status { background: var(--soft-green); padding: 13px 14px; font-size: 14px; line-height: 1.7; color: #285d4c; margin: 20px 0; }
#quote-dialog .request-summary dl { margin: 0; }
#quote-dialog .request-summary dl > div { display: grid; grid-template-columns: 105px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; gap: 16px; }
#quote-dialog .request-summary dt { color: var(--muted); font-weight: 400; }
#quote-dialog .request-summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#quote-dialog .summary-files { margin-top: 25px; }
#quote-dialog .summary-files h4 { font-size: 14px; }
#quote-dialog .summary-files li { font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#quote-dialog .summary-actions { display: flex; align-items: center; gap: 24px; margin-top: 27px; flex-wrap: wrap; }
#quote-dialog .summary-actions .button { min-height: 46px; font-size: 14px; }
#quote-dialog .summary-actions .text-link { font-size: 14px; gap: 12px; }
#quote-dialog .summary-footnote { font-size: 12px; line-height: 1.8; margin-top: 17px; }

#quote-dialog .wizard-progress { list-style: none; padding: 0; margin: 26px 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#quote-dialog .wizard-progress li { padding: 10px 0; border-top: 2px solid var(--line); font-family: var(--mono); font-size: 12px; color: #8a9b91; }
#quote-dialog .wizard-progress li.is-current { border-color: var(--green); color: var(--green); }
#quote-dialog .wizard-progress li.is-complete { border-color: #83b7a2; color: #647e70; }
#quote-dialog .wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 23px; margin-top: 26px; border-top: 1px solid var(--line); }
#quote-dialog .wizard-actions > span { font-family: var(--mono); font-size: 12px; color: var(--green); }
#quote-dialog .wizard-actions .button { min-height: 49px; font-size: 14px; }
#quote-dialog .wizard-actions .text-link { font-size: 14px; }
#quote-dialog .form-hint { font-size: 14px; line-height: 1.85; color: #6c8475; margin-top: 18px; }
#quote-dialog .consent-field { display: flex; gap: 11px; align-items: flex-start; font-size: 16px; color: var(--muted); line-height: 1.9; margin-top: 22px; }
#quote-dialog .consent-field input { margin-top: 7px; accent-color: var(--green); width: 15px; height: 15px; flex-shrink: 0; }
#quote-dialog .consent-field a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
#quote-dialog .honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#quote-dialog .quote-progress { padding: 11px 13px; background: var(--stone); color: var(--green); font-size: 14px; margin-top: 14px; }
#quote-dialog .rfq-success { padding-top: 30px; }
#quote-dialog .rfq-success h3 { font-size: 30px; line-height: 1.14; margin-bottom: 23px; }
#quote-dialog .rfq-success p { font-size: 16px; line-height: 1.85; margin-bottom: 17px; }
#quote-dialog .rfq-success #success-id { font-family: var(--mono); font-size: 16px; background: var(--soft-green); padding: 15px; color: var(--green); }
#quote-dialog .rfq-success .button { margin-top: 14px; }

#quote-dialog .button { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 56px; padding: 16px 23px; color: #fff; background: var(--green); border: 1px solid var(--green); font-size: 14px; font-weight: 600; line-height: 1.4; transition: background .15s, transform .15s; }
#quote-dialog .button:hover { background: var(--green-dark); border-color: var(--green-dark); }
#quote-dialog .button > span { font-size: 21px; font-weight: 400; line-height: 1; }
#quote-dialog .button-secondary { color: var(--ink); background: #fff; border-color: var(--line); }
#quote-dialog .button[disabled] { opacity: .65; cursor: wait; }
#quote-dialog .text-link { display: inline-flex; gap: 24px; align-items: center; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.55; text-align: left; }

/* MAiWeb delta (inline mode): the stock partial positions the dialog as a fixed right-side
   sheet; display_mode=inline renders the same markup in the document flow instead. */
#quote-dialog.quote-dialog.is-inline { position: static; width: 100%; height: auto; max-height: none; box-shadow: none; border: 1px solid var(--line); }

/* Renderer-owned opener (explicit dialog mode): one accessible button before the dialog
   riding the vendored script's existing data-open-quote binding. Values are the source's
   .button rule verbatim; scoped to the plugin's own class because the button sits outside
   #quote-dialog where the dialog-scoped variables and rules apply. */
button.maiweb-rfq-opener {
  --green: #087f75;
  --green-dark: #07695f;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 56px;
  padding: 16px 23px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
button.maiweb-rfq-opener:hover { background: var(--green-dark); border-color: var(--green-dark); }

/* Responsive rules from the source's 700px/450px/390px breakpoints, scoped and reduced to
   the partial's inventory. The source's per-rule text-tier font step-downs at 700px were
   dropped in the 2026-10-18 typography repair — the tiers above hold at every width (the
   readability complaint was measured at 390px) — while every structural rule (paddings,
   gaps, grid columns) and the large-heading scale keep the source's responsive behavior. */
@media (max-width: 700px) {
  #quote-dialog .quote-content { padding: 28px 23px 33px; }
  #quote-dialog .dialog-top { padding: 16px 23px; }
  #quote-dialog .quote-content > h2 { font-size: 36px; }
  #quote-dialog .dialog-intro { margin-top: 15px; }
  #quote-dialog .preview-notice { line-height: 1.8; }
  #quote-dialog .form-section { margin-top: 27px; }
  #quote-dialog .field-grid { gap: 14px; }
  #quote-dialog .field-grid input, #quote-dialog .field-grid select, #quote-dialog .full-field textarea { padding: 10px 9px; }
  #quote-dialog .required-note { display: block; margin-left: 0; }
  #quote-dialog .request-summary > h3 { font-size: 28px; }
  #quote-dialog .request-summary dl > div { grid-template-columns: 85px 1fr; gap: 13px; }
  #quote-dialog .summary-actions { gap: 18px; }
  #quote-dialog .wizard-progress { gap: 5px; }
  #quote-dialog .wizard-actions .button { gap: 24px; padding: 14px 17px; }
  #quote-dialog .rfq-success h3 { font-size: 28px; }
}
@media (max-width: 450px) {
  #quote-dialog .wizard-progress { grid-template-columns: repeat(2, 1fr); gap: 5px 15px; }
}
@media (max-width: 390px) {
  #quote-dialog .field-grid { grid-template-columns: 1fr; }
  #quote-dialog .field-span { grid-column: auto; }
  #quote-dialog .required-note { display: inline; margin-left: 4px; }
  #quote-dialog .quote-content { padding-left: 20px; padding-right: 20px; }
  #quote-dialog .dialog-top { padding-left: 20px; padding-right: 20px; }
}
