/* Homepage only. Shared editorial pages retain their existing design. */
body[data-page-type="home"] {
  --bg: #f5f5f2; --surface: #fff; --surface-2: #f7f8f5; --surface-3: #edf0ea;
  --tx: #202824; --tx-2: #4c5952; --tx-3: #626e67; --line: #e0e5df;
  --maxw: 1280px; --side-w: 200px; --r3: 10px;
  --home-green: #225842; --home-green-bg: #f1f6f2;
}
html[data-theme="dark"] body[data-page-type="home"] {
  --bg: #151b18; --surface: #1d2520; --surface-2: #242e27; --surface-3: #2c382f;
  --tx: #e7eee9; --tx-2: #c5d0c8; --tx-3: #a0b1a5; --line: #35443a;
  --home-green: #a4d4b3; --home-green-bg: #20342a;
}
@media(prefers-color-scheme:dark) {
  html[data-theme="auto"] body[data-page-type="home"] {
    --bg: #151b18; --surface: #1d2520; --surface-2: #242e27; --surface-3: #2c382f;
    --tx: #e7eee9; --tx-2: #c5d0c8; --tx-3: #a0b1a5; --line: #35443a;
    --home-green: #a4d4b3; --home-green-bg: #20342a;
  }
}
body[data-page-type="home"] .hdr-in { gap: 24px; }
body[data-page-type="home"] .hact { flex: 1; justify-content: flex-end; }
body[data-page-type="home"] .search { order: -1; flex: 0 1 250px; min-width: 130px; }
body[data-page-type="home"] .search input { width: 100%; min-height: 42px; }
.home-controls { display: flex; align-items: center; gap: 8px; }
.home-icon-button { display: none; }
body[data-page-type="home"] .subbar-in { justify-content: flex-start; gap: 24px; }
body[data-page-type="home"] .dates { overflow: visible; flex: 0 1 auto; height: auto; padding-right: 0; mask-image: none; -webkit-mask-image: none; }
.home-date { display: flex; align-items: center; gap: 12px; color: var(--tx-3); font-size: 13px; }
.home-date select, .home-category { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--tx); padding: 10px 12px; min-height: 44px; font: inherit; max-width: 100%; }
.home-date select { border-color: var(--ac); color: var(--ac); }
body[data-page-type="home"] .cols { grid-template-areas: 'side highlights' 'side feed'; grid-template-rows: auto 1fr; column-gap: 24px; row-gap: 24px; }
body[data-page-type="home"] .side { grid-area: side; }
body[data-page-type="home"] #hl { grid-area: highlights; margin: 0; }
body[data-page-type="home"] #feed { grid-area: feed; min-width: 0; }
body[data-page-type="home"] .hl-hd h2 { font-size: 18px; }
body[data-page-type="home"] .hl-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
body[data-page-type="home"] .hl-list li { font-size: 15px; }
.hl:not(.hl-expanded) .hl-list li { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hl:not(.hl-expanded) .hl-list li:nth-child(n+4) { display: none; }
.home-text-button { border: 0; background: transparent; color: var(--ac); padding: 10px 0; min-height: 44px; font: inherit; font-size: 13px; cursor: pointer; text-underline-offset: 4px; }
.home-text-button:hover { text-decoration: underline; }
.hl .home-text-button { display: block; margin-left: auto; padding-bottom: 0; }
body[data-page-type="home"] .sec { margin-bottom: 28px; }
body[data-page-type="home"] .item { border: 1px solid var(--line); border-radius: 0; margin: 0; box-shadow: none; border-left: 1px solid var(--line); }
body[data-page-type="home"] .item + .item { border-top: 0; }
body[data-page-type="home"] .sec-hd + .item { border-radius: 10px 10px 0 0; }
body[data-page-type="home"] .item:last-child { border-radius: 0 0 10px 10px; }
body[data-page-type="home"] .ihead { display: grid; grid-template-columns: minmax(0,1fr) 18px; gap: 10px; padding: 16px 20px; }
body[data-page-type="home"] .ittl { grid-column: 1; grid-row: 1; font-size: 16px; line-height: 1.65; }
body[data-page-type="home"] .chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
body[data-page-type="home"] .imetro { grid-column: 1; grid-row: 2; flex-wrap: wrap; }
body[data-page-type="home"] .imetro .src { display: inline; white-space: normal; }
body[data-page-type="home"] .isum { font-size: 16px; line-height: 1.8; }
body[data-page-type="home"] .tool-card { background: var(--home-green-bg); border-color: var(--line); margin: 28px 0; }
body[data-page-type="home"] .tool-card-tag { color: var(--home-green); font-weight: 700; font-size: 17px; }
body[data-page-type="home"] .tool-card > .tool-card-title { display: none; }
body[data-page-type="home"] .tool-grid > section { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: 8px; }
body[data-page-type="home"] .tool-card-cta { background: var(--home-green); color: var(--bg); border-color: var(--home-green); min-height: 44px; }
body[data-page-type="home"] .archive { margin-top: 28px; }
body[data-page-type="home"] .archive-intro { font-size: 13px; }
body[data-page-type="home"] .arch-list { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
body[data-page-type="home"] .arch-list li { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; margin: 0; padding: 12px 16px; }
body[data-page-type="home"] .arch-list li:last-child { border-bottom: 0; }
.archive.home-compact:not(.home-all) .arch-list li:nth-child(n+6) { display: none; }
body[data-page-type="home"] .support-links .arch-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-page-type="home"] .support-links li a { line-height: 1.7; font-size: 15px; }
body[data-page-type="home"] .mobbar { display: none; }
body[data-page-type="home"] .home-top { position: fixed; right: 20px; bottom: 20px; width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--tx); z-index: 50; box-shadow: var(--sh2); cursor: pointer; }
.home-category { display: none; }
.home-side-stack { display: contents; }
body[data-page-type="home"] .ftr { padding-top: 20px; padding-bottom: 20px; }
.home-footer-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 16px; margin-bottom: 6px; }
body[data-page-type="home"] .home-footer-meta .analytics-settings-button { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: inherit; font: inherit; line-height: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
body[data-page-type="home"] :is(button,a,select,input,summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media(max-width:1199px) {
  body[data-page-type="home"] .cols { grid-template-columns: minmax(0,1fr); grid-template-areas: 'highlights' 'side' 'feed'; }
  body[data-page-type="home"] .side { position: static; display: flex; flex-wrap: wrap; gap: 8px; align-items: start; }
  body[data-page-type="home"] #tocCard { flex: 1 1 210px; border: 0; background: transparent; box-shadow: none; }
  body[data-page-type="home"] #tocCard .card-hd, body[data-page-type="home"] .home-category ~ .toc { display: none; }
  .home-category { display: block; width: 100%; }
  .home-side-panel { position: relative; }
  .home-side-panel > summary { list-style: none; cursor: pointer; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; }
  .home-side-panel > .card { position: absolute; z-index: 30; right: 0; top: 50px; width: min(300px,80vw); box-shadow: var(--sh2); }
  .home-side-panel > .card .card-hd { display: none; }
  body[data-page-type="home"] .hdr-in { flex-wrap: nowrap; }
  body[data-page-type="home"] .brand { flex: 0 1 auto; }
  body[data-page-type="home"] .bsub { display: none; }
  body[data-page-type="home"] .hact { order: initial; flex: 1; }
  body[data-page-type="home"] .home-controls { display: none; position: absolute; right: 16px; top: calc(100% + 4px); padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh2); flex-direction: column; align-items: stretch; min-width: 210px; }
  body[data-page-type="home"] .home-controls.is-open { display: flex; }
  .home-menu-toggle { display: inline-grid; }
  .home-icon-button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--tx); width: 44px; height: 44px; place-items: center; flex: none; cursor: pointer; }
  .home-controls .hmenu .hm-pop { position: static; box-shadow: none; min-width: 0; }
}
@media(min-width:1200px) {
  .home-side-panel > summary { display: none; }
  /* Only the right column determines row height. Short reports scroll the sidebar. */
  body[data-page-type="home"] .side.home-side-layout { position: relative; top: auto; align-self: stretch; min-height: 0; }
  .home-side-stack { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; scrollbar-width: thin; }
  .home-side-stack > * { flex-shrink: 0; }
  body[data-page-type="home"] .side .archive { display: flex; flex-direction: column; flex: 1 0 220px; min-height: 220px; margin: 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
  body[data-page-type="home"] .side .archive-hd { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; }
  body[data-page-type="home"] .side .archive-hd h2 { font-size: 15px; }
  body[data-page-type="home"] .side .archive-hd .n { margin-left: 0; font-size: 11px; }
  body[data-page-type="home"] .side .archive-intro { display: none; }
  body[data-page-type="home"] .side .arch-list { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  body[data-page-type="home"] .side .arch-list li { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 8px; }
  body[data-page-type="home"] .side .arch-list .d { font-size: 12px; }
  body[data-page-type="home"] .side .arch-list .n { font-size: 11px; }
  body[data-page-type="home"] .side .arch-list .langs { width: 100%; margin: 0; flex-wrap: wrap; gap: 4px; }
  body[data-page-type="home"] .side .arch-list .langs a { font-size: 11px; padding: 4px; }
  body[data-page-type="home"] .side .archive.home-compact .arch-list li:nth-child(n+6) { display: flex; }
  body[data-page-type="home"] .side .archive > .home-text-button { display: none; }
  body[data-page-type="home"] .side .arch-all { margin: 10px 0 0; font-size: 12px; }
  /* A taller sidebar scrolls with the page so both tool links stay reachable. */
  body[data-page-type="home"] .side { position: static; }
  body[data-page-type="home"] .side .tool-card { margin: 0; padding: 14px; }
  body[data-page-type="home"] .side .tool-card-tag { font-size: 15px; }
  body[data-page-type="home"] .side .tool-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  body[data-page-type="home"] .side .tool-grid > section { padding: 0; background: transparent; border: 0; border-radius: 0; }
  body[data-page-type="home"] .side .tool-grid > section + section { border-top: 1px solid var(--line); padding-top: 16px; }
  body[data-page-type="home"] .side .tool-card-title { font-size: 15px; line-height: 1.55; }
  body[data-page-type="home"] .side .tool-card-desc { font-size: 12px; line-height: 1.7; }
  body[data-page-type="home"] .side .tool-card-cta { display: flex; justify-content: center; padding: 9px 8px; font-size: 12px; white-space: normal; }
}
body[data-page-type="home"] .home-source-note { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; max-width: 1000px; margin: 6px auto 0; }
body[data-page-type="home"] .home-source-note .lg { display: block; font-size: 12px; color: var(--tx-3); line-height: 1.8; }
body[data-page-type="home"] .home-source-note .lgd { display: none; }
body[data-page-type="home"] .home-source-note .lg b { font-weight: 400; }
@media(max-width:767px) {
  body[data-page-type="home"] .hdr-in { padding: 10px 16px; gap: 8px; }
  body[data-page-type="home"] .bname { font-size: 15px; }
  body[data-page-type="home"] .bmark, body[data-page-type="home"] .bmark svg { width: 30px; height: 30px; }
  body[data-page-type="home"] .brand { gap: 8px; }
  body[data-page-type="home"] .hact { flex: 0 0 auto; margin-left: auto; }
  body[data-page-type="home"] .search { display: none; position: absolute; top: 100%; left: 16px; right: 16px; background: var(--surface); padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
  body[data-page-type="home"] .search.is-open { display: block; }
  body[data-page-type="home"] .search .ico { left: 20px; }
  .home-search-toggle { display: inline-grid; }
  body[data-page-type="home"] .subbar { position: static; }
  body[data-page-type="home"] .subbar-in { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  body[data-page-type="home"] .tabs { flex: 1 1 100%; min-width: 0; }
  body[data-page-type="home"] .tab { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 44px; white-space: normal; flex-wrap: wrap; gap: 3px; }
  body[data-page-type="home"] .dates { width: 100%; }
  .home-date { justify-content: flex-start; width: 100%; }
  body[data-page-type="home"] .wrap { padding: 16px 16px 40px; }
  body[data-page-type="home"] .hl { padding: 16px; }
  body[data-page-type="home"] .hl-hd .cnt { width: 100%; margin-left: 0; }
  body[data-page-type="home"] .hl-list li { font-size: 14px; }
  body[data-page-type="home"] .ihead { padding: 14px; }
  body[data-page-type="home"] .support-links .arch-list { grid-template-columns: minmax(0,1fr); }
  body[data-page-type="home"] .tool-grid { grid-template-columns: minmax(0,1fr); }
  body[data-page-type="home"] .arch-list .langs { width: auto; margin-left: auto; flex-wrap: wrap; }
  body[data-page-type="home"] .has-analytics-settings { padding-bottom: 24px; }
}
