:root {
    --green: #0b361f;
    --mint: #ecffea;
    --button: #cef2c9;
    --line: #d9e7d7;
    --ink: #1d2a20;
    --muted: #617064;
    --paper: #fff;
    --red: #a52c2c;
    --red-bg: #fff0ee;
    --green-bg: #edf9ed;
    --gold: #8a5a00
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: #f7faf6;
    color: var(--ink);
    font-family: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", sans-serif;
    line-height: 1.55
}

.topnav {
    height: 76px;
    background: var(--mint);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 5vw, 64px);
    border-bottom: 1px solid #dcebd9
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    color: var(--green);
    font-weight: 750;
    text-decoration: none
}

.brand-mark {
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    font-size: 21px
}

.back-link {
    color: var(--green);
    text-decoration: none;
    font-weight: 600
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 64px
}

.hero {
    padding: 52px 0 35px
}

.eyebrow {
    font-size: 12px;
    letter-spacing: .14em;
    font-weight: 800;
    color: #4b7952;
    margin: 0 0 10px
}

.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    letter-spacing: -.04em;
    line-height: 1.08;
    color: var(--green);
    margin: 0;
    max-width: 800px
}

.hero-copy {
    font-size: 18px;
    color: #4f5f52;
    max-width: 740px;
    margin: 18px 0
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.hero-tags span {
    font-size: 12px;
    background: #eaf4e8;
    border: 1px solid #d9e8d5;
    border-radius: 30px;
    padding: 6px 11px;
    color: #3c6242
}

.lesson-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    align-items: start
}

.progress-panel, .lesson-card, .finish-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 28px #18391b0a
}

.progress-panel {
    padding: 20px;
    position: sticky;
    top: 16px
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px
}

.progress-head span {
    color: var(--muted);
    font-size: 12px
}

.progress-track {
    height: 7px;
    background: #e9efe7;
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0 20px
}

.progress-track div {
    height: 100%;
    width: 10%;
    background: #5c985f;
    transition: width .2s
}

.section-map {
    display: grid;
    gap: 7px
}

.map-item {
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: #536256;
    font: inherit;
    font-size: 13px;
    cursor: pointer
}

.map-item .map-number {
    display: grid;
    place-items: center;
    flex: 0 0 27px;
    height: 27px;
    border-radius: 50%;
    background: #eef3ec;
    color: #48654a;
    font-weight: 700
}

.map-item.active {
    background: #f0f8ee;
    border-color: #d4e7d0;
    color: var(--green);
    font-weight: 700
}

.map-item.active .map-number,
.map-item.done .map-number {
    background: var(--green);
    color: #fff
}

.text-button {
    border: 0;
    background: none;
    color: #68786b;
    text-decoration: underline;
    font: inherit;
    font-size: 12px;
    margin-top: 20px;
    padding: 0;
    cursor: pointer
}

.lesson-card {
    padding: clamp(20px, 4vw, 38px);
    min-height: 420px;
    display: flex;
    flex-direction: column
}

.slide-meta {
    display: flex;
    justify-content: space-between;
    color: #68806b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em
}

.slide-content {
    flex: 1;
    padding: 25px 0 30px
}

.slide-content h2 {
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.15;
    color: var(--green);
    margin: 0 0 14px;
    letter-spacing: -.025em
}

.slide-content p {
    font-size: 16px;
    max-width: 760px
}

.slide-content .lead {
    font-size: 19px;
    color: #4f6252
}

.slide-content ul {
    padding-left: 22px
}

.slide-content li {
    margin: 8px 0
}

.callout {
    background: #f0f8ee;
    border-left: 4px solid #6a9a66;
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    margin: 20px 0
}

.callout.warning {
    background: #fff8e8;
    border-color: #d6a33d
}

.interactive-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0
}

.demo-button,
.button {
    border: 1px solid var(--green);
    background: var(--button);
    color: var(--green);
    border-radius: 10px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, background .12s
}

.button:hover,
.demo-button:hover {
    transform: translateY(-1px);
    background: #b9e8b2
}

.button:focus-visible,
.demo-button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #78a97b;
    outline-offset: 2px
}

.button-secondary {
    background: #fff;
    border-color: #cbdaca
}

.button-secondary:hover {
    background: #f3f7f2
}

.button-warning {
    background: #fff0d7;
    border-color: #e3bf7c;
    color: #714b00
}

.slide-controls {
    border-top: 1px solid #e7eee5;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.slide-dots {
    display: flex;
    gap: 6px;
    justify-content: center
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: #d5e2d3;
    padding: 0
}

.slide-dot.active {
    background: var(--green);
    width: 21px;
    border-radius: 8px
}

.activity-section {
    margin-top: 60px
}

.section-intro {
    max-width: 780px;
    margin-bottom: 22px
}

.section-intro h2,
.finish-card h2 {
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    color: var(--green);
    margin: 0 0 12px;
    letter-spacing: -.03em
}

.section-intro p:not(.eyebrow) {
    color: #58675a;
    font-size: 16px
}

























.hash-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    color: #6a7d6b
}

.hash-output {
    font-size: 44px;
    line-height: 1.2;
    color: var(--green);
    font-weight: 800;
    overflow-wrap: anywhere
}

.feedback {
    font-size: 13px;
    color: #58675a;
    min-height: 42px
}

.feedback.good {
    color: #246b2d;
    font-weight: 700
}

.feedback.bad {
    color: var(--red);
    font-weight: 700
}



.fine-print {
    font-size: 12px;
    color: #718073;
    max-width: 900px;
    margin-top: 14px
}

.chain-section {
    padding-top: 5px
}

.chain-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0
}

.chain-status {
    padding: 12px 15px;
    border-radius: 10px;
    background: #edf5eb;
    color: #365c3b;
    font-size: 14px;
    margin-bottom: 16px
}

.chain-status.problem {
    background: var(--red-bg);
    color: var(--red)
}

.blockchain {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px
}

.block-card {
    border: 1px solid #cfdfcc;
    border-radius: 14px;
    background: white;
    padding: 17px;
    position: relative;
    min-width: 0
}

.block-card.valid {
    border-top: 4px solid #4c9652
}

.block-card.broken {
    border: 2px solid #c74b42;
    background: #fffafa
}

.block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.block-head h3 {
    margin: 0;
    color: var(--green);
    font-size: 17px
}

.status-pill {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-radius: 20px;
    padding: 4px 8px;
    background: var(--green-bg);
    color: #276c30
}

.broken .status-pill {
    background: var(--red-bg);
    color: var(--red)
}

.transaction-label {
    display: block;
    font-size: 11px;
    color: #6b7a6c;
    font-weight: 800;
    margin: 14px 0 5px
}

.transaction-input {
    width: 100%;
    border: 1px solid #d5e0d2;
    border-radius: 8px;
    padding: 9px;
    font: inherit;
    font-size: 13px
}

.hash-row {
    margin-top: 11px
}

.hash-row small {
    display: block;
    color: #6b7a6c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    margin-bottom: 4px
}

.hash-value {
    font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
    background: #f4f7f3;
    border-radius: 7px;
    padding: 8px;
    color: #354a37
}

.broken .hash-value {
    background: #fff0ee;
    color: #922b25
}

.concept-note {
    background: #f0f8ee;
    border-radius: 12px;
    padding: 17px;
    margin-top: 18px;
    font-size: 14px;
    color: #536354
}

.finish-card {
    margin-top: 60px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap
}

.finish-card>div {
    flex: 1;
    min-width: 240px
}

.finish-card h2 {
    font-size: 28px
}

.finish-card p:not(.eyebrow) {
    margin-bottom: 0;
    color: #5d6c5e
}

.finish-message {
    width: 100%;
    margin: 0;
    color: #276c30;
    font-weight: 700
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: #e5f0e3;
    padding: 24px clamp(18px, 5vw, 64px);
    color: #58745b;
    font-size: 12px
}

@media(max-width:820px) {
    .lesson-layout {
        grid-template-columns: 1fr
    }

    .progress-panel {
        position: static
    }

    .section-map {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    

    

    .blockchain {
        grid-template-columns: 1fr
    }

    .lesson-card {
        min-height: 380px
    }
}

@media(max-width:480px) {
    .topnav {
        height: 66px;
        padding: 0 16px
    }

    .brand {
        font-size: 13px
    }

    .back-link {
        font-size: 12px
    }

    .page-shell {
        width: calc(100% - 22px)
    }

    .hero {
        padding-top: 35px
    }

    .section-map {
        grid-template-columns: 1fr
    }

    .slide-controls {
        flex-wrap: wrap
    }

    .slide-dots {
        order: 3;
        width: 100%
    }

    

    

    

    .finish-card {
        padding: 18px
    }
}


/* Transaction-based mining puzzle */
.mining-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 28px #18391b0a;
    overflow: hidden;
}

.mining-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.65fr);
    gap: 24px;
    padding: 0px clamp(18px, 4vw, 30px) 0px;
    background: #edf5eb;
}

.mining-label,
.stat-box span,
.mining-target span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #617064;
    margin: 0 0 8px;
}

.mining-top label {
    font-size: 14px;
    font-weight: 600;
}

.nonce-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.nonce-controls input {
    flex: 1;
    min-width: 120px;
    width: 100%;
    border: 1px solid #cbdac8;
    border-radius: 10px;
    background: white;
    padding: 12px;
    color: var(--ink);
    font: inherit;
}

.mining-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-self: center;
    height: fit-content;
}

.stat-box {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.stat-box strong {
    display: block;
    color: var(--green);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.mining-transactions {
    padding: 22px clamp(18px, 4vw, 30px);
    border-bottom: 1px solid var(--line);
}

.mining-transactions h3,
.mining-result h3 {
    margin: 0;
    color: var(--green);
    font-size: 20px;
}

.mining-help {
    margin: 6px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.mining-transactions ol {
    margin: 0;
    padding-left: 25px;
}

.mining-transactions li {
    padding: 8px 0;
    border-bottom: 1px solid #edf2eb;
}

.mining-transactions li:last-child {
    border-bottom: 0;
}

.mining-result {
    padding: 22px clamp(18px, 4vw, 30px) 28px;
}

.mining-result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.mining-status {
    font-size: 12px;
    font-weight: 800;
    border-radius: 20px;
    background: #edf3eb;
    color: #526354;
    padding: 6px 10px;
}

.mining-status.success {
    background: var(--green-bg);
    color: #246b2d;
}

.mining-status.failure {
    background: var(--red-bg);
    color: var(--red);
}

.mining-hash {
    margin: 14px 0;
    padding: 14px;
    border-radius: 10px;
    background: #f3f7f2;
    color: var(--green);
    font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
    min-height: 54px;
}

.mining-target {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.mining-target span {
    margin: 0;
}

.mining-target code {
    background: #eaf4e8;
    border-radius: 6px;
    padding: 5px 9px;
    color: var(--green);
    font-weight: 800;
}

.mining-result .feedback {
    margin: 14px 0;
}

@media (max-width: 650px) {
    .mining-top {
        grid-template-columns: 1fr;
    }

    .mining-stats {
        grid-template-columns: 1fr 1fr;
    }

    .nonce-controls .button {
        width: 100%;
    }
}

/* Hide the mining puzzle until the lesson reaches it */
#miningLab.mining-locked {
    display: none;
}


/* =========================================
   BUILD, BREAK & REPAIR BLOCKCHAIN
   ========================================= */

.cb-activity {
  padding: 20px clamp(18px, 4vw, 30px);
  max-width: 1200px;
  margin: 0 auto;
}

.cb-activity [hidden] {
  display: none !important;
}

.cb-heading {
  text-align: center;
  margin-bottom: 22px;
}

.cb-heading h2 {
  margin-bottom: 8px;
}

.cb-heading p {
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.cb-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cb-stage {
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  background: #eaf3ed;
  color: #24633a;
}

.cb-alert {
  background: #f2f5f3;
  border: 1px solid #dce5df;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  line-height: 1.5;
}

.cb-alert.cb-danger {
  background: #fff0f0;
  color: #9f2828;
  border-color: #eab1b1;
}

.cb-alert.cb-success {
  background: #eaf7ec;
  color: #23613a;
  border-color: #b8dfc1;
}

/* Four-block chain */

.cb-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.cb-block {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 2px solid #d9e1dc;
  border-radius: 14px;
  padding: 16px 12px;
  transition:
    border-color 0.3s,
    background-color 0.3s,
    box-shadow 0.3s;
}

.cb-block.cb-valid {
  background: #f1faf3;
  border-color: #65b77c;
}

.cb-block.cb-invalid {
  background: #fff1f1;
  border-color: #df6262;
}

.cb-block.cb-affected {
  background: #fff6f2;
  border-color: #ed9874;
}

.cb-block.cb-locked {
  background: #f4f5f4;
  opacity: 0.6;
}

.cb-block.cb-current {
  box-shadow: 0 0 0 3px rgba(62, 148, 91, 0.18);
}

.cb-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.cb-block-header h3 {
  font-size: 1rem;
  margin: 0;
}

.cb-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 20px;
  background: #e8ece9;
  color: #53645b;
}

.cb-valid .cb-status {
  background: #d9f0df;
  color: #246b3b;
}

.cb-invalid .cb-status {
  background: #ffdada;
  color: #a42c2c;
}

.cb-affected .cb-status {
  background: #ffe1d1;
  color: #9a4b1c;
}

.cb-field {
  margin-bottom: 13px;
}

.cb-field-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #65746b;
  margin-bottom: 5px;
}

.cb-field-value {
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cb-hash {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.cb-old {
  text-decoration: line-through;
  color: #888;
}

.cb-new {
  color: #bb3030;
  font-weight: 700;
}

.cb-mismatch {
  color: #c22b2b;
  font-weight: 700;
}

.cb-block-footer {
  border-top: 1px solid #e3e8e4;
  padding-top: 10px;
  margin-top: 10px;
  font-size: 0.77rem;
  color: #637168;
}

/* Surprise animations */

.cb-flash {
  animation: cb-flash-red 0.8s ease-in-out 2;
}

.cb-shake {
  animation: cb-shake 0.45s ease-in-out;
}

@keyframes cb-flash-red {
  0%, 100% {
    background: #fff1f1;
    box-shadow: 0 0 0 0 rgba(220, 40, 40, 0);
  }

  50% {
    background: #ffd1d1;
    box-shadow: 0 0 0 6px rgba(220, 40, 40, 0.2);
  }
}

@keyframes cb-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Transaction comparison */

.cb-change-details {
  background: #fff5f5;
  border: 1px solid #eab5b5;
  border-radius: 14px;
  padding: 18px;
  margin: 20px 0;
}

.cb-change-details h3 {
  color: #ae2929;
  margin: 0 0 8px;
}

.cb-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cb-comparison > div {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
}

.cb-comparison span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #66736c;
}

.cb-comparison p {
  margin: 8px 0 0;
}

#cb-old-transaction {
  text-decoration: line-through;
}

#cb-new-transaction {
  color: #b72c2c;
  font-weight: 700;
}

/* Mining controls */

.cb-miner {
  max-width: 520px;
  margin: 20px auto;
  padding: 22px;
  border: 1px solid #d8e2da;
  border-radius: 14px;
  background: #f8faf8;
}

.cb-miner h3 {
  margin: 0 0 8px;
}

.cb-miner label {
  display: block;
  font-weight: 700;
  margin: 16px 0 7px;
}

.cb-miner-controls {
  display: flex;
  gap: 10px;
}

.cb-miner-controls input {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  border: 1px solid #becfc2;
  border-radius: 9px;
  font: inherit;
}

.cb-activity button {
  cursor: pointer;
  border: none;
  border-radius: 9px;
  padding: 11px 18px;
  background: #307348;
  color: white;
  font: inherit;
  font-weight: 700;
}

.cb-activity button:hover:not(:disabled) {
  background: #245d39;
}

.cb-activity button:disabled {
  opacity: 0.5;
  cursor: default;
}

#cb-feedback {
  min-height: 22px;
  font-weight: 600;
  margin: 12px 0 6px;
}

#cb-attempts {
  font-size: 0.85rem;
  color: #647269;
  margin: 0;
}

.cb-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

#cb-skip {
  background: #647269;
}

.cb-finish {
  margin-top: 22px;
  padding: 24px;
  text-align: center;
  border-radius: 14px;
  background: #eaf7ee;
  border: 2px solid #65b77c;
}

.cb-finish h3 {
  color: #246b3b;
  margin-top: 0;
}

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

@media (max-width: 520px) {
  .cb-chain, .cb-comparison {
    grid-template-columns: 1fr;
  }

  .cb-miner-controls {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-flash, .cb-shake {
    animation: none;
  }

  .cb-block {
    transition: none;
  }
}


/* =========================================
   UPDATED BLOCK LAYOUT
   ========================================= */

/* Make cards more compact and consistent */
.cb-block {
  min-height: 285px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Future blocks: completely blank */
.cb-block.cb-blank {
  background: transparent;
  border: 2px dashed #d4ded7;
  box-shadow: none;
}

/* Remove faded appearance */
.cb-block.cb-blank,
.cb-block.cb-locked {
  opacity: 1;
}

/* Previous hash input inside the block */
.cb-link-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #bccbc0;
  border-radius: 7px;
  font-family: monospace;
  font-size: 0.85rem;
  background: white;
}

.cb-link-input:focus {
  outline: 2px solid #66ae7d;
  outline-offset: 2px;
}

/* Hash mismatch feedback */
.cb-link-error {
  color: #ba3030;
  font-size: 0.78rem;
  margin-top: 6px;
}

.cb-link-help {
  color: #66766b;
  font-size: 0.76rem;
  margin-top: 6px;
}

/* Connect button */
.cb-connect-button {
  margin-top: 9px;
  width: 100%;
  padding: 9px 12px !important;
  font-size: 0.82rem !important;
}

/* Hash display for easy copying */
.cb-hash-value {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  user-select: text;
  background: #edf3ef;
  border-radius: 7px;
  padding: 9px;
}

/* Keep field order visually clear */
.cb-block .cb-field {
  margin-bottom: 0;
}

.cb-block .cb-field:last-child {
  margin-top: auto;
}

/* Highlight blocks that need linking */
.cb-block.cb-awaiting-link {
  border-color: #c9ab69;
  background: #fffaf0;
}

/* Red mismatch after transaction change */
.cb-recalculated {
  color: #bf3030;
  background: #ffe5e5;
}

/* Make the original transaction visibly crossed out */
.cb-old {
  display: inline-block;
  text-decoration: line-through;
  opacity: 0.65;
}

.cb-new {
  display: inline-block;
  margin-top: 5px;
  color: #b82b2b;
  font-weight: 700;
}

/* Mobile layout */
@media (max-width: 520px) {
  .cb-block {
    min-height: 220px;
  }
}


/* Original hash shown after surprise change */
.cb-original-hash {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
  color: #a0a9a2;
  text-decoration: line-through;
  overflow-wrap: anywhere;
  padding: 9px;
  background: #f4f5f4;
  border-radius: 7px;
}

.cb-original-label {
  display: block;
  color: #929d95;
  font-size: 0.72rem;
  margin-top: 4px;
  margin-bottom: 10px;
}

.cb-new-hash-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #307348;
  margin-top: 4px;
}

.cb-hash-pending {
  color: #ad6868;
  font-style: italic;
}

/* Keep the chain game hidden until Start Game is clicked */
#cb-activity[hidden] {
  display: none !important;
}


/* =========================================
   SECTION 5: WHAT'S INSIDE A BLOCK?
   ========================================= */

.lesson-block-diagram {
  max-width: 650px;
  margin: 24px auto;
  padding: 20px;
  background: #edf5eb;
  border: 2px solid #cddfca;
  border-radius: 16px;
}

.lesson-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  color: #0b361f;
  margin-bottom: 16px;
}

.lesson-block-tag {
  background: #d8eed8;
  color: #27663c;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 20px;
}

.lesson-block-part {
  background: white;
  border: 1px solid #d8e5d6;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.lesson-block-part:last-child {
  margin-bottom: 0;
}

.lesson-block-part-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #173d24;
}

.lesson-part-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dff0dd;
  color: #256d39;
  font-weight: 800;
  flex-shrink: 0;
}

.lesson-block-part p {
  color: #617064;
  font-size: 14px;
  margin: 9px 0 11px;
}

.lesson-example-hash {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  background: #f2f6f1;
  border-radius: 8px;
  padding: 11px;
  overflow-wrap: anywhere;
}

.lesson-valid-hash {
  background: #e4f5e4;
  color: #23723a;
}

.lesson-example-transactions {
  display: grid;
  gap: 7px;
}

.lesson-example-transactions div {
  background: #f6f9f5;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 14px;
}


/* =========================================
   SECTION 6: LESSON SUMMARY
   ========================================= */

.lesson-summary h3 {
  font-size: 20px;
  color: #0b361f;
  margin: 25px 0 15px;
}

.lesson-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0 24px;
}

.lesson-summary-item {
  border: 1px solid #d9e7d7;
  background: #fff;
  border-radius: 12px;
  padding: 17px;
  min-width: 0;
}

.lesson-summary-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: #eaf5e8;
  color: #246a38;
  border-radius: 10px;
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 11px;
}

.lesson-summary-item strong {
  display: block;
  color: #173d24;
  font-size: 15px;
}

.lesson-summary-item p {
  color: #607063;
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.lesson-summary-chain {
  background: #f2f8f0;
  border: 1px solid #d6e8d2;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.lesson-summary-chain h3 {
  margin: 0 0 18px;
}

.lesson-summary-chain p {
  font-size: 14px;
  color: #526655;
  margin: 16px auto 0;
}

.lesson-mini-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.lesson-mini-chain div {
  background: #dff1dd;
  border: 1px solid #91bf95;
  border-radius: 8px;
  color: #24683a;
  padding: 11px 6px;
  font-weight: 700;
  font-size: 12px;
  min-width: 0;
  flex: 1;
}

.lesson-mini-chain span {
  color: #418750;
  font-weight: 800;
  flex-shrink: 0;
}

.lesson-currency-transition {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 28px 0;
}

.lesson-currency-transition > span:not(.lesson-transition-arrow) {
  background: #e9f5e7;
  border: 1px solid #c4dfc0;
  border-radius: 11px;
  padding: 15px 20px;
  color: #1b5930;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lesson-transition-arrow {
  color: #488c55;
  font-size: 26px;
  font-weight: 800;
}

.lesson-final-takeaway {
  margin-top: 25px;
}

.lesson-final-takeaway p {
  margin: 8px 0 0;
  font-size: 14px;
}

.lesson-final-question {
  text-align: center;
  padding: 24px 12px 12px;
}

.lesson-final-question strong {
  display: block;
  color: #0b361f;
  font-size: 19px;
}

.lesson-final-question p {
  margin: 8px auto;
  font-size: 13px;
  color: #718073;
}

.lesson-finish-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.lesson-finish-actions .button {
  flex: 1;
  max-width: 210px;
  text-align: center;
}

.lesson-summary-finish-message {
  color: #28713b;
  font-weight: 700;
  text-align: center;
  font-size: 14px;
  margin: 15px auto 0;
}

.lesson-summary-finish-message:empty {
  display: none;
}

@media (max-width: 520px) {
  .lesson-summary-grid {
    grid-template-columns: 1fr;
  }

  .lesson-block-diagram {
    padding: 12px;
  }

  .lesson-mini-chain {
    gap: 4px;
  }

  .lesson-mini-chain div {
    font-size: 10px;
    padding: 9px 3px;
  }

  .lesson-finish-actions {
    flex-direction: column;
  }

  .lesson-finish-actions .button {
    width: 100%;
    max-width: none;
  }
}

/* Completion now takes place inside Section 6 */
.finish-card {
  display: none;
}


/* =========================================
   STUDENT PERSONALIZATION
   ========================================= */

.crypto-setup {
  max-width: 580px;
  margin: 20px auto;
}

.crypto-setup h2 {
  color: #103c25;
  margin-bottom: 12px;
}

.crypto-setup form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.crypto-setup label,
.crypto-currency-creator label {
  font-weight: 700;
  color: #244332;
  font-size: 14px;
}

.crypto-setup input,
.crypto-currency-creator input {
  box-sizing: border-box;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #c6d9c8;
  border-radius: 10px;
  background: white;
  font: inherit;
  color: #173d24;
}

.crypto-setup input:focus,
.crypto-currency-creator input:focus {
  outline: 2px solid #65af78;
  outline-offset: 2px;
}

.crypto-setup .button {
  margin-top: 12px;
  width: 100%;
}

.crypto-setup-error {
  font-size: 13px;
  font-weight: 600;
  color: #b72c2c;
  margin: 4px 0;
}

.crypto-setup-error:empty {
  display: none;
}

/* Currency creation inside Section 2 */

.crypto-currency-creator {
  background: #edf6ec;
  border: 1px solid #d3e4d2;
  border-radius: 14px;
  padding: 22px;
  margin: 20px 0;
}

.crypto-currency-creator h3 {
  margin: 0 0 8px;
  color: #123e25;
}

.crypto-currency-creator p {
  color: #526956;
}

.crypto-currency-creator label {
  display: block;
  margin: 15px 0 8px;
}

.crypto-currency-controls {
  display: flex;
  gap: 10px;
}

.crypto-currency-controls input {
  min-width: 0;
  flex: 1;
}

.crypto-currency-controls .button {
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .crypto-currency-controls {
    flex-direction: column;
  }

  .crypto-currency-controls .button {
    width: 100%;
  }

  .crypto-setup {
    margin: 10px auto;
  }
}
/* Dynamic lesson-demo feedback */
.demo-mismatch { color: #a52c2c; font-weight: 700; }


/* Remove extra space beneath the ledger completion message */
#ledgerDemo [data-ledger-finished] {
  margin-bottom: 0;
}
