/* The day's Recap: one card, opened by its own title row.
 *
 * The state the panel is in — Ready, still running, provisional, refused — is
 * a pill beside the word "Recap" rather than a line of its own, because it
 * qualifies the Recap and reads as part of its title.
 */

.recap-panel {
  margin-top: 0;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 1px 2px var(--shadow-hair), 0 16px 40px var(--shadow-card);
}

.recap-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.recap-title-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.recap-panel h2 {
  font-size: 1.35rem;
}

.recap-state {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: var(--signal);
  background: color-mix(in srgb, var(--signal) 9%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}

.recap-state::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--signal);
}

.recap-state:empty {
  display: none;
}

.recap-title {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.recap-title:empty {
  display: none;
}

/* The Device is chosen once for the whole page, above this panel; a Recap is
 * of that Device. The Recaps and Stats views keep their own selector, which is
 * why these rules stay. */
.recap-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.recap-device-label {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.recap-actions select {
  height: 2.4rem;
  max-width: 14rem;
  font-size: 0.85rem;
}

@media (max-width: 46rem) {
  .recap-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* What the Profile read of a closed Day: one Health row and the day's Visits. */
.profile-day {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 1px 2px var(--shadow-hair), 0 16px 40px var(--shadow-card);
}

.profile-day h2 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.health-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin: 0;
}

.health-row div {
  min-width: 0;
}

.health-row dt {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.health-row dd,
.visit-list {
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.visit-list {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  list-style: none;
}

.visit-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.6rem;
  align-items: baseline;
}

.visit-time {
  color: var(--ink-muted);
}

.visit-pin {
  text-decoration: none;
}

/* The row's one ellipsis (`visit_row.ts`): borderless, at the end of the line. */
.visit-menu-toggle {
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
  border-color: transparent;
  background: transparent;
}

.visit-list .visit-error,
.visit-form {
  flex-basis: 100%;
}

.visit-list .visit-error {
  margin: 0.2rem 0 0;
}

/* Naming opens inside the row, under it: the field with the candidate chip
   beside it, then Save and Cancel. */
.visit-name-form {
  display: grid;
  gap: 0.6rem;
  margin: 0.4rem 0 0.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-firm);
  border-radius: 0.9rem;
  font-variant-numeric: normal;
}

.visit-name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.visit-name-input {
  flex: 1 1 8rem;
  min-width: 0;
}

.visit-name-line .visit-candidate {
  margin-inline-start: 0;
  color: var(--ink);
  font-size: 0.85rem;
}

.visit-name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.visit-name-form .error {
  margin: 0;
}
