html, body { min-height: 100%; }
body.kumaun-topic-standalone {
  overflow-x: hidden;
  background: var(--parchment-2);
}
.topic-topbar-spacer { height: var(--shared-topbar-height, 64px); }
.topic-page-main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}
.topic-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 1040px;
  margin: 0 auto 14px;
  color: var(--ink-3);
  font: 700 12px var(--font-sans);
}
.topic-page-breadcrumb a {
  color: var(--indigo);
  text-decoration: none;
}
.topic-page-breadcrumb a:hover,
.topic-page-breadcrumb a:focus-visible { text-decoration: underline; }
.topic-standalone-overlay.notes-modal-overlay {
  display: block;
  position: static;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}
.topic-standalone-overlay .v4-modal {
  max-height: none;
  margin: 0 auto;
  animation: none;
  overflow: visible;
}
.topic-standalone-overlay .v4m-body {
  overflow: visible;
  max-height: none;
}
.kumaun-topic-standalone .v4m-tabs-bar {
  position: sticky;
  top: var(--shared-topbar-height, 64px);
  z-index: 24;
}
.topic-standalone-overlay [data-topic-close] { display: none; }
@media (max-width: 700px) {
  .topic-page-main { width: 100%; padding: 14px 0 0; }
  .topic-page-breadcrumb { padding: 0 16px; margin-bottom: 12px; }
  .topic-standalone-overlay .v4-modal { border: 0; border-radius: 0; }
}

/* Phase 2: standalone topic article metadata/navigation. These elements live
   outside [data-kumaun-topic-content], so the KumaunCom modal fetch keeps its
   compact dialog body unchanged. */
.topic-page-meta {
  max-width: 1040px;
  margin: -4px auto 16px;
  color: var(--ink-3);
  font: 600 12px/1.6 var(--font-sans);
}
.topic-page-meta a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
}
.topic-page-meta a:hover,
.topic-page-meta a:focus-visible { text-decoration: underline; }
.topic-page-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  max-width: 1040px;
  margin: 18px auto 0;
}
.topic-page-pagination a,
.topic-page-pagination-spacer {
  min-height: 46px;
}
.topic-page-pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--indigo);
  font: 700 13px/1.45 var(--font-sans);
  text-align: center;
  text-decoration: none;
}
.topic-page-pagination a:hover,
.topic-page-pagination a:focus-visible {
  border-color: currentColor;
  text-decoration: underline;
}
@media (max-width: 700px) {
  .topic-page-meta { padding: 0 16px; margin-bottom: 12px; }
  .topic-page-pagination { grid-template-columns: 1fr; padding: 0 16px 20px; }
  .topic-page-pagination-spacer { display: none; }
}
