/* Record interview (InterviewDesktop, InterviewPhone) and its correction form.  At 1024px and up the form sits in a
   white panel beside a side column with the companionship, its open needs and past interviews.  Below that the
   companionship shows as a card above the form, the households stack and Save interview sticks above the tab bar. */

.rec { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.rec-main, .rec-aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (min-width: 1024px) {
  .rec { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
}

/* The companionship: a white card on phones, a navy card in the side column on desktop. */
.rec-comp {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border-card);
  border-radius: var(--radius-card); background: #FFFFFF; box-shadow: var(--shadow-card);
}
.rec-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--walnut-700); }
.rec-eyebrow-navy { color: var(--navy-200); }
.rec-comp-name { font-family: var(--font-display); font-size: var(--type-title-sm); font-weight: var(--weight-display); color: var(--navy-950); overflow-wrap: anywhere; }
.rec-comp-tags { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.rec-rail-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 22px;
  border-radius: 16px; background: var(--navy-950); color: #FFFFFF;
}
.rec-rail-name { font-family: var(--font-display); font-size: var(--type-title-sm); font-weight: var(--weight-display); }

/* The form. */
.rec-form {
  display: flex; flex-direction: column; gap: 24px; padding: 28px; background: #FFFFFF; border: 1px solid var(--border-card);
  border-radius: 16px; box-shadow: var(--shadow-form);
}
.rec-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rec-fields .field { min-width: 0; }
.rec-modes { border: 0; margin: 0; padding: 0; min-width: 0; }
.rec-legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 10px; }
.rec-mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rec-mode {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px;
  padding: 8px 12px; border: 1px solid var(--paper-500); border-radius: var(--radius-choice); background: #FFFFFF;
  color: var(--ink-900); cursor: pointer; min-width: 0;
}
.rec-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rec-mode-label { font-size: 15px; font-weight: 700; }
.rec-mode-sub { font-size: 12px; color: var(--ink-500); }
.rec-mode:has(input:checked) {
  background: var(--navy-950); color: var(--gold-200); border: 2px solid var(--gold-500); box-shadow: var(--shadow-selected);
}
.rec-mode:has(input:checked) .rec-mode-sub { color: var(--navy-200); }
.rec-mode:has(input:focus-visible) { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.rec-section { display: flex; flex-direction: column; gap: 12px; }
.rec-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.rec-section-title { font-family: var(--font-display); font-size: var(--type-section); font-weight: var(--weight-display); color: var(--walnut-900); }
.rec-section-help { font-size: 13px; color: var(--ink-500); }
.rec-empty { font-size: 14px; color: var(--ink-500); }
.rec-entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }

/* One household, or the Companionship note.  A confidential entry gets a gold edge; a need, a ruby one. */
.rec-entry {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; border: 1px solid var(--border-card);
  border-radius: var(--radius-choice); background: #FFFFFF;
}
.rec-entry:has(.rec-need input:checked) { border: 1.5px solid var(--ruby-800); }
.rec-entry:has(.rec-confidential input:checked) { border: 1.5px solid var(--gold-500); }
.rec-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rec-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-entry-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.rec-entry-detail { font-size: 12px; color: var(--ink-500); overflow-wrap: anywhere; }
.rec-contacted { min-height: 40px; font-size: 14px; }
.rec-note-field { font-size: 13px; color: var(--walnut-900); }
.rec-note-field .textarea { min-height: 64px; font-size: 14px; font-weight: 400; resize: vertical; }
.rec-flags { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; }
.rec-hint { display: none; font-size: 12px; color: var(--ruby-800); }
.rec-need-hint { font-weight: 600; }
.rec-note:has(.rec-need input:checked) .rec-need-hint,
.rec-note:has(.rec-confidential input:checked) .rec-confidential-hint { display: block; }

/* Each place on the form holds any number of notes, with Add another note under them. */
.rec-notes, .rec-note-list { display: flex; flex-direction: column; gap: 12px; }
.rec-note { display: flex; flex-direction: column; gap: 8px; }
.rec-note + .rec-note { padding-top: 12px; border-top: 1px dashed var(--paper-300); }
.rec-note-remove, .rec-add-note {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; border: 0; background: none;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy-700);
}
.rec-note-remove { margin-left: auto; color: var(--ink-500); }
.rec-note-remove:hover, .rec-add-note:hover { color: var(--navy-950); text-decoration: underline; }
.rec-add-note { align-self: flex-start; }

/* The summary line and Save interview, kept in view while the form scrolls. */
.rec-footer {
  position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 0 -28px -28px; padding: 16px 28px; border-top: 1px solid var(--border-row); background: #FFFFFF;
  border-radius: 0 0 16px 16px;
}
.rec-summary { font-size: 13px; color: var(--ink-500); }
.rec-footer-actions { display: flex; gap: 12px; flex-shrink: 0; }

@media (max-width: 1023px) {
  .rec { gap: 18px; }
  .rec-form { padding: 0; gap: 24px; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .rec-fields { gap: 12px; }
  .rec-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-mode { min-height: 56px; }
  .rec-section-head { flex-direction: column; }
  .rec-entries { grid-template-columns: minmax(0, 1fr); }
  .rec-entry { border-radius: var(--radius-card); gap: 12px; box-shadow: var(--shadow-card); }
  .rec-entry-name { font-size: 16px; }
  .rec-contacted { min-height: 44px; }
  .rec-flags .checkbox { min-height: 40px; font-size: 14px; }
  .rec-flags .checkbox input { width: 20px; height: 20px; }
  .rec-note-field .textarea { font-size: 15px; }
  .rec-footer {
    bottom: var(--tabbar-h); flex-direction: column-reverse; align-items: stretch; gap: 8px; margin: 0 -16px;
    padding: 12px 16px; border-top: 1px solid var(--border-card); border-radius: 0; box-shadow: var(--shadow-sheet);
  }
  .rec-summary { text-align: center; font-size: 12px; }
  .rec-footer-actions { flex-direction: row-reverse; }
  .rec-footer-actions .btn { flex: 1 1 0; height: 52px; }
  .rec-save { flex-grow: 2; }
}
