/* TaxTimes Tools - shared styles */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a4f5a;
  --ink-3: #7a808c;
  --line: #e3e1da;
  --accent: #0f6b4f;
  --accent-soft: #e3f1ea;
  --old: #b5542a;
  --old-soft: #f8e9e1;
  --focus: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 24px rgba(20, 20, 20, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --surface: #1a1d23; --ink: #eceef2; --ink-2: #b4b9c3; --ink-3: #8a909c;
    --line: #2b2f37; --accent: #46c08f; --accent-soft: #163428; --old: #ec8a5c; --old-soft: #3a241a;
    --focus: #7aa2ff; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; font-size: 18px; }
.brand span { color: var(--accent); }
.topbar nav a { color: var(--ink-2); text-decoration: none; margin-left: 18px; font-size: 14px; }

.crumbs { font-size: 13px; color: var(--ink-3); margin: 20px 0 6px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.025em; margin: 6px 0 10px; }
h2 { font-size: 22px; letter-spacing: -.015em; margin: 40px 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; }
.lede { color: var(--ink-2); max-width: 760px; margin: 0 0 8px; font-size: 17px; }
.meta { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }

.grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-3); }
.money { position: relative; }
.money::before { content: "₹"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 15px; }
input[type="text"], select {
  width: 100%; padding: 10px 12px; font: 15px var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; outline: none;
}
.money input { padding-left: 28px; font-family: var(--mono); font-size: 14px; }
input:focus, select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

details.group { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
details.group summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; justify-content: space-between; margin-bottom: 12px; }
details.group summary::-webkit-details-marker { display: none; }
details.group summary::after { content: "+"; color: var(--ink-3); }
details.group[open] summary::after { content: "−"; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--old-soft); color: var(--old); margin-left: 6px; vertical-align: 1px; }

.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }

.verdict { border-radius: var(--radius); padding: 20px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.verdict.old { background: var(--old-soft); border-color: color-mix(in srgb, var(--old) 25%, transparent); }
.verdict .k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.verdict.old .k { color: var(--old); }
.verdict .v { font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 4px 0 6px; }
.verdict p { margin: 0; color: var(--ink-2); font-size: 15px; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (max-width: 480px) { .duo { grid-template-columns: 1fr; } }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.tile .name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.dot.old { background: var(--old); }
.tile .amt { font-family: var(--mono); font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.tile .sub { font-size: 12px; color: var(--ink-3); }
.tile.win { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile.win.old { border-color: var(--old); box-shadow: inset 0 0 0 1px var(--old); }

.bars { margin-top: 18px; }
.bar { display: grid; grid-template-columns: 90px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.bar .track { height: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.bar .fill.old { background: var(--old); }
.bar .n { text-align: right; font-family: var(--mono); }

table.bd { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bd th, table.bd td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; }
table.bd th:first-child, table.bd td:first-child { text-align: left; color: var(--ink-2); }
table.bd thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
table.bd td { font-family: var(--mono); font-size: 13px; }
table.bd td:first-child { font-family: var(--font); font-size: 14px; }
table.bd tr.total td { font-weight: 800; color: var(--ink); border-bottom: 0; }
.table-scroll { overflow-x: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 14px; border-radius: 10px; font: 600 14px var(--font); cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.note { font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.prose { max-width: 760px; }
.prose p, .prose li { color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }

.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.related a { display: block; text-decoration: none; color: var(--ink); }
.related .card { padding: 16px; height: 100%; }
.related .card span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.ad-slot { min-height: 100px; margin: 24px 0; }
footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 24px 0 40px; font-size: 13px; color: var(--ink-3); }

.sticky-result { display: none; }
@media (max-width: 880px) {
  .sticky-result {
    display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20;
    background: var(--accent); color: #fff; text-decoration: none; text-align: center;
    padding: 13px 16px; border-radius: 12px; font-weight: 700; font-size: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18); transition: opacity .2s;
  }
  .sticky-result.old { background: var(--old); }
  .sticky-result.hide { opacity: 0; pointer-events: none; }
  footer { padding-bottom: 90px; }
}
@media print {
  .topbar, .actions, .sticky-result, .ad-slot, .faq, .related, footer, #inputs { display: none !important; }
  body { background: #fff; }
  .grid { grid-template-columns: 1fr; }
}
