.right-bar-item.item-theme-toggle {
  box-sizing: border-box;
  display: grid;
  overflow: hidden;
  place-items: center;
}

.right-bar-item.item-theme-toggle > span {
  grid-area: 1 / 1;
  width: 34px;
  height: 34px;
}

.right-bar-item.item-theme-toggle > span > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cookie-preferences {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(6 13 25 / 72%);
  backdrop-filter: blur(8px);
}

.cookie-preferences__panel {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgb(148 163 184 / 25%);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(15 23 42 / 28%);
  color: #182230;
}

.dark .cookie-preferences__panel {
  background: #111827;
  color: #f8fafc;
}

.cookie-preferences__header,
.cookie-preferences__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-preferences__eyebrow {
  margin: 0 0 4px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cookie-preferences__close {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: inherit;
  cursor: pointer;
  font-size: 24px;
}

.cookie-preferences__list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.cookie-preferences__list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.dark .cookie-preferences__list label {
  border-color: #334155;
}

.cookie-preferences__list span,
.cookie-preferences__list small {
  display: block;
}

.cookie-preferences__list small {
  margin-top: 4px;
  color: #64748b;
}

.cookie-preferences__list input {
  width: 22px;
  height: 22px;
  accent-color: #2563eb;
}

.cookie-preferences-reopen {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  padding: 9px 14px;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 24px rgb(15 23 42 / 14%);
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.dark .cookie-preferences-reopen {
  background: rgb(15 23 42 / 92%);
  color: #f8fafc;
}
@media (max-width: 1023px) {
  .right-bar .item-tg,
  .right-bar .item-wx,
  .right-bar .item-ws { display: none; }

  .right-bar {
    bottom: 14px;
    right: 10px;
  }

  .footer .main-container > .grid > div:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 0;
  }

  .footer .main-container > .grid > div:nth-child(2) > div {
    grid-column: auto;
  }
}
@media (max-width: 640px) {
  .footer .main-container > .grid {
    padding-top: 36px;
    padding-bottom: 28px;
    row-gap: 32px;
  }

  .footer .main-container > .grid > div:first-child .max-w-\[306px\] {
    max-width: 100%;
  }

  .footer .main-container > .grid > div:first-child figure {
    width: 170px;
  }

  .footer .main-container > .grid > div:first-child p {
    margin-top: 12px;
    margin-bottom: 18px;
  }

  .footer .main-container > .grid > div:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 0;
  }

  .footer .main-container > .grid > div:nth-child(2) > div {
    grid-column: auto;
  }

  .footer .main-container > .grid > div:nth-child(2) > div > .space-y-8 > :not(:last-child) {
    margin-block-end: 14px;
  }

  .footer .main-container > .grid > div:nth-child(2) ul.space-y-5 > :not(:last-child) {
    margin-block-end: 10px;
  }

  .footer .main-container > .pt-\[26px\] {
    padding-top: 20px;
    padding-right: 12px;
    padding-bottom: 92px;
    padding-left: 12px;
  }

  .footer .site-copyright {
    max-width: 100%;
    line-height: 1.55;
  }

  .cookie-preferences__panel {
    padding: 22px;
    border-radius: 20px;
  }

  .cookie-preferences__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .cookie-preferences__actions .cookie-btn {
    width: 100%;
  }

  .cookie-preferences-reopen {
    left: 12px;
    right: auto;
    bottom: 12px;
  }
}
.right-bar .item-help-docs > a { display: block; width: 100%; height: 100%; border-radius: 50%; }
.right-bar .item-help-docs svg { display: block; width: 100%; height: 100%; }
.right-bar .item-help-docs > a:focus-visible { outline: 3px solid #8ec5ff; outline-offset: 3px; }

/* Footer social logos and hover QR cards. */
.footer-social-links { flex-wrap: wrap; overflow: visible; }
.footer-social-item { position: relative; display: inline-flex; }
.footer-social-trigger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 4px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.footer-social-logo { display: block; width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.footer-social-trigger:hover, .footer-social-trigger:focus-visible { background: #ffffff1a; outline: 2px solid #ffffff80; outline-offset: 2px; }
.footer-social-qr { position: absolute; bottom: 100%; left: 0; z-index: 50; display: none; width: 192px; padding: 12px; border-radius: 12px; background: #fff; color: #20232a; box-shadow: 0 8px 28px #0003; text-align: center; }
.footer-social-qr > img { display: block; width: 168px; height: 168px; object-fit: contain; }
.footer-social-qr > span { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; }
.footer-social-item:hover > .footer-social-qr, .footer-social-item:focus-within > .footer-social-qr { display: block; }
/* Existing generated footers also receive the larger rounded logos. */
footer .flex.items-center.gap-3 > a > img.size-6,
footer .flex.items-center.gap-3 > span > img.size-6 { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }

footer:has(.footer-social-links) { overflow: visible; }

/* Clip decorative artwork independently so social QR cards can overflow. */
.footer-decoration { position:absolute; inset:0; overflow:hidden; z-index:-1; pointer-events:none; border-radius:inherit; }

/* Give the brand and social row more room; keep the link columns compact. */
.footer .main-container > .grid > div:first-child > div { width:100%; max-width:420px; }
.footer-social-links { gap:8px; }
.footer-social-item, .footer-social-links > [aria-hidden="true"] { flex-shrink:0; }
@media (min-width:1024px) {
  .footer .main-container > .grid {
    grid-template-columns:minmax(380px,5fr) minmax(0,7fr);
    column-gap:clamp(32px,4vw,64px);
  }
  .footer .main-container > .grid > div { grid-column:auto; min-width:0; }
  .footer .main-container > .grid > div:nth-child(2) {
    grid-template-columns:repeat(3,minmax(0,1fr));
    column-gap:24px;
    align-content:start;
  }
  .footer .main-container > .grid > div:nth-child(2) > div { grid-column:auto; min-width:0; }
}
