/* HRA calculator + rent receipts: only what app.css doesn't cover. */
.tool-head .pill { margin-bottom: 12px; }
#hra-form fieldset, #rr-form fieldset { margin-bottom: 0; gap: 8px; }
#hra-form legend, #rr-form legend { font: 700 15px/1.3 var(--font); margin-bottom: 8px; }
#hra-form, #rr-form { display: grid; gap: 16px; }
.hra-inr { position: relative; display: grid; }
.hra-inr::before { content: '₹'; position: absolute; left: 14px; line-height: 50px; color: var(--muted); font-weight: 400; pointer-events: none; }
.hra-inr input { padding-left: 30px; }
.upper { text-transform: uppercase; }

/* Result card */
.hra-out { display: grid; gap: 12px; }
.hra-h2 { margin: 0; font-size: 20px; }
.hra-label, .hra-sub { margin: 0; color: var(--muted); font-size: 14px; }
.hra-big { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1; color: var(--leaf); }
.hra-limits { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 6px; }
.hra-limits li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; }
.hra-limits li.win { border-color: var(--leaf); background: var(--leaf-soft); color: var(--leaf-ink); }
.hra-limits em { flex-basis: 100%; font-style: normal; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hra-why { margin: 0; }
.hra-warn { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.hra-warn .hot { color: var(--warn); }
.hra-fine { margin-top: 4px; }
.rr-pan-msg:empty { display: none; }
#rr-form [hidden], #hra-form [hidden] { display: none; }

/* Repeating rows (salary parts, tenancies): a folded row is its one-line summary. */
.rr-stack { display: grid; gap: 12px; }
.rr-row, .rr-box { padding: 14px 16px; }
.rr-row[open] { border: 2px solid var(--ink); }
.rr-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.rr-sum::-webkit-details-marker { display: none; }
.rr-sum > span:first-child { display: grid; gap: 2px; min-width: 0; }
.rr-sum small { font-size: 13px; font-weight: 400; color: var(--muted); }
.rr-tag { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf-ink); white-space: nowrap; }
.rr-tag:empty { display: none; }
#rr-form .rr-fields, #hra-form .rr-fields { margin: 12px 0 0; gap: 12px; min-width: 0; }
.rr-box .hint { margin-top: 6px; }
.rr-edit summary { cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: underline; }
.rr-edit .row { margin-top: 10px; }
.rr-add { display: flex; gap: 8px; }
.rr-dash { flex: 1; border: 1.5px dashed var(--field); background: transparent; }
.rr-del { justify-self: start; font-size: 14px; padding: 8px 14px; }
.rr-part { display: block; }
.prac { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); vertical-align: middle; }
.rr-part .prac { background: var(--surface); }
.hra-k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hra-parts { list-style: none; margin: 0; padding: 0; display: grid; }
.hra-parts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }

/* Receipts: stacked with dashed cut lines; three fit on an A4 page. */
.rr-sheet { padding: 0; }
.rr { padding: 20px clamp(16px, 4vw, 28px); border-bottom: 1px dashed #a8a29e; break-inside: avoid; line-height: 1.6; }
.rr:last-child { border-bottom: 0; }
.rr header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.rr header strong { letter-spacing: .08em; }
.rr p { margin: 6px 0; }
.rr-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rr-blank { display: inline-block; border-bottom: 1px solid #1c1917; min-width: 14em; height: 1em; vertical-align: baseline; }
.rr-blank.short { min-width: 8em; }
.rr-stamp { width: 72px; height: 80px; border: 1px dashed #78716c; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: #57534e; padding: 4px; }
.rr-sign { border-top: 1px solid #1c1917; padding-top: 4px; min-width: 12em; text-align: center; font-size: 13px; }

@media print {
  .rr-sheet { border: 0; box-shadow: none; }
  .rr { height: 90mm; overflow: hidden; padding: 6mm 0; font-size: 12px; }
  .rr:nth-child(3n) { break-after: page; border-bottom: 0; }
}
