/* DIWARU KHI - Components CSS
 * Paket awal WP-2C: tombol dan info badge yang sudah stabil.
 */

.info-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.info-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.info-badge-label {
    opacity: 0.9;
    font-weight: 500;
}

.info-badge-value {
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.info-badge.berkas,
.info-badge.status-draft,
.info-badge.status-approved,
.info-badge.save-unsaved,
.info-badge.save-saved {
    background: rgba(255, 255, 255, 0.95);
    color: #047857;
    border-color: #d4af37;
}

.btn {
    border: 0;
    min-height: 44px;
    min-width: 44px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: #fff;
    box-shadow: 0 8px 20px rgba(4, 120, 87, .2);
    border: 1px solid rgba(212, 175, 55, .3);
}

.btn-primary:hover {
    box-shadow: 0 12px 28px rgba(4, 120, 87, .3);
    background: linear-gradient(135deg, var(--primary2), var(--gold-dark));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--bg1), var(--bg2));
    color: #fff;
    box-shadow: 0 8px 20px rgba(4, 120, 87, .15);
    border: 1px solid var(--gold);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg2), var(--gold-dark));
}

.btn-ghost {
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--line);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, .15);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 8px 20px rgba(22, 163, 74, .15);
}

.btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    opacity: .95;
}

.btn-close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
}

.btn-close:hover {
    background: #fee;
    border-color: #fcc;
    color: #c00;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.meta code {
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 4px 8px;
    border-radius: 10px;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.badge b {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, .25);
    font-size: 11px;
    font-weight: 700;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.action-buttons-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.step4-confirm-card {
    margin-top: 16px;
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 251, 235, .98), rgba(255, 255, 255, .96));
    box-shadow: 0 12px 28px rgba(4, 120, 87, .08);
    overflow: hidden;
}

.step4-confirm-head {
    padding: 16px 18px 8px;
}

.step4-confirm-head h3 {
    margin: 0 0 8px;
    color: #854d0e;
}

.step4-confirm-copy {
    color: #475569;
    line-height: 1.7;
}

.step4-confirm-summary {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.step4-confirm-item {
    border: 1px solid rgba(209, 213, 219, .9);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
}

.step4-confirm-item strong {
    display: block;
    margin-bottom: 6px;
}

.step4-confirm-meta {
    display: grid;
    gap: 4px;
    color: #475569;
    font-size: 13px;
}

.step4-confirm-empty {
    padding: 0 18px 18px;
    color: #64748b;
}

.step4-confirm-actions {
    border-top: 1px solid rgba(212, 175, 55, .22);
    background: rgba(255, 255, 255, .86);
    padding: 16px 18px 18px;
    display: grid;
    gap: 12px;
}

.step4-confirm-question {
    font-weight: 700;
    color: #0f172a;
}

.step4-confirm-choice {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.step4-confirm-choice .btn.active {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, .28);
}

.step4-confirm-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248, 250, 252, .9);
    border: 1px solid rgba(209, 213, 219, .85);
}

.step4-confirm-check input {
    margin-top: 3px;
}

.step4-confirm-status {
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

.step4-confirm-status strong {
    color: #0f172a;
}

@media (max-width: 768px) {
    .info-badges-container {
        flex-direction: column;
        gap: 6px;
    }

    .info-badge {
        width: 100%;
        justify-content: center;
    }
}

.step2-top {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: space-between;
}

.step2-top .left {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
}

.step2-top .right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.step2-shell {
    border: 1px solid rgba(209, 250, 229, .9);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(240, 253, 244, .92));
    box-shadow: 0 14px 32px rgba(4, 120, 87, .10);
    padding: 14px;
    margin-bottom: 14px;
}

.step2-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 8px;
}

.step2-search-block {
    display: grid;
    gap: 8px;
}

.step2-search-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #1f2937;
}

.step2-search-hints {
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.step2-mode-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.step2-mode-btn {
    flex: 1 1 240px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.step2-mode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
}

.step2-mode-btn.active {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(4, 120, 87, .10), rgba(212, 175, 55, .12));
    box-shadow: 0 10px 26px rgba(4, 120, 87, .12);
}

.step2-mode-btn:not(.active) {
    opacity: .88;
}

.step2-mode-title {
    display: block;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 4px;
}

.step2-mode-desc {
    display: block;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.step2-panel {
    display: none;
}

.step2-panel.active {
    display: block;
}

.step2-checklist-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
    border: 1px solid rgba(209, 250, 229, .9);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, .06);
    padding: 14px;
}

.step2-checklist-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.step2-checklist-title {
    font-size: 16px;
    font-weight: 800;
    color: #14532d;
    margin-bottom: 4px;
}

.step2-checklist-subtitle {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 620px;
}

.step2-bottom-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .step2-top {
        flex-direction: column;
    }

    .step2-top .left,
    .step2-top .right {
        width: 100%;
    }

    .step2-top .right,
    .step2-checklist-head,
    .step2-bottom-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .step2-top .right .badge,
    .step2-top .right .btn,
    .step2-mode-btn,
    .step2-bottom-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content {
        max-width: none;
        max-height: min(88dvh, 720px);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .modal-header,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .badge {
        font-size: 12px;
        padding: 8px 10px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .chip {
        font-size: 11px;
        padding: 4px 8px;
        white-space: normal;
        text-align: center;
    }

    .hint {
        font-size: 12px;
    }

    .content {
        padding: 18px 16px 24px;
    }

    .item {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
        padding: 14px 12px;
    }

    .list {
        padding: 10px;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .subhead {
        font-size: 13px;
    }

    .qty input {
        width: 56px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90dvh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(79, 70, 229, .05), rgba(124, 58, 237, .05));
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.step2-mode-confirm-content {
    max-width: 520px;
}

.step2-mode-confirm-body p {
    margin: 0;
    color: #334155;
    line-height: 1.7;
}

.step2-mode-confirm-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    background: #f8fafc;
}

.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header-flex h3 {
    margin: 0;
}

.chip {
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 600;
    background: #f8fafc;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.6;
    font-weight: 400;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
}

.surat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.storage-info {
    margin-top: 10px;
}

.storage-bar {
    width: 100%;
    height: 24px;
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 12px;
}

.storage-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.storage-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.storage-stats {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.storage-warning {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.saved-list {
    max-height: 400px;
    overflow-y: auto;
}

.saved-item {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.2s ease;
}

.saved-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.saved-item-info {
    flex: 1;
    min-width: 0;
}

.saved-item-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.saved-item-meta {
    font-size: 11px;
    color: var(--muted);
}

.saved-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.content {
    padding: 26px 28px 32px;
}

.subhead {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 18px;
    line-height: 1.6;
    font-weight: 500;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.group {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
    margin-bottom: 14px;
}

.group-title {
    background:
        linear-gradient(135deg, var(--primary), var(--primary2)),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, .05) 10px, rgba(255, 255, 255, .05) 20px);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 800;
    margin-bottom: 12px;
}

.group-title small {
    font-weight: 650;
    opacity: .9;
    font-size: 11px;
}

.list {
    margin-top: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 12px;
    background: #f8fafc;
}

.item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.heir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.heir-item {
    border: 1px solid var(--line);
    background: #f0fdf4;
    border-radius: 8px;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.heir-item[data-key="awp_laki"],
.heir-item[data-key="awp_perempuan"] {
    border: 2px solid var(--gold) !important;
    background: linear-gradient(135deg, rgba(212, 175, 55, .12), rgba(212, 175, 55, .08)) !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, .15) !important;
    position: relative;
}

.heir-item[data-key="awp_laki"]::before,
.heir-item[data-key="awp_perempuan"]::before {
    content: "AWP";
    position: absolute;
    top: -8px;
    right: 10px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    letter-spacing: .04em;
}

.heir-item[data-key="awp_laki"]:hover,
.heir-item[data-key="awp_perempuan"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, .25) !important;
}

.heir-item[data-key="awp_laki"] .heir-label,
.heir-item[data-key="awp_perempuan"] .heir-label {
    color: var(--gold-dark);
    font-weight: 800;
}

.heir-item[data-key="awp_laki"] .heir-check,
.heir-item[data-key="awp_perempuan"] .heir-check {
    accent-color: var(--gold);
    width: 20px;
    height: 20px;
}

.heir-item.disabled {
    opacity: .55;
    background: #f7f7f7;
    border-color: #e2e8f0;
}

.heir-check {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.heir-label {
    flex: 1 1 auto;
    font-weight: 750;
    font-size: 13px;
    line-height: 1.35;
}

.heir-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
}

.heir-ref {
    font-size: 11px;
    color: var(--muted);
    font-weight: 650;
}

.qty {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
    color: #0f172a;
}

.qty-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.qty input {
    width: 64px;
    padding: 10px 10px;
    text-align: center;
    border-radius: 10px;
}

.qty input:disabled {
    background: #f1f5f9;
    color: #334155;
}

/* --------------------------------------------------------
 * Toggle ayat (q-toggle) — dipindah dari inline <style> HTML
 * -------------------------------------------------------- */
.q-toggle summary {
    list-style: none;
}

.q-toggle summary::-webkit-details-marker {
    display: none;
}

.q-toggle .chev {
    transition: transform .2s ease;
}

.q-toggle[open] .chev {
    transform: rotate(180deg);
}

/* Ayat Arab */
.ayah-ar {
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 14px;
    padding: 14px 14px;
    margin-top: 10px;
    overflow-x: auto;
}

.ayah-ar .ar {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    font-size: 22px;
    line-height: 2.35;
    letter-spacing: .2px;
    color: #f8fafc;
    font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Noto Kufi Arabic", "Arial", sans-serif;
}

.ayah-ar.long {
    max-height: 190px;
    overflow-y: auto;
}

/* Terjemahan */
.ayah-id {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.75;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 12px;
    padding: 10px 12px;
}

/* Label kecil */
.ayah-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ayah-tag {
    font-size: 11px;
    color: #64748b;
}

/* --------------------------------------------------------
 * Wizard KHI (step 2) — dipindah dari inline <style> HTML
 * -------------------------------------------------------- */
.wizard-khi-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 12px 28px rgba(4, 120, 87, .08);
    margin-bottom: 14px;
}

.wizard-khi-head {
    margin-bottom: 18px;
}

.wizard-khi-progress {
    margin-bottom: 16px;
}

.wizard-khi-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}

.wizard-khi-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #dcfce7;
    overflow: hidden;
}

.wizard-khi-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transition: width .2s ease;
}

.wizard-khi-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(4, 120, 87, .08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.wizard-khi-question {
    font-size: 21px;
    line-height: 1.35;
    font-weight: 800;
    margin-bottom: 10px;
    color: #064e3b;
}

.wizard-khi-detail {
    font-size: 13px;
    line-height: 1.65;
    color: #334155;
    margin-bottom: 16px;
}

.wizard-khi-body {
    display: grid;
    gap: 14px;
}

.wizard-khi-answer-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.wizard-khi-answer-btn {
    flex: 1 1 180px;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: .18s ease;
    color: var(--text);
}

.wizard-khi-answer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(2, 6, 23, .08);
}

.wizard-khi-answer-btn.selected-ya {
    background: linear-gradient(135deg, #047857, #059669);
    border-color: #047857;
    color: #fff;
}

.wizard-khi-answer-btn.selected-tidak {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.wizard-khi-jumlah {
    display: none;
    border: 1px dashed #a7f3d0;
    border-radius: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, .9);
    margin-bottom: 16px;
}

.wizard-khi-jumlah.visible {
    display: block;
}

.wizard-khi-jumlah-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wizard-khi-jumlah-item {
    flex: 1 1 180px;
}

.wizard-khi-jumlah-item label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
}

.wizard-khi-jumlah-item input {
    width: 100%;
}

.wizard-khi-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-khi-nav-left,
.wizard-khi-nav-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.wizard-khi-summary {
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(212, 175, 55, .10), rgba(255, 255, 255, .95));
    padding: 16px;
}

.wizard-khi-summary h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #854d0e;
}

.wizard-khi-summary-list {
    display: grid;
    gap: 8px;
}

.wizard-khi-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(212, 175, 55, .24);
    font-size: 13px;
}

.wizard-khi-empty {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

/* --------------------------------------------------------
 * Toggle / Switch UI
 * -------------------------------------------------------- */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    user-select: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 11px;
    white-space: nowrap;
}

.toggle input {
    display: none;
}

.switch {
    width: 34px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 999px;
    position: relative;
    transition: background .2s ease;
    flex: 0 0 auto;
}

.switch::after {
    content: "";
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 999px;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform .2s ease;
    box-shadow: 0 6px 16px rgba(2, 6, 23, .15);
    border: 1px solid rgba(2, 6, 23, .08);
}

.toggle input:checked + .switch {
    background: rgba(22, 163, 74, .35);
}

.toggle input:checked + .switch::after {
    transform: translateX(16px);
}

/* --------------------------------------------------------
 * AW Card (step 4) + Checkline
 * -------------------------------------------------------- */
.aw-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, .06);
}

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

.aw-head h4 {
    font-size: 14px;
}

.aw-head .chip {
    background: rgba(79, 70, 229, .10);
    border-color: rgba(79, 70, 229, .20);
    color: var(--primary);
}

.checkline {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(245, 158, 11, .25);
    background: rgba(245, 158, 11, .10);
}

.checkline input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: 0 0 18px;
    accent-color: var(--primary);
}

.checkline-copy {
    display: grid;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.checkline label {
    margin: 0;
    font-weight: 700;
}

.checkline-copy label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
    line-height: 1.4;
}

.checkline p {
    margin: 0;
    color: #92400e;
    font-size: 11px;
    line-height: 1.45;
}

/* --------------------------------------------------------
 * Golongan header (step 3) + AWP builder
 * -------------------------------------------------------- */
.golongan-header {
    border-radius: 8px;
    padding: 14px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: 0 12px 28px rgba(2, 6, 23, .10);
    margin-top: 10px;
}

.golongan-title {
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 6px;
}

.golongan-desc {
    font-size: 12px;
    opacity: .95;
    line-height: 1.45;
}

.awp-case {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    margin-top: 10px;
}

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

.awp-case-head b {
    font-size: 13px;
}

.mini {
    font-size: 11px;
    color: var(--muted);
    font-weight: 650;
}

/* --------------------------------------------------------
 * Warning box
 * -------------------------------------------------------- */
.warning-box {
    border: 1px solid rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .10);
    color: #92400e;
    border-radius: 16px;
    padding: 14px 16px;
    margin: 14px 0 16px;
}

.warning-box h3 {
    margin: 0 0 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #92400e;
}

.warning-box p {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.55;
}

.warning-box ul {
    margin: 6px 0 10px 18px;
    font-size: 12px;
    line-height: 1.55;
}

.warning-box li {
    margin: 4px 0;
}

.warning-box .danger-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, .10);
    border: 1px solid rgba(239, 68, 68, .25);
    color: #991b1b;
    font-weight: 800;
    font-size: 12px;
}

/* --------------------------------------------------------
 * Basmalah (KHI)
 * -------------------------------------------------------- */
.basmalah-container {
    text-align: center;
    padding: 20px 16px;
    margin: -10px -12px 24px;
    background: linear-gradient(135deg, rgba(4, 120, 87, .08), rgba(212, 175, 55, .08));
    border: 2px solid var(--gold);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.basmalah-container::before {
    content: '*';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 120px;
    opacity: 0.05;
    color: var(--primary);
}

.basmalah-container::after {
    content: '*';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 120px;
    opacity: 0.05;
    color: var(--primary);
}

.basmalah-text {
    font-family: 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(4, 120, 87, .1);
    letter-spacing: 2px;
}

.basmalah-translation {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.3px;
}

/* --------------------------------------------------------
 * Portal back button
 * -------------------------------------------------------- */
.portal-back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10020;
    min-height: 46px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.96);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(30, 41, 59, 0.95));
    color: #f8fafc;
    text-decoration: none;
    font: 700 14px/1.2 ui-sans-serif, system-ui, sans-serif;
    letter-spacing: 0.1px;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.26), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.portal-back-btn:hover,
.portal-back-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.34), 0 0 0 3px rgba(212, 175, 55, 0.16);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.99), rgba(30, 41, 59, 0.98));
    outline: none;
}

.portal-back-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

body.has-last-memory-banner .portal-back-btn {
    top: 84px;
}

@media (max-width: 768px) {
    .portal-back-btn {
        top: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        justify-content: center;
        padding: 11px 16px;
        border-radius: 12px;
        font-size: 13px;
    }

    body.has-last-memory-banner .portal-back-btn {
        top: 96px;
    }
}

@media (max-width: 480px) {
    body.has-last-memory-banner .portal-back-btn {
        top: 108px;
    }
}

/* --------------------------------------------------------
 * Responsive — komponen yang dipindah dari inline HTML
 * -------------------------------------------------------- */
@media (max-width: 768px) {
    .toggle {
        white-space: normal;
        text-align: center;
        padding: 8px 12px;
        justify-content: center;
        width: 100%;
        font-size: 12px;
    }

    .golongan-header {
        padding: 12px;
    }

    .golongan-title {
        font-size: 13px;
    }

    .golongan-desc {
        font-size: 11px;
    }

    .basmalah-container {
        margin: -8px -8px 16px;
        padding: 16px 12px;
    }

    .basmalah-text {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .basmalah-translation {
        font-size: 11px;
    }

    .awp-case {
        padding: 10px;
    }

    .awp-case-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .wizard-khi-nav,
    .wizard-khi-nav-left,
    .wizard-khi-nav-right {
        flex-direction: column;
        align-items: stretch;
    }

    .wizard-khi-answer-btn,
    .wizard-khi-nav .btn {
        width: 100%;
    }
}
