/* Cross-program guidance: Overview, My opportunities, Gaps, Action plan
   (public/js/pnp-guidance.js). Uses the tokens defined in pnp-monitor.html.
   One colour per assessment status, used for the dot, the bar segment, the
   row edge and the badge, so a status reads the same on every screen. */

:root {
  --st-potential: #1a8a4a;   --st-potential-bg: #eef9f1;
  --st-confirm: #b16a00;     --st-confirm-bg: #fdf5e7;
  --st-info: #1673d1;        --st-info-bg: #eaf5ff;
  --st-future: #6a4bc4;      --st-future-bg: #f2eefc;
  --st-noteligible: #b4283c; --st-noteligible-bg: #fdeef0;
  --st-closed: #74727f;      --st-closed-bg: #f1f1f5;
}
.st-potential_match { --st: var(--st-potential); --st-bg: var(--st-potential-bg); }
.st-needs_confirmation { --st: var(--st-confirm); --st-bg: var(--st-confirm-bg); }
.st-more_information_needed { --st: var(--st-info); --st-bg: var(--st-info-bg); }
.st-future { --st: var(--st-future); --st-bg: var(--st-future-bg); }
.st-not_currently_eligible { --st: var(--st-noteligible); --st-bg: var(--st-noteligible-bg); }
.st-not_accepting { --st: var(--st-closed); --st-bg: var(--st-closed-bg); }

/* Status badge (also used by the program modal via opportunityBadge). */
.g-badge, .badge.g-badge[class] { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; white-space: nowrap; color: var(--st); background: var(--st-bg); }
.g-badge.st-not_accepting, .badge.g-badge.st-not_accepting[class] { background: transparent; box-shadow: inset 0 0 0 1px #d6d5de; }
.g-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st); display: inline-block; flex: none; }
.g-dot.st-not_accepting { background: transparent; box-shadow: inset 0 0 0 2px var(--st-closed); }

.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g-h { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.g-lead { font-size: 14px; color: var(--ink); line-height: 1.55; margin: 2px 0 14px; max-width: 64ch; }
.g-note { margin: 10px 0 0; line-height: 1.5; }
.g-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; }
.g-link { font-size: 12.5px; font-weight: 500; }
.g-empty { font-size: 13px; color: var(--ink-soft); background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 0; }

/* ---- Overview: distribution bar + legend ---- */
.g-dist { display: flex; gap: 2px; height: 12px; border-radius: 100px; overflow: hidden; margin: 4px 0 14px; }
.g-dist-seg { background: var(--st); min-width: 6px; }
.g-dist-seg.st-not_accepting { background: repeating-linear-gradient(135deg, #d9d8e0 0 3px, #f1f1f5 3px 6px); }
.g-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.g-legend a { display: grid; grid-template-columns: 10px 30px 1fr; align-items: baseline; gap: 8px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; color: inherit; min-height: 44px; }
.g-legend a:hover { background: var(--bg-soft); }
.g-legend a:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }
.g-legend .g-dot { align-self: start; margin-top: 8px; }
.g-legend-n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--st); text-align: right; }
.st-not_accepting .g-legend-n, .g-legend li:has(.st-not_accepting) .g-legend-n { color: var(--ink-soft); }
.g-legend-text { display: flex; flex-direction: column; min-width: 0; }
.g-legend-l { font-size: 13px; font-weight: 600; color: var(--ink); }
.g-legend-m { font-size: 12px; color: var(--ink-soft); line-height: 1.45; margin-top: 1px; }
.g-legend li.is-zero .g-legend-n, .g-legend li.is-zero .g-legend-l { color: var(--ink-faint); }
.g-legend li.is-zero .g-legend-n { font-weight: 500; }
.g-total { margin-top: 6px; }

/* ---- Program rows ---- */
.g-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.g-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 18px; padding: 13px 0; border-top: 1px solid var(--border); position: relative; }
.g-row:first-child { border-top: none; }
.g-row-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.g-row-prov { font-size: 11.5px; color: var(--ink-faint); font-weight: 500; }
.g-row-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.g-row-why { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; margin-top: 2px; }
.g-row-gap { font-size: 12.5px; color: var(--ink); line-height: 1.45; }
.g-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.g-row-align { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn.small.g-row-open { padding: 6px 0; min-height: 32px; }

/* ---- My opportunities: filters and groups ---- */
.g-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 12px 0 6px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); background: #fff; border: 1px solid var(--border); border-radius: 100px; cursor: pointer; }
.g-chip:hover:not(:disabled) { border-color: #cfd0da; color: var(--ink); }
.g-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.g-chip:disabled { opacity: .45; cursor: default; }
.g-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.g-chip-n { font-variant-numeric: tabular-nums; color: var(--ink-faint); font-weight: 600; }
.g-prov-filter { margin: 0; }
.g-prov-filter select { margin: 0; min-height: 36px; width: auto; min-width: 190px; }
.g-group { margin-top: 18px; }
.g-group-head h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; }
.g-group-n { font-weight: 500; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.g-group-head p { font-size: 12.5px; color: var(--ink-soft); margin: 3px 0 0 17px; line-height: 1.5; }
.g-more { margin: 4px 0 0 14px; background: none; border: none; padding: 8px 0; color: var(--blue); font-weight: 500; font-size: 12.5px; cursor: pointer; min-height: 36px; }

/* ---- Gaps sections ---- */
.g-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.g-sec.first { margin-top: 8px; padding-top: 0; border-top: none; }
.g-sec-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 0; }
.g-sec-n { font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--bg-soft); border-radius: 100px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.g-sec-sub { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 4px 0 8px; max-width: 70ch; }
.g-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.g-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
.g-item.plain { background: var(--bg-soft); }
.g-item-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.g-item-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.g-q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.g-tier { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 100px; white-space: nowrap; }
.g-tier.high { background: #fff0f6; color: #b0005a; }
.g-tier.medium { background: #eaf5ff; color: #0b5fb0; }
.g-tier.specific { background: var(--bg-soft); color: var(--ink-soft); }
.g-affects { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.g-qlist .req-toggle .why { color: var(--ink-soft); }

.g-details { margin-top: 6px; }
.g-details > summary { cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--blue); padding: 6px 0; min-height: 32px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.g-details > summary::-webkit-details-marker { display: none; }
.g-details > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
.g-details[open] > summary::before { transform: rotate(45deg); }
.g-details > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.g-proglist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.g-proglist li { padding: 6px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.g-proglist li:first-child { border-top: none; }
.g-proglink { background: none; border: none; padding: 2px 0; text-align: left; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; display: flex; flex-wrap: wrap; gap: 0 8px; }
.g-proglink:hover { color: var(--blue); }
.g-proglist-prov { color: var(--ink-faint); font-size: 12px; min-width: 110px; }
.g-proglist-why { font-size: 12px; color: var(--ink-soft); }

.g-perprog select { margin: 10px 0 0; }
.g-perprog { margin-bottom: 14px; }

/* ---- Action plan ---- */
.g-steps { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: none; }
.g-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.g-step:first-child { border-top: none; padding-top: 6px; }
.g-step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.g-step-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.g-step-body > .g-qlist { margin: 0; }
.g-step-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.g-steps.compact .g-step { padding: 10px 0; }
.g-steps.compact .g-step-n { width: 24px; height: 24px; font-size: 12px; background: var(--bg-soft); color: var(--ink); }
.g-steps.compact .g-step { grid-template-columns: 24px 1fr; }
.g-steps.compact .g-step-title { font-size: 13.5px; }
.g-minor { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }

.g-progress-n { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.g-progress-bar { height: 6px; border-radius: 100px; background: var(--border); overflow: hidden; margin: 10px 0 12px; }
.g-progress-bar > span { display: block; height: 100%; background: var(--green); border-radius: 100px; }
.g-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.g-facts li { display: grid; grid-template-columns: 16px 1fr; column-gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 12.5px; align-items: start; }
.g-facts li .req-ic { margin-top: 2px; }
.g-facts li.ok .req-ic { color: var(--green); }
.g-facts li.missing .req-ic { color: var(--ink-faint); }
.g-fact-l { color: var(--ink); font-weight: 500; }
.g-fact-v { grid-column: 2; color: var(--ink-soft); line-height: 1.4; overflow-wrap: anywhere; }
.g-facts li.missing .g-fact-v { color: var(--ink-faint); }

@media (max-width: 640px) {
  .g-legend { grid-template-columns: 1fr; }
  .g-row { flex-direction: column; }
  .g-row-side { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
  .btn.small.g-row-open { min-height: 44px; }
  .g-chip { min-height: 44px; }
  .g-prov-filter, .g-prov-filter select { width: 100%; min-height: 44px; }
  .g-facts { grid-template-columns: 1fr; }
  .g-details > summary, .g-more { min-height: 44px; }
  .g-proglink { min-height: 40px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .g-details > summary::before { transition: none; }
}
