/* Shared polish + responsive behaviour for the documentation shell (overview, tokens, components, patterns, icons, templates, guidelines). */
:root { --docs-ease: cubic-bezier(.2,.7,.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 rgba(48,80,160,.10); border-color: #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: #101828; color: #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: rgba(16,24,40,.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: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(16,24,40,.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: rgba(16,24,40,.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: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 24px 60px rgba(16,24,40,.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: #fff; cursor: pointer; }

/* Dark theme (filter-based, applied to the shell only) */
html[data-theme="dark"] body { background: #0b0f19; }
html[data-theme="dark"] .shell { filter: invert(.9) hue-rotate(180deg); }
html[data-theme="dark"] .shell img, html[data-theme="dark"] .shell video { filter: invert(1) hue-rotate(180deg); }

/* Responsive shell */
.d-burger { display: none; position: absolute; top: 10px; left: 10px; z-index: 90; width: 40px; height: 40px; border: 1px solid var(--color-border-primary); border-radius: 8px; background: #fff; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-xs); }
.d-scrim { display: none; }
@media (max-width: 900px) {
  .shell { display: block; }
  .main { padding-top: 56px; }
  .d-burger { 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 rgba(16,24,40,.2); }
  .sidebar.is-open { transform: none; }
  .d-scrim.is-on { display: block; position: fixed; inset: 0; z-index: 95; background: rgba(16,24,40,.35); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
