/* ==========================================================================
   Score explainer sheet (js/score-explain.js). Uses the .ig tokens.
   Centered glass sheet on desktop, bottom sheet on phones.
   ========================================================================== */
.se-scrim { position: fixed; inset: 0; z-index: 9700; padding: 0; background: rgba(15,23,42,.32); -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2); opacity: 0; transition: opacity .28s var(--ig-ease); }
.se-scrim.is-in { opacity: 1; }
html.theme-night .se-scrim { background: rgba(2,6,23,.6); }

.se-sheet {
  position: fixed; z-index: 9701; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 48px));
  display: flex; flex-direction: column; padding: 0;
  border-radius: 22px; background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 1px rgba(15,23,42,.08), 0 30px 80px -24px rgba(15,23,42,.45), 0 8px 24px -12px rgba(15,23,42,.2);
  opacity: 0; transform: translate(-50%, -48%) scale(.97);
  transition: opacity .26s var(--ig-ease), transform .42s var(--ig-ease);
}
.se-sheet.is-in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
html.theme-night .se-sheet { background: rgba(17,24,39,.92); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(255,255,255,.08), 0 30px 80px -24px rgba(0,0,0,.8); }

.se-grab { display: none; }
.se-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 12px 22px; }
.se-top h4 { margin: 0; font-size: 17px; font-weight: 760; letter-spacing: -.02em; color: var(--ig-txt); }
.se-top p { margin: 3px 0 0; font-size: 13px; color: var(--ig-txt-3); line-height: 1.4; }
.se-x { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ig-txt-2); background: var(--ig-tile); box-shadow: inset 0 1px 0 var(--ig-hi), inset 0 0 0 1px var(--ig-line); cursor: pointer; transition: transform .14s var(--ig-ease), color .2s; }
.se-x svg { width: 15px; height: 15px; }
.se-x:hover { color: var(--ig-txt); }
.se-x:active { transform: scale(.92); }
.se-x:focus-visible, .se-link:focus-visible { outline: 2px solid var(--ig-pink); outline-offset: 2px; }

.se-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px 8px; }

.se-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; background: var(--ig-tile); box-shadow: inset 0 1px 0 var(--ig-hi), inset 0 0 0 1px var(--ig-line); }
.se-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.se-who > div { min-width: 0; }
.se-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--ig-line); }
.se-av--ph { display: grid; place-items: center; font-size: 16px; font-weight: 720; color: #fff; background: linear-gradient(135deg, #F58529, #DD2A7B 55%, #8134AF); }
.se-name { font-size: 15px; font-weight: 700; letter-spacing: -.015em; color: var(--ig-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-handle { font-size: 12.5px; color: var(--ig-txt-3); margin-top: 1px; }
.se-big { text-align: right; flex: none; }
.se-big b { display: block; font-size: 32px; font-weight: 780; letter-spacing: -.04em; line-height: 1; color: var(--ig-txt); font-variant-numeric: tabular-nums; }
.se-big b small { font-size: 13px; font-weight: 640; color: var(--ig-txt-3); letter-spacing: 0; margin-left: 2px; }
.se-big .ig-band { margin-top: 6px; }

/* Band meter: a 0 to 100 track with the Medium and High thresholds marked */
.se-meter { margin: 2px 0 18px; }
.se-meter__track { position: relative; display: flex; height: 8px; border-radius: 999px; overflow: visible; }
.se-meter__seg { display: block; height: 100%; }
.se-meter__seg--low { width: 40%; border-radius: 999px 0 0 999px; background: rgba(148,163,184,.32); }
.se-meter__seg--medium { width: 30%; margin-left: 2px; background: rgba(245,158,11,.5); }
.se-meter__seg--high { flex: 1; margin-left: 2px; border-radius: 0 999px 999px 0; background: rgba(16,185,129,.55); }
.se-meter__pin { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.12), 0 4px 10px -2px rgba(15,23,42,.35); animation: sePin .6s var(--ig-ease) both; }
.se-meter__pin::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: currentColor; }
.se-meter__pin--high { color: #10B981; }
.se-meter__pin--medium { color: #F59E0B; }
.se-meter__pin--low { color: #94A3B8; }
@keyframes sePin { from { opacity: 0; transform: translate(-50%, -50%) scale(.4); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.se-meter__ax { position: relative; height: 16px; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--ig-txt-3); font-variant-numeric: tabular-nums; }
.se-meter__ax span { position: absolute; transform: translateX(-50%); }
.se-meter__ax span:first-child { transform: none; }
.se-meter__ax span:last-child { transform: translateX(-100%); }
.se-meter__keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--ig-txt-2); }
.se-meter__keys span { display: inline-flex; align-items: center; gap: 6px; }
.se-meter__keys i { width: 8px; height: 8px; border-radius: 50%; }
.se-meter__keys .is-low i { background: #94A3B8; }
.se-meter__keys .is-medium i { background: #F59E0B; }
.se-meter__keys .is-high i { background: #10B981; }
html.theme-night .se-meter__pin { background: #0F172A; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 4px 10px -2px rgba(0,0,0,.6); }

.se-sec { margin-bottom: 16px; }
.se-sec h5 { margin: 0 0 8px; font-size: 11.5px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; color: var(--ig-txt-3); }
.se-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--ig-card); box-shadow: inset 0 0 0 1px var(--ig-line); overflow: hidden; }
.se-row { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.4; color: var(--ig-txt); }
.se-row + .se-row { box-shadow: inset 0 1px 0 var(--ig-line); }
.se-row__ic { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--ig-teal); background: var(--ig-teal-soft); }
.se-row__ic svg { width: 12px; height: 12px; }
.se-row.is-neg .se-row__ic { color: var(--ig-amber); background: var(--ig-amber-soft); }
.se-row.is-info .se-row__ic { color: var(--ig-txt-3); background: var(--ig-tile); }
.se-row__txt { font-weight: 560; min-width: 0; }
.se-pts { min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 740; font-variant-numeric: tabular-nums; color: var(--ig-teal); background: var(--ig-teal-soft); }
.se-row.is-neg .se-pts { color: var(--ig-amber); background: var(--ig-amber-soft); }
.se-row.is-open { color: var(--ig-txt-2); }
.se-row.is-open .se-row__ic { color: var(--ig-txt-3); background: var(--ig-tile); box-shadow: inset 0 0 0 1px var(--ig-line); }
.se-row.is-open .se-row__txt { font-weight: 500; }
.se-row.is-open .se-pts { color: var(--ig-txt-3); background: transparent; box-shadow: inset 0 0 0 1px var(--ig-line); }

.se-total { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 12px 0; font-size: 13px; font-weight: 640; color: var(--ig-txt-2); }
.se-total b { font-size: 18px; font-weight: 780; letter-spacing: -.02em; color: var(--ig-txt); font-variant-numeric: tabular-nums; }
.se-note { margin: 8px 12px 0; font-size: 12.5px; color: var(--ig-txt-3); line-height: 1.45; }

.se-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px 18px; font-size: 12px; line-height: 1.45; color: var(--ig-txt-3); box-shadow: inset 0 1px 0 var(--ig-line); }
.se-link { flex: none; border: 0; padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 660; color: var(--ig-pink); background: var(--ig-pink-soft); cursor: pointer; transition: transform .14s var(--ig-ease), box-shadow .2s; }
.se-link:hover { box-shadow: inset 0 0 0 1px var(--ig-pink); }
.se-link:active { transform: scale(.96); }

/* Triggers inside Discover */
.ig-card__score.is-btn { border: 0; margin: -4px -6px 0 0; padding: 5px 6px 4px; border-radius: 12px; font: inherit; color: inherit; background: transparent; cursor: pointer; transition: background .2s, box-shadow .2s, transform .14s var(--ig-ease); -webkit-tap-highlight-color: transparent; }
.ig-card__score.is-btn:hover { background: var(--ig-tile); box-shadow: inset 0 1px 0 var(--ig-hi), inset 0 0 0 1px var(--ig-line); }
.ig-card__score.is-btn:active { transform: scale(.96); }
.ig-card__score.is-btn:focus-visible { outline: 2px solid var(--ig-pink); outline-offset: 1px; }
.ig-drawer__score.is-btn { border: 0; font: inherit; color: inherit; background: transparent; cursor: pointer; border-radius: 14px; padding-top: 4px; padding-bottom: 4px; transition: background .2s, transform .14s var(--ig-ease); }
.ig-drawer__score.is-btn:hover { background: var(--ig-tile); }
.ig-drawer__score.is-btn:active { transform: scale(.97); }
.ig-kpi--how { cursor: pointer; color: var(--ig-txt-2); transition: transform .14s var(--ig-ease), color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.ig-kpi--how svg { width: 14px; height: 14px; color: var(--ig-pink); }
.ig-kpi--how:hover { color: var(--ig-txt); box-shadow: inset 0 1px 0 var(--ig-hi), inset 0 0 0 1px var(--ig-line-strong); }
.ig-kpi--how:active { transform: scale(.96); }
.ig-why__more { border: 0; padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 660; color: var(--ig-pink); background: var(--ig-pink-soft); cursor: pointer; transition: transform .14s var(--ig-ease); }
.ig-why__more:active { transform: scale(.96); }

@media (max-width: 640px) {
  .se-sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .se-sheet.is-in { transform: translateY(0); }
  .se-grab { display: block; width: 38px; height: 5px; margin: 8px auto 0; border-radius: 999px; background: var(--ig-line-strong); }
  .se-top { padding: 12px 16px 10px; }
  .se-body { padding: 4px 16px 8px; }
  .se-foot { flex-direction: column; align-items: stretch; padding: 12px 16px 16px; }
  .se-link { align-self: flex-start; }
  .se-big b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .se-sheet, .se-scrim, .se-meter__pin { transition: none; animation: none; }
}
