/* Home prioritizes the periodic table; other pages can opt into a real 300px ad column. */
.bth-home-wide.bth-design .bth-site-content,
.bth-home-wide.bth-design .bth-header-inner,
.bth-home-wide.bth-design .bth-footer-inner{max-width:1560px}
.bth-home-wide.bth-design .bth-screen--home>.bth-ui{max-width:none}
.bth-ad-sidebar{display:none;min-width:0}
.bth-ad-sidebar-inner{width:300px;max-width:300px}
.bth-ad-sidebar [data-ad-sidebar-mount]{min-height:600px}
.bth-ad-sidebar .bth-ad-label{font-size:11px;line-height:1.5;color:var(--pencil,#505467);text-align:center;margin:0 0 8px}
.bth-ad-widget{width:300px;max-width:300px;margin:0 0 20px;padding:0;background:transparent;border:0;box-shadow:none;text-align:center}
.bth-ad-widget img{display:block;max-width:100%;height:auto;margin-inline:auto}
.bth-ad-widget :is(p,figure){margin:0}
.bth-ad-sidebar .bth-ad-title{font-size:14px;margin:0 0 10px}
@media(min-width:1366px){
 .bth-design.bth-has-ad-sidebar:not(.bth-comparison-page) .bth-site-content{max-width:1504px;display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
 .bth-has-ad-sidebar:not(.bth-comparison-page) .bth-ad-sidebar{display:block;align-self:stretch;width:300px}
 .bth-has-ad-sidebar .bth-screen{min-width:0}
}
@media(min-width:1600px){
 .bth-design.bth-has-ad-sidebar.bth-comparison-page .bth-site-content{max-width:1404px;display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
 .bth-has-ad-sidebar.bth-comparison-page .bth-ad-sidebar{display:block;align-self:stretch;width:300px}
}
@media(min-width:1366px) and (min-height:720px){
 .bth-ad-sidebar--single.bth-ad-sidebar--fits .bth-ad-sidebar-inner{position:sticky;top:24px}
 .admin-bar .bth-ad-sidebar--single.bth-ad-sidebar--fits .bth-ad-sidebar-inner{top:56px}
}
@media(min-width:1366px) and (max-width:1599px){
 .bth-has-ad-sidebar .bth-profile .bp-hero{grid-template-columns:minmax(0,1fr) 320px;gap:24px}
 .bth-has-ad-sidebar .bth-profile .bp-reading-layout{grid-template-columns:180px minmax(0,1fr);gap:20px}
 .bth-has-ad-sidebar .bp-facts>div{padding-inline:16px}
 .bth-has-ad-sidebar .bth-ed-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media print{.bth-ad-sidebar{display:none!important}.bth-design.bth-has-ad-sidebar .bth-site-content{display:block;max-width:1180px}}

/* Compact model surfaces: fit the atom to the viewport rather than a large square. */
.bth-design .bth-atom-viewer{margin:8px auto 10px;max-width:360px}
.bth-design .bth-atom-stage{height:190px;min-height:0;aspect-ratio:auto}
.bth-design .bth-profile .bp-model{align-self:start;justify-content:flex-start;padding:16px}
.bth-design .bp-model .bth-atom-viewer{margin:4px auto 0;max-width:100%}
.bth-design .bp-model .bth-atom-stage{height:190px;min-height:0;aspect-ratio:auto}
.bth-design .bth-element-detail .bth-atom-stage{height:180px;min-height:0}
.bth-design .bth-atom-viewer .bth-atom-selection{font:12px/1.5 Arial,sans-serif;min-height:18px;margin:6px 0 0}
.bth-design .bth-atom-viewer .bth-atom-config{gap:3px;margin:5px 0}
.bth-design .bth-atom-viewer .bth-atom-caption{font-size:11px;line-height:1.5;margin:5px 0 0}
.bth-design .bth-atom-viewer .bth-atom-parts{margin-top:6px}
/* The homepage contents follows the reading column, with a compact native disclosure. */
.bth-home-wide.bth-design .bth-home-contents{max-width:800px;margin:22px auto 16px;padding:0;border-radius:7px;background:var(--sheet)}
.bth-design .bth-home-contents summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 16px;cursor:pointer;list-style:none;font-size:14px;color:var(--ink)}
.bth-home-contents summary::-webkit-details-marker{display:none}
.bth-home-contents summary::after{content:'+';font-size:20px;font-weight:400}
.bth-home-contents details[open]>summary::after{content:'−'}
.bth-home-contents summary>span{margin-left:auto;font-size:12px;color:var(--pencil)}
.bth-design .bth-home-contents ul{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 20px;padding:2px 16px 12px;counter-reset:contents}
.bth-design .bth-home-contents li{margin:0;counter-increment:contents}
.bth-design .bth-home-contents a{display:flex;gap:8px;align-items:baseline;font-size:13px;text-decoration:none;padding:6px 0;line-height:1.55}
.bth-home-contents a::before{content:counter(contents,decimal-leading-zero);font-size:11px;color:var(--pencil);flex-shrink:0}
.bth-home-contents a:hover{text-decoration:underline}
/* Footer identity, description and the contact details supplied from the fanpage. */
.bth-design .bth-footer-inner{grid-template-columns:minmax(300px,1.7fr) repeat(3,minmax(0,1fr));gap:28px;padding-block:28px 16px}
.bth-footer-identity{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.bth-design .bth-footer-identity .bth-footer-logo{margin:0;width:42px;height:42px;flex-shrink:0}
.bth-design .bth-footer-identity b{font-size:14px;line-height:1.5;margin:0}
.bth-design .bth-footer-brand .bth-footer-description{font-size:14px;line-height:1.75;margin:0 0 16px;max-width:48ch}
.bth-footer-contact{font-style:normal;display:grid;gap:9px;font-size:13px;line-height:1.6;margin:0 0 12px}
.bth-footer-contact>div{display:grid;grid-template-columns:70px minmax(0,1fr);gap:8px}
.bth-design .bth-footer-contact span{font-size:12px;color:var(--pencil)}
.bth-design .bth-footer-brand .bth-footer-contact p{margin:0;font-size:13px;line-height:1.6}
.bth-footer-contact a{overflow-wrap:anywhere;color:var(--ink);text-decoration:none}
.bth-footer-contact a:hover{text-decoration:underline}
.bth-design .bth-footer-brand .bth-footer-contact-link{font-size:13px;padding:4px 0}
.bth-design .bth-footer-menu a{font-size:13px;line-height:1.6;padding:6px 0}
@media(max-width:900px){.bth-design .bth-footer-inner{grid-template-columns:repeat(2,minmax(0,1fr))}.bth-footer-brand{grid-column:1/-1}}
@media(max-width:600px){
 .bth-design .bth-home-contents ul{grid-template-columns:1fr}
 .bth-design .bth-profile .bp-model{padding:14px}
 .bth-design .bp-model .bth-atom-stage{height:175px}
 .bth-design .bth-element-detail .bth-atom-stage{height:170px}
 .bth-design .bth-footer-inner{gap:24px 18px}
 .bth-design .bth-footer-menu a{min-height:36px}
}
@media(max-width:600px){
 .bth-design .bp-facts>div{padding-inline:14px}
 .bth-design .bp-facts strong{font-size:21px;letter-spacing:-.4px;overflow-wrap:anywhere}
}

/* Align reading content with the table and featured image. */
.bth-home-wide.bth-design .bth-home-reading{min-width:0;grid-column:1;grid-row:2}
.bth-home-wide.bth-design .bth-home-reading :is(.bth-home-contents,.bth-editorial){width:100%;max-width:none;box-sizing:border-box;margin:0 0 20px}
.bth-home-wide.bth-design .bth-periodic-wrap{row-gap:20px}
@media(min-width:1101px){
 .bth-home-wide.bth-design .bth-periodic-wrap>.bth-element-detail{grid-column:2;grid-row:1 / span 2;align-self:start}
}
@media(max-width:1100px){
 .bth-home-wide.bth-design .bth-home-reading{grid-column:auto;grid-row:auto}
}
.bth-design .bth-screen--single .bth-reading{width:100%;max-width:none;box-sizing:border-box}
/* Home title and search share the centre of the periodic table column. */
.bth-home-wide.bth-design .notebook-title{width:100%;box-sizing:border-box;padding:8px 16px 18px}
.bth-home-wide.bth-design .notebook-title h1{font-size:clamp(30px,3.6vw,54px)}
.bth-home-wide.bth-design .notebook-title p{max-width:640px;margin-inline:auto;text-wrap:balance}
.bth-home-wide.bth-design .bth-periodic-head{width:min(100%,640px);box-sizing:border-box;margin-inline:auto;margin-bottom:16px}
@media(min-width:1051px){
 .bth-home-wide.bth-design .notebook-title{width:calc(100% - clamp(240px,23%,335px) - var(--pad))}
 .bth-home-wide.bth-design .notebook-title::before,.bth-home-wide.bth-design .notebook-title::after{display:none}
}
.bth-design .bth-pwa-install{position:fixed;right:20px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:90;margin:0;padding:11px 18px;background:var(--tab,#ffad50);color:var(--ink,#1c2950);border:1px solid #b47832;border-radius:8px;font:600 14px/1.4 Arial,sans-serif;box-shadow:0 3px 12px #1c295026}
.bth-install-dialog{box-sizing:border-box;width:min(440px,calc(100% - 32px));max-height:80vh;padding:24px;background:#fffaf0;color:#1c2950;border:1px solid #d8cebc;border-radius:10px}
.bth-install-dialog::backdrop{background:#1c295066}
.bth-install-dialog h2{font:700 23px/1.35 Georgia,serif;margin:0 0 14px}.bth-install-dialog p{font:16px/1.7 Arial,sans-serif}.bth-install-dialog button{padding:9px 16px;background:#ffad50;color:#1c2950;border:1px solid #b47832;border-radius:6px;cursor:pointer}
@media(max-width:760px){.bth-design .bth-pwa-install{right:12px;padding:10px 14px;font-size:13px}}

/* Installation shares the global header navigation. */
.bth-design .bth-site-content{position:relative}
.bth-design .bth-primary-menu .bth-pwa-install,.bth-design .bth-install-mobile{position:static;display:inline-flex;align-items:center;justify-content:center;gap:7px;margin:0;padding:8px 12px;min-height:40px;border:0;border-radius:5px;background:transparent;color:var(--ink);font:600 13px/1.4 Arial,sans-serif;box-shadow:none;cursor:pointer}
.bth-design .bth-primary-menu .bth-pwa-install:hover{background:var(--marker)}
.bth-design .bth-install-mobile{display:none}
.bth-design .bth-pwa-install[hidden]{display:none!important}
.bth-install-menu-item{display:flex;align-items:center}
@media(max-width:760px){
 body.bth-design{padding-bottom:0}
 .bth-design .bth-header-inner{display:grid;grid-template-columns:minmax(0,1fr) 36px auto;gap:7px}
 .bth-design .bth-brand{min-width:0;gap:6px}
 .bth-design .bth-brand-name{font-size:17px;min-width:0}
 .bth-design .bth-brand-name span{font-size:10px;line-height:1.3}
 .bth-design .bth-brand-mark{flex-shrink:0;width:34px;height:36px}
 .bth-design .bth-install-mobile{display:flex;padding:5px;min-width:36px;min-height:40px}
 .bth-install-mobile span{display:none}
 .bth-design .bth-menu-toggle{padding:8px 10px;min-height:40px}
 .bth-design .bth-primary-menu{grid-column:1/-1}
 .bth-primary-menu .bth-install-menu-item{display:none}
}
