/* ── Hours Calculator page styles ── */

.hrs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.hrs-card + .hrs-card {
  margin-top: var(--space-5);
}
.hrs-error[hidden],
.hrs-empty[hidden],
.hrs-results[hidden],
.hrs-result[hidden],
.hrs-copy[hidden],
.hrs-remove[hidden] {
  display: none;
}

/* The rows are built by script.js; hold the space of the five default rows
   until then so the page below does not jump. */
.hrs-rows:empty {
  min-height: 446px;
}

/* One row per day: label, start, end, break, result, remove */
.hrs-row {
  display: grid;
  grid-template-columns: 5.5rem repeat(3, minmax(0, 1fr)) minmax(8.5rem, 1.1fr) 44px;
  grid-template-areas: "day start end break out remove";
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.hrs-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.hrs-day {
  grid-area: day;
  align-self: center;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}
.hrs-field-start { grid-area: start; }
.hrs-field-end { grid-area: end; }
.hrs-field-break { grid-area: break; }

.hrs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hrs-field label {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-2);
}
#hrs-tool .hrs-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
#hrs-tool .hrs-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
#hrs-tool .hrs-field input[aria-invalid="true"] {
  border-color: rgba(239, 68, 68, 0.6);
}

.hrs-row-out {
  grid-area: out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
}
.hrs-row-total {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
}
.hrs-row-note {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-3);
}
.hrs-remove {
  grid-area: remove;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hrs-remove:hover {
  color: var(--text);
  border-color: var(--border);
}
.hrs-remove:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hrs-error {
  margin: var(--space-4) 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  font-size: 13px;
}

.hrs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.hrs-hint {
  display: block;
  margin: var(--space-3) 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}
.hrs-rate {
  margin-top: var(--space-5);
  max-width: 320px;
}
.hrs-rate .hrs-hint {
  margin-top: 0;
}

.hrs-h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}
.hrs-empty {
  margin: 0;
  color: var(--text-2);
}
.hrs-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin: 0;
}
.hrs-result {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.hrs-result dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.hrs-result dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.hrs-result-main dd {
  font-size: 24px;
  color: var(--accent);
}
.hrs-copy {
  margin-top: var(--space-4);
}
.hrs-copy.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .hrs-rows:empty {
    min-height: 1081px;
  }
  .hrs-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "day remove"
      "start end"
      "break out";
    gap: var(--space-2) var(--space-3);
  }
  .hrs-remove {
    justify-self: end;
  }
}
@media (max-width: 480px) {
  .hrs-card {
    padding: var(--space-4);
  }
  #hrs-tool .hrs-field input {
    padding: 8px 6px;
  }
}
