/* The free deal simulator (/learn/deal-simulator, assets/learn-deal.js), in
   the Learn page's look (shop.css: sh_ panels, fields and banners). Prefix ld_.

   Four colours, each the mark of one party or one way to put the music out:
   amber for you under the deal, magenta for the label, blue for a
   distribution deal, green for going on your own. Chosen as a set for this
   dark surface and run through the dataviz palette validator on 2026-10-27:
   the two in the first chart and the three in the second stay apart under
   protanopia and deuteranopia (worst pair 8.4 and above, against a floor of
   8), and each clears 3:1 against the panel. Text never wears them: a key, a
   stripe or a line beside the words carries the colour. */
.ld { --ld-you: #c98500; --ld-label: #d55181; --ld-dist: #3987e5; --ld-own: #199e70;
  --ld-cost: #7d7c84; --ld-fee: #5c5b62; --ld-surface: #111113; }
.ld_ico { width: 18px; height: 18px; flex: none; }

/* Back to the other tools, above the title. */
.ld_up { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 0 0 18px; font-size: .86rem; color: rgba(255,255,255,.8);
  text-decoration: none; }
.ld_up:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ── The form ─────────────────────────────────────────────────────────── */
.ld_form { display: grid; gap: 18px; }
.ld_k { display: block; font-family: var(--x-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.66); }
.ld_offers { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ld_offers .ld_k { flex: 1 1 100%; margin-bottom: 2px; }
.ld_chip { font: inherit; font-size: .84rem; padding: 7px 13px; border-radius: 999px; cursor: pointer; color: rgba(255,255,255,.84);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); }
.ld_chip:hover { border-color: rgba(255,255,255,.34); color: #fff; }
.ld_chip[aria-pressed="true"] { background: rgba(255,43,74,.18); border-color: rgba(255,43,74,.65); color: #fff; }
.ld_quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ld_quick .ld_chip { font-size: .78rem; padding: 5px 11px; }

.ld_grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 880px) { .ld_grid { grid-template-columns: minmax(0, 1fr); } }
/* A fieldset is as wide as its widest line unless told otherwise, which
   pushes a phone's page sideways. */
.ld_set, .ld_bases, .ld_pillset { min-width: 0; margin: 0; }
.ld_set { padding: 18px 18px 8px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.09); }
@media (max-width: 560px) { .ld_set { padding: 16px 14px 6px; } }
.ld_set > legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; color: #fff; font-size: 1.02rem; font-weight: 600; }
.ld_set > legend + * { clear: both; }
.ld_two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 380px) { .ld_two { grid-template-columns: minmax(0, 1fr); } }

/* A figure with its unit beside it: $ before, % after. */
.ld_in { display: flex; align-items: center; border-radius: 11px; background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.16); }
.ld_in:focus-within { border-color: var(--x-red); box-shadow: 0 0 0 3px rgba(255,43,74,.18); }
.ld_in > span { flex: none; padding-left: 14px; color: rgba(255,255,255,.55); }
.ld_in > span:last-child { padding: 0 14px 0 0; }
.sh_field .ld_in input { flex: 1; width: auto; min-width: 0; border: 0; border-radius: 11px; background: none; padding: 12px 14px 12px 6px; font-size: 1rem; }
.sh_field .ld_in input:first-child { padding-left: 14px; }
.sh_field .ld_in input:focus { outline: none; }
.ld_hint { margin: 6px 0 0; font-size: .8rem; line-height: 1.55; color: rgba(255,255,255,.6); }
.ld_hint a, .ld_how a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.ld_hint_top { margin: -6px 0 14px; }
.ld_hint_lead { margin: 0 0 12px; }
.ld_est { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font: 600 .6rem/1.6 var(--x-mono); letter-spacing: .1em;
  color: var(--gold); background: rgba(244,201,93,.1); border: 1px solid rgba(244,201,93,.35); vertical-align: middle; }

/* What your share is of: three cards, the one picked lit. */
.ld_bases { padding: 0; border: 0; display: grid; gap: 8px; margin-bottom: 14px; }
.ld_bases > legend, .ld_pillset > legend { padding: 0; margin: 0 0 8px; }
.ld_base { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; border-radius: 12px;
  cursor: pointer; background: rgba(0,0,0,.24); border: 1px solid rgba(255,255,255,.12); }
.ld_base:has(input:checked) { border-color: rgba(255,43,74,.6); background: rgba(255,43,74,.07); }
.ld_base input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--x-red); }
.ld_base b { display: block; color: #fff; font-size: .92rem; font-weight: 600; line-height: 1.35; }
.ld_base small { display: block; margin-top: 3px; color: rgba(255,255,255,.62); font-size: .8rem; line-height: 1.45; }

.ld_pillset { padding: 0; border: 0; margin-bottom: 16px; }
.ld_pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ld_pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; cursor: pointer; font-size: .86rem;
  color: rgba(255,255,255,.86); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); }
.ld_pill input { width: 16px; height: 16px; margin: 0; accent-color: var(--x-red); }
.ld_pill:has(input:checked) { background: rgba(255,43,74,.14); border-color: rgba(255,43,74,.6); color: #fff; }

/* A slider, its value said beside its name. */
.ld_f { margin-bottom: 14px; }
.ld_lab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.ld_lab label { font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.ld_lab output { font-family: var(--x-mono); font-size: .86rem; color: #fff; white-space: nowrap; }
.ld_f input[type="range"] { width: 100%; margin: 4px 0 0; accent-color: var(--x-red); }

/* ── The answer ───────────────────────────────────────────────────────── */
.ld_kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .ld_kpis { grid-template-columns: minmax(0, 1fr); } }
.ld_kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 5px; padding: 18px 18px 16px; border-radius: 16px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); }
.ld_kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kc); }
.ld_kpi .k { font-family: var(--x-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.68); }
.ld_kpi .v { color: #fff; font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.ld_kpi .s { color: rgba(255,255,255,.68); font-size: .86rem; line-height: 1.5; }
.ld_story { margin: 14px 0 0; }

.ld_chartp { margin-top: 16px; }
.ld_ch_h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 18px; margin-bottom: 12px; }
.ld_ch_h h3 { margin: 0; color: #fff; font-size: 1.08rem; }
.ld_legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: rgba(255,255,255,.82); }
.ld_legend span { display: inline-flex; align-items: center; gap: 8px; }
.ld_legend i { width: 16px; height: 2px; border-radius: 1px; background: var(--kc); }

/* The chart, drawn by learn-deal.js to the box's own width. */
.ld_chart { position: relative; min-height: 250px; border-radius: 10px; }
.ld_chart:focus-visible { outline: 2px solid var(--x-red); outline-offset: 4px; }
.ld_svg { display: block; width: 100%; height: auto; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.ld_svg .ld_grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.ld_svg .ld_zero { stroke: rgba(255,255,255,.32); stroke-width: 1; }
.ld_svg .ld_tick { fill: #8f8e96; font: 11px var(--x-mono); }
.ld_svg .ld_line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ld_svg .ld_dot { stroke: var(--ld-surface); stroke-width: 2; }
.ld_svg .ld_key { stroke: none; }
.ld_svg .ld_mark { stroke: rgba(255,255,255,.26); stroke-width: 1; }
.ld_svg .ld_mark_t { fill: rgba(255,255,255,.88); font: 500 11.5px var(--x-sans); }
.ld_svg .ld_end { fill: #fff; font: 600 12px var(--x-sans); paint-order: stroke; stroke: var(--ld-surface); stroke-width: 3px; stroke-linejoin: round; }
.ld_svg .ld_hair_l { stroke: rgba(255,255,255,.5); stroke-width: 1; }
.ld_svg .ld_hit { fill: transparent; cursor: crosshair; }
.ld_tip { position: absolute; z-index: 2; display: none; width: max-content; min-width: 150px; max-width: min(250px, 100%); padding: 10px 12px;
  border-radius: 12px; pointer-events: none; background: rgba(14,14,18,.96); border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 34px -14px rgba(0,0,0,.9); font-size: .82rem; line-height: 1.4; }
.ld_tip.on { display: block; }
.ld_tip .t { color: rgba(255,255,255,.7); font-size: .76rem; margin-bottom: 6px; }
.ld_tip .r { display: grid; grid-template-columns: 14px auto minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 4px; }
.ld_tip .r i { width: 14px; height: 2px; border-radius: 1px; background: var(--kc); }
.ld_tip .r i.none { background: none; }
.ld_tip .r b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.ld_tip .r span { color: rgba(255,255,255,.7); min-width: 0; overflow-wrap: anywhere; }
.ld_note { margin: 8px 0 0; font-size: .8rem; color: rgba(255,255,255,.55); }

/* Every month as a table: the chart's twin, for reading without the chart. */
.ld_table { margin-top: 12px; }
.ld_table summary { cursor: pointer; width: fit-content; color: rgba(255,255,255,.85); font-size: .9rem; padding: 4px 0;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.35); }
.ld_tbl_wrap { margin-top: 8px; max-height: 420px; overflow: auto; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.ld_tbl { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.ld_cap { text-align: left; padding: 10px 10px 6px; color: rgba(255,255,255,.62); font-size: .78rem; }
.ld_tbl th, .ld_tbl td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,.06); }
.ld_tbl thead th { position: sticky; top: 0; z-index: 1; background: #17171b; color: rgba(255,255,255,.78); font-weight: 600; }
.ld_tbl tbody th { color: rgba(255,255,255,.72); font-weight: 500; }
.ld_tbl td { color: rgba(255,255,255,.9); }
.ld_tbl tr.is-mark > * { background: rgba(201,133,0,.14); }

/* Where five years of the music's money ends up: a bar each, the key's
   colour on the bar, the figure and its share beside it. */
.ld_where { margin-top: 16px; }
.ld_where_h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.ld_where_h h3 { margin: 0; color: #fff; font-size: 1.08rem; }
.ld_where_h b { color: #fff; font-size: 1.3rem; letter-spacing: -.01em; }
.ld_rows { display: grid; gap: 12px; margin-top: 16px; }
/* The figure's column is one width on every row, so every bar is drawn
   against the same length and the bars can be compared. */
.ld_row { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) 9.5rem; gap: 4px 14px; align-items: center; }
.ld_row .n { display: flex; align-items: center; gap: 9px; color: #fff; font-size: .92rem; }
.ld_row .n i { width: 10px; height: 10px; border-radius: 3px; background: var(--kc); flex: none; }
.ld_row .trk { height: 12px; border-radius: 0 4px 4px 0; background: rgba(255,255,255,.04); overflow: hidden; }
.ld_row .trk i { display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0; background: var(--kc); transition: width .35s ease; }
.ld_row .val { text-align: right; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld_row .val small { margin-left: 8px; color: rgba(255,255,255,.58); font-weight: 400; }
.ld_row .note { grid-column: 1 / -1; font-size: .78rem; line-height: 1.45; color: rgba(255,255,255,.56); }
@media (max-width: 560px) {
  .ld_row { grid-template-columns: minmax(0, 1fr) auto; }
  .ld_row .trk { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .ld_row .trk i { transition: none; } }

/* ── Three ways, the same music ───────────────────────────────────────── */
.ld_paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 920px) { .ld_paths { grid-template-columns: minmax(0, 1fr); } }
.ld_path { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 16px; border-radius: 18px;
  background: rgba(255,255,255,.045); border: 1px solid color-mix(in srgb, var(--pc) 35%, rgba(255,255,255,.1)); }
.ld_path::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--pc); }
.ld_path_h { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; }
.ld_path_i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--pc);
  background: color-mix(in srgb, var(--pc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); }
.ld_path_i .ld_ico { width: 20px; height: 20px; }
.ld_path_h h3 { margin: 0; color: #fff; font-size: 1.06rem; }
.ld_path_h small { display: block; margin-top: 2px; color: rgba(255,255,255,.66); font-size: .82rem; line-height: 1.45; }
.ld_bests { display: flex; flex-wrap: wrap; gap: 6px; }
.ld_best { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font: 600 .62rem/1.5 var(--x-mono);
  letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2); }
.ld_best i { width: 6px; height: 6px; border-radius: 50%; background: var(--pc); }
.ld_pr { margin: 0; display: grid; }
.ld_pr > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.07); }
.ld_pr dt { color: rgba(255,255,255,.64); font-size: .84rem; }
.ld_pr dt small { display: block; color: rgba(255,255,255,.5); font-size: .74rem; }
.ld_pr dd { margin: 0; color: #fff; font-size: .92rem; text-align: right; font-variant-numeric: tabular-nums; }
.ld_pr .big dd { font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; }
.ld_pr .wide { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ld_pr .wide dd { text-align: left; color: rgba(255,255,255,.84); font-size: .86rem; line-height: 1.45; }
.ld_path_f { margin: auto 0 0; padding-top: 4px; color: rgba(255,255,255,.6); font-size: .8rem; line-height: 1.5; }
.ld_said { display: grid; gap: 8px; margin-top: 16px; }
.ld_said p { margin: 0; }

/* How the sums work. */
.ld_how { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 78ch; }
.ld_how li { position: relative; padding-left: 20px; color: rgba(255,255,255,.78); line-height: 1.65; }
.ld_how li::before { content: ''; position: absolute; left: 2px; top: .64em; width: 7px; height: 7px; border-radius: 2px; background: var(--x-pink); }
