/* Halaman unduh APK Mitra — selaras mitra-portal.css */
.mitra-wrap--download {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
}

.mitra-dl-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rp-text-muted);
    text-decoration: none;
}
.mitra-dl-back:hover { color: var(--rp-accent); }

/* Hero gradient */
.mitra-dl-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 22px 18px 20px;
    margin-bottom: 14px;
    background: linear-gradient(145deg, #141f45 0%, var(--rp-navy) 45%, #1e4080 100%);
    color: #fff;
    box-shadow: 0 10px 36px rgba(20, 31, 69, 0.45);
    text-align: center;
}
.mitra-dl-hero::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}
.mitra-dl-hero__icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}
.mitra-dl-hero__icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
}
.mitra-dl-hero__badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.mitra-dl-hero h1 {
    margin: 10px 0 6px;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}
.mitra-dl-hero__sub {
    margin: 0;
    font-size: 0.82rem;
    opacity: 0.88;
    line-height: 1.45;
}
.mitra-dl-hero__version {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* Notice */
.mitra-dl-invite {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: rgba(30, 64, 128, 0.08);
    border: 1px solid rgba(30, 64, 128, 0.18);
}
.mitra-dl-invite__body {
    flex: 1;
    min-width: 0;
}
.mitra-dl-invite__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 64, 128, 0.12);
    color: var(--rp-accent, #1e4080);
    flex-shrink: 0;
}
.mitra-dl-invite__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mitra-dl-invite__name {
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rp-text);
}
.mitra-dl-invite__area {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--rp-text-muted);
}
.mitra-dl-cta .mitra-dl-invite__hint {
    margin: 0;
    padding: 0 2px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--rp-text-muted);
    text-align: center;
}

.mitra-dl-invite-flow {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(30, 64, 128, 0.06);
    border: 1px dashed rgba(30, 64, 128, 0.22);
}
.mitra-dl-invite-flow__title {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rp-text-muted);
}
.mitra-dl-invite-steps {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--rp-text);
}
.mitra-dl-invite-steps li + li {
    margin-top: 4px;
}

.mitra-dl-ref-box {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(30, 64, 128, 0.2);
    box-shadow: 0 2px 8px rgba(30, 64, 128, 0.06);
}
.mitra-dl-ref-box__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rp-text-muted);
    margin-bottom: 6px;
}
.mitra-dl-ref-box__row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mitra-dl-ref-box__row code {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--rp-accent, #1e4080);
    word-break: break-all;
}
.mitra-dl-ref-box__copy {
    flex-shrink: 0;
    border: 1px solid rgba(30, 64, 128, 0.25);
    background: rgba(30, 64, 128, 0.08);
    color: var(--rp-accent, #1e4080);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.mitra-dl-ref-box__note {
    margin: 8px 0 0;
    font-size: 0.76rem;
    color: #0d7a3f;
    line-height: 1.4;
}

.mitra-dl-btn--open-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--rp-accent, #1e4080);
    border: 2px solid rgba(30, 64, 128, 0.35);
    box-shadow: 0 2px 8px rgba(30, 64, 128, 0.08);
}
.mitra-dl-btn--open-app:hover {
    background: #fff;
    border-color: var(--rp-accent, #1e4080);
}

.mitra-dl-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--rp-text-muted);
}
.mitra-dl-notice__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.18);
    color: var(--rp-warn);
    font-size: 0.9rem;
}
.mitra-dl-notice strong {
    display: block;
    margin-bottom: 3px;
    color: var(--rp-text);
    font-size: 0.85rem;
}

/* Card sections */
.mitra-dl-section {
    background: var(--rp-glass);
    border: 1px solid var(--rp-glass-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .mitra-dl-section {
    box-shadow: var(--rp-shadow-sm);
}
.mitra-dl-section__title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rp-text-muted);
}

/* Meta pills */
.mitra-dl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mitra-dl-meta__item {
    flex: 1 1 calc(50% - 4px);
    min-width: 130px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rp-glass-border);
}
html[data-theme="light"] .mitra-dl-meta__item {
    background: var(--rp-surface-muted);
}
.mitra-dl-meta__item dt {
    margin: 0 0 2px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rp-text-muted);
}
.mitra-dl-meta__item dd {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rp-text);
    word-break: break-all;
}
.mitra-dl-sha {
    flex: 1 1 100%;
}
.mitra-dl-sha dd {
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.45;
    word-break: break-all;
}
.mitra-dl-sha__copy {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rp-accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.mitra-dl-sha__copy:active { opacity: 0.7; }

/* Security chips */
.mitra-dl-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.mitra-dl-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rp-glass-border);
    font-size: 0.76rem;
    color: var(--rp-text-muted);
    line-height: 1.3;
}
html[data-theme="light"] .mitra-dl-chip {
    background: var(--rp-surface-muted);
}
.mitra-dl-chip__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    color: var(--rp-success);
    font-size: 0.82rem;
}

/* Cuplikan layar */
.mitra-dl-section--ss {
    overflow: visible;
}
.mitra-dl-ss-outer {
    margin: 0 -16px;
    padding: 0 16px;
    overflow: hidden;
}
.mitra-dl-screenshots {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    overflow-x: scroll;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.mitra-dl-screenshots.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.mitra-dl-screenshots:focus-visible {
    outline: 2px solid var(--rp-accent);
    outline-offset: 2px;
}
.mitra-dl-screenshots::-webkit-scrollbar { display: none; }
.mitra-dl-screenshots img {
    flex: 0 0 auto;
    width: min(46vw, 156px);
    max-width: none;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--rp-glass-border);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}
html[data-theme="light"] .mitra-dl-screenshots img {
    box-shadow: var(--rp-shadow-sm);
}

/* Mode in-app Android (WebView Pengaturan → Update) */
html.is-mitra-app .mitra-dl-back,
html.is-mitra-app .mitra-dl-sticky,
html.is-mitra-app #inviteBanner,
html.is-mitra-app #inviteWaBtn,
html.is-mitra-app #inviteNoContact,
html.is-mitra-app #inviteFlow,
html.is-mitra-app #inviteRefBox,
html.is-mitra-app #btnOpenApp,
html.is-mitra-app #inviteOpenAppHint {
    display: none !important;
}
html.is-mitra-app .mitra-wrap--download {
    padding-bottom: 24px;
}

.mitra-dl-ss-hint {
    margin: 6px 0 0;
    text-align: center;
    font-size: 0.72rem;
    color: var(--rp-text-muted);
    letter-spacing: 0.02em;
}

/* Steps */
.mitra-dl-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: dlstep;
}
.mitra-dl-steps li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.84rem;
    color: var(--rp-text-muted);
    line-height: 1.45;
}
.mitra-dl-steps li:last-child { margin-bottom: 0; }
.mitra-dl-steps li::before {
    counter-increment: dlstep;
    content: counter(dlstep);
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(59, 130, 246, 0.18);
    color: var(--rp-accent);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Accordion changelog */
.mitra-dl-accordion {
    border: 1px solid var(--rp-glass-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}
.mitra-dl-accordion summary {
    padding: 13px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--rp-glass);
    color: var(--rp-text);
}
.mitra-dl-accordion summary::-webkit-details-marker { display: none; }
.mitra-dl-accordion summary::after {
    content: "›";
    font-size: 1.1rem;
    color: var(--rp-text-muted);
    transition: transform 0.2s;
}
.mitra-dl-accordion[open] summary::after { transform: rotate(90deg); }
.mitra-dl-accordion__body {
    padding: 0 16px 14px;
    background: var(--rp-glass);
    border-top: 1px solid var(--rp-glass-border);
}
.mitra-dl-changelog {
    margin: 10px 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--rp-text-muted);
    line-height: 1.5;
}
.mitra-dl-changelog li { margin-bottom: 5px; }

/* CTA stack — undangan + unduh */
.mitra-dl-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.mitra-dl-cta .mitra-dl-invite {
    margin-bottom: 0;
}

/* Tombol halaman unduh — tidak pakai .mitra-btn global (hindari width/padding aneh) */
.mitra-dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border: none;
    border-radius: 13px;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.mitra-dl-btn:active {
    transform: scale(0.985);
}
.mitra-dl-btn--primary {
    color: #fff;
    background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 55%, #1e40af 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
}
.mitra-dl-btn--primary:hover {
    background: linear-gradient(145deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
}
.mitra-dl-btn--wa {
    color: #fff;
    background: #25d366;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.32);
}
.mitra-dl-btn--wa:hover {
    background: #1ebe5d;
    color: #fff;
}

/* Timpa warna link global portal (light theme) — tombol WA harus hijau penuh */
.mitra-wrap--download .mitra-dl-cta a.mitra-dl-btn--wa,
html[data-theme="light"] .mitra-wrap--download .mitra-dl-cta a.mitra-dl-btn--wa {
    display: inline-flex;
    color: #fff;
    background: #25d366;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.mitra-wrap--download .mitra-dl-cta a.mitra-dl-btn--wa:hover,
html[data-theme="light"] .mitra-wrap--download .mitra-dl-cta a.mitra-dl-btn--wa:hover {
    color: #fff;
    background: #1ebe5d;
    text-decoration: none;
}
.mitra-wrap--download .mitra-dl-cta a.mitra-dl-btn--wa i {
    color: #fff;
}

.mitra-dl-btn--compact {
    width: auto;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.88rem;
    border-radius: 11px;
    white-space: nowrap;
}

/* Footer links */
.mitra-dl-foot {
    text-align: center;
    font-size: 0.78rem;
    color: var(--rp-text-muted);
    padding: 4px 0 8px;
}
.mitra-dl-foot a { color: var(--rp-accent); font-weight: 600; }

/* Sticky bar */
.mitra-dl-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 22, 40, 0.94);
    border-top: 1px solid var(--rp-glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
html[data-theme="light"] .mitra-dl-sticky {
    background: rgba(241, 245, 249, 0.96);
}
.mitra-dl-sticky__inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
}
.mitra-dl-sticky__info { flex: 1; min-width: 0; }
.mitra-dl-sticky__label {
    margin: 0;
    font-size: 0.68rem;
    color: var(--rp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.mitra-dl-sticky__name {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--rp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mitra-dl-sticky .mitra-dl-btn--compact {
    flex-shrink: 0;
    min-width: 120px;
}

/* Modal */
.mitra-dl-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(12, 22, 40, 0.6);
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.mitra-dl-modal.is-open { display: flex; }
.mitra-dl-modal__sheet {
    background: var(--rp-glass);
    border: 1px solid var(--rp-glass-border);
    border-radius: 18px 18px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 480px;
    animation: mitraDlSheetUp 0.28s ease;
}
@keyframes mitraDlSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.mitra-dl-modal__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--rp-glass-border);
    margin: 0 auto 14px;
}
.mitra-dl-modal__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--rp-text);
}
.mitra-dl-modal__text {
    margin: 0 0 14px;
    font-size: 0.84rem;
    color: var(--rp-text-muted);
    line-height: 1.45;
}
.mitra-dl-modal .mitra-btn { width: 100%; margin-bottom: 8px; border-radius: 12px; min-height: 48px; }

@media (min-width: 560px) {
    .mitra-wrap--download { padding-top: 28px; padding-bottom: 32px; }
    .mitra-dl-sticky { display: none; }
    .mitra-dl-modal { align-items: center; padding: 20px; }
    .mitra-dl-modal__sheet { border-radius: 16px; animation: none; }
    .mitra-dl-modal__handle { display: none; }
}
