/* Appendix V (appendix5/): platform-style appendix.
   Elements and functions follow the BitcoinSaving calculator code
   (cards, carousel, tab/filter selectors, live search), with the
   user's overrides: angled buttons and search (clip-path, never
   rounded), solid header with a hard cut like Appendix II,
   brand tokens only (#f7931a on #111111). Content in the appendix fonts
   (Inter, EB Garamond); the site header and page headlines use the theme font. */

body.v5 { --v5-line: #262626; --v5-panel: #151515; --v5-grey: #8a8a8a; }

/* --- Header: solid, hard cut (Appendix II pattern) ------------------ */
body.v5 .site-header {
  position: static;
  background: var(--bg);
  border-bottom: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: calc(23 * var(--u));
  /* Geometry matches the site's compact nav bar (the scrolled homepage
     bar): logo at the bar size 124u, logo and Buy button at 31u from the
     top, total bar height 118u. */
  padding: calc(31 * var(--u)) calc(50 * var(--u)) calc(31 * var(--u));
}
body.v5 .site-header > * { position: static; transform: none; }
body.v5 .logo { width: calc(124 * var(--u)); }
/* In the compact bar the nav sits 11u below the logo top (42u vs 31u). */
body.v5 .nav { flex-wrap: nowrap; margin-top: calc(11 * var(--u)); }

/* --- Layout and type ------------------------------------------------- */
.v5-wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding: 2.6rem 1.25rem 3.5rem;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #e9e9e9;
}
.v5-kicker {
  font-size: .78rem; font-weight: 400; letter-spacing: .14em; line-height: 1.7;
  text-transform: uppercase; color: #666; margin: 0 0 .9rem;
}
.v5-title {
  font-family: var(--font); text-transform: uppercase;
  font-size: 2.55rem; line-height: 1.08; margin: 0 0 1.1rem; color: #fff;
}
.v5-title--sm { font-size: 2.1rem; text-transform: uppercase; font-family: var(--font); font-weight: 600; letter-spacing: .01em; line-height: 1.05; }
.v5-lede { font-size: 1.2rem; line-height: 1.6; color: #cfcfcf; max-width: 46rem; margin: 0 0 1rem; }
.v5-title--orange { color: var(--orange); text-align: center; }
.v5-beyond-h { font-family: var(--font); text-transform: uppercase; font-size: 1.05rem; font-weight: 400; color: #fff; text-align: center; margin: 2.2rem 0 1rem; }
.v5-beyond { font-family: var(--font); font-size: var(--fs-m); line-height: 0.95; color: #fff; text-align: center; max-width: 46rem; margin: 0 auto 1rem; }
.v5-body { font-size: 1.06rem; line-height: 1.7; color: #d8d8d8; max-width: 46rem; margin: 0 0 1rem; }
.v5-h2 {
  font-family: var(--font); text-transform: uppercase;
  font-size: 1.35rem; margin: 0; color: #fff;
}
.v5-sec { margin-top: 2.6rem; margin-bottom: 1rem; }
.v5-section { margin-top: 3.2rem; }
.v5-section > .v5-h2 { margin-bottom: 1.2rem; }
.v5-part { font-size: .85rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin: 1.6rem 0 .8rem; line-height: 1.55; }
.v5-back { margin-top: 2.6rem; }
.v5-back a { color: var(--orange); font-weight: 600; }
.v5-empty { color: var(--v5-grey); font-size: 1.05rem; padding: 1.4rem 0; }
.v5-xlink { color: var(--orange); font-size: .98rem; font-weight: 600; margin: 1.4rem 0 .4rem; }
.v5-srcline { color: var(--v5-grey); font-size: .95rem; line-height: 1.55; margin: 1.6rem 0 .5rem; max-width: 46rem; }
.v5-srcline + .v5-card { margin-top: 0; }
.v5-group { font-size: 1rem; font-weight: 800; color: #fff; margin: 2rem 0 1rem; }

/* --- Angled controls -------------------------------------------------- */
.v5-ang { clip-path: none; border-radius: 0; } /* fully rectangular (user, 2026-11-09) */
.v5-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--orange);
  box-shadow: inset 0 0 0 1.5px var(--orange);
  font-weight: 800; font-size: .86rem; letter-spacing: .04em; text-transform: uppercase;
  padding: .68rem 1.15rem; min-height: 42px; text-decoration: none;
  border: 0; cursor: pointer; font-family: inherit;
}
.v5-btn--ghost { background: transparent; }
.v5-btn:hover { background: var(--orange); color: #111; }
.v5-chip {
  display: inline-block; background: #1a1a1a; color: #e9e9e9;
  padding: .65rem 1.05rem; margin: 0 .45rem .6rem 0; font-size: .92rem; font-weight: 600; text-decoration: none;
}
.v5-chip:hover { background: var(--orange); color: #111; }
.v5-chips { margin: 0 0 .6rem; }

/* --- Featured carousel ------------------------------------------------ */
.v5-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.v5-car-nav { display: flex; gap: .6rem; margin: 0; }
.v5-navbox {
  width: 56px; height: 56px; font-size: 1.5rem; font-weight: 800; line-height: 1;
  background: var(--orange); color: #111; border: 0; cursor: pointer;
}
.v5-navbox:disabled { background: #2a2a2a; color: #666; cursor: default; }
.v5-navbox:not(:disabled):hover { filter: brightness(1.1); }
.v5-car { overflow: hidden; touch-action: pan-y; }
.v5-track { display: flex; gap: 16px; transition: transform .45s ease; }
.v5-track .v5-card { flex: 0 0 100%; margin: 0; }
.v5-car-count { color: rgba(190, 190, 190, .5); font-size: .9rem; margin: .9rem 0 0; text-align: right; }

/* --- Cards ------------------------------------------------------------ */
.v5-card {
  background: var(--v5-panel); border: 1px solid var(--v5-line);
  padding: 1.35rem 1.45rem; margin: 0 0 1rem;
}
.v5-card:hover { border-color: var(--orange); }
.v5-meta { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--v5-grey); margin: 0 0 .55rem; }
.v5-card-title { font-family: 'EB Garamond', Garamond, Georgia, serif; font-size: 1.22rem; line-height: 1.25; font-weight: 500; margin: 0 0 .4rem; }
.v5-card-title a { color: #fff; text-decoration: none; }
.v5-card-title a:hover { color: var(--orange); }
.v5-byline { color: var(--v5-grey); font-size: .95rem; margin: 0 0 .55rem; }
.v5-byline--big { font-size: 1.1rem; }
.v5-note { font-size: .99rem; line-height: 1.6; color: #c9c9c9; margin: 0 0 .8rem; }
.v5-card-links { margin: 0; }
.v5-card-links a { color: var(--orange); font-weight: 600; font-size: .95rem; }
.v5-stack .v5-card { margin-bottom: 1rem; }

/* --- Tiles (chapters / topics) --------------------------------------- */
.v5-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.v5-tile {
  display: block; background: var(--v5-panel); border: 1px solid var(--v5-line);
  padding: 1.2rem 1.3rem; text-decoration: none; color: #e9e9e9;
}
.v5-tile:hover { border-color: var(--orange); }
.v5-tile-num { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: .45rem; }
.v5-tile-title { display: block; font-size: .98rem; font-weight: 800; line-height: 1.35; color: #fff; }
.v5-tile-cnt { display: block; color: var(--v5-grey); font-size: .88rem; margin-top: .45rem; }
.v5-tile-blurb { display: block; color: #c9c9c9; font-size: .93rem; line-height: 1.5; margin-top: .5rem; }

/* --- All Sources menu: Appendix II shape, larger boxes ---------------- */
.v5-menu {
  position: sticky; top: 1rem; z-index: 30;
  background: var(--bg); border-block: 1px solid var(--v5-line);
  padding: 1rem 0 1.1rem; margin-bottom: 1.6rem;
  box-shadow: 0 -1.25rem 0 var(--bg);
}
.v5-tabs { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.v5-tab {
  min-height: 44px; padding: .55rem .95rem; font-size: .88rem; font-weight: 700;
  letter-spacing: .03em;
  background: transparent; color: #fff; border: 0; cursor: pointer; font-family: inherit;
  box-shadow: inset 0 0 0 1px #3d3d3d;
}
.v5-tab[aria-pressed="true"] { background: transparent; color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); font-weight: 800; }
.v5-filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: .8rem; }
.v5-fbtn {
  min-height: 44px; padding: .55rem .95rem; font-size: .88rem; font-weight: 700;
  letter-spacing: .03em;
  background: transparent; color: #fff; border: 0; cursor: pointer; font-family: inherit;
  box-shadow: inset 0 0 0 1px #3d3d3d;
}
.v5-fbtn[aria-pressed="true"] { background: transparent; color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); font-weight: 800; }
.v5-search {
  display: flex; align-items: center; gap: .6rem;
  background: #161616; box-shadow: inset 0 0 0 1px #333;
  padding: 0 1.1rem; height: 58px;
}
.v5-search:focus-within { box-shadow: inset 0 0 0 2px var(--orange); }
.v5-search input {
  flex: 1; background: none; border: 0; outline: 0; color: #fff;
  font: inherit; font-size: 1rem; min-width: 0;
}
.v5-search input::placeholder { color: #777; }
.v5-search-ic { font-size: 1rem; opacity: .7; }
.v5-status { color: var(--v5-grey); font-size: .92rem; margin: .85rem 0 0; }

/* --- Embeds ------------------------------------------------------------ */
.v5-facade {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  margin: 0 0 .9rem; overflow: hidden;
}
.v5-facade img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.v5-play {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 54px;
  background: var(--orange); color: #111; border: 0; cursor: pointer; font-size: 1.3rem;
}
.v5-play:hover { filter: brightness(1.1); }
.v5-embed { margin: 1.6rem 0 2rem; max-width: 52rem; }
.v5-embed-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #000; }
.v5-spotify { width: 100%; border: 0; border-radius: 0; display: block; }
.v5-facade--big { margin: 0; }

/* --- Facts + prev/next -------------------------------------------------- */
.v5-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 0 0 .5rem; }
.v5-facts > div { background: var(--v5-panel); border: 1px solid var(--v5-line); padding: 1rem 1.2rem; }
.v5-facts dt { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--v5-grey); margin-bottom: .4rem; }
.v5-facts dd { margin: 0; font-size: 1rem; color: #fff; }
.v5-prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.8rem; }

/* --- Responsive --------------------------------------------------------- */
@media (min-width: 640px) {
  .v5-track .v5-card { flex-basis: calc((100% - 16px) / 2); }
}
.v5-sec-head--fold { justify-content: flex-start; gap: .25rem; }
.v5-fold { flex: none; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #fff; border: 0; box-shadow: none; cursor: pointer; font-size: 1.7rem; line-height: 1; padding: .1em .15em; }
.v5-fold svg { width: .52em; height: .52em; transform: rotate(-90deg); transition: transform .18s ease; }
.v5-fold[aria-expanded="true"] svg { transform: rotate(0deg); }
@media (min-width: 1024px) {
  .v5-track .v5-card { flex-basis: calc((100% - 32px) / 3); }
}
@media (max-width: 821px) {
  body.v5 .site-header { flex-wrap: wrap; padding: .8rem 1.25rem .6rem; row-gap: .6rem; position: sticky; top: 0; z-index: 60; }
  body.v5 .logo { width: 4.4rem; order: 1; }
  /* Original mobile header: logo and Buy button share the first row,
     the nav sits centered on its own row below (user, 2026-11-09). */
  body.v5 .header-cta { order: 2; margin-left: auto; }
  body.v5 .nav { order: 3; flex: 1 1 100%; justify-content: center; margin-top: .35rem; }
  .v5-title { font-size: 1.8rem; }
  .v5-title--sm { font-size: 1.65rem; }
  .v5-lede { font-size: 1.08rem; }
  .v5-navbox { width: 50px; height: 50px; }
  .v5-tab { min-height: 44px; padding: .55rem .9rem; font-size: .88rem; }
  /* Filter bar sticks flush below the sticky mobile header (91px tall). */
  .v5-menu { top: 91px; }
}

/* --- All Sources accordion (dropdown list, original app pattern) ------ */
.v5-acc { background: var(--v5-panel); border: 1px solid var(--v5-line); margin: 0 0 .55rem; }
.v5-acc-head {
  display: flex; align-items: baseline; gap: 1.1rem; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: .5rem 1.1rem; font-family: inherit; color: #e9e9e9;
}
.v5-acc-head:hover .v5-acc-title { color: var(--orange); }
.v5-acc-num { color: var(--v5-grey); font-size: .95rem; min-width: 2rem; }
.v5-acc-main { flex: 1; min-width: 0; }
.v5-acc-title { display: block; font-size: .92rem; font-weight: 700; line-height: 1.28; color: #fff; }
.v5-acc-sub { display: block; color: var(--v5-grey); font-size: .85rem; margin-top: .12rem; }
.v5-acc-chev { color: var(--v5-grey); transition: transform .25s ease; }
.v5-acc-head[aria-expanded="true"] .v5-acc-chev { transform: rotate(180deg); }
.v5-acc-panel { border-top: 1px solid var(--v5-line); padding: 1.2rem 1.3rem 1.4rem 4.4rem; }
.v5-acc-label { font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--v5-grey); margin: 1.1rem 0 .5rem; }
.v5-acc-panel > .v5-acc-label:first-child { margin-top: 0; }
.v5-acc-chaps a { color: #fff; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; line-height: 1.7; }
.v5-commentary {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: 1.05rem; line-height: 1.6; color: #d8d8d8;
  border-left: 2px solid var(--orange); margin: 0 0 .4rem; padding-left: 1rem;
}
.v5-acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1.3rem 0 0; }
.v5-acc-details { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .v5-acc-panel { padding-left: 1.3rem; } }

/* --- Videos smaller on desktop (user, 2026-11-09) --------------------- */
@media (min-width: 1024px) {
  .v5-card .v5-facade, .v5-acc-panel .v5-facade { max-width: 400px; }
  .v5-embed { max-width: 40rem; }
  .v5-embed .v5-facade { max-width: none; }
}

/* --- Batch 2026-11-09 evening: featured cards, tags, crumbs, chapbar,
       contents modal, floating search widget ------------------------- */
.v5-card--link { display: block; text-decoration: none; color: #e9e9e9; }
.v5-card--link .v5-byline { color: var(--v5-grey); }
.v5-card--link .v5-card-title { color: #fff; }
.v5-tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.v5-tag {
  display: inline-block; background: transparent; color: #fff; text-decoration: none;
  padding: .8rem 1.3rem; font-size: 1rem; font-weight: 600;
  box-shadow: inset 0 0 0 1px #2c2c2c;
}
.v5-tag:hover { box-shadow: inset 0 0 0 1px var(--orange); color: var(--orange); }
.v5-tag .cnt { color: var(--v5-grey); font-size: .85rem; margin-left: .45rem; }
.v5-backrow { margin: 0 0 1rem; }
.v5-backbtn {
  display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .95rem;
  color: #fff; text-decoration: none; font-size: .88rem; font-weight: 600;
  background: transparent; box-shadow: inset 0 0 0 1px #3d3d3d;
}
.v5-backbtn:hover { box-shadow: inset 0 0 0 1px var(--orange); color: var(--orange); }
.v5-crumbs { font-size: .9rem; line-height: 1.8; color: #444444; margin: 0 0 2rem; }
.v5-crumbs a { color: #444444; text-decoration: none; }
.v5-crumbs a:hover { color: #444444; }
.v5-crumbs .sep { margin: 0 .5rem; color: #444444; }
.v5-crumbs [aria-current] { color: #444444; }

/* Chapter sub nav (Appendix II pattern) */
.chapbar5 { position: sticky; top: 0; z-index: 40; background: var(--bg); border-block: 1px solid var(--v5-line); margin: 0 0 2rem; }
.chapbar5-tabs { display: flex; flex-wrap: wrap; gap: .55rem; padding: .8rem 0; }
.chapbar5 .v5-tab { min-height: 44px; padding: .55rem .95rem; font-size: .88rem; }
.chapbar5-panel { border-top: 1px solid var(--v5-line); padding: 1.1rem 0 1.3rem; }
.chapbar5-panel[hidden] { display: none; }
.chapbar5-rows { max-height: 320px; overflow: auto; display: grid; gap: .35rem; }
.chapbar5-rows a { color: #e9e9e9; text-decoration: none; padding: .45rem .2rem; display: flex; justify-content: space-between; gap: 1rem; }
.chapbar5-rows a:hover { color: var(--orange); }
.chapbar5-rows .cnt { color: var(--v5-grey); font-size: .88rem; }

/* Contents modal (Appendix IV box style) */
.v5-modal { position: fixed; inset: 0; z-index: 90; background: rgba(8,8,8,.82); display: flex; align-items: flex-start; justify-content: center; padding: 4.5rem 1rem 2rem; overflow: auto; }
.v5-modal[hidden] { display: none; }
.v5-modal-box { background: #151515; border: 1px solid var(--orange); max-width: 47.5rem; width: 100%; padding: 1.8rem 2rem 2rem; }
.v5-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.v5-modal-title { font-family: var(--font); text-transform: uppercase; font-size: 1.5rem; color: #fff; margin: 0; }
.v5-modal-close { background: var(--orange); color: #111; border: 0; width: 44px; height: 44px; font-size: 1.25rem; font-weight: 800; cursor: pointer; }
.v5-modal .v5-part { margin-top: 1.3rem; }
.v5-modal-ch { display: flex; justify-content: space-between; gap: 1rem; color: #e9e9e9; text-decoration: none; padding: .5rem .1rem; border-bottom: 1px solid #222; }
.v5-modal-ch:hover { color: var(--orange); }
.v5-modal-ch[aria-current] { color: var(--orange); }
.v5-modal-ch .cnt { color: var(--v5-grey); font-size: .88rem; white-space: nowrap; }

/* Floating search & contents widget (Lovable pattern) */
.v5-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 80;
  display: flex; align-items: center; gap: .8rem;
  background: #1b1b1b; border: 1px solid #3a3a3a; color: #fff;
  padding: .5rem .5rem .5rem 1.15rem; cursor: pointer; font-family: 'Inter', sans-serif;
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
.v5-pill-label { font-size: .86rem; font-weight: 800; letter-spacing: .16em; display: flex; align-items: center; gap: .6rem; }
.v5-pill-btn { background: var(--orange); color: #111; width: 46px; height: 46px; display: grid; place-items: center; }
.v5-totop {
  position: fixed; right: 1rem; bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 7px); z-index: 80;
  background: transparent; color: var(--v5-grey); border: 0; box-shadow: inset 0 0 0 1.5px var(--v5-grey);
  width: 48px; height: 48px; font-size: 1.35rem; font-weight: 800; cursor: pointer;
  display: grid; place-items: center; font-family: 'Inter', sans-serif; line-height: 1;
}
.v5-totop[hidden] { display: none; }
.v5-totop:active { background: var(--v5-grey); color: #111; }
@media (hover: hover) and (pointer: fine) { .v5-totop:hover { background: var(--v5-grey); color: #111; } }
.v5-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(9,9,9,.98); overflow: auto; }
.v5-overlay[hidden] { display: none; }
.v5-overlay-in { max-width: 56rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; font-family: 'Inter', sans-serif; }
.v5-ov-closewrap {
  position: sticky; top: 0; z-index: 97; margin: 0;
  background: #090909; border-bottom: 1px solid #262626;
  display: flex; justify-content: flex-end; align-items: center;
  height: 64px; padding: 0 max(1.25rem, calc((100% - 56rem) / 2 + 1.25rem));
}
.v5-overlay-close { position: static; flex: none; background: transparent; color: var(--orange); border: 0; box-shadow: inset 0 0 0 1.5px var(--orange); width: 48px; height: 48px; font-size: 1.35rem; font-weight: 800; cursor: pointer; }
.v5-ov-fade {
  position: sticky; bottom: 0; z-index: 96;
  height: 96px; margin-top: -96px;
  background: linear-gradient(to bottom, rgba(9,9,9,0), #090909);
  pointer-events: none;
}
@media (max-width: 1023px) {
  .v5-overlay-in { padding-top: 1.25rem; }
}
.v5-overlay-close:hover { background: var(--orange); color: #111; }
.v5-ov-label { font-size: .8rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--v5-grey); margin: 0 0 .9rem; }
.v5-ov-search { display: flex; align-items: center; gap: .7rem; background: #141414; box-shadow: inset 0 0 0 1px #333; padding: 0 .5rem 0 1.1rem; height: 62px; }
.v5-ov-search:focus-within { box-shadow: inset 0 0 0 2px var(--orange); }
.v5-ov-search input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 1.05rem; min-width: 0; }
.v5-ov-go { background: var(--orange); color: #111; border: 0; width: 46px; height: 46px; font-size: 1.2rem; font-weight: 800; cursor: pointer; flex: none; }
.v5-ov-results { margin: 1rem 0 0; display: grid; gap: .4rem; }
.v5-ov-results a { display: flex; justify-content: space-between; gap: 1rem; background: #151515; border: 1px solid var(--v5-line); color: #e9e9e9; text-decoration: none; padding: .8rem 1rem; }
.v5-ov-results a:hover { border-color: var(--orange); }
.v5-ov-results .kind { display: inline-flex; align-items: center; flex: none; margin-left: 1rem; }
.v5-ov-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 2.2rem; }
.v5-ov-tile { background: #121212; border: 1px solid var(--v5-line); color: #fff; text-decoration: none; padding: 1.5rem 1.3rem; font-weight: 800; letter-spacing: .08em; font-size: .95rem; display: flex; align-items: center; gap: .8rem; }
.v5-ov-tile:hover { border-color: var(--orange); color: var(--orange); }
.v5-ov-contents { margin-top: 2.4rem; }
.v5-ov-contents .v5-modal-ch { border-bottom-color: #1e1e1e; }
@media (max-width: 640px) { .v5-ov-tiles { grid-template-columns: 1fr 1fr; } .v5-pill-label .txt { display: none; } }

/* --- Batch 2026-11-09 late: accordion button colors, chapter numbers,
       chapter index dropdown ------------------------------------------ */
.v5-acc-actions .v5-btn { color: #f2f2f2; box-shadow: inset 0 0 0 1.5px #e6e6e6; gap: .45rem; text-decoration: none; font-weight: 600; }
.v5-acc-actions .v5-btn:hover { background: #f2f2f2; color: #111; }
.v5-acc-actions .v5-btn.v5-acc-details { color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.v5-acc-actions .v5-btn.v5-acc-details:hover { background: var(--orange); color: #111; }
.v5-nums { display: flex; flex-wrap: wrap; gap: .55rem; }
.v5-num {
  width: 52px; height: 52px; display: grid; place-items: center;
  background: transparent; color: #fff; border: 1px solid #343434;
  text-decoration: none; font-weight: 700; font-size: 1.05rem;
}
.v5-num:hover { border-color: var(--orange); color: var(--orange); }
.v5-num[aria-current="true"] { border-color: var(--orange); color: var(--orange); }
.v5-numidx {
  width: 200px; justify-content: center;
  height: 52px; padding: 0 1.05rem; display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: #fff; border: 1px solid #343434; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; letter-spacing: .06em;
}
.v5-numidx:hover { border-color: var(--orange); color: var(--orange); }
.v5-numidx[aria-expanded="true"] { border-color: var(--orange); color: var(--orange); }
.v5-idx-box { border: 1px solid var(--orange); background: #141414; padding: 1.6rem 1.8rem 1.8rem; margin-top: 1.2rem; }
.v5-idx-box[hidden] { display: none; }
.v5-idx-head { font-size: .82rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); margin: 0 0 .4rem; }
.v5-idx-row { display: flex; gap: 1.15rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid #222; color: #eee; text-decoration: none; line-height: 1.45; }
.v5-idx-row .n { color: var(--orange); font-weight: 800; min-width: 1.6rem; }
.v5-idx-row:hover .t { color: var(--orange); }
.v5-idx-row[aria-current="true"] .t { color: var(--orange); }
.chapbar5-panel .v5-idx-box { max-height: 400px; overflow: auto; }

/* --- Overlay contents list: Lovable structure (serif titles, grey
       numbers, hairlines, open spacing) ------------------------------- */
.v5-ov-part { margin-top: 2.1rem; }
.v5-ov-part-k { font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #9a9a9a; margin: 0 0 .35rem; }
.v5-ov-part-t {
  font-family: var(--font); text-transform: uppercase; font-weight: 600;
  font-size: 1.55rem; line-height: 1.12; color: #fff;
  margin: 0; padding-bottom: .9rem; border-bottom: 1px solid #2c2c2c;
}
.v5-ov-ch { display: flex; gap: 1.4rem; align-items: baseline; padding: 1.02rem 0; border-bottom: 1px solid #222; text-decoration: none; }
.v5-ov-ch .n { color: #8f8f8f; font-size: .95rem; min-width: 1.8rem; }
.v5-ov-ch .t { font-family: 'EB Garamond', Garamond, Georgia, serif; font-size: 1.5rem; line-height: 1.25; color: #f4f4f4; }
.v5-ov-ch:hover .t { color: var(--orange); }

/* --- Batch 2026-11-09 night: source-page hierarchy calming, status
       line blanked (space kept) -------------------------------------- */
.v5-kicker--quiet { color: #666; font-weight: 400; }
.v5-byline--calm { color: #a8a8a8; }
.v5-facts dd { color: #d5d5d5; }
.v5-status { visibility: hidden; }

/* --- Batch 2026-11-09 evening 2: overlay tabs + tiles as filters,
       close aligned to the column, next-source tile ------------------ */
.v5-ov-go { display: grid; place-items: center; }
.v5-ov-tabs { display: flex; flex-wrap: wrap; gap: 1.6rem; border-bottom: 1px solid #262626; margin-top: 1.1rem; }
.v5-ov-tab {
  background: none; border: 0; color: #9a9a9a; font: inherit; cursor: pointer;
  font-size: .92rem; font-weight: 700; letter-spacing: .06em;
  padding: .55rem 0 .7rem; margin-bottom: -1px; box-shadow: 0 2px 0 transparent;
}
.v5-ov-tab .cnt { color: #6f6f6f; font-weight: 600; }
.v5-ov-tab[aria-selected="true"] { color: #fff; box-shadow: 0 2px 0 var(--orange); }
.v5-ov-tab[aria-selected="true"] .cnt { color: #9a9a9a; }
.v5-ov-tile { font-family: inherit; text-align: left; cursor: pointer; }
.v5-ov-none { color: var(--v5-grey); margin: .6rem 0 0; }
.chapbar5 .v5-tab[aria-expanded="true"] { color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.v5-acc .v5-chips { margin-top: 1rem; }
.v5-nexttile { margin: 2.6rem 0 0 auto; max-width: 430px; }
.v5-nexttile a {
  display: block; border: 1px solid #2e2e2e; padding: 1.05rem 1.3rem 1.15rem;
  text-decoration: none; text-align: right; background: transparent;
}
.v5-nexttile a:hover { border-color: var(--orange); }
.v5-nexttile-k { display: block; font-size: .82rem; font-weight: 700; color: #9a9a9a; margin-bottom: .45rem; }
.v5-nexttile-t { display: block; font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 700; font-size: 1.18rem; line-height: 1.3; color: #f4f4f4; }
.v5-nexttile-m { display: block; margin-top: .4rem; font-size: .88rem; color: #8a8a8a; }

/* Chapter numbers: 3 rows on mobile (7 + 7 + 6) */
@media (max-width: 640px) {
  .v5-nums { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; }
  .v5-nums .v5-num { width: auto; height: 44px; font-size: 1rem; }
  .v5-nums .v5-numidx { grid-column: span 4; width: auto; height: 44px; justify-content: center; }
}

/* Part icons (orange skyline progression, 2026-11-09) */
.v5-particon { display: block; width: 100%; max-width: 30rem; height: auto; margin: .35rem 0 1.1rem; }
.v5-particon--idx { max-width: 21rem; margin: 1.5rem 0 .85rem; }
.v5-idx-head + .v5-particon--idx { margin-top: .5rem; }

/* Desktop: tighten the gap under the All Sources search bar (user, 2026-11-09).
   The hidden status line keeps its space on mobile only. */
@media (min-width: 1024px) {
  .v5-menu { padding-bottom: .8rem; margin-bottom: 1rem; }
  .v5-status { margin-top: 0; height: 0; overflow: hidden; }
}

/* Podcast audio embeds (2026-11-09) */
.v5-audio { width: 100%; height: 54px; display: block; margin: 0 0 .9rem; }
.v5-buzz { width: 100%; border: 0; display: block; margin: 0 0 .9rem; }
.v5-embed-src { margin: .9rem 0 0; }

/* Polish pass 2026-11-26: layout-shift floor, pill clearance, tighter mobile controls */
#v5-list { min-height: 55vh; }
.v5-wrap { padding-bottom: 5.5rem; }
@media (max-width: 1023px) {
  .v5-menu { margin-bottom: .35rem; padding-bottom: .4rem; }
  .v5-track .v5-card { padding: 1.05rem 1.1rem; }
}

/* --- Desktop: search joins the first menu row; main header sticks ---- */
@media (min-width: 822px) {
  body.v5 .site-header { position: sticky; top: 0; z-index: 60; }
  .v5-menu { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 1rem; top: calc(118 * var(--u)); }
  .v5-menu { border-block: 0; padding: .45rem 0 .55rem; margin-bottom: 1.1rem; }
  .v5-tabs { order: 1; }
  .v5-search { order: 2; flex: 1 1 15rem; height: 44px; margin-bottom: .6rem; }
  .v5-filters { order: 3; flex: 1 1 100%; }
  .v5-status { order: 4; flex: 1 1 100%; }
}

/* --- Mobile menu: search beside All sources, selector trio below ------ */
@media (max-width: 821px) {
  .v5-menu { display: flex; flex-wrap: wrap; gap: .6rem; }
  .v5-tabs { display: contents; }
  .v5-tab { order: 3; flex: 1 1 0; }
  .v5-tab[data-mode="all"] { order: 1; flex: 0 0 auto; }
  .v5-search { order: 2; flex: 1 1 8rem; height: 44px; min-width: 0; }
  .v5-tab[data-mode="chapters"] { order: 3; }
  .v5-tab[data-mode="topics"] { order: 4; }
  .v5-tab[data-mode="featured"] { order: 5; }
  .v5-filters { order: 6; flex: 1 1 100%; }
  .v5-status { order: 7; flex: 1 1 100%; }
}

/* Appendix header = the main header's exact positioning, shaved (2026-11-26) */
@media (min-width: 822px) {
  body.v5 .site-header { display: block; height: calc(110 * var(--u)); padding: 0; }
  body.v5 .logo { position: absolute; left: calc(49.78 * var(--u)); top: calc(27 * var(--u)); width: calc(124 * var(--u)); margin: 0; }
  body.v5 .nav { position: absolute; left: 50%; transform: translateX(-50%); top: calc(38 * var(--u)); margin: 0; }
  body.v5 .header-cta { position: absolute; right: calc(50.28 * var(--u)); top: calc(27 * var(--u)); margin: 0; }
  .v5-menu { top: calc(110 * var(--u)); }
  body.v5 .frame { z-index: 70; }
  .v5-totop { right: calc(13 * var(--u) + 1.25rem); }
}
body.v5 .site-footer { padding-bottom: 8rem; }

/* Source pages: mirrored Back/Next tiles (2026-11-26) */
.v5-prevnext-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.6rem; }
.v5-prevnext-tiles .v5-nexttile { margin: 0; max-width: none; }
.v5-nexttile--back a { text-align: left; }
@media (max-width: 640px) { .v5-prevnext-tiles { grid-template-columns: 1fr; } }

/* Mobile: main-header paddings on the appendix header + compact menu tags (2026-11-26) */
@media (max-width: 821px) {
  body.v5 .site-header { padding: .8rem 1.5rem .6rem; row-gap: .5rem; }
  .v5-menu { gap: .45rem; align-items: center; padding-top: .8rem; padding-bottom: .4rem; margin-bottom: 0; }
  .v5-tab { min-height: 36px; padding: .35rem .7rem; font-size: .82rem; }
  .v5-fbtn { min-height: 36px; padding: .35rem .7rem; font-size: .82rem; }
  .v5-filters { gap: .45rem; margin-bottom: 0; }
  .v5-status { margin-top: .3rem; font-size: .85rem; }
}
/* Desktop: Beyond the Book at the nav font size (2026-11-26) */
@media (min-width: 822px) {
  .v5-beyond-h { font-size: var(--fs-s); }
}

/* Mobile: kill the last header offset + tighten the first group heading (2026-11-26) */
@media (max-width: 821px) {
  body.v5 .nav { margin-top: 0; }
  .v5-group { margin-top: 1rem; }
}

/* Mobile menu: search fills row 1 beside All sources, tabs keep their own row,
   search matches the tag height, status sits tight under the last filter row (2026-11-26) */
@media (max-width: 821px) {
  .v5-search { flex: 1 1 auto; height: 36px; min-height: 36px; }
  .v5-search input { height: 100%; font-size: .82rem; }
  .v5-status { margin-top: -2px; }
}

/* Mobile menu as a grid: All sources + search share row 1, mode tabs row 2 (2026-11-26) */
@media (max-width: 821px) {
  .v5-menu { display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: .45rem; row-gap: .45rem; align-items: stretch; padding-bottom: .15rem; }
  .v5-tabs { display: contents; }
  .v5-tab[data-mode="all"] { grid-column: 1; grid-row: 1; }
  .v5-search { grid-column: 2 / 4; grid-row: 1; height: 36px; min-height: 36px; }
  .v5-tab[data-mode="chapters"] { grid-column: 1; grid-row: 2; }
  .v5-tab[data-mode="topics"] { grid-column: 2; grid-row: 2; }
  .v5-tab[data-mode="featured"] { grid-column: 3; grid-row: 2; }
  .v5-filters { grid-column: 1 / -1; grid-row: 3; }
  .v5-status { grid-column: 1 / -1; grid-row: 4; }
  #v5-list > .v5-group:first-child { margin-top: .35rem; }
}

/* Mobile: header 1px overlap, subnav sticks flush under the 84px header (2026-11-26) */
@media (max-width: 821px) {
  body.v5 .site-header { top: -1px; padding-top: calc(.8rem + 1px); }
  .v5-menu { top: 83px; }
}

/* Mobile menu: tighter above the first row and under the last filter row (2026-11-26) */
@media (max-width: 821px) {
  .v5-menu { padding-top: .35rem; padding-bottom: 0; }
  .v5-status { line-height: 1.15; }
  #v5-list > .v5-group:first-child { margin-top: .1rem; }
}
