.public-main { max-width: 1080px; }
.privacy-main { max-width: 760px; }
.privacy-main + .public-footer { max-width: 760px; }
.privacy-main section:last-child { border-bottom: 0; }
.privacy-main details { margin-bottom: 0; }
.privacy-main a { overflow-wrap: anywhere; }
.page-heading { max-width: 720px; padding: .5rem 0 1rem; }
.eyebrow { color: var(--color-primary); font-size: .875rem; font-weight: 700; margin: 0 0 .5rem; }
.section-title { display: flex; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.section-title h2 { margin: 0; }
.step-number { color: var(--color-primary); font-weight: 750; font-size: 1.1rem; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.feedback-form { display: grid; gap: 1rem; max-width: 38rem; margin-block: 1.5rem; }
.feedback-form label { display: grid; gap: .4rem; min-width: 0; margin: 0; }
.feedback-form input:not([type=checkbox]), .feedback-form select, .feedback-form textarea { box-sizing: border-box; width: 100%; max-width: none; min-width: 0; font: inherit; padding: .75rem; border: 1px solid var(--color-control-border); border-radius: 6px; background: var(--color-surface); color: var(--color-ink); }
.feedback-form textarea { resize: vertical; }
.feedback-form .feedback-consent { display: flex; align-items: flex-start; gap: .65rem; line-height: 1.5; }
.feedback-consent input { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin-top: .15rem; }
.feedback-form button { justify-self: start; min-height: 44px; }
legend { font-weight: 750; font-size: 1.2rem; padding: 0; }
.country-choices { display: flex; gap: 2rem; flex-wrap: wrap; }
.check { display: flex; gap: .7rem; align-items: center; font-weight: 500; min-height: 44px; margin: .4rem 0; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; accent-color: var(--color-primary); padding: 0; }
.country-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin-top: 1rem; }
.country-inputs:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 600px; }
.country-inputs input, .country-inputs select { max-width: 100%; }
.year-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.year-row label { margin: 0; }
.year-row select { width: 8rem; max-width: 100%; flex-shrink: 0; }
summary { min-height: 44px; padding: .7rem 0; cursor: pointer; font-weight: 600; }
details { margin: .5rem 0; }
.additional-details { border-top: 1px solid var(--color-border); margin-top: 1.5rem; }
.small { font-size: .9rem; }
.notice { background: #fff6dd; border-left: 3px solid #967220; color: #57431c; padding: 1rem; }
.result { padding: 1.3rem 0; border-bottom: 1px solid var(--color-border); }
.result h3 { font-size: 1.15rem; margin: 0; }
.result-amount { display: block; font-size: 1.75rem; line-height: 1.25; margin: .5rem 0; font-weight: 750; overflow-wrap: anywhere; }
.source-check-detail { overflow-wrap: anywhere; }
.result dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem 1rem; }
.result dd { margin: 0; text-align: right; }
.result li { margin: .6rem 0; }
.filing-return { font-weight: 650; margin-bottom: .25rem; }
.filing-return + p { margin-top: 0; }
.filing-next-steps { margin-block: .5rem; }
.filing-next-steps ol { padding-inline-start: 1.5rem; max-width: 66ch; }
.result-country { margin-block: 1.25rem; padding: clamp(1rem, 4vw, 1.6rem); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; overflow-wrap: anywhere; }
.result-country h3 { font-size: 1.35rem; }
.result-country h4 { font-size: 1rem; margin: .95rem 0 .25rem; }
.result-country .result-year { margin: .15rem 0; }
.result-country .result-amount { color: var(--color-ink); margin-top: .25rem; }
.result-filing { border-top: 1px solid var(--color-border); margin-top: 1rem; }
.result-filing p { margin: .35rem 0; }
.result-filing .filing-review-answer { margin-top: .35rem; }
#countTaiwanDays { margin-top: .25rem; }
#taiwanDayCount { padding: 0; color: var(--color-ink); background: var(--color-surface); }
#taiwanDayCountForm { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem - 2px); padding: 1rem 1.25rem; }
#taiwanTripRows { overflow-y: auto; min-height: 0; padding: .25rem; }
#taiwanDayCountForm .actions { margin-top: .5rem; }
@media (max-height: 460px) { #taiwanDayCountForm { max-height: none; } }
.taiwan-trip-dates { display: grid; gap: .5rem .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.taiwan-trip-dates label { margin: .2rem 0; }
.taiwan-trip-dates input { display: block; margin-top: .2rem; width: 100%; min-width: 0; font-weight: 400; }
.taiwan-trip + .taiwan-trip { margin-top: .75rem; }
.taiwan-trip button, #addTaiwanTrip { margin-top: .5rem; }
#addTaiwanTrip { align-self: flex-start; }
#taiwanDayTotal { color: var(--color-ink); font-weight: 650; }
#taiwanDayTotal[data-state="error"] { color: #923337; }
#taiwanDayTotal:empty { min-height: 0; margin: 0; }
.result-filing a { display: inline-flex; align-items: center; min-height: 44px; }
.result-calculation { border-top: 1px solid var(--color-border); margin-bottom: 0; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1rem 0 2rem; }
.plan { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; padding: 1.3rem; display: flex; flex-direction: column; }
.plan ul { padding-left: 1.3rem; margin-bottom: 1.5rem; }
.plan li { margin: .7rem 0; }
.plan > .button, .availability { margin-top: auto; }
.price { font-size: 1.6rem; font-weight: 700; line-height: 1.35; }
.plan .price { margin: .75rem 0 .25rem; }
.plan .price + p { margin: 0; }
.availability { color: #5c4a20; font-size: .9rem; }
.public-footer { display: flex; flex-wrap: wrap; gap: 1.5rem; max-width: 1080px; }
body[data-page="developers"] :is(.api-reference, .developer-layout, .public-footer) {
  width: var(--public-content-width);
  max-width: none;
  padding-inline: 0;
}
.pilot-note { padding: 1.5rem 0; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; inset: .5rem auto auto .5rem; background: var(--color-surface); padding: .7rem; z-index: 10; }
@media (max-width: 800px) { .plans { grid-template-columns: 1fr; } .plan { max-width: 600px; } }
@media (max-width: 620px) { .country-inputs { grid-template-columns: 1fr; gap: 1.5rem; } .result dl { grid-template-columns: 1fr; gap: .3rem; } .result dd { text-align: left; margin-bottom: .65rem; } .result-amount { font-size: 1.5rem; } .account-nav { gap: .65rem; } }
.tax-summary { padding: 16px 0; border-block: 1px solid var(--color-control-border); }
.tax-summary h3 { margin: 0; font-size: 1rem; }
.tax-summary .summary-state { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.tax-summary .estimate-amount { display: block; font-size: 1.5rem; line-height: 1.35; }
.tax-summary p { max-width: 70ch; }
body[data-page="estimate"] .public-main { max-width: 800px; }
.estimate-progress ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 .5rem; }
.estimate-progress li { display: flex; min-width: 0; }
.estimate-progress button {
  display: grid; grid-template-columns: auto minmax(0, max-content); align-content: center; align-items: baseline;
  width: 100%; min-width: 0; min-height: 52px; padding: .5rem .25rem;
  border: 0; border-bottom: 3px solid var(--color-border); border-radius: 0; background: transparent;
  line-height: 1.35; overflow-wrap: anywhere;
}
.estimate-progress button[aria-current="step"] { color: var(--color-primary-strong); border-bottom-color: var(--color-primary); font-weight: 700; }
.estimate-progress button span:first-child { font-variant-numeric: tabular-nums; }
[data-estimate-step] { padding-top: .75rem; border-bottom: 0; }
.estimate-pay-fields { grid-template-columns: minmax(0, 1fr) minmax(6rem, auto); max-width: 480px; gap: .75rem; }
.estimate-actions { align-items: center; }
#estimateForm[data-taiwan-household] :is(#calculate, #reliefFacts),
#estimateForm[data-taiwan-household="taiwan"] .additional-details,
#calculate[hidden] ~ :is(#estimateTaiwanHouseholdPortal, #calculateHouseholdSingapore) { display: none; }
:is(body[data-page="estimate"], .inline-estimate) :is(#formStatus, #downloadStatus, #estimateFxStatus):empty { min-height: 0; margin: 0; }
.estimate-actions #resetEstimate { margin-left: auto; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
body[data-page="estimate"] .page-heading { padding-bottom: 0; }
:is(body[data-page="estimate"], .inline-estimate) .result dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
:is(body[data-page="estimate"], .inline-estimate) .result dd { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  :is(body[data-page="estimate"], .inline-estimate) .result dl { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .estimate-progress button { grid-template-columns: minmax(0, 1fr); align-content: start; gap: .2rem; font-size: .9375rem; }
  .estimate-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; }
  .estimate-actions :is(button, .button) { min-width: 0; min-height: 52px; overflow-wrap: anywhere; }
  .estimate-actions:has(#estimateBack[hidden]) .primary { grid-column: 1 / -1; }
  .estimate-actions #calculateHouseholdSingapore { grid-column: 1 / -1; }
  .estimate-actions #resetEstimate { grid-column: 1 / -1; justify-self: start; margin-left: 0; padding-inline: 0; border: 0; }
  #coverageForm .actions .primary { width: 100%; min-height: 52px; }
  .public-main, .coverage-main { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}
