/* Quote Mark cards share the Piece Desk's blue drawings and quiet controls. */
.face-piece-view-controls,.quote-card-profile .rr-orient-rotate,.quote-card-profile .rr-compass,[data-quote-card-three-view] .rr-orient-rotate,[data-quote-card-three-view] .rr-compass{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:6px 10px;color:#315a76;font-size:11px;border-bottom:1px solid #dce7ee}
.quote-card-profile .rr-compass,[data-quote-card-three-view] .rr-compass{justify-content:center}
.quote-card-profile .rr-orient-rotate button,.quote-card-profile .rr-compass button,[data-quote-card-three-view] .rr-orient-rotate button,[data-quote-card-three-view] .rr-compass button{padding:3px 7px;border:1px solid #bdd2e1;border-radius:4px;background:#fff;font-size:11px;cursor:pointer}
.face-piece-view-controls label{display:inline-flex;align-items:center;gap:4px;min-width:0}
.face-piece-view-controls select{padding:3px 5px;border:1px solid #bdd2e1;border-radius:4px;background:#fff;font-size:11px}
[data-face-view]{accent-color:#167ca2}
[data-profile-leg-dimension] text{font:600 11px ui-monospace,SFMono-Regular,Menlo,monospace}
.profile-end-caps{padding:6px 10px;border-top:1px solid #dce7ee;font-size:11px;color:#315a76}
.profile-end-caps button{padding:4px 8px;border:1px solid #bdd2e1;border-radius:4px;background:#fff}
.profile-end-caps fieldset{margin-top:6px;min-width:0}
.profile-end-caps legend{font-weight:600;margin-bottom:5px}
.profile-end-caps label{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:5px 0}
.profile-end-caps select,.profile-end-caps input[type=text]{padding:3px 5px;min-width:0;max-width:100%;border:1px solid #bdd2e1;border-radius:4px;background:#fff;font-size:11px}
.profile-end-caps input[type=text]{width:72px}
.profile-end-caps [hidden]{display:none!important}
/* BROWSER-RECUT-1: the FACE-EDIT strip is grid-column:2 under 3D. When End
   Caps opens at <=550px the pair already goes single-column so the fieldset
   can use the full card. Leaving the strip on column 2 created an implicit
   second track (~297px), collapsed Profile to ~2px, and let the 3D stack
   eat the Enable-caps click (hosted ONLY_ON_HEAD). Pin the strip to column 1
   for that stacked state only — desktop bottom-right quadrant is unchanged. */
@media(max-width:550px){.quote-card-visual-pair:has([data-profile-end-caps]:not([hidden])){grid-template-columns:minmax(0,1fr)}.quote-card-visual-pair:has([data-profile-end-caps]:not([hidden]))>[data-quote-card-edit-toolkit],.quote-card-visual-pair:has([data-profile-end-caps]:not([hidden]))>.quote-card-edit-toolkit,.quote-card-visual-pair:has([data-profile-end-caps]:not([hidden]))>[data-weld-opt-in]{grid-column:1}}
.quote-card-three-stack{grid-column:auto;min-width:0;margin:0;border:1px solid #d6e3ec;border-radius:10px;overflow:hidden;background:#f8fbfd;display:flex;flex-direction:column}
.quote-card-visual-pair>[data-weld-opt-in]{grid-column:2}
.quote-card-visual-pair>[data-quote-card-edit-toolkit]{grid-column:2}
.quote-mark-card .weld-opt-in-wrap{flex-shrink:0;border-top:1px solid #dce7ee;background:#f8fbfd}
.quote-mark-card .brake-meta{min-width:0;max-width:100%}
.quote-mark-card .brake-meta .portal-chip{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;flex-wrap:wrap}
.skinny-quote-card.quote-mark-card{display:block;padding:0;border:0;background:transparent;min-width:0}
.quote-card-primary{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;min-width:0}
.quote-card-mark{display:flex;flex:1 1 150px;min-width:min-content;flex-direction:column;align-items:flex-start;gap:5px}
.quote-mark-card .skinny-card-label{font-size:11px;line-height:1.4;letter-spacing:.07em;text-transform:uppercase;font-weight:600;color:#64748b}
/* MARK-CHIP-END-BUFFER: field-sizing:content + inherited
   border-box ate the 8px padding, so MK-003303 clipped the last glyph.
   Content-box keeps padding-inline outside the mark id. */
.quote-mark-card .skinny-card-mark-input,.quote-card-mark .part-mark-input{font-size:25px;font-weight:650;line-height:1.3;color:#173b54;width:auto;max-width:none;min-width:4ch;height:44px;padding:5px 8px;padding-inline:8px;border:1px solid #c8d7e2;border-radius:7px;background:white;field-sizing:content;box-sizing:content-box;overflow:visible;overflow-x:visible;text-overflow:clip}
.quote-card-quantity{display:flex;flex:0 0 92px;flex-direction:column;gap:5px}
.quote-card-quantity .input{width:92px;min-height:44px;font-size:23px;font-weight:600;text-align:center;color:#173b54;padding:5px 8px}
.quote-card-primary-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px;min-height:44px}
.quote-card-ask-stace{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:7px 12px;border:1px solid #0284c7;border-radius:7px;background:linear-gradient(160deg,#38bdf8 0%,#0ea5e9 30%,#0284c7 55%,#075985 78%,#0ea5e9 100%);color:#fff;font-size:13px;font-weight:700;white-space:nowrap;cursor:pointer}
.quote-card-ask-stace:hover{filter:brightness(1.08)}.quote-card-ask-stace:focus-visible{outline:2px solid #075985;outline-offset:3px}
.piece-chat-input{min-width:0}.piece-chat-scope{overflow-wrap:anywhere}
.quote-card-edit{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:7px 12px;border:1px solid #bdd2e1;border-radius:7px;background:#f1f8fc;color:#225b83;font-size:13px;font-weight:600}
.quote-card-edit:hover{background:#e1f0f9}.quote-card-remove{width:32px;height:38px;color:#7b8795;font-size:12px;border-radius:5px}.quote-card-remove:hover{color:#b44646;background:#fff3f3}
.quote-card-collapse-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid #c8d7e2;border-radius:7px;background:#fff;color:#315a76;font-size:13px;cursor:pointer}
.quote-card-collapse-btn:hover{background:#e1f0f9}
.quote-card-collapse-btn:focus-visible{outline:2px solid #5da9d6;outline-offset:2px}
.quote-mark-card.is-collapsed .quote-card-meta{margin:6px 0 0}
.quote-mark-card.is-collapsed .quote-card-visual-pair,
.quote-mark-card.is-collapsed .skinny-card-actions,
.quote-mark-card.is-collapsed .piece-chat{display:none!important}
.line-item.is-collapsed{padding-bottom:8px}
.line-item.is-collapsed>.line-details,
.line-item.is-collapsed>.line-expanded-only,
.line-item.is-collapsed>.quote-card-legacy-extrusion,
.line-item.is-collapsed .face-first-honesty-summary,
.line-item.is-collapsed .quote-card-source-pair,
.line-item.is-collapsed .import-mirror{display:none!important}
.quote-card-meta{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:5px 18px;margin:12px 0 15px;font-size:12px;color:#64748b;line-height:1.5}
.quote-card-meta [data-skinny-metal-thickness]{min-width:0;overflow-wrap:anywhere;white-space:normal}
.quote-card-line-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:7px}.quote-card-line-price>[data-skinny-piece-price]{font-weight:600;color:#475569}.quote-card-line-price>[data-skinny-line-price-math]{font-size:11px}
.quote-card-visual-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;min-width:0}
.quote-card-edit-toolkit{grid-column:2;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;padding:4px 0 10px;min-width:0}
.quote-card-export-menu{position:relative;display:inline-block}
.quote-card-export-menu>summary{list-style:none;display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:4px 10px;border:1px solid #bdd2e1;border-radius:6px;background:#f1f8fc;color:#225b83;font-size:12px;font-weight:600;cursor:pointer}
.quote-card-export-menu>summary::-webkit-details-marker{display:none}
.quote-card-export-menu>summary::after{content:"▾";font-size:10px;opacity:.7}
.quote-card-export-menu-list{position:absolute;left:0;top:calc(100% + 4px);z-index:40;min-width:168px;display:flex;flex-direction:column;gap:2px;padding:4px;border:1px solid #c8d7e2;border-radius:8px;background:#fff;box-shadow:0 10px 28px #0b182c22}
.quote-card-export-menu-list button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:#225b83;font-size:12px;font-weight:600;cursor:pointer}
.quote-card-export-menu-list button:hover{background:#e1f0f9}
.quote-card-export-menu-list button:disabled{opacity:.45;cursor:not-allowed}
.quote-card-edit-tool{display:inline-flex;align-items:center;min-height:32px;padding:5px 10px;border:1px solid #bdd2e1;border-radius:7px;background:#f1f8fc;color:#225b83;font-size:12px;font-weight:600;cursor:pointer}
.quote-card-edit-tool:hover{background:#e1f0f9}
.quote-mark-card.is-collapsed .quote-card-edit-toolkit{display:none!important}
.quote-card-profile,.quote-mark-card [data-quote-card-three-view]{grid-column:auto;min-width:0;margin:0;border:1px solid #d6e3ec;border-radius:10px;overflow:hidden;background:#f8fbfd;display:flex;flex-direction:column}
.quote-mark-card .quote-card-three-stack [data-quote-card-three-view]{border:0;border-radius:0;flex:1}
.quote-card-profile-head,.quote-mark-card .quote-card-three-head,.quote-card-source-head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:9px 11px;background:#f0f6fa;border-bottom:1px solid #dce7ee;font-size:13px;font-weight:600;line-height:1.4;color:#315a76}
.quote-mark-card .quote-card-three-title{font-size:13px;font-weight:600;color:#315a76}
.quote-card-popout{width:28px;height:26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #cfdee8;border-radius:5px;background:#fff;color:#52718b;font-size:11px;flex-shrink:0}
.quote-card-popout:hover{background:#e0eff9}
.quote-card-profile-dimensions{min-height:38px;display:flex;align-items:center;padding:5px 9px;font-size:10px;line-height:1.3;color:#567187;border-bottom:1px solid #e3ecf2}
.quote-card-profile-dimensions.quote-card-dimensions-check{color:#c76b16}
.quote-mark-card .quote-card-named-views{display:flex;flex-wrap:wrap;gap:3px;min-height:38px;align-items:center;padding:4px 7px;background:#f8fbfd}
.quote-mark-card .quote-card-named-view{padding:3px 6px;font-size:10px;color:#52718b;border-color:#d3e0e9;background:#fff}
.quote-mark-card .quote-card-named-view.on{color:#225b83;background:#dceef9;border-color:#8ebbd8}
.quote-card-drawing-viewport{position:relative;height:225px;min-height:225px;overflow:hidden;touch-action:none;cursor:grab;background:#fbfdff;flex:1}
.quote-card-drawing-viewport [data-profile-compass-hud],
[data-quote-card-profile-canvas] [data-profile-compass-hud],
[data-draft-profile] [data-profile-compass-hud]{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);z-index:3;pointer-events:none;padding:3px 10px;border:1px solid #bdd2e1;border-radius:999px;background:rgba(248,251,253,.94);color:#315a76;font:700 12px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em}
.quote-card-drawing-viewport[data-dragging=true],.quote-card-source-viewport[data-dragging=true]{cursor:grabbing}
.quote-card-drawing-viewport svg{position:absolute;left:0;top:0;max-width:none;max-height:none;transform-origin:0 0;user-select:none}
.quote-card-drawing-viewport:focus-visible,.quote-card-source-viewport:focus-visible{outline:2px solid #5da9d6;outline-offset:-2px}
.quote-mark-card .quote-card-three-canvas-wrap{position:relative;height:225px;min-height:225px;flex:1}
.quote-mark-card .quote-card-three-canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.quote-mark-card [data-flat2d-overlay],.draft-workbench-three [data-flat2d-overlay]{position:absolute;right:8px;top:8px;width:min(32%,148px);max-height:34%;z-index:4;background:rgba(11,15,20,.9);border:1px solid #2F5F86;border-radius:8px;overflow:hidden;pointer-events:none}
.quote-mark-card [data-flat2d-overlay][hidden],.draft-workbench-three [data-flat2d-overlay][hidden]{display:none!important}
.quote-mark-card [data-flat2d-overlay] svg,.draft-workbench-three [data-flat2d-overlay] svg{display:block;width:100%;height:auto;max-height:88px}
.draft-workbench-three{position:relative}
.quote-card-view-hint,.quote-mark-card .quote-card-three-hint{min-height:32px;padding:6px 9px;font-size:9px;line-height:1.3;background:#f0f6fa;color:#647c8d}
.quote-card-source-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px}
/* Piece/Page booth thumbs: #629 paper/ink floor, larger plate for demo glance.
   Height is scoped to the pair so the shared pop-out dialog can still fill. */
.quote-card-source{min-width:0;border:3px solid #245b83;border-radius:8px;overflow:hidden;background:#fffdf6;box-shadow:0 0 0 1px #173b54;transition:border-color 150ms ease,box-shadow 150ms ease}
.quote-card-source:focus-within{border-color:#173b54;box-shadow:0 0 0 1px #0f2740}
.quote-card-source-head{padding:8px;background:#dceef9;font-size:13px;font-weight:700;line-height:1.4;color:#173b54}
.quote-card-source-pair .quote-card-source-viewport{height:240px;min-height:240px}
.quote-card-source-viewport{position:relative;overflow:hidden;touch-action:none;cursor:grab;background:#fffdf6}
.quote-card-source-scene{position:absolute;left:0;top:0;transform-origin:0 0;user-select:none}
.quote-card-source-scene:has(.quote-card-source-empty){inset:0;width:100%;height:100%}
.quote-card-source-scene .doc.srcdoc{position:absolute;left:0;top:0;max-width:none;transform-origin:0 0;border:0;background:#fffdf6;box-shadow:inset 0 0 0 2px #245b83}
.quote-card-source-scene:has(.quote-card-source-empty) .doc.srcdoc{inset:0;width:100%;height:100%}
.quote-card-source-scene img{display:block;max-width:none;width:auto;height:auto;pointer-events:none;-webkit-user-drag:none;filter:contrast(1.42) saturate(1.18)}
.quote-card-source-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px 8px;background:#fffdf6;text-align:center}
.quote-card-source-empty-title{margin:0;font-size:13px;font-weight:700;line-height:1.3;color:#173b54}
.quote-card-source-empty-copy{margin:0;font-size:12px;line-height:1.4;color:#315a76}
.quote-card-source-attachment{margin-top:12px}.quote-card-legacy-extrusion>div:first-child{display:none}.quote-card-legacy-extrusion{margin-top:16px}
.quote-card-visual-overlay{position:fixed;inset:0;z-index:10001;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(10,22,32,.65)}
.quote-card-visual-dialog{width:min(1180px,100%);height:min(850px,90vh);display:flex;flex-direction:column;border:1px solid #aac8da;border-radius:13px;background:white;overflow:hidden;box-shadow:0 24px 90px #0b182c66}
.quote-card-visual-dialog header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;background:#f0f6fa;color:#315a76}
.quote-card-dialog-tools{display:flex;gap:6px}.quote-card-dialog-tools button{border:1px solid #c3d6e2;border-radius:6px;padding:5px 11px;background:white;color:#315a76;font-size:13px}
.quote-card-dialog-content{position:relative;flex:1;min-height:0;overflow:hidden}.quote-card-dialog-content canvas{display:block;width:100%;height:100%}.quote-card-dialog-status{position:absolute;inset:0;display:grid;place-items:center;color:#8faabd}
.quote-card-visual-dialog>p{padding:7px 16px;background:#f0f6fa;color:#647c8d;font-size:11px;pointer-events:none}
/* Quote Visual Lines hop: Cage ink the overlay pop-out only.
   Base .quote-card-visual-dialog stays white so #draft-workbench / paper plate hold. */
.quote-card-visual-overlay .quote-card-visual-dialog,
.quote-card-visual-dialog.qvl-chrome{background:#12161f;border:1px solid #1e2633;border-left:3px solid #38bdf8;border-radius:9px;box-shadow:none;transition:border-color 150ms ease}
.quote-card-visual-overlay .quote-card-visual-dialog header,
.quote-card-visual-overlay .quote-card-visual-dialog>p,
.quote-card-visual-dialog.qvl-chrome header,
.quote-card-visual-dialog.qvl-chrome>p{background:#12161f;color:#8f9dae;padding:8px 16px}
.quote-card-visual-overlay .quote-card-dialog-tools,
.quote-card-visual-dialog.qvl-chrome .quote-card-dialog-tools{gap:8px}
.quote-card-visual-overlay .quote-card-dialog-tools button,
.quote-card-visual-dialog.qvl-chrome .quote-card-dialog-tools button{background:#0d1017;border:1px solid #1e2633;border-radius:9px;color:#e7edf4;transition:border-color 150ms ease,color 150ms ease}
.quote-card-visual-overlay .quote-card-dialog-status,
.quote-card-visual-dialog.qvl-chrome .quote-card-dialog-status{color:#8f9dae;padding:16px 8px;font-size:.75rem}
.quote-card-visual-overlay .qvl-empty-state,
.quote-card-visual-dialog.qvl-chrome .qvl-empty-state{background:transparent;border:0;border-left:0}
@media(max-width:550px){.quote-card-primary{gap:10px}.quote-card-mark{flex-basis:120px;min-width:min-content}.quote-card-quantity{flex-basis:76px}.quote-card-quantity .input{width:76px}.quote-card-primary-actions{margin-left:auto}.quote-card-visual-pair,.quote-card-source-pair{gap:8px}.quote-card-drawing-viewport,.quote-mark-card .quote-card-three-canvas-wrap{height:195px;min-height:195px}.quote-card-source-pair .quote-card-source-viewport{height:176px;min-height:176px}.quote-card-visual-overlay{padding:8px}}
/* GlassBuild booth phones: overlay chrome + 8px rhythm. Desktop 240px
   paper plate and light #draft-workbench stay on the 550px / base rules. */
@media (max-width: 430px) {
    .quote-card-primary { gap: 8px; }
    .quote-card-visual-pair,
    .quote-card-source-pair { gap: 8px; }
    .quote-card-meta { gap: 8px; margin: 8px 0; }
    .quote-card-visual-overlay {
        align-items: stretch;
        justify-content: stretch;
        padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    }
    .quote-card-visual-overlay .quote-card-visual-dialog {
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 9px;
    }
    .quote-card-visual-overlay .quote-card-visual-dialog header {
        gap: 8px;
        padding: 8px;
    }
    .quote-card-visual-overlay .quote-card-dialog-tools {
        gap: 8px;
        flex-wrap: wrap;
    }
    .quote-card-visual-overlay .quote-card-dialog-tools button {
        min-height: 44px;
        padding: 8px;
    }
    .quote-card-visual-overlay .quote-card-visual-dialog > p { padding: 8px; }
    .quote-card-visual-overlay .qvl-empty-state {
        padding: 16px 8px;
        min-height: 72px;
    }
}
