.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field__label { font-size: var(--text-sm); font-weight: 500; }
.field__hint { font-size: var(--text-xs); color: var(--text-tertiary); }
.field__error { font-size: var(--text-xs); color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--control-height); padding: 0 var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--text-base);
}
.textarea { padding: var(--space-2) var(--space-3); min-height: 88px; resize: vertical; }
.select {
  appearance: none;
  padding-right: calc(var(--space-3) + 16px + var(--space-2));
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  cursor: pointer;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
/* A setting that can't change now (the planning interval once there's data): still readable, plainly not a choice. */
.input:disabled, .select:disabled, .textarea:disabled { background-color: var(--surface-muted); color: var(--text-secondary); cursor: not-allowed; }

/* A file picker: the browser's own "Choose file" button, made one of ours (a small secondary button)
   and centred in the box, with the file name beside it. */
.input[type="file"] { padding: 3px; font-size: var(--text-sm); color: var(--text-secondary); cursor: pointer; }
.input[type="file"]::file-selector-button {
  height: 28px; margin-right: var(--space-3); padding: 0 var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-muted); color: var(--text);
  font: inherit; font-size: var(--text-xs); font-weight: 500;
  cursor: pointer; transition: background-color .12s;
}
.input[type="file"]:hover::file-selector-button { background: var(--surface); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-offset: 0; }
.field--invalid .input, .field--invalid .select, .field--invalid .textarea { border-color: var(--danger); }

.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
/* Choices that go with the option above them, like the clients under "Only these clients". */
.field__choices { padding-inline-start: var(--space-5); }

.select--auto { width: auto; }
.input--short { width: 7.5rem; }
.row > .field { flex: 1 1 10rem; }
.row > .field:has(.input--short) { flex: 0 0 auto; }
.select--small { width: auto; min-width: 12rem; padding-block: 4px; font-size: var(--text-sm); }
/* A value to copy (copy_field): the box takes the room, the button keeps its size. */
.copy-field { display: flex; gap: var(--space-2); align-items: center; max-width: 44rem; }
.copy-field__value { flex: 1; min-width: 0; color: var(--text-secondary); }
.copy-field__value:focus { color: var(--text); }

.token { padding: 4px var(--space-2); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: var(--text-sm); word-break: break-all; }
.input--date { width: auto; }

/* Choosing someone by typing (issue #104): the matches in a list under the box. */
.picker { position: relative; }
.picker__list {
  position: absolute; inset-inline: 0; top: 100%; z-index: 10;
  margin: 4px 0 0; padding: var(--space-1); list-style: none;
  max-height: 18rem; overflow-y: auto;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-raised);
  font-size: var(--text-sm);

  [role=option] { padding: 6px var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
  [role=option]:hover, [aria-selected=true] { background: var(--surface-muted); }
}
.picker__none { padding: 6px var(--space-2); color: var(--text-tertiary); }

/* A long list of boxes to tick, narrowed by a filter (issue #123). */
.checklist {
  display: flex; flex-direction: column; gap: var(--space-1);
  max-height: 22rem; overflow-y: auto; padding: var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.checklist [hidden] { display: none; }

/* Line adherence on a service target (issue #278): its settings show once it's ticked. */
.line-adherence { flex-basis: 100%; border: 0; padding: 0; margin: 0; }
.line-adherence:not(:has(input[type="checkbox"]:checked)) :is(.field, .field__hint) { display: none; }

/* Adding Erlangly to an authenticator app (planning/29_Two_Step_Sign_In.md): the QR code beside what to do, under it
   on a phone. The code stays black on white in either theme, so every phone's camera reads it. */
.authenticator {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start;

  & > .stack { flex: 1 1 16rem; }
}

.qr-code { flex: none; width: 11rem; height: 11rem; background: #fff; fill: #000; border-radius: var(--radius-sm); }

.authenticator__key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
