/* Custom Metal Quotes: loaded on every page after css/portal.css (templates/base.html). The line form's look is a copy of
   Custom Wood Quotes' (static/quoting_wood/quoting_wood.css) under the mq- names, so each module keeps its own. New metal
   quoting styles go at the end of this file. */

/* ---- Custom Metal Quotes ---- */
.mq-form { max-width: 860px; }
.mq-form .card h3.minor { margin-top: 18px; }
.mq-form .check { display: flex; align-items: flex-start; gap: 8px; margin-top: 26px; font-weight: 500; }
.mq-form .check .sub { display: block; font-weight: 400; }
.mq-form .check.mq-prehung, .mq-form .check.mq-head { margin-top: 6px; margin-bottom: 4px; }   /* a tick box that heads its own fields */
.mq-leg-note { margin-top: 24px; }
.mq-form .check + .check { margin-top: 6px; }      /* two tick boxes in one cell: TDL and custom SDL, left and right sidelite */
.mq-form .mq-off { opacity: .45; }
.mq-form .mq-off select { background: var(--soft, #f3efe9); }
.mq-frame-note { font-weight: 400; margin-left: 6px; }
.mq-desc { white-space: normal; line-height: 1.45; }
.mq-text { white-space: pre-line; }
.mq-static { padding: 9px 0; font-weight: 500; }
.mq-sizes { font-weight: 500; color: var(--brown); }
.mq-summary { border-left: 4px solid var(--terracotta); }
.mq-summary-row { display: flex; gap: 14px; align-items: baseline; padding: 4px 0; }
.mq-summary-label { flex: 0 0 90px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.mq-summary .mq-sizes { font-weight: 500; color: var(--brown); }
.mq-summary .mq-sizes.muted, .mq-summary .mq-desc.muted { font-weight: 400; color: var(--muted); }
.mq-form-tabs { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
/* The door unit form takes the width of the window, as the Hub does, so its cards and fields are wide. */
main.wrap:has(.mq-line-layout) { max-width: 1440px; padding-left: 24px; padding-right: 24px; }   /* wider than the usual page, centred */
.mq-line .row3.mq-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }                     /* size by, width and height on one line */
/* A row of buttons standing in for a short pick-list, such as the thickness. */
.mq-seg { display: flex; flex-wrap: wrap; gap: 10px; }
.mq-seg label { cursor: pointer; }
.mq-seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.mq-seg span { display: block; padding: 9px 22px; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.mq-seg label:hover span { border-color: var(--brown); color: var(--brown); }
.mq-seg input:checked + span { background: var(--brown); border-color: var(--brown); color: #fff; }
.mq-seg input:focus-visible + span { outline: 2px solid var(--brown); outline-offset: 2px; }
/* The usual sizes as small buttons over a size box; the one matching the box lights up. */
.mq-quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.mq-pill { border: 1px solid var(--line); border-radius: 20px; padding: 3px 11px; background: #fff; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.mq-pill:hover { border-color: var(--brown); color: var(--brown); }
.mq-pill.on { background: var(--brown); border-color: var(--brown); color: #fff; }
.mq-seg label.mq-off span { cursor: default; }                                              /* a measure a door only cannot be given by */
.mq-by { margin-bottom: 10px; }
.mq-lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }      /* a size box's label with its Fixed tick at the right */
.mq-tick { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); cursor: pointer; margin: 0; }
.mq-tick.mq-off { opacity: .45; cursor: default; }
.mq-tick[hidden] { display: none; }                                                        /* no Fixed ticks for a slab size: nothing is worked out */
.mq-overall[hidden] { display: none; }
.mq-fixed input[readonly] { background: var(--soft, #f3efe9); color: var(--ink-2); }      /* a figure worked out for you, such as a half-round transom's height */
.mq-pill:disabled, .mq-fixed .mq-pill { opacity: .4; cursor: default; }                  /* sizes that cannot be chosen now: greyed, as with a round transom (David Roberts, 2026-11-04) */
.mq-pill:disabled:hover { border-color: var(--line); color: var(--ink); }
/* The configuration picker: a small sketch per way of putting the unit together. */
.mq-configs { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 8px; }
.mq-config { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px 6px; text-align: center; cursor: pointer; background: #fff; }
.mq-config input { position: absolute; opacity: 0; width: 0; height: 0; }
.mq-config svg { width: 100%; height: 84px; display: block; margin: 0 auto 4px; }
.mq-tops { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-width: 420px; }
.mq-config span { display: block; font-size: 12.5px; line-height: 1.25; }
.mq-config .mq-config-pic[hidden] { display: none; }                                      /* only the chosen top shape's drawing shows */
.mq-config:hover { border-color: var(--brown); }
.mq-config:has(input:checked) { border-color: var(--brown); box-shadow: 0 0 0 2px var(--brown) inset; background: #fdf8f3; }
.mq-line-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
/* The door unit form keeps its fields wide: two to a row, and every box fills its cell. */
.mq-line .row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.mq-line .row2 { gap: 12px 18px; }
.mq-line select, .mq-line input[type=text], .mq-line input[type=number], .mq-line textarea { width: 100%; box-sizing: border-box; }
.mq-form.mq-line { max-width: none; }                  /* the door unit form takes the page: its cards and tabs are inside it */
.mq-sketch-card { position: sticky; top: 14px; padding: 12px 14px; }                     /* a smaller card beside the form; the drawing fills it */
.mq-sketch-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 240px; display: flex; justify-content: center; align-items: flex-start; }
.mq-sketch-box img { width: 100%; height: auto; }
.mq-spacing[hidden], .mq-unequal[hidden] { display: none; }
.mq-btnrow { margin: 0 0 14px; }                                                           /* a row of buttons with its label above */
.mq-jamb-custom { margin-top: 8px; max-width: 260px; }
.mq-jamb-custom[hidden] { display: none; }
.mq-hands { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.mq-handcard { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 6px 6px; text-align: center; cursor: pointer; background: #fff; min-height: 64px; }
.mq-handcard input { position: absolute; opacity: 0; width: 0; height: 0; }
.mq-handcard svg { height: 76px; width: auto; max-width: 100%; display: block; margin: 0 auto 4px; }
.mq-handcard span { display: block; font-size: 12.5px; line-height: 1.25; }
.mq-hand-pic[hidden] { display: none; }
.mq-handcard:hover { border-color: var(--brown); }
.mq-handcard:has(input:checked) { border-color: var(--brown); box-shadow: 0 0 0 2px var(--brown) inset; background: #fdf8f3; }
.mq-handcard:has(input:focus-visible) { outline: 2px solid var(--brown); outline-offset: 2px; }
.mq-line select option[hidden] { display: none; }                                         /* spacings offered for another number of rails */
.mq-std-leg { display: block; margin-top: 6px; color: var(--brown); font-weight: 500; }           /* the standard arch's leg for this width */
.mq-legs-out[hidden] { display: none; }
.mq-legs-out input[readonly] { background: var(--soft, #f3efe9); color: var(--ink-2); }           /* the transom's leg and the whole unit's legs, worked out */
.mq-sketch-tools { margin: 8px 0 0; text-align: right; }
.mq-sketch-dialog { width: min(96vw, 1400px); max-height: 96vh; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mq-sketch-dialog::backdrop { background: rgba(31, 26, 23, .55); }
.mq-style-dialog { width: min(96vw, 1200px); max-height: 92vh; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: auto; }
.mq-style-dialog::backdrop { background: rgba(31, 26, 23, .55); }
.mq-style-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mq-style-dialog-head h2 { margin: 0; }
button.mq-style { font: inherit; cursor: pointer; width: 100%; }                         /* a style card on the form's catalog window */
.mq-style[hidden] { display: none; }                                                     /* a style of another top shape (2026-11-16) */
button.mq-style:hover { border-color: var(--brown); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
button.mq-style:hover .use { background: var(--brown); color: #fff; }
.mq-sketch-dialog img { display: block; width: 100%; height: auto; max-height: 84vh; object-fit: contain; }
.mq-thumb svg { width: 110px; height: auto; display: block; }
/* The door style catalog: category tabs, then a grid of wireframe thumbnails, each one a pick. */
.mq-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.mq-tab { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.mq-tab .count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.mq-tab:hover { border-color: var(--brown); color: var(--brown); }
.mq-tab.on { background: var(--brown); border-color: var(--brown); color: #fff; }
.mq-tab.on .count { color: #f3e6dc; }
.mq-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.mq-style { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; text-align: center; color: var(--ink); text-decoration: none; }
a.mq-style:hover { border-color: var(--brown); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.mq-style svg { width: 96px; height: auto; display: block; margin: 0 auto 8px; }
.mq-style .name { font-weight: 500; font-size: 13.5px; line-height: 1.3; }
.mq-style .sub { display: block; margin: 2px 0 6px; }
.mq-style .use { display: inline-block; font-size: 12.5px; color: var(--brown); border: 1px solid var(--brown); border-radius: 6px; padding: 3px 9px; }
a.mq-style:hover .use { background: var(--brown); color: #fff; }
.mq-thumb-doc svg { width: 140px; }
@media screen and (max-width: 980px) {
  /* One column: the sketch goes first and stays in view, small, while the form below it is filled in. */
  .mq-line-layout { grid-template-columns: 1fr; }
  .mq-sketch-card { order: -1; position: sticky; top: 0; z-index: 3; padding: 8px 12px; }
  .mq-sketch-card h2, .mq-sketch-card .sub { display: none; }
  .mq-sketch-box { min-height: 0; padding: 4px; }
  .mq-sketch-box img { width: auto; max-width: 100%; max-height: 30vh; }
}
table.mq-lines td.mq-desc { min-width: 320px; }
table.list tfoot td { border-top: 1px solid var(--line); background: var(--soft, #faf7f3); }
table.list tfoot tr.total td { font-size: 15px; }
@media print {
  .no-print, header, nav, footer, .messages { display: none !important; }
  body { background: #fff; }
  main.wrap { max-width: none; padding: 0; }
  .mq-doc { box-shadow: none; border: 0; max-width: none; }
}

/* Custom Wood Quotes: a section between the horizontal rails, set out on its own (2026-11-16) */
.mq-section { border: 2px solid #b9a796; border-radius: 10px; background: #fcfaf7; padding: 0 14px 12px; margin: 14px 0; overflow: hidden; }
.mq-section h4 { margin: 0 -14px 8px; padding: 8px 14px; background: #f1ebe3; border-bottom: 1px solid #d8cbbd; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.mq-section select { max-width: 22rem; }
#mq-door-layout[hidden], #mq-door-vgroove[hidden], #mq-door-glass[hidden], #mq-door-glass-row[hidden] { display: none; }        /* the sections stand for them */
.mq-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }   /* a tab's heading with its Reset button (2026-11-16) */
.mq-pair { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: flex-start; }   /* a count and its rail size side by side (2026-11-16) */

/* Custom Wood Pricing: the Pre-hung Unit Costs table (quoting_wood, 2026-11-17). */
/* The description is shown in full (David Roberts, 2026-11-17); a narrow screen scrolls the table inside its card. */
/* This page only: the main area is widened to fit the whole Pre-hung Unit Costs table (David Roberts, 2026-11-17). */
main.wrap:has(#prehung-table) { max-width: 1960px; }
/* Custom Wood Quotes: list and net price in the line form's header (David Roberts, 2026-11-17) */
.mq-summary .mq-price-row strong { color: var(--brown); font-size: 16px; }
.mq-price-incomplete { color: var(--terracotta); font-weight: 600; }
.mq-summary .mq-price-row strong.mq-price-incomplete { font-size: 14px; }
.mq-price-issues { margin-top: 12px; }
.mq-form .mq-override { display: flex; align-items: center; gap: 10px; }
.mq-form .mq-override .check { margin: 0; white-space: nowrap; }
.mq-price-issues ul { margin: 4px 0 0; padding-left: 18px; }
.mq-summary .mq-price-row .linklike { margin-left: 8px; }
.mq-summary .mq-price-detail { margin: 2px 0 6px 104px; font-size: 13px; }
.mq-summary .mq-price-parts td { padding: 2px 10px 2px 0; vertical-align: top; }
.mq-summary .mq-price-parts td.sub { color: var(--muted); font-size: 12px; }
.mq-summary .mq-price-total td { border-top: 1px solid var(--line); font-weight: 600; }
.mq-summary .mq-price-why { margin: 0 0 6px; padding: 6px 10px; border-left: 3px solid var(--terracotta); background: rgba(0,0,0,.03); }
.mq-summary .mq-price-why ul { margin: 2px 0 0; padding-left: 18px; }
@media screen and (max-width: 720px) { .mq-summary .mq-price-detail { margin-left: 0; } }
/* Custom Wood Pricing: Sidelite and Transom Prices tables (David Roberts, 2026-11-17) */
/* Custom Wood Pricing: every card folds from its heading (David Roberts, 2026-11-17) */
/* Custom Wood Quotes: the list's row buttons and a quote's history line (David Roberts, 2026-11-17) */
/* Custom Wood Quotes: the Cost / Proposal and Order boxes, the quote's customer (David Roberts, 2026-11-17) */
/* Custom Wood Quotes: the Dealer cost / Proposal price button on a quote (David Roberts, 2026-11-17) */
.mq-view-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.mq-view-toggle .btn[aria-pressed="true"] { background: var(--brown); color: #fff; border-color: var(--brown); }
/* Custom Wood Quotes: a door unit's description on its lines, sections indented (David Roberts, 2026-11-17) */
.mq-desc-lines { white-space: pre-wrap; }
/* Custom Wood Pricing: Documented pricing rules list (David Roberts, 2026-11-17) */
/* Custom Wood Pricing: Slab Pricing card (David Roberts, 2026-11-17) */

/* Custom Wood Pricing: Save pricing at the top of the page (2026-11-18). */

/* ---- steel's own (2026-11-19) ---- */
.mq-line .row3 { display: grid; }                                        /* the three-across rows; the wood tool's .row3 is its own */
.mq-custom { margin-top: 8px; max-width: 260px; }
.mq-custom[hidden] { display: none; }
.mq-quote-list td, .mq-quote-list th { padding: 6px 10px; text-align: left; }


/* Build step 4: the calculated list price on the Pricing tab, its workings, item number and Agility message. */
.mq-pane .mq-price-parts { border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; }
.mq-pane .mq-price-parts td { padding: 3px 14px 3px 0; vertical-align: top; }
.mq-pane .mq-price-parts td.num, .mq-summary .mq-price-parts td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mq-pane .mq-price-total td { border-top: 1px solid var(--line); font-weight: 600; }
.mq-price-why ul { margin: 4px 0 0; padding-left: 18px; }
.mq-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 0; font-size: 14px; }
.mq-facts dt { color: var(--muted); }
.mq-facts dd { margin: 0; }
.mq-pre { white-space: pre-wrap; }
.mq-unknowns { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0; }
.mq-missing { color: var(--terracotta); font-size: 13px; }

/* Build step 5: the quote pages, as the wood quotes' (quoting_wood.css). */
.mq-drawings li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mq-drawings li .sub { flex: 1; }
table.list td.mq-row-actions { min-width: 190px; white-space: normal; }
.mq-row-actions form.inline, .mq-actions form.inline { display: inline; }
.mq-row-actions .btn, .mq-actions .btn { margin: 2px 0 2px 4px; white-space: nowrap; }
table.list td.mq-actions { min-width: 170px; white-space: normal; }
.mq-dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; max-width: 480px; }
.mq-dialog .form-actions .btn { white-space: nowrap; }
.mq-dialog::backdrop { background: rgba(0,0,0,.35); }
.mq-dialog h3 { margin: 0 0 6px; }
.mq-dialog .form-actions + label.check { margin-top: 12px; }
.mq-pdf-sub { margin-left: 22px; }
.mq-lines .mq-thumb svg { width: auto; max-width: 110px; max-height: 150px; }
