/* Mitra Hafis mobile + PWA patch, 20260910-1. Loaded AFTER the original styles. */
:root {
    --mh-banner-h: 0px;
    --mh-safe-top: env(safe-area-inset-top, 0px);
    --mh-nav-h: 68px;
}
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + var(--mh-banner-h) + var(--mh-safe-top) + 16px); }
body { overflow-x: clip; }
.site-header { top: calc(var(--mh-banner-h) + var(--mh-safe-top)); }
.hero { margin-top: calc(var(--mh-banner-h) + var(--mh-safe-top)); }
.mh-has-banner { --mh-safe-top: 0px; }
.brand-logo { width: 162px; max-width: 162px; height: auto; max-height: 43px; }
.reveal { opacity: 1; transform: none; }
.mh-animate .reveal:not(.is-visible) { opacity: 0; transform: translateY(14px); }
.mobile-drawer { visibility: hidden; overflow-y: auto; overscroll-behavior: contain; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
body.menu-open .mobile-drawer { visibility: visible; }
.drawer-bottom { flex-shrink: 0; }
.modal-backdrop:not(.is-open) { visibility: hidden; }
.drawer-close, .modal-close { min-width: 44px; min-height: 44px; flex-shrink: 0; }

/* The top promotion never covers the existing header or the page content. */
.mh-install-banner {
    position: fixed; inset: 0 0 auto; z-index: 31;
    border-bottom: 1px solid rgba(120, 171, 255, .2);
    background: #10203a;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
}
.mh-install-inner { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; gap: 12px; max-width: 1184px; margin: 0 auto; }
.mh-install-logo { width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.mh-install-copy { min-width: 0; }
.mh-install-copy strong { display: block; color: #f5f8ff; font-size: 14px; line-height: 1.35; font-weight: 750; }
.mh-install-copy span { display: block; margin-top: 2px; color: #b5c6e0; font-size: 12px; line-height: 1.4; }
.mh-install-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid rgba(161,190,255,.3); border-radius: 11px; color: #fff; background: #326eed; font-size: 13px; font-weight: 750; cursor: pointer; }
.mh-install-button:hover { background: #427ef7; }
.mh-install-button:disabled { opacity: .6; cursor: wait; }
.mh-install-close { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 10px; color: #c2d0e5; background: transparent; cursor: pointer; }
.mh-install-close:hover { background: rgba(255,255,255,.08); }
.mh-install-close .icon { width: 19px; height: 19px; }
.mh-app-status { margin: 12px 10px 0; color: var(--green); font-size: 12px; }

/* Real WhatsApp brand glyph, supplied locally rather than an icon font/CDN. */
.wa-brand { display: inline-block; width: 21px; height: 24px; flex: 0 0 auto; object-fit: contain; }
.whatsapp-float {
    display: flex; width: 54px; height: 54px; min-height: 54px; padding: 0; gap: 0;
    right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom));
    border: 1px solid rgba(255,255,255,.22); background: #25d366;
    box-shadow: 0 8px 25px rgba(0,0,0,.28); z-index: 33;
}
.whatsapp-float .wa-brand { width: 29px; height: 34px; }
.whatsapp-float:hover { background: #20c35c; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.mh-bottom-nav { display: none; }
body.menu-open .whatsapp-float, body.modal-open .whatsapp-float, body.install-help-open .whatsapp-float { visibility: hidden; }

/* Manual installation instructions: no fake install alert when native prompt is unavailable. */
.mh-install-dialog {
    width: min(440px, calc(100% - 28px)); max-height: calc(100dvh - 40px);
    margin: auto; padding: 24px; overflow-y: auto;
    border: 1px solid var(--line-strong); border-radius: 22px;
    color: var(--text); background: #0d1b2f; box-shadow: 0 24px 100px rgba(0,0,0,.5);
}
.mh-install-dialog::backdrop { background: rgba(2,8,16,.8); }
.mh-install-dialog:not([open]) { display: none; }
.mh-install-dialog[open]:not(:modal) { position: fixed; inset: 0; z-index: 80; }
body.install-help-open { overflow: hidden; }
.mh-install-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mh-install-dialog-head img { width: 54px; height: 54px; border-radius: 14px; }
.mh-install-dialog h2 { margin: 18px 0 8px; font-size: 22px; line-height: 1.3; letter-spacing: -.5px; }
.mh-install-dialog p { margin: 0 0 14px; color: var(--muted-strong); font-size: 13px; line-height: 1.7; }
.mh-install-steps { margin: 0 0 18px; padding-left: 22px; color: var(--muted-strong); font-size: 13px; }
.mh-install-steps li { padding-left: 3px; margin-bottom: 10px; }
.mh-install-hint { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.mh-install-dialog .button { width: 100%; cursor: pointer; }
.mh-toast { position: fixed; z-index: 90; bottom: 95px; left: 50%; width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 12px 16px; border: 1px solid rgba(120,171,255,.25); border-radius: 12px; color: #f5f8ff; background: #142744; box-shadow: 0 10px 35px rgba(0,0,0,.3); font-size: 12px; line-height: 1.5; text-align: center; }

@media (max-width: 1120px) and (min-width: 961px) {
    .brand-logo { width: 139px; max-width: 139px; }
}
@media (max-width: 960px) {
    body { padding-bottom: calc(var(--mh-nav-h) + env(safe-area-inset-bottom) + 14px); }
    .mh-bottom-nav {
        position: fixed; inset: auto 0 0; z-index: 32; display: block;
        min-height: calc(var(--mh-nav-h) + env(safe-area-inset-bottom));
        padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
        border-top: 1px solid rgba(160,189,231,.16); border-radius: 20px 20px 0 0;
        background: rgba(11,21,38,.97); box-shadow: 0 -7px 28px rgba(0,0,0,.15);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    }
    .mh-bottom-inner { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: center; max-width: 620px; min-height: var(--mh-nav-h); margin: 0 auto; }
    .mh-nav-item { display: flex; min-width: 0; min-height: 60px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 2px; border: 0; border-radius: 12px; color: #a6b6cd; background: transparent; font-size: 10.5px; font-weight: 650; line-height: 1.25; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .mh-nav-icon { display: flex; width: 46px; height: 29px; align-items: center; justify-content: center; border-radius: 10px; }
    .mh-nav-item .icon { width: 22px; height: 22px; stroke-width: 1.85; }
    .mh-nav-item.is-active, .mh-nav-item:hover { color: var(--cyan); }
    .mh-nav-item.is-active .mh-nav-icon { background: rgba(89,229,212,.1); }
    .whatsapp-float { right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--mh-nav-h) + env(safe-area-inset-bottom) + 14px); width: 52px; height: 52px; min-height: 52px; }
    .mh-toast { bottom: calc(var(--mh-nav-h) + env(safe-area-inset-bottom) + 78px); }
    .field input, .field select { font-size: 16px; }
}
@media (max-width: 730px) {
    :root { --header-h: 79px; }
    .shell { width: calc(100% - 32px); }
    .site-header { padding-top: 9px; }
    .header-inner { height: 59px; padding-inline: 13px; }
    .brand { min-width: 0; }
    .brand-logo { width: 170px; max-width: 170px; height: auto; }
    .mh-install-inner { grid-template-columns: 40px minmax(0,1fr) auto 44px; gap: 8px; }
    .mh-install-logo { width: 40px; height: 40px; border-radius: 11px; }
    .mh-install-copy strong { font-size: 13px; }
    .mh-install-copy span { font-size: 10.5px; }
    .mh-install-button { padding-inline: 14px; font-size: 12px; }
    .hero-inner { gap: 24px; padding-top: 100px; padding-bottom: 26px; }
    .eyebrow { max-width: 100%; padding: 7px 10px; font-size: 9px; letter-spacing: .45px; }
    .hero h1 { margin: 17px 0 13px; font-size: clamp(35px, 10.2vw, 53px); line-height: 1.1; letter-spacing: -1.8px; }
    .hero-description { font-size: 13.5px; line-height: 1.75; }
    .hero-actions { flex-wrap: nowrap; gap: 9px; margin-top: 21px; }
    .hero-actions .button { min-height: 45px; padding-inline: 13px; font-size: 12px; }
    .hero-actions .button .icon { width: 16px; height: 16px; }
    .hero-proof { gap: 12px; margin-top: 21px; font-size: 11px; }
    .hero-proof strong { font-size: 12px; }
    .hero-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 20px; padding-top: 17px; }
    .hero-stat { min-width: 0; gap: 8px; }
    .hero-stat + .hero-stat { padding-left: 10px; }
    .hero-stat strong { font-size: 19px; }
    .hero-stat span { max-width: none; font-size: 10px; line-height: 1.35; }
    .hero-visual { min-height: 0; margin-top: 0; }
    .hero-visual .floating-chip, .visual-glow { display: none; }
    .dashboard-card { width: 100%; padding: 17px; border-radius: 19px; }
    .dashboard-top { margin-bottom: 13px; gap: 10px; }
    .dashboard-top strong { font-size: 14px; }
    .dashboard-top span { font-size: 10.5px; }
    .dashboard-feature { min-height: 0; padding: 14px 16px; border-radius: 13px; }
    .dashboard-feature strong { margin-top: 4px; font-size: 17px; line-height: 1.3; }
    .mini-services { gap: 9px; margin-top: 10px; }
    .mini-service { min-height: 78px; padding: 10px 7px; border-radius: 12px; }
    .mini-service strong { font-size: 11px; }
    .mini-service span { font-size: 10px; }
    .mini-service .icon { width: 21px; height: 21px; }
    .dashboard-bottom { flex-wrap: wrap; gap: 3px 12px; margin-top: 11px; font-size: 10px; }
    .access-strip { margin-top: 0; }
    .access-panel { gap: 13px; padding: 15px; }
    .access-caption strong { font-size: 13px; }
    .access-caption span { font-size: 11px; }
    .access-links { gap: 9px; }
    .access-link { min-height: 44px; gap: 7px; font-size: 11.5px; }
    .section { padding: 46px 0; }
    .services-section { padding-top: 43px; }
    .section-heading { margin-bottom: 20px; }
    .section-heading h2, .about-copy h2, .contact-panel h2 { font-size: 29px; line-height: 1.2; letter-spacing: -.9px; }
    .section-heading > p { font-size: 12.5px; line-height: 1.7; }
    .services-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .service-card, .service-card.featured { min-width: 0; min-height: 0; padding: 16px; border-radius: 17px; }
    .service-card { gap: 0; }
    .service-top { min-width: 0; gap: 8px; }
    .service-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; }
    .service-icon .icon { width: 21px; height: 21px; }
    .service-label { width: fit-content; max-width: 100%; padding: 4px 7px; font-size: 9px; line-height: 1.4; text-align: left; white-space: normal; }
    .service-card h3 { margin: 12px 0 7px; font-size: 15px; line-height: 1.35; overflow-wrap: break-word; }
    .service-card p { max-width: none; color: #a5b5cc; font-size: 12px; line-height: 1.65; }
    .service-action { gap: 6px; padding-top: 13px; font-size: 11px; line-height: 1.5; }
    .service-action .icon { width: 15px; height: 15px; }
    .service-watermark { opacity: .045; }
    .service-card.featured { display: grid; grid-column: 1 / -1; grid-template-columns: 40px minmax(0,1fr); align-items: start; column-gap: 13px; row-gap: 5px; }
    .service-card.featured .service-top { display: contents; }
    .service-card.featured .service-icon { grid-column: 1; grid-row: 1 / 5; }
    .service-card.featured .service-label { grid-column: 2; grid-row: 2; }
    .service-card.featured h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 16px; }
    .service-card.featured p { grid-column: 2; grid-row: 3; margin-top: 2px; }
    .service-card.featured .service-action { grid-column: 2; grid-row: 4; padding-top: 5px; }
    .service-card:not(.featured) .service-top { flex-direction: column; align-items: flex-start; }
    .about-grid { gap: 23px; }
    .about-copy > p { font-size: 13px; line-height: 1.8; }
    .about-visual { min-height: 325px; }
    .about-window-top { top: 39px; }
    .about-window-top > span { font-size: 8px; }
    .about-badge { right: 0; bottom: 8px; padding: 13px 15px; }
    .benefit-list { gap: 10px; }
    .steps-grid, .news-grid { gap: 12px; }
    .step-card { display: grid; grid-template-columns: 36px minmax(0,1fr); column-gap: 13px; row-gap: 6px; padding: 17px; min-height: 0; }
    .step-number { grid-column: 1; grid-row: 1 / 3; }
    .step-card h3 { grid-column: 2; margin: 0; font-size: 15px; }
    .step-card p { grid-column: 2; margin: 0; font-size: 12px; line-height: 1.7; }
    .step-card::after { display: none; }
    .news-card { min-height: 0; padding: 19px; }
    .news-card h3 { margin: 12px 0 8px; font-size: 16px; }
    .news-card p { font-size: 12px; }
    .news-section { padding-top: 0; }
    .contact-section { padding: 0 0 43px; }
    .contact-panel { padding: 25px 21px; gap: 20px; }
    .contact-panel p { font-size: 13px; }
    .site-footer { padding-top: 34px; }
    .footer-main { gap: 28px 20px; }
    .footer-bottom { padding-bottom: 20px; }
    .footer-brand p, .footer-links { font-size: 12px; }
}
@media (min-width: 380px) and (max-width: 730px) {
    .services-grid .service-card:last-child { grid-column: 1 / -1; }
    .services-grid .service-card:last-child .service-top { flex-direction: row; align-items: center; }
    .services-grid .service-card:last-child h3 { margin-top: 10px; }
}
@media (max-width: 379px) {
    .shell { width: calc(100% - 28px); }
    .mh-install-banner { padding-inline: 8px; }
    .mh-install-inner { grid-template-columns: 36px minmax(0,1fr) auto 44px; gap: 6px; }
    .mh-install-logo { width: 36px; height: 36px; }
    .mh-install-copy strong { font-size: 12px; }
    .mh-install-copy span { font-size: 10px; }
    .mh-install-button { padding-inline: 11px; }
    .hero-actions .button { gap: 6px; padding-inline: 10px; font-size: 11.5px; }
    .hero-stat { gap: 5px; }
    .hero-stat + .hero-stat { padding-left: 7px; }
    .hero-stat span { font-size: 9px; }
    .services-grid { grid-template-columns: minmax(0,1fr); }
    .service-card:not(.featured) .service-top { flex-direction: row; align-items: center; }
    .service-card:not(.featured) h3 { margin-top: 10px; }
    .dashboard-card { padding: 14px; }
    .dashboard-bottom { font-size: 9.5px; }
}
@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
    :root, .mh-has-banner { --mh-banner-h: 0px !important; --mh-safe-top: env(safe-area-inset-top, 0px); }
    .mh-install-banner, [data-pwa-install] { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .mh-animate .reveal:not(.is-visible) { opacity: 1; transform: none; }
}
@media print {
    .site-header, .mh-install-banner, .mh-bottom-nav, .whatsapp-float, .mobile-drawer, .mh-install-dialog, .mh-toast { display: none !important; }
    body { padding-bottom: 0; }
    .hero { margin-top: 0; }
    .reveal, .mh-animate .reveal:not(.is-visible) { opacity: 1; transform: none; }
}
