/* ============================================================
   Calculation Hub — Component Styles (HUB CORE)
   Governance v6 — Component Authority Lock
   ------------------------------------------------------------
   Owns:
   - Shared components
   - Internal formatting
   - Sidebar component styling
   - Steps / Analyzer internals
   - Shared header/nav component styling
   - Tutorial / educational component styling

   Does NOT own:
   - Panel shell visuals → pp-panels.css
   - Layout grid → pp-layout.css
   - Primitive systems (btn/input) → pp-atoms.css
   - Tool-leaf internals → tool-shell.css
   ============================================================ */


/* ============================================================
   ACCESSIBILITY — SKIP LINK
   ============================================================ */
.pp-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;

  padding: 8px 12px;

  background: var(--pp-brand-900);
  color: var(--pp-surface-base);
  border-radius: var(--pp-radius-sm);

  font-size: var(--pp-small-size);
  text-decoration: none;
}

.pp-skip-link:focus {
  left: 16px;
  top: 12px;
  z-index: 2000;
}


/* ============================================================
   GLOBAL HEADER COMPONENTS
   ============================================================ */
.pp-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--pp-brand-900);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.pp-brand-mark {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}


/* ============================================================
   CATEGORY NAV
   ============================================================ */
.pp-category-nav {
  margin-left: auto;
}

.pp-category-list {
  display: flex;
  align-items: center;
  gap: 22px;

  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-category-item a {
  display: inline-flex;
  align-items: center;

  padding-bottom: 4px;

  color: var(--pp-text-600);
  text-decoration: none;
  font-size: var(--pp-body-size);
  line-height: 1.2;

  transition: color var(--pp-trans-fast);
}

.pp-category-item a:hover {
  color: var(--pp-brand-900);
}

.pp-category-item.is-active a {
  color: var(--pp-brand-900);
  border-bottom: 2px solid var(--pp-brand-700);
  font-weight: 600;
}


/* ============================================================
   PANEL INTERNAL RHYTHM NORMALIZATION
   ============================================================ */
.pp-panel__body > :first-child {
  margin-top: 0;
}

.pp-panel__body > :last-child {
  margin-bottom: 0;
}


/* ============================================================
   LEGACY STEPS / ANALYZER HOOKS
   ============================================================ */
.steps-card,
.pp-steps,
.analyzer-card,
.pp-analyzer {
  width: 100%;
  box-sizing: border-box;
}


/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.pp-sidebar-title {
  margin: 0 0 12px;
  padding-bottom: 10px;

  border-bottom: 1px solid var(--pp-border-subtle);

  color: var(--pp-text-700);
  font-size: var(--pp-small-size);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.pp-sidebar-list {
  display: grid;
  gap: 2.5px;

  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-sidebar-item a {
  display: block;

  padding: 6px 11px;

  border: 1px solid transparent;
  border-radius: 11px;

  color: var(--pp-text-800);
  text-decoration: none;
  line-height: 1.24;

  transition:
    background var(--pp-trans-fast),
    border-color var(--pp-trans-fast),
    color var(--pp-trans-fast);
}

.pp-sidebar-item a:hover {
  background: var(--pp-surface-muted);
  border-color: var(--pp-border-subtle);
  color: var(--pp-text-900);
}

.pp-sidebar-item.is-active a {
  background: color-mix(in srgb, var(--pp-brand-900) 3%, var(--pp-surface-base));
  border-color: var(--pp-border-structural);
  color: var(--pp-brand-900);
  font-weight: 600;
}

.pp-sidebar-section + .pp-sidebar-section {
  margin-top: 22px;
}

/* ============================================================
   PAGE INDEX — IN-FLOW CARD VARIANT
   ------------------------------------------------------------
   File: public/styles/pp-components.css

   PURPOSE
   - Shared in-flow presentation for PageIndex when rendered
     below a hero workspace instead of inside a sidebar slot

   OWNERSHIP
   - Shared component styling only
   ============================================================ */

.pp-page-index--flow-card {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-xl);
  background: var(--pp-surface-0);
  box-shadow: var(--pp-shadow-xs);
}

.pp-page-index--flow-card .pp-sidebar-title {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pp-border-subtle);
}

.pp-page-index--flow-card .pp-sidebar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pp-page-index--flow-card .pp-sidebar-item {
  margin: 0;
}

.pp-page-index--flow-card .pp-sidebar-item a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--pp-border-subtle);
  border-radius: 999px;
  background: var(--pp-surface-0);
  white-space: nowrap;
}

.pp-page-index--flow-card .pp-sidebar-item a:hover {
  border-color: var(--pp-border-strong);
}

.pp-page-index--flow-card .pp-sidebar-item.is-active a,
.pp-page-index--flow-card .pp-sidebar-item a[aria-current="location"] {
  background: var(--pp-surface-muted);
  border-color: var(--pp-border-strong);
  color: var(--pp-text-900);
  font-weight: 600;
}

@media (max-width: 767px) {
  .pp-page-index--flow-card {
    padding: 16px;
  }

  .pp-page-index--flow-card .pp-sidebar-list {
    gap: 8px;
  }

  .pp-page-index--flow-card .pp-sidebar-item a {
    min-height: 34px;
    padding: 0 12px;
  }
}


/* ============================================================
   PANEL HEADER COMPONENT
   ============================================================ */
.pp-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pp-panel__title {
  margin: 0;

  color: var(--pp-text-900);
  font-size: var(--pp-h3-size);
  font-weight: 700;
  line-height: 1.24;
}


/* ============================================================
   SHARED SURFACE HEAD
   ============================================================ */
.surface-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.surface-title {
  margin: 0;

  color: var(--pp-text-900);
  font-size: var(--pp-h3-size);
  font-weight: 700;
  line-height: 1.24;
}

.surface-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}


/* ============================================================
   STEPS / ANALYZER HEADER DIVIDER
   ============================================================ */
.pp-panel--steps .surface-head,
.pp-panel--analyzer .surface-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pp-border-subtle);
}


/* ============================================================
   STEPS INTERNAL RHYTHM
   ============================================================ */
.steps-card .problem,
.steps-card .pp-steps-problem {
  margin-top: 0;
  margin-bottom: 15px;

  color: var(--pp-text-800);
  font-size: var(--pp-body-size);
  line-height: 1.58;
}

.steps-card .step-item + .step-item,
.steps-card .pp-step-item + .pp-step-item {
  margin-top: 20px;
}

.steps-card .step-title,
.steps-card .pp-step-title {
  margin: 0 0 7px;

  color: var(--pp-text-900);
  font-weight: 600;
  line-height: 1.32;
}

.steps-card .step-math,
.steps-card .pp-step-math {
  margin: 0;
  color: var(--pp-text-800);
  line-height: 1.58;
}

.steps-card .final-answer,
.steps-card .pp-step-final {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--pp-border-subtle);

  color: var(--pp-text-900);
  font-weight: 700;
  line-height: 1.42;
}


/* ============================================================
   ANALYZER INTERNAL HIERARCHY
   ============================================================ */
.pp-panel--analyzer .analyzer-content {
  margin-top: 12px;
}

.pp-panel--analyzer .pp-analyzer-subtitle,
.pp-panel--analyzer .pp-analyzer-label {
  margin: 0 0 8px;

  color: var(--pp-text-900);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.32;
}

.pp-panel--analyzer .pp-analyzer-summary,
.pp-panel--analyzer .pp-analyzer-text {
  margin: 0;

  color: var(--pp-text-800);
  line-height: 1.62;
}

.pp-panel--analyzer .pp-analyzer-text + .pp-analyzer-text,
.pp-panel--analyzer .pp-analyzer-summary + .pp-analyzer-text {
  margin-top: 10px;
}

.pp-panel--analyzer .pp-analyzer-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--pp-border-subtle);
}


/* ============================================================
   ORDERED CONTENT SEQUENCE
   ------------------------------------------------------------
   PURPOSE
   - Shared semantic presentation for guided workflows and
     deterministic calculation explanations.
   - Preserves one ordered-list DOM across desktop and mobile.
   - Mobile rows give narrative copy the full available measure.
   ============================================================ */
.pp-content-intro {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 72rem;
  min-width: 0;
}

.pp-content-sequence {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-content-sequence__item,
.pp-content-sequence__copy,
.pp-content-sequence__evidence {
  min-width: 0;
}

.pp-content-sequence__copy {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.pp-content-sequence__copy h3,
.pp-content-sequence__copy p,
.pp-content-sequence__evidence span,
.pp-content-sequence__evidence code {
  margin: 0;
}

.pp-content-sequence__copy h3 {
  color: var(--pp-text-900);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.pp-content-sequence__copy p {
  color: var(--pp-text-700);
  line-height: 1.58;
}

.pp-content-sequence__index {
  display: inline-flex;
  width: fit-content;
  min-height: 1.9rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  border: 1px solid color-mix(in srgb, var(--pp-brand-700) 20%, var(--pp-border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pp-brand-100) 42%, var(--pp-surface-base));
  color: var(--pp-brand-900);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.pp-content-sequence--workflow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.pp-content-sequence--workflow .pp-content-sequence__item {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--pp-border-subtle);
  border-top: 3px solid color-mix(in srgb, var(--pp-brand-700) 48%, var(--pp-border-subtle));
  border-radius: var(--pp-radius-md);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--pp-surface-muted) 58%, var(--pp-surface-base)),
    var(--pp-surface-base)
  );
}

.pp-content-sequence--calculation {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-md);
  background: var(--pp-surface-base);
}

.pp-content-sequence--calculation .pp-content-sequence__item {
  display: grid;
  grid-template-columns: minmax(4rem, 4.75rem) minmax(0, 1fr) minmax(18rem, 0.72fr);
  gap: 1rem;
  align-items: stretch;
  min-width: 0;
}

.pp-content-sequence--calculation .pp-content-sequence__item + .pp-content-sequence__item {
  border-top: 1px solid var(--pp-border-subtle);
}

.pp-content-sequence--calculation .pp-content-sequence__index {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  padding: 0.75rem;
  border: 0;
  border-right: 1px solid var(--pp-border-subtle);
  border-radius: 0;
  background: color-mix(in srgb, var(--pp-surface-muted) 78%, var(--pp-surface-base));
}

.pp-content-sequence--calculation .pp-content-sequence__copy {
  align-content: center;
  padding: 1rem 0;
}

.pp-content-sequence__evidence {
  display: grid;
  gap: 0.35rem;
  align-self: center;
  margin: 0.85rem 1rem 0.85rem 0;
  padding: 0.75rem;
  border-radius: var(--pp-radius-sm);
  background: color-mix(in srgb, var(--pp-surface-muted) 78%, var(--pp-surface-base));
}

.pp-content-sequence__evidence > span {
  color: var(--pp-text-600);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.15;
  text-transform: uppercase;
}

.pp-content-sequence__evidence code {
  color: var(--pp-text-900);
  font-family: var(--pp-mono);
  font-size: 0.8rem;
  line-height: 1.48;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .pp-content-sequence--calculation .pp-content-sequence__item {
    grid-template-columns: minmax(3.5rem, 4rem) minmax(0, 1fr);
  }

  .pp-content-sequence--calculation .pp-content-sequence__evidence {
    grid-column: 2;
    margin: 0 1rem 1rem 0;
  }
}

@media (max-width: 900px) {
  .pp-content-sequence--workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .pp-content-intro {
    max-width: none;
  }

  .pp-content-sequence--workflow,
  .pp-content-sequence--calculation {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .pp-content-sequence--workflow .pp-content-sequence__item,
  .pp-content-sequence--calculation .pp-content-sequence__item {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem 0.65rem;
    min-width: 0;
    padding: 0.9rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .pp-content-sequence--workflow .pp-content-sequence__item {
    grid-template-areas:
      "index title"
      "body body";
  }

  .pp-content-sequence--calculation .pp-content-sequence__item {
    grid-template-areas:
      "index title"
      "body body"
      "evidence evidence";
  }

  .pp-content-sequence--workflow .pp-content-sequence__item:first-child,
  .pp-content-sequence--calculation .pp-content-sequence__item:first-child {
    padding-top: 0;
  }

  .pp-content-sequence--workflow .pp-content-sequence__item:last-child,
  .pp-content-sequence--calculation .pp-content-sequence__item:last-child {
    padding-bottom: 0;
  }

  .pp-content-sequence--workflow .pp-content-sequence__item + .pp-content-sequence__item,
  .pp-content-sequence--calculation .pp-content-sequence__item + .pp-content-sequence__item {
    border-top: 1px solid var(--pp-mobile-divider);
  }

  .pp-content-sequence__copy {
    display: contents;
  }

  .pp-content-sequence__index,
  .pp-content-sequence--calculation .pp-content-sequence__index {
    grid-area: index;
    align-self: center;
    width: fit-content;
    min-width: 2.15rem;
    min-height: 1.9rem;
    padding: 0 0.55rem;
    border: 1px solid color-mix(in srgb, var(--pp-brand-700) 20%, var(--pp-border-subtle));
    border-radius: 999px;
    background: color-mix(in srgb, var(--pp-brand-100) 42%, var(--pp-surface-base));
  }

  .pp-content-sequence__copy h3 {
    grid-area: title;
    align-self: center;
    font-size: clamp(0.98rem, 4vw, 1.06rem);
    line-height: 1.27;
  }

  .pp-content-sequence__copy p {
    grid-area: body;
    font-size: var(--pp-mobile-readable-copy-size, 0.93rem);
    line-height: var(--pp-mobile-readable-copy-line-height, 1.58);
  }

  .pp-content-sequence__evidence,
  .pp-content-sequence--calculation .pp-content-sequence__evidence {
    grid-area: evidence;
    width: 100%;
    margin: 0;
    padding: 0.7rem 0.75rem;
  }
}


/* ============================================================
   UTILITIES
   ============================================================ */
.hidden {
  display: none !important;
}

.pp-panel--analyzer[data-pp-analyzer-collapsed="1"] [data-analyzer-mount] {
  display: none;
}


/* ============================================================
   TUTORIAL SYSTEM
   ============================================================ */
.pp-guide {
  color: var(--pp-text-800);
  font-size: var(--pp-body-size);
  line-height: 1.66;
}

.pp-guide > * + * {
  margin-top: 11px;
}

.pp-guide > :first-child {
  margin-top: 0;
}

.pp-guide > :last-child {
  margin-bottom: 0;
}

.pp-guide h2 {
  margin: 36px 0 12px;
  padding-top: 18px;

  border-top: 1px solid var(--pp-border-subtle);

  color: var(--pp-text-900);
  font-size: var(--pp-h2-size);
  font-weight: var(--pp-h2-weight);
  line-height: 1.24;
}

.pp-guide h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.pp-guide h3 {
  margin: 24px 0 10px;

  color: var(--pp-text-900);
  font-size: var(--pp-h3-size);
  font-weight: 700;
  line-height: 1.28;
}

.pp-guide h4 {
  margin: 18px 0 8px;

  color: var(--pp-text-900);
  font-size: var(--pp-body-size);
  font-weight: 700;
  line-height: 1.34;
}

.pp-guide p {
  margin: 7px 0;
}

.pp-guide strong {
  color: var(--pp-text-900);
}

.pp-guide ul,
.pp-guide ol {
  margin: 8px 0 14px 20px;
  padding: 0;
}

.pp-guide li + li {
  margin-top: 6px;
}

.pp-guide a {
  color: var(--pp-brand-900);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ============================================================
   FORMULA BLOCK
   ============================================================ */
.pp-guide .pp-formula {
  margin: 16px 0;
  padding: 11px 14px;

  border: 1px solid var(--pp-border-accent);
  border-left: 4px solid var(--pp-brand-700);
  border-radius: var(--pp-radius-sm);
  background: var(--pp-surface-result);
}

.pp-guide .pp-formula code {
  padding: 0;
  border: 0;
  background: transparent;

  color: var(--pp-text-900);
  font-family: var(--pp-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   FORMULA VARIABLES GRID
   ============================================================ */
.pp-formula-vars {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 16px;

  margin: 12px 0;

  font-size: 0.95em;
}

.pp-formula-vars span:first-child {
  color: var(--pp-text-900);
  font-family: var(--pp-mono);
  font-weight: 600;
}


/* ============================================================
   FORMULA RULE
   ============================================================ */
.pp-formula-rule {
  margin: 12px 0 18px;
  padding: 10px 12px;

  border: 1px solid var(--pp-border-accent);
  border-radius: var(--pp-radius-sm);
  background: color-mix(in srgb, var(--pp-surface-result) 88%, var(--pp-surface-base));
}


/* ============================================================
   EXAMPLE BLOCK
   ============================================================ */
.pp-guide .pp-example {
  margin: 18px 0;
  padding: 14px 16px;

  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-md);
  background: color-mix(in srgb, var(--pp-surface-analytical) 72%, var(--pp-surface-base));
}

.pp-guide .pp-example + .pp-example {
  margin-top: 20px;
}

.pp-guide .pp-example > strong:first-child {
  display: block;
  margin-bottom: 8px;

  color: var(--pp-text-700);
  font-size: var(--pp-small-size);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.pp-guide .pp-example p {
  margin: 6px 0;
}


/* ============================================================
   CALCULATION SURFACE (LEVEL 2 MATH)
   ============================================================ */
.pp-step-math {
  margin: 8px 0 12px;
}

.pp-step-math code {
  display: inline-block;
  padding: 6px 12px;

  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-sm);
  background: var(--pp-surface-base);

  color: var(--pp-text-900);
  font-family: var(--pp-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   INLINE MATH (LEVEL 3 MATH)
   ============================================================ */
.pp-inline-math {
  padding: 2px 6px;

  border-radius: var(--pp-radius-sm);
  background: var(--pp-surface-muted);

  font-family: var(--pp-mono);
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   CONCEPT BOX SYSTEM
   ============================================================ */
.pp-concept {
  margin: 20px 0;
  padding: 14px 16px;

  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-md);
  background: color-mix(in srgb, var(--pp-surface-analytical) 62%, var(--pp-surface-base));
}

.pp-concept strong:first-child {
  display: block;
  margin-bottom: 7px;

  color: var(--pp-text-700);
  font-size: var(--pp-small-size);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
}

.pp-insight {
  border-left: 4px solid var(--pp-brand-500);
}

.pp-edge {
  border-left: 4px solid color-mix(in srgb, var(--pp-brand-700) 55%, #8c3b2b);
}

.pp-mistake {
  border-left: 4px solid color-mix(in srgb, var(--pp-brand-700) 35%, #9b6f08);
}

.pp-curious {
  border-left: 4px solid var(--pp-brand-700);
}


/* ============================================================
   THINKING PROMPT
   ============================================================ */
.pp-think {
  margin: 20px 0;
  padding: 14px 16px;

  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-md);
  background: color-mix(in srgb, var(--pp-surface-analytical) 62%, var(--pp-surface-base));
}

.pp-think summary {
  cursor: pointer;

  color: var(--pp-text-900);
  font-weight: 600;
  line-height: 1.4;
}

.pp-think p {
  margin-top: 10px;
}


/* ============================================================
   FAQ
   ============================================================ */
.pp-guide details {
  margin: 14px 0;
  padding: 12px 14px;

  border: 1px solid var(--pp-border-subtle);
  border-radius: var(--pp-radius-sm);
  background: color-mix(in srgb, var(--pp-surface-analytical) 62%, var(--pp-surface-base));
}

.pp-guide summary {
  cursor: pointer;

  color: var(--pp-text-900);
  font-weight: 600;
  line-height: 1.42;
}

.pp-guide details p {
  margin: 10px 0 0;
}


/* ============================================================
   Scroll Buffer
   ============================================================ */
.pp-guide .pp-lesson {
  scroll-margin-top: 60px;
}


/* ============================================================
   Separator
   ============================================================ */
.pp-guide .pp-lesson {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--pp-border-subtle);
}

.pp-guide .pp-lesson:first-of-type {
  padding-top: 0;
  border-top: 0;
}


/* ============================================================
   MOBILE REFINEMENT
   ============================================================ */
@media screen and (max-width: 767px) {
  .pp-guide h2 {
    margin-bottom: 12px;
  }

  .pp-guide h3 {
    margin-top: 22px;
  }

.pp-guide .pp-formula,
.pp-guide .pp-example,
.pp-concept,
.pp-think,
.pp-guide details {
  padding: 12px;
}

.pp-concept {
  padding: 13px 14px;
}

.pp-concept p {
  line-height: 1.55;
}

.pp-concept strong:first-child {
  line-height: 1.32;
  letter-spacing: 0.045em;
}
  .pp-sidebar-item a {
    padding: 8px 11px;
  }

  .pp-panel--analyzer .pp-analyzer-subtitle,
  .pp-panel--analyzer .pp-analyzer-label {
    font-size: 17px;
  }
  
  .pp-step-math code,
.pp-guide .pp-formula code {
  font-size: 13px;
}

.pp-step-math code {
  padding: 5px 10px;
}

}

/* ============================================================
   INSTITUTIONAL MOBILE TOOL COMPOSITION — SHARED PRIMITIVES
   ============================================================
   Opt-in only. A tool must declare:
     data-pp-mobile-composition="institutional"

   DEPTH MODEL
   1. Section panel: one major boundary.
   2. Divided stack/data rows: rhythm and evidence without card chrome.
   3. Contained surface: a single justified analytical or interactive surface.
   ============================================================ */
@media (max-width: 767px) {
  [data-pp-mobile-composition="institutional"] :where(
    .pp-mobile-stack,
    .pp-mobile-data-groups,
    .pp-mobile-data-group,
    .pp-mobile-data-list
  ) {
    display: grid;
    min-width: 0;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-stack {
    gap: var(--pp-mobile-stack-gap);
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-stack--divided
    > .pp-mobile-stack__item {
    min-width: 0;
    margin: 0;
    padding: var(--pp-mobile-row-pad-y) 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-stack--divided
    > .pp-mobile-stack__item:first-child {
    padding-top: 0;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-stack--divided
    > .pp-mobile-stack__item:last-child {
    padding-bottom: 0;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-stack--divided
    > .pp-mobile-stack__item
    + .pp-mobile-stack__item {
    border-top: 1px solid var(--pp-mobile-divider);
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-data-groups {
    gap: var(--pp-mobile-section-gap);
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-data-group {
    gap: 8px;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-data-list {
    gap: 0;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(7.25rem, auto);
    align-items: center;
    gap: var(--pp-mobile-row-gap);
    min-width: 0;
    margin: 0;
    padding: var(--pp-mobile-row-pad-y) 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-data-row
    + .pp-mobile-data-row {
    border-top: 1px solid var(--pp-mobile-divider);
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-data-row
    > :last-child {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  /* Long narrative values use a label-first row instead of competing columns. */
  [data-pp-mobile-composition="institutional"] .pp-mobile-data-row--stacked {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-data-row--stacked
    > :last-child {
    max-width: 100%;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-surface {
    min-width: 0;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-surface--flat {
    margin: 0;
    padding-right: 0;
    padding-left: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-pp-mobile-composition="institutional"] .pp-mobile-surface--contained {
    min-width: 0;
    padding: var(--pp-mobile-surface-pad);
    border: 1px solid var(--pp-mobile-divider);
    border-radius: var(--pp-radius-md);
    background: color-mix(in srgb, var(--pp-surface-result) 78%, var(--pp-surface-base));
    box-shadow: none;
  }

  /* White analytical canvas for charts and high-attention evidence. */
  [data-pp-mobile-composition="institutional"] .pp-mobile-surface--canvas {
    border-color: color-mix(in srgb, var(--pp-border-subtle) 82%, transparent);
    background: var(--pp-surface-base);
  }

  /* One grouped boundary for related label/value evidence rows. */
  [data-pp-mobile-composition="institutional"] .pp-mobile-ledger {
    display: grid;
    gap: 0;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--pp-mobile-divider);
    border-radius: var(--pp-radius-md);
    background: var(--pp-surface-base);
  }

  [data-pp-mobile-composition="institutional"]
    .pp-mobile-ledger
    > .pp-mobile-data-row {
    padding: var(--pp-mobile-row-pad-y) var(--pp-mobile-surface-pad);
  }

  /* Div-based responsive data lists retain every material value. */
  [data-pp-mobile-composition="institutional"] .pp-responsive-data-list {
    display: grid;
    min-width: 0;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__head {
    display: none;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__row
    + .pp-responsive-data-list__row {
    border-top: 1px solid var(--pp-mobile-divider);
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__primary {
    grid-column: 1 / -1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__metric {
    display: grid;
    gap: 3px;
    min-width: 0;
    text-align: left;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-data-list__metric::before {
    content: attr(data-mobile-label);
    color: var(--pp-text-500);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  /* Semantic tables remain tables in source and become readable data records. */
  [data-pp-mobile-composition="institutional"] .pp-responsive-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }

  [data-pp-mobile-composition="institutional"] .pp-responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table :where(tbody, tr, th, td) {
    display: block;
    width: 100%;
    min-width: 0;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table tbody tr {
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table tbody tr
    + tr {
    border-top: 1px solid var(--pp-mobile-divider);
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table tbody th[scope="row"] {
    margin-bottom: 9px;
    padding: 0;
    color: var(--pp-text-900);
    text-align: left;
    overflow-wrap: anywhere;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table tbody td {
    display: grid;
    grid-template-columns: minmax(5.75rem, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0 0;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }

  [data-pp-mobile-composition="institutional"]
    .pp-responsive-table tbody td::before {
    content: attr(data-mobile-label);
    color: var(--pp-text-500);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-transform: uppercase;
  }
}
