html {
  scroll-padding-top: calc(var(--dialoga-header-height, 76px) + 8px);
}

html.dialoga-reading-open {
  overflow: hidden;
}

[data-editorial-news-toggle], [data-editorial-close] {
  cursor: pointer;
  border: 1px solid #b6b6b8;
  border-radius: 999px;
  background: white;
  color: #222326;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
}

[data-editorial-card] { cursor: pointer; }

[data-editorial-open] {
  align-self: start;
  margin-top: auto;
  border: 0;
  padding: 6px 0 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: start;
  color: oklch(52% 0.12 72);
}

[data-editorial-card]:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }

dialog[data-editorial-dialog] {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(760px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  border: 0;
  border-radius: 20px;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: oklch(18% 0.012 260);
  background: white;
  box-shadow: 0 40px 100px -30px #0009;
}

dialog[data-editorial-dialog]::backdrop {
  background: oklch(16% 0.014 262 / 0.72);
  backdrop-filter: blur(6px);
}

.dialoga-reading-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.dialoga-reading-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dialoga-reading-copy { display: grid; gap: 14px; padding: clamp(18px, 4vw, 32px); }
.dialoga-reading-copy h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; }
.dialoga-reading-copy p { margin: 0; line-height: 1.65; }
.dialoga-reading-copy [data-editorial-close] { justify-self: end; background: #242526; color: white; }
.dialoga-reading-dismiss { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; padding: 0; font-size: 26px; }

@media (max-width: 920px) {
  [data-demo-hero] {
    grid-template-columns: minmax(0, 1fr) minmax(44px, 22%) !important;
    row-gap: 12px;
  }
  [data-demo-hero] > :last-child { grid-column: 1 / -1; min-width: 0; }
  [data-demo-console-body] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [data-demo-console-body] > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  [data-demo-console-body] > div { min-width: 0; box-sizing: border-box; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: calc(var(--dialoga-header-height, 132px) + 4px); }
  body > header:first-of-type { position: sticky !important; top: 0; }
  body > header > div {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px !important;
    min-height: auto !important;
    padding: 6px 12px 4px !important;
  }
  body > header > div > a { grid-column: 1; grid-row: 1; }
  body > header > div > a img { max-width: 76px; height: auto !important; }
  body > header > div > div {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 3px 6px !important;
  }
  body > header > div > div > a { padding: 6px 8px !important; font-size: 12px !important; }
  body > header > div > nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 14px !important;
    margin-left: 0 !important;
    min-width: 0;
  }
  body > header nav a { flex: none; white-space: nowrap; padding-block: 6px; }
  /* The static product templates use fixed minimums inside padded panels. */
  div[style*="repeat(auto-fit,minmax(280px,"] {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
  }
  div[style*="repeat(auto-fit,minmax(300px,"] {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)) !important;
  }
  div[style*="minmax(160px,220px) minmax(0,1fr) minmax(170px,240px)"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  div[style*="minmax(120px,1fr) minmax(90px,1fr) 60px auto"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
