/* Income tax and TDS calculators (/freepmtools/income-tax-calculator, /tds-calculator): inputs on the left, a live result panel on the right that stays in view.
   Theme tokens only, so light and dark both work. Loaded on those pages only (see tools/build-freepmtools.py). */
.tx { --tx-r: 16px; }
.tx-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.tx-form { display: grid; gap: 16px; min-width: 0; }
.tx-sec { background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--tx-r); padding: 16px 18px; min-width: 0; }
.tx-sec[hidden], .tx-sub[hidden] { display: none; }
.tx-sh { margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); cursor: default; }
details.tx-sec > summary.tx-sh { cursor: pointer; margin: 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.tx-sec > summary.tx-sh::after { content: "+"; font-size: 1.1rem; font-weight: 400; color: var(--text-light); } details.tx-sec[open] > summary.tx-sh::after { content: "\2212"; }
details.tx-sec[open] > summary.tx-sh { margin-bottom: 12px; } details.tx-sec > summary::-webkit-details-marker { display: none; }
.tx-sh2 { margin: 14px 0 8px; font-size: .86rem; font-weight: 600; color: var(--text-primary); }
.tx .pt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 14px; margin: 0; }
.tx .pt-field { font-size: .8rem; font-weight: 500; color: var(--text-secondary); gap: 6px; }
.tx .pt-field input, .tx .pt-field select { height: 42px; border-radius: 10px; font-size: .95rem; background: var(--surface); }
.tx .pt-field small { font-size: .72rem; font-weight: 400; color: var(--text-light); }
.tx-check { flex-direction: row !important; align-items: center; gap: 8px !important; grid-column: 1 / -1; font-weight: 400 !important; }
.tx-check input { width: 18px !important; height: 18px !important; flex: none; accent-color: var(--primary); }
.tx-arow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; margin-bottom: 10px; }
.tx-alabel { font-size: .84rem; font-weight: 500; color: var(--text-primary); display: grid; gap: 2px; align-self: center; } .tx-alabel small { font-size: .72rem; font-weight: 400; color: var(--text-light); }
.tx-hint { margin: 10px 0 0; font-size: .8rem; color: var(--text-light); line-height: 1.5; }

/* result panel */
.tx-result { position: sticky; top: 84px; display: grid; gap: 14px; min-width: 0; }
.tx-verdict { padding: 18px 20px; border-radius: var(--tx-r); background: var(--bg-gray); border: 1px solid var(--border); font-size: 1.05rem; line-height: 1.45; color: var(--text-primary); }
.tx-verdict b { font-weight: 700; } .tx-vlabel { display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.tx-verdict.is-new { background: rgba(4, 120, 87, .09); border-color: rgba(4, 120, 87, .35); } .tx-verdict.is-old { background: rgba(37, 99, 235, .08); border-color: rgba(37, 99, 235, .35); }
html[data-theme="dark"] .tx-verdict.is-new { background: rgba(52, 211, 153, .12); } html[data-theme="dark"] .tx-verdict.is-old { background: rgba(96, 165, 250, .14); }
.tx-regimes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tx-reg { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--tx-r); background: var(--surface); border: 1px solid var(--border); font-size: .78rem; color: var(--text-light); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.tx-reg.win { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.tx-regname { font-size: .76rem; font-weight: 700; color: var(--text-secondary); }
.tx-big { font-size: 1.6rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tx-sub2 { margin-top: 4px; }
.tx-cmp { width: 100%; min-width: 0; table-layout: fixed; font-size: .8rem; font-variant-numeric: tabular-nums; } .tx-cmp col:first-child, .tx-cmp th:first-child { width: 44%; } .tx-cmp td:first-child { white-space: normal; overflow-wrap: anywhere; } .tx-cmp td, .tx-cmp th { padding: 8px 6px; } .tx-cmp td:nth-child(n+2), .tx-cmp th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.tx-cmp tr.tx-strong td { font-weight: 700; color: var(--text-primary); border-top: 1px solid var(--border); }
.tx-bal { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--bg-gray); font-size: .84rem; color: var(--text-secondary); } .tx-bal b { font-size: 1.15rem; color: var(--text-primary); }
.tx-adv { width: 100%; font-size: .84rem; margin-top: 10px; } .tx-cap { text-align: left; font-size: .78rem; font-weight: 600; color: var(--text-secondary); padding: 0 0 6px; caption-side: top; }
.tx-slabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }

/* TDS panel */
.tx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 16px; }
.tx-card { background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--tx-r); padding: 16px 18px; min-width: 0; }
.tx-h { margin: 0 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.tx-dl { display: grid; gap: 8px; margin: 0; font-size: .86rem; } .tx-dl div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; } .tx-dl dt { color: var(--text-light); } .tx-dl dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.tx-card { min-width: 0; overflow-x: auto; } .tx-je { width: 100%; min-width: 0; font-size: .84rem; } .tx-je th, .tx-je td { padding: 8px 10px; } .tx-je td:nth-child(n+2), .tx-je th:nth-child(n+2) { text-align: right; }
.tx-wide { grid-column: 1 / -1; }

@media (max-width: 1100px) { .tx-layout { grid-template-columns: 1fr; } .tx-result { position: static; order: -1; } }
@media (max-width: 600px) { .tx-dl div { grid-template-columns: 100px minmax(0, 1fr); } .tx-sec { padding: 14px; } .tx-arow { grid-template-columns: 1fr 1fr; } .tx-alabel { grid-column: 1 / -1; } .tx-regimes { gap: 8px; } .tx-reg { padding: 12px; } .tx-big { font-size: 1.3rem; } }
