/* One outer gutter for the header, content and footer; inner reading stays bounded. */
body { --shell-width:1280px; --shell-gutter:24px; }
body.news-page { --shell-width:1560px; }
body.chooser { --shell-width:1000px; }
body.settings-page { --shell-width:1040px; }
body.privacy-page { --shell-width:900px; }
body.blog-page { --shell-width:1050px; }
body:is(.auth-page,.pricing-page,.people-page,.endorsements-page,.appendix-page) { --shell-width:1120px; }
body > .toolbar,body > main#content,body > .site-footer,body > .news-pagination {
  width:min(calc(100% - 2 * var(--shell-gutter)),var(--shell-width));
  max-width:none; margin-inline:auto;
}
body > main#content { padding-inline:0; min-width:0; }
body.auth-page > main#content { max-width:488px; }
/* Equal side tracks keep the brand centered independently of action widths. */
body > .toolbar {
  display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:16px; padding:10px 16px; border-radius:24px;
}
.toolbar > .back { grid-column:1; justify-self:start; max-width:100%; }
.toolbar > .brand { grid-column:2; justify-self:center; min-width:0; min-height:44px; }
.toolbar > .toolbar-actions { grid-column:3; justify-self:end; min-width:0; }
.toolbar.home-toolbar { grid-template-columns:minmax(0,1fr) auto; }
.toolbar.home-toolbar > .brand { grid-column:1; justify-self:start; }
.toolbar.home-toolbar > .toolbar-actions { grid-column:2; }
.toolbar .brand img { flex:none; width:40px; height:40px; object-fit:contain; }
.toolbar .back-label { overflow-wrap:anywhere; }
.toolbar .site-menu > .profile-shortcut { max-width:calc(100vw - 2 * var(--shell-gutter) - 24px); }

/* Wrap content at its own boundary instead of hiding page overflow. */
:is(.intro,.card,.auth-card,.plan-card,.settings-label,.blog-post,.appendix-entry,.endorsement-profile,.person-card) { min-width:0; overflow-wrap:anywhere; }
.card-meta,.plan-top,.plan-price { flex-wrap:wrap; }
.plan-top h2 { min-width:0; }
.plan-status { max-width:100%; white-space:normal; }
.directory-tabs { flex-wrap:wrap; }
.directory-page #search-form input { width:100%; }
.profile-contacts dd a,.company-contact a,.evidence-list a { min-height:44px; align-content:center; }
.settings-row > * { min-width:0; }
.display-options { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
.display-option { min-width:0; overflow-wrap:anywhere; }
dialog { max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; overflow-wrap:anywhere; }
dialog > .close { position:sticky; top:0; z-index:3; }

/* A visible news banner, with a quiet timestamp and a clear headline. */
.news-page .latest-updates { border:1px solid var(--glass-field-border); border-left:4px solid var(--accent); box-shadow:var(--glass-shadow),0 8px 24px #1d405014; }
.latest-updates h2 { background:var(--accent); font-size:13px; letter-spacing:.04em; }
.latest-headline > a { font-size:18px; font-weight:650; }

/* Both sets of controls sit in the reading column, beside the stories they page. */
.news-page .news-pagination { display:grid; grid-template-columns:minmax(0,1fr); justify-content:stretch; gap:12px; width:100%; max-width:none; margin:24px 0; padding:16px 0; border-block:1px solid var(--line); }
.news-page .news-pagination[hidden] { display:none; }
.pagination-meta { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px 16px; color:var(--muted); font-size:14px; }
.pagination-meta label { display:flex; align-items:center; gap:8px; }
.pagination-meta select { width:auto; min-width:64px; min-height:44px; font-size:16px; }
.pagination-controls { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.pagination-controls button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:44px; min-height:44px; padding:8px 14px; border:1px solid var(--glass-field-border); border-radius:12px; color:var(--ink); background:var(--glass-field); font-size:14px; font-weight:600; }
.page-numbers { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px; }
.page-numbers button { padding:8px; }
.page-numbers [aria-current="page"] { background:var(--accent); color:#fff; border-color:var(--accent); }
.pagination-controls button:hover { border-color:var(--accent); }
.pagination-controls [aria-disabled="true"] { opacity:.5; cursor:default; }
.page-gap { display:inline-flex; justify-content:center; width:16px; color:var(--muted); }
html[data-theme="dark"] .latest-updates h2,html[data-theme="dark"] .page-numbers [aria-current="page"] { background:var(--night-accent); color:var(--night-bg); }
@media(forced-colors:active) {
  .latest-updates h2,.page-numbers [aria-current="page"] { background:Highlight; color:HighlightText; }
  .pagination-controls button { border-color:ButtonText; background:ButtonFace; color:ButtonText; }
  .page-numbers [aria-current="page"] { outline:2px solid Highlight; outline-offset:-4px; }
}

@media(max-width:760px) {
  body { --shell-gutter:16px; }
  body > .toolbar { top:8px; margin-top:8px; padding:8px; gap:6px; min-height:64px; grid-template-columns:44px minmax(0,1fr) auto; }
  .toolbar > .back { width:44px; padding:8px; gap:0; justify-content:center; }
  .toolbar .back .back-label { display:none; }
  .toolbar > .brand,.home-toolbar .brand { display:flex; justify-self:start; min-width:44px; }
  .toolbar .brand-name { display:none; }
  .toolbar .brand img,.home-toolbar .brand img { width:36px; height:36px; }
  .toolbar > .toolbar-actions { gap:6px; }
  .toolbar-actions > .account-link { min-width:70px; padding:9px 12px; font-size:13px; }
  .toolbar.home-toolbar { grid-template-columns:minmax(0,1fr) auto; }
  .toolbar.home-toolbar .brand img { width:44px; height:44px; }
  .toolbar .site-menu > .profile-shortcut { max-height:calc(100dvh - 104px); }
  body > main#content { padding-inline:0; }
  .settings-row { grid-template-columns:minmax(0,1fr); gap:20px; padding:24px 20px; }
  .settings-label p { max-width:none; }
  input:not([type="checkbox"]):not([type="radio"]),select,textarea,
  .directory-page #search-form input,.directory-page select { font-size:16px; }
  .directory-page .research-layout { display:block; }
  .directory-page aside { position:static; margin-bottom:20px; }
  .directory-page #topics { flex-direction:row; flex-wrap:wrap; gap:8px; }
  .directory-page #topics button { flex:none; }
  .directory-page .section-heading { flex-wrap:wrap; }
  .directory-tabs a,.directory-tabs button { white-space:normal; }
  .plan-card { padding:24px; }
  .plan-cards { grid-template-columns:minmax(0,1fr); }
  .pricing-controls .view-tabs { min-width:0; flex-wrap:wrap; }
  .pricing-controls .view-tabs button { white-space:normal; }
  .news-page .desk-head .intro h1 { font-size:clamp(32px,8vw,38px); }
  dialog,.news-dialog { padding:20px; border-radius:20px; }
  .update-detail { padding-inline:0; }
  .update-detail h2,dialog h2 { font-size:32px; }
  .latest-updates h2 { font-size:12px; letter-spacing:0; }
  .latest-headline > a { font-size:16px; }
  .pagination-controls { display:grid; grid-template-columns:1fr 1fr; }
  .pagination-controls .page-previous { grid-column:1; justify-self:start; }
  .pagination-controls .page-next { grid-column:2; grid-row:1; justify-self:end; }
  .page-numbers { grid-column:1 / -1; grid-row:2; }
}
@media(max-width:400px) {
  .directory-filters { grid-template-columns:minmax(0,1fr); }
  .directory-filters #reset { grid-column:1; }
  .profile-facts,.profile-contacts { grid-template-columns:minmax(0,1fr); gap:4px; }
  .profile-facts dd,.profile-contacts dd { margin-bottom:8px; }
  .display-options { grid-template-columns:minmax(0,1fr); }
  .auth-card { padding:24px 20px; }
}
@media(max-height:500px) and (max-width:1000px) {
  body > .toolbar { position:relative; top:auto; }
  .news-page .desk-filters { position:static; max-height:none; }
}
