/* Niche finder (public/finder.js). Uses the dashboard's colour tokens, .pill, .btn and the .pd panel from /app. */
.nf { padding: 18px 0 8px; display: flex; flex-direction: column; gap: 14px; container: nf / inline-size; }
.nf > * { margin-inline: 16px; }
.nf > .nf-list { margin-inline: 0; }
.nf-k { margin: 0 0 4px; font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nf-head h2 { font-family: var(--f-display); font-size: 20px; margin: 0 0 4px; font-weight: 600; letter-spacing: -.01em; }
.nf-head .sub { margin: 0; color: var(--muted); font-size: 13px; max-width: 70ch; }
.nf-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: calc(100% - 32px); overflow-x: auto; }
.nf-tabs button { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); background: none; border: 0; border-radius: 9px; padding: 8px 14px; min-height: 38px; cursor: pointer; white-space: nowrap; }
.nf-tabs button:hover { color: var(--ink); }
.nf-tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.nf-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.nf-tools input, .nf-tools select { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; min-height: 40px; min-width: 0; }
.nf-tools input { flex: 1 1 200px; }
.nf-tools input::placeholder { color: var(--faint); }
.nf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nf-chips button { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer; }
.nf-chips button:hover { color: var(--ink); border-color: var(--line-strong); }
.nf-chips button[aria-pressed="true"] { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
.nf-chips small { color: var(--faint); font-family: var(--f-mono); margin-left: 4px; }
.nf-msg { color: var(--muted); font-size: 13.5px; min-height: 1em; margin-block: 0; }
.nf-msg.nf-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 16px; color: var(--ink); }
.nf-list { list-style: none; margin: 0; padding: 0; }
.nf-cols, .nf-row { display: grid; grid-template-columns: minmax(150px, 2fr) 112px minmax(130px, 1.4fr) minmax(110px, 1fr); gap: 12px; align-items: center; padding: 11px 16px; }
.nf-cols { font: 500 10.5px var(--f-body); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border-bottom: 1px solid var(--line); padding-block: 8px; padding-right: 60px; }
.nf-li { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.nf-row { flex: 1; min-width: 0; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.nf-row:hover { background: var(--surface-2); }
.nf-row:focus-visible { outline-offset: -2px; }
.nf-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-name b { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.nf-name small, .nf-cell small { color: var(--faint); font-size: 11.5px; }
.nf-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nf-cell b { font-family: var(--f-mono); font-weight: 500; font-size: 13.5px; }
.nf-cell .nf-pin { color: var(--good); }
.nf-demand { display: flex; align-items: center; gap: 8px; }
.nf-demand .spark { color: var(--accent); flex: none; }
.nf-delta { font: 500 13px var(--f-mono); color: var(--muted); }
.nf-delta.up { color: var(--good); } .nf-delta.down { color: var(--bad); }
.nf-none, .nf-empty { color: var(--faint); font-size: 12.5px; }
.nf-empty { padding: 16px; }
.nf-star { flex: none; width: 44px; background: none; border: 0; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.nf-star:hover { color: var(--ink); background: var(--surface-2); }
.nf-star[aria-pressed="true"] { color: var(--accent); }
.nf-locked .nf-row { grid-template-columns: minmax(150px, 2fr) 112px minmax(130px, 2.4fr); }
.nf-locked .nf-name b { color: var(--muted); }
.nf-lockmsg { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12.5px; }
.nf-note { color: var(--faint); font-size: 12px; margin-top: 0; margin-bottom: 12px; max-width: 80ch; line-height: 1.5; }
@container nf (max-width: 720px) {
  .nf-cols { display: none; }
  .nf-row, .nf-locked .nf-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 16px; }
  .nf-demand, .nf-extra, .nf-lockmsg { grid-column: 1 / -1; }
  .nf-stage { justify-self: end; }
}
/* detail panel */
#nf-pd-body { display: flex; flex-direction: column; gap: 16px; }
.nf-pd .tip { margin: 0; color: var(--muted); font-size: 13.5px; }
.nf-curve { width: 100%; height: auto; color: var(--accent); display: block; }
.nf-band { fill: var(--accent-soft); }
.nf-now { stroke: var(--flare, #FF5B3A); stroke-width: 1.5; stroke-dasharray: 3 3; }
.nf-nowl { fill: var(--flare, #FF5B3A); font: 500 10px var(--f-mono); }
.nf-tick { fill: var(--faint); font: 10px var(--f-mono); }
.nf-foot { color: var(--faint); font-size: 12px; margin: 6px 0 0; }
.nf-pinbox { margin: 0; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.nf-prods { list-style: none; margin: 0; padding: 0; }
.nf-prods a { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.nf-prods a:hover b { color: var(--accent); }
.nf-prods img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.nf-prods span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-prods b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-prods small { color: var(--faint); font-size: 11.5px; }
@media (max-width: 560px) { .nf-pd .pd-stats { grid-template-columns: 1fr 1fr; } }
