/* ===================================================================== */
/* 1. VARIABEL & PENGATURAN DASAR
/* ===================================================================== */
/* 1. Definisi Variabel Global (Khusus Halaman Ini) */
:root {
    --primary-color: #0D47A1;
    --secondary-color: #BBDEFB;
    --background-color: #F8F9FA;
    --text-color: #212529;
    --border-color: #DEE2E6;
    
    /* Font Stack: Mengambil dari Global style.min.css */
    --font-latin: 'Poppins', sans-serif;
    --font-sunda: 'Noto Sans Sundanese', 'Noto Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-latin); 
    background-color: var(--background-color); 
    color: var(--text-color); 
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 2. Utility Class Sakti (Terapkan ke HTML mana saja) */
.font-sunda { 
    font-family: var(--font-sunda); 
    
    /* 1. Mendorong rendering ligatures (Aman & Ringan) */
    font-variant-ligatures: common-ligatures contextual;
    -webkit-font-feature-settings: "liga" on, "clig" on;
    font-feature-settings: "liga" on, "clig" on;
    
    /* 2. Menajamkan font (Tanpa shadow berat) khusus layar HD/Mac/iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 3. Kompensasi Ukuran Aksara (Ide Anda: Membesarkan sedikit karena font asli kekecilan) */
    font-size: 1.15em; /* 1.15em lebih aman agar H1 tidak pecah */
    line-height: 1.65; /* Mencegah sandhangan terpotong */
    
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 1. HERO MINI */
.hero-mini {
    background: linear-gradient(135deg, hsla(224, 64%, 33%, 1) 0%, hsla(221, 83%, 53%, 1) 50%, hsla(224, 64%, 33%, 1) 100%);
    color: white;
    padding: 4rem 1rem 5rem 1rem; /* Padding lebih lega */
    margin-bottom: -3rem; /* Overlap effect ke card bawah */
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-mini h1 {
    margin: 0 0 0.8rem 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-mini p {
    opacity: 0.9;
    font-size: 1.15rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 2. LAYOUT GRID */
.content-wrapper {
    padding-bottom: 5rem;
    position: relative;
    z-index: 2; /* Agar di atas hero */
}

/* ===================================================================== */
/* 2. STRUKTUR UTAMA & KARTU
/* ===================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 15px; } 
header { text-align: center; } 
header h1 { color: var(--primary-color); margin-bottom: 5px; font-weight: 600; font-size: 1.8em; } 
header p { color: #6C757D; font-size: 1em; max-width: 600px; margin: 0 auto; }
.main-layout-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.main-content-column, .sidebar-column { display: grid; grid-template-columns: 1fr; gap: 20px; align-content: start; }
.card { background-color: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 25px rgba(0,0,0,0.08); border: 1px solid var(--border-color); }
.card h2 { margin-top: 0; color: var(--primary-color); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; font-size: 1.4em; }
/* ===================================================================== */
/* 4. ALAT TRANSLITERASI
/* ===================================================================== */
.io-container { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 15px; } 
textarea, .output-box { width: 100%; height: 250px; padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; resize: vertical; transition: all 0.2s ease; }
textarea:focus, .output-box:focus, textarea:hover, .output-box:hover { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--secondary-color); }
textarea::placeholder { color: #ADB5BD; opacity: 1; font-size: 15px; }
.output-box { background-color: #F8F9FA; overflow-y: auto; font-size: 22px; line-height: 1.8; }
.output-box .word { cursor: pointer; position: relative; transition: background-color 0.2s ease; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.output-box .word:hover { background-color: var(--secondary-color); }
.word-tooltip { 
    position: absolute; 
    background: #FFFFFF;
    color: var(--text-color);
    padding: 12px 16px; 
    border-radius: 12px;
    font-size: 14px; 
    font-family: var(--font-latin); 
    z-index: 1000; 
    pointer-events: none; 
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 10px 30px -5px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.word-tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}
.tooltip-title {
    font-weight: 500;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.word-tooltip .tooltip-analysis {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.word-tooltip .tooltip-item {
    display: inline-flex;
    flex-direction: column;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--background-color);
    text-align: center;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.word-tooltip .tooltip-item .sunda {
    font-size: 1.2em;
    font-family: var(--font-sunda);
    color: var(--text-color);
}
.word-tooltip .tooltip-item .latin {
    font-size: 0.75em;
    color: #6C757D;
}
.controls { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 20px; }
.controls .radio-group-wrapper { display: flex; flex-wrap: wrap; gap: 15px; }
.controls label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.pemisah { font-family: var(--font-latin); color: #6C757D; font-weight: 500; margin: 0 4px; }

/* ==========================================================================
   SLIDER CONTOH TULISAN & UNGKAPAN
   ========================================================================== */
#example-content-wrapper {
    position: relative;
    min-height: 140px;
    overflow: hidden;
}

.example-slide {
    display: none;
    cursor: pointer;
    animation: fadeInSlide 0.3s ease-in-out;
}

.example-slide.active {
    display: block;
}

/* Desain Kotak Detail Contoh */
.example-detail-card {
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

/* Efek Hover pada Kotak */
.example-slide:hover .example-detail-card {
    background-color: #eff6ff; /* Biru sangat muda */
    border-left: 4px solid var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -5px rgba(37, 99, 235, 0.1); /* Bayangan biru elegan */
}

/* Struktur Baris (Paksa kiri-kanan rapi) */
.ex-row {
    display: flex;
    flex-direction: row; 
    align-items: flex-start;
    margin-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 10px;
    gap: 15px;
}

.ex-row:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Label & Konten */
.ex-label { 
    font-weight: 600; 
    font-size: 0.85em; 
    color: var(--primary-color); 
    width: 90px; /* Lebar absolut agar sejajar vertikal */
    flex-shrink: 0; 
    position: relative; 
    margin-top: 2px;
}
.ex-label::after { content: ":"; position: absolute; right: 0; }

.ex-content {
    flex: 1 1 auto; 
    min-width: 0; 
    word-break: break-word; 
    text-align: left;
}

/* Tipografi Khusus */
.ex-sunda-text {
    font-size: 26px; /* Lebih besar agar aksara jelas */
    color: var(--primary-color);
    line-height: 1.4;
    display: block;
}

.ex-latin-text {
    font-weight: 600;
    color: #1e293b;
    display: block;
    font-size: 15px;
}

.ex-arti-text {
    font-size: 0.9em;
    color: #64748b;
    font-style: italic;
    display: block;
}

/* Tombol Ajak Klik (Pulse Animation) */
.ex-cta-text {
    margin-top: 15px;
    text-align: center;
    font-size: 0.85em;
    color: #ffffff;
    background-color: var(--primary-color); /* Biru lebih terang */
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    width: 100%;
}

.pulse-animation {
    animation: pulseBtn 2s infinite;
}

/* Keyframes */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseBtn {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}


/* ===================================================================== */
/* 5. KEYBOARD VIRTUAL
/* ===================================================================== */
.keyboard-caption { text-align: center; margin-top: 35px; margin-bottom: 15px; color: #6C757D; font-weight: 500; font-size: 1em; }

/* === DESAIN TAB GARIS BAWAH (FINAL & DIREKOMENDASIKAN) === */

/* 1. Wadah untuk semua tab */
.tabs {
    display: flex;
    overflow-x: auto;
    /* Menghilangkan scrollbar untuk estetika */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
    display: none;
}

/* 2. Tombol tab individual */
.tab-button {
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 10px 16px;
    
    /* Semua tab memiliki border bawah abu-abu tipis */
    border-bottom: 1px solid var(--border-color);
    
    /* Gaya teks default untuk tab tidak aktif */
    color: #6C757D;
    font-weight: 500;
    font-size: 0.9em;
    white-space: nowrap;
    transition: color 0.2s ease-in-out;
}

/* 3. Efek saat kursor di atas tab */
.tab-button:hover {
    color: var(--primary-color);
}

/* 4. Gaya untuk tab yang AKTIF */
.tab-button.active {
    /* Timpa border bawah dengan warna primer dan ketebalan yang berbeda */
    border-bottom: 3px solid var(--primary-color);
    
    /* Gaya teks untuk tab aktif */
    color: var(--primary-color);
    font-weight: 600;
}
.tab-content { display: none; } 
.tab-content.active { display: block; padding-top: 15px; }
.keyboard-row { display: flex; justify-content: center; gap: 5px; margin-bottom: 5px; flex-wrap: wrap; }
.key { background-color: #fff; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; gap: 2px; transition: all 0.2s ease; flex-grow: 1; flex-shrink: 1; flex-basis: 0; padding: 5px; min-width: 28px; }
.key:hover { background-color: var(--secondary-color); }
.key .sunda { font-family: var(--font-sunda); font-size: 22px; line-height: 1; }
.key .latin { font-family: var(--font-latin); font-size: 10px; color: #6C757D; line-height: 1; }
/* ===================================================================== */
/* 6. KONTEN INFORMASI & EDUKATIF
/* ===================================================================== */
#aksara-hari-ini .aksara { font-family: var(--font-sunda); font-size: clamp(4em, 15vw, 6em); text-align: center; color: var(--primary-color); line-height: 1.5; }
#aksara-hari-ini h3 { margin-top: 0; margin-bottom: 8px; font-size: 1.5em; color: var(--primary-color); }
.contoh-fokus { background-color: #F8F9FA; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; }
.analysis-container { margin-top: 0; padding: 15px; background-color: #F8F9FA; border-radius: 8px; min-height: 50px; display: flex; flex-wrap: wrap; gap: 5px; }
.analysis-item { display: inline-flex; flex-direction: column; padding: 5px 10px; border: 1px solid #ccc; border-radius: 5px; background: white; text-align: center; }
.analysis-item .sunda { font-size: 1.2em; } 
.analysis-item .latin { font-size: 0.8em; color: #555; }
.analysis-item .type { font-size: 0.7em; color: var(--primary-color); font-style: italic; }
.info-list { list-style: none; padding-left: 0; } 
.info-list li { padding-left: 1.5em; position: relative; margin-bottom: 10px; } 
.info-list li::before { content: '✓'; color: var(--primary-color); font-weight: bold; position: absolute; left: 0; }
.faq-item { border-bottom: 1px solid var(--border-color); } 
.faq-question { padding: 15px 0; font-weight: 600; cursor: pointer; position: relative; } 
.faq-question::after { content: '+'; position: absolute; right: 5px; font-size: 1.2em; transition: transform 0.2s ease; } 
.faq-question.active::after { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in-out; } 
.faq-answer p { padding-bottom: 15px; margin: 0; }
.example-list { display: flex; flex-direction: column; gap: 16px; }
.example-item { background-color: #f8f9fa; border-left: 4px solid var(--primary-color); padding: 12px 16px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; }
.example-item:hover { background-color: #E3F2FD; transform: translateY(-2px); }
/* .ex-row { display: flex; align-items: center; gap: 10px; } */
/* .ex-label { font-weight: 500; font-size: 0.8em; color: var(--primary-color); width: 90px; flex-shrink: 0; position: relative; } */
/* .ex-label::after { content: ":"; position: absolute; right: 0; } */
/* .ex-content.ex-sunda { font-size: 1.4em; overflow-wrap: break-word; word-break: break-all; } */
.tip-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.tip-example { background-color: var(--background-color); border: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04); padding: 15px; border-radius: 8px; text-align: center; border-left-width: 4px; border-left-style: solid; }
.tip-label { font-weight: 600; font-size: 0.8em; display: block; margin-bottom: 10px; }
.tip-benar { border-left-color: #28a745; }
.tip-benar .tip-label { color: #28a745; }
.tip-salah { border-left-color: #dc3545; }
.tip-salah .tip-label { color: #dc3545; }
.tip-text-container { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-height: 60px; }
.tip-sunda-text, .tip-latin-text { margin: 0; }
.tip-sunda-text { font-size: 1.6em; overflow-wrap: break-word; word-break: break-all; }
.tip-latin-text { font-size: 0.85em; color: #6C757D; font-style: italic; }
.tip-carousel-header { text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.tip-carousel-header h2 { border-bottom: none; padding-bottom: 0; }
#tip-content-wrapper { min-height: 250px; display: flex; flex-direction: column; justify-content: center; transition: opacity 0.2s ease-in-out; }
.tip-content-fade-out { opacity: 0; }
.tip-carousel-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border-color); padding-top: 15px; margin-top: 20px; }
.tip-nav-btn-new { background-color: transparent; border: 1px solid var(--border-color); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; transition: all 0.2s ease; }
.tip-nav-btn-new:hover { background-color: var(--secondary-color); border-color: var(--primary-color); }
.tip-nav-btn-new svg { width: 24px; height: 24px; fill: var(--primary-color); }
#tip-counter { font-size: 0.9em; font-weight: 500; color: #6C757D; flex-shrink: 0; }
.tip-progress-container { flex-grow: 1; width: 100%; height: 6px; background-color: #e9ecef; border-radius: 3px; overflow: hidden; }
#tip-progress-bar { width: 0%; height: 100%; background-color: var(--primary-color); border-radius: 3px; transition: width 0.3s ease; }
/* ===================================================================== */
/* 7. FITUR & KONTROL TAMBAHAN
/* ===================================================================== */
.control-deck { background-color: #FFFFFF; border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-top: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.deck-title {
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 1.3em;
	font-weight: 600;
	color: var(--primary-color);
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-color);
}
.features-cohesive { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: stretch; }
.btn-cohesive { display: flex; align-items: center; justify-content: center; width: 100%; background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 10px 16px; cursor: pointer; gap: 10px; color: #495057; font-size: 14px; font-family: var(--font-latin); font-weight: 500; text-decoration: none; white-space: nowrap; transition: all 0.2s ease-in-out; }
.btn-cohesive:hover { border-color: #ced4da; background-color: #e9ecef; color: #212529; }
.btn-cohesive svg { width: 18px; height: 18px; color: #6c757d; transition: color 0.2s ease-in-out; flex-shrink: 0; }
.btn-cohesive:hover svg { color: #212529; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 2000; padding: 15px; }
.modal-content { background-color: white; padding: 25px; border-radius: 12px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2em; cursor: pointer; color: #888; }
.quiz-container { display: flex; flex-direction: column; gap: 15px; }
#quiz-question-text { font-size: 1.2em; }
#quiz-input { flex-grow: 1; font-size: 1.2em; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; }
/* [PERBAIKAN] Mengatur gaya spesifik untuk placeholder pada input kuis */
#quiz-input::placeholder {
    /* Gunakan ukuran font yang lebih kecil, sama seperti placeholder input Latin */
    font-size: 15px; 
    
    /* [PENTING] Setel opasitas menjadi 1 agar terlihat jelas di semua browser */
    opacity: 1; 
    
    /* Warna abu-abu yang lebih lembut, standar untuk placeholder */
    color: #ADB5BD;
}

/* Fallback untuk browser lama (opsional tapi direkomendasikan) */
#quiz-input:-ms-input-placeholder { 
    font-size: 15px;
    color: #ADB5BD;
}
#quiz-input::-ms-input-placeholder { 
    font-size: 15px;
    color: #ADB5BD;
}
.quiz-feedback { padding: 10px; border-radius: 6px; display: none; }
.quiz-feedback.correct { background-color: #d4edda; color: #155724; }
.quiz-feedback.incorrect { background-color: #f8d7da; color: #721c24; }
footer { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 0.9em; color: #6C757D; }
.collection-list { margin-top: 20px; display: grid; grid-template-columns: 1fr; gap: 15px; }
.collection-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; position: relative; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; }
.collection-item:hover { background-color: #F8F9FA; transform: translateY(-2px); }
.collection-item .c-sunda { font-size: 1.5em; font-family: var(--font-sunda); margin-bottom: 8px; display: block; color: var(--primary-color); }
.collection-item .c-latin { font-size: 0.9em; font-weight: 500; color: var(--text-color); }
.collection-item-delete { position: absolute; top: 8px; right: 8px; background: #F8D7DA; color: #721C24; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2em; opacity: 0; transition: opacity 0.2s ease; }
.collection-item:hover .collection-item-delete { opacity: 1; }
.share-options { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 10px; 
    margin-top: 20px; 
}
.share-option-btn { 
    display: block; 
    padding: 12px 15px; 
    border-radius: 8px; 
    text-align: center; 
    font-weight: 500; 
    text-decoration: none; 
    color: #fff; 
    transition: transform 0.2s ease, opacity 0.2s ease; 
}
.share-option-btn:hover { 
    transform: scale(1.03); 
    opacity: 0.9; 
}
.share-option-btn.whatsapp { background-color: #25D366; }
.share-option-btn.telegram { background-color: #0088cc; }
.share-option-btn.twitter  { background-color: #1DA1F2; }
.share-option-btn.facebook { background-color: #1877F2; }
.share-option-btn.copy-link { 
    background-color: #6c757d; 
    border: none; 
    width: 100%; 
    font-family: var(--font-latin); 
    font-size: 14px; 
    cursor: pointer; 
}

.glossary-section { 
    margin-bottom: 25px; 
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
.glossary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.glossary-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 10px; 
}
.glossary-item { 
    background-color: #f8f9fa; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 10px; 
    text-align: center; 
}
.glossary-item .g-sunda { 
    font-family: var(--font-sunda); 
    font-size: 2em; 
    display: block;
    color: var(--primary-color);
}
.glossary-item .g-latin { 
    font-size: 0.9em; 
    color: #555; 
}

/* ===================================================================== */
/* 8. MEDIA QUERIES (BREAKPOINTS RESPONSIVE & ANTI-OVERFLOW)
/* ===================================================================== */

/* --- RESET & PERATURAN ANTI-BOCOR GLOBAL --- */
* {
    box-sizing: border-box; 
}
.card {
    max-width: 100%;
    overflow: hidden; /* Mencegah elemen dalam card meluber ke luar */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ---- UNTUK LAYAR TABLET (>= 768px) ---- */
@media (min-width: 768px) {
    .container { padding: 0 20px; }
    header { padding-top: 20px; }
    header h1 { font-size: 2.2em; }
    textarea, .output-box { font-size: 18px; }
    .key { flex-basis: 40px; }
    .controls { flex-direction: row; align-items: center; gap: 10px; }
    .collection-list {
        grid-template-columns: 1fr 1fr;
    }    
}

/* ---- UNTUK LAYAR DESKTOP (>= 1024px) ---- */
@media (min-width: 1024px) {
    .container { padding: 0 15px; }
    header h1 { font-size: 2.5em; }
    .io-container { grid-template-columns: 1fr 1fr; }
    .card { padding: 25px 30px; }
    textarea, .output-box { height: 280px; }
    .main-layout-grid {
        grid-template-columns: 2fr 1fr;
        gap: 20px;
    }
}

/* --- UNTUK LAYAR TABLET (<= 768px) --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; overflow-x: hidden; }
    header h1 { font-size: 1.8em; }
    .card { padding: 18px; }
    
    /* Arah Transliterasi */
    .radio-group-wrapper { display: flex; flex-direction: column; gap: 10px; width: 100%; }

}

/* --- UNTUK LAYAR MOBILE & HP KECIL (<= 480px) --- */
@media (max-width: 480px) {
    header h1 { font-size: 1.5em; }
    .card { padding: 15px; }

    /* 1. TOOLS & PENGATURAN (Paksa 1 Kolom & Teks Tombol Boleh Turun) */
    .features-cohesive { 
        grid-template-columns: 1fr 1fr;
        /* grid-template-columns: 1fr !important; /* Wajib 1 Kolom */
        gap: 10px;
    }
    .btn-cohesive {
        white-space: normal !important; /* Izinkan teks tombol turun/membungkus */
        height: auto;
        padding: 12px 10px;
        text-align: center;
        justify-content: inherit;
    }

    /* 3. UJI KEMAMPUAN: KUIS CEPAT (Aman dari dorongan input) */
    .quiz-container { display: flex; flex-direction: column; width: 100%; gap: 10px; }
    .quiz-question-wrapper { width: 100%; word-wrap: break-word; }
    .quiz-input-wrapper { width: 100%; display: flex; flex-direction: column; gap: 5px; }
    #quiz-input { 
        width: 100% !important; 
        max-width: 100% !important; 
        box-sizing: border-box !important; 
        font-size: 1rem;
    }
    .quiz-controls { width: 100%; display: block; }
    .quiz-controls button { width: 100%; margin-top: 5px; }

    /* 4. KEYBOARD VIRTUAL (Lebih elastis) */
    .keyboard-row { flex-wrap: wrap; gap: 4px; }
    .key { 
        flex: 1 1 12%; /* Biarkan menyusut otomatis */
        min-width: 0 !important; /* Hilangkan paksaan lebar minimum */
        padding: 6px 2px; 
        min-height: 44px; 
    }
    .key .sunda { font-size: 18px; }
    .key .latin { font-size: 8px; }
    
    /* 5. TABS (Analisis & Keyboard) */
    .tabs { flex-wrap: wrap; justify-content: center; }
    .tab-button { flex: 1 1 30%; text-align: center; padding: 8px; font-size: 0.8em; white-space: normal; }

    /* 6. AKSARA HARI INI */
    #aksara-hari-ini .aksara { font-size: 3.5em; line-height: 1.2; }
    .breakdown-contoh { display: flex; flex-direction: column; align-items: center; gap: 5px; }
    .panah { transform: rotate(90deg); margin: 5px 0; } /* Panah menunjuk ke bawah di HP */

    /* 7. SHARE MODAL */
    .share-options { grid-template-columns: 1fr; }
}