/*
  Chores after the approved mock (docs/mockup/hauswerk-prototyp.html, "Haus" and the sheets): the room's
  chore card, the "Verstanden:" preview under the entry line, and the chore sheet. Built on the tokens of
  hauswerk.css, so light and dark follow the theme without rules of their own.
*/

/* --- room selection for people who cannot edit rooms ----------------------------- */

.hw-room-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hw-room-pick[aria-pressed="true"] .hw-room-name {
  color: var(--bsft-color-primary);
  font-weight: 700;
}

.hw-chore-sheet-who {
  margin: 0;
}

.hw-chore-quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- chore card -------------------------------------------------------------------- */

.hw-chore-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hw-chore-list > li + li {
  border-top: 1px solid var(--bsft-color-border);
}

.hw-chore-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.hw-chore-row {
  cursor: pointer;
}

.hw-chore-text {
  flex: 1;
  min-width: 0;
}

.hw-chore-text b {
  display: block;
  font-weight: 700;
}

.hw-chore-text small {
  color: var(--bsft-color-muted);
  font-size: 13px;
}

.hw-chore-rooms {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

/* One scrollable row on a phone, so the list stays in view however many rooms there are. */
.hw-pills.hw-chore-filter {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.hw-chore-filter .hw-pill {
  flex: none;
}

@media (min-width: 900px) {
  .hw-pills.hw-chore-filter {
    flex-wrap: wrap;
  }
}

/* --- entry preview --------------------------------------------------------------- */

.hw-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
  color: var(--bsft-color-muted);
}

.hw-preview:empty {
  display: none;
}

.hw-preview-part {
  background: var(--bsft-color-surface);
  border: 1px dashed var(--bsft-color-primary);
  color: var(--bsft-color-text);
  border-radius: 8px;
  padding: 3px 8px;
}

.hw-preview-part.is-missing {
  border-color: var(--bsft-color-warning);
  color: var(--bsft-color-warning);
}

/* --- pills ------------------------------------------------------------------------- */

.hw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* --- sheet ------------------------------------------------------------------------- */

.bsft-dialog-overlay:has(.hw-sheet) {
  align-items: flex-end;
  padding: 0;
}

.bsft-dialog-panel:has(> .hw-sheet) {
  max-width: 560px;
  max-height: 88%;
  padding: 0;
  border-radius: 26px 26px 0 0;
}

.hw-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 18px 22px;
}

.hw-sheet-grab {
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: var(--bsft-color-border);
  margin: 0 auto 2px;
}

.hw-sheet-title {
  margin: 0;
  font-family: var(--hw-font-display);
  font-size: 20px;
}

.hw-sheet-label {
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bsft-color-muted);
}

.hw-sheet-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--bsft-color-muted);
}

.hw-sheet-field input,
.hw-sheet-field select {
  min-height: 40px;
  color: var(--bsft-color-text);
}

.hw-sheet-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hw-sheet-summary {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--hw-surface-2);
  color: var(--bsft-color-text);
  font-size: 14px;
}

.hw-sheet-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bsft-color-danger-surface);
}

.hw-sheet-confirm p {
  margin: 0;
}

.hw-recurrence {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.hw-interval {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-interval-value {
  min-width: 2ch;
  text-align: center;
  font-family: var(--hw-font-mono);
  font-size: 18px;
}

.hw-chore-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.hw-chore-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-chore-step input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
}
