/**
 * Dayly — habit editor and activity logging.
 */

/* ---------------------------------------------------------------------------
 * Numeric habit steppers (count / quantity / duration)
 * ------------------------------------------------------------------------- */

.habit-count {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  min-width: 62px;
  text-align: right;
}

.habit-count__target {
  color: var(--text-tertiary);
  font-weight: var(--weight-regular);
}

.habit-step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: var(--text-body);
  line-height: 1;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.habit-step:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
 * Activity list
 * ------------------------------------------------------------------------- */

.act-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.act-item {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  text-align: left;
  min-height: 44px;
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}

.act-item:hover { background: var(--surface-3); }

.act-item__name {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
}

.act-item__meta {
  font-size: var(--text-caption);
  color: var(--text-secondary);
  text-align: right;
}

/* ---------------------------------------------------------------------------
 * Chips — compact single-select rows inside sheets
 * ------------------------------------------------------------------------- */

.opts--chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  grid-template-columns: none;
}

.chip {
  padding: var(--space-2) var(--space-4);
  min-height: 38px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.chip:hover { background: var(--surface-3); color: var(--text); }

/* Selection carries both a border and a fill, never colour alone. */
.chip.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
 * Habit editor
 * ------------------------------------------------------------------------- */

.hb-target-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-2);
}

.hb-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}

.hb-day {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.hb-day.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

textarea.input {
  min-height: 76px;
  resize: vertical;
  line-height: var(--leading-normal);
}

/* ---------------------------------------------------------------------------
 * Tappable settings rows
 * ------------------------------------------------------------------------- */

.set-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  min-height: 44px;
  justify-content: center;
  padding-right: var(--space-3);
}

.set-link__name {
  font-size: var(--text-small);
  color: var(--text);
}

.set-link__meta {
  font-size: var(--text-caption);
  color: var(--text-tertiary);
}

.set-link:hover .set-link__name { color: var(--accent); }
