.stage {
  display: grid;
  gap: 12px;
}

.section-grid,
.section-list,
.topic-grid,
.variant-list,
.saved-list {
  display: grid;
  gap: 12px;
}

.suggestion-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.crumbs > .suggestion-row,
.crumbs > .search-suggestions-shell {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.crumbs > .suggestion-row {
  padding: 0 0 1px;
}

.search-suggestions-shell {
  position: relative;
  display: flex;
  overflow: hidden;
}

.search-suggestions-shell .search-suggestions {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 1px;
  transition: -webkit-mask-image 180ms ease, mask-image 180ms ease;
}

.search-suggestions-shell.can-scroll-right .search-suggestions {
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 calc(100% - 86px),
    rgba(0, 0, 0, 0.62) calc(100% - 54px),
    rgba(0, 0, 0, 0.22) calc(100% - 28px),
    transparent calc(100% - 12px)
  );
  mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 calc(100% - 86px),
    rgba(0, 0, 0, 0.62) calc(100% - 54px),
    rgba(0, 0, 0, 0.22) calc(100% - 28px),
    transparent calc(100% - 12px)
  );
}

.search-suggestions-more {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 1px;
  z-index: 2;
  display: grid;
  width: 44px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.search-suggestions-more span {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--accent) 12%);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.32);
  padding: 0 0 2px;
  font-size: 1.14rem;
  font-weight: 650;
  line-height: 1;
}

.search-suggestions-shell.can-scroll-right .search-suggestions-more {
  opacity: 1;
  pointer-events: auto;
}

.search-suggestions-more:hover span,
.search-suggestions-more:focus-visible span {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 80%, var(--accent) 20%);
}

.suggestion-row::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  border-radius: 999px;
  padding: 0 13px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 820;
  cursor: pointer;
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-list {
  gap: 0;
  overflow: hidden;
  border: 0;
}

.section-list-item {
  display: grid;
  grid-template-columns: 46px minmax(0, auto) 24px;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 19%, transparent);
  border-radius: 0;
  padding: 10px 3px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform var(--ios-spring);
}

.section-list .section-list-item {
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.section-list-item:last-child {
  border-bottom: 0;
}

.section-list-item:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-bottom-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.section-list-item .section-pin-indicator {
  position: static;
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: 22px;
  height: 22px;
  transform: none;
}

.home-image-source-note {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0 6px;
  color: #9daabc;
  font-size: clamp(0.62rem, 2.55vw, 0.74rem);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
}

.settings-source-note {
  margin: 8px 4px 0;
  color: #9daabc;
  font-size: clamp(0.62rem, 2.55vw, 0.74rem);
  font-weight: 650;
  line-height: 1.38;
  text-align: center;
}

.list-glyph-badge {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(3, 5, 8, 0.82);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.list-glyph-badge img {
  width: 37px;
  height: 37px;
  object-fit: contain;
}

.list-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 820;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    var(--material);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.13), 0 16px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(30px) saturate(145%);
  transform: translateZ(0);
  transition: border-color 220ms ease, background 220ms ease, transform var(--ios-spring), box-shadow 220ms ease;
}

.glass-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.section-card,
.topic-card,
.variant-card {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.section-card:active,
.section-list-item:active,
.topic-card:active,
.variant-card:active {
  filter: brightness(0.94);
  transform: scale(0.982);
}

.section-card.photo-card:active {
  filter: brightness(0.96) saturate(1.02);
  transform: scale(0.976) translateY(1px);
}

.section-card *,
.section-card *::before,
.section-card *::after,
.section-list-item,
.section-list-item *,
.section-list-item *::before,
.section-list-item *::after,
.topic-card *,
.topic-card *::before,
.topic-card *::after,
.variant-card *,
.variant-card *::before,
.variant-card *::after {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.section-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 176px;
  border: 0;
  padding: 16px;
}

.section-card.photo-card {
  display: block;
  min-height: clamp(188px, 47vw, 206px);
  border: 1px solid rgba(255, 255, 255, 0.075);
  padding: 0;
  background: rgba(8, 10, 14, 0.86);
  isolation: isolate;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.11),
    inset 0 -1px rgba(0, 0, 0, 0.48),
    0 16px 38px rgba(0, 0, 0, 0.34);
}

.tile-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) brightness(0.92);
  transform: scale(1.01);
}

.section-card[data-id="breast"] .tile-photo {
  transform: scaleX(-1) scale(1.01);
}

.section-card[data-id="polytrauma"] .tile-photo {
  object-position: 50% 48%;
}

.section-card[data-id="pediatric"] .tile-photo,
.section-card[data-id="thoracic"] .tile-photo {
  object-position: 50% 44%;
}

.section-card[data-id="systemic-oncology"] .tile-photo {
  object-position: 50% 38%;
}

.section-card[data-id="urologic"] .tile-photo {
  object-position: 50% 47%;
}

.section-card[data-id="vascular"] .tile-photo {
  object-position: 50% 50%;
}

.photo-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 16%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.4));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    inset -1px -1px rgba(0, 0, 0, 0.42);
  content: "";
  pointer-events: none;
}

.photo-card .tile-title-glass::before {
  content: none;
}

.section-card.photo-card::before {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: block;
  width: auto;
  height: 46%;
  aspect-ratio: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(10, 12, 14, 0), rgba(12, 15, 18, 0.42) 34%, rgba(5, 6, 8, 0.9) 100%);
  content: "";
  pointer-events: none;
}

.section-card[data-id="breast"]::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.2) 66%, rgba(0, 0, 0, 0.72) 100%);
}

.tile-title-glass {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: white;
  font-size: clamp(1.12rem, 5.8vw, 1.76rem);
  font-weight: 800;
  line-height: 0.96;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
  backdrop-filter: none;
}

.tile-title-glass > span:last-child {
  position: absolute;
  right: 14px;
  bottom: 18px;
  left: 14px;
  display: block;
  overflow: visible;
  color: #f5f8fc;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.86);
}

.tile-glyph-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018) 48%, rgba(0, 0, 0, 0.12)),
    rgba(2, 4, 7, 0.76);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px rgba(0, 0, 0, 0.38),
    0 10px 22px rgba(0, 0, 0, 0.38);
  transform: none;
}

.tile-glyph-badge::before {
  content: none;
}

.tile-glyph-badge img {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.section-card[data-id="interventional-radiology"] .tile-glyph-badge img {
  width: 37px;
  height: 37px;
}

.section-card[data-id="breast"] .tile-title-glass > span:last-child {
  right: 18px;
  bottom: 18px;
  left: 18px;
  line-height: 0.9;
}


.section-card:not(.photo-card)::before,
.topic-card::before,
.variant-card::before {
  position: absolute;
  inset: -44% auto auto -34%;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09), transparent 62%);
  content: "";
  pointer-events: none;
}

.section-image {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  justify-self: end;
  overflow: hidden;
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 0 14px 28px rgba(0, 0, 0, 0.28);
}

.section-image img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.section-card h3 {
  position: relative;
  margin: 0;
  text-align: left;
  font-size: clamp(1.02rem, 5vw, 1.42rem);
  font-weight: 920;
  overflow-wrap: anywhere;
}

.topic-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  border: 0;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.115), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.032)),
    rgba(13, 18, 25, 0.78);
}

.section-pin-indicator {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 3;
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 50%;
  padding: 0;
  background: var(--accent);
  color: #050608;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 20%, transparent);
  pointer-events: none;
}

.section-pinned .section-pin-indicator {
  display: grid;
}

.section-pin-indicator svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
  stroke-width: 2;
  stroke-linejoin: round;
}

.recent-topic-section > h2 {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.recent-topic-group-list {
  display: grid;
  gap: 8px;
}

.recent-topic-section {
  --saved-title-size: 1rem;
  display: grid;
  gap: 8px;
}

.topic-card *,
.topic-card *::before,
.topic-card *::after {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.topic-card h2,
.variant-card h2 {
  position: relative;
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.recent-topic-card > span:first-child,
.saved-topic-card > span:first-child {
  transform: translateY(-2px);
}

.topic-card p,
.variant-card p,
.meta {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.count-pill,
.score {
  position: relative;
  display: inline-grid;
  min-width: 44px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #050608;
  font-weight: 900;
}

body.compact-mode .saved-content-section,
body.compact-mode .recent-topic-section {
  gap: 6px;
}

body.compact-mode .saved-content-section .saved-content-list,
body.compact-mode .recent-topic-section .recent-topic-group-list {
  gap: 7px;
}

body.compact-mode .saved-content-section .saved-criterion-card {
  height: 52px;
  min-height: 52px;
  border-radius: 16px;
  padding: 8px 12px;
}

body.compact-mode .saved-content-section .saved-topic-card,
body.compact-mode .recent-topic-section .recent-topic-card {
  min-height: 62px;
  gap: 10px;
  border-radius: 20px;
  padding: 9px 12px;
}

body.compact-mode .saved-content-section .count-pill,
body.compact-mode .recent-topic-section .count-pill {
  min-width: 38px;
  height: 30px;
}

body.ultra-compact-mode .saved-content-section,
body.ultra-compact-mode .recent-topic-section {
  gap: 5px;
}

body.ultra-compact-mode .saved-content-section .saved-content-list,
body.ultra-compact-mode .recent-topic-section .recent-topic-group-list {
  gap: 5px;
}

body.ultra-compact-mode .saved-content-section .saved-criterion-card {
  height: 46px;
  min-height: 46px;
  border-radius: 14px;
  padding: 7px 10px;
}

body.ultra-compact-mode .saved-content-section .saved-topic-card,
body.ultra-compact-mode .recent-topic-section .recent-topic-card {
  min-height: 54px;
  gap: 8px;
  border-radius: 17px;
  padding: 7px 10px;
}

body.ultra-compact-mode .saved-content-section .count-pill,
body.ultra-compact-mode .recent-topic-section .count-pill {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.portal-source-badge {
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.variant-card p.scenario-metadata {
  margin-top: 5px;
  color: color-mix(in srgb, var(--accent) 56%, var(--muted));
  font-size: 0.7rem;
  font-weight: 760;
}

.scenario-pill {
  display: inline-flex;
  height: 26px;
  min-height: 26px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(10, 13, 18, 0.68);
  color: #d9e2ed;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 8px 18px rgba(0, 0, 0, 0.2);
  font-size: 0.67rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.scenario-pill:active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: rgba(255, 255, 255, 0.12);
}

.portal-parent-variant .variant-head p {
  margin-top: 7px;
}

.additional-scenario-groups {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.additional-scenario-groups h2,
.additional-scenario-groups p {
  margin: 0;
}

.additional-scenario-groups h2 {
  font-size: 0.84rem;
}

.additional-scenario-groups p {
  color: var(--muted);
  font-size: 0.74rem;
}

.additional-scenario-list {
  display: grid;
}

.additional-scenario-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 2px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.count-pill.topic-save-confirming,
.count-pill.topic-unsave-confirming {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 82%, transparent);
  background: #050608;
  color: var(--accent);
}

.count-pill.topic-save-confirming {
  animation: topic-save-pill-confirm 980ms ease both;
}

.count-pill.topic-unsave-confirming {
  animation: topic-unsave-pill-confirm 980ms ease both;
}

.topic-save-glyph {
  width: 22px;
  height: 22px;
  color: var(--accent);
  transform-origin: center;
  animation: topic-save-glyph-pop 980ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.topic-save-outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  opacity: 1;
  animation: topic-save-outline-out 980ms ease both;
}

.topic-save-fill {
  fill: currentColor;
  opacity: 0;
  transform: scale(0.72);
  transform-origin: center;
  animation: topic-save-fill-in 980ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.topic-unsave-confirming .topic-save-glyph {
  animation: topic-unsave-glyph-pop 980ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.topic-unsave-confirming .topic-save-outline {
  animation: topic-unsave-outline-in 980ms ease both;
}

.topic-unsave-confirming .topic-save-fill {
  opacity: 1;
  transform: scale(1);
  animation: topic-unsave-fill-out 980ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

@keyframes topic-save-pill-confirm {
  0% {
    border-color: transparent;
    background: var(--accent);
    color: #050608;
    filter: brightness(1);
    transform: scale(1);
  }

  18%,
  76% {
    border-color: color-mix(in srgb, var(--accent) 82%, transparent);
    background: #050608;
    color: var(--accent);
    filter: brightness(1.08);
    transform: scale(1);
  }

  28% {
    filter: brightness(1.18);
    transform: scale(1.04);
  }

  100% {
    border-color: transparent;
    background: var(--accent);
    color: #050608;
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes topic-unsave-pill-confirm {
  0% {
    border-color: color-mix(in srgb, var(--accent) 82%, transparent);
    background: #050608;
    color: var(--accent);
    filter: brightness(1.08);
    transform: scale(1);
  }

  34% {
    filter: brightness(1.18);
    transform: scale(1.04);
  }

  72% {
    border-color: color-mix(in srgb, var(--accent) 82%, transparent);
    background: #050608;
    color: var(--accent);
  }

  100% {
    border-color: transparent;
    background: var(--accent);
    color: #050608;
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes topic-save-glyph-pop {
  0% {
    opacity: 0;
    transform: scale(0.42);
  }

  28% {
    opacity: 1;
    transform: scale(1.08);
  }

  68% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.18);
  }
}

@keyframes topic-unsave-glyph-pop {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  42% {
    opacity: 1;
    transform: scale(1.08);
  }

  68% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.18);
  }
}

@keyframes topic-save-outline-out {
  0%,
  30% {
    opacity: 1;
  }

  48%,
  100% {
    opacity: 0;
  }
}

@keyframes topic-unsave-outline-in {
  0%,
  30% {
    opacity: 0;
  }

  48%,
  68% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes topic-save-fill-in {
  0%,
  32% {
    opacity: 0;
    transform: scale(0.68);
  }

  50%,
  74% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.18);
  }
}

@keyframes topic-unsave-fill-out {
  0%,
  34% {
    opacity: 1;
    transform: scale(1);
  }

  64% {
    opacity: 0;
    transform: scale(0.68);
  }

  100% {
    opacity: 0;
    transform: scale(0.18);
  }
}

.variant-card {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 14px;
}

.variant-page {
  display: grid;
  gap: 11px;
}

.variant-jump-drawer {
  position: relative;
  z-index: 7;
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 18px;
  padding: 8px;
  background: rgba(7, 10, 13, 0.78);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px) saturate(145%);
}

.variant-jump-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.variant-jump-drawer-header strong {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #050608;
  font-size: 0.72rem;
}

.variant-jump-list {
  display: grid;
  grid-auto-rows: max-content;
  gap: 6px;
  max-height: min(42vh, 338px);
  overflow: auto;
  padding-right: 1px;
  overscroll-behavior: contain;
}

.variant-jump-list button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  height: auto;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  padding: 8px 8px 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  text-align: left;
  overflow: visible;
}

.variant-jump-list button strong {
  display: grid;
  width: 26px;
  height: 26px;
  margin-top: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 62%, transparent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
}

.variant-jump-list button span {
  display: block;
  min-width: 0;
  padding-top: 1px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 820;
  line-height: 1.22;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
}

/* Keep filtering independent of the cards' grid/flex display rules. */
.saved-list [hidden], .saved-filter[hidden], .saved-filter-empty[hidden] { display: none !important; }
.saved-filter { display: grid; gap: 8px; min-width: 0; }
.saved-filter > label { color: var(--accent); font-size: .85rem; font-weight: 650; }
.saved-filter-row { display: flex; gap: 8px; }
.saved-filter input {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 12px; background: var(--bg-soft); color: var(--text); font: inherit;
}
.saved-filter input::placeholder { color: var(--muted); }
.saved-filter-clear {
  min-height: 44px; padding: 8px 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--bg-soft); color: var(--accent); font: inherit; cursor: pointer;
}
.saved-filter-clear:disabled { opacity: .45; cursor: default; }
.saved-filter input:focus-visible, .saved-filter-clear:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.saved-filter > p { margin: 0; color: var(--muted); font-size: .8rem; }

.saved-filter-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.saved-filter-toggle[aria-expanded="true"] svg { fill: currentColor; }

.saved-entry-controls button, .saved-undo button {
  min-height: 44px; min-width: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--bg-soft); color: var(--accent); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.saved-entry { display: grid; gap: 6px; min-width: 0; }
.saved-entry > .glass-card { width: 100%; min-width: 0; }
.saved-entry-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.saved-entry-controls [data-saved-control="up"],
.saved-entry-controls [data-saved-control="remove"] { margin-left: auto; }
.saved-entry-controls button:disabled { opacity: .4; cursor: default; }
.saved-entry-controls button:focus-visible, .saved-edit-toggle:focus-visible, .saved-undo button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.saved-pinned-section > h2 { color: var(--accent); }
.saved-pinned-section > .saved-content-list > .saved-entry > .glass-card {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.saved-undo {
  position: fixed; z-index: 100; bottom: calc(79px + env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right)); width: max-content;
}
body.bottom-nav-collapsed .saved-undo { bottom: 16px; }
.saved-undo button { box-shadow: 0 4px 18px #0006; }

.saved-list .saved-pinned-section .saved-content-list {
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.oled-mode .saved-list .saved-pinned-section .saved-content-list { background: transparent; }

.saved-edit-toggle[hidden] { display: none !important; }
.saved-edit-toggle svg { width: 18px; height: 18px; }
.saved-entry-controls button { min-height: 34px; min-width: 34px; width: 34px; height: 34px; padding: 6px; border-radius: 10px; display: grid; place-items: center; }
.saved-edit-toggle[aria-pressed="true"] svg { fill: currentColor; }
.saved-entry-controls svg { width: 18px; height: 18px; vertical-align: middle; }
.saved-entry-controls [data-saved-control="pin"] svg { fill: currentColor; }
.saved-entry-controls .pin-slash { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; paint-order: stroke; }
.saved-entry-controls .saved-unpin, .saved-entry-controls [data-saved-control="remove"] {
  color: #ff747c; border-color: #ff747c80;
}
.saved-entry > .glass-card { -webkit-touch-callout: none; user-select: none; }
.saved-entry .saved-pin-indicator { position: static; display: grid; flex: 0 0 24px; }
.saved-entry .saved-topic-card .saved-pin-indicator { margin-left: 8px; }
.crumbs:has(.saved-edit-toggle:not([hidden])) { column-gap: 6px; }

.saved-entry-controls .pin-slash-cut { fill: none; stroke: var(--bg-soft); stroke-width: 5; stroke-linecap: round; }
.saved-topic-trailing { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; align-self: center; gap: 4px; }
.saved-entry .saved-topic-card .saved-pin-indicator { margin-left: 0; }

.saved-content-section > h2:has(.saved-variant-controls) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-variant-controls { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }

@media (max-width: 380px) {
  .crumbs:has(.saved-variant-controls) .saved-view-toggle svg,
  .crumbs:has(.saved-variant-controls) .saved-view-toggle img { display: none; }
}

/* Overlay edit tools without replacing or restyling the original card. */
.saved-edit-card { position: relative; --saved-control-size: 32px; }
.saved-edit-card:has(> .saved-criterion-card) { --saved-control-size: 26px; }
body.compact-mode .saved-edit-card { --saved-control-size: 28px; }
body.compact-mode .saved-edit-card:has(> .saved-criterion-card) { --saved-control-size: 24px; }
body.ultra-compact-mode .saved-edit-card { --saved-control-size: 24px; }
body.ultra-compact-mode .saved-edit-card:has(> .saved-criterion-card) { --saved-control-size: 21px; }
.saved-card-editing { --saved-control-size: 32px; }
body.compact-mode .saved-card-editing { --saved-control-size: 28px; }
body.ultra-compact-mode .saved-card-editing { --saved-control-size: 24px; }
.saved-entry .saved-entry-controls {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, var(--saved-control-size));
  gap: 2px;
  border: 0;
  animation: saved-edit-in 180ms ease-out;
}
.saved-entry .saved-entry-controls button {
  position: relative;
  width: var(--saved-control-size);
  height: var(--saved-control-size);
  min-width: var(--saved-control-size);
  min-height: var(--saved-control-size);
  margin: 0;
  padding: 3px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 37.5%;
  isolation: isolate;
}
.saved-entry-controls button::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 35.714%;
  background: currentColor;
  opacity: .055;
  z-index: -1;
  transition: opacity 160ms ease;
}
.saved-entry-controls button:not(:disabled):hover::before,
.saved-entry-controls button:not(:disabled):active::before { opacity: .15; }
.saved-entry-controls [data-saved-control="pin"] { grid-column: 1; justify-self: start; }
.saved-entry-controls [data-saved-control="up"] { grid-column: 2; }
.saved-entry-controls [data-saved-control="down"] { grid-column: 3; }
.saved-entry-controls [data-saved-control="remove"] { grid-column: 4; justify-self: end; }
.saved-entry-controls button { grid-row: 1; }

.saved-entry.saved-edit-card > .saved-entry-controls {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  grid-template-columns: repeat(2, var(--saved-control-size));
}
.saved-edit-card .saved-entry-controls [data-saved-control="remove"] { grid-column: 2; grid-row: 1; }
.saved-edit-card .saved-entry-controls [data-saved-control="up"] { grid-column: 1; grid-row: 2; }
.saved-edit-card .saved-entry-controls [data-saved-control="down"] { grid-column: 2; grid-row: 2; }

.saved-card-editing .variant-card-toolbar > .saved-entry-controls {
  margin-left: auto;
  flex-shrink: 0;
  height: 26px;
  align-items: center;
}
body.compact-mode .saved-card-editing .variant-card-toolbar > .saved-entry-controls { height: 24px; }
/* Anchor the short fade to the controls, independently of each text column's width. */
.saved-edit-card { container-type: inline-size; --edit-copy-inset: 16px; }
.saved-edit-card:has(> .saved-criterion-card) { --edit-copy-inset: 14px; }
body.compact-mode .saved-edit-card { --edit-copy-inset: 12px; }
body.ultra-compact-mode .saved-edit-card { --edit-copy-inset: 10px; }
.saved-edit-card > .glass-card > :is(.saved-criterion-copy, span:first-child):not(.saved-topic-trailing) {
  --edit-fade-end: calc(100cqw - 10px - var(--saved-control-size) * 2 - 2px - var(--edit-copy-inset) - 2px);
  -webkit-mask-image: linear-gradient(to right, #000 calc(var(--edit-fade-end) - 8px), transparent var(--edit-fade-end));
  mask-image: linear-gradient(to right, #000 calc(var(--edit-fade-end) - 8px), transparent var(--edit-fade-end));
}

@keyframes saved-edit-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .saved-entry .saved-entry-controls { animation: none; }
  .saved-entry-controls button::before { transition: none; }
}

.saved-topic-count {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 50%;
  background: var(--accent);
  color: #050608;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: proportional-nums;
}

/* Keep Saved card edges and trailing pin positions aligned across card types. */
.saved-list { --saved-card-trailing-inset: 16px; min-width: 0; }
body.compact-mode .saved-list { --saved-card-trailing-inset: 12px; }
body.ultra-compact-mode .saved-list { --saved-card-trailing-inset: 10px; }
.saved-list .saved-content-section,
.saved-list .saved-content-list { min-width: 0; }
.saved-list .saved-content-section .saved-entry > .glass-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline-end: var(--saved-card-trailing-inset);
}

/* One welcome surface keeps the empty state and exploration choices together. */
.saved-empty-welcome {
  container-type: inline-size;
  width: 100%;
  max-width: 620px;
  justify-self: center;
  margin: 0;
  padding: 24px 18px 20px;
  border-radius: 26px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--material);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045), 0 12px 32px rgba(0, 0, 0, 0.16);
}
.saved-empty-message {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.65rem, 3.9cqi, 0.88rem);
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}
.saved-empty-welcome h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.saved-explore-dancer {
  display: block;
  position: relative;
  width: 160px;
  height: 116px;
  margin: 10px auto 12px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.saved-explore-dancer:hover,
.saved-explore-dancer:active { background: transparent; transform: none; box-shadow: none; }
.saved-explore-dancer:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.saved-explore-dancer[aria-disabled="true"] { cursor: wait; }
.saved-explore-dancer::before {
  content: "";
  position: absolute;
  inset: auto 28px -3px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.saved-explore-sprite {
  position: absolute;
  width: 90px;
  height: 108px;
  left: 35px;
  bottom: 0;
  background: url("../assets/saved-skeleton-atlas.png?v=1") no-repeat 0 0 / 800% 600%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
  image-rendering: pixelated;
  animation: saved-explore-dance 4.8s steps(1, end) infinite;
}
.saved-explore-dancer[data-scan] .saved-explore-sprite {
  animation: none;
  background: url("../assets/saved-skeleton-anatomical.png?v=1") no-repeat center / contain;
}
.saved-xray-frame {
  position: absolute;
  left: 27px;
  top: 6px;
  width: 106px;
  height: 108px;
  opacity: 0;
  pointer-events: none;
}
.saved-explore-dancer[data-scan="scanning"] .saved-xray-frame { opacity: 1; }
.saved-xray-line {
  display: block;
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: #d4f8ff;
  box-shadow: 0 0 5px #89e6ff, 0 0 15px #67d6ff;
}
.saved-xray-line::before {
  content: "";
  position: absolute;
  inset: -8px 0;
  background: linear-gradient(transparent, rgba(104, 221, 255, 0.16), transparent);
}
.saved-xray-film {
  position: fixed;
  width: 108px;
  height: 128px;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
  border: 1px solid #87ddf3;
  border-radius: 5px;
  background: linear-gradient(145deg, #183747, #06151e);
  box-shadow: inset 0 0 18px rgba(102, 219, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 20%;
}
.saved-xray-image {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 90px;
  height: 108px;
  background: url("../assets/saved-skeleton-anatomical.png?v=1") no-repeat center / contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 3px #98ecff);
}
.saved-xray-label {
  position: absolute;
  bottom: 4px;
  inset-inline: 0;
  color: #bdefff;
  text-align: center;
  font: 600 7px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
}
.saved-explore-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}
.saved-explore-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 94px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 17px;
  padding: 12px 6px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    color-mix(in srgb, var(--bg-soft) 95%, var(--accent));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.saved-explore-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent);
}
.saved-explore-links svg { width: 25px; height: 25px; }
.saved-explore-links a:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, var(--bg-soft));
}
.saved-explore-links a:active { transform: scale(0.97); }
.saved-explore-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
body.oled-mode .saved-explore-links a {
  background: #000;
  border-color: var(--line);
  box-shadow: none;
}
body.oled-mode .saved-explore-links a:hover,
body.oled-mode .saved-explore-links a:active {
  background: #000;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
}
@media (min-width: 601px) {
  .saved-empty-welcome { padding: 28px 26px 24px; }
  .saved-explore-links { gap: 14px; }
  .saved-explore-links a { min-height: 100px; font-size: 0.86rem; }
}
@media (max-width: 359px) {
  .saved-empty-welcome { padding-inline: 12px; }
  .saved-explore-links { gap: 8px; }
  .saved-explore-links a { font-size: 0.78rem; }
}
@keyframes saved-explore-dance {
  0.0000% { background-position: 0.0000% 0%; }
  2.0833% { background-position: 14.2857% 0%; }
  4.1667% { background-position: 28.5714% 0%; }
  6.2500% { background-position: 42.8571% 0%; }
  8.3333% { background-position: 57.1429% 0%; }
  10.4167% { background-position: 71.4286% 0%; }
  12.5000% { background-position: 85.7143% 0%; }
  14.5833% { background-position: 100.0000% 0%; }
  16.6667% { background-position: 0.0000% 20%; }
  18.7500% { background-position: 14.2857% 20%; }
  20.8333% { background-position: 28.5714% 20%; }
  22.9167% { background-position: 42.8571% 20%; }
  25.0000% { background-position: 57.1429% 20%; }
  27.0833% { background-position: 71.4286% 20%; }
  29.1667% { background-position: 85.7143% 20%; }
  31.2500% { background-position: 100.0000% 20%; }
  33.3333% { background-position: 0.0000% 40%; }
  35.4167% { background-position: 14.2857% 40%; }
  37.5000% { background-position: 28.5714% 40%; }
  39.5833% { background-position: 42.8571% 40%; }
  41.6667% { background-position: 57.1429% 40%; }
  43.7500% { background-position: 71.4286% 40%; }
  45.8333% { background-position: 85.7143% 40%; }
  47.9167% { background-position: 100.0000% 40%; }
  50.0000% { background-position: 0.0000% 60%; }
  52.0833% { background-position: 14.2857% 60%; }
  54.1667% { background-position: 28.5714% 60%; }
  56.2500% { background-position: 42.8571% 60%; }
  58.3333% { background-position: 57.1429% 60%; }
  60.4167% { background-position: 71.4286% 60%; }
  62.5000% { background-position: 85.7143% 60%; }
  64.5833% { background-position: 100.0000% 60%; }
  66.6667% { background-position: 0.0000% 80%; }
  68.7500% { background-position: 14.2857% 80%; }
  70.8333% { background-position: 28.5714% 80%; }
  72.9167% { background-position: 42.8571% 80%; }
  75.0000% { background-position: 57.1429% 80%; }
  77.0833% { background-position: 71.4286% 80%; }
  79.1667% { background-position: 85.7143% 80%; }
  81.2500% { background-position: 100.0000% 80%; }
  83.3333% { background-position: 0.0000% 100%; }
  85.4167% { background-position: 14.2857% 100%; }
  87.5000% { background-position: 28.5714% 100%; }
  89.5833% { background-position: 42.8571% 100%; }
  91.6667% { background-position: 57.1429% 100%; }
  93.7500% { background-position: 71.4286% 100%; }
  95.8333% { background-position: 85.7143% 100%; }
  97.9167% { background-position: 100.0000% 100%; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .saved-explore-sprite { animation: none; background-position: 0 20%; }
  .saved-explore-links a { transition: none; }
  .saved-explore-links a:active { transform: none; }
}
