/* Popup ads and announcements (shared by the app and the admin preview). Uses the theme colour variables. */
.kp{position:fixed; z-index:120; pointer-events:none; opacity:0; transition:opacity .22s ease, transform .22s ease;}
.kp.kp-in{opacity:1;} .kp.kp-out{opacity:0;}
.kp-box, .kp-backdrop{pointer-events:auto;}
.kp-box{position:relative; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:18px; box-shadow:0 18px 50px rgba(0,0,0,.28); overflow:hidden; max-width:100%; font-family:inherit;}
.kp-small .kp-box{width:min(300px,92vw);} .kp-medium .kp-box{width:min(380px,92vw);} .kp-large .kp-box{width:min(500px,94vw);}

/* middle of the screen */
.kp-center{inset:0; display:grid; place-items:center; padding:16px; transform:scale(.96);}
.kp-center.kp-in{transform:none;}
.kp-center.kp-dim .kp-backdrop{position:absolute; inset:0; background:rgba(8,14,11,.58);}
.kp-center:not(.kp-dim) .kp-backdrop{position:absolute; inset:0; pointer-events:none;}
.kp-center .kp-box{position:relative; z-index:1;}

/* corners */
.kp-top-left, .kp-top-right, .kp-bottom-left, .kp-bottom-right{padding:16px;}
.kp-top-left{top:0; left:0; transform:translateY(-10px);} .kp-top-right{top:0; right:0; transform:translateY(-10px);}
.kp-bottom-left{bottom:0; left:0; transform:translateY(10px);} .kp-bottom-right{bottom:0; right:0; transform:translateY(10px);}
.kp-top-left.kp-in, .kp-top-right.kp-in, .kp-bottom-left.kp-in, .kp-bottom-right.kp-in{transform:none;}

/* bars across the top or bottom */
.kp-top, .kp-bottom{left:0; right:0; padding:10px 12px;}
.kp-top{top:0; transform:translateY(-14px);} .kp-bottom{bottom:0; transform:translateY(14px);}
.kp-top.kp-in, .kp-bottom.kp-in{transform:none;}
.kp-top .kp-box, .kp-bottom .kp-box{width:min(960px,100%); margin:0 auto; display:flex; align-items:center; gap:14px; padding-right:44px; border-radius:14px;}
.kp-top .kp-img, .kp-bottom .kp-img{width:auto; max-width:140px; max-height:64px; border-radius:0; flex:none;}
.kp-top .kp-text, .kp-bottom .kp-text{flex:1; padding:10px 0;}
.kp-top .kp-frame, .kp-bottom .kp-frame{width:100%;}

.kp-img{display:block; width:100%; height:auto; max-height:70vh; object-fit:cover;}
.kp-imglink{display:block;}
.kp-text{padding:16px 18px 18px;}
.kp-title{margin:0 0 6px; font-size:1.15rem; line-height:1.3;}
.kp-body{margin:0 0 14px; font-size:.93rem; line-height:1.5; color:var(--muted); white-space:pre-line;}
.kp-btn{display:inline-block; padding:10px 18px; border-radius:12px; background:var(--btn); color:var(--btn-ink); font-weight:700; font-size:.93rem; text-decoration:none;}
.kp-btn:hover{filter:brightness(1.1);}
.kp-frame{display:block; width:100%; border:0; background:transparent;}

.kp-x{position:absolute; top:8px; right:8px; z-index:3; width:32px; height:32px; border-radius:50%; border:0; cursor:pointer; background:rgba(0,0,0,.62); color:#fff; font-size:.95rem; line-height:1; display:grid; place-items:center;}
.kp-x:hover{background:rgba(0,0,0,.8);}
.kp-wait{position:absolute; top:10px; right:10px; z-index:3; padding:4px 10px; border-radius:999px; background:rgba(0,0,0,.62); color:#fff; font-size:.72rem; font-weight:600;}
.kp-wait[hidden], .kp-x[hidden]{display:none;}

/* phones: keep clear of the bottom tab bar, and give bars/cards the full width */
@media (max-width:820px){
  .kp-bottom, .kp-bottom-left, .kp-bottom-right{bottom:calc(66px + env(safe-area-inset-bottom, 0px));}
  .kp-top-left, .kp-top-right, .kp-bottom-left, .kp-bottom-right{left:0; right:0; padding:10px;}
  .kp-top-left .kp-box, .kp-top-right .kp-box, .kp-bottom-left .kp-box, .kp-bottom-right .kp-box{width:100%;}
  .kp-top .kp-box, .kp-bottom .kp-box{flex-wrap:wrap;}
}
.kp-preview{z-index:400;}
@media (prefers-reduced-motion:reduce){.kp{transition:none; transform:none !important;}}
