/* Smartin Modern TOC — Ribbon (site-wide) */

:root {
  --sm-ribbon-height: 60px;
  --sm-ribbon-offset: 0px;
  --sm-highlight-gradient: linear-gradient(135deg, #7c3aed 0%, #fbbf24 100%);
}

.smartin-ribbon {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1000;
  display: flex;
  pointer-events: none;
  padding: 0;
}

.smartin-ribbon--ready {
  pointer-events: none;
}

.smartin-ribbon--pos-top {
  top: calc(env(safe-area-inset-top, 0px));
}

.smartin-ribbon--pos-bottom {
  bottom: calc(env(safe-area-inset-bottom, 0px));
}

.smartin-ribbon__inner {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: var(--sm-ribbon-height);
    background: linear-gradient(
      180deg,
    color-mix(in srgb, #ffffff 82%, var(--sm-accent, #8b5cf6) 8%),
    color-mix(in srgb, #f9f9fb 80%, var(--sm-primary, #7c3aed) 10%)
  );
  box-shadow: 0 -12px 32px rgba(17, 24, 39, .30);
  border-top: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.smartin-ribbon--align-left .smartin-ribbon__inner {
  justify-content: flex-start;
  padding-left: calc(18px + var(--sm-ribbon-offset));
  padding-right: 18px;
}

.smartin-ribbon--align-center .smartin-ribbon__inner {
  justify-content: center;
  padding-left: calc(18px + var(--sm-ribbon-offset));
  padding-right: calc(18px + var(--sm-ribbon-offset));
}

.smartin-ribbon--align-right .smartin-ribbon__inner {
  justify-content: flex-end;
  padding-right: calc(18px + var(--sm-ribbon-offset));
  padding-left: 18px;
}

.smartin-ribbon__hamburger-toggle {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, .75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  height: 38px;
  width: 38px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
  flex: 0 0 auto;
}

.smartin-ribbon__hamburger-toggle:hover,
.smartin-ribbon__hamburger-toggle:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .9);
  outline: none;
}

.smartin-ribbon__hamburger {
  width: 16px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.smartin-ribbon__hamburger::before,
.smartin-ribbon__hamburger::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.smartin-ribbon__hamburger::before {
  top: 4px;
  box-shadow: 0 5px 0 currentColor;
}

.smartin-ribbon__hamburger::after {
  bottom: 4px;
}

.smartin-ribbon__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f1f2b;
  white-space: nowrap;
  flex: 0 0 auto;
}

.smartin-ribbon__arrow {
  display: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
    align-items: center;
  justify-content: center;
  color: rgba(17, 24, 39, .45);
}

.smartin-ribbon__arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

.smartin-ribbon__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.smartin-ribbon__action {
    appearance: none;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
  justify-content: center;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform .18s ease;
  color: #1f1f2b;
  padding: 0;
}

.smartin-ribbon__action[data-icon-only="true"] {
  box-shadow: none;
}

.smartin-ribbon__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.smartin-ribbon__action-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.smartin-ribbon__action svg {
  width: 22px;
  height: 22px;
  display: block;
}

.smartin-ribbon__action:hover,
.smartin-ribbon__action:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.smartin-ribbon__action:focus-visible {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .42);
}

.smartin-ribbon__action[data-icon-only="true"]:hover,
.smartin-ribbon__action[data-icon-only="true"]:focus-visible {
  background: transparent;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .18);
}

.smartin-ribbon__action--smartin {
  background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(139,92,246,.85));
  color: #fff;
  padding: 0 18px;
}

.smartin-ribbon__action--smartin:hover,
.smartin-ribbon__action--smartin:focus-visible {
  background: linear-gradient(135deg, rgba(139,92,246,1), rgba(167,139,250,.95));
}

.smartin-ribbon__toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 16px) + 24px);
  left: 50%;
  transform: translate(-50%, 20px);
  background: rgba(17, 24, 39, .85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: .01em;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 1200;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .32);
}

.smartin-ribbon__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.smartin-ribbon__scroll {
  flex: 1 1 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  align-items: center;
  gap: 0;
}

.smartin-ribbon__scroll::-webkit-scrollbar {
  display: none;
}

.smartin-ribbon__items {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.smartin-ribbon__item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
}

.smartin-ribbon__item--desktop-hidden {
  display: flex;
}

.smartin-ribbon__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .82);
    color: #111827;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}

.smartin-ribbon__link:hover,
.smartin-ribbon__link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, .14);
  outline: none;
}

.smartin-ribbon__link.is-active {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
  color: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--sm-primary, #7c3aed) 35%, transparent);
}

.smartin-ribbon__item--highlight .smartin-ribbon__link,
.smartin-ribbon__link--highlight {
  background: var(--sm-highlight-gradient, linear-gradient(135deg, #7c3aed 0%, #fbbf24 100%));
  color: #fff;
  box-shadow: 0 12px 32px rgba(91, 33, 182, .25);
}

.smartin-ribbon__item--highlight .smartin-ribbon__link:hover,
.smartin-ribbon__item--highlight .smartin-ribbon__link:focus-visible,
.smartin-ribbon__link--highlight:hover,
.smartin-ribbon__link--highlight:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(91, 33, 182, .3);
}

.smartin-ribbon__item--highlight .smartin-ribbon__link.is-active,
.smartin-ribbon__link--highlight.is-active {
  background: var(--sm-highlight-gradient, linear-gradient(135deg, #7c3aed 0%, #fbbf24 100%));
  color: #fff;
  box-shadow: 0 16px 38px rgba(91, 33, 182, .35);
}

.smartin-ribbon__items--show-all-desktop .smartin-ribbon__item {
  display: flex;
}

@media (max-width: 900px) {
  .smartin-ribbon {
    padding: 0;
  }

  .smartin-ribbon__arrow {
    display: none;
  }

  .smartin-ribbon__inner {
    gap: 8px;
    padding: 0 calc(16px + var(--sm-ribbon-offset));
  }

  .smartin-ribbon__title {
    font-size: 0.88rem;
    display: block;
    line-height: 1.2;
    white-space: normal;
  }

  .smartin-ribbon__scroll {
    display: none;
    padding: 0;
  }

  .smartin-ribbon__actions {
    margin-left: auto;
    gap: 8px;
  }

  .smartin-ribbon--mobile-collapsible:not(.smartin-ribbon--mobile-open) .smartin-ribbon__scroll {
    display: none;
  }

  .smartin-ribbon--mobile-collapsible:not(.smartin-ribbon--mobile-open) .smartin-ribbon__title {
    margin-right: 0;
  }

  .smartin-ribbon__action[data-icon-only="true"] {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
  }

  .smartin-ribbon__action[data-icon-only="true"] .smartin-ribbon__action-icon,
  .smartin-ribbon__action[data-icon-only="true"] svg {
    width: 20px;
    height: 20px;
  }

  .smartin-ribbon__action--smartin {
    min-width: 110px;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(124,58,237,1), rgba(147,112,252,1));
    color: #fff;
    box-shadow: 0 12px 28px rgba(124, 58, 237, .35);
    text-align: center;
    white-space: nowrap;
  }

  .smartin-ribbon__action--smartin svg {
    display: none;
  }
}

@media (max-width: 600px) {
  .smartin-ribbon__inner {
    gap: 6px;
    padding: 0 calc(12px + var(--sm-ribbon-offset));
  }

  .smartin-ribbon__title {
    font-size: 0.8rem;
  }

  .smartin-ribbon__action[data-icon-only="true"] {
    width: 32px;
    height: 32px;
  }

  .smartin-ribbon__action[data-icon-only="true"] .smartin-ribbon__action-icon,
  .smartin-ribbon__action[data-icon-only="true"] svg {
    width: 18px;
    height: 18px;
  }

  .smartin-ribbon__action--smartin {
    min-width: 96px;
    font-size: 0.78rem;
    padding: 0 14px;
  }
}

@media (min-width: 901px) {
  .smartin-ribbon__arrow {
    display: inline-flex;
  }

  .smartin-ribbon__item--desktop-hidden {
    display: none;
  }

  .smartin-ribbon__actions {
    margin-left: 12px;
  }
}

@media (min-width: 1200px) {
  .smartin-ribbon__inner {
    max-width: min(1280px, 100% - (var(--sm-ribbon-offset) * 2));
    margin: 0 auto;
  }

  .smartin-ribbon__scroll {
    padding-right: 12px;
  }
}

@media (min-width: 1400px) {
  .smartin-ribbon__inner {
    max-width: min(1440px, 100% - (var(--sm-ribbon-offset) * 2));
  }
}

@media (min-width: 901px) {
  body:has(.smartin-ribbon--pos-bottom.smartin-ribbon--ready) {
    padding-bottom: calc(var(--sm-ribbon-height) + 32px);
  }
}

.smartin-toc-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
}

.smartin-toc-modal.is-open {
  display: block;
}

.smartin-toc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .22);
  backdrop-filter: blur(6px);
}

.smartin-toc-modal__panel {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(env(safe-area-inset-top, 0px) + 48px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  max-width: min(420px, 90vw);
  margin-left: calc(env(safe-area-inset-left, 0px) + 24px);
  background: rgba(249, 250, 252, .95);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, .35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.smartin-toc-modal__capsules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.smartin-toc-modal__capsules-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(17, 24, 39, .56);
}

.smartin-toc-modal__capsule-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.smartin-toc-modal__capsule-track::-webkit-scrollbar {
  display: none;
}

.smartin-toc-modal__capsule {
  appearance: none;
  border: 0;
  background: rgba(124, 58, 237, .12);
  color: #4c1d95;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .18);
}

.smartin-toc-modal__capsule--highlight {
  background: var(--sm-highlight-gradient, linear-gradient(135deg, #7c3aed 0%, #fbbf24 100%));
  color: #fff;
  box-shadow: 0 10px 24px rgba(91, 33, 182, .2);
}

.smartin-toc-modal__capsule--highlight:hover,
.smartin-toc-modal__capsule--highlight:focus-visible {
  background: var(--sm-highlight-gradient, linear-gradient(135deg, #7c3aed 0%, #fbbf24 100%));
  color: #fff;
  box-shadow: 0 14px 32px rgba(91, 33, 182, .28);
}

.smartin-toc-modal__capsule[data-pin="true"] {
  background: rgba(255, 255, 255, .92);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .25);
}

.smartin-toc-modal__capsule:hover,
.smartin-toc-modal__capsule:focus-visible {
  transform: translateY(-1px);
  background: rgba(124, 58, 237, .2);
  outline: none;
  box-shadow: 0 10px 20px rgba(124, 58, 237, .18);
}

.smartin-toc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  border-bottom: 1px solid rgba(17, 24, 39, .08);
}

.smartin-toc-modal__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.smartin-toc-modal__close {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, .08);
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 0;
  cursor: pointer;
}

.smartin-toc-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.smartin-toc-modal__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.smartin-toc-modal__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smartin-toc-modal__nested {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smartin-toc-modal__link {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.85);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.smartin-toc-modal__link:hover,
.smartin-toc-modal__link:focus-visible {
  background: rgba(124, 58, 237, .15);
  transform: translateX(2px);
  outline: none;
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__panel {
  left: 0;
  right: 0;
  margin: 0;
  max-width: 100%;
  top: auto;
  bottom: 0;
  height: min(65vh, calc(100vh - 40px));
  border-radius: 28px 28px 0 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(249, 250, 252, .92));
  box-shadow: 0 -24px 45px rgba(15, 23, 42, .22);
  transform: translateY(100%);
  transition: transform .28s ease, opacity .28s ease;
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__head {
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(17, 24, 39, .08);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__backdrop {
  background: rgba(17, 24, 39, .1);
  backdrop-filter: blur(4px);
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__capsule-track {
  padding: 4px 4px 10px;
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__body {
  padding: 18px 20px 24px;
}

.smartin-toc-modal[data-variant="mobile"].is-open .smartin-toc-modal__panel {
  transform: translateY(0);
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__list {
  gap: 16px;
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__link {
  background: rgba(255, 255, 255, .82);
  border-radius: 16px;
  font-size: 1rem;
  padding: 12px 16px;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .08);
}

.smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__nested {
  padding-left: 12px;
}

@media (max-width: 480px) {
  .smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__panel {
    height: min(68vh, calc(100vh - 32px));
  }

  .smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__body {
    padding: 16px 16px 22px;
  }

  .smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__capsule {
    padding: 8px 14px;
    font-size: 0.88rem;
  }

  .smartin-toc-modal[data-variant="mobile"] .smartin-toc-modal__link {
    font-size: 0.95rem;
    padding: 12px 14px;
  }
}

.smartin-toc-modal[data-variant="desktop"] .smartin-toc-modal__backdrop {
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(2px);
}

.smartin-toc-modal[data-variant="desktop"] .smartin-toc-modal__panel {
  max-width: min(420px, 92vw);
  box-shadow: 0 24px 55px rgba(15, 23, 42, .15), 0 0 0 1px rgba(124, 58, 237, .06);
  border: 1px solid rgba(255, 255, 255, .65);
}

.smartin-toc-modal[data-variant="desktop"] .smartin-toc-modal__body {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .9));
}

.smartin-toc-modal[data-variant="desktop"] .smartin-toc-modal__capsules {
  margin-bottom: 18px;
}

  @media (prefers-reduced-motion: reduce) {
  .smartin-ribbon,
  .smartin-ribbon__action,
  .smartin-ribbon__link,
  .smartin-toc-modal__panel,
  .smartin-toc-modal__capsule,
  .smartin-toc-modal__link {
    transition: none !important;
    animation: none !important;
  }
}