* {
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
}

body, p, li {
  font-family: 'Lato', sans-serif;
}

code, pre {
  font-family: 'Fira Code', monospace;
}

html {
    box-sizing: border-box;
    font-size: 16px;
    background: linear-gradient(135deg, #ffffff, #c3c3f3, #0046f6);
    background-size: 400% 400%;
}

header {
    top: 20px;
    background-color: #15256d;
    display: flex;
    justify-content: center;
    border-bottom: silver 5px solid;
}

.nav-bar {
    height: 3rem;
    justify-content: center;
    align-items: center;
    display: flex;
    padding: 1rem;
}

.nav-bar ul {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-bar li {
    display: inline-flex;
    flex-direction: column;
    padding: 0rem 1rem;
    color: white;
}

.nav-bar a {
    color: white;
    text-decoration: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.page-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

.project-page-link h3 {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.ranking-frameworks-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 80%;
}

.levels-main-header, .levels-embed-header {
    display: flex;
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60%;
    max-width: 40rem;
}

.levels-main-header h3, .levels-embed-header h3 {
    text-align: center;
}

.levels-main-header ol, .levels-embed-header ol {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-content: center;
}

.levels-main-header li, .levels-embed-header li {
    padding: 0.25rem;
}

.levels-image-container {
    display: flex;
    margin: 1rem;
}

.levels-image-container img {
    max-width: 80%;
    height: auto;
    margin: 0 auto;
    border-radius: 25px;
    border:#031564 10px solid;
}

.levels-actions, .levels-cost-curves, .levels-curve-visuals, .levels-code {
    font-size: 0.75rem;
    height: 30rem; 
    overflow: auto; 
    border: 3px solid #ccc; 
    padding: 1rem; 
    background-color: #f8f8f8; 
    width: 80%;
    margin: 1rem;
}

.levels-sheets-embed {
    width: 100%;
    height: 100%;
}

footer {
    display: flex;
    width: 100%;
    justify-content: center;
    align-content: center;
    height: 4em;
    background-color: #15256d;
    position: relative;
    border-top: silver 5px solid;
}

.copyright {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
}

.copyright p {
    color: silver;
    font-size: 1.25rem;
}

@media only screen and (max-width: 769px) {
    
    .levels-main-header {
        width: 80%;
    }

    .levels-embed-header {
        width: 80%;
    }

}

/* Footer at the bottom: on a short page it sits at the foot of the window, on a long page after the content */
body {
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  padding-bottom: calc(4em + 5px); /* room for the footer, which is 4em tall plus its 5px border */
}

footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ---- lv-visual-styles (moved from inline <style>) ---- */
.lv-section { width: 100%; max-width: 1100px; margin: 2rem auto; padding: 1.5rem; box-sizing: border-box; background: #fff; border: 5px solid #0046f6; border-radius: 0.5rem; color: #1b1f3a; font-family: 'Lato', sans-serif; }
.lv-section h2 { text-align: center; color: #15256d; font-family: 'Poppins', sans-serif; margin: 0 0 0.75rem; }
.lv-section h3 { color: #15256d; font-family: 'Poppins', sans-serif; margin: 1.75rem 0 0.75rem; text-align: left; }
.lv-section details.cz-dd > summary { font-size: 1.05rem; }
.lv-intro { max-width: 52rem; margin: 0 auto 1rem; line-height: 1.6; text-align: center; }
.lv-banner { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: center; background: #eef2ff; border: 1px dashed #0046f6; border-radius: 8px; padding: 0.7rem 1rem; margin: 0 0 1rem; text-align: center; font-size: 0.95rem; }
.lv-banner a { color: #0046f6; font-weight: 700; }
.lv-tag { display: inline-block; vertical-align: middle; margin-left: 0.4rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: #0046f6; color: #fff; font-size: 0.7rem; font-family: 'Lato', sans-serif; font-weight: 700; letter-spacing: 0.03em; }

.lv-seq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; align-items: stretch; }
.lv-step { position: relative; background: #f3f5ff; border: 1px solid #d6dcf5; border-top: 4px solid #2645c5; border-radius: 8px; padding: 0.8rem 0.9rem; box-sizing: border-box; }
.lv-step b { display: inline-flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 50%; background: #2645c5; color: #fff; font-size: 0.85rem; margin-right: 0.4rem; }
.lv-step strong { color: #15256d; }
.lv-step p { margin: 0.4rem 0 0; font-size: 0.9rem; line-height: 1.5; }
.lv-step code { background: #e6e9fb; border-radius: 4px; padding: 0 0.3rem; font-size: 0.82rem; }

.lv-panel { border: 1px solid #c5cdf0; border-radius: 10px; background: #fafbff; padding: 1rem; box-sizing: border-box; }
.lv-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.lv-btn { cursor: pointer; border: 1px solid #0056b3; background: #fff; color: #0056b3; border-radius: 6px; padding: 0.4rem 0.75rem; font-weight: 700; font-size: 0.9rem; font-family: 'Lato', sans-serif; min-height: 2.4rem; }
.lv-btn:hover { background: #eef2ff; }
.lv-btn.active { background: #0056b3; color: #fff; }
.lv-btn:focus-visible, .lv-range:focus-visible, .lv-select:focus-visible { outline: 3px solid #15256d; outline-offset: 2px; }
.lv-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lv-sliderrow { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0.9rem; }
.lv-range { flex: 1 1 auto; min-width: 0; height: 2rem; accent-color: #0046f6; }
.lv-levelout { font-family: 'Poppins', sans-serif; font-weight: 700; color: #15256d; min-width: 6.5rem; text-align: right; }
.lv-bandname { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem; margin-bottom: 0.6rem; }
.lv-b-hand { background: #fef3c7; color: #92400e; } .lv-b-curve { background: #dbeafe; color: #1e40af; } .lv-b-chain { background: #ede9fe; color: #5b21b6; }

.lv-wf { display: flex; flex-direction: column; gap: 0.45rem; }
.lv-row { display: grid; grid-template-columns: 11rem 1fr 9.5rem; gap: 0.7rem; align-items: center; }
.lv-row .lv-lab strong { display: block; color: #15256d; font-size: 0.92rem; }
.lv-row .lv-lab span { display: block; font-size: 0.78rem; color: #4a4a5a; line-height: 1.3; }
.lv-bar { height: 1.15rem; background: #e6e9fb; border-radius: 999px; overflow: hidden; }
.lv-bar i { display: block; height: 100%; min-width: 0.35rem; background: #2645c5; border-radius: 999px; transition: width 0.35s ease; }
.lv-row.mult .lv-bar i { background: #7c3aed; } .lv-row.total .lv-bar i { background: #047857; } .lv-row.carry .lv-bar i { background: #64748b; }
.lv-val { font-family: 'Fira Code', monospace; font-size: 0.88rem; font-weight: 700; text-align: right; color: #15256d; }
.lv-row.total { border-top: 2px solid #15256d; padding-top: 0.5rem; margin-top: 0.2rem; }
.lv-factors { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.8rem 0 0; }
.lv-chip { background: #fff; border: 1px solid #c5cdf0; border-radius: 6px; padding: 0.25rem 0.55rem; font-size: 0.8rem; line-height: 1.3; }
.lv-chip b { color: #15256d; }
.lv-note { font-size: 0.82rem; color: #4a4a5a; line-height: 1.5; margin: 0.7rem 0 0; }

.lv-chart { width: 100%; height: auto; display: block; margin-top: 1rem; background: #fff; border: 1px solid #d6dcf5; border-radius: 8px; }
.lv-chart text { font-family: 'Lato', sans-serif; font-size: 11px; fill: #4a4a5a; }
.lv-chart .lv-title { font-size: 12px; font-weight: 700; fill: #15256d; }

.lv-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; background: #15256d; color: #fff; border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 0.8rem; font-size: 0.92rem; }
.lv-status .lv-chip { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: #fff; }
.lv-status .lv-chip b { color: #fde68a; }
.lv-status button { margin-left: auto; background: transparent; border: 0; color: #bfdbfe; text-decoration: underline; cursor: pointer; font-size: 0.85rem; font-family: 'Lato', sans-serif; min-height: 2.4rem; }
.lv-scene { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lv-prog { background: #e6e9fb; border-radius: 999px; height: 1.6rem; overflow: hidden; position: relative; }
.lv-prog i { display: block; height: 100%; background: linear-gradient(90deg, #2645c5, #22c55e); width: 0; transition: width 0.25s ease; }
.lv-prog span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: #0b1240; }
.lv-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.8rem 0; }
.lv-block { aspect-ratio: 1.3; border: 3px solid #4b3a1c; border-radius: 6px; background: repeating-linear-gradient(45deg, #8b6b3d, #8b6b3d 8px, #7a5c33 8px, #7a5c33 16px); cursor: pointer; font-size: 0; position: relative; min-height: 3rem; }
.lv-block { display: flex; align-items: center; justify-content: center; }
.lv-block::before { content: attr(data-n); font-size: 0.95rem; font-weight: 800; color: #fff7e0; text-shadow: 0 1px 2px #3b2a0f, 0 0 4px #3b2a0f; text-align: center; line-height: 1.1; padding: 0 0.2rem; pointer-events: none; }
.lv-block.broken::before { content: ""; }
.lv-block::after { pointer-events: none; }
.lv-block::before { white-space: pre-line; }
.lv-block.lv-lucky:not(.broken) { background: repeating-linear-gradient(45deg, #fbbf24, #fbbf24 8px, #f59e0b 8px, #f59e0b 16px); border-color: #92400e; box-shadow: 0 0 10px 2px #fde68a; animation: lvlucky 1.4s ease-in-out infinite; }
.lv-block.lv-lucky::before { color: #451a03; text-shadow: 0 1px 0 #fef3c7; }
@keyframes lvlucky { 50% { box-shadow: 0 0 18px 5px #fcd34d; } }
.lv-block.pop::after { white-space: nowrap; }
.lv-block:hover { filter: brightness(1.12); }
.lv-block:focus-visible { outline: 3px solid #15256d; outline-offset: 2px; }
.lv-block.broken { background: #e7e1d3; border-style: dashed; border-color: #b9ae94; }
.lv-block.pop::after { content: attr(data-gain); position: absolute; left: 50%; top: -0.2rem; transform: translateX(-50%); font-size: 0.8rem; font-weight: 700; color: #065f46; background: #d1fae5; padding: 0 0.4rem; border-radius: 999px; animation: lvpop 0.7s ease forwards; }
@keyframes lvpop { from { opacity: 1; top: 0.4rem; } to { opacity: 0; top: -1.6rem; } }
.lv-tap { margin: 0.4rem 0 0; font-weight: 700; color: #0046f6; font-size: 0.9rem; }
.lv-log { min-height: 9rem; max-height: 15rem; overflow-y: auto; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 0.6rem 0.8rem; font-family: 'Fira Code', monospace; font-size: 0.78rem; line-height: 1.55; box-sizing: border-box; }
.lv-log div.up { color: #86efac; } .lv-log div.mut { color: #94a3b8; }
.lv-label { font-weight: 700; color: #15256d; font-size: 0.88rem; margin: 0.4rem 0 0.3rem; display: block; }
.lv-select { min-height: 2.4rem; border: 1px solid #0056b3; border-radius: 6px; padding: 0.3rem 0.5rem; font-size: 0.9rem; font-family: 'Lato', sans-serif; background: #fff; }
.lv-nudge { animation: lvglow 1.6s ease-in-out infinite; }
@keyframes lvglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,70,246,0.45); } 50% { box-shadow: 0 0 0 7px rgba(0,70,246,0); } }

.lv-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.lv-band { background: #f3f5ff; border: 1px solid #d6dcf5; border-left: 5px solid #2645c5; border-radius: 8px; padding: 0.8rem 1rem; box-sizing: border-box; }
.lv-band h4 { margin: 0 0 0.3rem; color: #15256d; font-size: 1rem; }
.lv-band p { margin: 0.3rem 0 0; font-size: 0.88rem; line-height: 1.5; }
.lv-band code { background: #e6e9fb; border-radius: 4px; padding: 0 0.3rem; font-size: 0.8rem; word-break: break-word; }
.lv-band.red { border-left-color: #94a3b8; background: #f4f5f8; }
.lv-gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.lv-gl { background: #fff; border: 1px solid #d6dcf5; border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.9rem; line-height: 1.5; }
.lv-gl strong { color: #15256d; display: block; }

@media (max-width: 900px) {
  .lv-seq { grid-template-columns: 1fr 1fr; }
  .lv-scene { grid-template-columns: 1fr; }
  .lv-bands { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .lv-section { padding: 1rem 0.7rem; border-width: 3px; margin: 1rem calc(50% - 50vw + 0.5rem); width: calc(100vw - 1rem); min-width: 0; max-width: none; }
  .lv-section > *, .lv-panel, .lv-scene > div, .lv-sliderrow { min-width: 0; max-width: 100%; }
  .lv-seq { grid-template-columns: 1fr; }
  .lv-bands, .lv-gloss { grid-template-columns: 1fr; }
  .lv-row { grid-template-columns: 1fr; gap: 0.25rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e6e9fb; }
  .lv-row.total { border-top: 2px solid #15256d; }
  .lv-val { text-align: left; font-size: 0.95rem; }
  .lv-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.3rem; scroll-snap-type: x proximity; width: 100%; }
  .lv-presets .lv-btn { flex: 0 0 auto; }
  .lv-levelout { min-width: 5.5rem; }
  .lv-status button { margin-left: 0; }
  .lv-blocks { grid-template-columns: repeat(3, 1fr); }
  .lv-log { max-height: 12rem; }
  .lv-chart text { font-size: 22px !important; }
}
.lv-blocks { touch-action: pan-y; }
.lv-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.lv-sub { font-family: 'Poppins', sans-serif; font-weight: 700; color: #15256d; font-size: 1rem; margin: 1.1rem 0 0.5rem; }
.lv-ms { display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.6rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 0.8rem; }
.lv-row.rate .lv-bar i { background: #0d9488; } .lv-row.time .lv-bar i { background: #e11d48; }
.lv-chart .lv-ml { font-size: 10px; fill: #92400e; }
.lv-gear { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 0.7rem 0; }
.lv-gearbox { display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 2px solid #c5cdf0; border-radius: 12px; padding: 0.55rem 0.7rem; min-width: 0; }
.lv-gearbox svg { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; }
.lv-gearbox > div { flex: 1 1 auto; min-width: 0; }
.lv-gearbox .lv-label { margin: 0 0 0.15rem; display: block; }
.lv-gearbox input[type=range] { width: 100%; min-width: 0; accent-color: #0046f6; }
.lv-gearbox .lv-select { width: 100%; }
.lv-auto { font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; margin-top: 0.15rem; }
.lv-scene .lv-select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.lv-balance { display: flex; align-items: center; gap: 0.5rem; background: #ecfeff; border: 2px solid #67e8f9; border-radius: 999px; padding: 0.2rem 0.9rem 0.2rem 0.3rem; margin: 0.2rem 0; width: fit-content; max-width: 100%; }
.lv-balance .lv-orb { width: 2rem; height: 2rem; flex: 0 0 auto; }
.lv-balance > div { min-width: 0; line-height: 1.1; }
.lv-balk { display: block; font-size: 0.7rem; color: #155e75; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
#lv-atoms { font-size: 1.1rem; color: #0e7490; font-weight: 800; }
.lv-balance.spend { animation: lvspend 0.7s ease; }
@keyframes lvspend { 0% { background: #fecaca; border-color: #f87171; } 100% { background: #ecfeff; border-color: #67e8f9; } }
.lv-balance.gain { animation: lvgain 0.7s ease; }
@keyframes lvgain { 0% { background: #bbf7d0; border-color: #4ade80; } 100% { background: #ecfeff; border-color: #67e8f9; } }
.lv-confirm { margin-top: 0.5rem; padding: 0.5rem 0.6rem; border: 2px solid #f59e0b; background: #fffbeb; border-radius: 10px; }
.lv-confirm p { margin: 0 0 0.3rem; font-size: 0.9rem; }
.lv-orb-s { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e0faff, #22d3ee 45%, #0e7490); border: 1px solid #155e75; margin-right: 0.25rem; }
.lv-boost { font-weight: 800; font-size: 1.1rem; color: #64748b; }
.lv-boost.on { color: #b45309; animation: lvlucky 1.2s ease-in-out infinite; }
.lv-boost small { display: block; font-size: 0.78rem; font-weight: 700; color: #92400e; }
.lv-logbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.lv-logbar > .lv-label { margin: 0; }
.lv-speed { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.lv-speed .lv-label { margin: 0; white-space: nowrap; }
.lv-scene .lv-speed .lv-select { width: auto; min-width: 9.5rem; }
.lv-atoms { font-weight: 800; color: #0e7490; font-size: 1.05rem; }
.lv-upbtns .lv-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 768px) { .lv-gear { grid-template-columns: 1fr; } }

/* ---- Production layout: player view + engineer console ---- */
.lv-stage { background: #eef1fb; padding: 0.9rem; }
.lv-stage .lv-scene { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.lv-player { background: linear-gradient(180deg, #ffffff, #f4f6ff); border: 2px solid #c5cdf0; border-radius: 14px; padding: 0.9rem; box-shadow: 0 2px 0 #c5cdf0; min-width: 0; }
.lv-pane-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; margin-bottom: 0.7rem; }
.lv-pane-tag { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.65rem; border-radius: 999px; }
.lv-tag-player { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.lv-pane-sub { font-size: 0.78rem; color: #55657a; }
.lv-hud { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; }
.lv-lvl { background: #15256d; color: #fff; border-radius: 12px; padding: 0.35rem 0.8rem; text-align: center; line-height: 1; min-width: 4rem; }
.lv-lvl span { display: block; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: #bfdbfe; }
.lv-lvl b { font-family: 'Poppins', sans-serif; font-size: 1.6rem; color: #fde68a; }
.lv-hudrow { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; font-weight: 700; color: #15256d; margin-bottom: 0.2rem; }
.lv-hudmine { color: #0e7490; white-space: nowrap; }
.lv-stage .lv-balance { margin: 0; }
.lv-stage .lv-tap { text-align: center; margin: 0.7rem 0 0; }
.lv-stage .lv-gear { margin: 0.2rem 0 0; }
.lv-console { background: #0b1220; color: #cbd5e1; border: 1px solid #1e293b; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; font-family: 'Fira Code', monospace; box-shadow: 0 6px 18px rgba(2, 6, 23, 0.35); }
.lv-con-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; background: #111a2e; border-bottom: 1px solid #1e293b; padding: 0.55rem 0.8rem; }
.lv-dots { display: inline-flex; gap: 0.3rem; } .lv-dots i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #ef4444; } .lv-dots i:nth-child(2) { background: #f59e0b; } .lv-dots i:nth-child(3) { background: #22c55e; }
.lv-con-title { color: #e2e8f0; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.lv-con-h .lv-pane-sub { color: #94a3b8; font-family: 'Lato', sans-serif; }
.lv-con-sec { padding: 0.7rem 0.8rem; border-bottom: 1px solid #1e293b; }
.lv-con-lab { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #94a3b8; margin-bottom: 0.45rem; }
.lv-tune { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 0.7rem; align-items: center; font-size: 0.78rem; }
.lv-tune label { color: #94a3b8; }
.lv-console .lv-select { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 6px; font-family: 'Fira Code', monospace; font-size: 0.78rem; min-height: 2.1rem; width: 100%; max-width: 100%; min-width: 0; }
.lv-console .lv-select:focus-visible, .lv-cbtn:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.lv-con-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.lv-cbtn { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 6px; padding: 0.35rem 0.8rem; font-family: 'Fira Code', monospace; font-size: 0.76rem; cursor: pointer; min-height: 2.2rem; }
.lv-cbtn:hover { background: #273449; border-color: #475569; }
.lv-console .lv-status { background: transparent; padding: 0; margin: 0; border-radius: 0; gap: 0.35rem; font-size: 0.74rem; }
.lv-console .lv-chip { background: #0f172a; border: 1px solid #1e293b; color: #94a3b8; border-radius: 4px; font-size: 0.72rem; }
.lv-console .lv-chip b { color: #7dd3fc; }
.lv-console .lv-status button { margin-left: 0; color: #7dd3fc; font-family: 'Fira Code', monospace; font-size: 0.72rem; min-height: 2rem; }
.lv-con-log { flex: 1 1 auto; display: flex; flex-direction: column; border-bottom: 0; min-height: 0; }
.lv-console .lv-log { flex: 1 1 auto; background: #050a14; border: 1px solid #1e293b; min-height: 11rem; max-height: 17rem; border-radius: 6px; font-size: 0.74rem; }
.lv-console .lv-log div::before { content: "> "; color: #475569; }
@media (max-width: 900px) { .lv-stage .lv-scene { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .lv-stage { padding: 0.5rem; }
  .lv-hud { grid-template-columns: auto minmax(0, 1fr); } .lv-stage .lv-balance { grid-column: 1 / -1; }
  .lv-tune { grid-template-columns: 1fr; gap: 0.2rem; } .lv-tune label { margin-top: 0.3rem; }
  .lv-console .lv-log { max-height: 13rem; }
}

.lv-math { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.86rem; }
.lv-form { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 0.55rem 0.7rem; font-family: 'Fira Code', monospace; font-size: 0.76rem; line-height: 1.5; overflow-wrap: anywhere; }
.lv-form code { display: block; background: transparent; color: #e2e8f0; padding: 0; font-size: inherit; white-space: normal; }
.lv-form code + code { margin-top: 0.25rem; color: #86efac; } .lv-form code.lv-red { color: #fca5a5; }
.lv-form sup { font-size: 0.7em; }
.lv-facts, .lv-stats { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lv-facts span, .lv-stats span { background: #fff; border: 1px solid #c5cdf0; border-radius: 6px; padding: 0.15rem 0.5rem; font-size: 0.76rem; }
.lv-facts b, .lv-stats b { color: #15256d; }
.lv-stats span { background: #ecfdf5; border-color: #86efac; }
.lv-why { margin: 0; font-size: 0.82rem; color: #334155; }
.lv-ex { border: 1px solid #c5cdf0; border-radius: 8px; background: #fff; overflow: hidden; }
.lv-ex-h { background: #e6e9fb; color: #15256d; font-weight: 700; font-size: 0.78rem; padding: 0.25rem 0.6rem; }
.lv-st { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; gap: 0.1rem 0.5rem; align-items: baseline; padding: 0.3rem 0.6rem; border-top: 1px solid #eef0fb; font-size: 0.78rem; }
.lv-st-n { color: #64748b; font-weight: 700; } .lv-st code { background: transparent; padding: 0; font-size: 0.74rem; color: #334155; white-space: normal; overflow-wrap: anywhere; }
.lv-st b { color: #15256d; text-align: right; font-family: 'Fira Code', monospace; font-size: 0.76rem; }
.lv-st em { grid-column: 2 / -1; color: #047857; font-style: normal; font-weight: 700; font-size: 0.74rem; }
.lv-spark { width: 100%; height: auto; display: block; background: #f4f6ff; border: 1px solid #dfe4fa; border-radius: 6px; }
.lv-spark-l { display: flex; justify-content: space-between; font-size: 0.72rem; color: #475569; margin-top: -0.35rem; }
.lv-hand { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.3rem; }
.lv-hand div { background: #fff; border: 1px solid #c5cdf0; border-radius: 6px; padding: 0.25rem; text-align: center; font-size: 0.72rem; }
.lv-hand span { display: block; color: #64748b; } .lv-hand b { color: #15256d; }
.lv-assume { margin-top: 0.8rem; border: 1px solid #c5cdf0; border-radius: 8px; background: #fff; padding: 0.2rem 0.8rem; }
.lv-assume summary { cursor: pointer; font-weight: 700; color: #15256d; padding: 0.5rem 0; min-height: 2.4rem; display: flex; align-items: center; }
.lv-assume ul { margin: 0 0 0.6rem; padding-left: 1.1rem; font-size: 0.86rem; color: #334155; }
.lv-assume li { margin-bottom: 0.4rem; }
.lv-player { display: flex; flex-direction: column; }
.lv-player .lv-blocks { flex: 1 1 auto; grid-auto-rows: minmax(5rem, 1fr); }
@media (max-width: 768px) { .lv-hand { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lv-st { grid-template-columns: 1rem minmax(0, 1fr); } .lv-st b { grid-column: 2; text-align: left; } }

.lv-player .lv-blocks, .lv-stage .lv-blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; box-sizing: border-box; padding: 0.3rem; }
.lv-block { min-width: 0; overflow: hidden; }
.lv-block::before { white-space: pre-line; overflow-wrap: anywhere; font-size: clamp(0.72rem, 1.6vw, 0.95rem); }
.lv-player > * { min-width: 0; }

.lv-balance.can-spend:not(.spend):not(.gain) { animation: lvglow 1.6s ease-in-out infinite; border-color: #22d3ee; }
@keyframes lvglow { 0%, 100% { box-shadow: 0 0 4px 0 rgba(34, 211, 238, 0.35); background: #ecfeff; } 50% { box-shadow: 0 0 16px 5px rgba(34, 211, 238, 0.75); background: #cffafe; } }
.lv-balance.can-spend .lv-orb { animation: lvorb 1.6s ease-in-out infinite; }
@keyframes lvorb { 50% { transform: scale(1.12); filter: drop-shadow(0 0 5px #22d3ee); } }
.lv-upbtns .lv-btn:not([disabled]) { box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.45); }
@media (prefers-reduced-motion: reduce) { .lv-balance.can-spend:not(.spend):not(.gain), .lv-balance.can-spend .lv-orb { animation: none; box-shadow: 0 0 10px 3px rgba(34, 211, 238, 0.6); } }

.lv-stack { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 0.5rem; }
.lv-mc { flex: 1 1 11rem; max-width: 14rem; background: #f3f5ff; border: 1px solid #d6dcf5; border-top: 4px solid #2645c5; border-radius: 10px; padding: 0.65rem 0.7rem; position: relative; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.lv-mc strong { color: #15256d; padding-right: 1.6rem; margin-top: 0.4rem; } .lv-mc em { font-style: normal; font-size: 0.78rem; color: #0e7490; font-weight: 700; }
.lv-mc p { margin: 0.2rem 0; font-size: 0.84rem; line-height: 1.45; } .lv-mc code { background: #e6e9fb; border-radius: 4px; padding: 0 0.25rem; font-size: 0.78rem; }
.lv-mn { position: absolute; top: 0.5rem; right: 0.55rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #15256d; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 800; }
.lv-mx { margin-top: auto; font-size: 0.7rem; color: #55657a; border-top: 1px dashed #c5cdf0; padding-top: 0.25rem; }
.lv-op { display: flex; align-items: center; font-size: 1.6rem; font-weight: 800; color: #2645c5; }
.lv-res { border-top-color: #059669; background: #ecfdf5; border-color: #a7f3d0; }
.lv-res .lv-mn { background: #047857; }
.lv-mods { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 0.7rem; align-items: center; margin: 0.4rem 0 0.7rem; font-size: 0.88rem; }
.lv-mods label { font-weight: 700; color: #15256d; } .lv-mods .lv-select { width: 100%; max-width: 100%; min-width: 0; }
.lv-tablewrap { overflow-x: auto; margin: 0.5rem 0; } .lv-table { border-collapse: collapse; width: 100%; font-size: 0.84rem; }
.lv-table th, .lv-table td { border: 1px solid #d6dcf5; padding: 0.3rem 0.55rem; text-align: left; } .lv-table th { background: #e6e9fb; color: #15256d; } .lv-table td:last-child, .lv-table th:last-child { text-align: right; font-family: 'Fira Code', monospace; }
@media (max-width: 768px) { .lv-mc { max-width: none; flex-basis: 100%; } .lv-op { flex-basis: 100%; justify-content: center; font-size: 1.3rem; line-height: 1; } .lv-mods { grid-template-columns: 1fr; gap: 0.2rem; } }

.lv-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.lv-mc { max-width: none; flex: none; }
.lv-opb { position: absolute; top: -0.8rem; left: 0.7rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #2645c5; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; line-height: 1; box-shadow: 0 0 0 3px #fff; }
.lv-res .lv-opb { background: #047857; }
@media (max-width: 900px) { .lv-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .lv-stack { grid-template-columns: 1fr; gap: 1.1rem; } }

.lv-built { background: #ecfdf5; border: 1px solid #86efac; border-left: 5px solid #059669; border-radius: 8px; padding: 0.7rem 1rem; margin: 0.8rem 0; font-size: 0.92rem; }
.lv-built strong { color: #065f46; display: block; margin-bottom: 0.3rem; } .lv-built ol { margin: 0.2rem 0 0.4rem 1.2rem; padding: 0; } .lv-built li { margin-bottom: 0.2rem; } .lv-built p { margin: 0; font-weight: 700; color: #065f46; }
.lv-fit { margin-top: 0.8rem; background: #fff; border: 1px solid #86efac; border-radius: 10px; overflow: hidden; }
.lv-fit-h { background: #047857; color: #fff; font-weight: 700; font-size: 0.86rem; padding: 0.35rem 0.8rem; }
.lv-fit-eq { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.35rem; padding: 0.6rem 0.8rem 0.2rem; }
.lv-fit-eq span { background: #f4f6ff; border: 1px solid #d6dcf5; border-radius: 8px; padding: 0.3rem 0.55rem; text-align: center; flex: 1 1 5.5rem; min-width: 0; }
.lv-fit-eq small { display: block; font-size: 0.68rem; color: #55657a; line-height: 1.2; } .lv-fit-eq b { color: #15256d; font-family: 'Fira Code', monospace; font-size: 0.9rem; overflow-wrap: anywhere; }
.lv-fit-eq i { align-self: center; font-style: normal; font-weight: 800; color: #2645c5; }
.lv-fit-eq .lv-fit-res { background: #ecfdf5; border-color: #86efac; } .lv-fit-eq .lv-fit-res b { color: #065f46; }
.lv-fit p { margin: 0; padding: 0.3rem 0.8rem 0.65rem; font-size: 0.86rem; color: #334155; }
@media (max-width: 768px) { .lv-fit-eq i { flex-basis: 100%; text-align: center; line-height: 1; } .lv-fit-eq span { flex-basis: 100%; } }

.lv-smooth { background: #fff; border: 1px dashed #059669; border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.3rem 0 0.6rem !important; font-weight: 400 !important; color: #1b1f3a !important; }
.lv-smooth span { background: #047857; color: #fff; border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.74rem; margin-right: 0.4rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.lv-dotkey { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #f59e0b; border: 1.5px solid #92400e; vertical-align: -0.05rem; }

.lv-calc2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; background: #f3f5ff; border: 1px solid #d6dcf5; border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.5rem 0; }
.lv-calc2 label { font-weight: 700; color: #15256d; } .lv-calc2 .lv-select { min-width: 8rem; }
.lv-calc2-out { flex: 1 1 100%; font-size: 0.88rem; color: #1b1f3a; } .lv-calc2-out b { color: #15256d; }

.lv-calc3 strong { flex: 1 1 100%; color: #15256d; } .lv-calc3 input.lv-select { width: 6rem; min-width: 0; }


.lv-upbtns .lv-btn b { color: #0e7490; margin-left: 0.1rem; } .lv-upbtns .lv-btn[disabled] b { color: inherit; }
.lv-upbtns .lv-orb-s, .lv-upinfo-o { margin-right: 0.15rem; }
.lv-costnote { display: inline-block; margin-left: 0.3rem; font-size: 0.72rem; font-weight: 700; color: #0e7490; background: #ecfeff; border: 1px solid #67e8f9; border-radius: 999px; padding: 0 0.5rem; }
.lv-auto b { color: #0e7490; }
.lv-confirm .lv-orb-s { vertical-align: -0.15em; }
#lv-upinfo { display: block; }
.lv-upbtns .lv-btn .lv-orb-s { margin-left: 0.25rem; }

.lv-why-sec .lv-intro { text-align: center; max-width: 52rem; margin-left: auto; margin-right: auto; }
.lv-journey { list-style: none; margin: 1rem 0 0.8rem; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; counter-reset: none; }
.lv-journey li { position: relative; background: #f3f5ff; border: 1px solid #d6dcf5; border-top: 4px solid #2645c5; border-radius: 10px; padding: 0.8rem 0.8rem 0.7rem; }
.lv-journey li:last-child { border-top-color: #059669; background: #ecfdf5; border-color: #a7f3d0; }
.lv-journey li:not(:last-child)::after { content: "\2192"; position: absolute; right: -0.75rem; top: 50%; transform: translateY(-50%); z-index: 1; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #2645c5; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; box-shadow: 0 0 0 3px #fff; }
.lv-jn { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #15256d; color: #fff; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; margin-bottom: 0.4rem; }
.lv-journey li:last-child .lv-jn { background: #047857; }
.lv-journey strong { display: block; color: #15256d; margin-bottom: 0.25rem; }
.lv-journey p { margin: 0; font-size: 0.88rem; line-height: 1.5; }
.lv-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.lv-skills span { background: #15256d; color: #fff; border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.8rem; font-weight: 700; }
@media (max-width: 900px) { .lv-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lv-journey li:nth-child(2)::after { display: none; } }
@media (max-width: 768px) { .lv-journey { grid-template-columns: 1fr; } .lv-journey li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -0.85rem; transform: translateX(-50%) rotate(90deg); display: flex !important; } .lv-journey li:nth-child(2)::after { display: flex; } }

/* ---- polish pass ---- */
.lv-gear { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.lv-upbtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: 0.4rem; margin-top: 0.4rem; }
.lv-upbtns .lv-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem; padding: 0.3rem 0.3rem; line-height: 1.15; min-height: 2.9rem; height: auto; max-width: 100%; text-align: center; }
.lv-ul { font-size: 0.82rem; } .lv-uc { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.15rem; font-size: 0.78rem; overflow-wrap: anywhere; }
.lv-upbtns .lv-btn .lv-orb-s { margin: 0; }
.lv-fold { margin-top: 1rem; border: 1px solid #d6dcf5; border-radius: 10px; background: #fff; padding: 0 0.8rem; }
.lv-fold > summary { cursor: pointer; font-family: 'Poppins', sans-serif; font-weight: 700; color: #15256d; padding: 0.7rem 0; min-height: 2.6rem; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.lv-fold > summary::-webkit-details-marker { display: none; }
.lv-fold > summary::after { content: "+"; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #0056b3; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.lv-fold[open] > summary::after { content: "\2212"; }
.lv-fold[open] { padding-bottom: 0.6rem; }
@media (max-width: 768px) {
  .lv-stack, .lv-journey { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.8rem; padding: 1rem 0.2rem 0.5rem; margin-left: -0.2rem; margin-right: -0.2rem; -webkit-overflow-scrolling: touch; }
  .lv-stack > .lv-mc, .lv-journey > li { flex: 0 0 82%; scroll-snap-align: center; }
  .lv-journey li:not(:last-child)::after { display: none !important; }
  .lv-fit-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; } .lv-fit-eq i { display: none; } .lv-fit-eq span { flex-basis: auto; } .lv-fit-eq .lv-fit-res { grid-column: 1 / -1; }
  .lv-section h2 { font-size: 1.35rem; } .lv-intro { font-size: 0.92rem; }
  .lv-built { padding: 0.55rem 0.75rem; font-size: 0.88rem; }
  .lv-pane-sub { display: none; }
  .lv-gear { grid-template-columns: 1fr; }
}

/* ---- mobile: cost-band cards size to their own content ---- */
@media (max-width: 768px) { .lv-bands { align-items: flex-start; } }
.lv-ms[hidden] { display: none; }
.lv-chart .lv-ms-label { fill: #065f46; font-weight: 700; }
