/* USFP quote tool - every rule scoped to .usfp-quote (the tool sits inside usfencepro.com pages).
   USFP quote page. Tokens follow ~/usfp-store-project/brand/tokens.css (no blue in the brand). */
:root {
  --red: #bf1414; --red-dark: #9a0f0f; --red-tint: #ff8f8f;
  --ink: #1a1a1a; --body: #4a4f55; --muted: #6b7077;
  --line: #e2e4e6; --bg: #f5f6f6; --card: #ffffff;
  --ok: #1e7a3c; --warn: #7a4e00; --warn-bg: #fff4d6; --err: #9a0f0f; --err-bg: #fdecec;
  --head: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --radius: 4px;
  --panel-w: 420px;
}
.usfp-quote, .usfp-quote * { box-sizing: border-box; }
.usfp-quote { margin: 0; }
.usfp-quote { font: 15px/1.6 var(--font); color: var(--body); background: var(--bg); }
.usfp-quote button, .usfp-quote input, .usfp-quote select, .usfp-quote textarea { font: inherit; }
.usfp-quote [hidden] { display: none !important; }

.usfp-quote .topbar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: #fff;
  border-bottom: 4px solid var(--red); }
.usfp-quote .brand { display: flex; line-height: 0; }
.usfp-quote .brand img { height: 46px; width: auto; }
.usfp-quote .tag { font: 700 14px/1.2 var(--head); color: var(--ink); text-transform: uppercase; letter-spacing: .05em;
  padding-left: 16px; border-left: 1px solid var(--line); }
.usfp-quote .top-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.usfp-quote .top-links .shop { color: var(--ink); font-weight: 600; text-decoration: none; }
.usfp-quote .top-links .shop:hover { color: var(--red); }
.usfp-quote .phone { background: var(--red); color: #fff; font-weight: 700; text-decoration: none; padding: 8px 14px;
  border-radius: var(--radius); white-space: nowrap; }
.usfp-quote .phone:hover { background: var(--red-dark); }
.usfp-quote .panel-foot { padding: 16px 20px; font-size: 12px; color: var(--muted); }
.usfp-quote .panel-foot a { color: var(--muted); }
.usfp-quote .banner { padding: 6px 16px; font-size: 13px; background: #e9eaeb; color: var(--ink); }
.usfp-quote .banner.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }

.usfp-quote .layout { display: grid; grid-template-columns: 1fr var(--panel-w); height: calc(100vh - 141px); min-height: 560px; } /* below the shared 141px site header */
.usfp-quote .map-wrap { position: relative; min-height: 0; min-width: 0; }
.usfp-quote #map { position: absolute; inset: 0; background: #2a2d30; }
.usfp-quote .panel { min-width: 0; background: var(--card); border-left: 1px solid var(--line); overflow-y: auto; }

.usfp-quote .map-tools { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; flex-wrap: wrap;
  gap: 6px; align-items: center; pointer-events: none; }
.usfp-quote .map-tools > * { pointer-events: auto; }
.usfp-quote .map-tools .sep { width: 8px; }
.usfp-quote .tool { border: 0; border-radius: var(--radius); padding: 9px 14px; min-height: 40px; background: #fff; color: var(--ink);
  font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.usfp-quote .tool:hover { background: #f1f1f1; }
.usfp-quote .tool.primary, .usfp-quote .tool[aria-pressed="true"] { background: var(--red); color: #fff; }
.usfp-quote .tool.primary:hover, .usfp-quote .tool[aria-pressed="true"]:hover { background: var(--red-dark); }
.usfp-quote .hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500; max-width: calc(100% - 32px);
  background: rgba(26,26,26,.88); color: #fff; padding: 8px 14px; border-radius: var(--radius); font-size: 14px; text-align: center; }
.usfp-quote .hint:empty { display: none; }
.usfp-quote .hint { pointer-events: none; bottom: 8px; font-size: 12px; padding: 5px 10px; }
.usfp-quote .map-nav { position: absolute; bottom: 72px; left: 12px; z-index: 500; display: grid; gap: 6px; }
.usfp-quote .map-nav > div { display: flex; gap: 5px; }
.usfp-quote .map-nav .tool { min-width: 38px; padding: 6px 10px; }

.usfp-quote .steps { list-style: none; margin: 0; padding: 0; }
.usfp-quote .step { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.usfp-quote .step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 700 15px/1.3 var(--head);
  color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
.usfp-quote .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--red);
  color: #fff; font-size: 13px; }
.usfp-quote .muted { color: var(--muted); }
.usfp-quote .small { font-size: 13px; margin: 0 0 8px; }
.usfp-quote .picked { margin: 8px 0 0; font-weight: 600; color: var(--ink); }
.usfp-quote .draft-storage { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.usfp-quote .draft-storage p { margin: 0 0 8px; }
.usfp-quote .draft-storage p:last-child { margin-bottom: 0; }
.usfp-quote .draft-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.usfp-quote .draft-actions button { text-align: left; }

.usfp-quote .address-host gmp-place-autocomplete { display: block; width: 100%; min-width: 0; }
.usfp-quote .dev-search { display: flex; gap: 6px; }
.usfp-quote .dev-search input { flex: 1; min-width: 0; }
.usfp-quote .dev-results { list-style: none; margin: 6px 0 0; padding: 0; }
.usfp-quote .dev-results button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none;
  padding: 8px 4px; cursor: pointer; font-size: 13px; }
.usfp-quote .dev-results button:hover { background: var(--bg); }

.usfp-quote input, .usfp-quote select, .usfp-quote textarea { width: 100%; border: 1px solid #c9ccd0; border-radius: var(--radius); padding: 9px 10px;
  color: var(--ink); background: #fff; }
.usfp-quote input:focus, .usfp-quote select:focus, .usfp-quote textarea:focus, .usfp-quote button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.usfp-quote button.primary, .usfp-quote .dev-search button { border: 0; border-radius: var(--radius); background: var(--red); color: #fff;
  font-weight: 700; padding: 10px 16px; cursor: pointer; letter-spacing: .05em; text-transform: uppercase; font-size: 13px; }
.usfp-quote button.primary:hover, .usfp-quote .dev-search button:hover { background: var(--red-dark); }
.usfp-quote button.primary:disabled { opacity: .6; cursor: wait; }
.usfp-quote .wide { width: 100%; }
.usfp-quote .link { border: 0; background: none; padding: 0; color: var(--red-dark); text-decoration: underline; cursor: pointer; font-size: 13px; }

.usfp-quote .runs { list-style: none; margin: 0; padding: 0; }
.usfp-quote .runs li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.usfp-quote .runs li { flex-wrap: wrap; gap: 6px 12px; }
.usfp-quote .run-actions { display: flex; gap: 12px; }
.usfp-quote .run-editor { width: 100%; font-size: 13px; }
.usfp-quote .run-editor summary { cursor: pointer; color: var(--red-dark); font-weight: 600; }
.usfp-quote .run-editor > p { margin: 8px 0; }
.usfp-quote .segment-editor { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.usfp-quote .segment-editor label { display: grid; gap: 4px; margin: 0; width: 104px; }
.usfp-quote .segment-editor input { padding: 5px; }
.usfp-quote .segment-editor button { min-height: 32px; }
.usfp-quote .hookup-count { padding: 12px; margin: 12px 0; background: #f7f8f9; border: 1px solid var(--line); border-radius: 4px; }
.usfp-quote .hookup-count label { display: block; margin: 0 0 6px; font-weight: 600; }
.usfp-quote .hookup-count input { width: 130px; padding: 8px; }
.usfp-quote .hookup-count p { margin: 8px 0 0; }
.usfp-quote .chainlink-gates { padding: 12px; margin: 12px 0; border: 1px solid var(--line); border-radius: 4px; background: #f7f8f9; }
.usfp-quote .chainlink-gates > label { display: block; margin-bottom: 6px; font-weight: 600; }
.usfp-quote #chainlink-gate-count { width: 130px; padding: 8px; }
.usfp-quote .gate-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.usfp-quote .gate-sizes:empty { display: none; }
.usfp-quote .gate-sizes label { display: grid; gap: 4px; margin: 0; font-size: 12px; }
.usfp-quote .chainlink-gates p { margin: 8px 0 0; }

.usfp-quote .gate-row { display: flex; justify-content: space-between; gap: 8px; }
.usfp-quote .gate-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fafafa; }
.usfp-quote .gate-editor label { min-width: 0; font-size: 12px; margin: 0; }
.usfp-quote .gate-editor label input, .usfp-quote .gate-editor label select { margin-top: 4px; padding: 6px; }
.usfp-quote .gate-editor .run-actions, .usfp-quote .gate-editor p, .usfp-quote .gate-editor label:has(select) { grid-column: 1 / -1; }
.usfp-quote .gate-editor .run-actions { flex-wrap: wrap; }
.usfp-quote .total { margin: 8px 0 4px; font-weight: 700; color: var(--ink); }

.usfp-quote .types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.usfp-quote .type-card { text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.usfp-quote .type-card b { color: var(--ink); font-size: 14px; line-height: 1.3; }
.usfp-quote .type-card span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.usfp-quote .type-card:hover { border-color: #b8bcc0; }
.usfp-quote .type-card[aria-checked="true"] { border: 2px solid var(--red); padding: 9px; background: #fffafa; }
.usfp-quote .field { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.usfp-quote .field > span { display: block; margin-bottom: 4px; }
.usfp-quote .field select, .usfp-quote .field input, .usfp-quote .field textarea { margin-top: 4px; font-weight: 400; }
.usfp-quote .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.usfp-quote .chips button { border: 1px solid #c9ccd0; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--ink); min-height: 36px; }
.usfp-quote .chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.usfp-quote .range { margin: 0; font: 700 30px/1.2 var(--head); color: var(--ink); }
.usfp-quote .qty { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0; font-size: 14px; }
.usfp-quote .qty dt { color: var(--muted); }
.usfp-quote .qty dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.usfp-quote .fine { font-size: 12px; color: var(--muted); line-height: 1.5; }
.usfp-quote .error { background: var(--err-bg); color: var(--err); padding: 8px 10px; border-radius: var(--radius); font-size: 14px; }
.usfp-quote .lead { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.usfp-quote .lead h3, .usfp-quote .done h3 { margin: 0; font: 700 15px/1.3 var(--head); color: var(--ink); text-transform: uppercase; }
.usfp-quote .lead button[type=submit] { margin-top: 14px; }
.usfp-quote .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.usfp-quote .done { margin-top: 16px; padding: 14px; background: #eef7f1; border-left: 4px solid var(--ok); }
.usfp-quote .done p { margin: 6px 0 0; }

/* Map overlays. Google anchors marker content at bottom-center; Leaflet divIcons at top-left. */
.usfp-quote .mk-vertex { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--red);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4); transform: translateY(50%); cursor: grab; }
.usfp-quote .mk-vertex.first { width: 22px; height: 22px; background: var(--red); border-color: #fff; }
.usfp-quote .mk-label { font: 700 12px/1 var(--font); color: #fff; background: rgba(26,26,26,.85); padding: 3px 6px; border-radius: 3px;
  white-space: nowrap; transform: translateY(-14px); pointer-events: none; }
.usfp-quote .mk-gate { font: 700 11px/1 var(--font); color: var(--ink); background: #ffd23f; border: 2px solid var(--ink); padding: 4px 7px;
  border-radius: 3px; white-space: nowrap; transform: translateY(50%); cursor: pointer; }
.usfp-quote .mk-gate.double { background: #ffa53f; }
.usfp-quote .mk-pin { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transform: translateY(50%); }
.usfp-quote .leaflet.mk-vertex, .usfp-quote .leaflet.mk-gate, .usfp-quote .leaflet.mk-pin { transform: translate(-50%, -50%); }
.usfp-quote .leaflet.mk-label { transform: translate(-50%, calc(-100% - 14px)); }

/* USFP's five post shapes, with point IDs shared by map, sections and reports. */
.usfp-quote .post-inline { display: inline-flex; align-items: center; gap: 4px; }
.usfp-quote .post-inline svg { width: 20px; height: 20px; flex: 0 0 20px; }
.usfp-quote .post-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; margin: 8px 0; }
.usfp-quote .post-help { margin: 8px 0; }
.usfp-quote .section-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 14px; }
.usfp-quote .post-choice { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; }
.usfp-quote .post-choice select { width: 100%; min-width: 0; font-size: 13px; padding: 7px; }
.usfp-quote .mk-vertex.mk-post { position: relative; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 4px; border-width: 2px; background: #fff; color: #1a1a1a; }
.usfp-quote .mk-post svg { display: block; width: 22px; height: 22px; }
.usfp-quote .mk-post .post-point-id { position: absolute; top: 28px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #111; border-radius: 3px; padding: 1px 4px; font: bold 11px/1.3 Arial,sans-serif; box-shadow: 0 0 2px #444; }
.usfp-quote .mk-post.sel { border-color: #ffd23f; box-shadow: 0 0 0 2px #1a1a1a; }
.usfp-quote .mk-post.first { border-color: #ffd23f; }
.usfp-quote .post-report { margin-top: 14px; }
.usfp-quote .post-report h3 { font-size: 14px; margin: 0 0 6px; }
.usfp-quote .post-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.usfp-quote .post-table th, .usfp-quote .post-table td { padding: 5px; border-bottom: 1px solid #ddd; text-align: left; }
.usfp-quote .post-table tr { break-inside: avoid; }

@media (max-width: 860px) {
  .usfp-quote .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh auto; height: auto; min-height: 0; }
  .usfp-quote { height: auto; }
  .usfp-quote .panel { border-left: 0; overflow: visible; }
  .usfp-quote .tag, .usfp-quote .top-links .shop { display: none; }
  .usfp-quote .brand img { height: 38px; }
  .usfp-quote .phone { padding: 6px 10px; font-size: 14px; }
  .usfp-quote .types { grid-template-columns: 1fr 1fr; }
  .usfp-quote .tool { padding: 8px 10px; font-size: 14px; }
}

.usfp-quote .staff-list { padding: 20px; overflow-x: auto; }
.usfp-quote .staff-list h2 { font: 700 18px var(--head); color: var(--ink); text-transform: uppercase; }
.usfp-quote .staff-list table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
.usfp-quote .staff-list th, .usfp-quote .staff-list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.usfp-quote .staff-list a { color: var(--red-dark); }
.usfp-quote .step a { color: var(--red-dark); }

.usfp-quote .tool.danger { background: var(--err-bg); color: var(--err); }
.usfp-quote .mk-vertex.mid { width: 14px; height: 14px; border: 2px solid var(--red); background: rgba(255,255,255,.85);
  box-shadow: none; opacity: .9; }
.usfp-quote .mk-vertex.mid::after { content: "+"; display: block; font: 700 12px/10px var(--font); color: var(--red); text-align: center; }
.usfp-quote .mk-vertex.sel { background: var(--ink); border-color: #ffd23f; width: 22px; height: 22px; }
.usfp-quote .check { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--ink); cursor: pointer; }
.usfp-quote .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.usfp-quote .check.muted { color: var(--muted); cursor: default; }
.usfp-quote .notes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.usfp-quote .notes:empty { display: none; }

@media print {
  @page { margin: 12mm; }
  .usfp-quote { display: block; background: #fff; height: auto; }
  .usfp-quote .banner, .usfp-quote .map-tools, .usfp-quote .hint, .usfp-quote .noprint, .usfp-quote #lead-form, .usfp-quote #step-address h2 + div, .usfp-quote .panel-foot, .usfp-quote .top-links .shop, .usfp-quote .leaflet-control-container, .usfp-quote .gmnoprint, .usfp-quote #runs .link, .usfp-quote #btn-clear, .usfp-quote #types, .usfp-quote .chips button[aria-pressed="false"], .usfp-quote #step-draw > p.small, .usfp-quote .hp, .usfp-quote .mk-vertex.mid { display: none !important; }
  .usfp-quote .layout { display: block; }
  .usfp-quote .map-wrap { height: 110mm; break-inside: avoid; }
  .usfp-quote .panel { border: 0; overflow: visible; }
  .usfp-quote .step { padding: 8px 0; break-inside: avoid; }
  .usfp-quote .chips button { border: 0; padding: 0; background: none !important; color: var(--ink) !important; }
  .usfp-quote .phone { background: none; color: var(--ink); padding: 0; }
}

/* The print preview is attached directly to body, outside the main site's layout. */
#usfp-print-dialog { width: min(860px, 100%); max-width: 100%; max-height: 96vh; padding: 0; border: 0;
  margin: auto; color: #222; background: #fff; box-shadow: 0 8px 50px #0006; overflow: auto; }
#usfp-print-dialog::backdrop { background: #0009; }
#usfp-print-dialog .report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px;
  background: #f0f1f2; border-bottom: 1px solid #ddd; font-size: 12px; }
#usfp-print-dialog .report-actions span { flex: 1 1 200px; }
#usfp-print-dialog .fence-report { width: 190mm; max-width: calc(100% - 32px); margin: 18px auto; padding: 0;
  background: #fff; color: #222; font: 12px/1.4 Arial, sans-serif; }
#usfp-print-dialog .report-header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 3px solid #bf1414; }
#usfp-print-dialog .report-header strong { color: #bf1414; font-size: 22px; letter-spacing: .04em; }
#usfp-print-dialog h1 { margin: 4px 0 0; color: #222; font: bold 16px/1.3 Arial, sans-serif; }
#usfp-print-dialog .report-header > div:last-child { text-align: right; font-size: 11px; }
#usfp-print-dialog .report-address { padding: 10px 0; }
#usfp-print-dialog .report-map { position: relative; height: 330px; break-inside: avoid; background: #eee; }
#usfp-print-dialog #map { position: absolute; inset: 0; pointer-events: none; }
#usfp-print-dialog .gmnoprint { display: none !important; }
#usfp-print-dialog .report-caption { margin: 5px 0 10px; font-size: 10px; color: #555; }
#usfp-print-dialog .report-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 0 0 12px; }
#usfp-print-dialog .report-options > div { break-inside: avoid; }
#usfp-print-dialog dt { margin: 0; font-size: 10px; color: #555; }
#usfp-print-dialog dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
#usfp-print-dialog .report-lines { width: 100%; border-collapse: collapse; font-size: 11px; margin: 0; }
#usfp-print-dialog .report-lines th, #usfp-print-dialog .report-lines td { padding: 5px 6px; border-bottom: 1px solid #ddd; text-align: left; }
#usfp-print-dialog .report-lines tr { break-inside: avoid; }
#usfp-print-dialog .report-lines th { background: #f2f2f2; }
#usfp-print-dialog .report-notes { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
#usfp-print-dialog .report-contact { margin: 8px 0; overflow-wrap: anywhere; }
#usfp-print-dialog .report-terms { margin-top: 12px; padding-top: 8px; border-top: 1px solid #aaa; font-size: 10px; break-inside: avoid; }
#usfp-print-dialog .report-terms b { display: block; margin-bottom: 3px; }
#usfp-print-dialog .mk-vertex, #usfp-print-dialog .mk-pin { display: none !important; }
#usfp-print-dialog .mk-vertex.mk-post { display: grid !important; }
#usfp-print-dialog .post-report p { font-size: 10px; margin: 5px 0; }
#usfp-print-dialog .post-report h3 { break-after: avoid; }
@media print {
  @page { size: auto; margin: 10mm; }
  html.usfp-printing { background: #fff !important; height: auto !important; }
  body.usfp-printing { margin: 0 !important; padding: 0 !important; background: #fff !important; height: auto !important; overflow: visible !important; }
  body.usfp-printing > :not(#usfp-print-dialog) { display: none !important; }
  body.usfp-printing #usfp-print-dialog { display: block !important; position: static !important; inset: auto !important;
    width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; overflow: visible !important; box-shadow: none !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #usfp-print-dialog::backdrop, #usfp-print-dialog .report-actions { display: none !important; }
  #usfp-print-dialog .fence-report { max-width: 100%; margin: 0 auto; padding: 0 !important; }
  #usfp-print-dialog .report-map { height: 86mm; }
  #usfp-print-dialog .gmnoprint, #usfp-print-dialog .leaflet-control-container { display: none !important; }
  #usfp-print-dialog a[href]::after { content: none !important; }
}
