.site-navigation, .site-related { margin: 24px max(24px, 8vw); line-height: 1.55; font-family: inherit; font-size: 14px; font-weight: 400; }
.site-navigation a, .site-related a { color: #1f3fb0; display: inline-block; min-height: 44px; padding: 8px 0; }
.site-related ul { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 0; list-style: none; }
.site-navigation, .site-related a, .site-related summary { font-size: 12px; font-weight: 400; }
.site-related summary { min-height: 44px; cursor: pointer; }
.site-related summary:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 4px; }
@media (min-width: 900px) { .site-navigation { margin-left: max(110px, 10vw); } }

select, .planner-section input { min-height: 44px; }

/* Larger collection navigation, without adding weight or changing the shelf homepage. */
.page-header .header-link { font-size: 15px; font-weight: 400; }
@media (max-width: 767px) {
  .page-header .header-link { font-size: 13px; }
}

/* Keep native keyboard interaction; only the decorative chevron is custom. */
.planner-bar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.planner-bar select:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
@media (forced-colors: active) {
  .planner-bar select { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 14px; }
}

/* EPUB text uses the same reader, not a second list below the preview. */
.reader-text-viewport { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; }
.reader-text-back { min-height: 44px; padding: 0 14px; font-size: 11px !important; white-space: nowrap; }
.reader-text-viewport[hidden], .reader-text-back[hidden] { display: none; }
.reader-text-viewport .source-context { max-width: 70ch; margin: 0 auto; padding: 0; border: 0; }
.reader-text-viewport .source-context > summary { display: none; }
.reader-text-viewport .context-block { overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .reader-text-viewport { padding: 20px 16px; }
  .reader-text-back { justify-self: end; }
}

/* Guide-only header navigation replaces the former left rail. */
.guide-page { --rail: 0px; }
.guide-page .page { margin-left: 0; }
.guide-page .page-header { width: 100%; max-width: 1420px; margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "brand edition collection"; }
.guide-page .guide-brand { grid-area: brand; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; width: 44px; }
.guide-page .guide-brand img { width: 39px; height: auto; }
.guide-page .header-link { grid-area: collection; justify-self: end; }
.guide-page .header-edition { grid-area: edition; text-align: center; }
.guide-page .site-navigation { margin-inline: max(24px, 6vw); }
@media (max-width: 1023px) {
  .guide-page .page-header { grid-template-columns: 44px 1fr; grid-template-areas: "brand collection"; }
  .guide-page .header-edition { display: none; }
}
@media (max-width: 767px) {
  .guide-page .guide-brand img { width: 27px; }
}

/* Paid guide purchase actions keep the existing pill interaction and free-guide exception. */
.guide-paid .button-purchase { background: #1f3fb0; color: #fff; border: 1px solid #1f3fb0; font-size: 13px; }
.guide-paid .hero-actions { gap: 16px; }
.guide-paid .hero-actions > .button, .guide-paid .closing > .button { max-width: 100%; min-height: 51px; }

/* Captionless PDF readers use the full mobile row for the original-image action. */
@media (max-width: 767px) {
  .page-reader:not([aria-describedby]) .reader-original {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* Guide chrome inherits the homepage preference without a second control. */
:root[data-home-theme='dark'] { color-scheme: dark; }
[data-home-theme='dark'] .guide-page {
  --paper: #20211f;
  --sheet: #272824;
  --ink: #eeeae1;
  --muted: #b5b2aa;
  --line: #eeeae138;
  --cobalt: #9dafff;
}
[data-home-theme='dark'] .guide-page .guide-brand img { filter: invert(1) brightness(.93); }
[data-home-theme='dark'] .guide-page .hero-description,
[data-home-theme='dark'] .guide-page .about-note,
[data-home-theme='dark'] .guide-page .v1-fit-grid p,
[data-home-theme='dark'] .guide-page .v1-invitation,
[data-home-theme='dark'] .guide-page .v1-contents li,
[data-home-theme='dark'] .guide-page .v1-addons p,
[data-home-theme='dark'] .guide-page .v1-faq-grid details p { color: var(--muted); }
[data-home-theme='dark'] .guide-page .excerpt-card { background: var(--sheet); border-color: var(--line); }
[data-home-theme='dark'] .guide-page .practical { background: #262d29; }
[data-home-theme='dark'] .guide-page .detour { background: #302c25; }
[data-home-theme='dark'] .guide-page .preparation { background: #282c30; }
[data-home-theme='dark'] .guide-page .image-tag { background: #272824ed; color: var(--ink); }
[data-home-theme='dark'] .guide-page blockquote { border-color: var(--line); }
[data-home-theme='dark'] .guide-page .page-image,
[data-home-theme='dark'] .guide-page .map-image { background: var(--sheet); }
[data-home-theme='dark'] .guide-page .site-navigation a,
[data-home-theme='dark'] .guide-page .site-related a { color: var(--cobalt); }
[data-home-theme='dark'] .guide-page .planner-inputs input { border-color: var(--line); }
[data-home-theme='dark'] .guide-page .planner-inputs input[aria-invalid='true'] { border-color: #f3a899; }
[data-home-theme='dark'] .guide-page .planner-error { color: #f3a899; }
[data-home-theme='dark'] .guide-page .status-label { border-color: var(--line); color: var(--muted); }
[data-home-theme='dark'] .guide-page .reader-viewport { background: #20211f; }
[data-home-theme='dark'] .guide-page .reader-text-viewport { background: var(--sheet); color: var(--ink); }
[data-home-theme='dark'] .guide-page .reader-image { color-scheme: light; background: white; }
@media (hover: hover) and (pointer: fine) {
  [data-home-theme='dark'] .guide-paid .button-purchase:hover { background: #1f3fb0; color: #fff; border-color: #1f3fb0; }
}
