/* /how-we-rate/ and /affiliate-disclosure/ (mu-plugin betadvisor-page-hwr.php). Prefix tr-. */

/* ----- Weight chart: stacked bar plus legend, widths fixed by class ----- */
.tr-weights { margin: 0 0 1.4em; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tr-weights__bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 0 0 12px; }
.tr-weights__bar span { display: grid; place-items: center; color: #fff; font-size: .74rem; font-weight: 800; white-space: nowrap; overflow: hidden; }
.tr-w35 { width: 35%; } .tr-w20 { width: 20%; } .tr-w10 { width: 10%; } .tr-w8 { width: 8%; } .tr-w7 { width: 7%; }
.tr-c1 { background: #0d3b2c; } .tr-c2 { background: #145c43; } .tr-c3 { background: #3f8a5e; }
.tr-c4 { background: #7fb24a; } .tr-c5 { background: #d99a00; } .tr-c6 { background: #b06a1f; }
.tr-weights__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tr-weights__legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-weights__legend li { margin: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; font-size: .9rem; }
.tr-weights__legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; transform: translateY(1px); }
.tr-weights__legend b { font-family: var(--font-head); color: var(--green); }
.tr-weights__legend small { grid-column: 2 / -1; color: var(--ink-soft); font-size: .8rem; line-height: 1.35; }
.tr-weights__note { margin: 10px 0 0; font-size: .78rem; color: var(--ink-soft); }

/* ----- Worked example ----- */
.tr-calc { margin: 0 0 1.4em; border: 2px solid var(--green); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.tr-calc__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--green); color: #fff; }
.tr-calc__head b { font-family: var(--font-head); font-size: 1.05rem; }
.tr-calc__head span { font-size: .8rem; color: #cfe2d8; }
.tr-calc table { width: 100%; border-collapse: collapse; margin: 0; font-size: .9rem; }
.tr-calc th, .tr-calc td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tr-calc td:last-child, .tr-calc th:last-child { text-align: right; white-space: nowrap; }
.tr-calc tr.tr-sum td { font-weight: 800; background: var(--green-soft); color: var(--green); }
.tr-calc tr.tr-ed td { color: var(--ink-soft); font-style: italic; }
.tr-calc tr.tr-total td { font-weight: 800; font-size: 1rem; background: #fff7e3; }
.tr-calc__note { margin: 0; padding: 10px 14px; font-size: .82rem; color: var(--ink-soft); }

/* ----- Boxes, steps, checks ----- */
.tr-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0 0 1.2em; }
@media (min-width: 640px) { .tr-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-box { background: #fbfaf6; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tr-box h3 { margin: 0 0 6px; font-size: 1.02rem; }
.tr-box p { margin: 0 0 .5em; font-size: .94rem; }
.tr-box p:last-child { margin: 0; }
.tr-steps { list-style: none; margin: 0 0 1.2em; padding: 0; display: grid; gap: 10px; counter-reset: trstep; }
.tr-steps > li { margin: 0; position: relative; padding: 12px 14px 12px 54px; background: #fbfaf6; border: 1px solid var(--line); border-radius: var(--radius); counter-increment: trstep; }
.tr-steps > li::before { content: counter(trstep); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--green); font-weight: 800; }
.tr-steps strong { display: block; color: var(--green); }
.tr-flow { list-style: none; margin: 0 0 1.2em; padding: 0; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .tr-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tr-flow li { margin: 0; position: relative; padding: 12px; border-radius: var(--radius-sm); background: var(--green-soft); font-size: .88rem; }
.tr-flow b { display: block; color: var(--green); font-family: var(--font-head); }
.tr-callout { margin: 0 0 1.2em; padding: 12px 14px; border-left: 4px solid var(--lime); border-radius: var(--radius-sm); background: var(--green-soft); }
.tr-callout p { margin: 0; }
.tr-scroll { overflow-x: auto; margin: 0 0 1.2em; }
.tr-scroll table { margin: 0; min-width: 480px; }

/* Worked example on phones: all four columns visible, scroll inside the box if a phone is narrower still. */
.tr-calc__scroll { overflow-x: auto; }
@media (max-width: 520px) {
	.tr-calc table { font-size: .78rem; }
	.tr-calc th, .tr-calc td { padding: 6px 6px; }
	.tr-calc th { font-size: .66rem; }
	.tr-calc td:nth-child(2) { min-width: 96px; }
}
@media (max-width: 520px) {
	.tr-calc table { table-layout: fixed; width: 100%; }
	.tr-calc th:nth-child(1), .tr-calc td:nth-child(1) { width: 27%; }
	.tr-calc th:nth-child(2), .tr-calc td:nth-child(2) { width: 41%; min-width: 0; }
	.tr-calc th:nth-child(3), .tr-calc td:nth-child(3) { width: 14%; }
	.tr-calc th:nth-child(4), .tr-calc td:nth-child(4) { width: 18%; }
	.tr-calc td:last-child, .tr-calc th:last-child { white-space: normal; }
	.tr-calc th { word-break: break-word; }
}
@media (max-width: 520px) {
	.tr-calc th { text-transform: none; letter-spacing: 0; font-size: .7rem; word-break: normal; }
	.tr-calc th:nth-child(1), .tr-calc td:nth-child(1) { width: 25%; }
	.tr-calc th:nth-child(2), .tr-calc td:nth-child(2) { width: 39%; }
	.tr-calc th:nth-child(3), .tr-calc td:nth-child(3) { width: 16%; }
	.tr-calc th:nth-child(4), .tr-calc td:nth-child(4) { width: 20%; }
}
@media (max-width: 520px) {
	.entry-content .tr-calc thead th { text-transform: none; letter-spacing: 0; font-size: .72rem; padding: 6px; }
}
@media (max-width: 520px) {
	.tr-calc th:nth-child(2), .tr-calc td:nth-child(2) { width: 36%; }
	.tr-calc th:nth-child(4), .tr-calc td:nth-child(4) { width: 23%; }
}
