/* ALAMANAH_MAKLUMAT_GATE_V1 — native-style mandatory announcement */
#amMaklumatGateV1[hidden]{display:none!important}
html.amg-locked,html.amg-locked body{overflow:hidden!important;overscroll-behavior:none!important}
#amMaklumatGateV1{position:fixed;inset:0;z-index:2147483600;display:grid;place-items:center;background:#0b2335bb;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);padding:12px;box-sizing:border-box;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#amMaklumatGateV1 *{box-sizing:border-box}
#amMaklumatGateV1 .amg-panel{display:flex;flex-direction:column;width:min(640px,100%);height:min(830px,calc(100dvh - 24px));min-height:340px;overflow:hidden;background:#fff;border:1px solid #d4e6f2;border-radius:22px;box-shadow:0 25px 100px #081b2a73;color:#1b374d}
#amMaklumatGateV1 .amg-header{flex-shrink:0;padding:20px 22px;display:flex;gap:13px;align-items:center;background:linear-gradient(127deg,#16568a,#2289c2);color:white}
#amMaklumatGateV1 .amg-icon{width:45px;height:45px;flex-shrink:0;display:grid;place-items:center;border:1px solid #ffffff57;border-radius:13px;background:#ffffff21;font-size:23px}
#amMaklumatGateV1 .amg-header small{display:block;margin:0 0 3px;font-size:10px;font-weight:800;letter-spacing:.11em;color:#dcefff}
#amMaklumatGateV1 .amg-header h2{font-size:19px;line-height:1.3;margin:0;color:#fff;font-weight:840}
#amMaklumatGateV1 .amg-content{flex:1;min-height:0;overflow-y:auto;padding:20px 22px;overscroll-behavior:contain}
#amMaklumatGateV1 .amg-counter{font-size:11px;text-transform:uppercase;color:#267bb0;font-weight:850;letter-spacing:.06em}
#amMaklumatGateV1 .amg-doc-title{font-size:19px;color:#153e5a;line-height:1.35;margin:8px 0 9px;font-weight:850;overflow-wrap:anywhere}
#amMaklumatGateV1 .amg-desc{margin:0 0 15px;font-size:12px;color:#677f90;line-height:1.75}
#amMaklumatGateV1 .amg-paper{border:1px solid #dce7ef;border-radius:14px;background:#f8fbfd;overflow:hidden;min-height:170px;margin-bottom:15px}
#amMaklumatGateV1 .amg-paper.amg-text{padding:20px;white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.85;color:#2b465d;background:#fff}
#amMaklumatGateV1 .amg-pdf-hint{font-size:11px;color:#57748a;padding:11px 13px;margin:0;background:#eaf4fb;line-height:1.6}
#amMaklumatGateV1 .amg-pdf{display:block;width:100%;min-height:290px;height:45dvh;border:0;background:#e8f0f6}
#amMaklumatGateV1 .amg-open{border:1px solid #b7d5e9;background:#ebf6fe;color:#1461a0;font-size:13px;font-weight:850;cursor:pointer;padding:12px 16px;width:calc(100% - 24px);border-radius:11px;margin:12px}
#amMaklumatGateV1 .amg-confirm{display:flex;align-items:flex-start;gap:11px;background:#f0f8f4;border:1px solid #cae7d8;border-radius:13px;padding:14px;cursor:pointer}
#amMaklumatGateV1 .amg-confirm input{margin:3px 0 0;width:19px;height:19px;min-width:19px;accent-color:#16845d}
#amMaklumatGateV1 .amg-confirm span{color:#32634c;font-size:12px;font-weight:750;line-height:1.6}
#amMaklumatGateV1 .amg-footer{flex-shrink:0;display:flex;gap:10px;padding:15px 20px;padding-bottom:max(15px,env(safe-area-inset-bottom));border-top:1px solid #e8f0f5;background:#fff}
#amMaklumatGateV1 .amg-footer button{min-height:45px;border-radius:12px;padding:11px 14px;font-size:12px;font-weight:850;cursor:pointer}
#amMaklumatGateV1 .amg-primary{flex:1;background:#1669b6;color:white;border:1px solid #1669b6}
#amMaklumatGateV1 button:disabled{opacity:.45;cursor:not-allowed}
#amMaklumatGateV1 .amg-secondary{background:#f1f6fa;color:#526f84;border:1px solid #dbe5ef}
#amMaklumatGateV1 .amg-loading{min-height:160px;display:grid;place-content:center;justify-items:center;gap:11px;text-align:center;padding:20px;color:#5a7891}
#amMaklumatGateV1 .amg-loading p{font-size:12px;margin:0;line-height:1.7}
#amMaklumatGateV1 .amg-spinner{width:29px;height:29px;border:3px solid #cde4f3;border-top-color:#167cb8;border-radius:50%;animation:amgspin .75s linear infinite}
#amMaklumatGateV1 .amg-alert{margin-top:12px;border:1px solid #f0d3b2;background:#fff8ee;padding:18px;border-radius:13px;color:#95602b}
#amMaklumatGateV1 .amg-alert p{font-size:12px;line-height:1.6}
@keyframes amgspin{to{transform:rotate(360deg)}}
@media(max-width:600px){#amMaklumatGateV1{padding:0}#amMaklumatGateV1 .amg-panel{width:100%;height:100dvh;max-height:none;border:0;border-radius:0}#amMaklumatGateV1 .amg-header{padding:20px 17px}#amMaklumatGateV1 .amg-content{padding:16px}#amMaklumatGateV1 .amg-footer{padding:12px 14px;padding-bottom:max(12px,env(safe-area-inset-bottom))}#amMaklumatGateV1 .amg-header h2{font-size:17px}}

/* ALAMANAH_MAKLUMAT_THEME_SYNC_V2 — warna merek mengikuti theme_app_css.php dari backend.
   Hanya nilai netral yang memiliki fallback; primary, gradient dan highlight berasal dari tema aktif. */
#amMaklumatGateV1{
 --amg-brand:var(--primary,#087b57);
 --amg-strong:var(--primary-600,var(--primary,#087b57));
 --amg-ink:var(--text,#213a35);
 --amg-surface:var(--panel,#fff);
 --amg-subtle:color-mix(in srgb,var(--amg-brand) 7%,#fff);
 --amg-soft:color-mix(in srgb,var(--amg-brand) 12%,#fff);
 --amg-stroke:color-mix(in srgb,var(--amg-brand) 22%,#fff);
 background:color-mix(in srgb,var(--amg-strong) 30%,#0b1412 70%);
}
#amMaklumatGateV1 .amg-panel{background:var(--amg-surface);border-color:var(--amg-stroke);color:var(--amg-ink)}
#amMaklumatGateV1 .amg-header{background:linear-gradient(125deg,var(--amg-strong),var(--amg-brand));}
#amMaklumatGateV1 .amg-header small{color:rgba(255,255,255,.88)}
#amMaklumatGateV1 .amg-counter{color:var(--amg-strong)}
#amMaklumatGateV1 .amg-doc-title{color:var(--amg-ink)}
#amMaklumatGateV1 .amg-desc{color:color-mix(in srgb,var(--amg-ink) 68%,#fff)}
#amMaklumatGateV1 .amg-paper{border-color:var(--amg-stroke);background:var(--amg-subtle)}
#amMaklumatGateV1 .amg-paper.amg-text{color:var(--amg-ink);background:var(--amg-surface)}
#amMaklumatGateV1 .amg-pdf-hint{color:var(--amg-strong);background:var(--amg-subtle)}
#amMaklumatGateV1 .amg-pdf{background:var(--amg-subtle)}
#amMaklumatGateV1 .amg-open{border-color:var(--amg-stroke);background:var(--amg-soft);color:var(--amg-strong)}
#amMaklumatGateV1 .amg-confirm{background:var(--amg-subtle);border-color:var(--amg-stroke)}
#amMaklumatGateV1 .amg-confirm input{accent-color:var(--amg-brand)}
#amMaklumatGateV1 .amg-confirm span{color:var(--amg-strong)}
#amMaklumatGateV1 .amg-footer{background:var(--amg-surface);border-color:var(--amg-stroke)}
#amMaklumatGateV1 .amg-primary{background:var(--amg-brand);border-color:var(--amg-brand);color:#fff}
#amMaklumatGateV1 .amg-secondary{background:var(--amg-subtle);border-color:var(--amg-stroke);color:var(--amg-strong)}
#amMaklumatGateV1 .amg-loading{color:var(--amg-strong)}
#amMaklumatGateV1 .amg-spinner{border-color:var(--amg-stroke);border-top-color:var(--amg-brand)}

/* ALAMANAH_MAKLUMAT_MEDIA_READER_V3 — canvas PDF.js, responsive and locally hosted */
#amMaklumatGateV1 .amg-media{background:#fff;border:1px solid var(--amg-stroke,#dce7ef);overflow:hidden;min-height:0}
#amMaklumatGateV1 .amg-media-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;padding:9px;background:var(--amg-subtle,#f4f8f6);border-bottom:1px solid var(--amg-stroke,#dce7ef)}
#amMaklumatGateV1 .amg-zoom{display:inline-grid;place-items:center;flex:0 0 37px;height:37px;font-size:23px;font-weight:750;border:1px solid var(--amg-stroke,#dce7ef);border-radius:10px;background:#fff;color:var(--amg-strong,#176e52);cursor:pointer;padding:0}
#amMaklumatGateV1 .amg-zoom:disabled{opacity:.38}
#amMaklumatGateV1 .amg-page-status{font:750 12px/1.3 system-ui,sans-serif;min-width:49px;text-align:center;color:var(--amg-strong,#176e52);white-space:nowrap}
#amMaklumatGateV1 .amg-canvas-window{height:auto;min-height:180px;max-height:min(66dvh,610px);overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;background:#f1f2f3;display:flex;justify-content:flex-start;align-items:flex-start;padding:6px}
#amMaklumatGateV1 .amg-pdf-canvas{display:block;flex-shrink:0;margin:0 auto;background:#fff;box-shadow:0 2px 12px #0002}
#amMaklumatGateV1 .amg-image-space{overflow:auto;max-height:min(66dvh,650px);min-height:90px;padding:8px;display:flex;justify-content:flex-start;align-items:flex-start;background:#f8fafb}
#amMaklumatGateV1 .amg-photo{height:auto;max-height:none;object-fit:contain;display:block;flex-shrink:0;margin:0 auto;box-shadow:0 2px 8px #0001}
#amMaklumatGateV1 .amg-pdf-hint{font-size:11px;line-height:1.55;padding:9px 12px;color:var(--amg-strong,#176e52);margin:0}
#amMaklumatGateV1 .amg-media .amg-open{background:var(--amg-soft,#eaf5ef);color:var(--amg-strong,#176e52);margin:12px;border-color:var(--amg-stroke,#dce7ef);font-size:12px}
#amMaklumatGateV1 .amg-content{background:#fff}
@media(max-width:600px){
 #amMaklumatGateV1 .amg-media-toolbar{gap:5px;padding:8px 4px}
 #amMaklumatGateV1 .amg-zoom{width:35px;flex-basis:35px;height:35px}
 #amMaklumatGateV1 .amg-page-status{min-width:44px}
 #amMaklumatGateV1 .amg-canvas-window{max-height:55dvh}
}

/* Netral terang yang mengikuti warna tema agar PDF/gambar tetap mudah dibaca */
#amMaklumatGateV1{--amg-surface:color-mix(in srgb,var(--amg-brand) 2%,#fff)}
#amMaklumatGateV1 .amg-content{background:var(--amg-surface)}
