/* Hours & Timesheet Calculator. Only this tool's own pieces; everything else is the shared tool frame.
   Colours come from the site's variables only (tests/catalogue.test.mjs checks there are no hex values here). */

/* ---------- sessions: one row each, folding to a line once it counts ---------- */
.ht-rows { margin: 0 0 12px; padding: 0; list-style: none; }
.ht-row { border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--silver); background: var(--white); }
.ht-row + .ht-row { margin-top: 10px; }
.ht-row.has-problem { box-shadow: inset 0 0 0 2px var(--graphite); }
.ht-row__sum { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0; }
.ht-row.is-open .ht-row__sum { display: none; }
.ht-row__open { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px 8px 14px; border: 0; background: none; font: inherit; font-size: 15px; text-align: left; color: var(--graphite); cursor: pointer; }
.ht-row__what { min-width: 0; overflow-wrap: anywhere; }
.ht-keep { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.ht-row__hrs { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.ht-row__x { min-width: 44px; min-height: 44px; }
.ht-row__edit { display: none; padding: 12px 14px 14px; }
.ht-row.is-open .ht-row__edit { display: grid; gap: 12px; }
.ht-row__n { margin: 0; font-size: 14px; font-weight: 600; color: var(--slate); }
.ht-f { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 500; }
.ht-f .input { width: 100%; min-width: 0; font-size: 17px; min-height: 48px; }
.ht-times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 7.5em); gap: 10px; align-items: end; }
.ht-time { font-variant-numeric: tabular-nums; }
.ht-next { display: flex; width: 100%; min-height: 44px; font-size: 16px; font-weight: 600; }
.ht-next[hidden] { display: none; }
.ht-next input { width: 22px; height: 22px; }
.ht-row__warn, .ht-row__clock { margin: 0; }
.ht-row__btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 420px) {
  .ht-row__open { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
  .ht-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ht-f--brk { grid-column: 1 / -1; }
}
.ht-adds { display: flex; flex-wrap: wrap; gap: 8px; }
.ht-adds .btn[disabled] { opacity: .45; cursor: not-allowed; }
#ht-same-hint { margin-top: 6px; }

.ht-money { position: relative; display: flex; align-items: center; max-width: 14em; }
.ht-sym { position: absolute; left: 14px; font-size: 18px; color: var(--slate); pointer-events: none; }
.ht-amount { padding-left: 32px; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- the timesheet ---------- */
.ht-meta { display: grid; gap: 4px; margin: 0 0 16px; font-size: 14.5px; }
.ht-meta div { display: flex; gap: 10px; }
.ht-meta dt { min-width: 5.5em; color: var(--slate); }
.ht-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ht-empty { margin: 0; padding: 26px 0 14px; font-size: 15px; color: var(--steel); }
.ht-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ht-table th, .ht-table td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--silver); text-align: left; vertical-align: top; }
.ht-table th { font-size: 12.5px; font-weight: 600; color: var(--slate); }
.ht-table td:last-child { overflow-wrap: anywhere; }
.ht-table td:nth-child(2), .ht-table td:nth-child(3), .ht-table td:nth-child(4) { white-space: nowrap; }
.ht-table .ht-num { text-align: right; white-space: nowrap; padding-right: 12px; }
.ht-dec { display: block; font-size: 12px; color: var(--slate); }
.ht-nd { display: block; font-size: 11.5px; color: var(--slate); }
.ht-day td { font-weight: 600; color: var(--graphite); border-bottom-color: var(--steel); }
.ht-total { margin-top: 14px; }
.ht-total__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 8px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.ht-total__row span { color: var(--slate); }
.ht-total__row strong { font-size: 18px; text-align: right; }
.ht-total__amt { border-top: 1px solid var(--silver); }
.ht-note { margin: 8px 0 0; font-size: 12.5px; color: var(--slate); }
.ht-sign { display: grid; gap: 22px; margin-top: 28px; }
.ht-sign[hidden] { display: none; }
.ht-sign p { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin: 0; }
.ht-sign span { padding-top: 26px; border-bottom: 1px solid var(--graphite); font-size: 12.5px; color: var(--slate); }
@media (max-width: 520px) {
  .ht-table { font-size: 12.5px; }
  .ht-table th, .ht-table td { padding-right: 4px; }
  .ht-table th { font-size: 11.5px; }
}
@media (max-width: 400px) {
  .ht-table { font-size: 11.5px; }
  .ht-table th, .ht-table td { padding-right: 3px; }
  .ht-table td:nth-child(4) { white-space: normal; }
  .ht-table .ht-num { padding-right: 6px; }
}
@media (max-width: 360px) { .ht-table .ht-num { white-space: normal; } }
@media print { .ht-table { font-size: 11pt; } .ht-row__clock { display: none; } }
