/* Reserve space below the article TOC for its persistent affiliate button. */
.fortuna-has-sidebar-bonus .article-sidebar {
  position: sticky;
  top: var(--fortuna-header-offset, 92px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - var(--fortuna-header-offset, 92px) - 16px);
  max-height: calc(100dvh - var(--fortuna-header-offset, 92px) - 16px);
}

.fortuna-has-sidebar-bonus .article-sidebar > .toc-card {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}

.fortuna-has-sidebar-bonus .article-sidebar > .toc-card > h2 { flex: 0 0 auto; }
.fortuna-has-sidebar-bonus .article-sidebar > .toc-card > ol {
  min-height: 0;
  overflow-y: auto;
  grid-template-columns: minmax(0, 1fr);
  scrollbar-width: thin;
  scrollbar-color: #9dafc6 transparent;
  scrollbar-gutter: stable;
  padding-right: 8px;
}

.fortuna-toc-toggle { display: none; }
.fortuna-sticky-bonus {
  flex: 0 0 auto;
  padding: 12px;
  border: 1px solid #e6d789;
  border-radius: 8px;
  background: #fff9de;
  color: #10233f;
  box-shadow: 0 6px 18px rgb(22 41 72 / 8%);
}

.fortuna-sticky-bonus__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid #e0b900;
  border-radius: 8px;
  background: #ffdc00;
  color: #10233f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}
.fortuna-sticky-bonus__button:hover { background: #f3ce00; color: #10233f; }
.fortuna-sticky-bonus__meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-top: 7px; font-size: 11px; }
.fortuna-sticky-bonus__meta a { color: #304b70; text-decoration: underline; text-underline-offset: 3px; }
.fortuna-has-sidebar-bonus .article-sidebar :is(a, button, summary, ol):focus-visible { outline: 3px solid #10233f; outline-offset: 2px; }
.fortuna-sidebar-more { flex: 0 0 auto; max-height: 30vh; max-height: 30dvh; overflow-y: auto; border: 1px solid #e6edf6; border-radius: 8px; background: white; padding: 8px 12px; font-size: 12px; }
.fortuna-sidebar-more > summary { cursor: pointer; font-weight: 700; }
.fortuna-sidebar-more .disclaimer-note { margin-top: 8px; padding: 8px; font-size: 11px; box-shadow: none; }

.fortuna-has-sidebar-bonus main [id] { scroll-margin-top: var(--fortuna-header-offset, 92px); }
.fortuna-has-sidebar-bonus .app-phone-figure { top: var(--fortuna-header-offset, 92px); }

@media (max-width: 1080px) {
  .fortuna-has-sidebar-bonus .article-sidebar { gap: 8px; }
  .fortuna-has-sidebar-bonus .article-sidebar > .toc-card { padding: 10px 14px; }
  .fortuna-has-sidebar-bonus .article-sidebar > .toc-card > h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
  .fortuna-has-sidebar-bonus[data-toc-enhanced] .fortuna-toc-toggle { display: inline-flex; justify-content: center; align-items: center; min-height: 32px; padding: 4px 10px; border: 1px solid #b7c9e3; border-radius: 6px; background: #f3f7ff; color: #10233f; font: inherit; font-size: 12px; cursor: pointer; }
  .fortuna-has-sidebar-bonus[data-toc-enhanced] .toc-card:not([data-toc-open]) > ol { display: none; }
  .fortuna-has-sidebar-bonus .article-sidebar > .toc-card > ol { margin-top: 10px; max-height: 24vh; max-height: 24dvh; }
  .fortuna-has-sidebar-bonus .fortuna-sticky-bonus { padding: 10px 12px; }
  .fortuna-has-sidebar-bonus main [id] { scroll-margin-top: calc(var(--fortuna-header-offset, 92px) + var(--fortuna-sidebar-height, 210px) + 12px); }
  .fortuna-has-sidebar-bonus .site-nav.is-open { max-height: calc(100dvh - var(--fortuna-header-offset, 92px)); overflow-y: auto; }
}

@media print {
  .fortuna-sticky-bonus, .fortuna-toc-toggle { display: none !important; }
  .fortuna-has-sidebar-bonus .article-sidebar { position: static; max-height: none; }
  .fortuna-has-sidebar-bonus .article-sidebar > .toc-card > ol { display: grid !important; max-height: none; overflow: visible; }
}
