/* Shared activity time editor (site/assets/time-editor.js).
   Ported from the Dagplanner's daypart chips so every planner shows the same
   control; var() fallbacks because overview.html and ai-planner.html do not
   load day-planner.css and its --dp-* tokens. */

.te-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.15rem 0;
}

.te-daypart-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Selectors are two-deep on purpose: the planners' own
   `.new-activity-form button` / `.new-activity-form input` rules would
   otherwise strip the chip border and stretch the clock inputs to full width. */
.te-field .te-daypart {
  width: auto;
  margin: 0;
  border: 1px solid var(--dp-border, var(--border, #e2e8f0));
  background: var(--dp-card, #fff);
  color: var(--dp-muted, var(--text-secondary, #64748b));
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.te-field .te-daypart:hover {
  border-color: var(--dp-primary, var(--primary, #43b0b3));
  color: var(--dp-primary, var(--primary, #43b0b3));
}

.te-field .te-daypart.active {
  background: var(--dp-primary, var(--primary, #43b0b3));
  border-color: var(--dp-primary, var(--primary, #43b0b3));
  color: #fff;
}

.te-daypart-hint {
  font-size: 0.78rem;
  color: var(--dp-muted, var(--text-secondary, #94a3b8));
  margin-left: 0.25rem;
}

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

.te-time-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--dp-muted, var(--text-secondary, #64748b));
}

.te-field .te-time {
  width: auto;
  margin: 0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--dp-border, var(--border, #e2e8f0));
  border-radius: var(--dp-radius-sm, 6px);
  background: var(--dp-card, #fff);
  color: inherit;
}

.te-field .te-time:focus {
  outline: none;
  border-color: var(--dp-primary, var(--primary, #43b0b3));
}
