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

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #212529;
    background: #f3f6fb;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    border-bottom: 1px solid #dce5f2;
    padding: 24px 0 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.06);
}

.header__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.header__subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 16px;
}

.search-wrap {
    margin-top: 12px;
}

.search {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #cfd8e6;
    border-radius: 10px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
    background: #fff;
}

/* Kategori sections */
.kategori {
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.kategori.is-hidden {
    display: none;
}

.kategori__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: none;
    border-bottom: 2px solid #e9ecef;
    cursor: pointer;
    text-align: left;
}

.kategori__toggle:hover {
    background: #f8f9fa;
}

.kategori__nama {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #495057;
}

.kategori__chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.kategori.is-collapsed .kategori__chevron {
    transform: rotate(-45deg);
}

.kategori.is-collapsed .kategori__content {
    display: none;
}

.kategori__content {
    padding: 0;
}

/* Panduan CS */
.panduan-block {
    margin-top: 24px;
}

.panduan-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    background: linear-gradient(135deg, #1a1a2e 0%, #27496d 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 10px 26px rgba(26, 26, 46, 0.12);
}

.eyebrow {
    margin-bottom: 6px;
    color: #b9d7ff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.panduan-hero h2 {
    margin-bottom: 6px;
    font-size: 1.35rem;
    line-height: 1.25;
}

.panduan-hero p:last-child {
    max-width: 640px;
    color: #e9f2ff;
    font-size: 0.95rem;
}

.panduan-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    min-width: 190px;
}

.panduan-badges span {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #495057;
    margin-bottom: 12px;
}

.section-heading--shortcuts {
    margin-top: 32px;
    padding-top: 4px;
}

.panduan-group .panduan-section {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #edf1f6;
}

.panduan-group .panduan-section:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.panduan-group {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 26px rgba(26, 26, 46, 0.08);
    overflow: hidden;
    counter-reset: panduan-step;
}

.panduan-group .panduan-section.is-hidden {
    display: none;
}

.panduan-section {
    counter-increment: panduan-step;
}

.panduan-section .kategori__toggle {
    gap: 12px;
    padding: 15px 18px;
    border-bottom: none;
    background: #fff;
}

.panduan-section .kategori__toggle:hover {
    background: #f8fbff;
}

.panduan-section:not(.is-collapsed) .kategori__toggle {
    background: #f8fbff;
}

.panduan-section .kategori__nama {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    font-size: 0.82rem;
}

.panduan-section .kategori__nama::before {
    content: counter(panduan-step, decimal-leading-zero);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    border-radius: 999px;
    background: #e7f1ff;
    color: #2f80ed;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.panduan-section:not(.is-collapsed) .kategori__nama::before {
    background: #2f80ed;
    color: #fff;
}

.panduan-body {
    padding: 18px 20px 24px 58px;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 72%);
}

.panduan-text {
    max-width: 760px;
    padding: 18px 20px;
    border: 1px solid #e4ebf5;
    border-left: 4px solid #2f80ed;
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #3f4a5a;
    white-space: pre-wrap;
    word-break: break-word;
}

.panduan-text strong {
    color: #16213e;
    font-weight: 700;
}

.panduan-block.is-hidden {
    display: none;
}

@media (max-width: 767px) {
    .panduan-hero {
        flex-direction: column;
        padding: 18px;
    }

    .panduan-badges {
        justify-content: flex-start;
        min-width: 0;
    }

    .panduan-body {
        padding: 14px;
    }

    .panduan-text {
        padding: 14px;
        font-size: 0.92rem;
    }

    .panduan-section .kategori__nama {
        align-items: flex-start;
    }

    .panduan-section .kategori__nama::before {
        flex-shrink: 0;
    }
}

/* Table - mobile card layout */
.guide-table {
    width: 100%;
    border-collapse: collapse;
}

.guide-table thead {
    display: none;
}

.guide-table tbody tr {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
}

.guide-table tbody tr:last-child {
    border-bottom: none;
}

.guide-table tbody tr.is-hidden {
    display: none;
}

.guide-table td {
    display: block;
    padding: 4px 0;
}

.guide-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin-bottom: 4px;
}

.guide-table td:first-child::before {
    display: none;
}

.guide-table td:first-child {
    margin-bottom: 8px;
}

/* Shortcut pill */
.shortcut-pill {
    display: inline-block;
    background: #e9ecef;
    color: #212529;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Pesan + copy button */
.pesan-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.pesan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pesan-body {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pesan-wrap.is-collapsed .pesan-body {
    display: none;
}

/* Modal preview (desktop) */
.pesan-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pesan-modal[hidden] {
    display: none;
}

.pesan-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.pesan-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pesan-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 12px;
    border-bottom: 1px solid #e9ecef;
}

.pesan-modal__meta {
    min-width: 0;
}

.pesan-modal__deskripsi {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.pesan-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}

.pesan-modal__close:hover {
    background: #e9ecef;
    color: #212529;
}

.pesan-modal__body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.pesan-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.pesan-modal__body .pesan-text {
    margin: 0;
}

.shortcut-row.is-pesan-open {
    background: #fafbfc;
}

.shortcut-row.is-pesan-open td {
    border-bottom-color: #dee2e6;
}

.copy-source {
    position: fixed;
    top: 0;
    left: 0;
    width: 2em;
    height: 2em;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    opacity: 0;
    font-size: 16px;
    z-index: -1;
    resize: none;
    overflow: hidden;
}

.pesan-text {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.pesan-body .pesan-text {
    margin: 0;
}

.btn-copy {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-preview {
    background: #fff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-preview:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-copy:hover {
    background: #218838;
}

.btn-copy--done {
    background: #6c757d;
}

.text-muted {
    color: #adb5bd;
}

/* Empty / no results */
.empty-state,
.no-results {
    text-align: center;
    padding: 40px 16px;
    color: #6c757d;
}

.no-results {
    background: #fff;
    border-radius: 8px;
    margin-top: 20px;
}

/* Footer */
.footer {
    padding: 24px 0;
    text-align: center;
    margin-top: 32px;
}

.footer a {
    color: #adb5bd;
    font-size: 0.8rem;
    text-decoration: none;
}

.footer a:hover {
    color: #6c757d;
}

/* Desktop table layout */
@media (min-width: 768px) {
    .header__title {
        font-size: 1.5rem;
    }

    .table-wrap {
        overflow-x: auto;
    }

    .guide-table thead {
        display: table-header-group;
    }

    .guide-table thead th {
        padding: 12px 16px;
        text-align: left;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #6c757d;
        background: #f8f9fa;
        border-bottom: 2px solid #e9ecef;
    }

    .guide-table thead th:first-child {
        width: 140px;
    }

    .guide-table thead th:last-child {
        width: 200px;
    }

    .pesan-body {
        display: none !important;
    }

    .guide-table tbody tr.is-pesan-open {
        background: inherit;
    }

    .guide-table tbody tr.is-pesan-open:hover {
        background: #f8f9fa;
    }

    .guide-table tbody tr {
        display: table-row;
        padding: 0;
    }

    .guide-table tbody tr:hover {
        background: #f8f9fa;
    }

    .guide-table td {
        display: table-cell;
        padding: 14px 16px;
        vertical-align: top;
        border-bottom: 1px solid #e9ecef;
    }

    .guide-table td::before {
        display: none;
    }

    .guide-table td:first-child {
        margin-bottom: 0;
    }
}
