/* KIKIMORA account / Supabase auth */
.k-auth-gate{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:20px;background:radial-gradient(circle at 50% 18%,rgba(112,145,63,.16),transparent 34%),rgba(5,8,5,.92);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.k-auth-gate[hidden]{display:none!important}
.k-auth-card{width:min(430px,100%);max-height:min(720px,calc(100vh - 28px));overflow:auto;padding:28px;border-radius:26px;border:1px solid rgba(145,176,88,.24);background:linear-gradient(155deg,rgba(24,31,21,.98),rgba(9,13,9,.98));box-shadow:0 30px 90px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.025);color:#edf0e8}
.k-auth-brand{display:flex;align-items:center;gap:13px;margin-bottom:20px}.k-auth-brand img{width:44px;height:44px;border-radius:13px;object-fit:cover}.k-auth-brand strong{display:block;font-size:18px;letter-spacing:.06em}.k-auth-brand span{display:block;margin-top:3px;color:#8d9a82;font-size:12px}
.k-auth-title{margin:0 0 7px;font-size:27px;line-height:1.08}.k-auth-sub{margin:0 0 21px;color:#9aa490;font-size:14px;line-height:1.45}
.k-auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:5px;margin-bottom:17px;border-radius:14px;background:#11170f;border:1px solid rgba(137,164,87,.13)}
.k-auth-tab{border:0;border-radius:10px;padding:10px 12px;background:transparent;color:#788271;font:inherit;font-weight:700;cursor:pointer}.k-auth-tab.active{background:#25301f;color:#d7e8bd;box-shadow:inset 0 0 0 1px rgba(150,184,92,.22)}
.k-auth-form{display:grid;gap:12px}.k-auth-field{display:grid;gap:7px}.k-auth-field label{font-size:12px;font-weight:700;color:#9ca891}
.k-auth-field input{width:100%;height:47px;padding:0 14px;border-radius:13px;border:1px solid rgba(130,157,82,.19);outline:none;background:#0c110b;color:#eef1e9;font:inherit;transition:border-color .16s,box-shadow .16s}.k-auth-field input:focus{border-color:rgba(154,194,91,.62);box-shadow:0 0 0 3px rgba(130,170,78,.12)}
.k-auth-primary{height:48px;margin-top:3px;border:0;border-radius:14px;cursor:pointer;background:linear-gradient(135deg,#789d49,#9aba63);color:#0b1009;font:inherit;font-weight:800}.k-auth-primary:disabled{opacity:.55;cursor:wait}
.k-auth-link{border:0;background:none;color:#9fb779;padding:3px 0;font:inherit;font-size:13px;cursor:pointer;text-align:left}.k-auth-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.k-auth-message{min-height:19px;margin-top:10px;font-size:13px;line-height:1.4;color:#9fb779}.k-auth-message.error{color:#e59787}.k-auth-message.success{color:#a9ca7d}
.k-auth-security{margin-top:19px;padding-top:15px;border-top:1px solid rgba(130,157,82,.13);font-size:11px;color:#677261;line-height:1.45}
.k-account-wrap{position:relative;margin-left:auto;display:flex;align-items:center}.k-account-button{width:40px;height:40px;border-radius:13px;border:1px solid rgba(126,156,78,.24);background:rgba(24,29,22,.9);color:#c8d8af;font:inherit;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center}.k-account-button:hover{background:rgba(51,65,39,.9)}
.k-account-menu{position:absolute;right:0;top:48px;width:245px;padding:10px;z-index:10000;border-radius:16px;border:1px solid rgba(129,157,80,.22);background:rgba(13,18,12,.98);box-shadow:0 20px 55px rgba(0,0,0,.45)}.k-account-menu[hidden]{display:none!important}
.k-account-email{padding:9px 10px 11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d8ded2;font-size:13px}.k-account-status{padding:0 10px 10px;color:#77836f;font-size:11px}.k-account-action{width:100%;border:0;border-radius:10px;padding:10px;text-align:left;background:transparent;color:#aeb9a5;font:inherit;cursor:pointer}.k-account-action:hover{background:#20291d;color:#e4ecd9}

.k-memory-panel{position:fixed;inset:0;z-index:10020;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(4,7,4,.72);backdrop-filter:blur(10px)}.k-memory-panel[hidden]{display:none!important}
.k-memory-card{width:min(620px,100%);max-height:min(720px,86vh);display:flex;flex-direction:column;gap:14px;padding:20px;border-radius:22px;border:1px solid rgba(129,157,80,.24);background:rgba(12,17,11,.99);box-shadow:0 30px 90px rgba(0,0,0,.58)}
.k-memory-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.k-memory-head strong{display:block;color:#e2ead7;font-size:20px}.k-memory-head span{display:block;margin-top:3px;color:#77836f;font-size:12px}.k-memory-close{width:34px;height:34px;border:0;border-radius:10px;background:#1b2418;color:#b9c6ad;font-size:24px;line-height:1;cursor:pointer}.k-memory-close:hover{background:#263321;color:#eef5e8}
.k-memory-add{display:flex;gap:9px}.k-memory-input{flex:1;min-width:0;height:44px;border-radius:12px;border:1px solid rgba(128,157,82,.22);background:#111710;color:#dfe8d6;padding:0 13px;font:inherit;outline:none}.k-memory-input:focus{border-color:rgba(157,192,96,.55);box-shadow:0 0 0 3px rgba(127,158,78,.09)}.k-memory-save{height:44px;border:0;border-radius:12px;padding:0 16px;background:#6f8c46;color:#f5f8f1;font:inherit;font-weight:800;cursor:pointer}.k-memory-save:disabled{opacity:.55;cursor:wait}
.k-memory-status{min-height:18px;color:#87937e;font-size:12px}.k-memory-list{overflow:auto;display:grid;gap:8px;padding-right:3px}.k-memory-row{display:flex;gap:12px;align-items:center;padding:12px;border-radius:14px;border:1px solid rgba(126,156,78,.14);background:#111710}.k-memory-body{min-width:0;flex:1}.k-memory-text{color:#d8e1cf;font-size:13px;line-height:1.45;overflow-wrap:anywhere}.k-memory-meta{margin-top:4px;color:#65705f;font-size:10px;text-transform:uppercase;letter-spacing:.04em}.k-memory-delete{border:0;border-radius:9px;padding:8px 10px;background:transparent;color:#b98f84;font:inherit;font-size:12px;cursor:pointer}.k-memory-delete:hover{background:rgba(146,74,58,.14);color:#e0a091}.k-memory-delete:disabled{opacity:.5}
.k-memory-foot{display:flex;justify-content:flex-end;padding-top:3px}.k-memory-clear{border:0;background:transparent;color:#8f6f68;font:inherit;font-size:12px;cursor:pointer}.k-memory-clear:hover{color:#cf8f80}
.k-memory-section-label{padding:8px 2px 2px;color:#718064;font-size:10px;font-weight:800;letter-spacing:.11em}.k-memory-chat-row{align-items:flex-start}.k-memory-chat-summary{margin-top:5px;color:#879280;font-size:12px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
@media(max-width:600px){.k-memory-panel{padding:12px;align-items:flex-end}.k-memory-card{max-height:82vh;border-radius:22px 22px 16px 16px;padding:17px}.k-memory-add{flex-direction:column}.k-memory-save{width:100%}}
.k-auth-reset-only{display:none}.k-auth-card[data-mode="reset"] .k-auth-tabs,.k-auth-card[data-mode="reset"] .k-auth-normal-only{display:none}.k-auth-card[data-mode="reset"] .k-auth-reset-only{display:grid}
@media(max-width:600px){.k-auth-gate{padding:12px;align-items:flex-end}.k-auth-card{width:100%;border-radius:24px 24px 18px 18px;padding:23px 18px 20px}}
.k-auth-divider{position:relative;display:flex;align-items:center;justify-content:center;margin:3px 0;color:#66705f;font-size:11px}
.k-auth-divider:before,.k-auth-divider:after{content:"";height:1px;flex:1;background:rgba(130,157,82,.13)}
.k-auth-divider span{padding:0 10px}
.k-auth-secondary{height:46px;border-radius:14px;border:1px solid rgba(130,157,82,.22);background:#151c13;color:#c7d5b7;font:inherit;font-weight:750;cursor:pointer}
.k-auth-secondary:hover{background:#20291d;border-color:rgba(154,188,96,.36)}
.k-auth-otp-only{display:none}
.k-auth-card[data-mode="otp"] .k-auth-normal-only,
.k-auth-card[data-mode="otp"] .k-auth-reset-only{display:none}
.k-auth-card[data-mode="otp"] .k-auth-otp-only{display:grid}
#kOtpVerifyBox{display:grid;gap:12px}
#kOtpVerifyBox[hidden]{display:none!important}
#kOtpCode{font-size:22px;letter-spacing:.32em;text-align:center;font-weight:800}


#kNameField[hidden]{display:none!important}
.k-auth-code-main{margin-bottom:2px}

.k-auth-google{width:100%;height:48px;margin:0 0 10px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:#f4f4f2;color:#171a16;font:inherit;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px}
.k-auth-google:hover{background:#fff}
.k-auth-google:disabled{opacity:.6;cursor:wait}
.k-auth-google[hidden]{display:none!important}
.k-auth-google-g{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid rgba(0,0,0,.08);font-family:Arial,sans-serif;font-weight:900;color:#4285f4;font-size:16px;line-height:1}


.k-account-menu-divider{height:1px;margin:6px 4px;background:rgba(129,157,80,.13)}
.k-account-logout{color:#ff6f6f!important;font-weight:800}
.k-account-logout:hover{background:rgba(177,54,54,.16)!important;color:#ff9a9a!important}
.k-account-panel{position:fixed;inset:0;z-index:10030;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(4,7,4,.76);backdrop-filter:blur(11px)}
.k-account-panel[hidden]{display:none!important}
.k-account-card{width:min(720px,100%);max-height:min(820px,90vh);overflow:auto;padding:22px;border-radius:24px;border:1px solid rgba(129,157,80,.24);background:rgba(12,17,11,.99);box-shadow:0 30px 90px rgba(0,0,0,.6)}
.k-account-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.k-account-panel-head strong{display:block;color:#e7edde;font-size:22px}
.k-account-panel-head span{display:block;margin-top:4px;color:#77836f;font-size:12px}
.k-account-panel-close{width:36px;height:36px;border:0;border-radius:11px;background:#1b2418;color:#b9c6ad;font-size:25px;line-height:1;cursor:pointer}
.k-account-panel-close:hover{background:#263321;color:#eef5e8}
.k-account-identity{display:flex;align-items:center;gap:12px;margin-top:18px;padding:14px;border-radius:16px;border:1px solid rgba(126,156,78,.14);background:#111710}
.k-account-avatar{width:42px;height:42px;border-radius:13px;display:flex;align-items:center;justify-content:center;background:#1f2a1b;color:#b9d18e;font-weight:900}
.k-account-identity strong{display:block;color:#e2ead7;font-size:14px;overflow-wrap:anywhere}
.k-account-identity span{display:block;margin-top:4px;color:#7e8b75;font-size:11px}
.k-account-summary-grid,.k-account-usage-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}
.k-account-summary,.k-account-usage{min-width:0;padding:14px;border-radius:15px;border:1px solid rgba(126,156,78,.13);background:#0f150e}
.k-account-summary>span,.k-account-usage>span{display:block;color:#74806d;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.k-account-summary>strong,.k-account-usage>strong{display:block;margin-top:7px;color:#e0e8d7;font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.k-account-summary>small,.k-account-usage>small{display:block;min-height:15px;margin-top:5px;color:#687361;font-size:10px;line-height:1.4}
.k-account-section-title{margin:20px 2px 2px;color:#87977a;font-size:11px;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.k-account-danger{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:20px;padding:15px;border-radius:16px;border:1px solid rgba(190,69,69,.28);background:rgba(91,24,24,.12)}
.k-account-danger strong{display:block;color:#f0c4c4;font-size:13px}
.k-account-danger span{display:block;max-width:430px;margin-top:4px;color:#987777;font-size:11px;line-height:1.45}
.k-account-delete{flex:0 0 auto;border:1px solid rgba(229,91,91,.38);border-radius:11px;padding:10px 13px;background:rgba(165,48,48,.18);color:#ff8383;font:inherit;font-size:12px;font-weight:850;cursor:pointer}
.k-account-delete:hover:not(:disabled){background:rgba(182,55,55,.29);color:#ffaaaa}
.k-account-delete:disabled{opacity:.48;cursor:not-allowed}
.k-account-panel-status{min-height:18px;margin-top:10px;color:#c28176;font-size:12px}
@media(max-width:700px){
 .k-account-panel{padding:12px;align-items:flex-end}
 .k-account-card{max-height:88vh;border-radius:24px 24px 16px 16px;padding:18px}
 .k-account-summary-grid,.k-account-usage-grid{grid-template-columns:1fr 1fr}
 .k-account-danger{align-items:stretch;flex-direction:column}
 .k-account-delete{width:100%}
}
@media(max-width:430px){
 .k-account-summary-grid,.k-account-usage-grid{grid-template-columns:1fr}
}
