/* ============================================================================
   PARTNER FINDER (community partner list and warm referral). Its own sheet,
   like Case Notes. Colors come from the tool tokens in styles.css
   (data-tool="partners", rust); the soft check and the warnings use the
   shared warning yellow, as Case Notes does.
   ============================================================================ */

.tool-card:nth-child(7) { animation-delay: 360ms; }

#partnerFinderPage > .page-head { margin-bottom: 2rem; }
#partnerFinderPage > .page-head .feature-identifier { margin-bottom: 1rem; }
#partnerFinderPage > .page-head h2 { margin: 0 0 1.25rem; }
#partnerFinderPage > .page-head .page-description { margin: 0; max-width: 64ch; }
body[data-tool="partners"] #partnerFinderPage.active > .page-head > h2 {
    text-decoration: underline;
    text-decoration-color: var(--tool);
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}
#partnerFinderPage [hidden] { display: none !important; }

#partnerFinderPage .card { margin-bottom: 1.5rem; }
#partnerFinderPage .form-group input,
#partnerFinderPage .form-group select,
#partnerFinderPage .form-group textarea { width: 100%; }

.pf-needs-field {
    border: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    min-width: 0;
}
.pf-needs-field legend {
    font-weight: 600;
    margin-bottom: 0.4rem;
    padding: 0;
}
.pf-needs-field .form-help { margin: 0 0 0.5rem; }
.pf-needs-field.field-error .pf-needs { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: var(--radius-md); }
.pf-required { color: #EF4444; font-weight: 700; }
.pf-needs .checkbox-item { min-height: 44px; padding: 0.5rem 0.85rem; }
.pf-needs .checkbox-item:has(input:checked) {
    border-left-color: var(--tool);
    background: var(--tool-tint);
}

.pf-results h3:focus:not(:focus-visible),
.pf-web h3:focus:not(:focus-visible),
.pf-form-panel h3:focus:not(:focus-visible),
.pf-referral h3:focus:not(:focus-visible),
.pf-import h3:focus:not(:focus-visible),
.pf-import h4:focus:not(:focus-visible) { outline: none; }

.pf-summary { margin: 0 0 1rem; color: var(--text-secondary); }

.pf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}
.pf-item {
    border: 1px solid var(--border);
    border-left: 4px solid var(--tool);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    background: var(--white);
}
.pf-item.pf-item-web { border-left-color: #ca8a04; }
.pf-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}
.pf-item-name { margin: 0; font-size: 1.1rem; }
.pf-item-miles { color: var(--text-secondary); font-size: 0.9rem; white-space: nowrap; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0.5rem; }
.pf-badge {
    display: inline-block;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-primary);
}
.pf-badge-recent { border-color: #15803d; color: #14532d; background: #f0fdf4; }
.pf-badge-stale,
.pf-badge-never,
.pf-badge-web { border-color: #ca8a04; color: #713f12; background: #fef9c3; }
.pf-badge-import { border-color: var(--border); color: var(--text-secondary); background: #f8fafc; }
.pf-item-services { margin: 0 0 0.5rem; }
.pf-reasons { margin: 0 0 0.5rem; padding-left: 1.2rem; color: var(--text-secondary); font-size: 0.92rem; }
.pf-facts { margin: 0 0 0.75rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.75rem; font-size: 0.95rem; }
.pf-facts dt { font-weight: 600; }
.pf-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.pf-item-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pf-item-source { margin: 0 0 0.75rem; font-size: 0.9rem; overflow-wrap: anywhere; }

.pf-empty { padding: 0.5rem 0 0; }
.pf-empty p { margin: 0 0 0.75rem; }
.pf-web-more { margin: 1rem 0 0; }
.pf-web-source {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #fef9c3;
    border: 1px solid #ca8a04;
    border-radius: var(--radius-md);
    color: #422006;
    overflow-wrap: anywhere;
}

.pf-warning,
.pf-check,
.pf-warnings {
    margin: 0 0 1rem;
    padding: 0.85rem 1.1rem;
    background: #fef9c3;
    border: 1px solid #ca8a04;
    border-radius: var(--radius-md);
    color: #422006;
}
.pf-warnings { list-style: disc; padding-left: 2.1rem; }
.pf-check p { margin: 0 0 0.5rem; }
.pf-check ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.pf-check code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255, 255, 255, 0.7); padding: 0 0.3rem; border-radius: 4px; }

.pf-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.25rem 0 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    min-height: 44px;
}
.pf-consent input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; flex: none; }
.pf-consent.field-error { border-color: var(--danger); }

.pf-ref-out { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 5px solid var(--tool); }
.pf-note { margin: 0 0 1.5rem; }
.pf-note-meta { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.pf-note-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 1rem 1.15rem;
    margin: 0.5rem 0 0.75rem;
    background: #fbfaf8;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    line-height: 1.55;
}

.pf-delete { color: var(--danger); border-color: var(--danger); }

/* Spreadsheet import (public/partner-import.js). Both tables scroll inside
   their own box on a phone, never the page; the box takes focus so a
   keyboard can scroll it. */
.pf-import h4 { margin-top: 1.25rem; }
.pf-import-scroll {
    max-width: 100%;
    max-height: 28rem;
    overflow: auto;
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.pf-import-scroll:focus-visible { outline: 3px solid var(--tool); outline-offset: 2px; }
.pf-import-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.pf-import-table th,
.pf-import-table td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
.pf-import-table thead th { position: sticky; top: 0; background: #f8fafc; font-weight: 600; }
.pf-import-table select { min-height: 44px; min-width: 11rem; }
.pf-import-example { color: var(--text-secondary); overflow-wrap: anywhere; }
.pf-import-what { display: block; font-weight: 600; }
.pf-import-note { display: block; color: var(--text-secondary); font-size: 0.85rem; }
.pf-import-refuse .pf-import-what { color: #991b1b; }
.pf-import-skip .pf-import-what { color: var(--text-secondary); }
.pf-import .checkbox-item { min-height: 44px; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.85rem; }

@media (max-width: 600px) {
    #partnerFinderPage .story-row { grid-template-columns: minmax(0, 1fr); }
    .pf-facts { grid-template-columns: minmax(0, 1fr); }
    .pf-facts dd { margin-bottom: 0.35rem; }
    .pf-item-actions .btn,
    #partnerFinderPage .form-actions .btn { flex: 1 1 100%; }
}
