/* Rent split calculator (/tools/rent-split-calculator): room rows, extra chips, slider, result cards. */

/* Room row: colour swatch, name, size, remove button. */
.rs-room {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) clamp(76px, 28%, 120px) 36px;
  gap: 8px;
  align-items: center;
}
.rs-room-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #efe7db;
}
.rs-room-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
@media (max-width: 480px) {
  .rs-room .nk-input {
    padding: 0 10px;
    font-size: 16px;
  }
}

/* Extra toggles under each room (checkbox styled as a chip). */
.rs-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 18px;
}
.rs-chip {
  position: relative;
  cursor: pointer;
}
.rs-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.rs-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid #ddd5c8;
  background: #fffdf9;
  font-size: 13px;
  font-weight: 500;
  color: #7a6a5c;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.rs-chip:hover span {
  border-color: #c8bbae;
  color: #3b302b;
}
.rs-chip input:checked + span {
  background: #fbf3df;
  border-color: #ffb900;
  color: #2e2018;
}
.rs-chip input:focus-visible + span {
  outline: 2px solid #8b5e3c;
  outline-offset: 2px;
}

/* Shared-space slider. */
.rs-range {
  width: 100%;
  margin: 4px 0 0;
  accent-color: #8b5e3c;
  height: 28px;
  cursor: pointer;
}
.rs-range:focus-visible {
  outline: 2px solid #8b5e3c;
  outline-offset: 4px;
  border-radius: 6px;
}

/* Extra values: label + small percentage field. */
.rs-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rs-pct {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 14px;
  color: #7a6a5c;
}
.rs-pct .nk-input {
  width: 72px;
  height: 44px;
}

/* Result: big ratio, per-person cards. */
.rs-ratio {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #2e2018;
  font-size: clamp(48px, 7vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.rs-ratio[data-count='4'] {
  font-size: clamp(40px, 6vw, 60px);
}
.rs-ratio[data-count='5'],
.rs-ratio[data-count='6'] {
  font-size: clamp(34px, 5vw, 48px);
}
.rs-ratio[data-count='7'],
.rs-ratio[data-count='8'] {
  font-size: clamp(28px, 4vw, 40px);
}
.rs-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr));
  gap: 8px;
}
.rs-people li {
  background: #f7f1e8;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rs-person-name {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #7a6a5c;
  overflow-wrap: anywhere;
}
.rs-person-amount {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #2e2018;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.rs-person-note {
  margin: 0;
  font-size: 13px;
  color: #7a6a5c;
}

@media (prefers-reduced-motion: reduce) {
  .rs-chip span {
    transition: none;
  }
}

/* Result tables: tighter cells on phones so five columns fit without scrolling. */
@media (max-width: 480px) {
  .rs-compact th, .rs-compact td { padding: 9px 5px; font-size: 14px; }
  .rs-compact thead th { font-size: 10px; letter-spacing: 0.04em; }
  .rs-person-name { font-size: 13px; gap: 6px; }
}
