.program-detail {
    --program-ink: #1e293b;
    --program-muted: #64748b;
    --program-border: #e2e8f0;
    --program-accent: #0f766e;
    --program-link: #365f91;
    padding: 24px 0 56px;
    background: #f8fafc;
    color: var(--program-ink);
    font-size: 14px;
    line-height: 1.65;
}
.program-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-bottom: 12px;
    color: #526174;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.program-detail__back:hover { color: var(--program-accent); }
.program-detail__hero,
.program-detail__panel,
.program-detail__action,
.program-detail__nav {
    border: 1px solid var(--program-border);
    border-radius: 12px;
    background: #fff;
}
.program-detail__hero { padding: 28px; margin-bottom: 24px; }
.program-detail__identity { display: flex; align-items: flex-start; gap: 20px; }
.program-detail__identity > div { min-width: 0; }
.program-detail__logo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 8px;
    border: 1px solid #edf1f5;
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}
.program-detail h1 {
    margin: 0 0 10px;
    font-size: clamp(24px, 2.7vw, 32px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}
.program-detail__description { max-width: 840px; margin: 0; color: var(--program-muted); }
.program-detail__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 22px;
    color: var(--program-muted);
    font-size: 12px;
}
.program-detail__meta strong { margin-left: 4px; color: #475569; font-weight: 500; white-space: nowrap; }
.program-detail__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #526174;
    font-size: 12px;
    font-weight: 600;
}
.program-detail__badge--accepting { background: #edf7f2; color: #24664d; }
.program-detail__badge--paused { background: #fff6e7; color: #855c1a; }
.program-detail__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0 0;
    padding-top: 20px;
    border-top: 1px solid #edf1f5;
}
.program-detail__stats > div + div { padding-left: 24px; border-left: 1px solid #edf1f5; }
.program-detail__stats dt { display: flex; align-items: center; gap: 7px; color: var(--program-muted); font-size: 12px; font-weight: 400; }
.program-detail__stats dd { margin: 5px 0 0; font-size: 24px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.program-detail__stat-hidden { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--program-muted); font-size: 18px; vertical-align: middle; }
.program-detail__layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; grid-template-areas: "body sidebar"; gap: 24px; align-items: start; }
.program-detail__body { grid-area: body; display: grid; gap: 20px; min-width: 0; }
.program-detail__sidebar { grid-area: sidebar; min-width: 0; height: 100%; }
.program-detail__sticky { position: sticky; top: calc(var(--header-height, 140px) + 20px); display: grid; gap: 16px; }
.program-detail__panel { min-width: 0; padding: 24px; }
.program-detail__panel p:last-child { margin-bottom: 0; }
.program-detail [id] { scroll-margin-top: calc(var(--header-height, 140px) + 20px); }
.program-detail__section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 20px; font-weight: 650; line-height: 1.35; }
.program-detail__panel > p { color: #526174; }
.program-detail__muted { color: var(--program-muted); }
.program-detail__action { padding: 22px; }
.program-detail__action-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 14px; border-radius: 9px; background: #edf7f5; color: var(--program-accent); font-size: 18px; }
.program-detail__action h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.4; font-weight: 650; }
.program-detail__action p { margin-bottom: 18px; color: var(--program-muted); font-size: 13px; line-height: 1.65; }
.program-detail__button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 12px; border: 1px solid #334155; border-radius: 8px; background: #334155; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.5; text-decoration: none; text-align: center; }
.program-detail__button:hover { background: #1e293b; color: #fff; }
.program-detail__notice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #f1f5f9; color: #526174; font-size: 12px; line-height: 1.6; }
.program-detail__rules-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; margin-top: 8px; color: #526174; font-size: 12px; text-decoration: none; }
.program-detail__rules-link:hover { color: var(--program-accent); }
.program-detail__nav { padding: 16px; }
.program-detail__nav h2 { margin: 0 8px 8px; color: var(--program-muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.program-detail__nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px; border-radius: 6px; color: #475569; font-size: 13px; font-weight: 500; line-height: 1.5; text-decoration: none; }
.program-detail__nav a > i:last-child { margin-left: auto; font-size: 10px; }
.program-detail__nav a:hover { background: #edf7f5; color: var(--program-accent); }
.program-detail__count { padding: 3px 8px; border-radius: 5px; background: #f1f5f9; color: #526174; font-size: 12px; font-weight: 600; }
.program-detail__table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--program-border); border-radius: 8px; }
.program-detail__table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.program-detail__table th, .program-detail__table td { padding: 12px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.program-detail__table th { font-weight: 500; }
.program-detail__table thead th { background: #f1f5f9; color: #526174; font-size: 12px; font-weight: 600; white-space: nowrap; }
.program-detail__table tbody tr:last-child > * { border-bottom: 0; }
.program-detail__table tbody tr:hover > * { background: #f8fafc; }
.program-detail__table td { font-variant-numeric: tabular-nums; }
.program-detail__leaderboard { min-width: 520px; }
.program-detail__leaderboard tr > :nth-child(n + 3) { text-align: right; white-space: nowrap; }
.program-detail__leaderboard tr > :first-child { width: 46px; }
.program-detail__rank { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 6px; color: var(--program-muted); font-size: 12px; }
.program-detail__rank--top { background: #edf7f5; color: #11665e; font-weight: 600; }
.program-detail__researcher { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.program-detail__researcher img { flex: 0 0 28px; border-radius: 50%; object-fit: cover; }
.program-detail__researcher > span { max-width: 190px; overflow-wrap: anywhere; }
.program-detail__rewards { min-width: 400px; }
.program-detail__rewards td { white-space: nowrap; }
.program-detail__rewards tr > :last-child { text-align: right; font-weight: 600; }
.program-detail__severity { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.program-detail__severity--critical { background: #fbeef0; color: #9b354c; }
.program-detail__severity--high { background: #fff3e8; color: #9a571d; }
.program-detail__severity--medium { background: #fff8e6; color: #84651a; }
.program-detail__severity--low { background: #edf7f2; color: #24664d; }
.program-detail__rule { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--program-border); border-radius: 8px; }
.program-detail__rule + .program-detail__rule { margin-top: 12px; }
.program-detail__rule > i { font-size: 18px; }
.program-detail__rule--allowed > i { color: #2b8060; }
.program-detail__rule--forbidden > i { color: #b55160; }
.program-detail__rule h3 { margin: 2px 0 6px; font-size: 14px; font-weight: 600; }
.program-detail__rule p { margin: 0; color: #526174; font-size: 13px; }
.program-detail__empty { padding: 24px 12px; text-align: center; color: var(--program-muted); }
.program-detail__empty > i { display: inline-block; margin-bottom: 12px; font-size: 24px; }
.program-detail__empty h3 { font-size: 15px; color: #475569; }
.program-detail__empty p { max-width: 360px; margin: 8px auto 0; font-size: 13px; }

/* Stored program policies keep their content and use the same page typography. */
.program-detail__content { min-width: 0; color: #475569; overflow-wrap: anywhere; }
.program-detail__content .program-section { padding-top: 0; }
.program-detail__content .program-section + .program-section { margin-top: 28px; }
.program-detail__content :is(h2, h3, h4, .section-title) { color: var(--program-ink); font-size: 20px; line-height: 1.4; font-weight: 650; margin: 24px 0 14px; }
.program-detail__content :is(h3, h4) { font-size: 17px; }
.program-detail__content .section-title { padding-bottom: 12px; border-bottom-color: var(--program-border); }
.program-detail__content > :first-child,
.program-detail__content .program-section > :first-child { margin-top: 0; }
.program-detail__content p, .program-detail__content li { font-size: 14px; line-height: 1.75; }
.program-detail__content li + li { margin-top: 5px; }
.program-detail__content :is(ul, ol) { padding-left: 22px; }
.program-detail__content a { color: var(--program-link); text-underline-offset: 3px; }
.program-detail__content :is(img, video, iframe) { max-width: 100%; }
.program-detail__content img { height: auto; }
.program-detail code { color: #0f766e; overflow-wrap: anywhere; }
.program-detail__content table code { color: inherit; }
.program-detail__content pre { max-width: 100%; padding: 16px; border-radius: 8px; background: #f1f5f9; overflow-x: auto; }
.program-detail__content blockquote { padding: 12px 16px; border-left: 3px solid #9bc7bf; background: #f8fafc; }
.program-detail__content table { width: 100%; font-size: 13px; border-collapse: collapse; }
.program-detail__content table:not(.table) { display: block; overflow-x: auto; }
.program-detail__content th, .program-detail__content td { padding: 10px 12px; border: 1px solid var(--program-border); vertical-align: top; }
.program-detail__content thead th { background: #f1f5f9; color: #475569; font-weight: 600; }

/* These selectors also override the historical styles stored inside scope HTML. */
.program-detail :is(#scope, #scope-en).bb-scope {
    --bb-accent: #475569;
    --bb-accent-2: #526174;
    --bb-bg: #f8fafc;
    --bb-muted: #64748b;
    --bb-success: #24664d;
    --bb-warning: #a47826;
    --bb-danger: #a54455;
    --bb-radius: 8px;
    --bb-shadow: none;
}
.program-detail :is(#scope, #scope-en) .bb-card { padding: 18px; margin-bottom: 18px; border-color: var(--program-border); background: #fff; box-shadow: none; }
.program-detail :is(#scope, #scope-en) .bb-card.gradient { background: #f8fafc; border-color: var(--program-border); }
.program-detail :is(#scope, #scope-en) .section-title { margin: 0 0 14px; font-size: 20px; }
.program-detail :is(#scope, #scope-en) .section-title .bb-dot { width: 7px; height: 7px; flex-basis: 7px; box-shadow: none; }
.program-detail :is(#scope, #scope-en) .bb-lead { font-size: 14px; line-height: 1.75; color: #475569; }
.program-detail :is(#scope, #scope-en) .bb-h2 { font-size: 17px; font-weight: 650; color: var(--program-ink); }
.program-detail :is(#scope, #scope-en) .bb-timeline::before { background: #d4e6e2; }
.program-detail :is(#scope, #scope-en) .bb-timeline li::before { box-shadow: 0 0 0 3px #edf7f5; }
.program-detail :is(#scope, #scope-en) .bb-callout { border-left-width: 3px; background: #f8fafc; }
.program-detail :is(#scope, #scope-en) .bb-callout .title { color: #334155; }
.program-detail :is(#scope, #scope-en) .table { min-width: 440px; margin-bottom: 0; border-radius: 0; font-size: 13px; }
.program-detail :is(#scope, #scope-en) .table th,
.program-detail :is(#scope, #scope-en) .table td { padding: 10px 12px; border-color: var(--program-border); }
.program-detail :is(#scope, #scope-en) .table thead th { background: #f1f5f9; color: #475569; border-bottom-color: var(--program-border); }
.program-detail :is(#scope, #scope-en) .table tbody tr:nth-child(even) { background: #f8fafc; }
.program-detail :is(#scope, #scope-en) .table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--program-border); border-radius: 8px; }
.program-detail :is(#scope, #scope-en) a { color: var(--program-link); border-bottom-color: #b8c9dd; }
.program-detail__content a:hover,
.program-detail :is(#scope, #scope-en) a:hover { color: #24476f; border-bottom-color: #24476f; }
.program-detail :is(#scope, #scope-en) .bb-badge { border-radius: 5px; font-size: 11px; }
.program-detail :is(#scope, #scope-en) .bb-caption { font-size: 12px; }
.program-detail a:focus-visible,
.program-detail [tabindex="0"]:focus-visible { outline: 3px solid #0f766e; outline-offset: 3px; }

@media (max-width: 1199.98px) {
    .program-detail__layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
    .program-detail__panel { padding: 20px; }
    .program-detail__action { padding: 18px; }
}
@media (max-width: 991.98px) {
    .program-detail__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sidebar" "body"; }
    .program-detail__sticky { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .program-detail__action-icon { display: none; }
    .program-detail__nav a { min-height: 44px; }
}
@media (max-width: 767.98px) {
    .program-detail { padding: 16px 0 36px; }
    .program-detail__hero { padding: 20px; margin-bottom: 16px; }
    .program-detail__identity { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px 12px; }
    .program-detail__identity > div { display: contents; }
    .program-detail__logo { width: 48px; height: 48px; flex-basis: 48px; padding: 5px; border-radius: 9px; }
    .program-detail h1 { margin: 0; font-size: 24px; }
    .program-detail__description { grid-column: 1 / -1; margin: 0; }
    .program-detail__meta { gap: 10px 14px; margin-top: 16px; }
    .program-detail__meta .program-detail__badge { margin-right: 100%; white-space: nowrap; }
    .program-detail__stats { gap: 8px; margin-top: 18px; padding-top: 16px; }
    .program-detail__stats > div + div { padding-left: 10px; }
    .program-detail__stats dt { display: block; font-size: 11px; }
    .program-detail__stats dt > i { display: none; }
    .program-detail__stats dd { font-size: 22px; }
    .program-detail__sticky { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .program-detail__action h2 { font-size: 17px; }
    .program-detail__button, .program-detail__back, .program-detail__rules-link { min-height: 44px; }
    .program-detail__nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
    .program-detail__nav h2 { display: none; }
    .program-detail__nav a { padding: 8px; font-size: 12px; }
    .program-detail__nav a > i:last-child { display: none; }
    .program-detail__panel { padding: 18px; }
    .program-detail__section-title { font-size: 18px; }
    .program-detail :is(#scope, #scope-en) .bb-card { padding: 14px; }
    .program-detail :is(#scope, #scope-en) .section-title { font-size: 18px; }
}
