/*!
 * IR.Tools Patch Pricing - calculator styles.
 * Every rule is scoped to .irtpp. Element selectors use .irtpp.irtpp so Divi and
 * WooCommerce content rules (e.g. ".entry-content tr td", ".et_pb_text ul") do not leak in.
 * Colors follow the IR.Tools palette (olive #91993e, brown #453636); text pairs meet WCAG 2.1 AA.
 */
.irtpp {
	--irtpp-ink: #2f2525;
	--irtpp-brown: #453636;
	--irtpp-muted: #5f5654;
	--irtpp-line: #d6d7c8;
	--irtpp-panel: #f4f5ee;
	--irtpp-field: #ffffff;
	--irtpp-olive: #91993e;
	--irtpp-olive-deep: #5c6520;
	--irtpp-warn: #8a3b0d;
	--irtpp-warn-bg: #fbeee2;
	--irtpp-error: #b00020;
	--irtpp-grid: #e3e5d6;
	--irtpp-display: 'Abel', 'Arial Narrow', Arial, sans-serif;
	--irtpp-body: 'Open Sans', Arial, Helvetica, sans-serif;
	box-sizing: border-box;
	color: var(--irtpp-ink);
	font-family: var(--irtpp-body);
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
	max-width: 1180px;
	margin: 0 auto;
	/* Layout responds to the width of the column it sits in (Divi row, sidebar, full width), not only the viewport */
	container-type: inline-size;
	container-name: irtpp;
}
.irtpp *, .irtpp *::before, .irtpp *::after { box-sizing: inherit; }
.irtpp [hidden] { display: none !important; }

/* Resets for theme rules that target bare elements inside page content */
.irtpp.irtpp p { margin: 0; padding: 0; }
.irtpp.irtpp ul { margin: 0; padding: 0; list-style: none; }
.irtpp.irtpp li { margin: 0; padding: 0; list-style: none; }
.irtpp.irtpp li::before { content: none; }
.irtpp.irtpp h2, .irtpp.irtpp h3, .irtpp.irtpp h4, .irtpp.irtpp h5 {
	font-family: var(--irtpp-display); font-weight: 400; line-height: 1.15; margin: 0; padding: 0;
	color: var(--irtpp-brown); text-transform: none; letter-spacing: .01em;
}
.irtpp.irtpp fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.irtpp.irtpp legend { padding: 0; margin: 0; border: 0; }
.irtpp.irtpp table.irtpp-table { border: 0; border-collapse: collapse; width: 100%; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.irtpp.irtpp th, .irtpp.irtpp td {
	border: 0; border-bottom: 1px solid var(--irtpp-line); padding: 7px 8px; text-align: right;
	white-space: nowrap; vertical-align: middle; font-size: inherit; color: inherit; background: none;
}
.irtpp.irtpp thead th { font-weight: 600; color: var(--irtpp-muted); font-size: 13px; }
.irtpp.irtpp tbody th { font-weight: 400; }
.irtpp.irtpp th:first-child, .irtpp.irtpp td:first-child { text-align: left; padding-left: 0; }
.irtpp.irtpp input, .irtpp.irtpp select, .irtpp.irtpp button, .irtpp.irtpp textarea { font-family: inherit; font-size: 15px; color: var(--irtpp-ink); margin: 0; }
.irtpp.irtpp svg { max-width: 100%; }

.irtpp :focus-visible { outline: 3px solid var(--irtpp-olive-deep); outline-offset: 2px; }

.irtpp-sr {
	position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
	overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* Intro */
.irtpp .irtpp-intro { margin-bottom: 26px; max-width: 66ch; }
.irtpp.irtpp .irtpp-title { font-size: 36px; }
.irtpp.irtpp .irtpp-intro p { margin-top: 8px; color: var(--irtpp-muted); }
.irtpp.irtpp .irtpp-noscript { padding: 14px 16px; background: var(--irtpp-panel); border-left: 3px solid var(--irtpp-olive); }

/* Layout */
.irtpp .irtpp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: start; }
@media (max-width: 980px) {
	.irtpp .irtpp-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.irtpp.irtpp .irtpp-title { font-size: 30px; }
}

.irtpp.irtpp .irtpp-section { border-top: 1px solid var(--irtpp-line); padding: 20px 0 24px; }
.irtpp.irtpp .irtpp-section:first-child { border-top: 0; padding-top: 0; }
.irtpp.irtpp .irtpp-legend { font-family: var(--irtpp-display); font-size: 24px; color: var(--irtpp-brown); float: left; width: 100%; margin-bottom: 14px; line-height: 1.2; }
.irtpp .irtpp-legend + * { clear: both; }
.irtpp .irtpp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.irtpp .irtpp-row.irtpp-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) {
	.irtpp .irtpp-row, .irtpp .irtpp-row.irtpp-two { grid-template-columns: minmax(0, 1fr); }
}
.irtpp.irtpp .irtpp-stack > * + * { margin-top: 16px; }

.irtpp.irtpp .irtpp-field label, .irtpp.irtpp .irtpp-lab {
	display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: var(--irtpp-ink); float: none; width: auto;
}
.irtpp.irtpp .irtpp-unitlabel { font-weight: 400; color: var(--irtpp-muted); }
.irtpp.irtpp .irtpp-field input[type=number],
.irtpp.irtpp .irtpp-field input[type=text],
.irtpp.irtpp .irtpp-field select {
	display: block; width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid #8a8478; border-radius: 4px;
	background: var(--irtpp-field); box-shadow: none; line-height: 1.3; font-size: 16px; height: auto;
}
.irtpp.irtpp .irtpp-field input[aria-invalid=true] { border-color: var(--irtpp-error); box-shadow: inset 0 0 0 1px var(--irtpp-error); }
.irtpp .irtpp-unit { position: relative; }
.irtpp.irtpp .irtpp-unit input { padding-right: 36px; }
.irtpp .irtpp-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--irtpp-muted); font-size: 14px; pointer-events: none; }
.irtpp.irtpp .irtpp-error { color: var(--irtpp-error); font-size: 13.5px; font-weight: 600; margin-top: 5px; }
.irtpp.irtpp .irtpp-error:empty { display: none; }
.irtpp.irtpp .irtpp-hint { color: var(--irtpp-muted); font-size: 13.5px; margin-top: 6px; }
.irtpp.irtpp .irtpp-hint-top { margin: 0 0 6px; }
.irtpp.irtpp .irtpp-sizeline { margin-top: 12px; font-size: 14px; }
.irtpp.irtpp .irtpp-sizeline b { font-family: var(--irtpp-display); font-weight: 400; font-size: 19px; color: var(--irtpp-olive-deep); margin-right: 6px; }

/* Segmented choices (native radios, visually replaced) */
.irtpp .irtpp-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.irtpp.irtpp .irtpp-choice label { position: relative; cursor: pointer; margin: 0; }
.irtpp.irtpp .irtpp-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.irtpp.irtpp .irtpp-choice span {
	display: block; min-height: 44px; padding: 10px 16px; border: 1px solid #8a8478; border-radius: 4px;
	background: var(--irtpp-field); font-weight: 600; font-size: 14px; line-height: 1.6;
}
.irtpp.irtpp .irtpp-choice input:checked + span { border-color: var(--irtpp-olive-deep); box-shadow: inset 0 0 0 2px var(--irtpp-olive-deep); color: var(--irtpp-olive-deep); background: #f6f7ec; }
.irtpp.irtpp .irtpp-choice input:checked + span::before { content: "\2713\00a0"; }
.irtpp.irtpp .irtpp-choice input:focus-visible + span { outline: 3px solid var(--irtpp-olive-deep); outline-offset: 2px; }

/* Options checklist */
.irtpp.irtpp .irtpp-opts li { border-bottom: 1px solid var(--irtpp-line); }
.irtpp.irtpp .irtpp-opts li:last-child { border-bottom: 0; }
.irtpp.irtpp .irtpp-opts label { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 2px; cursor: pointer; font-weight: 400; margin: 0; }
.irtpp.irtpp .irtpp-opts input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--irtpp-olive-deep); flex: none; margin: 0; }
.irtpp.irtpp .irtpp-opts input:disabled + .irtpp-optlabel { color: var(--irtpp-muted); }
.irtpp .irtpp-pct { margin-left: auto; color: var(--irtpp-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.irtpp.irtpp .irtpp-sub { margin: 0 0 12px 32px; }

/* Result panel */
.irtpp .irtpp-result { position: sticky; top: 24px; background: var(--irtpp-panel); border-radius: 6px; padding: 22px; min-width: 0; }
@media (max-width: 980px) { .irtpp .irtpp-result { position: static; } }
.irtpp .irtpp-preview { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--irtpp-line); border-radius: 4px; }
.irtpp .irtpp-preview .irtpp-grid line { stroke: var(--irtpp-grid); stroke-width: 1; }
.irtpp .irtpp-preview .irtpp-patch { fill: var(--irtpp-olive); fill-opacity: .82; stroke: var(--irtpp-olive-deep); stroke-width: 1.5; }
.irtpp .irtpp-preview .irtpp-patch.is-blank { fill-opacity: .28; }
.irtpp .irtpp-preview .irtpp-flip { fill: none; stroke: var(--irtpp-olive-deep); stroke-width: 1.5; stroke-dasharray: 5 4; }
.irtpp .irtpp-preview .irtpp-stitch { fill: none; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 4 3; }
.irtpp .irtpp-preview text { font-family: var(--irtpp-display); font-size: 15px; fill: var(--irtpp-ink); }
.irtpp .irtpp-preview-cap { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--irtpp-muted); margin: 6px 0 18px; }
.irtpp.irtpp .irtpp-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.irtpp.irtpp .irtpp-price strong { font-family: var(--irtpp-display); font-weight: 400; font-size: 56px; line-height: 1; color: var(--irtpp-brown); }
.irtpp.irtpp .irtpp-price span { color: var(--irtpp-muted); }
.irtpp.irtpp .irtpp-forwho { font-size: 13.5px; color: var(--irtpp-muted); margin-top: 4px; }
.irtpp.irtpp .irtpp-sums { margin: 16px 0 0; padding: 0; border-top: 1px solid var(--irtpp-line); }
.irtpp .irtpp-sums div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--irtpp-line); font-variant-numeric: tabular-nums; }
.irtpp.irtpp .irtpp-sums dt, .irtpp.irtpp .irtpp-sums dd { margin: 0; padding: 0; float: none; }
.irtpp.irtpp .irtpp-sums dd { font-weight: 600; }
.irtpp.irtpp .irtpp-sums .irtpp-tot dt, .irtpp.irtpp .irtpp-sums .irtpp-tot dd { font-weight: 700; font-size: 16px; }
.irtpp.irtpp .irtpp-nudge { margin-top: 12px; font-size: 14px; }
.irtpp.irtpp .irtpp-nudge button { background: none; border: 0; padding: 0; color: var(--irtpp-olive-deep); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: 14px; min-height: 24px; }
.irtpp.irtpp .irtpp-warns { margin-top: 14px; }
.irtpp.irtpp .irtpp-warns li { background: var(--irtpp-warn-bg); color: var(--irtpp-warn); border-left: 3px solid var(--irtpp-warn); padding: 8px 12px; font-size: 13.5px; margin-top: 6px; border-radius: 0 4px 4px 0; }
.irtpp.irtpp .irtpp-h { font-size: 21px; margin: 24px 0 8px; }
.irtpp .irtpp-scroll { overflow-x: auto; }
.irtpp.irtpp tr.is-on th, .irtpp.irtpp tr.is-on td { font-weight: 700; color: var(--irtpp-olive-deep); }
.irtpp.irtpp .irtpp-name { font-family: var(--irtpp-display); font-size: 19px; line-height: 1.3; background: #fff; border: 1px solid var(--irtpp-line); border-radius: 4px; padding: 10px 12px; overflow-wrap: anywhere; }
.irtpp .irtpp-namebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 13.5px; color: var(--irtpp-muted); flex-wrap: wrap; }
.irtpp .irtpp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.irtpp.irtpp .irtpp-empty { color: var(--irtpp-muted); padding: 24px 0; text-align: center; }
.irtpp.irtpp .irtpp-toast { min-height: 1.4em; font-size: 13.5px; color: var(--irtpp-olive-deep); margin-top: 10px; font-weight: 600; }

/* Buttons: own classes so Divi's .et_pb_button styles never apply */
.irtpp.irtpp .irtpp-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
	border: 2px solid var(--irtpp-brown); background: var(--irtpp-brown); color: #fff; padding: 9px 18px; border-radius: 3px;
	font-family: var(--irtpp-display); font-size: 16px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase;
	text-decoration: none; line-height: 1.2; cursor: pointer; box-shadow: none;
}
.irtpp.irtpp .irtpp-btn:hover { background: #2f2525; border-color: #2f2525; color: #fff; }
.irtpp.irtpp .irtpp-btn::after { content: none; display: none; }
.irtpp.irtpp .irtpp-btn.irtpp-ghost { background: #fff; color: var(--irtpp-brown); }
.irtpp.irtpp .irtpp-btn.irtpp-ghost:hover { background: var(--irtpp-panel); }
.irtpp.irtpp .irtpp-btn.irtpp-small { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.irtpp.irtpp .irtpp-btn.irtpp-link { background: none; border: 0; color: var(--irtpp-muted); text-decoration: underline; padding: 0 4px; min-height: 24px; font-family: var(--irtpp-body); font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.irtpp.irtpp .irtpp-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Quote */
.irtpp .irtpp-quote { margin-top: 44px; border-top: 4px solid var(--irtpp-olive); padding-top: 22px; }
.irtpp.irtpp .irtpp-qtitle { font-size: 30px; margin-bottom: 8px; }
.irtpp.irtpp .irtpp-qtable tbody th { white-space: normal; min-width: 240px; font-weight: 600; }
.irtpp.irtpp .irtpp-qtable tfoot th, .irtpp.irtpp .irtpp-qtable tfoot td { border-bottom: 0; font-weight: 700; font-size: 15px; }
.irtpp.irtpp .irtpp-copybox { display: block; width: 100%; min-height: 120px; margin-top: 10px; padding: 10px; border: 1px solid var(--irtpp-line); border-radius: 4px; background: #fff; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) {
	/* Stack quote rows as cards on phones so nothing scrolls sideways */
	.irtpp.irtpp .irtpp-qtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
	.irtpp.irtpp .irtpp-qtable tr { display: block; border-bottom: 1px solid var(--irtpp-line); padding: 8px 0; }
	.irtpp.irtpp .irtpp-qtable th, .irtpp.irtpp .irtpp-qtable td { display: flex; justify-content: space-between; border: 0; padding: 3px 0; white-space: normal; min-width: 0; text-align: right; }
	.irtpp.irtpp .irtpp-qtable tbody th { display: block; text-align: left; }
	.irtpp.irtpp .irtpp-qtable td[data-label]::before { content: attr(data-label); color: var(--irtpp-muted); font-weight: 400; text-align: left; }
	.irtpp.irtpp .irtpp-qtable tfoot td:empty, .irtpp.irtpp .irtpp-qtable tbody td:last-child { justify-content: flex-end; }
	.irtpp.irtpp .irtpp-qtable tfoot tr { display: flex; justify-content: space-between; }
	.irtpp.irtpp .irtpp-qtable tfoot th, .irtpp.irtpp .irtpp-qtable tfoot td { display: block; }
	.irtpp.irtpp .irtpp-price strong { font-size: 46px; }
	.irtpp .irtpp-result { padding: 16px; }
}

/* Container queries: same breakpoints as above, measured against the calculator's own width */
@container irtpp (max-width: 820px) {
	.irtpp-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
	.irtpp-result { position: static !important; }
	.irtpp-title.irtpp-title { font-size: 30px; }
}
@container irtpp (max-width: 520px) {
	.irtpp-row, .irtpp-row.irtpp-two { grid-template-columns: minmax(0, 1fr) !important; }
	.irtpp-result { padding: 16px !important; }
}
@container irtpp (max-width: 600px) {
	.irtpp-qtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
	.irtpp-qtable tr { display: block; border-bottom: 1px solid var(--irtpp-line); padding: 8px 0; }
	.irtpp-qtable.irtpp-qtable th, .irtpp-qtable.irtpp-qtable td { display: flex; justify-content: space-between; border: 0; padding: 3px 0; white-space: normal; min-width: 0; text-align: right; }
	.irtpp-qtable.irtpp-qtable tbody th { display: block; text-align: left; }
	.irtpp-qtable.irtpp-qtable td[data-label]::before { content: attr(data-label); color: var(--irtpp-muted); font-weight: 400; text-align: left; }
	.irtpp-qtable.irtpp-qtable tbody td:last-child { justify-content: flex-end; }
	.irtpp-qtable.irtpp-qtable tfoot tr { display: flex; justify-content: space-between; }
	.irtpp-qtable.irtpp-qtable tfoot th, .irtpp-qtable.irtpp-qtable tfoot td { display: block; }
}

.irtpp.irtpp .irtpp-note { font-size: 13.5px; color: var(--irtpp-muted); margin-top: 36px; max-width: 75ch; }

@media print {
	.irtpp .irtpp-layout { display: block; }
	.irtpp .irtpp-btn, .irtpp .irtpp-nudge { display: none !important; }
}
