/* R5: faster topic access and readable organization details. R4 remains unchanged. */
@media (prefers-reduced-motion: reduce) {
  html.ai-connected-document { scroll-behavior: auto; }
}
/* The root already reserves the fixed header through scroll-padding-top. */
body.ai-tools-page main [id],
body.ai-community-page main [id],
body.ai-community-page #ai-water-power-giving.ai-directory-r19,
body.ai-community-page #ai-water-power-giving.ai-directory-r19 [id],
body.ai-community-page #elemental-data-center-resource,
body.ai-community-page #codecarbon-impact-resource,
.ai-guide-quickstart[id] { scroll-margin-top: 8px; }
body.ai-tools-page .ai-tool-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 30px;
}
body.ai-tools-page .ai-tool-index a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid #b9cbb2;
  border-radius: 3px;
  color: #244a36;
  background: #fafbf6;
  text-decoration: none;
  font: 650 .8rem/1.45 Montserrat, Arial, sans-serif;
}
body.ai-tools-page .ai-tool-index img {
  width: 32px;
  height: 32px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 5px;
  background: #fff;
}
body.ai-tools-page .ai-tool-index a:hover { border-color: #658a60; background: #e5eddd; }
body.ai-tools-page .ai-tool-index a:focus-visible { outline: 3px solid #257262; outline-offset: 4px; }
body.ai-tools-page .ai-tool-card:target {
  border-color: #547b4e;
  box-shadow: 0 0 0 3px #d4e0cb;
}
body.ai-tools-page .ai-tool-facts > .ai-tool-review-note {
  background: #f6f0df;
  border: 1px solid #dfd0aa;
  border-left: 3px solid #9c8148;
  padding: 16px 18px;
  margin: 4px 0 8px;
}
body.ai-tools-page .ai-tool-review-note dt { color: #605025; font-size: .8rem; }
body.ai-tools-page .ai-tool-review-note dd { color: #514d3e; font-size: 1rem; }
.ai-guide-quickstart {
  padding: 33px 0 35px;
  background: #f7f7ef;
  border-bottom: 1px solid #cbd6c7;
  color: #173d31;
}
.ai-guide-quickstart > .ai-tools-shell {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.7fr);
  gap: 28px 38px;
  align-items: center;
}
.ai-guide-quickstart .eyebrow {
  color: #476d4b;
  font: 750 .75rem/1.5 Montserrat, Arial, sans-serif;
  letter-spacing: .11em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.ai-guide-quickstart h2 {
  color: #173d31;
  font: 600 clamp(1.9rem, 3.1vw, 2.65rem)/1.1 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.02em;
  margin: 0;
}
.ai-guide-quickstart nav { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-guide-quickstart nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  color: #31553c;
  background: #eef2e6;
  border: 1px solid #c0cfb7;
  border-radius: 3px;
  padding: 9px 14px;
  font: 600 .8rem/1.55 Montserrat, Arial, sans-serif;
  text-decoration: none;
}
.ai-guide-quickstart nav a:hover { background: #dfe9d5; border-color: #7e9d74; }
.ai-guide-quickstart nav a:focus-visible { outline: 3px solid #257262; outline-offset: 4px; }
.ai-history-refresh .ai-story-section:target > h2,
.ai-history-refresh .ai-participation-section:target > h2 {
  text-decoration: underline;
  text-decoration-color: #b69c62;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
/* Explicit selectors override legacy small-text rules without changing other Giving pages. */
body.ai-community-page .ai-giving-lede,
body.ai-community-page .ai-position p,
body.ai-community-page .ai-section-heading > p,
body.ai-community-page .ai-card-body > p,
body.ai-community-page .donation-route-panel p,
body.ai-community-page .ai-impact-pending p,
body.ai-community-page .ai-tool-grid dd,
body.ai-community-page .ai-resource-directory > p,
body.ai-community-page .ai-climate-resource p,
body.ai-community-page .ai-resource-list p {
  font-size: 1rem;
  line-height: 1.8;
}
body.ai-community-page .ai-position .ai-scope-note,
body.ai-community-page .ai-lane-heading p,
body.ai-community-page .ai-card-body > .ai-card-limit,
body.ai-community-page .ai-giving-note,
body.ai-community-page .ai-tools-context,
body.ai-community-page .ai-resource-list .ai-resource-limit,
body.ai-community-page .ai-reading-close p {
  font-size: .875rem;
  line-height: 1.75;
}
body.ai-community-page .eyebrow,
body.ai-community-page .ai-role,
body.ai-community-page .ai-card-body .donation-route-pill,
body.ai-community-page .ai-community-visual figcaption,
body.ai-community-page .ai-card-body .donation-route-status,
body.ai-community-page .ai-pending-label,
body.ai-community-page .ai-tool-grid dt span,
body.ai-community-page .ai-source-date,
body.ai-community-page .ai-giving-breadcrumb {
  font-size: .75rem;
  line-height: 1.65;
}
body.ai-community-page .ai-impact-asof { font-size: .75rem !important; }
body.ai-community-page .ai-source-link,
body.ai-community-page .donation-route-review,
body.ai-community-page .donation-route-actions .btn,
body.ai-community-page .ai-climate-resource a,
body.ai-community-page .ai-reading-close a,
body.ai-community-page .ai-impact-pending a {
  font-size: .875rem;
  line-height: 1.6;
  gap: 7px;
}
body.ai-community-page .donation-route-panel { font-size: 1rem; }
body.ai-community-page .ai-tool-grid dt { font-size: 1rem; }
body.ai-community-page .ai-giving-jump-links b { font-size: .875rem; }
body.ai-community-page .ai-giving-jump-links small { font-size: .75rem; }
body.ai-community-page .ai-giving-jump-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.ai-community-page .ai-giving-jump-links > a { gap: 10px; padding-inline: 18px; }
body.ai-community-page .ai-giving-jump-links > a:first-child { padding-left: 0; }
body.ai-community-page .ai-giving-jump-links > a:last-child { padding-right: 0; }
body.ai-community-page .ai-support-card:target { border-color: #547b4e; box-shadow: 0 0 0 3px #d4e0cb; }
@media (max-width: 1080px) {
  body.ai-tools-page .ai-tool-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-guide-quickstart > .ai-tools-shell { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  body.ai-community-page .ai-giving-jump-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ai-community-page .ai-giving-jump-links > a { padding: 20px 18px; }
  body.ai-community-page .ai-giving-jump-links > a:nth-child(odd) { padding-left: 0; }
  body.ai-community-page .ai-giving-jump-links > a:nth-child(even) { padding-right: 0; border-right: 0; }
  body.ai-community-page .ai-giving-jump-links > a:nth-child(-n+2) { border-bottom: 1px solid #cbd6c7; }
}
@media (max-width: 760px) {
  .ai-section-nav-inner { padding-block: 7px; gap: 3px; }
  .ai-section-home { min-height: 30px; }
  .ai-section-links a { min-height: 48px; font-size: .75rem; padding-block: 7px; }
  body.ai-tools-page .ai-tool-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 25px; }
  body.ai-tools-page .ai-tool-index a { min-height: 60px; gap: 8px; padding: 10px; }
  .ai-guide-quickstart { padding: 27px 0 29px; }
  .ai-guide-quickstart nav { gap: 8px; }
  .ai-guide-quickstart nav a { padding: 9px 12px; font-size: .8rem; }
  .ai-history-refresh .ai-section-card-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 30px; }
  .ai-history-refresh .ai-section-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 17px;
    align-items: start;
    min-height: 0;
    background: #f8faf2;
    border: 1px solid #c5d3bf;
    border-radius: 4px;
    padding: 17px;
    color: #173d31;
    box-shadow: none;
    transform: none;
    transition: none;
  }
  .ai-history-refresh .ai-section-card::before,
  .ai-history-refresh .ai-section-card::after { display: none; }
  .ai-history-refresh .ai-section-card img {
    position: static;
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 3px;
    transform: none;
    filter: none;
    transition: none;
  }
  .ai-history-refresh .ai-section-card > span { display: block; min-height: 0; padding: 0; }
  .ai-history-refresh .ai-section-card small {
    display: block;
    font-size: .75rem;
    line-height: 1.5;
    letter-spacing: .025em;
    font-weight: 650;
    text-transform: none;
    color: #53714b;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  .ai-history-refresh .ai-section-card b {
    display: block;
    margin: 6px 0 9px;
    color: #173d31;
    font-size: 1.65rem;
    line-height: 1.08;
    text-shadow: none;
  }
  .ai-history-refresh .ai-section-card em {
    display: block;
    max-width: none;
    color: #526359;
    font-size: .875rem;
    line-height: 1.65;
    text-shadow: none;
  }
  .ai-history-refresh .ai-section-card i {
    margin-top: 10px;
    font-size: .75rem;
    line-height: 1.6;
    color: #1c6447;
  }
  .ai-history-refresh .ai-section-card:hover { border-color: #6f9466; background: #edf3e6; transform: none; box-shadow: none; }
  .ai-history-refresh .ai-section-card:focus-visible { outline: 3px solid #257262; outline-offset: 4px; box-shadow: none; transform: none; }
  body.ai-community-page .ai-role { letter-spacing: .035em; line-height: 1.55; }
  body.ai-community-page .ai-support-identity { gap: 12px; }
  body.ai-community-page .ai-logo-panel { max-width: 48%; flex-shrink: 1; }
  body.ai-community-page .ai-support-lane--infrastructure .ai-logo-panel { max-width: 50%; }
  body.ai-community-page .ai-hero-copy .eyebrow { font-size: .75rem; }
  body.ai-community-page .ai-direct-giving { padding-block: 36px; }
  body.ai-community-page .ai-card-body { padding: 22px; }
  body.ai-community-page .ai-resource-list { gap: 0 24px; }
}
@media (max-width: 620px) {
  body.ai-community-page .ai-giving-jump-links { grid-template-columns: minmax(0, 1fr); }
  body.ai-community-page .ai-giving-jump-links > a { padding: 16px 0; min-height: 79px; border-right: 0; }
}
@media (max-width: 430px) {
  .ai-section-links a { min-height: 48px; font-size: .75rem; padding-block: 7px; }
  body.ai-tools-page .ai-tool-index a { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; padding: 9px; font-size: .75rem; }
  body.ai-tools-page .ai-tool-index img { width: 28px; height: 28px; }
  .ai-history-refresh .ai-section-card { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 15px; }
  .ai-history-refresh .ai-section-card img { width: 64px; height: 72px; }
  .ai-history-refresh .ai-section-card b { font-size: 1.5rem; }
  body.ai-community-page .ai-support-identity { padding: 19px 20px; }
  body.ai-community-page .ai-role { max-width: 48%; font-size: .75rem; }
  body.ai-community-page .ai-card-body { padding: 21px 20px; }
  body.ai-community-page .donation-route-panel { padding: 16px; }
}
