/* Study costs: one line per university (name, bar, first-year fee and a Details button) on every screen, so the list reads
   at a glance; the programme, whole-degree cost, months of typical pay, residence and fine print sit in a panel that opens
   under the line, laid out as labelled facts (Jacob, 10 Oct 2026: the rows showed too much at once).
   Loaded by viewCost only, so the printable plan's stylesheets (and the example PDFs) never change. */
.cost-standin { margin: 0 0 12px; max-width: 80ch; }
.cost-related { margin: 4px 0 16px; max-width: 90ch; font-size: .92rem; color: var(--ink-2); line-height: 1.7; }

/* The line */
.cost-rows .cost-row { padding: 0; }
.cost-line { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr) 12.5rem auto; align-items: center; gap: 4px 16px; padding: 10px 12px 10px 16px; }
.cost-line h3 { margin: 0; font-size: .97rem; line-height: 1.3; }
.cost-line h3 .b-badge { margin-left: 6px; font-size: .68rem; padding: 1px 7px; vertical-align: 2px; }
.cost-rows .cost-bar { height: 8px; margin: 0; }
.cost-line .cost-amt { display: grid; justify-items: end; text-align: right; line-height: 1.25; min-width: 0; }
.cost-line .cost-amt b { font-size: 1rem; white-space: nowrap; }
.cost-line .cost-amt small { font-size: .74rem; }

/* The Details button: a pill with a chevron that turns when open */
.cost-more { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper, #fff);
  color: var(--brand); font: 600 .8rem/1 var(--font); cursor: pointer; white-space: nowrap; }
.cost-more::after { content: ''; width: 7px; height: 7px; margin: 0 1px 3px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.cost-more[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cost-more[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.cost-more:hover { border-color: var(--brand); }
.cost-more:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cost-row.is-open { background: var(--tint); }

/* The panel: labelled facts in a grid, then the fine print and a link to the university */
.cost-row-more { padding: 2px 16px 14px; }
.cost-row-more[hidden] { display: none; }
.cost-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.cost-facts > div { padding: 10px 14px; border-top: 1px solid var(--line); margin-top: -1px; }
.cost-facts dt { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.cost-facts dd { margin: 3px 0 0; font-size: .9rem; line-height: 1.4; color: var(--ink); }
.cost-facts dd b { font-size: 1.05rem; }
.cost-facts dd small { display: block; font-size: .78rem; color: var(--ink-3); }
@media (min-width: 620px) { .cost-facts > div + div { border-left: 1px solid var(--line); } }
.cost-fine { margin: 8px 2px 0; font-size: .78rem; line-height: 1.45; color: var(--ink-3); }
.cost-uni-link { margin: 6px 2px 0; font-size: .86rem; }

/* No fee published: the same lines, dashed */
.cost-rows.cost-np { border-style: dashed; }
.cost-np .cost-line { grid-template-columns: minmax(0, 1fr) auto auto; }
.cost-np .cost-row + .cost-row { border-top-style: dashed; }

/* Narrower screens: name and bar stacked on the left, the fee and the button on the right */
@media (max-width: 899px) {
  .cost-line { grid-template-columns: minmax(0, 1fr) minmax(0, 42%) auto; gap: 0 10px; padding: 8px 8px 8px 12px; }
  .cost-line h3 { grid-column: 1; grid-row: 1; font-size: .9rem; }
  .cost-rows .cost-bar { grid-column: 1; grid-row: 2; margin: 6px 0 2px; }
  .cost-line .cost-amt { grid-column: 2; grid-row: 1 / span 2; }
  .cost-line .cost-amt b { font-size: .95rem; white-space: normal; }
  .cost-line .cost-amt small { font-size: .7rem; }
  .cost-line .cost-more { grid-column: 3; grid-row: 1 / span 2; }
  .cost-np .cost-line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .cost-np .cost-line .cost-amt, .cost-np .cost-line .cost-more { grid-row: 1; }
  .cost-row-more { padding: 0 10px 12px; }
}
/* Phones: the button shrinks to its chevron */
@media (max-width: 519px) {
  .cost-more { width: 34px; padding: 0; justify-content: center; }
  .cost-more-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cost-more::after { margin: 0 0 3px; }
}
@media print { .cost-more { display: none; } .cost-row-more[hidden] { display: block; } }
