:root{
  --bg:#050507;
  --bg2:#010102;

  --ivory:#f2efe7;
  --muted:#c7c1b4;

  /* Deep stone base */
  --stoneA:#24252a;
  --stoneB:#17181c;
  --stoneC:#2f3037;

  /* Muted spectrum */
  --c-modewheel:#8a3a3a;
  --c-about:#8f6a3a;
  --c-theory:#1f8f5a;
  --c-library:#2f8c9c;
  --c-temperament:#3b6098;
  --c-harmonics:#3f7a57;
  --c-spheres:#3a5f8f;
  --c-shop:#4a3f8f;
  --c-contact:#7a3f8f;


  --railW: 252px;
  --btnH: 60px;

  --radius: 16px;
  --radiusInner: 12px;
  --frameW: 3px;
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html, body{
  height:100%;
  margin:0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.04), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,.02), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 85%);
  font-family: "Cormorant Garamond", Garamond, "Palatino Linotype", Palatino, serif;
}

a{ color:inherit; text-decoration:none; }
a:focus, button:focus{ outline: 2px solid rgba(255,255,255,.30); outline-offset: 3px; }

.page{ min-height:100vh; display:flex; }

/* ===== Stone + Frame (refined, no crosshatch) ===== */
.stone{
  /* subtle marbling using large soft gradients */
  background:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,.05), rgba(255,255,255,0) 52%),
    radial-gradient(circle at 70% 78%, rgba(0,0,0,.55), rgba(0,0,0,0) 58%),
    radial-gradient(circle at 65% 30%, rgba(255,255,255,.02), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, var(--stoneA), var(--stoneB));
}

.frame-outer{
  position:relative;
  border-radius: var(--radius);
  border: var(--frameW) solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.06),
    inset 0 -12px 20px rgba(0,0,0,.65),
    0 18px 36px rgba(0,0,0,.48);
  overflow:hidden;
}

/* corner ornaments (rune-like cuts) */
.frame-outer::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.75;
  background:
    /* top-left */
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,0) 26%) top left / 40px 40px no-repeat,
    linear-gradient(315deg, rgba(0,0,0,.55), rgba(0,0,0,0) 26%) top left / 40px 40px no-repeat,
    /* top-right */
    linear-gradient(225deg, rgba(255,255,255,.10), rgba(255,255,255,0) 26%) top right / 40px 40px no-repeat,
    linear-gradient(45deg, rgba(0,0,0,.55), rgba(0,0,0,0) 26%) top right / 40px 40px no-repeat,
    /* bottom-left */
    linear-gradient(45deg, rgba(255,255,255,.08), rgba(255,255,255,0) 26%) bottom left / 40px 40px no-repeat,
    linear-gradient(135deg, rgba(0,0,0,.60), rgba(0,0,0,0) 26%) bottom left / 40px 40px no-repeat,
    /* bottom-right */
    linear-gradient(315deg, rgba(255,255,255,.08), rgba(255,255,255,0) 26%) bottom right / 40px 40px no-repeat,
    linear-gradient(225deg, rgba(0,0,0,.60), rgba(0,0,0,0) 26%) bottom right / 40px 40px no-repeat;
}

/* inner bevel (inlay edge) — kept tight to preserve space */
.frame-outer::after{
  content:"";
  position:absolute;
  inset: 8px;
  border-radius: var(--radiusInner);
  border: 2px solid rgba(0,0,0,.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 2px 0 rgba(255,255,255,.025),
    inset 0 -3px 10px rgba(0,0,0,.60);
  pointer-events:none;
}

/* inlaid panel */
.inlay{
  position:relative;
  border-radius: var(--radiusInner);
  background:
    radial-gradient(circle at 50% 25%, rgba(255,255,255,.04), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.55));
  border: 2px solid rgba(255,255,255,.05);
  box-shadow:
    inset 0 10px 20px rgba(0,0,0,.70),
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* ===== Desktop rail ===== */
.rail{
  width: var(--railW);
  flex: 0 0 var(--railW);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display:none;
  border-right: 4px solid rgba(255,255,255,.08);
  box-shadow: 14px 0 28px rgba(0,0,0,.45);
}

.brand{
  text-align:center;
  margin: 6px 6px 14px;
}
.brand .title{
  font-size: 34px;
  letter-spacing: .01em;
  text-shadow: 0 2px 0 rgba(0,0,0,.60), 0 18px 30px rgba(0,0,0,.35);
}
.brand .subtitle{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ===== Nav buttons: full-color stone tint, refined frame ===== */
.navbtn{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height: var(--btnH);
  width: 100%;
  margin: 0 0 10px;
  padding: 0 14px;
  border:0;
  cursor:pointer;
  border-radius: var(--radius);
  color: var(--ivory);
  font-size: 20px;
  letter-spacing: .01em;
  user-select:none;
}

/* button slab (tinted stone) */
.navbtn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: var(--radius);
  /* accent tint across entire slab */
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.05), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.55), rgba(0,0,0,0) 60%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 28%, var(--stoneC)),
      color-mix(in srgb, var(--accent) 18%, var(--stoneB)));
  border: 3px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.06),
    inset 0 -10px 18px rgba(0,0,0,.70),
    0 14px 28px rgba(0,0,0,.48);
  pointer-events:none;
}

/* inner frame + rune corners (compact) */
.navbtn::after{
  content:"";
  position:absolute;
  inset: 8px;
  border-radius: var(--radiusInner);
  border: 2px solid rgba(0,0,0,.65);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 2px 0 rgba(255,255,255,.03),
    inset 0 -3px 10px rgba(0,0,0,.62);
  background:
    /* faint runic notches near top */
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, rgba(255,255,255,0) 1px 14px) top / 100% 6px no-repeat,
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.50));
  pointer-events:none;
}

.navbtn .label{
  position:relative;
  z-index:2;
  text-shadow: 0 -1px 0 rgba(0,0,0,.70), 0 1px 0 rgba(255,255,255,.08);
}

/* current page: slightly brighter border, no glow */
.navbtn.is-current::before{
  border-color: rgba(255,255,255,.16);
}

/* hover: heavy lift */
.navbtn:hover::before{ box-shadow:
    inset 0 2px 0 rgba(255,255,255,.07),
    inset 0 -10px 18px rgba(0,0,0,.70),
    0 18px 34px rgba(0,0,0,.56);
}
.navbtn:active{ transform: translateY(1px); }
.navbtn:active::before{
  box-shadow:
    inset 0 3px 12px rgba(0,0,0,.80),
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 24px rgba(0,0,0,.50);
}

/* ===== Mobile topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  padding: 14px 12px 12px;
  border-bottom: 4px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 26px rgba(0,0,0,.45);
}

.topbar .brand .title{ font-size: 30px; }
.topbar .brand .subtitle{ font-size: 12px; }

.mobile-nav{
  width: min(760px, 100%);
  display:grid;
  gap: 10px;
}
.mobile-nav .row{
  display:grid;
  gap: 10px;
  justify-content:center;
}
.mobile-nav .row.top{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mobile-nav .row.bottom{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mobile-nav .navbtn{
  height: 58px;
  font-size: 16px;
  margin: 0;
}

/* ===== Content ===== */
.content{
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  flex-direction:column;
}
.main{
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
}

/* Wheel stage */
#wheel-stage{
  width: 100%;
  min-height: calc(100vh - 44px);
  height: auto;
  border-radius: 18px;
  overflow: hidden;
}
#wheel-stage .inlay{
  position: relative;
  inset: auto;
  padding: 18px;
  display: block;
  text-align: center;
}

#wheel-stage h1{
  margin: 0 0 10px;
  font-size: 34px;
}
#wheel-stage p{
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

/* Standard page card */
.card{
  max-width: 980px;
  margin: 0 auto;
  padding: 0; /* inlay handles padding */
  border-radius: 18px;
}
.card .inlay{
  padding: 20px;
}
.card h1{
  margin: 0 0 10px;
  font-size: 38px;
  text-shadow: 0 2px 0 rgba(0,0,0,.65);
}
.card p{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}
.card .note{
  font-size: 13px;
  color: rgba(255,255,255,.70);
}

.footer{
  padding: 14px 18px 20px;
  color: rgba(255,255,255,.60);
  font-size: 12px;
  text-align:center;
}

/* ===== Responsive ===== */
@media (min-width: 900px){
  .rail{ display:block; }
  .topbar{ display:none; }
  .content{ width: calc(100vw - var(--railW)); }
}

@media (max-width: 420px){
  .mobile-nav .navbtn{ font-size: 14px; }
}



/* === Mobile layout adjustments === */
@media (max-width: 820px) {
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 8px 10px 4px;
    position: relative; /* for absolutely-positioned drawer */
  }

  .mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-header .title { font-size: 18px; }
  .mobile-header .subtitle { font-size: 12px; opacity: 0.85; }

  .hamburger {
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.25);
    color: inherit;
  }

  /* Drawer is hidden by default (do not override the [hidden] attribute) */
  .mobile-drawer[hidden] { display: none !important; }

  /* When opened, show as an overlay so it doesn't push the wheel down */
  .mobile-drawer {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.62);
    display: grid;
    gap: 8px;
    z-index: 60;
  }

  .mobile-drawer a{
    text-decoration:none;
    color: inherit;
  }


/* Remove frames/inlays on mobile */
  .frame-outer,
  .stone.frame-outer,
  #wheel-stage.frame-outer,
  .inlay {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    overflow: visible !important;     /* critical: undo overflow:hidden from .frame-outer */
    border-radius: 0 !important;      /* avoid subtle clipping/warping on tiny screens */
  }
  .frame-outer::before,
  .frame-outer::after{
    display:none !important;          /* remove ornamental cuts that can distort edges */
  }
/* Fully flatten the Mode Wheel stage on small screens (avoid subtle texture warping at edges) */
  #wheel-stage{
    border-radius: 0 !important;
    overflow: visible !important;
    min-height: auto !important;
  }
  #wheel-stage.stone{
    background: transparent !important;
  }

  /* Make drawer buttons more opaque and more clearly tinted by their accent */
  .mobile-drawer .navbtn{
    position: relative;
    overflow: hidden;

    margin: 0;
    height: auto;
    min-height: 44px;
  }

  .mobile-drawer .navbtn::before{
    /* Fallback tint for older Safari: always works */
    background: var(--accent);
    opacity: 0.35;
    border: 3px solid rgba(255,255,255,.24);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,.07),
      inset 0 -10px 18px rgba(0,0,0,.72),
      0 10px 20px rgba(0,0,0,.50);
  }

  .mobile-drawer .navbtn .label{
    position: relative;
    z-index: 1;
  }


  .mobile-drawer .navbtn::after{
    background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.55));
    border: 2px solid rgba(0,0,0,.70);
  }

  /* Enhanced tint for modern browsers (keeps vivid MTG-like depth) */
  @supports (background: color-mix(in srgb, red 50%, black)) {
    .mobile-drawer .navbtn::before{
      opacity: 1;
      background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,.06), rgba(255,255,255,0) 52%),
        radial-gradient(circle at 70% 78%, rgba(0,0,0,.62), rgba(0,0,0,0) 58%),
        linear-gradient(180deg,
          color-mix(in srgb, var(--accent) 72%, var(--stoneC)),
          color-mix(in srgb, var(--accent) 55%, var(--stoneB)));
    }
  }


  /* Remove subtle texture warping/frame effects on mobile by flattening card/wheel wrappers */
  #wheel-stage,
  .card{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .main{
    padding: 8px 10px 18px !important;
  }

}


@media (max-width: 820px) {

  /* Extra: remove any remaining clipping/edge warp around the wheel + tiles */
  #wheel-stage,
  #wheel-stage.frame-outer,
  #wheel-stage .inlay,
  #mw-app,
  #mw-container,
  #key-area,
  #key-rows {
    overflow: visible !important;
    border-radius: 0 !important;
    clip-path: none !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  /* Frame ornaments can subtly warp textures on small screens */
  .frame-outer::before,
  .frame-outer::after {
    display: none !important;
    content: none !important;
  }

}


/* === Tablet sizing tweaks (e.g., iPad) === */
@media (min-width: 821px) and (max-width: 1024px) {
  #key-rows { gap: 10px; max-width: 960px; }
  .mode-tile {
    flex: 1 1 140px;
    max-width: 130px;
    min-width: 95px;
    border-radius: 6px;
    padding: 4px 0;
  }
  .key-btn {
    font-size: 16px;
    padding: 6px 8px;
  }
}


/* === Rebalanced original style: keep sidebar/buttons, clean content pages === */
/* Black page field instead of grey stone wash */
html, body{
  background: #000 !important;
  background-image: none !important;
  background-color: #000 !important;
}

/* Keep the original rail shape/frame/button styling, but remove the grey stone fill */
.rail,
.topbar{
  background: transparent !important;
  background-image: none !important;
}

/* Keep original nav button frames and typography, but remove their grey slab fill */
.navbtn::before{
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 28%, rgba(0,0,0,0.96)),
      color-mix(in srgb, var(--accent) 14%, rgba(0,0,0,0.98))) !important;
}

/* Standard non-wheel content pages: remove card frame, ornaments, grey fill, and bevels */
.card,
.card.frame-outer,
.card.stone,
.card .inlay{
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
}

.card.frame-outer::before,
.card.frame-outer::after{
  display: none !important;
  content: none !important;
}

.card{
  max-width: 980px;
  padding: 0 !important;
}

.card .inlay{
  padding: 20px !important;
}

/* Keep the wheel stage and wheel CSS as originally styled for now. */



/* === Wheel page: remove frame + grey background ONLY === */
#wheel-stage.stone,
#wheel-stage.frame-outer {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#wheel-stage.frame-outer::before,
#wheel-stage.frame-outer::after {
  display: none !important;
  content: none !important;
}

#wheel-stage .inlay {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}


/* === Footer: Anchor to Desktop Sidebar/Rail === */
/* The footer lives in the page content markup, but on desktop it should read
   as part of the navigation rail rather than the Mode Wheel/instrument area. */
@media (min-width: 900px) {
  .rail {
    padding-bottom: 48px !important; /* reserve visual space for the footer */
  }

  .content > .footer,
  .footer {
    position: fixed !important;
    left: 0 !important;
    bottom: 12px !important;
    z-index: 8 !important;

    width: var(--railW) !important;
    max-width: var(--railW) !important;

    margin: 0 !important;
    padding: 0 14px !important;

    text-align: center !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    color: rgba(255,255,255,0.48) !important;
    opacity: 0.50 !important;

    pointer-events: none !important;
  }
}

/* On mobile/tablet, keep the footer in the normal page flow. */
@media (max-width: 899px) {
  .footer {
    position: static !important;
    width: auto !important;
    max-width: none !important;
    padding: 14px 18px 20px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
/* =========================================================
   MODEWHEEL DESKTOP VIEWPORT LOCK V3 — Safari-safe scoped page shell
   ---------------------------------------------------------
   Requires body.modewheel-page, added by wheel.js.
   Desktop only. Mobile/tablet stays scrollable.
   ========================================================= */

@media (min-width: 900px) {
  body.modewheel-page {
    height: 100%;
    overflow: hidden !important;
  }

  body.modewheel-page .page {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.modewheel-page .rail {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.modewheel-page .content {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.modewheel-page .main {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 18px !important;
  }

  /*
    Keep the instrument visible outside its nominal frame.
    Left stack and mode tiles use absolute positioning around the wheel.
  */
  body.modewheel-page #wheel-stage,
  body.modewheel-page #wheel-stage.frame-outer,
  body.modewheel-page #wheel-stage .inlay {
    height: calc(100dvh - 36px) !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.modewheel-page #wheel-stage .inlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Decorative smoked-glass rails, ModeWheel desktop only. */
  body.modewheel-page .content::before,
  body.modewheel-page .content::after {
    content: "";
    position: fixed;
    left: var(--railW);
    right: 0;
    height: 24px;
    z-index: 7;
    pointer-events: none;
    background:
      linear-gradient(
        180deg,
        rgba(0,0,0,0.74),
        rgba(0,0,0,0.26) 70%,
        rgba(0,0,0,0)
      );
  }

  body.modewheel-page .content::before {
    top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  body.modewheel-page .content::after {
    bottom: 0;
    transform: scaleY(-1);
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
}

/* Mobile/tablet safeguard: ModeWheel page remains scrollable. */
@media (max-width: 899px) {
  body.modewheel-page {
    height: auto !important;
    min-height: 100%;
    overflow: auto !important;
  }

  body.modewheel-page .page,
  body.modewheel-page .content,
  body.modewheel-page .main,
  body.modewheel-page #wheel-stage,
  body.modewheel-page #wheel-stage .inlay {
    height: auto !important;
    overflow: visible !important;
  }

  body.modewheel-page .content::before,
  body.modewheel-page .content::after {
    display: none !important;
    content: none !important;
  }
}


/* === CENTERING PASS === */
@media (min-width: 900px) {
  body.modewheel-page #wheel-stage .inlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.modewheel-page #mw-container {
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    height: 100%;
  }
}


/* ===== Theory landing and article pages ===== */
.theory-landing .inlay,
.theory-article .inlay{
  padding: 28px;
}

.theory-intro{
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}

.eyebrow{
  margin: 0 0 8px !important;
  color: rgba(255,255,255,.62) !important;
  font-size: 13px !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.theory-intro h1,
.theory-article h1{
  margin-bottom: 12px;
}

.theory-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
}

.theory-card{
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.055), rgba(255,255,255,0) 48%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.28));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -12px 22px rgba(0,0,0,.35),
    0 12px 24px rgba(0,0,0,.22);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.theory-card:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--c-theory) 56%, rgba(255,255,255,.20));
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.07), rgba(255,255,255,0) 48%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.25));
}

.spectrum-graphic{
  position: relative;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(143,136,58,.18), rgba(143,136,58,0) 55%),
    linear-gradient(90deg, rgba(80,100,150,.16), rgba(255,255,255,.035), rgba(150,115,60,.18));
}

.spectrum-line{
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,.30);
}

.spectrum-center{
  position: absolute;
  left: 50%;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: rgba(255,255,255,.22);
}

.spectrum-point{
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(242,239,231,.88);
  box-shadow: 0 0 10px rgba(242,239,231,.22);
}

.spectrum-point.p1{ left: 18%; }
.spectrum-point.p2{ left: 31%; }
.spectrum-point.p3{ left: 42%; }
.spectrum-point.p4{ left: 50%; width: 14px; height: 14px; background: var(--c-theory); }
.spectrum-point.p5{ left: 58%; }
.spectrum-point.p6{ left: 69%; }
.spectrum-point.p7{ left: 82%; }

.theory-card-body h2{
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.08;
}

.theory-card-body p{
  margin-bottom: 0;
}

.theory-article{
  max-width: 900px;
}

.theory-article .subtitle{
  font-size: 19px;
  color: rgba(255,255,255,.72);
  margin-top: -4px;
}

.article-placeholder{
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.10);
}

@media (max-width: 700px){
  .theory-landing .inlay,
  .theory-article .inlay{
    padding: 18px !important;
  }

  .theory-card{
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .spectrum-graphic{
    height: 96px;
  }

  .theory-card-body h2{
    font-size: 23px;
  }
}


/* ===== Theory article draft content ===== */
.article-hero-graphic{
  position: relative;
  height: 150px;
  max-width: 720px;
  margin: 22px auto 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(143,136,58,.20), rgba(143,136,58,0) 55%),
    linear-gradient(90deg, rgba(80,100,150,.16), rgba(255,255,255,.035), rgba(150,115,60,.18));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -16px 24px rgba(0,0,0,.24);
}

.article-note{
  max-width: 720px;
  margin: 0 auto 26px !important;
  font-size: 13px !important;
  text-align: center;
  color: rgba(255,255,255,.58) !important;
}

.article-body{
  max-width: 720px;
  margin: 0 auto;
}

.article-body h2{
  margin: 34px 0 10px;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ivory);
  text-shadow: 0 2px 0 rgba(0,0,0,.45);
}

.article-body h2:first-child{
  margin-top: 18px;
}

.formula-card{
  margin: 18px 0 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.05), rgba(255,255,255,0) 52%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.28));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -12px 18px rgba(0,0,0,.28);
}

.formula-card.compact{
  padding: 13px 16px;
}

.formula-title{
  margin-bottom: 7px;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.formula-main{
  color: var(--ivory);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.formula-sub{
  margin-top: 6px;
  color: rgba(255,255,255,.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
}

.spectrum-example{
  margin: 18px 0 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(90deg, rgba(58,95,143,.12), rgba(255,255,255,.025), rgba(143,106,58,.14));
}

.spectrum-axis{
  position: relative;
  height: 24px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.axis-label{
  position: absolute;
  top: 0;
}

.axis-label.left{ left: 0; }
.axis-label.center{ left: 50%; transform: translateX(-50%); }
.axis-label.right{ right: 0; }

.spectrum-bars{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
}

.spec-item{
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  text-align: center;
  background: rgba(0,0,0,.24);
}

.spec-item span{
  font-size: 12px;
  color: rgba(255,255,255,.72);
  line-height: 1.1;
  word-break: break-word;
}

.spec-item b{
  font-size: 20px;
  color: var(--ivory);
  font-weight: 500;
}

.spec-item.zero{
  background: color-mix(in srgb, var(--c-theory) 34%, rgba(0,0,0,.45));
  border-color: rgba(255,255,255,.16);
}

@media (max-width: 700px){
  .article-hero-graphic{
    height: 110px;
  }

  .article-body h2{
    font-size: 24px;
  }

  .formula-main{
    font-size: 14px;
  }

  .spectrum-bars{
    grid-template-columns: 1fr;
  }

  .spec-item{
    min-height: 0;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
  }
}
@media (max-width: 700px){
  .spectrum-axis{
    display: none;
  }
}


/* =========================================================
   NAV REBUILD — primary Mode Wheel + starlit supporting links
   ========================================================= */
:root{
  --btnH: 48px;
  --navSupportH: 48px;
  --navPrimaryH: 62px;
}

.rail-nav{
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-top: 16px;
}

.rail .navbtn{
  margin: 0;
}

/* Primary instrument entry: close to the old button scale, still clearly first. */
.rail .navbtn-primary{
  height: var(--navPrimaryH);
  margin-bottom: 10px;
  font-size: 22px;
  letter-spacing: .015em;
}

.rail .navbtn-primary::before{
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.07), rgba(255,255,255,0) 50%),
    radial-gradient(circle at 80% 88%, rgba(0,0,0,.74), rgba(0,0,0,0) 58%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 30%, rgba(9,9,12,.97)),
      color-mix(in srgb, var(--accent) 15%, rgba(0,0,0,.99))) !important;
  border-color: rgba(255,255,255,.14);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.065),
    inset 0 -10px 18px rgba(0,0,0,.70),
    0 14px 26px rgba(0,0,0,.46);
}

.rail .navbtn-primary::after{
  inset: 8px;
  border-color: rgba(0,0,0,.70);
}

/* Supporting entries: black-glass buttons, centered text, color only as a small star. */
.rail .navbtn-support{
  height: var(--navSupportH);
  justify-content:center;
  padding: 0 18px 0 30px;
  font-size: 20px;
  letter-spacing: .01em;
}

.rail .navbtn-support::before{
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.04), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.030), rgba(0,0,0,.44)) !important;
  border: 1px solid rgba(255,255,255,.075);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -8px 14px rgba(0,0,0,.46),
    0 7px 14px rgba(0,0,0,.24);
}

.rail .navbtn-support::after{
  content:"";
  display:block;
  position:absolute;
  left: 15px;
  top: 50%;
  width: 6px;
  height: 6px;
  inset: auto auto auto 15px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
  border: 0;
  background: color-mix(in srgb, var(--accent) 54%, rgba(255,255,255,.72));
  box-shadow:
    0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
    0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0));
  opacity: .72;
  pointer-events:none;
}

.rail .navbtn-support .label{
  width:100%;
  text-align:center;
  color: rgba(242,239,231,.88);
  text-shadow: 0 1px 0 rgba(0,0,0,.70);
}

.rail .navbtn-support.is-current::before{
  border-color: rgba(255,255,255,.17);
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.055), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.38)) !important;
}

.rail .navbtn-support.is-current::after{
  opacity: 1;
  width: 7px;
  height: 7px;
  box-shadow:
    0 0 6px color-mix(in srgb, var(--accent) 78%, rgba(255,255,255,.50)),
    0 0 18px color-mix(in srgb, var(--accent) 58%, rgba(255,255,255,0));
}

.rail .navbtn-support.is-current .label{
  color: var(--ivory);
}

.rail .navbtn-support:hover::before{
  border-color: rgba(255,255,255,.13);
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.06), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.36)) !important;
}

.rail .navbtn-support:hover::after{
  opacity:.96;
}

/* Mobile drawer: same hierarchy, compact and touch-friendly. */
.mobile-drawer .navbtn-primary{
  min-height: 54px;
  font-size: 18px;
  margin-bottom: 4px;
}

.mobile-drawer .navbtn-support{
  min-height: 46px;
  font-size: 16px;
  justify-content:center;
  padding: 0 16px 0 30px;
}

.mobile-drawer .navbtn-support .label{
  width:100%;
  text-align:center;
}

@media (max-width: 820px){
  .mobile-drawer .navbtn-support::before{
    background:
      radial-gradient(circle at 50% 18%, rgba(255,255,255,.055), rgba(255,255,255,0) 54%),
      linear-gradient(180deg, rgba(255,255,255,.052), rgba(0,0,0,.54)) !important;
    opacity: 1;
    border: 1px solid rgba(255,255,255,.13);
  }

  .mobile-drawer .navbtn-support::after{
    content:"";
    display:block;
    position:absolute;
    left: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    inset: auto auto auto 14px;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 1px;
    border: 0;
    background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,.72));
    box-shadow:
      0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
      0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0));
    opacity: .76;
    pointer-events:none;
  }

  .mobile-drawer .navbtn-primary::before{
    background:
      radial-gradient(circle at 18% 28%, rgba(255,255,255,.065), rgba(255,255,255,0) 52%),
      linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 46%, rgba(0,0,0,.96)),
        color-mix(in srgb, var(--accent) 22%, rgba(0,0,0,.98))) !important;
    opacity: 1;
  }
}


/* =========================================================
   NAV REBUILD V3 — clean hierarchy, abbreviated labels
   ---------------------------------------------------------
   Main Mode Wheel button now uses black-glass treatment too;
   subtopics retain starlight bullets for hierarchy.
   ========================================================= */
.rail .navbtn-primary::before{
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.052), rgba(255,255,255,0) 54%),
    radial-gradient(circle at 80% 88%, rgba(0,0,0,.74), rgba(0,0,0,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.038), rgba(0,0,0,.46)) !important;
  border-color: rgba(255,255,255,.105) !important;
}
.rail .navbtn-primary.is-current::before{
  border-color: rgba(255,255,255,.17) !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.066), rgba(255,255,255,0) 54%),
    radial-gradient(circle at 80% 88%, rgba(0,0,0,.72), rgba(0,0,0,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.052), rgba(0,0,0,.40)) !important;
}
.rail .navbtn-primary .label{
  width:100% !important;
  text-align:center !important;
  color: rgba(242,239,231,.88) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.70) !important;
}
.mobile-drawer .navbtn-primary::before{
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.062), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.050), rgba(0,0,0,.54)) !important;
  border-color: rgba(255,255,255,.14) !important;
}
.mobile-drawer .navbtn-primary.is-current::before{
  border-color: rgba(255,255,255,.20) !important;
}

/* =========================================================
   NAV REBUILD V4 — primary button matches black-glass family
   ---------------------------------------------------------
   Removes the inherited old inner-frame artifact from the
   main Mode Wheel button and normalizes nav stack spacing.
   ========================================================= */
.rail-nav{
  gap: 8px !important;
}

.rail .navbtn-primary{
  margin-bottom: 0 !important;
  height: var(--navPrimaryH) !important;
  font-size: 23px !important;
  font-weight: 600;
}

.rail .navbtn-primary::before{
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.04), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.030), rgba(0,0,0,.44)) !important;
  border: 1px solid rgba(255,255,255,.075);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -8px 14px rgba(0,0,0,.46),
    0 7px 14px rgba(0,0,0,.24);

}

.rail .navbtn-primary.is-current::before{
  border-color: rgba(255,255,255,.17) !important;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.072), rgba(255,255,255,0) 54%),
    radial-gradient(circle at 18% 24%, rgba(255,255,255,.034), rgba(255,255,255,0) 48%),
    radial-gradient(circle at 82% 86%, rgba(0,0,0,.70), rgba(0,0,0,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.056), rgba(0,0,0,.40)) !important;
}

/* The primary button should not inherit the older rune/inner-frame layer. */
.rail .navbtn-primary::after,
.mobile-drawer .navbtn-primary::after{
  display: none !important;
  content: none !important;
}

.mobile-drawer .navbtn-primary{
  margin-bottom: 0 !important;
  min-height: 54px !important;
  font-size: 18px !important;
  font-weight: 600;
}

.mobile-drawer .navbtn-primary::before{
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.068), rgba(255,255,255,0) 54%),
    radial-gradient(circle at 82% 86%, rgba(0,0,0,.72), rgba(0,0,0,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.052), rgba(0,0,0,.54)) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    inset 0 -9px 16px rgba(0,0,0,.50),
    0 8px 16px rgba(0,0,0,.28) !important;
}

.mobile-drawer .navbtn-primary.is-current::before{
  border-color: rgba(255,255,255,.20) !important;
}

/* =========================================================
   NAV REBUILD V5 — header divider + primary balance
   ---------------------------------------------------------
   Built from confirmed working v4 package.
   - softer primary font weight
   - primary gets same hover glow/lift as support buttons
   - subtle divider below brand
   - more breathing room before nav stack
   ========================================================= */
.rail .brand{
  margin-bottom: 18px !important;
  padding-bottom: 16px !important;
  position: relative;
}

.rail .brand::after{
  content:"";
  position:absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0),
    rgba(255,255,255,.16) 25%,
    rgba(255,255,255,.24) 50%,
    rgba(255,255,255,.16) 75%,
    rgba(255,255,255,0));
  box-shadow: 0 0 10px rgba(255,255,255,.055);
  opacity: .78;
}

.rail-nav{
  gap: 8px !important;
}

.rail .navbtn-primary,
.mobile-drawer .navbtn-primary{
  font-weight: 500 !important;
}

.rail .navbtn-primary:hover::before{
  border-color: rgba(255,255,255,.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    inset 0 -9px 16px rgba(0,0,0,.46),
    0 10px 20px rgba(0,0,0,.32),
    0 0 16px rgba(255,255,255,.045) !important;
}

.mobile-drawer .navbtn-primary:hover::before{
  border-color: rgba(255,255,255,.20) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    inset 0 -9px 16px rgba(0,0,0,.48),
    0 10px 20px rgba(0,0,0,.32),
    0 0 16px rgba(255,255,255,.045) !important;
}

.mobile-header .brand{
  position: relative;
  padding-bottom: 4px;
}

.mobile-header .brand::after{
  content:"";
  position:absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0),
    rgba(255,255,255,.16),
    rgba(255,255,255,0));
  opacity: .7;
}


/* === Primary Mode Wheel starlight marker === */
/* Placed at the end so it overrides the earlier primary ::after hiding rule. */
.rail .navbtn-primary::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  left: 15px !important;
  top: 50% !important;
  width: 6px !important;
  height: 6px !important;
  inset: auto auto auto 15px !important;
  transform: translateY(-50%) rotate(45deg) !important;
  border-radius: 1px !important;
  border: 0 !important;
  background: color-mix(in srgb, var(--accent) 54%, rgba(255,255,255,.72)) !important;
  box-shadow:
    0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
    0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
  opacity: .72 !important;
  pointer-events:none !important;
}

.rail .navbtn-primary{
  padding: 0 18px 0 30px !important;
}

.rail .navbtn-primary .label{
  width:100% !important;
  text-align:center !important;
}


/* === Mobile drawer double-star markers === */
/* Mobile gets matching left/right starlight markers on every nav button, including Mode Wheel. */
@media (max-width: 820px){
  .mobile-drawer .navbtn-primary,
  .mobile-drawer .navbtn-support{
    padding: 0 30px !important;
  }

  .mobile-drawer .navbtn-primary::after,
  .mobile-drawer .navbtn-support::after{
    content:"" !important;
    display:block !important;
    position:absolute !important;
    left: 14px !important;
    top: 50% !important;
    width: 6px !important;
    height: 6px !important;
    inset: auto auto auto 14px !important;
    transform: translateY(-50%) rotate(45deg) !important;
    border-radius: 1px !important;
    border: 0 !important;
    background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,.72)) !important;
    box-shadow:
      0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
      0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
    opacity: .76 !important;
    pointer-events:none !important;
  }

  .mobile-drawer .navbtn-primary::before,
  .mobile-drawer .navbtn-support::before{
    z-index: 0;
  }

  .mobile-drawer .navbtn-primary .label,
  .mobile-drawer .navbtn-support .label{
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
  }

  .mobile-drawer .navbtn-primary .label::after,
  .mobile-drawer .navbtn-support .label::after{
    content:"";
    position:absolute;
    right: -16px;
    top: 50%;
    width: 6px;
    height: 6px;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 1px;
    background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,.72));
    box-shadow:
      0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
      0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0));
    opacity: .76;
    pointer-events:none;
  }
}


/* === Desktop primary Mode Wheel starlight marker === */
.rail .navbtn-primary::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  left: 15px !important;
  top: 50% !important;
  width: 6px !important;
  height: 6px !important;
  inset: auto auto auto 15px !important;
  transform: translateY(-50%) rotate(45deg) !important;
  border-radius: 1px !important;
  border: 0 !important;
  background: color-mix(in srgb, var(--accent) 54%, rgba(255,255,255,.72)) !important;
  box-shadow:
    0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
    0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
  opacity: .72 !important;
  pointer-events:none !important;
}

.rail .navbtn-primary{
  padding: 0 18px 0 30px !important;
}

.rail .navbtn-primary .label{
  width:100% !important;
  text-align:center !important;
}


/* === Final nav star color/glow overrides === */
/* User Guide gets yellow while Spectrum Theory keeps emerald. */
.rail .navbtn-support[href="using-the-mode-wheel.html"],
.mobile-drawer .navbtn-support[href="using-the-mode-wheel.html"]{
  --accent: #d6b84a !important;
}

/* Force Mode Wheel star to use the same size/brightness behavior as support stars. */
.rail .navbtn-primary::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  left: 15px !important;
  top: 50% !important;
  width: 6px !important;
  height: 6px !important;
  inset: auto auto auto 15px !important;
  transform: translateY(-50%) rotate(45deg) !important;
  border-radius: 1px !important;
  border: 0 !important;
  background: color-mix(in srgb, var(--accent) 54%, rgba(255,255,255,.72)) !important;
  box-shadow:
    0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
    0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
  opacity: .72 !important;
  filter: none !important;
  pointer-events:none !important;
  z-index: 3 !important;
}

.rail .navbtn-primary.is-current::after,
.rail .navbtn-primary:hover::after{
  opacity: .96 !important;
}

/* Keep primary text centered with the marker present. */
.rail .navbtn-primary{
  padding: 0 18px 0 30px !important;
}

.rail .navbtn-primary .label{
  width:100% !important;
  text-align:center !important;
}

/* Mobile: make Mode Wheel left/right stars behave like the rest. */
@media (max-width: 820px){
  .mobile-drawer .navbtn-primary::after{
    content:"" !important;
    display:block !important;
    position:absolute !important;
    left: 14px !important;
    top: 50% !important;
    width: 6px !important;
    height: 6px !important;
    inset: auto auto auto 14px !important;
    transform: translateY(-50%) rotate(45deg) !important;
    border-radius: 1px !important;
    border: 0 !important;
    background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,.72)) !important;
    box-shadow:
      0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
      0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
    opacity: .76 !important;
    filter: none !important;
    pointer-events:none !important;
    z-index: 3 !important;
  }

  .mobile-drawer .navbtn-primary .label::after{
    content:"" !important;
    position:absolute !important;
    right: -16px !important;
    top: 50% !important;
    width: 6px !important;
    height: 6px !important;
    transform: translateY(-50%) rotate(45deg) !important;
    border-radius: 1px !important;
    background: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,.72)) !important;
    box-shadow:
      0 0 4px color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,.35)),
      0 0 12px color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0)) !important;
    opacity: .76 !important;
    pointer-events:none !important;
  }
}



/* =========================================================
   MOBILE STANDALONE SHARE BUTTON
   ========================================================= */

.app-only-share{
  display:none;
}

body.is-standalone .app-only-share{
  display:inline-flex;
}

@media (max-width: 820px){

  .mobile-header-inner{
    position: relative;
  }

  .mobile-share-btn{
    display:flex;
    align-items:center;
    justify-content:center;

    width: 42px;
    height: 42px;

    margin-left: 8px;

    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);

    background: rgba(0,0,0,0.25);
    color: rgba(242,239,231,.92);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
  }

  .mobile-share-menu{
    position: absolute;
    right: 0;
    top: calc(100% + 10px);

    width: 220px;

    padding: 10px;

    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);

    background: rgba(0,0,0,.72);

    display: grid;
    gap: 8px;

    z-index: 100;
  }

  .share-option{
    appearance: none;
    border: 1px solid rgba(255,255,255,.12);

    border-radius: 12px;

    padding: 12px 14px;

    background:
      radial-gradient(circle at 50% 18%, rgba(255,255,255,.05), rgba(255,255,255,0) 54%),
      linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.42));

    color: rgba(242,239,231,.92);

    font-family: inherit;
    font-size: 15px;

    text-align: center;

    cursor: pointer;
  }

  .share-option:hover{
    border-color: rgba(255,255,255,.20);
  }
}


/* === Mobile standalone share menu fixes === */
.mobile-share-menu[hidden]{
  display: none !important;
}

/* =========================================================
   MODE WHEEL MOBILE QUICK HELP
   Matches the standalone share control, but is created only
   on the wheel page in an ordinary mobile browser.
   ========================================================= */

.mobile-wheel-help-button,
.mobile-wheel-help-overlay{
  display: none;
}

@media (max-width: 820px){
  .mobile-wheel-help-button{
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--mobile-wheel-help-width, 42px);
    height: var(--mobile-wheel-help-height, 42px);
    margin-left: 0;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.25);
    color: rgba(242,239,231,.92);
    font-family: inherit;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-header-inner > .hamburger{
    margin-left: auto;
  }

  .mobile-wheel-help-overlay{
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 76px 14px 20px;
    background: rgba(0,0,0,.34);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-wheel-help-overlay[hidden]{
    display: none !important;
  }

  .mobile-wheel-help-panel{
    width: min(390px, 100%);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 20px 19px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,.07), rgba(255,255,255,0) 48%),
      rgba(5,5,5,.92);
    color: rgba(242,239,231,.94);
    box-shadow: 0 18px 44px rgba(0,0,0,.58);
  }

  .mobile-wheel-help-panel h2{
    margin: 0 0 11px;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
  }

  .mobile-wheel-help-panel p{
    margin: 0 0 9px;
    font-size: 15px;
    line-height: 1.42;
  }

  .mobile-wheel-help-panel p:last-child{
    margin-bottom: 0;
  }
}

@media (max-width: 820px){
  .mobile-share-menu{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: min(360px, calc(100vw - 20px)) !important;

    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }

  .share-option{
    min-height: 48px;
    padding: 10px 10px !important;
    line-height: 1.15;
  }
}

.about-page h3.turning-header{
  font-style: italic;
}

.toc-header{
  text-decoration: underline;
}
