/* The tax calculator page (src/builders/tax.mjs). The site's own look: ink #00184a, blue #004aeb, orange #fe9300,
   white rounded boxes on the pale blue ground, as the credit card finder (assets/css/credit-cards.css).
   Phones first; the two-column layout starts at 1024px. */

.ptx-w { background: #f3f6fb; padding-bottom: 56px; }
.ptx { --ink: #00184a; --mut: #5b6b85; --line: #e1e7f0; --blue: #004aeb; --blue-s: #eaf1ff; --orange: #fe9300; --green: #0f8a55; --green-s: #e3f7ee; --red: #c2410c;
	color: var(--ink); font-family: "Noto Sans Thai", Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5; max-width: 1200px; margin: 0 auto; }
.ptx *, .ptx *::before, .ptx *::after { box-sizing: border-box; }
.ptx [hidden] { display: none !important; }
/* (:where keeps this reset weaker than every class rule below) */
:where(.ptx) :is(h1, h2, h3, p, ul, ol, dl, dd) { margin: 0; padding: 0; }
:where(.ptx) :is(ul, ol) { list-style: none; }
.ptx a { color: var(--blue); text-decoration: none; }
.ptx a:hover { text-decoration: underline; }
.ptx button, .ptx input, .ptx select { font: inherit; color: inherit; }
.ptx button { cursor: pointer; }
.ptx :focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }

.ptx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0 6px; font-size: 14px; color: #687993; }
.ptx-crumbs a { color: inherit; }
.ptx-crumbs b { color: var(--ink); font-weight: 600; }

/* Title band */
.ptx-band { position: relative; display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; padding: 18px 16px 16px; border-radius: 16px; overflow: hidden; color: #fff;
	background: radial-gradient(320px 200px at 100% 100%, rgba(255, 233, 141, .4), rgba(255, 233, 141, 0) 72%), linear-gradient(100deg, #0039b4 0, #0b57e8 56%, #4f8ff6 100%);
	box-shadow: 0 8px 20px rgba(0, 57, 180, .22); }
.ptx-band > div { flex: 1; min-width: 0; }
.ptx-band h1 { font-size: 26px; line-height: 1.25; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 24, 74, .3); }
.ptx-band p { margin-top: 6px; font-size: 15.5px; line-height: 1.55; color: #e3edff; }
.ptx-band .ptx-band-note { display: inline-flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding: 7px 12px; border-radius: 10px; background: rgba(0, 24, 74, .35); font-size: 13.5px; line-height: 1.45; color: #e6eeff; }
.ptx-band-note svg { flex: none; margin-top: 2px; }
.ptx-band-m { display: none; flex: none; width: 132px; height: auto; margin: -6px 4px -22px 0; filter: drop-shadow(0 6px 10px rgba(0, 24, 74, .25)); }

/* Boxes */
.ptx-sec { margin: 0 0 14px; padding: 16px 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ptx-hd { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.ptx-hd h2, .ptx-res h2 { display: flex; align-items: center; gap: 9px; font-size: 20px; line-height: 1.3; font-weight: 800; color: #0b1f5c; }
.ptx-hd h2 i, .ptx-res h2 i { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-style: normal; font-size: 15px; font-weight: 800; }
.ptx-hd small { flex-basis: 100%; font-size: 14px; color: var(--mut); }
.ptx-hd > a { font-size: 14.5px; font-weight: 700; }
.ptx-note, .ptx-fine { font-size: 13.5px; line-height: 1.5; color: var(--mut); }
.ptx-note { margin-bottom: 10px; }
.ptx-fine { margin-top: 8px; }

/* Segmented switch */
.ptx-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 14px; padding: 4px; border-radius: 12px; background: #eef2f8; }
.ptx-seg button { min-height: 42px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; font-size: 15px; font-weight: 700; color: var(--mut); }
.ptx-seg button[aria-pressed="true"] { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(0, 24, 74, .14); }

/* Fields */
.ptx-grid2 { display: grid; gap: 12px; }
.ptx-f { display: block; }
.ptx-f-l { display: block; font-size: 15px; font-weight: 700; }
.ptx-f-h { display: block; margin-top: 1px; font-size: 13px; line-height: 1.45; color: var(--mut); }
.ptx-in { position: relative; display: flex; align-items: center; margin-top: 6px; }
.ptx-in input { width: 100%; min-width: 0; height: 48px; padding: 0 52px 0 14px; border: 1.5px solid #cfd8e6; border-radius: 10px; background: #fff; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.ptx-in input::placeholder { color: #a8b4c8; font-weight: 500; }
.ptx-in input:hover { border-color: #9db3d8; }
.ptx-in input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 74, 235, .16); }
.ptx-in input:disabled { background: #f3f6fb; color: var(--mut); border-style: dashed; }
.ptx-in i { position: absolute; right: 13px; font-style: normal; font-size: 14px; color: var(--mut); pointer-events: none; }
.ptx-f-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ptx-f-inline select { height: 42px; padding: 0 10px; border: 1.5px solid #cfd8e6; border-radius: 10px; background: #fff; font-weight: 700; }
.ptx-more { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ptx-more > summary, .ptx-q > summary { cursor: pointer; font-size: 15px; font-weight: 700; color: var(--blue); list-style: none; display: flex; align-items: center; gap: 8px; }
.ptx-more > summary::-webkit-details-marker, .ptx-q > summary::-webkit-details-marker, .ptx-grp > summary::-webkit-details-marker { display: none; }
.ptx-more > summary::before { content: "+"; display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-s); font-weight: 800; line-height: 1; }
.ptx-more[open] > summary::before { content: "−"; }
.ptx-more[open] > summary { margin-bottom: 12px; }
.ptx-link { margin-top: 8px; padding: 6px 0; border: 0; background: none; font-size: 14px; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.ptx-sum { display: grid; gap: 6px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f3f6fb; }
.ptx-sum div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.ptx-sum dt { color: var(--mut); }
.ptx-sum dd { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Month by month */
.ptx-mwrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px 6px; -webkit-overflow-scrolling: touch; }
.ptx-mt { border-collapse: separate; border-spacing: 0; min-width: 660px; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.ptx-mt th, .ptx-mt td { padding: 3px 3px; text-align: right; white-space: nowrap; }
.ptx-mt thead th { padding: 6px 4px 8px; font-size: 12.5px; line-height: 1.3; font-weight: 700; color: var(--mut); white-space: normal; vertical-align: bottom; }
.ptx-mt th[scope="row"], .ptx-mt thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 700; padding-right: 8px; }
.ptx-mt th em { display: block; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--orange); line-height: 1; }
.ptx-mt input { width: 100%; min-width: 92px; height: 38px; padding: 0 8px; border: 1.5px solid #d6deea; border-radius: 8px; background: #fff; text-align: right; font-weight: 600; }
.ptx-mt input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 74, 235, .16); }
.ptx-mt tr.is-forecast input { border-style: dashed; background: #fafbfd; color: #8a97ad; }
.ptx-mt .ptx-m-net { padding-left: 10px; font-weight: 700; color: var(--mut); }
.ptx-mt tfoot th, .ptx-mt tfoot td { padding: 8px 6px 4px; border-top: 1px solid var(--line); font-weight: 800; }
.ptx-mt tfoot tr:last-child th, .ptx-mt tfoot tr:last-child td { border-top: 0; padding-top: 2px; color: var(--blue); }

/* Allowance groups and rows */
.ptx-grp { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: #fff; }
.ptx-grp > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 14px; cursor: pointer; list-style: none; border-radius: 12px; }
.ptx-grp > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2.5px solid var(--mut); border-bottom: 2.5px solid var(--mut); transform: rotate(45deg); margin: -4px 4px 0 4px; transition: transform .15s; }
.ptx-grp[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.ptx-grp[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; background: #f8fafd; }
.ptx-grp-n { font-size: 17px; font-weight: 800; }
.ptx-grp-u { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--green); white-space: nowrap; }
.ptx-gnote { margin: 12px 14px 0; padding: 8px 12px; border-radius: 10px; background: var(--blue-s); font-size: 13.5px; line-height: 1.45; color: #1c3f8f; }
.ptx-gnote b { white-space: nowrap; }
.ptx-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px; border-top: 1px solid #edf1f6; }
.ptx-grp > .ptx-row:first-of-type, .ptx-gnote + .ptx-row { border-top: 0; }
.ptx-row-t label { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.ptx-row-t small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--mut); }
.ptx-src { font-size: 12px; color: #8090aa !important; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.ptx-row-c .ptx-in { margin-top: 0; }
.ptx-row-c .ptx-in input { height: 46px; }
.ptx-fixed { display: inline-block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ptx-fixed i { font-style: normal; font-size: 14px; font-weight: 500; color: var(--mut); }
.ptx-row-s { display: flex; align-items: center; gap: 10px; min-height: 20px; font-size: 13.5px; font-weight: 700; color: var(--blue); }
.ptx-bar { flex: none; width: 72px; height: 6px; border-radius: 99px; background: #e6ebf3; overflow: hidden; }
.ptx-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--blue); transition: width .25s; }
.ptx-row[data-state="full"] .ptx-row-s { color: var(--green); }
.ptx-row[data-state="full"] .ptx-bar i { background: var(--green); }
.ptx-row[data-state="over"] .ptx-row-s { color: var(--red); }
.ptx-row[data-state="over"] .ptx-bar i { background: var(--orange); }
.ptx-row[data-state="over"] .ptx-in input { border-color: var(--orange); }
.ptx-row[data-row="personal"] .ptx-row-s, .ptx-row[data-row="spouse"] .ptx-row-s { display: none; }

/* switch and stepper */
.ptx-sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.ptx-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ptx-sw span { position: relative; flex: none; width: 52px; height: 30px; border-radius: 99px; background: #c9d3e3; transition: background .15s; }
.ptx-sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 24, 74, .3); transition: transform .15s; }
.ptx-sw input:checked + span { background: var(--blue); }
.ptx-sw input:checked + span::after { transform: translateX(22px); }
.ptx-sw input:focus-visible + span { outline: 3px solid #7aa7ff; outline-offset: 2px; }
.ptx-sw b { font-size: 15px; font-weight: 700; color: var(--mut); }
.ptx-sw input:checked ~ b { color: var(--ink); }
.ptx-step { display: inline-flex; align-items: center; gap: 6px; }
.ptx-step button { width: 44px; height: 44px; border: 1.5px solid #cfd8e6; border-radius: 10px; background: #fff; font-size: 22px; font-weight: 700; line-height: 1; color: var(--blue); }
.ptx-step button:hover { background: var(--blue-s); border-color: var(--blue); }
.ptx-step input { width: 54px; height: 44px; border: 1.5px solid #cfd8e6; border-radius: 10px; text-align: center; font-size: 18px; font-weight: 800; }
.ptx-step input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 74, 235, .16); }
.ptx-step i { font-style: normal; font-size: 14px; color: var(--mut); margin-left: 2px; }

/* Result */
.ptx-res { margin: 0 0 14px; padding: 16px 14px 14px; border: 1.5px solid #c9d8f7; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(0, 57, 180, .08); }
.ptx-res h2 { margin-bottom: 12px; }
.ptx-res h3 { margin: 18px 0 8px; font-size: 15.5px; font-weight: 800; color: #0b1f5c; }
.ptx-res-empty { padding: 18px 14px; border-radius: 12px; background: #f3f6fb; font-size: 14.5px; color: var(--mut); text-align: center; }
.ptx-res-main { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--blue-s); color: #0b2f8a; }
.ptx-res-main[data-state="refund"] { background: var(--green-s); color: #0a6b42; }
.ptx-res-main[data-state="pay"] { background: #fff3e0; color: #9a4b00; }
.ptx-res-k { font-size: 15px; font-weight: 800; }
.ptx-res-v { font-size: 34px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ptx-res-v i { font-style: normal; font-size: 16px; font-weight: 700; }
.ptx-res-main small { font-size: 13px; opacity: .85; }
.ptx-res-list { display: grid; margin-top: 10px; }
.ptx-res-list div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; border-bottom: 1px solid #edf1f6; font-size: 14.5px; }
.ptx-res-list dt { color: var(--mut); }
.ptx-res-list dd { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptx-flat { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #fff3e0; font-size: 13px; line-height: 1.5; color: #7a3d00; }
.ptx-bands { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.ptx-bands span { display: grid; gap: 4px; justify-items: center; }
.ptx-bands i { position: relative; display: block; width: 100%; height: 12px; border-radius: 4px; background: #e6ebf3; overflow: hidden; }
.ptx-bands i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); background: var(--blue); border-radius: 4px; transition: width .25s; }
.ptx-bands span.is-here i::after { background: var(--orange); }
.ptx-bands b { font-size: 11.5px; font-weight: 700; color: #8a97ad; }
.ptx-bands span.is-here b { color: var(--ink); }
.ptx-bandlist { margin-top: 8px; }
.ptx-bandlist li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.ptx-bandlist li b { color: var(--ink); }
.ptx-bandlist li span:last-child { white-space: nowrap; }
.ptx-if li { display: grid; gap: 1px; padding: 9px 12px; margin-top: 6px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.ptx-if li > b { font-size: 14.5px; color: var(--green); }
.ptx-if li.is-none { border-left-color: #c9d3e3; color: var(--mut); }
.ptx-res-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ptx-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ptx-chk input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.ptx-chk small { display: block; font-size: 12px; font-weight: 400; color: var(--mut); }
.ptx-btn-ghost { min-height: 40px; padding: 6px 14px; border: 1.5px solid #cfd8e6; border-radius: 10px; background: #fff; font-size: 14px; font-weight: 700; color: var(--mut); }
.ptx-btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* How it is worked out */
.ptx-flow { display: grid; gap: 6px; counter-reset: s; }
.ptx-flow li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: #f3f6fb; font-size: 14.5px; }
.ptx-flow li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptx-flow li:nth-child(5), .ptx-flow li:nth-child(6) { background: var(--blue-s); font-weight: 700; }

/* Notes, questions, articles */
.ptx-list li { position: relative; padding: 0 0 0 16px; margin-top: 8px; font-size: 14.5px; line-height: 1.6; }
.ptx-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.ptx-list-s li { font-size: 13.5px; color: var(--mut); }
.ptx-list-s li::before { background: #c9d3e3; }
.ptx-rd { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ptx-rd a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1.5px solid #c9d8f7; border-radius: 10px; background: var(--blue-s); font-size: 14px; font-weight: 700; }
.ptx-q { border-top: 1px solid #edf1f6; padding: 12px 0; }
.ptx-q:first-of-type { border-top: 0; padding-top: 0; }
.ptx-q > summary { color: var(--ink); font-size: 15.5px; justify-content: space-between; }
.ptx-q > summary::after { content: "+"; flex: none; font-size: 20px; font-weight: 700; color: var(--blue); line-height: 1; }
.ptx-q[open] > summary::after { content: "−"; }
.ptx-q p { margin-top: 8px; font-size: 14.5px; line-height: 1.65; color: #33425f; }
.ptx-arts { display: grid; gap: 12px; }
.ptx-art { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--ink) !important; }
.ptx-art img { width: 112px; height: 70px; border-radius: 10px; object-fit: cover; background: #eef2f8; }
.ptx-art b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 1.4; }
.ptx-art small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mut); }

/* The bar at the bottom of a phone's screen */
.ptx-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #00184a; color: #fff; box-shadow: 0 -6px 18px rgba(0, 24, 74, .25); transition: transform .2s; }
.ptx-dock small { display: block; font-size: 12.5px; color: #b9c8ea; line-height: 1.2; }
.ptx-dock b { font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ptx-dock[data-state="refund"] b { color: #7ff0b8; }
.ptx-dock[data-state="pay"] b { color: #ffcb7d; }
.ptx-dock a { flex: none; display: inline-flex; align-items: center; min-height: 42px; padding: 6px 18px; border-radius: 10px; background: var(--orange); color: #00184a !important; font-size: 15px; font-weight: 800; text-decoration: none !important; }
.ptx-result-seen .ptx-dock { transform: translateY(110%); }
body.ptx-has-dock .ptx-w { padding-bottom: 96px; }
#ptx-result, #ptx-income, #ptx-allow { scroll-margin-top: 96px; }

@media (min-width: 640px) {
	.ptx-band { padding: 22px 24px; }
	.ptx-band h1 { font-size: 32px; }
	.ptx-band-m { display: block; }
	.ptx-sec { padding: 20px 20px 22px; }
	.ptx-grid2 { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
	.ptx-hd small { flex-basis: auto; }
	.ptx-row { grid-template-columns: minmax(0, 1fr) 230px; column-gap: 18px; align-items: center; padding: 14px 16px; }
	.ptx-row-c { justify-self: end; width: 100%; display: flex; justify-content: flex-end; }
	.ptx-row-c .ptx-in { width: 100%; }
	.ptx-row-s { grid-column: 1 / -1; }
	.ptx-mwrap { margin: 0; padding: 0 0 6px; }
	.ptx-arts { grid-template-columns: 1fr 1fr; }
	.ptx-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
	.ptx-cols { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; align-items: start; }
	.ptx-side { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow-y: auto; border-radius: 16px; scrollbar-width: thin; }
	.ptx-res { margin-bottom: 0; padding: 18px 18px 16px; }
	.ptx-dock { display: none; }
	body.ptx-has-dock .ptx-w { padding-bottom: 56px; }
	.ptx-info { align-items: start; }
	.ptx-flow { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
	.ptx-flow li { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; }
	.ptx-flow li b { font-size: 16px; }
	.ptx-arts { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ptx * { transition: none !important; } }
