/* Shared polish + responsive behaviour for the documentation shell (overview, tokens, components, patterns, icons, templates, guidelines). */
:root {
  --docs-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --docs-fast: 150ms;
  --docs-med: 220ms;
}
html {
  scroll-behavior: smooth;
}
:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
  border-radius: 6px;
}
button,
[role='tab'],
a {
  transition:
    background-color var(--docs-fast) var(--docs-ease),
    color var(--docs-fast) var(--docs-ease),
    border-color var(--docs-fast) var(--docs-ease),
    box-shadow var(--docs-fast) var(--docs-ease),
    transform var(--docs-fast) var(--docs-ease),
    opacity var(--docs-fast) var(--docs-ease);
}
button {
  font-family: inherit;
}
.nav__item {
  transition:
    background-color var(--docs-fast) var(--docs-ease),
    color var(--docs-fast) var(--docs-ease),
    padding var(--docs-fast) var(--docs-ease);
}
.nav__item:hover:not(.nav__item--active) {
  padding-left: 16px;
}
.release__row--link {
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: inherit;
  padding: 0;
  color: var(--color-content-secondary);
}
.release__row--link:hover {
  color: var(--color-content-brand);
}

/* Subtle card/tile hover (opt-in via class, also auto-applied to common card classes by docs.js) */
.d-lift {
  transition:
    transform var(--docs-med) var(--docs-ease),
    box-shadow var(--docs-med) var(--docs-ease),
    border-color var(--docs-med) var(--docs-ease);
}
.d-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--dk-sh-3050a01a, rgba(48, 80, 160, 0.1));
  border-color: var(--dk-bd-dbe6fb, #dbe6fb);
}
.d-in {
  animation: d-in 320ms var(--docs-ease) both;
  animation-delay: var(--i, 0ms);
}
@keyframes d-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.d-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--dk-bg-101828, #101828);
  color: var(--dk-fg-ffffff, #fff);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--docs-med) var(--docs-ease),
    transform var(--docs-med) var(--docs-ease);
  z-index: 200;
}
.d-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Search palette */
.d-pal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: var(--dk-bg-10182859, rgba(16, 24, 40, 0.35));
  backdrop-filter: blur(2px);
}
.d-pal.is-open {
  display: flex;
  animation: d-fade 160ms ease both;
}
@keyframes d-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.d-pal__box {
  width: min(560px, 100%);
  background: var(--dk-bg-ffffff, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 60px var(--dk-sh-1018284c, rgba(16, 24, 40, 0.3));
  overflow: hidden;
  animation: d-in 220ms var(--docs-ease) both;
}
.d-pal__input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--color-border-primary);
  padding: 16px 18px;
  font: 400 15px var(--font-family);
  outline: none;
}
.d-pal__list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px;
}
.d-pal__list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-content-primary);
}
.d-pal__list a small {
  color: var(--color-content-secondary);
}
.d-pal__list a.is-sel,
.d-pal__list a:hover {
  background: var(--color-brand-primary-subtle);
}
.d-pal__empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--color-content-secondary);
}

/* Release-notes modal */
.d-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--dk-bg-10182866, rgba(16, 24, 40, 0.4));
}
.d-modal.is-open {
  display: flex;
  animation: d-fade 160ms ease both;
}
.d-modal__box {
  width: min(480px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--dk-bg-ffffff, #fff);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 60px var(--dk-sh-1018284c, rgba(16, 24, 40, 0.3));
  animation: d-in 220ms var(--docs-ease) both;
}
.d-modal__box h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.d-modal__box ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.d-modal__box li {
  font-size: 13px;
  line-height: 19px;
  color: var(--color-content-secondary);
}
.d-modal__box li b {
  color: var(--color-content-primary);
  font-weight: 500;
}
.d-modal__close {
  margin-top: 16px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border-primary);
  background: var(--dk-bg-ffffff, #fff);
  cursor: pointer;
}

/* Top bar (rendered by docs.js on every docs page) */
.gl > .d-top {
  margin: 0 -24px 24px; /* Guidelines pads <main> itself, so let the bar run edge to edge */
}
.d-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 24px;
  background: var(--dk-bg-ffffffeb, rgba(255, 255, 255, 0.92));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-primary);
}
.d-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.d-top__menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  background: none;
  color: var(--color-content-primary);
  cursor: pointer;
}
.d-top__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 480px;
  height: 40px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  background: var(--color-surface-main);
  color: var(--color-content-secondary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.d-top__search:hover {
  border-color: var(--color-border-secondary-pressed);
}
.d-top__search span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-top__search kbd {
  padding: 2px 6px;
  border: 1px solid var(--color-border-primary);
  border-radius: 4px;
  font: 500 11px/16px var(--font-family);
  color: var(--color-content-secondary);
}
.d-top__right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
/* Exit: same secondary button as the AI Brand Customization app */
.d-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--dk-bd-d0d5dd, #d0d5dd);
  border-radius: 8px;
  background: var(--color-surface-main);
  color: var(--color-content-primary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.d-exit:hover {
  background: var(--dk-bg-f9fafb, #f9fafb);
}
.d-exit svg {
  width: 16px;
  height: 16px;
}

.d-scrim {
  display: none;
}
@media (max-width: 900px) {
  .shell {
    display: block;
  }
  .d-top {
    padding: 0 16px;
  }
  .gl > .d-top {
    margin: 0 -16px 16px;
  }
  .d-top__menu {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--docs-med) var(--docs-ease);
    box-shadow: 0 0 40px var(--dk-sh-10182833, rgba(16, 24, 40, 0.2));
  }
  .sidebar.is-open {
    transform: none;
  }
  .d-top__search kbd {
    display: none;
  }
  .d-scrim.is-on {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 95;
    background: var(--dk-bg-10182859, rgba(16, 24, 40, 0.35));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 560px) {
  .d-top {
    gap: 8px;
  }
  .d-top__search {
    width: 40px;
    flex: none;
    padding: 0;
    justify-content: center;
  }
  .d-top__search span {
    display: none;
  }
  .d-exit {
    padding: 0 10px;
  }
}
@media (max-width: 480px) {
  .d-top__right {
    gap: 6px;
  }
  .d-exit {
    width: 36px;
    padding: 0;
    gap: 0;
    justify-content: center;
    font-size: 0; /* icon only; the word stays for screen readers */
  }
}
