@media screen {
  html { scrollbar-gutter: stable; }
  .topbar, .shell {
    width: min(1320px, calc(100% - 32px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 24px;
  }
  .shell {
    grid-template-columns: 192px minmax(0, 1fr) 256px;
    gap: 32px;
  }
  .shell-focused { grid-template-columns: 192px minmax(0, 860px); }
  .shell > .rail { display: flex; }
}
.edition-home .feed-intro { margin-bottom: 24px; }
.edition-home .feed-intro h1 { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.edition-home .sidebar nav a { overflow-wrap: normal; }
.edition-home .feed-intro p { margin: 0; }
.home-edition { margin-bottom: 32px; }
.edition-lead { min-width: 0; }
.edition-story {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  background: #131c30;
  color: #fff;
}
.edition-story:hover { color: #fff; }
.edition-story:hover h2, .edition-recent li a:hover .edition-title {
  text-decoration: underline;
  text-underline-offset: .16em;
}
.edition-story img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}
.edition-copy { padding: 24px; }
.edition-copy h2 { margin: 12px 0; font-size: 30px; line-height: 36px; }
.edition-copy p { color: #dce3f1; font-size: 14px; line-height: 20px; }
.edition-label, .edition-meta, .edition-time { font-size: 12px; line-height: 16px; font-weight: 600; }
.edition-label { color: #c7d8ff; }
.edition-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.edition-time span { font-size: 20px; line-height: 28px; }
.edition-recent {
  border-top: 3px solid var(--focus);
  border-bottom: 1px solid var(--line);
  padding: 16px 0 0;
}
.edition-recent h2 { margin: 0 0 8px; font-size: 24px; line-height: 32px; }
.edition-recent ol { list-style: none; padding: 0; margin: 0; }
.edition-recent li { border-bottom: 1px solid var(--line); }
.edition-recent li a { display: grid; gap: 8px; padding: 16px 0; }
.edition-meta { color: var(--muted); }
.edition-title { font-size: 16px; line-height: 24px; font-weight: 700; }
.edition-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; font-weight: 700; }
.edition-home .feed-sort { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.edition-home .content > .feed-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 24px 0;
}
.edition-home .feed-card h2 { max-width: 36ch; }
.edition-home .feed-card p { max-width: 68ch; }
.feed-cover { margin: 16px 0 0; }
.feed-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}
@media screen and (max-width: 1100px) {
  .shell, .shell-focused { grid-template-columns: 192px minmax(0, 1fr); }
  .shell > .rail { display: none; }
}
@media screen and (max-width: 980px) {
  .topbar, .shell { padding-inline: 16px; }
  .shell, .shell-focused { grid-template-columns: 144px minmax(0, 1fr); gap: 24px; }
}
@media screen and (max-width: 680px) {
  .topbar, .shell { width: calc(100% - 16px); padding-inline: 12px; }
  .edition-home .feed-intro h1 { font-size: 36px; line-height: 40px; }
  .edition-story img { aspect-ratio: 16 / 9; }
  .edition-copy { padding: 16px; }
  .edition-copy h2 { font-size: 24px; line-height: 32px; }
}

/* Reading pages use paper margins and rules; forms keep their own surface. */
.content:has(.article-header, .search-filters, .profile-cover, .settings-heading, .editor) {
  --edition-rule: var(--line);
  --edition-navy: #131c30;
  --edition-on-navy: #fff;
  --edition-muted-on-navy: #dce3f1;
  min-width: 0;
}

.content > .article-header {
  margin: 0 0 24px;
  padding: 24px 0;
  background: transparent;
  border: 0;
  border-top: 3px solid var(--focus);
  border-bottom: 1px solid var(--edition-rule);
  border-radius: 0;
}
.content .article-header h1 {
  max-width: 24ch;
  font-size: 48px;
  line-height: 48px;
}
.content .article-header .lead { max-width: 62ch; }
.content:has(> .article-header) > .article-body {
  margin-bottom: 32px;
  padding: 24px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.content:has(> .article-header) > .article-body > :is(p, ul, ol) { max-width: 68ch; }
.content:has(> .article-header) > .article-body .toc {
  border-left: 3px solid var(--focus);
  border-radius: 0 8px 8px 0;
}
.content:has(> .article-header) > .article-body h2 { margin-top: 40px; }

.reading-next { border-top: 3px solid var(--focus); margin-block: 32px; padding-top: 20px; }
.reading-next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reading-next-card { min-width: 0; }
.reading-next-card > a {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 12px;
  background: var(--edition-navy, #131c30);
  color: #fff;
}
.reading-next-card > a:hover h3 { text-decoration: underline; text-underline-offset: .16em; }
.reading-next-card > a:focus-visible { outline-color: var(--focus); }
.reading-next-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px 12px 0 0; }
.reading-next-copy { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 20px; }
.reading-next-copy h3 { margin: 0; font-size: 20px; line-height: 28px; }
.reading-next-copy p { margin: 0; color: #dce3f1; font-size: 14px; line-height: 20px; }
.reading-next-copy .edition-time { margin-top: auto; }

.content:has(.search-filters) > .page-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.content:has(.search-filters) > .page-heading p { margin: 0; }
.content > .search-result-count {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--edition-rule);
}
.content:has(.search-filters, .profile-cover) > .feed-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--edition-rule);
  border-radius: 0;
  margin: 0;
  padding: 24px 0;
}

.content > .profile-cover {
  background: var(--edition-navy);
  color: var(--edition-on-navy);
  border: 0;
  border-radius: 12px;
  margin-bottom: 24px;
}
.content .profile-cover :is(.meta, .profile-occupation, .profile-bio, .profile-bio p, .profile-website .text-link) { color: var(--edition-muted-on-navy); }
.content .profile-cover :is(.profile-stats a, .profile-actions .ghost) {
  border-color: #63718b;
  background: #202d45;
  color: #fff;
}
.content .profile-cover :is(.profile-stats a, .profile-actions .ghost):hover { background: #30415f; }
.content .profile-cover a:focus-visible { outline-color: #c7d8ff; }
.content .profile-cover .profile-identity .badge { background: #e6edf9; color: #202c43; }

.content .settings-page > .card {
  border: 0;
  border-top: 1px solid var(--edition-rule);
  border-radius: 0;
  background: transparent;
  padding: 24px 0;
}
.content .settings-page .form { max-width: 640px; }
.content .settings-heading .eyebrow { display: none; }

.content:has(> .editor) > .row.spread:first-of-type {
  border-top: 3px solid var(--focus);
  padding-top: 24px;
  margin-bottom: 16px;
}
.content:has(> .editor) > .row.spread > div { min-width: 0; }
.content:has(> .editor) > .row.spread > a { text-decoration: underline; text-underline-offset: 4px; }
.content > .editor {
  border-radius: 12px;
  padding: 24px;
}
.content .editor .wysiwyg-heading {
  background: var(--edition-navy);
  color: var(--edition-on-navy);
}
.content .editor .wysiwyg-heading :focus-visible { outline-color: #c7d8ff; }

.content:has(.search-filters) .page-heading h1,
.content .profile-cover h1,
.content .settings-heading h1,
.content:has(> .editor) > .row.spread h1 {
  font-size: 36px;
  line-height: 40px;
}

@media (max-width: 680px) {
  .content:has(.article-header, .search-filters, .profile-cover, .settings-heading, .editor) {
    margin-inline: 8px;
  }
  .content .article-header h1,
  .content:has(.search-filters) .page-heading h1,
  .content .profile-cover h1,
  .content .settings-heading h1,
  .content:has(> .editor) > .row.spread h1 {
    font-size: 30px;
    line-height: 36px;
  }
  .content:has(> .article-header) > .article-body { padding-block: 16px; }
  .content:has(> .article-header) > .article-body h2 { margin-top: 32px; }
  .reading-next-grid { grid-template-columns: minmax(0, 1fr); }
  .content > .editor { padding: 16px; }
  .content .profile-cover { padding: 16px; }
  .content .profile-cover .profile-stats a { flex-basis: auto; }
  .content:has(> .editor) > .row.spread:first-of-type {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
.metrika-choice {
  position: fixed;
  z-index: 50;
  inset: auto 16px 16px;
  max-width: 640px;
  margin-inline: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 32px #0002;
}
.metrika-choice h2 { margin-bottom: 8px; font-size: 20px; line-height: 28px; }
.metrika-choice p { margin-bottom: 12px; }
.metrika-choice a { text-decoration: underline; }
.metrika-choice .row { gap: 8px; }
