/* Shared help, disclosure controls and inline guidance. */
.alert:not([data-flash-message]) { display:block; box-shadow:none; line-height:1.65; }
.alert:not([data-flash-message]) > strong { display:block; margin-bottom:5px; }
.alert:not([data-flash-message]) > p { margin:0; }
.builder-step-toggle, [data-course-nav-collapse] { display:grid; flex:0 0 40px; width:40px; min-height:40px; place-items:center; padding:0; border:0; border-radius:8px; background:transparent; color:var(--green); box-shadow:none; font-size:1.3rem; font-weight:400; line-height:1; }
.builder-step-toggle:hover, [data-course-nav-collapse]:hover { background:#e8f1e5; }
.builder-step-toggle [data-builder-step-toggle-label] { position:static; width:auto; height:auto; clip:auto; overflow:visible; font-size:1.3rem; line-height:1; }
.builder-step-toggle-icon { display:none; }
.import-section-collapse i { display:none; }
.import-section-collapse::after { content:'−'; font-size:1.3rem; font-style:normal; }
.import-section-collapse[aria-expanded="false"]::after { content:'+'; }
.import-section-collapse { background:transparent; border:0; box-shadow:none; }

/* Adoption is a secondary card action, with the destination revealed on demand. */
.exercise-adopt, .content-workspace .exercise-adopt { margin-top:20px; padding:0; border:1px solid #d6e2d1; border-radius:10px; background:#f8faf5; overflow:hidden; }
.exercise-adopt > summary { display:flex; align-items:center; gap:12px; padding:14px 16px; list-style:none; color:#315d41; font-size:.8rem; font-weight:550; cursor:pointer; }
.exercise-adopt > summary::-webkit-details-marker { display:none; }
.exercise-adopt > summary::before { content:'↗'; display:grid; flex:0 0 30px; height:30px; place-items:center; background:#e5efdf; border-radius:7px; font-size:1.05rem; }
.exercise-adopt > summary::after { content:'+'; margin-left:auto; font-size:1.15rem; font-weight:400; }
.exercise-adopt[open] > summary::after { content:'−'; }
.exercise-adopt[open] > summary { border-bottom:1px solid #dce6d6; }
.exercise-adopt > summary:hover { background:#edf5e7; }
.exercise-adopt > summary:focus-visible { outline:2px solid var(--green); outline-offset:-3px; }
.exercise-adopt form { display:grid; gap:11px; padding:17px; margin:0; background:#fff; }
.exercise-adopt form label { font-size:.76rem; font-weight:550; }
.exercise-adopt form small { font-size:.72rem; line-height:1.6; color:#677c69; }
.exercise-adopt form select { min-width:0; width:100%; }
.exercise-adopt form .button { width:100%; margin-top:4px; }

/* Tours: a quiet spotlight, readable guidance and consistent navigation. */
.onboarding-mask { background:rgba(12,34,25,.5); }
.onboarding-spotlight { border:2px solid #cde6ba; border-radius:12px; box-shadow:0 0 0 4px rgba(229,245,220,.35),0 0 0 9999px rgba(12,34,25,.5); transition:none; }
.onboarding-popover { width:min(420px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; padding:24px; border:1px solid #ccdcc5; border-radius:14px; background:#fcfdf9; color:#163e2b; box-shadow:0 16px 55px #102d253b; }
.onboarding-popover-top { margin-bottom:15px; font-size:.75rem; font-weight:500; color:#64775d; }
.onboarding-popover-top button, .context-tour-offer-close { border:1px solid #d8e3d2; border-radius:8px; background:#f0f5ea; color:#34583b; }
.onboarding-popover .eyebrow { font-size:.65rem; letter-spacing:.09em; color:#55744c; }
.onboarding-popover h2 { margin:10px 0 13px; font-size:1.65rem; line-height:1.17; letter-spacing:-.02em; }
.onboarding-popover p { font-size:.92rem; line-height:1.7; color:#5b6f59; }
.onboarding-popover-actions { padding-top:20px; margin-top:22px; border-top:1px solid #dce6d5; gap:12px; }
.onboarding-popover-actions .button { min-height:42px; padding:10px 19px; border-radius:8px; font-size:.84rem; font-weight:550; box-shadow:none; }
.tour-progress-track { height:4px; margin:0 0 22px; border-radius:9px; background:#e4eddd; overflow:hidden; }
.tour-progress-track > span { display:block; height:100%; width:var(--tour-progress,0%); border-radius:inherit; background:#2f7750; transition:width .18s ease; }
.onboarding-popover button:focus-visible, .context-tour-help:focus-visible, .context-tour-offer button:focus-visible { outline:3px solid #78a85b; outline-offset:3px; }
.context-tour-help { min-height:40px; padding:8px 13px; gap:8px; border:1px solid #c9d9c1; border-radius:9px; background:#fbfdf8; color:#365a3e; font-size:.78rem; font-weight:550; box-shadow:0 4px 16px #19372c12; }
.context-tour-help span { width:22px; height:22px; border-radius:6px; background:#e2eed9; color:#335c3b; }
.context-tour-offer { padding:24px; border-color:#c9d9c1; border-radius:13px; background:#fbfdf7; box-shadow:0 12px 36px #19372c26; }
.context-tour-offer > strong { font-size:1.45rem; margin:12px 20px 12px 0; }
.context-tour-offer > p { font-size:.88rem; line-height:1.65; }
.context-tour-offer-actions { padding-top:17px; border-top:1px solid #dee8d6; }
.context-tour-offer-actions .button { border-radius:8px; box-shadow:none; }
.onboarding-choice-card { border:1px solid #d5e1ce; border-radius:14px; background:#fbfdf8; box-shadow:0 10px 35px #23472e10; }
.onboarding-role-grid button { padding:22px; border-radius:10px; border-color:#cddcc5; background:#fff; }
.onboarding-role-grid button strong { font-size:1rem; font-weight:600; }
.onboarding-role-grid button small { margin-top:6px; font-size:.83rem; line-height:1.6; }
.onboarding-role-icon, .onboarding-role-icon.is-teacher { border-radius:9px; background:#e7f1de; color:#376246; }
@media(max-width:600px) {
  .onboarding-popover { padding:20px; max-height:calc(100dvh - 24px); }
  .onboarding-popover h2 { font-size:1.4rem; }
  .onboarding-popover p { font-size:.86rem; }
  .onboarding-role-grid { grid-template-columns:1fr; }
  .context-tour-help { right:12px; bottom:12px; }
}
@media(prefers-reduced-motion:reduce) { .tour-progress-track > span { transition:none; } }

/* Keep the card navigation below adoption controls, including expanded forms. */
.card-link:has(> .exercise-adopt) { display:flex; flex-direction:column; }
.card-link:has(> .exercise-adopt) > .card-arrow { position:static; align-self:flex-end; margin-top:auto; padding-top:12px; line-height:1; }
