/* Depreciation calculator list and held-back depreciation tracker (build/pages/tool-depreciation.mjs). Block prefix dep- and hb-. */
.dep-life-note { margin: -8px 0 14px; color: var(--muted); }
.dep-life-note b { color: var(--text); font-weight: 650; }
.dep-preview { margin: 16px 0 18px; padding: 16px; border-radius: 14px; background: var(--sand); }
.dep-preview .tool-k { margin-bottom: 8px; }
.dep-preview .dep-big b { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.dep-preview .dep-bar { background: #fff; }
.dep-preview > :last-child, .dep-preview [data-result] > :last-child { margin-bottom: 0; }
.dep-cancel { width: 100%; justify-content: center; margin-top: 10px; min-height: 44px; }
.dep-tot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.dep-tot small { display: block; color: var(--muted); font-size: .84rem; }
.dep-tot b { display: block; font-size: clamp(1.15rem, 3.2vw, 1.6rem); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dep-tot span:nth-child(2) b { color: var(--gold-ink); }
.tool-out .dep-act { white-space: nowrap; }
.tool-out .dep-edit { border: 0; background: none; color: var(--dusk); font: inherit; font-size: .86rem; font-weight: 600; text-decoration: underline; min-width: 44px; min-height: 44px; padding: 0 6px; border-radius: 8px; cursor: pointer; }
.tool-out .dep-edit:hover { background: var(--tint); }
.tool-out td .tag { margin-top: 4px; }

.hb-hint { margin: -8px 0 16px; }
#hb textarea { width: 100%; min-height: 72px; padding: 11px 14px; border: 1.5px solid var(--tint-2); border-radius: 12px; background: #fff; color: var(--text); font: inherit; resize: vertical; }
.hb-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 12px 0 14px; }
@media (min-width: 520px) { .hb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hb-stats li { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--sand); font-size: .82rem; color: var(--muted); }
.hb-stats b { display: block; color: var(--text); font-size: 1.02rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tool-out .hb-status { min-height: 44px; padding: 8px 10px; font-size: .9rem; }
.hb-cal { border: 1.5px solid var(--tint-2); background: #fff; color: var(--dusk); border-radius: 10px; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; cursor: pointer; }
.hb-cal .icon { width: 20px; height: 20px; }
.hb-cal:hover { background: var(--tint); }
.hb-cal:disabled { opacity: .4; cursor: default; }
.tool-out tr.hb-paid td { color: var(--muted); }

@media screen and (max-width: 560px) {
  #dep-tool .tools-rows tr { grid-template-columns: repeat(3, minmax(0, 1fr)) 52px; }
  #hb .tools-rows tr { grid-template-columns: repeat(2, minmax(0, 1fr)) 52px; }
  #hb .tools-rows td:nth-child(4) { grid-column: 1 / -2; }
  #hb .tools-rows td.hb-cal-cell { grid-column: -2 / -1; grid-row: 3; }
  .tool-out .tools-rows td.dep-act { display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: normal; }
  .dep-tot { grid-template-columns: minmax(0, 1fr); }
  .dep-tot span { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
}

@media print {
  .hb-cal, .hb-cal-cell, .dep-edit, [data-restore-file] { display: none !important; }
  .hb-status { border: 0; padding: 0; appearance: none; -webkit-appearance: none; background: none; }
  .hb-stats li, .dep-preview { background: none; border: 1px solid #bbb; }
}

@media screen and (max-width: 560px) { #h-paid1, #h-due { padding-inline: 8px; } }
@media screen and (max-width: 350px) { .hb-dates { grid-template-columns: minmax(0, 1fr); } }

/* Group rows in the starting-figure life table */
.ref.dep-life .dep-grp th { background: var(--sand); color: var(--ink, inherit); font-size: .86rem; font-weight: 650; text-align: left; }
.ref.dep-life td:last-child { white-space: nowrap; }
.ref.dep-life { width: 100%; }
.ref.dep-life th, .ref.dep-life td { padding: 9px 14px; }
.ref.dep-life thead th:last-child, .ref.dep-life td:last-child { text-align: right; }
.tbl-wrap table.ref.dep-life { min-width: 0; }
