.reading-surface {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 32px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  position: relative;
}

.reader-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalL);
}

.reader-heading {
  font-family: var(--fontFamilyBase);
  color: var(--colorNeutralForeground1);
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalS);
}

.reading-close {
  display: flex;
  justify-content: flex-end;
}

.reading-close fluent-button {
  font-size: 12px;
}

.reader-heading .eyebrow {
  margin: 0;
}

.reader-heading h2 {
  font-size: 28px;
  line-height: 35px;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
  outline: none;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacingVerticalS) var(--spacingHorizontalM);
  font-size: 12px;
  color: var(--muted);
  line-height: 19px;
}

.reader-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacingHorizontalS);
  padding-bottom: var(--spacingVerticalM);
  border-bottom: 1px solid var(--stroke);
}

.reader-actions fluent-button {
  font-size: 12px;
}

.reader-actions .reader-more {
  margin-left: auto;
  position: relative;
}

.reader-more > summary {
  cursor: pointer;
  list-style: none;
  padding: 6px;
  border-radius: 4px;
}

.reader-more > summary:hover {
  background: #f3f1ed;
}

.reader-more > div {
  position: absolute;
  right: 0;
  top: 34px;
  width: 210px;
  z-index: 4;
  background: var(--paper);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow8);
  padding: 6px;
  border-radius: 6px;
  display: grid;
}

.reader-more fluent-button {
  justify-content: flex-start;
}

.prose {
  font-family: var(--fontFamilyBase);
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalXL);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.prose p {
  margin: 0;
}

.prose h3 {
  font-size: 18px;
  line-height: 27px;
  margin: 0;
}

.prose fluent-link {
  font-size: inherit;
}

.prose .citation {
  font-size: 11px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
  margin: 0 2px 0 4px;
  border-radius: 3px;
  background: var(--colorBrandBackground2, #f9f0f3);
  padding: 0 5px;
  text-decoration: none;
  white-space: nowrap;
}

.citation .icon {
  width: 12px;
  height: 12px;
}

.prose fluent-badge.citation {
  padding: 0 4px;
  min-height: 20px;
  font-weight: var(--fontWeightRegular);
  vertical-align: middle;
}

.entity-reference {
  font-weight: var(--fontWeightSemibold);
}

.citation[aria-current="true"] {
  background: var(--colorBrandStroke2, #e3c6ce);
  outline: 1px solid var(--brand);
}

.reader-related {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalM);
  padding-top: var(--spacingVerticalL);
  border-top: 1px solid var(--stroke);
}

.reader-related h3 {
  font-size: 13px;
}

.reader-related > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.version-notice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacingHorizontalS);
  padding: 10px 12px;
  background: #f6f5f2;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
}

.version-notice a {
  margin: 0;
}

.evidence-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f8f7f5;
  border-right: 1px solid var(--stroke);
}

.evidence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
}

.evidence-toolbar > span {
  font-size: 12px;
  font-weight: 600;
}

.evidence-toolbar > div {
  display: flex;
  gap: 4px;
}

.evidence-scroll {
  min-height: 0;
  overflow: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.original-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
  margin-bottom: 12px;
}

.original-heading .icon {
  color: var(--brand);
}

.original-content h2 {
  font-size: 22px;
  line-height: 29px;
  overflow-wrap: anywhere;
  outline: none;
}

.original-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 19px;
  margin: 10px 0 20px;
}

.evidence-note {
  font-size: 12px;
  line-height: 19px;
  color: var(--muted);
  margin-bottom: 14px;
}

.document-text {
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.active-evidence {
  color: #242424;
  background: #efdee3;
  box-shadow: 0 0 0 2px #efdee3;
  border-radius: 2px;
  scroll-margin-top: 24px;
}

.evidence-excerpt {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-left: 2px solid var(--brand);
  border-radius: 4px;
  margin-bottom: 16px;
}

.evidence-excerpt .document-text {
  margin: 0;
}

.extraction-label {
  font-size: 11px;
  color: var(--muted);
  margin: 22px 0 10px;
}

.original-expanded {
  margin: 20px 0;
}

.source-uses {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}

.source-uses p {
  font-size: 12px;
  line-height: 20px;
  margin-bottom: 12px;
}

.source-uses > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.source-uses fluent-button {
  font-size: 12px;
}

.connection-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
}

.connection-section h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.connection-section p {
  font-size: 12px;
  color: var(--muted);
  line-height: 20px;
}

.local-connections {
  width: 100%;
  height: auto;
  margin: 12px 0;
}

.local-connections .local-edge {
  stroke: var(--colorBrandStroke2);
  stroke-width: 1.5;
  fill: none;
}

.local-connections a rect {
  fill: var(--paper);
  stroke: var(--stroke);
}

.local-connections a:hover rect,
.local-connections a:focus rect {
  fill: var(--colorBrandBackground2);
  stroke: var(--brand);
}

.local-connections text {
  font-size: 12px;
  fill: #242424;
}

.local-connections .local-center {
  fill: var(--brand);
}

.local-connections .local-title {
  fill: #fff;
  font-size: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .reading-surface > .reader-body {
    animation: surface-enter 0.16s ease-out;
  }
  @keyframes surface-enter {
    from {
      opacity: 0.35;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1100px) {
  .reading-surface {
    padding: 16px 20px 28px;
  }
}

@media (max-width: 760px) {
  .reading-workspace.is-reading .collection-panel {
    display: none;
  }
  .reading-workspace.is-reading .reading-surface {
    flex: 1;
  }
  .reading-workspace.has-evidence .reading-surface {
    display: none;
  }
  .reading-workspace.has-evidence .evidence-panel {
    flex: 1;
    border: 0;
  }
  .reading-surface {
    padding: 12px 20px 28px;
  }
  .reader-heading h2 {
    font-size: 26px;
    line-height: 33px;
  }
  .prose {
    font-size: 15px;
  }
  .evidence-scroll {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .reader-actions fluent-button {
    font-size: 11px;
  }
  .reading-surface {
    padding-left: 16px;
    padding-right: 16px;
  }
}
