.resource-guides {
  width: 100%;
  margin: 12px 0 36px;
}

.resource-guides > h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.resource-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.resource-guide .article-cover {
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.resource-guide p {
  margin: 8px 0 0;
  color: #565656;
  line-height: 1.5;
}

html:has(.resource-page) {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container.resource-page {
  align-items: center;
  padding-bottom: 56px;
}

.resource-article {
  --resource-reading-width: 640px;
  display: block;
  width: 100%;
  max-width: 860px;
  min-width: 0;
  margin-inline: auto;
  text-align: left;
}

.resource-article [hidden] {
  display: none;
}

.resource-header,
.resource-body > :is(p, h2, h3, ul, ol, blockquote) {
  max-width: var(--resource-reading-width);
  margin-inline: auto;
}

.resource-back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
}

.resource-back:hover {
  text-decoration: underline;
}

.resource-article h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.resource-deck {
  margin: 0 0 14px;
  color: #454545;
  font-size: 18px;
  line-height: 1.5;
}

.resource-byline, .resource-example figcaption {
  color: #565656;
  font-size: 13px;
  line-height: 1.5;
}

.resource-byline a, .resource-example a {
  color: inherit;
  text-underline-offset: 2px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 14px 0 0;
}

.resource-header .resource-actions {
  gap: 8px 12px;
  margin-top: 18px;
}

.resource-action.cta {
  --copy-top: #fefefe;
  --copy-bottom: #f5f5f5;
  --copy-hover: #fff;
  --copy-pressed: #ececec;
  --copy-rim: #00000024;
  --copy-inset: #00000016;
  width: auto;
  appearance: none;
  border: 0;
  background-color: var(--copy-bottom);
  background-image: linear-gradient(var(--copy-top), var(--copy-bottom));
  box-shadow: 0 2px 4px #00000009, 0 1px 1px #00000014, 0 0 0 .5px var(--copy-rim), inset 0 -1px var(--copy-inset);
  color: #252525;
  font-size: 16px;
  line-height: 22px;
  text-shadow: 0 .5px 0 #fff3;
  white-space: nowrap;
  cursor: pointer;
}

.resource-action.cta:hover {
  background-image: linear-gradient(var(--copy-hover), var(--copy-bottom));
  box-shadow: 0 2px 4px #00000012, 0 1px 1px #00000024, 0 0 0 .5px var(--copy-rim), inset 0 -1px var(--copy-inset);
}

.resource-action.cta:active {
  background-image: linear-gradient(var(--copy-pressed), var(--copy-bottom));
  box-shadow: 0 0 0 .5px var(--copy-rim), inset 0 1px var(--copy-inset);
  text-shadow: 0 -.5px 0 #fff6;
}

.resource-action:not([hidden]) {
  display: inline-grid;
}

.resource-action > span {
  grid-area: 1 / 1;
}

.resource-action-feedback {
  visibility: hidden;
}

.resource-action[data-copied] > span:first-child {
  opacity: 0;
}

.resource-action[data-copied] > .resource-action-feedback {
  visibility: visible;
}

.resource-action[data-copied] ~ .resource-copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.resource-copy-status {
  color: #565656;
  font-size: 13px;
  line-height: 1.4;
}

.resource-actions [data-resource-copy-fallback] {
  flex: 1 0 100%;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #bcbcbc;
  border-radius: 6px;
  background: #fff;
  color: #252525;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}

.resource-example {
  width: 100%;
  margin: 24px auto 30px;
}

.resource-body figure.resource-example {
  max-width: 100%;
}

.resource-example img,
.resource-example video {
  display: block;
  width: 100%;
  height: auto;
  background: #f5f5f5;
  border-radius: 8px;
}

.resource-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.resource-preview::after,
.resource-related-image::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #0000001c, inset 0 1px 0 #ffffff28;
  pointer-events: none;
  content: '';
}

.resource-preview > video[data-resource-video] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.resource-preview[data-playing] > video[data-resource-video] {
  opacity: 1;
}

.resource-preview-toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.resource-preview-toggle span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #171717d9;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
}

.resource-article .resource-preview-toggle:focus-visible {
  outline-offset: -3px;
}

.resource-preview-toggle:is(:focus-visible, :active) span {
  opacity: 1;
}

@media (hover: hover) {
  .resource-preview-toggle:hover span { opacity: 1; }
}

.resource-body figure.resource-message-preview {
  max-width: 358px;
  margin-block: clamp(42px, 6vw, 64px);
}

.resource-message-preview .resource-preview::after {
  content: none;
}

.resource-message-preview .resource-preview-toggle span {
  top: 10px;
  bottom: auto;
}

.resource-body figure.resource-example[data-crop="square"] {
  max-width: 320px;
}

.resource-example[data-crop="square"] img {
  aspect-ratio: 1;
  object-fit: cover;
}

.resource-example figcaption {
  max-width: var(--resource-reading-width);
  margin: 8px auto 0;
}

.resource-body {
  min-width: 0;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.resource-body h2, .resource-related h2 {
  margin-block: 34px 12px;
  font-size: 24px;
  line-height: 1.2;
}

.resource-body h3 {
  margin-block: 24px 10px;
  font-size: 18px;
  line-height: 1.3;
}

.resource-body p, .resource-body ul, .resource-body ol {
  margin-bottom: 16px;
}

.resource-body > .resource-lead {
  margin-top: clamp(38px, 6vw, 64px);
  margin-bottom: 26px;
  font-size: 18px;
  line-height: 1.65;
}

.resource-body li + li {
  margin-top: 6px;
}

.resource-body :where(p, li, figcaption) code {
  padding: .12em .36em;
  border-radius: 4px;
  background: #f0f0f0;
  font-size: .85em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.resource-code, .resource-body > pre {
  --resource-code-padding: clamp(26px, 5.5vw, 48px);
  --resource-code-actions-inset: clamp(18px, 2.5vw, 24px);
  margin: 36px auto;
  border: 1px solid #dadade;
  border-radius: 16px;
  background: #f8f8f9;
  color: #25252d;
}

.resource-code {
  position: relative;
}

.resource-code-actions {
  justify-content: center;
  margin: 0 var(--resource-code-actions-inset) var(--resource-code-actions-inset);
}

@media (hover: hover) and (pointer: fine) {
  .resource-code-actions:not(:has([data-resource-copy-fallback]:not([hidden]))) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: calc(100% - 2 * var(--resource-code-actions-inset));
    margin: 0;
  }

  .resource-code:not(:hover, :has(:focus-visible), :has([data-resource-copy-fallback]:not([hidden]))) .resource-code-actions {
    opacity: 0;
    pointer-events: none;
  }
}

.resource-code-actions .resource-copy-status {
  flex: 1 0 100%;
  text-align: center;
  color: #515560;
}

.resource-code-actions .resource-copy-status:empty {
  position: absolute;
}

.resource-body pre {
  min-width: 0;
  padding: var(--resource-code-padding, 22px);
  overflow-x: auto;
  font: 500 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
  overflow-wrap: normal;
}

.resource-code pre { margin: 0; }

.resource-code[data-resource-language="html"] pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.resource-body pre code { font: inherit; }
.resource-code .code-tag { color: #004fd4; }
.resource-code .code-attr { color: #94109f; }
.resource-code .code-string { color: #00683b; }
.resource-code .code-comment { color: #48576c; }
.resource-code .code-command { color: #963900; }

.resource-body table {
  width: min(100%, var(--resource-reading-width));
  margin: 20px auto;
  border-collapse: collapse;
  font-size: 14px;
}

.resource-body th, .resource-body td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.resource-related {
  width: 100%;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}

.resource-related h2 {
  margin: 0 0 14px;
}

.resource-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-related-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.resource-related-image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1200 / 630;
  border-radius: 8px;
  background: #f5f5f5;
}

.resource-related-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-related-title {
  display: block;
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.resource-related-card:hover .resource-related-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.resource-related-deck {
  display: block;
  margin: 5px 0 0;
  color: #565656;
  font-size: 14px;
  line-height: 1.5;
}

.resource-article :is(a, button, pre):focus-visible {
  outline: 2px solid #817000;
  outline-offset: 3px;
}

.resource-code :is(button, pre):focus-visible {
  outline-color: #005bd4;
}

.resource-code pre:focus-visible {
  outline-offset: -2px;
}

@media (max-width: 767px) {
  .resource-guide-grid { grid-template-columns: 1fr; }
  .container.resource-page { padding-top: 28px; }
}

@media (max-width: 600px) {
  .resource-related-grid { grid-template-columns: 1fr; }
  .resource-body th, .resource-body td { padding-inline: 6px; }
}
