/* Shared close control, keeping each card's existing positioning and behavior. */
html body:is(.prototype-landing, .group-quiz-page, .journey-game-page) :is(
 #brandPopoverClose, #heroExplainerClose, #contactClose, #supportClose, #closeQuickRules,
 #closeGroupRules, #soloQuizClose, #result.show #soloResultClose, #learningTimeClose,
 [data-info-close], [data-scam-close], .desktop-hero-tools-close, .desktop-reference-close,
 #supporterDialog form[method="dialog"] > button, .mobile-ranking-dialog-head > button,
 .journey-game-page :is(#closeModal, #closeHint, #skipTutorial, #closeToast, #closeAchievement, .discovery-skip)
) {
 display: inline-grid;
 place-items: center;
 box-sizing: border-box;
 width: var(--card-close-size, 44px)!important;
 min-width: var(--card-close-size, 44px)!important;
 height: var(--card-close-size, 44px)!important;
 min-height: var(--card-close-size, 44px)!important;
 flex: 0 0 var(--card-close-size, 44px);
 padding: 0!important;
 border: 0!important;
 border-radius: 10px!important;
 /* Draw the mark at the center, independent of the platform font's baseline. */
 background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8m0-8-8 8' fill='none' stroke='%23164b34' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 20px 20px!important;
 box-shadow: none!important;
 color: #164b34!important;
 font: 600 0/1 system-ui,sans-serif!important;
 cursor: pointer;

 &:focus-visible {
  outline: 2px solid #17603e;
  outline-offset: 2px;
 }

 @media (hover: hover) and (pointer: fine) {
  &:hover { background-color: rgb(24 84 60 / .09)!important; }
 }
}
@media (width > 1000px) {
 body.desktop-landing-refined :is(#brandPopover, #heroExplainerPanel) {
  --card-close-size: calc(44px / var(--desktop-landing-scale, 1));
 }
}

/* Give the explainer title and close button the same grid row. Its height
   follows the taller item so the introduction always starts below both. */
body.prototype-landing .hero #heroExplainerPanel > #heroExplainerClose {
 position: static;
 z-index: 1;
 grid-area: 1 / 1 / 2 / -1;
 justify-self: end;
 align-self: start;
}
body.prototype-landing .hero #heroExplainerPanel .hero-explainer-title {
 grid-area: 1 / 1 / 2 / -1;
 align-self: center;
 padding-inline-end: calc(var(--card-close-size, 44px) + 8px);
}

/* The brand popover uses inline body copy below its block title. */
body.prototype-landing > header #brandPopover > b {
 min-height: var(--card-close-size, 44px);
 padding-inline-end: var(--card-close-size, 44px);
 overflow-wrap: anywhere;
}
