/* ════════════════════════════════════════════════════════════════════════
   Share a chart: the story's share sheet, back for Peak Season's charts (Nov 19: "one button
   per chart", the picture "similarly to how the slides worked"). js/share.js opens it, a
   <dialog class="shm">, from each chart's Share button (.pshare).
   Left, the post as it will look in the feed, on a backdrop blurred from its own image. Right,
   the format, the words and the ways to send it. The sheet never changes size: switching
   formats morphs the image's frame.
   ════════════════════════════════════════════════════════════════════════ */
html.shm-lock { overflow: hidden; }
/* the dialog is the dimmed, blurred backdrop itself, so the card centres in it */
dialog.shm { position: fixed; inset: 0; z-index: 600; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 18px; border: 0; color: var(--text); background: rgba(4, 8, 24, .6); -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%); opacity: 0; transition: opacity .35s var(--ease); }
dialog.shm[open] { display: grid; place-items: center; }
dialog.shm::backdrop { background: transparent; }
.shm.is-open { opacity: 1; }
.sh__card { --pw: min(380px, calc((100vh - 330px) * .8)); position: relative; width: min(1040px, 100%); max-height: calc(100vh - 36px); overflow: auto; overscroll-behavior: contain; display: grid; grid-template-columns: auto minmax(0, 1fr); border-radius: 30px; background: #fff; color: var(--text); box-shadow: 0 70px 140px -50px rgba(0, 0, 0, .75); transform: translateY(22px) scale(.97); transition: transform .6s var(--ease); scrollbar-width: thin; }
.shm.is-open .sh__card { transform: none; }
.sh__x { position: absolute; top: 18px; right: 18px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s var(--ease), transform .45s var(--ease); }
.sh__x svg { width: 17px; height: 17px; }

/* the stage */
.sh__stage { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; min-height: calc(var(--pw) * 1.25 + 270px); padding: 52px 40px 28px; background: #0B1533; }
.sh__bgs i { position: absolute; inset: -80px; z-index: -4; background: center / cover no-repeat; filter: blur(48px) saturate(1.35); transform: scale(1.1); opacity: 0; transition: opacity .8s var(--ease); }
.sh__bgs i.is-on { z-index: -2; opacity: 1; }
.sh__bgs i.is-was { z-index: -3; opacity: 1; }
.sh__cap { position: absolute; top: 18px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 7px; width: max-content; padding: 6px 13px 6px 11px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #fff; background: rgba(9, 13, 31, .26); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); }
.sh__cap svg { width: 14px; height: 14px; }
.sh__stage::before { content: ''; position: absolute; left: 50%; top: 50%; z-index: -1; width: calc(var(--pw) * 1.9); height: calc(var(--pw) * 1.9); margin: calc(var(--pw) * -.95) 0 0 calc(var(--pw) * -.95); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0)); pointer-events: none; }
.sh__stage::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(75% 60% at 50% 45%, rgba(4, 8, 24, 0), rgba(4, 8, 24, .32)), linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(4, 8, 24, .12)); }
/* the post */
.sh__post { container-type: inline-size; width: var(--pw); overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(9, 13, 31, .06), 0 46px 90px -40px rgba(0, 0, 0, .65), 0 14px 30px -18px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(16px) scale(.97); transition: transform .9s var(--ease) .06s, opacity .5s var(--ease) .06s; }
.shm.is-open .sh__post { opacity: 1; transform: none; }
.sh__who { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 14px; }
.sh__av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--grad-cta); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sh__av > svg { display: block; width: 100%; height: 100%; }
/* verified, by the people who verify */
.sh__vf { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: #00A876; box-shadow: 0 0 0 2px #fff; }
.sh__vf svg { width: 11px; height: 11px; stroke-width: 3.2; }
.sh__id { display: grid; min-width: 0; line-height: 1.3; }
.sh__id b { overflow: hidden; font-size: 13.5px; font-weight: 600; color: rgba(0, 0, 0, .9); white-space: nowrap; text-overflow: ellipsis; }
.sh__id em { overflow: hidden; font-size: 11.5px; font-style: normal; color: rgba(0, 0, 0, .6); white-space: nowrap; text-overflow: ellipsis; }
.sh__id small { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: rgba(0, 0, 0, .55); }
.sh__id small svg { width: 11px; height: 11px; }
.sh__dots { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; color: rgba(0, 0, 0, .55); }
.sh__dots svg { width: 18px; height: 18px; }
.sh__copy { position: relative; margin: 0 14px 10px; cursor: text; max-height: calc(1.45em * 3); overflow: hidden; font-size: 13px; line-height: 1.45; color: rgba(0, 0, 0, .9); white-space: pre-line; overflow-wrap: anywhere; }
.sh__copy.is-clamped::after { content: '…more'; position: absolute; right: 0; bottom: 0; padding-left: 34px; color: rgba(0, 0, 0, .55); background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 28px); }
.sh__tag { font-weight: 600; color: #0A66C2; }
/* the image: its frame morphs between 4:5 and 1:1 while the two renders crossfade */
.sh__frame { position: relative; overflow: hidden; height: calc(var(--pw) * 1.25); background: #EEF1F6; transition: height .75s cubic-bezier(.5, 0, .1, 1); }
.sh__frame[data-fmt="square"] { height: var(--pw); }
.sh__frame::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%) 0 0 / 220% 100%; opacity: 0; transition: opacity .35s var(--ease); animation: sh-shim 1.3s linear infinite; }
.sh__frame.is-busy::before { opacity: 1; }
@keyframes sh-shim { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sh__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(12px); transform: scale(1.06); transition: opacity .5s cubic-bezier(.5, 0, .1, 1), filter .65s var(--ease), transform .9s var(--ease); }
/* a focus pull: the old image softens and leans in while the new one comes into focus over it */
.sh__frame img.is-on { z-index: 2; opacity: 1; filter: blur(0); transform: none; }
.sh__frame img.is-was { z-index: 1; opacity: 1; filter: blur(12px); transform: scale(1.08); }
.sh__frame .sh__spin { position: absolute; left: 50%; top: 50%; margin: -14px 0 0 -14px; opacity: 0; transition: opacity .3s; }
.sh__frame.is-busy:not(:has(img.is-on)) .sh__spin { opacity: 1; }
.sh__err { position: absolute; inset: 0; display: none; place-items: center; padding: 24px; font-size: 13px; text-align: center; color: var(--text-2); }
.sh__frame.is-err .sh__err { display: grid; }
.sh__bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 6px; border-top: 1px solid rgba(0, 0, 0, .08); }
.sh__bar span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; font-size: 12px; font-weight: 600; color: rgba(0, 0, 0, .6); }
.sh__bar svg { width: 17px; height: 17px; flex: none; }
@container (max-width: 350px) { .sh__bar span { gap: 4px; font-size: 11px; } .sh__bar svg { width: 15px; height: 15px; } }
@container (max-width: 290px) { .sh__bar span { font-size: 0; } .sh__bar svg { width: 16px; height: 16px; } }
/* a narrow post keeps the whole joke: smaller type, then the headline wraps rather than cuts off */
@container (max-width: 290px) {
  .sh__who { gap: 8px; padding: 10px 8px 6px 11px; }
  .sh__av { width: 38px; height: 38px; }
  .sh__id b { font-size: 12.5px; }
  .sh__id em, .sh__id small { font-size: 10.5px; }
  .sh__dots { width: 24px; }
}
@container (max-width: 230px) {
  .sh__av { width: 32px; height: 32px; }
  .sh__vf { width: 14px; height: 14px; right: -2px; bottom: -2px; }
  .sh__vf svg { width: 8px; height: 8px; }
  .sh__id em { line-height: 1.25; white-space: normal; }
  .sh__dots { display: none; }
}

/* the controls */
/* a column whose editor takes whatever height the preview leaves over */
.sh__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 34px 34px 30px; }
.sh__side > * { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .8s var(--ease); }
.shm.is-open .sh__side > * { opacity: 1; transform: none; }
.shm.is-open .sh__side > :nth-child(1) { transition-delay: .1s; }
.shm.is-open .sh__side > :nth-child(2) { transition-delay: .16s; }
.shm.is-open .sh__side > :nth-child(3) { transition-delay: .22s; }
.shm.is-open .sh__side > :nth-child(4) { transition-delay: .28s; }
.sh__head { display: grid; gap: 8px; padding-right: 48px; }
.sh__head h3 { font-size: clamp(1.6rem, 1.15rem + .9vw, 2.1rem); line-height: 1.12; font-weight: var(--fw-head); letter-spacing: -.01em; }
.sh__head p { max-width: 30em; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.sh__group { display: grid; gap: 8px; }
.sh__group--post { flex: 1 1 auto; display: flex; flex-direction: column; }
.sh__lab { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.sh__reset { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--primary); }
.sh__reset:hover { text-decoration: underline; text-underline-offset: 3px; }
.sh__reset[hidden] { display: none; }
.sh__fmt { container-type: inline-size; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.sh__fmt small em { font-style: normal; }
/* a narrow picker keeps the ratio and drops the description, rather than cutting it off */
@container (max-width: 360px) { .sh__fmt small em { display: none; } }
.sh__ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(9, 13, 31, .08), 0 10px 22px -10px rgba(9, 13, 31, .3); transition: transform .6s var(--ease); }
.sh__fmt[data-on="square"] .sh__ind { transform: translateX(calc(100% + 4px)); }
.sh__fmt button { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: 12px; text-align: left; color: var(--text-2); transition: color .3s var(--ease); }
.sh__fmt button:hover { color: var(--text); }
.sh__fmt button[aria-pressed="true"] { color: var(--text); }
.sh__fmt span { display: grid; min-width: 0; }
.sh__fmt b { font-size: 13.5px; font-weight: 700; }
.sh__fmt small { overflow: hidden; font-size: 11.5px; color: var(--text-3); white-space: nowrap; text-overflow: ellipsis; }
.sh__glyph { flex: none; display: grid; place-items: center; width: 24px; height: 28px; }
.sh__glyph::before { content: ''; display: block; border-radius: 4px; box-shadow: inset 0 0 0 1.8px currentColor; transition: background-color .35s var(--ease), box-shadow .35s var(--ease), transform .5s var(--ease); }
.sh__glyph--p::before { width: 18px; height: 23px; }
.sh__glyph--s::before { width: 21px; height: 21px; }
.sh__fmt button[aria-pressed="true"] .sh__glyph::before { background: var(--grad-cta); box-shadow: 0 6px 12px -6px rgba(4, 94, 232, .7); transform: scale(1.06); }
.sh__edit { --eb: var(--surface-2); position: relative; flex: 1 1 auto; display: flex; border-radius: 16px; background: var(--eb); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s var(--ease), box-shadow .3s var(--ease); }
.sh__edit:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.sh__edit:focus-within { --eb: #fff; box-shadow: inset 0 0 0 1.5px var(--blue-400), 0 0 0 4px rgba(42, 139, 255, .14); }
.sh__text { flex: 1 1 auto; width: 100%; min-height: 196px; resize: none; -webkit-mask-image: linear-gradient(#000 calc(100% - 38px), transparent calc(100% - 6px)); mask-image: linear-gradient(#000 calc(100% - 38px), transparent calc(100% - 6px)); padding: 14px 16px 30px; border: 0; border-radius: 16px; background: transparent; font: 500 13.5px/1.6 var(--font); color: var(--text); scrollbar-width: thin; }
.sh__text:focus { outline: none; box-shadow: none; }
.sh__count { position: absolute; z-index: 1; right: 14px; bottom: 9px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-3); background: #fff; box-shadow: 0 0 0 1px var(--line); pointer-events: none; }
.sh__count.is-near { color: #B76E00; }
.sh__count.is-over { color: #fff; background: var(--red-500); }
.sh__acts { display: grid; gap: 10px; }
.sh__go { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 56px; padding: 0 22px; border-radius: var(--r-pill); font-size: 15px; font-weight: 700; letter-spacing: var(--track-sm); text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #0A66C2 0%, #1A7FDB 100%); box-shadow: 0 16px 32px -14px rgba(10, 102, 194, .75); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.sh__go::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #00498F 0%, #0A66C2 55%, #2D8FE6 100%); opacity: 0; transition: opacity .5s var(--ease); }
.sh__go::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .32) 50%, transparent 65%) 0 0 / 250% 100% no-repeat; background-position: 130% 0; pointer-events: none; }
.shm.is-open .sh__go::after { animation: sh-sweep 1.3s var(--ease-io) .85s 1 both; }
@keyframes sh-sweep { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.sh__go:active { transform: scale(.985); transition-duration: .15s; }
.sh__go > i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .16); }
.sh__go > i svg { width: 17px; height: 17px; }
.sh__go > svg { width: 18px; height: 18px; opacity: .85; transition: transform .5s var(--ease); }
.sh__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh__more button { display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0; min-height: 90px; padding: 12px 6px; border-radius: 16px; text-align: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s var(--ease), box-shadow .3s var(--ease), transform .45s var(--ease); }
.sh__more button:active { transform: scale(.97); transition-duration: .15s; }
.sh__more button[hidden] { display: none; }
.sh__more i { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 2px; border-radius: 50%; color: var(--primary); background: rgba(0, 93, 232, .1); transition: background-color .35s var(--ease), color .35s var(--ease), transform .5s var(--ease); }
.sh__more i svg { width: 18px; height: 18px; }
.sh__more b { font-size: 13px; font-weight: 700; }
.sh__more small { max-width: 100%; overflow: hidden; font-size: 11px; color: var(--text-3); white-space: nowrap; text-overflow: ellipsis; }
.sh__more button.is-done i { color: #fff; background: #00A876; transform: scale(1.08); }
.sh__more button.is-done b { color: #00865E; }
.sh__note { min-height: 46px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); text-align: center; text-wrap: balance; }
/* what's done and what's left, as a stepper: one line with connectors when it fits,
   three columns with the labels under their numbers when it doesn't. Never a step broken in two. */
.sh__acts { container-type: inline-size; }
.sh__steps { display: grid; grid-auto-flow: column; justify-content: center; align-items: center; margin: 0; padding: 0; list-style: none; }
.sh__steps li { position: relative; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; color: var(--text-2); opacity: 0; transform: translateY(4px); animation: sh-step .5s var(--ease) forwards; }
.sh__steps li + li::before { content: ''; flex: none; width: 22px; height: 2px; margin: 0 4px 0 6px; border-radius: 2px; background: var(--line-2); }
.sh__steps li:nth-child(2) { animation-delay: .12s; }
.sh__steps li:nth-child(3) { animation-delay: .24s; color: var(--text); }
.sh__steps i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700; color: var(--primary); background: rgba(0, 93, 232, .1); }
.sh__steps li.is-done i { color: #fff; background: #00A876; }
.sh__steps i svg { width: 12px; height: 12px; }
/* the one left to do, nudged a few times and then left alone */
.sh__steps li:not(.is-done) i { color: #fff; background: var(--primary); animation: sh-ping 1.6s ease-out .7s 3; }
.sh__steps span svg { display: inline-block; width: 16px; height: 16px; margin-left: 2px; vertical-align: -3px; color: #0A66C2; }
@keyframes sh-step { to { opacity: 1; transform: none; } }
@keyframes sh-ping { from { box-shadow: 0 0 0 0 rgba(0, 93, 232, .45); } to { box-shadow: 0 0 0 9px rgba(0, 93, 232, 0); } }
@container (max-width: 470px) {
  .sh__steps { grid-auto-columns: minmax(0, 1fr); align-items: start; width: 100%; }
  .sh__steps li { flex-direction: column; gap: 6px; padding: 0 4px; font-size: 12px; text-align: center; white-space: normal; text-wrap: balance; }
  .sh__steps li + li::before { position: absolute; top: 10px; right: calc(50% + 17px); width: calc(100% - 34px); margin: 0; }
}
.sh__x:focus-visible { border-radius: 50%; box-shadow: var(--ring); }
.sh__fmt button:focus-visible { border-radius: 12px; }
.sh__go:focus-visible { border-radius: var(--r-pill); box-shadow: var(--ring), 0 16px 32px -14px rgba(10, 102, 194, .75); }
.sh__more button:focus-visible { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2), var(--ring); }
.sh__reset:focus-visible { border-radius: 4px; }
/* hover lifts only where there's a pointer to hover with (no sticky hover after a tap) */
@media (hover: hover) {
  .sh__x:hover { background: #fff; transform: rotate(90deg); box-shadow: inset 0 0 0 1px var(--line-2), 0 8px 20px -10px rgba(0, 39, 104, .35); }
  .sh__go:hover { transform: translateY(-1px); box-shadow: 0 22px 40px -16px rgba(10, 102, 194, .85); }
  .sh__go:hover::before { opacity: 1; }
  .sh__go:hover > svg { transform: translate(2px, -2px); }
  .sh__more button:hover { background: #fff; transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2), 0 16px 30px -18px rgba(0, 39, 104, .45); }
}
@media (max-height: 820px) and (min-width: 861px) {
  .sh__side { gap: 16px; padding-top: 28px; }
  .sh__head p { display: none; }
  .sh__text { min-height: 150px; }
  .sh__more button { min-height: 78px; }
}
/* short laptop screens: everything still fits without scrolling */
@media (max-height: 700px) and (min-width: 861px) {
  .sh__card { --pw: min(380px, calc((100vh - 290px) * .75)); }
  .sh__stage { min-height: calc(var(--pw) * 1.25 + 232px); padding: 22px 32px; }
  .sh__cap { display: none; }
  .sh__side { gap: 12px; padding: 22px 28px 20px; }
  .sh__head { gap: 4px; }
  .sh__head h3 { font-size: 1.55rem; }
  .sh__fmt button { padding: 7px 10px; }
  .sh__fmt small { display: none; }
  .sh__text { min-height: 104px; padding-bottom: 26px; }
  .sh__go { height: 50px; }
  .sh__more button { min-height: 0; grid-auto-flow: column; justify-content: center; align-items: center; gap: 8px; padding: 11px 8px; }
  .sh__more i { width: 30px; height: 30px; margin: 0; }
  .sh__more small { display: none; }
  .sh__note:not(.is-steps) { display: none; }
  .sh__note { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sh__frame, .sh__frame img, .sh__post, .sh__ind, .sh__bgs i, .sh__side > * { transition: none; }
  .sh__frame img, .sh__frame img.is-was { filter: none; transform: none; }
  .sh__frame::before, .shm.is-open .sh__go::after { animation: none; }
  .sh__steps li { animation: none; opacity: 1; transform: none; }
  .sh__steps li:not(.is-done) i { animation: none; }
}

/* phones: the sheet rises from the bottom; the preview stays, a little smaller */
@media (max-width: 860px) {
  dialog.shm[open] { place-items: end center; padding: 0; }
  .sh__card { --pw: max(184px, min(236px, calc(100vw - 120px), calc((100vh - 560px) * .8))); width: 100%; max-height: 94vh; grid-template-columns: minmax(0, 1fr); border-radius: 28px 28px 0 0; transform: translateY(48px); }
  /* tall enough for the portrait post, so switching to square never moves the controls */
  .sh__stage { min-height: calc(var(--pw) * 1.25 + 176px); padding: 20px 16px 22px; }
  .sh__cap { display: none; }
  .sh__who { padding: 9px 10px 6px 11px; gap: 8px; }
  .sh__av { width: 34px; height: 34px; }
  .sh__vf { width: 15px; height: 15px; right: -2px; bottom: -2px; }
  .sh__vf svg { width: 9px; height: 9px; }
  .sh__id b { font-size: 12px; }
  .sh__copy { max-height: calc(1.45em * 2); margin: 0 11px 8px; font-size: 11.5px; }
  .sh__bar span { height: 32px; font-size: 0; gap: 0; }
  .sh__side { gap: 16px; padding: 20px 18px 0; }
  .sh__head { padding-right: 0; gap: 4px; }
  .sh__head h3 { font-size: 1.5rem; }
  .sh__head p { display: none; }
  .sh__x { top: 14px; right: 14px; background: rgba(255, 255, 255, .92); }
  .sh__fmt small { display: none; }
  .sh__text { min-height: 120px; max-height: 120px; }
  /* the ways to send it stay in reach while the rest scrolls */
  .sh__acts { position: sticky; bottom: 0; z-index: 2; margin: 0 -18px; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255, 255, 255, 0), #fff 14px); }
  .sh__more button { min-height: 70px; padding: 8px 4px; }
  .sh__more i { width: 30px; height: 30px; }
  .sh__more small { display: none; }
  .sh__note:not(.is-steps) { display: none; }
}
html.motion-off .sh__steps li:not(.is-done) i { animation: none; }

/* ── Each chart's Share button, at the end of its title row ─────────────── */
/* A primary button (Nov 20: "more primary, obvious, pulse, but fit in"): the call to action's
   blue, its icon in a bubble of its own. Once its chart is built a glint runs across it and it
   pulses three times, then every few seconds it glints and pulses once more, softly. */
.pshare { --psh: 0 10px 22px -12px rgba(4, 94, 232, .8), inset 0 1px 0 rgba(255, 255, 255, .28); --pring: 42, 139, 255; position: relative; isolation: isolate; overflow: hidden; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 5px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; letter-spacing: .2px; color: #fff; background: var(--grad-cta); box-shadow: 0 0 0 0 rgba(var(--pring), 0), var(--psh); transition: color .3s var(--ease), box-shadow .35s var(--ease), transform .45s var(--ease); }
.pshare > i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); transition: background-color .3s var(--ease), transform .5s var(--ease); }
.pshare svg { width: 15px; height: 15px; transition: transform .5s var(--ease); }
.pshare::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--grad-cta-hover); opacity: 0; transition: opacity .35s var(--ease); }
.pshare::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%) 0 0 / 250% 100% no-repeat; background-position: 130% 0; pointer-events: none; }
.pshare.is-built { animation: pshare-pulse 1.6s var(--ease) .5s 3, pshare-idle 9s var(--ease) 5.3s infinite; }
.pshare.is-built::after { animation: sh-sweep 1.2s var(--ease-io) .2s 1 both, pshare-glint 9s var(--ease-io) 5.3s infinite; }
@keyframes pshare-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--pring), .6), var(--psh); } 70%, 100% { box-shadow: 0 0 0 13px rgba(var(--pring), 0), var(--psh); } }
@keyframes pshare-idle { 0%, 84% { box-shadow: 0 0 0 0 rgba(var(--pring), 0), var(--psh); } 86% { box-shadow: 0 0 0 0 rgba(var(--pring), .45), var(--psh); } 100% { box-shadow: 0 0 0 12px rgba(var(--pring), 0), var(--psh); } }
@keyframes pshare-glint { 0%, 80% { background-position: 130% 0; } 96%, 100% { background-position: -30% 0; } }
.pshare:active { transform: scale(.96); transition-duration: .15s; }
.pshare:focus-visible { box-shadow: var(--ring); animation: none; }
@media (hover: hover) {
  .pshare:hover { box-shadow: 0 0 0 4px rgba(var(--pring), .18), 0 16px 30px -12px rgba(28, 125, 250, .85), inset 0 1px 0 rgba(255, 255, 255, .3); transform: translateY(-1px); animation: none; }
  .pshare:hover::before { opacity: 1; }
  .pshare:hover > i { background: rgba(255, 255, 255, .3); transform: rotate(-8deg) scale(1.06); }
  .pshare:hover svg { transform: translateY(-2px); }
}
/* on the blue and the night chapters: white, with the blue on it, and a white ring */
.on-blue .pshare { --psh: 0 12px 26px -12px rgba(0, 10, 40, .6), inset 0 0 0 1px rgba(255, 255, 255, .9); --pring: 255, 255, 255; color: var(--primary); background: #fff; }
.on-blue .pshare > i { color: #fff; background: var(--grad-cta); box-shadow: none; }
.on-blue .pshare::before { background: linear-gradient(90deg, #FFFFFF, #EAF2FF); }
.on-blue .pshare::after { background-image: linear-gradient(105deg, transparent 30%, rgba(42, 139, 255, .22) 50%, transparent 70%); }
.chap--rings .pshare { color: #B3122E; }
.chap--rings .pshare > i { background: linear-gradient(135deg, #FF4D63, #C21A3A); }
@media (hover: hover) {
  .on-blue .pshare:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 16px 30px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px #fff; }
  .on-blue .pshare:hover > i { background: var(--grad-cta-hover); }
  .chap--rings .pshare:hover > i { background: linear-gradient(135deg, #FF6176, #D62346); }
}
/* the title row's right end: a chart's own chip, then Share */
.panel__end { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px; margin-left: auto; }
@media (max-width: 560px) { .pshare { height: 36px; padding: 0 14px 0 4px; font-size: 12.5px; } .pshare > i { width: 28px; height: 28px; } }
@media (prefers-reduced-motion: reduce) { .pshare, .pshare svg, .pshare > i, .pshare::before { transition: none; } .pshare.is-built, .pshare.is-built::after { animation: none; } }
html.motion-off .pshare.is-built, html.motion-off .pshare.is-built::after { animation: none; }
/* beside a chart's toggle on a phone, Share is its icon in its bubble (its name stays for screen
   readers), so the two keep one line */
@media (max-width: 560px) {
  .panel__end .seg + .pshare { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .panel__end .seg + .pshare span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
