/* routines: the project's routine rows, the new-routine form and the proposed count. */
/* A proposed routine waits for the owner and wears the amber of "waits for
   a human"; the other states stay in the plain ink. */

.routines-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@container settings (min-width: 40rem) {
  .routines-block { grid-column: 1 / -1; }
}

.routines-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.routines-head .field-label { margin-bottom: 0; }

.routines-notice {
  font-family: var(--font-sans);
  font-size: var(--fs-12, 0.75rem);
  color: var(--attn);
}

.routines-list { display: flex; flex-direction: column; gap: 0.5rem; }

.routines-empty {
  font-family: var(--font-sans);
  font-size: var(--fs-12, 0.75rem);
  color: var(--prose-dim);
}

.routine-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--rope);
  border-left: 3px solid var(--rope);
}
.routine-row.state-proposed {
  border-color: var(--attn);
  border-left-color: var(--attn);
}

.routine-row-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.routine-schedule {
  font-family: var(--font-mono);
  font-size: var(--fs-12, 0.75rem);
  color: var(--paper-white);
}

.routine-next {
  font-family: var(--font-mono);
  font-size: var(--fs-11, 0.6875rem);
  color: var(--prose-dim);
}

.routine-state {
  font-family: var(--font-label);
  font-size: var(--fs-10, 0.625rem);
  letter-spacing: var(--track, 0.1em);
  text-transform: var(--caps, uppercase);
  color: var(--glow-dim);
}
.routine-state.state-proposed { color: var(--attn); }
.routine-state.state-on { color: var(--signal-green); }

.routine-text {
  font-family: var(--font-sans);
  font-size: var(--fs-12, 0.75rem);
  line-height: 1.4;
  color: var(--bone-2, var(--paper-white));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.routine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.routines-form, .routine-edit {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.routines-form input[type="text"],
.routine-edit input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: var(--fs-12, 0.75rem);
}
.routines-form > .btn, .routine-edit > .btn { align-self: flex-start; }
.routine-edit .routine-actions { margin-top: 0.25rem; }

.routines-hint {
  margin: 0;
  max-width: 60ch;
  font-family: var(--font-sans);
  font-size: var(--fs-11, 0.6875rem);
  line-height: 1.4;
  color: var(--glow-dim);
}

.routines-error {
  font-family: var(--font-sans);
  font-size: var(--fs-12, 0.75rem);
  color: var(--danger);
  overflow-wrap: anywhere;
}

/* A phone: text fields stay at 16px so the page never zooms on focus, and
   every button keeps a thumb's height. */
@media (max-width: 700px), (pointer: coarse) {
  .routines-form input[type="text"], .routines-form textarea,
  .routine-edit input[type="text"], .routine-edit textarea { font-size: 16px; }
  .routine-actions .btn, .routines-form .btn {
    min-height: 44px;
    font-size: var(--fs-16, 1rem);
  }
}
