/* Run-It insights (owner 2026-10-23, js/run-it-insights.js). Option B, picked the same day: a button
   at the top right of the section card ("Insights" in shimmering text, two cyan lights running
   round its edge, the number of things to improve in amber), a panel of insights under it, and one
   coach card fixed at the bottom of the screen (the toast surface, pro-app.css .run-toast). */

/* The host is the last item of the section's .ri-card-head. It has no height, so the button
   centres on the title row and can never move the divider under it. */
.ri-card-head:has(> .ri-insights) { position: relative; }
/* While its panel is open the title row sits above the section's own raised content (the Runs
   list is z-index 100), so the panel is never under it. */
.ri-card-head:has(> .ri-insights .ri-insights-btn[aria-expanded="true"]) { z-index: 400; }
.ri-insights {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  height: 0;
  margin-left: auto;
}
.ri-insights[hidden] { display: none; }

/* Two lights chase each other round the button's edge (owner 2026-10-25 picked "twin lights" over
   one running light): a conic gradient with two beams half a turn apart, on a registered angle. */
@property --ri-insights-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.ri-insights-btn {
  --_btn-surface: #0c0e22;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 5px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background:
    radial-gradient(90% 120% at 50% 130%, rgba(46, 209, 244, 0.24), rgba(46, 209, 244, 0) 70%) padding-box,
    linear-gradient(var(--_btn-surface), var(--_btn-surface)) padding-box,
    conic-gradient(from var(--ri-insights-angle), rgba(46, 209, 244, 0) 0deg 110deg, rgba(46, 209, 244, 0.8) 150deg, #d6f8ff 170deg, rgba(46, 209, 244, 0) 180deg 290deg, rgba(46, 209, 244, 0.8) 330deg, #d6f8ff 350deg, rgba(46, 209, 244, 0) 360deg) border-box,
    linear-gradient(rgba(46, 209, 244, 0.26), rgba(46, 209, 244, 0.26)) border-box;
  box-shadow: 0 0 16px rgba(46, 209, 244, 0.22), inset 0 0 12px rgba(46, 209, 244, 0.12);
  color: #fff;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  animation: riInsightsBeam 5.5s linear infinite;
  transition: box-shadow var(--ri-dur-fast, 150ms) var(--ri-ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
}
@keyframes riInsightsBeam { to { --ri-insights-angle: 360deg; } }
@media (hover: hover) {
  .ri-insights-btn:hover { box-shadow: 0 0 22px rgba(46, 209, 244, 0.4), inset 0 0 14px rgba(46, 209, 244, 0.2); }
}
.ri-insights-btn[aria-expanded="true"] { box-shadow: 0 0 22px rgba(46, 209, 244, 0.45), inset 0 0 16px rgba(46, 209, 244, 0.24); }
.ri-insights-btn:focus-visible { outline: 2px solid var(--ri-cyan, #2ED1F4); outline-offset: 3px; }
.ri-insights-btn-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(46, 209, 244, 0.12);
  box-shadow: inset 0 0 0 1px rgba(46, 209, 244, 0.32);
}
.ri-insights-btn-mark img { width: 16px; height: 16px; object-fit: contain; }
/* "Insights" (owner 2026-10-25: no "Run-It" in it any more) under a cyan-white shimmer. */
.ri-insights-btn-text {
  background: linear-gradient(100deg, #2ED1F4 0%, #2ED1F4 30%, #ffffff 45%, #b8f3ff 55%, #2ED1F4 70%, #2ED1F4 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: var(--ri-text-button, 14px);
  font-weight: var(--ri-weight-medium, 500);
  letter-spacing: 0.01em;
  animation: riInsightsShimmer 5.5s ease-in-out infinite;
}
@keyframes riInsightsShimmer {
  0% { background-position: 100% 0; }
  60%, 100% { background-position: 0% 0; }
}
.ri-insights-btn-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f3b63f;
  box-shadow: 0 0 10px rgba(243, 182, 63, 0.5);
  color: #1a1205;
  font-size: var(--ri-text-micro, 11px);
  font-weight: 700;
  line-height: 1;
}
.ri-insights-btn-count[hidden] { display: none; }

/* What changed since the last read (js/run-it-insights.js insightChanges): green better, amber worse. */
.ri-insights-btn { position: relative; }
.ri-insights-btn[data-change]::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--_change-c);
  box-shadow: 0 0 0 2px #07081a, 0 0 10px var(--_change-c);
  animation: riInsightsChangePulse 1.8s ease-in-out infinite;
}
.ri-insights-btn[data-change="better"] { --_change-c: #34d399; }
.ri-insights-btn[data-change="worse"] { --_change-c: #f3b63f; }
@keyframes riInsightsChangePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}
.ri-insights-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--_change-c, var(--ri-cyan, #2ED1F4));
  box-shadow: 0 0 8px var(--_change-c, var(--ri-cyan, #2ED1F4));
  vertical-align: 1px;
}
.ri-insights-row.is-better, .ri-insight-coach-change.is-better { --_change-c: #34d399; }
.ri-insights-row.is-worse, .ri-insight-coach-change.is-worse { --_change-c: #f3b63f; }
.ri-insights-row.has-change { background: color-mix(in srgb, var(--_change-c) 7%, transparent); }
.ri-insights-note-change {
  display: flex;
  align-items: center;
  margin-top: 4px;
  color: var(--ri-text-muted, rgba(255, 255, 255, 0.74));
}

/* The panel under the button. */
.ri-insights-panel {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 60;
  box-sizing: border-box;
  width: 380px;
  padding: 12px 6px 8px;
  border: 1px solid rgba(46, 209, 244, 0.26);
  border-radius: 14px;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(46, 209, 244, 0.16), rgba(46, 209, 244, 0) 66%),
    var(--ri-surface-overlay, #120F22);
  box-shadow: var(--ri-shadow-overlay, 0 16px 48px rgba(0, 0, 0, 0.5)), inset 0 0 24px rgba(46, 209, 244, 0.1);
  text-align: left;
  white-space: normal;
  animation: riInsightsPanelIn 200ms var(--ri-ease-standard, cubic-bezier(0.4, 0, 0.2, 1)) both;
}
.ri-insights-panel[hidden] { display: none; }
@keyframes riInsightsPanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.ri-insights-note {
  margin: 0 10px 8px !important;
  color: var(--ri-text-faint, rgba(255, 255, 255, 0.62));
  font-size: var(--ri-text-caption, 13px) !important;
  font-weight: var(--ri-weight-light, 300);
  line-height: 1.4;
}
.ri-insights-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--ri-dur-fast, 150ms) ease;
}
.ri-insights-row + .ri-insights-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.ri-insights-group {
  margin: 10px 10px 2px !important;
  color: var(--ri-cyan, #2ED1F4);
  font-size: var(--ri-text-caption, 13px) !important;
  font-weight: var(--ri-weight-medium, 500);
}
.ri-insights-rows > .ri-insights-group:first-child { margin-top: 0 !important; }
@media (hover: hover) {
  .ri-insights-row:hover { background: rgba(46, 209, 244, 0.07); }
  .ri-insights-row:hover .ri-insights-row-go { transform: translateX(3px); }
}
.ri-insights-row:focus-visible { outline: 2px solid var(--ri-cyan, #2ED1F4); outline-offset: -2px; }
.ri-insights-row > .run-it-icon { grid-row: span 2; width: 18px; height: 18px; color: var(--row-color, var(--ri-cyan, #2ED1F4)); }
.ri-insights-row-headline {
  color: var(--ri-text-strong, rgba(255, 255, 255, 0.96));
  font-size: var(--ri-text-secondary, 14px);
  font-weight: var(--ri-weight-medium, 500);
  line-height: 1.3;
}
.ri-insights-row-headline span { color: var(--ri-text-faint, rgba(255, 255, 255, 0.62)); font-weight: var(--ri-weight-light, 300); }
/* Marks the rows the button's amber count is counting: the badge's own amber pill. Pinned to the
   row's top right corner, the same spot on every row however the title wraps (owner 2026-10-26);
   the title keeps clear of it and the arrow sits under it. */
.ri-insights-row { position: relative; }
.ri-insights-row-flag {
  position: absolute;
  top: 9px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f3b63f;
  box-shadow: 0 0 8px rgba(243, 182, 63, 0.4);
  color: #1a1205;
  font-size: var(--ri-text-micro, 11px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.ri-insights-row:has(.ri-insights-row-flag) .ri-insights-row-headline { padding-right: 64px; }
/* A change wears the same pill, green when it got better (owner 2026-10-26: "use the same yellow
   button styling, for the green dot and the tag"): on the row, beside the button's amber count, and
   inline before the panel note and the coach card's change line. No corner dot any more. */
.ri-insights-row-flag.is-better,
.ri-insights-btn-count.is-better {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
  color: #04241a;
}
/* A form number that moved, not yet judged by heart rate: the Improved pill in cyan (owner
   2026-10-29: "same styling as improved"). */
.ri-insights-row-flag.is-changed {
  background: #2ED1F4;
  box-shadow: 0 0 8px rgba(46, 209, 244, 0.45);
  color: #04202a;
}
.ri-insights-row-flag.is-inline {
  position: static;
  display: inline-block;
  margin-right: 8px;
  vertical-align: 1px;
}
.ri-insights-btn-count + .ri-insights-btn-count { margin-left: -3px; }
.ri-insights-btn[data-change]::after { content: none; }
.ri-insights-row.has-change { background: none; }
.ri-insights-row:has(.ri-insights-row-flag) .ri-insights-row-go { grid-row: 2; }
.ri-insights-row-sub {
  grid-column: 2;
  color: var(--ri-text-muted, rgba(255, 255, 255, 0.74));
  font-size: var(--ri-text-caption, 13px);
  font-weight: var(--ri-weight-light, 300);
  line-height: 1.3;
}
.ri-insights-row-go {
  grid-row: 1 / span 2;
  grid-column: 3;
  color: var(--ri-cyan, #2ED1F4);
  transition: transform var(--ri-dur-fast, 150ms) var(--ri-ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
}
.ri-insights-row.is-pending { cursor: default; }
.ri-insights-row.is-pending .ri-insights-row-headline { width: 70%; height: 14px; border-radius: 6px; }
.ri-insights-row.is-pending .ri-insights-row-sub { width: 45%; height: 12px; border-radius: 6px; }
.ri-insights-foot { display: flex; justify-content: flex-end; padding: 6px 10px 2px; }

.ri-insights-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(46, 209, 244, 0.1);
  box-shadow: inset 0 0 0 1px rgba(46, 209, 244, 0.28);
}
.ri-insights-mark img { width: 16px; height: 16px; object-fit: contain; }

/* The card an insight points at (owner 2026-10-25: "build a nicer selected card, this cyan border
   looks a bit cheap"): a glow ring of its own drawn over the card (.ri-insight-spot only marks
   it). Under the coach card and the site header. A soft cyan edge with a faint inner light, and the
   button's twin lights running round it the whole time (owner 2026-10-25: "the SAME animation, so
   not the pulsating glow stuff"); they fade in as the ring lands on each new card. */
@property --ri-ring-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.ri-insight-ring {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1100;
  box-sizing: border-box;
  width: 0;
  height: 0;
  border-radius: var(--ring-radius, 18px);
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgba(46, 209, 244, 0.05), rgba(46, 209, 244, 0) 60%);
  box-shadow:
    0 0 0 1px rgba(46, 209, 244, 0.5),
    0 0 18px 1px rgba(46, 209, 244, 0.2),
    0 0 46px 6px rgba(46, 209, 244, 0.08),
    inset 0 0 22px rgba(46, 209, 244, 0.1);
  opacity: 0;
  transition: opacity 260ms ease;
}
.ri-insight-ring.is-on { opacity: 1; }
/* The two running lights (as on .ri-insights-btn), shown only in a thin edge. */
.ri-insight-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ri-ring-angle), rgba(46, 209, 244, 0) 0deg 110deg, rgba(46, 209, 244, 0.8) 150deg, #e6fbff 170deg, rgba(46, 209, 244, 0) 180deg 290deg, rgba(46, 209, 244, 0.8) 330deg, #e6fbff 350deg, rgba(46, 209, 244, 0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
}
.ri-insight-ring.is-on::before { opacity: 1; animation: riInsightRingBeam 5.5s linear infinite; }
.ri-insight-ring.is-on.is-arriving::before { animation: riInsightRingBeam 5.5s linear infinite, riInsightRingIn 500ms ease-out both; }
@keyframes riInsightRingBeam { to { --ri-ring-angle: 360deg; } }
@keyframes riInsightRingIn { from { opacity: 0; } }

.ri-insight-coach {
  --coach-rgb: 46, 209, 244;
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  box-sizing: border-box;
  width: min(480px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  border: 1px solid rgba(var(--coach-rgb), 0.26);
  border-radius: var(--ri-radius-md, 12px);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(var(--coach-rgb), 0.18), rgba(var(--coach-rgb), 0) 66%),
    radial-gradient(90% 60% at 50% 115%, rgba(var(--coach-rgb), 0.08), rgba(var(--coach-rgb), 0) 70%),
    var(--ri-surface-overlay, #120F22);
  box-shadow: var(--ri-shadow-overlay, 0 16px 48px rgba(0, 0, 0, 0.5)), inset 0 0 24px rgba(var(--coach-rgb), 0.12);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 220ms ease, transform 220ms var(--ri-ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
}
.ri-insight-coach[hidden] { display: none; }
.ri-insight-coach.is-open { opacity: 1; transform: translate(-50%, 0); }
/* A long card scrolls inside itself instead of running off the screen. In the iOS app (owner
   2026-11-02: "the bottom bar is in the way") it sits above the app's tab bar, whose height the
   app gives the page as --run-it-native-bottom-chrome-inset, and stops below the app's header. */
.ri-insight-coach {
  max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html[data-run-it-native-shell="1"] .ri-insight-coach.ri-insight-coach {
  bottom: calc(var(--run-it-native-bottom-chrome-inset, 0px) + 12px);
  max-height: calc(100dvh - var(--run-it-native-bottom-chrome-inset, 0px) - env(safe-area-inset-top, 0px) - 96px);
}
.ri-insight-coach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ri-insight-coach-step {
  flex: 1;
  color: var(--ri-text-faint, rgba(255, 255, 255, 0.62));
  font-size: var(--ri-text-caption, 13px);
}
.ri-insight-coach-change {
  display: block;
  margin: 0 0 12px !important;
  padding: 9px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--_change-c, #2ED1F4) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_change-c, #2ED1F4) 22%, transparent);
  color: var(--_change-c, var(--ri-cyan, #2ED1F4));
  font-size: var(--ri-text-caption, 13px) !important;
  font-weight: var(--ri-weight-medium, 500);
  line-height: 1.35;
}
.ri-insight-coach-change-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ri-insight-coach-change-head .ri-insights-row-flag.is-inline { margin-right: 0; }
.ri-insight-coach-change-note {
  display: block;
  margin-top: 4px;
  color: var(--ri-text-muted, rgba(255, 255, 255, 0.74));
  font-weight: var(--ri-weight-light, 300);
}
/* Strength sessions logged for that part since the last visit (owner 2026-10-29). */
.ri-insight-coach-change-strength {
  display: block;
  margin-top: 6px;
  color: var(--ri-text-muted, rgba(255, 255, 255, 0.74));
  font-weight: var(--ri-weight-light, 300);
  line-height: 1.4;
}
/* Did the change pay off? Heart rate at the same speeds (green yes, amber higher, muted otherwise). */
.ri-insight-coach-change-payoff {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ri-text-muted, rgba(255, 255, 255, 0.74));
  font-size: var(--ri-text-caption, 13px);
  line-height: 1.4;
}
.ri-insight-coach-change-payoff.is-yes { color: #34d399; }
.ri-insight-coach-change-payoff.is-no { color: #f3b63f; }

.ri-insight-coach-change[hidden] { display: none; }
.ri-insight-coach-title {
  margin: 0 0 6px;
  color: var(--ri-text-strong, rgba(255, 255, 255, 0.96));
  font-size: var(--ri-text-lead, 16px);
  font-weight: var(--ri-weight-medium, 500);
  line-height: 1.3;
}
.ri-insight-coach-step { display: inline-flex; align-items: center; gap: 5px; }
.ri-insight-coach-step-name { margin-right: 4px; }
.ri-insight-coach-step i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }
.ri-insight-coach-step i.is-done { background: rgba(46, 209, 244, 0.5); }
.ri-insight-coach-step i.is-current { width: 16px; background: var(--ri-cyan, #2ED1F4); box-shadow: 0 0 8px rgba(46, 209, 244, 0.6); }
/* Where you are: three equal parts with a dot, words only. */
.ri-insight-coach-scale { margin: 2px 0 12px; }
.ri-insight-coach-scale[hidden] { display: none; }
.ri-insight-coach-scale-bar { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 6px; }
.ri-insight-coach-scale-bar span { border-radius: 999px; }
.ri-insight-coach-scale-bar .is-good { background: rgba(52, 211, 153, 0.55); }
.ri-insight-coach-scale-bar .is-normal { background: rgba(46, 209, 244, 0.5); }
.ri-insight-coach-scale-bar .is-focus { background: rgba(243, 182, 63, 0.55); }
.ri-insight-coach-scale-bar i {
  position: absolute;
  top: 50%;
  left: var(--at, 50%);
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgb(var(--coach-rgb));
  box-shadow: 0 0 10px rgba(var(--coach-rgb), 0.8);
  transform: translate(-50%, -50%);
}
.ri-insight-coach-scale-labels { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 6px; color: var(--ri-text-faint, rgba(255, 255, 255, 0.62)); font-size: var(--ri-text-micro, 11px); }
.ri-insight-coach-scale-labels span:nth-child(2) { text-align: center; }
.ri-insight-coach-scale-labels span:nth-child(3) { text-align: right; }
.ri-insight-coach-text {
  margin: 0 !important;
  color: var(--ri-text-strong, rgba(255, 255, 255, 0.92));
  font-size: var(--ri-text-secondary, 14px) !important;
  font-weight: var(--ri-weight-light, 300);
  line-height: 1.55;
  white-space: pre-line;
}
/* Under a tip that names exercises: the Strength page on that part (owner 2026-10-29). */
.ri-insight-coach-strength {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--ri-radius-sm, 8px);
  background: rgba(46, 209, 244, 0.06);
  box-shadow: inset 0 0 0 1px rgba(46, 209, 244, 0.22);
}
.ri-insight-coach-strength[hidden] { display: none; }
.ri-insight-coach-strength p { flex: 1 1 180px; margin: 0 !important; color: var(--ri-text-muted, rgba(255, 255, 255, 0.74)); font-size: var(--ri-text-caption, 13px) !important; line-height: 1.4; }
.ri-insight-coach-strength .ri-btn { flex: none; gap: 6px; }
.ri-insight-coach-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
/* Above .ri-btn's margin reset whatever order the page loads the sheets in. */
.ri-insight-coach-foot .ri-insight-coach-next { margin-left: auto; }
.ri-insight-coach-back[hidden] { display: none; }
.ri-insight-coach-back { color: var(--ri-text-faint, rgba(255, 255, 255, 0.62)); }
.ri-insight-coach-back:hover .dash-cta-arrow,
.ri-insight-coach-back:focus-visible .dash-cta-arrow { transform: translateX(-3px); }

/* Under the card: the page fades and softens towards the bottom edge (owner 2026-10-25: "a bit
   of blur or smoothing"). Taps go through to the page. */
.ri-insight-coach-scrim {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1199;
  height: 320px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(3, 0, 20, 0.88) 0%, rgba(3, 0, 20, 0.62) 45%, rgba(3, 0, 20, 0) 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, #000 50%, transparent 100%);
  opacity: 0;
  transition: opacity 220ms ease;
}
.ri-insight-coach-scrim[hidden] { display: none; }
.ri-insight-coach-scrim.is-open { opacity: 1; }


@media (max-width: 640px) {
  /* Phones: the title row has no room for words: the round mark keeps the running light and the
     count; the panel opens across the column under the title. */
  .ri-insights { position: static; }
  .ri-insights-btn { width: 36px; padding: 0; justify-content: center; gap: 0; position: relative; }
  .ri-insights-btn-text { display: none; }
  .ri-insights-btn-mark { width: 26px; height: 26px; }
  .ri-insights-btn-count { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; box-shadow: 0 0 0 2px #07081a, 0 0 10px rgba(243, 182, 63, 0.5); }
  .ri-insights-btn-count.is-better { box-shadow: 0 0 0 2px #07081a, 0 0 10px rgba(52, 211, 153, 0.5); }
  .ri-insights-panel { left: 0; right: 0; top: calc(100% + 8px); width: auto; }
  .ri-insight-coach { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding: 12px 14px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ri-insights-btn,
  .ri-insights-btn[data-change]::after,
  .ri-insights-btn-text,
  .ri-insights-panel,
  .ri-insight-ring.is-on::before,
  .ri-insight-ring.is-on.is-arriving::before { animation: none; }
  .ri-insights-btn-text { background-position: 0 0; }
  .ri-insight-coach { transition: opacity 120ms linear; }
  .ri-insight-coach-back:hover .dash-cta-arrow,
  .ri-insight-coach-back:focus-visible .dash-cta-arrow { transform: none; }
}
