:root{
    --bg:#07111f;
    --bg2:#0b1730;
    --card:rgba(255,255,255,.105);
    --card2:rgba(255,255,255,.075);
    --text:#f8fbff;
    --muted:#aebbd0;
    --muted2:#7f8ea7;
    --line:rgba(148,163,184,.22);
    --primary:#38bdf8;
    --primary2:#2563eb;
    --violet:#8b5cf6;
    --cyan:#22d3ee;
    --green:#34d399;
    --danger:#fb7185;
    --shadow:0 24px 70px rgba(0,0,0,.34),0 0 44px rgba(37,99,235,.14);
    --shadow-soft:0 12px 32px rgba(0,0,0,.28),0 0 26px rgba(34,211,238,.10);
    --radius:26px;
    --wp-composer-height:178px;
}

*{box-sizing:border-box}
html{scroll-padding-top:92px}
html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC","Segoe UI",sans-serif;color:var(--text);background:var(--bg);overflow-x:hidden;overscroll-behavior-y:contain}
body:before{content:"";position:fixed;inset:0;z-index:-3;background:radial-gradient(circle at 18% 5%,rgba(56,189,248,.28),transparent 30%),radial-gradient(circle at 84% 16%,rgba(139,92,246,.25),transparent 34%),radial-gradient(circle at 54% 58%,rgba(34,197,94,.10),transparent 35%),linear-gradient(180deg,#07111f 0%,#0b1730 48%,#08111f 100%)}
body:after{content:"";position:fixed;inset:0;z-index:-2;opacity:.42;background-image:linear-gradient(rgba(148,163,184,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.10) 1px,transparent 1px);background-size:38px 38px;mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.25) 74%,transparent)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.wp-app{min-height:100vh;padding:calc(env(safe-area-inset-top) + 14px) 16px calc(var(--wp-composer-height, 178px) + env(safe-area-inset-bottom));max-width:860px;margin:0 auto;position:relative}
.wp-app:before{content:"";position:fixed;left:50%;top:72px;width:min(720px,86vw);height:260px;transform:translateX(-50%);z-index:-1;background:linear-gradient(100deg,rgba(37,99,235,.24),rgba(34,211,238,.10),rgba(139,92,246,.18));filter:blur(34px);border-radius:999px;opacity:.92}
.wp-topbar{position:sticky;top:8px;z-index:10;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:10px 0 15px;background:linear-gradient(180deg,rgba(7,17,31,.92),rgba(7,17,31,.64) 72%,rgba(7,17,31,0));backdrop-filter:blur(18px)}
.wp-kicker{display:inline-flex;align-items:center;border:1px solid rgba(56,189,248,.34);background:linear-gradient(135deg,rgba(56,189,248,.16),rgba(139,92,246,.12));color:#9ee7ff;font-size:12px;font-weight:880;letter-spacing:.12em;text-transform:uppercase;border-radius:999px;padding:7px 12px;margin-bottom:10px;box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 0 24px rgba(56,189,248,.14)}
.wp-topbar h1{margin:0;font-size:31px;letter-spacing:-.055em;line-height:1.04;color:#fff;text-shadow:0 0 30px rgba(56,189,248,.24)}
.wp-topbar p{margin:7px 0 0;color:var(--muted);font-size:14px;line-height:1.35}
.wp-icon-btn{flex:0 0 auto;width:48px;height:48px;border:1px solid rgba(148,163,184,.20);background:linear-gradient(145deg,rgba(255,255,255,.15),rgba(255,255,255,.06));box-shadow:var(--shadow-soft);border-radius:18px;font-size:24px;color:#eff6ff;backdrop-filter:blur(18px)}
.wp-main{display:flex;flex-direction:column;gap:15px;position:relative}
.wp-status-card{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 18px 17px;border-radius:26px;background:linear-gradient(135deg,rgba(15,23,42,.88),rgba(30,64,175,.40) 52%,rgba(14,165,233,.18));box-shadow:var(--shadow);border:1px solid rgba(125,211,252,.20);color:var(--text);overflow:hidden;position:relative;backdrop-filter:blur(20px)}
.wp-status-card:before{content:"";position:absolute;right:-34px;top:-56px;width:162px;height:162px;border-radius:999px;background:radial-gradient(circle,rgba(56,189,248,.34),rgba(37,99,235,.15) 58%,transparent 72%);box-shadow:0 0 70px rgba(56,189,248,.18)}
.wp-status-card:after{content:"";position:absolute;left:18px;top:18px;width:58px;height:3px;border-radius:999px;background:linear-gradient(90deg,var(--green),var(--cyan),transparent);box-shadow:0 0 16px rgba(34,211,238,.55)}
.wp-status-card strong{display:block;font-size:18px;margin:13px 0 5px;color:#fff;letter-spacing:-.02em}
.wp-status-card span{display:block;color:#d7e2f3;font-size:13px;line-height:1.58;max-width:540px}
.wp-status-card em{position:relative;z-index:1;font-style:normal;font-size:12px;font-weight:900;border-radius:999px;background:rgba(56,189,248,.14);border:1px solid rgba(125,211,252,.32);padding:7px 11px;color:#dff8ff;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 0 22px rgba(56,189,248,.18)}

/* v0.48/v0.50 running pipeline status bar */
.wp-status-card > div{position:relative;z-index:1;min-width:0;flex:1}
.wp-status-card.wp-status-running:after{left:18px;top:18px;width:74px;height:4px;border-radius:999px;background:linear-gradient(90deg,rgba(52,211,153,0),rgba(52,211,153,.96),var(--cyan),rgba(37,99,235,.95),rgba(125,211,252,0));animation:wpPipelineTravel 1.35s cubic-bezier(.35,0,.18,1) infinite;box-shadow:0 0 18px rgba(34,211,238,.72),0 0 34px rgba(37,99,235,.24);will-change:transform,opacity}
.wp-pipeline{display:none;align-items:center;gap:7px;flex-wrap:wrap;margin-top:11px;padding-top:10px;border-top:1px solid rgba(125,211,252,.14);max-width:100%}
.wp-status-card.wp-status-running .wp-pipeline{display:flex}
.wp-pipeline span{position:relative;display:inline-flex;align-items:center;height:24px;border-radius:999px;padding:0 9px 0 22px;background:rgba(15,23,42,.42);border:1px solid rgba(125,211,252,.18);color:#aebbd0;font-size:11px;font-weight:850;line-height:1;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.wp-pipeline span:before{content:"";position:absolute;left:8px;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:999px;background:rgba(148,163,184,.52);box-shadow:0 0 0 rgba(56,189,248,0)}
.wp-pipeline span:nth-child(1){color:#dcfce7;border-color:rgba(52,211,153,.26);background:rgba(16,185,129,.10)}
.wp-pipeline span:nth-child(1):before{background:var(--green);box-shadow:0 0 12px rgba(52,211,153,.60)}
.wp-pipeline span:nth-child(2){color:#e0f7ff;border-color:rgba(56,189,248,.38);background:rgba(56,189,248,.14);box-shadow:0 0 22px rgba(56,189,248,.12),inset 0 1px 0 rgba(255,255,255,.10)}
.wp-pipeline span:nth-child(2):before{background:var(--cyan);animation:wpPipelinePulse 1.05s ease-in-out infinite;box-shadow:0 0 14px rgba(34,211,238,.72)}
.wp-pipeline span:nth-child(3):before{animation:wpPipelineSoft 1.45s ease-in-out infinite .25s}
.wp-pipeline span:nth-child(4):before{animation:wpPipelineSoft 1.45s ease-in-out infinite .50s}
@keyframes wpPipelineTravel{0%{transform:translateX(0);opacity:.25}12%{opacity:1}78%{opacity:1}100%{transform:translateX(min(238px,calc(100vw - 185px)));opacity:.25}}
@keyframes wpPipelinePulse{0%,100%{transform:scale(1);opacity:.82}50%{transform:scale(1.45);opacity:1}}
@keyframes wpPipelineSoft{0%,100%{opacity:.40;box-shadow:0 0 0 rgba(56,189,248,0)}50%{opacity:.95;background:rgba(125,211,252,.88);box-shadow:0 0 10px rgba(56,189,248,.42)}}
@media (max-width:420px){
    .wp-pipeline{gap:5px;margin-top:9px;padding-top:9px}
    .wp-pipeline span{height:22px;padding:0 7px 0 19px;font-size:10.5px}
    .wp-pipeline span:before{left:7px;width:6px;height:6px;margin-top:-3px}
    .wp-status-card.wp-status-running:after{width:58px;animation-duration:1.18s}
}
@media (prefers-reduced-motion:reduce){.wp-status-card.wp-status-running:after{animation:none;opacity:.9;transform:translateX(0)}}

.wp-gallery{display:grid;grid-template-columns:1fr;gap:14px;min-height:220px}
.wp-empty{position:relative;display:flex;min-height:250px;align-items:center;justify-content:center;flex-direction:column;gap:9px;border:1px dashed rgba(125,211,252,.38);background:linear-gradient(160deg,rgba(255,255,255,.10),rgba(255,255,255,.055));border-radius:28px;color:var(--muted);text-align:center;padding:32px;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 18px 50px rgba(0,0,0,.18);backdrop-filter:blur(18px);overflow:hidden}
.wp-empty:before{content:"✦";position:absolute;top:34px;font-size:30px;color:rgba(125,211,252,.58);text-shadow:0 0 24px rgba(56,189,248,.55)}
.wp-empty:after{content:"";position:absolute;inset:auto 18% 28px;height:1px;background:linear-gradient(90deg,transparent,rgba(125,211,252,.45),transparent)}
.wp-empty b{color:#f8fbff;font-size:18px;letter-spacing:-.02em;margin-top:38px}
.wp-empty span{font-size:14px;line-height:1.55;max-width:285px;color:#aebbd0}
.wp-error{position:relative;display:flex;min-height:220px;align-items:center;justify-content:center;flex-direction:column;gap:10px;border:1px solid rgba(248,113,113,.28);background:linear-gradient(160deg,rgba(127,29,29,.18),rgba(255,255,255,.05));border-radius:28px;color:#fecaca;text-align:center;padding:30px 24px;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 18px 50px rgba(0,0,0,.18);backdrop-filter:blur(18px);overflow:hidden}
.wp-error:before{content:'!';position:absolute;top:30px;width:42px;height:42px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:rgba(248,113,113,.12);border:1px solid rgba(248,113,113,.24);font-size:22px;font-weight:900;color:#fecaca;box-shadow:0 0 24px rgba(248,113,113,.16)}
.wp-error b{color:#fff;font-size:18px;letter-spacing:-.02em;margin-top:42px}
.wp-error span{font-size:14px;line-height:1.7;max-width:320px;color:#fecaca;white-space:pre-wrap;word-break:break-word}
.wp-card{background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.07));border:1px solid rgba(125,211,252,.20);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;backdrop-filter:blur(18px)}
.wp-card img{display:block;width:100%;height:auto;background:#111827}
.wp-card img.wp-output-image{cursor:zoom-in;touch-action:manipulation}
.wp-card img.wp-output-image:focus-visible{outline:2px solid rgba(34,211,238,.75);outline-offset:3px;border-radius:10px}
.wp-card-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;background:rgba(7,17,31,.38)}
.wp-card-actions span{font-size:12px;color:#b9c8dc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wp-card-actions a{flex:0 0 auto;text-decoration:none;border-radius:999px;background:linear-gradient(135deg,var(--cyan),var(--primary2));color:#fff;font-size:13px;font-weight:850;padding:8px 12px;box-shadow:0 10px 24px rgba(37,99,235,.26)}
.wp-history-wrap{padding:2px 0 10px}
.wp-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.wp-section-head h2{margin:0;font-size:18px;letter-spacing:-.02em;color:#f8fbff;text-shadow:0 0 22px rgba(56,189,248,.13)}
.wp-section-head button{border:0;background:transparent;color:#93a4bd;font-size:13px;padding:6px 0}
.wp-history{display:flex;gap:10px;overflow:auto;padding-bottom:6px;scrollbar-width:none}
.wp-history::-webkit-scrollbar{display:none}
.wp-history-item{min-width:148px;width:148px;border:1px solid rgba(148,163,184,.18);border-radius:19px;background:linear-gradient(180deg,rgba(255,255,255,.105),rgba(255,255,255,.065));padding:10px;box-shadow:0 14px 34px rgba(0,0,0,.20);backdrop-filter:blur(16px);color:#fff;text-align:left}
.wp-history-item img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:14px;background:#111827;display:block;margin-bottom:8px;border:1px solid rgba(255,255,255,.08)}
.wp-history-item strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#f8fbff}
.wp-history-item span{display:block;color:#92a4bc;font-size:11px;margin-top:4px}
.wp-composer{position:fixed;left:50%;bottom:0;z-index:30;width:min(860px,100%);transform:translate3d(-50%,0,0);padding:9px 14px calc(8px + env(safe-area-inset-bottom));background:linear-gradient(180deg,rgba(7,17,31,0),rgba(7,17,31,.72) 18%,rgba(7,17,31,.96));backdrop-filter:blur(18px)}
.wp-composer form{background:linear-gradient(180deg,rgba(15,23,42,.92),rgba(15,23,42,.76));border:1px solid rgba(125,211,252,.22);border-radius:28px;box-shadow:0 -14px 56px rgba(0,0,0,.34),0 0 42px rgba(37,99,235,.16);padding:10px;backdrop-filter:blur(20px);max-height:min(46vh,360px);overflow:visible}
.wp-composer textarea{display:block;width:100%;border:0;outline:0;resize:none;min-height:48px;max-height:118px;padding:8px 10px 5px;font-size:16px;line-height:1.42;background:transparent;color:#f8fbff;overflow-y:auto}
.wp-composer textarea::placeholder{color:#8393ab}
.wp-controls-row,.wp-advanced,.wp-action-row{display:flex;gap:8px;align-items:center;padding:5px 2px 0}
.wp-controls-row{overflow:auto;scrollbar-width:none}
.wp-controls-row::-webkit-scrollbar{display:none}
.wp-upload-btn input{display:none}
.wp-upload-btn span,.wp-secondary,.wp-primary,.wp-controls-row select,.wp-advanced select{height:40px;border-radius:999px;border:1px solid rgba(148,163,184,.20);background:rgba(255,255,255,.08);padding:0 13px;display:inline-flex;align-items:center;justify-content:center;color:#e5edf8;font-weight:780;font-size:14px;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(0,0,0,.14);backdrop-filter:blur(12px)}
.wp-controls-row select,.wp-advanced select{appearance:none;min-width:78px;text-align:center;color:#eff6ff;background-color:rgba(255,255,255,.08)}
.wp-controls-row select option,.wp-advanced select option{color:#111827;background:#fff}
.wp-advanced{display:none;grid-template-columns:1fr 1fr 1fr}
.wp-advanced.show{display:grid}
.wp-advanced select{width:100%;min-width:0}
.wp-action-row{justify-content:space-between;padding-top:8px}
.wp-secondary{background:rgba(255,255,255,.07);color:#c7d4e6;min-width:72px}
.wp-primary{border:0;background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);color:#fff;height:42px;border-radius:999px;padding:0 22px;font-weight:900;box-shadow:0 13px 28px rgba(37,99,235,.36),0 0 30px rgba(34,211,238,.18)}
.wp-primary:disabled{opacity:.58;box-shadow:none}
.wp-ref-preview{display:flex;gap:8px;overflow:auto;padding:0 2px 2px;scrollbar-width:none}
.wp-ref-preview::-webkit-scrollbar{display:none}
.wp-ref-chip{position:relative;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.08);border:1px solid rgba(148,163,184,.20);border-radius:15px;padding:6px;min-width:46px;min-height:46px;flex:0 0 auto}
.wp-ref-chip img{width:34px;height:34px;object-fit:cover;border-radius:10px;background:#111827;display:block}
.wp-ref-remove{position:absolute;top:-6px;right:-6px;width:19px;height:19px;border:none;border-radius:50%;background:rgba(15,23,42,.95);color:#fff;font-size:14px;line-height:19px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.35);cursor:pointer;padding:0}
.wp-modal{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;background:rgba(3,7,18,.58);padding:22px;backdrop-filter:blur(14px)}
.wp-modal[hidden]{display:none}
.wp-modal-card{width:min(380px,100%);background:linear-gradient(180deg,rgba(15,23,42,.95),rgba(15,23,42,.88));border:1px solid rgba(125,211,252,.22);border-radius:28px;padding:22px;box-shadow:0 30px 90px rgba(0,0,0,.42),0 0 42px rgba(56,189,248,.15);color:#fff}
.wp-modal-card h2{margin:0 0 8px;font-size:22px}
.wp-modal-card p{margin:0 0 16px;color:var(--muted);font-size:14px;line-height:1.6}
.wp-modal-card input{width:100%;height:48px;border:1px solid rgba(148,163,184,.22);border-radius:16px;padding:0 14px;outline:none;background:rgba(255,255,255,.08);color:#fff}
.wp-modal-card button{width:100%;height:48px;border:0;border-radius:16px;background:linear-gradient(135deg,var(--cyan),var(--primary2));color:#fff;font-weight:850;margin-top:12px}
.wp-toast{position:fixed;left:50%;bottom:calc(var(--wp-composer-height, 178px) + 12px + env(safe-area-inset-bottom));z-index:110;transform:translateX(-50%);max-width:min(360px,calc(100% - 30px));background:rgba(15,23,42,.94);border:1px solid rgba(125,211,252,.22);color:#fff;border-radius:999px;padding:11px 16px;font-size:14px;box-shadow:0 18px 48px rgba(0,0,0,.34);text-align:center;backdrop-filter:blur(14px)}
.wp-toast[hidden]{display:none}
.wp-loading{position:relative;overflow:hidden;min-height:220px;background:linear-gradient(160deg,rgba(255,255,255,.10),rgba(255,255,255,.06));border-radius:var(--radius);box-shadow:var(--shadow);border:1px solid rgba(125,211,252,.20);display:flex;align-items:center;justify-content:center;color:#c7d4e6;font-weight:800;backdrop-filter:blur(18px)}
.wp-loading:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(56,189,248,.16),transparent);animation:wpShimmer 1.1s infinite;transform:translateX(-100%)}
@keyframes wpShimmer{to{transform:translateX(100%)}}
@media (max-width:420px){
    .wp-app{padding-left:13px;padding-right:13px;padding-bottom:calc(var(--wp-composer-height, 178px) + env(safe-area-inset-bottom))}
    .wp-topbar h1{font-size:30px}
    .wp-status-card{padding:16px;border-radius:24px}
    .wp-empty{min-height:236px;border-radius:24px}
    .wp-composer{padding-left:12px;padding-right:12px}
    .wp-composer textarea{max-height:104px}
    .wp-primary{padding:0 18px}
}
@media (min-width:680px){
    .wp-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
    .wp-composer form{padding:12px}
}

/* v0.10 composer compact layout: one-row controls + paper-plane send button */
:root{--wp-composer-height:126px;}
.wp-app{padding-bottom:calc(var(--wp-composer-height, 126px) + env(safe-area-inset-bottom));}
.wp-composer{padding:7px 14px calc(7px + env(safe-area-inset-bottom));}
.wp-composer form{position:relative;border-radius:24px;padding:10px 10px 9px;max-height:min(34vh,248px);}
.wp-prompt-wrap{position:relative;min-height:42px;}
.wp-composer textarea{min-height:40px;max-height:86px;padding:7px 58px 6px 8px;font-size:16px;line-height:1.36;}
.wp-controls-row{display:flex;align-items:center;gap:7px;flex-wrap:nowrap;overflow:visible;padding:7px 0 0;}
.wp-upload-btn span,.wp-secondary,.wp-controls-row select,.wp-advanced select{height:36px;border-radius:999px;padding:0 10px;font-size:13px;font-weight:820;flex:0 0 auto;}
.wp-upload-btn span{width:76px;padding:0 8px;}
.wp-controls-row select{appearance:none;min-width:0;text-align:center;background-color:rgba(255,255,255,.08);}
#size{width:64px;}
#quality{width:54px;}
#n{width:58px;}
.wp-secondary{width:58px;min-width:58px;padding:0;}
.wp-primary{position:absolute;right:1px;top:0;width:44px;height:44px;border:0;border-radius:17px;padding:0;font-size:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);box-shadow:0 12px 26px rgba(37,99,235,.40),0 0 26px rgba(34,211,238,.22);}
.wp-primary:before{content:'➤';display:block;color:#fff;font-size:22px;line-height:1;transform:rotate(-38deg) translate(1px,-1px);text-shadow:0 0 18px rgba(255,255,255,.38);}
.wp-primary:disabled{opacity:.62;box-shadow:none;}
.wp-primary.wp-submit-busy:before{content:'···';font-size:22px;letter-spacing:1px;transform:none;margin-top:-6px;}
.wp-primary.wp-submit-locked:before{content:'···';font-size:22px;letter-spacing:1px;transform:none;margin-top:-6px;}
.wp-primary.wp-submit-locked{opacity:.55;box-shadow:none;cursor:not-allowed;}
.wp-primary:disabled:not(.wp-submit-busy):not(.wp-submit-locked):before{content:'➤';}
.wp-action-row{display:none!important;}
.wp-advanced{padding:7px 0 0;gap:7px;}
.wp-toast{bottom:calc(var(--wp-composer-height, 126px) + 12px + env(safe-area-inset-bottom));}
@media (max-width:420px){
    .wp-app{padding-bottom:calc(var(--wp-composer-height, 126px) + env(safe-area-inset-bottom));}
    .wp-composer{padding-left:12px;padding-right:12px;}
    .wp-composer form{padding:10px 10px 9px;border-radius:23px;}
    .wp-composer textarea{min-height:40px;max-height:82px;padding-right:56px;}
    .wp-controls-row{gap:7px;}
    .wp-primary{width:43px;height:43px;border-radius:16px;}
}
@media (max-width:374px){
    .wp-controls-row{gap:5px;}
    .wp-upload-btn span{width:70px;font-size:12px;}
    #size{width:59px;} #quality{width:50px;} #n{width:54px;}
    .wp-secondary{width:54px;min-width:54px;font-size:12px;}
}


/* v0.11 keyboard + advanced popup polish */
:root{--wp-composer-height:106px;}
.wp-app{padding-bottom:calc(var(--wp-composer-height, 106px) + env(safe-area-inset-bottom));}
.wp-composer{padding:6px 14px calc(6px + env(safe-area-inset-bottom));}
.wp-keyboard-active .wp-composer{padding-bottom:6px;}
.wp-keyboard-active .wp-app{padding-bottom:calc(var(--wp-composer-height, 106px) + 6px);}
.wp-composer form{border-radius:22px;padding:9px;max-height:min(28vh,210px);}
.wp-prompt-wrap{min-height:38px;}
.wp-composer textarea{min-height:36px;max-height:72px;padding:5px 54px 4px 7px;font-size:15px;line-height:1.32;}
.wp-primary{right:0;top:0;width:40px;height:40px;border-radius:15px;}
.wp-primary:before{font-size:20px;}
.wp-controls-row{gap:6px;padding-top:6px;}
.wp-upload-btn span,.wp-secondary,.wp-controls-row select,.wp-advanced select{height:34px;font-size:12px;padding:0 8px;}
.wp-upload-btn span{width:72px;}
#size{width:58px;}
#quality{width:48px;}
#n{width:54px;}
.wp-secondary{width:54px;min-width:54px;}
.wp-advanced{position:absolute;left:9px;right:9px;bottom:calc(100% + 8px);z-index:8;display:none!important;grid-template-columns:1fr 72px 94px;gap:7px;padding:8px;border-radius:18px;border:1px solid rgba(125,211,252,.24);background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.88));box-shadow:0 18px 50px rgba(0,0,0,.34),0 0 28px rgba(34,211,238,.12);backdrop-filter:blur(18px);}
.wp-advanced.show{display:grid!important;}
.wp-advanced select{width:100%;min-width:0;height:34px;font-size:12px;}
.wp-ref-preview{max-height:42px;}
.wp-ref-chip{padding:5px;border-radius:13px;min-width:40px;min-height:40px;}
.wp-ref-chip img{width:30px;height:30px;border-radius:9px;}
.wp-ref-remove{top:-5px;right:-5px;width:18px;height:18px;font-size:13px;line-height:18px;}
.wp-toast{bottom:calc(var(--wp-composer-height, 106px) + 10px + env(safe-area-inset-bottom));}
.wp-keyboard-active .wp-toast{bottom:calc(var(--wp-composer-height, 106px) + 10px);}
@media (max-width:420px){
    .wp-app{padding-bottom:calc(var(--wp-composer-height, 106px) + env(safe-area-inset-bottom));}
    .wp-keyboard-active .wp-app{padding-bottom:calc(var(--wp-composer-height, 106px) + 6px);}
    .wp-composer{padding-left:12px;padding-right:12px;}
    .wp-composer form{padding:9px;border-radius:21px;}
    .wp-composer textarea{min-height:36px;max-height:68px;padding-right:52px;}
    .wp-primary{width:40px;height:40px;border-radius:15px;}
}
@media (max-width:374px){
    .wp-upload-btn span{width:66px;font-size:11px;}
    #size{width:54px;} #quality{width:46px;} #n{width:50px;}
    .wp-secondary{width:50px;min-width:50px;font-size:11px;}
    .wp-controls-row{gap:5px;}
}


/* v0.13 mobile zoom lock: prevent iPhone focus/pinch/double-tap zoom */
html{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
    touch-action:pan-x pan-y;
}
body,.wp-app{
    width:100%;
    max-width:100%;
    touch-action:pan-x pan-y;
}
input,select,textarea{
    font-size:16px!important;
}
.wp-composer textarea{
    font-size:16px!important;
    line-height:1.32;
}
.wp-controls-row select,.wp-advanced select,.wp-modal-card input{
    font-size:16px!important;
}
.wp-controls-row select{
    text-align:center;
    text-align-last:center;
}

/* v0.14 running task resume + elapsed timer */
.wp-loading{
    flex-direction:column;
    gap:12px;
    text-align:center;
}
.wp-loading-inner{
    position:relative;
    z-index:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:22px 18px;
}
.wp-loading-inner b{
    color:#f8fbff;
    font-size:17px;
    font-weight:600!important;
    letter-spacing:-.012em;
}
.wp-loading-prompt{
    display:-webkit-box;
    width:100%;
    max-width:320px;
    overflow:hidden;
    text-overflow:ellipsis;
    -webkit-line-clamp:2;
    line-clamp:2;
    -webkit-box-orient:vertical;
    line-height:1.34;
    word-break:break-word;
    white-space:normal;
    font-weight:600!important;
}
.wp-loading-inner span{
    color:#9fb0c8;
    font-size:13px;
    line-height:1.45;
}
.wp-loading .wp-loading-inner b.wp-loading-prompt{
    font-weight:600!important;
    text-shadow:0 1px 10px rgba(0,0,0,.16);
}
.wp-elapsed-badge{
    position:absolute;
    left:18px;
    bottom:16px;
    z-index:2;
    min-width:92px;
    height:32px;
    padding:0 12px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#bff7ff;
    font-size:12px;
    font-style:normal;
    font-weight:850;
    letter-spacing:.02em;
    background:linear-gradient(135deg,rgba(34,211,238,.16),rgba(37,99,235,.16));
    border:1px solid rgba(125,211,252,.28);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 0 24px rgba(34,211,238,.14);
    backdrop-filter:blur(12px);
}


/* v0.16 iOS Safari keyboard stability fix
   Safari has a known shaky behavior with fixed input bars that use transform/backdrop-filter.
   Keep the composer in fixed layout but remove transform based centering and simplify layers while keyboard is active. */
.wp-composer{
    left:0;
    right:0;
    margin-left:auto;
    margin-right:auto;
    transform:none!important;
    max-width:860px;
    width:100%;
    -webkit-transform:none!important;
}
.wp-composer,.wp-composer form,.wp-prompt-wrap,.wp-composer textarea{
    transform:none!important;
    -webkit-transform:none!important;
}
.wp-composer textarea{
    -webkit-user-select:text;
    user-select:text;
    caret-color:#38bdf8;
}
body.wp-ios-safari.wp-keyboard-active{
    overscroll-behavior:none;
}
body.wp-ios-safari.wp-keyboard-active .wp-composer{
    bottom:var(--wp-ios-composer-bottom, 0px);
    padding-bottom:6px!important;
    background:linear-gradient(180deg,rgba(7,17,31,0),rgba(7,17,31,.68) 18%,rgba(7,17,31,.96));
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-composer form,
body.wp-ios-safari.wp-keyboard-active .wp-primary,
body.wp-ios-safari.wp-keyboard-active .wp-upload-btn span,
body.wp-ios-safari.wp-keyboard-active .wp-secondary,
body.wp-ios-safari.wp-keyboard-active .wp-controls-row select{
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-composer form{
    box-shadow:0 -8px 32px rgba(0,0,0,.32),0 0 24px rgba(37,99,235,.12);
}
body.wp-ios-safari.wp-keyboard-active .wp-app{
    padding-bottom:calc(var(--wp-composer-height, 106px) + 10px)!important;
}
body.wp-ios-safari .wp-controls-row{
    overflow:hidden;
}
body.wp-ios-safari .wp-composer textarea,
body.wp-ios-safari .wp-controls-row select,
body.wp-ios-safari .wp-advanced select{
    font-size:16px!important;
}


/* v0.17 iOS Safari focus mode: remove fixed composer while keyboard is open.
   Safari misplaces textarea caret when a focused textarea lives inside a fixed/glass panel.
   In focus mode the composer participates in normal document flow and Safari can scroll it naturally. */
body.wp-ios-safari.wp-keyboard-active .wp-composer{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    top:auto!important;
    width:100%!important;
    max-width:none!important;
    margin:12px 0 0!important;
    padding:0 0 12px!important;
    background:transparent!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    z-index:5!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-app{
    padding-bottom:18px!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-main{
    padding-bottom:0!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-composer form{
    max-height:none!important;
    box-shadow:0 10px 34px rgba(0,0,0,.30),0 0 24px rgba(37,99,235,.12)!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-composer textarea{
    position:relative!important;
    display:block!important;
    opacity:1!important;
    transform:none!important;
    -webkit-transform:none!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-toast{
    bottom:18px!important;
}
body.wp-ios-safari.wp-keyboard-active .wp-advanced{
    bottom:calc(100% + 8px)!important;
}


/* v0.21 history action modal */
.wp-history-modal[hidden]{display:none}
.wp-history-modal{position:fixed;inset:0;z-index:130;display:flex;align-items:flex-end;justify-content:center;padding:18px 14px calc(18px + env(safe-area-inset-bottom))}
.wp-history-modal-mask{position:absolute;inset:0;background:rgba(2,6,23,.58);backdrop-filter:blur(12px)}
.wp-history-modal-card{position:relative;width:min(420px,100%);border:1px solid rgba(125,211,252,.24);border-radius:26px;background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.90));box-shadow:0 24px 80px rgba(0,0,0,.45),0 0 34px rgba(34,211,238,.13);padding:14px;color:#f8fafc}
.wp-history-modal-head{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 10px}
.wp-history-modal-head strong{font-size:17px}
.wp-history-modal-head button{width:34px;height:34px;border:none;border-radius:50%;background:rgba(255,255,255,.08);color:#fff;font-size:24px;line-height:1}
.wp-history-modal-preview{width:100%;aspect-ratio:var(--wp-preview-ratio, 16/9);max-height:42vh;border-radius:18px;background:rgba(255,255,255,.06);border:1px solid rgba(148,163,184,.18);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#94a3b8}
.wp-history-modal-preview img{width:100%;height:100%;object-fit:contain;background:rgba(2,6,23,.28)}
.wp-history-modal-text{margin:10px 0 12px;max-height:64px;overflow:auto;color:#cbd5e1;font-size:14px;line-height:1.55;background:rgba(255,255,255,.05);border:1px solid rgba(148,163,184,.14);border-radius:16px;padding:10px 12px}
.wp-history-modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.wp-history-modal-actions button{height:42px;border-radius:15px;border:1px solid rgba(125,211,252,.22);background:rgba(255,255,255,.08);color:#eef6ff;font-weight:850}
.wp-history-modal-actions button[data-action="both"]{background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);border:none;color:#fff}
.wp-history-modal-actions button[data-action="view"]{grid-column:1 / -1}
@media (max-width:420px){
    .wp-history-modal{padding-left:12px;padding-right:12px}
    .wp-history-modal-card{border-radius:24px}
    .wp-history-modal-actions button{height:40px;font-size:13px}
}


/* v0.24 custom size picker: keep bottom button short, modal shows full ratios */
.wp-native-select-hidden{display:none!important}
.wp-size-button{height:36px;border-radius:999px;padding:0 10px;font-size:13px;font-weight:820;flex:0 0 auto;width:64px;border:1px solid rgba(148,163,184,.22);background:rgba(255,255,255,.08);color:#eff6ff;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(0,0,0,.14);backdrop-filter:blur(12px)}
.wp-size-modal[hidden]{display:none}
.wp-size-modal{position:fixed;inset:0;z-index:135;display:flex;align-items:flex-end;justify-content:center;padding:18px 14px calc(18px + env(safe-area-inset-bottom))}
.wp-size-modal-mask{position:absolute;inset:0;background:rgba(2,6,23,.56);backdrop-filter:blur(12px)}
.wp-size-modal-card{position:relative;width:min(400px,100%);border:1px solid rgba(125,211,252,.24);border-radius:26px;background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.90));box-shadow:0 24px 80px rgba(0,0,0,.45),0 0 34px rgba(34,211,238,.13);padding:14px;color:#f8fafc}
.wp-size-modal-head{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 10px}
.wp-size-modal-head strong{font-size:17px}
.wp-size-modal-head button{width:34px;height:34px;border:none;border-radius:50%;background:rgba(255,255,255,.08);color:#fff;font-size:24px;line-height:1}
.wp-size-modal-list{display:grid;gap:8px;max-height:min(52vh,430px);overflow:auto;padding:2px}
.wp-size-modal-item{height:48px;border-radius:16px;border:1px solid rgba(148,163,184,.18);background:rgba(255,255,255,.06);color:#eef6ff;display:flex;align-items:center;justify-content:space-between;padding:0 14px;font-weight:850;text-align:left}
.wp-size-modal-item em{font-style:normal;color:#93a4bd;font-size:13px;font-weight:780}
.wp-size-modal-item.active{border-color:rgba(56,189,248,.66);background:linear-gradient(135deg,rgba(34,211,238,.22),rgba(124,58,237,.18));box-shadow:inset 0 0 0 1px rgba(56,189,248,.18)}
@media (max-width:374px){
    .wp-size-button{width:59px;font-size:12px}
}


/* v0.26 compact size picker + tap stability */
.wp-size-modal{padding:14px 14px calc(14px + env(safe-area-inset-bottom));align-items:flex-end}
.wp-size-modal-card{width:min(380px,100%);border-radius:22px;padding:12px}
.wp-size-modal-head{padding:0 0 8px}
.wp-size-modal-head strong{font-size:16px}
.wp-size-modal-head button{width:32px;height:32px;font-size:22px}
.wp-size-modal-list{gap:6px;max-height:min(46vh,360px);padding:0}
.wp-size-modal-item{height:42px;border-radius:14px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.wp-size-modal-item span{font-size:15px;font-weight:900}
.wp-size-modal-item em{font-size:13px;font-weight:820;color:#9fb0c7}
.wp-size-modal-item.active{background:linear-gradient(135deg,rgba(34,211,238,.20),rgba(37,99,235,.18));border-color:rgba(56,189,248,.72)}
.wp-size-button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
@media (max-width:420px){
    .wp-size-modal{padding-left:10px;padding-right:10px}
    .wp-size-modal-card{border-radius:20px;padding:10px}
    .wp-size-modal-list{gap:5px;max-height:min(44vh,330px)}
    .wp-size-modal-item{height:40px;border-radius:13px}
}


/* v0.27 history modal action labels */
.wp-history-modal-actions button{white-space:nowrap}
.wp-history-modal-actions button[data-action="both"]{font-size:15px}
@media (max-width:374px){.wp-history-modal-actions button[data-action="both"]{font-size:13px}}


/* v0.28 history modal labels cleanup */
.wp-history-modal-actions button[data-action="refs"],
.wp-history-modal-actions button[data-action="both"]{font-size:15px}
@media (max-width:374px){
    .wp-history-modal-actions button[data-action="refs"],
    .wp-history-modal-actions button[data-action="both"]{font-size:13px}
}


/* v0.29 history modal action layout */
.wp-history-modal-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
}
.wp-history-modal-actions button[data-action="both"]{
    grid-column:1 / -1;
    white-space:nowrap;
}
.wp-history-modal-actions button[data-action="prompt"],
.wp-history-modal-actions button[data-action="refs"]{
    white-space:nowrap;
}
@media (max-width:374px){
    .wp-history-modal-actions button[data-action="both"],
    .wp-history-modal-actions button[data-action="prompt"],
    .wp-history-modal-actions button[data-action="refs"]{font-size:13px}
}


/* v0.30 history modal loading state */
.wp-history-loading[hidden]{display:none}
.wp-history-loading{display:flex;align-items:center;gap:10px;margin:10px 0 12px;padding:10px 12px;border-radius:15px;border:1px solid rgba(56,189,248,.24);background:rgba(14,165,233,.10);color:#c8f2ff;font-size:14px;font-weight:800}
.wp-history-loading i{width:16px;height:16px;border-radius:50%;border:2px solid rgba(203,213,225,.35);border-top-color:#22d3ee;animation:wpSpin .8s linear infinite;flex:0 0 auto}
.wp-history-modal.is-busy .wp-history-modal-actions button,
.wp-history-modal.is-busy .wp-history-modal-head button{opacity:.55;pointer-events:none}
@keyframes wpSpin{to{transform:rotate(360deg)}}


/* v0.31 image preview modal */
.wp-ref-chip{cursor:pointer}
.wp-image-preview-modal[hidden]{display:none}
.wp-image-preview-modal{
    position:fixed;
    inset:0;
    z-index:145;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:18px 14px calc(18px + env(safe-area-inset-bottom));
}
.wp-image-preview-mask{
    position:absolute;
    inset:0;
    background:rgba(2,6,23,.72);
    backdrop-filter:blur(14px);
}
.wp-image-preview-card{
    position:relative;
    width:min(560px,100%);
    max-height:calc(100vh - 72px - env(safe-area-inset-bottom));
    border:1px solid rgba(125,211,252,.24);
    border-radius:26px;
    background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.91));
    box-shadow:0 24px 90px rgba(0,0,0,.50),0 0 42px rgba(34,211,238,.13);
    padding:14px;
    color:#f8fafc;
    display:flex;
    flex-direction:column;
}
.wp-image-preview-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:2px 2px 12px;
}
.wp-image-preview-head strong{font-size:17px}
.wp-image-preview-head button{
    width:36px;
    height:36px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:25px;
    line-height:1;
}
.wp-image-preview-stage{
    width:100%;
    min-height:220px;
    max-height:calc(100vh - 150px - env(safe-area-inset-bottom));
    border-radius:20px;
    border:1px solid rgba(148,163,184,.18);
    background:rgba(2,6,23,.40);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
.wp-image-preview-stage img{
    max-width:100%;
    max-height:calc(100vh - 170px - env(safe-area-inset-bottom));
    width:auto;
    height:auto;
    object-fit:contain;
    display:block;
}
@media (max-width:420px){
    .wp-image-preview-modal{padding:12px 10px calc(12px + env(safe-area-inset-bottom))}
    .wp-image-preview-card{border-radius:24px;padding:12px;max-height:calc(100vh - 48px - env(safe-area-inset-bottom))}
    .wp-image-preview-stage{max-height:calc(100vh - 128px - env(safe-area-inset-bottom))}
    .wp-image-preview-stage img{max-height:calc(100vh - 148px - env(safe-area-inset-bottom))}
}


/* v0.32 custom quality/count pickers */
.wp-param-button{
    height:36px;
    border-radius:999px;
    padding:0 10px;
    font-size:13px;
    font-weight:820;
    flex:0 0 auto;
    border:1px solid rgba(148,163,184,.22);
    background:rgba(255,255,255,.08);
    color:#eff6ff;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(0,0,0,.14);
    backdrop-filter:blur(12px);
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
}
.wp-param-button-quality{width:54px}
.wp-param-button-count{width:58px}
.wp-param-modal .wp-size-modal-card{width:min(360px,100%)}
.wp-param-modal .wp-size-modal-list{max-height:min(42vh,320px)}
@media (max-width:374px){
    .wp-param-button-quality{width:50px;font-size:12px}
    .wp-param-button-count{width:54px;font-size:12px}
}


/* v0.33 OpenAI-style size/quality labels */
.wp-size-button{width:74px}
.wp-size-modal-item em:empty{display:none}
.wp-size-modal-item span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wp-size-modal-item{justify-content:flex-start}
.wp-size-modal-item.active{background:linear-gradient(135deg,rgba(34,211,238,.22),rgba(37,99,235,.20))}
.wp-param-modal .wp-size-modal-item{justify-content:flex-start}
.wp-param-modal .wp-size-modal-item span{font-size:16px}
.wp-param-button-quality{width:58px}
@media (max-width:374px){
    .wp-size-button{width:68px}
    .wp-param-button-quality{width:54px}
}


/* v0.34 unify parameter modal width with image size modal */
.wp-param-modal .wp-size-modal-card{
    width:min(380px,100%) !important;
}
.wp-param-modal .wp-size-modal-list{
    max-height:min(46vh,360px);
}


/* v0.41 input reference thumbnails in running/result cards */
.wp-card{position:relative;}
.wp-input-ref-thumbs{
    position:absolute;
    left:16px;
    top:16px;
    z-index:4;
    display:flex;
    align-items:center;
    gap:0;
    pointer-events:auto;
}
.wp-input-ref-thumbs.is-output{
    left:12px;
    top:12px;
}
.wp-input-ref-thumbs.is-output-bar{
    position:static;
    left:auto;
    top:auto;
    z-index:auto;
    flex:0 0 auto;
    gap:0;
}
.wp-input-ref-thumb{
    width:46px;
    height:46px;
    padding:3px;
    margin-right:-9px;
    border-radius:15px;
    border:1px solid rgba(203,213,225,.36);
    background:rgba(15,23,42,.70);
    box-shadow:0 10px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.18);
    backdrop-filter:blur(12px);
    overflow:hidden;
}
.wp-input-ref-thumbs.is-output .wp-input-ref-thumb{
    width:42px;
    height:42px;
    border-radius:14px;
}
.wp-input-ref-thumbs.is-output-bar .wp-input-ref-thumb{
    width:42px;
    height:42px;
    border-radius:14px;
}
.wp-input-ref-thumb img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    border-radius:11px!important;
    margin:0!important;
    border:0!important;
    background:#111827;
}
.wp-input-ref-more{
    min-width:28px;
    height:28px;
    padding:0 8px;
    margin-left:2px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#e0f7ff;
    background:rgba(15,23,42,.78);
    border:1px solid rgba(125,211,252,.34);
    box-shadow:0 8px 20px rgba(0,0,0,.24);
    font-size:12px;
    font-weight:850;
}
.wp-history-ref-thumb{
    opacity:.76;
    filter:saturate(.92);
}
@media (max-width:420px){
    .wp-input-ref-thumbs{left:14px;top:14px;}
    .wp-input-ref-thumb{width:44px;height:44px;border-radius:14px;}
    .wp-input-ref-thumbs.is-output .wp-input-ref-thumb{width:40px;height:40px;}
    .wp-input-ref-thumbs.is-output-bar .wp-input-ref-thumb{width:40px;height:40px;}
}

/* v0.53 output image linear action icons in bottom info bar */
.wp-output-media{
    position:relative;
    overflow:hidden;
    background:#111827;
}
.wp-output-media .wp-output-image{
    display:block;
    width:100%;
    height:auto;
}
.wp-output-card-actions{
    justify-content:space-between;
    gap:12px;
    min-height:58px;
}
.wp-output-card-actions > span{
    display:none;
}
.wp-output-tools{
    position:static;
    z-index:auto;
    flex:0 0 auto;
    margin-left:auto;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:12px;
    padding:0;
    border-radius:0;
    background:transparent;
    border:0;
    box-shadow:none;
    backdrop-filter:none;
}
.wp-card-actions .wp-output-tool,
.wp-card-actions a.wp-output-tool,
.wp-card-actions button.wp-output-tool{
    width:28px;
    height:28px;
    padding:0;
    border:0;
    border-radius:999px;
    background:transparent;
    color:#dbeafe;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    cursor:pointer;
    box-shadow:none;
    -webkit-tap-highlight-color:transparent;
}
.wp-card-actions .wp-output-tool svg{
    width:22px;
    height:22px;
    display:block;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;
    filter:none;
}
.wp-card-actions .wp-output-tool:active{
    transform:scale(.94);
}
.wp-card-actions .wp-output-tool:focus-visible{
    outline:2px solid rgba(34,211,238,.85);
    outline-offset:3px;
}
@media (max-width:420px){
    .wp-output-card-actions{gap:10px;padding:12px 14px}
    .wp-output-tools{gap:10px}
    .wp-card-actions .wp-output-tool,
    .wp-card-actions a.wp-output-tool,
    .wp-card-actions button.wp-output-tool{width:27px;height:27px}
    .wp-card-actions .wp-output-tool svg{width:21px;height:21px}
}

/* v0.67 history cards: only success tasks show generated result image */
 .wp-history-placeholder{
    width:100%;
    aspect-ratio:1/1;
    border-radius:14px;
    margin-bottom:8px;
    border:1px solid rgba(255,255,255,.08);
    background:linear-gradient(145deg,rgba(15,23,42,.78),rgba(30,41,59,.52));
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:7px;
    text-align:center;
    color:#9fb0c7;
    font-size:13px;
    font-weight:850;
    line-height:1.35;
    padding:10px;
}
.wp-history-placeholder.is-running{
    color:#c7f2ff;
    border-color:rgba(56,189,248,.24);
    background:
        radial-gradient(circle at 50% 36%,rgba(34,211,238,.20),transparent 42%),
        linear-gradient(145deg,rgba(14,165,233,.13),rgba(30,41,59,.48));
}
.wp-history-placeholder.is-running:before{
    content:"";
    width:24px;
    height:24px;
    border-radius:999px;
    border:2px solid rgba(203,213,225,.24);
    border-top-color:#22d3ee;
    border-right-color:#60a5fa;
    box-shadow:0 0 22px rgba(34,211,238,.18);
    animation:wpSpin .9s linear infinite;
}
.wp-history-placeholder.is-failed{
    color:#fecaca;
    border-color:rgba(248,113,113,.22);
    background:linear-gradient(145deg,rgba(127,29,29,.20),rgba(30,41,59,.46));
}
.wp-history-placeholder.is-failed:before{
    content:"!";
    width:24px;
    height:24px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(248,113,113,.30);
    background:rgba(248,113,113,.12);
    color:#fecaca;
    font-size:14px;
    font-weight:900;
}
.wp-history-placeholder.is-empty{
    color:#94a3b8;
}

/* v0.62 landscape history card width-only adaptive layout: keep card/thumb height uniform */
.wp-history-item.wp-history-landscape{
    min-width:186px;
    width:186px;
}
.wp-history-item.wp-history-landscape img{
    aspect-ratio:auto;
    height:128px;
    min-height:128px;
    max-height:128px;
    object-fit:contain;
}
@media (max-width:420px){
    .wp-history-item.wp-history-landscape{
        min-width:176px;
        width:176px;
    }
    .wp-history-item.wp-history-landscape img{
        height:128px;
        min-height:128px;
        max-height:128px;
    }
}


/* v0.68 hard guard: non-success history cards never show reference/result image */
.wp-history-item[data-status-type]:not([data-status-type="success"]) > img{
    display:none!important;
}
.wp-history-item[data-status-type]:not([data-status-type="success"]){
    width:var(--wp-history-card-width, 142px)!important;
}
.wp-history-item[data-status-type]:not([data-status-type="success"]).wp-history-landscape{
    width:var(--wp-history-card-width, 142px)!important;
}
.wp-history-item[data-status-type]:not([data-status-type="success"]) .wp-history-placeholder{
    display:flex!important;
}


/* v0.69 stronger guard: any non-success history card must never display image covers */
.wp-history-item.wp-history-non-success img,
.wp-history-item[data-status-type="running"] img,
.wp-history-item[data-status-type="failed"] img,
.wp-history-item[data-status="running"] img,
.wp-history-item[data-status="pending"] img,
.wp-history-item[data-status="processing"] img,
.wp-history-item[data-status="submitting"] img,
.wp-history-item[data-status="failed"] img,
.wp-history-item[data-status="error"] img{
    display:none!important;
}
.wp-history-item.wp-history-non-success,
.wp-history-item[data-status-type="running"],
.wp-history-item[data-status-type="failed"],
.wp-history-item[data-status="running"],
.wp-history-item[data-status="pending"],
.wp-history-item[data-status="processing"],
.wp-history-item[data-status="submitting"],
.wp-history-item[data-status="failed"],
.wp-history-item[data-status="error"]{
    min-width:var(--wp-history-card-width, 142px)!important;
    width:var(--wp-history-card-width, 142px)!important;
}
.wp-history-item.wp-history-non-success .wp-history-placeholder,
.wp-history-item[data-status-type="running"] .wp-history-placeholder,
.wp-history-item[data-status-type="failed"] .wp-history-placeholder,
.wp-history-item[data-status="running"] .wp-history-placeholder,
.wp-history-item[data-status="pending"] .wp-history-placeholder,
.wp-history-item[data-status="processing"] .wp-history-placeholder,
.wp-history-item[data-status="submitting"] .wp-history-placeholder,
.wp-history-item[data-status="failed"] .wp-history-placeholder,
.wp-history-item[data-status="error"] .wp-history-placeholder{
    display:flex!important;
}


/* v0.75 top clear-history button */
.wp-clear-history-btn svg{width:24px;height:24px;display:block;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.wp-clear-history-btn:disabled{opacity:.55;pointer-events:none}

/* v0.77 clear button and custom confirm modal */
.wp-icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
}
.wp-clear-history-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0;
}
.wp-clear-history-btn svg{
    width:25px;
    height:25px;
    display:block;
    flex:0 0 auto;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.wp-confirm-modal{
    position:fixed;
    inset:0;
    z-index:80;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:22px;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
}
.wp-confirm-modal.show{
    opacity:1;
    pointer-events:auto;
}
.wp-confirm-mask{
    position:absolute;
    inset:0;
    background:rgba(2,6,23,.70);
    backdrop-filter:blur(14px);
}
.wp-confirm-card{
    position:relative;
    width:min(360px, calc(100vw - 44px));
    border-radius:26px;
    padding:24px 20px 18px;
    color:#f8fafc;
    background:
        radial-gradient(circle at 85% 8%, rgba(14,165,233,.26), transparent 38%),
        linear-gradient(145deg, rgba(15,23,42,.96), rgba(17,24,39,.94));
    border:1px solid rgba(125,211,252,.24);
    box-shadow:0 26px 80px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.08);
    transform:translateY(10px) scale(.98);
    transition:transform .18s ease;
}
.wp-confirm-modal.show .wp-confirm-card{
    transform:translateY(0) scale(1);
}
.wp-confirm-close{
    position:absolute;
    right:14px;
    top:14px;
    width:34px;
    height:34px;
    border:0;
    border-radius:14px;
    color:#dbeafe;
    font-size:24px;
    line-height:1;
    background:rgba(148,163,184,.16);
}
.wp-confirm-icon{
    width:50px;
    height:50px;
    margin:0 auto 14px;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#bae6fd;
    background:linear-gradient(145deg, rgba(14,165,233,.22), rgba(99,102,241,.18));
    border:1px solid rgba(125,211,252,.28);
    box-shadow:0 0 32px rgba(14,165,233,.18);
}
.wp-confirm-icon svg{
    width:27px;
    height:27px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.wp-confirm-card strong{
    display:block;
    text-align:center;
    font-size:21px;
    letter-spacing:-.03em;
}
.wp-confirm-card p{
    margin:10px auto 18px;
    max-width:280px;
    text-align:center;
    color:#b8c5d8;
    font-size:14px;
    line-height:1.65;
}
.wp-confirm-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}
.wp-confirm-btn{
    height:46px;
    border-radius:16px;
    border:1px solid rgba(148,163,184,.18);
    font-weight:900;
    color:#e2e8f0;
    background:rgba(148,163,184,.14);
}
.wp-confirm-btn.is-danger{
    color:#fff;
    border-color:rgba(34,211,238,.38);
    background:linear-gradient(135deg,#22d3ee,#2563eb 54%,#7c3aed);
    box-shadow:0 12px 30px rgba(37,99,235,.26);
}
.wp-confirm-btn.is-cancel{
    background:rgba(15,23,42,.78);
}


/* v0.79 running pause icon polish */
.wp-primary.wp-submit-paused{
    opacity:1;
    cursor:pointer;
    position:absolute;
    overflow:hidden;
    box-shadow:0 12px 26px rgba(37,99,235,.35),0 0 26px rgba(34,211,238,.20);
}
.wp-primary.wp-submit-paused:before{
    content:'';
    width:24px;
    height:24px;
    display:block;
    transform:none;
    margin:0;
    border:1px solid rgba(255,255,255,.20);
    border-radius:999px;
    background:rgba(255,255,255,.10);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 0 14px rgba(255,255,255,.16);
}
.wp-primary.wp-submit-paused:after{
    content:'';
    position:absolute;
    left:50%;
    top:50%;
    width:5px;
    height:15px;
    border-radius:999px;
    background:#fff;
    box-shadow:8px 0 0 #fff,0 0 12px rgba(255,255,255,.20);
    transform:translate(-6.5px,-50%);
}
.wp-primary.wp-submit-paused:active{
    transform:scale(.96);
}

/* v0.83 WhalePix lightweight user login */
.wp-top-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.wp-user-badge{height:36px;max-width:116px;padding:0 12px;border-radius:999px;border:1px solid rgba(125,211,252,.24);background:rgba(15,23,42,.50);color:#cbd5e1;font-weight:850;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);backdrop-filter:blur(14px)}
.wp-user-badge.is-login{color:#dffbff;background:linear-gradient(135deg,rgba(14,165,233,.20),rgba(37,99,235,.16));border-color:rgba(56,189,248,.32)}
.wp-user-modal[hidden]{display:none}
.wp-user-modal{position:fixed;inset:0;z-index:95;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(2,6,23,.58);backdrop-filter:blur(16px)}
.wp-user-modal-mask{position:absolute;inset:0}
.wp-user-modal-card{position:relative;width:min(380px,calc(100vw - 44px));border-radius:28px;padding:24px 20px 20px;color:#f8fafc;background:radial-gradient(circle at 84% 6%,rgba(14,165,233,.30),transparent 38%),linear-gradient(145deg,rgba(15,23,42,.97),rgba(17,24,39,.94));border:1px solid rgba(125,211,252,.25);box-shadow:0 26px 90px rgba(0,0,0,.52),inset 0 1px 0 rgba(255,255,255,.08)}
.wp-user-modal-card h2{margin:8px 0 8px;font-size:24px;letter-spacing:-.04em}
.wp-user-modal-card p{margin:0 0 16px;color:#b8c5d8;font-size:14px;line-height:1.65}
.wp-user-modal-card input{width:100%;height:48px;margin:0 0 10px;padding:0 14px;border-radius:16px;border:1px solid rgba(148,163,184,.20);background:rgba(15,23,42,.72);color:#fff;outline:none}
.wp-user-modal-card input:focus{border-color:rgba(56,189,248,.62);box-shadow:0 0 0 4px rgba(56,189,248,.12)}
.wp-user-modal-card button{width:100%;height:48px;margin-top:4px;border:0;border-radius:16px;background:linear-gradient(135deg,#22d3ee,#2563eb 54%,#7c3aed);color:#fff;font-weight:900;box-shadow:0 12px 30px rgba(37,99,235,.26)}
.wp-user-modal-card button[hidden]{display:none}
.wp-user-modal-card #wpLogoutBtn{margin-top:10px;background:rgba(148,163,184,.14);color:#dbeafe;border:1px solid rgba(148,163,184,.18);box-shadow:none}
@media (max-width:420px){.wp-top-actions{gap:8px}.wp-user-badge{max-width:86px;height:34px;padding:0 10px;font-size:12px}.wp-topbar{align-items:flex-start}}

/* v0.88 logged-in account popup: show user info instead of login form */
.wp-user-modal-close{
    position:absolute;
    right:14px;
    top:14px;
    width:38px!important;
    height:38px!important;
    margin:0!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.08)!important;
    border:1px solid rgba(148,163,184,.18)!important;
    color:#dbeafe!important;
    font-size:26px!important;
    line-height:1!important;
    box-shadow:none!important;
}
.wp-user-modal.is-login .wp-user-modal-close{display:none}
.wp-account-pane .wp-kicker{display:inline-flex;margin-bottom:10px}
.wp-account-pane h2{margin:0 44px 6px 0!important;font-size:27px!important;line-height:1.12;letter-spacing:-.05em}
.wp-account-sub{margin:0 0 16px!important;color:#b8c5d8!important;font-size:14px!important;line-height:1.55!important}
.wp-account-sub b{color:#e0f7ff;font-weight:900}
.wp-account-stats{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
    margin:14px 0;
    padding:10px;
    border-radius:18px;
    border:1px solid rgba(148,163,184,.16);
    background:rgba(15,23,42,.46);
}
.wp-account-stats div{
    min-width:0;
    text-align:center;
    padding:8px 4px;
    border-radius:14px;
    background:rgba(255,255,255,.045);
}
.wp-account-stats strong{display:block;color:#f8fafc;font-size:20px;line-height:1.1;font-weight:950}
.wp-account-stats span{display:block;margin-top:5px;color:#91a4bd;font-size:11px;font-weight:850;white-space:nowrap}
.wp-account-info{display:grid;gap:8px;margin:12px 0 14px}
.wp-account-info div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:42px;
    padding:0 12px;
    border-radius:14px;
    background:rgba(255,255,255,.055);
    border:1px solid rgba(148,163,184,.13);
}
.wp-account-info span{color:#91a4bd;font-size:13px;font-weight:820;white-space:nowrap}
.wp-account-info b{color:#e2e8f0;font-size:13px;font-weight:850;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wp-user-modal.is-account .wp-user-modal-card{padding-top:24px}
.wp-user-modal.is-account #wpLogoutBtn{display:block;margin-top:12px;background:rgba(148,163,184,.14);color:#dbeafe;border:1px solid rgba(148,163,184,.18);box-shadow:none}
@media (max-width:420px){
    .wp-account-stats{gap:6px;padding:8px}
    .wp-account-stats strong{font-size:18px}
    .wp-account-stats span{font-size:10px}
    .wp-account-info div{padding:0 10px}
}

/* v0.98 result image preview zoom: zoom only the image inside preview modal, not the output card */
.wp-image-preview-modal{
    overscroll-behavior:contain;
}
.wp-image-preview-card{
    touch-action:none;
}
.wp-image-preview-actions{
    display:flex;
    align-items:center;
    gap:8px;
}
.wp-image-preview-actions button{
    width:36px;
    height:36px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:25px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
}
#imagePreviewReset{
    min-width:42px;
    width:auto;
    padding:0 10px;
    border-radius:999px;
    font-size:13px;
    font-weight:900;
    letter-spacing:.02em;
    color:#c8f2ff;
    background:rgba(14,165,233,.16);
    border:1px solid rgba(125,211,252,.18);
}
.wp-image-preview-stage{
    position:relative;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
    cursor:zoom-in;
}
.wp-image-preview-stage img{
    transform:translate3d(0,0,0) scale(1);
    transform-origin:center center;
    transition:transform .12s ease-out;
    will-change:transform;
    user-select:none;
    -webkit-user-drag:none;
    cursor:zoom-in;
}
.wp-image-preview-stage img.is-zoomed{
    cursor:grab;
    transition:none;
}
.wp-image-preview-stage:active img.is-zoomed{
    cursor:grabbing;
}
.wp-image-preview-hint{
    position:absolute;
    left:50%;
    bottom:12px;
    transform:translateX(-50%);
    padding:7px 11px;
    border-radius:999px;
    background:rgba(2,6,23,.56);
    border:1px solid rgba(125,211,252,.16);
    color:rgba(226,232,240,.78);
    font-size:12px;
    font-weight:800;
    pointer-events:none;
    white-space:nowrap;
    opacity:.88;
}
@media (max-width:420px){
    .wp-image-preview-actions{gap:6px;}
    .wp-image-preview-actions button{width:34px;height:34px;font-size:23px;}
    #imagePreviewReset{min-width:40px;font-size:12px;padding:0 9px;}
    .wp-image-preview-hint{bottom:10px;font-size:11px;}
}

/* framework_patch_whalepix_v111_quota_top_status_red: quota insufficient top status should match failed state */
.wp-status-card.wp-status-failed{
    background:linear-gradient(135deg,rgba(40,10,20,.92),rgba(127,29,29,.52) 52%,rgba(244,63,94,.18))!important;
    border-color:rgba(248,113,113,.34)!important;
    box-shadow:0 18px 50px rgba(127,29,29,.20), inset 0 1px 0 rgba(255,255,255,.08)!important;
}
.wp-status-card.wp-status-failed:before{
    background:radial-gradient(circle,rgba(248,113,113,.32),rgba(127,29,29,.18) 58%,transparent 72%)!important;
    box-shadow:0 0 70px rgba(248,113,113,.16)!important;
}
.wp-status-card.wp-status-failed:after{
    background:linear-gradient(90deg,rgba(248,113,113,.98),rgba(244,63,94,.72),transparent)!important;
    box-shadow:0 0 18px rgba(248,113,113,.58)!important;
}
.wp-status-card.wp-status-failed em{
    background:rgba(248,113,113,.14)!important;
    border-color:rgba(248,113,113,.42)!important;
    color:#ffe4e6!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 0 22px rgba(248,113,113,.18)!important;
}
.wp-status-card.wp-status-failed span{color:#ffe4e6!important;}

/* framework_patch_whalepix_v113_failed_status_blue_card_red_text: keep failed top status blue, only text/emphasis turns red */
.wp-status-card.wp-status-failed{
    background:linear-gradient(135deg,rgba(15,23,42,.88),rgba(30,64,175,.40) 52%,rgba(14,165,233,.18))!important;
    border-color:rgba(125,211,252,.20)!important;
    box-shadow:var(--shadow)!important;
}
.wp-status-card.wp-status-failed:before{
    background:radial-gradient(circle,rgba(56,189,248,.34),rgba(37,99,235,.15) 58%,transparent 72%)!important;
    box-shadow:0 0 70px rgba(56,189,248,.18)!important;
}
.wp-status-card.wp-status-failed:after{
    background:linear-gradient(90deg,rgba(248,113,113,.98),rgba(244,63,94,.72),transparent)!important;
    box-shadow:0 0 18px rgba(248,113,113,.50)!important;
}
.wp-status-card.wp-status-failed strong{
    color:#fecaca!important;
}
.wp-status-card.wp-status-failed span{
    color:#fecaca!important;
}
.wp-status-card.wp-status-failed em{
    background:rgba(248,113,113,.13)!important;
    border-color:rgba(248,113,113,.38)!important;
    color:#ffe4e6!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 0 22px rgba(248,113,113,.16)!important;
}

/* framework_patch_whalepix_v114_failed_top_status_default: failed/quota top card keeps normal blue card, red only stays in middle error card */
.wp-status-card.wp-status-failed{
  background:linear-gradient(135deg,rgba(15,23,42,.88),rgba(30,64,175,.40) 52%,rgba(14,165,233,.18))!important;
  border-color:rgba(125,211,252,.20)!important;
  box-shadow:var(--shadow)!important;
}
.wp-status-card.wp-status-failed:before{
  background:radial-gradient(circle,rgba(56,189,248,.34),rgba(37,99,235,.15) 58%,transparent 72%)!important;
  box-shadow:0 0 70px rgba(56,189,248,.18)!important;
}
.wp-status-card.wp-status-failed:after{
  background:linear-gradient(90deg,var(--green),var(--cyan),transparent)!important;
  box-shadow:0 0 16px rgba(34,211,238,.55)!important;
}
.wp-status-card.wp-status-failed strong{
  color:#fff!important;
}
.wp-status-card.wp-status-failed span{
  color:#d7e2f3!important;
}
.wp-status-card.wp-status-failed em{
  background:rgba(56,189,248,.14)!important;
  border-color:rgba(125,211,252,.32)!important;
  color:#dff8ff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 0 22px rgba(56,189,248,.18)!important;
}

/* v1.16 top action menu: replace standalone clear icon with menu actions */
.wp-top-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;position:relative;z-index:22;flex:0 0 auto}
.wp-top-menu-wrap{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.wp-top-menu-btn svg{width:24px;height:24px;display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:2.35;stroke-linecap:round;stroke-linejoin:round}
.wp-top-menu{position:absolute;right:0;top:calc(100% + 10px);z-index:60;min-width:142px;padding:8px;border:1px solid rgba(125,211,252,.24);border-radius:18px;background:linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.90));box-shadow:0 20px 58px rgba(0,0,0,.42),0 0 26px rgba(34,211,238,.12);backdrop-filter:blur(20px)}
.wp-top-menu[hidden]{display:none!important}
.wp-top-menu:before{content:"";position:absolute;right:18px;top:-6px;width:12px;height:12px;transform:rotate(45deg);background:rgba(15,23,42,.96);border-left:1px solid rgba(125,211,252,.20);border-top:1px solid rgba(125,211,252,.20)}
.wp-top-menu button{position:relative;z-index:1;width:100%;border:0;border-radius:13px;background:transparent;color:#eaf6ff;font-weight:850;font-size:14px;line-height:1.2;text-align:left;padding:12px 13px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.wp-top-menu button:hover,.wp-top-menu button:focus{outline:0;background:rgba(56,189,248,.12)}
.wp-top-menu button+button{margin-top:4px;color:#fecaca}
.wp-top-menu button+button:hover,.wp-top-menu button+button:focus{background:rgba(248,113,113,.10)}
.wp-top-menu button:disabled{opacity:.48;cursor:not-allowed}
@media(max-width:420px){.wp-top-menu{min-width:132px;right:-2px}.wp-top-menu button{font-size:13.5px;padding:11px 12px}}


/* v1.18 expanded generation history panel */
body.wp-history-panel-open{overflow:hidden}
.wp-history-panel[hidden]{display:none!important}
.wp-history-panel{position:fixed;inset:0;z-index:180;display:flex;align-items:flex-end;justify-content:center;padding:14px 12px calc(14px + env(safe-area-inset-bottom));pointer-events:none}
.wp-history-panel.show{pointer-events:auto}
.wp-history-panel-mask{position:absolute;inset:0;background:rgba(2,6,23,.62);backdrop-filter:blur(13px);opacity:0;transition:opacity .16s ease}
.wp-history-panel.show .wp-history-panel-mask{opacity:1}
.wp-history-panel-card{position:relative;width:min(620px,100%);max-height:min(78vh,760px);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(125,211,252,.22);border-radius:28px;background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(10,18,32,.94));box-shadow:0 28px 92px rgba(0,0,0,.55),0 0 34px rgba(34,211,238,.12);color:#f8fafc;transform:translateY(18px) scale(.985);opacity:0;transition:transform .18s ease,opacity .18s ease}
.wp-history-panel.show .wp-history-panel-card{transform:translateY(0) scale(1);opacity:1}
.wp-history-panel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 18px 14px;border-bottom:1px solid rgba(148,163,184,.14)}
.wp-history-panel-head strong{display:block;font-size:20px;line-height:1.2;letter-spacing:-.02em;color:#fff}
.wp-history-panel-head span{display:block;margin-top:4px;font-size:12px;color:#8ea4bd;font-weight:700}
.wp-history-panel-close{width:42px;height:42px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:#dbeafe;font-size:28px;line-height:1;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.wp-history-panel-body{overflow:auto;padding:18px;scrollbar-width:thin;scrollbar-color:rgba(125,211,252,.34) transparent}
.wp-history-panel-section+ .wp-history-panel-section{margin-top:24px}
.wp-history-panel-section h3{margin:0 0 12px;font-size:16px;line-height:1.25;color:#f8fafc;font-weight:900;letter-spacing:-.01em}
.wp-history-panel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.wp-history-panel-item{border:0;border-radius:18px;background:rgba(255,255,255,.06);padding:0;overflow:hidden;box-shadow:0 12px 34px rgba(0,0,0,.22);min-width:0;color:#fff;text-align:left;position:relative}
.wp-history-panel-item img,.wp-history-panel-placeholder{width:100%;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;object-fit:cover;background:rgba(15,23,42,.82);border:1px solid rgba(255,255,255,.07);border-radius:18px}
.wp-history-panel-item span{position:absolute;left:7px;right:7px;bottom:7px;display:block;padding:6px 8px;border-radius:999px;background:rgba(2,6,23,.64);backdrop-filter:blur(10px);color:#eaf6ff;font-size:11px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
.wp-history-panel-placeholder{color:#9fb1c7;font-size:13px;font-weight:900;border-style:dashed;border-color:rgba(148,163,184,.22)}
.wp-history-panel-placeholder.is-running{color:#cffafe;background:linear-gradient(135deg,rgba(8,47,73,.72),rgba(15,23,42,.82))}
.wp-history-panel-placeholder.is-failed{color:#fecaca;background:linear-gradient(135deg,rgba(127,29,29,.34),rgba(15,23,42,.84))}
.wp-history-panel-loading,.wp-history-panel-empty{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#9fb1c7;font-size:14px;font-weight:800;gap:10px}
.wp-history-panel-loading i{width:28px;height:28px;border-radius:50%;border:3px solid rgba(148,163,184,.24);border-top-color:#22d3ee;animation:wpSpin .8s linear infinite}
.wp-history-panel-empty strong{color:#fff;font-size:18px}
.wp-history-panel-empty span{font-size:13px;color:#8ea4bd}
@media(max-width:420px){.wp-history-panel{padding:10px 10px calc(10px + env(safe-area-inset-bottom))}.wp-history-panel-card{max-height:80vh;border-radius:26px}.wp-history-panel-head{padding:16px 16px 12px}.wp-history-panel-body{padding:16px}.wp-history-panel-grid{gap:10px}.wp-history-panel-section h3{font-size:15px}.wp-history-panel-item span{font-size:10px;padding:5px 7px}}


/* v1.19 history panel record detail modal */
.wp-history-detail-meta{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin:10px 0 0;
}
.wp-history-detail-meta span{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:0 10px;
    border-radius:999px;
    border:1px solid rgba(148,163,184,.18);
    background:rgba(255,255,255,.06);
    color:#cbd5e1;
    font-size:12px;
    font-weight:850;
}
.wp-history-detail-meta[data-status-type="success"] span:first-child{color:#bbf7d0;border-color:rgba(34,197,94,.26);background:rgba(34,197,94,.10)}
.wp-history-detail-meta[data-status-type="running"] span:first-child{color:#cffafe;border-color:rgba(34,211,238,.26);background:rgba(34,211,238,.10)}
.wp-history-detail-meta[data-status-type="failed"] span:first-child{color:#fecaca;border-color:rgba(248,113,113,.26);background:rgba(248,113,113,.10)}
.wp-history-detail-modal .wp-history-modal-preview.is-running{border-color:rgba(34,211,238,.26);background:linear-gradient(135deg,rgba(8,47,73,.72),rgba(15,23,42,.82))}
.wp-history-detail-modal .wp-history-modal-preview.is-failed{border-color:rgba(248,113,113,.26);background:linear-gradient(135deg,rgba(127,29,29,.26),rgba(15,23,42,.84))}
.wp-history-detail-actions button[data-wide="1"]{grid-column:1 / -1;background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);border:none;color:#fff}
.wp-history-detail-actions button[data-close="1"]{background:rgba(255,255,255,.08);border:1px solid rgba(125,211,252,.22);color:#eef6ff}

/* v1.84 quota detail modal + top menu color cleanup */
.wp-top-menu button{color:#eaf6ff}
.wp-top-menu button+button{margin-top:4px;color:#eaf6ff}
.wp-top-menu button:hover,.wp-top-menu button:focus{background:rgba(56,189,248,.12)}
.wp-top-menu button.is-danger{color:#fecaca}
.wp-top-menu button.is-danger:hover,.wp-top-menu button.is-danger:focus{background:rgba(248,113,113,.10)}
.wp-quota-modal{z-index:92}
.wp-quota-modal .wp-confirm-card{width:min(420px, calc(100vw - 36px));padding:22px 18px 16px}
.wp-quota-intro{margin-bottom:12px!important}
.wp-quota-body{margin:0 0 14px}
.wp-quota-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 10px}
.wp-quota-summary div{border:1px solid rgba(125,211,252,.18);border-radius:16px;background:rgba(15,23,42,.55);padding:10px 8px;text-align:center}
.wp-quota-summary strong{font-size:19px;text-align:center;letter-spacing:-.03em;color:#f8fafc}
.wp-quota-summary span{display:block;margin-top:3px;font-size:12px;color:#94a3b8;white-space:nowrap}
.wp-quota-note{margin:0 0 10px;padding:9px 11px;border-radius:14px;border:1px solid rgba(34,211,238,.16);background:rgba(8,47,73,.25);color:#b8c5d8;font-size:12px;line-height:1.55;text-align:left}
.wp-quota-list{max-height:38vh;overflow:auto;display:grid;gap:8px;padding-right:2px}
.wp-quota-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid rgba(148,163,184,.14);border-radius:16px;background:rgba(255,255,255,.055);padding:10px 10px 10px 12px}
.wp-quota-row-main{min-width:0;display:flex;flex-direction:column;gap:3px}
.wp-quota-row-main strong{font-size:14px;text-align:left;letter-spacing:0;color:#f8fafc}
.wp-quota-row-main span{font-size:12px;color:#94a3b8;line-height:1.35}
.wp-quota-row-main em{font-style:normal;font-size:12px;color:#b8c5d8;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wp-quota-row>b{flex:0 0 auto;min-width:42px;height:34px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:900;background:rgba(148,163,184,.13);color:#cbd5e1}
.wp-quota-row.is-plus>b{background:rgba(34,197,94,.14);color:#86efac;border:1px solid rgba(34,197,94,.22)}
.wp-quota-row.is-minus>b{background:rgba(56,189,248,.13);color:#bae6fd;border:1px solid rgba(56,189,248,.22)}
.wp-quota-empty,.wp-quota-loading{min-height:118px;border:1px dashed rgba(148,163,184,.18);border-radius:18px;background:rgba(255,255,255,.04);display:flex;align-items:center;justify-content:center;text-align:center;color:#94a3b8;font-size:13px;line-height:1.55;padding:18px}
.wp-quota-empty.is-error{color:#fecaca;border-color:rgba(248,113,113,.20);background:rgba(127,29,29,.12)}
.wp-quota-loading{gap:10px}
.wp-quota-loading i{width:16px;height:16px;border-radius:50%;border:2px solid rgba(125,211,252,.20);border-top-color:#67e8f9;animation:wpSpin .82s linear infinite}
.wp-quota-actions{grid-template-columns:1fr}
@media(max-width:374px){.wp-quota-modal .wp-confirm-card{width:calc(100vw - 24px);padding-left:14px;padding-right:14px}.wp-quota-summary{gap:6px}.wp-quota-summary div{padding:9px 4px}.wp-quota-summary strong{font-size:17px}.wp-quota-row-main span,.wp-quota-row-main em{font-size:11.5px}}

/* v1.91 front feedback / usage guide modal style restore */
.wp-guide-modal,
.wp-feedback-modal{
    z-index:92;
}
.wp-guide-modal .wp-confirm-card,
.wp-feedback-modal .wp-confirm-card{
    width:min(380px, calc(100vw - 44px));
    padding:24px 20px 18px;
}
.wp-guide-modal .wp-confirm-card strong,
.wp-feedback-modal .wp-confirm-card strong{
    font-weight:900;
}
.wp-guide-list{
    display:grid;
    gap:12px;
    margin:18px 0 18px;
}
.wp-guide-list p{
    display:grid;
    grid-template-columns:28px minmax(0,1fr);
    align-items:flex-start;
    gap:10px;
    max-width:none!important;
    margin:0!important;
    text-align:left!important;
    color:#cbd5e1!important;
    font-size:14px!important;
    line-height:1.62!important;
}
.wp-guide-list b{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:28px;
    height:28px;
    border-radius:999px;
    color:#dff8ff;
    font-size:13px;
    font-weight:900;
    background:rgba(56,189,248,.13);
    border:1px solid rgba(125,211,252,.24);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}
.wp-guide-list span{
    display:block;
    min-width:0;
}
.wp-guide-actions{
    grid-template-columns:1fr;
}
.wp-guide-actions .wp-confirm-btn{
    width:100%;
}
.wp-feedback-intro{
    margin-bottom:14px!important;
}
.wp-feedback-textarea{
    display:block;
    width:100%;
    min-height:112px;
    resize:none;
    padding:13px 14px;
    border-radius:16px;
    border:1px solid rgba(125,211,252,.24);
    outline:0;
    background:rgba(15,23,42,.70);
    color:#f8fafc;
    font-size:14px;
    line-height:1.55;
    font-weight:700;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
    -webkit-appearance:none;
    appearance:none;
}
.wp-feedback-textarea::placeholder{
    color:rgba(184,197,216,.62);
    font-weight:700;
}
.wp-feedback-textarea:focus{
    border-color:rgba(56,189,248,.66);
    box-shadow:0 0 0 4px rgba(56,189,248,.13), inset 0 1px 0 rgba(255,255,255,.08);
}
.wp-feedback-textarea:disabled{
    opacity:.62;
}
.wp-feedback-upload{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    margin:12px 0 10px;
    border-radius:15px;
    border:1px dashed rgba(125,211,252,.34);
    background:rgba(56,189,248,.08);
    color:#dff8ff;
    font-size:14px;
    font-weight:900;
    cursor:pointer;
    overflow:hidden;
}
.wp-feedback-upload input{
    position:absolute;
    inset:0;
    opacity:0;
    width:100%;
    height:100%;
    cursor:pointer;
}
.wp-feedback-upload span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    pointer-events:none;
}
.wp-feedback-modal.is-submitting .wp-feedback-upload{
    opacity:.58;
    cursor:not-allowed;
}
.wp-feedback-preview{
    display:grid;
    gap:8px;
    min-height:40px;
    margin:0 0 12px;
}
.wp-feedback-empty{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:9px 12px;
    border-radius:14px;
    border:1px solid rgba(148,163,184,.14);
    background:rgba(255,255,255,.045);
    color:#91a4bd;
    font-size:12px;
    line-height:1.45;
    font-weight:800;
    text-align:center;
}
.wp-feedback-thumb{
    position:relative;
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    align-items:center;
    gap:10px;
    min-height:58px;
    padding:7px 40px 7px 7px;
    border-radius:16px;
    border:1px solid rgba(148,163,184,.16);
    background:rgba(255,255,255,.055);
}
.wp-feedback-thumb img,
.wp-feedback-thumb i{
    width:48px;
    height:48px;
    border-radius:12px;
    object-fit:cover;
    background:rgba(15,23,42,.78);
    border:1px solid rgba(255,255,255,.08);
}
.wp-feedback-thumb i{
    display:flex;
    align-items:center;
    justify-content:center;
    color:#91a4bd;
    font-size:12px;
    font-style:normal;
    font-weight:850;
}
.wp-feedback-thumb span{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#cbd5e1;
    font-size:12px;
    font-weight:820;
}
.wp-feedback-thumb button{
    position:absolute;
    right:9px;
    top:50%;
    transform:translateY(-50%);
    width:28px;
    height:28px;
    border:0;
    border-radius:999px;
    background:rgba(148,163,184,.14);
    color:#dbeafe;
    font-size:20px;
    line-height:1;
}
.wp-feedback-submit-tip{
    display:none;
    align-items:center;
    justify-content:center;
    gap:8px;
    margin:0 0 12px;
    padding:9px 11px;
    border-radius:14px;
    border:1px solid rgba(34,211,238,.16);
    background:rgba(8,47,73,.25);
    color:#c8f2ff;
    font-size:12px;
    line-height:1.45;
    font-weight:800;
    text-align:center;
}
.wp-feedback-modal.is-submitting .wp-feedback-submit-tip{
    display:flex;
}
.wp-feedback-spinner{
    width:15px;
    height:15px;
    border-radius:50%;
    border:2px solid rgba(125,211,252,.22);
    border-top-color:#67e8f9;
    animation:wpSpin .82s linear infinite;
    flex:0 0 auto;
}
.wp-feedback-actions{
    grid-template-columns:1fr 1fr;
}
.wp-feedback-actions .wp-confirm-btn:disabled,
.wp-feedback-modal .wp-confirm-close:disabled{
    opacity:.56;
    cursor:not-allowed;
}
@media(max-width:374px){
    .wp-guide-modal .wp-confirm-card,
    .wp-feedback-modal .wp-confirm-card{
        width:calc(100vw - 24px);
        padding-left:14px;
        padding-right:14px;
    }
    .wp-guide-list{gap:10px}
    .wp-guide-list p{grid-template-columns:26px minmax(0,1fr);gap:8px;font-size:13.5px!important}
    .wp-guide-list b{width:26px;height:26px;font-size:12px}
    .wp-feedback-textarea{min-height:104px;font-size:13.5px}
    .wp-feedback-actions{gap:10px}
}

/* v1.92 modal single-action button edge fix */
.wp-confirm-actions,
.wp-confirm-actions .wp-confirm-btn{
    box-sizing:border-box;
    min-width:0;
}
.wp-confirm-actions .wp-confirm-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    max-width:100%;
    overflow:hidden;
    margin:0;
}
.wp-quota-actions,
.wp-guide-actions{
    width:100%;
    padding:0 2px;
}
.wp-quota-actions .wp-confirm-btn,
.wp-guide-actions .wp-confirm-btn{
    justify-self:stretch;
    border-radius:16px;
}
@media(max-width:374px){
    .wp-quota-actions,
    .wp-guide-actions{padding:0 1px}
}

/* v1.93 single primary modal button right-edge rendering cleanup
   Fixes iOS/WebKit gradient/button edge bleed on the right rounded corner. */
.wp-quota-actions .wp-confirm-btn.is-danger,
.wp-guide-actions .wp-confirm-btn.is-danger{
    -webkit-appearance:none;
    appearance:none;
    border:0;
    border-radius:18px;
    background:linear-gradient(135deg,#22d3ee 0%,#2563eb 58%,#6d5dfc 100%);
    background-clip:padding-box;
    -webkit-background-clip:padding-box;
    overflow:hidden;
    transform:translateZ(0);
    -webkit-mask-image:-webkit-radial-gradient(white, black);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 10px 22px rgba(37,99,235,.18);
}
.wp-quota-actions .wp-confirm-btn.is-danger:focus,
.wp-guide-actions .wp-confirm-btn.is-danger:focus{
    outline:0;
}

/* v1.94 feedback modal submit button right-edge rendering cleanup
   Apply the same iOS/WebKit rounded-gradient clipping to the two-button feedback submit action. */
.wp-feedback-actions .wp-confirm-btn.is-danger{
    -webkit-appearance:none;
    appearance:none;
    position:relative;
    border:0;
    border-radius:18px;
    background:linear-gradient(135deg,#22d3ee 0%,#2563eb 58%,#6d5dfc 100%);
    background-clip:padding-box;
    -webkit-background-clip:padding-box;
    overflow:hidden;
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
    -webkit-mask-image:-webkit-radial-gradient(white, black);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 10px 22px rgba(37,99,235,.18);
}
.wp-feedback-actions .wp-confirm-btn.is-danger:focus{
    outline:0;
}

/* v1.95 clear-history confirm button right-edge rendering cleanup
   Apply the same rounded-gradient clipping to the generic clear-confirm primary action. */
.wp-confirm-actions:not(.wp-feedback-actions):not(.wp-quota-actions):not(.wp-guide-actions) .wp-confirm-btn.is-danger{
    -webkit-appearance:none;
    appearance:none;
    position:relative;
    border:0;
    border-radius:18px;
    background:linear-gradient(135deg,#22d3ee 0%,#2563eb 58%,#6d5dfc 100%);
    background-clip:padding-box;
    -webkit-background-clip:padding-box;
    overflow:hidden;
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
    -webkit-mask-image:-webkit-radial-gradient(white, black);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 10px 22px rgba(37,99,235,.18);
}
.wp-confirm-actions:not(.wp-feedback-actions):not(.wp-quota-actions):not(.wp-guide-actions) .wp-confirm-btn.is-danger:focus{
    outline:0;
}

/* v1.96 iOS keyboard composer height / visibility restore
   Keep the prompt bar compact while the native keyboard is open, and let JS scroll it back into the visible viewport. */
body.wp-ios-browser.wp-keyboard-active .wp-composer form{
    max-height:132px!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer textarea{
    min-height:36px!important;
    max-height:54px!important;
    line-height:1.32!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-controls-row{
    margin-top:8px;
}
body.wp-ios-browser.wp-keyboard-active .wp-ref-preview:not(:empty){
    max-height:54px;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer{
    scroll-margin-bottom:10px;
}

/* v1.99 iOS Safari: use custom top control pickers so model/format/background still respond after textarea focus */
.wp-control-button{
    height:34px;
    border-radius:999px;
    padding:0 10px;
    font-size:12px;
    font-weight:820;
    flex:0 0 auto;
    border:1px solid rgba(148,163,184,.22);
    background:rgba(255,255,255,.08);
    color:#eff6ff;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(0,0,0,.14);
    -webkit-backdrop-filter:blur(12px);
    backdrop-filter:blur(12px);
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    box-sizing:border-box;
}
.wp-control-button-model{width:190px;text-align:left;justify-content:flex-start;}
.wp-control-button-format{width:68px;text-align:center;}
.wp-control-button-background{width:108px;text-align:center;}
.wp-control-modal .wp-size-modal-card{width:min(390px,100%)}
.wp-control-modal .wp-size-modal-list{max-height:min(44vh,340px)}
.wp-control-modal .wp-size-modal-item{justify-content:flex-start}
.wp-control-modal .wp-size-modal-item span{font-size:16px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.wp-ios-safari.wp-keyboard-active .wp-control-button{
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
}
@media (max-width:420px){
    .wp-control-button-model{width:184px;}
    .wp-control-button-format{width:66px;}
    .wp-control-button-background{width:104px;}
}
@media (max-width:374px){
    .wp-control-button-model{width:160px;font-size:12px;}
    .wp-control-button-format{width:62px;font-size:12px;}
    .wp-control-button-background{width:96px;font-size:12px;}
}


/* v2.00: keep the advanced top control buttons inside the composer panel on small iPhone screens.
   The v1.99 custom picker buttons replaced native selects; fixed pixel widths could exceed
   the absolute advanced panel columns, especially for the background button. */
.wp-advanced{
    overflow:hidden;
}
.wp-advanced .wp-control-button{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding-left:8px;
    padding-right:8px;
}
.wp-advanced .wp-control-button-model{
    text-align:left;
}
.wp-advanced .wp-control-button-format,
.wp-advanced .wp-control-button-background{
    text-align:center;
}
@media (max-width:420px){
    .wp-advanced{
        grid-template-columns:minmax(0,1fr) 66px 96px!important;
        gap:7px;
    }
}
@media (max-width:374px){
    .wp-advanced{
        grid-template-columns:minmax(0,1fr) 60px 88px!important;
        gap:6px;
    }
    .wp-advanced .wp-control-button{
        font-size:11.5px;
        padding-left:7px;
        padding-right:7px;
    }
}


/* v2.05: iOS Safari keyboard transition gap guard.
   Keep the browser paint area dark while the native keyboard opens/closes, and avoid white overscroll flashes. */
html,
body,
body.wp-ios-browser,
body.wp-ios-browser.wp-keyboard-active{
    background-color:#07111f!important;
}
body.wp-ios-browser.wp-keyboard-active{
    overscroll-behavior-y:none;
}


/* v2.06: iOS keyboard + reference thumbnail compact containment.
   When reference images are present, the composer becomes taller. Keep the thumbnail row,
   prompt and parameter chips inside the composer panel instead of overflowing into the native keyboard. */
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref form{
    max-height:168px!important;
    overflow:hidden!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-preview:not(:empty){
    max-height:38px!important;
    min-height:36px;
    padding:0 2px 3px;
    margin:0 0 2px;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-chip{
    min-width:36px;
    min-height:36px;
    width:36px;
    height:36px;
    padding:3px;
    border-radius:12px;
    box-sizing:border-box;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-chip img{
    width:28px;
    height:28px;
    border-radius:8px;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-remove{
    top:0;
    right:0;
    width:16px;
    height:16px;
    font-size:12px;
    line-height:16px;
    box-shadow:0 3px 9px rgba(0,0,0,.32);
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-wrap{
    min-height:34px;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref textarea{
    min-height:34px!important;
    max-height:42px!important;
    padding-top:4px!important;
    padding-bottom:3px!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-controls-row{
    padding-top:5px!important;
    margin-top:0!important;
}

/* v2.13: iOS/WKWebView keyboard gap fix.
   Use the visualViewport-calculated top value to pin the composer just above the native keyboard.
   This replaces the old relative-in-document keyboard mode that could leave a large blank gap. */
body.wp-ios-browser.wp-keyboard-active .wp-composer{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:var(--wp-ios-composer-top, calc(100dvh - var(--wp-composer-height, 106px) - 8px))!important;
    bottom:auto!important;
    width:100%!important;
    max-width:860px!important;
    margin:0 auto!important;
    padding:0 14px 6px!important;
    background:linear-gradient(180deg,rgba(7,17,31,0),rgba(7,17,31,.64) 16%,rgba(7,17,31,.96))!important;
    z-index:60!important;
    transform:none!important;
    -webkit-transform:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    box-sizing:border-box;
    will-change:top;
}
body.wp-ios-browser.wp-keyboard-active .wp-app{
    padding-bottom:calc(var(--wp-composer-height, 106px) + 14px)!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-main{
    padding-bottom:0!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer form{
    max-height:132px!important;
    overflow:visible!important;
}
@supports not (height:100dvh){
    body.wp-ios-browser.wp-keyboard-active .wp-composer{
        top:var(--wp-ios-composer-top, calc(100vh - var(--wp-composer-height, 106px) - 8px))!important;
    }
}
@media (max-width:420px){
    body.wp-ios-browser.wp-keyboard-active .wp-composer{
        padding-left:12px!important;
        padding-right:12px!important;
    }
}

/* v2.14: iOS/WKWebView keyboard stutter reduction.
   The composer position is applied only after visualViewport settles in JS; keep the element
   free of CSS animation/compositor hints so WebKit does not animate every top recalculation. */
body.wp-ios-browser.wp-keyboard-active .wp-composer{
    transition:none!important;
    animation:none!important;
    will-change:auto!important;
    -webkit-backface-visibility:hidden;
    backface-visibility:hidden;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer form,
body.wp-ios-browser.wp-keyboard-active .wp-prompt-wrap,
body.wp-ios-browser.wp-keyboard-active .wp-controls-row{
    transition:none!important;
    animation:none!important;
}


/* v2.20: move advanced close button to the upper-right corner of the floating advanced panel.
   The v2.19 button was inserted as an extra pill in the row, which crowded the controls. */
.wp-advanced{
    grid-template-columns:minmax(0,1fr) 66px 96px!important;
    overflow:visible!important;
}
.wp-advanced .wp-advanced-close{
    appearance:none;
    -webkit-appearance:none;
    position:absolute;
    top:-14px;
    right:-8px;
    z-index:3;
    width:30px;
    min-width:30px;
    height:30px;
    border-radius:999px;
    border:1px solid rgba(148,163,184,.26);
    background:linear-gradient(180deg,rgba(30,41,59,.96),rgba(15,23,42,.92));
    color:#dbeafe;
    font-size:20px;
    font-weight:620;
    line-height:1;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0 0 2px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10),0 8px 22px rgba(0,0,0,.28),0 0 18px rgba(56,189,248,.10);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    -webkit-tap-highlight-color:transparent;
}
.wp-advanced .wp-advanced-close:active{
    transform:scale(.96);
    background:linear-gradient(180deg,rgba(51,65,85,.98),rgba(15,23,42,.94));
}
@media (max-width:374px){
    .wp-advanced{
        grid-template-columns:minmax(0,1fr) 60px 88px!important;
    }
    .wp-advanced .wp-advanced-close{
        width:28px;
        min-width:28px;
        height:28px;
        top:-13px;
        right:-7px;
        font-size:19px;
    }
}


/* v2.21: shorten advanced control bubbles and reserve space before the close button.
   Keep the upper-right close button independent while preventing the background pill from touching it. */
.wp-advanced{
    grid-template-columns:minmax(142px, 0.72fr) 62px 88px!important;
    justify-content:start;
    padding-right:42px!important;
    column-gap:7px!important;
}
.wp-advanced .wp-control-button-model{
    justify-content:flex-start!important;
    text-align:left!important;
    overflow:hidden;
    text-overflow:ellipsis;
}
.wp-advanced .wp-control-button-format,
.wp-advanced .wp-control-button-background{
    justify-content:center!important;
}
@media (max-width:374px){
    .wp-advanced{
        grid-template-columns:minmax(128px, 0.70fr) 58px 82px!important;
        padding-right:38px!important;
        column-gap:6px!important;
    }
    .wp-advanced .wp-control-button{
        font-size:11.5px;
        padding-left:7px;
        padding-right:7px;
    }
}

/* v2.23 result preview long-press save support */
.wp-output-image,
.wp-history-modal-preview img,
.wp-image-preview-stage img,
.wp-long-save-image{
    -webkit-touch-callout:default!important;
    -webkit-user-select:auto!important;
    user-select:auto!important;
    -webkit-user-drag:auto!important;
}
.wp-history-modal-preview{position:relative;}
.wp-history-save-hint{
    position:absolute;
    left:50%;
    bottom:10px;
    transform:translateX(-50%);
    padding:6px 10px;
    border-radius:999px;
    background:rgba(2,6,23,.58);
    border:1px solid rgba(125,211,252,.18);
    color:rgba(226,232,240,.82);
    font-size:12px;
    font-weight:850;
    line-height:1;
    white-space:nowrap;
    pointer-events:none;
    box-shadow:0 8px 20px rgba(0,0,0,.22);
}
#imagePreviewSave{
    min-width:48px;
    width:auto;
    padding:0 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:900;
    color:#e0faff;
    background:linear-gradient(135deg,rgba(34,211,238,.24),rgba(124,58,237,.24));
    border:1px solid rgba(125,211,252,.20);
}
@media (max-width:420px){
    .wp-history-save-hint{bottom:8px;font-size:11px;padding:6px 9px;}
    #imagePreviewSave{min-width:44px;font-size:12px;padding:0 10px;}
}

/* WhalePix v2.29 card recharge */
.wp-card-recharge-modal{z-index:93}
.wp-card-recharge-modal .wp-confirm-card{width:min(420px, calc(100vw - 36px));padding:22px 18px 16px}
.wp-card-recharge-intro{margin-bottom:13px!important}
.wp-card-recharge-body{display:grid;gap:10px;margin:0 0 14px;text-align:left}
.wp-card-code-label{display:grid;gap:8px;font-size:13px;color:#b8c5d8;font-weight:850}
.wp-card-code-input{width:100%;box-sizing:border-box;border:1px solid rgba(125,211,252,.22);border-radius:16px;background:rgba(15,23,42,.72);color:#f8fafc;min-height:48px;padding:0 14px;font-size:15px;font-weight:850;letter-spacing:.02em;outline:0;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
.wp-card-code-input:focus{border-color:rgba(56,189,248,.62);box-shadow:0 0 0 4px rgba(56,189,248,.12), inset 0 1px 0 rgba(255,255,255,.06)}
.wp-card-recharge-tip{margin:0;padding:9px 11px;border-radius:14px;border:1px solid rgba(34,211,238,.16);background:rgba(8,47,73,.25);color:#b8c5d8;font-size:12px;line-height:1.55;text-align:center}
.wp-card-recharge-message{border-radius:14px;padding:10px 11px;font-size:13px;line-height:1.5;font-weight:800;text-align:center}
.wp-card-recharge-message.is-success{border:1px solid rgba(34,197,94,.24);background:rgba(20,83,45,.20);color:#bbf7d0}
.wp-card-recharge-message.is-error{border:1px solid rgba(248,113,113,.24);background:rgba(127,29,29,.18);color:#fecaca}
.wp-card-recharge-actions{grid-template-columns:1fr 1.2fr}
.wp-card-recharge-actions .wp-confirm-btn{display:flex;align-items:center;justify-content:center;text-align:center}
.wp-card-recharge-actions .wp-confirm-btn:disabled{opacity:.62;cursor:not-allowed}
@media(max-width:374px){.wp-card-recharge-modal .wp-confirm-card{width:calc(100vw - 24px);padding-left:14px;padding-right:14px}.wp-card-recharge-actions{grid-template-columns:1fr}.wp-card-recharge-actions .wp-confirm-btn{width:100%}}



/* v2.38 redesigned top menu hamburger icon for embedded mobile browsers */
.wp-top-menu-btn{
    position:relative;
    color:#eaf6ff;
}
.wp-top-menu-btn svg{
    display:none!important;
}
.wp-top-menu-btn .wp-menu-bars{
    position:relative;
    display:block;
    width:18px;
    height:2px;
    flex:0 0 auto;
    border-radius:999px;
    background:linear-gradient(90deg,#f8fbff,#eef7ff);
    box-shadow:0 0 8px rgba(125,211,252,.16);
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
}
.wp-top-menu-btn .wp-menu-bars:before,
.wp-top-menu-btn .wp-menu-bars:after{
    content:"";
    position:absolute;
    left:50%;
    transform:translateX(-50%);
    -webkit-transform:translateX(-50%);
    height:2px;
    border-radius:999px;
    background:linear-gradient(90deg,#f8fbff,#eef7ff);
    box-shadow:0 0 8px rgba(125,211,252,.14);
}
.wp-top-menu-btn .wp-menu-bars:before{
    width:13px;
    top:-6px;
}
.wp-top-menu-btn .wp-menu-bars:after{
    width:13px;
    top:6px;
}
.wp-top-menu-btn:hover .wp-menu-bars,
.wp-top-menu-btn:focus-visible .wp-menu-bars,
.wp-top-menu-btn:hover .wp-menu-bars:before,
.wp-top-menu-btn:hover .wp-menu-bars:after,
.wp-top-menu-btn:focus-visible .wp-menu-bars:before,
.wp-top-menu-btn:focus-visible .wp-menu-bars:after{
    opacity:1;
}
.wp-top-menu-btn:active .wp-menu-bars{
    transform:scale(.96) translateZ(0);
    -webkit-transform:scale(.96) translateZ(0);
    opacity:.84;
}

/* v2.39 email register and password reset panels */
.wp-auth-extra-pane[hidden]{display:none!important}
.wp-auth-links{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.wp-auth-links:not(.is-center){padding:0 24px}
.wp-auth-links button{height:auto!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;color:#7dd3fc!important;font-size:13px!important;font-weight:720!important;line-height:1.4!important;letter-spacing:.01em!important}
.wp-auth-links button:hover,.wp-auth-links button:focus{color:#e0f7ff!important;outline:0!important}
.wp-auth-links.is-center{justify-content:center;margin-top:14px;padding:0}
@media (max-width:420px){.wp-auth-links:not(.is-center){padding:0 20px}.wp-auth-links button{font-weight:720!important}}
.wp-auth-code-row{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:8px;align-items:center}
.wp-auth-code-row input{margin-bottom:10px!important}
.wp-auth-code-row button{height:48px!important;margin:0 0 10px!important;border-radius:16px!important;background:rgba(56,189,248,.13)!important;border:1px solid rgba(125,211,252,.25)!important;color:#dffbff!important;box-shadow:none!important;font-size:13px!important;font-weight:900!important;white-space:nowrap!important}
.wp-auth-code-row button:disabled{opacity:.58!important;cursor:not-allowed!important}
.wp-user-modal.is-register .wp-user-modal-card,.wp-user-modal.is-reset .wp-user-modal-card{width:min(420px,calc(100vw - 34px));padding:24px 20px 20px}
.wp-user-modal.is-register .wp-user-modal-close,.wp-user-modal.is-reset .wp-user-modal-close{display:block}
.wp-user-modal.is-register .wp-user-modal-card h2,.wp-user-modal.is-reset .wp-user-modal-card h2{margin-right:44px}
@media(max-width:420px){
    .wp-auth-code-row{grid-template-columns:minmax(0,1fr) 104px;gap:7px}
    .wp-auth-code-row button{font-size:12px!important;padding:0 8px!important}
}


/* v2.40 Safari block: guide iPhone/iPad Safari users to WeChat Official Account */
body.wp-safari-blocked{
    min-height:100vh;
    overflow:hidden;
}
body.wp-safari-blocked:before{
    background:
        radial-gradient(circle at 18% 8%,rgba(56,189,248,.30),transparent 32%),
        radial-gradient(circle at 82% 12%,rgba(139,92,246,.25),transparent 34%),
        radial-gradient(circle at 50% 78%,rgba(34,211,238,.10),transparent 38%),
        linear-gradient(180deg,#07111f 0%,#0b1730 48%,#08111f 100%);
}
.wp-browser-block{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 18px);
    color:#f8fbff;
    background:
        radial-gradient(circle at 18% 10%,rgba(56,189,248,.22),transparent 36%),
        radial-gradient(circle at 86% 20%,rgba(139,92,246,.22),transparent 38%),
        rgba(7,17,31,.94);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}
.wp-browser-block[hidden]{display:none!important;}
.wp-browser-block-card{
    width:min(430px,100%);
    max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 36px);
    overflow:auto;
    border-radius:30px;
    padding:24px 22px 22px;
    text-align:center;
    border:1px solid rgba(125,211,252,.26);
    background:
        radial-gradient(circle at 82% 8%,rgba(56,189,248,.22),transparent 38%),
        linear-gradient(180deg,rgba(15,23,42,.96),rgba(15,23,42,.88));
    box-shadow:0 30px 90px rgba(0,0,0,.46),0 0 48px rgba(56,189,248,.16);
    backdrop-filter:blur(22px);
    -webkit-backdrop-filter:blur(22px);
}
.wp-browser-block-kicker{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:34px;
    padding:0 16px;
    margin-bottom:14px;
    border-radius:999px;
    border:1px solid rgba(56,189,248,.34);
    background:linear-gradient(135deg,rgba(56,189,248,.16),rgba(139,92,246,.12));
    color:#9ee7ff;
    font-size:12px;
    font-weight:900;
    letter-spacing:.16em;
    text-transform:uppercase;
}
.wp-browser-block-card h1{
    margin:0 0 10px;
    font-size:26px;
    line-height:1.2;
    letter-spacing:-.04em;
    color:#fff;
}
.wp-browser-block-card p{
    margin:0 auto 18px;
    max-width:350px;
    color:#b8c7dc;
    font-size:15px;
    line-height:1.75;
}
.wp-wechat-qr-box{
    position:relative;
    width:min(270px,78vw);
    margin:0 auto 16px;
    padding:12px;
    border-radius:28px;
    background:rgba(255,255,255,.96);
    box-shadow:0 18px 46px rgba(0,0,0,.34),0 0 34px rgba(34,211,238,.16);
}
.wp-wechat-qr-box:before{
    content:"";
    position:absolute;
    inset:-1px;
    border-radius:29px;
    border:1px solid rgba(125,211,252,.30);
    pointer-events:none;
}
.wp-wechat-qr-box img{
    display:block;
    width:100%;
    height:auto;
    border-radius:20px;
    background:#fff;
}
.wp-wechat-guide-tips{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:0 auto 16px;
    color:#dff8ff;
    font-size:14px;
    line-height:1.45;
    font-weight:850;
}
.wp-wechat-guide-tips span:last-child{
    color:#91a4bd;
    font-size:13px;
    font-weight:700;
}
.wp-browser-block-card button{
    width:100%;
    height:52px;
    border:0;
    border-radius:18px;
    background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);
    color:#fff;
    font-weight:900;
    font-size:16px;
    box-shadow:0 14px 32px rgba(37,99,235,.28),0 0 26px rgba(34,211,238,.18);
}
.wp-browser-block-card small{
    display:block;
    margin-top:14px;
    color:#8393ab;
    font-size:12px;
    line-height:1.65;
}

.wp-wechat-qr-box{
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}
.wp-wechat-qr-box:active{
    transform:scale(.985);
}
.wp-wechat-qr-action-hint{
    position:absolute;
    left:50%;
    bottom:13px;
    transform:translateX(-50%);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:24px;
    padding:0 12px;
    border-radius:999px;
    color:#eaf6ff;
    background:rgba(15,23,42,.72);
    border:1px solid rgba(125,211,252,.20);
    font-size:12px;
    font-weight:850;
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    box-shadow:0 8px 20px rgba(0,0,0,.20);
}
.wp-wechat-action-modal{
    position:fixed;
    inset:0;
    z-index:10020;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 18px);
}
.wp-wechat-action-modal[hidden]{display:none!important;}
.wp-wechat-action-mask{
    position:absolute;
    inset:0;
    background:rgba(3,7,18,.62);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}
.wp-wechat-action-card{
    position:relative;
    z-index:1;
    width:min(390px,100%);
    border-radius:30px;
    padding:22px 20px 20px;
    text-align:center;
    border:1px solid rgba(125,211,252,.26);
    background:
        radial-gradient(circle at 82% 8%,rgba(56,189,248,.22),transparent 38%),
        linear-gradient(180deg,rgba(15,23,42,.97),rgba(15,23,42,.90));
    box-shadow:0 30px 90px rgba(0,0,0,.48),0 0 48px rgba(56,189,248,.16);
    color:#f8fbff;
}
.wp-wechat-action-close{
    position:absolute;
    right:14px;
    top:14px;
    width:38px;
    height:38px;
    border:1px solid rgba(148,163,184,.20);
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#eaf6ff;
    font-size:24px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
}
.wp-wechat-action-card h2{
    margin:0 0 8px;
    font-size:24px;
    line-height:1.2;
    color:#fff;
    letter-spacing:-.03em;
}
.wp-wechat-action-card p{
    margin:0 auto 14px;
    max-width:300px;
    color:#b8c7dc;
    font-size:14px;
    line-height:1.7;
}
.wp-wechat-action-preview{
    width:min(190px,56vw);
    margin:0 auto 16px;
    padding:10px;
    border-radius:22px;
    background:rgba(255,255,255,.96);
    box-shadow:0 16px 38px rgba(0,0,0,.32);
}
.wp-wechat-action-preview img{
    display:block;
    width:100%;
    height:auto;
    border-radius:14px;
    background:#fff;
}
.wp-wechat-action-buttons{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:4px;
}
.wp-wechat-action-buttons button{
    height:48px;
    border:0;
    border-radius:17px;
    color:#fff;
    font-size:15px;
    font-weight:900;
    background:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed);
    box-shadow:0 14px 28px rgba(37,99,235,.24);
}
.wp-wechat-action-buttons button.is-soft{
    color:#dff8ff;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(125,211,252,.22);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}
.wp-wechat-action-buttons button:disabled{
    opacity:.58;
}
.wp-wechat-action-card small{
    display:block;
    margin-top:12px;
    color:#8fa2bc;
    font-size:12px;
    line-height:1.55;
}
body.wp-wechat-action-open{
    overflow:hidden;
}
@media (max-width:380px){
    .wp-wechat-action-card{padding:20px 17px 17px;border-radius:26px;}
    .wp-wechat-action-card h2{font-size:22px;}
    .wp-wechat-action-buttons{grid-template-columns:1fr;}
    .wp-wechat-action-preview{width:min(176px,54vw);}
}

@media (max-width:380px){
    .wp-browser-block-card{padding:21px 18px 18px;border-radius:26px;}
    .wp-browser-block-card h1{font-size:24px;}
    .wp-wechat-qr-box{width:min(246px,78vw);border-radius:24px;}
    .wp-wechat-qr-box img{border-radius:16px;}
}


/* v2.49 login remember password */
.wp-remember-password-row{
    margin:-2px 0 12px!important;
    display:inline-flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    color:#b8c5d8!important;
    font-size:13px!important;
    font-weight:560!important;
    line-height:1.3!important;
    cursor:pointer!important;
    width:auto!important;
    max-width:max-content!important;
    -webkit-tap-highlight-color:transparent;
}
.wp-remember-password-row input{
    width:17px!important;
    height:17px!important;
    min-height:17px!important;
    margin:0!important;
    padding:0!important;
    border-radius:6px!important;
    accent-color:#38bdf8;
    flex:0 0 auto!important;
}
.wp-remember-password-row span{
    display:inline-block!important;
    color:#b8c5d8!important;
    font-size:13px!important;
    font-weight:560!important;
}
.wp-auth-links:not(.is-center){padding:0 30px!important;}
.wp-auth-links button{font-weight:560!important;}
@media (max-width:420px){
    .wp-auth-links:not(.is-center){padding:0 28px!important;}
    .wp-auth-links button{font-weight:560!important;}
}




/* v2.52: card recharge modal keyboard hacks removed; main composer owns keyboard positioning. */
.wp-card-recharge-modal{overscroll-behavior:contain;}


/* v2.53: Mini Program / WeChat WebView keyboard composer stabilization.
   Use a CSS-driven bottom anchor for WeChat containers and keep the composer compact.
   This avoids unstable visualViewport top sampling that can leave the input box floating too high. */
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    top:auto!important;
    bottom:0!important;
    width:min(860px,100%)!important;
    max-width:860px!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0 12px calc(6px + env(safe-area-inset-bottom))!important;
    transform:translate3d(-50%,0,0)!important;
    -webkit-transform:translate3d(-50%,0,0)!important;
    background:linear-gradient(180deg,rgba(7,17,31,0),rgba(7,17,31,.72) 18%,rgba(7,17,31,.96))!important;
    z-index:70!important;
    box-sizing:border-box!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer form{
    height:auto!important;
    min-height:0!important;
    max-height:126px!important;
    padding:10px 10px 9px!important;
    overflow:visible!important;
    border-radius:23px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-prompt-wrap{
    min-height:40px!important;
    height:auto!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer textarea{
    min-height:40px!important;
    height:40px!important;
    max-height:54px!important;
    padding-top:7px!important;
    padding-bottom:6px!important;
    overflow-y:auto!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-controls-row{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    height:auto!important;
    min-height:36px!important;
    padding-top:7px!important;
    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-primary{
    top:0!important;
    right:1px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-app{
    padding-bottom:calc(var(--wp-composer-height, 126px) + env(safe-area-inset-bottom))!important;
}


/* v2.54: keep reference thumbnails and parameter chips inside the composer in WeChat/Mini Program keyboard mode.
   v2.53 stabilised the keyboard position, but the extra reference thumbnail row can make the chip row overflow the panel. */
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref form{
    max-height:154px!important;
    padding:8px 10px 8px!important;
    overflow:hidden!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-preview:not(:empty){
    max-height:34px!important;
    min-height:32px!important;
    height:32px!important;
    padding:0 2px 2px!important;
    margin:0 0 4px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-chip{
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    min-height:32px!important;
    padding:3px!important;
    border-radius:11px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-chip img{
    width:26px!important;
    height:26px!important;
    border-radius:8px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-remove{
    top:-3px!important;
    right:-3px!important;
    width:17px!important;
    height:17px!important;
    line-height:17px!important;
    font-size:12px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-wrap{
    min-height:34px!important;
    height:34px!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-composer textarea,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref textarea{
    min-height:34px!important;
    height:34px!important;
    max-height:38px!important;
    padding-top:4px!important;
    padding-bottom:3px!important;
    line-height:1.28!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-controls-row{
    min-height:34px!important;
    height:34px!important;
    padding-top:5px!important;
    gap:6px!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-upload-btn span,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-secondary,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-controls-row select{
    height:32px!important;
    font-size:12px!important;
    padding-left:8px!important;
    padding-right:8px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-primary{
    top:0!important;
    right:1px!important;
    width:43px!important;
    height:43px!important;
}


/* v2.55: WeChat/Mini Program composer text area height restore.
   v2.54 kept the reference thumbnail row inside the composer, but compressed the textarea too much.
   Keep the chips contained while allowing the prompt to show more lines. */
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref form{
    max-height:190px!important;
    padding:9px 10px 9px!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-ref-preview:not(:empty){
    margin:0 0 5px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-wrap{
    min-height:62px!important;
    height:auto!important;
    overflow:visible!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-composer textarea,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref textarea{
    min-height:58px!important;
    height:58px!important;
    max-height:76px!important;
    padding-top:7px!important;
    padding-bottom:7px!important;
    line-height:1.34!important;
    overflow-y:auto!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-controls-row{
    height:36px!important;
    min-height:36px!important;
    padding-top:7px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-upload-btn span,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-secondary,
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-controls-row select{
    height:34px!important;
    font-size:12.5px!important;
}
body.wp-weixin-webview.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-primary{
    top:7px!important;
}


/* v2.62 input composer structural stabilisation.
   Keep current features, but stop relying on an absolutely-positioned paper-plane over the native textarea.
   In iOS WeChat/Mini Program WebView the textarea can own hit-testing while the keyboard is open, so the send
   button is now a real sibling at the right side of the input row. */
.wp-prompt-line{
    position:relative;
    display:flex;
    align-items:flex-start;
    gap:8px;
    min-height:44px;
    width:100%;
}
.wp-prompt-line .wp-prompt-wrap{
    flex:1 1 auto;
    min-width:0;
    width:auto;
    min-height:44px;
}
.wp-prompt-line .wp-prompt-wrap textarea,
.wp-composer .wp-prompt-line textarea{
    padding-right:8px!important;
    box-sizing:border-box!important;
}
.wp-prompt-line .wp-primary,
.wp-prompt-line #submitBtn{
    position:relative!important;
    right:auto!important;
    top:auto!important;
    left:auto!important;
    bottom:auto!important;
    flex:0 0 44px!important;
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    margin:0!important;
    align-self:flex-start!important;
    z-index:8!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent;
    transform:none!important;
    -webkit-transform:none!important;
}
.wp-prompt-line #submitBtn:after{
    content:"";
    position:absolute;
    inset:-8px;
    border-radius:22px;
}
body.wp-ios-browser.wp-keyboard-active .wp-prompt-line{
    min-height:44px!important;
    gap:8px!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-prompt-line .wp-prompt-wrap{
    min-height:44px!important;
    height:auto!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-prompt-line #submitBtn,
body.wp-ios-browser.wp-keyboard-active .wp-prompt-line .wp-primary{
    position:relative!important;
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    flex-basis:44px!important;
    right:auto!important;
    top:auto!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-line .wp-prompt-wrap{
    min-height:58px!important;
}
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-line #submitBtn,
body.wp-ios-browser.wp-keyboard-active .wp-composer.wp-composer-has-ref .wp-prompt-line .wp-primary{
    margin-top:0!important;
}
/* Remove any ineffective transparent hit-zone from previous send-button experiments when this patch is installed over v2.60/v2.61. */
.wp-send-hotzone{display:none!important;pointer-events:none!important;}


/* v2.70: keep the running-state pause icon visually centered after the v2.62 sibling send-button layout. */
.wp-prompt-line #submitBtn.wp-submit-paused:before,
.wp-prompt-line .wp-primary.wp-submit-paused:before{
    content:""!important;
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    width:26px!important;
    height:26px!important;
    margin:0!important;
    display:block!important;
    border:1px solid rgba(255,255,255,.22)!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.10)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 0 14px rgba(255,255,255,.16)!important;
    transform:translate(-50%,-50%)!important;
    z-index:1!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused:after,
.wp-prompt-line .wp-primary.wp-submit-paused:after{
    content:""!important;
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    right:auto!important;
    bottom:auto!important;
    inset:auto!important;
    width:4px!important;
    height:17px!important;
    border-radius:999px!important;
    background:#fff!important;
    box-shadow:0 0 12px rgba(255,255,255,.22)!important;
    transform:translate(-5px,-50%)!important;
    z-index:2!important;
    pointer-events:none!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused .wp-pause-bar,
.wp-prompt-line .wp-primary.wp-submit-paused .wp-pause-bar{
    display:none!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused{
    background-image:linear-gradient(135deg,#22d3ee,#2563eb 58%,#7c3aed)!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused{
    --wp-pause-second-bar:1;
}
.wp-prompt-line #submitBtn.wp-submit-paused > span{
    display:none!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused:after{
    box-shadow:10px 0 0 #fff,0 0 12px rgba(255,255,255,.22)!important;
}


/* v2.71: replace paused pseudo-elements with real centered icon bars. */
.wp-prompt-line #submitBtn:before,
.wp-prompt-line #submitBtn:after{
    content:none!important;
    display:none!important;
}
.wp-prompt-line #submitBtn .wp-submit-label{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}
.wp-prompt-line #submitBtn .wp-submit-icon{
    position:absolute!important;
    inset:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    pointer-events:none!important;
    z-index:3!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused > .wp-submit-icon,
.wp-prompt-line #submitBtn.wp-submit-busy > .wp-submit-icon,
.wp-prompt-line #submitBtn > .wp-submit-icon{
    display:flex!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused > .wp-submit-label,
.wp-prompt-line #submitBtn.wp-submit-busy > .wp-submit-label,
.wp-prompt-line #submitBtn > .wp-submit-label{
    display:block!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused:before,
.wp-prompt-line #submitBtn.wp-submit-paused:after{
    content:none!important;
    display:none!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused .wp-submit-icon-pause{
    gap:6px!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused .wp-submit-icon-pause:before{
    content:""!important;
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    width:26px!important;
    height:26px!important;
    border:1px solid rgba(255,255,255,.22)!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.10)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 0 14px rgba(255,255,255,.16)!important;
    transform:translate(-50%,-50%)!important;
    z-index:-1!important;
}
.wp-prompt-line #submitBtn.wp-submit-paused .wp-submit-icon-pause i{
    display:block!important;
    width:5px!important;
    height:17px!important;
    border-radius:999px!important;
    background:#fff!important;
    box-shadow:0 0 10px rgba(255,255,255,.22)!important;
}
.wp-prompt-line #submitBtn.wp-submit-busy .wp-submit-icon-busy:before{
    content:"···"!important;
    display:block!important;
    color:#fff!important;
    font-size:22px!important;
    line-height:1!important;
    letter-spacing:1px!important;
    transform:translateY(-4px)!important;
}
.wp-prompt-line #submitBtn:not(.wp-submit-paused):not(.wp-submit-busy) .wp-submit-icon-send:before{
    content:"➤"!important;
    display:block!important;
    color:#fff!important;
    font-size:22px!important;
    line-height:1!important;
    transform:rotate(-38deg) translate(1px,-1px)!important;
    text-shadow:0 0 18px rgba(255,255,255,.38)!important;
}
