/* Prospects and trial training ("Interessenten", approved Codex design docs/design/interessenten-v2).
   Lives inside the guided-admission page, so the shared admission v2 classes (av-*) do the heavy lifting; this file adds
   what is specific to the prospect list, the three steps, the detail view and the "already known?" check.
   Colours and sizes come only from the shared tokens (--ui-*): white text sits on every red (--ui-action) surface,
   light, dark and the HAYO palette follow theme.css. Main targets are 64 px high (4rem), secondary ones 48 px. */
.ad-body.ui #ad-prospects.ip-screen { margin-top: 0; }
.ad-body.ui .ad-shell .ip-screen .av-help { align-items: center; }
.ad-body.ui .ad-shell .ip-screen .av-help > span:first-child { display: inline-flex; }

/* Notice after saving */
.ad-body.ui .ad-shell .ip-notice { margin: 0 0 1.5rem !important; padding: 1rem 1.4rem; border-radius: 12px; border: 1px solid var(--ui-success); background: var(--ui-success-bg); color: var(--ui-success); font-weight: 650; font-size: 1.1rem; }
.ad-body.ui .ad-shell .ip-notice[hidden] { display: none; }
.ad-body.ui .ad-shell .ip-notice:focus-visible { outline: 4px solid var(--av-focus); outline-offset: 3px; }

/* Filter chips and search */
.ad-body.ui .ad-shell .ip-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.ad-body.ui .ad-shell .ip-tools[hidden] { display: none; }
.ad-body.ui .ad-shell .ip-filters { display: flex; flex-wrap: wrap; gap: .6rem; }
.ad-body.ui .ad-shell .ip-chip { min-height: 4rem; padding: .6rem 1.2rem; border: 1.5px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); color: var(--ui-ink); font: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation; }
.ad-body.ui .ad-shell .ip-chip:hover { border-color: var(--ui-primary); }
.ad-body.ui .ad-shell .ip-chip[aria-pressed="true"] { border-color: var(--ui-primary); background: var(--av-soft); }
.ad-body.ui .ad-shell .ip-search { display: grid; gap: .35rem; min-width: min(100%, 18rem); color: var(--ui-muted); font-weight: 600; }
.ad-body.ui .ad-shell .ip-search input { min-height: 4rem; padding: .7rem 1.1rem; border: 1.5px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); color: var(--ui-ink); font: inherit; font-size: 1.3rem; }

/* Rows: a person is one clear line */
.ad-body.ui .ad-shell .ip-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.ad-body.ui .ad-shell .ip-row { width: 100%; min-height: 4rem; display: grid; grid-template-columns: 3.2rem minmax(0, 1.2fr) auto minmax(0, 1.6fr) 1.6rem; align-items: center; gap: 1.2rem; padding: 1rem 1.4rem; border: 1.5px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.ad-body.ui .ad-shell .ip-row:hover { border-color: var(--ui-primary); }
.ad-body.ui .ad-shell .ip-row.fresh { border-color: var(--ui-primary); background: var(--av-soft); }
.ad-body.ui .ad-shell .ip-avatar { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--av-soft); color: var(--ui-primary); font-weight: 700; font-size: 1.05rem; }
.ad-body.ui .ad-shell .ip-name { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ad-body.ui .ad-shell .ip-meta { display: grid; gap: .1rem; min-width: 0; }
.ad-body.ui .ad-shell .ip-meta strong { font-weight: 650; overflow-wrap: anywhere; }
.ad-body.ui .ad-shell .ip-meta span { color: var(--ui-muted); font-size: 1.05rem; }
.ad-body.ui .ad-shell .ip-go { color: var(--ui-primary); display: grid; place-items: center; }
.ad-body.ui .ad-shell .ip-go svg { width: 1.6rem; height: 1.6rem; }
.ad-body.ui .ad-shell .ip-empty { list-style: none; padding: 2.2rem; border: 1.5px dashed var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); display: grid; gap: .8rem; justify-items: start; }
.ad-body.ui .ad-shell .ip-empty p { color: var(--ui-muted) !important; font-size: 1.15rem; }
.ad-body.ui .ad-shell .ip-limit { margin-top: 1rem !important; color: var(--ui-muted); font-size: 1rem; }
.ad-body.ui .ad-shell .ip-limit[hidden] { display: none; }
.ad-body.ui .ad-shell .ip-state { margin-top: .8rem !important; }

/* Status labels carry a symbol and words as well as a colour */
.ad-body.ui .ad-shell .ip-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 8px; font-size: .95rem; font-weight: 700; background: var(--ui-soft); color: var(--ui-ink); width: fit-content; }
.ad-body.ui .ad-shell .ip-badge.warn { background: var(--ui-warn-bg); color: var(--ui-warn); }
.ad-body.ui .ad-shell .ip-badge.good { background: var(--ui-success-bg); color: var(--ui-success); }
.ad-body.ui .ad-shell .ip-badge.bad { background: var(--ui-danger-bg); color: var(--ui-danger); }

/* Steps */
.ad-body.ui .ad-shell .ip-stepbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-body.ui .ad-shell .ip-mini { margin: 0 0 .6rem !important; }
.ad-body.ui .ad-shell .ip-block { margin-bottom: 1.8rem; }
.ad-body.ui .ad-shell .ip-block > h2 { margin-bottom: 1rem !important; }
.ad-body.ui .ad-shell .ip-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.ad-body.ui .ad-shell .ip-contact-note { margin: 0 !important; padding-right: 3.2rem; position: relative; min-height: 3rem; }
.ad-body.ui .ad-shell .ip-none { color: var(--ui-muted); margin-bottom: .8rem !important; grid-column: 1 / -1; }

/* Big choice cards (class, permission, adult or minor) */
.ad-body.ui .ad-shell .ip-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.ad-body.ui .ad-shell .ip-cards4 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.ad-body.ui .ad-shell #ip-list .ip-footer { position: static; }
.ad-body.ui .ad-shell .ip-screen .av-form-layout { margin-bottom: 1.5rem; }
.ad-body.ui .ad-shell .ip-screen .av-aside > .av-button { margin-top: 1.2rem; }
.ad-body.ui .ad-shell .ip-card { overflow-wrap: normal; hyphens: manual; }
.ad-body.ui .ad-shell .ip-card { min-height: 4rem; padding: 1.1rem 1.3rem; border: 2px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); font: inherit; font-size: 1.3rem; font-weight: 650; text-align: left; position: relative; display: flex; flex-direction: column; justify-content: center; gap: .2rem; cursor: pointer; touch-action: manipulation; }
.ad-body.ui .ad-shell .ip-card:hover { border-color: var(--ui-primary); }
.ad-body.ui .ad-shell .ip-card[aria-pressed="true"] { border-color: var(--ui-primary); background: var(--av-soft); }
.ad-body.ui .ad-shell .ip-card[aria-pressed="true"]::after { content: "✓"; position: absolute; right: 1rem; top: .8rem; color: var(--ui-primary); font-size: 1.2rem; }
.ad-body.ui .ad-shell .ip-card-sub { font-size: 1.05rem; font-weight: 400; color: var(--ui-muted); }
.ad-body.ui .ad-shell .ip-cards .ip-card { padding-right: 2.8rem; }
.ad-body.ui .ad-shell .ip-check { display: flex; align-items: center; gap: 1rem; min-height: 4rem; padding: .8rem 1.2rem; margin-bottom: 1.8rem; border: 1.5px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); font-size: 1.15rem; position: relative; padding-right: 3.6rem; }
.ad-body.ui .ad-shell .ip-check input { width: 1.7rem; height: 1.7rem; flex-shrink: 0; accent-color: var(--ui-action); }
.ad-body.ui .ad-shell .ip-more { margin: 0 0 1.5rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); padding: 0 1.2rem; }
.ad-body.ui .ad-shell .ip-more > summary { min-height: 4rem; display: flex; align-items: center; cursor: pointer; font-weight: 650; }
.ad-body.ui .ad-shell .ip-consents { display: grid; gap: 1rem; padding-bottom: 1.2rem; }
.ad-body.ui .ad-shell .ip-more .ip-hinted { margin-bottom: 1rem; color: var(--ui-muted); }
.ad-body.ui .ad-shell .ip-summary-block h2 { font-size: 1.6rem; }
.ad-body.ui .ad-shell .ip-summary-block p:first-of-type { color: var(--ui-ink); font-weight: 600; }
.ad-body.ui .ad-shell .ip-summary-block .ip-badge { margin-top: .6rem; }

/* Fields with a "?" button */
.ad-body.ui .ad-shell .ip-screen .av-field-head[data-hint] { flex-wrap: wrap; min-height: 3rem; padding-right: 3.4rem; }
.ad-body.ui .ad-shell .ip-screen [data-hint] > .hint-btn { width: 3rem; height: 3rem; font-size: 1.15rem; top: 0; }
.ad-body.ui .ad-shell .ip-screen [data-hint] > .hint-text { flex-basis: 100%; font-size: 1.05rem; }
.ad-body.ui .ad-shell .ip-hinted { position: relative; padding-right: 3.6rem; min-height: 3rem; margin-bottom: .8rem; }
.ad-body.ui .ad-shell .ip-hinted > .hint-text { margin-top: .6rem; }
.ad-body.ui .ad-shell .ip-screen label[data-hint] { position: relative; }
.ad-body.ui .ad-shell .ip-screen label.av-field[data-hint] > .av-field-head { min-height: 3rem; align-items: center; padding-right: 3.4rem; margin-bottom: 0; }
.ad-body.ui .ad-shell .ip-check { flex-wrap: wrap; }
.ad-body.ui .ad-shell .ip-check > .hint-btn { top: .5rem; right: .6rem; }
.ad-body.ui .ad-shell .ip-check > .hint-text { flex-basis: 100%; }
.ad-body.ui .ad-shell .ip-aside-actions { position: relative; margin-top: 1.2rem; }
.ad-body.ui .ad-shell .ip-aside-actions .av-button { width: 100%; }
.ad-body.ui .ad-shell .ip-erase { min-height: 3rem; color: var(--ui-muted); border-color: transparent; text-decoration: underline; }

/* One enquiry and the known-person check */
.ad-body.ui .ad-shell .ip-person { padding: 1.2rem 1.4rem; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); }
.ad-body.ui .ad-shell .ip-person p { margin-top: .3rem !important; overflow-wrap: anywhere; }
.ad-body.ui .ad-shell .ip-web .ip-web-message { white-space: pre-wrap; }
.ad-body.ui .ad-shell .ip-matches { display: grid; gap: 1.2rem; }
.ad-body.ui .ad-shell .ip-match { display: grid; gap: .5rem; justify-items: start; }
.ad-body.ui .ad-shell .ip-match .ip-match-note { color: var(--ui-muted); margin-top: 0 !important; }
.ad-body.ui .ad-shell .ip-match .av-button { margin-top: .8rem; }
.ad-body.ui .ad-shell .ip-other { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding-bottom: 1.2rem; align-items: center; }

.ad-body.ui .ad-shell .ip-screen :is(.ip-row, .ip-chip, .ip-card, .ip-more > summary):focus-visible,
.ad-body.ui .ad-shell .ip-search input:focus-visible { outline: 4px solid var(--av-focus); outline-offset: 3px; }

@media (max-width: 1000px) {
  .ad-body.ui .ad-shell .ip-row { grid-template-columns: 3.2rem minmax(0, 1fr) auto 1.6rem; }
  .ad-body.ui .ad-shell .ip-row .ip-meta { grid-column: 2 / 4; grid-row: 2; }
}
@media (max-width: 650px) {
  .ad-body.ui .ad-shell .ip-screen .av-heading .av-button { width: 100%; margin-top: 1.2rem; }
  .ad-body.ui .ad-shell .ip-tools { display: grid; }
  .ad-body.ui .ad-shell .ip-row { grid-template-columns: 2.6rem minmax(0, 1fr) 1.6rem; gap: .5rem .9rem; padding: .9rem 1rem; }
  .ad-body.ui .ad-shell .ip-row .ip-avatar { width: 2.6rem; height: 2.6rem; }
  .ad-body.ui .ad-shell .ip-row .ip-badge { grid-column: 2; grid-row: 2; }
  .ad-body.ui .ad-shell .ip-row .ip-meta { grid-column: 2 / 4; grid-row: 3; }
  .ad-body.ui .ad-shell .ip-row .ip-go { grid-column: 3; grid-row: 1; }
  .ad-body.ui .ad-shell .ip-name { font-size: 1.3rem; }
  .ad-body.ui .ad-shell .ip-grid2, .ad-body.ui .ad-shell .ip-other { grid-template-columns: 1fr; }
  .ad-body.ui .ad-shell .ip-cards, .ad-body.ui .ad-shell .ip-cards4 { grid-template-columns: 1fr; }
  .ad-body.ui .ad-shell .ip-footer .av-button { flex: 1; }
}
