* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 10px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #232D4B;
    flex: 1;
    min-width: 200px;
}

.back-link {
    color: #E57200;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 12px;
    border: 1px solid #E57200;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #E57200;
    color: white;
}

.intro {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1rem;
    color: #555;
    padding: 0 10px;
}

.navigation {
    margin-top: 20px;
}

.exercise-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.exercise-link {
    display: block;
    padding: 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    min-height: 80px;
}

.exercise-link:hover {
    background-color: #E57200;
    color: white;
    border-color: #E57200;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.exercise-link h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: inherit;
}

.exercise-link p {
    font-size: 0.95rem;
    color: inherit;
    opacity: 0.9;
}

.exercise-container {
    width: 100%;
}

.info-box,
.teaching-box,
.warning-box {
    padding: 14px 16px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.info-box {
    background-color: #e3f2fd;
    border-left: 4px solid #2196F3;
}

.teaching-box {
    background-color: #f8f9fa;
    border-left: 4px solid #232D4B;
}

.warning-box {
    background-color: #fff3e0;
    border-left: 4px solid #E57200;
}

.info-box p,
.teaching-box p,
.warning-box p {
    margin: 0 0 8px;
}

.info-box p:last-child,
.teaching-box p:last-child,
.warning-box p:last-child {
    margin-bottom: 0;
}

.vignette-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
}

.vignette-card h2,
.section-heading {
    color: #232D4B;
    margin-bottom: 10px;
}

.section-heading {
    margin-top: 10px;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 120px;
    flex: 1;
    max-width: 220px;
}

.btn-primary {
    background-color: #E57200;
    color: white;
}

.btn-primary:hover {
    background-color: #d16500;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-blue {
    background-color: #2196F3;
    color: white;
}

.btn-blue:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none;
}

.result-callout {
    border: 2px solid #E57200;
    border-radius: 8px;
    padding: 16px;
    margin: 15px 0;
    background: #fff8f0;
}

.result-callout h2 {
    color: #232D4B;
    margin-bottom: 8px;
}

.feedback-correct {
    background-color: #e8f5e9;
    border-left: 4px solid #66bb6a;
    color: #2e7d32;
}

.feedback-incorrect {
    background-color: #fce4ec;
    border-left: 4px solid #ef5350;
    color: #c62828;
}

.quiz-error {
    color: #c62828;
    text-align: center;
    font-weight: 500;
    margin-top: 10px;
}

/* ---- Module landing ---- */
.attribution {
    width: 100%;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

.qr-card {
    max-width: 320px;
    margin: 0 auto 26px;
    padding: 20px 20px 16px;
    text-align: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.qr-title { font-size: 1.15rem; color: #232D4B; margin-bottom: 14px; }
.qr-img { width: 230px; height: 230px; max-width: 100%; display: block; margin: 0 auto; }
.qr-caption { font-size: 0.92rem; color: #555; margin-top: 12px; }
.qr-url { font-size: 0.8rem; color: #888; margin-top: 2px; }
.nowrap { white-space: nowrap; }

.page-list { list-style: none; max-width: 640px; margin: 0 auto 22px; }

.page-list-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid #eee;
}

.page-list-item:last-child { border-bottom: none; }

.page-list-num {
    font-weight: 700;
    color: #E57200;
    min-width: 22px;
}

.page-list-text { font-size: 0.95rem; color: #444; text-decoration: none; }
.page-list-text:hover { color: #E57200; }
.page-list-text strong { color: #232D4B; }

a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ---- Step indicator ---- */
.step-indicator {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.step-dot {
    width: 30px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
}

.step-dot.active { background: #E57200; }
.step-dot.done { background: #232D4B; }

/* ---- Section colors ---- */
.sec-background { --sec: #1E88E5; --sec-soft: #e3f2fd; }
.sec-methods    { --sec: #232D4B; --sec-soft: #e8eaf1; }
.sec-results    { --sec: #E57200; --sec-soft: #fff3e0; }
.sec-conclusion { --sec: #2e7d32; --sec-soft: #e8f5e9; }

/* ---- Element highlights (one color per job a sentence does) ---- */
.hl-1 { --hl: #fff1b8; --hl-ink: #7a5d00; }
.hl-2 { --hl: #d6eaff; --hl-ink: #0d47a1; }
.hl-3 { --hl: #e6dcff; --hl-ink: #4527a0; }
.hl-4 { --hl: #d9f2dc; --hl-ink: #1b5e20; }
.hl-5 { --hl: #ffdcd2; --hl-ink: #a03a16; }

.chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--hl);
    color: var(--hl-ink);
    font-weight: 600;
    font-size: 0.9rem;
}

.lead {
    font-size: 1.02rem;
    margin-bottom: 16px;
}

.section-title {
    color: #232D4B;
    font-size: 1.15rem;
    margin: 22px 0 10px;
}

/* ---- Page 1: blurred abstracts ---- */
.abstract-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px 0;
}

.abstract-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.abstract-card.picked {
    border-color: #E57200;
    box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.15);
}

.abstract-card.checked.is-good {
    border-color: #66bb6a;
    box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.18);
}

.abstract-card.checked.is-poor {
    border-color: #e0e0e0;
    box-shadow: none;
}

.abstract-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.abstract-card-head h3 {
    color: #232D4B;
    font-size: 1.1rem;
}

.pick-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f8f9fa;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
}

.pick-toggle:hover:not(:disabled) { border-color: #E57200; }
.pick-toggle:disabled { cursor: default; }

.pick-box {
    width: 18px;
    height: 18px;
    border: 2px solid #999;
    border-radius: 4px;
    background: white;
    position: relative;
    flex: none;
}

.pick-toggle[aria-pressed="true"] {
    background: #fff3e0;
    border-color: #E57200;
    color: #b35900;
}

.pick-toggle[aria-pressed="true"] .pick-box {
    background: #E57200;
    border-color: #E57200;
}

.pick-toggle[aria-pressed="true"] .pick-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fuzz {
    filter: blur(2.5px);
    color: #444;
    font-size: 0.66rem;
    line-height: 1.4;
    user-select: none;
    -webkit-user-select: none;
}

.fuzz-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #232D4B;
    margin-bottom: 10px;
}

.fuzz-section {
    border-left: 4px solid var(--sec);
    padding: 2px 0 2px 10px;
    margin-bottom: 8px;
}

.fuzz-heading {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sec);
    margin-bottom: 1px;
}

.card-reveal {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
}

.verdict { margin-bottom: 8px; }
.verdict-right { color: #2e7d32; }
.verdict-wrong { color: #c62828; }

.share-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.share-seg {
    flex-basis: 0;
    background: var(--sec);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
}

.card-explanation {
    font-size: 0.93rem;
    color: #444;
}

.shape-diagram {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    margin: 12px 0 4px;
    max-width: 520px;
}

.shape-diagram .shape-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--sec);
}

.shape-diagram .shape-bar {
    height: 14px;
    border-radius: 3px;
    background: var(--sec);
}

/* ---- Pages 2 to 5: abstract map ---- */
.abstract-map {
    margin-bottom: 18px;
}

.map-caption {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.map-bar {
    display: flex;
    gap: 3px;
    height: 16px;
}

.map-seg {
    flex-basis: 0;
    background: var(--sec);
    opacity: 0.25;
    border-radius: 3px;
    transition: opacity 0.15s;
}

.map-seg:hover { opacity: 0.5; }
.map-seg.current { opacity: 1; }

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 6px;
    font-size: 0.85rem;
}

.map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #777;
    text-decoration: none;
}

.map-legend-item.current {
    color: var(--sec);
    font-weight: 700;
}

.map-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--sec);
}

/* ---- Pages 2 to 5: rules and annotated example ---- */
.rule-list {
    margin: 6px 0 0 1.3em;
}

.rule-list li { margin-bottom: 4px; }

.element-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    counter-reset: el;
}

.element-list li { counter-increment: el; }

.element-list li::before {
    content: counter(el) ".";
    display: inline-block;
    width: 1.5em;
    color: #666;
    font-weight: 600;
}

.absent-note {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.example-card {
    border: 1px solid #ddd;
    border-left: 5px solid var(--sec);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fff;
}

.example-card h3 {
    color: var(--sec);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.example-card.context {
    background: #fafafa;
}

.example-text { line-height: 1.7; }

.sentence-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sentence {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #333;
    padding: 10px 12px;
    border: 1px dashed #c5cfdf;
    border-radius: 6px;
    background: #f7f9fc;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.sentence:hover:not(.revealed) {
    border-color: #E57200;
    background: #fff8f0;
}

.sentence.revealed {
    background: var(--hl);
    border: 1px solid transparent;
    cursor: default;
}

.sentence-num {
    display: inline-block;
    min-width: 1.5em;
    font-weight: 700;
    color: #888;
}

.sentence-tag {
    display: none;
    width: fit-content;
    margin-bottom: 4px;
    padding: 1px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--hl-ink);
    font-size: 0.8rem;
    font-weight: 700;
}

.sentence.revealed .sentence-tag { display: block; }
.sentence.revealed .sentence-num { color: var(--hl-ink); }

.context-sentence {
    color: #888;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 3px;
}

.context-sentence.linked {
    color: #222;
    background: var(--hl);
    padding: 1px 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.section-stats {
    font-size: 0.88rem;
    color: #666;
    margin: -4px 0 14px;
}

.reveal-row {
    margin: 0 0 18px;
}

.reveal-row .btn { max-width: 260px; }

.btn:disabled,
.btn:disabled:hover {
    opacity: 0.55;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.pitfalls ul {
    margin: 4px 0 0 1.2em;
}

/* ---- Page 6: build the abstract ---- */
.deal-card {
    border: 2px solid #232D4B;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.deal-card.dealt { animation: deal-in 0.3s ease-out; }

@keyframes deal-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.build-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: #E57200;
    margin-bottom: 6px;
}

.current-sentence {
    font-size: 1.05rem;
    line-height: 1.6;
}

.choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.choice-btn {
    max-width: none;
    min-width: 0;
    background: white;
    color: var(--sec);
    border: 2px solid var(--sec);
    font-weight: 700;
}

.choice-btn:hover:not(:disabled) {
    background: var(--sec);
    color: white;
}

.choice-btn.wrong { animation: shake 0.35s; }

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

.build-feedback {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.build-score {
    font-size: 0.85rem;
    color: #666;
    text-align: right;
    min-height: 1.3em;
    margin-bottom: 8px;
}

.built-abstract {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fcfcfc;
}

.built-abstract-title {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 10px;
}

.built-section {
    border-left: 4px solid var(--sec);
    padding: 2px 0 2px 10px;
    margin-bottom: 12px;
}

.built-section:last-child { margin-bottom: 0; }

.built-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sec);
    margin-bottom: 2px;
}

.built-body {
    font-size: 0.93rem;
    line-height: 1.6;
    min-height: 1.6em;
}

.built-body:empty::before {
    content: "\2026";
    color: #bbb;
}

.placed {
    transition: background-color 1.4s;
    border-radius: 3px;
}

.placed.just-placed { background: var(--sec-soft); }

/* ---- Wider screens ---- */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .container {
        max-width: 900px;
        padding: 30px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .abstract-grid {
        grid-template-columns: 1fr 1fr;
    }

    .choice-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media print {
    body {
        background-color: white;
    }

    .buttons {
        display: none;
    }
}
