/* Income tax, GST returns and capital gains tools. Builds on site.css, encyclopedia.css and motion.css. */
.tx-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.5rem; align-items: start; }
.tx-form > .tool-card, .tx-panel > .tool-card { margin-bottom: 1.25rem; }
.tx-sticky { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 2px; }
.tx-panel .tool-actions { gap: .5rem; }
.tx-top-actions { margin: 0 0 1rem; }
.tx-panel .btn-ghost { padding: 9px 14px; font-size: .74rem; }
.tx-fs { border: 0; padding: 0; margin: 0; }
.tx-fs legend { font-family: var(--serif); color: var(--navy); font-size: 1.2rem; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.tx-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: .25rem 1rem; margin-top: .75rem; }
.tx-fields .field { margin-bottom: .6rem; }
.tx-fields .field small, .tx-words { font-weight: 400; font-size: .74rem; color: var(--mid-gray); min-height: 1.1em; }
.tx-fields input[type="text"], .tx-fields input[type="number"], .tx-fields select { width: 100%; }
.tx-only-old { transition: opacity .35s ease; }
.tx-layout[data-focus="new"] .tx-only-old { opacity: .55; }
.tx-tag { display: inline-block; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: #fbf4e4; border: 1px solid #ecd9ad; color: #5a4012; margin-left: .35rem; vertical-align: 2px; }

/* Segmented controls */
.tx-seg { display: inline-flex; flex-wrap: wrap; background: var(--off-white); border: 1px solid var(--light-border); border-radius: 999px; padding: 3px; gap: 2px; position: relative; }
.tx-seg button { font: inherit; font-size: .84rem; border: 0; background: transparent; color: var(--navy); padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: background .3s ease, color .3s ease, box-shadow .3s ease; }
.tx-seg button[aria-pressed="true"], .tx-seg button[aria-selected="true"] { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(11,29,58,.18); }
.tx-seg button:hover:not([aria-pressed="true"]):not([aria-selected="true"]) { background: #fff; }

/* Tabs */
.tx-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 auto 1.25rem; }
.tx-tabs [role="tab"] { font: inherit; font-size: .88rem; padding: 10px 18px; border-radius: 3px; border: 1px solid var(--light-border); background: #fff; color: var(--navy); cursor: pointer; position: relative; overflow: hidden; transition: color .3s ease, border-color .3s ease, transform .25s ease; }
.tx-tabs [role="tab"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.tx-tabs [role="tab"][aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.tx-tabs [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }
.tx-tabs [role="tab"]:hover { transform: translateY(-2px); border-color: var(--gold); }
[role="tabpanel"][hidden] { display: none; }
[role="tabpanel"].tx-in { animation: tx-rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Result card */
.tx-result { background: var(--navy); color: #fff; border-radius: 6px; padding: 1.5rem; position: relative; overflow: hidden; box-shadow: 0 18px 40px rgba(11,29,58,.22); }
.tx-result::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; background: radial-gradient(closest-side, rgba(196,151,58,.28), transparent 70%); pointer-events: none; animation: tx-drift 14s ease-in-out infinite alternate; }
@keyframes tx-drift { from { transform: translate(0, 0); } to { transform: translate(-30%, 20%); } }
.tx-result h2 { font-family: var(--serif); color: #fff; font-size: 1.25rem; margin-bottom: .2rem; position: relative; }
.tx-result .tx-sub { color: rgba(255,255,255,.72); font-size: .82rem; position: relative; }
.tx-duel { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.1rem 0 .9rem; position: relative; }
.tx-reg { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 4px; padding: .9rem 1rem; transition: border-color .4s ease, background .4s ease, transform .4s ease; }
.tx-reg.win { border-color: var(--gold); background: rgba(196,151,58,.14); transform: translateY(-3px); }
.tx-reg dt { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.tx-reg dd { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.tx-reg .tx-badge { display: inline-block; margin-left: .3rem; vertical-align: 1px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); background: var(--gold); padding: 1px 8px; border-radius: 999px; opacity: 0; transform: scale(.8); transition: opacity .35s ease, transform .35s cubic-bezier(.3,1.6,.5,1); }
.tx-reg.win .tx-badge { opacity: 1; transform: none; }
.tx-bars { position: relative; display: grid; gap: .5rem; margin: .5rem 0 1rem; }
.tx-bar { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: .6rem; font-size: .78rem; color: rgba(255,255,255,.8); }
.tx-bar .track { height: 10px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.tx-bar .fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 999px; transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.tx-bar.old .fill { background: linear-gradient(90deg, #8fa6c8, #c9d6ea); }
.tx-verdict { position: relative; font-size: .95rem; color: #fff; border-top: 1px solid rgba(255,255,255,.14); padding-top: .9rem; }
.tx-verdict strong { color: var(--gold-light); }
.tx-mini { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1rem; margin-top: .9rem; font-size: .8rem; color: rgba(255,255,255,.78); }
.tx-mini b { display: block; color: #fff; font-size: .95rem; font-variant-numeric: tabular-nums; }
.tx-pulse { animation: tx-pulse .6s ease; }
@keyframes tx-pulse { 0% { box-shadow: 0 0 0 0 rgba(196,151,58,.55); } 100% { box-shadow: 0 0 0 14px rgba(196,151,58,0); } }

/* Breakdown */
.tx-break { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tx-break th, .tx-break td { padding: .5rem .6rem; border-bottom: 1px solid var(--light-border); text-align: left; vertical-align: top; }
.tx-break td.num, .tx-break th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-break tr.sub td { color: var(--mid-gray); font-size: .8rem; padding-top: .25rem; padding-bottom: .25rem; }
.tx-break tr.sub td:first-child { padding-left: 1.4rem; }
.tx-break tr.tot td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); }
.tx-break tr.minus td.num { color: #1d6b3a; }
.tx-notes { margin-top: .8rem; font-size: .85rem; }
.tx-notes li { position: relative; padding-left: 1.1rem; margin-bottom: .35rem; }
.tx-notes li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* Slab ladder */
.tx-ladder { display: grid; gap: 4px; margin-top: .75rem; }
.tx-step { display: grid; grid-template-columns: 7.5rem 1fr 5.5rem; align-items: center; gap: .6rem; font-size: .78rem; }
.tx-step .track { height: 14px; background: var(--off-white); border-radius: 3px; overflow: hidden; }
.tx-step .fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--navy-mid), var(--navy)); transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s); }
.tx-step .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Upload zone */
.tx-drop { border: 2px dashed #c9bfa8; border-radius: 6px; padding: 1.6rem; text-align: center; background: #fffdf8; transition: border-color .3s ease, background .3s ease, transform .3s ease; }
.tx-drop.over { border-color: var(--gold); background: #fff6e2; transform: scale(1.01); }
.tx-drop .file-btn { margin: .5rem 0; }
.tx-brokers { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .8rem; }
.tx-brokers .pill { font-size: .74rem; }
.tx-files { margin-top: .75rem; font-size: .85rem; }
.tx-files li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--light-border); }
.tx-files li .pill { margin-left: auto; }
.tx-progress { height: 4px; background: var(--off-white); border-radius: 999px; overflow: hidden; margin-top: .75rem; }
.tx-progress span { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 999px; animation: tx-load 1.1s ease-in-out infinite; }
.tx-progress[hidden] { display: none; }
@keyframes tx-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.tx-mapping { margin-top: .75rem; }
.tx-mapping summary { cursor: pointer; font-weight: 500; color: var(--navy); font-size: .88rem; }
.tx-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: .25rem 1rem; margin-top: .6rem; }
.tx-sheet { padding: .75rem 0; border-bottom: 1px solid var(--light-border); }
.tx-sheet:last-child { border-bottom: 0; }
.tx-sheet h3 { font-size: .92rem; margin: 0 0 .25rem; color: var(--navy); }

/* KPI tiles with animated numbers */
.tx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 1rem; margin: 1rem 0; }
.tx-kpi { background: #fff; border: 1px solid var(--light-border); border-left: 4px solid var(--gold); border-radius: 4px; padding: .9rem 1rem; transition: transform .3s ease, box-shadow .3s ease; }
.tx-kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(11,29,58,.08); }
.tx-kpi dt { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mid-gray); }
.tx-kpi dd { font-family: var(--serif); font-size: 1.35rem; color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-kpi dd.neg { color: #a3261b; }
.tx-kpi dd.tx-k-note { font-family: var(--sans); font-size: .74rem; font-weight: 400; color: var(--mid-gray); }

.tx-warn { background: #fff7e0; border-left: 4px solid #c48a12; padding: .8rem 1rem; border-radius: 3px; font-size: .88rem; margin: .75rem 0; }
.tx-warn[hidden] { display: none; }
.tx-ok { background: #edf7ee; border-left: 4px solid #2e7d32; padding: .8rem 1rem; border-radius: 3px; font-size: .88rem; margin: .75rem 0; }
.tx-legal { background: #fff; border: 1px solid var(--light-border); border-left: 4px solid #a3261b; border-radius: 4px; padding: 1rem 1.25rem; font-size: .86rem; margin: 0 auto 1.5rem; }
.tx-legal strong { color: var(--navy); }
.tx-legal p + p { margin-top: .4rem; }

/* Due-date timeline */
.tx-timeline { position: relative; margin: 1rem 0 0; padding-left: 1.5rem; }
.tx-timeline::before { content: ""; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: linear-gradient(var(--gold), var(--navy)); transform-origin: top; animation: tx-grow 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tx-grow { from { transform: scaleY(0); } to { transform: none; } }
.tx-timeline li { position: relative; padding: .45rem 0 .65rem; animation: tx-rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.tx-timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .85rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); }
.tx-timeline li.past::before { border-color: #9DB0CC; }
.tx-timeline li.soon::before { background: var(--gold); box-shadow: 0 0 0 0 rgba(196,151,58,.6); animation: tx-ping 1.8s ease-out infinite; }
@keyframes tx-ping { 0% { box-shadow: 0 0 0 0 rgba(196,151,58,.6); } 100% { box-shadow: 0 0 0 12px rgba(196,151,58,0); } }
.tx-timeline .when { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.tx-timeline .what { display: block; font-size: .88rem; }
.tx-timeline .past .when { color: var(--mid-gray); }

.tx-ret-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 1rem; }
.tx-ret { background: #fff; border: 1px solid var(--light-border); border-radius: 4px; padding: 1.1rem 1.2rem; position: relative; overflow: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease; }
.tx-ret::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); transform: scaleY(.25); transform-origin: top; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.tx-ret:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(11,29,58,.1); }
.tx-ret:hover::before { transform: none; }
.tx-ret h3 { font-family: var(--serif); color: var(--navy); font-size: 1.1rem; margin-bottom: .2rem; }
.tx-ret .who { font-size: .78rem; color: var(--gold-text); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.tx-ret p, .tx-ret li { font-size: .86rem; }
.tx-ret ul { margin-top: .4rem; }
.tx-ret li { padding-left: 1rem; position: relative; }
.tx-ret li::before { content: "›"; position: absolute; left: 0; color: var(--gold-text); font-weight: 700; }

.tx-setoff td.cash { font-weight: 700; color: #7a1a12; }
.tx-setoff td.zero { color: var(--mid-gray); }
.tx-inline-input { width: 8.5rem; padding: 6px 8px; font: inherit; font-size: .85rem; border: 1px solid var(--light-border); border-radius: 3px; }

.tx-faq details { background: #fff; border: 1px solid var(--light-border); border-radius: 4px; margin-bottom: .6rem; overflow: hidden; }
.tx-faq summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 500; color: var(--navy); list-style: none; position: relative; padding-right: 2.5rem; }
.tx-faq summary::-webkit-details-marker { display: none; }
.tx-faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--gold-text); transition: transform .3s ease; }
.tx-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.tx-faq details > div { padding: 0 1.1rem 1rem; font-size: .9rem; animation: tx-rise .4s ease both; }
.tx-sources { font-size: .82rem; color: var(--mid-gray); }
.tx-sources a { color: var(--navy); }

@media (max-width: 960px) {
  .tx-layout { grid-template-columns: 1fr; }
  .tx-sticky { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 520px) {
  .tx-duel { grid-template-columns: 1fr; }
  .tx-step { grid-template-columns: 5.5rem 1fr 4.6rem; }
  .tx-seg button { padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tx-result::before, .tx-timeline::before, .tx-timeline li, .tx-timeline li.soon::before, [role="tabpanel"].tx-in, .tx-progress span, .tx-pulse { animation: none; }
  .tx-bar .fill, .tx-step .fill, .tx-reg, .tx-ret, .tx-ret::before, .tx-kpi, .tx-tabs [role="tab"] { transition: none; }
}
@media print {
  .tx-result { box-shadow: none; }
  .site-nav, .tx-tabs, .tool-actions, footer { display: none; }
}
