/* Escape Velocity — styles for soc-groups.js. Colours come from the theme variables, never fixed values (the gold ring is the "you" gold of the map pin). */

/* ===== How members spread their money ===== */
/* a share is printed inside its part of a bar only when it fits there (on a narrow bar a small part used to show half a number) */
.mixbar > span { container-type: inline-size; }
@container (max-width: 1.9rem) { .mixbar > span > i { display: none; } }
@container (max-width: 2.45rem) { .mixbar > span > i.ma-wide { display: none; } }
/* by country and by age group: side by side when the card is wide enough, one under the other (country first) when it is not */
.ma-groups { container: ma / inline-size; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.ma-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem 2.4rem; align-items: start; }
@container ma (min-width: 37rem) { .ma-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ma-h { margin: 0 0 .25rem; font-size: 1rem; font-weight: 650; }
/* in a column (and on a narrow screen) the group's name sits over its bar, with how many members on the same line when it fits */
.ma-col .mixrow { grid-template-columns: minmax(0, 1fr); gap: .3rem; padding: .4rem 0; }
.ma-col .mixrow > span { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .5rem; row-gap: 0; }
.ma-col .mixrow > span > .you-tag { margin-left: 0; }
.ma-col .mix-sub { display: inline; margin: 0; }
@media (max-width: 860px) {
  .ma-card .mixrow { gap: .3rem; }
  .ma-card .mixrow > span { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .5rem; row-gap: 0; }
  .ma-card .mixrow > span > .you-tag { margin-left: 0; }
  .ma-card .mix-sub { display: inline; margin: 0; }
}
.ma-note { margin: .5rem 0 0; font-size: .95rem; }
.ma-fact { margin: .9rem 0 0; padding: .75rem 1rem; border-radius: 12px; border-left: 4px solid var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); line-height: 1.5; }

/* ===== How risky members' money is: a shaded grid ===== */
/* the colour of a level is the one on the Investments page; the shade is its share (--s, 0 to 100). It stays light enough for the figure to be read in every theme. */
.rk-safe { --rk: var(--pos); } .rk-balanced { --rk: var(--warn); } .rk-bold { --rk: var(--neg); }
.rk-grid { container: rk / inline-size; position: relative; margin-top: .4rem; }
.rk-head, .rk-row { display: grid; grid-template-columns: minmax(7.5rem, 1.5fr) repeat(3, minmax(0, 1fr)); gap: .3rem; align-items: stretch; }
.rk-head { padding-bottom: .1rem; }
.rk-colh { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .45rem .2rem; border-bottom: 3px solid var(--rk); font-size: .82rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: center; }
.rk-row { margin-top: .3rem; }
.rk-name { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: .2rem .1rem; line-height: 1.3; font-weight: 600; }
.rk-name small { font-weight: 400; font-size: .88rem; }
.rk-name .you-tag { align-self: flex-start; margin: .1rem 0; }
.rk-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3rem; padding: .3rem .2rem; border-radius: .6rem; background: color-mix(in srgb, var(--rk) calc(6% + var(--s) * .34%), transparent); }
.rk-cell b { font-size: 1.08rem; font-weight: 750; }
.rk-l { display: none; font-style: normal; font-size: .8rem; color: var(--muted); }
.rk-sec { margin: 1.1rem 0 .1rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.rk-none { margin-top: .3rem; }
.rk-none .soc-none { margin: 0; }
.rk-note { margin: .8rem 0 0; font-size: .95rem; }
/* a narrow card (a phone, or big text): the group's name has a line to itself with the three cells under it, each with its own level's name; the
   header row stays for a screen reader but is not drawn */
@container rk (max-width: 33rem) {
  .rk-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .7rem; }
  .rk-name { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 0 .6rem; padding: 0; }
  .rk-name .you-tag { align-self: baseline; margin: 0; }
  .rk-l { display: block; }
  .rk-cell { min-height: 3.6rem; min-width: 0; }
}
/* narrower still (a phone with big text): three cells side by side would be too narrow for "Aggressive", so they stack, the level's name on the
   left and its figure on the right */
@container rk (max-width: 15.5rem) {
  .rk-row { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .rk-cell { flex-direction: row; justify-content: space-between; min-height: 2.5rem; padding: .25rem .9rem; }
}

/* ===== Popular experiences: when and what they cost ===== */
.bk-card { margin-bottom: 1.2rem; }
.bk-note { margin: -.45rem 0 1rem; font-size: .95rem; line-height: 1.5; }
.bk-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 .8rem; }
.bk-ctl .f-label { margin: 0; }
.bk-key { margin: 0; }
.bk-key i { vertical-align: -.12em; }
.legend-line .bk-k-pill { width: 1.7rem; height: .6rem; border-radius: 99px; background: linear-gradient(90deg, var(--g1), var(--g2)); }
.legend-line .bk-k-mid { width: .9rem; height: .9rem; border-radius: 50%; background: var(--card-solid); box-shadow: inset 0 0 0 .2rem var(--ink); }
.legend-line .bk-k-me { width: 1rem; height: 1rem; border-radius: 50%; box-shadow: inset 0 0 0 2px #fbbf24, 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent); }

/* one experience: its name, then a ruler for the age and one for the cost, each with its words under it */
.bk-wrap { container: bk / inline-size; }
.bk-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.bk-head { display: none; }
.bk-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem 1.8rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--line); }
.bk-name { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); column-gap: .6rem; align-items: start; min-width: 0; }
.bk-swatch { width: .9rem; height: .9rem; border-radius: 50%; margin-top: .32rem; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); }
.bk-what { min-width: 0; text-wrap: pretty; }
.bk-what > b { overflow-wrap: anywhere; }
.bk-by { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-top: .1rem; }
.bk-by small { color: var(--muted); line-height: 1.5; }
.bk-by small b { color: var(--ink); }
.bk-col { display: grid; grid-template-columns: 2.9rem minmax(0, 1fr); column-gap: .6rem; row-gap: .35rem; align-items: center; min-width: 0; }
.bk-lab { grid-column: 1; grid-row: 1; font-size: .92rem; font-weight: 650; color: var(--muted); }
.bk-col > .bk-ruler { grid-column: 2; grid-row: 1; }
.bk-say { grid-column: 1 / -1; margin: 0; font-size: .95rem; line-height: 1.45; color: var(--muted); }
.bk-say > span { display: block; }
.bk-say b, .bk-yours { color: var(--ink); }
.bk-say b { font-weight: 700; }
.bk-yours { font-weight: 600; }
.bk-gone .bk-say { grid-column: 2; grid-row: 1; }

/* the ruler: a cell for each band, the bar where most members are, the dot on the typical band, your band in a gold ring */
.bk-ruler { display: grid; grid-template-columns: repeat(var(--bk-n), minmax(0, 1fr)); align-items: center; height: 1.55rem; }
.bk-ruler > i { grid-row: 1; }
.bk-step { height: .45rem; margin: 0 1.5px; border-radius: 99px; background: var(--chip); }
.bk-pill { height: .8rem; margin: 0 1px; border-radius: 99px; background: linear-gradient(90deg, var(--g1), var(--g2)); }
.bk-mid { justify-self: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--card-solid); box-shadow: inset 0 0 0 .22rem var(--ink), 0 0 0 2px var(--card-solid); }
.bk-me { justify-self: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; box-shadow: inset 0 0 0 2px #fbbf24, 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent); }

/* a very narrow card (the biggest text on a small phone): the label goes over its ruler, so the ruler keeps the whole width */
@container bk (max-width: 13rem) {
  .bk-col { grid-template-columns: minmax(0, 1fr); }
  .bk-col > .bk-ruler, .bk-gone .bk-say { grid-column: 1; grid-row: auto; }
}
/* a wider card: the name across the top, the two rulers side by side under it */
@container bk (min-width: 30rem) {
  .bk-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bk-name { grid-column: 1 / -1; }
}
/* a wide card: a table, one experience to a line, with the scale of each ruler across the top */
@container bk (min-width: 50rem) {
  .bk-list { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.8rem; }
  .bk-head, .bk-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
  .bk-head { align-items: end; padding-bottom: .35rem; }
  .bk-name { grid-column: auto; }
  .bk-col { grid-template-columns: minmax(0, 1fr); }
  .bk-col > .bk-lab { display: none; }
  .bk-col > .bk-ruler, .bk-col > .bk-say, .bk-gone .bk-say { grid-column: 1; grid-row: auto; }
}
.bk-axis { display: grid; gap: .3rem; min-width: 0; }
.bk-axis > b { font-size: .92rem; font-weight: 650; color: var(--muted); }
.bk-ticks { display: grid; grid-template-columns: repeat(var(--bk-n), minmax(0, 1fr)); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bk-ticks > i { grid-row: 1; justify-self: start; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.bk-more { margin-top: .8rem; }
/* nothing to show yet: the two rulers, empty */
.bk-ghost { display: grid; gap: .5rem; max-width: 30rem; margin: .2rem 0 .4rem; opacity: .8; }

/* the mix card's Numbers view: every share as text */
.ma-card .card-head { align-items: flex-start; }
.ma-view { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; }
.ma-numbers { margin-top: .8rem; max-height: none; }
.ma-tbl { width: 100%; border-collapse: collapse; }
.ma-tbl th, .ma-tbl td { padding: .5rem .55rem; border-top: 1px solid var(--line); border-bottom: 0; vertical-align: baseline; white-space: normal; }
.ma-tbl thead th { border-top: 0; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--muted); font-weight: 600; vertical-align: bottom; min-width: 4.4rem; line-height: 1.25; cursor: default; }
.ma-tbl thead th:hover { color: var(--muted); }
.ma-tbl thead th:first-child { min-width: 9rem; }
.ma-tbl tbody th { text-align: left; font-weight: 600; }
.ma-tbl .r { text-align: right; }
.ma-tbl tbody tr:hover th, .ma-tbl tbody tr:hover td { background: transparent; }
.ma-rsub { display: block; font-weight: 400; }
.ma-sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: -.05em; }
.ma-note { margin: .6rem 0 0; }
