/* ==========================================================================
   Tashteeby — companion styles: the line-by-line BOQ (js/boq.js), saved units on the calculator (js/calc-units.js),
   the unit follow-up page (js/unit.js) and the units list. Website and desktop apps.
   ========================================================================== */

/* ---------------------------------------------------------------- line-by-line BOQ (js/boq.js, calculator pages) */
html.tb-has-boq .calc { padding-block-end: 1.75rem; }

/* the card in the result column (in place of the browser's "in the app" teaser) */
.boq-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; padding: 16px;
  border-radius: var(--r-lg); border: 1px solid rgba(232, 181, 71, 0.3);
  background: linear-gradient(135deg, rgba(232, 181, 71, 0.12), rgba(232, 181, 71, 0.02) 60%), rgba(246, 241, 228, 0.03);
}
.boq-card.is-locked { border-color: var(--line-strong); background: rgba(246, 241, 228, 0.04); }
.boq-card-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); box-shadow: 0 10px 22px -12px rgba(232, 181, 71, 0.9); }
.boq-card.is-locked .boq-card-ico { color: var(--gold-300); background: rgba(232, 181, 71, 0.12); box-shadow: none; }
.boq-card-ico svg { width: 22px; height: 22px; }
.boq-card-text { display: grid; gap: 2px; line-height: 1.45; }
.boq-card-text b { font-size: 0.98rem; color: var(--on-navy); }
.boq-card-text small { font-size: 0.8rem; color: var(--on-navy-muted); }
.boq-card-go { grid-column: 1 / -1; min-height: 42px; font-size: 0.9rem; }

/* the panel under the calculator */
.boq-panel { display: grid; gap: 16px; padding-block-end: clamp(3rem, 6vw, 5rem); scroll-margin-top: 96px; }
.boq-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.boq-heading { min-width: 0; max-width: 46rem; }
.boq-heading h2 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); color: var(--on-navy); }
.boq-heading p { margin-top: 6px; color: var(--on-navy-muted); font-size: 0.92rem; line-height: 1.6; }
.boq-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.boq-search {
  display: flex; align-items: center; gap: 8px; height: 42px; min-width: 230px; padding-inline: 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(246, 241, 228, 0.05); color: var(--on-navy-faint); transition: border-color 0.2s, background 0.2s;
}
.boq-search:focus-within { border-color: var(--gold-400); background: rgba(246, 241, 228, 0.08); }
.boq-search svg { width: 17px; height: 17px; flex: none; }
.boq-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--on-navy); font: inherit; font-size: 0.9rem; }
.boq-search input::placeholder { color: var(--on-navy-faint); }
.boq-btn { min-height: 42px; padding: 0 16px; font-size: 0.88rem; gap: 8px; }
.boq-btn svg { width: 17px; height: 17px; }
.boq-btn.is-busy svg { display: none; }

.boq-sheet { overflow: hidden; border-radius: var(--r-lg); background: var(--paper); color: var(--ink); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6); }
.boq-trade + .boq-trade { border-top: 1px solid var(--paper-line); }
.boq-trade > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  padding: 14px 20px; transition: background 0.15s; -webkit-user-select: none; user-select: none;
}
.boq-trade > summary::-webkit-details-marker { display: none; }
.boq-trade > summary:hover { background: rgba(232, 181, 71, 0.07); }
.boq-trade > summary:focus-visible { outline-offset: -3px; }
.boq-trade[open] > summary { background: var(--cream); border-bottom: 1px solid var(--paper-line); }
.boq-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.boq-ico svg { width: 19px; height: 19px; }
.boq-trade-name { display: grid; min-width: 0; line-height: 1.35; }
.boq-trade-name b { font-size: 0.98rem; color: var(--ink); }
.boq-trade-name small { font-size: 0.76rem; color: var(--muted); }
.boq-trade-name em { font-style: normal; font-weight: 600; color: #9a6f14; }
.boq-share { min-width: 3.2em; padding: 3px 8px; border-radius: 999px; text-align: center; font-size: 0.74rem; font-weight: 600; color: var(--ink-2); background: var(--cream-2); }
.boq-trade-total { font-size: 1rem; color: var(--ink); white-space: nowrap; }
.boq-trade-total small { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.boq-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s var(--ease-out); }
.boq-trade[open] .boq-chev { transform: rotate(180deg); }

.boq-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.boq-table th { padding: 9px 10px; text-align: start; white-space: nowrap; font-size: 0.72rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--paper-line); }
.boq-table td { padding: 7px 10px; color: var(--ink); vertical-align: middle; border-bottom: 1px solid rgba(226, 219, 200, 0.65); }
.boq-table tr:last-child td { border-bottom: 0; }
.boq-table th:first-child, .boq-table td:first-child { padding-inline-start: 20px; }
.boq-table th:last-child, .boq-table td:last-child { padding-inline-end: 14px; }
.boq-table .num { text-align: end; font-variant-numeric: tabular-nums lining-nums; }
.boq-table tbody tr:hover td { background: rgba(246, 241, 228, 0.7); }
.boq-table tr.edited td { background: rgba(232, 181, 71, 0.08); }
.boq-name { min-width: 14rem; }
.boq-name span { display: block; font-weight: 500; line-height: 1.45; }
.boq-name small { display: block; margin-top: 1px; font-size: 0.74rem; line-height: 1.4; color: var(--muted); }
.boq-unit { white-space: nowrap; font-size: 0.82rem; color: var(--ink-2); }
.boq-in {
  width: 7.2em; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; text-align: end; font-variant-numeric: tabular-nums lining-nums; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.boq-in:hover { border-color: #cdbf9c; }
.boq-in:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(232, 181, 71, 0.24); }
.boq-in.changed { border-color: var(--gold-500); background: #fff8e6; color: #7a5510; }
.boq-line-total { font-weight: 700; white-space: nowrap; }
.boq-act { width: 44px; text-align: center; }
.boq-reset { width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 1px solid var(--paper-line); background: #fff; color: var(--gold-600); display: inline-grid; place-items: center; transition: border-color 0.15s, color 0.15s; }
.boq-reset:hover { border-color: var(--gold-500); color: #7a5510; }
.boq-reset svg { width: 15px; height: 15px; }
.boq-empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.boq-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--paper-line); background: var(--cream); }
.boq-foot > div { display: grid; gap: 2px; padding: 14px 20px; line-height: 1.35; }
.boq-foot > div + div { border-inline-start: 1px solid var(--paper-line); }
.boq-foot span { font-size: 0.76rem; color: var(--muted); }
.boq-foot b { font-size: 1.08rem; color: var(--ink); white-space: nowrap; }
.boq-foot b small { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.boq-foot .grand { background: var(--navy-900); }
.boq-foot .grand span { color: var(--on-navy-muted); }
.boq-foot .grand b { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold-300); }
html[dir="ltr"] .boq-foot .grand b { font-family: var(--font-body); }
.boq-foot .grand b small { color: var(--on-navy-muted); }
.boq-note { font-size: 0.8rem; color: var(--on-navy-faint); }

/* free plan: a blurred sample under the Premium card */
.boq-locked { position: relative; min-height: 340px; }
.boq-sample { filter: blur(4px); opacity: 0.5; pointer-events: none; -webkit-user-select: none; user-select: none; }
.boq-sample td { padding-block: 12px; }
.boq-lock-card {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(470px, calc(100% - 32px)); text-align: center;
  padding: 28px 26px 24px; border-radius: 22px; color: var(--on-navy); border: 1px solid rgba(232, 181, 71, 0.35);
  background: radial-gradient(120% 80% at 50% 0%, #163a7a 0%, #0c2552 45%, #081c42 100%); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85);
}
.boq-lock-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 17px; display: grid; place-items: center; color: var(--gold-300); background: rgba(232, 181, 71, 0.12); border: 1px solid rgba(232, 181, 71, 0.3); }
.boq-lock-ico svg { width: 25px; height: 25px; }
.boq-lock-card h3 { font-size: 1.12rem; }
.boq-lock-card p { margin-top: 8px; color: var(--on-navy-muted); font-size: 0.9rem; line-height: 1.7; }
.boq-lock-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.boq-lock-actions .btn { min-height: 44px; font-size: 0.9rem; }

@media (max-width: 1180px) {
  .boq-share { display: none; }
  .boq-trade > summary { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .boq-name { min-width: 10rem; }
  .boq-in { width: 6.2em; }
}

/* ---------------------------------------------------------------- BOQ PDF (printed by the app: html.tb-print-boq) */
#boqPrint { display: none; }
@media print {
  html.tb-print-boq, html.tb-print-boq body { background: #fff !important; color: #101728 !important; padding: 0 !important; margin: 0 !important; min-height: 0; }
  html.tb-print-boq body > *:not(#boqPrint) { display: none !important; }
  html.tb-print-boq #boqPrint { display: block; }
  #boqPrint { font-family: var(--font-body); font-size: 9.5pt; line-height: 1.5; color: #101728; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #boqPrint .bp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid #061534; }
  #boqPrint .bp-brand { display: flex; align-items: center; gap: 10px; flex: none; }
  #boqPrint .bp-brand img { width: 40px; height: 40px; border-radius: 10px; }
  #boqPrint .bp-brand b { display: block; font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.2; }
  #boqPrint[dir="ltr"] .bp-brand b { font-family: var(--font-body); }
  #boqPrint .bp-brand small { display: block; font-size: 8pt; color: #5f6879; direction: ltr; }
  #boqPrint .bp-meta { text-align: end; }
  #boqPrint .bp-meta h1 { font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.3; }
  #boqPrint[dir="ltr"] .bp-meta h1 { font-family: var(--font-body); }
  #boqPrint .bp-meta p { font-size: 9pt; color: #3c465a; }
  #boqPrint .bp-muted { color: #7c8496 !important; font-size: 8pt !important; }
  #boqPrint .bp-summary { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; margin: 14px 0 16px; }
  #boqPrint .bp-summary > div { padding: 8px 12px; border-radius: 8px; background: #f6f1e4; border: 1px solid #e2dbc8; }
  #boqPrint .bp-summary span { display: block; font-size: 7.5pt; color: #5f6879; }
  #boqPrint .bp-summary b { font-size: 11pt; font-variant-numeric: tabular-nums; }
  #boqPrint .bp-summary .bp-grand { background: #061534; border-color: #061534; }
  #boqPrint .bp-summary .bp-grand span { color: #b4bdd0; }
  #boqPrint .bp-summary .bp-grand b { color: #f5cf6f; font-size: 14pt; }
  #boqPrint .bp-summary .bp-grand small { color: #b4bdd0; font-size: 8pt; font-weight: 500; }
  #boqPrint .bp-table { width: 100%; border-collapse: collapse; }
  #boqPrint .bp-table thead th { padding: 6px 8px; font-size: 7.5pt; font-weight: 600; text-align: start; color: #fff; background: #0b2454; }
  #boqPrint .bp-table td, #boqPrint .bp-table tbody th { padding: 5px 8px; border-bottom: 1px solid #e2dbc8; text-align: start; vertical-align: top; }
  #boqPrint .bp-table .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #boqPrint .bp-table td small { display: block; font-size: 7.5pt; color: #7c8496; }
  #boqPrint .bp-table tr { break-inside: avoid; }
  #boqPrint .bp-trade th { padding-top: 9px; font-size: 10pt; font-weight: 700; color: #061534; background: #f6f1e4; border-bottom: 1px solid #d8cfb6; break-after: avoid; }
  #boqPrint .bp-edited td { background: #fff8e6; }
  #boqPrint .bp-edited td:first-child { box-shadow: inset 3px 0 0 #d4a23a; }
  #boqPrint[dir="rtl"] .bp-edited td:first-child { box-shadow: inset -3px 0 0 #d4a23a; }
  #boqPrint .bp-totals { break-inside: avoid; }
  #boqPrint .bp-totals th, #boqPrint .bp-totals td { padding: 7px 8px; font-size: 10pt; font-weight: 600; border-bottom: 1px solid #e2dbc8; }
  #boqPrint .bp-totals tr:first-child th, #boqPrint .bp-totals tr:first-child td { border-top: 2px solid #061534; }
  #boqPrint .bp-total th, #boqPrint .bp-total td { font-size: 12pt; font-weight: 700; color: #061534; background: #f6f1e4; }
  #boqPrint .bp-foot { margin-top: 14px; display: grid; gap: 3px; font-size: 8pt; color: #5f6879; break-inside: avoid; }
}

/* ---------------------------------------------------------------- saved units on the calculator (js/calc-units.js) */
.cu-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px; border-radius: 16px;
  background: #fff; border: 1px solid var(--paper-line); box-shadow: 0 12px 30px -24px rgba(6, 21, 52, 0.5);
}
.cu-bar.is-saved { border-color: rgba(212, 162, 58, 0.55); background: linear-gradient(135deg, #fffaf0, #fff 70%); }
.cu-main { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 260px; }
.cu-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cream-2); color: var(--navy-700); }
.cu-ico.saved { background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--gold-ink); box-shadow: 0 8px 18px -10px rgba(232, 181, 71, 0.9); }
.cu-ico svg { width: 21px; height: 21px; }
.cu-text { display: grid; gap: 2px; min-width: 0; line-height: 1.45; }
.cu-text b { font-size: 0.98rem; color: var(--ink); overflow-wrap: anywhere; }
.cu-text small { font-size: 0.8rem; color: var(--muted); }
.cu-status.saving { color: #9a6f14; }
.cu-status.failed { color: #b3261e; }
.cu-status.saved { color: #1d6b43; }
.cu-status .spinner { display: inline-block; width: 11px; height: 11px; border-width: 2px; vertical-align: -1px; margin-inline-end: 4px; }
.cu-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cu-btn { min-height: 42px; padding: 0 16px; font-size: 0.88rem; }
.cu-btn svg { width: 16px; height: 16px; }
html[dir="rtl"] .cu-follow svg { transform: scaleX(-1); }
.cu-pick select {
  height: 42px; max-width: 230px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink);
  font: inherit; font-size: 0.86rem; cursor: pointer;
}
.cu-pick select:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.cu-error { width: 100%; font-size: 0.82rem; color: #b3261e; }

/* ---------------------------------------------------------------- unit follow-up page (unit.html, js/unit.js) */
.u-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px 32px; }
.u-title { min-width: 0; max-width: 46rem; }
.u-title h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--on-navy); overflow-wrap: anywhere; }
.u-title p { margin-top: 6px; color: var(--on-navy-muted); }
.u-skel { opacity: 0.55; }
.u-total { display: grid; gap: 2px; justify-items: end; text-align: end; }
.u-total > span { font-size: 0.8rem; color: var(--on-navy-muted); }
.u-total > b { font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; color: var(--gold-300); }
html[dir="ltr"] .u-total > b { font-family: var(--font-body); letter-spacing: -0.02em; }
.u-total > b small { font-size: 0.9rem; font-weight: 500; color: var(--on-navy-muted); }
.u-head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.u-head-actions .btn { min-height: 42px; padding: 0 16px; font-size: 0.88rem; }
.u-head-actions .btn svg { width: 16px; height: 16px; }
.u-save { font-size: 0.8rem; color: var(--on-navy-faint); min-width: 4em; }
.u-save.saving { color: var(--gold-300); }
.u-save.saved { color: #8be0b3; }
.u-save.failed { color: #ffb4ab; }

.u-page { display: grid; gap: 18px; padding-block-end: clamp(3rem, 6vw, 5rem); }
.u-headline {
  padding: 14px 18px; border-radius: 16px; font-size: 1.02rem; line-height: 1.7; color: var(--on-navy);
  background: linear-gradient(135deg, rgba(232, 181, 71, 0.15), rgba(232, 181, 71, 0.03)); border: 1px solid rgba(232, 181, 71, 0.32);
}
.u-kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 12px; }
.u-kpi { display: grid; gap: 6px; align-content: start; padding: 16px 18px; border-radius: 18px; background: rgba(246, 241, 228, 0.05); border: 1px solid var(--line); }
.u-kpi > span { font-size: 0.78rem; color: var(--on-navy-muted); }
.u-kpi > b { font-size: 1.35rem; line-height: 1.2; color: var(--on-navy); }
.u-kpi > b small { font-size: 0.75rem; font-weight: 500; color: var(--on-navy-muted); }
.u-kpi > small { font-size: 0.78rem; color: var(--on-navy-faint); }
.u-kpi.bad > small { color: #ffb4ab; }
.u-kpi.good > small { color: #8be0b3; }
.u-bar { display: block; height: 6px; border-radius: 6px; background: rgba(246, 241, 228, 0.12); overflow: hidden; }
.u-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); transition: width 0.4s var(--ease-out); }
.u-bar.thin { height: 5px; background: var(--cream-2); }
.u-bar.bad > i { background: linear-gradient(90deg, #c0392b, #e57368); }

.u-tabs { display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(246, 241, 228, 0.05); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.u-tabs::-webkit-scrollbar { display: none; }
.u-tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: transparent; color: var(--on-navy-muted); font-weight: 600; font-size: 0.9rem; white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.u-tab:hover { color: var(--on-navy); background: rgba(246, 241, 228, 0.05); }
.u-tab.on { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-300), var(--gold-400)); box-shadow: 0 10px 24px -14px rgba(232, 181, 71, 0.9); }
.u-tab svg { width: 18px; height: 18px; }
.u-body { display: grid; gap: 14px; }
.u-intro { max-width: 60rem; font-size: 0.92rem; color: var(--on-navy-muted); }
.u-callout { padding: 12px 16px; border-radius: 14px; font-size: 0.9rem; color: #c9f0da; background: rgba(76, 181, 127, 0.1); border: 1px solid rgba(76, 181, 127, 0.35); }
.u-sheet { overflow: hidden; border-radius: var(--r-lg); background: var(--paper); color: var(--ink); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6); }
.u-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.u-ico svg { width: 18px; height: 18px; }
.u-x { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); }
.u-x:hover { background: #fde4e1; color: #a1271d; }
.u-x svg { width: 14px; height: 14px; }
.u-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: #9a6f14; font-weight: 600; font-size: 0.84rem; }
.u-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.u-link svg { width: 15px; height: 15px; }
.u-link.danger { color: #a1271d; }
.u-empty { font-size: 0.82rem; color: var(--muted); }
.u-empty.center { text-align: center; padding: 18px; color: var(--on-navy-muted); }
.u-err { font-size: 0.82rem; color: #a1271d; }
.u-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; background: var(--cream-2); color: var(--ink-2); }
.u-chip svg { width: 12px; height: 12px; }
.u-chip.bad, .u-chip.lv-high { background: #fde4e1; color: #a1271d; }
.u-chip.warn, .u-chip.lv-above { background: #fff1d6; color: #8a5a00; }
.u-chip.good, .u-chip.lv-fair { background: #dcf3e6; color: #1d6b43; }
.u-chip.lv-below { background: #e3edff; color: #24508f; }
.u-chip.lv-low { background: #ece6ff; color: #5b3aa6; }
.u-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.u-toolbar .btn, .u-add { min-height: 42px; padding: 0 16px; font-size: 0.86rem; }
.u-toolbar .btn svg, .u-add svg { width: 16px; height: 16px; }
.u-add { justify-self: start; }
.u-lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--gold-300); background: rgba(232, 181, 71, 0.12); border: 1px solid rgba(232, 181, 71, 0.3); }
.u-lock svg { width: 28px; height: 28px; }
.u-body > .u-hint { color: var(--on-navy-faint); font-size: 0.8rem; }

/* progress */
.u-start { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: 18px; background: var(--paper); color: var(--ink); }
.u-start > div { flex: 1 1 240px; display: grid; gap: 2px; }
.u-start label { cursor: pointer; }
.u-start small { font-size: 0.8rem; color: var(--muted); }
.u-start input { width: auto; max-width: 210px; min-height: 44px; }
.u-start-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-900); color: var(--gold-300); }
.u-start-ico svg { width: 20px; height: 20px; }
.u-trade + .u-trade { border-top: 1px solid var(--paper-line); }
.u-trade > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 12px;
  padding: 14px 18px; transition: background 0.15s;
}
.u-trade > summary::-webkit-details-marker { display: none; }
.u-trade > summary:hover { background: rgba(232, 181, 71, 0.06); }
.u-trade[open] > summary { background: var(--cream); }
.u-trade-name { display: grid; min-width: 0; line-height: 1.4; }
.u-trade-name b { font-size: 0.96rem; }
.u-trade-name small { font-size: 0.76rem; color: var(--muted); }
.s-done .u-trade-name b { color: #1d6b43; }
.u-trade-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.u-money { font-size: 0.86rem; white-space: nowrap; }
.u-money .muted { color: var(--muted); }
.u-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--cream-2); }
.u-seg button { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.u-seg button:hover { color: var(--ink); }
.u-seg button svg { width: 13px; height: 13px; }
.u-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -2px rgba(6, 21, 52, 0.3); }
.s-active .u-seg button.on { background: var(--gold-400); color: var(--gold-ink); }
.s-done .u-seg button.on { background: #2f8f5b; color: #fff; }
.u-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s var(--ease-out); }
.u-trade[open] .u-chev { transform: rotate(180deg); }
.u-trade-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; padding: 6px 18px 18px; background: var(--cream); }
.u-trade-body > .u-bar, .u-dates, .u-note { grid-column: 1 / -1; }
.u-dates { display: flex; flex-wrap: wrap; gap: 12px; }
.u-dates label, .u-note { display: grid; gap: 4px; font-size: 0.78rem; color: var(--muted); }
.u-dates input { min-height: 40px; }
.u-dates input:disabled { opacity: 0.5; }
.u-col h4 { margin-bottom: 6px; font-size: 0.82rem; color: var(--ink-2); }
.u-pays { display: grid; gap: 6px; }
.u-pays li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--paper-line); font-size: 0.84rem; }
.u-pays li > span:first-child { font-weight: 700; white-space: nowrap; }
.u-pays li > span:first-child small { font-weight: 500; color: var(--muted); }
.u-pays li > span:nth-child(2) { font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.u-payform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--paper-line); }
.u-payform label { display: grid; gap: 4px; font-size: 0.76rem; color: var(--muted); }
.u-payform .wide { grid-column: 1 / -1; }
.u-payform input { min-height: 40px; }
.u-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.u-form-actions .btn { min-height: 40px; padding: 0 16px; font-size: 0.86rem; }
.u-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.u-photos figure { position: relative; margin: 0; }
.u-photo { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--cream-2); cursor: zoom-in; }
.u-photo img { width: 100%; height: 100%; object-fit: cover; }
.u-photos figure .u-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; background: rgba(255, 255, 255, 0.92); }
.u-photo-add { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 1; padding: 4px; border-radius: 10px; border: 1.5px dashed #cdbf9c; color: #9a6f14; font-size: 0.74rem; font-weight: 600; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.u-photo-add:hover { border-color: var(--gold-500); background: #fffaf0; }
.u-photo-add svg { width: 20px; height: 20px; }
.u-note textarea { min-height: 60px; padding: 10px 12px; resize: vertical; }
.u-other { display: grid; gap: 10px; padding: 16px 18px; }
.u-other-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.u-other-head > div { display: grid; gap: 2px; }
.u-other-head small { font-size: 0.78rem; color: var(--muted); }
.u-other-head > b { white-space: nowrap; }
.u-other-head > b small { font-weight: 500; color: var(--muted); }

/* quotes */
.u-quote header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 18px; border-bottom: 1px solid var(--paper-line); }
.u-quote header > div:first-child { display: grid; gap: 2px; }
.u-quote header > div:first-child b { font-size: 1.05rem; }
.u-quote header > div:first-child small { font-size: 0.78rem; color: var(--muted); }
.u-quote-total { display: grid; gap: 4px; justify-items: end; }
.u-quote-total .u-chip { font-size: 0.8rem; padding: 3px 10px; }
.u-quote-total small { font-size: 0.78rem; color: var(--muted); }
.u-quote-actions { display: flex; gap: 14px; }
.u-hl { display: grid; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--paper-line); background: #fffaf0; }
.u-hl li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.92rem; font-weight: 600; }
.u-hl li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 0.6em; border-radius: 50%; background: currentColor; }
.u-hl .lv-high { color: #a1271d; }
.u-hl .lv-above { color: #8a5a00; }
.u-hl .lv-below { color: #24508f; }
.u-hl .lv-low { color: #5b3aa6; }
.u-table-wrap { overflow-x: auto; }
.u-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.u-table th { padding: 9px 18px; text-align: start; font-size: 0.72rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--paper-line); white-space: nowrap; }
.u-table td { padding: 9px 18px; border-bottom: 1px solid rgba(226, 219, 200, 0.6); }
.u-table tr:last-child td { border-bottom: 0; }
.u-table .num { text-align: end; font-variant-numeric: tabular-nums lining-nums; }
.u-sheet > .u-hint { padding: 12px 18px 14px; font-size: 0.8rem; color: var(--muted); }
.u-qform { display: grid; gap: 14px; padding: 18px; }
.u-qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.u-qgrid label { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.u-qgrid label small { font-size: 0.72rem; }
.u-qform fieldset { margin: 0; padding: 0; border: 0; }
.u-qform legend { margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; }
.u-qtrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.u-qtrades label { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--paper-line); }
.u-qtrades label > span { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 600; }
.u-qtrades label > span small { margin-inline-start: auto; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.u-qtrades .u-ico { width: 28px; height: 28px; border-radius: 9px; }
.u-qtrades .u-ico svg { width: 15px; height: 15px; }
.u-qform .num { text-align: end; }

/* shopping */
.u-week header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--cream); border-bottom: 1px solid var(--paper-line); }
.u-week header > div:first-child { display: grid; gap: 2px; }
.u-week header > div:first-child b { font-size: 1rem; }
.u-week header > div:first-child small { font-size: 0.78rem; color: var(--muted); }
.u-week-total { display: grid; justify-items: end; }
.u-week-total small { font-size: 0.72rem; color: var(--muted); }
.u-week-total b { font-size: 1.02rem; }
.u-week-total b small { font-weight: 500; }
.u-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid rgba(226, 219, 200, 0.6); }
.u-items li:last-child { border-bottom: 0; }
.u-items li.k-mortar { background: #fcfaf4; }
.u-items .u-ico { width: 30px; height: 30px; border-radius: 9px; }
.u-items .u-ico svg { width: 15px; height: 15px; }
.u-item-name { display: grid; min-width: 0; line-height: 1.4; }
.u-item-name b { font-size: 0.88rem; font-weight: 500; }
.u-item-name small { font-size: 0.74rem; color: var(--muted); }
.u-item-qty { display: grid; justify-items: end; font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.u-item-qty small { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.u-tag { padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.u-tag.k-material { background: #e3edff; color: #24508f; }
.u-tag.k-supply_install { background: #fff1d6; color: #8a5a00; }
.u-tag.k-mortar { background: var(--cream-2); color: var(--ink-2); }
.u-item-budget { min-width: 6.5em; text-align: end; font-size: 0.88rem; font-weight: 700; }
.u-sum { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 16px 18px; background: var(--navy-900); color: var(--on-navy); }
.u-sum b { font-size: 1.2rem; color: var(--gold-300); }
.u-sum b small { font-weight: 500; color: var(--on-navy-muted); font-size: 0.8rem; }
.u-sum .wide { width: 100%; font-size: 0.8rem; color: var(--on-navy-muted); }

/* payments */
.u-ms-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 16px 18px; background: var(--cream); border-bottom: 1px solid var(--paper-line); }
.u-ms-head > div { display: grid; }
.u-ms-head > div span { font-size: 0.76rem; color: var(--muted); }
.u-ms-head > div b { font-size: 1.2rem; }
.u-ms-head > div b small { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.u-switch { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; cursor: pointer; }
.u-switch input { width: 18px; height: 18px; accent-color: var(--gold-500); }
.u-ms-list { margin: 0; padding: 0; list-style: none; }
.u-ms { display: grid; grid-template-columns: 26px minmax(0, 1fr) 6.2em 7em 10.5em; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(226, 219, 200, 0.6); }
.u-ms.next { background: #fffaf0; }
.u-ms.paid { background: #f3fbf6; }
.u-ms-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cdbf9c; display: grid; place-items: center; color: #fff; }
.u-ms.paid .u-ms-dot { background: #2f8f5b; border-color: #2f8f5b; }
.u-ms.next .u-ms-dot { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(232, 181, 71, 0.2); }
.u-ms-dot svg { width: 14px; height: 14px; }
.u-ms-name { display: grid; min-width: 0; line-height: 1.45; }
.u-ms-name b { font-size: 0.94rem; }
.u-ms-name small { font-size: 0.76rem; color: var(--muted); }
.u-ms-pct { display: inline-flex; align-items: center; gap: 4px; font-size: 0.86rem; color: var(--muted); }
.u-ms-pct input { width: 4.4em; min-height: 36px; padding: 0 8px; text-align: center; }
.u-ms-amount { min-width: 6.5em; text-align: end; font-size: 0.98rem; }
.u-ms-paid { display: inline-flex; align-items: center; justify-content: center; justify-self: end; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink-2); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.u-ms-paid:hover { border-color: #2f8f5b; color: #1d6b43; }
.u-ms-paid.on { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.u-ms-paid svg { width: 13px; height: 13px; }
.u-ms-sheet > .u-err { padding: 10px 18px 0; }
.u-ms-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 14px 18px; font-size: 0.86rem; color: var(--ink-2); }
.u-ms-foot b { color: var(--ink); }

@media (max-width: 760px) {
  .u-trade > summary { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; }
  .u-trade-chips { display: none; }
  .u-money { grid-column: 2; }
  .u-seg { grid-column: 1 / -1; justify-self: start; }
  .u-chev { grid-row: 1; grid-column: 3; }
  .u-trade-body { grid-template-columns: 1fr; }
  .u-items li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .u-tag { display: none; }
  .u-item-budget { grid-column: 2 / -1; text-align: start; min-width: 0; }
  .u-ms { grid-template-columns: auto minmax(0, 1fr) auto; }
  .u-ms-pct { grid-column: 2; }
  .u-ms-paid { grid-column: 2 / -1; justify-self: start; }
  .u-total { justify-items: start; text-align: start; }
  .u-head-actions { justify-content: flex-start; }
}

/* ---------------------------------------------------------------- units list (dashboard) */
.u-units { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.u-unit-card { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(246, 241, 228, 0.04); transition: border-color 0.2s, transform 0.25s var(--ease-out); }
.u-unit-card:hover { border-color: rgba(232, 181, 71, 0.45); transform: translateY(-2px); }
.u-unit-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.u-unit-top > div { display: grid; gap: 2px; min-width: 0; }
.u-unit-top b { font-size: 1.05rem; color: var(--on-navy); overflow-wrap: anywhere; }
.u-unit-top small { font-size: 0.78rem; color: var(--on-navy-muted); }
.u-unit-total { text-align: end; white-space: nowrap; color: var(--gold-300); font-weight: 700; }
.u-unit-total small { display: block; font-size: 0.7rem; font-weight: 500; color: var(--on-navy-faint); }
.u-unit-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.78rem; color: var(--on-navy-muted); }
.u-unit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.u-unit-actions .btn { min-height: 40px; padding: 0 14px; font-size: 0.84rem; }

/* ---------------------------------------------------------------- printed shopping list / payment schedule */
#uPrint { display: none; }
@media print {
  html.tb-print-doc, html.tb-print-doc body { background: #fff !important; color: #101728 !important; padding: 0 !important; margin: 0 !important; min-height: 0; }
  html.tb-print-doc body > *:not(#uPrint) { display: none !important; }
  html.tb-print-doc #uPrint { display: block; }
  #uPrint { font-family: var(--font-body); font-size: 9.5pt; line-height: 1.5; color: #101728; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #uPrint .pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 2px solid #061534; }
  #uPrint .pd-brand { display: flex; align-items: center; gap: 10px; flex: none; }
  #uPrint .pd-brand img { width: 40px; height: 40px; border-radius: 10px; }
  #uPrint .pd-brand b { display: block; font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.2; }
  #uPrint[dir="ltr"] .pd-brand b, #uPrint[dir="ltr"] .pd-meta h1 { font-family: var(--font-body); }
  #uPrint .pd-brand small { display: block; font-size: 8pt; color: #5f6879; direction: ltr; }
  #uPrint .pd-meta { text-align: end; }
  #uPrint .pd-meta h1 { font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.3; }
  #uPrint .pd-meta p { font-size: 9pt; color: #3c465a; }
  #uPrint .pd-muted { color: #7c8496 !important; font-size: 8pt !important; }
  #uPrint h2 { margin: 14px 0 6px; font-size: 11pt; color: #061534; break-after: avoid; }
  #uPrint h2 small { font-weight: 400; font-size: 8.5pt; color: #5f6879; }
  #uPrint table { width: 100%; border-collapse: collapse; }
  #uPrint th { padding: 5px 8px; text-align: start; font-size: 7.5pt; font-weight: 600; color: #fff; background: #0b2454; }
  #uPrint td { padding: 5px 8px; vertical-align: top; border-bottom: 1px solid #e2dbc8; }
  #uPrint td small { display: block; font-size: 7.5pt; color: #7c8496; }
  #uPrint .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #uPrint tr { break-inside: avoid; }
  #uPrint tfoot th { background: #f6f1e4; color: #061534; font-size: 9pt; }
  #uPrint .pd-note { margin-top: 10px; font-size: 8pt; color: #5f6879; }
}

/* ================================================================ Contractor plan (js/contractor.js, unit.js quote tab) */

/* ---- letterhead on printed documents (BOQ, shopping list, payments, quotation) and its preview ---- */
.lh-own { display: flex; align-items: center; gap: 12px; max-width: 68%; }
.lh-part { white-space: nowrap; unicode-bidi: isolate; }
.lh-own .lh-logo { width: auto !important; height: auto !important; max-width: 150px; max-height: 58px; border-radius: 0 !important; object-fit: contain; flex: none; }
.lh-own .lh-mono { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--lh, #061534); color: #fff; font-weight: 800; font-size: 20px; }
.lh-own > div { display: grid; gap: 1px; min-width: 0; }
.lh-own b { color: var(--lh, #061534) !important; overflow-wrap: anywhere; }
#boqPrint .lh-own small, #uPrint .lh-own small, .cw-paper .lh-own small { direction: inherit; unicode-bidi: plaintext; font-size: 8pt; color: #5f6879; }
#boqPrint.lh-doc .bp-head, #uPrint.lh-doc .pd-head { border-bottom-color: var(--lh, #061534); }
#boqPrint.lh-doc .bp-meta h1, #uPrint.lh-doc .pd-meta h1 { color: var(--lh, #061534); }
#boqPrint.lh-doc .bp-table thead th, #uPrint.lh-doc th { background: var(--lh, #0b2454); }
#boqPrint.lh-doc .bp-trade th, #uPrint.lh-doc tfoot th { background: #f6f1e4; }
.lh-note { font-size: 8.5pt; color: #3c465a; white-space: pre-line; }
.lh-powered { font-size: 7pt; color: #9aa1b0; }
#uPrint .pd-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid #e2dbc8; display: grid; gap: 3px; break-inside: avoid; }

/* ---- the quotation document (#uPrint.is-quote) ---- */
@media print {
  #uPrint .qd-parties { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; margin: 12px 0 14px; }
  #uPrint .qd-parties > div { display: grid; gap: 1px; align-content: start; padding: 9px 12px; border-radius: 8px; background: #f6f1e4; border: 1px solid #e2dbc8; }
  #uPrint .qd-parties span { font-size: 7.5pt; color: #5f6879; }
  #uPrint .qd-parties b { font-size: 10pt; color: #101728; }
  #uPrint .qd-parties small { font-size: 8pt; color: #3c465a; unicode-bidi: plaintext; }
  #uPrint .qd-dates span { display: flex; justify-content: space-between; gap: 12px; font-size: 8pt; }
  #uPrint .qd-dates b { font-size: 8.5pt; }
  #uPrint .qd-table th { background: var(--lh, #0b2454); }
  #uPrint .qd-table .qd-trade th { padding-top: 8px; font-size: 9.5pt; font-weight: 700; color: #061534; background: #f6f1e4; }
  #uPrint .qd-n { width: 28px; color: #7c8496; }
  #uPrint .qd-totals th, #uPrint .qd-totals td { padding: 6px 8px; font-size: 9.5pt; font-weight: 600; text-align: start; color: #101728; background: transparent; border-bottom: 1px solid #e2dbc8; }
  #uPrint .qd-totals td { text-align: end; }
  #uPrint .qd-totals tr:first-child th, #uPrint .qd-totals tr:first-child td { border-top: 2px solid var(--lh, #061534); }
  #uPrint .qd-total th, #uPrint .qd-total td { font-size: 12pt !important; font-weight: 800 !important; color: #061534 !important; background: #f6f1e4 !important; }
  #uPrint .qd-block { margin-top: 14px; break-inside: avoid; }
  #uPrint .qd-block h2 { margin: 0 0 6px; }
  #uPrint .qd-text { font-size: 9pt; color: #3c465a; white-space: pre-line; }
  #uPrint .qd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 26px; break-inside: avoid; }
  #uPrint .qd-sign div { display: grid; gap: 4px; }
  #uPrint .qd-sign span { font-size: 9pt; font-weight: 600; color: #061534; }
  #uPrint .qd-sign i { display: block; height: 34px; border-bottom: 1px solid #9aa1b0; }
  #uPrint .qd-sign small { font-size: 7.5pt; color: #7c8496; }
}

/* ---- dashboard: Contractor workspace ---- */
.cw { display: grid; gap: 1rem; }
.cw:empty { display: none; }
.cw .section-title .pill { margin-inline-end: auto; }
.cw-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cw .panel { gap: 1.1rem; }
.cw-head { display: flex; align-items: flex-start; gap: 12px; }
.cw-head > div { flex: 1; min-width: 0; }
.cw-head h3 { font-size: 1.1rem; color: var(--ink); }
.cw-head p { font-size: 0.84rem; color: var(--muted); }
.cw-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--gold-ink); }
.cw-ico svg { width: 20px; height: 20px; }
.cw-add { min-height: 40px; padding: 0 14px; font-size: 0.84rem; flex: none; }
.cw-add svg { width: 16px; height: 16px; }
.cw-logo { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--cream); border: 1px dashed #cdbf9c; }
.cw-logo-box { flex: none; width: 96px; height: 64px; border-radius: 10px; background: #fff; border: 1px solid var(--paper-line); display: grid; place-items: center; overflow: hidden; color: #b49a62; }
.cw-logo-box img { max-width: 88px; max-height: 56px; object-fit: contain; }
.cw-logo-box svg { width: 24px; height: 24px; }
.cw-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cw-logo-actions .btn { min-height: 38px; padding: 0 14px; font-size: 0.82rem; cursor: pointer; }
.cw-logo-actions small { flex-basis: 100%; font-size: 0.76rem; color: var(--muted); }
.cw-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.cw-form .wide, .cw-field.wide { grid-column: 1 / -1; }
.cw-field { display: grid; gap: 5px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.cw-field .text-input { min-height: 44px; font-size: 0.92rem; }
.cw-field textarea.text-input { padding: 10px 12px; min-height: 64px; resize: vertical; }
.cw-color input { width: 64px; height: 44px; padding: 4px; border-radius: 12px; border: 1px solid var(--paper-line); background: #fff; cursor: pointer; }
.cw-preview { display: grid; gap: 6px; }
.cw-preview-label { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.cw-paper { padding: 18px 20px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--paper-line); box-shadow: 0 18px 40px -30px rgba(6, 21, 52, 0.6); color: #101728; display: grid; gap: 8px; }
.cw-paper .qd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--lh, #061534); }
.cw-paper .qd-brand { display: flex; align-items: center; gap: 10px; }
.cw-paper .qd-brand img { width: 40px; height: 40px; border-radius: 10px; }
.cw-paper .qd-brand b { display: block; font-size: 1rem; color: #061534; line-height: 1.25; }
.cw-paper .qd-brand small { display: block; font-size: 0.72rem; color: #5f6879; }
.cw-paper .qd-meta { text-align: end; }
.cw-paper .qd-meta h1 { font-size: 1rem; color: var(--lh, #061534); }
.cw-paper .qd-meta p { font-size: 0.74rem; color: #5f6879; direction: ltr; }
.cw-paper .lh-note { font-size: 0.76rem; }
.cw-paper .lh-powered { font-size: 0.66rem; }
.cw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cw-status { font-size: 0.84rem; font-weight: 600; }
.cw-status.ok { color: #1d6b43; }
.cw-status.err { color: #a1271d; }
.cw-search { min-height: 44px !important; font-size: 0.92rem !important; }
.cw-list { display: grid; gap: 8px; }
.cw-client { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av main count" "av actions actions"; gap: 6px 12px; align-items: center; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--paper-line); }
.cw-avatar, .qo-avatar { grid-area: av; align-self: start; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-800); color: var(--gold-300); font-weight: 700; }
.cw-client-main { grid-area: main; display: grid; gap: 1px; min-width: 0; }
.cw-client-main b { overflow-wrap: anywhere; }
.cw-client-main small { font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.cw-count { grid-area: count; font-size: 0.74rem; font-weight: 600; color: #9a6f14; background: #fff4dc; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cw-client-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cw-client-actions .btn { min-height: 34px; padding: 0 12px; font-size: 0.78rem; margin-inline-end: auto; }
.cw-client-actions .btn svg { width: 14px; height: 14px; }
.cw-client-actions .icon-btn { color: var(--ink-2); border-color: var(--paper-line); }
.cw-client-form { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--cream); border: 1px solid #e6d8b4; }
.cw-err { font-size: 0.82rem; color: #a1271d; }
.cw-empty { display: grid; gap: 4px; padding: 22px 16px; text-align: center; border-radius: 14px; border: 1px dashed var(--paper-line); }
.cw-empty p { font-size: 0.84rem; color: var(--muted); }
.cw-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--r-lg); border: 1px solid rgba(232, 181, 71, 0.4); background: radial-gradient(120% 140% at 100% 0%, rgba(232, 181, 71, 0.16), transparent 55%), rgba(246, 241, 228, 0.04); }
.cw-teaser > div { flex: 1 1 26rem; display: grid; gap: 0.4rem; }
.cw-teaser h2 { font-size: 1.3rem; color: var(--on-navy); }
.cw-teaser p { color: var(--on-navy-muted); font-size: 0.92rem; max-width: 46rem; }
#premiumCard.is-contractor { border-color: rgba(232, 181, 71, 0.7); background: radial-gradient(130% 120% at 0% 0%, rgba(232, 181, 71, 0.26), transparent 60%), linear-gradient(160deg, rgba(11, 36, 84, 0.6), rgba(246, 241, 228, 0.03)); }

/* ---- dashboard units: client tags and filter ---- */
.u-unit-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.u-unit-client, .u-unit-quote { font-size: 0.7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.u-unit-client { color: var(--gold-ink); background: var(--gold-300); }
.u-unit-quote { color: var(--on-navy); border: 1px solid var(--line-strong); direction: ltr; }
.u-filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.u-fchip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--on-navy-muted); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.u-fchip:hover { color: var(--on-navy); border-color: rgba(232, 181, 71, 0.5); }
.u-fchip.on { color: var(--gold-ink); background: var(--gold-400); border-color: var(--gold-400); }
.u-usage { grid-column: 1 / -1; font-size: 0.8rem; color: var(--on-navy-faint); }
.cu-limit a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- unit page: the client quotation tab ---- */
.u-tab-pro { font-style: normal; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 6px; background: rgba(232, 181, 71, 0.2); color: var(--gold-300); }
.u-tab.on .u-tab-pro { background: rgba(59, 42, 5, 0.15); color: var(--gold-ink); }
.qo-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.qo-main { display: grid; gap: 16px; }
.qo-side { display: grid; gap: 14px; position: sticky; top: 88px; }
.qo-client, .qo-form { display: grid; gap: 12px; padding: 18px; }
.qo-client h3, .qo-form h3, .qo-table h3 { font-size: 1rem; }
.qo-client-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qo-client > select { min-height: 46px; font-size: 0.95rem; }
.qo-client-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--cream); }
.qo-client-card > div { display: grid; gap: 1px; min-width: 0; }
.qo-client-card small { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.qo-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 12px; background: var(--cream); }
.qo-quick .u-err { grid-column: 1 / -1; }
.u-field { display: grid; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.u-field .text-input { min-height: 44px; font-size: 0.92rem; }
.u-field textarea.text-input { padding: 10px 12px; resize: vertical; line-height: 1.6; }
.qo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.qo-fields .wide { grid-column: 1 / -1; }
.qo-fields .u-hint { font-size: 0.78rem; color: var(--muted); margin-top: -4px; }
.qo-markup { position: relative; display: block; }
.qo-markup b { position: absolute; inset-block: 0; inset-inline-end: 14px; display: grid; place-items: center; color: var(--muted); font-weight: 600; pointer-events: none; }
.qo-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--cream-2); justify-self: start; }
.qo-seg-opt { position: relative; cursor: pointer; }
.qo-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.qo-seg-opt span { display: block; padding: 8px 14px; border-radius: 9px; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.qo-seg-opt input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -3px rgba(6, 21, 52, 0.35); }
.qo-seg-opt input:focus-visible + span { outline: 2px solid var(--gold-500); outline-offset: 1px; }
.qo-kpis { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; }
.qo-kpis > div { display: grid; gap: 2px; align-content: start; padding: 14px; border-radius: 16px; background: rgba(246, 241, 228, 0.05); border: 1px solid var(--line); }
.qo-kpis span { font-size: 0.74rem; color: var(--on-navy-muted); }
.qo-kpis b { font-size: 1.15rem; color: var(--on-navy); }
.qo-kpis small { font-size: 0.72rem; font-weight: 500; color: var(--on-navy-faint); }
.qo-kpis .qo-price { background: linear-gradient(160deg, rgba(232, 181, 71, 0.25), rgba(232, 181, 71, 0.06)); border-color: rgba(232, 181, 71, 0.55); }
.qo-kpis .qo-price b { color: var(--gold-300); font-size: 1.35rem; }
.qo-kpis .good b { color: #7ee2a8; }
.qo-kpis .bad b { color: #ff9f94; }
.qo-table { padding: 16px 0 6px; }
.qo-table h3 { padding: 0 18px 8px; }
.qo-table table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.qo-table th, .qo-table td { padding: 8px 18px; text-align: start; border-top: 1px solid var(--paper-line); }
.qo-table thead th { font-size: 0.72rem; font-weight: 600; color: var(--muted); border-top: 0; }
.qo-table td:first-child { display: flex; align-items: center; gap: 10px; }
.qo-table .u-ico { width: 28px; height: 28px; border-radius: 9px; }
.qo-table .u-ico svg { width: 15px; height: 15px; }
.qo-table .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qo-table td.num:last-child { font-weight: 700; color: var(--ink); }
.qo-table td.num:nth-child(2) { color: var(--muted); }
.qo-table tfoot th { padding-block: 12px; font-size: 0.92rem; background: var(--cream); }

@media (max-width: 980px) {
  .cw-grid, .qo-grid { grid-template-columns: 1fr; }
  .qo-side { position: static; }
}
@media (max-width: 560px) {
  .cw-form, .qo-fields, .qo-quick { grid-template-columns: 1fr; }
  .qo-kpis { grid-template-columns: 1fr 1fr; }
  .qo-kpis .qo-price { grid-column: 1 / -1; order: -1; }
  .cw-logo { flex-wrap: wrap; }
  .cw-head { flex-wrap: wrap; }
  .qo-table th, .qo-table td { padding-inline: 12px; }
}

/* ---------------------------------------------------------------- Remodel renders linked to a unit (js/unit.js, shopping tab) */
.u-rm header { align-items: center; }
.u-rm-thumb { flex: none; width: 64px; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: var(--cream-2); }
.u-rm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u-rm header small a { color: #9a6f14; font-weight: 600; }
.u-rm-empty { margin: 0; padding: 12px 18px 16px; color: var(--muted); font-size: 0.85rem; }
.u-rm header > a + div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.u-rm header > a + div b { font-size: 1rem; }
.u-rm header > a + div small { color: var(--muted); font-size: 0.78rem; }
