/* ============================================================================
   Components — chrome and learning UI
   ========================================================================== */

/* ---------------------------------------------------------------- App shell */
.app { min-height: 100dvh; }
.app--with-nav {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
}
@media (max-width: 900px) { .app--with-nav { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------- Header */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(24, 38, 52, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; gap: var(--s4);
  height: 60px; padding-inline: var(--gut); max-width: var(--wrap); margin-inline: auto;
}
.app--with-nav .masthead__inner { max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
/* The real Colossus logo image (replaces the former text wordmark). */
.wordmark-img { height: 21px; width: auto; display: block; }
@media (max-width: 760px) { .wordmark-img { height: 17px; } }
.brand__mark { display: inline-flex; align-items: center; }
.brand__sub {
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text-2);
  padding-left: 12px; border-left: 1px solid var(--line-2);
}
.masthead__spacer { flex: 1 1 auto; }
.masthead__nav { display: flex; align-items: center; gap: 26px; }
/* Match the main site's nav links: uppercase, tracked, underline on hover */
.masthead__link {
  position: relative; font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-2); white-space: nowrap;
  transition: color 0.3s ease;
}
.masthead__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: rgba(255, 255, 255, 0.7); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.masthead__link:hover { color: #fff; }
.masthead__link:hover::after { transform: scaleX(1); }
@media (max-width: 760px) { .masthead__nav { display: none; } }
.navtoggle {
  display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--text); cursor: pointer;
}
.navtoggle span, .navtoggle span::before, .navtoggle span::after {
  content: ""; display: block; width: 18px; height: 1.5px; background: currentColor;
  position: relative; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.navtoggle span::before { position: absolute; top: -6px; }
.navtoggle span::after  { position: absolute; top: 6px; }
@media (max-width: 900px) { .navtoggle { display: inline-flex; } }

/* The wordmark (HTML, accessible). Peak replaces the 4th glyph. */
.wordmark {
  font-family: var(--sans); font-weight: 300; font-size: 1.15rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: #fff;
  display: inline-flex; align-items: center; line-height: 1; padding-right: 0.2em;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .wordmark { font-size: 0.95rem; letter-spacing: 0.18em; padding-right: 0.18em; }
  .brand__sub { font-size: 0.6rem; letter-spacing: 0.2em; padding-left: 8px; }
}
/* The peak that replaces the 4th glyph: a narrow, sharp, hairline apex matching
   the light letter weight on colossusfirm.com. */
.wordmark__peak { display: inline-block; width: 0.52em; height: 0.76em; margin: 0 0.04em;
  position: relative; top: -0.01em; }
.wordmark__peak path { fill: none; stroke: currentColor; stroke-width: 3.4;
  stroke-linejoin: miter; stroke-linecap: butt; }

/* ----------------------------------------------------------------- Sidebar */
.sidenav {
  position: sticky; top: 60px; align-self: start;
  height: calc(100dvh - 60px); overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: var(--s5) var(--s3) var(--s6) var(--gut);
  background: linear-gradient(180deg, rgba(17,26,36,0.30), transparent 30%);
}
.sidenav__group + .sidenav__group { margin-top: var(--s4); }
.sidenav__label {
  font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-3); margin-bottom: var(--s2); padding-left: 8px;
}
.sidenav a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 8px; border-radius: var(--radius); color: var(--text-2);
  font-size: 0.92rem; line-height: 1.3; transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sidenav a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidenav a.is-current { color: var(--text); background: var(--steel-soft);
  box-shadow: inset 2px 0 0 var(--steel); }
.sidenav__num { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3);
  min-width: 1.4em; }
.sidenav a.is-current .sidenav__num { color: var(--steel); }
.sidenav__check { margin-left: auto; color: var(--good); opacity: 0; font-size: 0.8rem; }
.sidenav a.is-done .sidenav__check { opacity: 1; }
.sidenav a.is-done .sidenav__num { color: var(--good); }

@media (max-width: 900px) {
  .sidenav {
    position: fixed; inset: 60px 0 0 0; height: auto; z-index: 55;
    background: var(--navy-deep); border-right: 0;
    padding: var(--s4) var(--gut) var(--s7);
    transform: translateX(-100%); transition: transform 0.25s var(--ease);
    overflow-y: auto;
  }
  .sidenav.is-open { transform: translateX(0); }
}

/* --------------------------------------------------------------- Main / hero */
.main { min-width: 0; padding-bottom: var(--s8); }
.page-head { padding: var(--s7) 0 var(--s5); border-bottom: 1px solid var(--line); }
.page-head .eyebrow { display: block; margin-bottom: var(--s3); }
.page-head h1 { max-width: 18ch; }
.page-head .lead { margin-top: var(--s4); }
.module-meta {
  display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s5);
  font-size: var(--fs-small); color: var(--text-3);
}
.module-meta b { color: var(--text-2); font-weight: 500; }

/* --------------------------------------------------------------------- Footer
   Mirrors colossusfirm.com: brand + tag left, single uppercase nav right,
   informational note, then the legal line with a dot separator. */
.footer { position: relative; overflow: hidden; background: var(--navy-deeper);
  border-top: 1px solid var(--line); padding: 60px 0 48px; margin-top: var(--s8); }
.footer .wrap { position: relative; z-index: 1; }
.footer__grid { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap; }
.footer__brand { display: block; }
.footer__brand .wordmark { font-size: 1.05rem; }
.footer__brand .wordmark-img { height: 20px; }
.footer__tag { margin: 14px 0 0; font-family: var(--serif); font-style: italic;
  font-size: 18px; color: var(--text-2); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 12px 26px; max-width: 460px; }
.footer__nav a { position: relative; font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-2); transition: color 0.3s ease; }
.footer__nav a:hover { color: #fff; }
.footer__note { margin: 48px 0 0; padding-top: 26px; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: 12.5px; line-height: 1.7; max-width: 76ch; }
.footer__legal { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); }
.footer__legal b { font-weight: 500; color: var(--text-2); }
.footer__dot { width: 2px; height: 2px; border-radius: 50%; background: var(--text-3); }
.footer__view { margin-left: auto; text-transform: none; letter-spacing: normal; }
.footer__view .platform button { padding: 5px 12px; font-size: 0.74rem; }

/* Disclaimer banner (educational only) */
.disclaimer {
  border: 1px solid var(--line); border-left: 2px solid var(--warn);
  background: var(--warn-soft); border-radius: var(--radius);
  padding: var(--s4); font-size: var(--fs-small); color: var(--text-2);
}
.disclaimer b { color: var(--text); }

/* -------------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em;
  padding: 11px 20px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.05s var(--ease);
}
.btn:hover { border-color: var(--steel); background: rgba(255,255,255,0.03); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--steel); color: var(--navy-deeper); border-color: var(--steel);
  font-weight: 600; }
.btn--primary:hover { background: #9cb8df; border-color: #9cb8df; }
.btn--ghost { border-color: transparent; color: var(--text-2); padding-inline: 8px; }
.btn--ghost:hover { color: var(--text); background: transparent; }
.btn--sm { padding: 7px 13px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn__icon { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* ------------------------------------------------------------ Cards / panels */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s5);
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s4); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
a.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.grid { display: grid; gap: var(--s4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 760px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Callouts */
.callout {
  border: 1px solid var(--line); border-left: 2px solid var(--steel);
  border-radius: var(--radius); padding: var(--s4) var(--s4) var(--s4) var(--s5);
  background: rgba(255,255,255,0.02); margin-block: var(--s5);
}
.callout__label {
  font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 600; margin-bottom: var(--s2); display: block; color: var(--steel);
}
.callout p { color: var(--text-2); max-width: none; }
.callout p + p { margin-top: var(--s2); }
.callout--flag { border-left-color: var(--bad); background: var(--bad-soft); }
.callout--flag .callout__label { color: var(--bad); }
.callout--mistake { border-left-color: var(--warn); background: var(--warn-soft); }
.callout--mistake .callout__label { color: var(--warn); }
.callout--key { border-left-color: var(--steel); background: var(--steel-soft); }
.callout--why { border-left-color: var(--good); background: var(--good-soft); }
.callout--why .callout__label { color: var(--good); }

/* --------------------------------------------------------- Glossary tooltips */
.term {
  border-bottom: 1px dotted var(--steel-line); cursor: help; color: var(--text);
  position: relative;
}
.term:hover, .term:focus { border-bottom-color: var(--steel); }
.tip {
  position: absolute; z-index: 80; max-width: 320px; width: max-content;
  background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 12px 14px; font-size: 0.85rem; line-height: 1.5; color: var(--text-2);
  box-shadow: var(--shadow); pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
.tip.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.tip b { color: var(--text); display: block; margin-bottom: 3px; font-size: 0.9rem; }
/* Mobile tap-to-expand: inline disclosure under the term */
.term--open { background: var(--steel-soft); }
.term__inline {
  display: none; margin-top: var(--s2); padding: var(--s3);
  border-left: 2px solid var(--steel); background: rgba(255,255,255,0.02);
  font-size: 0.88rem; color: var(--text-2); border-radius: 0 var(--radius) var(--radius) 0;
}
.term__inline.is-open { display: block; }

/* ----------------------------------------------------- Example tabs (AAPL/MSFT) */
.example { margin-block: var(--s5); }
.example__head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.example__co {
  font-family: var(--sans); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--steel);
  display: inline-flex; align-items: center; gap: 8px;
}
.example__co::before { content: ""; width: 18px; height: 1px; background: var(--steel); }
.altexample { margin-top: var(--s4); border-top: 1px solid var(--line); }
.altexample > summary {
  list-style: none; cursor: pointer; padding: var(--s3) 0;
  display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 0.9rem;
}
.altexample > summary::-webkit-details-marker { display: none; }
.altexample > summary::before {
  content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
.altexample[open] > summary::before { transform: rotate(45deg); }
.altexample[open] > summary { color: var(--text); }
.altexample__body { padding: var(--s3) 0 var(--s4); }
.altexample__tag {
  font-size: var(--fs-eyebrow); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); border: 1px solid var(--line); border-radius: 2px; padding: 2px 7px;
}

/* ------------------------------------------------------------- Data figures */
figure.fig { margin-block: var(--s6); }
figure.fig svg { width: 100%; height: auto; }
figure.fig figcaption {
  margin-top: var(--s3); font-size: var(--fs-small); color: var(--text-3);
  text-align: center; line-height: var(--lh-snug);
}
.fig__frame {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--navy-deep); padding: var(--s5);
}

/* KaTeX display blocks sit in a quiet well */
.formula {
  margin-block: var(--s4); padding: var(--s4) var(--s5);
  background: var(--navy-deep); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto;
}
.formula .katex { color: var(--text); font-size: 1.18em; }
.formula__note { margin-top: var(--s3); font-size: var(--fs-small); color: var(--text-3); }
.katex { color: var(--text); }
/* Display formulas scroll horizontally on narrow screens instead of stretching the page */
.math-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.math-display .katex-display { margin: 0; }

/* ----------------------------------------------------------- Source citation */
.cite {
  font-size: var(--fs-small); color: var(--text-3);
  border-left: 1px solid var(--line-2); padding-left: var(--s3); margin-top: var(--s3);
}
.cite a { color: var(--text-2); border-bottom: 1px solid var(--line-2); }
.cite a:hover { color: var(--steel); }

/* ----------------------------------------------------------- Practice widget */
.practice { border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--navy-deep); margin-block: var(--s5); overflow: hidden; }
.practice__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.practice__count { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3);
  letter-spacing: 0.04em; }
.practice__label { font-size: var(--fs-eyebrow); text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--steel); }
.practice__body { padding: var(--s4); }
.practice__q { color: var(--text); font-size: var(--fs-lead); line-height: var(--lh-snug); }
.practice__givens { margin: var(--s3) 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; }
.practice__givens table { width: 100%; border-collapse: collapse; font-family: var(--mono);
  font-size: 0.86rem; }
.practice__givens td { padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.practice__givens tr:last-child td { border-bottom: 0; }
.practice__givens td:last-child { text-align: right; color: var(--text); }
.practice__form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center;
  margin-top: var(--s3); }
.practice__input {
  font-family: var(--mono); font-size: 0.95rem; color: var(--text);
  background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; width: 180px; max-width: 100%;
}
.practice__input:focus { border-color: var(--steel); outline: none; }
.practice__unit { color: var(--text-3); font-size: var(--fs-small); }
.practice__msg { margin-top: var(--s3); font-size: 0.9rem; display: none; }
.practice__msg.is-shown { display: block; }
.practice.is-correct .practice__msg--ok { color: var(--good); }
.practice.is-wrong .practice__input { border-color: var(--bad); }
.practice__solution {
  display: none; margin-top: var(--s3); padding: var(--s4);
  border-top: 1px solid var(--line); background: rgba(255,255,255,0.02);
  border-radius: 0 0 var(--radius) var(--radius);
}
.practice__solution.is-shown { display: block; }
.practice__solution h5 { font-family: var(--sans); font-size: var(--fs-small);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); margin-bottom: var(--s2); }
.practice__solution ol { padding-left: 1.3em; color: var(--text-2); font-size: 0.92rem; }
.practice__solution li + li { margin-top: var(--s2); }
.practice__solution .mono { color: var(--text); }
.tag-review {
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--warn); border: 1px solid rgba(201,160,99,0.4); border-radius: 2px;
  padding: 2px 6px; margin-left: var(--s2);
}

/* ----------------------------------------------------- Platform selector */
.platform {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius);
  overflow: hidden; background: var(--ink);
}
.platform button {
  font-family: var(--sans); font-size: 0.8rem; color: var(--text-2); cursor: pointer;
  background: transparent; border: 0; padding: 7px 15px; transition: all 0.15s var(--ease);
}
.platform button.is-active { background: var(--steel); color: var(--navy-deeper); font-weight: 600; }
.platform button + button { border-left: 1px solid var(--line-2); }
.kbd {
  font-family: var(--mono); font-size: 0.82em; background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px;
  padding: 1px 6px; color: var(--text); white-space: nowrap;
}

/* ----------------------------------------------------------- Screenshot frame */
.shot {
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: #fff; padding: 14px; margin-block: var(--s4);
  box-shadow: var(--shadow); overflow: auto;
}
.shot img { max-width: 100%; height: auto; border-radius: 2px; margin-inline: auto; display: block; }
.shot__cap, .pair__cap {
  font-size: var(--fs-small); color: var(--text-3); margin-top: var(--s2);
}
.pair { display: grid; gap: var(--s4); margin-block: var(--s5); }
/* The recreation and the authentic Excel screenshot stack vertically so the
   screenshot gets the full reading width (side by side it was too narrow to
   read). Force a full-width column, then keep the HTML recreation comfortable. */
.pair--2 { grid-template-columns: minmax(0, 1fr); }
.pair--2 .pair__panel:has(> .xl) { max-width: 920px; }
/* Grid items default to min-width:auto (min-content); the nowrap formula bar and
   the max-content scroll table would otherwise force the panel wider than a phone
   viewport. min-width:0 lets the panel shrink so the inner overflow-x:auto scrolls. */
.pair, .pair__panel { min-width: 0; }
.pair__panel { max-width: 100%; }
.pair__panel > h5 { font-size: var(--fs-eyebrow); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--text-3); margin-bottom: var(--s2); }

/* ----------------------------------------------------------------- Flashcards */
.deck { margin-block: var(--s5); }
.flashcard {
  perspective: 1200px; cursor: pointer; margin-inline: auto; max-width: 460px;
}
.flashcard__inner {
  position: relative; width: 100%; min-height: 200px;
  transition: transform 0.5s var(--ease); transform-style: preserve-3d;
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: var(--s5); display: flex; flex-direction: column; justify-content: center;
  background: var(--panel);
}
.flashcard__face--back { transform: rotateY(180deg); background: var(--navy-deep); }
.flashcard__term { font-family: var(--serif); font-size: 1.6rem; color: var(--text); }
.flashcard__hint { margin-top: var(--s2); font-size: var(--fs-small); color: var(--text-3); }
.flashcard__def { color: var(--text-2); line-height: var(--lh-snug); }
.flashcard__essential {
  position: absolute; top: 12px; right: 12px; font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--steel); border: 1px solid var(--steel-line);
  border-radius: 2px; padding: 2px 6px;
}
.deck__controls { display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-top: var(--s4); }
.deck__srs { display: flex; gap: var(--s2); }
.deck__progress { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); }

/* ------------------------------------------------------------------- Progress */
.progressbar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px;
  overflow: hidden; }
.progressbar > i { display: block; height: 100%; background: var(--steel);
  width: 0; transition: width 0.4s var(--ease); }
.mark-done { display: inline-flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------- Mobile notice */
.only-desktop, .only-mobile { display: revert; }
.is-mobile .only-desktop { display: none; }
.is-mobile .only-mobile  { display: revert; }
body:not(.is-mobile) .only-mobile { display: none; }

/* Mobile/desktop manual toggle */
.viewtoggle { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-small);
  color: var(--text-3); }

/* Next/prev module pager */
.pager { display: flex; justify-content: space-between; gap: var(--s4);
  margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); }
.pager a { display: block; max-width: 48%; }
.pager .eyebrow { display: block; margin-bottom: 4px; }
.pager b { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; color: var(--text); }
.pager a:hover b { color: var(--steel); }
.pager .pager__next { text-align: right; margin-left: auto; }

/* ----------------------------------------------- Platform-conditional content */
[data-plat] { display: none; }
body.plat-mac [data-plat="mac"] { display: revert; }
body.plat-win [data-plat="win"] { display: revert; }
.platform-bar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) 0; margin-bottom: var(--s4); border-bottom: 1px solid var(--line);
}
.platform-bar .eyebrow { color: var(--text-3); }

/* ------------------------------------------------ Practice multiple choice */
.practice__choices { display: grid; gap: var(--s2); margin-top: var(--s3); }
.choice {
  text-align: left; cursor: pointer; font-family: var(--sans); font-size: 0.95rem;
  color: var(--text); background: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 12px 14px; transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.choice:hover:not(:disabled) { border-color: var(--steel); }
.choice:disabled { cursor: default; }
.choice.is-picked-ok { border-color: var(--good); background: var(--good-soft); }
.choice.is-picked-no { border-color: var(--bad); background: var(--bad-soft); }
.choice__key { font-family: var(--mono); color: var(--text-3); margin-right: 10px; }

/* ----------------------------------------------------------- Flashcard SRS */
.deck__srs .btn--sm { font-size: 0.78rem; }
.srs-got { color: var(--good); border-color: rgba(127,176,138,0.4); }
.srs-got:hover { border-color: var(--good); background: var(--good-soft); }
.srs-again { color: var(--warn); border-color: rgba(201,160,99,0.4); }
.srs-again:hover { border-color: var(--warn); background: var(--warn-soft); }
.deck__done { text-align: center; padding: var(--s6) var(--s4); color: var(--text-2); }
.deck__filterbar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4);
  align-items: center; }
.chip {
  font-size: var(--fs-small); color: var(--text-2); cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: 20px;
  padding: 5px 13px; transition: all 0.15s var(--ease);
}
.chip.is-active { background: var(--steel); color: var(--navy-deeper); border-color: var(--steel); font-weight: 600; }
.chip:hover:not(.is-active) { border-color: var(--steel); color: var(--text); }

/* ----------------------------------------------- Financial snapshot table */
.snapshot { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  margin-block: var(--s4); background: var(--navy-deep); }
.snapshot__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.snapshot__co { font-family: var(--sans); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text); }
.snapshot__fy { font-size: var(--fs-small); color: var(--text-3); }
.snapshot table { width: 100%; border-collapse: collapse; }
.snapshot td { padding: 10px var(--s4); border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.snapshot tr:last-child td { border-bottom: 0; }
.snapshot td.lbl { color: var(--text-2); }
.snapshot td.val { text-align: right; font-family: var(--mono); color: var(--text); white-space: nowrap; }
.snapshot tr.is-emph td { background: var(--steel-soft); }
.snapshot tr.is-emph td.lbl { color: var(--text); font-weight: 500; }
.snapshot__note { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
/* Full statement tables: section sub-rows, indented items, totals */
.snapshot tr.sub td { color: var(--text-3); font-size: var(--fs-eyebrow); text-transform: uppercase;
  letter-spacing: 0.12em; padding-top: 16px; padding-bottom: 6px; border-bottom: 0; }
.snapshot td.ind { padding-left: 30px; color: var(--text-2); }
.snapshot tr.tot td { border-top: 1px solid var(--line-2); color: var(--text); font-weight: 500; }
.snapshot tr.tot td.val { font-weight: 600; }
.snapshot tr.grand td { border-top: 2px solid var(--line-2); color: var(--text); }
.snapshot tr.grand td.val { font-weight: 700; }

/* Three-statements overview */
.stmt-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-block: var(--s5); }
.stmt-overview > div { background: var(--navy-deep); padding: var(--s4); }
.stmt-overview h4 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; color: var(--text); }
.stmt-overview p { color: var(--text-2); font-size: 0.92rem; margin-top: var(--s2); max-width: none; }
.stmt-overview .when { display: inline-block; margin-top: var(--s3); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--steel); border: 1px solid var(--steel-line); border-radius: 2px; padding: 2px 7px; }
@media (max-width: 760px) { .stmt-overview { grid-template-columns: 1fr; } }

/* Accounting-equation balance bars */
.eqbars { margin-block: var(--s5); }
.eqbars__row { display: flex; align-items: center; gap: 2px; height: 46px; border-radius: var(--radius);
  overflow: hidden; }
.eqbars__seg { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 14px;
  font-size: 0.82rem; color: var(--text); white-space: nowrap; }
.eqbars__seg b { font-family: var(--mono); font-size: 0.9rem; }
.eqbars__seg span { font-size: 0.7rem; color: var(--text-2); }
.eqbars__assets { background: rgba(138,170,214,0.30); border: 1px solid var(--steel-line); width: 100%; }
.eqbars__liab { background: rgba(201,160,99,0.22); border: 1px solid rgba(201,160,99,0.4); }
.eqbars__eq { background: rgba(127,176,138,0.22); border: 1px solid rgba(127,176,138,0.4); }
.eqbars__op { text-align: center; font-family: var(--serif); font-size: 1.6rem; color: var(--text-3); padding: 0 6px; }
.eqbars__lblrow { display: flex; justify-content: space-between; margin-top: var(--s2); font-size: var(--fs-small);
  color: var(--text-3); }

/* --------------------------------------------------- Accrual timing matrix */
.tmatrix { display: grid; grid-template-columns: minmax(120px, 0.8fr) 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; margin-block: var(--s5); }
.tmatrix > div { background: var(--navy-deep); padding: var(--s4); }
.tmatrix__corner { background: var(--navy-deeper); }
.tmatrix__ch, .tmatrix__rh { font-family: var(--sans); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel);
  display: flex; align-items: center; background: var(--navy-deeper); }
.tmatrix__rh { color: var(--text-2); }
.tmatrix__cell b { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--text);
  display: block; }
.tmatrix__cell p { font-size: 0.88rem; color: var(--text-2); margin-top: 6px; max-width: none; }
.tmatrix__kind { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 2px; padding: 2px 7px; margin-top: var(--s2); display: inline-block; }
.tmatrix__kind--asset { color: var(--steel); border: 1px solid var(--steel-line); }
.tmatrix__kind--liab { color: var(--warn); border: 1px solid rgba(201,160,99,0.4); }
@media (max-width: 700px) {
  .tmatrix { grid-template-columns: 1fr; }
  .tmatrix__corner, .tmatrix__ch { display: none; }
  .tmatrix__rh { background: var(--navy-deeper); }
}

/* ------------------------------------------------------ Ratio cards (M7) */
.ratiogrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-block: var(--s4); }
@media (max-width: 760px) { .ratiogrid { grid-template-columns: 1fr; } }
.ratio { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4);
  background: var(--navy-deep); display: flex; flex-direction: column; }
.ratio__name { font-family: var(--serif); font-size: 1.16rem; color: var(--text); line-height: 1.2; }
.ratio__f { margin: 10px 0; padding: 8px 10px; background: rgba(255,255,255,0.02); border-radius: var(--radius);
  overflow-x: auto; }
.ratio__f .katex { font-size: 0.98em; }
.ratio__m { color: var(--text-2); font-size: 0.9rem; flex: 1; }
.ratio__stats { display: flex; gap: var(--s5); margin-top: var(--s3); padding-top: var(--s3);
  border-top: 1px solid var(--line); }
.ratio__stat span { color: var(--text-3); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  display: block; margin-bottom: 3px; }
.ratio__stat b { font-family: var(--mono); font-size: 1.05rem; color: var(--text); font-weight: 500; }
.ratio__stat.is-apple b { color: var(--steel); }
.cat-head { display: flex; align-items: baseline; gap: var(--s3); margin-top: var(--s6); }
.cat-head h3 { margin: 0; }
.cat-head span { color: var(--text-3); font-size: var(--fs-small); }

/* Industry comparison table (M7) */
.industries { width: 100%; border-collapse: collapse; margin-block: var(--s4); font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.industries th, .industries td { padding: 11px var(--s3); border: 1px solid var(--line); text-align: left;
  vertical-align: top; }
.industries th { background: var(--navy-deeper); color: var(--steel); font-weight: 500; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em; }
.industries td:first-child { color: var(--text); font-weight: 500; }
.industries td { color: var(--text-2); }
.industries .mono { color: var(--text); }
@media (max-width: 760px) { .industries { display: block; overflow-x: auto; white-space: nowrap; } }

/* ------------------------------------------------- Filing anatomy map (M4) */
.docmap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  margin-block: var(--s5); background: var(--navy-deep); }
.docmap__part { padding: 9px var(--s4); background: var(--navy-deeper); color: var(--steel);
  font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.14em; }
.docmap__item { display: grid; grid-template-columns: 70px minmax(150px, 220px) 1fr; gap: var(--s3);
  padding: 12px var(--s4); border-top: 1px solid var(--line); align-items: baseline; }
.docmap__item.is-key { background: var(--steel-soft); }
.docmap__no { font-family: var(--mono); color: var(--text-3); font-size: 0.8rem; }
.docmap__item.is-key .docmap__no { color: var(--steel); }
.docmap__t { color: var(--text); font-weight: 500; }
.docmap__d { color: var(--text-2); font-size: 0.9rem; }
@media (max-width: 700px) {
  .docmap__item { grid-template-columns: 56px 1fr; }
  .docmap__d { grid-column: 1 / -1; }
}

/* "Where does this number live" map (M4) */
.locmap { width: 100%; border-collapse: collapse; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; margin-block: var(--s4); background: var(--navy-deep); }
.locmap td { padding: 12px var(--s4); border-top: 1px solid var(--line); vertical-align: top; }
.locmap tr:first-child td { border-top: 0; }
.locmap td:first-child { color: var(--text); width: 44%; font-size: 0.95rem; }
.locmap td:last-child { color: var(--text-2); font-size: 0.92rem; }
.locmap .where { color: var(--steel); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.12em; display: block; margin-bottom: 4px; }

/* ---------------------------------------------------- Inline figure labels */
.fig svg text { font-family: var(--sans); }
.fig .n { font-family: var(--mono); }
.lookback { border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: var(--s3) var(--s4); background: rgba(255,255,255,0.015); margin-block: var(--s4); }
.lookback .eyebrow { color: var(--text-3); display: block; margin-bottom: 6px; }

/* ----------------------------------------------------------- Screenshot zoom */
.shot img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000; background: rgba(13, 20, 28, 0.93);
  display: flex; align-items: center; justify-content: center; padding: 4vh 4vw;
  cursor: zoom-out; animation: lb-in 0.12s ease;
}
.lightbox img {
  max-width: 96vw; max-height: 92vh; width: auto; height: auto;
  border-radius: 4px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.lightbox__hint { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center;
  color: var(--text-3); font-size: var(--fs-small); letter-spacing: 0.04em; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------ Step-by-step build */
/* Inline spreadsheet cell reference in prose, e.g. type into B5 */
.cell {
  font-family: var(--mono); font-size: 0.84em; color: var(--steel);
  background: rgba(138, 170, 214, 0.10); border: 1px solid var(--steel-line);
  border-radius: 3px; padding: 1px 6px; white-space: nowrap;
}
/* Numbered build procedure with circled step markers */
.build { counter-reset: build; list-style: none; padding-left: 0; margin: var(--s5) 0; }
.build > li {
  counter-increment: build; position: relative; padding-left: 56px;
  margin-top: var(--s4); color: var(--text-2);
}
.build > li:first-child { margin-top: var(--s2); }
.build > li::before {
  content: counter(build); position: absolute; left: 0; top: -3px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--steel-line); color: var(--steel);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.9rem;
}
.build > li b { color: var(--text); font-weight: 600; }
.build .mono { color: var(--text); }

/* ---- Identity gate (write-once name capture) ---------------------------- */
.namegate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: var(--s4); background: rgba(13,20,28,.74);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.namegate__card { width: 100%; max-width: 520px; background: var(--navy-deep);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: var(--s5);
  box-shadow: var(--shadow); }
.namegate__card h2 { margin: var(--s2) 0 var(--s3); font-size: var(--fs-h3); }
.namegate__card p { color: var(--text-2); }
.namegate__row { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }
.namegate__row label { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px;
  font-size: var(--fs-small); color: var(--text-3); }
.namegate__row input { background: var(--navy); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 11px 12px; font-size: var(--fs-body); font-family: var(--sans); }
.namegate__row input:focus { outline: none; border-color: var(--steel); }
.namegate__form .btn { margin-top: var(--s4); }
.namegate__err { color: var(--bad); font-size: var(--fs-small); margin-top: var(--s3); }
body.is-gated { overflow: hidden; }

/* ---- Account chip: the read-only locked name in the masthead ------------ */
.masthead__acct { color: var(--text-2); font-size: var(--fs-small); padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 100px; white-space: nowrap; }

/* ---- Sequential unlock: a locked module in the sidebar ------------------ */
.sidenav a.is-locked { opacity: .5; cursor: not-allowed; pointer-events: none; }
.sidenav a.is-locked .sidenav__check { opacity: .6; }
