/* Artha calculators on npcorner.in. Builds on /assets/npcorner.css (its colours, fonts, masthead). */
.calc-hero { text-align: center; padding: 2.6rem 0 1.4rem; }
.calc-hero .kicker a { color: inherit; text-decoration: none; }
.calc-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: .2rem auto 0; }
.calc-hero .lede { margin-top: .7rem; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1.4rem; align-items: start; }
.calc > *, .calc form > *, .kpis > * { min-width: 0; }
.calc-card { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); padding: 1.3rem 1.4rem; }
.calc-card h2 { font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin: 0 0 .9rem; }

.calc form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem .9rem; font-family: var(--sans); }
.calc form label { display: grid; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.calc form label.check { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.calc form .help { font-weight: 400; font-size: .74rem; }
.calc input, .calc select { font: inherit; font-size: .95rem; font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 10px; padding: .55rem .7rem; width: 100%; font-variant-numeric: tabular-nums; }
.calc input[type="checkbox"] { width: auto; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--t-artha); outline-offset: 1px; }
.calc-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.calc-actions button { font: inherit; font-weight: 600; cursor: pointer; background: none; border: 1px solid var(--rule); border-radius: 99px; padding: .35rem .9rem; color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.kpi { --tone: var(--t-artha); position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .9rem 1rem; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone); }
.kpi.t2 { --tone: var(--gold); } .kpi.t3 { --tone: var(--accent); } .kpi.t4 { --tone: var(--t-markets); }
.kpi-label, .kpi-note { font-family: var(--sans); margin: 0; }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: .15rem 0; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value.small { font-size: 1.25rem; }
.kpi-note { font-size: .76rem; color: var(--muted); line-height: 1.45; }
.error { font-family: var(--sans); background: var(--accent-soft); color: var(--accent); padding: .8rem 1rem; border-radius: 12px; margin: 0; }

.chart-box { margin-top: .9rem; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .9rem 1rem .6rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--rule); }
.chart .axis { fill: var(--muted); font: 11px var(--sans); }
.chart .s1 { fill: var(--t-artha); } .chart .s2 { fill: var(--gold); }
.chart .line { fill: none; stroke: var(--t-artha); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: var(--t-artha); opacity: .12; }
.chart .hit { fill: transparent; } .chart .hit:hover { fill: var(--t-artha); fill-opacity: .08; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.legend i.s1 { background: var(--t-artha); } .legend i.s2 { background: var(--gold); }

.table-box { margin-top: 1.2rem; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .8rem 1rem; }
.table-box summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.table-box .scroll { overflow-x: auto; margin-top: .6rem; }
.table-box table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .84rem; font-variant-numeric: tabular-nums; }
.table-box th { text-align: right; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .4rem .5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table-box td { text-align: right; padding: .45rem .5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table-box th:first-child, .table-box td:first-child { text-align: left; }
.table-box td:last-child { font-weight: 600; }
.table-box tr.mark td { background: var(--gold-soft); }
.note { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin: .9rem 0 0; line-height: 1.6; }

.explain { max-width: 46rem; margin: 2.4rem auto 0; }
.explain h2 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; margin: 1.8rem 0 .4rem; }
.explain p, .explain li { color: var(--ink); }
.explain .formula { font-family: var(--sans); background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: .8rem 1rem; overflow-x: auto; }
.explain details { border-bottom: 1px solid var(--rule); padding: .7rem 0; }
.explain summary { cursor: pointer; font-weight: 600; }
.artha-note { max-width: 46rem; margin: 2rem auto 0; padding: 1.1rem 1.3rem; border: 1px dashed var(--t-artha); border-radius: 14px; font-family: var(--sans); font-size: .9rem; color: var(--muted); }
.artha-note b { color: var(--ink); }
.related { max-width: 46rem; margin: 1.6rem auto 0; font-family: var(--sans); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.related a { border: 1px solid var(--rule); border-radius: 99px; padding: .25rem .8rem; text-decoration: none; color: var(--ink); background: var(--card); }
.related a:hover { border-color: var(--t-artha); color: var(--t-artha); }

.calc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.calc-cards a { display: flex; flex-direction: column; gap: .35rem; background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--t-artha);
  border-radius: 16px; padding: 1.1rem 1.2rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
.calc-cards a:hover { transform: translateY(-2px); }
.calc-cards h3 { font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin: 0; }
.calc-cards p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.calc-cards span { margin-top: auto; padding-top: .4rem; font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--t-artha); }

@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .calc form, .kpis { grid-template-columns: minmax(0, 1fr); }
  .calc-card { padding: 1.1rem 1rem; }
  .kpi-value { font-size: 1.35rem; }
}
