/* SyntaxFlow — documents, budgets and projects: the shared pieces.
   ===========================================================================
   Loaded on top of base.css by the pages of the Documents area and My
   projects only. Built from base.css tokens, so light and dark come free.

   DESIGN PLAN — "live paper"
     Layout   the desk on one side (what you type, photograph and measure), the
              paper on the other: the real A4 or Letter page, updating as you
              type, at the size it will print. On a phone the two are tabs.
     Colour   the sixth world, Documents: drafting-ink indigo with the red of a
              marking pencil. On the paper itself, black ink on white, always:
              it is a document, not a screen, and it prints the same.
     Type     Archivo, the site's face, set wider for the documents' headings;
              measurements and references in the monospace, with tabular figures.
     Motion   only as an answer: a photo lands on the paper, a line moves where
              it was dragged, a saved state ticks. Nothing loops.
   =========================================================================== */
:root{
  --docs:#1f2547; --docs-ink:#eef0fa; --docs-ink2:#c5c9e6; --pencil:#ff8a6b;
  --pencil-ink:#b5381f;                    /* the pencil as text on white: 5.5 : 1 */
  --desk:#e6e9ee; --sheet:#ffffff; --sheet-ink:#1b1f24; --sheet-ink2:#4a525c; --sheet-rule:#d9dde3;
}
@media (prefers-color-scheme: dark){
  :root{ --desk:#0c1013; --pencil-ink:#ff9b80; }
}

/* buttons the tools add to base.css's .btn */
.btn.primary{ background:var(--glass); border-color:var(--glass); color:#fff; font-weight:640; }
.btn.primary:hover{ background:var(--glass-deep); border-color:var(--glass-deep); color:#fff; }
@media (prefers-color-scheme: dark){ .btn.primary{ color:#06231e; } .btn.primary:hover{ color:#06231e; } }
.btn.danger{ border-color:color-mix(in srgb,var(--fail) 55%,var(--rule)); color:var(--fail); }
.btn.danger:hover{ background:color-mix(in srgb,var(--fail) 10%,var(--surface)); border-color:var(--fail); color:var(--fail); }
.btn.small{ min-height:44px; padding:6px 12px; font-size:.9rem; }
.btn[disabled]{ opacity:.55; cursor:not-allowed; }

/* ---------- toasts ---------- */
.sf-toasts{ position:fixed; left:50%; bottom:calc(16px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:200;
  display:grid; gap:8px; width:min(560px, calc(calc(100vw / var(--zc,1)) - 32px)); pointer-events:none; }
.sf-toast{ pointer-events:auto; padding:12px 16px; border-radius:10px; background:var(--ink); color:var(--surface); font-size:.95rem;
  box-shadow:0 14px 34px -16px rgba(0,0,0,.55); transition:opacity .3s, transform .3s; }
.sf-toast.error{ background:var(--fail); color:#fff; }
.sf-toast.ok{ background:var(--pass); color:#fff; }
@media (prefers-color-scheme: dark){ .sf-toast.error,.sf-toast.ok{ color:#0b1115; } }
.sf-toast.out{ opacity:0; transform:translateY(8px); }

/* ---------- dialog ---------- */
.sf-dialog{ border:1px solid var(--rule-2); border-radius:14px; padding:22px 24px 20px; width:min(520px, calc(calc(100vw / var(--zc,1)) - 32px));
  background:var(--surface); color:var(--ink); box-shadow:0 30px 80px -30px rgba(0,0,0,.6); }
.sf-dialog::backdrop{ background:rgba(10,16,20,.55); }
.sf-dialog h2{ font-size:1.25rem; margin:0 0 12px; font-stretch:112%; }
.sf-dialog p{ color:var(--ink-2); margin:0 0 12px; }
.sf-dialog .sf-pro-line{ color:var(--ink); font-weight:560; }
.sf-dialog-acts{ display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; margin-top:16px; }

/* ---------- save state ---------- */
.sf-save{ display:inline-flex; align-items:center; gap:8px; font-size:.86rem; color:var(--ink-3); }
.sf-save::before{ content:""; width:8px; height:8px; border-radius:50%; background:var(--rule-2); flex:0 0 8px; }
.sf-save.saving::before{ background:var(--warn); }
.sf-save.saved::before{ background:var(--pass); }
.sf-save.failed{ color:var(--fail); font-weight:600; }
.sf-save.failed::before{ background:var(--fail); }

/* ---------- free-limit meter ---------- */
.sf-meter{ display:grid; gap:5px; min-width:150px; font-size:.86rem; color:var(--ink-2); }
.sf-meter-bar{ display:block; height:5px; border-radius:3px; background:var(--paper-2); overflow:hidden; }
.sf-meter-bar i{ display:block; height:100%; width:0; background:var(--glass); transition:width .25s; }
.sf-meter.near .sf-meter-bar i{ background:var(--warn); }
.sf-meter.full .sf-meter-bar i{ background:var(--fail); }
.sf-meter.full .sf-meter-txt{ color:var(--ink); font-weight:600; }
.sf-meter.pro .sf-meter-bar{ display:none; }

/* ---------- storage box ---------- */
.sf-storage{ display:grid; gap:8px; padding:14px 16px; border:2.5px solid var(--ink); border-radius:10px; background:var(--surface); font-size:.9rem; }
.sf-storage p{ margin:0; }
.sf-storage-why{ color:var(--ink-2); max-width:78ch; }
.sf-storage-line{ color:var(--ink-3); font-variant-numeric:tabular-nums; }
.sf-storage-line:empty::before{ content:"\00a0"; }   /* r3180: its line before the browser says how much it keeps */
.sf-storage .btn{ justify-self:start; }
.sf-storage.bad{ border-color:var(--fail); background:color-mix(in srgb,var(--fail) 6%,var(--surface)); }
.sf-storage.bad .sf-storage-line{ color:var(--fail); font-weight:600; }

/* ---------- project picker ---------- */
.sf-picker{ display:grid; gap:4px; min-width:0; }
.sf-picker label{ font-size:.86rem; font-weight:560; color:var(--ink-2); }
.sf-picker select{ min-height:42px; max-width:100%; }

/* ---------- example ribbon ---------- */
.sf-example{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; padding:10px 14px; border-radius:12px;
  border:2.5px solid var(--ink); box-shadow:4px 4px 0 var(--ink); background:color-mix(in srgb,var(--pencil) 7%,var(--surface)); color:var(--ink); font-size:.92rem; }

/* ---------- the tool bar at the top of every document tool ---------- */
.sf-bar{ display:flex; flex-wrap:wrap; align-items:end; gap:12px 18px; padding:14px 0 16px; border-bottom:1px solid var(--rule); margin-bottom:18px; }
.sf-bar .grow{ flex:1 1 auto; }
.sf-bar-acts{ display:flex; flex-wrap:wrap; gap:8px; }
.sf-limits{ font-size:.9rem; color:var(--ink-2); margin:0; max-width:90ch; }
.sf-limits b{ color:var(--ink); font-weight:620; }
/* r3180 (20-11-2026): the place of what the tool writes after the first paint, kept from the first paint. The page
   paints its tool empty and the scripts (deferred) fill it some 60-130 ms later: the project picker came into the bar
   (61 → 95 px), the row of actions under it, and the text under the tool was pushed out of the first screen
   (ui-mesa-page: CLS 0.03-0.42 at 1560 px, with the example line, which the page now brings: tools/doc-boot.cjs).
     · the first slot of the bar is where the picker goes (every tool but the price list, which leaves it empty): the
       picker's own height (label and select; 44 px selects on touch, below);
     · the row of actions of the tools with a desk and a paper, from 1100 px, where it is one row (34 px buttons, 6 px
       padding and 1 px border: .q-acts:not(:empty) below);
     · the work area takes at least the window's height, so what comes after the tool starts below the first screen and
       does not move when the desk is filled (the desks are 1300-8500 px tall once filled).
   The pickers, the save indicator and the example line are in the page itself (tools/doc-boot.cjs); the first rule is
   for a page that does not have them. On screen only: the print has its own layout. */
@media screen{
  .sf-app:not(#sf-pricelist) > .sf-bar > .sf-bar-acts:first-child:empty{ min-height:74px; }
  /* the list preparer has no desk: its import box (402-424 px once built, at 390-1920 px) */
  #sf-listprep > #lp-import:empty{ min-height:400px; }
}
@media screen and (min-width:1100px){
  /* (below 1100 px the desk and the paper are tabs: the paper alone can be shorter than the window) */
  .sf-app > .sf-work{ min-height:100vh; }
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts:empty{ min-height:48px; }
  body.app[data-area="docs"] #sf-pack.sf-app:not([data-px]) > #pk-acts:empty{ min-height:54px; }   /* its first button is a full-size one */
}

/* ---------- desk and paper ---------- */
.sf-work{ display:grid; gap:24px; align-items:start; }
@media (min-width:1100px){ .sf-work{ grid-template-columns:minmax(0,1fr) minmax(0,1.04fr); } }
.sf-desk{ display:grid; gap:18px; min-width:0; }
.sf-paperwrap{ position:relative; min-width:0; background:var(--desk); border-radius:14px; padding:clamp(12px,calc(2vw / var(--zc,1)),24px); }
@media (min-width:1100px){ .sf-paperwrap{ position:sticky; top:calc(var(--hd,61px) + 12px); max-height:calc(100svh - var(--hd,61px) - 24px); overflow:auto; scrollbar-gutter:stable; } }   /* r3130: the room of its scrollbar is always kept: the sheet, scaled to the width it is given, came out 13 px too wide whenever a long sheet brought the scrollbar (ui-quote, one run in three) */
.sf-tabs{ display:none; }
@media (max-width:1099px){
  .sf-tabs{ display:flex; gap:4px; padding:4px; border-radius:999px; background:var(--paper-2); position:sticky; top:calc(var(--hd,61px) + 6px); z-index:5; }
  .sf-tabs button{ flex:1; min-height:42px; border:0; border-radius:999px; background:transparent; color:var(--ink-2); font:inherit; font-weight:600; }
  .sf-tabs button[aria-selected="true"]{ background:var(--surface); color:var(--ink); box-shadow:var(--e1); }
  .sf-work[data-tab="desk"] .sf-paperwrap{ display:none; }
  .sf-work[data-tab="paper"] .sf-desk{ display:none; }
}

/* ---------- sections of the desk ---------- */
.sf-panel{ background:var(--surface); border:2.5px solid var(--ink); border-radius:12px; box-shadow:4px 4px 0 var(--ink); padding:16px 18px; display:grid; gap:12px; min-width:0; }
.sf-panel > h2,.sf-panel > h3{ margin:0; font-size:1.06rem; font-stretch:110%; display:flex; align-items:center; gap:10px; }
.sf-panel > h2::before,.sf-panel > h3::before{ content:""; width:4px; height:1.05em; border-radius:2px; background:var(--pencil); flex:0 0 4px; }
.sf-row{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
.sf-drop{ display:grid; place-items:center; gap:6px; text-align:center; padding:22px 16px; border:2px dashed var(--rule-2); border-radius:12px; color:var(--ink-2); background:var(--surface-2); cursor:pointer; }
.sf-drop:hover,.sf-drop.over{ border-color:var(--pencil-ink); color:var(--ink); background:color-mix(in srgb,var(--pencil) 6%,var(--surface)); }
.sf-drop:focus-within{ outline:3px solid var(--glass); outline-offset:2px; }
.sf-drop input[type=file]{ position:absolute; width:1px; height:1px; opacity:0; }
.sf-empty{ padding:22px 18px; border:2px dashed var(--ink); border-radius:12px; color:var(--ink-2); background:var(--surface); }
.sf-empty b{ color:var(--ink); }

/* ---------- the paper (screen) ---------- */
.sf-sheet{ background:var(--sheet); color:var(--sheet-ink); box-shadow:0 0 0 2px var(--ink),5px 5px 0 2px var(--ink); margin:0 auto 18px; transform-origin:top left; }
.sf-sheet:last-child{ margin-bottom:0; }

/* ---------- My projects ---------- */
.sf-projects{ display:grid; gap:10px; }
.sf-proj{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 18px; align-items:center; padding:14px 16px; background:var(--surface); border:1px solid var(--rule); border-radius:12px; }
.sf-proj:hover{ border-color:var(--rule-2); }
.sf-proj h3{ margin:0; font-size:1.08rem; font-stretch:108%; }
.sf-proj h3 a{ color:var(--ink); text-decoration:none; }
.sf-proj h3 a:hover{ text-decoration:underline; }
.sf-proj .meta{ font-size:.86rem; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.sf-proj .counts{ display:flex; flex-wrap:wrap; gap:6px 14px; font-size:.86rem; color:var(--ink-2); }
.sf-proj .acts{ display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; grid-row:1 / span 3; grid-column:2; }
.sf-proj.archived{ opacity:.72; }
@media (max-width:640px){ .sf-proj{ grid-template-columns:1fr; } .sf-proj .acts{ grid-row:auto; grid-column:1; justify-content:flex-start; } }
/* two versions of a project compared (projects-ui.js, projectdiff.js) */
.pc-work{ margin:4px 0 18px; }
.pc-desk h2{ margin:0; font-size:1.3rem; }
.pc-desk h2:focus{ outline:none; }                 /* focused by the page, to be read out; not a control */
.pc-sides{ display:grid; grid-template-columns:auto minmax(0,1fr); gap:4px 12px; margin:0; font-size:.92rem; }
.pc-sides dt{ color:var(--ink-3); }
.pc-sides dd{ margin:0; overflow-wrap:anywhere; }
.pc-counts,.pc-totals{ margin:0; padding-left:18px; display:grid; gap:4px; }
.pc-totals{ font-variant-numeric:tabular-nums; font-weight:600; }
.pc-pro p{ margin:0 0 8px; }
.pc-acts{ display:flex; flex-wrap:wrap; gap:8px; }
.sf-sheet.sf-doc h3.pd-h{ font-size:10.5pt; margin:6mm 0 2mm; break-after:avoid; }
.sf-sheet.sf-doc .pd-sides{ width:auto; margin:0 0 4mm; }
.sf-sheet.sf-doc .pd-sides th{ text-transform:none; letter-spacing:0; font-size:8.6pt; border-bottom:.2mm solid #d9dde3; padding-right:5mm; }
.sf-doc .pd-sum{ margin:0 0 2mm; font-weight:620; }
.sf-doc .pd-sub td{ padding:0 0 3mm 5mm; font-size:8.6pt; }
.sf-doc .pd-sub p{ margin:1mm 0 0; }
.sf-doc .pd-list{ margin:1mm 0 1mm; padding-left:5mm; }
.sf-doc .pd-list li{ margin:.4mm 0; }
.sf-sheet.sf-doc .pd-els{ width:100%; margin:1mm 0; font-size:8.4pt; }
.sf-sheet.sf-doc .pd-totals{ width:100%; margin:0 0 4mm; }
.sf-doc .pd-totals caption{ text-align:left; font-weight:700; padding:1mm 0; caption-side:top; }
.sf-doc .pd-sumrow th,.sf-doc .pd-sumrow td{ border-top:.35mm solid #1b1f24; border-bottom:0; font-weight:700; padding-top:1.6mm; text-align:left; text-transform:none; letter-spacing:0; font-size:9pt; color:#1b1f24; }
.sf-doc .pd-sumrow td{ text-align:right; }
.sf-doc .pd-note{ margin-top:3mm; font-size:8.3pt; color:#4a525c; }

@media print{
  .sf-bar,.sf-tabs,.sf-desk,.sf-toasts,.sf-storage,.sf-example,.site-head,.site-foot,.langbar{ display:none !important; }
  .sf-paperwrap{ background:none; padding:0; position:static; max-height:none; overflow:visible; }
  .sf-sheet{ box-shadow:none; margin:0; transform:none !important; }
}

/* My projects */
.linklike{ background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; text-align:left; }
.linklike:hover{ text-decoration:underline; }
.linklike:focus-visible{ outline:2px solid var(--glass); outline-offset:3px; border-radius:3px; }
.sf-open{ margin:-4px 0 6px; border-top-left-radius:0; border-top-right-radius:0; }
.sf-detail{ display:grid; gap:4px; }
.sf-detail-bar{ display:flex; justify-content:flex-end; }
.sf-contents h4{ margin:10px 0 4px; font-size:.95rem; }
.sf-contents ul{ margin:0; padding-left:18px; color:var(--ink-2); font-size:.92rem; }
#sf-projects.over{ outline:2px dashed var(--pencil-ink); outline-offset:8px; border-radius:12px; }
.sf-app{ display:grid; gap:14px; }
@media screen and (max-width:359px){
  .sf-app{ grid-template-columns:minmax(0,1fr); }
  .sf-app .s-views{ max-width:100%; flex-wrap:wrap; }
  .sf-app .sf-picker{ max-width:100%; }
}

/* on a page that IS a tool, the coloured band is a title, not a poster:
   the work has to be on the first screen */
body.app main > .hero:first-of-type{ padding-top:22px !important; padding-bottom:20px !important; }
body.app main > .hero:first-of-type > h1{ font-size:clamp(1.7rem,1.2rem + calc(1.8vw / var(--zc,1)),2.5rem); margin-bottom:.35em; }
body.app main > .hero:first-of-type > .answer{ padding:12px 16px; margin-bottom:0; }
body.app main > .hero:first-of-type > .answer p{ font-size:.98rem; }
body.app .sf-bar{ padding-top:4px; }
body.app .sf-storage{ padding:10px 14px; }
body.app .sf-storage-why{ font-size:.86rem; }
body.app main > section.sf-app{ padding-top:18px; }

/* your company on the documents */
.sf-company > summary{ cursor:pointer; font-weight:640; font-stretch:108%; list-style-position:inside; }
.sf-company > summary:focus-visible{ outline:2px solid var(--glass); outline-offset:3px; border-radius:4px; }
.sf-company[open] > summary{ margin-bottom:6px; }
.sf-logo{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.sf-logo img{ max-height:64px; max-width:200px; object-fit:contain; background:#fff; border:1px solid var(--rule); border-radius:8px; padding:6px; }

/* ---------- the live paper: holder, sheet, page guides ---------- */
/* the sheet keeps its real size in mm and is scaled down; the holder takes the
   scaled size, so nothing overflows the column */
.sf-sheet-holder{ position:relative; margin:0 auto; }
.sf-sheet-holder > .sf-sheet{ position:absolute; top:0; left:0; margin:0; box-sizing:border-box; }
.sf-guides{ position:absolute; inset:0; pointer-events:none; }
.sf-guides i{ position:absolute; left:0; right:0; border-top:1px dashed #8a94a0; }
.sf-guides span{ position:absolute; right:6px; top:3px; font:600 10px/1.2 var(--mono,monospace); color:#5b6470; background:#fff; padding:1px 5px; border-radius:3px; }

/* ---------- a document on paper: black ink on white, always ---------- */
.sf-doc{ font:9.5pt/1.42 Archivo,Arial,sans-serif; color:#1b1f24; overflow:hidden; }
.sf-doc h1,.sf-doc h2,.sf-doc h3{ color:#0b0f0e; font-stretch:110%; }
.sf-doc p{ margin:0; }
.d-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:8mm; padding-bottom:4.5mm; margin-bottom:5mm; border-bottom:.6mm solid #0b0f0e; }
.d-co{ display:flex; gap:4mm; align-items:flex-start; min-width:0; }
.d-co strong{ font-size:11.5pt; font-stretch:108%; }
.d-co p{ margin-top:1mm; color:#4a525c; font-size:8.5pt; }
.d-logo{ max-height:18mm; max-width:42mm; object-fit:contain; }
.d-meta{ text-align:right; flex:0 0 auto; }
.d-meta h1,.d-meta .d-h1{ font-size:20pt; line-height:1; margin:0 0 3mm; letter-spacing:-.01em; }
/* r3892 (02-12-2026): the document's name in the mould's face, condensed Archivo in ink (it was Archivo at 110 % in navy) */
.sf-doc .d-meta h1,.sf-doc .d-meta .d-h1{ font-size:24pt; font-stretch:72%; font-weight:820; letter-spacing:0; color:#0b0f0e; }
.sf-doc .d-title{ font-stretch:85%; font-weight:780; color:#0b0f0e; }
.d-meta dl{ display:grid; grid-template-columns:auto auto; gap:.6mm 4mm; margin:0; justify-content:end; font-size:9pt; }
.d-meta dt{ color:#4a525c; }
.d-meta dd{ margin:0; font-weight:620; font-variant-numeric:tabular-nums; }
.d-draft{ color:#b5381f; text-transform:uppercase; letter-spacing:.1em; font-size:8pt; }
.d-client{ margin:0 0 5mm; }
.d-client h2{ font-size:7.5pt; text-transform:uppercase; letter-spacing:.12em; color:#4a525c; margin:0 0 1mm; }
.d-title{ font-size:12.5pt; margin:0 0 4mm; }
.sf-sheet.sf-doc table{ display:table; width:auto; margin:0; overflow:visible; font-size:inherit; }
.sf-sheet.sf-doc th,.sf-sheet.sf-doc td{ background:none; white-space:normal; color:inherit; }
.sf-sheet.sf-doc tbody tr:hover td{ background:none; }
.sf-sheet.sf-doc .d-lines{ width:100%; font-size:9pt; }
.sf-sheet.sf-doc .d-lines td.i,.sf-sheet.sf-doc .d-lines th.i{ background:#fbf1ee; }
.d-ph{ flex:1; padding:3mm 4mm; border:.3mm dashed #9aa3ad; border-radius:2mm; color:#5b6470; font-size:8.5pt; max-width:95mm; }
.d-lines thead{ display:table-header-group; }
.d-lines th{ text-align:left; font-size:7.3pt; font-weight:650; text-transform:uppercase; letter-spacing:.07em; color:#4a525c; padding:1.6mm 2mm; border-bottom:.35mm solid #1b1f24; }
.d-lines td{ padding:2mm; border-bottom:.2mm solid #d9dde3; vertical-align:top; }
.d-lines tr{ break-inside:avoid; }
.d-lines .n{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.d-lines th:first-child,.d-lines td:first-child{ padding-left:0; }
.d-lines th:last-child,.d-lines td:last-child{ padding-right:0; }
.d-ch td{ padding-top:4.5mm; font-weight:760; font-stretch:90%; color:#0b0f0e; border-bottom:.35mm solid #0b0f0e; }
.d-out td{ color:#69727d; }
.d-tag{ display:block; margin-top:.8mm; font-size:7.6pt; font-style:italic; color:#4a525c; }
.d-tag.warn{ font-style:normal; font-weight:650; color:#b5381f; }
.d-empty{ padding:8mm 2mm !important; text-align:center; font-style:italic; color:#69727d; }
.d-totals{ margin:4mm 0 0 auto; border-collapse:collapse; min-width:78mm; font-size:9.5pt; break-inside:avoid; }
.d-totals th{ text-align:left; font-weight:500; color:#4a525c; padding:1.1mm 6mm 1.1mm 0; }
.d-totals td{ padding:1.1mm 0; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.d-total th,.d-total td{ padding-top:2.5mm; border-top:.5mm solid #1b1f24; font-size:12.5pt; font-weight:760; color:#1b1f24; }
.d-note th{ font-style:italic; font-size:8.3pt; }
.d-texts{ display:grid; grid-template-columns:1fr 1fr; gap:4mm 8mm; margin-top:5mm; font-size:8.8pt; }
.d-texts h3{ font-size:7.3pt; text-transform:uppercase; letter-spacing:.1em; margin:0 0 1mm; }
.d-internal{ margin-top:6mm; padding:3mm 4mm; border:.4mm dashed #b5381f; font-size:8.8pt; break-inside:avoid; }
.d-internal h3{ color:#b5381f; font-size:8pt; text-transform:uppercase; letter-spacing:.08em; margin:0 0 1.5mm; }
.d-internal p + p{ margin-top:1.5mm; }
.d-foot{ display:flex; justify-content:space-between; align-items:flex-end; gap:6mm; margin-top:3mm; padding-top:2mm; border-top:.2mm solid #d9dde3; font-size:7.8pt; color:#4a525c; }
.d-brand{ color:#69727d; white-space:nowrap; }
.d-watermark{ position:absolute; top:38%; left:50%; transform:translate(-50%,-50%) rotate(-24deg); font:800 30pt/1 Archivo,Arial,sans-serif; letter-spacing:.06em; white-space:nowrap; color:rgba(181,56,31,.14); pointer-events:none; z-index:1; }

/* ---------- the budget's desk ---------- */
.q-acts{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.q-chapter{ display:grid; gap:4px; padding:12px 14px; border:2px solid var(--ink); border-radius:6px; background:var(--surface-2); min-width:0; }
.q-ch-head{ display:flex; flex-wrap:wrap; align-items:end; gap:4px 12px; }
.q-ch-head .grow{ flex:1 1 220px; }
.q-ch-acts{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.q-line{ position:relative; display:grid; grid-template-columns:repeat(auto-fill,minmax(68px,1fr)); gap:0 8px; align-items:end; padding-top:10px; border-top:1px dashed var(--rule-2); min-width:0; }
.q-line .q-text{ grid-column:1 / -1; }
.q-line .field{ margin-bottom:10px; }
.q-line .field label{ font-size:.84rem; margin-bottom:4px; }
.q-line .field .hint{ margin-top:3px; font-size:.78rem; }
.q-line input,.q-line select{ width:100%; min-width:0; }
.q-line-acts{ position:absolute; top:6px; right:0; display:flex; gap:4px; }
.q-line-acts .btn{ min-height:44px; padding:2px 9px; font-size:.82rem; }
.q-lines-acts,.q-chips{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.q-tax{ align-items:end; }
.q-tax .btn{ margin-bottom:14px; justify-self:start; }
.q-check{ display:flex; gap:10px; align-items:center; font-size:.92rem; cursor:pointer; }
.q-check input{ width:20px; height:20px; accent-color:var(--glass); }
.field.i input,.field.i textarea{ border-style:dashed; border-color:var(--pencil-ink); }
input[aria-invalid="true"],textarea[aria-invalid="true"]{ border-color:var(--fail) !important; box-shadow:0 0 0 3px color-mix(in srgb,var(--fail) 18%,transparent); }
.q-summary{ position:sticky; bottom:0; z-index:4; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 18px; padding:12px 16px; border:2.5px solid var(--ink); border-radius:12px; background:color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter:blur(6px); box-shadow:4px 4px 0 var(--ink); font-variant-numeric:tabular-nums; }
.q-summary .q-total{ margin:0; font-size:1.05rem; }
.q-summary .q-total strong{ font-size:1.3rem; font-weight:760; }
.q-summary span{ font-size:.88rem; color:var(--ink-2); }
.q-summary .warn{ color:var(--pencil-ink); font-weight:600; }
.q-diff ul{ margin:0 0 10px; padding-left:18px; display:grid; gap:4px; }
.q-diff .d-added{ color:var(--pass,#1d7a4f); }
.q-diff .d-removed{ color:var(--fail); }

/* printing a document: only the sheet, at its real size, on the paper @page sets */
@media print{
  body.app main > :not(.sf-app),.sf-work > :not(.sf-paperwrap),.sf-guides,.sf-dialog{ display:none !important; }
  /* Only in a tool that keeps its paper in .sf-work does everything else in
     the app go: a tool with its own work area (the plan takeoff's .pl-work,
     the QR code's .qr-work) or none (my data, the configurator) printed as a
     blank page when this hid every child that was not .sf-work (13-10-2026).
     A rule of its own, so a browser without :has() drops only this one and
     prints the tool's buttons above the sheet, never a blank page. */
  .sf-app:has(> .sf-work) > :not(.sf-work){ display:none !important; }
  /* Print lays the page out at the paper's width (≈794 px for A4), under the
     1100 px where the desk/paper tabs hide one of the two. The page opens on
     the desk tab, so without this the sheet stayed hidden and the PDF came out
     blank (13-10-2026). Whatever the tab, the sheet is what prints. */
  .sf-work[data-tab] > .sf-paperwrap{ display:block !important; }
  body.app main,body.app main > .sf-app{ padding:0 !important; margin:0 !important; max-width:none !important; }
  .sf-sheet-holder{ width:auto !important; height:auto !important; }
  .sf-sheet-holder > .sf-sheet{ position:static; }
  .sf-doc{ overflow:visible; }
  .d-watermark{ position:fixed; top:45%; }
  .d-ph{ visibility:hidden; }
}
.sf-sheet.sf-doc .d-totals{ margin:4mm 0 0 auto; min-width:78mm; }
.q-line textarea{ min-height:0; height:auto; padding-top:8px; padding-bottom:8px; }
.q-line input,.q-line select{ min-height:42px; }
.q-line .field label{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.q-line .q-sel{ grid-column:span 2; }
.q-preview{ max-height:260px; overflow:auto; }
.q-ptable{ display:table; width:100%; margin:6px 0 4px; font-size:.86rem; }
.q-ptable th,.q-ptable td{ padding:5px 8px; white-space:normal; }
.q-ptable .n{ text-align:right; font-variant-numeric:tabular-nums; }
.q-ptable .q-miss{ color:var(--pencil-ink); font-size:.8rem; }
.q-ptable tr.q-over td{ opacity:.55; }

/* results waiting from the calculators */
.q-inbox{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; padding:12px 16px; border-radius:12px; border:1px solid color-mix(in srgb,var(--pencil) 45%,var(--rule)); background:color-mix(in srgb,var(--pencil) 8%,var(--surface)); }
.q-inbox p{ margin:0; }
.q-inbox .q-inbox-free{ flex:1 0 100%; order:3; }   /* r1346: its own line, under the count and the buttons */
.q-inbox-list{ display:grid; gap:12px; max-height:min(calc(62vh / var(--zc,1)),560px); overflow:auto; }
.q-inbox-item{ border:1px solid var(--rule); border-radius:10px; padding:8px 12px 2px; margin:0; min-width:0; }
.q-inbox-item legend{ padding:0 6px; font-weight:640; }
.q-inbox-item .grow2{ grid-column:span 2; }

/* library and revision history (Pro) */
.q-lib-list{ display:grid; gap:2px; max-height:min(calc(50vh / var(--zc,1)),420px); overflow:auto; margin:4px 0 8px; }
.q-lib-row{ display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:10px; align-items:center; padding:6px 4px; border-bottom:1px solid var(--rule); }
.q-lib-row .q-check span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-lib-price{ font-size:.86rem; color:var(--ink-2); font-variant-numeric:tabular-nums; white-space:nowrap; }
.q-ptable tr.q-h-cur td{ font-weight:640; }
.q-chips select{ min-height:38px; }

/* new budget: blank, trade templates, mine */
.q-new{ display:grid; gap:8px; max-height:min(calc(64vh / var(--zc,1)),600px); overflow:auto; }
.q-new h3{ margin:10px 0 0; font-size:.92rem; color:var(--ink-2); }
.q-new-opt{ display:grid; gap:2px; width:100%; text-align:left; padding:10px 14px; border:1px solid var(--rule); border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; cursor:pointer; }
.q-new-opt:hover{ border-color:var(--pencil-ink); }
.q-new-opt:focus-visible{ outline:3px solid var(--glass); outline-offset:2px; }
.q-new-opt span{ font-size:.86rem; color:var(--ink-2); }
.q-new-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; }
.q-fx{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 14px; margin-top:-4px; }
.q-fx .hint{ margin:0; flex:1 1 260px; }

/* phones: the tool, not the title, fills the first screen */
@media (max-width:640px){
  body.app main > .hero:first-of-type{ padding-top:14px !important; padding-bottom:14px !important; }
  body.app main > .hero:first-of-type > h1{ font-size:1.55rem; }
  body.app main > .hero:first-of-type > .answer{ padding:9px 12px; }
  body.app main > .hero:first-of-type > .answer p{ font-size:.86rem; line-height:1.45; }
}

/* the bar's "More" */
/* base.css frames every <details> as a panel; this one is a button in the bar */
.q-more{ position:relative; border:0; border-radius:0; padding:0; margin:0; background:none; }
.q-more[open] > summary{ margin-bottom:0; }
.q-more > summary{ list-style:none; cursor:pointer; }
.q-more > summary::-webkit-details-marker{ display:none; }
.q-more > summary::after{ content:" ▾"; }
.q-more-menu{ position:absolute; z-index:20; top:calc(100% + 6px); right:0; display:grid; gap:4px; min-width:240px; padding:8px; border:2.5px solid var(--ink); border-radius:12px; background:var(--surface); box-shadow:4px 4px 0 var(--ink); }
.q-more-menu .btn{ justify-content:flex-start; text-align:left; width:100%; }
/* r1710 (14-11-2026): closed, it takes no room (it made the budget 66 px wider than a 390 phone); on a phone it opens as a
   sheet at the foot of the screen, inside its width, wherever the button sits in its row */
.q-more:not([open]) > .q-more-menu{ display:none; }
@media (max-width:640px){ .q-more-menu{ position:fixed; top:auto; left:16px; right:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); min-width:0; max-height:70vh; overflow:auto; z-index:70; } }
@media (max-width:640px){
  /* the same promise is in the save line and in the text below the tool */
  body.app main > .hero:first-of-type > .answer{ display:none; }
  body.app .sf-example{ padding:8px 12px; font-size:.86rem; }
  .q-acts .btn{ padding-left:10px; padding-right:10px; }
}

/* ---------- the red pencil (pencil.js) ---------- */
.sf-dialog.wide{ width:min(1100px, calc(calc(100vw / var(--zc,1)) - 16px)); max-height:calc(calc(100svh / var(--zc,1)) - 16px); padding:14px 16px 16px; }
.pn{ display:grid; gap:10px; }
.pn-tools{ display:flex; flex-wrap:wrap; gap:6px; }
.pn-tools [aria-pressed="true"]{ background:var(--docs); border-color:var(--docs); color:#fff; }
.pn-status{ margin:0; font-size:.9rem; color:var(--ink-2); min-height:1.4em; }
.pn-stage{ background:#15181c; border-radius:10px; overflow:hidden; display:grid; place-items:center; }
.pn-stage svg{ display:block; width:100%; height:auto; max-height:calc(58svh / var(--zc,1)); touch-action:none; cursor:crosshair; user-select:none; }
.pn-dim{ display:flex; flex-wrap:wrap; align-items:end; gap:8px 12px; padding:10px 12px; border:1px solid var(--rule); border-radius:10px; background:var(--surface-2); }
.pn-dim label{ flex:1 1 100%; font-size:.9rem; font-weight:600; }
.pn-dim input{ max-width:180px; }
.pn-h{ margin:4px 0 0; font-size:.95rem; }
.pn-list{ margin:0; padding-left:20px; display:grid; gap:4px; }
.pn-list li{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.pn-list li > span{ flex:1 1 auto; }
.pn-list li.sel > span{ font-weight:700; }
.sf-photo{ display:block; width:100%; height:auto; }

/* ---------- the survey sheet's desk ---------- */
.s-refs{ gap:14px; }
.s-el{ display:grid; gap:6px; padding:12px 14px; border:2px solid var(--ink); border-radius:12px; background:var(--surface-2); min-width:0; }
.s-el-h{ display:flex; flex-wrap:wrap; align-items:end; gap:4px 10px; }
.s-el-h .s-code{ flex:0 0 84px; }
.s-el-h .grow{ flex:1 1 180px; }
.s-el-acts{ display:flex; gap:4px; margin-bottom:14px; }
.s-el-acts .btn{ min-height:32px; padding:2px 10px; }
.s-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:0 10px; }
.s-grid .wide{ grid-column:auto; }
.s-el textarea{ min-height:0; height:auto; }
.s-grid select{ text-overflow:ellipsis; }
.s-six{ display:grid; grid-template-columns:auto repeat(3,minmax(0,1fr)); gap:0 10px; align-items:end; }
.s-six .s-lab{ font-size:.86rem; font-weight:650; color:var(--ink-2); padding-bottom:26px; }
.s-six .field{ margin-bottom:8px; }
.s-six .field label{ font-size:.8rem; margin-bottom:3px; }
.s-calc{ display:flex; flex-wrap:wrap; gap:4px 12px; margin:0 0 4px; font-size:.9rem; font-variant-numeric:tabular-nums; }
/* "Where to measure" sketch (24-10-2026): tokens only, so it reads in both themes */
.s-howto{ margin:2px 0 8px; }
.s-howto > summary{ cursor:pointer; font-size:.9rem; font-weight:650; color:var(--ink-2); padding:4px 0; }
.s-howto-b{ display:flex; flex-wrap:wrap; gap:8px 18px; align-items:flex-start; padding:4px 0 2px; }
.s-sketch{ flex:0 1 340px; min-width:0; color:var(--ink); }
.s-sketch svg{ display:block; width:100%; max-width:340px; height:auto; }
.s-sketch .sk-wall{ fill:var(--rule); }
.s-sketch .sk-tray{ fill:var(--rule-2, var(--rule)); }
.s-sketch .sk-top{ stroke:var(--ink-3); stroke-width:1.5; stroke-dasharray:6 5; }
.s-sketch .sk-frame{ fill:var(--surface-2, var(--surface)); stroke:var(--ink-3); stroke-width:1.5; }
.s-sketch .sk-glass{ fill:var(--glass-tint, transparent); stroke:var(--ink-3); stroke-width:1.5; }
.s-sketch .sk-diag{ stroke:var(--ink-3); stroke-width:1.5; stroke-dasharray:4 5; }
.s-sketch .sk-dim{ stroke:var(--accent); stroke-width:2; }
.s-sketch .sk-head{ fill:var(--accent); }
.s-sketch .sk-tag circle{ fill:var(--paper); stroke:var(--accent); stroke-width:1.5; }
.s-sketch .sk-tag text{ fill:var(--ink); font:700 12px/1 var(--font, system-ui, sans-serif); text-anchor:middle; }
.s-howto-l{ flex:1 1 260px; min-width:0; margin:0; padding-left:18px; font-size:.9rem; color:var(--ink-2); display:grid; gap:4px; }
@media print{ .s-howto{ display:none; } }
.s-flag{ font-size:.84rem; padding:1px 8px; border-radius:999px; background:var(--paper-2); color:var(--ink-2); }
.s-flag.warn{ background:color-mix(in srgb,var(--pencil) 16%,var(--surface)); color:var(--pencil-ink); font-weight:600; }
.s-links{ display:flex; gap:12px; font-size:.86rem; }
.s-photos{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px 10px; align-items:start; }
.s-ph{ position:relative; border-radius:8px; overflow:hidden; background:#15181c; }
.s-ph-acts{ position:absolute; left:6px; right:6px; bottom:6px; display:flex; justify-content:space-between; gap:6px; }
.s-ph-acts .btn{ min-height:30px; padding:2px 9px; font-size:.8rem; background:rgba(255,255,255,.92); }
.s-photos > .btn{ align-self:center; justify-self:start; }
.s-cap{ margin-bottom:6px; }
.s-ph-meta{ grid-column:1 / -1; }
.s-sys{ align-items:end; }
.s-sys .btn{ margin-bottom:14px; justify-self:start; }
.s-pend{ display:flex; align-items:center; gap:10px; }
.s-pend .grow{ flex:1 1 auto; }
.s-pend input[type=checkbox]{ width:20px; height:20px; accent-color:var(--glass); }
.s-views{ display:inline-flex; gap:4px; padding:4px; border-radius:999px; background:var(--paper-2); }
.s-views button{ min-height:36px; border:0; border-radius:999px; padding:0 14px; background:transparent; color:var(--ink-2); font:inherit; font-weight:600; cursor:pointer; }
.s-views button[aria-pressed="true"]{ background:var(--ink); color:var(--surface); box-shadow:inset 0 0 0 2px var(--ink); }
.s-copy{ width:100%; font-family:var(--mono,monospace); font-size:.86rem; }
@media (max-width:640px){ .s-six{ grid-template-columns:repeat(3,minmax(0,1fr)); } .s-six .s-lab{ grid-column:1 / -1; padding:4px 0 0; } }

/* ---------- the survey sheet on paper ---------- */
.sf-sheet.sf-doc .d-survey{ width:100%; font-size:8.8pt; border-collapse:collapse; }
.d-survey .d-el{ break-inside:avoid; }
.d-survey .d-el-h th{ text-align:left; font-size:10pt; color:#1f2547; padding:2.6mm 2mm 1mm 0; border-top:.35mm solid #1f2547; }
.d-survey .d-el-h td{ padding:2.6mm 2mm 1mm; border-top:.35mm solid #1f2547; font-weight:600; }
.d-survey .d-el-h td.n{ text-align:right; font-weight:500; white-space:nowrap; }
.d-survey .d-meas{ padding:0 0 2.4mm; }
.d-meas > span{ display:inline-block; margin:0 5mm 1mm 0; font-variant-numeric:tabular-nums; }
.d-meas b{ color:#4a525c; font-weight:600; margin-right:1mm; }
.d-meas .d-glass{ color:#1b1f24; }
.d-meas .d-flags{ display:block; }
.d-meas .d-flags i{ display:inline-block; font-style:normal; font-size:7.8pt; margin:0 2mm .6mm 0; padding:.2mm 1.6mm; border-radius:1mm; background:#eef0f3; color:#4a525c; }
.d-meas .d-flags i.warn{ background:#fbe9e5; color:#b5381f; font-weight:650; }
.d-note-i{ display:block; color:#4a525c; font-style:italic; }
.d-thumbs{ display:flex !important; gap:2mm; margin-top:1mm; }
.d-thumb{ width:30mm; }
.d-state{ font-size:7.8pt; color:#4a525c; }
.d-state.estimated,.d-state.pending{ color:#b5381f; font-weight:650; }
.d-tag-i{ display:inline-block; font-size:7.6pt; font-weight:500; color:#4a525c; margin-left:1.5mm; }
.d-sum{ margin:0 0 3mm; font-size:9pt; color:#4a525c; }
.d-method{ margin-top:3mm; font-size:7.6pt; color:#69727d; }
.d-figs{ display:grid; grid-template-columns:1fr 1fr; gap:4mm 5mm; margin-bottom:4mm; }
.d-fig{ margin:0; break-inside:avoid; }
.d-fig figcaption{ font-size:8pt; color:#4a525c; margin-top:1mm; }
.d-fig .d-dims{ display:block; color:#b5381f; font-weight:600; }
.d-group{ font-size:9.5pt; margin:4mm 0 2mm; color:#1f2547; }
.d-nophoto{ display:grid; place-items:center; aspect-ratio:4/3; background:#eef0f3; color:#69727d; font-size:7.5pt; }
.q-ready{ margin:0 0 6px; padding-left:18px; font-size:.88rem; color:var(--ink-2); display:grid; gap:2px; }

/* touch screens (the reasons are in base.css, 14-10-2026): the document tools'
   small buttons were 36 px, the tabs 42, the move and delete buttons of each
   surveyed opening 32 px side by side, the links under it 22 px */
@media (pointer:coarse){
  .btn.small{ min-height:44px; }
  .sf-tabs button,.s-views button{ min-height:44px; }
  .s-el-acts .btn{ min-height:44px; min-width:44px; }
  .q-line input,.q-line select,.sf-picker select,.q-chips select{ min-height:44px; }
  .sf-app:not(#sf-pricelist) > .sf-bar > .sf-bar-acts:first-child:empty{ min-height:76px; }   /* r3180: the picker with its 44 px select */
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts:empty{ min-height:0; }
  .s-links a{ display:inline-flex; align-items:center; min-height:44px; }
  .sf-company > summary{ padding:9px 0; }
  /* the buttons of each budget line floated over its top right corner at 28 px,
     «move down» 4 px from «delete line»: on touch they get a row of their own at
     the foot of the line, at 44 px (proposal 1 in docs/plataforma/movil/, 15-10-2026) */
  .q-line-acts{ position:static; grid-column:1 / -1; justify-content:flex-end; gap:8px; margin:0 0 10px; }
  body .q-line-acts .btn{ min-height:44px; min-width:44px; }
}
/* r3964: the same row and the same 44 px on a narrow screen without a touch pointer (they measured 31 to 39 px wide) */
@media screen and (max-width:640px){
  .q-line-acts{ position:static; grid-column:1 / -1; justify-content:flex-end; gap:8px; margin:0 0 10px; }
  body .q-line-acts .btn, body .sf-app .pl-acts .btn.small, body .sf-app .btn.small.danger{ min-height:44px; min-width:44px; }
  body .sf-app :is(.sf-tabs, .s-views) button{ min-height:44px; }
}
.sf-save.warn{ color:var(--warn,#935700); font-weight:600; }

/* r3180: the QR code tool (/documents/qr/). Until r3180 its deferred script wrote these rules in a <style> after the
   first paint, and the result panel jumped from under the form to beside it (CLS 0.14-0.18 at 1560 px). */
.qr-work{display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}
@media (min-width:860px){.qr-work{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);align-items:stretch}}
@media screen {
  .qr-work .qr-form > .field:first-child {
    padding-bottom:12px;
    border-bottom:1px solid var(--rule);
  }
  .qr-work .qr-result {
    background:var(--surface-2);
    align-content:start;
  }
  .qr-work .qr-result .sf-bar-acts {
    width:100%;
    padding-top:12px;
    border-top:1px solid var(--rule);
  }
}
.qr-form textarea{width:100%;min-height:7.5em;font-family:inherit;resize:vertical}
.qr-form .field{margin-bottom:0}
.qr-result{justify-items:center;text-align:center}
.qr-code{width:min(100%,320px);aspect-ratio:1/1;display:grid;place-items:center;background:#fff;border:2.5px solid var(--ink);border-radius:10px;padding:10px;box-sizing:border-box}
.qr-code.has-cap{aspect-ratio:auto}
.qr-code svg{width:100%;height:auto;display:block}
.qr-code .qr-empty{color:#4a525c;font-size:.95rem;padding:12px}
.qr-info{margin:0;font-size:.92rem;color:var(--ink-2);min-height:2.6em;max-width:36em}
.qr-info.warn{color:var(--warn)}
.qr-result .sf-bar-acts{justify-content:center}
#qr-printout{display:none}
@media print{body.qr-printing > *:not(#qr-printout){display:none !important}body.qr-printing #qr-printout{display:block !important}
#qr-printout figure{margin:0;display:inline-block;text-align:center;break-inside:avoid}#qr-printout svg{display:block}
#qr-printout figcaption{font:9pt Archivo,Arial,sans-serif;color:#000;margin-top:2mm;max-width:100%;overflow-wrap:anywhere}}


@media screen {
  #sf-projects > .sf-bar {
    display:grid;
    justify-items:start;
    gap:12px;
    margin-bottom:0;
    padding:clamp(16px,2vw,26px);
    border:2.5px solid var(--ink);
    border-radius:16px;
    box-shadow:5px 5px 0 var(--ink);
    background:var(--surface);
  }
  #sf-projects .sf-bar .sf-limits { margin:0; }
  #sf-projects .sf-proj { border-inline-start:4px solid var(--accent); }
  #sf-projects .sf-empty {
    padding:20px;
    background:var(--surface-2);
  }
  #sf-projects .sf-empty > b:first-child { display:block; margin-bottom:4px; }
}
@media screen and (min-width:880px) {
  #sf-projects { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  #sf-projects > * { grid-column:1 / -1; }
  #sf-projects > :is(#sf-storage,#sf-company) { grid-column:span 1; }
}

@media screen {
  .sf-work .sf-desk .sf-panel > :is(h2,h3):first-child {
    padding-block-end:10px;
    border-bottom:1px solid var(--rule);
    line-height:1.25;
  }
  .sf-work .sf-desk .sf-panel:focus-within { border-color:var(--rule-2); }
  .sf-work .sf-desk .field:focus-within > label {
    text-decoration:underline;
    text-underline-offset:.2em;
  }
  .sf-app .sf-tabs button[aria-selected="true"] {
    color:var(--ink);
    box-shadow:inset 0 -3px var(--glass);
  }
}

/* ===========================================================================
   REDISEÑO 8-11-2026, r361: the paper leads in the document tools
   Scoped to the tools that keep a desk and a paper side by side (.sf-work) in the
   Documents area; the customer's views and the px pages are left alone. Screen only:
   what prints does not change (the print rules above drop background, shadow and scale). */
body.app[data-area="docs"]{ --mat-dot:rgba(31,37,71,.16); --mat-top:#eceff6; }
@media (prefers-color-scheme: dark){ body.app[data-area="docs"]{ --mat-dot:rgba(197,201,230,.11); --mat-top:#141a22; } }
@media screen{
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) .sf-paperwrap{
    background:radial-gradient(circle at 1px 1px,var(--mat-dot) 1px,transparent 1.4px) 0 0 / 18px 18px,linear-gradient(180deg,var(--mat-top),var(--desk));
    border:1px solid color-mix(in srgb,var(--docs) 14%,var(--rule)); border-radius:16px; }
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) .sf-sheet{ border-radius:2px; box-shadow:0 0 0 2.5px var(--ink),6px 6px 0 2.5px var(--ink); }
  /* the actions: one bar, flat buttons, the main one still solid */
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts:not(:empty){ gap:4px; padding:6px; border:2.5px solid var(--ink);
    border-radius:12px; background:var(--surface); box-shadow:4px 4px 0 var(--ink); }
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .btn:not(.primary),
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .q-more > summary.btn{ border-color:transparent; background:transparent; }
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .btn:not(.primary):hover,
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .q-more > summary.btn:hover,
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .q-more[open] > summary.btn{ background:var(--surface-2); border-color:var(--rule); }
}
@media screen and (min-width:1100px){
  /* wider than the page's 1200 px, never wider than the window less 32 px a side */
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work){ margin-inline:calc((100% - min(1480px, 100vw - 64px)) / 2); }
  body.app[data-area="docs"] .sf-app:not([data-px]) > .sf-work{ grid-template-columns:minmax(380px,.8fr) minmax(0,1.2fr); gap:28px; }
  body.app[data-area="docs"] .sf-app:not([data-px]) > .sf-work > .sf-paperwrap{ padding:24px; }
}
@media screen and (max-width:640px){
  body.app[data-area="docs"] .sf-app:not([data-px]) > .sf-work > .sf-paperwrap{ padding:6px; border-radius:12px; }
  /* on a phone the bar wraps to three rows: each action keeps a soft chip so it still reads as a button */
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .btn:not(.primary),
  body.app[data-area="docs"] .sf-app:not([data-px]):has(> .sf-work) > .q-acts > .q-more > summary.btn{ background:var(--surface-2); }
}
/* r953 (10-11-2026, informe del 8-11): the estimate's A4 sheet leads on a laptop. The sheet is what the tool sells,
   and at 1560 x 787 it started at 712 px, under the opening band, the example line, the bar and the actions: 75 px of
   it on the first screen. Here, from 1100 px wide and on screen only, the sheet takes the right-hand column from the top
   of the tool (beside the example line, the bar and the actions, which move to the left with the editor), and the
   opening band is lower: no drawing (the sheet is the picture) and the title on one line. Same markup and scripts;
   the phone tabs, the print and the other document tools are left alone. */
@media not print and (min-width:1100px){
  body.app[data-area="docs"]:has(#sf-quote) main > .hero:first-of-type{ padding-top:16px !important; padding-bottom:14px !important; margin-bottom:0; }
  body.app[data-area="docs"]:has(#sf-quote) main > .hero:first-of-type::after{ display:none; }
  body.app[data-area="docs"]:has(#sf-quote) main > .hero:first-of-type > :is(h1,.eyebrow,.answer,p){ max-width:none; }
  body.app[data-area="docs"]:has(#sf-quote) main > .hero:first-of-type > h1{ font-size:clamp(1.6rem,1rem + calc(1vw / var(--zc,1)),2.1rem); margin-bottom:.3em; }
  body.app[data-area="docs"] main > #sf-quote.sf-app:not([data-px]){ grid-template-columns:minmax(440px,.95fr) minmax(0,1.05fr); column-gap:28px; align-items:start; padding-top:14px; }
  body.app[data-area="docs"] main > #sf-quote > *{ grid-column:1; min-width:0; }
  body.app[data-area="docs"] main > #sf-quote > .sf-work{ display:contents; }
  body.app[data-area="docs"] main > #sf-quote > .sf-work > .sf-desk{ grid-column:1; }
  body.app[data-area="docs"] main > #sf-quote > .sf-work > .sf-paperwrap{ grid-column:2; grid-row:1 / span 12; align-self:start; }
  /* r3180: in this narrow column the two pickers (project and budget) fill the first row of the bar and the rest goes
     to a second one; the empty slot takes that row from the first paint, so the bar does not grow when they come */
  body.app[data-area="docs"] main > #sf-quote > .sf-bar > #q-top{ flex-basis:100%; }
}
/* r1710: the budget below 1100 px is one column as wide as the screen: its implicit columns took the min-content of the
   desk (440 px at 390) and the paper went to a second column 14 px wide */
@media (max-width:1099px){
  body.app[data-area="docs"] main > #sf-quote.sf-app:not([data-px]){ grid-template-columns:minmax(0,1fr); }
  body.app[data-area="docs"] main > #sf-quote.sf-app:not([data-px]) > *, body.app[data-area="docs"] main > #sf-quote.sf-app:not([data-px]) > .sf-work > *{ min-width:0; grid-column:1; }
}

/* r3800 (n26-309): every control at least 44 px high (the project name, the folded boxes of the account pages) */
.sf-proj h3 .linklike{ min-height:44px; display:inline-flex; align-items:center; }
main details > summary{ min-height:44px; box-sizing:border-box; padding-block:10px; }
