/* Handyman Estimator — styles scoped under .hm-est-wrap so they don't
   collide with the host WordPress theme. Ported from the original file. */
.hm-est-wrap{
  --navy:#1F3864; --blue:#2E75B6; --headfill:#D5E8F0; --callfill:#F2F6FA;
  --green:#3C8C3C; --greenf:#EAF4EA; --amber:#E0A100; --amberf:#FFF6E6;
  --grey:#555; --line:#D9DEE6; --bg:#F4F6F9; --card:#FFFFFF; --ink:#1A1A1A;
  max-width:900px; margin:0 auto; padding:24px 18px 60px;
  background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; line-height:1.5;
  border-radius:14px;
}
.hm-est-wrap *{ box-sizing:border-box; }
.hm-est-wrap header.hd{ border-bottom:3px solid var(--blue); padding-bottom:10px; margin-bottom:14px; }
.hm-est-wrap .brand{ font-weight:700; letter-spacing:3px; color:var(--navy); font-size:18px; }
.hm-est-wrap .sub{ color:var(--grey); font-size:13px; margin-top:2px; }
.hm-est-wrap .tabs{ display:flex; gap:8px; margin:16px 0 18px; }
.hm-est-wrap .tab{ border:1px solid var(--line); background:#fff; color:var(--navy); border-radius:9px 9px 0 0;
  padding:10px 18px; font-size:14px; cursor:pointer; font-weight:600; border-bottom:3px solid transparent; font-family:inherit; }
.hm-est-wrap .tab.on{ background:var(--navy); color:#fff; border-color:var(--navy); }
.hm-est-wrap h1{ font-size:24px; color:#000; margin:4px 0 2px; }
.hm-est-wrap .tagline{ color:var(--navy); font-style:italic; font-size:15px; margin-bottom:16px; }
.hm-est-wrap .grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media(max-width:780px){ .hm-est-wrap .grid{ grid-template-columns:1fr; } }
.hm-est-wrap .card{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:18px 20px; margin-bottom:18px; }
.hm-est-wrap .card h2{ font-size:15px; color:var(--navy); margin:0 0 14px; }
.hm-est-wrap .presets{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.hm-est-wrap .preset{ border:1px solid var(--line); background:#fff; color:var(--navy); border-radius:8px; padding:7px 12px; font-size:13px; cursor:pointer; font-weight:600; font-family:inherit; }
.hm-est-wrap .preset:hover{ background:var(--callfill); border-color:var(--blue); }
.hm-est-wrap .preset.active{ background:var(--navy); color:#fff; border-color:var(--navy); }
.hm-est-wrap .row{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.hm-est-wrap .row label{ font-size:13px; color:var(--grey); width:130px; flex-shrink:0; }
.hm-est-wrap .row input[type=range]{ flex:1; accent-color:var(--blue); }
.hm-est-wrap .row .num{ width:84px; flex-shrink:0; }
.hm-est-wrap input,.hm-est-wrap select,.hm-est-wrap textarea{ font-family:inherit; }
.hm-est-wrap input[type=number],.hm-est-wrap input[type=text],.hm-est-wrap input[type=date],.hm-est-wrap input[type=tel],.hm-est-wrap input[type=email],.hm-est-wrap select,.hm-est-wrap textarea{
  border:1px solid var(--line); border-radius:8px; padding:8px 9px; font-size:14px; width:100%; background:#fff; }
.hm-est-wrap input:focus,.hm-est-wrap select:focus,.hm-est-wrap textarea:focus{ outline:2px solid var(--blue); outline-offset:-1px; border-color:var(--blue); }
.hm-est-wrap textarea{ min-height:64px; resize:vertical; }
.hm-est-wrap .fld{ margin-bottom:13px; } .hm-est-wrap .fld label{ display:block; font-size:12.5px; color:var(--grey); margin-bottom:4px; }
.hm-est-wrap .two{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.hm-est-wrap .toggle{ display:flex; gap:8px; margin:6px 0 2px; }
.hm-est-wrap .toggle button{ flex:1; border:1px solid var(--line); background:#fff; border-radius:8px; padding:9px 8px; font-size:12.5px; cursor:pointer; color:var(--grey); font-family:inherit; }
.hm-est-wrap .toggle button.on{ background:var(--navy); color:#fff; border-color:var(--navy); font-weight:600; }
.hm-est-wrap .quotes{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; }
.hm-est-wrap .qbox{ background:var(--callfill); border-radius:10px; padding:14px 16px; }
.hm-est-wrap .qbox .lbl{ font-size:12.5px; color:var(--grey); margin-bottom:3px; }
.hm-est-wrap .qbox .val{ font-size:28px; font-weight:700; color:var(--navy); }
.hm-est-wrap .qbox.big{ background:var(--navy); } .hm-est-wrap .qbox.big .lbl{ color:#cdd8ea; } .hm-est-wrap .qbox.big .val{ color:#fff; }
.hm-est-wrap table.bd{ width:100%; border-collapse:collapse; font-size:13.5px; }
.hm-est-wrap table.bd td{ padding:6px 0; } .hm-est-wrap table.bd td:last-child{ text-align:right; font-variant-numeric:tabular-nums; }
.hm-est-wrap table.bd tr.tot td{ border-top:1px solid var(--line); font-weight:700; padding-top:9px; }
.hm-est-wrap table.bd tr.fee td{ color:var(--blue); font-weight:700; }
.hm-est-wrap .note{ font-size:12.5px; color:var(--grey); margin-top:12px; line-height:1.55; background:var(--greenf); border-left:4px solid var(--green); padding:9px 12px; border-radius:0 6px 6px 0; }
.hm-est-wrap .note.warn{ background:var(--amberf); border-left-color:var(--amber); }
.hm-est-wrap .actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.hm-est-wrap .actions button{ border:1px solid var(--line); background:#fff; color:var(--navy); border-radius:8px; padding:10px 16px; font-size:13.5px; cursor:pointer; font-weight:600; font-family:inherit; }
.hm-est-wrap .actions button:hover{ background:var(--callfill); border-color:var(--blue); }
.hm-est-wrap .actions button.primary{ background:var(--blue); color:#fff; border-color:var(--blue); }
.hm-est-wrap .msg{ font-size:12.5px; color:var(--green); margin-top:8px; min-height:16px; }
.hm-est-wrap .quotetext{ background:#fff; border:1px dashed var(--line); border-radius:8px; padding:12px 14px; font-size:13.5px; margin-top:12px; white-space:pre-wrap; }
.hm-est-wrap .photos{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.hm-est-wrap .slot{ border:1px dashed var(--line); border-radius:10px; padding:10px; text-align:center; background:#fafbfc; }
.hm-est-wrap .slot .cap{ font-size:12px; color:var(--grey); margin-bottom:6px; font-weight:600; }
.hm-est-wrap .slot img{ display:none; max-width:100%; border-radius:6px; margin-top:8px; }
.hm-est-wrap .slot input[type=file]{ font-size:12px; }
.hm-est-wrap .hm-foot{ font-size:11.5px; color:var(--grey); margin-top:26px; line-height:1.6; border-top:1px solid var(--line); padding-top:14px; }
.hm-est-wrap .mini{ font-size:11px; color:var(--grey); margin-top:3px; }
.hm-est-wrap .pill{ display:inline-block; font-size:11px; background:var(--headfill); color:var(--navy); padding:2px 8px; border-radius:10px; font-weight:600; }

/* invoice region hidden on screen; shown only when printing this instance */
.hm-est-wrap .hm-invoice{ display:none; }
.hm-est-wrap .inv{ max-width:760px; margin:0 auto; color:#000; }
.hm-est-wrap .inv .ihead{ display:flex; justify-content:space-between; border-bottom:3px solid var(--blue); padding-bottom:12px; margin-bottom:18px; }
.hm-est-wrap .inv h2{ font-size:22px; margin:0; color:#000; } .hm-est-wrap .inv .biz{ text-align:right; font-size:12.5px; color:#333; }
.hm-est-wrap .inv .meta{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:18px; }
.hm-est-wrap .inv table{ width:100%; border-collapse:collapse; font-size:14px; margin-bottom:14px; }
.hm-est-wrap .inv th{ text-align:left; border-bottom:2px solid var(--line); padding:8px 6px; color:var(--navy); font-size:13px; }
.hm-est-wrap .inv td{ padding:8px 6px; } .hm-est-wrap .inv td:last-child{ text-align:right; }
.hm-est-wrap .inv tr.totrow td{ border-top:2px solid var(--line); font-weight:700; font-size:16px; }
.hm-est-wrap .inv .terms{ font-size:12.5px; color:#555; margin-top:18px; line-height:1.6; }

/* ---------- print: show only the active instance's chosen region ---------- */
@media print {
  body.hm-printing > *:not(.hm-print-host){ }
  body.hm-printing .hm-est-wrap:not(.hm-print-active){ display:none !important; }
  /* hide page chrome by hiding everything, then revealing the active instance */
  body.hm-printing *{ visibility:hidden !important; }
  body.hm-printing .hm-est-wrap.hm-print-active,
  body.hm-printing .hm-est-wrap.hm-print-active *{ visibility:visible !important; }
  body.hm-printing .hm-est-wrap.hm-print-active{ position:absolute; left:0; top:0; width:100%; background:#fff; padding:0; }

  /* invoice mode: show only invoice region */
  body.hm-print-invoice .hm-est-wrap.hm-print-active .tabs,
  body.hm-print-invoice .hm-est-wrap.hm-print-active .hm-view,
  body.hm-print-invoice .hm-est-wrap.hm-print-active header.hd,
  body.hm-print-invoice .hm-est-wrap.hm-print-active .hm-foot{ display:none !important; }
  body.hm-print-invoice .hm-est-wrap.hm-print-active .hm-invoice{ display:block !important; }

  /* quote mode: same region as invoice */
  body.hm-print-quote .hm-est-wrap.hm-print-active .tabs,
  body.hm-print-quote .hm-est-wrap.hm-print-active .hm-view,
  body.hm-print-quote .hm-est-wrap.hm-print-active header.hd,
  body.hm-print-quote .hm-est-wrap.hm-print-active .hm-foot{ display:none !important; }
  body.hm-print-quote .hm-est-wrap.hm-print-active .hm-invoice{ display:block !important; }

  /* job sheet mode: hide estimator tab view + invoice, keep job view */
  body.hm-print-jobsheet .hm-est-wrap.hm-print-active .hm-view[data-view="est"],
  body.hm-print-jobsheet .hm-est-wrap.hm-print-active .tabs,
  body.hm-print-jobsheet .hm-est-wrap.hm-print-active .hm-invoice{ display:none !important; }
}

/* ====================================================================
 * Optional inline link to the operator's CostEm materials workbench
 * (per-tenant _hm_costem_url, v1.1.0). Cosmetic one-way navigation
 * link only — no data bridge. Hidden entirely when the tenant has
 * no URL set. Two contexts:
 *  - Estimator tab: own row beneath the Materials/parts row, padded
 *    in to align with the input column (label is 130px + 12px gap).
 *  - Job sheet/invoice tab: inline inside the Materials .fld, on a
 *    new line under the input via display:block + margin-top.
 * ==================================================================== */
.hm-est-wrap .hm-costem-link-row{ margin: -8px 0 14px 142px; }
.hm-est-wrap .hm-costem-link{ font-size:11.5px; color:var(--blue); text-decoration:none; }
.hm-est-wrap .hm-costem-link:hover{ text-decoration:underline; }
.hm-est-wrap .fld .hm-costem-link{ display:inline-block; margin-top:6px; }
@media(max-width:780px){ .hm-est-wrap .hm-costem-link-row{ margin-left:0; } }
