/* Utility split calculator (/tools/utility-split-calculator): people rows, WFH stepper,
   bill rows with a type select, daytime-share slider and per-person result cards.
   Builds on the shared "Free tools" classes in site.css (.nk-input, .nk-table, ...). */

/* ---- People ---- */
.ut-person {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: #f7f1e8;
}
.ut-person__name {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}
.ut-person__fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}
.ut-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #7a6a5c;
}
.ut-stepper {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 6px;
  align-items: center;
}
.ut-stepper .nk-input {
  text-align: center;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.ut-stepper button {
  width: 40px;
  height: 40px;
  border: 1.5px solid #ddd5c8;
  border-radius: 50%;
  background: #fffdf9;
  color: #3b302b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.ut-stepper button:hover:not(:disabled) {
  background: #f2ebe0;
  border-color: #8b5e3c;
}
.ut-stepper button:disabled {
  opacity: 0.4;
  cursor: default;
}
.ut-stepper button:focus-visible,
.ut-range:focus-visible {
  outline: 2px solid #8b5e3c;
  outline-offset: 2px;
}
.ut-person input[type='number']::-webkit-inner-spin-button,
.ut-person input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ut-person .nk-icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.ut-person .nk-icon-btn:disabled:hover {
  background: transparent;
}

/* ---- Bills ---- */
.ut-bill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(80px, 24%, 120px) 104px 36px;
  gap: 8px;
  align-items: center;
}
.ut-bill--head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b5e3c;
}
.ut-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  font-size: 15px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b5e3c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
@media (max-width: 520px) {
  .ut-bill {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ede5d8;
  }
  .ut-bill__name {
    grid-column: 1 / 3;
  }
  .ut-bill__remove {
    grid-column: 3;
    grid-row: 1;
  }
  .ut-bill__amount {
    grid-column: 1;
    grid-row: 2;
  }
  .ut-bill__type {
    grid-column: 2;
    grid-row: 2;
  }
  .ut-bill--head {
    display: none;
  }
  .ut-bill .nk-input {
    padding: 0 10px;
    font-size: 16px;
  }
  .ut-bill .ut-select {
    padding-right: 30px;
  }
}

/* ---- Daytime share slider ---- */
.ut-range {
  width: 100%;
  margin: 10px 0 0;
  accent-color: #8b5e3c;
  height: 28px;
  cursor: pointer;
}

/* ---- Result ---- */
.ut-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.ut-card {
  background: #f7f1e8;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ut-card p {
  margin: 0;
}
.ut-card__who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #7a6a5c;
  overflow-wrap: anywhere;
}
.ut-card__amount {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #2e2018;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ut-card__diff {
  font-size: 13px;
  color: #7a6a5c;
  font-variant-numeric: tabular-nums;
}
.ut-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #ede5d8;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #7a6a5c;
  vertical-align: 1px;
}
.nk-table tbody th[scope='row'] {
  text-align: left;
  padding-left: 0;
  font-weight: 500;
  color: #3b302b;
}
@media (prefers-reduced-motion: reduce) {
  .ut-stepper button {
    transition: none;
  }
}
@media (max-width: 520px) { .ut-tag { display: none; } }
