/* frame.css: the frame of the Quotes module (shell.js, boot.js): the module's slim bar, the band, the customer frames, the first screen and the Desk stand-in.
   Ported from the approved mockup's mock.css by lane q1125-port (card P4384); the Mockup Bar and The Walk are gone, and the module lives inside the design system shell's <main class="ds-main">.
   Tokens only, no hex value. Every selector here is under qm- (the shell); the shared primitives are components.css under q-. */

/* THE MODULE'S LAYERS (card P4412). No stylesheet of the module writes a number after z-index: each surface names its layer of shared/layers.css, the one stacking order
   (rule R-29), which the page links before these files. The order the module keeps, bottom to top:
     a local lift inside one component (a sticky grid header, a mark over its track, the stage's own pieces): --layer-behind, --layer-base, --layer-step-1 to --layer-step-6,
       each the number it was;
     the label over the stage's drawing: --layer-canvas-overlay (the stage already uses all six steps, and the label is an overlay on the drawing surface);
     a screen's own sticky bar (the customer page's top bar, the phone's Bottom Bar): --layer-docked-sub;
     a bar docked over another bar (the band, the present bar over the top bar, the customer frame's bar): --layer-docked-sub-top;
     the module bar, over the band: --layer-docked;
     the phone's sheet over the customer page and its bars: --layer-panel-sheet;
     a menu from the bar or the tracker: --layer-menu;      a popover on a figure, and the flyout of a Your Selection row: --layer-popover;
     a dialog and Preview As Client, each over the whole page: --layer-dialog (the one opened later is on top, so a dialog opened inside the preview shows over it);
     the tooltip: --layer-teaching-tip;      the toast lane: --layer-toast.
   So a dialog stays above the page, a toast above a dialog, and the bar above the content, as before. What the loose numbers did that the one order does not: the module bar
   (800) and the band (790) painted over the shell's account menu, its open left menu, its dialogs and the sign-in gate; they are docked bars now, so those sit over them.
   tests/p4412-quote-layers.test.cjs holds every line of this by name. */

/* A SURFACE THAT TAKES OVER THE PAGE KEEPS A PAINT LAYER OF ITS OWN (card P4412). A dialog is centered in the window, so its box often starts on a part of a pixel (332.75 px down
   for Add A Price Sheet at 1080 high). With the loose numbers the dialog (900) and the preview (940) sat over the shell's tooltip (830), which made the browser paint each on a layer
   of its own, set on whole pixels: the Close X was crisp. On its layer of the one order a dialog is under the tooltip and would be painted with the page, on the part pixel, and the
   X came out soft (75 pixels of the Share dialog's picture). will-change keeps the layer of its own, so a dialog and the preview are drawn pixel for pixel as they were. */
.q-scrim, .qd-pac{ will-change:transform; }

/* ---- the host: the page's <main>, under the shell's top bar and beside its rail. The module fills it and never scrolls the page: a screen scrolls inside itself. ---- */
main.ds-main.qm-host{ display:flex; flex-direction:column; height:calc(100vh - var(--ds-topbar-h, 56px)); min-height:0; padding:0; margin:0; overflow:hidden; background:var(--bg); color:var(--text); }
.qm-root{ flex:1; min-height:0; display:flex; flex-direction:column; min-width:0; }
.qm-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* ---- the module bar: 44 px, the module's own, inside the page. Quotes (to Home), the job's name, number and state chip, one View menu. ---- */
.qm-modbar{ flex:none; height:44px; display:flex; align-items:center; gap:16px; padding:0 16px; background:var(--surface); border-bottom:1px solid var(--border); position:relative; z-index:var(--layer-docked); }
.qm-modbar-left, .qm-modbar-right, .qm-top-job{ display:flex; align-items:center; min-width:0; } .qm-modbar-left{ gap:8px; flex:none; } .qm-modbar-right{ gap:8px; flex:none; margin-left:auto; } .qm-top-job{ gap:10px; flex:1 1 auto; justify-content:center; }
.qm-top-link, .qm-top-btn{ display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 12px; border-radius:var(--radius-sm); border:1px solid transparent; background:transparent; color:var(--text); font:600 13px/18px var(--font); text-decoration:none; cursor:pointer; white-space:nowrap; }
.qm-top-link:hover, .qm-top-btn:hover, .qm-top-btn[aria-expanded="true"]{ background:var(--surface-hi); border-color:var(--border); } .qm-top-link[aria-current="page"]{ background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent-deep); }
.qm-top-btn{ border-color:var(--border); }
.qm-top-jobname{ font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .qm-top-jobno{ color:var(--text-muted); font-family:var(--font-num); font-size:13px; white-space:nowrap; }
.qm-top-link:focus-visible, .qm-top-btn:focus-visible, .qm-tab:focus-visible, .qm-ctop-shop:focus-visible, .qm-band .q-btn:focus-visible{ outline:var(--focus-ring-width, 2px) solid var(--focus-ring-color, var(--accent)); outline-offset:2px; }
.qm-density{ gap:8px; }
.qm-dialog-words{ margin:0; font-size:15px; line-height:22px; }
.qm-keys td:first-child{ white-space:nowrap; width:1%; } .qm-keys-to{ margin:0 6px; }

/* ---- the band: one fixed strip under the module bar on every route, shop side and customer side. This is how the Sample says it is a sample. ---- */
.qm-band{ flex:none; min-height:40px; display:flex; align-items:center; gap:12px; padding:6px 16px; background:var(--surface-hi); border-bottom:1px solid var(--border-strong); font-size:13px; line-height:18px; position:relative; z-index:var(--layer-docked-sub-top); }
.qm-band[hidden]{ display:none; }
.qm-band-words{ flex:1 1 auto; min-width:0; display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; }
.qm-band-line{ margin:0; font-weight:600; } .qm-band-sub{ margin:0; color:var(--text-muted); }
.qm-band-acts{ flex:none; display:flex; align-items:center; gap:8px; }
.qm-band-acts .q-seg button{ height:26px; padding:0 10px; font-size:12px; line-height:16px; } .qm-band-acts .q-seg .qm-off{ opacity:.5; cursor:not-allowed; }
.qm-band-acts .q-btn{ height:28px; font-size:12px; }
.qm-band-label{ font-weight:600; color:var(--text-muted); font-size:12px; white-space:nowrap; }

/* ---- the page under the bar and the band. A shop screen never scrolls the page: it scrolls inside itself. ---- */
.qm-main{ flex:1; min-height:0; overflow:hidden; position:relative; }
.qm-page{ height:100%; overflow:auto; }
/* the Desk is drawn 1920 wide (desk.css: min-width 1920px) and the room beside the shell's rail is less, so it is fitted to the room that is left, the way the mockup fitted it beside The Walk:
   the scale is the room over 1920, the width is the room divided by the scale, and nothing of it is cut off or scrolls sideways (shell.js fitDesk) */
.qm-main[data-route^="desk:"]{ zoom:var(--qm-fit, 1); width:var(--qm-fit-w, auto); height:var(--qm-fit-h, auto); max-width:none; flex:none; }

/* ---- boot: the styled skeleton while the session and the source resolve, the signed-out sentence, and the one plain card of a part that is not turned on yet ---- */
.qm-skel{ flex:1; display:flex; flex-direction:column; gap:16px; padding:24px; }
.qm-skel-bar{ height:44px; border-radius:var(--radius-sm); background:var(--surface-hi); border:1px solid var(--border); }
.qm-skel-band{ height:40px; border-radius:var(--radius-sm); background:var(--surface-hi); }
.qm-skel-block{ flex:1; min-height:240px; border-radius:var(--radius-lg); background:var(--surface); border:1px solid var(--border); }
.qm-skel-line{ height:14px; width:40%; border-radius:var(--radius-pill); background:var(--surface-hi); }
.qm-signed-out{ margin:0; padding:48px 24px; font-size:var(--type-lede-size, 17px); line-height:var(--type-lede-lh, 1.45); }
.qm-signed-out a{ color:var(--accent-deep); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.qm-landing{ flex:1; min-height:0; overflow:auto; padding:32px 24px; display:flex; flex-direction:column; gap:20px; }
.qm-landing-head{ margin:0; font-size:28px; line-height:34px; font-weight:700; letter-spacing:-.02em; }
.qm-cards{ display:grid; grid-template-columns:repeat(auto-fit, minmax(360px, 520px)); gap:16px; }
.qm-card{ display:flex; flex-direction:column; gap:12px; padding:24px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); }
.qm-card h2{ margin:0; font-size:20px; line-height:26px; font-weight:700; } .qm-card p{ margin:0; color:var(--text-muted); font-size:14px; line-height:20px; }
.qm-card .q-row{ margin-top:auto; }
.qm-off-card{ flex:1; display:flex; align-items:center; justify-content:center; padding:48px 24px; }
.qm-off-card .q-notyet{ max-width:560px; }

/* ---- the first screen (spec 5.1), until the project screen lands ---- */
.qm-proj{ height:100%; display:grid; grid-template-columns:minmax(0, 1fr) 440px; gap:24px; padding:24px; }
.qm-proj-main{ display:flex; flex-direction:column; gap:12px; min-width:0; min-height:0; } .qm-proj-bar{ flex:none; min-height:36px; }
.qm-stage{ flex:1; min-height:0; display:flex; align-items:center; justify-content:center; padding:24px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.qm-stage-pic{ border-radius:var(--radius-md); overflow:hidden; max-width:100%; } .qm-stage-draw{ line-height:0; }
.qm-proj-side{ display:flex; flex-direction:column; gap:16px; padding:32px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); min-height:0; overflow:auto; }
.qm-proj-eyebrow{ display:flex; align-items:center; gap:12px; }
.qm-proj-title{ margin:8px 0 0; font-size:44px; line-height:46px; font-weight:700; letter-spacing:-.025em; }
.qm-proj-count{ margin:0; font-size:var(--type-lede-size); line-height:var(--type-lede-lh, 1.45); color:var(--text-muted); font-weight:500; }
.qm-proj-facts{ margin:0; display:grid; grid-template-columns:72px 1fr; gap:8px 12px; padding:16px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.qm-proj-facts dt{ color:var(--text-muted); font-size:13px; font-weight:600; } .qm-proj-facts dd{ margin:0; font-weight:500; }
.qm-proj-state{ min-height:24px; gap:10px; }
.qm-proj-quote.q-btn{ width:100%; height:56px; font-size:18px; margin-top:auto; }
.qm-proj-hint{ margin:0; color:var(--text-muted); font-size:13px; line-height:18px; text-align:center; }
.qm-proj-all.q-link{ align-self:center; color:var(--text-muted); font-weight:500; }

/* ---- the Desk stand-in (contract section 6): title 48, the job's arithmetic 80, tabs 44, then the worksheet 1436 wide beside a 420 panel ---- */
.qm-desk{ height:100%; display:flex; flex-direction:column; padding:0 24px 16px; }
.qm-desk-title{ flex:none; height:48px; display:flex; align-items:center; justify-content:space-between; gap:16px; } .qm-desk-title .q-row{ gap:12px; }
.qm-desk-money{ flex:none; height:80px; display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:8px; }
.qm-money-tile.q-tile{ display:flex; flex-direction:column; justify-content:center; gap:6px; padding:12px 16px; } .qm-money-tile .q-tile-value{ text-align:left; font-size:22px; line-height:28px; }
.qm-money-price.q-tile{ border-color:var(--accent-deep); box-shadow:inset 0 -3px 0 var(--accent-deep); }
.qm-desk-tabs{ flex:none; height:44px; display:flex; align-items:flex-end; gap:4px; border-bottom:1px solid var(--border); }
.qm-tab{ display:inline-flex; align-items:center; gap:8px; height:36px; padding:0 14px; margin-bottom:-1px; border-bottom:2px solid transparent; border-radius:var(--radius-xs) var(--radius-xs) 0 0; color:var(--text-muted); font-weight:600; font-size:14px; text-decoration:none; white-space:nowrap; position:relative; }
.qm-tab:hover{ color:var(--text); background:var(--surface-hi); } .qm-tab[aria-selected="true"]{ color:var(--text); border-bottom-color:var(--accent-deep); }
.qm-tab-badge{ display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:var(--radius-pill); background:var(--surface-hi); border:1px solid var(--border); font-size:11px; color:var(--text); }
.qm-tab-check{ background:var(--ok-soft); border-color:var(--ok); color:var(--ok-ink); padding:0; }
.qm-desk-body{ flex:1; min-height:0; margin-top:24px; display:flex; gap:16px; }
.qm-ws{ flex:1 1 1436px; min-width:0; overflow:auto; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); }
.qm-rail{ flex:none; width:420px; display:flex; flex-direction:column; gap:12px; padding:16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); overflow:auto; }
.qm-mini{ width:388px; height:176px; flex:none; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; line-height:0; }
.qm-summary td{ height:36px; }

/* ---- the customer side: the shop's paper. Desktop is the page as it is; Tablet is an 1180 by 820 frame and Phone a 390 by 844 frame, each centered at full size. ---- */
.qm-cmain{ flex:1; min-height:0; overflow:auto; background:var(--surface-hi); }
.qm-frame{ min-height:100%; display:flex; flex-direction:column; }
.qm-frame[data-screen="tablet"], .qm-frame[data-screen="phone"]{ min-height:0; margin:24px auto; overflow:auto; border:1px solid var(--border-strong); box-shadow:var(--elev-3); }
.qm-frame[data-screen="tablet"]{ width:1180px; height:820px; border-radius:24px; } .qm-frame[data-screen="phone"]{ width:390px; height:844px; border-radius:36px; }
.qm-chost{ flex:1; min-height:0; display:flex; flex-direction:column; } .qm-chost > .qc{ flex:1; }
.qm-ctop{ flex:none; position:sticky; top:0; z-index:var(--layer-docked-sub-top); min-height:64px; display:flex; align-items:center; gap:16px; padding:0 24px; background:var(--surface); border-bottom:1px solid var(--border); }
.qm-ctop[hidden]{ display:none; }
.qm-ctop-shop{ display:inline-flex; align-items:center; gap:12px; color:var(--text); text-decoration:none; border-radius:var(--radius-sm); } .qm-ctop-name{ font-weight:700; font-size:17px; letter-spacing:-.01em; }
.qm-ctop-meta{ color:var(--text-muted); font-size:14px; padding-left:16px; border-left:1px solid var(--border); } .qm-ctop-acts{ display:flex; align-items:center; gap:8px; }
.qm-frame[data-width="tablet"] .qm-ctop-acts .q-btn{ height:44px; }
.qm-frame[data-width="phone"] .qm-ctop{ flex-wrap:wrap; padding:10px 16px; gap:8px 12px; } .qm-frame[data-width="phone"] .qm-ctop-meta{ border-left:0; padding-left:0; flex-basis:100%; order:3; }
.qm-frame[data-width="phone"] .qm-ctop-acts{ order:4; flex-basis:100%; flex-wrap:wrap; } .qm-frame[data-width="phone"] .qm-ctop-acts .q-btn{ height:44px; flex:1 1 auto; }
.qm-cnone{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:96px 24px; text-align:center; min-height:420px; }
.qm-cnone-words{ margin:0; max-width:560px; font-size:var(--type-lede-size); line-height:var(--type-lede-lh, 1.45); font-weight:500; }

/* ---- print: when the PDF route prints, only the sheets print. The shell's top bar and rail, the module bar and the band do not. ---- */
@media print{
  .ds-topbar, .ds-rail, .ds-rail-edge, .ds-skip, .qm-modbar, .qm-band, .qt-strip, .q-toasts{ display:none !important; }
  body.ds-body{ padding:0 !important; }
  main.ds-main.qm-host, .qm-root, .qm-main, .qm-cmain, .qm-page{ height:auto !important; overflow:visible !important; }
}
@media (prefers-reduced-motion: reduce){ .qm-root *{ animation:none !important; transition:none !important; } }
