/* Keep the original masthead and six tabs; fit desktop labels without wrapping. */
@media (min-width: 768px) {
  header > div:has(> #nav-tabs) { column-gap: 1.25rem; }
  header > div:has(> #nav-tabs) > :first-child,
  header > div:has(> #nav-tabs) > :last-child,
  #nav-tabs > button { flex-shrink: 0; white-space: nowrap; }
  header > div:has(> #nav-tabs) > :first-child > span:nth-child(2) { display: none; }
  #nav-tabs { gap: clamp(.75rem, 1.4vw, 1.75rem); font-size: .875rem; }
  #nav-tabs > button { margin-inline: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  header > div:has(> #nav-tabs) {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    padding-block: .875rem .375rem;
    row-gap: .5rem;
  }
  #nav-tabs { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; }
}
@media (min-width: 1350px) {
  header > div:has(> #nav-tabs) > :first-child > span:nth-child(2) {
    display: inline-block;
    max-width: 8.5rem;
    white-space: normal;
  }
}

/* Align the six desktop columns without changing overlay or mobile widths. */
@media (min-width: 1024px) {
  main > .tab-pane > .mx-auto { max-width: 1152px; }

  #biz-articles-stream .biz-article-item,
  #supply-articles-stream .supply-report-item { gap: 2rem; }
  :is(#biz-articles-stream, #supply-articles-stream) article > a {
    width: clamp(11rem, 16vw, 14rem);
    height: auto;
    aspect-ratio: 16 / 10;
  }

  #leaders-card-grid { gap: 1.5rem; }
  #leaders-card-grid .leader-card { padding: 1.5rem; }
  #leaders-card-grid h3 { white-space: normal; }
  #leaders-card-grid .leader-card p { font-size: .8125rem; }

  #timeline-list { padding-left: 2.5rem; }
  #timeline-list .timeline-row > span:first-child { left: -47px; }
  #timeline-list .timeline-row > div > p { max-width: 78ch; }

  #industry-news-container > article,
  #github-feed-container > article { padding: 1.5rem 1.75rem; }
  :is(#industry-news-container, #github-feed-container) article > p {
    max-width: 100ch;
    line-height: 1.75;
  }
  #github-feed-container article > div:last-child {
    flex-wrap: wrap;
    gap: .625rem 1rem;
  }
}

@media (min-width: 1024px) {
  main.article-page {
    box-sizing: content-box;
    width: auto;
    max-width: 1088px;
    align-self: stretch;
    margin-inline: max(32px, calc((100% - 1088px) / 2));
    padding-inline: 0;
  }
}

.profile-summary { margin: 1rem 0; color: #444; line-height: 1.7; }
.profile-note { margin-top: .6rem; color: #666; font-size: .75rem; }
.profile-ledger { margin-top: 1.25rem; }
.profile-ledger h4 { gap: .75rem; }
.profile-career { border-block: 1px solid #ececec; padding-block: 1.25rem; }
.profile-career h2 { font-weight: 700; margin-bottom: .75rem; }
.profile-career li { display: grid; grid-template-columns: 4rem 1fr; gap: .5rem; padding-block: .35rem; font-size: .875rem; }
.profile-career p { margin-top: .75rem; font-size: .75rem; }
.profile-career a { color: #007acc; text-decoration: underline; }
@media (min-width: 1024px) {
  .profile-overview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
  .profile-ledger { margin-top: 0; padding: 1.25rem; border: 1px solid #ececec; }
  .profile-ledger h4 { padding-bottom: .75rem; font-size: .8125rem; }
  .profile-ledger > div > div { padding: .875rem; overflow-wrap: anywhere; }
}

.book-heading { font-weight: 700; padding-bottom: .75rem; border-bottom: 1px solid #ececec; }
.book-card { display: flex; gap: 1.25rem; align-items: center; padding: 1rem; border: 1px solid #ececec; }
.book-card:hover, .book-card:focus-visible { border-color: #111; }
.book-cover { flex: none; width: 92px; height: 138px; object-fit: contain; background: #fafafa; }
.book-card h3 { font-size: 1rem; font-weight: 700; }
.book-card h3 span { margin-inline-start: .4rem; }
.book-card p { margin-top: .375rem; font-size: .875rem; color: #666; }
.book-action { display: inline-block; margin-top: .6rem; font-size: .8125rem; color: #006eb7; }

:root {
  --selected-fill: #ff6b6b;
  --selected-ink: #9b2156;
  --selected-line: #e7a1bf;
}
.filter-group-label { display: none; }

@media (min-width: 1024px) {
  .tab-pane > .mx-auto > header:first-child {
    display: block;
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #ececec;
  }
  .tab-pane > .mx-auto > header:first-child h1 {
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-block: .75rem;
  }
  .tab-pane > .mx-auto > header:first-child p {
    max-width: 48rem;
    margin-inline: auto;
    font-size: .9375rem;
    line-height: 1.65;
    color: #666;
  }
  #tab-section-news header > div > .flex { justify-content: center; }
  :is(#news-time-filters, #gh-time-filters) { justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
  #timeline-filters { gap: .5rem; }
  .filter-group-label { display: inline-block; min-width: 4.5rem; color: #666; font-weight: 600; }
  .tab-pane :is(.biz-scale-btn, .supply-tab-btn, .track-btn, .entity-btn, .timeline-filter-btn, .ind-time-btn, .ind-cat-btn, .gh-time-btn, .gh-cat-btn) {
    min-height: 34px;
    padding: .35rem .875rem;
    border: 1px solid #dedee3;
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-weight: 500;
    box-shadow: none;
  }
  .tab-pane :is(.biz-scale-btn, .supply-tab-btn, .track-btn, .entity-btn, .timeline-filter-btn, .ind-time-btn, .ind-cat-btn, .gh-time-btn, .gh-cat-btn):hover {
    background: #fff8fb;
    border-color: var(--selected-line);
  }
  .tab-pane :is(.biz-scale-btn, .supply-tab-btn, .track-btn, .entity-btn, .ind-cat-btn, .gh-cat-btn).active,
  .tab-pane :is(.timeline-filter-btn, .ind-time-btn, .gh-time-btn).border-black {
    background: var(--selected-fill);
    border-color: var(--selected-fill);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  }
  #nav-tabs .nav-btn[aria-pressed="true"] { color: var(--selected-ink); }
  #nav-tabs .nav-btn[aria-pressed="true"] .tab-indicator { background: var(--selected-ink); }
}

@media (min-width: 1024px) {
  .news-categories { justify-content: center; }
  :is(#industry-news-container, #github-feed-container) { margin-top: 1.5rem; }
  #industry-news-container .ind-news-item {
    margin-top: 0;
    padding: 1.5rem 0;
  }
  #industry-news-container .ind-news-item h2 { font-size: 1.375rem; }
  #industry-news-container .ind-news-item p { max-width: 56rem; }
  #news-empty { padding: 1rem 0; }
}

.project-grid { display: grid; gap: 1rem; }
.project-name { overflow-wrap: anywhere; }
.project-card {
  position: relative;
  padding: 1.125rem 1.25rem;
  border: 1px solid #ececec;
}
.project-card:hover, .project-card:focus-within { border-color: var(--selected-line); }
.project-card > * + * { margin-top: .5rem; }
.project-card-link { display: inline-block; }
.project-card-link::after { content: ""; position: absolute; inset: 0; }
#github-empty { grid-column: 1 / -1; }
@media (min-width: 1024px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
