/* ============================================
   RADIOSKOLA.SE - KOMPLETT STILMALL
   Version: 3.0 (Städad & Optimerad)
   ============================================
   
   INNEHÅLL:
   1.  CSS-Variabler (Light & Dark)
   2.  Reset & Bas
   3.  Typografi
   4.  Knappar
   5.  Badges & Taggar
   6.  Innehållsboxar (Info, Tip, Warning, etc.)
   7.  Formulär & Inputs
   8.  Navigation (Header)
   9.  Footer
   10. Layout & Container
   11. Hero Section
   12. Quick Stats
   13. Kapitelkort & Grid
   14. Breadcrumbs
   15. Kapitelinnehåll (Läs-vy)
   16. Formel-boxar
   17. Tabeller
   18. Kapitelnavigation
   19. Quiz & Exam
   20. Resultat
   21. Statistik
   22. Övningar (Exercises)
   23. Böcker-sektion
   24. Bonus-sektion
   25. PMR446-specifika stilar
   26. Specialelement (Kapitelinnehåll)
   27. Responsiv Design
   28. Dark Mode
   29. Print Styles
   
   ============================================ */


/* ===========================================
   1. CSS-VARIABLER
   =========================================== */
:root {
    /* Primära färger */
    --primary-color: #4299e1;
    --primary-dark: #2b6cb0;
    --primary-light: #63b3ed;
    --primary-gradient: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    
    /* Sekundära färger */
    --secondary-color: #718096;
    --accent-color: #9f7aea;
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
    
    /* Status färger */
    --success-color: #48bb78;
    --success-bg: #f0fff4;
    --success-border: #9ae6b4;
    
    --warning-color: #ed8936;
    --warning-bg: #fffaf0;
    --warning-border: #fbd38d;
    
    --danger-color: #f56565;
    --danger-bg: #fff5f5;
    --danger-border: #feb2b2;
    
    --info-color: #4299e1;
    --info-bg: #ebf8ff;
    --info-border: #bee3f8;

    /* Bakgrund & ytor */
    --background: #f7fafc;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --card-bg: #ffffff;
    --bg-light: #f8f9fa;
    
    /* Text */
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --text-inverse: #ffffff;
    --text-color: #2d3748;
    --text-muted: #718096;
    
    /* Ramar & skuggor */
    --border-color: #e2e8f0;
    --border-active: #4299e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    /* Rundning */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Hover */
    --hover-bg: #f8f9fa;
    --marker-bg: #e9ecef;
}


/* ===========================================
   2. RESET & BAS
   =========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Länkar */
a { 
    color: var(--primary-color); 
    text-decoration: none; 
    transition: color 0.2s; 
}

a:hover { 
    text-decoration: underline; 
}

/* Interaktiva element - förhindra textmarkering */
button, .btn, .nav-button, .quiz-option, .option-label, .chapter-card {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

/* Fokus-stilar för tillgänglighet */
a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
select:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Bilder */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Horisontell linje */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Kod */
code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}


/* ===========================================
   3. TYPOGRAFI
   =========================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* Hjälptext */
small,
.hint,
.help-text,
figcaption,
.table-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}


/* ===========================================
   4. KNAPPAR
   =========================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-md); 
    text-decoration: none; 
}

.btn:active { 
    transform: translateY(0); 
}

/* Primär knapp */
.btn-primary { 
    background: var(--primary-gradient); 
    color: var(--text-inverse); 
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* Sekundär knapp */
.btn-secondary { 
    background: transparent; 
    color: var(--primary-color); 
    border: 2px solid var(--primary-color); 
}

.btn-secondary:hover { 
    background: var(--primary-color); 
    color: var(--text-inverse); 
}

/* Övriga knappvarianter */
.btn-success { background: var(--success-color); color: var(--text-inverse); }
.btn-danger { background: var(--danger-color); color: var(--text-inverse); }

/* Knappstorlekar */
.btn-small { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }

/* Länk-knapp */
.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Outline-knapp */
.btn-outline {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
}

/* Kapitel-knapp */
.btn-chapter {
    background: var(--primary-color);
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-chapter:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

/* Intro-knapp */
.btn-intro {
    background: linear-gradient(135deg, #38b2ac, #319795);
    color: var(--text-inverse);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-intro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.4);
    text-decoration: none;
}


/* ===========================================
   5. BADGES & TAGGAR
   =========================================== */
.badge, 
.difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.easy, 
.difficulty.easy { 
    background: var(--success-bg); 
    color: #276749; 
}

.badge.medium, 
.difficulty.medium { 
    background: var(--warning-bg); 
    color: #92400e; 
}

.badge.hard, 
.difficulty.hard { 
    background: var(--danger-bg); 
    color: #c53030; 
}


/* ===========================================
   6. INNEHÅLLSBOXAR
   =========================================== */

/* Bas-stil för alla boxar */
.content-box, 
.info-box, 
.tip-box, 
.warning-box, 
.fun-fact, 
.quote-box {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.content-box h3, 
.content-box h4,
.info-box h4, 
.tip-box h4 { 
    margin-top: 0; 
    margin-bottom: 0.75rem; 
    font-size: 1.05rem; 
}

.content-box p:last-child { 
    margin-bottom: 0; 
}

.content-box ul, 
.info-box ul, 
.tip-box ul { 
    margin: 0.5rem 0 0 1.5rem; 
}

/* Info box - Blå */
.content-box.info, 
.info-box { 
    background: var(--info-bg); 
    border-color: var(--info-border); 
    border-left: 4px solid var(--info-color); 
}

.content-box.info h3, 
.content-box.info h4, 
.info-box h4 { 
    color: var(--primary-dark); 
}

.info-box p, 
.info-box ul { 
    color: #2c5282; 
}

/* Tip box - Grön */
.content-box.tip, 
.tip-box { 
    background: var(--success-bg); 
    border-color: var(--success-border); 
    border-left: 4px solid var(--success-color); 
}

.content-box.tip h3, 
.content-box.tip h4, 
.tip-box h4 { 
    color: #276749; 
}

.tip-box p, 
.tip-box ul { 
    color: #2f855a; 
}

/* Warning box - Orange */
.content-box.warning, 
.warning-box { 
    background: var(--warning-bg); 
    border-color: var(--warning-border); 
    border-left: 4px solid var(--warning-color); 
}

.content-box.warning h3, 
.warning-box h4 { 
    color: #9c4221; 
}

/* Important / Danger box - Röd */
.content-box.important, 
.content-box.danger { 
    background: var(--danger-bg); 
    border-color: var(--danger-border); 
    border-left: 4px solid var(--danger-color); 
}

.content-box.important h3, 
.content-box.important h4 { 
    color: #c53030; 
}

/* Fun fact box */
.content-box.fun-fact, 
.fun-fact { 
    background: #fffaf0; 
    border: 1px solid #fbd38d; 
}

.fun-fact h4 { 
    color: #c05621; 
    margin: 0 0 0.5rem 0; 
}

.fun-fact p { 
    color: #9c4220; 
    margin: 0; 
}

/* Quote box - Lila */
.content-box.quote, 
.quote-box { 
    background: #faf5ff; 
    border-left: 4px solid var(--accent-color); 
    font-style: italic; 
}

.quote-box p { 
    color: #553c9a; 
    font-size: 1.05rem; 
    margin: 0; 
}

.quote-box cite, 
.content-box.quote cite { 
    display: block; 
    margin-top: 0.75rem; 
    font-style: normal; 
    font-size: 0.9rem; 
    font-weight: 600;
    color: #805ad5;
}

/* Intro box - för kapitelintros */
.intro-box {
    background: linear-gradient(135deg, var(--info-bg), #e6fffa);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
}

.intro-box.warning {
    background: linear-gradient(135deg, #fffaf0, #fef3c7);
    border-left-color: var(--warning-color);
}

.intro-box .lead {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
}

/* Example box */
.example-box {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-box h4 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.example {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}

.example:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.solution {
    background: #edf2f7;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
}

/* Key points / Summary box */
.key-points, 
.summary-box {
    background: linear-gradient(135deg, var(--info-bg), #e6fffa);
    border: 2px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.key-points h3, 
.summary-box h3 {
    color: var(--primary-dark);
    margin: 0 0 1rem 0;
}

.key-points ul, 
.summary-box ul {
    margin: 0;
    color: #2c5282;
}


/* ===========================================
   7. FORMULÄR & INPUTS
   =========================================== */
input[type="text"], 
input[type="number"], 
input[type="email"], 
textarea, 
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, 
textarea:focus, 
select:focus { 
    border-color: var(--primary-color); 
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}


/* ===========================================
   8. NAVIGATION (HEADER)
   =========================================== */
.main-nav {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--primary-color); 
    text-decoration: none; 
}

.logo-icon { 
    font-size: 2rem; 
}

/* Nav-länkar */
.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 1.5rem; 
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links a:hover, 
.nav-links a.active { 
    color: var(--primary-color); 
    background: var(--info-bg); 
}

/* Mobilmeny-knapp */
.mobile-menu-btn { 
    display: none; 
    background: none; 
    border: none; 
    flex-direction: column; 
    gap: 5px; 
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span { 
    display: block;
    width: 25px; 
    height: 3px; 
    background: var(--text-primary); 
    border-radius: 2px;
    transition: all 0.3s;
}


/* ===========================================
   9. FOOTER
   =========================================== */
.main-footer, 
footer {
    background: #1a202c;
    color: var(--text-inverse);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.main-footer p, 
footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.main-footer a,
footer a {
    color: var(--primary-light);
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.6;
}


/* ===========================================
   10. LAYOUT & CONTAINER
   =========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 700px;
}


/* ===========================================
   11. HERO SECTION
   =========================================== */
.hero {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 2rem;
}

.hero h1 { 
    font-size: 2.5rem; 
    margin-bottom: 1rem; 
    color: var(--text-inverse); 
}

.hero p { 
    font-size: 1.25rem; 
    opacity: 0.9; 
    margin-bottom: 2rem; 
    max-width: 700px; 
    margin-left: auto; 
    margin-right: auto; 
}

.hero-buttons { 
    display: flex; 
    gap: 1rem; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.hero .btn-primary { 
    background: var(--surface); 
    color: var(--primary-color); 
}

.hero .btn-primary:hover {
    background: var(--background);
}

.hero .btn-secondary { 
    border-color: var(--text-inverse); 
    color: var(--text-inverse); 
}

.hero .btn-secondary:hover {
    background: var(--text-inverse);
    color: var(--primary-color);
}

/* Hero för intro-sidor */
.hero-intro {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #2b6cb0 100%);
}

.hero-intro .hero-label {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}


/* ===========================================
   12. QUICK STATS
   =========================================== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: -2rem auto 2rem;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon { 
    font-size: 2.5rem; 
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}


/* ===========================================
   13. KAPITELKORT & GRID
   =========================================== */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.chapter-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
}

.chapter-card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg); 
}

/* Kapitelkort header */
.chapter-card-header, 
.chapter-header {
    background: var(--primary-gradient);
    padding: 1rem 1.5rem;
    color: var(--text-inverse);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-number {
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.chapter-icon {
    font-size: 1.75rem;
}

/* Kapitelkort body */
.chapter-card-body, 
.chapter-content { 
    padding: 1.5rem; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}

.chapter-card h3, 
.chapter-content h3 { 
    margin: 0 0 0.5rem; 
    color: var(--text-primary); 
    font-size: 1.2rem; 
}

.chapter-card p, 
.chapter-content > p { 
    color: var(--text-secondary); 
    font-size: 0.95rem; 
    margin-bottom: 1rem; 
    flex: 1;
    line-height: 1.5;
}

/* Ämnen i kapitelkort */
.chapter-topics {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-topics li {
    padding: 0.35rem 0 0.35rem 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: #4a5568;
}

.chapter-topics li::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Kapitelkort footer */
.chapter-footer {
    padding: 1rem 1.5rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chapter-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.read-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Progress bar i kapitelkort */
.chapter-progress { 
    height: 6px; 
    background: var(--border-color); 
    border-radius: 3px; 
    overflow: hidden; 
    margin-top: 1rem; 
}

.chapter-progress .bar, 
.chapter-progress .progress-bar { 
    height: 100%; 
    background: var(--success-color); 
    width: 0%; 
    transition: width 0.5s;
    border-radius: 3px;
}


/* ===========================================
   14. BREADCRUMBS
   =========================================== */
.breadcrumb { 
    background: var(--background); 
    padding: 0.75rem 1rem; 
    font-size: 0.9rem; 
    border-bottom: 1px solid var(--border-color); 
}

.breadcrumb-container { 
    max-width: 900px; 
    margin: 0 auto; 
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb span { 
    color: var(--text-light); 
    margin: 0 0.5rem; 
}

.breadcrumb .current { 
    color: var(--text-secondary); 
}


/* ===========================================
   15. KAPITELINNEHÅLL (LÄS-VY)
   =========================================== */
.chapter-page {
    min-height: calc(100vh - 80px);
}

.chapter-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.chapter-article {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Kapitelartikel header */
.chapter-article .chapter-header {
    background: linear-gradient(135deg, #2c5282, #2b6cb0);
    padding: 2rem;
    text-align: center;
    display: block;
}

.chapter-article .chapter-header .chapter-label {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.9);
}

.chapter-article .chapter-header h1 {
    color: var(--text-inverse);
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.chapter-article .chapter-header .chapter-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.chapter-article .chapter-header .read-time,
.chapter-article .chapter-header .difficulty {
    color: rgba(255,255,255,0.9);
}

.chapter-article .chapter-header .difficulty.easy {
    background: rgba(72, 187, 120, 0.3);
    color: var(--text-inverse);
}

.chapter-article .chapter-header .difficulty.medium {
    background: rgba(237, 137, 54, 0.3);
    color: var(--text-inverse);
}

/* Sektioner i kapitel */
.chapter-section, 
.content-section {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.chapter-section:last-of-type, 
.content-section:last-child {
    border-bottom: none;
}

.chapter-section h2, 
.content-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--info-border);
}

.chapter-section h3, 
.content-section h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.chapter-section h4, 
.content-section h4 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
}

.chapter-section p, 
.content-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.chapter-section ul, 
.chapter-section ol,
.content-section ul, 
.content-section ol {
    margin: 1rem 0 1.5rem 2rem;
}

.chapter-section li, 
.content-section li {
    margin-bottom: 0.5rem;
}

/* Table of Contents */
.toc {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.toc h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.toc-list {
    margin-left: 1.5rem;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.toc-list a:hover {
    color: var(--primary-color);
}


/* ===========================================
   16. FORMEL-BOXAR
   =========================================== */
.formula-box {
    background: #1a365d;
    color: var(--text-inverse);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.formula-box.main-formula {
    background: linear-gradient(135deg, #2c5282, #2b6cb0);
}

.formula-box h3 { 
    font-size: 2rem; 
    font-family: 'Georgia', serif;
    margin: 0 0 0.5rem 0;
    color: var(--text-inverse);
}

.formula-box p {
    margin: 0;
    color: rgba(255,255,255,0.9);
}

.formula-note {
    font-size: 0.85rem;
    margin-top: 0.5rem !important;
    color: rgba(255,255,255,0.7) !important;
}

.formula-variants {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.formula-variant {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.formula-simple {
    background: #faf5ff;
    border: 2px solid var(--accent-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.25rem;
    font-family: 'Georgia', serif;
    color: #553c9a;
    margin: 1rem 0;
}

/* Formula triangle */
.formula-triangle {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

.triangle-visual {
    text-align: center;
}

.triangle-top {
    background: var(--primary-color);
    color: var(--text-inverse);
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.triangle-bottom {
    display: flex;
    background: var(--primary-dark);
    color: var(--text-inverse);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.triangle-bottom span {
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}


/* ===========================================
   17. TABELLER
   =========================================== */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.content-table, 
.prefix-table, 
.db-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.content-table th, 
.content-table td,
.prefix-table th, 
.prefix-table td,
.db-table th, 
.db-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.content-table th, 
.prefix-table th, 
.db-table th {
    background: var(--primary-color);
    color: var(--text-inverse);
    font-weight: 600;
}

.content-table tr:hover, 
.prefix-table tr:hover {
    background: var(--background);
}

.content-table tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

/* Prefix table specifika klasser */
.prefix-table tr.prefix-large { 
    background: var(--info-bg); 
}

.prefix-table tr.prefix-base { 
    background: var(--background); 
    font-weight: 600; 
}

.prefix-table tr.prefix-small { 
    background: #faf5ff; 
}


/* ===========================================
   18. KAPITELNAVIGATION
   =========================================== */
.chapter-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.nav-btn, 
.nav-button {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

.nav-btn:hover, 
.nav-button:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
    text-decoration: none;
}

.nav-btn.featured, 
.nav-button.practice {
    background: var(--primary-gradient);
    border: none;
    color: var(--text-inverse);
}

.nav-btn.featured:hover, 
.nav-button.practice:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-direction {
    font-size: 0.85rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 600;
    color: var(--text-primary);
}

.nav-btn.featured .nav-direction,
.nav-btn.featured .nav-title {
    color: var(--text-inverse);
}

.nav-btn.prev { 
    text-align: left; 
}

.nav-btn.next { 
    text-align: right; 
}


/* ===========================================
   19. QUIZ & EXAM
   =========================================== */

/* Exam section på startsidan */
.exam-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.exam-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.exam-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.exam-card.featured {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.exam-card.intro-card {
    background: linear-gradient(135deg, #ebf8ff, #e6fffa);
    border: 2px solid #81e6d9;
}

.exam-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--text-inverse);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.exam-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.exam-card h3 {
    margin-bottom: 0.5rem;
}

.exam-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Quiz container */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.quiz-header {
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-info {
    display: flex;
    gap: 2rem;
}

.quiz-info-item {
    display: flex;
    flex-direction: column;
}

.quiz-info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-info-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Timer */
.timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.timer.warning { 
    color: var(--warning-color); 
}

.timer.danger { 
    color: var(--danger-color); 
    animation: pulse 1s infinite; 
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Question card */
.question-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
}

.question-header {
    background: var(--primary-color);
    color: var(--text-inverse);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number { 
    font-weight: 600; 
}

.question-category { 
    font-size: 0.875rem; 
    opacity: 0.9; 
}

.question-body { 
    padding: 2rem; 
}

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.question-image {
    max-width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
}

/* Answer options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.answer-option:hover {
    border-color: var(--primary-light);
    background: var(--surface-hover);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: var(--info-bg);
}

.answer-option.correct {
    border-color: var(--success-color);
    background: var(--success-bg);
}

.answer-option.incorrect {
    border-color: var(--danger-color);
    background: var(--danger-bg);
}

.answer-option.disabled {
    pointer-events: none;
}

.answer-marker {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.2s;
}

.answer-option.selected .answer-marker {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-inverse);
}

.answer-option.correct .answer-marker {
    border-color: var(--success-color);
    background: var(--success-color);
    color: var(--text-inverse);
}

.answer-option.incorrect .answer-marker {
    border-color: var(--danger-color);
    background: var(--danger-color);
    color: var(--text-inverse);
}

.answer-text { 
    flex: 1; 
}

/* Question navigation dots */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.question-dots {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 60%;
}

.question-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.question-dot:hover { 
    border-color: var(--primary-color); 
}

.question-dot.current {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-inverse);
}

.question-dot.answered {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--text-inverse);
}

.question-dot.correct {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--text-inverse);
}

.question-dot.incorrect {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--text-inverse);
}

.question-dot.flagged::after {
    content: '🚩';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.6rem;
}

/* Explanation box */
.explanation-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.explanation-box h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}


/* ===========================================
   20. RESULTAT
   =========================================== */
.result-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.result-hero {
    text-align: center;
    padding: 3rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.result-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-hero.passed .result-score { 
    color: var(--success-color); 
}

.result-hero.failed .result-score { 
    color: var(--danger-color); 
}

.result-message {
    font-size: 1.5rem;
    margin: 1rem 0;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.result-detail { 
    text-align: center; 
}

.result-detail-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}


/* ===========================================
   21. STATISTIK
   =========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stats-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.big-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.trend.up { 
    color: var(--success-color); 
}

.trend.down { 
    color: var(--danger-color); 
}

/* Knowledge bars */
.knowledge-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.knowledge-item {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.knowledge-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.knowledge-label { 
    font-weight: 500; 
}

.knowledge-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Progress bar (generell) */
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.good { 
    background: var(--success-color); 
}

.progress-fill.medium { 
    background: var(--warning-color); 
}

.progress-fill.low { 
    background: var(--danger-color); 
}

/* History list */
.history-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

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

.history-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 100px;
}

.history-type {
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.history-score {
    margin-left: auto;
    font-weight: 700;
}

.history-score.passed { 
    color: var(--success-color); 
}

.history-score.failed { 
    color: var(--danger-color); 
}


/* ===========================================
   22. ÖVNINGAR (EXERCISES)
   =========================================== */
.exercises-section {
    background: var(--background);
}

.exercises-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Exercise card bas */
.exercise-card,
.exercise-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.exercise-card.answered-correct,
.exercise-item.answered-correct {
    border-color: var(--success-color);
    background: var(--success-bg);
}

.exercise-card.answered-wrong,
.exercise-item.answered-wrong {
    border-color: var(--danger-color);
    background: var(--danger-bg);
}

.exercise-card.reflection-card {
    background: #faf5ff;
    border-color: #d6bcfa;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exercise-number {
    font-weight: 600;
    color: var(--primary-color);
}

.exercise-type {
    font-size: 0.8rem;
    background: var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    color: var(--text-secondary);
}

.exercise-question {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.exercise-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #faf5ff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* --- MULTIPLE CHOICE - Förbättrad design --- */
.mc-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.mc-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
}

.mc-option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.mc-option-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.mc-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--marker-bg);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    flex-shrink: 0;
}

.mc-text {
    flex: 1;
    line-height: 1.4;
}

.mc-option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
}

.mc-option-btn.correct .mc-marker {
    background: #28a745;
    color: white;
}

.mc-option-btn.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.mc-option-btn.incorrect .mc-marker {
    background: #dc3545;
    color: white;
}

.mc-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* --- TRUE/FALSE - Stora knappar --- */
.tf-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.tf-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-family: inherit;
}

.tf-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tf-true:hover:not(:disabled) {
    border-color: #28a745;
    background: #d4edda;
}

.tf-false:hover:not(:disabled) {
    border-color: #dc3545;
    background: #f8d7da;
}

.tf-icon {
    font-size: 2rem;
}

.tf-label {
    font-weight: 600;
}

.tf-btn.correct {
    border-color: #28a745;
    background: #d4edda;
}

.tf-btn.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.tf-btn:disabled {
    cursor: not-allowed;
}

/* --- MATCHING - Tydlig grid --- */
.matching-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.match-left {
    padding: 0.75rem 1rem;
    background: var(--info-bg);
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.match-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.match-right-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-right-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.match-choice {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.match-choice:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.match-choice.selected {
    border-color: var(--primary-color);
    background: var(--info-bg);
    font-weight: 600;
}

.match-choice.correct {
    border-color: #28a745;
    background: #d4edda;
}

.match-choice.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.match-choice:disabled {
    cursor: not-allowed;
}

/* Gammal matching-stil (fallback) */
.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.matching-item {
    background: var(--info-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
    font-weight: 500;
}

.matching-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--surface);
    cursor: pointer;
}

/* --- ORDERING & TIMELINE - Mobilvänlig v2 --- */
.ordering-help {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    line-height: 1.5;
}

.ordering-container,
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    -webkit-user-select: none;
    user-select: none;
}

.ordering-item,
.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: grab;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.ordering-item:active,
.timeline-item:active {
    cursor: grabbing;
}

.order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.ordering-item .item-text,
.timeline-item .item-text {
    flex: 1;
    line-height: 1.4;
}

.drag-handle {
    color: var(--text-light);
    font-size: 1.25rem;
    padding: 0.5rem;
    margin: -0.5rem;
    flex-shrink: 0;
    font-weight: bold;
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* Hover state (desktop) */
.ordering-item:hover,
.timeline-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ordering-item:hover .drag-handle,
.timeline-item:hover .drag-handle {
    opacity: 1;
}

/* Touch-aktiv state (före drag startar) */
.ordering-item.touch-active,
.timeline-item.touch-active {
    border-color: var(--primary-color);
    background: var(--info-bg);
    transform: scale(1.02);
}

/* När man drar */
.ordering-item.dragging,
.timeline-item.dragging {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--primary-color);
    background: var(--info-bg);
}

/* Vald för swap (tap-to-swap) */
.ordering-item.selected-for-swap,
.timeline-item.selected-for-swap {
    border-color: var(--primary-color);
    background: var(--info-bg);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
    transform: scale(1.02);
}

.ordering-item.selected-for-swap .order-number {
    background: var(--primary-dark);
    animation: pulse-number 1s ease infinite;
}

@keyframes pulse-number {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Resultat: Rätt ordning */
.ordering-item.correct-order,
.timeline-item.correct-order {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.ordering-item.correct-order .order-number {
    background: #28a745;
}

/* Resultat: Fel ordning */
.ordering-item.incorrect-order,
.timeline-item.incorrect-order {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.ordering-item.incorrect-order .order-number {
    background: #dc3545;
}

/* Ghost element som följer fingret vid touch-drag */
.drag-ghost {
    position: fixed;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 10000;
    opacity: 0.95;
    transform: rotate(2deg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drag-ghost .order-number {
    background: var(--primary-color);
    color: white;
}

.drag-ghost .drag-handle {
    display: none;
}

/* === MOBIL-SPECIFIKA ANPASSNINGAR === */
@media (max-width: 768px) {
    .ordering-item,
    .timeline-item {
        padding: 1rem 0.875rem;
        min-height: 60px;
    }
    
    .order-number {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }
    
    .item-text {
        font-size: 0.95rem;
    }
    
    .drag-handle {
        font-size: 1.5rem;
        padding: 0.75rem;
        margin: -0.75rem -0.5rem -0.75rem 0;
    }
    
    .ordering-help {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
        text-align: center;
    }
}

/* Touch-enheter: Större touch targets */
@media (pointer: coarse) {
    .ordering-item,
    .timeline-item {
        min-height: 64px;
        padding: 1.125rem 1rem;
    }
    
    .drag-handle {
        padding: 1rem;
        margin: -0.5rem -0.25rem -0.5rem 0;
    }
}

/* Drag ghost för touch */
.drag-ghost {
    position: fixed;
    left: 10px;
    right: 10px;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    pointer-events: none;
    z-index: 1000;
    opacity: 0.9;
}

/* --- Fill blank --- */
.fill-blank-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.fill-blank-input {
    flex: 1;
    min-width: 200px;
}

/* --- Calculation --- */
.calculation-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.calculation-input {
    width: 150px;
}

.unit-label {
    font-weight: 600;
    color: #4a5568;
}

.steps-container {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.steps-container h5 {
    margin: 0 0 0.5rem 0;
}

.steps-container ol {
    margin: 0;
    padding-left: 1.25rem;
}

/* --- Reflection --- */
.reflection-hints {
    background: #faf5ff;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.reflection-hints h5 {
    margin: 0 0 0.5rem 0;
    color: #553c9a;
}

.reflection-hints ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #6b46c1;
}

.reflection-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.reflection-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
}

.reflection-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.reflection-note {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-style: italic;
    margin-top: 0.75rem;
}

/* --- Options (gammal stil, fallback) --- */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.option-label:hover {
    border-color: var(--primary-color);
    background: var(--info-bg);
}

.option-label input { 
    flex-shrink: 0; 
}

.option-text { 
    flex: 1; 
}

.true-false-options {
    flex-direction: row;
    flex-wrap: wrap;
}

.true-false-options .option-label {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* --- Feedback --- */
.feedback,
.exercise-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.feedback-correct {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #276749;
}

.feedback-wrong {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #c53030;
}

.feedback-text.correct {
    color: #276749;
}

.feedback-text.incorrect {
    color: #c53030;
}

.feedback-explanation {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* --- Exercise results --- */
.exercise-results {
    background: linear-gradient(135deg, var(--info-bg), #e6fffa);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.exercise-results h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-dark);
}

.exercise-results p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #2c5282;
}


/* ===========================================
   23. BÖCKER-SEKTION
   =========================================== */
.books-section {
    padding: 3rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.books-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.books-section .section-intro {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.books-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Bok-kort */
.book-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.book-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Bok-header */
.book-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.book-card[data-book="intro"] .book-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.book-header:hover {
    filter: brightness(1.05);
}

.book-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.book-number.bonus {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    font-size: 1.2rem;
}

.book-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.book-title-area {
    flex: 1;
}

.book-title-area h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.book-tagline {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.book-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Expanderat innehåll */
.book-expanded-content {
    display: none;
    padding: 0;
}

.book-card.expanded .book-expanded-content {
    display: block;
}

/* Bok-intro */
.book-intro {
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.book-intro h4 {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1.1rem;
}

.book-intro p {
    margin: 0 0 1rem 0;
    line-height: 1.7;
    color: #4a5568;
}

.book-intro p:last-of-type {
    margin-bottom: 1rem;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.book-meta span {
    font-size: 0.85rem;
    color: #718096;
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* Kapitel-lista */
.chapters-list {
    padding: 1.5rem;
}

.chapters-list h4 {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.book-card[data-book="intro"] .chapter-link {
    border-left-color: #11998e;
}

.chapter-link:hover {
    background: #f0f4ff;
    border-left-color: #4c63d2;
    transform: translateX(4px);
    text-decoration: none;
}

.book-card[data-book="intro"] .chapter-link:hover {
    background: #e6fff9;
    border-left-color: #0d7d71;
}

.chapter-num {
    font-weight: 700;
    font-size: 0.9rem;
    color: #667eea;
    background: #eef2ff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.book-card[data-book="intro"] .chapter-num {
    color: #11998e;
    background: #e6fff9;
}

.chapter-title {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.chapter-time {
    font-size: 0.8rem;
    color: #718096;
    flex-shrink: 0;
}

/* Bokavdelare */
.books-divider {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-left: 4px solid #6c757d;
}

.books-divider.cert-divider {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fdf2f2 0%, #fce8e8 100%);
}

.divider-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.divider-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.divider-text h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.divider-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Bonusbok */
.book-card.bonus-book {
    border: 2px dashed #e67e22;
    background: linear-gradient(135deg, #fffbf5 0%, #fff8f0 100%);
}

.book-card.bonus-book .book-header {
    background: linear-gradient(135deg, #fff8f0 0%, #ffedd5 100%);
}

.bonus-badge {
    display: inline-block;
    background: #e67e22;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    margin-top: 0.3rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* SSA Rekommendation */
.ssa-recommendation {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.ssa-recommendation-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ssa-recommendation-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ssa-recommendation-text {
    flex: 1;
    min-width: 200px;
}

.ssa-recommendation-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
}

.ssa-recommendation-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

.ssa-recommendation-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ssa-recommendation-link:hover {
    background: var(--primary-dark);
    transform: translateX(2px);
    text-decoration: none;
}

.ssa-recommendation-link .link-arrow {
    transition: transform 0.2s ease;
}

.ssa-recommendation-link:hover .link-arrow {
    transform: translateX(4px);
}


/* ===========================================
   24. BONUS-SEKTION
   =========================================== */
.bonus-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 2rem;
    margin-top: 2rem;
    border-top: 3px solid #dee2e6;
}

.bonus-header {
    text-align: center;
    margin-bottom: 2rem;
}

.bonus-header h2 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.bonus-header p {
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

.bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.bonus-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bonus-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.bonus-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.bonus-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.bonus-title-area h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: #2d3748;
}

.bonus-title-area p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.bonus-card .bonus-badge {
    position: absolute;
    top: -0.5rem;
    right: 0;
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bonus-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Exam Ready Modal */
.exam-ready-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.exam-ready-modal.visible {
    opacity: 1;
    visibility: visible;
}

.exam-ready-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.exam-ready-modal.visible .exam-ready-content {
    transform: scale(1);
}

.exam-ready-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.exam-ready-content h2 {
    color: #1a202c;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.exam-ready-content p {
    color: #4a5568;
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.exam-ready-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.exam-ready-buttons .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.exam-ready-buttons .btn-primary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exam-ready-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.4);
}

.exam-ready-buttons .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    font-weight: 500;
}

.exam-ready-buttons .btn-secondary:hover {
    background: #e2e8f0;
}

.exam-ready-note {
    font-size: 0.9rem;
    color: #718096;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

#examReady.ready {
    color: #10b981;
    font-weight: 700;
}


/* ===========================================
   25. PMR446-SPECIFIKA STILAR
   =========================================== */

/* Användningsfall-grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.use-case-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.use-case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.use-case-card .use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.use-case-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.use-case-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Regler-lista */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.rule-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.rule-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.rule-content h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
}

.rule-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Jämförelsetabell */
.comparison-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table td.good {
    color: #27ae60;
    font-weight: 500;
}

.comparison-table td.bad {
    color: #e74c3c;
}

.comparison-table td.neutral {
    color: var(--text-muted);
}

/* Stor jämförelsetabell */
.comparison-table-large {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.comparison-table-large table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table-large th,
.comparison-table-large td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table-large th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table-large th:first-child {
    background: #5a6fd6;
}

.comparison-table-large td:first-child {
    font-weight: 500;
}

.comparison-table-large td.good {
    color: #27ae60;
}

.comparison-table-large td.bad {
    color: #e74c3c;
}

.comparison-table-large td.neutral {
    color: var(--text-muted);
}

/* Process-steg */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.process-step,
.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Köpguide prisnivåer */
.buying-guide {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.price-tier {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
}

.price-tier.featured {
    border-color: var(--primary-color);
    position: relative;
}

.price-tier.featured::before {
    content: "Rekommenderas";
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-tier h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.price-tier ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.price-tier li {
    margin-bottom: 0.25rem;
}

.brand-examples {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* Checklista */
.checklist-box {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.checklist-box h4 {
    margin: 0 0 1rem 0;
    color: #2e7d32;
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist li {
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
}

.checklist li::before {
    content: "☐";
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Batteriinfo */
.battery-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.battery-type {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.battery-type h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.battery-type ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Steg-guide med kort */
.step-guide {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.step-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.step-num {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-header h4 {
    margin: 0;
}

.step-card p {
    margin: 0;
    color: var(--text-muted);
}

.step-tip {
    margin-top: 0.75rem !important;
    padding: 0.5rem 0.75rem;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e65100 !important;
}

/* Radio-etikett */
.radio-etiquette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.etiquette-do {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 1.5rem;
}

.etiquette-do h4 {
    color: #2e7d32;
    margin: 0 0 1rem 0;
}

.etiquette-dont {
    background: #ffebee;
    border-radius: 12px;
    padding: 1.5rem;
}

.etiquette-dont h4 {
    color: #c62828;
    margin: 0 0 1rem 0;
}

.radio-etiquette ul {
    margin: 0;
    padding-left: 1.25rem;
}

.radio-etiquette li {
    margin-bottom: 0.5rem;
}

/* Exempel-konversation */
.example-conversation {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-conversation h4 {
    margin: 0 0 1rem 0;
}

.conversation {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 85%;
}

.message.outgoing {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.incoming {
    background: #e9ecef;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message .speaker {
    font-weight: 600;
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.message .text {
    font-style: italic;
}

/* Kanaltabell */
.channel-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.channel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.channel-table th,
.channel-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.channel-table th {
    background: var(--primary-color);
    color: white;
}

.channel-table tr:nth-child(even) {
    background: var(--bg-light);
}

.channel-table tr.highlighted {
    background: #fff3e0;
}

.channel-table tr.highlighted td {
    font-weight: 500;
}

/* CTCSS-tabell */
.ctcss-table-wrapper {
    margin: 1.5rem 0;
}

.ctcss-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

.ctcss-table th,
.ctcss-table td {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.ctcss-table th {
    background: var(--card-bg);
    font-weight: 600;
}

.table-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Räckviddskort */
.range-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.range-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.range-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.range-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.range-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.range-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.range-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Blockerare-lista */
.blockers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.blocker-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    align-items: flex-start;
}

.blocker-item.severe {
    border-left: 4px solid #e74c3c;
}

.blocker-item.moderate {
    border-left: 4px solid #f39c12;
}

.blocker-item.mild {
    border-left: 4px solid #3498db;
}

.blocker-item.none {
    border-left: 4px solid #27ae60;
}

.blocker-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.blocker-info h4 {
    margin: 0;
}

.blocker-impact {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.25rem 0 0.5rem 0;
}

.blocker-item.severe .blocker-impact { color: #e74c3c; }
.blocker-item.moderate .blocker-impact { color: #f39c12; }
.blocker-item.mild .blocker-impact { color: #3498db; }
.blocker-item.none .blocker-impact { color: #27ae60; }

.blocker-info p:last-child {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Tips-grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.tip-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.tip-number {
    position: absolute;
    top: -10px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.tip-card h4 {
    margin: 0.5rem 0 0.5rem 0;
}

.tip-card p {
    margin: 0 0 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tip-effect {
    font-size: 0.85rem;
    color: #27ae60;
    font-weight: 500;
}

/* Felsökning */
.troubleshoot-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.troubleshoot-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.troubleshoot-item .problem {
    background: #fff3e0;
    padding: 1rem 1.5rem;
}

.troubleshoot-item .problem h4 {
    margin: 0;
    color: #e65100;
}

.troubleshoot-item .solution {
    padding: 1rem 1.5rem;
}

.troubleshoot-item .solution ul {
    margin: 0;
    padding-left: 1.25rem;
}

.troubleshoot-item .solution li {
    margin-bottom: 0.5rem;
}

/* Aktiviteter-grid */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.activity-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.activity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.activity-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.activity-card h4 {
    margin: 0 0 0.5rem 0;
}

.activity-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Effektjämförelse */
.power-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.power-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.power-bar .power-label {
    width: 160px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.power-bar .power-value {
    width: 80px;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.power-bar .power-fill {
    flex-grow: 1;
    height: 24px;
    background: linear-gradient(90deg, var(--primary-color), #764ba2);
    border-radius: 12px;
    min-width: 4px;
}

/* Kostnadöversikt */
.cost-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.cost-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.cost-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.cost-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.cost-item p:last-child {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Nästa steg-kort */
.next-steps-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.next-step-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.next-step-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-decoration: none;
}

.next-step-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.next-step-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.next-step-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Grattis-box */
.congratulations-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    margin: 2rem 0;
}

.congratulations-box h3 {
    margin: 0 0 1rem 0;
    font-size: 1.75rem;
    color: white;
}

.congratulations-box p {
    margin: 0.5rem 0;
}

.congratulations-box ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.congratulations-box li {
    padding: 0.25rem 0;
}

/* Pro tips */
.pro-tip {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem 1.5rem;
    border-radius: 0 10px 10px 0;
    margin: 1.5rem 0;
}

.pro-tip h4 {
    margin: 0 0 0.5rem 0;
    color: #1565c0;
}

.pro-tip p {
    margin: 0;
}

/* Ungdomstips */
.youth-tips {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.youth-tips h4 {
    margin: 0 0 1rem 0;
}

.youth-tips ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.youth-tips li {
    padding: 0.5rem 0;
}


/* ===========================================
   26. SPECIALELEMENT (KAPITELINNEHÅLL)
   =========================================== */

/* Example grid */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.example-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.example-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.example-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.example-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Comparison box */
.comparison-box {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.comparison-box h4 {
    text-align: center;
    margin: 0 0 1rem 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comparison-item {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.comparison-item h5 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.comparison-item ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-color);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    cursor: default;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 3px var(--border-color);
}

.timeline-item.featured::before {
    background: var(--warning-color);
    width: 16px;
    height: 16px;
    left: calc(-2rem - 2px);
}

.timeline-year {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    margin: 0 0 0.5rem 0;
}

.timeline-content p {
    margin: 0;
    font-size: 0.95rem;
}

/* Person grid */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.person-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.person-image {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.person-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.person-title {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin: 0 0 0.75rem 0 !important;
}

.person-card p:last-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Story box */
.story-box {
    background: linear-gradient(135deg, #1a365d, #2c5282);
    color: var(--text-inverse);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.story-box p {
    color: rgba(255,255,255,0.95);
}

.story-box ul {
    color: rgba(255,255,255,0.9);
}

/* Two column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.column h4 {
    margin: 0 0 0.75rem 0;
}

/* Success / Warning lists */
.success-list, 
.warning-list {
    list-style: none;
    padding: 0;
}

.success-list li, 
.warning-list li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
}

.success-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.warning-list li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: var(--danger-color);
    font-weight: bold;
}

/* Impact box */
.impact-box {
    background: #faf5ff;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.impact-box h4 {
    color: #553c9a;
    margin: 0 0 0.75rem 0;
}

.impact-box ul {
    margin: 0;
    color: #6b46c1;
}

/* Hero box */
.hero-box {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: var(--text-inverse);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.hero-box h4 {
    color: var(--text-inverse);
    margin: 0 0 0.75rem 0;
}

.hero-box p, 
.hero-box ul {
    color: rgba(255,255,255,0.95);
}

/* Case study */
.case-study {
    background: var(--background);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.case-study h4 {
    color: var(--primary-dark);
    margin: 0 0 0.5rem 0;
}

.case-study p {
    margin: 0 0 0.75rem 0;
}

.case-study ul {
    margin: 0;
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Unit cards */
.unit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.unit-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-top: 4px solid var(--primary-color);
}

.unit-symbol {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.unit-card h4 {
    margin: 0 0 0.5rem 0;
}

.unit-analogy {
    background: var(--success-bg);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #276749;
    margin-bottom: 0.75rem;
}

.unit-example {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.75rem;
}

/* Spectrum visual */
.spectrum-visual {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #1a365d;
    border-radius: var(--radius-md);
}

.spectrum-bar {
    display: flex;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
}

.spectrum-section {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: 0.75rem;
    font-weight: 600;
}

.spectrum-section.vlf { background: #742a2a; }
.spectrum-section.lf { background: #9c4221; }
.spectrum-section.mf { background: #b7791f; }
.spectrum-section.hf { background: #2f855a; }
.spectrum-section.vhf { background: #2b6cb0; }
.spectrum-section.uhf { background: #553c9a; }
.spectrum-section.shf { background: #702459; }
.spectrum-section.ehf { background: #4a5568; }

.spectrum-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
}

/* Band cards */
.band-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.band-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.band-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.band-header {
    padding: 1rem 1.25rem;
    color: var(--text-inverse);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.band-header.lf { background: linear-gradient(135deg, #9c4221, #c05621); }
.band-header.mf { background: linear-gradient(135deg, #b7791f, #d69e2e); }
.band-header.hf { background: linear-gradient(135deg, #276749, #38a169); }
.band-header.vhf { background: linear-gradient(135deg, #2b6cb0, #4299e1); }
.band-header.uhf { background: linear-gradient(135deg, #553c9a, #805ad5); }
.band-header.shf { background: linear-gradient(135deg, #702459, #b83280); }

.band-header h3 {
    margin: 0;
    color: var(--text-inverse);
    font-size: 1.1rem;
}

.band-range {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.band-content {
    padding: 1.25rem;
}

.band-content p {
    margin: 0.5rem 0;
}

.band-content ul {
    margin: 0.5rem 0 1rem 0;
}

.band-highlight {
    background: var(--info-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.band-highlight p {
    margin: 0;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Amateur bands table */
.amateur-bands-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.amateur-bands-table table {
    width: 100%;
    border-collapse: collapse;
}

.amateur-bands-table th,
.amateur-bands-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.amateur-bands-table th {
    background: var(--primary-dark);
    color: var(--text-inverse);
}

.amateur-bands-table tr.highlight-row {
    background: var(--info-bg);
}

/* Frequency activities */
.frequency-activities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* Chaos examples */
.chaos-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.chaos-item {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.chaos-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.chaos-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #c53030;
}

/* Activity showcase */
.activity-showcase {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.achievement-box {
    background: linear-gradient(135deg, #faf5ff, #e9d8fd);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.achievement-box h5 {
    color: #553c9a;
    margin: 0 0 0.5rem 0;
}

.achievement-box p {
    margin: 0;
    color: #6b46c1;
    font-size: 0.95rem;
}

/* Contest info */
.contest-info {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.contest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.contest-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.contest-card h5 {
    margin: 0 0 0.25rem 0;
}

.contest-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Project showcase */
.project-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.project-level {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.project-level h4 {
    margin: 0 0 0.75rem 0;
}

.project-level ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Space activities */
.space-activities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.space-card {
    background: linear-gradient(135deg, #1a365d, #2c5282);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.space-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.space-card h4 {
    color: var(--text-inverse);
    margin: 0 0 0.5rem 0;
}

.space-card p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

/* Emergency info */
.emergency-info {
    margin: 1.5rem 0;
}

.org-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.org-card {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.org-card h5 {
    margin: 0 0 0.5rem 0;
    color: #c53030;
}

.org-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #9b2c2c;
}

/* Digital modes */
.digital-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.mode-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-top: 4px solid var(--primary-color);
}

.mode-card h4 {
    margin: 0;
}

.mode-type {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin: 0.25rem 0 0.75rem 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Special activities */
.special-activities {
    margin: 1.5rem 0;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

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

.activity-content h4 {
    margin: 0 0 0.25rem 0;
}

.activity-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Community aspects */
.community-aspects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.community-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.community-card h4 {
    margin: 0 0 0.5rem 0;
}

.community-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Completion box */
.completion-box {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: var(--text-inverse);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 1.5rem 0;
}

.completion-box h2 {
    color: var(--text-inverse);
    margin: 0 0 1rem 0;
}

.completion-box p {
    color: rgba(255,255,255,0.95);
}

.completion-box ul {
    text-align: left;
    display: inline-block;
    margin: 1rem 0;
}

.completion-box li {
    color: rgba(255,255,255,0.95);
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Welcome section (intro-sidor) */
.intro-welcome {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-card {
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.welcome-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.welcome-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.welcome-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.welcome-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.welcome-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Intro chapters grid */
.intro-chapters {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Intro card styling */
.chapter-card.intro-card {
    border-left: none;
}

.chapter-card.intro-card .chapter-header {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

/* Next steps */
.next-steps {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.next-steps-card {
    background: linear-gradient(135deg, #2c5282, #2b6cb0);
    color: var(--text-inverse);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.next-steps-card h2 {
    color: var(--text-inverse);
    margin-bottom: 1rem;
}

.next-steps-card p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.next-steps-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}


/* ===========================================
   27. RESPONSIV DESIGN
   =========================================== */

/* Tablet och mindre */
@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 1rem;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-color);
        gap: 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Hero */
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Stats */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -1rem;
        padding: 0 1rem;
    }
    
    /* Kapitelkort */
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .intro-grid {
        grid-template-columns: 1fr;
    }
    
    /* Kapitelinnehåll */
    .chapter-content {
        padding: 1rem;
    }
    
    .chapter-section, 
    .content-section {
        padding: 1.5rem 1rem;
    }
    
    .chapter-section h2, 
    .content-section h2 {
        font-size: 1.35rem;
    }
    
    .chapter-article .chapter-header {
        padding: 1.5rem;
    }
    
    .chapter-article .chapter-header h1 {
        font-size: 1.5rem;
    }
    
    .chapter-article .chapter-header .chapter-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Formler */
    .formula-box {
        padding: 1.25rem 1rem;
    }
    
    .formula-box h3 {
        font-size: 1.5rem;
    }
    
    .formula-triangle {
        flex-direction: column;
    }
    
    /* Grids */
    .comparison-grid,
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .person-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .unit-cards {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 1rem;
    }
    
    /* Navigation */
    .chapter-navigation {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .chapter-navigation .nav-btn {
        text-align: center !important;
    }
    
    /* Quiz */
    .quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-info {
        justify-content: center;
    }
    
    .question-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .question-dots {
        max-width: 100%;
    }
    
    /* Results */
    .result-details {
        grid-template-columns: 1fr;
    }
    
    /* Next steps */
    .next-steps-card {
        padding: 1.5rem;
    }
    
    /* Övningar */
    .match-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .match-arrow {
        transform: rotate(90deg);
    }
    
    .match-right-options {
        justify-content: center;
    }
    
    .ordering-item {
        padding: 0.875rem;
    }
    
    .ordering-help {
        text-align: center;
        padding: 0.5rem;
        background: var(--info-bg);
        border-radius: 6px;
    }
    
    /* Böcker */
    .books-section {
        padding: 2rem 1rem;
    }
    
    .book-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1.25rem;
        position: relative;
        padding-right: 2.5rem;
    }
    
    .book-number {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .book-icon {
        font-size: 1.5rem;
    }
    
    .book-title-area h3 {
        font-size: 1.05rem;
    }
    
    .book-tagline {
        font-size: 0.85rem;
    }
    
    .toggle-icon {
        position: absolute;
        right: 1rem;
        top: 1.5rem;
    }
    
    .book-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chapter-link {
        padding: 0.85rem;
        gap: 0.75rem;
    }
    
    .chapter-time {
        display: none;
    }
    
    /* Bonus section */
    .bonus-section {
        padding: 2rem 1rem;
    }
    
    .bonus-grid {
        grid-template-columns: 1fr;
    }
    
    .bonus-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .bonus-icon {
        margin: 0 auto;
    }
    
    .bonus-card .bonus-badge {
        position: static;
        display: inline-block;
        margin-top: 0.5rem;
    }
    
    .bonus-meta {
        justify-content: center;
    }
    
    /* SSA recommendation */
    .ssa-recommendation-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ssa-recommendation-link {
        width: 100%;
        justify-content: center;
    }
    
    /* Divider */
    .divider-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    /* PMR-specifikt */
    .power-bar {
        flex-wrap: wrap;
    }
    
    .power-bar .power-label {
        width: 100%;
    }
    
    .power-bar .power-value {
        text-align: left;
    }
    
    .use-cases-grid,
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .range-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Touch targets */
    .nav-links a,
    .nav-button,
    .nav-btn,
    .answer-option,
    .chapter-card,
    .option-label,
    .mc-option-btn,
    .tf-btn,
    .match-choice,
    .ordering-item {
        min-height: 48px;
    }
}

/* Mobil */
@media (max-width: 480px) {
    /* Stats */
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    /* Knappar */
    .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Diverse */
    .chapter-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .welcome-grid {
        grid-template-columns: 1fr;
    }
    
    .person-grid {
        grid-template-columns: 1fr;
    }
    
    .example-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .feature-grid,
    .space-activities,
    .digital-modes,
    .contest-grid,
    .project-showcase {
        grid-template-columns: 1fr;
    }
    
    /* Övningar */
    .matching-container {
        grid-template-columns: 1fr;
    }
    
    .mc-option-btn {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .match-choice {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        text-align: center;
    }
    
    /* PMR-specifikt */
    .use-cases-grid,
    .activities-grid,
    .range-cards {
        grid-template-columns: 1fr;
    }
    
    /* Exam modal */
    .exam-ready-content {
        padding: 1.5rem;
    }
    
    .exam-ready-icon {
        font-size: 3rem;
    }
    
    .exam-ready-content h2 {
        font-size: 1.25rem;
    }
}


/* ===========================================
   28. DARK MODE
   =========================================== */
@media (prefers-color-scheme: dark){
    :root {
        --background: #1a202c;
        --surface: #2d3748;
        --surface-hover: #4a5568;
        --card-bg: #2d3748;
        --bg-light: #374151;
        
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-light: #a0aec0;
        --text-color: #f7fafc;
        --text-muted: #a0aec0;
        
        --border-color: #4a5568;
        --marker-bg: #4a5568;
        --hover-bg: #374151;
        
        /* Justerade bakgrundsfärger för bättre kontrast */
        --info-bg: rgba(66, 153, 225, 0.15);
        --info-border: #63b3ed;
        
        --success-bg: rgba(72, 187, 120, 0.15);
        --success-border: #68d391;
        
        --warning-bg: rgba(237, 137, 54, 0.15);
        --warning-border: #f6ad55;
        
        --danger-bg: rgba(245, 101, 101, 0.15);
        --danger-border: #fc8181;

            /* Ordering touch states - Dark mode */
    .ordering-item.touch-active,
    .timeline-item.touch-active {
        background: rgba(66, 153, 225, 0.2);
        border-color: #63b3ed;
    }
    
    .ordering-item.selected-for-swap,
    .timeline-item.selected-for-swap {
        background: rgba(66, 153, 225, 0.2);
        border-color: #4299e1;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.3);
    }
    
    .drag-ghost {
        background: var(--surface);
        border-color: #63b3ed;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }
    
    .ordering-help {
        background: var(--surface);
        border-left-color: #63b3ed;
        color: #a0aec0;
    }

    }
    
    /* Grundläggande text */
    body, p, li, td, span, label {
        color: var(--text-primary);
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: var(--text-primary);
    }
    
    /* Content boxes */
    .content-box,
    .info-box,
    .tip-box,
    .warning-box,
    .example-box {
        color: var(--text-primary);
    }
    
    /* Info box */
    .content-box.info,
    .info-box {
        background: var(--info-bg);
        border-color: var(--info-border);
    }
    
    .content-box.info h3,
    .content-box.info h4,
    .info-box h4 {
        color: #90cdf4;
    }
    
    .info-box p,
    .info-box ul,
    .content-box.info p {
        color: #e2e8f0;
    }
    
    /* Tip box */
    .content-box.tip,
    .tip-box {
        background: var(--success-bg);
        border-color: var(--success-border);
    }
    
    .content-box.tip h3,
    .content-box.tip h4,
    .tip-box h4 {
        color: #9ae6b4;
    }
    
    .tip-box p,
    .tip-box ul {
        color: #e2e8f0;
    }
    
    /* Warning box */
    .content-box.warning,
    .warning-box {
        background: var(--warning-bg);
        border-color: var(--warning-border);
    }
    
    .content-box.warning h3,
    .content-box.warning h4,
    .warning-box h4 {
        color: #fbd38d;
    }
    
    .warning-box p {
        color: #e2e8f0;
    }
    
    /* Danger/Important box */
    .content-box.important,
    .content-box.danger {
        background: var(--danger-bg);
        border-color: var(--danger-border);
    }
    
    .content-box.important h3,
    .content-box.important h4 {
        color: #feb2b2;
    }
    
    /* Fun fact */
    .content-box.fun-fact,
    .fun-fact {
        background: rgba(237, 137, 54, 0.15);
        border-color: #f6ad55;
    }
    
    .fun-fact h4 {
        color: #fbd38d;
    }
    
    .fun-fact p {
        color: #e2e8f0;
    }
    
    /* Quote box */
    .content-box.quote,
    .quote-box {
        background: rgba(159, 122, 234, 0.15);
        border-left-color: #b794f4;
    }
    
    .quote-box p {
        color: #e2e8f0;
    }
    
    .quote-box cite,
    .content-box.quote cite {
        color: #d6bcfa;
    }
    
    /* Intro box */
    .intro-box {
        background: rgba(66, 153, 225, 0.15);
        border-left-color: #63b3ed;
    }
    
    .intro-box .lead,
    .intro-box p {
        color: #e2e8f0;
    }
    
    .intro-box.warning {
        background: rgba(237, 137, 54, 0.15);
        border-left-color: #f6ad55;
    }
    
    /* Key points / Summary */
    .key-points,
    .summary-box {
        background: rgba(66, 153, 225, 0.12);
        border-color: #4299e1;
    }
    
    .key-points h3,
    .summary-box h3 {
        color: #90cdf4;
    }
    
    .key-points ul,
    .key-points li,
    .summary-box ul,
    .summary-box li {
        color: #e2e8f0;
    }
    
    /* Example box */
    .example-box {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .example-box h4 {
        color: #90cdf4;
        border-bottom-color: var(--border-color);
    }
    
    .solution {
        background: rgba(0, 0, 0, 0.2);
        color: #e2e8f0;
    }
    
    /* Tabeller */
    .content-table,
    .prefix-table,
    .db-table,
    .amateur-bands-table table,
    .comparison-table table,
    .channel-table,
    .ctcss-table {
        background: var(--surface);
    }
    
    .content-table th,
    .prefix-table th,
    .db-table th,
    .amateur-bands-table th,
    .comparison-table th,
    .channel-table th,
    .ctcss-table th {
        background: #2c5282;
        color: #f7fafc;
    }
    
    .content-table td,
    .prefix-table td,
    .db-table td,
    .amateur-bands-table td,
    .comparison-table td,
    .channel-table td,
    .ctcss-table td {
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .content-table tr:nth-child(even),
    .channel-table tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .content-table tr:hover,
    .prefix-table tr:hover {
    .content-table tr:hover,
    .prefix-table tr:hover {
        background: rgba(255, 255, 255, 0.06);
    }
    
    /* Prefix table rader */
    .prefix-table tr.prefix-large {
        background: rgba(66, 153, 225, 0.12);
    }
    
    .prefix-table tr.prefix-base {
        background: var(--surface);
    }
    
    .prefix-table tr.prefix-small {
        background: rgba(159, 122, 234, 0.12);
    }
    
    /* Highlighted row */
    .amateur-bands-table tr.highlight-row,
    .channel-table tr.highlighted {
        background: rgba(237, 137, 54, 0.15);
    }
    
    /* Comparison table specifikt */
    .comparison-table td.good,
    .comparison-table-large td.good {
        color: #68d391;
    }
    
    .comparison-table td.bad,
    .comparison-table-large td.bad {
        color: #fc8181;
    }
    
    .comparison-table td.neutral,
    .comparison-table-large td.neutral {
        color: #a0aec0;
    }
    
    /* Formulär */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    textarea,
    select,
    .fill-blank-input,
    .calculation-input,
    .matching-select,
    .reflection-textarea {
        background: #2d3748;
        border-color: #4a5568;
        color: #f7fafc;
    }
    
    input::placeholder,
    textarea::placeholder {
        color: #a0aec0;
    }
    
    input:focus,
    textarea:focus,
    select:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2);
    }
    
    /* Kort & komponenter */
    .chapter-card,
    .exam-card,
    .stat-card,
    .welcome-card,
    .book-card,
    .exercise-card,
    .exercise-item,
    .stats-card,
    .bonus-card,
    .use-case-card,
    .range-card,
    .activity-card,
    .price-tier,
    .battery-type,
    .unit-card,
    .feature-card,
    .person-card,
    .example-card,
    .comparison-item,
    .contest-card,
    .project-level,
    .mode-card,
    .community-card,
    .org-card,
    .next-step-card,
    .tip-card,
    .troubleshoot-item,
    .step-card {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .chapter-card-body p,
    .chapter-content > p,
    .exam-card p,
    .stat-label,
    .welcome-item p,
    .use-case-card p,
    .range-card p,
    .activity-card p,
    .feature-card p,
    .person-card p:last-child,
    .example-card p,
    .unit-example,
    .community-card p,
    .next-step-card p,
    .tip-card p,
    .blocker-info p:last-child,
    .step-content p,
    .step-card p,
    .activity-content p {
        color: #a0aec0;
    }
    
    .chapter-topics li {
        color: #cbd5e0;
    }
    
    .chapter-footer,
    .book-intro {
        background: rgba(0, 0, 0, 0.2);
        border-color: var(--border-color);
    }
    
    /* Övningar - Option labels */
    .option-label,
    .answer-option {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .option-label:hover,
    .answer-option:hover {
        background: var(--surface-hover);
        border-color: #63b3ed;
    }
    
    .answer-option.selected {
        background: rgba(66, 153, 225, 0.2);
        border-color: #4299e1;
    }
    
    .answer-option.correct {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .answer-option.incorrect {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    /* Multiple choice knappar */
    .mc-option-btn {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .mc-option-btn:hover:not(:disabled) {
        background: var(--surface-hover);
        border-color: #63b3ed;
    }
    
    .mc-marker {
        background: var(--marker-bg);
        color: var(--text-primary);
    }
    
    .mc-option-btn.correct {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .mc-option-btn.correct .mc-marker {
        background: #48bb78;
        color: white;
    }
    
    .mc-option-btn.incorrect {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    .mc-option-btn.incorrect .mc-marker {
        background: #fc8181;
        color: white;
    }
    
    /* True/False knappar */
    .tf-btn {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .tf-true:hover:not(:disabled) {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .tf-false:hover:not(:disabled) {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    .tf-btn.correct {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .tf-btn.incorrect {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    /* Matching */
    .match-row {
        background: var(--surface);
    }
    
    .match-left {
        background: rgba(66, 153, 225, 0.15);
        color: #90cdf4;
    }
    
    .match-choice {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .match-choice:hover:not(:disabled) {
        background: var(--surface-hover);
        border-color: #63b3ed;
    }
    
    .match-choice.selected {
        background: rgba(66, 153, 225, 0.2);
        border-color: #4299e1;
    }
    
    .match-choice.correct {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .match-choice.incorrect {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    .matching-item {
        background: rgba(66, 153, 225, 0.15);
        color: #90cdf4;
    }
    
    /* Ordering/Timeline */
    .ordering-item,
    .timeline-item {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .ordering-item:hover,
    .timeline-item:hover {
        border-color: #63b3ed;
    }
    
    .ordering-item.dragging,
    .timeline-item.dragging {
        background: rgba(66, 153, 225, 0.2);
        border-color: #4299e1;
    }
    
    .ordering-item.selected-for-swap {
        background: rgba(66, 153, 225, 0.2);
        border-color: #4299e1;
    }
    
    .ordering-item.correct-order,
    .timeline-item.correct-order {
        background: rgba(72, 187, 120, 0.2);
        border-color: #48bb78;
    }
    
    .ordering-item.incorrect-order,
    .timeline-item.incorrect-order {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
    }
    
    .drag-handle {
        color: #718096;
    }
    
    .item-text {
        color: var(--text-primary);
    }
    
    .drag-ghost {
        background: var(--surface);
        border-color: #4299e1;
    }
    
    /* Exercise states */
    .exercise-card.answered-correct,
    .exercise-item.answered-correct {
        background: rgba(72, 187, 120, 0.15);
        border-color: #68d391;
    }
    
    .exercise-card.answered-wrong,
    .exercise-item.answered-wrong {
        background: rgba(245, 101, 101, 0.15);
        border-color: #fc8181;
    }
    
    .exercise-card.reflection-card {
        background: rgba(159, 122, 234, 0.15);
        border-color: #b794f4;
    }
    
    /* Feedback */
    .feedback-correct {
        background: rgba(72, 187, 120, 0.2);
        border-color: #68d391;
        color: #9ae6b4;
    }
    
    .feedback-wrong {
        background: rgba(245, 101, 101, 0.2);
        border-color: #fc8181;
        color: #feb2b2;
    }
    
    .feedback-text.correct {
        color: #9ae6b4;
    }
    
    .feedback-text.incorrect {
        color: #feb2b2;
    }
    
    /* Exercise hints */
    .exercise-hint {
        background: rgba(159, 122, 234, 0.15);
        color: #e2e8f0;
    }
    
    .reflection-hints {
        background: rgba(159, 122, 234, 0.15);
    }
    
    .reflection-hints h5 {
        color: #d6bcfa;
    }
    
    .reflection-hints ul {
        color: #e2e8f0;
    }
    
    .reflection-note {
        color: #b794f4;
    }
    
    /* Exercise results */
    .exercise-results {
        background: rgba(66, 153, 225, 0.15);
        border-color: #4299e1;
    }
    
    .exercise-results h3 {
        color: #90cdf4;
    }
    
    .exercise-results p {
        color: #e2e8f0;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .breadcrumb .current {
        color: #a0aec0;
    }
    
    /* TOC */
    .toc {
        background: var(--surface);
    }
    
    .toc h2 {
        color: #90cdf4;
    }
    
    .toc-list a {
        color: var(--text-primary);
    }
    
    .toc-list a:hover {
        color: #63b3ed;
    }
    
    /* Quiz header */
    .quiz-header {
        background: var(--surface);
    }
    
    .quiz-info-label {
        color: #a0aec0;
    }
    
    .quiz-info-value {
        color: var(--text-primary);
    }
    
    /* Question card */
    .question-card {
        background: var(--surface);
    }
    
    .question-body {
        color: var(--text-primary);
    }
    
    .question-text {
        color: var(--text-primary);
    }
    
    .question-nav {
        background: rgba(0, 0, 0, 0.2);
        border-color: var(--border-color);
    }
    
    /* Question dots */
    .question-dot {
        background: var(--surface);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .question-dot:hover {
        border-color: #63b3ed;
    }
    
    /* Explanation box */
    .explanation-box {
        background: rgba(102, 126, 234, 0.1);
        border-left-color: #667eea;
    }
    
    .explanation-box h4 {
        color: #a3bffa;
    }
    
    .explanation-box p {
        color: #e2e8f0;
    }
    
    /* Result hero */
    .result-hero {
        background: var(--surface);
    }
    
    .result-message {
        color: var(--text-primary);
    }
    
    .result-details {
        border-color: var(--border-color);
    }
    
    .result-detail-value {
        color: var(--text-primary);
    }
    
    .result-detail-label {
        color: #a0aec0;
    }
    
    /* Stats */
    .knowledge-item {
        background: var(--surface);
    }
    
    .knowledge-label {
        color: var(--text-primary);
    }
    
    .progress-bar {
        background: var(--border-color);
    }
    
    .history-list {
        background: var(--surface);
    }
    
    .history-item {
        border-color: var(--border-color);
    }
    
    .history-date {
        color: #a0aec0;
    }
    
    .history-type {
        background: rgba(0, 0, 0, 0.2);
        color: #a0aec0;
    }
    
    /* Badges */
    .badge.easy,
    .difficulty.easy {
        background: rgba(72, 187, 120, 0.2);
        color: #9ae6b4;
    }
    
    .badge.medium,
    .difficulty.medium {
        background: rgba(237, 137, 54, 0.2);
        color: #fbd38d;
    }
    
    .badge.hard,
    .difficulty.hard {
        background: rgba(245, 101, 101, 0.2);
        color: #feb2b2;
    }
    
    .exercise-type {
        background: rgba(0, 0, 0, 0.3);
        color: #a0aec0;
    }
    
    /* Read time */
    .read-time {
        color: #a0aec0;
    }
    
    /* Chapter sections */
    .chapter-section h2,
    .content-section h2 {
        color: #90cdf4;
        border-bottom-color: rgba(99, 179, 237, 0.3);
    }
    
    /* Process steps */
    .process-steps .step-content p,
    .step-guide .step-card p {
        color: #a0aec0;
    }
    
    .step-tip {
        background: rgba(237, 137, 54, 0.15);
        color: #fbd38d;
    }
    
    /* Comparison box */
    .comparison-box {
        background: var(--surface);
    }
    
    .comparison-item {
        background: rgba(0, 0, 0, 0.2);
        border-color: var(--border-color);
    }
    
    .comparison-item h5 {
        color: #90cdf4;
    }
    
    /* Two column */
    .two-column .column h4 {
        color: var(--text-primary);
    }
    
    /* Success/Warning lists */
    .success-list li {
        color: var(--text-primary);
    }
    
    .success-list li::before {
        color: #68d391;
    }
    
    .warning-list li {
        color: var(--text-primary);
    }
    
    .warning-list li::before {
        color: #fc8181;
    }
    
    /* Impact box */
    .impact-box {
        background: rgba(159, 122, 234, 0.15);
        border-color: #b794f4;
    }
    
    .impact-box h4 {
        color: #d6bcfa;
    }
    
    .impact-box ul {
        color: #e2e8f0;
    }
    
    /* Case study */
    .case-study {
        background: var(--surface);
        border-left-color: #4299e1;
    }
    
    .case-study h4 {
        color: #90cdf4;
    }
    
    .case-study p,
    .case-study ul {
        color: #e2e8f0;
    }
    
    /* Unit cards */
    .unit-symbol {
        color: #90cdf4;
    }
    
    .unit-analogy {
        background: rgba(72, 187, 120, 0.15);
        color: #9ae6b4;
    }
    
    /* Band cards */
    .band-card {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .band-content p,
    .band-content ul {
        color: #e2e8f0;
    }
    
    .band-highlight {
        background: rgba(66, 153, 225, 0.15);
    }
    
    .band-highlight p {
        color: #90cdf4;
    }
    
    /* Frequency activities */
    .frequency-activities .activity-card {
        background: var(--surface);
    }
    
    .frequency-activities .activity-card h4 {
        color: #90cdf4;
    }
    
    /* Chaos examples */
    .chaos-item {
        background: rgba(245, 101, 101, 0.15);
        border-color: rgba(252, 129, 129, 0.3);
    }
    
    .chaos-item p {
        color: #feb2b2;
    }
    
    /* Activity showcase */
    .activity-showcase {
        background: var(--surface);
    }
    
    .achievement-box {
        background: rgba(159, 122, 234, 0.15);
        border-color: #b794f4;
    }
    
    .achievement-box h5 {
        color: #d6bcfa;
    }
    
    .achievement-box p {
        color: #e2e8f0;
    }
    
    /* Contest info */
    .contest-info {
        background: var(--surface);
    }
    
    .contest-card {
        background: rgba(0, 0, 0, 0.2);
        border-color: var(--border-color);
    }
    
    .contest-card p {
        color: #a0aec0;
    }
    
    /* Special activities */
    .special-activities {
        background: var(--surface);
    }
    
    .activity-item {
        border-color: var(--border-color);
    }
    
    /* Emergency info */
    .org-card {
        background: rgba(245, 101, 101, 0.15);
        border-color: rgba(252, 129, 129, 0.3);
    }
    
    .org-card h5 {
        color: #feb2b2;
    }
    
    .org-card p {
        color: #fecaca;
    }
    
    /* Troubleshoot */
    .troubleshoot-item .problem {
        background: rgba(237, 137, 54, 0.15);
    }
    
    .troubleshoot-item .problem h4 {
        color: #fbd38d;
    }
    
    .troubleshoot-item .solution {
        background: var(--surface);
    }
    
    .troubleshoot-item .solution li {
        color: #e2e8f0;
    }
    
    /* Blocker items */
    .blocker-item {
        background: var(--surface);
    }
    
    .blocker-info h4 {
        color: var(--text-primary);
    }
    
    /* Rules list */
    .rule-item {
        background: var(--surface);
    }
    
    .rule-content h4 {
        color: var(--text-primary);
    }
    
    .rule-content p {
        color: #a0aec0;
    }
    
    /* Checklist box */
    .checklist-box {
        background: rgba(72, 187, 120, 0.15);
    }
    
    .checklist-box h4 {
        color: #9ae6b4;
    }
    
    .checklist li {
        color: #e2e8f0;
    }
    
    /* Radio etiquette */
    .etiquette-do {
        background: rgba(72, 187, 120, 0.15);
    }
    
    .etiquette-do h4 {
        color: #9ae6b4;
    }
    
    .etiquette-do li {
        color: #e2e8f0;
    }
    
    .etiquette-dont {
        background: rgba(245, 101, 101, 0.15);
    }
    
    .etiquette-dont h4 {
        color: #feb2b2;
    }
    
    .etiquette-dont li {
        color: #e2e8f0;
    }
    
    /* Example conversation */
    .example-conversation {
        background: var(--surface);
    }
    
    .message.incoming {
        background: rgba(0, 0, 0, 0.3);
        color: var(--text-primary);
    }
    
    /* Pro tip */
    .pro-tip {
        background: rgba(33, 150, 243, 0.15);
        border-left-color: #64b5f6;
    }
    
    .pro-tip h4 {
        color: #90caf9;
    }
    
    .pro-tip p {
        color: #e2e8f0;
    }
    
    /* Youth tips */
    .youth-tips {
        background: var(--surface);
    }
    
    .youth-tips li {
        color: #e2e8f0;
    }
    
    /* Books section */
    .book-card {
        background: var(--surface);
    }
    
    .book-intro {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .book-intro h4 {
        color: var(--text-primary);
    }
    
    .book-intro p {
        color: #a0aec0;
    }
    
    .book-meta span {
        background: rgba(0, 0, 0, 0.3);
        border-color: var(--border-color);
        color: #a0aec0;
    }
    
    .chapters-list h4 {
        color: var(--text-primary);
    }
    
    .chapter-link {
        background: rgba(0, 0, 0, 0.2);
        border-color: var(--border-color);
    }
    
    .chapter-link:hover {
        background: rgba(66, 153, 225, 0.15);
    }
    
    .chapter-title {
        color: var(--text-primary);
    }
    
    .chapter-time {
        color: #a0aec0;
    }
    
    /* Bonus book */
    .book-card.bonus-book {
        background: rgba(230, 126, 34, 0.1);
        border-color: #e67e22;
    }
    
    .book-card.bonus-book .book-header {
        background: rgba(230, 126, 34, 0.2);
    }
    
    /* Books divider */
    .books-divider {
        background: var(--surface);
    }
    
    .books-divider.cert-divider {
        background: rgba(231, 76, 60, 0.1);
    }
    
    .divider-text h4 {
        color: var(--text-primary);
    }
    
    .divider-text p {
        color: #a0aec0;
    }
    
    /* Bonus section */
    .bonus-section {
        background: var(--background);
        border-top-color: var(--border-color);
    }
    
    .bonus-header h2 {
        color: var(--text-primary);
    }
    
    .bonus-header p {
        color: #a0aec0;
    }
    
    .bonus-card {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .bonus-title-area h3 {
        color: var(--text-primary);
    }
    
    .bonus-title-area p {
        color: #a0aec0;
    }
    
    .bonus-meta,
    .bonus-meta span {
        color: #cbd5e0;
    }

    
    /* SSA recommendation */
    .ssa-recommendation {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .ssa-recommendation-text h4 {
        color: var(--text-primary);
    }
    
    .ssa-recommendation-text p {
        color: #a0aec0;
    }
    
    /* Exam ready modal */
    .exam-ready-content {
        background: var(--surface);
    }
    
    .exam-ready-content h2 {
        color: var(--text-primary);
    }
    
    .exam-ready-content p {
        color: #a0aec0;
    }
    
    .exam-ready-note {
        background: rgba(0, 0, 0, 0.2);
        color: #a0aec0;
    }
    
    .exam-ready-buttons .btn-secondary {
        background: rgba(0, 0, 0, 0.3);
        color: var(--text-primary);
    }
    
    /* Welcome section */
    .welcome-card {
        background: var(--surface);
    }
    
    .welcome-item {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .welcome-item h3 {
        color: var(--text-primary);
    }
    
    .welcome-item p {
        color: #a0aec0;
    }
    
    /* Länkar */
    a {
        color: #90cdf4;
    }
    
    a:hover {
        color: #63b3ed;
    }
    
    /* Knappar */
    .btn-secondary {
        background: transparent;
        color: #90cdf4;
        border-color: #4299e1;
    }
    
    .btn-secondary:hover {
        background: #4299e1;
        color: #ffffff;
    }
    
    .btn-outline {
        border-color: #667eea;
        color: #a3bffa;
    }
    
    .btn-outline:hover {
        background: #667eea;
        color: #ffffff;
    }
    
    .btn-chapter {
        color: #ffffff;
    }
    
    /* Nav */
    .main-nav {
        background: var(--surface);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .nav-links a {
        color: #a0aec0;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        color: #90cdf4;
        background: rgba(66, 153, 225, 0.15);
    }
    
    .mobile-menu-btn span {
        background: var(--text-primary);
    }
    
    /* Navigation buttons */
    .nav-btn,
    .nav-button {
        background: var(--surface);
        border-color: var(--border-color);
    }
    
    .nav-btn:hover,
    .nav-button:hover {
        border-color: #63b3ed;
    }
    
    .nav-direction {
        color: #90cdf4;
    }
    
    .nav-title {
        color: var(--text-primary);
    }
    
    /* Footer */
    .main-footer,
    footer {
        background: #171923;
    }
    
    .main-footer p,
    footer p {
        color: #a0aec0;
    }
    
    .main-footer a,
    footer a {
        color: #90cdf4;
    }
    
    .footer-note {
        color: #718096;
    }
    
    /* Code */
    code {
        background: rgba(0, 0, 0, 0.3);
        color: #faf089;
    }
    
    pre {
        background: rgba(0, 0, 0, 0.4);
    }
    
    pre code {
        color: #e2e8f0;
    }
    
    /* HR */
    hr {
        border-color: var(--border-color);
    }
    
    /* Small text */
    small,
    .hint,
    .help-text,
    figcaption,
    .table-note {
        color: #a0aec0;

        
    }
}


/* ===========================================
   29. PRINT STYLES
   =========================================== */
@media print {
    /* Dölj interaktiva element */
    .main-nav,
    .mobile-menu-btn,
    .chapter-navigation,
    .next-steps,
    .exercises-section,
    .quiz-container,
    .btn,
    .breadcrumb,
    footer,
    .main-footer {
        display: none !important;
    }
    
    /* Grundläggande */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    /* Ta bort skuggor och rundning */
    .chapter-article,
    .chapter-card,
    .content-box,
    .info-box,
    .tip-box,
    .warning-box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    /* Header */
    .chapter-header,
    .chapter-article .chapter-header {
        background: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .chapter-article .chapter-header h1 {
        color: black !important;
    }
    
    /* Undvik sidbrytning mitt i element */
    .content-section,
    .chapter-section,
    .content-box,
    .formula-box,
    .example-box,
    h1, h2, h3, h4 {
        break-inside: avoid;
    }
    
    /* Visa URL efter länkar */
    a {
        color: black;
        text-decoration: underline;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Interna länkar - visa inte URL */
    a[href^="#"]::after,
    a[href^="/"]::after {
        content: "";
    }
    
    /* Sidmarginaler */
    @page {
        margin: 2cm;
    }
}
}