/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================
   IQP Quote/Invoice App — Design Tokens & Base
   ============================================================ */

:root {
  /* Color */
  --bg:          #FAF8F4;   /* warm off-white page */
  --bg-deep:     #F2EEE6;   /* slightly deeper warm for rails */
  --surface:     #FFFFFF;   /* cards */
  --surface-2:   #FBFAF7;   /* nested fills */
  --ink:         #1F2421;   /* near-black, slightly warm */
  --ink-muted:   #6B6B63;   /* secondary / derived text */
  --ink-faint:   #9B9A8F;   /* tertiary / hints */
  --line:        #E7E2D8;   /* hairline borders */
  --line-strong: #D8D2C5;
  --accent:      #2E6E5B;   /* grounded deep green */
  --accent-ink:  #235445;   /* darker green for hover/text-on-light */
  --accent-soft: #E5EFEA;   /* accent tint */
  --accent-soft-2:#D6E7DF;
  --warn:        #B4541E;   /* terracotta — destructive */
  --warn-soft:   #F6E7DD;
  --ok:          #3E7D4F;   /* paid/accepted */
  --ok-soft:     #E4F0E6;
  --info:        #4A6FA5;   /* sent */
  --info-soft:   #E5EBF3;
  --amber:       #9A7B22;   /* draft */
  --amber-soft:  #F3ECD8;

  /* Typography */
  --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-doc: "Spectral", Georgia, "Times New Roman", serif;

  /* Spacing scale: 4 8 12 16 24 32 48 */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Radius */
  --r-input: 8px;
  --r-card: 12px;
  --r-pill: 999px;

  /* Shadow — subtle, low-spread */
  --shadow-sm: 0 1px 2px rgba(31,36,33,0.04), 0 1px 3px rgba(31,36,33,0.05);
  --shadow-md: 0 2px 6px rgba(31,36,33,0.05), 0 6px 18px rgba(31,36,33,0.06);
  --shadow-lg: 0 8px 30px rgba(31,36,33,0.10), 0 2px 8px rgba(31,36,33,0.06);
  --shadow-pop: 0 12px 40px rgba(31,36,33,0.16);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 180ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* tabular figures for everything numeric by default in tables/summary */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "tnum"; }

h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: var(--accent-soft-2); }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #d8d2c5; border-radius: 999px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #c7c0b0; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 60;
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: 0 var(--s6);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px; color: var(--ink-faint); margin-top: -2px; letter-spacing: 0.01em; }
.brand-logo { height: 30px; width: auto; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--s4);
}
.nav-item {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: rgba(46,110,91,0.07); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.topbar-spacer { flex: 1 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-input);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #c7c0b0; background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-ghost:hover { background: rgba(31,36,33,0.05); color: var(--ink); }

.btn-danger { background: transparent; color: var(--warn); border-color: transparent; }
.btn-danger:hover { background: var(--warn-soft); }

.btn-sm { padding: 6px 11px; font-size: 13px; gap: 6px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Pills, badges, tags
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  line-height: 1;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-draft   { background: var(--amber-soft); color: var(--amber); }
.pill-draft .dot { background: var(--amber); }
.pill-sent    { background: var(--info-soft); color: var(--info); }
.pill-sent .dot { background: var(--info); }
.pill-accepted{ background: var(--ok-soft); color: var(--ok); }
.pill-accepted .dot { background: var(--ok); }
.pill-paid    { background: var(--ok-soft); color: var(--ok); }
.pill-paid .dot { background: var(--ok); }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-quote   { border: 1px solid var(--line-strong); color: var(--ink-muted); background: var(--surface); }
.badge-invoice { background: var(--accent); color: #fff; }

.tag-auto {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ============================================================
   Cards & sections
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.section-num {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.section-head .spacer { flex: 1 1; }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.01em; }
.field-label .req { color: var(--warn); margin-left: 2px; }

.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  padding: 9px 11px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder { color: var(--ink-faint); }
.input:hover { border-color: #c7c0b0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,110,91,0.15); }
.input.invalid { border-color: var(--warn); }
.input.invalid:focus { box-shadow: 0 0 0 3px rgba(180,84,30,0.15); }

textarea.input { resize: vertical; min-height: 70px; line-height: 1.5; }

.input-num { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-affix .affix { position: absolute; color: var(--ink-faint); font-size: 13px; pointer-events: none; }
.input-affix .affix-left { left: 11px; }
.input-affix .affix-right { right: 11px; }
.input-affix .input.has-left { padding-left: 26px; }
.input-affix .input.has-right { padding-right: 30px; }

/* Derived / read-only value style — never looks editable */
.derived {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-style: italic;
  background: transparent;
  border: 1px dashed transparent;
}
.derived-cell {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-style: italic;
  cursor: help;
}

/* Segmented toggle */
.segmented {
  display: inline-flex;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: color var(--t-med);
  position: relative;
  white-space: nowrap;
}
.segmented button.on { color: var(--ink); }
.seg-thumb {
  position: absolute;
  top: 3px; left: 3px;
  height: calc(100% - 6px);
  background: var(--surface);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), width var(--t-med) var(--ease);
  z-index: 0;
}
.segmented.wrap { position: relative; }
.segmented .seg-label { position: relative; z-index: 1; }

/* Switch */
.switch {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  border: none;
  cursor: pointer;
  transition: background var(--t-med);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }

/* ============================================================
   Tooltip
   ============================================================ */
.tip { position: relative; display: inline-flex; }
.tip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 80;
  box-shadow: var(--shadow-md);
}
.tip-bubble::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tip:hover .tip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); }
.help-dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  cursor: help;
}

/* ============================================================
   Tables
   ============================================================ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* highlight pulse on changed numbers */
@keyframes valpulse {
  0%   { background: rgba(46,110,91,0.18); }
  100% { background: transparent; }
}
.pulse { animation: valpulse 700ms var(--ease); border-radius: 5px; }

/* row-action menu */
.menu {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 5px;
  min-width: 184px;
  z-index: 90;
  animation: menuin 120ms var(--ease);
}
@keyframes menuin { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--warn); }
.menu-item.danger:hover { background: var(--warn-soft); }
.menu-item svg { width: 15px; height: 15px; opacity: 0.7; flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 2px; }

/* ============================================================
   Layout helpers
   ============================================================ */
.page { max-width: 1320px; margin: 0 auto; padding: var(--s6); width: 100%; }
.page-narrow { max-width: 1120px; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  padding: 11px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  animation: toastin 200ms var(--ease);
}
.toast svg { width: 16px; height: 16px; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* fade-in for screens — intentionally static (capture-safe) */
.screen-in { }

/* dropdown popover for product picker */
.popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  z-index: 95;
  overflow: hidden;
  animation: menuin 120ms var(--ease);
}
.popover-search { padding: 8px; border-bottom: 1px solid var(--line); position: -webkit-sticky; position: sticky; top: 0; background: var(--surface); }
.popover-list { max-height: 280px; overflow-y: auto; padding: 5px; }
.popover-group { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 4px; }
.popover-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.popover-opt:hover, .popover-opt.active { background: var(--accent-soft); }
.popover-opt .price { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; color: var(--ink-muted); font-size: 13px; }

/* empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 18px;
}
.empty-art { width: 120px; height: 120px; opacity: 0.9; }

kbd {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 600;
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--ink-muted);
}
/* ============================================================
   IQP — Layout, screen-specific & print styles
   ============================================================ */

/* ---- Filter chips (quotes list) ---- */
.chip {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { border-color: #c7c0b0; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Context bar (editor / preview) ---- */
.context-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* ---- Editor two-column layout ---- */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-gap: var(--s6);
  gap: var(--s6);
  align-items: start;
  padding-top: var(--s6);
  padding-bottom: 80px;
}
.editor-main { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }
.editor-aside { position: -webkit-sticky; position: sticky; top: 140px; }
.summary-panel { width: 340px; }

/* ---- Help / documentation layout ---- */
.help-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-gap: var(--s6);
  gap: var(--s6);
  align-items: start;
  padding-bottom: 60px;
}
.help-toc { position: -webkit-sticky; position: sticky; top: 140px; align-self: start; }
.help-toc-group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); padding: 4px 10px; margin-bottom: 2px;
}
.help-toc-item {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 8px; border: none; background: none;
  font-size: 13.5px; color: var(--ink-muted); cursor: pointer; line-height: 1.35;
}
.help-toc-item:hover { background: rgba(46,110,91,0.07); color: var(--ink); }
.help-toc-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.help-content { min-width: 0; max-width: 760px; }
.help-content h2 { color: var(--ink); }
.help-content table { font-size: 13.5px; }

/* customer form grid */
.cust-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 16px; gap: 16px; }

/* installation */
.install-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 16px; gap: 16px; }
.install-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }

/* deposit */
.deposit-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; }
.deposit-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }

/* measurement / table niceties */
.meas-table tfoot td, .table tfoot td { border-bottom: none; background: var(--surface-2); }
.meas-foot td { border-top: 1px solid var(--line); }
.lw-box:focus { z-index: 2; position: relative; }
.area-name:focus { z-index: 2; position: relative; }

/* mobile total bar (hidden on desktop) */
.mobile-total-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 70;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(31,36,33,0.08);
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
}

/* ---- Settings ---- */
.settings-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid; place-items: center;
}
.const-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 18px; gap: 18px; }
.const-cell {}
.term-num {
  flex: none; width: 24px; height: 24px; margin-top: 7px;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---- Catalogue modal ---- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(31,36,33,0.32);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  animation: scrimin 150ms var(--ease);
}
@keyframes scrimin { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  width: 540px; max-width: 100%;
  padding: 24px;
  animation: modalin 180ms var(--ease);
}
@keyframes modalin { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-wide { width: 980px; max-width: 100%; max-height: 88vh; overflow: auto; }
.price-row { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-radius: 10px; padding: 14px; }
.derived-readout { display: flex; align-items: baseline; gap: 6px; padding: 9px 0; }

/* ============================================================
   Document / print
   ============================================================ */
.doc-stage {
  padding: 40px 20px 80px;
  display: flex;
  justify-content: center;
  background: var(--bg-deep);
  min-height: calc(100vh - 124px);
}
.doc-page {
  background: #fff;
  width: 794px;             /* A4 @ 96dpi */
  min-height: 1123px;
  padding: 56px 60px;
  box-shadow: var(--shadow-lg);
  color: #23241f;
  font-family: var(--font-doc);
  font-size: 14px;
  line-height: 1.5;
}
.doc-header { display: flex; align-items: flex-start; gap: 6px; }
.doc-brand-mark {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-ui);
  font-weight: 700; font-size: 22px; letter-spacing: 0.02em;
}
.doc-logo { height: 52px; width: auto; display: block; }
.doc-company { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.doc-tagline { font-style: italic; color: #6b6b63; font-size: 13px; }
.doc-meta { font-size: 12.5px; color: #6b6b63; margin-top: 1px; }
.doc-title-block { text-align: right; }
.doc-title { font-size: 22px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-ink); }
.doc-num { font-size: 13px; color: #6b6b63; margin-top: 2px; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.doc-rule { height: 2px; background: #23241f; margin: 18px 0; }
.doc-parties { display: flex; justify-content: space-between; gap: 24px; }
.doc-label { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #9b9a8f; }
.doc-table { width: 100%; border-collapse: collapse; margin: 4px 0 0; }
.doc-table th { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9b9a8f; padding: 8px 0; border-bottom: 1px solid #d8d2c5; }
.doc-table td { padding: 9px 0; border-bottom: 1px solid #efebe2; font-size: 13.5px; }
.doc-note { color: #9b9a8f; font-size: 12px; }
.doc-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.doc-total-rule { height: 2px; background: #23241f; margin: 6px 0; }
.doc-notes { margin-top: 24px; font-size: 13px; }
.doc-bank { margin-top: 26px; padding-top: 14px; border-top: 1px solid #d8d2c5; font-size: 12.5px; line-height: 1.9; }
.doc-bank .doc-label { display: inline; }
.doc-terms { margin-top: 24px; page-break-before: auto; break-before: auto; }
.doc-terms-list { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; font-size: 10.5px; line-height: 1.5; color: #4a4a44; }
.doc-terms-list li { page-break-inside: avoid; break-inside: avoid; margin-bottom: 5px; }
.doc-sign { display: flex; gap: 48px; margin-top: 40px; }
.doc-sign > div { flex: 1 1; }
.doc-sign-line { border-bottom: 1.5px solid #23241f; height: 40px; margin-bottom: 6px; }

/* ============================================================
   Responsive — desktop-first
   ============================================================ */
@media (max-width: 1080px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-aside { display: none; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
  .mobile-total-bar { display: flex; }
  .cust-grid { grid-template-columns: repeat(2, 1fr); }
  .const-grid { grid-template-columns: repeat(2, 1fr); }
  .install-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page { padding: 20px 16px; }
  .nav { display: none; }
  .cust-grid { grid-template-columns: 1fr; }
  .const-grid { grid-template-columns: 1fr; }
  .doc-page { padding: 32px 28px; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .no-print { display: none !important; }
  body, html { background: #fff; }
  .doc-stage { padding: 0; background: #fff; min-height: 0; }
  .doc-page { box-shadow: none; width: 100%; min-height: 0; padding: 0; }
  .doc-terms { page-break-before: always; break-before: page; }
  @page { size: A4; margin: 16mm; }
}

/* Print only the costing sheet (overlay), hiding the app behind it. */
@page costing { size: A4 landscape; margin: 12mm; }
@media print {
  body.costing-print * { visibility: hidden; }
  body.costing-print .costing-sheet,
  body.costing-print .costing-sheet * { visibility: visible; }
  body.costing-print .modal-scrim { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; display: block; }
  body.costing-print .costing-sheet { position: absolute; inset: 0; width: 100%; max-height: none; overflow: visible; box-shadow: none; border-radius: 0; animation: none; page: costing; }
  body.costing-print .no-print { display: none !important; }
  body.costing-print { background: #fff; }
}

