/* Free HVAC Report Maker: the form (screen) and the report (print).
   Colours inside the report come from PDFStyle.swift via report-templates.js. */

.rm { max-width: 920px; margin: 0 auto; display: grid; gap: 22px; }
.rm-form { display: grid; gap: 22px; }
.rm-card {
  background: #fff; border-radius: var(--tool-radius, 22px); padding: 24px 26px; margin: 0;
  border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 30px 70px rgba(2, 8, 23, .12); min-width: 0;
}
.rm-card legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 20px; font-weight: 900; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.rm-card legend + * { clear: both; }
.rm-step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 15px; }
.rm-hint { margin: 0 0 14px; font-size: 14px; color: var(--tool-sub, #475569); }
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.rm-field { display: grid; gap: 6px; font-size: 14px; font-weight: 800; color: #1e293b; min-width: 0; }
.rm-wide { grid-column: 1 / -1; }
.rm-field input, .rm-field select, .rm-field textarea, .rm-control select, .rm-control input[type="text"], .rm-num input, .rm-lead input[type="email"] {
  width: 100%; min-height: 46px; border: 1.5px solid #cbd5e1; border-radius: 12px; padding: 8px 12px;
  background: #f8fafc; color: #0f172a; font: inherit; font-size: 16px; font-weight: 600; box-sizing: border-box;
}
.rm-field textarea { min-height: 0; resize: vertical; }
.rm-field input:focus, .rm-field select:focus, .rm-field textarea:focus, .rm-control select:focus, .rm-control input:focus, .rm-lead input:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); background: #fff;
}
.rm-logo input[type="file"] { min-height: 0; padding: 8px; font-size: 14px; }
.rm-logo img { max-height: 60px; max-width: 200px; object-fit: contain; }

.rm-sec { border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.rm-sec summary { cursor: pointer; padding: 14px 16px; font-weight: 900; font-size: 16px; color: #0f172a; background: #f8fafc; display: flex; justify-content: space-between; gap: 12px; }
.rm-count { font-weight: 700; color: var(--tool-sub, #475569); font-size: 14px; }
.rm-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; align-items: center; padding: 10px 16px; border-top: 1px solid #f1f5f9; }
.rm-label { font-size: 15px; font-weight: 700; color: #1e293b; }
.rm-label small { display: block; font-size: 13px; font-weight: 600; color: var(--tool-sub, #475569); margin-top: 2px; }
.rm-tag { display: inline-block; font-size: 12px; font-weight: 800; color: #b91c1c; background: #fee2e2; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.rm-num { display: flex; align-items: center; gap: 8px; }
.rm-num input { max-width: 160px; }
.rm-unit { font-size: 14px; font-weight: 800; color: #2563eb; }
.rm-seg { display: inline-flex; border: 1.5px solid #cbd5e1; border-radius: 12px; overflow: hidden; }
.rm-seg label { position: relative; }
.rm-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rm-seg span { display: block; padding: 10px 16px; font-size: 15px; font-weight: 800; color: #334155; background: #f8fafc; }
.rm-seg label + label span { border-left: 1.5px solid #cbd5e1; }
.rm-seg input:checked + span { background: #2563eb; color: #fff; }
.rm-seg input[value="fail"]:checked + span { background: #c62828; }
.rm-seg input[value="pass"]:checked + span { background: #2e7d32; }
.rm-seg input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .4); outline-offset: -3px; }
.rm-auto { display: inline-block; font-size: 15px; font-weight: 800; color: #64748b; padding: 10px 12px; border-radius: 10px; background: #f1f5f9; }
.rm-auto.is-pass { color: #1b5e20; background: #e8f5e9; }
.rm-auto.is-fail { color: #b71c1c; background: #ffebee; }
.rm-auto.is-error { color: #92400e; background: #fef3c7; font-weight: 700; font-size: 14px; }
.rm-muted { font-size: 14px; color: #64748b; font-weight: 600; }

.rm-finding { border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.rm-finding .rm-link { margin-top: 8px; }
.rm .btn-secondary, .rm-add { color: #1d4ed8; background: #eff6ff; border: 1.5px solid #bfdbfe; box-shadow: none; min-height: 46px; }
.rm-link { background: none; border: 0; padding: 0; color: #2563eb; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; text-decoration: underline; }
.rm-app-only { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.rm-app-only div { border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: 12px 14px; font-size: 14px; color: #475569; }
.rm-app-only b { display: block; color: #0f172a; font-size: 15px; }

.rm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.rm-check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 700; color: #334155; }
.rm-check input { width: 18px; height: 18px; margin-top: 1px; }

.rm-done { background: #fff; border-radius: var(--tool-radius, 22px); padding: 26px; border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 30px 70px rgba(2, 8, 23, .12); }
.rm-done h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.rm-done h3 { font-size: 18px; line-height: 1.3; }
.rm-next { margin-top: 18px; padding: 20px; border-radius: 16px; background: #0f172a; color: #e2e8f0; }
.rm-next h3 { color: #fff; margin: 0 0 8px; }
.rm-next ul { margin: 0 0 16px; padding-left: 20px; }
.rm-next .fine { margin: 8px 0 0; font-size: 13px; color: #94a3b8; }
.rm-lead { margin-top: 18px; display: grid; gap: 10px; }
.rm-lead h3 { margin: 0; }
.rm-lead-row { display: flex; gap: 10px; }
.rm-lead-row input { flex: 1; }
.rm-lead-msg { margin: 0; font-size: 14px; font-weight: 700; color: #1d4ed8; min-height: 1em; }
.rm-lead .fine { margin: 0; font-size: 13px; color: #64748b; }
.rm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 640px) {
  .rm-card { padding: 18px 16px; }
  .rm-grid, .rm-app-only { grid-template-columns: 1fr; }
  .rm-item { grid-template-columns: 1fr; gap: 8px; }
  .rm-lead-row { flex-direction: column; }
}

/* ------------------------------------------------------------ the report (print only) */

.rmr { display: none; }
@media print {
  @page { size: letter; margin: 0.55in 0.55in 0.7in; }
  html.rm-print body > *:not(.rmr) { display: none !important; }
  /* !important + higher specificity: tools.css hides every body child but .tool-report in print. */
  html.rm-print body > .rmr { display: block !important; }
  html.rm-print body { background: #fff; margin: 0; }
}
.rmr { font-family: Inter, -apple-system, "Helvetica Neue", Arial, sans-serif; color: #111; font-size: 10.5pt; line-height: 1.35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rmr-foot { margin-top: 28px; padding-top: 8px; border-top: 1px solid #ddd; text-align: center; font-size: 8.5pt; color: #777; break-inside: avoid; }
.rmr-foot a { color: #555; }
.rmr-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid; padding-bottom: 12px; margin-bottom: 14px; }
.rmr-logo { max-height: 64px; max-width: 170px; object-fit: contain; }
.rmr-co { flex: 1; font-size: 9.5pt; color: #444; }
.rmr-co-name { font-size: 16pt; font-weight: 800; }
.rmr-title { text-align: right; font-size: 9.5pt; color: #444; }
.rmr-title div:first-child { font-size: 15pt; font-weight: 800; }
.rmr-info { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 10px; }
.rmr-info h3 { margin: 0 0 4px; font-size: 9pt; text-transform: uppercase; letter-spacing: .06em; color: #666; }
.rmr-info p { margin: 0; }
.rmr-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0 14px; border-bottom: 1px solid #ddd; margin-bottom: 6px; font-weight: 700; }
.rmr-condition { color: #fff; border-radius: 6px; padding: 4px 10px; }
.rmr-fail-text { color: #c62828; }
.rmr-sec { margin-top: 14px; }
.rmr-sec h2 { font-size: 12pt; margin: 0 0 6px; color: #1a2b4a; break-after: avoid; }
.rmr table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rmr th:nth-child(1) { width: 44%; } .rmr th:nth-child(2) { width: 24%; } .rmr th:nth-child(4) { width: 52px; }
.rmr td { overflow-wrap: anywhere; }
.rmr th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .05em; color: #666; border-bottom: 1px solid #ccc; padding: 4px 6px; }
.rmr td { border-bottom: 1px solid #eee; padding: 5px 6px; vertical-align: top; }
.rmr tr { break-inside: avoid; }
.rmr-val { font-weight: 700; }
.rmr-target { color: #555; font-size: 9pt; }
.rmr-dot { width: 52px; text-align: right; font-weight: 800; font-size: 9pt; }
/* Spanish status words ("Aprobado") are longer than "Pass". */
html[lang="es"] .rmr th:nth-child(4), html[lang="es"] .rmr-dot { width: 78px; }
.rmr-pass { color: #2e7d32; }
.rmr-fail td { background: rgba(198, 40, 40, .08); }
.rmr-fail .rmr-fail, .rmr .rmr-dot .rmr-fail { color: #c62828; }
.rmr-muted { color: #999; font-weight: 600; }
.rmr-finding { border-left: 4px solid; padding: 6px 10px; margin-bottom: 8px; background: #fafafa; break-inside: avoid; }
.rmr-finding-head { display: flex; align-items: center; gap: 8px; }
.rmr-finding p { margin: 4px 0 0; }
.rmr-urgency { color: #fff; font-size: 8pt; font-weight: 800; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; }
.rmr-cost { margin-left: auto; font-weight: 700; }
.rmr-notes { white-space: pre-wrap; margin: 0; }
.rmr-sign { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 24px; margin-top: 36px; break-inside: avoid; font-size: 9pt; color: #555; }
.rmr-sign span { display: block; border-bottom: 1px solid #333; height: 34px; margin-bottom: 4px; }
