/* Scoped feature layouts. The publication retains its own page typography and palette. */
[id^="editorial-"] { --feature-rule: color-mix(in srgb,currentColor 16%,transparent); --feature-surface: color-mix(in srgb,currentColor 5%,transparent); }
#editorial-feature-hero { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); align-items:stretch; gap:clamp(1rem,3vw,2rem); margin:1.5rem 0 2rem; }
#editorial-feature-hero figure{margin:0;min-width:0}
#editorial-feature-hero img{display:block;width:100%;height:auto;border-radius:14px}
#editorial-feature-summary,#editorial-key-takeaways,#editorial-cta{background:var(--feature-surface);border:1px solid var(--feature-rule);border-radius:14px;padding:clamp(1rem,2.7vw,1.75rem)}
#editorial-feature-summary h2,#editorial-cta h2{margin:.8rem 0 .55rem}
[id^="editorial-brand-"]{display:flex;gap:.65rem;align-items:center;font-weight:700;line-height:1.25;font-size:.88rem}
#editorial-feature-hero #editorial-brand-opener img,#editorial-brand-closer img{width:34px;height:34px;border-radius:8px}
#editorial-key-takeaways li+li{margin-top:.45rem}
#editorial-jump-links{margin:1.1rem 0 2rem}
#editorial-jump-links h2{font-size:1rem;margin:0 0 .7rem}
#editorial-jump-links ul{display:flex;flex-wrap:wrap;gap:.55rem;list-style:none;margin:0;padding:0}
#editorial-jump-links a{
  display:inline-flex;align-items:center;min-height:44px;padding:.25rem .9rem;border:1px solid var(--feature-rule);
  border-radius:999px;color:inherit;font-weight:650;text-decoration:none;
}
#editorial-jump-links a:hover,#editorial-jump-links a:focus-visible{background:var(--feature-surface);text-decoration:underline}
#editorial-affiliate-products{margin:1.6rem 0;padding:clamp(1rem,3vw,1.55rem);background:var(--feature-surface);border:1px solid var(--feature-rule);border-radius:14px}
#editorial-affiliate-products>h3{margin-top:0}
#editorial-affiliate-disclosure{font-size:.85rem}
#editorial-affiliate-products .product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem}
#editorial-affiliate-products .product-card{display:flex;min-width:0;flex-direction:column;align-items:start;gap:.65rem;padding:1rem;border:1px solid var(--feature-rule);border-radius:10px}
#editorial-affiliate-products .product-card p,#editorial-affiliate-products .product-card h4{margin:0}
#editorial-affiliate-products .product-description{font-size:.91em}
#editorial-affiliate-products .amazon-photo{width:100%;background:white;border-radius:8px;overflow:hidden}
#editorial-affiliate-products .amazon-photo:empty,#editorial-affiliate-products [hidden]{display:none}
#editorial-affiliate-products .amazon-photo img{display:block;width:100%;height:8.5rem;object-fit:contain}
#editorial-affiliate-products .product-cta{display:inline-flex;align-items:center;min-height:44px;margin-top:auto;padding:.35rem .8rem;border:1px solid currentColor;border-radius:7px;font-weight:700}
#editorial-affiliate-products .product-card>div.product-description{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .85rem;margin-top:auto}
#editorial-affiliate-products .product-card a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
[id^="editorial-columns-"],#editorial-collection ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
[id^="editorial-columns-"]>section,#editorial-collection li{padding:1rem;border:1px solid var(--feature-rule);border-radius:12px;margin:0}
#editorial-collection ul{list-style:none;padding:0;grid-template-columns:repeat(3,minmax(0,1fr))}
#editorial-collection a{font-weight:720}
#editorial-faq details,#editorial-main-question{border:1px solid var(--feature-rule);border-radius:10px;padding:.75rem 1rem;margin:.6rem 0}
#editorial-faq summary,#editorial-main-question summary{cursor:pointer;font-weight:690}
#editorial-feature-summary>p>a,#editorial-cta>a{display:inline-flex;align-items:center;min-height:44px;padding:.4rem .95rem;border:1px solid currentColor;border-radius:8px;text-decoration:none;font-weight:715;color:inherit}
#editorial-feature-summary>p>a:hover,#editorial-cta>a:hover{background:var(--feature-surface);text-decoration:underline}
#editorial-feature-summary a:focus-visible,#editorial-cta a:focus-visible,#editorial-collection a:focus-visible{outline:2px solid currentColor;outline-offset:4px}
#editorial-references li+li{margin-top:.45rem}
#editorial-references span{font-size:.92em;opacity:.78}
.publication-body figure>details:has(>img){
  border:1px solid color-mix(in srgb,currentColor 20%,transparent);
  border-radius:10px;padding:.65rem 1rem;margin-bottom:.45rem;
}
.publication-body figure>details:has(>img)>summary{cursor:pointer;min-height:36px;font-weight:670}
.publication-body figure>details[open]>img{display:block;margin:.6rem 0}
.publication-body:has(#editorial-feature-hero) .tool-block{
  --tool-border:color-mix(in srgb,currentColor 20%,transparent);
  --tool-surface:color-mix(in srgb,currentColor 4%,transparent);
  margin:1.5rem 0;padding:clamp(1rem,3vw,1.5rem);border:1px solid var(--tool-border);
  border-radius:14px;background:var(--tool-surface);
}
.publication-body:has(#editorial-feature-hero) .tool-block h3{margin:0 0 1rem}
.publication-body:has(#editorial-feature-hero) .tool-block label{display:grid;gap:.3rem;margin:.8rem 0;cursor:pointer}
.publication-body:has(#editorial-feature-hero) .tool-block input{font:inherit;color:inherit}
.publication-body:has(#editorial-feature-hero) .tool-block input[type=number]{
  box-sizing:border-box;padding:.45rem .65rem;min-height:44px;max-width:16rem;
  border:1px solid var(--tool-border);border-radius:8px;background:transparent;
}
.publication-body:has(#editorial-feature-hero) .tool-block input[type=range]{width:100%;min-height:44px}
.publication-body:has(#editorial-feature-hero) .tool-checklist-list{list-style:none;padding:0;margin:.5rem 0}
.publication-body:has(#editorial-feature-hero) .tool-checklist-list li{margin:0;padding:0}
.publication-body:has(#editorial-feature-hero) .tool-checklist-list label{
  grid-template-columns:1.25rem 1fr;gap:.75rem;align-items:center;min-height:44px;
  margin:0;padding:.45rem 0;border-bottom:1px solid var(--tool-border);
}
.publication-body:has(#editorial-feature-hero) .tool-checklist-list input{width:1.15rem;height:1.15rem;margin:0}
.publication-body:has(#editorial-feature-hero) .tool-checklist-list input:checked+span{opacity:.72;text-decoration:line-through}
.publication-body:has(#editorial-feature-hero) .tool-block output,
.publication-body:has(#editorial-feature-hero) .tool-progress{font-weight:720;font-variant-numeric:tabular-nums}
.publication-body:has(#editorial-feature-hero) .tool-reset{
  min-height:44px;padding:.4rem .95rem;border:1px solid var(--tool-border);border-radius:8px;
  background:transparent;color:inherit;font:inherit;font-weight:650;cursor:pointer;
}
.publication-body:has(#editorial-feature-hero) .tool-reset:hover{background:var(--tool-surface)}
.publication-body:has(#editorial-feature-hero) .tool-block :focus-visible{outline:2px solid currentColor;outline-offset:3px}
@media(max-width:680px){#editorial-feature-hero,[id^="editorial-columns-"],#editorial-collection ul,#editorial-affiliate-products .product-grid{grid-template-columns:1fr}}

/* Editorial media and table containment */
#editorial-feature-hero #editorial-brand-opener img,#editorial-brand-closer img{object-fit:contain}
:has(> #editorial-feature-hero) figure img{max-inline-size:100%;height:auto}
:has(> #editorial-feature-hero) .table-scroll{
  min-inline-size:0;max-inline-size:100%;overflow-x:auto;overscroll-behavior-inline:contain;
}
.publication-body:has(#editorial-feature-hero) .tool-block input{accent-color:var(--article-accent,currentColor)}

@media (max-width:650px) {
  .article-layout > .prose:has(#editorial-feature-hero) { max-inline-size:100%; }
}
