.reader-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: 54px minmax(0, 1fr) 39px;
  background: var(--rd-surface);
}

.reader-toolbar {
  padding: 0 17px;
  border-bottom: 1px solid var(--rd-line);
}

.reader-action-separator {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--rd-line);
}

.reader-scroll {
  min-height: 0;
  overflow: auto;
  outline: none;
  scroll-behavior: smooth;
}

.reader-scroll:focus-visible {
  box-shadow: inset 0 0 0 2px var(--rd-accent);
}

.reader-article {
  width: min(100%, 47.5rem);
  margin: 0 auto;
  padding: clamp(38px, 6vw, 72px) clamp(24px, 6vw, 64px) 80px;
}

.article-heading {
  margin-bottom: 31px;
}

.article-source {
  display: block;
  margin-bottom: 13px;
  color: var(--rd-muted);
  font-size: var(--rd-text-xs);
}

.article-heading h1 {
  margin: 0 0 14px;
  color: var(--rd-ink);
  font-family: var(--rd-font-serif);
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.article-heading p {
  margin: 0;
  color: var(--rd-muted);
  font-size: 0.69rem;
}

.article-hero {
  display: block;
  width: 100%;
  max-height: 23.75rem;
  margin: 0 0 34px;
  border-radius: var(--rd-radius-md);
  object-fit: cover;
}

[data-bs-theme="dark"] .article-hero,
[data-bs-theme="dark"] .row-cover img {
  filter: brightness(0.78) saturate(0.85);
}

.article-content {
  color: var(--rd-ink);
  font-family: var(--rd-font-serif);
  font-size: 1.03rem;
  line-height: 1.78;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content > :last-child {
  margin-bottom: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.7em 0 0.65em;
  font-family: var(--rd-font-serif);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.55rem; }
.article-content h3 { font-size: 1.27rem; }

.article-content p,
.article-content ul,
.article-content ol,
.article-content figure,
.article-content blockquote,
.article-content pre,
.article-content table {
  margin: 0 0 1.35em;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border-radius: var(--rd-radius-sm);
}

.article-content a {
  color: var(--rd-accent-deep);
  text-decoration-color: color-mix(in srgb, var(--rd-accent) 45%, transparent);
}

.article-content blockquote {
  padding: 5px 0 5px 22px;
  border-left: 3px solid var(--rd-accent);
  color: var(--rd-muted);
  font-size: 1.1rem;
  font-style: italic;
}

.article-content pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--rd-line);
  border-radius: var(--rd-radius-md);
  background: var(--rd-surface-soft);
}

.article-content pre,
.article-content code {
  font-family: var(--rd-font-mono);
  font-size: 0.8em;
}

.article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.article-content th,
.article-content td {
  padding: 9px;
  border: 1px solid var(--rd-line);
}

.reader-empty {
  min-height: 300px;
  color: var(--rd-muted);
}

.reader-empty > i {
  margin-bottom: 14px;
  color: var(--rd-accent);
  font-size: 1.7rem;
}

.reader-empty h2 {
  color: var(--rd-ink);
  font-family: var(--rd-font-serif);
  font-size: 1.4rem;
}

.reader-empty p {
  max-width: 24.375rem;
  font-size: 0.75rem;
}

.reader-source-details {
  margin-top: 55px;
  padding-top: 18px;
  border-top: 1px solid var(--rd-line);
  color: var(--rd-muted);
  font-family: var(--rd-font-sans);
  font-size: var(--rd-text-sm);
}

.reader-source-details summary {
  color: var(--rd-ink);
  cursor: pointer;
  font-weight: 650;
}

.reader-source-details dl {
  display: grid;
  margin: 14px 0 0;
}

.reader-source-details dl > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 15px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rd-line);
}

.reader-source-details dt {
  font-weight: 600;
}

.reader-source-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.reader-footer {
  position: relative;
  padding: 0 18px;
  color: var(--rd-muted);
  font-size: var(--rd-text-xs);
}

.reader-progress-track {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: transparent;
}

.reader-progress-track span {
  display: block;
  width: 0;
  height: 2px;
  background: var(--rd-accent);
  transition: width 100ms linear;
}

.reader-footer nav {
  display: flex;
  gap: 22px;
}

.reader-footer a {
  color: var(--rd-ink);
  text-decoration: none;
}

.focused-reader-wrap {
  height: 100dvh;
  background: var(--rd-surface);
}

.focused-reader-wrap .reader-article {
  width: min(100%, 48.75rem);
}
