/* Partners directory, services settings, and the finding service select. Builds on app.css tokens. */

.pt-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pt-break { overflow-wrap: anywhere; }

/* ---- Compliance colors: danger = expired, warn = expires within 30 days ---- */
.pt-chip-danger { background: #fbe4e1; color: var(--danger); }
.pt-chip-warn { background: #fdf0dc; color: #9a5d00; }
.pt-chip-ok { background: #dcf1e5; color: var(--ok); }
.pt-chip-none { background: #eef1f5; color: var(--muted); }
.pt-flags .chip svg, .pt-comp .chip svg {
  width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---- "N partners need attention" banner ---- */
.pt-alert {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; min-height: 60px;
  border: 1px solid #f3c2bb; border-radius: var(--radius); background: #fdf1ef; color: var(--text); text-decoration: none;
}
.pt-alert svg, .pt-banner svg {
  width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pt-alert svg { color: var(--danger); }
.pt-alert-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pt-alert-text span { color: var(--muted); font-size: 0.875rem; }
.pt-alert::after { content: "›"; color: var(--muted); font-size: 1.4rem; }

/* ---- Filter chips: one horizontally scrolling row ---- */
.pt-filters {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pt-filters::-webkit-scrollbar { display: none; }
.pt-filter {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.pt-filter.active { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.pt-filter-svc { font-weight: 500; }
.pt-filter-sep { flex: 0 0 1px; background: var(--border); margin: 6px 2px; }
.pt-count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; background: #eef1f5; color: var(--muted);
  font-size: 0.78rem; font-weight: 700; text-align: center; line-height: 1.5;
}
.pt-filter-alert:not(.active) .pt-count { background: var(--danger); color: #fff; }
.pt-filter.active .pt-count { background: rgba(255, 255, 255, 0.25); color: inherit; }

/* ---- Directory rows: left edge shows compliance ---- */
.pt-list { margin-bottom: 88px; } /* room so the + button never covers the last row */
.pt-row { position: relative; align-items: flex-start; padding-left: 18px; }
.pt-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: transparent;
}
.pt-row::after { align-self: center; }
.pt-row.pt-lvl-danger::before { background: var(--danger); }
.pt-row.pt-lvl-warn::before { background: var(--warn); }
.pt-row.pt-lvl-ok::before { background: var(--ok); }
.pt-row .row-main { display: flex; flex-direction: column; gap: 2px; }
.pt-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt-row-top .row-title { flex: 1; min-width: 0; }
.pt-rating { flex: none; color: #9a5d00; font-size: 0.85rem; font-weight: 700; }
.pt-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.pt-mark {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand);
  font-weight: 800; font-size: 0.9rem; letter-spacing: 0.02em;
}
.pt-mark-lg { flex-basis: 56px; width: 56px; height: 56px; border-radius: 14px; font-size: 1.15rem; margin: 0; }
.pt-mark-lg.pt-lvl-danger { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--danger); }
.pt-mark-lg.pt-lvl-warn { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--warn); }
.pt-mark-lg.pt-lvl-ok { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ok); }

.pt-empty svg {
  width: 44px; height: 44px; fill: none; stroke: var(--muted); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px;
}
.pt-empty p { margin-bottom: 16px; }

/* ---- Partner detail ---- */
.pt-head { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.pt-head-text { min-width: 0; padding-top: 2px; }
.pt-head-text h1 { font-size: 1.35rem; margin-bottom: 2px; overflow-wrap: anywhere; }
.pt-stars { color: #c98a00; letter-spacing: 1px; }
.page-header > .btn { flex: 0 0 auto; }

.pt-banner {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 14px;
  border-radius: var(--radius); border: 1px solid;
}
.pt-banner div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-banner span { font-size: 0.9rem; color: var(--text); }
.pt-banner-danger { background: #fdf1ef; border-color: #f3c2bb; color: var(--danger); }
.pt-banner-warn { background: #fef7ea; border-color: #f4d9a6; color: #9a5d00; }

.pt-actions { display: flex; gap: 8px; margin-bottom: 20px; }
.pt-actions > .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }

.pt-comp { padding: 0; overflow: hidden; }
.pt-comp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.pt-comp-row:last-child { border-bottom: 0; }
.pt-comp-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pt-comp-value { font-weight: 600; overflow-wrap: anywhere; }
.pt-comp-value a { display: inline-flex; align-items: center; min-height: 32px; }
.pt-comp-value .muted { font-weight: 500; font-size: 0.95rem; }
.pt-comp-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; text-align: right; }

.pt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-trade {
  min-height: 36px; padding: 4px 14px; text-decoration: none; font-size: 0.9rem;
  background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand);
}
.pt-zip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.pt-notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-delete { margin: 24px 0 8px; }

/* ---- Forms ---- */
.pt-form-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 480px) { .pt-form-grid { grid-template-columns: 1fr 1fr; } }
.pt-form input[type=file] { display: block; width: 100%; min-height: 44px; padding: 8px 0; font-size: 16px; }
.pt-pills label { min-height: 40px; padding: 6px 14px; font-size: 0.95rem; }
.pt-doc-current {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 8px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: #f9fafb;
}
.pt-doc-current svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.pt-doc-current a { font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.pt-save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  padding: 8px 0 0; background: linear-gradient(to bottom, rgba(246, 247, 249, 0), var(--bg) 40%);
}
.pt-save-bar .btn { min-height: 52px; box-shadow: var(--shadow); }
.pt-fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.pt-fieldset legend { padding: 0; }
.pt-cat-group { margin-bottom: 12px; }
.pt-cat-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

/* ---- Services list ---- */
.pt-uncovered { font-size: 0.9rem; background: #fef7ea; border-color: #f4d9a6; }
.svc-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; min-height: 64px;
  border-bottom: 1px solid var(--border);
}
.svc-row:last-child { border-bottom: 0; }
.svc-row:target { background: color-mix(in srgb, var(--brand) 6%, #fff); }
.svc-inactive .svc-name { color: var(--muted); }
.svc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; }
.svc-name { font-weight: 600; overflow-wrap: anywhere; }
.svc-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.svc-cat {
  display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef1f5;
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.svc-meta { color: var(--muted); font-size: 0.8rem; }
.svc-actions { display: flex; gap: 6px; flex: none; }
.svc-actions form { margin: 0; }
.pt-icon { width: 44px; min-height: 44px; padding: 0; font-size: 1.1rem; }

/* ---- Recommended service on a finding card ---- */
.pt-finding-svc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.pt-finding-svc svg {
  width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pt-finding-svc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pt-finding-svc-head label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.pt-finding-svc-ro { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pt-finding-svc-ro svg { color: var(--muted); }
.pt-finding-svc-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pt-finding-svc .form-status:not(:empty) { margin-top: 6px; }
