:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface-2: #f1f4f3;
  --text: #15201d;
  --muted: #5b6763;
  --line: #dfe5e3;
  --brand: #0f766e;
  --brand-strong: #0b5c56;
  --brand-soft: #e3f3f0;
  --accent: #c2410c;
  --accent-soft: #fdeee6;
  --good: #15803d;
  --chart-1: #0f766e;
  --chart-2: #f59e0b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 22, .05), 0 6px 24px rgba(16, 24, 22, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412;
    --surface: #151d1a;
    --surface-2: #1b2622;
    --text: #e7eeeb;
    --muted: #9aa8a3;
    --line: #2a3632;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --brand-soft: #123a35;
    --accent: #fb923c;
    --accent-soft: #3a2316;
    --good: #4ade80;
    --chart-1: #2dd4bf;
    --chart-2: #fbbf24;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow > * { max-width: 780px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand b { color: var(--brand); }
.brand-mark { width: 30px; height: 30px; color: var(--brand); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); width: 44px; height: 44px; padding: 10px; cursor: pointer; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
}

/* Hero */
.hero { padding: 40px 0 24px; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { font-size: .8rem; background: var(--brand-soft); color: var(--brand-strong); padding: 4px 10px; border-radius: 999px; font-weight: 600; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-card { display: block; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.tool-card h3 { margin: 10px 0 6px; }
.tool-card p { color: var(--muted); margin: 0; font-size: .95rem; }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.tool-icon svg { width: 24px; height: 24px; }
.tool-card.soon { opacity: .65; pointer-events: none; }
.tag-soon { font-size: .7rem; background: var(--surface-2); color: var(--muted); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* Calculator layout */
.calc { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .calc { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } .calc .results { position: sticky; top: 76px; } }
fieldset { border: 0; margin: 0 0 8px; padding: 0; }
legend { font-weight: 700; font-size: 1rem; margin-bottom: 10px; padding: 0; }
.section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.row2 { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.money { position: relative; }
.money::before { content: "₹"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money input[type="text"] { padding-left: 28px; }
.suffix { position: relative; }
.suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: .9rem; }
.suffix input[type="number"] { padding-right: 56px; }
input[type="text"], input[type="number"], input[type="month"], select {
  width: 100%; height: 46px; padding: 0 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="range"] { width: 100%; accent-color: var(--brand); margin: 10px 0 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin: 6px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow); }
details.more { margin-top: 8px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 8px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "– "; }
.only-old { border-left: 3px solid var(--accent); padding-left: 12px; }
.only-old-note { font-size: .8rem; color: var(--accent); font-weight: 600; margin: -4px 0 10px; }

/* Results */
.results h2 { margin: 0 0 12px; font-size: 1.15rem; }
.big { font-size: clamp(1.9rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.verdict { background: var(--brand-soft); color: var(--brand-strong); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.verdict strong { display: block; font-size: 1.1rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.compare .box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.compare .box.win { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.compare .box .k { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.compare .box .v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.compare .box .s { font-size: .8rem; color: var(--muted); }
.win-tag { display: inline-block; font-size: .7rem; background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
@media (prefers-color-scheme: dark) { .win-tag { color: #04201c; } }
.kv { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.kv th, .kv td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); }
.kv tr.total th, .kv tr.total td { font-weight: 800; color: var(--text); border-bottom: 0; }
.kv td.neg { color: var(--good); }
.tip { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.stat .k { font-size: .8rem; color: var(--muted); }
.stat .v { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.donut-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.donut { width: 140px; height: 140px; flex: none; }
.legend { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.legend li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.save { color: var(--good); font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 560px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--surface-2); font-weight: 700; position: sticky; top: 0; }
table.data tr.year-row { cursor: pointer; }
table.data tr.year-row:hover { background: var(--surface-2); }
table.data tr.month-row td { color: var(--muted); font-size: .85rem; background: var(--surface-2); }
.caret { display: inline-block; width: 1em; transition: transform .15s; }
tr.open .caret { transform: rotate(90deg); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #04201c; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Article content */
.content { padding-bottom: 40px; }
.content table:not(.data) { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .95rem; }
.content table:not(.data) th, .content table:not(.data) td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.content table:not(.data) th { background: var(--surface-2); }
.content ul, .content ol { padding-left: 1.3rem; }
.content li { margin-bottom: .4rem; }
.formula { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; overflow-x: auto; }
details.faq { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
details.faq > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; float: right; color: var(--muted); }
details.faq[open] > summary::after { content: "–"; }
details.faq > p { padding: 0 16px 14px; margin: 0; color: var(--muted); }
.updated { font-size: .85rem; color: var(--muted); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 0 16px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.footer-h { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }

/* Embed mode (calculator shown inside another website) */
.embed-credit { display: none; }
.embed-code { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); resize: vertical; }
html.embed body { background: var(--surface); }
html.embed .site-header, html.embed .site-footer, html.embed article.content, html.embed .embed-box,
html.embed .hero .lead, html.embed .hero .badges, html.embed .crumbs, html.embed .cta, html.embed [data-share] { display: none !important; }
html.embed .hero { padding: 12px 0 8px; }
html.embed .hero h1 { font-size: 1.4rem; }
html.embed .calc .results { position: static; }
html.embed .embed-credit { display: block; text-align: center; font-size: .85rem; margin: 16px 0; }

@media print {
  .site-header, .site-footer, .actions, .nav-toggle, .content .faq-wrap { display: none !important; }
  body { background: #fff; }
}

/* Tax calendar */
.next-up { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.next-up .k { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cal-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.cal-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px; }
.cal-item.urgent { border-color: var(--accent); }
.cal-date { flex: none; width: 76px; text-align: center; background: var(--brand-soft); color: var(--brand-strong); border-radius: 12px; padding: 8px 4px; font-size: .8rem; font-weight: 600; }
.cal-date .cal-day { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.urgent .cal-date { background: var(--accent-soft); color: var(--accent); }
.cal-body { min-width: 0; flex: 1; }
.cal-body h3 { margin: 0 0 4px; }
.cal-body p { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-left { font-weight: 700; font-size: .85rem; margin-right: 4px; }
.urgent .cal-left { color: var(--accent); }
@media (max-width: 480px) { .cal-item { flex-direction: column; } .cal-date { width: auto; display: flex; gap: 8px; align-items: baseline; padding: 6px 12px; } .cal-date .cal-day { display: inline; font-size: 1.2rem; } }

/* Rent receipts */
.receipts { display: grid; gap: 16px; }
.receipt { background: #fff; color: #111; border: 1.5px dashed #999; border-radius: 8px; padding: 18px 20px; font-size: .95rem; line-height: 1.55; }
.receipt-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid #ddd; padding-bottom: 8px; margin-bottom: 10px; }
.receipt-head strong { letter-spacing: .08em; }
.receipt-head span { color: #555; font-size: .85rem; }
.receipt p { margin: 0 0 14px; }
.receipt-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.stamp { width: 70px; height: 80px; border: 1px solid #999; display: grid; place-items: center; text-align: center; font-size: .7rem; color: #777; }
.sign { text-align: right; font-size: .88rem; }
.sign-line { width: 180px; border-bottom: 1px solid #333; margin: 28px 0 6px auto; }
@media print {
  html.print-receipts body * { visibility: hidden; }
  html.print-receipts #receipts, html.print-receipts #receipts * { visibility: visible; }
  html.print-receipts #receipts { position: absolute; left: 0; top: 0; width: 100%; display: block; }
  html.print-receipts .receipt { break-inside: avoid; margin: 0 0 14px; border-color: #666; }
  html.print-receipts .receipt:nth-child(3n) { break-after: page; }
}

/* Line chart */
.chart-card { padding: 16px; }
.line-chart { width: 100%; height: auto; display: block; }
.legend-row { display: flex; gap: 18px; font-size: .9rem; margin-bottom: 8px; }
.legend-row .dot { display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Article tables on small screens */
.scroll-x { overflow-x: auto; margin: 0 0 1rem; }
.scroll-x table { margin: 0; }
@media (max-width: 480px) {
  .content table:not(.data) { font-size: .85rem; }
  .content table:not(.data) th, .content table:not(.data) td { padding: 6px 7px; }
}
