/* Math-only layout refinements; colors and type inherit the approved tool template. */
#mathSummary p,#mathSummary dd,.math-steps li,.math-example-inputs dd{overflow-wrap:anywhere}
#form select,#form textarea{font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--hair);border-radius:6px;padding:10px;width:100%;max-width:100%;min-width:0}
#form select{font-size:16px}#form textarea{resize:vertical}#form [hidden]{display:none!important}
.math-fraction{margin:12px 0;padding:12px;border:1px solid var(--hair);border-radius:6px;min-width:0}
.math-fraction legend{font-weight:600}.math-fraction .f{margin:0}.math-fraction .f+.f{border-top:2px solid var(--ink);padding-top:8px;margin-top:8px}.math-fraction .box input{text-align:center}
.math-details>div,.math-example-inputs>div{display:flex;justify-content:space-between;gap:14px;border-bottom:1px solid var(--hair);padding:6px 0}.math-details dd,.math-example-inputs dd{margin:0;text-align:right;min-width:0}
.math-solution{margin:18px 0}.math-solution>summary{cursor:pointer;font-weight:600}.math-steps{padding-left:24px}.math-steps li{margin:9px 0;font-family:var(--nums)}
.math-visual{margin:20px 0}.math-visual figcaption{font-weight:600;margin-bottom:10px}.math-share,.math-bar-track{height:20px;background:var(--hair);border:1px solid var(--ink);border-radius:4px;overflow:hidden}.math-share>span,.math-bar-track>span{height:100%;display:block;background:var(--accent,#7c3447)}.math-bar-row{margin:8px 0}.math-tiles{display:flex;flex-wrap:wrap;gap:3px}.math-tiles>span{width:24px;height:28px;border:1px solid var(--ink)}.math-tiles .filled{background:var(--accent,#7c3447)}
.math-weight-row,.math-weight-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 66px;gap:6px;margin:8px 0}.math-weight-head{font-weight:600;font-size:13px}.math-weight-row>div{min-width:0}.math-weight-row .btn{font-size:11px;padding:6px;align-self:start}.math-weight-row .box input{font-size:16px;min-width:0}.math-weight-row .err{font-size:12px}
.math-table-wrap{overflow:auto;max-width:100%}.math-table-wrap table{border-collapse:collapse;width:100%;font-size:14px}.math-table-wrap caption{text-align:left;font-weight:600;margin:8px 0}.math-table-wrap th,.math-table-wrap td{padding:8px;border-bottom:1px solid var(--hair);text-align:left;overflow-wrap:anywhere;max-width:220px}
.math-unknown{position:absolute;inset:0;display:grid;place-items:center;font-weight:700;background:var(--bg);border:2px solid var(--accent,#7c3447)}.box.is-unknown{position:relative}.box.is-unknown input{visibility:hidden}
.math-examples details{border-bottom:1px solid var(--hair);padding:12px 0}.math-examples summary{cursor:pointer;font-weight:600}.math-exact{font-family:var(--nums)}

.calc.embed:has(#mathSummary) .core{display:block}.math-solution summary,.math-examples summary{min-height:44px;display:flex;align-items:center}
@media print{.math-solution>*{display:block}.math-visual{break-inside:avoid}}

/* The shared quick-access navigation uses the same spacing as Money & Taxes. */
.pay-more-tools{display:flex;flex-wrap:wrap;gap:12px 22px;margin-top:20px}.pay-more-tools a{display:inline-flex;min-height:44px;align-items:center}.pay-more-label{flex-basis:100%;margin:0;color:var(--ink2);font-size:15px}
@media(min-width:1024px){.topics-section .topic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Exact values use the shared result, cells, paper and responsive summary styles. */
#mathSummary .total,.strip .v{overflow-wrap:anywhere;max-width:100%}.strip .row1{flex-wrap:wrap}
.calculation-checks summary{min-height:44px;cursor:pointer;display:flex;align-items:center}
@media(max-width:389px){.math-weight-row,.math-weight-head{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 52px;gap:4px}.math-weight-row .btn{font-size:10px}}
