.entry-shell { max-width: 1180px; margin: 0 auto; padding: 40px 32px 72px; }
.entry-shell h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; letter-spacing: -.035em; margin: 0 0 10px; }
.entry-shell h2 { font-size: 23px; font-weight: 650; letter-spacing: -.025em; }
.entry-shell h3 { font-size: 18px; font-weight: 650; margin: 0 0 8px; }
.entry-shell p, .entry-drawer p { line-height: 1.55; }
.entry-heading, .entry-heading-row { margin-bottom: 30px; }
.entry-heading p, .entry-heading-row p, .home-heading p { color: var(--bgt-color-text-muted); }
.entry-heading-row { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.app-primary-nav { display: flex; flex-wrap: wrap; gap: 24px; align-self: stretch; align-items: center; }
.app-primary-nav a { color: var(--bgt-color-text-muted); text-decoration: none; font-weight: 600; padding: 20px 0 16px; border-bottom: 3px solid transparent; }
.app-primary-nav a.active { color: var(--bgt-color-primary); border-color: var(--bgt-color-primary); }
.entry-text-link { color: var(--bgt-color-primary); font-weight: 600; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.entry-text-link:hover .entry-link-label, .entry-text-link:focus-visible .entry-link-label { text-decoration: underline; text-underline-offset: 4px; }
.home-heading { padding: 10px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: center; gap: 32px; }
.home-table-illustration { width: 100%; height: 166px; object-fit: contain; }
.home-heading p { font-size: 18px; }
.continue-strip { display: flex; align-items: center; gap: 24px; background: #eaf2e9; border: 1px solid var(--bgt-color-border); border-top: 3px solid var(--bgt-color-primary); border-radius: 8px; padding: 22px 24px; margin: 8px 0 42px; }
.continue-strip h2 { margin: 0; padding-right: 24px; border-right: 1px solid var(--bgt-color-border-strong); font-size: 20px; }
.continue-context { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.continue-context strong { font-size: 20px; }
.continue-context p { margin: 4px 0 0; color: var(--bgt-color-text-muted); overflow-wrap: anywhere; }
.continue-strip .entry-text-link { white-space: nowrap; }
.shortcut-pair { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--bgt-color-border); border-bottom: 1px solid var(--bgt-color-border); margin-top: 22px; }
.home-shortcut { display: flex; align-items: center; gap: 20px; color: var(--bgt-color-text); text-decoration: none; padding: 28px 24px; }
.home-shortcut:first-child { border-right: 1px solid var(--bgt-color-border); }
.home-shortcut .bgt-icon { color: var(--bgt-color-primary); flex-shrink: 0; }
.home-shortcut h3 { font-size: 22px; margin: 0 0 6px; }
.home-shortcut p { color: var(--bgt-color-text-muted); margin: 0; }
.home-shortcut > span { margin-left: auto; font-size: 25px; }
.home-shortcut:hover, .home-shortcut-ready { background: #edf2e9; }
.home-secondary { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-top: 32px; }
.entry-import-button { display: inline-flex; position: relative; align-items: center; border: 1px solid var(--bgt-color-primary); border-radius: 5px; color: var(--bgt-color-primary); padding: 10px 18px; font-weight: 600; min-height: 44px; cursor: pointer; }
.entry-import-button input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.entry-import-button input::file-selector-button { cursor: pointer; }
.entry-import-button:focus-within { outline: 2px solid var(--bgt-color-primary); outline-offset: 3px; }
.entry-filters { display: flex; align-items: end; gap: 18px; margin: 24px 0; }
.entry-filters > div:first-child { flex: 1; }
.entry-filters label { display: block; font-size: 13px; font-weight: 600; color: var(--bgt-color-text-muted); margin-bottom: 6px; }
.entry-filters .bgt-select-field { min-width: 170px; }
.entry-filters .bgt-select-trigger, .entry-filters .bgt-input, .entry-filters > .bgt-button { min-height: 44px; }
.entry-secondary { color: var(--bgt-color-text-muted); font-size: 14px; }
.game-highlights { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin: 30px 0; }
.game-highlight { display: grid; grid-template-columns: minmax(0,1fr) 160px; gap: 20px; padding: 24px; background: var(--bgt-color-surface-muted); border: 1px solid var(--bgt-color-border); border-radius: 9px; }
.game-highlight:only-child { max-width: 650px; }
.game-highlight h2 { margin: 0 0 10px; }
.game-highlight > a { grid-column: 1/-1; justify-self: end; }
.game-artwork { width: 78px; height: 72px; flex-shrink: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--bgt-color-primary); background: transparent; overflow: hidden; }
.game-artwork img { width: 100%; height: 100%; object-fit: contain; }
.game-highlight .game-artwork { width: 160px; height: 156px; }
.game-list-row, .local-game-row { display: flex; align-items: center; gap: 20px; padding: 18px 10px; width: 100%; border: 0; border-bottom: 1px solid var(--bgt-color-border); background: transparent; text-align: left; color: var(--bgt-color-text); text-decoration: none; }
.game-list-row > div:not(.game-artwork), .local-game-row > div:not(.game-artwork) { min-width: 0; flex: 1; }
.game-list-row h2, .local-game-row h2 { font-size: 20px; margin: 0 0 6px; overflow-wrap: anywhere; }
.game-list-row p, .local-game-row p { margin: 0; }
.game-list-row:hover, .local-game-row:hover, .local-game-row.is-selected { background: #eaf1e7; }
.game-list-row > span, .local-game-row > span { font-size: 24px; margin-inline: 8px 12px; }
.game-facts, .game-mechanics { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--bgt-color-text-muted); font-size: 13px; margin: 10px 0; }
.game-mechanics span { padding: 3px 8px; border-radius: 20px; background: #e6ece1; }
.game-detail-heading { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 50px; margin: 32px 0 40px; }
.game-detail-heading .game-artwork { width: 300px; height: 260px; }
.game-detail-heading small { color: var(--bgt-color-text-muted); display: block; margin-top: 8px; }
.pack-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.pack-section-heading h2 { margin: 0; font-size: 20px; }
.pack-row { display: flex; align-items: start; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--bgt-color-border); }
.pack-row > div:first-of-type { min-width: 0; flex: 1; }
.pack-row > .bgt-icon { color: var(--bgt-color-primary); flex-shrink: 0; margin-top: 4px; }
.pack-row p { margin: 6px 0; }
.pack-row h3 { overflow-wrap: anywhere; }
.pack-row-actions { display: flex; flex-direction: column; align-items: end; align-self: stretch; justify-content: space-between; gap: 24px; }
.pack-description { white-space: pre-line; overflow-wrap: anywhere; }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 24px 0; }
.pack-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--bgt-color-border); border-radius: 9px; background: var(--bgt-color-surface); min-width: 0; }
.pack-card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--bgt-color-primary); }
.pack-card-heading .audience-label { color: var(--bgt-color-text-muted); margin: 0; }
.pack-card h3 { font-size: 21px; overflow-wrap: anywhere; }
.pack-card-summary { margin: 6px 0 16px; overflow-wrap: anywhere; }
.pack-card-includes { padding-left: 18px; margin: 0 0 16px; color: var(--bgt-color-text-muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.pack-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; margin-top: auto; border-top: 1px solid var(--bgt-color-border); }
.pack-filters { flex-wrap: wrap; }
.pack-filters > div:first-child { min-width: 200px; }
.game-expansions { padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--bgt-color-border); }
.game-expansions summary { color: var(--bgt-color-text-muted); cursor: pointer; }
.game-expansions li { margin-top: 12px; }
.game-expansions p { margin: 4px 0; white-space: pre-line; }
.entry-drawer.bgt-dialog-content { position: fixed; inset: 0 0 0 auto; transform: none; width: min(560px, 95vw); max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 30px; overflow-y: auto; }
.entry-drawer .bgt-dialog-header { padding-right: 80px; }
.entry-drawer-close { position: absolute; right: 18px; top: 22px; }
.entry-drawer .bgt-dialog-body { padding: 12px 0 0; }
.entry-drawer h2 { font-size: 26px; margin: 14px 0; }
.entry-drawer h3 { font-size: 17px; font-weight: 650; margin: 20px 0 8px; }
.entry-drawer .pack-row h3 { margin: 0 0 8px; }
.entry-drawer .local-pack-row { gap: 14px; }
.entry-drawer .local-pack-row .bgt-select { margin: 12px 0; }
.pack-detail-action { padding-top: 28px; }
.pack-details details { border-top: 1px solid var(--bgt-color-border); padding-top: 16px; }
.pack-details details summary { cursor: pointer; color: var(--bgt-color-primary); padding: 8px 0; }
.pack-details dt { font-size: 13px; color: var(--bgt-color-text-muted); margin-top: 12px; }
.pack-details dd { margin: 2px 0; }
.artifact-hash { overflow-wrap: anywhere; font-size: 13px; }
.audience-label { margin-left: 10px; border: 1px solid var(--bgt-color-border); border-radius: 4px; padding: 2px 6px; font-size: 13px; }
.device-presence { color: var(--bgt-color-primary); font-weight: 600; }
.library-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; }
.entry-empty { padding: 35px 0; }
@media(max-width: 850px) {
 .home-heading { grid-template-columns: minmax(0,1fr) 220px; gap: 18px; }
 .home-table-illustration { height: 130px; }
 .pack-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .app-library-header { flex-wrap: wrap; gap: 12px; padding: 12px 24px; }
 .app-primary-nav { order: 3; width: 100%; gap: 22px; }
 .app-primary-nav a { padding: 8px 0; }
 .entry-shell { padding: 28px 22px 60px; }
 .game-highlights { grid-template-columns: 1fr; }
 .continue-strip { flex-wrap: wrap; gap: 18px; }
 .continue-context { flex-basis: 65%; }
 .game-detail-heading { grid-template-columns: minmax(0,1fr) 200px; gap: 24px; }
 .game-detail-heading .game-artwork { width: 200px; height: 200px; }
}
@media(max-width: 580px) {
 .home-heading { grid-template-columns: 1fr; gap: 0; }
 .home-table-illustration { height: 106px; max-width: 290px; justify-self: end; }
 .pack-grid { grid-template-columns: 1fr; gap: 16px; }
 .pack-card { padding: 20px; }
 .entry-shell .bgt-button, .entry-drawer .bgt-button { min-height: 44px; }
 .entry-shell { padding: 24px 18px 48px; }
 .home-heading { padding: 10px 0 22px; }
 .shortcut-pair { grid-template-columns: 1fr; }
 .home-shortcut { padding: 22px 12px; gap: 16px; }
 .home-shortcut:first-child { border-right: 0; border-bottom: 1px solid var(--bgt-color-border); }
 .home-shortcut h3 { font-size: 20px; }
 .continue-strip { padding: 18px 16px; margin-bottom: 28px; }
 .continue-strip h2 { border: 0; padding: 0; flex-basis: 100%; font-size: 17px; }
 .continue-context { flex-basis: 100%; }
 .continue-context strong { font-size: 18px; }
 .home-secondary, .entry-heading-row { flex-direction: column; }
 .entry-filters { flex-wrap: wrap; gap: 12px; }
 .entry-filters > div:first-child { flex-basis: 100%; }
 .game-highlight { grid-template-columns: minmax(0,1fr) 100px; gap: 16px; padding: 20px; }
 .game-highlight .game-artwork { width: 100px; height: 116px; }
 .game-detail-heading { grid-template-columns: 1fr; gap: 18px; }
 .game-detail-heading > div:last-child { order: -1; }
 .game-detail-heading .game-artwork { width: 100%; height: 180px; }
 .pack-section-heading { align-items: start; flex-direction: column; gap: 12px; }
 .pack-row { flex-wrap: wrap; }
 .pack-row-actions { flex-direction: row; width: 100%; justify-content: end; align-items: center; }
 .game-list-row, .local-game-row { gap: 14px; }
 .game-artwork { width: 62px; height: 60px; }
 .entry-drawer.bgt-dialog-content { width: 100%; padding: 24px 20px; }
}

/* Only the two framed App flows fill the viewport; their content owns scrolling. */
div.page:has(.active-runner-shell, .new-session-app) { position: fixed; inset: 0; min-height: 0; display: flex; flex-direction: column; }
div.page > [data-testid="active-session"] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
