/* "Your rules", the stock picker (src/dashboard/picker.js). Colours come from app.css's variables, so dark mode follows. A mark says whether a rule is met by its shape as well as its
   colour, and nothing here ranks one stock above another. Phone first: one column, no sideways scroll. */
.pk > *, .pk-list > *, .pk-card > * { min-width: 0; }
.pk-sets { flex-wrap: wrap; max-width: 100%; }
.pk-sets button { max-width: 100%; overflow-wrap: anywhere; }
.pk-chips .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.pk-count { margin: 0; font-weight: 600; }
.pk-sortrow { gap: 8px; }
.pk-sort { width: auto; max-width: 100%; min-width: 0; flex: 0 1 280px; }
.pk-list { display: grid; gap: 8px; align-items: start; }
.pk-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.pk-card > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.pk-card > summary::-webkit-details-marker { display: none; }
.pk-card[open] > summary { border-bottom: 1px solid var(--line); }
.pk-id { display: flex; align-items: baseline; gap: 8px; flex: 1 1 160px; min-width: 0; }
.pk-id .name { font-weight: 700; flex: none; }
.pk-co { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pk-pass { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-marks { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.pk-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 1; flex: none; }
.pk-mark.pass { background: var(--pos-bg); color: var(--pos); }
.pk-mark.fail { background: var(--neg-bg); color: var(--neg); }
.pk-mark.na { background: var(--panel-2); color: var(--muted); }
.pk-short { margin: 0; padding: 0 12px 8px; color: var(--muted); }
.pk-card.near > .pk-short { padding-top: 6px; }
.pk-body { padding: 8px 12px 12px; display: grid; gap: 8px; }
.pk-rule-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pk-rule-line > details > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 0; list-style: none; }
.pk-rule-line > details > summary::-webkit-details-marker { display: none; }
.pk-rl { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.pk-val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-evidence { margin-inline-start: 26px; padding: 2px 0 8px; display: grid; gap: 4px; }
.pk-evidence p { margin: 0; overflow-wrap: anywhere; }
.pk-legend { margin: 0; }
/* The editor: one rule per block, its threshold under its name. */
.pk-group h3 { margin: 12px 0 6px; font-size: 14px; font-weight: 600; }
.pk-rule { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.pk-rule.off .pk-threshold, .pk-rule.off .pk-option, .pk-rule.off .pk-help { opacity: 0.55; }
.pk-rule-head { align-items: flex-start; }
.pk-threshold { margin-inline-start: 28px; gap: 8px; }
.pk-option, .pk-help { margin-inline-start: 28px; }
input.in.pk-num { width: 96px; max-width: 100%; text-align: end; }
.pk-save { gap: 8px; }
.pk-notrated ul { margin: 4px 0 0; padding-inline-start: 18px; }
.pk-portfolio .pk-list { margin-top: 4px; }
@media (min-width: 900px) {
  .pk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pk-horizons { display: grid; gap: 8px; }
.pk-hz { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pk-hz b { min-width: 6.5em; }
.pk-hz span { font-variant-numeric: tabular-nums; }
.pk-hz-note { flex: 1 1 100%; margin: 0; }
/* The ten critical checks and "Review my holdings": what a stock fails is a line of its own under its headline (the word "Fails" says it, the colour and the mark only help), and a held stock with a cross
   has a bar at the start of its card, on the right side in both directions. */
.pk-fails { display: block; flex: 1 1 100%; margin: 0; overflow-wrap: anywhere; }
.pk-fails::before { content: "\2717\00a0"; content: "\2717\00a0" / ""; color: var(--neg); font-weight: 700; }
.pk-review-row > summary .pk-id { flex: 1 1 100%; }
.pk-review-row.near { border-inline-start: 4px solid var(--neg); }
.pk-weight { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-review .pk-list { margin-top: 4px; }
/* The stored latest result (src/dashboard/picker-latest.js): the line above a result and the notes about it. */
.pk-latest { display: grid; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 8px; background: var(--panel-2); }
.pk-latest > * { min-width: 0; margin: 0; }
.pk-latest-line { font-weight: 600; overflow-wrap: anywhere; }
.pk-latest-note { color: var(--muted); overflow-wrap: anywhere; }
.pk-latest-held .pk-latest-line { margin: 0; }

/* The small "Fund" chip of an ETF or index fund, beside its symbol: it does not grow or wrap, so a long name still shortens beside it. */
.pk-kind { flex: none; font-size: 11px; line-height: 1.4; padding: 1px 7px; }

/* Rule categories (docs/picker.md "Rule categories"): a heading and a count on a card, a line of counts on its head, a chip beside each rule and the chips that filter the editor. Never a grade. */
.pk-cats { flex: 1 1 100%; margin: 0; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pk-cat { display: grid; gap: 2px; }
.pk-cat + .pk-cat { margin-top: 4px; }
.pk-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 2px 0; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.pk-cat-tally { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-catchips { margin: 4px 0 2px; }
.pk-catfilter { border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; }
.pk-catfilter.on { background: var(--panel-2); border-color: var(--text); font-weight: 600; }
.pk-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pk-group-count { font-weight: 400; }
.pk-cat-chip, .pk-kind-chip { white-space: normal; font-size: 11px; min-height: 0; line-height: 1.5; padding: 0 8px; vertical-align: middle; }
.pk-subgroup { margin: 10px 0 0; font-size: 12px; font-weight: 500; color: var(--muted); }
