   /* 7. luokka — teema D: pehmeä violetti/pinkki */

      .nav-logo {
        font-family: 'Playfair Display', serif;
        font-size: 22px;
        font-weight: 600;
        color: #ffffff;
        letter-spacing: -0.5px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 3px;
      }
      .nav-logo span {
        color: #f0c040;
        font-style: italic;
      }

      .book-spread {
        background: rgba(255, 255, 255, 0.75);
        border: 1px solid #e9d5ff;
        box-shadow: 0 8px 32px rgba(124, 58, 237, 0.08);
      }

      .book-page-left {
        background: #faf5ff;
        border-right: 1px solid #e9d5ff;
      }

      .book-page-left h3 {
        color: #3b0764;
        font-size: 0.85rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 16px;
      }

      .aihelista a {
        color: #3b0764;
        font-weight: 500;
        border-left: 3px solid transparent;
        background: transparent;
      }
      .aihelista a:hover {
        color: #6d28d9;
        background: #ede9fe;
      }
      .aihelista a.active {
        color: #4c1d95;
        background: #ede9fe;
        border-left: 3px solid #7c3aed;
        font-weight: 700;
        box-shadow: none;
      }
      .sub-link {
        color: #7c3aed;
        font-weight: 400;
        opacity: 0.85;
      }
      .sub-link:hover {
        opacity: 1;
        color: #6d28d9;
      }

      .aihe-osio {
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid #e9d5ff;
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.06);
      }
      .aihe-otsikko {
        border-bottom: 2px solid #a855f7;
      }
      .aihe-otsikko h2 {
        color: #4c1d95;
      }
      .aihe-otsikko p {
        color: #6b21a8;
      }

      .theory-card {
        background: #faf5ff;
        border: 1px solid #e9d5ff;
        border-radius: 14px;
      }
      .theory-text h3 {
        color: #4c1d95;
      }

      .tasks-section {
        background: #fdf2f8;
        border: 1px solid #f9a8d4;
        border-radius: 14px;
      }
      .task-card:hover {
        border-color: #d8b4fe;
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
      }

      .mission-card {
        background: linear-gradient(135deg, #faf5ff, #fdf4ff);
        border: 2px solid #c4b5fd;
        box-shadow: 0 6px 20px rgba(124, 58, 237, 0.12);
      }
      .mission-card::before {
        display: none;
      }
      .mission-header h4 {
        color: #3b0764;
      }
      .mission-badge {
        background: #ede9fe;
        color: #4c1d95;
      }
      .mission-card p {
        color: #475569;
      }
      .mission-list li {
        color: #1e1b4b;
      }
      .mission-card:hover {
        box-shadow: 0 10px 28px rgba(124, 58, 237, 0.18);
      }

      .interactive-hero.hero-7lk {
        background: linear-gradient(135deg, #7c3aed, #a855f7);
        box-shadow: 0 8px 28px rgba(124, 58, 237, 0.25);
        border: none;
      }

      .breadcrumb a {
        color: #7c3aed;
      }
      .breadcrumb a:hover {
        color: #4c1d95;
      }

      .header-search input {
        background: rgba(255, 255, 255, 0.9);
        border-color: #ddd6fe;
        color: #1e1b4b;
      }
      .header-search input:focus {
        border-color: #a78bfa;
        outline: 2px solid #ddd6fe;
      }
      #searchResults {
        background: #ffffff;
        border-color: #e9d5ff;
      }
      .result-item {
        border-color: #e9d5ff;
      }
      .result-item:hover {
        background: #faf5ff;
      }

      #scrollTopBtn {
        background: #7c3aed;
      }
      #scrollTopBtn:hover {
        background: #6d28d9;
      }

      .peli-sulje-rivi {
        display: flex;
        justify-content: flex-end;
        margin-top: 20px;
        margin-bottom: 8px;
      }
      .peli-sulje-btn {
        background: #7c3aed;
        color: white;
        border: none;
        padding: 8px 18px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: background 0.2s;
      }
      .peli-sulje-btn:hover {
        background: #6d28d9;
      }

      /* Selviytymiskeino-numero-pilli */
      .selviytymis-numero {
        display: inline-block;
        background: #7c3aed;
        color: white;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        padding: 3px 12px;
        border-radius: 999px;
        margin-bottom: 8px;
      }

      .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }
      .sr-only-focusable:focus {
        position: static;
        width: auto;
        height: auto;
        clip: auto;
        white-space: normal;
        background: #7c3aed;
        color: white;
        padding: 8px 16px;
        border-radius: 6px;
        font-weight: 700;
      }
    
    /* ── Haaste ylöspäin eriyttäminen ── */
    .haaste-osio {
      margin-top: 12px;
      margin-bottom: 8px;
    }
    .haaste-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: linear-gradient(135deg, #5b21b6, #7c3aed);
      color: #fff;
      border: 2px solid #6d28d9;
      border-radius: 12px;
      padding: 11px 20px;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      transition: opacity 0.15s, transform 0.15s;
      text-align: left;
    }
    .haaste-toggle:hover {
      opacity: 0.92;
      transform: translateY(-1px);
      background: linear-gradient(135deg, #6d28d9, #a855f7);
    }
    .haaste-toggle-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .haaste-pollo-kuva {
      width: 40px;
      height: 40px;
      object-fit: contain;
      flex-shrink: 0;
    }
    .haaste-nuoli {
      font-size: 0.85rem;
      transition: transform 0.3s;
      flex-shrink: 0;
      color: #fff;
    }
    .haaste-toggle[aria-expanded="true"] .haaste-nuoli {
      transform: rotate(180deg);
    }
    .haaste-sisalto {
      background: linear-gradient(160deg, #faf5ff 0%, #f3e8ff 100%);
      border: 1.5px solid #c4b5fd;
      border-top: none;
      border-radius: 0 0 12px 12px;
      padding: 18px 20px 16px;
      margin-top: -4px;
      color: #1e1b4b;
    }
    .haaste-ohje {
      color: #3b0764;
      font-size: 0.92rem;
      line-height: 1.65;
      margin: 0 0 10px;
    }
    .haaste-ohje strong {
      color: #6d28d9;
    }
    .haaste-vihje {
      color: #4c1d95;
      font-size: 0.83rem;
      font-style: italic;
      margin: 0;
      padding: 8px 12px;
      background: rgba(167, 139, 250, 0.18);
      border-left: 3px solid #7c3aed;
      border-radius: 0 6px 6px 0;
    }

    /* ── tasks-section: poistetaan ulompi boksiefekti ── */
    .tasks-section {
      background: none !important;
      border: none !important;
      box-shadow: none !important;
      padding: 0 !important;
      border-radius: 0 !important;
      margin-bottom: 12px !important;
    }

    /* ── Tehtäväkortit: yhtenäinen leveys ── */
    .keskustelu-kortti,
    .vihko-kortti {
      box-sizing: border-box !important;
      width: 100% !important;
      margin-bottom: 12px !important;
    }

    /* ── mission-card: väli ja padding säilyy ── */
    .mission-card {
      margin-bottom: 12px !important;
    }

    /* ── Opettajan materiaali -toggle ── */
    .opettaja-osio {
      margin-top: 10px;
      margin-bottom: 8px;
    }
    .opettaja-toggle {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 11px 18px;
      background: #f1f5f9;
      border: 1.5px solid #cbd5e1;
      border-radius: 10px;
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 600;
      color: #475569;
      text-align: left;
      transition: background 0.18s, border-color 0.18s;
    }
    .opettaja-toggle:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
    }
    .opettaja-toggle-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .opettaja-nuoli {
      font-size: 0.8rem;
      transition: transform 0.22s;
      color: #94a3b8;
    }
    .opettaja-toggle[aria-expanded="true"] .opettaja-nuoli {
      transform: rotate(180deg);
    }
    .opettaja-sisalto {
      background: #f8fafc;
      border: 1.5px solid #cbd5e1;
      border-top: none;
      border-radius: 0 0 10px 10px;
      padding: 16px 20px;
    }
    .opettaja-lataus {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 18px;
      background: #7c3aed;
      color: #fff;
      border-radius: 8px;
      text-decoration: none;
      font-size: 0.88rem;
      font-weight: 600;
      margin-bottom: 10px;
      transition: background 0.18s;
    }
    .opettaja-lataus:hover {
      background: #6d28d9;
    }
    .opettaja-kuvaus {
      font-size: 0.82rem;
      color: #64748b;
      margin: 0;
      line-height: 1.5;
    }
    /* Tehtäväkortit: alle 640px pinoutuvat pystyyn */
    @media (max-width: 640px) {
      #oppimaan-oppiminen-osiot > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
      }
    }

    /* ── Kuvakorjaukset mobiilille ── */

    /* Theory-kortit: kuvat skaalaantuvat säilyttäen suhteen */
    .theory-image img {
      max-width: 100%;
      height: auto;
      display: block;
      border-radius: 10px;
    }

    /* Keino-kuvat otsikossa: pienempi mobiilissa, sallitaan kutistuminen */
    .aihe-otsikko img {
      flex-shrink: 1 !important;
      max-width: 120px;
    }

    @media (max-width: 480px) {
      /* Keino-kuva kutistuu entisestään kapeilla näytöillä */
      .aihe-otsikko img {
        width: 72px !important;
        max-width: 72px;
      }
      /* Theory-kortin asettelu pinoutuu pystyyn */
      .theory-card {
        flex-direction: column !important;
      }
      .theory-image {
        width: 100% !important;
        max-width: 100% !important;
      }
      .theory-image img {
        width: 100%;
        max-height: 220px;
        object-fit: cover;
      }
    }