 <style>
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 1rem;
  line-height: 1.4;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
      
strong {
  font-weight: 700;
  background: #fff3a0; /* soft yellow highlight */
  padding: 0 2px;
  border-radius: 3px;
}

p {
    margin: 0 0 0.5em;
}

.compact p,
p.compact {
    margin: 0;
    line-height: 1.2;
}

blockquote {
  margin: 0 0 0.75em 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid #ccc;
  line-height: 1.5;
}

/* =========================
   SKIP LINK
========================= */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  position: absolute;  
  left: 10px;
  top: 10px;
  background: #fff;
  padding: 0.5rem;
  border: 2px solid #000;
  z-index: 1000;
}

/* =========================
   MAIN CONTENT
========================= */

main {
  flex: 1 1 600px;
  max-width: 900px;
  padding: 1.5rem;
  border: 2px solid #555;
  border-radius: 12px;
  background-color: #fdfdfd;
  position: relative;
}

/* =========================
   TYPOGRAPHY
========================= */

header, footer {
  text-align: center;
}

header img {
  max-width: 100%;
  height: auto;
}

h1 {
  text-align: center;
  font-size: 2rem;
  margin: 0.5rem 0;
}

h2, h3 {
  text-align: left;
  scroll-margin-top: 20px;
}

h2 { margin-top: 2rem; }
h3 { margin-top: 1.5rem; }

/* =========================
   FIGURES
========================= */

figure {
  border: 1px solid #555;
  background: #fff;
  padding: 6px;
  margin: 1rem;
}

/* Responsive images */
figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Figure captions */
figcaption {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* =========================
   FLOATING FIGURES
========================= */

.figure-left {
  float: left;
  margin: 0.5rem 1rem 0.5rem 0;
  max-width: 40%;
}

.figure-right {
  float: right;
  margin: 0.5rem 0 0.5rem 1rem;
  max-width: 40%;
}

/* Keep new sections below floated figures */
h2, h3, h4 {
  clear: both;
}

/* =========================
   CENTERED FIGURES
========================= */

.figure-center {
  clear: both;
  width: fit-content;
  margin: 1.5rem auto;
  text-align: center;
}

/* =========================
   MOBILE / TABLET
========================= */

@media (max-width: 768px) {

  .figure-left,
  .figure-right,
  .figure-center {
    float: none;
    width: fit-content;
    max-width: 100%;
    margin: 1rem auto;
  }
}

a:focus, a:hover {
  text-decoration: underline;
}

hr {
  border: 1px solid #555;
  margin: 2rem 0;
}

/* =========================
   Honor users choice on scrolling
========================= */
html {
  scroll-behavior: smooth;
}

/* =========================
   TOC (DESKTOP)
========================= */

.toc {
  position: sticky;
  top: 12px;
  flex: 0 0 240px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: #fff;
  border: 2px solid #555;
  border-radius: 10px;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.toc-details {
  display: block;
}

.toc summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.25rem 0;
}

.toc summary::-webkit-details-marker {
  display: none;
}

/* lists */
.toc ul {
  list-style: none;
  padding-left: 0.5rem;
  margin: 0.5rem 0 0 0;
}

.toc li {
  margin: 4px 0;
}

.toc ul ul {
  padding-left: 1rem;
  margin-left: 0.5rem;
  border-left: 1px solid #ccc;
}

.toc a {
  text-decoration: none;
  color: #000;
  display: block;
  padding: 2px 0;
}

.toc a:hover {
  text-decoration: underline;
}

/* ACTIVE SECTION (used by JS later) */
.toc a.active {
  font-weight: 800 !important;
  text-decoration: underline;
}

/* =========================
   BACK TO TOP
========================= */
.top-button-container {
    position: sticky;
    bottom: 1rem;
    height: 3rem;
    display: flex;
    justify-content: flex-end;
}

.back-to-top {
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 2px solid #555;
    border-radius: 8px;
    text-decoration: none;
}


/* =========================
   RESPONSIVE BREAKPOINT
   (FIXED ALIGNMENT)
========================= */

@media (max-width: 1250px) {

  body {
    flex-direction: column;
  }

  .toc {
    position: static;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 1rem auto;
    flex: none;
    max-height: none;
    overflow: visible;
  }

  main {
    max-width: 900px;
    margin: 0 auto;
  }
}

/* =========================
   SMALL SCREENS
========================= */

@media (max-width: 700px) {
  main {
    max-width: 100%;
    margin: 0 auto;
  }

  .toc summary {
    font-size: 1rem;
  }

   .top-button-container {
        position: fixed;
        right: 1rem;
        bottom: 1.5rem;
        z-index: 1000;
    }

    .back-to-top {
        display: inline-block;
        padding: 0.5rem 0.75rem;
        background: #fff;
        border: 2px solid #555;
        border-radius: 8px;
        text-decoration: none;
        box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
    }
  }
  
  /* =========================
   PERSONALITY THEORIES HOME PAGE
========================= */

/* Center the entire home page rather than reserving
   space for the chapter-page TOC */
.home-page {
    display: block;
}

.home-page main {
    max-width: 1100px;
    margin: 0 auto;
}

/* Two-column home-page layout */
.home-columns {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.home-intro {
    flex: 1.4;
}

.home-toc {
    flex: 0.8;
    border-left: 2px solid #ccc;
    padding-left: 1.5rem;
}

.home-toc ul {
    margin-top: 0.5rem;
}

.home-toc li {
    margin-bottom: 0.4rem;
}

/* Stack the two home-page columns on smaller screens */
@media (max-width: 900px) {

    .home-columns {
        display: block;
    }

    .home-toc {
        border-left: none;
        border-top: 2px solid #ccc;
        margin-top: 2rem;
        padding-left: 0;
        padding-top: 1rem;
    }

}
</style>